@starasia/admin 8.4.1 → 8.4.3
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/TableLayout/TableLayout.d.ts +1 -1
- package/dist/components/TableLayout/types.d.ts +19 -2
- package/dist/index.cjs.js +2 -2
- package/dist/index.es.js +2821 -2758
- package/dist/index.umd.js +2 -2
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(g,$e){typeof exports=="object"&&typeof module<"u"?$e(exports,require("@starasia/alert"),require("@starasia/badges"),require("@starasia/box"),require("@starasia/breadcrumb"),require("@starasia/button"),require("@starasia/card"),require("@starasia/date"),require("@starasia/dialog"),require("@starasia/drawer"),require("@starasia/dropdown"),require("@starasia/hooks"),require("@starasia/http"),require("@starasia/input"),require("@starasia/menu"),require("@starasia/pagination"),require("@starasia/storage"),require("@starasia/table"),require("@starasia/tabs"),require("@starasia/textarea"),require("@starasia/theme"),require("@starasia/toast"),require("@starasia/toggle"),require("@starasia/tooltip"),require("@starasia/checkbox"),require("@starasia/radio"),require("@starasia/text"),require("@starasia/icon"),require("@starasia/flex"),require("@starasia/grid"),require("@starasia/progress"),require("@starasia/stepper"),require("@starasia/accordion"),require("@starasia/story-record"),require("@starasia/skeleton"),require("@starasia/progress-stepper"),require("react/jsx-runtime"),require("react"),require("react-router"),require("react-dom"),require("react-easy-crop")):typeof define=="function"&&define.amd?define(["exports","@starasia/alert","@starasia/badges","@starasia/box","@starasia/breadcrumb","@starasia/button","@starasia/card","@starasia/date","@starasia/dialog","@starasia/drawer","@starasia/dropdown","@starasia/hooks","@starasia/http","@starasia/input","@starasia/menu","@starasia/pagination","@starasia/storage","@starasia/table","@starasia/tabs","@starasia/textarea","@starasia/theme","@starasia/toast","@starasia/toggle","@starasia/tooltip","@starasia/checkbox","@starasia/radio","@starasia/text","@starasia/icon","@starasia/flex","@starasia/grid","@starasia/progress","@starasia/stepper","@starasia/accordion","@starasia/story-record","@starasia/skeleton","@starasia/progress-stepper","react/jsx-runtime","react","react-router","react-dom","react-easy-crop"],$e):(g=typeof globalThis<"u"?globalThis:g||self,$e(g["@starasia/admin"]={},g.alert,g.badges,g.box,g.breadcrumb,g.button,g.card,g.date,g.dialog,g.drawer,g.dropdown,g.hooks,g.http,g.input,g.menu,g.pagination,g.storage,g.table,g.tabs,g.textarea,g.theme,g.toast,g.toggle,g.tooltip,g.checkbox,g.radio,g.text,g.icon,g.flex,g.grid,g.progress,g.stepper,g.accordion,g.storyRecord,g.skeleton,g.progressStepper,g.jsxRuntime,g.React,g.ReactRouter,g.ReactDOM,g.ReactEasyCrop))})(this,function(g,$e,Ze,y,Re,H,ft,Je,Le,ur,er,ue,rr,Ge,I,sr,ar,Y,gt,Ar,tr,ut,lr,xe,or,Vr,k,F,ne,yt,pt,Ct,bt,vt,Ye,xt,e,h,ye,Hr,El){"use strict";const Ml={menus:[],menuBottom:void 0,logo:"",appName:"Workspace",userData:null,setUserData:()=>{}},Pr=h.createContext(Ml),jr=()=>h.useContext(Pr),wt=r=>{const[t,l]=h.useState((r==null?void 0:r.initialUserData)||null);return{userData:t,setUserData:l}},Dt=h.createContext({badges:{},setBadge:()=>{},setBadges:()=>{},clearBadge:()=>{}}),St=({children:r})=>{const[t,l]=h.useState({}),n=h.useCallback(i=>{l(a=>typeof i=="function"?i(a):i)},[]),o=h.useCallback((i,a)=>{l(d=>{const u=typeof a=="function"?a(d[i]):a;return{...d,[i]:u}})},[]),c=h.useCallback(i=>{l(a=>{if(!(i in a))return a;const d={...a};return delete d[i],d})},[]),s=h.useMemo(()=>({badges:t,setBadge:o,setBadges:n,clearBadge:c}),[t,o,n,c]);return e.jsx(Dt.Provider,{value:s,children:r})},kt=()=>h.useContext(Dt),yr=(r,t)=>{const l=t!==void 0?t:r;return l==null?null:typeof l=="string"||typeof l=="number"?{value:l}:l},Bt=({router:r,menus:t=[],menuBottom:l,logo:n,appName:o="Workspace",initialUserData:c,theme:s})=>{const i=wt({initialUserData:c}),{theme:a}=tr.useTheme();return e.jsx(Pr.Provider,{value:{logo:n,appName:o,menus:t,userData:i.userData,setUserData:i.setUserData,menuBottom:l},children:e.jsx(St,{children:s?e.jsx(tr.ThemeProvider,{value:s,children:r}):a?e.jsx(tr.ThemeProvider,{value:a,children:r}):r})})},Ll=h.memo(Bt);function mt({collapsed:r=!1,children:t}){if(!t)return null;const l=typeof t=="function",n=l?t({collapsed:r}):t;return n==null||n===!1?null:e.jsx("div",{style:{position:"sticky",top:"4rem",zIndex:1,borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",paddingLeft:"0.5rem",paddingRight:"0.5rem",paddingTop:"0.5rem",paddingBottom:"0.5rem",boxSizing:"border-box"},children:l?n:e.jsx("div",{style:{opacity:r?0:1,transition:"opacity 0.3s",visibility:r?"hidden":"visible"},children:n})})}const Nr=h.createContext(null);function Ft({children:r}){const[t,l]=h.useState(null),[n,o]=h.useState(null),[c,s]=h.useState(null),[i,a]=h.useState(0),d=h.useCallback(()=>(a(u=>u+1),()=>a(u=>u-1)),[]);return e.jsx(Nr.Provider,{value:{prependNode:t,appendNode:n,replaceNode:c,setPrependNode:l,setAppendNode:o,setReplaceNode:s,replaceCount:i,registerReplace:d},children:r})}function Et({children:r}){const t=h.useContext(Nr);return t?e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:t.setPrependNode,style:{display:"contents"}}),t.replaceCount>0?e.jsx("div",{ref:t.setReplaceNode,style:{display:"contents"}}):r,e.jsx("div",{ref:t.setAppendNode,style:{display:"contents"}})]}):e.jsx(e.Fragment,{children:r})}function Il({children:r,mode:t="append"}){const l=h.useContext(Nr);if(h.useEffect(()=>{if(!(t!=="replace"||!l))return l.registerReplace()},[t,l]),!l)return process.env.NODE_ENV!=="production"&&console.warn("[HeaderLeftSlot] used outside AppLayout — content not rendered"),null;const n=t==="prepend"?l.prependNode:t==="replace"?l.replaceNode:l.appendNode;return n?Hr.createPortal(r,n):null}const _r=h.createContext(null);function Mt({children:r}){const[t,l]=h.useState({}),[n,o]=h.useState({}),c=h.useCallback((a,d)=>{l(u=>u[a]===d?u:{...u,[a]:d})},[]),s=h.useCallback(a=>(o(d=>({...d,[a]:(d[a]??0)+1})),()=>o(d=>({...d,[a]:Math.max(0,(d[a]??0)-1)}))),[]),i=h.useMemo(()=>({outletNodes:t,setOutletNode:c,slotCounts:n,registerSlot:s}),[t,c,n,s]);return e.jsx(_r.Provider,{value:i,children:r})}function Lt({slotKey:r,fallback:t}){const l=h.useContext(_r),n=l?(l.slotCounts[r]??0)>0:!1,o=h.useRef(l==null?void 0:l.setOutletNode);o.current=l==null?void 0:l.setOutletNode;const c=h.useCallback(s=>{var i;return(i=o.current)==null?void 0:i.call(o,r,s)},[r]);return e.jsx(e.Fragment,{children:n?e.jsx("div",{ref:c,style:{display:"contents"}}):t})}function Tl({slotKey:r,children:t}){const l=h.useContext(_r),n=h.useRef(l==null?void 0:l.registerSlot);if(n.current=l==null?void 0:l.registerSlot,h.useEffect(()=>{var c;return(c=n.current)==null?void 0:c.call(n,r)},[r]),!l)return process.env.NODE_ENV!=="production"&&console.warn("[SidebarGroupSlot] used outside AppLayout — content not rendered"),null;const o=l.outletNodes[r];return o?Hr.createPortal(t,o):null}const pr="moduleSwitcherGroupId",qr="sa-module-switcher-change";function It(){if(typeof window>"u")return null;const r=window.localStorage.getItem(pr);if(r===null)return null;const t=Number(r);return Number.isFinite(t)?t:null}function Tt(r){typeof window>"u"||(r===null?window.localStorage.removeItem(pr):window.localStorage.setItem(pr,String(r)),window.dispatchEvent(new CustomEvent(qr,{detail:r})))}function Ol(){Tt(null)}function Zr(){const[r,t]=h.useState(()=>It());return h.useEffect(()=>{const n=()=>{t(It())},o=c=>{c.key===pr&&n()};return window.addEventListener(qr,n),window.addEventListener("storage",o),()=>{window.removeEventListener(qr,n),window.removeEventListener("storage",o)}},[]),{selectedGroupId:r,setSelectedGroupId:n=>{Tt(n),t(n)}}}let Cr=0,Xe=!1,Ot=new Set;const Wt=()=>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"})]}),zt={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 Wl({children:r,headerLeftSlot:t,profile:l,isLoadingProfile:n,onLogout:o,isLoggingOut:c,loadingComponent:s,sidebarHeaderContent:i,headerActions:a,profileRole:d,profileMenuButtons:u,profileMenuItems:p,logoutButton:C}){var Qe,cr;const[v]=ye.useSearchParams(),T=v.get("embed")==="true",b=jr(),{badges:B}=kt(),E=ye.useNavigate(),S=ye.useLocation(),w=!ue.useMediaQuery("md"),[z,W]=h.useState(!1),[D,O]=h.useState(!1),[q,U]=h.useState(!1),[G,$]=h.useState(!1),[te,he]=h.useState(()=>new Set(Ot)),[ie,se]=h.useState(null),{selectedGroupId:ee,setSelectedGroupId:P}=Zr();h.useEffect(()=>{Ot=te},[te]);const le=h.useRef(null),pe=h.useRef(null);h.useEffect(()=>{const m=le.current;if(!m)return;const _=()=>{Xe||(Cr=m.scrollTop)};return m.addEventListener("scroll",_),()=>m.removeEventListener("scroll",_)},[]);const fe=()=>{const m=le.current;m&&Cr>0&&(Xe=!0,m.scrollTop=Cr,requestAnimationFrame(()=>{Xe=!1}))};h.useLayoutEffect(()=>{Xe=!0,fe();const m=setTimeout(()=>{Xe=!1},300);return()=>clearTimeout(m)},[]),h.useLayoutEffect(()=>{b.menus.length>0&&(Cr>0?fe():requestAnimationFrame(()=>{var _;const m=(_=le.current)==null?void 0:_.querySelector("[data-menu-active='true']");m&&m.scrollIntoView({block:"center",behavior:"instant"})}))},[b.menus]),h.useEffect(()=>{Xe=!0,fe();const m=setTimeout(fe,0),_=setTimeout(fe,50),j=setTimeout(fe,100),M=setTimeout(fe,200),Q=setTimeout(()=>{Xe=!1},300),N=setTimeout(()=>{const Z=le.current,X=Z==null?void 0:Z.querySelector("[data-menu-active='true']");if(Z&&X){const Ce=Z.getBoundingClientRect(),ke=X.getBoundingClientRect();ke.top>=Ce.top&&ke.bottom<=Ce.bottom||X.scrollIntoView({block:"center",behavior:"smooth"})}},250);return()=>{clearTimeout(m),clearTimeout(_),clearTimeout(j),clearTimeout(M),clearTimeout(Q),clearTimeout(N)}},[S.pathname]),h.useEffect(()=>{pe.current&&(pe.current.scrollTop=0)},[S.pathname]),h.useEffect(()=>{w&&U(!1)},[S.pathname,w]),h.useEffect(()=>{w&&O(!0)},[w]);const ge=()=>{W(!0)},me=()=>{W(!1)},We=()=>{W(!1),o()},Pe=m=>{const _=[m.to];return m.children&&_.push(...m.children.map(j=>j.to)),_},je=[...b.menus.flatMap(m=>m.items.flatMap(Pe)),...((Qe=b.menuBottom)==null?void 0:Qe.flatMap(Pe))??[]],we=m=>{if(!S.pathname.startsWith(m))return!1;const _=je.filter(j=>S.pathname.startsWith(j)).sort((j,M)=>M.length-j.length)[0];return m===_};h.useEffect(()=>{var _;const m=j=>{var M;(M=j.children)!=null&&M.some(Q=>S.pathname.startsWith(Q.to))&&he(Q=>{const N=new Set(Q);return N.add(j.id),N})};b.menus.forEach(j=>{j.items.forEach(m)}),(_=b.menuBottom)==null||_.forEach(m)},[S.pathname,b.menus,b.menuBottom]);const De=m=>{he(_=>{const j=new Set(_);return j.has(m)?j.delete(m):j.add(m),j})};h.useEffect(()=>{b.menus.length!==0&&ee!==null&&!b.menus.some(m=>m.id===ee)&&P(null)},[b.menus,ee,P]);const Ee=h.useMemo(()=>{if(ee!==null)return b.menus.filter(j=>j.id===ee||j.parentGroupId===ee);const m=b.menus.filter(j=>j.parentGroupId===void 0),_=b.menus.filter(j=>j.parentGroupId!==void 0).flatMap(j=>j.items);return _.length===0?m:[...m,{id:18,name:"Pengaturan",items:_,parentGroupId:void 0}]},[b.menus,ee]);if(T)return e.jsx("main",{style:{height:"100vh",overflowY:"auto",backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)"},children:r||e.jsx(ye.Outlet,{})});const ze=m=>{const _=m.children&&m.children.length>0,j=te.has(m.id),M=_?m.children.some(Z=>we(Z.to)):we(m.to),Q=yr(m.badge,B[m.id]),N=!!Q&&D&&!w;return e.jsxs("div",{"data-menu-active":M||void 0,children:[e.jsxs("button",{onClick:Z=>{if(_)if(D&&!w){const X=Z.currentTarget.getBoundingClientRect();se({item:m,top:X.top,left:X.right+8})}else De(m.id);else E(m.to)},style:{width:"100%",display:"flex",alignItems:"center",justifyContent:D&&!w?"center":void 0,gap:"0.5rem",paddingLeft:D&&!w?"0":"0.5rem",paddingRight:D&&!w?"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:D&&!w?m.title:void 0,onMouseEnter:Z=>{M||(Z.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:Z=>{M||(Z.currentTarget.style.backgroundColor="transparent")},children:[e.jsxs("span",{style:{position:"relative",display:"inline-flex",flexShrink:0},children:[e.jsx(F.Icon,{name:m.icon,size:"sm",style:{flexShrink:0}}),N&&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)"}})]}),(!D||w)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{fontSize:"0.875rem",fontWeight:"500",whiteSpace:"nowrap",transition:"opacity 0.3s",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:m.title}),Q&&e.jsx(Ze.Badges,{text:String(Q.value),variant:Q.variant??"info",size:"xs",border:!0}),_&&e.jsx("svg",{style:{width:"1rem",height:"1rem",flexShrink:0,transition:"transform 0.2s",transform:j?"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"})})]})]}),_&&(!D||w)&&(()=>{const Z=m.children.findIndex(X=>we(X.to));return e.jsxs("div",{style:{position:"relative",marginLeft:"0.9375rem",paddingLeft:"1.125rem",overflow:"hidden",transition:"all 0.3s ease-in-out",maxHeight:j?`${m.children.length*36}px`:"0px",opacity:j?1:0,marginTop:j?"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"}}),Z>=0&&e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:`${Z*32}px`,width:"1.5px",height:"32px",backgroundColor:"var(--sa-text-primary, #292a2e)",transition:"top 0.2s ease-in-out",pointerEvents:"none",zIndex:1}}),m.children.map(X=>{const Ce=yr(X.badge,B[X.id]);return e.jsxs("button",{onClick:()=>E(X.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:we(X.to)?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",backgroundColor:we(X.to)?"var(--sa-background-primary, #ffffff)":"transparent",color:we(X.to)?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",cursor:"pointer",border:we(X.to)?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent"},onMouseEnter:ke=>{we(X.to)||(ke.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:ke=>{we(X.to)||(ke.currentTarget.style.backgroundColor="transparent")},children:[e.jsx(F.Icon,{name:X.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:X.title}),Ce&&e.jsx(Ze.Badges,{text:String(Ce.value),variant:Ce.variant??"info",size:"xs",border:!0})]},X.id)})]})})()]},m.id)};return e.jsx(Mt,{children:e.jsxs(Ft,{children:[e.jsxs("div",{style:{display:"flex",height:"100vh",position:"relative","--app-sidebar-width":w?"0px":D?"4.375rem":"16.375rem","--app-footer-zindex":w&&q?"40":"999"},children:[w&&e.jsx("div",{style:{position:"fixed",inset:0,backgroundColor:"var(--sa-color-black-alpha-a50, #181a198f)",zIndex:40,opacity:q?.5:0,pointerEvents:q?"auto":"none",transition:"opacity 0.3s"},onClick:()=>U(!1)}),e.jsxs("aside",{style:{width:w?"16.375rem":D?"4.375rem":"16.375rem",position:w?"fixed":"relative",...w&&{inset:0,zIndex:50,transform:q?"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:w?void 0:0},children:[e.jsx("div",{onMouseEnter:()=>$(!0),onMouseLeave:()=>$(!1),style:{height:"4rem",display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"1rem",paddingRight:"1rem",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",position:"relative"},children:(()=>{const m=!w&&D&&!q,_=m&&G;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",flex:m?1:void 0,justifyContent:m?"center":void 0,transition:"opacity 0.2s",opacity:_?0:1,pointerEvents:_?"none":"auto"},children:[e.jsx("img",{src:b.logo,alt:"Logo",style:{width:"2rem",height:"2rem",flexShrink:0}}),(!D||q)&&e.jsx("span",{style:{fontWeight:"600",color:"var(--sa-text-primary, #292a2e)",whiteSpace:"nowrap",transition:"opacity 0.3s"},children:b.appName})]}),!w&&!D&&e.jsx("button",{type:"button",onClick:()=>O(!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(Wt,{})}),m&&e.jsx("button",{type:"button",onClick:()=>O(!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:_?1:0,pointerEvents:_?"auto":"none",transition:"opacity 0.2s"},children:e.jsx("span",{style:{width:"1rem",height:"1rem",display:"inline-flex"},children:e.jsx(Wt,{})})}),w&&e.jsx("button",{onClick:()=>U(!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"})})})]})})()}),i&&e.jsx(mt,{collapsed:w?!1:D,children:i}),e.jsx("div",{ref:le,style:{flex:1,overflowY:"auto",paddingTop:"1rem",paddingBottom:"1rem"},children:Ee.map(m=>e.jsxs("div",{style:{marginBottom:"1rem"},children:[!D||w?m.name&&e.jsx("div",{style:{paddingLeft:"1.5rem",paddingRight:"1rem",paddingTop:"0rem",paddingBottom:"0.25rem",fontSize:"0.875rem",fontWeight:"400",color:"var(--sa-text-subtlest, #6b6e76)",transition:"opacity 0.3s",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:m.name}):m.name&&e.jsx("div",{"aria-label":m.name,style:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"0.75rem",paddingBottom:"0.75rem"},children:e.jsx("span",{style:{display:"block",width:"1rem",height:"2px",borderRadius:"1px",backgroundColor:m.color??"var(--sa-background-brand, #04254f)"}})}),e.jsx("div",{style:{paddingLeft:"1rem",paddingRight:"1rem",display:"flex",flexDirection:"column",gap:"var(--sa-spacing-xs, 0.25rem)"},children:m.slotKey?e.jsx(Lt,{slotKey:m.slotKey,fallback:m.items.map(_=>ze(_))}):m.items.map(_=>ze(_))})]},m.id))}),b.menuBottom&&b.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:b.menuBottom.map(m=>ze(m))})]}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[e.jsxs("header",{style:{height:"4rem",backgroundColor:"var(--sa-background-primary, #ffffff)",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"1rem",paddingRight:"1rem",flexShrink:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1rem"},children:[w&&e.jsx("button",{onClick:()=>U(!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(Et,{children:t})]}),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:n?"Loading...":(l==null?void 0:l.name)||"unknown"}),e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n?"":(l==null?void 0:l.email)||"unknown"})]}),e.jsx("div",{style:{width:"2.5rem",height:"2.5rem",borderRadius:"9999px",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--sa-background-primary, #ffffff)",fontWeight:600,fontSize:"0.875rem",boxShadow:"var(--sa-shadow-sm, 0 1px 2px 0 #0000000d)",flexShrink:0,backgroundColor:"var(--sa-background-brand, #04254f)"},children:((l==null?void 0:l.name)||"U")[0].toUpperCase()}),e.jsx(F.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:((l==null?void 0:l.name)||"U")[0].toUpperCase()}),e.jsx("p",{style:{margin:0,fontSize:"0.875rem",fontWeight:600,color:"var(--sa-text-primary, #292a2e)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(l==null?void 0:l.name)||"unknown"}),e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(l==null?void 0:l.email)||"unknown"}),d&&e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:d})]})}),(u&&u.length>0||p)&&e.jsxs(I.MenuBody,{children:[u==null?void 0:u.map((m,_)=>e.jsx(I.MenuButton,{children:e.jsxs("button",{type:"button",onClick:m.onClick,style:zt,onMouseEnter:j=>{j.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)"},onMouseLeave:j=>{j.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(F.Icon,{name:m.icon,size:"md"}),e.jsx("span",{children:m.label})]})},`${m.label}-${_}`)),p]}),C??e.jsx(I.MenuFooter,{children:e.jsx(I.MenuButton,{children:e.jsxs("button",{type:"button",onClick:ge,style:{...zt,color:"var(--sa-background-error, #c9184a)",fontWeight:500},onMouseEnter:m=>{m.currentTarget.style.backgroundColor="var(--sa-color-error-50, #fff0f3)"},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(F.Icon,{name:"Logout",size:"md",style:{color:"var(--sa-background-error, #c9184a)"}}),e.jsx("span",{children:"Logout"})]})})})]})]})]})]}),e.jsx("main",{ref:pe,style:{flex:1,overflowY:"auto"},children:r||e.jsx(ye.Outlet,{})})]})]}),c&&s&&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:s}),e.jsxs(Le.Dialog,{isShow:z,onHide:me,children:[e.jsx(Le.DialogTitle,{children:"Confirmation Logout"}),e.jsx(Le.DialogBody,{children:"Are you sure you want to end the session and exit the page?"}),e.jsx(Le.DialogFooter,{children:e.jsx(y.Box,{direction:"column",display:"flex",align:"flex-end",justify:"center",children:e.jsxs(ne.Flex,{direction:"row",gap:"sm",align:"center",children:[e.jsx(y.Box,{direction:"column",children:e.jsx(H.Button,{secondary:!0,onClick:me,children:"Cancel"})}),e.jsx(y.Box,{direction:"column",children:e.jsx(H.Button,{primary:!0,onClick:We,children:"Yes, Sure"})})]})})})]}),ie&&e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:()=>se(null),style:{position:"fixed",inset:0,zIndex:60,backgroundColor:"transparent"}}),e.jsxs("div",{role:"dialog","aria-label":ie.item.title,style:{position:"fixed",top:ie.top,left:ie.left,zIndex:61,minWidth:"13rem",maxWidth:"16rem",backgroundColor:"var(--sa-background-primary, #ffffff)",border:"1px solid var(--sa-border-subtle, #0b120e24)",borderRadius:"var(--sa-radii-md, 0.5rem)",boxShadow:"var(--sa-shadow-lg, 0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a)",padding:"0.5rem",display:"flex",flexDirection:"column",gap:"0.125rem"},children:[e.jsx("div",{style:{fontSize:"0.75rem",fontWeight:600,color:"var(--sa-color-gray-500, #8c8f97)",padding:"0.25rem 0.5rem 0.5rem",textTransform:"uppercase",letterSpacing:"0.05em"},children:ie.item.title}),(cr=ie.item.children)==null?void 0:cr.map(m=>{const _=we(m.to),j=yr(m.badge,B[m.id]);return e.jsxs("button",{onClick:()=>{E(m.to),se(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:_?"var(--sa-color-gray-100, #f8f8f8)":"transparent",color:_?"var(--sa-text-primary, #292a2e)":"var(--sa-color-gray-800, #505258)",border:"1px solid transparent",cursor:"pointer",fontSize:"0.875rem",fontWeight:500},onMouseEnter:M=>{_||(M.currentTarget.style.backgroundColor="var(--sa-color-gray-100, #f8f8f8)")},onMouseLeave:M=>{_||(M.currentTarget.style.backgroundColor="transparent")},children:[m.icon&&e.jsx(F.Icon,{name:m.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:{flex:1,whiteSpace:"nowrap"},children:m.title}),j&&e.jsx(Ze.Badges,{text:String(j.value),variant:j.variant??"info",size:"xs",border:!0})]},m.id)})]})]})]})})}const br=h.forwardRef(({children:r,...t},l)=>e.jsx(y.Box,{ref:l,role:"button",cursor:"pointer","aria-pressed":"true",display:"inline-block",tabIndex:0,...t,children:r})),At=({title:r,iconName:t,textColor:l,iconColor:n,hoverTextColor:o,hoverIconColor:c})=>{const[s,i]=h.useState(!1),a=n??"var(--sa-text-subtle, #8c8f97)",d=l??"var(--sa-text-subtle, #8c8f97)",u=c??"var(--sa-text-subtle, #8c8f97)",p=o??"var(--sa-text-primary, #292a2e)";return e.jsxs(y.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),style:{cursor:"pointer"},children:[e.jsx(F.Icon,{name:t||"ChevronLeft",size:"xs",style:{color:s?u:a,transition:"color 0.15s ease"}}),e.jsx(k.Text,{variant:"sub-h3",style:{color:s?p:d,transition:"color 0.15s ease"},children:r||"Back"})]})},zl=({items:r,separator:t="/",iconName:l,iconColor:n,hoverIconColor:o})=>{const[c,s]=h.useState(!1),i=n??"var(--sa-text-subtle, #8c8f97)",a=o??"var(--sa-text-subtle, #8c8f97)",d=r.length>1?r[0]:void 0,u=!!(d!=null&&d.to||d!=null&&d.onClick),p=e.jsx(F.Icon,{name:l||"ChevronLeft",size:"xs",onMouseEnter:u?()=>s(!0):void 0,onMouseLeave:u?()=>s(!1):void 0,style:{color:u&&c?a:i,transition:"color 0.15s ease",cursor:u?"pointer":void 0}}),C=d!=null&&d.to?e.jsx(ye.Link,{to:d.to,replace:!0,style:{textDecoration:"none"},children:p}):d!=null&&d.onClick?e.jsx(br,{onClick:d.onClick,children:p}):p;return e.jsxs(y.Box,{direction:"row",gap:"xs",align:"center",children:[C,e.jsx(Re.Breadcrumb,{separator:t,size:"md",children:r.map((v,T)=>{const b=T===r.length-1;return v.to&&!b?e.jsx(Re.BreadcrumbItem,{children:e.jsx(ye.Link,{to:v.to,children:v.label})},T):e.jsx(Re.BreadcrumbItem,{currentPage:b,children:e.jsx(Re.BreadcrumbLink,{onClick:b?void 0:v.onClick,children:v.label})},T)})})]})},Al=r=>{const{items:t,separator:l,onClick:n,navigateTo:o,...c}=r;return t&&t.length>0?e.jsx(zl,{items:t,separator:l,iconName:c.iconName,iconColor:c.iconColor,hoverIconColor:c.hoverIconColor}):o?e.jsx(y.Box,{direction:"row",children:e.jsx(ye.Link,{to:o,replace:!0,style:{textDecoration:"none"},children:e.jsx(At,{...c})})}):e.jsx(y.Box,{direction:"row",children:e.jsx(br,{onClick:n,children:e.jsx(At,{...c})})})},Gr=[{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 Vt(r,t,l){return{display:"flex",alignItems:"center",justifyContent:"center",width:"64px",height:"64px",borderRadius:"var(--sa-radii-sm, 6px)",border:r?`2px solid ${l.activeBorder}`:"2px solid var(--sa-color-gray-200, #f0f1f2)",backgroundColor:r?l.activeBg:"var(--sa-color-gray-50, #ffffff)",boxShadow:r?t?`0 8px 20px ${l.activeShadow.replace("0.25","0.35")}`:`0 2px 8px ${l.activeShadow}`:t?"0 8px 20px rgba(0, 0, 0, 0.14)":"0 1px 4px rgba(0, 0, 0, 0.08)",transform:t?"translateY(-3px) scale(1.05)":"translateY(0) scale(1)",transition:"box-shadow 0.2s ease, transform 0.2s ease, background-color 0.15s ease, border-color 0.15s ease"}}const Ht={fontSize:"11px",fontWeight:500,textAlign:"center",overflowWrap:"normal",wordBreak:"normal",color:"var(--sa-background-primary, #ffffff)",lineHeight:"1.3",maxWidth:"80px"},Pt={display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",cursor:"pointer",padding:0};function jt({isShow:r,onHide:t,menus:l,selectedGroupId:n,onSelect:o}){const[c,s]=h.useState(void 0),i=d=>{o(d),t()},a=Gr[0];return e.jsx(Le.Dialog,{isShow:r,onHide:t,style:{width:560,background:"transparent",boxShadow:"none",border:"none"},children:e.jsx(Le.DialogBody,{children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:"16px"},children:[e.jsxs("button",{onClick:()=>i(null),onMouseEnter:()=>s("all"),onMouseLeave:()=>s(void 0),style:Pt,children:[e.jsx("div",{style:Vt(n===null,c==="all",a),children:e.jsx("div",{style:{color:a.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(F.Icon,{name:"Grid",size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:Ht,children:"Semua"})]}),l.map((d,u)=>{var b;const p=n===d.id,C=c===d.id,v=((b=d.items[0])==null?void 0:b.icon)??"Grid",T=Gr[(u+1)%Gr.length];return e.jsxs("button",{onClick:()=>i(d.id),onMouseEnter:()=>s(d.id),onMouseLeave:()=>s(void 0),style:Pt,children:[e.jsx("div",{style:Vt(p,C,T),children:e.jsx("div",{style:{color:T.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(F.Icon,{name:v,size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:Ht,children:d.name})]},d.id)})]})})})}function Vl({onSelect:r,"aria-label":t="Pilih module"}={}){const l=jr(),n=ye.useNavigate(),{selectedGroupId:o,setSelectedGroupId:c}=Zr(),[s,i]=h.useState(!1),a=d=>{var u;if(c(d),d!==null){const p=l.menus.find(v=>v.id===d),C=(u=p==null?void 0:p.items[0])==null?void 0:u.to;C&&n(C)}r==null||r(d)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{position:"relative"},children:[e.jsx("button",{onClick:()=>i(!0),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"2.25rem",height:"2.25rem",borderRadius:"var(--sa-radii-sm, 0.25rem)",border:"1px solid var(--sa-border-subtle, #0b120e24)",color:"var(--sa-text-subtle, #8c8f97)",backgroundColor:"transparent",cursor:"pointer"},"aria-label":t,onMouseEnter:d=>{d.currentTarget.style.backgroundColor="var(--sa-background-primary-inverse, #f8f8f8)"},onMouseLeave:d=>{d.currentTarget.style.backgroundColor="transparent"},children:e.jsx(F.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(jt,{isShow:s,onHide:()=>i(!1),menus:l.menus.filter(d=>d.parentGroupId===void 0),selectedGroupId:o,onSelect:a})]})}const Hl=(r,t)=>{const l=[];if(t===0)return l.push(r),l;for(let n=0;n<r.length;n+=t){const o=r.slice(n,n+t);l.push(o)}return l},Pl=h.memo(({value:r,label:t,separator:l,labelWidth:n,lastIndex:o,labelAlign:c="top"})=>{const s=h.useMemo(()=>({padding:0,paddingBottom:o?0:12,verticalAlign:c}),[o,c]),i=h.useMemo(()=>({padding:0,paddingRight:12,paddingLeft:12,paddingBottom:o?0:12,verticalAlign:c}),[o,c]),a=()=>typeof t=="string"?e.jsx(k.Text,{fontWeight:"medium",color:"subtlest",children:t}):t,d=()=>typeof r=="string"||typeof r=="number"?e.jsx(k.Text,{color:"primary",fontWeight:"medium",children:r}):r,u=()=>typeof l=="string"||typeof l=="number"?e.jsx(k.Text,{fontWeight:"medium",color:"subtlest",children:l}):l;return e.jsxs(Y.Tr,{children:[e.jsx(Y.Td,{style:s,width:n,children:a()}),l?e.jsx(Y.Td,{style:i,width:24,children:u()}):null,e.jsx(Y.Td,{style:s,children:d()})]})}),jl=h.memo(({fields:r,separator:t,labelWidth:l})=>e.jsx(Y.Table,{children:r.map((n,o)=>e.jsx(Pl,{separator:t,labelWidth:l,lastIndex:o===r.length-1,...n},`field-group-field-${o}`))})),Nl=h.memo(({maxRow:r=0,maxColumn:t=2,separator:l=":",fields:n=[],labelWidth:o=150,bordered:c=!1})=>{const s=h.useMemo(()=>Hl(n,r),[n,r]),i=s.length>2,a=()=>{switch(t){case 1:return"width-full";case 2:return"width-1-2";case 3:return"width-1-3";case 4:return"width-1-4";default:return"width-1-2"}};return e.jsx(y.Box,{gap:i?void 0:"lg",direction:"row",flexWrap:"wrap",borderRadius:"rounded-sm",padding:"lg",paddingBottom:i?"xs":"lg",bg:"accent-dark-tertiary",borderWidth:c?"border":void 0,borderStyle:c?"border-solid":void 0,borderColor:c?"border-subtle":void 0,children:s.map((d,u)=>e.jsx(y.Box,{direction:"column",flex:i?void 0:"1",width:i?a():void 0,marginBottom:i?"lg":void 0,children:e.jsx(jl,{labelWidth:o,fields:d,separator:l})},u))})}),_l=({backButton:r})=>{const[t,l]=h.useState(!1),n=(r==null?void 0:r.iconColor)??"var(--sa-text-subtle, #8c8f97)",o=(r==null?void 0:r.textColor)??"var(--sa-text-subtle, #8c8f97)",c=(r==null?void 0:r.hoverIconColor)??"var(--sa-text-subtle, #8c8f97)",s=(r==null?void 0:r.hoverTextColor)??"var(--sa-text-primary, #292a2e)";return e.jsxs(y.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:{cursor:"pointer"},children:[e.jsx(F.Icon,{name:(r==null?void 0:r.iconName)||"ChevronLeft",size:"xs",style:{color:t?c:n,transition:"color 0.15s ease"}}),e.jsx(k.Text,{variant:"sub-h3",style:{color:t?s:o,textDecoration:t?"underline":"none",transition:"color 0.15s ease"},children:(r==null?void 0:r.title)||"Back"})]})},ql=({backButton:r,title:t,titleIcon:l,titleTag:n,children:o,header:c=!0,headerBorder:s=!1,subHeaders:i,action:a,titleTagProps:d,containerProps:u,headerProps:p})=>{const C=ue.useMediaQuery("md"),v=ye.useNavigate(),T=ye.useLocation(),b=r==null?void 0:r.show,B=()=>{if(typeof(r==null?void 0:r.onClick)=="function"){r.onClick();return}v(-1,{replace:!0})},E=()=>{if(!a)return null;if(h.isValidElement(a))return a;const D=a.filter(O=>O&&(O.title||O.icon));return D.length===0?null:C?e.jsx(y.Box,{direction:"row",gap:"md",children:D.map(({title:O,icon:q,buttonProps:U,onClick:G},$)=>e.jsx(H.Button,{iconLeft:q?e.jsx(F.Icon,{name:q,size:"md"}):void 0,onClick:G,...U,children:O},`action-${$}`))}):e.jsxs(I.Menu,{position:"bottom-right",children:[e.jsx(I.MenuButton,{children:e.jsx(H.Button,{variant:"tertiary",size:"sm",iconLeft:e.jsx(F.Icon,{name:"MenuBurger"}),"aria-label":"Actions"})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{minWidth:200},children:D.map(({title:O,icon:q,buttonProps:U,onClick:G},$)=>{const te=(U==null?void 0:U.tone)==="error"||(U==null?void 0:U.danger)===!0;return e.jsx(I.MenuItem,{intent:te?"danger":void 0,disabled:U==null?void 0:U.disabled,startIcon:q?e.jsx(F.Icon,{name:q}):void 0,onClick:G,children:O},`action-${$}`)})})})]})},S=()=>{const D=e.jsx(_l,{backButton:r});return r!=null&&r.navigateTo?e.jsx(y.Box,{direction:"row",children:e.jsx(ye.Link,{to:r.navigateTo,replace:!0,style:{textDecoration:"none"},children:D})}):e.jsx(y.Box,{direction:"row",children:e.jsx(br,{onClick:B,children:D})})},V=()=>{const D=!!t,O=Array.isArray(a)&&a.length>0,q=h.isValidElement(a)?!0:O;if(!D&&!q&&!b)return null;const G=C||!C&&O;return e.jsxs(y.Box,{direction:"column",gap:"xs",paddingBlock:(p==null?void 0:p.paddingBlock)??"sm",paddingInline:(p==null?void 0:p.paddingInline)??"md",...p,style:{...s?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:{},...p==null?void 0:p.style},children:[b&&S(),(D||q)&&e.jsxs(y.Box,{direction:G?"row":"column",gap:"sm",justify:"space-between",align:G?"center":"flex-start",children:[D?typeof t=="string"?e.jsxs(y.Box,{direction:"row",gap:"lg",align:"center",children:[e.jsxs(y.Box,{direction:"row",gap:"sm",align:"center",children:[l&&e.jsx(F.Icon,{name:l,size:"md",color:"primary"}),e.jsx(k.Text,{variant:"h3",fontWeight:"semibold",fontFamily:"Poppins",children:t})]}),n&&e.jsx(Ze.Badge,{border:!0,size:"lg",text:n,...d})]}):t:null,E()]})]})},w=()=>{if(!i||i.length===0)return null;let D=0,O=-1/0;return i.forEach((q,U)=>{const G=q.order??0;G>=O&&(O=G,D=U)}),i.map(({content:q,order:U,borderBottom:G=!0},$)=>e.jsx(y.Box,{direction:"column",paddingTop:"sm",paddingBottom:G||$===D?"sm":"spacing-0",paddingInline:"md",style:{...G?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:{},...U!==void 0?{order:U}:{}},children:q},`sub-header-${$}`))},z=()=>{const D=c?V():null,O=w();return!D&&!O?null:e.jsxs(y.Box,{direction:"column",style:{marginBottom:i&&i.length>0?"var(--sa-spacing-0)":"var(--sa-spacing-md)"},children:[D,O]})},W=()=>o;return e.jsxs(y.Box,{direction:"column",as:"main",...u,style:{...(u==null?void 0:u.style)??{},animation:"pageLayoutEnter 320ms cubic-bezier(0.16, 1, 0.3, 1) backwards"},children:[z(),W()]},T.pathname)},Zl=h.memo(ql),Gl={icon:"Cross",title:""},Ql="calc(100vw - 16px)",Nt=r=>r==null?void 0:`min(${typeof r=="number"?`${r}px`:r}, ${Ql})`,_t=h.forwardRef(({onHide:r,show:t,withBlur:l=!1,style:n,children:o,closeButton:c=Gl,width:s,minWidth:i="357px",maxWidth:a="357px"},d)=>{const u=Nt(s??i),p=Nt(s??a);return e.jsx(ur.Drawer,{blur:l,isShow:t,position:"right",onHide:r,ref:d,style:{minWidth:u,maxWidth:p,...n},children:e.jsxs(y.Box,{direction:"column",padding:"lg",children:[c?e.jsxs(y.Box,{direction:"row",align:"center",gap:"sm",onClick:r,marginBottom:"lg",cursor:"pointer",children:[e.jsx(F.Icon,{name:c.icon,size:"md",color:"subtle",cursor:"pointer"}),c.title?e.jsx(k.Text,{fontFamily:"Poppins",fontSize:"md",color:"subtlest",children:c.title}):null]}):null,o]})})}),Qr=h.memo(({children:r,borderBottom:t=!0,padding:l=!0})=>{const n=ue.useMediaQuery("lg");return e.jsx(y.Box,{direction:"column",padding:l?"md":"spacing-0",paddingLeft:l?"md":"spacing-0",paddingRight:l?"md":"spacing-0",style:t?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:r})}),Ur=h.memo(({children:r,borderTop:t=!0,padding:l=!0})=>{const n=ue.useMediaQuery("lg");return e.jsx(y.Box,{direction:"column",padding:l?"md":"spacing-0",paddingLeft:l?"md":"spacing-0",paddingRight:l?"md":"spacing-0",style:t?{borderTop:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:r})}),Ul=h.memo(({children:r,...t})=>e.jsx(y.Box,{direction:"column",padding:"md",paddingLeft:"md",paddingRight:"md",gap:"md",...t,children:r})),Jl=h.memo(({children:r,title:t,titleTag:l,action:n,header:o,footer:c,actionContainer:s,containerProps:i,bodyProps:a,headerProps:d={borderBottom:!0},footerProps:u={borderTop:!0},variantTag:p="info"})=>{const C=ue.useMediaQuery("lg"),v=()=>l?e.jsxs(y.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(k.Text,{fontWeight:"medium",children:t}),e.jsx(Ze.Badges,{border:!0,text:l,variant:p})]}):e.jsx(k.Text,{fontWeight:"medium",children:t}),T=()=>o||e.jsxs(y.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(y.Box,{direction:"column",children:t?v():null}),e.jsx(y.Box,{direction:"column",style:C?{width:"100%",maxWidth:"19.313rem"}:{flex:1},...s,children:n??null})]}),b=!!(o||t||n);return e.jsxs(y.Box,{direction:"column",bg:"white",borderRadius:"rounded-xs",as:"section",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",...i,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",...(i==null?void 0:i.style)??{}},children:[o!==null&&b?e.jsx(Qr,{...d,children:T()}):null,e.jsx(Ul,{...a,children:r}),c?e.jsx(Ur,{...u,children:c}):null]})}),Ie={H1:r=>e.jsx(k.Text,{variant:"h1",children:r.children,...r.props}),H2:r=>e.jsx(k.Text,{variant:"h2",children:r.children,...r.props}),H3:r=>e.jsx(k.Text,{variant:"h3",children:r.children,...r.props}),H4:r=>e.jsx(k.Text,{variant:"h4",children:r.children,...r.props}),H5:r=>e.jsx(k.Text,{variant:"h5",children:r.children,...r.props}),H6:r=>e.jsx(k.Text,{variant:"h6",children:r.children,...r.props}),SubH1:r=>e.jsx(k.Text,{variant:"sub-h1",children:r.children,...r.props}),SubH2:r=>e.jsx(k.Text,{variant:"sub-h2",children:r.children,...r.props}),SubH3:r=>e.jsx(k.Text,{variant:"sub-h3",children:r.children,...r.props}),Body1:r=>e.jsx(k.Text,{variant:"body-1",children:r.children,...r.props}),Body2:r=>e.jsx(k.Text,{variant:"body-2",children:r.children,...r.props}),Body3:r=>e.jsx(k.Text,{variant:"body-3",children:r.children,...r.props})},Be=()=>{const[r,t]=ye.useSearchParams(),l=rr.searchParamsToObject(r.toString()),n=ye.useParams(),o=ye.useLocation(),c=n.id;return{setSearchParams:t,searchParams:r,searchQueries:l,isHasQuery:(u,p)=>r.has(u)&&r.get(u)===p,getQueryParam:u=>r.get(u),getRouteParam:u=>n[u],params:n,location:o,id:c,hasId:!!c}},qt=r=>JSON.stringify(r),Zt=r=>JSON.stringify(r),Gt=r=>JSON.stringify(r),Qt=r=>JSON.stringify(r),Yl=r=>r,Xl=r=>JSON.stringify(r),dr=({value:r,name:t,type:l,withSearchParam:n=!0,setSearchParams:o,searchQueries:c,dropdownSearchKey:s,filterKey:i="filter",pageKey:a="page"})=>{if(n){let d;switch(l){case"search":d=Yl(r);break;case"dropdown":case"dropdown-multiple":d=qt(r);break;case"radio":d=Zt(r);break;case"date-range":d=Gt(r);break;case"advanced-date-range":d=Xl(r);break;case"date":d=Qt(r);break;default:d=r;break}if(typeof d<"u"){const p={...c[i]&&typeof c[i]=="string"?JSON.parse(c[i]):void 0,[t]:d},C={...c};s&&typeof s=="string"&&delete C[s],delete C[a];const v={...C,[i]:JSON.stringify(p)},T=new URLSearchParams(c).toString(),b=new URLSearchParams(v).toString();if(T===b)return;o(v)}}},vr=({name:r,filterKey:t="filter",searchParams:l,get:n})=>{const o=l.get(t)||void 0,c=o&&typeof o=="string"?JSON.parse(o):void 0,s=c?c[r]:void 0;return n==="label"&&s?JSON.parse(s)[0].label:n==="value"&&s?JSON.parse(s)[0].value:s},Ut=({name:r,filterKey:t="filter",searchParams:l,get:n})=>{const o=l.get(t)||void 0,c=o&&typeof o=="string"?JSON.parse(o):void 0,s=c?c[r]:void 0;return n==="label"&&s?JSON.parse(s).map(i=>i.label):n==="value"&&s?JSON.parse(s).map(i=>i.value):n==="array"&&s?JSON.parse(s):s},Kl=({name:r,filterKey:t="filter",searchParams:l,get:n})=>{const o=l.get(t)||void 0,c=o&&typeof o=="string"?JSON.parse(o):void 0,s=c?c[r]:void 0;return n==="id"&&s?JSON.parse(s).id:n==="label"&&s?JSON.parse(s).label:n==="value"&&s?JSON.parse(s).value:s},xr=(r,t,l)=>{const n=t.get(l||"filter")||void 0,o=n&&typeof n=="string"?JSON.parse(n):void 0;return o?o[r]:void 0},$l=({name:r,filterKey:t="filter",searchParams:l})=>{const n=l.get(t||"filter")||void 0,o=n&&typeof n=="string"?JSON.parse(n):void 0,c=o?o[r]:void 0;return{start:c?JSON.parse(c).from:void 0,end:c?JSON.parse(c).to:void 0}},Jt=({name:r,filterKey:t="filter",searchParams:l})=>{const n=l.get(t||"filter")||void 0,o=n&&typeof n=="string"?JSON.parse(n):void 0,c=o?o[r]:void 0;return c?JSON.parse(c):void 0},Rl=(r,{filterKey:t="filter",perPageKey:l="perPage",pageKey:n="page"})=>{const o=r.get(t)||void 0,c=r.get(l)||void 0,s=r.get(n)||void 0;return!!o||!!c||!!s},Yt=({isOpen:r,onClose:t,filterKey:l,pageKey:n,filters:o})=>{const{searchParams:c,setSearchParams:s,searchQueries:i}=Be(),[a,d]=h.useState({}),u=()=>{c.delete(l||"filter"),s(c)},p=(C,v)=>{switch(C.type){case"radio":{const{show:T=!0}=C;return T&&e.jsx(y.Box,{direction:"column",children:e.jsx(y.Box,{direction:"column",children:C.title})},v)}case"dropdown":{const{show:T=!0}=C;return T&&e.jsx(y.Box,{direction:"column",children:e.jsx(y.Box,{direction:"column",children:C.title})},v)}case"date-range":return e.jsx(y.Box,{direction:"column",children:e.jsx(y.Box,{direction:"column",children:C.title})},v);case"date":return e.jsx(y.Box,{direction:"column",children:e.jsx(y.Box,{direction:"column",children:C.title})},v);case"dropdown-multiple":{const{show:T=!0}=C;return T&&e.jsx(y.Box,{direction:"column",children:e.jsx(y.Box,{direction:"column",children:C.title})},v)}default:return null}};return e.jsx(_t,{onHide:t,show:r||!1,children:e.jsxs(y.Box,{direction:"column",gap:"md",children:[e.jsxs(ne.Flex,{direction:"row",justify:"space-between",align:"center",children:[e.jsx(y.Box,{direction:"column",children:"Filter"}),e.jsx(y.Box,{direction:"column",style:{cursor:"pointer"},onClick:u,children:"Reset"})]}),o==null?void 0:o.map((C,v)=>p(C,v))]})})},Xt=({searchKey:r="q",statusKey:t="status",searchPlaceholder:l="Search",searchHighlightPlaceholder:n,extendedFilter:o,showSearchFilter:c=!0,showStatusFilter:s=!0,filterKey:i="filter",pageKey:a="page",customWidthSearch:d,handleOnReset:u,filterConfigs:p,buttonToggleProps:C,position:v="right",titleSearchLabel:T="Work Order",withTitleLabels:b=!1})=>{const E=(C==null?void 0:C.isShowLabel)??!0,[S,V]=h.useState(!1),[w,z]=h.useState(0),W=()=>{z(P=>P+1)},{searchParams:D,setSearchParams:O,getQueryParam:q}=Be(),U=rr.searchParamsToObject(D.toString()),G=xr(r,D,i)||"",[$,te]=h.useState(G),he=q(i),se=!!(he&&!(()=>{if(he)try{const P=JSON.parse(he);return Object.keys(P).length===1&&P[r]===""}catch(P){console.error("Filter parameter is not a valid JSON:",P)}return!1})()),ee=ue.useMediaQuery("md");return h.useEffect(()=>{te(G)},[G]),h.useEffect(()=>{if($===G)return;const P=window.setTimeout(()=>{dr({value:$,name:r,type:"search",searchQueries:U,setSearchParams:O,filterKey:i,pageKey:a})},350);return()=>{window.clearTimeout(P)}},[$,G,r,U,O,i,a]),e.jsxs(ne.Flex,{gap:"md",style:{flexDirection:ee&&v==="left"?"row":ee&&v==="right"?"row-reverse":"column"},align:"flex-end",children:[se&&e.jsx(y.Box,{direction:"column",justify:"flex-end",children:e.jsx(H.Button,{onClick:()=>{const P=new URLSearchParams(D);P.delete(i),O(P),te(""),W(),u&&u()},variant:"outline",tone:"neutral",children:e.jsx(k.Text,{color:"error",fontWeight:"semibold",children:"Reset"})})}),o==null?void 0:o.map(({minWidth:P,content:le,title:pe,onClickContainer:fe},ge)=>e.jsxs(y.Box,{direction:"column",gap:"sm",onClick:fe,style:{minWidth:P},children:[pe&&e.jsx(Ie.SubH3,{children:pe}),le]},`extended-filter-${ge}-${w}`)),!!(p!=null&&p.length)&&e.jsx(H.Button,{primary:se,secondary:!se,iconLeft:e.jsx(F.Icon,{size:"sm",name:(C==null?void 0:C.icon)||"FilterHorizontal",style:{color:he?"var(--sa-background-brand, #04254f)":"var(--sa-text-primary, #292a2e)"}}),fullWidth:!ee,onClick:()=>V(!0),children:E?"Filter":void 0}),s&&e.jsxs(y.Box,{direction:"column",gap:"sm",style:{minWidth:"126px"},children:[b&&e.jsx(Ie.SubH3,{children:"Status"}),e.jsx(er.Dropdown,{dropdownLists:[{label:"Active",value:"active"},{label:"InActive",value:"inactive"}],defaultValue:vr({get:"value",name:t,searchParams:D,filterKey:i})?[{label:vr({get:"value",name:t,searchParams:D,filterKey:i})==="active"?"Active":"InActive",value:vr({get:"value",name:t,searchParams:D,filterKey:i})}]:[],onChange:P=>dr({value:P,name:t,type:"dropdown",searchQueries:U,setSearchParams:O,filterKey:i}),placeholder:b?"All":"All Status"},w)]}),c&&e.jsxs(y.Box,{direction:"column",gap:"sm",style:{width:d&&ee?d:ee?"310px":""},children:[b&&e.jsxs(Ie.SubH3,{children:["Search for ",T]}),e.jsx(Ge.Input,{placeholder:l,leftIcon:e.jsx(F.Icon,{name:"Search",width:20,height:20}),onChange:P=>te(P.target.value),value:$,fullWidth:!0},w+1+i)]}),e.jsx(Yt,{isOpen:S,onClose:()=>V(!1),filterKey:i,filters:p,pageKey:a})]})},eo=r=>r==="checkbox-multiple"?"dropdown-multiple":r==="radio"?"dropdown":r==="date-compact"?"date":r;function Jr({configs:r,filterKey:t="filter",activeFilterKey:l="filters",pageKey:n="page",searchKey:o="q"}){const{searchParams:c,setSearchParams:s,searchQueries:i}=Be(),a=h.useMemo(()=>Object.fromEntries(r.map(w=>[w.key,w])),[r]),d=h.useMemo(()=>{const w=(c.get(l)||"").split(",").map(W=>W.trim()).filter(Boolean);let z=[];try{const W=c.get(t);W&&(z=Object.keys(JSON.parse(W)).filter(D=>D!==o))}catch{}return r.map(W=>W.key).filter(W=>{const D=a[W];return(D==null?void 0:D.locked)||w.includes(W)||z.includes(W)})},[c,l,t,o,r,a]),u=h.useCallback(w=>{try{return w[t]?JSON.parse(w[t]):{}}catch{return{}}},[t]),p=h.useCallback(w=>{const z={...i};w.length?z[l]=w.join(","):delete z[l],s(z)},[i,l,s]),C=h.useCallback(w=>{d.includes(w)||p([...d,w])},[d,p]),v=h.useCallback(w=>{var O;if((O=a[w])!=null&&O.locked)return;const z={...i},W=d.filter(q=>q!==w);W.length?z[l]=W.join(","):delete z[l];const D=u(z);w in D&&(delete D[w],Object.keys(D).length?z[t]=JSON.stringify(D):delete z[t]),delete z[n],s(z)},[i,d,l,t,n,u,s,a]),T=h.useCallback(w=>d.includes(w)?v(w):C(w),[d,C,v]),b=h.useCallback(w=>{switch(w.type){case"dropdown":case"dropdown-multiple":case"checkbox-multiple":case"radio":return Ut({name:w.key,get:"array",searchParams:c,filterKey:t})||[];case"date":{const z=Jt({name:w.key,searchParams:c,filterKey:t});return z?new Date(z):void 0}case"date-compact":{const W=u(Object.fromEntries(c.entries()))[w.key];return W&&typeof W=="object"?W:void 0}default:return}},[c,t,u]),B=h.useCallback((w,z)=>{if(w.type==="date-compact"){const W={...i},D=u(W);z==null?delete D[w.key]:D[w.key]=z,Object.keys(D).length?W[t]=JSON.stringify(D):delete W[t],delete W[n],s(W);return}dr({value:z,name:w.key,type:eo(w.type),searchQueries:i,setSearchParams:s,filterKey:t,pageKey:n})},[i,s,t,n,u]),E=h.useCallback(w=>{const z={...i},W=u(z);w in W&&(delete W[w],Object.keys(W).length?z[t]=JSON.stringify(W):delete z[t]),delete z[n],s(z)},[i,t,n,u,s]),S=h.useCallback(()=>{const w={...i};delete w[t],delete w[l],delete w[n],s(w)},[i,t,l,n,s]),V=d.length>0;return{activeKeys:d,configByKey:a,hasActiveFilter:V,addFilter:C,removeFilter:v,toggleFilter:T,getValue:b,setValue:B,clearValue:E,clearAll:S}}const Yr={get(r){return ar.storage.get(r)??null},set(r,t){ar.storage.save(r,t)},remove(r){ar.storage.delete(r)}},nr={columns:r=>`filterbar:colprefs:${r}`,savedViews:r=>`filterbar:views:${r}`,lastState:r=>`filterbar:last:${r}`,perPage:r=>`filterbar:perpage:${r}`,tableSort:r=>`tablelayout:sort:${r}`},wr=(r,t)=>{const l=new Set(t.map(c=>c.key)),n=r.order.filter(c=>l.has(c));for(const c of t)n.includes(c.key)||n.push(c.key);const o=r.hidden.filter(c=>l.has(c));return{order:n,hidden:o}};function ro({columns:r,scopeId:t,storage:l,onColumnsChange:n,value:o}){const c=h.useMemo(()=>({order:r.map(D=>D.key),hidden:[]}),[r]),s=t?nr.columns(t):void 0,i=(D,O)=>wr({order:D.order??O,hidden:D.hidden??[]},r),[a,d]=h.useState(()=>{if(o&&(o.order||o.hidden))return i(o,r.map(D=>D.key));if(s){const D=l.get(s);if(D&&Array.isArray(D.order))return wr(D,r)}return c}),u=r.map(D=>D.key).join("|");h.useEffect(()=>d(D=>wr(D,r)),[u]);const p=h.useRef(a);p.current=a;const C=o?`${(o.order??[]).join("|")}~${(o.hidden??[]).join("|")}`:null,v=h.useRef(C);h.useEffect(()=>{if(C==null||v.current===C)return;v.current=C;const D=p.current,O=i(o,D.order);O.order.join("|")===D.order.join("|")&&O.hidden.join("|")===D.hidden.join("|")||(d(O),s&&l.set(s,O))},[C,u]);const T=h.useRef(!1);h.useEffect(()=>{T.current||(T.current=!0,n==null||n(a))},[]);const b=h.useCallback(D=>{d(D),s&&l.set(s,D),n==null||n(D)},[s,l,n]),B=h.useMemo(()=>{const D=new Map(r.map(O=>[O.key,O]));return a.order.filter(O=>D.has(O)).map(O=>({...D.get(O),visible:!a.hidden.includes(O)}))},[a,r]),E=h.useCallback(D=>{const O=a.hidden.includes(D)?a.hidden.filter(q=>q!==D):[...a.hidden,D];b({...a,hidden:O})},[a,b]),S=h.useCallback((D,O)=>{if(D===O)return;const q=[...a.order],[U]=q.splice(D,1);q.splice(O,0,U),b({...a,order:q})},[a,b]),V=h.useCallback(D=>{b({...a,hidden:D?r.filter(O=>!O.locked).map(O=>O.key):[]})},[a,r,b]),w=h.useCallback(()=>b(c),[b,c]),z=h.useCallback(D=>b(wr(D,r)),[b,r]),W=a.hidden.length===0;return{state:a,orderedColumns:B,allVisible:W,toggleVisibility:E,reorder:S,setAllHidden:V,reset:w,applyState:z}}function to({scopeId:r,storage:t,snapshotKeys:l,pageKey:n="page",getColumns:o,applyColumns:c}){const{searchParams:s,setSearchParams:i}=Be(),a=r?nr.savedViews(r):void 0,[d,u]=h.useState(()=>a?t.get(a)||[]:[]),p=h.useCallback(b=>{u(b),a&&t.set(a,b)},[a]),C=h.useCallback(b=>{const B=b.trim();if(!B)return;const E={};l.forEach(V=>{const w=s.get(V);w!=null&&(E[V]=w)});const S={id:`${Date.now()}`,name:B,query:E,columns:o==null?void 0:o(),createdAt:Date.now()};p([...d,S])},[l,s,o,p,d]),v=h.useCallback(b=>p(d.filter(B=>B.id!==b)),[p,d]),T=h.useCallback(b=>{const B=Object.fromEntries(s.entries());l.forEach(E=>delete B[E]),Object.assign(B,b.query),delete B[n],i(B),b.columns&&(c==null||c(b.columns))},[s,l,n,i,c]);return{enabled:!!a,views:d,saveView:C,deleteView:v,applyView:T}}function lo({scopeId:r,storage:t,snapshotKeys:l,enabled:n=!0}){const{searchParams:o}=Be(),c=r&&n?nr.lastState(r):void 0;h.useEffect(()=>{if(!c)return;const a={};l.forEach(d=>{const u=o.get(d);u!=null&&(a[d]=u)}),Object.keys(a).length!==0&&t.set(c,a)},[o,c,l,t]);const s=h.useCallback(()=>{if(!c)return null;const a=t.get(c);return a&&Object.keys(a).length>0?a:null},[c,t]),i=h.useCallback(()=>{c&&t.remove(c)},[c,t]);return{enabled:!!c,read:s,clear:i}}function oo({scopeId:r,storage:t,perPageKey:l,pageSizeOptions:n,enabled:o=!0}){const{searchParams:c}=Be(),s=r&&o?nr.perPage(r):void 0,i=c.toString();h.useEffect(()=>{if(!s)return;const u=c.get(l);if(!u)return;const p=Number(u);!Number.isFinite(p)||p<=0||t.set(s,p)},[i,s,l,t]);const a=h.useCallback(()=>{if(!s)return null;const u=t.get(s);if(u==null)return null;const p=Number(u);return!Number.isFinite(p)||p<=0||n&&!n.includes(p)?null:String(p)},[s,t,n]),d=h.useCallback(()=>{s&&t.remove(s)},[s,t]);return{enabled:!!s,read:a,clear:d}}let Xr={},Kr=!1,$r=null;const no=(r,t)=>{Object.assign(Xr,r),$r=t,!Kr&&(Kr=!0,queueMicrotask(()=>{const l=Xr,n=$r;Xr={},Kr=!1,$r=null,!(!n||Object.keys(l).length===0)&&n(o=>{const c=new URLSearchParams(o);return Object.entries(l).forEach(([s,i])=>c.set(s,i)),c})}))};function co({enabled:r,snapshotKeys:t,perPageKey:l,readSnapshot:n,readPerPage:o}){const{searchParams:c,setSearchParams:s,location:i}=Be(),a=h.useRef(null);h.useEffect(()=>{if(!r||a.current===i.pathname)return;a.current=i.pathname;const d={};if(!c.has(l)){const u=o();u&&(d[l]=u)}if(!t.some(u=>c.has(u))){const u=n();u&&Object.assign(d,u)}Object.keys(d).length!==0&&no(d,s)},[i.pathname,r])}const io=({configs:r,activeKeys:t,onToggle:l,hasActiveFilter:n,onReset:o})=>r.length?e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(H.Button,{variant:n?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"FilterHorizontal"}),"aria-label":"Add filter"})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{minWidth:260},title:e.jsxs(y.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:"Add Filter"}),n&&o&&e.jsx(H.Button,{variant:"link",tone:"brand",size:"xs",onClick:o,children:"Reset"})]}),children:r.map(c=>e.jsx(I.MenuItem,{selected:c.locked||t.includes(c.key),disabled:c.locked,closeOnSelect:!1,startIcon:c.icon??void 0,onClick:()=>{c.locked||l(c.key)},children:c.label},c.key))})})]}):null,Dr=({onClear:r,onRemove:t})=>e.jsxs(I.Menu,{position:"bottom-right",children:[e.jsx(I.MenuButton,{children:e.jsx(H.Button,{variant:"link",tone:"neutral",size:"xs",iconLeft:e.jsx(F.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(F.Icon,{name:"CrossCircle"}),onClick:r,children:"Clear value"}),t&&e.jsx(I.MenuItem,{intent:"danger",startIcon:e.jsx(F.Icon,{name:"Trash1"}),onClick:t,children:"Remove filter"})]})})]}),so=r=>{const t=new Date(r);return t.setHours(0,0,0,0),t},Kt=(r,t,l)=>{const n=new Date(r);return l==="day"?n.setDate(n.getDate()+t):l==="week"?n.setDate(n.getDate()+t*7):l==="month"?n.setMonth(n.getMonth()+t):n.setFullYear(n.getFullYear()+t),n},$t=r=>{const t=so(new Date);if(r.direction==="this"){const n=new Date(t),o=new Date(t);return r.period==="week"?(n.setDate(t.getDate()-t.getDay()),o.setDate(n.getDate()+6)):r.period==="month"?(n.setDate(1),o.setMonth(o.getMonth()+1,0)):r.period==="year"&&(n.setMonth(0,1),o.setMonth(11,31)),{from:n,to:o}}const l=r.count??1;return r.direction==="past"?{from:Kt(t,-l,r.period),to:t}:{from:t,to:Kt(t,l,r.period)}},Rt=24,el=r=>r.length>Rt?`${r.slice(0,Rt)}...`:r,Sr=r=>r.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric"}),kr={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"},ao=["is","is-before","is-after","is-on-or-before","is-on-or-after","is-between","is-relative-to-today","is-empty","is-not-empty"],Rr={past:"Past",next:"Next",this:"This"},ho=["day","week","month","year"],fo=["past","next","this"],go=r=>r.field.type==="date-compact"?e.jsx(po,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}):e.jsx(uo,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}),uo=({field:r,value:t,onChange:l,onClear:n,onRemove:o})=>{const c=t?Sr(new Date(t)):null,s=!!c,i=s?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:el(c)})]}):r.label;return e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(H.Button,{variant:s?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:s?e.jsx(F.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:i})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{width:260},title:e.jsxs(y.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Dr,{onClear:n,onRemove:o})]}),children:e.jsx(Je.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:r.mode,value:t,onChange:a=>a==null?n():l(a),withPadding:!1})})})]})},yo=r=>{switch(r.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return r.date?`${kr[r.op]} ${Sr(new Date(r.date))}`:null;case"is-between":return r.from&&r.to?`${Sr(new Date(r.from))} - ${Sr(new Date(r.to))}`:null;case"is-relative-to-today":{const t=r.relative;if(!t)return null;if(t.direction==="this")return`This ${t.period}`;const l=t.count??1,n=l===1?t.period:`${t.period}s`;return`${Rr[t.direction]} ${l} ${n}`}case"is-empty":case"is-not-empty":return kr[r.op];default:return null}},po=({field:r,value:t,onChange:l,onClear:n,onRemove:o})=>{const c=(t==null?void 0:t.op)??"is",s=t?yo(t):null,i=!!s,a=i?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:el(s)})]}):r.label,d=u=>{if(u!==c){if(u==="is-empty"||u==="is-not-empty"){l({op:u});return}if(u==="is-relative-to-today"){l({op:u,relative:(t==null?void 0:t.relative)??{direction:"past",count:1,period:"week"}});return}if(u==="is-between"){l({op:u,from:t==null?void 0:t.from,to:t==null?void 0:t.to});return}l({op:u,date:t==null?void 0:t.date})}};return e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(H.Button,{variant:i?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:i?e.jsx(F.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:a})}),e.jsxs(I.MenuLists,{children:[e.jsx(I.MenuBody,{style:{width:320},title:e.jsxs(y.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",gap:"xs",fullWidth:!0,children:[e.jsxs(y.Box,{display:"flex",direction:"row",align:"center",gap:"xs",style:{minWidth:0},children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Co,{op:c,onChange:d})]}),e.jsx(Dr,{onClear:n,onRemove:o})]}),children:e.jsx(bo,{value:t,op:c,onChange:l})}),c==="is-relative-to-today"&&e.jsx(I.MenuFooter,{children:e.jsx(k.Text,{fontSize:"xs",color:"subtlest",children:"Filter will update with the current date"})})]})]})},Co=({op:r,onChange:t})=>e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(H.Button,{variant:"link",tone:"neutral",size:"xs",iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:kr[r]})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{width:200},children:ao.map(l=>e.jsx(I.MenuItem,{selected:r===l,onClick:()=>t(l),endIcon:r===l?e.jsx(F.Icon,{name:"Check"}):void 0,children:kr[l]},l))})})]}),bo=({value:r,op:t,onChange:l})=>{if(t==="is-empty"||t==="is-not-empty")return e.jsx(y.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(k.Text,{fontSize:"xs",color:"subtlest",children:"No further input required."})});if(t==="is-between"){const n=r!=null&&r.from||r!=null&&r.to?{from:r!=null&&r.from?new Date(r.from):null,to:r!=null&&r.to?new Date(r.to):null}:void 0;return e.jsx(Je.StarasiaDate,{size:"sm",input:!1,clearable:!0,rangedDate:!0,value:n,onChange:o=>{if(o==null){l({op:t});return}if(typeof o=="object"&&o!==null&&"from"in o&&"to"in o){let{from:c,to:s}=o;if(!c&&s&&(c=s,s=null),!c&&!s){l({op:t});return}l({op:t,from:c?c.toISOString():void 0,to:s?s.toISOString():void 0})}},withPadding:!1},"range")}return t==="is-relative-to-today"?e.jsx(vo,{value:r==null?void 0:r.relative,onChange:n=>l({op:t,relative:n})}):e.jsx(Je.StarasiaDate,{size:"sm",input:!1,clearable:!0,value:r!=null&&r.date?new Date(r.date):void 0,onChange:n=>{if(n==null){l({op:t});return}n instanceof Date&&l({op:t,date:n.toISOString()})},withPadding:!1},"single")},vo=({value:r,onChange:t})=>{const l=(r==null?void 0:r.direction)??"past",n=(r==null?void 0:r.count)??1,o=(r==null?void 0:r.period)??"week",c=l!=="this",s=$t({direction:l,count:n,period:o});return e.jsxs(y.Box,{direction:"column",display:"flex",gap:"sm",children:[e.jsxs(y.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(H.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:Rr[l]})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{width:140},children:fo.map(i=>e.jsx(I.MenuItem,{selected:l===i,endIcon:l===i?e.jsx(F.Icon,{name:"Check"}):void 0,onClick:()=>t(i==="this"?{direction:i,period:o}:{direction:i,count:n,period:o}),children:Rr[i]},i))})})]}),c&&e.jsx(Ge.Input,{type:"number",size:"sm",min:1,clearable:!1,value:n,onChange:i=>{const a=Number(i.target.value);t({direction:l,count:Number.isFinite(a)&&a>0?a:1,period:o})},style:{width:72}}),e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(H.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:o})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{width:140},children:ho.map(i=>e.jsx(I.MenuItem,{selected:o===i,endIcon:o===i?e.jsx(F.Icon,{name:"Check"}):void 0,onClick:()=>t(l==="this"?{direction:l,period:i}:{direction:l,count:n,period:i}),children:i},i))})})]})]}),e.jsx(Je.StarasiaDate,{size:"sm",input:!1,disabled:!0,rangedDate:!0,value:s,onChange:()=>{},withPadding:!1},"relative-preview")]})},rl=18,xo=r=>r.length>rl?`${r.slice(0,rl)}...`:r,wo=({field:r,value:t,onChange:l,onClear:n,onRemove:o})=>{const c=r.type==="dropdown-multiple",s=t.length,[i,a]=h.useState(""),d=r.options,u=typeof r.onSearch=="function",p=(()=>{if(u)return d;const B=i.trim().toLowerCase();return B?d.filter(E=>E.label.toLowerCase().includes(B)):d})(),C=B=>t.some(E=>E.value===B.value),v=B=>{if(!c){l([{label:B.label,value:B.value}]),a("");return}l(C(B)?t.filter(E=>E.value!==B.value):[...t,{label:B.label,value:B.value}])},T=B=>{var E;a(B),(E=r.onSearch)==null||E.call(r,B)},b=s===0?r.label:e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:s===1?xo(t[0].label):`${s} Selected`})]});return e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(H.Button,{variant:s>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:s>0?e.jsx(F.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:b})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{width:260},title:e.jsxs(y.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Dr,{onClear:n,onRemove:o})]}),children:e.jsxs(y.Box,{direction:"column",gap:"sm",children:[e.jsx(er.Dropdown,{size:"sm",triggerInput:!0,fullWidth:!0,hideChevronIcon:!0,clearable:!0,multiSelect:c,searchAble:!0,searchValue:i,onSearch:T,value:t,onChange:l,placeholder:`Search ${r.label.toLowerCase()}…`}),e.jsx(y.Box,{direction:"column",overflow:"overflow-y-auto",customMaxHeight:"240px",children:r.isLoading?e.jsx(y.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(k.Text,{fontSize:"xs",color:"subtlest",children:"Loading…"})}):p.length===0?e.jsx(y.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(k.Text,{fontSize:"xs",color:"subtlest",children:"No results"})}):p.map(B=>e.jsx(I.MenuItem,{closeOnSelect:!c,selected:C(B),startIcon:B.avatar,endIcon:C(B)?e.jsx(F.Icon,{name:"Check"}):void 0,description:B.description,onClick:()=>v(B),children:B.label},B.value))})]})})})]})},tl=18,Do=r=>r.length>tl?`${r.slice(0,tl)}...`:r,ll=({checked:r,indeterminate:t})=>e.jsx("span",{style:{pointerEvents:"none",display:"inline-flex"},children:e.jsx(or.Checkbox,{size:"sm",checked:r,readOnly:!0,onChange:()=>{},variant:t?"indeterminate":"select"})}),So=({field:r,value:t,onChange:l,onClear:n,onRemove:o})=>{const c=new Set(t.map(C=>C.value)),s=t.length,i=r.options.length>0&&r.options.every(C=>c.has(C.value)),a=s>0&&!i,d=C=>{l(c.has(C.value)?t.filter(v=>v.value!==C.value):[...t,{label:C.label,value:C.value}])},u=()=>{l(i?[]:r.options.map(C=>({label:C.label,value:C.value})))},p=s===0?r.label:e.jsxs(e.Fragment,{children:[e.jsxs(k.Text,{as:"span",fontWeight:"semibold",children:[r.label,":"]})," ",e.jsx(k.Text,{as:"span",children:s===1?Do(t[0].label):`${s} Selected`})]});return e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(H.Button,{variant:s>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:s>0?e.jsx(F.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:p})}),e.jsx(I.MenuLists,{children:e.jsxs(I.MenuBody,{style:{width:240},title:e.jsxs(y.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Dr,{onClear:n,onRemove:o})]}),children:[e.jsx(I.MenuItem,{closeOnSelect:!1,selected:i,onClick:u,startIcon:e.jsx(ll,{checked:i||a,indeterminate:a}),children:"Select All"}),r.options.map(C=>e.jsx(I.MenuItem,{closeOnSelect:!1,selected:c.has(C.value),onClick:()=>d(C),startIcon:e.jsx(ll,{checked:c.has(C.value)}),children:C.label},C.value))]})})]})},ol=({activeKeys:r,configByKey:t,getValue:l,setValue:n,clearValue:o,removeFilter:c})=>e.jsx(e.Fragment,{children:r.map(s=>{const i=t[s];if(!i)return null;const a=l(i),d=i.locked?void 0:()=>c(s);return i.type==="date"||i.type==="date-compact"?e.jsx(go,{field:i,value:a,onChange:u=>n(i,u),onClear:()=>o(s),onRemove:d},s):i.type==="checkbox-multiple"?e.jsx(So,{field:i,value:a||[],onChange:u=>n(i,u),onClear:()=>o(s),onRemove:d},s):e.jsx(wo,{field:i,value:a||[],onChange:u=>n(i,u),onClear:()=>o(s),onRemove:d},s)})}),nl=r=>`${r} Rows`,ko=({pagination:r,pageKey:t="page",perPageKey:l="perPage",pageSizeOptions:n=[10,25,50,100],defaultPerPage:o=10,showResultCount:c=!0,showPageSize:s=!0,showPagination:i=!0})=>{var E;const{searchQueries:a,setSearchParams:d,searchParams:u}=Be(),p=u.get(l),C=p?Number(p):o,v=S=>{d({...a,[t]:String(S)})},T=S=>{d({...a,[l]:S,[t]:"1"})},b=(r==null?void 0:r.rangeStart)??(((r==null?void 0:r.currentPage)||0)>1?(((r==null?void 0:r.currentPage)||0)-1)*((r==null?void 0:r.perPage)||0)+1:1),B=(r==null?void 0:r.rangeEnd)??((r==null?void 0:r.totalCurrentPage)!==(r==null?void 0:r.perPage)?r==null?void 0:r.totalData:((r==null?void 0:r.currentPage)||1)*((r==null?void 0:r.totalCurrentPage)||0));return e.jsxs(e.Fragment,{children:[c&&e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${b}-${B} of ${((E=r==null?void 0:r.totalData)==null?void 0:E.toLocaleString())||0}`}),s&&e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(H.Button,{variant:"outline",tone:"neutral",size:"xs",iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),"aria-label":"Rows per page",children:nl(C)})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{children:n.map(S=>e.jsx(I.MenuItem,{selected:S===C,onClick:()=>T(String(S)),children:nl(S)},S))})})]}),i&&((r==null?void 0:r.totalPage)??0)>1&&e.jsx(y.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(sr.Pagination,{size:"sm",variant:"neutral",siblingCount:0,currentPage:r!=null&&r.currentPage?Number(r.currentPage):1,totalPages:Number(r==null?void 0:r.totalPage),onPageChange:v})})]})};function Bo(r,t,l=!0){h.useEffect(()=>{if(!l)return;const n=o=>{var i;if(o.metaKey||o.ctrlKey||o.altKey||o.key!==r)return;const c=o.target,s=(i=c==null?void 0:c.tagName)==null?void 0:i.toLowerCase();s==="input"||s==="textarea"||c!=null&&c.isContentEditable||(o.preventDefault(),t())};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[r,t,l])}const mo=240,cl=({searchKey:r="q",filterKey:t="filter",pageKey:l="page",placeholder:n="Search",shortcut:o="/"})=>{const{searchParams:c,setSearchParams:s,searchQueries:i}=Be(),a=xr(r,c,t)||"",[d,u]=h.useState(!!a),[p,C]=h.useState(!a),[v,T]=h.useState(a),b=ue.useDebounce(v,350),B=h.useRef(null);h.useEffect(()=>{T(a),a&&u(!0)},[a]),h.useEffect(()=>{d&&C(!1)},[d]),h.useEffect(()=>{b!==a&&dr({value:b,name:r,type:"search",searchQueries:i,setSearchParams:s,filterKey:t,pageKey:l})},[b]);const E=h.useCallback(()=>{u(!0),requestAnimationFrame(()=>{var z;return(z=B.current)==null?void 0:z.focus()})},[]);Bo(o,E);const S=()=>{v||u(!1)},V=z=>{var W;z.key==="Escape"&&!v&&(u(!1),(W=B.current)==null||W.blur())},w=()=>{d||C(!0)};return e.jsxs(y.Box,{display:"flex",direction:"row",align:"center",gap:"spacing-0",children:[p&&e.jsx(H.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Search",size:"sm"}),"aria-label":"Search","aria-expanded":!1,onClick:E}),e.jsxs(y.Box,{onTransitionEnd:w,style:{position:"relative",width:d?mo:0,overflow:"hidden",transition:"width 220ms ease"},children:[e.jsx(Ge.Input,{ref:B,size:"sm",fullWidth:!0,value:v,placeholder:n,leftIcon:e.jsx(F.Icon,{name:"Search",width:16,height:16}),onChange:z=>T(z.target.value),onKeyDown:V,onBlur:S,tabIndex:d?0:-1}),d&&!v&&e.jsx(y.Box,{align:"center",justify:"center",borderColor:"border-subtle",borderWidth:"border",borderStyle:"border-solid",borderRadius:"rounded-xs",paddingInline:"spacing-1",customBackgroundColor:"var(--sa-background-surface-hover, #f1f2f4)",style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",minWidth:18,height:18,display:"inline-flex"},children:e.jsx(k.Text,{fontSize:"xs",color:"subtle",children:o})})]})]})},il=({columns:r,allVisible:t,onToggle:l,onReorder:n,onSetAllHidden:o})=>{const[c,s]=h.useState(null),[i,a]=h.useState(null),d=()=>{c!==null&&i!==null&&c!==i&&n(c,i),s(null),a(null)},u=(p,C)=>{const v=p+C;v<0||v>=r.length||n(p,v)};return e.jsxs(I.Menu,{position:"bottom-right",children:[e.jsx(I.MenuButton,{children:e.jsx(H.Button,{variant:t?"outline":"secondary",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Grid",size:"sm"}),"aria-label":"Customize columns"})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{children:e.jsxs(y.Box,{padding:"sm",direction:"column",customWidth:"296px",customMaxHeight:"60vh",overflow:"overflow-hidden",children:[e.jsx(k.Text,{fontWeight:"semibold",color:"primary",children:"Customize Column Table"}),e.jsxs(y.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",paddingBlock:"md",children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtle",children:"Show in table"}),e.jsx(H.Button,{variant:"link",tone:"info",size:"xs",onClick:()=>o(t),children:t?"Hide All":"Show All"})]}),e.jsx(y.Box,{direction:"column",overflow:"overflow-y-auto",children:r.map((p,C)=>{const v=!p.locked,T=i===C&&c!==null&&c!==C;return e.jsxs(y.Box,{direction:"row",display:"flex",align:"center",gap:"sm",paddingBlock:"xs",draggable:v,onDragStart:()=>v&&s(C),onDragOver:b=>{b.preventDefault(),a(C)},onDrop:d,onDragEnd:d,style:{minHeight:32,boxShadow:T?"inset 0 2px 0 0 var(--sa-background-brand, #04254f)":void 0},children:[e.jsx(y.Box,{direction:"column",as:"div",align:"center",justify:"center",role:"button",tabIndex:v?0:-1,"aria-label":`Reorder ${p.title}`,"aria-disabled":!v||void 0,color:"icon-subtlest",onKeyDown:b=>{v&&(b.key==="ArrowUp"?(b.preventDefault(),u(C,-1)):b.key==="ArrowDown"&&(b.preventDefault(),u(C,1)))},style:{display:"inline-flex",cursor:v?"grab":"default",opacity:v?1:.4},children:e.jsx(F.Icon,{name:"DragVertical",width:16,height:16})}),p.icon&&e.jsx(y.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:p.icon}),e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:p.title}),e.jsx(y.Box,{direction:"column",style:{marginLeft:"auto"},children:e.jsx(lr.Toggle,{size:"sm",checked:p.visible,disabled:p.locked,onChange:()=>l(p.key),"aria-label":`Toggle ${p.title} column`})})]},p.key)})})]})})})]})},sl=({views:r,onApply:t,onDelete:l,onSave:n})=>{const[o,c]=h.useState(""),s=()=>{const i=o.trim();i&&(n(i),c(""))};return e.jsxs(I.Menu,{position:"bottom-right",children:[e.jsx(I.MenuButton,{children:e.jsx(H.Button,{variant:r.length>0?"secondary":"outline",tone:(r.length>0,"neutral"),size:"sm",iconLeft:e.jsx(F.Icon,{name:"Bookmark",size:"sm"}),"aria-label":"Saved views"})}),e.jsxs(I.MenuLists,{style:{width:"260px"},children:[e.jsx(I.MenuBody,{children:e.jsxs(y.Box,{direction:"column",padding:"xs",gap:"sm",children:[e.jsx(k.Text,{fontWeight:"semibold",color:"primary",children:"Saved Views"}),e.jsx(y.Box,{direction:"column",overflow:"overflow-y-auto",children:r.length===0?e.jsx(y.Box,{direction:"column",paddingBlock:"sm",children:e.jsx(k.Text,{fontSize:"sm",color:"subtlest",children:"No saved views yet"})}):r.map(i=>e.jsx(I.MenuItem,{startIcon:e.jsx(F.Icon,{name:"Bookmark"}),onClick:()=>t(i),endIcon:e.jsx(H.Button,{variant:"link",tone:"error",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Trash2"}),"aria-label":`Delete ${i.name}`,onClick:a=>{a.stopPropagation(),l(i.id)}}),children:i.name},i.id))})]})}),e.jsx(I.MenuFooter,{children:e.jsxs(y.Box,{direction:"row",gap:"xs",children:[e.jsx(y.Box,{direction:"column",style:{flex:"1 0 0",minWidth:0},children:e.jsx(Ge.Input,{size:"sm",fullWidth:!0,placeholder:"Save current view as…",value:o,onChange:i=>c(i.target.value),onKeyDown:i=>{i.key==="Enter"&&s()}})}),e.jsx(H.Button,{variant:"primary",tone:"brand",size:"sm",disabled:!o.trim(),onClick:s,children:"Save"})]})})]})]})},Fo=({isOpen:r,onClose:t,configs:l,activeKeys:n,configByKey:o,hasActiveFilter:c,onToggle:s,onReset:i,getValue:a,setValue:d,clearValue:u,removeFilter:p})=>{const C=n.length;return e.jsx(ur.Drawer,{position:"bottom",isShow:r,onHide:t,children:e.jsxs(y.Box,{direction:"column",customMaxHeight:"85vh",style:{minHeight:280},children:[e.jsxs(y.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(y.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsx(k.Text,{fontWeight:"semibold",color:"primary",children:"Filter"}),C>0&&e.jsxs(k.Text,{fontSize:"sm",color:"subtle",children:["(",C,")"]})]}),e.jsx(H.Button,{variant:"link",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Cross"}),"aria-label":"Close filter",onClick:t})]}),e.jsxs(y.Box,{direction:"column",gap:"lg",padding:"md",overflow:"overflow-y-auto",style:{flex:"1 1 auto",minHeight:0},children:[C>0&&e.jsxs(y.Box,{direction:"column",gap:"sm",children:[e.jsx(k.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Filter aktif"}),e.jsx(y.Box,{direction:"row",display:"flex",wrap:"wrap",gap:"sm",align:"center",children:e.jsx(ol,{activeKeys:n,configByKey:o,getValue:a,setValue:d,clearValue:u,removeFilter:p})})]}),l.length>0&&e.jsxs(y.Box,{direction:"column",gap:"sm",children:[e.jsx(k.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Tambah filter"}),e.jsx(y.Box,{direction:"column",children:l.map(v=>{const T=n.includes(v.key),b=!!v.locked;return e.jsxs(y.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",paddingBlock:"sm",style:{opacity:b?.5:1,borderTop:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.08))"},children:[e.jsxs(y.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{minWidth:0},children:[v.icon&&e.jsx(y.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:v.icon}),e.jsx(k.Text,{fontSize:"sm",color:"primary",truncate:!0,children:v.label})]}),e.jsx(lr.Toggle,{size:"sm",checked:T||b,disabled:b,onChange:()=>s(v.key),"aria-label":`Toggle ${v.label}`})]},v.key)})})]})]}),e.jsxs(y.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(y.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(H.Button,{variant:"outline",tone:"neutral",size:"md",fullWidth:!0,disabled:!c,onClick:i,children:"Reset"})}),e.jsx(y.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(H.Button,{variant:"primary",tone:"brand",size:"md",fullWidth:!0,onClick:t,children:"Selesai"})})]})]})})},Eo=r=>`${r} Rows`,Mo=({perPageKey:r,pageKey:t,pageSizeOptions:l,defaultPerPage:n=10,showPageSize:o})=>{const{searchQueries:c,setSearchParams:s,searchParams:i}=Be(),a=i.get(r),d=a?Number(a):n,u=p=>{s({...c,[r]:p,[t]:"1"})};return o?e.jsxs(I.Menu,{position:"bottom-right",children:[e.jsx(I.MenuButton,{children:e.jsx(H.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"MenuVertical",size:"sm"}),"aria-label":"More options"})}),e.jsx(I.MenuLists,{children:e.jsxs(I.MenuBody,{style:{minWidth:200},children:[e.jsx(y.Box,{paddingInline:"sm",paddingBlock:"xs",children:e.jsx(k.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Rows per page"})}),l.map(p=>e.jsx(I.MenuItem,{selected:p===d,endIcon:p===d?e.jsx(F.Icon,{name:"Check"}):void 0,onClick:()=>u(String(p)),children:Eo(p)},p))]})})]}):null},Lo=r=>{var Ee;const{withPadding:t,configs:l,activeKeys:n,configByKey:o,hasActiveFilter:c,toggleFilter:s,removeFilter:i,getValue:a,setValue:d,clearValue:u,onReset:p,searchable:C,searchKey:v,filterKey:T,pageKey:b,searchPlaceholder:B,searchShortcut:E,pagination:S,perPageKey:V,pageSizeOptions:w,defaultPerPage:z,showPagination:W,showResultCount:D,showPageSize:O,hasColumns:q,orderedColumns:U,allVisible:G,onToggleVisibility:$,onReorder:te,onSetAllHidden:he,showSavedViews:ie,savedViews:se,onApplyView:ee,onDeleteView:P,onSaveView:le}=r,[pe,fe]=h.useState(!1),{searchQueries:ge,setSearchParams:me}=Be(),We=(S==null?void 0:S.rangeStart)??(((S==null?void 0:S.currentPage)||0)>1?(((S==null?void 0:S.currentPage)||0)-1)*((S==null?void 0:S.perPage)||0)+1:1),Pe=(S==null?void 0:S.rangeEnd)??((S==null?void 0:S.totalCurrentPage)!==(S==null?void 0:S.perPage)?S==null?void 0:S.totalData:((S==null?void 0:S.currentPage)||1)*((S==null?void 0:S.totalCurrentPage)||0)),je=ze=>{me({...ge,[b]:String(ze)})},we=D||W&&!!(S!=null&&S.totalPage),De=()=>{p(),fe(!1)};return e.jsxs(y.Box,{direction:"column",gap:"sm",fullWidth:!0,paddingTop:t?"sm":void 0,paddingBottom:t?"sm":void 0,paddingLeft:t?"md":void 0,paddingRight:t?"md":void 0,role:"toolbar","aria-label":"Filter bar",children:[e.jsxs(y.Box,{direction:"row",display:"flex",align:"center",wrap:"wrap",gap:"sm",fullWidth:!0,overflow:"overflow-auto",children:[C&&e.jsx(cl,{searchKey:v,filterKey:T,pageKey:b,placeholder:B,shortcut:E}),e.jsx(H.Button,{variant:c?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"FilterHorizontal"}),onClick:()=>fe(!0),"aria-label":"Open filters",children:c?`Filter: ${n.length}`:null}),e.jsxs(y.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{marginLeft:"auto"},children:[ie&&e.jsx(sl,{views:se,onApply:ee,onDelete:P,onSave:le}),q&&e.jsx(il,{columns:U,allVisible:G,onToggle:$,onReorder:te,onSetAllHidden:he}),e.jsx(Mo,{perPageKey:V,pageKey:b,pageSizeOptions:w,defaultPerPage:z,showPageSize:O})]})]}),we&&e.jsxs(y.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",fullWidth:!0,children:[D?e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${We}-${Pe} of ${((Ee=S==null?void 0:S.totalData)==null?void 0:Ee.toLocaleString())||0}`}):e.jsx(y.Box,{direction:"column"}),W&&!!(S!=null&&S.totalPage)&&e.jsx(sr.Pagination,{size:"xs",variant:"neutral",siblingCount:0,currentPage:S!=null&&S.currentPage?Number(S.currentPage):1,totalPages:Number(S.totalPage),onPageChange:je})]}),e.jsx(Fo,{isOpen:pe,onClose:()=>fe(!1),configs:l,activeKeys:n,configByKey:o,hasActiveFilter:c,onToggle:s,onReset:De,getValue:a,setValue:d,clearValue:u,removeFilter:i})]})},Io=({withPadding:r=!1,filterConfigs:t=[],filterKey:l="filter",activeFilterKey:n="filters",pageKey:o="page",perPageKey:c="perPage",pageSizeOptions:s=[25,50,100],defaultPerPage:i,showPagination:a=!0,showResultCount:d=!0,showPageSize:u=!0,searchable:p=!1,searchKey:C="q",searchPlaceholder:v="Search",searchShortcut:T="/",pagination:b,columns:B=[],onColumnsChange:E,columnsState:S,scopeId:V,savedViews:w,persistLastState:z=!0,storage:W=Yr,onReset:D})=>{const O=V??(w==null?void 0:w.scopeId),{activeKeys:q,configByKey:U,hasActiveFilter:G,toggleFilter:$,removeFilter:te,getValue:he,setValue:ie,clearValue:se,clearAll:ee}=Jr({configs:t,filterKey:l,activeFilterKey:n,pageKey:o,searchKey:C}),P=ro({columns:B,scopeId:O,storage:W,onColumnsChange:E,value:S}),le=to({scopeId:O,storage:W,snapshotKeys:[n,l,c],pageKey:o,getColumns:()=>P.state,applyColumns:P.applyState}),pe=lo({scopeId:O,storage:W,snapshotKeys:[n,l,o],enabled:z}),fe=oo({scopeId:O,storage:W,perPageKey:c,pageSizeOptions:s,enabled:z});co({enabled:z&&!!O,snapshotKeys:[n,l,o],perPageKey:c,readSnapshot:pe.read,readPerPage:fe.read});const ge=i??s[0]??25,me=!!(w!=null&&w.enabled)&&le.enabled,We=()=>{ee(),pe.clear(),D==null||D()};return ue.useMediaQuery("md")?e.jsxs(y.Box,{display:"flex",direction:"row",align:"center",gap:"sm",wrap:"wrap",fullWidth:!0,paddingTop:r?"sm":void 0,paddingBottom:r?"sm":void 0,paddingLeft:r?"md":void 0,paddingRight:r?"md":void 0,role:"toolbar","aria-label":"Filter bar",children:[e.jsxs(y.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(io,{configs:t,activeKeys:q,onToggle:$,hasActiveFilter:G,onReset:We}),e.jsxs(y.Box,{direction:"row",display:"flex",align:"center",gap:"sm",overflow:"overflow-x-auto",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(ol,{activeKeys:q,configByKey:U,getValue:he,setValue:ie,clearValue:se,removeFilter:te}),G&&e.jsx(H.Button,{variant:"link",tone:"brand",size:"sm",onClick:We,children:"Reset"})]})]}),e.jsxs(y.Box,{direction:"row",display:"flex",align:"center",gap:"sm",children:[e.jsx(ko,{pagination:b,pageKey:o,perPageKey:c,pageSizeOptions:s,defaultPerPage:ge,showPagination:a,showResultCount:d,showPageSize:u}),p&&e.jsx(cl,{searchKey:C,filterKey:l,pageKey:o,placeholder:v,shortcut:T}),me&&e.jsx(sl,{views:le.views,onApply:le.applyView,onDelete:le.deleteView,onSave:le.saveView}),B.length>0&&e.jsx(il,{columns:P.orderedColumns,allVisible:P.allVisible,onToggle:P.toggleVisibility,onReorder:P.reorder,onSetAllHidden:P.setAllHidden})]})]}):e.jsx(Lo,{withPadding:r,configs:t,activeKeys:q,configByKey:U,hasActiveFilter:G,toggleFilter:$,removeFilter:te,getValue:he,setValue:ie,clearValue:se,onReset:We,searchable:p,searchKey:C,filterKey:l,pageKey:o,searchPlaceholder:v,searchShortcut:T,pagination:b,perPageKey:c,pageSizeOptions:s,defaultPerPage:ge,showPagination:a,showResultCount:d,showPageSize:u,hasColumns:B.length>0,orderedColumns:P.orderedColumns,allVisible:P.allVisible,onToggleVisibility:P.toggleVisibility,onReorder:P.reorder,onSetAllHidden:P.setAllHidden,showSavedViews:me,savedViews:le.views,onApplyView:le.applyView,onDeleteView:le.deleteView,onSaveView:le.saveView})},To=r=>{if(!Array.isArray(r)||r.length===0)return;const t=r[0];return(t==null?void 0:t.value)!=null?String(t.value):void 0},Oo=r=>{if(!Array.isArray(r)||r.length===0)return;const t=r.map(l=>(l==null?void 0:l.value)!=null?String(l.value):null).filter(l=>l!=null);return t.length?t:void 0},Wo=(r,t)=>{switch(r.type){case"dropdown":case"radio":return To(t);case"dropdown-multiple":case"checkbox-multiple":return Oo(t);case"date":return t instanceof Date?t.toISOString():void 0;case"date-compact":return t;default:return}},al=(r,t)=>{if(r==null||r==="")return t;const l=Number(r);return Number.isFinite(l)&&l>0?l:t},zo=r=>{const{filterConfigs:t,filterKey:l="filter",activeFilterKey:n="filters",pageKey:o="page",perPageKey:c="perPage",searchKey:s="q",defaultPage:i=1,defaultPerPage:a=10,paramKeys:d,serialize:u}=r,{activeKeys:p,configByKey:C,hasActiveFilter:v,getValue:T}=Jr({configs:t,filterKey:l,activeFilterKey:n,pageKey:o,searchKey:s}),{searchParams:b}=Be(),B=b.toString();return h.useMemo(()=>{const S={},V={},w=al(b.get(o),i),z=al(b.get(c),a);S[(d==null?void 0:d.page)??"page"]=w,S[(d==null?void 0:d.perPage)??"perPage"]=z;const W=xr(s,b,l)||"";W&&(S[(d==null?void 0:d.search)??"search"]=W);let D=!1;for(const O of p){const q=C[O];if(!q)continue;const U=T(q);V[O]=U;const G=u==null?void 0:u[O],$=G?G(U):Wo(q,U);if($==null||Array.isArray($)&&$.length===0)continue;const te=(d==null?void 0:d[O])??O;S[te]=$,D=!0}return{params:S,raw:V,hasActiveFilter:v||!!W||D}},[B,p.join("|"),l,n,o,c,s,i,a,d,u,C])},Ao=["dropdown","dropdown-multiple","checkbox-multiple","radio"],Vo=({filterConfigs:r,filterKey:t,activeFilterKey:l,pageKey:n,searchKey:o})=>{const{configByKey:c,getValue:s,setValue:i,removeFilter:a,clearAll:d,hasActiveFilter:u}=Jr({configs:r,filterKey:t,activeFilterKey:l,pageKey:n,searchKey:o}),p=(E,S)=>{var w;const V=E.options;return((w=V==null?void 0:V.find(z=>z.value===S))==null?void 0:w.label)??S},C=h.useCallback(E=>{const S=c[E];if(!S)return[];const V=s(S);return Array.isArray(V)?V.map(w=>String(w.value)):[]},[c,s]),v=h.useCallback((E,S)=>{const V=c[E];if(!V||!Ao.includes(V.type))return;const w=Array.isArray(S)?S:[S];if(w.length===0){a(E);return}i(V,w.map(z=>({label:p(V,z),value:z})))},[c,i,a]),T=h.useCallback((E,S)=>{const V=C(E);v(E,V.includes(S)?V.filter(w=>w!==S):[...V,S])},[C,v]),b=h.useCallback((E,S)=>C(E).includes(S),[C]),B=h.useCallback(E=>a(E),[a]);return{set:v,toggle:T,clear:B,clearAll:d,isActive:b,values:C,hasActiveFilter:u}},Ho=(r,t)=>{if(!r)return{};const{fromKey:l,toKey:n,opKey:o}=t,c={};switch(r.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return r.date&&(c[l]=new Date(r.date).toISOString()),o&&(c[o]=r.op),c;case"is-between":return r.from&&(c[l]=new Date(r.from).toISOString()),r.to&&(c[n]=new Date(r.to).toISOString()),c;case"is-relative-to-today":{if(!r.relative)return c;const{from:s,to:i}=$t(r.relative);return c[l]=s.toISOString(),c[n]=i.toISOString(),c}case"is-empty":case"is-not-empty":return o&&(c[o]=r.op==="is-empty"?"empty":"not-empty"),c;default:return c}},dl=({children:r,borderRadius:t,height:l})=>{const n=h.useRef(null),[o,c]=h.useState("100vh");return h.useEffect(()=>{if(l)return;const s=()=>{if(n.current){const i=n.current.getBoundingClientRect().top;c(`calc(100vh - ${i}px)`)}};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[l]),e.jsx(y.Box,{ref:n,fullWidth:!0,borderStyle:"border-solid",borderWidth:"border",borderColor:"border-base",borderRadius:t||"rounded-xs",style:{height:l??o,display:"flex",flexDirection:"column"},children:r})},hl=({action:r,rightContent:t,leftContent:l,headerSlot:n,advanceFilter:o,showFilter:c=!0})=>{const s=ue.useMediaQuery("md"),i=c?e.jsx(Xt,{...o}):null,a=()=>r?h.isValidElement(r)?r:e.jsx(y.Box,{style:{display:"flex",flexDirection:s?"row":"column",gap:"8px",width:s?"auto":"100%",textWrap:"nowrap"},children:r.map(({title:d,icon:u,buttonProps:p,onClick:C},v)=>!d&&!u?null:e.jsx(H.Button,{fullWidth:!s,iconLeft:u?e.jsx(F.Icon,{name:u}):void 0,onClick:C,...p,children:d},`action-${v}`))}):null;return e.jsx(y.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:s?"row":"column-reverse",gap:"16px"},children:n?n({filter:i}):e.jsxs(e.Fragment,{children:[e.jsxs(y.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flex:1,minWidth:0},children:[i,l]}),e.jsxs(y.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flexShrink:0},children:[t,a()]})]})})},Po=({totalData:r,withMarginBottom:t=!0,withMarginTop:l=!0})=>e.jsxs(y.Box,{style:{display:"flex",gap:"4px",flexDirection:"row",alignItems:"center",marginBottom:t?"16px":void 0,marginTop:l?"16px":void 0},children:[e.jsxs(Ie.Body1,{props:{color:"gray-500"},children:["Total data:"," "]}),e.jsx(Ie.Body1,{children:r||0})]}),fl=({pagination:r,pageKey:t="page",perPageKey:l="perPage",defaultPerPage:n=10,showPagination:o=!0,totalData:c})=>{const{searchQueries:s,setSearchParams:i,searchParams:a}=Be(),d=a.get(l),u=T=>{i({...s,[t]:String(T)})},p=T=>{i({...s,[l]:T,[t]:"1"})},C=(r==null?void 0:r.rangeStart)??(((r==null?void 0:r.currentPage)||0)>1?(((r==null?void 0:r.currentPage)||0)-1)*((r==null?void 0:r.perPage)||0)+1:1),v=(r==null?void 0:r.rangeEnd)??((r==null?void 0:r.totalCurrentPage)!==(r==null?void 0:r.perPage)?r==null?void 0:r.totalData:((r==null?void 0:r.currentPage)||1)*((r==null?void 0:r.totalCurrentPage)||0));return e.jsx(y.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(y.Box,{style:{display:"flex",flexDirection:"row",gap:"8px",alignItems:"center",textWrap:"nowrap"},children:[e.jsx(k.Text,{children:"Rows Per Page: "}),e.jsx(er.Dropdown,{dropdownLists:[{label:"5",value:"5"},{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"},{label:"100",value:"100"}],onChange:T=>{p(T[0].value)},value:d?[{label:`${d} per row`,value:d}]:[{label:`${n} per row`,value:`${n}`}],defaultValue:d?[{label:`${d} per row`,value:d}]:[{label:`${n} per row`,value:`${n}`}]}),e.jsx(k.Text,{children:`${C}-${v} of ${(r==null?void 0:r.totalData)||0}`})]}),e.jsx(sr.Pagination,{currentPage:r!=null&&r.currentPage?Number(r==null?void 0:r.currentPage):1,totalPages:r!=null&&r.totalPage?Number(r==null?void 0:r.totalPage):1,onPageChange:u})]}):e.jsx(Po,{totalData:c,withMarginBottom:!1,withMarginTop:!1})})},gl=({filter:r,columnTitle:t})=>{const[l,n]=h.useState(!1),o=h.useRef(null),c=h.useRef(null),s=h.useRef(null),[i,a]=h.useState(""),[d,u]=h.useState({top:0,left:0}),p=r.selectedValues,C=h.useMemo(()=>i?r.options.filter(b=>b.label.toLowerCase().includes(i.toLowerCase())):r.options,[r.options,i]);h.useEffect(()=>{if(l&&c.current){const b=c.current.getBoundingClientRect(),B=280,E={top:b.bottom+8};r.position==="left"||b.left+B>window.innerWidth?E.right=window.innerWidth-b.right:E.left=b.left,u(E)}},[l,r.position]),h.useEffect(()=>{l&&s.current?setTimeout(()=>{var b;return(b=s.current)==null?void 0:b.focus()},50):a("")},[l]),h.useEffect(()=>{const b=B=>{o.current&&!o.current.contains(B.target)&&c.current&&!c.current.contains(B.target)&&n(!1)};return l&&document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[l]);const v=b=>{const B=p.includes(b)?p.filter(E=>E!==b):[...p,b];r.onFilterChange(B)},T=()=>r.onFilterChange([]);return e.jsxs(y.Box,{direction:"column",style:{position:"relative"},children:[e.jsx(y.Box,{ref:c,style:{display:"flex",flexDirection:"row",alignItems:"center",cursor:"pointer"},onClick:b=>{var B;b.stopPropagation(),l||(B=r.onOpen)==null||B.call(r),n(E=>!E)},children:e.jsx(F.Icon,{name:l?"ChevronUp":"ChevronDown",size:"sm",style:{color:p.length>0?"var(--sa-color-brand-500, #1a4fa0)":"var(--sa-text-subtle, #8c8f97)"}})}),l&&e.jsxs(y.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(y.Box,{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingTop:"12px",paddingBottom:"12px",paddingLeft:"16px",paddingRight:"16px",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"},children:[e.jsxs(k.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-700",children:["Filter ",t]}),p.length>0&&e.jsx(y.Box,{direction:"column",style:{cursor:"pointer"},children:e.jsx(k.Text,{fontSize:"xs",color:"primary",fontWeight:"semibold",onClick:b=>{b.stopPropagation(),T()},children:"CLEAR"})})]}),!r.hideSearch&&e.jsx(y.Box,{direction:"column",style:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px"},children:e.jsx(Ge.Input,{ref:s,placeholder:`Search ${t.toLowerCase()}...`,leftIcon:e.jsx(F.Icon,{name:"Search",size:"sm"}),value:i,onChange:b=>a(b.target.value),style:{fontSize:"14px"}})}),e.jsx(y.Box,{direction:"column",className:"ts-filter-dropdown-options",style:{overflowY:"auto",maxHeight:"250px",paddingLeft:"8px",paddingRight:"8px"},children:r.isLoadingOptions?e.jsxs(y.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(F.Icon,{name:"Loading",size:"lg",style:{color:"var(--sa-background-brand, #04254f)",animation:"spin 1s linear infinite"}}),e.jsx(k.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"Loading options..."})]}):C.length>0?e.jsx(y.Box,{direction:"column",style:{gap:"2px",paddingTop:"4px",paddingBottom:"4px"},children:C.map(b=>e.jsxs(y.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:p.includes(b.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent"},onClick:B=>{B.stopPropagation(),v(b.value)},onMouseEnter:B=>{p.includes(b.value)||(B.currentTarget.style.backgroundColor="var(--sa-background-primary, #ffffff)"),B.currentTarget.style.transform="translateX(2px)"},onMouseLeave:B=>{B.currentTarget.style.backgroundColor=p.includes(b.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent",B.currentTarget.style.transform="translateX(0)"},children:[e.jsx(or.Checkbox,{checked:p.includes(b.value),onChange:()=>{}}),e.jsx(k.Text,{fontSize:"sm",fontWeight:p.includes(b.value)?"medium":"normal",color:p.includes(b.value)?"primary":"gray-700",children:b.label})]},b.value))}):e.jsxs(y.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(F.Icon,{name:"Search",size:"lg",style:{color:"var(--sa-text-subtle, #8c8f97)"}}),e.jsx(k.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"No results found"})]})}),p.length>0&&e.jsx(y.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(y.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsx(y.Box,{direction:"column",style:{backgroundColor:"var(--sa-background-brand, #04254f)",borderRadius:"12px",padding:"2px 8px",fontSize:"11px",fontWeight:600,color:"white"},children:p.length}),e.jsxs(k.Text,{fontSize:"xs",color:"primary",fontWeight:"medium",children:["item",p.length>1?"s":""," selected"]})]})})]})]})},jo=({direction:r})=>{const t="var(--sa-text-primary, #292a2e)",l="var(--sa-text-subtle, #8c8f97)",n=r==="asc"?t:l,o=r==="desc"?t:l,c=r==="asc"?1:.45,s=r==="desc"?1:.45;return e.jsxs("span",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flexShrink:0,lineHeight:0},"aria-hidden":!0,children:[e.jsx("svg",{width:"8",height:"5",viewBox:"0 0 8 5",style:{color:n,opacity:c,marginBottom:1},children:e.jsx("path",{d:"M4 0 L8 5 L0 5 Z",fill:"currentColor"})}),e.jsx("svg",{width:"8",height:"5",viewBox:"0 0 8 5",style:{color:o,opacity:s},children:e.jsx("path",{d:"M0 0 L8 0 L4 5 Z",fill:"currentColor"})})]})},No=({frozen:r})=>e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:r?"currentColor":"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e.jsx("path",{d:r?"M7 11V7a5 5 0 0 1 10 0v4":"M7 11V7a5 5 0 0 1 9.9-1"})]}),et="var(--sa-background-primary, #ffffff)",ul="var(--sa-background-primary-inverse, #f8f8f8)",yl=({columns:r,records:t,handleDetail:l,handleUpdate:n,handleDelete:o,isLoading:c,visibleHandleDelete:s,visibleHandleUpdate:i,visibleHandleDetail:a,showHeadBorder:d=!1,scrollParentRef:u,frozenCount:p=0,onFrozenCountChange:C,customActions:v,actionsOrder:T=["detail","update","delete","custom"],customEmptyState:b,enableColumnResize:B=!1,defaultColumnWidths:E,onColumnWidthsChange:S,defaultMinColumnWidth:V=60,sort:w,defaultSort:z,onSortChange:W,showActionDivider:D=!1})=>{const O=w!==void 0,[q,U]=h.useState(z??null),G=O?w??null:q,$=M=>{if(M.sortKey)return M.sortKey;if(typeof M.accessor=="string")return M.accessor},te=M=>{const Q=$(M);if(!Q)return;let N;!G||G.key!==Q?N={key:Q,direction:"asc"}:G.direction==="asc"?N={key:Q,direction:"desc"}:N=null,O||U(N),W==null||W(N)},ie=[l,n,o].filter(M=>M!==void 0).length,se=!!v,ee=!!l||!!n||!!o||se,P="var(--sa-border-subtle, #0b120e24)",le=`1px solid ${P}`,pe=`inset 1px 0 0 ${P}`,fe=`inset -1px 0 0 ${P}`,ge=ie===3?se?"178px":"140px":ie===2?se?"140px":"102px":ie===1?se?"112px":"74px":se?"74px":"",me=(M,Q)=>{if(!Q)return M;if(typeof Q=="function")return Q(M);if(typeof Q=="string")return M[Q]},[We,Pe]=h.useState(!1);h.useEffect(()=>{if(!(u!=null&&u.current))return;const M=u.current;Pe(M.scrollHeight>M.clientHeight)},[t,u]);const je=h.useRef(null),[we,De]=h.useState([]),[Ee,ze]=h.useState(()=>E??{}),Qe=h.useRef(null);h.useLayoutEffect(()=>{if(!p||!je.current){De([]);return}const M=Array.from(je.current.querySelectorAll("thead tr th")),Q=[];let N=0;M.forEach((Z,X)=>{Q[X]=N,X<p&&(N+=Z.offsetWidth)}),De(Q)},[p,r,t,Ee]);const cr=M=>{C&&C(M<p?M:M+1)},m=(M,Q)=>{const N=Ee[M];if(N!==void 0){const Z=`${N}px`;return{width:Z,minWidth:Z,maxWidth:Z}}return Q?{width:Q}:{}},_=M=>B&&(M.resizable??!0),j=(M,Q)=>{M.preventDefault(),M.stopPropagation();const N=M.currentTarget.closest("th");if(!N)return;const Z=Math.round(N.getBoundingClientRect().width);Qe.current={colIndex:Q,startX:M.clientX,startWidth:Z};const X=document.body.style.userSelect,Ce=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";const ke=Me=>{var qe;const Te=Qe.current;if(!Te)return;const gr=((qe=r[Te.colIndex])==null?void 0:qe.minWidth)??V,Ve=Math.max(gr,Te.startWidth+(Me.clientX-Te.startX));ze(Ne=>Ne[Te.colIndex]===Ve?Ne:{...Ne,[Te.colIndex]:Ve})},Ae=()=>{document.removeEventListener("mousemove",ke),document.removeEventListener("mouseup",Ae),document.body.style.userSelect=X,document.body.style.cursor=Ce,Qe.current=null,S&&ze(Me=>(S(Me),Me))};document.addEventListener("mousemove",ke),document.addEventListener("mouseup",Ae)};return e.jsx("div",{ref:je,children:e.jsxs(Y.Table,{fullWidth:!0,children:[e.jsx(Y.Thead,{style:{height:"40px",whiteSpace:"nowrap"},children:e.jsxs(Y.Tr,{children:[r.map((M,Q)=>{var Or,Wr;const N=p>0&&Q<p,Z=we[Q]??0,X=_(M),ke=Q===r.length-1&&ee&&D,Ae=$(M),Me=!!M.sortable&&!!Ae,Te=Me&&(G==null?void 0:G.key)===Ae?G.direction:null,gr=M.title||((Or=M.accessor)==null?void 0:Or.toString())||"",Ve=(Wr=M.headerTooltip)!=null&&Wr.showIcon?e.jsx(F.Icon,{name:"InfoCircle",size:"xs",style:{flexShrink:0,color:"var(--sa-icon-subtle, #8c8f97)",opacity:.75}}):null,qe=e.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:gr}),Ne=Me?e.jsxs("button",{type:"button",onClick:()=>te(M),title:Te==="asc"?"Sorted ascending — click to sort descending":Te==="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:[qe,Ve,e.jsx(jo,{direction:Te})]}):e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4},children:[qe,Ve]});return e.jsxs(Y.Th,{style:{position:"sticky",top:0,left:N?Z:void 0,zIndex:N?4:2,paddingLeft:Q===0?"12px":"",borderRight:d&&!ke&&!N?le:void 0,borderBottom:d?le:void 0,boxShadow:d&&N?fe:void 0,backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",textAlign:M.textAlign==="text-right"?"right":M.textAlign==="text-center"?"center":"left",...m(Q,M.width)},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"space-between",minWidth:0},children:[M.headerTooltip?e.jsx(xe.Tooltip,{label:M.headerTooltip.content,position:"bottom",children:Ne}):Ne,M.filter&&e.jsx(gl,{filter:M.filter,columnTitle:M.title}),C&&e.jsx("button",{onClick:()=>cr(Q),title:N?"Unfreeze column":"Freeze column",style:{background:"none",border:"none",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",flexShrink:0,color:N?"var(--sa-background-brand, #04254f)":"var(--sa-text-subtle, #8c8f97)",opacity:N?1:.45,transition:"opacity 0.15s"},children:e.jsx(No,{frozen:N})})]}),X&&e.jsx("div",{onMouseDown:Ue=>j(Ue,Q),onClick:Ue=>Ue.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-${Q}`)}),ee?e.jsx(Y.Th,{style:{backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",position:"sticky",top:0,right:0,zIndex:3,borderBottom:d?le:void 0,boxShadow:d&&D?pe:void 0}}):null]})}),e.jsx(Y.Tbody,{children:c?e.jsx(Y.Tr,{children:e.jsx(Y.Td,{colSpan:r.length+1,children:e.jsxs(y.Box,{direction:"column",style:{gap:"16px"},children:[e.jsx(Ye.Skeleton,{variant:"list"}),e.jsx(Ye.Skeleton,{variant:"list"}),e.jsx(Ye.Skeleton,{variant:"list"}),e.jsx(Ye.Skeleton,{variant:"list"}),e.jsx(Ye.Skeleton,{variant:"list"})]})})}):!(t!=null&&t.length)&&b?e.jsx(Y.Tr,{children:e.jsx(Y.Td,{colSpan:r.length+1,children:b})}):t==null?void 0:t.map((M,Q)=>e.jsxs(Y.Tr,{style:{transition:"background-color 0.3s ease",padding:0,borderBottom:Q===t.length-1&&We?void 0:"1px solid var(--sa-border-subtle, #0b120e24)"},onMouseEnter:N=>{const Z=N.currentTarget;Z.style.backgroundColor=ul,Array.from(Z.querySelectorAll("td")).forEach(X=>{X.style.position==="sticky"&&(X.style.backgroundColor=ul)})},onMouseLeave:N=>{const Z=N.currentTarget;Z.style.backgroundColor="",Array.from(Z.querySelectorAll("td")).forEach(X=>{X.style.position==="sticky"&&(X.style.backgroundColor=et)})},children:[r.map((N,Z)=>{const X=N.render?N.render(M,Q,t):me(M,N.accessor),Ce=p>0&&Z<p,ke=we[Z]??0,Ae=Ee[Z]!==void 0,Me=Ce&&Z===p-1;return e.jsx(Y.Td,{style:{position:Ce?"sticky":void 0,left:Ce?ke:void 0,zIndex:Ce?1:void 0,backgroundColor:Ce?et:void 0,transition:Ce?"background-color 0.3s ease":void 0,paddingLeft:Z===0?"12px":"",whiteSpace:"nowrap",overflow:Ae?"hidden":void 0,borderLeft:N.showBorderLeft?le:void 0,borderRight:N.showBorderRight?le:void 0,boxShadow:Me?fe:void 0,textAlign:N.textAlign==="text-right"?"right":N.textAlign==="text-center"?"center":"left",...m(Z,N.width)},children:typeof X=="string"?e.jsx(k.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:N.textAlign==="text-right"?"right":N.textAlign==="text-center"?"center":"left"},children:X}):X},`row-${Q}-col-${Z}`)}),ee?e.jsx(Y.Td,{style:{width:ge,position:"sticky",right:0,zIndex:1,backgroundColor:et,boxShadow:D?pe:void 0,transition:"background-color 0.3s ease"},children:e.jsx(ne.Flex,{direction:"row",align:"center",justify:"center",gap:"sm",children:T.map(N=>{const Z=Q===t.length-1?"top":"bottom";return N==="detail"&&l&&(a==null?void 0:a(M))!==!1?e.jsx(xe.Tooltip,{label:"Detail",position:Z,children:e.jsx(H.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>l(M.id,M),iconLeft:e.jsx(F.Icon,{name:"DocumentClean",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"detail"):N==="update"&&n&&(i==null?void 0:i(M))!==!1?e.jsx(xe.Tooltip,{label:"Update",position:Z,children:e.jsx(H.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>n(M),iconLeft:e.jsx(F.Icon,{name:"Edit1",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"update"):N==="delete"&&o&&(s==null?void 0:s(M))!==!1?e.jsx(xe.Tooltip,{label:"Delete",position:Z,children:e.jsx(H.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>o(M.id,M),iconLeft:e.jsx(F.Icon,{name:"Trash1",size:"sm",style:{color:"var(--sa-color-error-600, #c9184a)"}})})},"delete"):N==="custom"?e.jsx(h.Fragment,{children:v==null?void 0:v(M)},"custom"):null})})}):null]},`${M}${Q}`))})]})})},_o=({wrapperProps:r,dataTableProps:t,headerProps:l,footerProps:n})=>{var p;const o=h.useRef(null),[c,s]=h.useState((t==null?void 0:t.defaultFrozenCount)??0),i=(l==null?void 0:l.show)??!0,a=h.useRef(null),d=(p=t==null?void 0:t.pagination)==null?void 0:p.totalData;typeof d=="number"&&(a.current=d);const u=(n==null?void 0:n.showFooter)??(d===void 0?a.current!==0:d!==0);return e.jsxs(dl,{...r,children:[i&&e.jsx(hl,{...l}),e.jsx(y.Box,{direction:"column",ref:o,style:{flex:1,overflowY:"auto",overflowX:"auto"},children:t?e.jsx(yl,{...t,scrollParentRef:o,frozenCount:t!=null&&t.enableFreezeColumns?c:0,onFrozenCountChange:t!=null&&t.enableFreezeColumns?s:void 0}):null}),u&&e.jsx(fl,{pagination:t==null?void 0:t.pagination,pageKey:t==null?void 0:t.pageKey,perPageKey:t==null?void 0:t.perPageKey,defaultPerPage:t==null?void 0:t.defaultPerPage,showPagination:t==null?void 0:t.showPagination,totalData:n==null?void 0:n.totalData})]})};function qo(r){return h.memo(r)}const Zo=qo(_o),pl=200,rt="1px solid var(--sa-border-subtle, #0b120e24)",Go=({sortDir:r,frozen:t})=>r==="asc"?e.jsx(F.Icon,{name:"ChevronSmallUp"}):r==="desc"?e.jsx(F.Icon,{name:"ChevronSmallDown"}):t?e.jsx(F.Icon,{name:"LockOn",size:"xs"}):e.jsx(F.Icon,{name:"Filter",size:"xs"}),Br=({icon:r,label:t,active:l,danger:n,onClick:o})=>{const c=n?"var(--sa-color-error-600, #c9184a)":"var(--sa-text-primary, #292a2e)";return e.jsxs("button",{type:"button",onClick:o,style:{display:"flex",alignItems:"center",gap:12,width:"100%",padding:"8px 12px",background:l?"var(--sa-background-brand-subtlest, #e6edf6)":"none",border:"none",cursor:"pointer",font:"inherit",color:c,textAlign:"left"},onMouseEnter:s=>{l||(s.currentTarget.style.background="var(--sa-background-primary-inverse, #f8f8f8)")},onMouseLeave:s=>{s.currentTarget.style.background=l?"var(--sa-background-brand-subtlest, #e6edf6)":"none"},children:[e.jsx(F.Icon,{name:r,size:"sm",style:{color:c,flexShrink:0}}),e.jsx(k.Text,{as:"span",style:{color:c},children:t})]})},Cl=({active:r,canSort:t,canHide:l,sortDir:n,frozen:o,onSort:c,onClearSort:s,onToggleFreeze:i,onHide:a})=>{const[d,u]=h.useState(!1),p=h.useRef(null),C=h.useRef(null),[v,T]=h.useState({top:0,left:0});h.useEffect(()=>{if(d&&p.current){const B=p.current.getBoundingClientRect(),E=B.left+pl>window.innerWidth;T({top:B.bottom+6,...E?{right:window.innerWidth-B.right}:{left:B.left}})}},[d]),h.useEffect(()=>{if(!d)return;const B=E=>{C.current&&!C.current.contains(E.target)&&p.current&&!p.current.contains(E.target)&&u(!1)};return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[d]);const b=B=>{B(),u(!1)};return e.jsxs(e.Fragment,{children:[e.jsx("button",{ref:p,type:"button",className:"sa-tl-menu-trigger","data-active":r||d?"true":"false",onClick:B=>{B.stopPropagation(),u(E=>!E)},title:"Column options",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:"var(--sa-radii-sm, 6px)",border:rt,background:"var(--sa-background-primary, #ffffff)",cursor:"pointer",color:"var(--sa-text-subtle, #8c8f97)",flexShrink:0},children:e.jsx(Go,{sortDir:n,frozen:o})}),d&&e.jsxs(y.Box,{ref:C,onClick:B=>B.stopPropagation(),style:{position:"fixed",top:`${v.top}px`,...v.left!==void 0?{left:`${v.left}px`}:{right:`${v.right}px`},minWidth:pl,backgroundColor:"var(--sa-background-primary, #ffffff)",border:rt,borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"0 6px 24px rgba(0,0,0,0.12)",zIndex:9999,padding:"4px",display:"flex",flexDirection:"column"},children:[t&&e.jsxs(e.Fragment,{children:[e.jsx(Br,{icon:"ChevronUp",label:"Ascending",active:n==="asc",onClick:()=>b(()=>n==="asc"?s():c("asc"))}),e.jsx(Br,{icon:"ChevronDown",label:"Descending",active:n==="desc",onClick:()=>b(()=>n==="desc"?s():c("desc"))}),e.jsx("div",{style:{borderTop:rt,margin:"4px 0"}})]}),e.jsx(Br,{icon:"Pin1",label:o?"Unfreeze":"Freeze",active:o,onClick:()=>b(i)}),l&&e.jsx(Br,{icon:"EyeClosed",label:"Hide column",danger:!0,onClick:()=>b(a)})]})]})},tt="1px solid var(--sa-border-subtle, #0b120e24)",Qo="var(--sa-text-subtle, #8c8f97)",hr="var(--sa-background-neutral, #f0f1f2)",bl="2px 0 4px -2px rgba(0,0,0,0.15)",mr={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},vl="sa-table-layout-styles",Uo=()=>{if(typeof document>"u"||document.getElementById(vl))return;const r=document.createElement("style");r.id=vl,r.textContent=`
|
|
1
|
+
(function(g,Re){typeof exports=="object"&&typeof module<"u"?Re(exports,require("@starasia/alert"),require("@starasia/badges"),require("@starasia/box"),require("@starasia/breadcrumb"),require("@starasia/button"),require("@starasia/card"),require("@starasia/date"),require("@starasia/dialog"),require("@starasia/drawer"),require("@starasia/dropdown"),require("@starasia/hooks"),require("@starasia/http"),require("@starasia/input"),require("@starasia/menu"),require("@starasia/pagination"),require("@starasia/storage"),require("@starasia/table"),require("@starasia/tabs"),require("@starasia/textarea"),require("@starasia/theme"),require("@starasia/toast"),require("@starasia/toggle"),require("@starasia/tooltip"),require("@starasia/checkbox"),require("@starasia/radio"),require("@starasia/text"),require("@starasia/icon"),require("@starasia/flex"),require("@starasia/grid"),require("@starasia/progress"),require("@starasia/stepper"),require("@starasia/accordion"),require("@starasia/story-record"),require("@starasia/skeleton"),require("@starasia/progress-stepper"),require("react/jsx-runtime"),require("react"),require("react-router"),require("react-dom"),require("react-easy-crop")):typeof define=="function"&&define.amd?define(["exports","@starasia/alert","@starasia/badges","@starasia/box","@starasia/breadcrumb","@starasia/button","@starasia/card","@starasia/date","@starasia/dialog","@starasia/drawer","@starasia/dropdown","@starasia/hooks","@starasia/http","@starasia/input","@starasia/menu","@starasia/pagination","@starasia/storage","@starasia/table","@starasia/tabs","@starasia/textarea","@starasia/theme","@starasia/toast","@starasia/toggle","@starasia/tooltip","@starasia/checkbox","@starasia/radio","@starasia/text","@starasia/icon","@starasia/flex","@starasia/grid","@starasia/progress","@starasia/stepper","@starasia/accordion","@starasia/story-record","@starasia/skeleton","@starasia/progress-stepper","react/jsx-runtime","react","react-router","react-dom","react-easy-crop"],Re):(g=typeof globalThis<"u"?globalThis:g||self,Re(g["@starasia/admin"]={},g.alert,g.badges,g.box,g.breadcrumb,g.button,g.card,g.date,g.dialog,g.drawer,g.dropdown,g.hooks,g.http,g.input,g.menu,g.pagination,g.storage,g.table,g.tabs,g.textarea,g.theme,g.toast,g.toggle,g.tooltip,g.checkbox,g.radio,g.text,g.icon,g.flex,g.grid,g.progress,g.stepper,g.accordion,g.storyRecord,g.skeleton,g.progressStepper,g.jsxRuntime,g.React,g.ReactRouter,g.ReactDOM,g.ReactEasyCrop))})(this,function(g,Re,Ze,u,er,P,gt,Qe,Le,pr,rr,ue,tr,Ge,I,hr,fr,J,ut,Pr,lr,yt,or,De,nr,jr,k,F,ne,pt,Ct,bt,vt,xt,Ve,wt,e,h,ye,Nr,Ll){"use strict";const Tl={menus:[],menuBottom:void 0,logo:"",appName:"Workspace",userData:null,setUserData:()=>{}},_r=h.createContext(Tl),qr=()=>h.useContext(_r),Dt=r=>{const[t,l]=h.useState((r==null?void 0:r.initialUserData)||null);return{userData:t,setUserData:l}},St=h.createContext({badges:{},setBadge:()=>{},setBadges:()=>{},clearBadge:()=>{}}),kt=({children:r})=>{const[t,l]=h.useState({}),n=h.useCallback(i=>{l(a=>typeof i=="function"?i(a):i)},[]),o=h.useCallback((i,a)=>{l(d=>{const y=typeof a=="function"?a(d[i]):a;return{...d,[i]:y}})},[]),c=h.useCallback(i=>{l(a=>{if(!(i in a))return a;const d={...a};return delete d[i],d})},[]),s=h.useMemo(()=>({badges:t,setBadge:o,setBadges:n,clearBadge:c}),[t,o,n,c]);return e.jsx(St.Provider,{value:s,children:r})},Bt=()=>h.useContext(St),Cr=(r,t)=>{const l=t!==void 0?t:r;return l==null?null:typeof l=="string"||typeof l=="number"?{value:l}:l},mt=({router:r,menus:t=[],menuBottom:l,logo:n,appName:o="Workspace",initialUserData:c,theme:s})=>{const i=Dt({initialUserData:c}),{theme:a}=lr.useTheme();return e.jsx(_r.Provider,{value:{logo:n,appName:o,menus:t,userData:i.userData,setUserData:i.setUserData,menuBottom:l},children:e.jsx(kt,{children:s?e.jsx(lr.ThemeProvider,{value:s,children:r}):a?e.jsx(lr.ThemeProvider,{value:a,children:r}):r})})},Il=h.memo(mt);function Ft({collapsed:r=!1,children:t}){if(!t)return null;const l=typeof t=="function",n=l?t({collapsed:r}):t;return n==null||n===!1?null:e.jsx("div",{style:{position:"sticky",top:"4rem",zIndex:1,borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",paddingLeft:"0.5rem",paddingRight:"0.5rem",paddingTop:"0.5rem",paddingBottom:"0.5rem",boxSizing:"border-box"},children:l?n:e.jsx("div",{style:{opacity:r?0:1,transition:"opacity 0.3s",visibility:r?"hidden":"visible"},children:n})})}const Zr=h.createContext(null);function Et({children:r}){const[t,l]=h.useState(null),[n,o]=h.useState(null),[c,s]=h.useState(null),[i,a]=h.useState(0),d=h.useCallback(()=>(a(y=>y+1),()=>a(y=>y-1)),[]);return e.jsx(Zr.Provider,{value:{prependNode:t,appendNode:n,replaceNode:c,setPrependNode:l,setAppendNode:o,setReplaceNode:s,replaceCount:i,registerReplace:d},children:r})}function Mt({children:r}){const t=h.useContext(Zr);return t?e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:t.setPrependNode,style:{display:"contents"}}),t.replaceCount>0?e.jsx("div",{ref:t.setReplaceNode,style:{display:"contents"}}):r,e.jsx("div",{ref:t.setAppendNode,style:{display:"contents"}})]}):e.jsx(e.Fragment,{children:r})}function Ol({children:r,mode:t="append"}){const l=h.useContext(Zr);if(h.useEffect(()=>{if(!(t!=="replace"||!l))return l.registerReplace()},[t,l]),!l)return process.env.NODE_ENV!=="production"&&console.warn("[HeaderLeftSlot] used outside AppLayout — content not rendered"),null;const n=t==="prepend"?l.prependNode:t==="replace"?l.replaceNode:l.appendNode;return n?Nr.createPortal(r,n):null}const Gr=h.createContext(null);function Lt({children:r}){const[t,l]=h.useState({}),[n,o]=h.useState({}),c=h.useCallback((a,d)=>{l(y=>y[a]===d?y:{...y,[a]:d})},[]),s=h.useCallback(a=>(o(d=>({...d,[a]:(d[a]??0)+1})),()=>o(d=>({...d,[a]:Math.max(0,(d[a]??0)-1)}))),[]),i=h.useMemo(()=>({outletNodes:t,setOutletNode:c,slotCounts:n,registerSlot:s}),[t,c,n,s]);return e.jsx(Gr.Provider,{value:i,children:r})}function Tt({slotKey:r,fallback:t}){const l=h.useContext(Gr),n=l?(l.slotCounts[r]??0)>0:!1,o=h.useRef(l==null?void 0:l.setOutletNode);o.current=l==null?void 0:l.setOutletNode;const c=h.useCallback(s=>{var i;return(i=o.current)==null?void 0:i.call(o,r,s)},[r]);return e.jsx(e.Fragment,{children:n?e.jsx("div",{ref:c,style:{display:"contents"}}):t})}function Wl({slotKey:r,children:t}){const l=h.useContext(Gr),n=h.useRef(l==null?void 0:l.registerSlot);if(n.current=l==null?void 0:l.registerSlot,h.useEffect(()=>{var c;return(c=n.current)==null?void 0:c.call(n,r)},[r]),!l)return process.env.NODE_ENV!=="production"&&console.warn("[SidebarGroupSlot] used outside AppLayout — content not rendered"),null;const o=l.outletNodes[r];return o?Nr.createPortal(t,o):null}const br="moduleSwitcherGroupId",Qr="sa-module-switcher-change";function It(){if(typeof window>"u")return null;const r=window.localStorage.getItem(br);if(r===null)return null;const t=Number(r);return Number.isFinite(t)?t:null}function Ot(r){typeof window>"u"||(r===null?window.localStorage.removeItem(br):window.localStorage.setItem(br,String(r)),window.dispatchEvent(new CustomEvent(Qr,{detail:r})))}function Al(){Ot(null)}function Ur(){const[r,t]=h.useState(()=>It());return h.useEffect(()=>{const n=()=>{t(It())},o=c=>{c.key===br&&n()};return window.addEventListener(Qr,n),window.addEventListener("storage",o),()=>{window.removeEventListener(Qr,n),window.removeEventListener("storage",o)}},[]),{selectedGroupId:r,setSelectedGroupId:n=>{Ot(n),t(n)}}}let vr=0,Ue=!1,Wt=new Set;const At=()=>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"})]}),zt={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 zl({children:r,headerLeftSlot:t,profile:l,isLoadingProfile:n,onLogout:o,isLoggingOut:c,loadingComponent:s,sidebarHeaderContent:i,headerActions:a,profileRole:d,profileMenuButtons:y,profileMenuItems:C,logoutButton:p}){var Oe,Je;const[x]=ye.useSearchParams(),O=x.get("embed")==="true",b=qr(),{badges:B}=Bt(),L=ye.useNavigate(),S=ye.useLocation(),w=!ue.useMediaQuery("md"),[V,A]=h.useState(!1),[D,M]=h.useState(!1),[N,Q]=h.useState(!1),[q,$]=h.useState(!1),[ie,pe]=h.useState(()=>new Set(Wt)),[te,de]=h.useState(null),{selectedGroupId:R,setSelectedGroupId:_}=Ur();h.useEffect(()=>{Wt=ie},[ie]);const oe=h.useRef(null),se=h.useRef(null);h.useEffect(()=>{const m=oe.current;if(!m)return;const U=()=>{Ue||(vr=m.scrollTop)};return m.addEventListener("scroll",U),()=>m.removeEventListener("scroll",U)},[]);const fe=()=>{const m=oe.current;m&&vr>0&&(Ue=!0,m.scrollTop=vr,requestAnimationFrame(()=>{Ue=!1}))};h.useLayoutEffect(()=>{Ue=!0,fe();const m=setTimeout(()=>{Ue=!1},300);return()=>clearTimeout(m)},[]),h.useLayoutEffect(()=>{b.menus.length>0&&(vr>0?fe():requestAnimationFrame(()=>{var U;const m=(U=oe.current)==null?void 0:U.querySelector("[data-menu-active='true']");m&&m.scrollIntoView({block:"center",behavior:"instant"})}))},[b.menus]),h.useEffect(()=>{Ue=!0,fe();const m=setTimeout(fe,0),U=setTimeout(fe,50),Z=setTimeout(fe,100),T=setTimeout(fe,200),H=setTimeout(()=>{Ue=!1},300),j=setTimeout(()=>{const G=oe.current,K=G==null?void 0:G.querySelector("[data-menu-active='true']");if(G&&K){const ve=G.getBoundingClientRect(),Be=K.getBoundingClientRect();Be.top>=ve.top&&Be.bottom<=ve.bottom||K.scrollIntoView({block:"center",behavior:"smooth"})}},250);return()=>{clearTimeout(m),clearTimeout(U),clearTimeout(Z),clearTimeout(T),clearTimeout(H),clearTimeout(j)}},[S.pathname]),h.useEffect(()=>{se.current&&(se.current.scrollTop=0)},[S.pathname]),h.useEffect(()=>{w&&Q(!1)},[S.pathname,w]),h.useEffect(()=>{w&&M(!0)},[w]);const Fe=()=>{A(!0)},Ie=()=>{A(!1)},ge=()=>{A(!1),o()},Ee=m=>{const U=[m.to];return m.children&&U.push(...m.children.map(Z=>Z.to)),U},_e=[...b.menus.flatMap(m=>m.items.flatMap(Ee)),...((Oe=b.menuBottom)==null?void 0:Oe.flatMap(Ee))??[]],we=m=>{if(!S.pathname.startsWith(m))return!1;const U=_e.filter(Z=>S.pathname.startsWith(Z)).sort((Z,T)=>T.length-Z.length)[0];return m===U};h.useEffect(()=>{var U;const m=Z=>{var T;(T=Z.children)!=null&&T.some(H=>S.pathname.startsWith(H.to))&&pe(H=>{const j=new Set(H);return j.add(Z.id),j})};b.menus.forEach(Z=>{Z.items.forEach(m)}),(U=b.menuBottom)==null||U.forEach(m)},[S.pathname,b.menus,b.menuBottom]);const qe=m=>{pe(U=>{const Z=new Set(U);return Z.has(m)?Z.delete(m):Z.add(m),Z})};h.useEffect(()=>{b.menus.length!==0&&R!==null&&!b.menus.some(m=>m.id===R)&&_(null)},[b.menus,R,_]);const je=h.useMemo(()=>{if(R!==null)return b.menus.filter(Z=>Z.id===R||Z.parentGroupId===R);const m=b.menus.filter(Z=>Z.parentGroupId===void 0),U=b.menus.filter(Z=>Z.parentGroupId!==void 0).flatMap(Z=>Z.items);return U.length===0?m:[...m,{id:18,name:"Pengaturan",items:U,parentGroupId:void 0}]},[b.menus,R]);if(O)return e.jsx("main",{style:{height:"100vh",overflowY:"auto",backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)"},children:r||e.jsx(ye.Outlet,{})});const be=m=>{const U=m.children&&m.children.length>0,Z=ie.has(m.id),T=U?m.children.some(G=>we(G.to)):we(m.to),H=Cr(m.badge,B[m.id]),j=!!H&&D&&!w;return e.jsxs("div",{"data-menu-active":T||void 0,children:[e.jsxs("button",{onClick:G=>{if(U)if(D&&!w){const K=G.currentTarget.getBoundingClientRect();de({item:m,top:K.top,left:K.right+8})}else qe(m.id);else L(m.to)},style:{width:"100%",display:"flex",alignItems:"center",justifyContent:D&&!w?"center":void 0,gap:"0.5rem",paddingLeft:D&&!w?"0":"0.5rem",paddingRight:D&&!w?"0":"0.5rem",paddingTop:"0.25rem",paddingBottom:"0.25rem",height:"2rem",borderRadius:T?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",border:T?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent",backgroundColor:T?"var(--sa-background-primary, #ffffff)":"transparent",color:"var(--sa-text-primary, #292a2e)",cursor:"pointer"},title:D&&!w?m.title:void 0,onMouseEnter:G=>{T||(G.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:G=>{T||(G.currentTarget.style.backgroundColor="transparent")},children:[e.jsxs("span",{style:{position:"relative",display:"inline-flex",flexShrink:0},children:[e.jsx(F.Icon,{name:m.icon,size:"sm",style:{flexShrink:0}}),j&&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)"}})]}),(!D||w)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{fontSize:"0.875rem",fontWeight:"500",whiteSpace:"nowrap",transition:"opacity 0.3s",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:m.title}),H&&e.jsx(Ze.Badges,{text:String(H.value),variant:H.variant??"info",size:"xs",border:!0}),U&&e.jsx("svg",{style:{width:"1rem",height:"1rem",flexShrink:0,transition:"transform 0.2s",transform:Z?"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"})})]})]}),U&&(!D||w)&&(()=>{const G=m.children.findIndex(K=>we(K.to));return e.jsxs("div",{style:{position:"relative",marginLeft:"0.9375rem",paddingLeft:"1.125rem",overflow:"hidden",transition:"all 0.3s ease-in-out",maxHeight:Z?`${m.children.length*36}px`:"0px",opacity:Z?1:0,marginTop:Z?"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"}}),G>=0&&e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:`${G*32}px`,width:"1.5px",height:"32px",backgroundColor:"var(--sa-text-primary, #292a2e)",transition:"top 0.2s ease-in-out",pointerEvents:"none",zIndex:1}}),m.children.map(K=>{const ve=Cr(K.badge,B[K.id]);return e.jsxs("button",{onClick:()=>L(K.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:we(K.to)?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",backgroundColor:we(K.to)?"var(--sa-background-primary, #ffffff)":"transparent",color:we(K.to)?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",cursor:"pointer",border:we(K.to)?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent"},onMouseEnter:Be=>{we(K.to)||(Be.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:Be=>{we(K.to)||(Be.currentTarget.style.backgroundColor="transparent")},children:[e.jsx(F.Icon,{name:K.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:K.title}),ve&&e.jsx(Ze.Badges,{text:String(ve.value),variant:ve.variant??"info",size:"xs",border:!0})]},K.id)})]})})()]},m.id)};return e.jsx(Lt,{children:e.jsxs(Et,{children:[e.jsxs("div",{style:{display:"flex",height:"100vh",position:"relative","--app-sidebar-width":w?"0px":D?"4.375rem":"16.375rem","--app-footer-zindex":w&&N?"40":"999"},children:[w&&e.jsx("div",{style:{position:"fixed",inset:0,backgroundColor:"var(--sa-color-black-alpha-a50, #181a198f)",zIndex:40,opacity:N?.5:0,pointerEvents:N?"auto":"none",transition:"opacity 0.3s"},onClick:()=>Q(!1)}),e.jsxs("aside",{style:{width:w?"16.375rem":D?"4.375rem":"16.375rem",position:w?"fixed":"relative",...w&&{inset:0,zIndex:50,transform:N?"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:w?void 0:0},children:[e.jsx("div",{onMouseEnter:()=>$(!0),onMouseLeave:()=>$(!1),style:{height:"4rem",display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"1rem",paddingRight:"1rem",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",position:"relative"},children:(()=>{const m=!w&&D&&!N,U=m&&q;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",flex:m?1:void 0,justifyContent:m?"center":void 0,transition:"opacity 0.2s",opacity:U?0:1,pointerEvents:U?"none":"auto"},children:[e.jsx("img",{src:b.logo,alt:"Logo",style:{width:"2rem",height:"2rem",flexShrink:0}}),(!D||N)&&e.jsx("span",{style:{fontWeight:"600",color:"var(--sa-text-primary, #292a2e)",whiteSpace:"nowrap",transition:"opacity 0.3s"},children:b.appName})]}),!w&&!D&&e.jsx("button",{type:"button",onClick:()=>M(!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(At,{})}),m&&e.jsx("button",{type:"button",onClick:()=>M(!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:U?1:0,pointerEvents:U?"auto":"none",transition:"opacity 0.2s"},children:e.jsx("span",{style:{width:"1rem",height:"1rem",display:"inline-flex"},children:e.jsx(At,{})})}),w&&e.jsx("button",{onClick:()=>Q(!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"})})})]})})()}),i&&e.jsx(Ft,{collapsed:w?!1:D,children:i}),e.jsx("div",{ref:oe,style:{flex:1,overflowY:"auto",paddingTop:"1rem",paddingBottom:"1rem"},children:je.map(m=>e.jsxs("div",{style:{marginBottom:"1rem"},children:[!D||w?m.name&&e.jsx("div",{style:{paddingLeft:"1.5rem",paddingRight:"1rem",paddingTop:"0rem",paddingBottom:"0.25rem",fontSize:"0.875rem",fontWeight:"400",color:"var(--sa-text-subtlest, #6b6e76)",transition:"opacity 0.3s",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:m.name}):m.name&&e.jsx("div",{"aria-label":m.name,style:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"0.75rem",paddingBottom:"0.75rem"},children:e.jsx("span",{style:{display:"block",width:"1rem",height:"2px",borderRadius:"1px",backgroundColor:m.color??"var(--sa-background-brand, #04254f)"}})}),e.jsx("div",{style:{paddingLeft:"1rem",paddingRight:"1rem",display:"flex",flexDirection:"column",gap:"var(--sa-spacing-xs, 0.25rem)"},children:m.slotKey?e.jsx(Tt,{slotKey:m.slotKey,fallback:m.items.map(U=>be(U))}):m.items.map(U=>be(U))})]},m.id))}),b.menuBottom&&b.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:b.menuBottom.map(m=>be(m))})]}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[e.jsxs("header",{style:{height:"4rem",backgroundColor:"var(--sa-background-primary, #ffffff)",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"1rem",paddingRight:"1rem",flexShrink:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1rem"},children:[w&&e.jsx("button",{onClick:()=>Q(!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(Mt,{children:t})]}),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:n?"Loading...":(l==null?void 0:l.name)||"unknown"}),e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n?"":(l==null?void 0:l.email)||"unknown"})]}),e.jsx("div",{style:{width:"2.5rem",height:"2.5rem",borderRadius:"9999px",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--sa-background-primary, #ffffff)",fontWeight:600,fontSize:"0.875rem",boxShadow:"var(--sa-shadow-sm, 0 1px 2px 0 #0000000d)",flexShrink:0,backgroundColor:"var(--sa-background-brand, #04254f)"},children:((l==null?void 0:l.name)||"U")[0].toUpperCase()}),e.jsx(F.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:((l==null?void 0:l.name)||"U")[0].toUpperCase()}),e.jsx("p",{style:{margin:0,fontSize:"0.875rem",fontWeight:600,color:"var(--sa-text-primary, #292a2e)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(l==null?void 0:l.name)||"unknown"}),e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(l==null?void 0:l.email)||"unknown"}),d&&e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:d})]})}),(y&&y.length>0||C)&&e.jsxs(I.MenuBody,{children:[y==null?void 0:y.map((m,U)=>e.jsx(I.MenuButton,{children:e.jsxs("button",{type:"button",onClick:m.onClick,style:zt,onMouseEnter:Z=>{Z.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)"},onMouseLeave:Z=>{Z.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(F.Icon,{name:m.icon,size:"md"}),e.jsx("span",{children:m.label})]})},`${m.label}-${U}`)),C]}),p??e.jsx(I.MenuFooter,{children:e.jsx(I.MenuButton,{children:e.jsxs("button",{type:"button",onClick:Fe,style:{...zt,color:"var(--sa-background-error, #c9184a)",fontWeight:500},onMouseEnter:m=>{m.currentTarget.style.backgroundColor="var(--sa-color-error-50, #fff0f3)"},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(F.Icon,{name:"Logout",size:"md",style:{color:"var(--sa-background-error, #c9184a)"}}),e.jsx("span",{children:"Logout"})]})})})]})]})]})]}),e.jsx("main",{ref:se,style:{flex:1,overflowY:"auto"},children:r||e.jsx(ye.Outlet,{})})]})]}),c&&s&&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:s}),e.jsxs(Le.Dialog,{isShow:V,onHide:Ie,children:[e.jsx(Le.DialogTitle,{children:"Confirmation Logout"}),e.jsx(Le.DialogBody,{children:"Are you sure you want to end the session and exit the page?"}),e.jsx(Le.DialogFooter,{children:e.jsx(u.Box,{direction:"column",display:"flex",align:"flex-end",justify:"center",children:e.jsxs(ne.Flex,{direction:"row",gap:"sm",align:"center",children:[e.jsx(u.Box,{direction:"column",children:e.jsx(P.Button,{secondary:!0,onClick:Ie,children:"Cancel"})}),e.jsx(u.Box,{direction:"column",children:e.jsx(P.Button,{primary:!0,onClick:ge,children:"Yes, Sure"})})]})})})]}),te&&e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:()=>de(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}),(Je=te.item.children)==null?void 0:Je.map(m=>{const U=we(m.to),Z=Cr(m.badge,B[m.id]);return e.jsxs("button",{onClick:()=>{L(m.to),de(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:U?"var(--sa-color-gray-100, #f8f8f8)":"transparent",color:U?"var(--sa-text-primary, #292a2e)":"var(--sa-color-gray-800, #505258)",border:"1px solid transparent",cursor:"pointer",fontSize:"0.875rem",fontWeight:500},onMouseEnter:T=>{U||(T.currentTarget.style.backgroundColor="var(--sa-color-gray-100, #f8f8f8)")},onMouseLeave:T=>{U||(T.currentTarget.style.backgroundColor="transparent")},children:[m.icon&&e.jsx(F.Icon,{name:m.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:{flex:1,whiteSpace:"nowrap"},children:m.title}),Z&&e.jsx(Ze.Badges,{text:String(Z.value),variant:Z.variant??"info",size:"xs",border:!0})]},m.id)})]})]})]})})}const xr=h.forwardRef(({children:r,...t},l)=>e.jsx(u.Box,{ref:l,role:"button",cursor:"pointer","aria-pressed":"true",display:"inline-block",tabIndex:0,...t,children:r})),Vt=({title:r,iconName:t,textColor:l,iconColor:n,hoverTextColor:o,hoverIconColor:c})=>{const[s,i]=h.useState(!1),a=n??"var(--sa-text-subtle, #8c8f97)",d=l??"var(--sa-text-subtle, #8c8f97)",y=c??"var(--sa-text-subtle, #8c8f97)",C=o??"var(--sa-text-primary, #292a2e)";return e.jsxs(u.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),style:{cursor:"pointer"},children:[e.jsx(F.Icon,{name:t||"ChevronLeft",size:"xs",style:{color:s?y:a,transition:"color 0.15s ease"}}),e.jsx(k.Text,{variant:"sub-h3",style:{color:s?C:d,transition:"color 0.15s ease"},children:r||"Back"})]})},Vl=({items:r,separator:t="/",iconName:l,iconColor:n,hoverIconColor:o})=>{const[c,s]=h.useState(!1),i=n??"var(--sa-text-subtle, #8c8f97)",a=o??"var(--sa-text-subtle, #8c8f97)",d=r.length>1?r[0]:void 0,y=!!(d!=null&&d.to||d!=null&&d.onClick),C=e.jsx(F.Icon,{name:l||"ChevronLeft",size:"xs",onMouseEnter:y?()=>s(!0):void 0,onMouseLeave:y?()=>s(!1):void 0,style:{color:y&&c?a:i,transition:"color 0.15s ease",cursor:y?"pointer":void 0}}),p=d!=null&&d.to?e.jsx(ye.Link,{to:d.to,replace:!0,style:{textDecoration:"none"},children:C}):d!=null&&d.onClick?e.jsx(xr,{onClick:d.onClick,children:C}):C;return e.jsxs(u.Box,{direction:"row",gap:"xs",align:"center",children:[p,e.jsx(er.Breadcrumb,{separator:t,size:"md",children:r.map((x,O)=>{const b=O===r.length-1;return x.to&&!b?e.jsx(er.BreadcrumbItem,{children:e.jsx(ye.Link,{to:x.to,children:x.label})},O):e.jsx(er.BreadcrumbItem,{currentPage:b,children:e.jsx(er.BreadcrumbLink,{onClick:b?void 0:x.onClick,children:x.label})},O)})})]})},Hl=r=>{const{items:t,separator:l,onClick:n,navigateTo:o,...c}=r;return t&&t.length>0?e.jsx(Vl,{items:t,separator:l,iconName:c.iconName,iconColor:c.iconColor,hoverIconColor:c.hoverIconColor}):o?e.jsx(u.Box,{direction:"row",children:e.jsx(ye.Link,{to:o,replace:!0,style:{textDecoration:"none"},children:e.jsx(Vt,{...c})})}):e.jsx(u.Box,{direction:"row",children:e.jsx(xr,{onClick:n,children:e.jsx(Vt,{...c})})})},Jr=[{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 Ht(r,t,l){return{display:"flex",alignItems:"center",justifyContent:"center",width:"64px",height:"64px",borderRadius:"var(--sa-radii-sm, 6px)",border:r?`2px solid ${l.activeBorder}`:"2px solid var(--sa-color-gray-200, #f0f1f2)",backgroundColor:r?l.activeBg:"var(--sa-color-gray-50, #ffffff)",boxShadow:r?t?`0 8px 20px ${l.activeShadow.replace("0.25","0.35")}`:`0 2px 8px ${l.activeShadow}`:t?"0 8px 20px rgba(0, 0, 0, 0.14)":"0 1px 4px rgba(0, 0, 0, 0.08)",transform:t?"translateY(-3px) scale(1.05)":"translateY(0) scale(1)",transition:"box-shadow 0.2s ease, transform 0.2s ease, background-color 0.15s ease, border-color 0.15s ease"}}const Pt={fontSize:"11px",fontWeight:500,textAlign:"center",overflowWrap:"normal",wordBreak:"normal",color:"var(--sa-background-primary, #ffffff)",lineHeight:"1.3",maxWidth:"80px"},jt={display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",cursor:"pointer",padding:0};function Nt({isShow:r,onHide:t,menus:l,selectedGroupId:n,onSelect:o}){const[c,s]=h.useState(void 0),i=d=>{o(d),t()},a=Jr[0];return e.jsx(Le.Dialog,{isShow:r,onHide:t,style:{width:560,background:"transparent",boxShadow:"none",border:"none"},children:e.jsx(Le.DialogBody,{children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:"16px"},children:[e.jsxs("button",{onClick:()=>i(null),onMouseEnter:()=>s("all"),onMouseLeave:()=>s(void 0),style:jt,children:[e.jsx("div",{style:Ht(n===null,c==="all",a),children:e.jsx("div",{style:{color:a.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(F.Icon,{name:"Grid",size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:Pt,children:"Semua"})]}),l.map((d,y)=>{var b;const C=n===d.id,p=c===d.id,x=((b=d.items[0])==null?void 0:b.icon)??"Grid",O=Jr[(y+1)%Jr.length];return e.jsxs("button",{onClick:()=>i(d.id),onMouseEnter:()=>s(d.id),onMouseLeave:()=>s(void 0),style:jt,children:[e.jsx("div",{style:Ht(C,p,O),children:e.jsx("div",{style:{color:O.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(F.Icon,{name:x,size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:Pt,children:d.name})]},d.id)})]})})})}function Pl({onSelect:r,"aria-label":t="Pilih module"}={}){const l=qr(),n=ye.useNavigate(),{selectedGroupId:o,setSelectedGroupId:c}=Ur(),[s,i]=h.useState(!1),a=d=>{var y;if(c(d),d!==null){const C=l.menus.find(x=>x.id===d),p=(y=C==null?void 0:C.items[0])==null?void 0:y.to;p&&n(p)}r==null||r(d)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{position:"relative"},children:[e.jsx("button",{onClick:()=>i(!0),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"2.25rem",height:"2.25rem",borderRadius:"var(--sa-radii-sm, 0.25rem)",border:"1px solid var(--sa-border-subtle, #0b120e24)",color:"var(--sa-text-subtle, #8c8f97)",backgroundColor:"transparent",cursor:"pointer"},"aria-label":t,onMouseEnter:d=>{d.currentTarget.style.backgroundColor="var(--sa-background-primary-inverse, #f8f8f8)"},onMouseLeave:d=>{d.currentTarget.style.backgroundColor="transparent"},children:e.jsx(F.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(Nt,{isShow:s,onHide:()=>i(!1),menus:l.menus.filter(d=>d.parentGroupId===void 0),selectedGroupId:o,onSelect:a})]})}const jl=(r,t)=>{const l=[];if(t===0)return l.push(r),l;for(let n=0;n<r.length;n+=t){const o=r.slice(n,n+t);l.push(o)}return l},Nl=h.memo(({value:r,label:t,separator:l,labelWidth:n,lastIndex:o,labelAlign:c="top"})=>{const s=h.useMemo(()=>({padding:0,paddingBottom:o?0:12,verticalAlign:c}),[o,c]),i=h.useMemo(()=>({padding:0,paddingRight:12,paddingLeft:12,paddingBottom:o?0:12,verticalAlign:c}),[o,c]),a=()=>typeof t=="string"?e.jsx(k.Text,{fontWeight:"medium",color:"subtlest",children:t}):t,d=()=>typeof r=="string"||typeof r=="number"?e.jsx(k.Text,{color:"primary",fontWeight:"medium",children:r}):r,y=()=>typeof l=="string"||typeof l=="number"?e.jsx(k.Text,{fontWeight:"medium",color:"subtlest",children:l}):l;return e.jsxs(J.Tr,{children:[e.jsx(J.Td,{style:s,width:n,children:a()}),l?e.jsx(J.Td,{style:i,width:24,children:y()}):null,e.jsx(J.Td,{style:s,children:d()})]})}),_l=h.memo(({fields:r,separator:t,labelWidth:l})=>e.jsx(J.Table,{children:r.map((n,o)=>e.jsx(Nl,{separator:t,labelWidth:l,lastIndex:o===r.length-1,...n},`field-group-field-${o}`))})),ql=h.memo(({maxRow:r=0,maxColumn:t=2,separator:l=":",fields:n=[],labelWidth:o=150,bordered:c=!1})=>{const s=h.useMemo(()=>jl(n,r),[n,r]),i=s.length>2,a=()=>{switch(t){case 1:return"width-full";case 2:return"width-1-2";case 3:return"width-1-3";case 4:return"width-1-4";default:return"width-1-2"}};return e.jsx(u.Box,{gap:i?void 0:"lg",direction:"row",flexWrap:"wrap",borderRadius:"rounded-sm",padding:"lg",paddingBottom:i?"xs":"lg",bg:"accent-dark-tertiary",borderWidth:c?"border":void 0,borderStyle:c?"border-solid":void 0,borderColor:c?"border-subtle":void 0,children:s.map((d,y)=>e.jsx(u.Box,{direction:"column",flex:i?void 0:"1",width:i?a():void 0,marginBottom:i?"lg":void 0,children:e.jsx(_l,{labelWidth:o,fields:d,separator:l})},y))})}),Zl=({backButton:r})=>{const[t,l]=h.useState(!1),n=(r==null?void 0:r.iconColor)??"var(--sa-text-subtle, #8c8f97)",o=(r==null?void 0:r.textColor)??"var(--sa-text-subtle, #8c8f97)",c=(r==null?void 0:r.hoverIconColor)??"var(--sa-text-subtle, #8c8f97)",s=(r==null?void 0:r.hoverTextColor)??"var(--sa-text-primary, #292a2e)";return e.jsxs(u.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:{cursor:"pointer"},children:[e.jsx(F.Icon,{name:(r==null?void 0:r.iconName)||"ChevronLeft",size:"xs",style:{color:t?c:n,transition:"color 0.15s ease"}}),e.jsx(k.Text,{variant:"sub-h3",style:{color:t?s:o,textDecoration:t?"underline":"none",transition:"color 0.15s ease"},children:(r==null?void 0:r.title)||"Back"})]})},Gl=({backButton:r,title:t,titleIcon:l,titleTag:n,children:o,header:c=!0,headerBorder:s=!1,subHeaders:i,action:a,titleTagProps:d,containerProps:y,headerProps:C})=>{const p=ue.useMediaQuery("md"),x=ye.useNavigate(),O=ye.useLocation(),b=r==null?void 0:r.show,B=()=>{if(typeof(r==null?void 0:r.onClick)=="function"){r.onClick();return}x(-1,{replace:!0})},L=()=>{if(!a)return null;if(h.isValidElement(a))return a;const D=a.filter(M=>M&&(M.title||M.icon));return D.length===0?null:p?e.jsx(u.Box,{direction:"row",gap:"md",children:D.map(({title:M,icon:N,buttonProps:Q,onClick:q},$)=>e.jsx(P.Button,{iconLeft:N?e.jsx(F.Icon,{name:N,size:"md"}):void 0,onClick:q,...Q,children:M},`action-${$}`))}):e.jsxs(I.Menu,{position:"bottom-right",children:[e.jsx(I.MenuButton,{children:e.jsx(P.Button,{variant:"tertiary",size:"sm",iconLeft:e.jsx(F.Icon,{name:"MenuBurger"}),"aria-label":"Actions"})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{minWidth:200},children:D.map(({title:M,icon:N,buttonProps:Q,onClick:q},$)=>{const ie=(Q==null?void 0:Q.tone)==="error"||(Q==null?void 0:Q.danger)===!0;return e.jsx(I.MenuItem,{intent:ie?"danger":void 0,disabled:Q==null?void 0:Q.disabled,startIcon:N?e.jsx(F.Icon,{name:N}):void 0,onClick:q,children:M},`action-${$}`)})})})]})},S=()=>{const D=e.jsx(Zl,{backButton:r});return r!=null&&r.navigateTo?e.jsx(u.Box,{direction:"row",children:e.jsx(ye.Link,{to:r.navigateTo,replace:!0,style:{textDecoration:"none"},children:D})}):e.jsx(u.Box,{direction:"row",children:e.jsx(xr,{onClick:B,children:D})})},z=()=>{const D=!!t,M=Array.isArray(a)&&a.length>0,N=h.isValidElement(a)?!0:M;if(!D&&!N&&!b)return null;const q=p||!p&&M;return e.jsxs(u.Box,{direction:"column",gap:"xs",paddingBlock:(C==null?void 0:C.paddingBlock)??"sm",paddingInline:(C==null?void 0:C.paddingInline)??"md",...C,style:{...s?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:{},...C==null?void 0:C.style},children:[b&&S(),(D||N)&&e.jsxs(u.Box,{direction:q?"row":"column",gap:"sm",justify:"space-between",align:q?"center":"flex-start",children:[D?typeof t=="string"?e.jsxs(u.Box,{direction:"row",gap:"lg",align:"center",children:[e.jsxs(u.Box,{direction:"row",gap:"sm",align:"center",children:[l&&e.jsx(F.Icon,{name:l,size:"md",color:"primary"}),e.jsx(k.Text,{variant:"h3",fontWeight:"semibold",fontFamily:"Poppins",children:t})]}),n&&e.jsx(Ze.Badge,{border:!0,size:"lg",text:n,...d})]}):t:null,L()]})]})},w=()=>{if(!i||i.length===0)return null;let D=0,M=-1/0;return i.forEach((N,Q)=>{const q=N.order??0;q>=M&&(M=q,D=Q)}),i.map(({content:N,order:Q,borderBottom:q=!0},$)=>e.jsx(u.Box,{direction:"column",paddingTop:"sm",paddingBottom:q||$===D?"sm":"spacing-0",paddingInline:"md",style:{...q?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:{},...Q!==void 0?{order:Q}:{}},children:N},`sub-header-${$}`))},V=()=>{const D=c?z():null,M=w();return!D&&!M?null:e.jsxs(u.Box,{direction:"column",style:{marginBottom:i&&i.length>0?"var(--sa-spacing-0)":"var(--sa-spacing-md)"},children:[D,M]})},A=()=>o;return e.jsxs(u.Box,{direction:"column",as:"main",...y,style:{...(y==null?void 0:y.style)??{},animation:"pageLayoutEnter 320ms cubic-bezier(0.16, 1, 0.3, 1) backwards"},children:[V(),A()]},O.pathname)},Ql=h.memo(Gl),Ul={icon:"Cross",title:""},Jl="calc(100vw - 16px)",_t=r=>r==null?void 0:`min(${typeof r=="number"?`${r}px`:r}, ${Jl})`,qt=h.forwardRef(({onHide:r,show:t,withBlur:l=!1,style:n,children:o,closeButton:c=Ul,width:s,minWidth:i="357px",maxWidth:a="357px"},d)=>{const y=_t(s??i),C=_t(s??a);return e.jsx(pr.Drawer,{blur:l,isShow:t,position:"right",onHide:r,ref:d,style:{minWidth:y,maxWidth:C,...n},children:e.jsxs(u.Box,{direction:"column",padding:"lg",children:[c?e.jsxs(u.Box,{direction:"row",align:"center",gap:"sm",onClick:r,marginBottom:"lg",cursor:"pointer",children:[e.jsx(F.Icon,{name:c.icon,size:"md",color:"subtle",cursor:"pointer"}),c.title?e.jsx(k.Text,{fontFamily:"Poppins",fontSize:"md",color:"subtlest",children:c.title}):null]}):null,o]})})}),Yr=h.memo(({children:r,borderBottom:t=!0,padding:l=!0})=>{const n=ue.useMediaQuery("lg");return e.jsx(u.Box,{direction:"column",padding:l?"md":"spacing-0",paddingLeft:l?"md":"spacing-0",paddingRight:l?"md":"spacing-0",style:t?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:r})}),Xr=h.memo(({children:r,borderTop:t=!0,padding:l=!0})=>{const n=ue.useMediaQuery("lg");return e.jsx(u.Box,{direction:"column",padding:l?"md":"spacing-0",paddingLeft:l?"md":"spacing-0",paddingRight:l?"md":"spacing-0",style:t?{borderTop:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:r})}),Yl=h.memo(({children:r,...t})=>e.jsx(u.Box,{direction:"column",padding:"md",paddingLeft:"md",paddingRight:"md",gap:"md",...t,children:r})),Xl=h.memo(({children:r,title:t,titleTag:l,action:n,header:o,footer:c,actionContainer:s,containerProps:i,bodyProps:a,headerProps:d={borderBottom:!0},footerProps:y={borderTop:!0},variantTag:C="info"})=>{const p=ue.useMediaQuery("lg"),x=()=>l?e.jsxs(u.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(k.Text,{fontWeight:"medium",children:t}),e.jsx(Ze.Badges,{border:!0,text:l,variant:C})]}):e.jsx(k.Text,{fontWeight:"medium",children:t}),O=()=>o||e.jsxs(u.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(u.Box,{direction:"column",children:t?x():null}),e.jsx(u.Box,{direction:"column",style:p?{width:"100%",maxWidth:"19.313rem"}:{flex:1},...s,children:n??null})]}),b=!!(o||t||n);return e.jsxs(u.Box,{direction:"column",bg:"white",borderRadius:"rounded-xs",as:"section",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",...i,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",...(i==null?void 0:i.style)??{}},children:[o!==null&&b?e.jsx(Yr,{...d,children:O()}):null,e.jsx(Yl,{...a,children:r}),c?e.jsx(Xr,{...y,children:c}):null]})}),Te={H1:r=>e.jsx(k.Text,{variant:"h1",children:r.children,...r.props}),H2:r=>e.jsx(k.Text,{variant:"h2",children:r.children,...r.props}),H3:r=>e.jsx(k.Text,{variant:"h3",children:r.children,...r.props}),H4:r=>e.jsx(k.Text,{variant:"h4",children:r.children,...r.props}),H5:r=>e.jsx(k.Text,{variant:"h5",children:r.children,...r.props}),H6:r=>e.jsx(k.Text,{variant:"h6",children:r.children,...r.props}),SubH1:r=>e.jsx(k.Text,{variant:"sub-h1",children:r.children,...r.props}),SubH2:r=>e.jsx(k.Text,{variant:"sub-h2",children:r.children,...r.props}),SubH3:r=>e.jsx(k.Text,{variant:"sub-h3",children:r.children,...r.props}),Body1:r=>e.jsx(k.Text,{variant:"body-1",children:r.children,...r.props}),Body2:r=>e.jsx(k.Text,{variant:"body-2",children:r.children,...r.props}),Body3:r=>e.jsx(k.Text,{variant:"body-3",children:r.children,...r.props})},ke=()=>{const[r,t]=ye.useSearchParams(),l=tr.searchParamsToObject(r.toString()),n=ye.useParams(),o=ye.useLocation(),c=n.id;return{setSearchParams:t,searchParams:r,searchQueries:l,isHasQuery:(y,C)=>r.has(y)&&r.get(y)===C,getQueryParam:y=>r.get(y),getRouteParam:y=>n[y],params:n,location:o,id:c,hasId:!!c}},Zt=r=>JSON.stringify(r),Gt=r=>JSON.stringify(r),Qt=r=>JSON.stringify(r),Ut=r=>JSON.stringify(r),Kl=r=>r,$l=r=>JSON.stringify(r),gr=({value:r,name:t,type:l,withSearchParam:n=!0,setSearchParams:o,searchQueries:c,dropdownSearchKey:s,filterKey:i="filter",pageKey:a="page"})=>{if(n){let d;switch(l){case"search":d=Kl(r);break;case"dropdown":case"dropdown-multiple":d=Zt(r);break;case"radio":d=Gt(r);break;case"date-range":d=Qt(r);break;case"advanced-date-range":d=$l(r);break;case"date":d=Ut(r);break;default:d=r;break}if(typeof d<"u"){const C={...c[i]&&typeof c[i]=="string"?JSON.parse(c[i]):void 0,[t]:d},p={...c};s&&typeof s=="string"&&delete p[s],delete p[a];const x={...p,[i]:JSON.stringify(C)},O=new URLSearchParams(c).toString(),b=new URLSearchParams(x).toString();if(O===b)return;o(x)}}},wr=({name:r,filterKey:t="filter",searchParams:l,get:n})=>{const o=l.get(t)||void 0,c=o&&typeof o=="string"?JSON.parse(o):void 0,s=c?c[r]:void 0;return n==="label"&&s?JSON.parse(s)[0].label:n==="value"&&s?JSON.parse(s)[0].value:s},Jt=({name:r,filterKey:t="filter",searchParams:l,get:n})=>{const o=l.get(t)||void 0,c=o&&typeof o=="string"?JSON.parse(o):void 0,s=c?c[r]:void 0;return n==="label"&&s?JSON.parse(s).map(i=>i.label):n==="value"&&s?JSON.parse(s).map(i=>i.value):n==="array"&&s?JSON.parse(s):s},Rl=({name:r,filterKey:t="filter",searchParams:l,get:n})=>{const o=l.get(t)||void 0,c=o&&typeof o=="string"?JSON.parse(o):void 0,s=c?c[r]:void 0;return n==="id"&&s?JSON.parse(s).id:n==="label"&&s?JSON.parse(s).label:n==="value"&&s?JSON.parse(s).value:s},Dr=(r,t,l)=>{const n=t.get(l||"filter")||void 0,o=n&&typeof n=="string"?JSON.parse(n):void 0;return o?o[r]:void 0},eo=({name:r,filterKey:t="filter",searchParams:l})=>{const n=l.get(t||"filter")||void 0,o=n&&typeof n=="string"?JSON.parse(n):void 0,c=o?o[r]:void 0;return{start:c?JSON.parse(c).from:void 0,end:c?JSON.parse(c).to:void 0}},Yt=({name:r,filterKey:t="filter",searchParams:l})=>{const n=l.get(t||"filter")||void 0,o=n&&typeof n=="string"?JSON.parse(n):void 0,c=o?o[r]:void 0;return c?JSON.parse(c):void 0},ro=(r,{filterKey:t="filter",perPageKey:l="perPage",pageKey:n="page"})=>{const o=r.get(t)||void 0,c=r.get(l)||void 0,s=r.get(n)||void 0;return!!o||!!c||!!s},Xt=({isOpen:r,onClose:t,filterKey:l,pageKey:n,filters:o})=>{const{searchParams:c,setSearchParams:s,searchQueries:i}=ke(),[a,d]=h.useState({}),y=()=>{c.delete(l||"filter"),s(c)},C=(p,x)=>{switch(p.type){case"radio":{const{show:O=!0}=p;return O&&e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:p.title})},x)}case"dropdown":{const{show:O=!0}=p;return O&&e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:p.title})},x)}case"date-range":return e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:p.title})},x);case"date":return e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:p.title})},x);case"dropdown-multiple":{const{show:O=!0}=p;return O&&e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:p.title})},x)}default:return null}};return e.jsx(qt,{onHide:t,show:r||!1,children:e.jsxs(u.Box,{direction:"column",gap:"md",children:[e.jsxs(ne.Flex,{direction:"row",justify:"space-between",align:"center",children:[e.jsx(u.Box,{direction:"column",children:"Filter"}),e.jsx(u.Box,{direction:"column",style:{cursor:"pointer"},onClick:y,children:"Reset"})]}),o==null?void 0:o.map((p,x)=>C(p,x))]})})},Kt=({searchKey:r="q",statusKey:t="status",searchPlaceholder:l="Search",searchHighlightPlaceholder:n,extendedFilter:o,showSearchFilter:c=!0,showStatusFilter:s=!0,filterKey:i="filter",pageKey:a="page",customWidthSearch:d,handleOnReset:y,filterConfigs:C,buttonToggleProps:p,position:x="right",titleSearchLabel:O="Work Order",withTitleLabels:b=!1})=>{const L=(p==null?void 0:p.isShowLabel)??!0,[S,z]=h.useState(!1),[w,V]=h.useState(0),A=()=>{V(_=>_+1)},{searchParams:D,setSearchParams:M,getQueryParam:N}=ke(),Q=tr.searchParamsToObject(D.toString()),q=Dr(r,D,i)||"",[$,ie]=h.useState(q),pe=N(i),de=!!(pe&&!(()=>{if(pe)try{const _=JSON.parse(pe);return Object.keys(_).length===1&&_[r]===""}catch(_){console.error("Filter parameter is not a valid JSON:",_)}return!1})()),R=ue.useMediaQuery("md");return h.useEffect(()=>{ie(q)},[q]),h.useEffect(()=>{if($===q)return;const _=window.setTimeout(()=>{gr({value:$,name:r,type:"search",searchQueries:Q,setSearchParams:M,filterKey:i,pageKey:a})},350);return()=>{window.clearTimeout(_)}},[$,q,r,Q,M,i,a]),e.jsxs(ne.Flex,{gap:"md",style:{flexDirection:R&&x==="left"?"row":R&&x==="right"?"row-reverse":"column"},align:"flex-end",children:[de&&e.jsx(u.Box,{direction:"column",justify:"flex-end",children:e.jsx(P.Button,{onClick:()=>{const _=new URLSearchParams(D);_.delete(i),M(_),ie(""),A(),y&&y()},variant:"outline",tone:"neutral",children:e.jsx(k.Text,{color:"error",fontWeight:"semibold",children:"Reset"})})}),o==null?void 0:o.map(({minWidth:_,content:oe,title:se,onClickContainer:fe},Fe)=>e.jsxs(u.Box,{direction:"column",gap:"sm",onClick:fe,style:{minWidth:_},children:[se&&e.jsx(Te.SubH3,{children:se}),oe]},`extended-filter-${Fe}-${w}`)),!!(C!=null&&C.length)&&e.jsx(P.Button,{primary:de,secondary:!de,iconLeft:e.jsx(F.Icon,{size:"sm",name:(p==null?void 0:p.icon)||"FilterHorizontal",style:{color:pe?"var(--sa-background-brand, #04254f)":"var(--sa-text-primary, #292a2e)"}}),fullWidth:!R,onClick:()=>z(!0),children:L?"Filter":void 0}),s&&e.jsxs(u.Box,{direction:"column",gap:"sm",style:{minWidth:"126px"},children:[b&&e.jsx(Te.SubH3,{children:"Status"}),e.jsx(rr.Dropdown,{dropdownLists:[{label:"Active",value:"active"},{label:"InActive",value:"inactive"}],defaultValue:wr({get:"value",name:t,searchParams:D,filterKey:i})?[{label:wr({get:"value",name:t,searchParams:D,filterKey:i})==="active"?"Active":"InActive",value:wr({get:"value",name:t,searchParams:D,filterKey:i})}]:[],onChange:_=>gr({value:_,name:t,type:"dropdown",searchQueries:Q,setSearchParams:M,filterKey:i}),placeholder:b?"All":"All Status"},w)]}),c&&e.jsxs(u.Box,{direction:"column",gap:"sm",style:{width:d&&R?d:R?"310px":""},children:[b&&e.jsxs(Te.SubH3,{children:["Search for ",O]}),e.jsx(Ge.Input,{placeholder:l,leftIcon:e.jsx(F.Icon,{name:"Search",width:20,height:20}),onChange:_=>ie(_.target.value),value:$,fullWidth:!0},w+1+i)]}),e.jsx(Xt,{isOpen:S,onClose:()=>z(!1),filterKey:i,filters:C,pageKey:a})]})},to=r=>r==="checkbox-multiple"?"dropdown-multiple":r==="radio"?"dropdown":r==="date-compact"?"date":r;function Kr({configs:r,filterKey:t="filter",activeFilterKey:l="filters",pageKey:n="page",searchKey:o="q"}){const{searchParams:c,setSearchParams:s,searchQueries:i}=ke(),a=h.useMemo(()=>Object.fromEntries(r.map(w=>[w.key,w])),[r]),d=h.useMemo(()=>{const w=(c.get(l)||"").split(",").map(A=>A.trim()).filter(Boolean);let V=[];try{const A=c.get(t);A&&(V=Object.keys(JSON.parse(A)).filter(D=>D!==o))}catch{}return r.map(A=>A.key).filter(A=>{const D=a[A];return(D==null?void 0:D.locked)||w.includes(A)||V.includes(A)})},[c,l,t,o,r,a]),y=h.useCallback(w=>{try{return w[t]?JSON.parse(w[t]):{}}catch{return{}}},[t]),C=h.useCallback(w=>{const V={...i};w.length?V[l]=w.join(","):delete V[l],s(V)},[i,l,s]),p=h.useCallback(w=>{d.includes(w)||C([...d,w])},[d,C]),x=h.useCallback(w=>{var M;if((M=a[w])!=null&&M.locked)return;const V={...i},A=d.filter(N=>N!==w);A.length?V[l]=A.join(","):delete V[l];const D=y(V);w in D&&(delete D[w],Object.keys(D).length?V[t]=JSON.stringify(D):delete V[t]),delete V[n],s(V)},[i,d,l,t,n,y,s,a]),O=h.useCallback(w=>d.includes(w)?x(w):p(w),[d,p,x]),b=h.useCallback(w=>{switch(w.type){case"dropdown":case"dropdown-multiple":case"checkbox-multiple":case"radio":return Jt({name:w.key,get:"array",searchParams:c,filterKey:t})||[];case"date":{const V=Yt({name:w.key,searchParams:c,filterKey:t});return V?new Date(V):void 0}case"date-compact":{const A=y(Object.fromEntries(c.entries()))[w.key];return A&&typeof A=="object"?A:void 0}default:return}},[c,t,y]),B=h.useCallback((w,V)=>{if(w.type==="date-compact"){const A={...i},D=y(A);V==null?delete D[w.key]:D[w.key]=V,Object.keys(D).length?A[t]=JSON.stringify(D):delete A[t],delete A[n],s(A);return}gr({value:V,name:w.key,type:to(w.type),searchQueries:i,setSearchParams:s,filterKey:t,pageKey:n})},[i,s,t,n,y]),L=h.useCallback(w=>{const V={...i},A=y(V);w in A&&(delete A[w],Object.keys(A).length?V[t]=JSON.stringify(A):delete V[t]),delete V[n],s(V)},[i,t,n,y,s]),S=h.useCallback(()=>{const w={...i};delete w[t],delete w[l],delete w[n],s(w)},[i,t,l,n,s]),z=d.length>0;return{activeKeys:d,configByKey:a,hasActiveFilter:z,addFilter:p,removeFilter:x,toggleFilter:O,getValue:b,setValue:B,clearValue:L,clearAll:S}}const $r={get(r){return fr.storage.get(r)??null},set(r,t){fr.storage.save(r,t)},remove(r){fr.storage.delete(r)}},cr={columns:r=>`filterbar:colprefs:${r}`,savedViews:r=>`filterbar:views:${r}`,lastState:r=>`filterbar:last:${r}`,perPage:r=>`filterbar:perpage:${r}`,tableSort:r=>`tablelayout:sort:${r}`},Sr=(r,t)=>{const l=new Set(t.map(c=>c.key)),n=r.order.filter(c=>l.has(c));for(const c of t)n.includes(c.key)||n.push(c.key);const o=r.hidden.filter(c=>l.has(c));return{order:n,hidden:o}};function lo({columns:r,scopeId:t,storage:l,onColumnsChange:n,value:o}){const c=h.useMemo(()=>({order:r.map(D=>D.key),hidden:[]}),[r]),s=t?cr.columns(t):void 0,i=(D,M)=>Sr({order:D.order??M,hidden:D.hidden??[]},r),[a,d]=h.useState(()=>{if(o&&(o.order||o.hidden))return i(o,r.map(D=>D.key));if(s){const D=l.get(s);if(D&&Array.isArray(D.order))return Sr(D,r)}return c}),y=r.map(D=>D.key).join("|");h.useEffect(()=>d(D=>Sr(D,r)),[y]);const C=h.useRef(a);C.current=a;const p=o?`${(o.order??[]).join("|")}~${(o.hidden??[]).join("|")}`:null,x=h.useRef(p);h.useEffect(()=>{if(p==null||x.current===p)return;x.current=p;const D=C.current,M=i(o,D.order);M.order.join("|")===D.order.join("|")&&M.hidden.join("|")===D.hidden.join("|")||(d(M),s&&l.set(s,M))},[p,y]);const O=h.useRef(!1);h.useEffect(()=>{O.current||(O.current=!0,n==null||n(a))},[]);const b=h.useCallback(D=>{d(D),s&&l.set(s,D),n==null||n(D)},[s,l,n]),B=h.useMemo(()=>{const D=new Map(r.map(M=>[M.key,M]));return a.order.filter(M=>D.has(M)).map(M=>({...D.get(M),visible:!a.hidden.includes(M)}))},[a,r]),L=h.useCallback(D=>{const M=a.hidden.includes(D)?a.hidden.filter(N=>N!==D):[...a.hidden,D];b({...a,hidden:M})},[a,b]),S=h.useCallback((D,M)=>{if(D===M)return;const N=[...a.order],[Q]=N.splice(D,1);N.splice(M,0,Q),b({...a,order:N})},[a,b]),z=h.useCallback(D=>{b({...a,hidden:D?r.filter(M=>!M.locked).map(M=>M.key):[]})},[a,r,b]),w=h.useCallback(()=>b(c),[b,c]),V=h.useCallback(D=>b(Sr(D,r)),[b,r]),A=a.hidden.length===0;return{state:a,orderedColumns:B,allVisible:A,toggleVisibility:L,reorder:S,setAllHidden:z,reset:w,applyState:V}}function oo({scopeId:r,storage:t,snapshotKeys:l,pageKey:n="page",getColumns:o,applyColumns:c}){const{searchParams:s,setSearchParams:i}=ke(),a=r?cr.savedViews(r):void 0,[d,y]=h.useState(()=>a?t.get(a)||[]:[]),C=h.useCallback(b=>{y(b),a&&t.set(a,b)},[a]),p=h.useCallback(b=>{const B=b.trim();if(!B)return;const L={};l.forEach(z=>{const w=s.get(z);w!=null&&(L[z]=w)});const S={id:`${Date.now()}`,name:B,query:L,columns:o==null?void 0:o(),createdAt:Date.now()};C([...d,S])},[l,s,o,C,d]),x=h.useCallback(b=>C(d.filter(B=>B.id!==b)),[C,d]),O=h.useCallback(b=>{const B=Object.fromEntries(s.entries());l.forEach(L=>delete B[L]),Object.assign(B,b.query),delete B[n],i(B),b.columns&&(c==null||c(b.columns))},[s,l,n,i,c]);return{enabled:!!a,views:d,saveView:p,deleteView:x,applyView:O}}function no({scopeId:r,storage:t,snapshotKeys:l,enabled:n=!0}){const{searchParams:o}=ke(),c=r&&n?cr.lastState(r):void 0,s=h.useRef(c);h.useEffect(()=>{if(!c){s.current=c;return}if(s.current!==c){s.current=c;return}const d={};l.forEach(y=>{const C=o.get(y);C!=null&&(d[y]=C)}),Object.keys(d).length!==0&&t.set(c,d)},[o,c,l,t]);const i=h.useCallback(()=>{if(!c)return null;const d=t.get(c);return d&&Object.keys(d).length>0?d:null},[c,t]),a=h.useCallback(()=>{c&&t.remove(c)},[c,t]);return{enabled:!!c,read:i,clear:a}}function co({scopeId:r,storage:t,perPageKey:l,pageSizeOptions:n,enabled:o=!0}){const{searchParams:c}=ke(),s=r&&o?cr.perPage(r):void 0,i=c.toString(),a=h.useRef(s);h.useEffect(()=>{if(!s){a.current=s;return}if(a.current!==s){a.current=s;return}const C=c.get(l);if(!C)return;const p=Number(C);!Number.isFinite(p)||p<=0||t.set(s,p)},[i,s,l,t]);const d=h.useCallback(()=>{if(!s)return null;const C=t.get(s);if(C==null)return null;const p=Number(C);return!Number.isFinite(p)||p<=0||n&&!n.includes(p)?null:String(p)},[s,t,n]),y=h.useCallback(()=>{s&&t.remove(s)},[s,t]);return{enabled:!!s,read:d,clear:y}}let Rr={},et=!1,rt=null;const io=(r,t)=>{Object.assign(Rr,r),rt=t,!et&&(et=!0,queueMicrotask(()=>{const l=Rr,n=rt;Rr={},et=!1,rt=null,!(!n||Object.keys(l).length===0)&&n(o=>{const c=new URLSearchParams(o);return Object.entries(l).forEach(([s,i])=>c.set(s,i)),c})}))};function so({enabled:r,snapshotKeys:t,perPageKey:l,readSnapshot:n,readPerPage:o}){const{searchParams:c,setSearchParams:s,location:i}=ke(),a=h.useRef(null);h.useEffect(()=>{if(!r||a.current===i.pathname)return;a.current=i.pathname;const d={};if(!c.has(l)){const y=o();y&&(d[l]=y)}if(!t.some(y=>c.has(y))){const y=n();y&&Object.assign(d,y)}Object.keys(d).length!==0&&io(d,s)},[i.pathname,r])}const ao=({configs:r,activeKeys:t,onToggle:l,hasActiveFilter:n,onReset:o})=>r.length?e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(P.Button,{variant:n?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"FilterHorizontal"}),"aria-label":"Add filter"})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{minWidth:260},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:"Add Filter"}),n&&o&&e.jsx(P.Button,{variant:"link",tone:"brand",size:"xs",onClick:o,children:"Reset"})]}),children:r.map(c=>e.jsx(I.MenuItem,{selected:c.locked||t.includes(c.key),disabled:c.locked,closeOnSelect:!1,startIcon:c.icon??void 0,onClick:()=>{c.locked||l(c.key)},children:c.label},c.key))})})]}):null,kr=({onClear:r,onRemove:t})=>e.jsxs(I.Menu,{position:"bottom-right",children:[e.jsx(I.MenuButton,{children:e.jsx(P.Button,{variant:"link",tone:"neutral",size:"xs",iconLeft:e.jsx(F.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(F.Icon,{name:"CrossCircle"}),onClick:r,children:"Clear value"}),t&&e.jsx(I.MenuItem,{intent:"danger",startIcon:e.jsx(F.Icon,{name:"Trash1"}),onClick:t,children:"Remove filter"})]})})]}),ho=r=>{const t=new Date(r);return t.setHours(0,0,0,0),t},$t=(r,t,l)=>{const n=new Date(r);return l==="day"?n.setDate(n.getDate()+t):l==="week"?n.setDate(n.getDate()+t*7):l==="month"?n.setMonth(n.getMonth()+t):n.setFullYear(n.getFullYear()+t),n},Rt=r=>{const t=ho(new Date);if(r.direction==="this"){const n=new Date(t),o=new Date(t);return r.period==="week"?(n.setDate(t.getDate()-t.getDay()),o.setDate(n.getDate()+6)):r.period==="month"?(n.setDate(1),o.setMonth(o.getMonth()+1,0)):r.period==="year"&&(n.setMonth(0,1),o.setMonth(11,31)),{from:n,to:o}}const l=r.count??1;return r.direction==="past"?{from:$t(t,-l,r.period),to:t}:{from:t,to:$t(t,l,r.period)}},el=24,rl=r=>r.length>el?`${r.slice(0,el)}...`:r,Br=r=>r.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric"}),mr={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"},fo=["is","is-before","is-after","is-on-or-before","is-on-or-after","is-between","is-relative-to-today","is-empty","is-not-empty"],tt={past:"Past",next:"Next",this:"This"},go=["day","week","month","year"],uo=["past","next","this"],yo=r=>r.field.type==="date-compact"?e.jsx(bo,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}):e.jsx(po,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}),po=({field:r,value:t,onChange:l,onClear:n,onRemove:o})=>{const c=t?Br(new Date(t)):null,s=!!c,i=s?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:rl(c)})]}):r.label;return e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(P.Button,{variant:s?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:s?e.jsx(F.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:i})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{width:260},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(kr,{onClear:n,onRemove:o})]}),children:e.jsx(Qe.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:r.mode,value:t,onChange:a=>a==null?n():l(a),withPadding:!1})})})]})},Co=r=>{switch(r.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return r.date?`${mr[r.op]} ${Br(new Date(r.date))}`:null;case"is-between":return r.from&&r.to?`${Br(new Date(r.from))} - ${Br(new Date(r.to))}`:null;case"is-relative-to-today":{const t=r.relative;if(!t)return null;if(t.direction==="this")return`This ${t.period}`;const l=t.count??1,n=l===1?t.period:`${t.period}s`;return`${tt[t.direction]} ${l} ${n}`}case"is-empty":case"is-not-empty":return mr[r.op];default:return null}},bo=({field:r,value:t,onChange:l,onClear:n,onRemove:o})=>{const c=(t==null?void 0:t.op)??"is",s=t?Co(t):null,i=!!s,a=i?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:rl(s)})]}):r.label,d=y=>{if(y!==c){if(y==="is-empty"||y==="is-not-empty"){l({op:y});return}if(y==="is-relative-to-today"){l({op:y,relative:(t==null?void 0:t.relative)??{direction:"past",count:1,period:"week"}});return}if(y==="is-between"){l({op:y,from:t==null?void 0:t.from,to:t==null?void 0:t.to});return}l({op:y,date:t==null?void 0:t.date})}};return e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(P.Button,{variant:i?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:i?e.jsx(F.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:a})}),e.jsxs(I.MenuLists,{children:[e.jsx(I.MenuBody,{style:{width:320},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",gap:"xs",fullWidth:!0,children:[e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",gap:"xs",style:{minWidth:0},children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(vo,{op:c,onChange:d})]}),e.jsx(kr,{onClear:n,onRemove:o})]}),children:e.jsx(xo,{value:t,op:c,onChange:l})}),c==="is-relative-to-today"&&e.jsx(I.MenuFooter,{children:e.jsx(k.Text,{fontSize:"xs",color:"subtlest",children:"Filter will update with the current date"})})]})]})},vo=({op:r,onChange:t})=>e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(P.Button,{variant:"link",tone:"neutral",size:"xs",iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:mr[r]})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{width:200},children:fo.map(l=>e.jsx(I.MenuItem,{selected:r===l,onClick:()=>t(l),endIcon:r===l?e.jsx(F.Icon,{name:"Check"}):void 0,children:mr[l]},l))})})]}),xo=({value:r,op:t,onChange:l})=>{if(t==="is-empty"||t==="is-not-empty")return e.jsx(u.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(k.Text,{fontSize:"xs",color:"subtlest",children:"No further input required."})});if(t==="is-between"){const n=r!=null&&r.from||r!=null&&r.to?{from:r!=null&&r.from?new Date(r.from):null,to:r!=null&&r.to?new Date(r.to):null}:void 0;return e.jsx(Qe.StarasiaDate,{size:"sm",input:!1,clearable:!0,rangedDate:!0,value:n,onChange:o=>{if(o==null){l({op:t});return}if(typeof o=="object"&&o!==null&&"from"in o&&"to"in o){let{from:c,to:s}=o;if(!c&&s&&(c=s,s=null),!c&&!s){l({op:t});return}l({op:t,from:c?c.toISOString():void 0,to:s?s.toISOString():void 0})}},withPadding:!1},"range")}return t==="is-relative-to-today"?e.jsx(wo,{value:r==null?void 0:r.relative,onChange:n=>l({op:t,relative:n})}):e.jsx(Qe.StarasiaDate,{size:"sm",input:!1,clearable:!0,value:r!=null&&r.date?new Date(r.date):void 0,onChange:n=>{if(n==null){l({op:t});return}n instanceof Date&&l({op:t,date:n.toISOString()})},withPadding:!1},"single")},wo=({value:r,onChange:t})=>{const l=(r==null?void 0:r.direction)??"past",n=(r==null?void 0:r.count)??1,o=(r==null?void 0:r.period)??"week",c=l!=="this",s=Rt({direction:l,count:n,period:o});return e.jsxs(u.Box,{direction:"column",display:"flex",gap:"sm",children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(P.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:tt[l]})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{width:140},children:uo.map(i=>e.jsx(I.MenuItem,{selected:l===i,endIcon:l===i?e.jsx(F.Icon,{name:"Check"}):void 0,onClick:()=>t(i==="this"?{direction:i,period:o}:{direction:i,count:n,period:o}),children:tt[i]},i))})})]}),c&&e.jsx(Ge.Input,{type:"number",size:"sm",min:1,clearable:!1,value:n,onChange:i=>{const a=Number(i.target.value);t({direction:l,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(P.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:o})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{width:140},children:go.map(i=>e.jsx(I.MenuItem,{selected:o===i,endIcon:o===i?e.jsx(F.Icon,{name:"Check"}):void 0,onClick:()=>t(l==="this"?{direction:l,period:i}:{direction:l,count:n,period:i}),children:i},i))})})]})]}),e.jsx(Qe.StarasiaDate,{size:"sm",input:!1,disabled:!0,rangedDate:!0,value:s,onChange:()=>{},withPadding:!1},"relative-preview")]})},tl=18,Do=r=>r.length>tl?`${r.slice(0,tl)}...`:r,So=({field:r,value:t,onChange:l,onClear:n,onRemove:o})=>{const c=r.type==="dropdown-multiple",s=t.length,[i,a]=h.useState(""),d=r.options,y=typeof r.onSearch=="function",C=(()=>{if(y)return d;const B=i.trim().toLowerCase();return B?d.filter(L=>L.label.toLowerCase().includes(B)):d})(),p=B=>t.some(L=>L.value===B.value),x=B=>{if(!c){l([{label:B.label,value:B.value}]),a("");return}l(p(B)?t.filter(L=>L.value!==B.value):[...t,{label:B.label,value:B.value}])},O=B=>{var L;a(B),(L=r.onSearch)==null||L.call(r,B)},b=s===0?r.label:e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:s===1?Do(t[0].label):`${s} Selected`})]});return e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(P.Button,{variant:s>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:s>0?e.jsx(F.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:b})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{style:{width:260},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(kr,{onClear:n,onRemove:o})]}),children:e.jsxs(u.Box,{direction:"column",gap:"sm",children:[e.jsx(rr.Dropdown,{size:"sm",triggerInput:!0,fullWidth:!0,hideChevronIcon:!0,clearable:!0,multiSelect:c,searchAble:!0,searchValue:i,onSearch:O,value:t,onChange:l,placeholder:`Search ${r.label.toLowerCase()}…`}),e.jsx(u.Box,{direction:"column",overflow:"overflow-y-auto",customMaxHeight:"240px",children:r.isLoading?e.jsx(u.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(k.Text,{fontSize:"xs",color:"subtlest",children:"Loading…"})}):C.length===0?e.jsx(u.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(k.Text,{fontSize:"xs",color:"subtlest",children:"No results"})}):C.map(B=>e.jsx(I.MenuItem,{closeOnSelect:!c,selected:p(B),startIcon:B.avatar,endIcon:p(B)?e.jsx(F.Icon,{name:"Check"}):void 0,description:B.description,onClick:()=>x(B),children:B.label},B.value))})]})})})]})},ll=18,ko=r=>r.length>ll?`${r.slice(0,ll)}...`:r,ol=({checked:r,indeterminate:t})=>e.jsx("span",{style:{pointerEvents:"none",display:"inline-flex"},children:e.jsx(nr.Checkbox,{size:"sm",checked:r,readOnly:!0,onChange:()=>{},variant:t?"indeterminate":"select"})}),Bo=({field:r,value:t,onChange:l,onClear:n,onRemove:o})=>{const c=new Set(t.map(p=>p.value)),s=t.length,i=r.options.length>0&&r.options.every(p=>c.has(p.value)),a=s>0&&!i,d=p=>{l(c.has(p.value)?t.filter(x=>x.value!==p.value):[...t,{label:p.label,value:p.value}])},y=()=>{l(i?[]:r.options.map(p=>({label:p.label,value:p.value})))},C=s===0?r.label:e.jsxs(e.Fragment,{children:[e.jsxs(k.Text,{as:"span",fontWeight:"semibold",children:[r.label,":"]})," ",e.jsx(k.Text,{as:"span",children:s===1?ko(t[0].label):`${s} Selected`})]});return e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(P.Button,{variant:s>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:s>0?e.jsx(F.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),children:C})}),e.jsx(I.MenuLists,{children:e.jsxs(I.MenuBody,{style:{width:240},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(kr,{onClear:n,onRemove:o})]}),children:[e.jsx(I.MenuItem,{closeOnSelect:!1,selected:i,onClick:y,startIcon:e.jsx(ol,{checked:i||a,indeterminate:a}),children:"Select All"}),r.options.map(p=>e.jsx(I.MenuItem,{closeOnSelect:!1,selected:c.has(p.value),onClick:()=>d(p),startIcon:e.jsx(ol,{checked:c.has(p.value)}),children:p.label},p.value))]})})]})},nl=({activeKeys:r,configByKey:t,getValue:l,setValue:n,clearValue:o,removeFilter:c})=>e.jsx(e.Fragment,{children:r.map(s=>{const i=t[s];if(!i)return null;const a=l(i),d=i.locked?void 0:()=>c(s);return i.type==="date"||i.type==="date-compact"?e.jsx(yo,{field:i,value:a,onChange:y=>n(i,y),onClear:()=>o(s),onRemove:d},s):i.type==="checkbox-multiple"?e.jsx(Bo,{field:i,value:a||[],onChange:y=>n(i,y),onClear:()=>o(s),onRemove:d},s):e.jsx(So,{field:i,value:a||[],onChange:y=>n(i,y),onClear:()=>o(s),onRemove:d},s)})}),cl=r=>`${r} Rows`,mo=({pagination:r,pageKey:t="page",perPageKey:l="perPage",pageSizeOptions:n=[10,25,50,100],defaultPerPage:o=10,showResultCount:c=!0,showPageSize:s=!0,showPagination:i=!0})=>{var L;const{searchQueries:a,setSearchParams:d,searchParams:y}=ke(),C=y.get(l),p=C?Number(C):o,x=S=>{d({...a,[t]:String(S)})},O=S=>{d({...a,[l]:S,[t]:"1"})},b=(r==null?void 0:r.rangeStart)??(((r==null?void 0:r.currentPage)||0)>1?(((r==null?void 0:r.currentPage)||0)-1)*((r==null?void 0:r.perPage)||0)+1:1),B=(r==null?void 0:r.rangeEnd)??((r==null?void 0:r.totalCurrentPage)!==(r==null?void 0:r.perPage)?r==null?void 0:r.totalData:((r==null?void 0:r.currentPage)||1)*((r==null?void 0:r.totalCurrentPage)||0));return e.jsxs(e.Fragment,{children:[c&&e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${b}-${B} of ${((L=r==null?void 0:r.totalData)==null?void 0:L.toLocaleString())||0}`}),s&&e.jsxs(I.Menu,{position:"bottom-left",children:[e.jsx(I.MenuButton,{children:e.jsx(P.Button,{variant:"outline",tone:"neutral",size:"xs",iconRight:e.jsx(F.Icon,{name:"ChevronSmallDown"}),"aria-label":"Rows per page",children:cl(p)})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{children:n.map(S=>e.jsx(I.MenuItem,{selected:S===p,onClick:()=>O(String(S)),children:cl(S)},S))})})]}),i&&((r==null?void 0:r.totalPage)??0)>1&&e.jsx(u.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(hr.Pagination,{size:"sm",variant:"neutral",siblingCount:0,currentPage:r!=null&&r.currentPage?Number(r.currentPage):1,totalPages:Number(r==null?void 0:r.totalPage),onPageChange:x})})]})};function Fo(r,t,l=!0){h.useEffect(()=>{if(!l)return;const n=o=>{var i;if(o.metaKey||o.ctrlKey||o.altKey||o.key!==r)return;const c=o.target,s=(i=c==null?void 0:c.tagName)==null?void 0:i.toLowerCase();s==="input"||s==="textarea"||c!=null&&c.isContentEditable||(o.preventDefault(),t())};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[r,t,l])}const Eo=240,il=({searchKey:r="q",filterKey:t="filter",pageKey:l="page",placeholder:n="Search",shortcut:o="/"})=>{const{searchParams:c,setSearchParams:s,searchQueries:i}=ke(),a=Dr(r,c,t)||"",[d,y]=h.useState(!!a),[C,p]=h.useState(!a),[x,O]=h.useState(a),b=ue.useDebounce(x,350),B=h.useRef(null);h.useEffect(()=>{O(a),a&&y(!0)},[a]),h.useEffect(()=>{d&&p(!1)},[d]),h.useEffect(()=>{b!==a&&gr({value:b,name:r,type:"search",searchQueries:i,setSearchParams:s,filterKey:t,pageKey:l})},[b]);const L=h.useCallback(()=>{y(!0),requestAnimationFrame(()=>{var V;return(V=B.current)==null?void 0:V.focus()})},[]);Fo(o,L);const S=()=>{x||y(!1)},z=V=>{var A;V.key==="Escape"&&!x&&(y(!1),(A=B.current)==null||A.blur())},w=()=>{d||p(!0)};return e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",gap:"spacing-0",children:[C&&e.jsx(P.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Search",size:"sm"}),"aria-label":"Search","aria-expanded":!1,onClick:L}),e.jsxs(u.Box,{onTransitionEnd:w,style:{position:"relative",width:d?Eo:0,overflow:"hidden",transition:"width 220ms ease"},children:[e.jsx(Ge.Input,{ref:B,size:"sm",fullWidth:!0,value:x,placeholder:n,leftIcon:e.jsx(F.Icon,{name:"Search",width:16,height:16}),onChange:V=>O(V.target.value),onKeyDown:z,onBlur:S,tabIndex:d?0:-1}),d&&!x&&e.jsx(u.Box,{align:"center",justify:"center",borderColor:"border-subtle",borderWidth:"border",borderStyle:"border-solid",borderRadius:"rounded-xs",paddingInline:"spacing-1",customBackgroundColor:"var(--sa-background-surface-hover, #f1f2f4)",style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",minWidth:18,height:18,display:"inline-flex"},children:e.jsx(k.Text,{fontSize:"xs",color:"subtle",children:o})})]})]})},sl=({columns:r,allVisible:t,onToggle:l,onReorder:n,onSetAllHidden:o})=>{const[c,s]=h.useState(null),[i,a]=h.useState(null),d=()=>{c!==null&&i!==null&&c!==i&&n(c,i),s(null),a(null)},y=(C,p)=>{const x=C+p;x<0||x>=r.length||n(C,x)};return e.jsxs(I.Menu,{position:"bottom-right",children:[e.jsx(I.MenuButton,{children:e.jsx(P.Button,{variant:t?"outline":"secondary",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Grid",size:"sm"}),"aria-label":"Customize columns"})}),e.jsx(I.MenuLists,{children:e.jsx(I.MenuBody,{children:e.jsxs(u.Box,{padding:"sm",direction:"column",customWidth:"296px",customMaxHeight:"60vh",overflow:"overflow-hidden",children:[e.jsx(k.Text,{fontWeight:"semibold",color:"primary",children:"Customize Column Table"}),e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",paddingBlock:"md",children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"subtle",children:"Show in table"}),e.jsx(P.Button,{variant:"link",tone:"info",size:"xs",onClick:()=>o(t),children:t?"Hide All":"Show All"})]}),e.jsx(u.Box,{direction:"column",overflow:"overflow-y-auto",children:r.map((C,p)=>{const x=!C.locked,O=i===p&&c!==null&&c!==p;return e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",paddingBlock:"xs",draggable:x,onDragStart:()=>x&&s(p),onDragOver:b=>{b.preventDefault(),a(p)},onDrop:d,onDragEnd:d,style:{minHeight:32,boxShadow:O?"inset 0 2px 0 0 var(--sa-background-brand, #04254f)":void 0},children:[e.jsx(u.Box,{direction:"column",as:"div",align:"center",justify:"center",role:"button",tabIndex:x?0:-1,"aria-label":`Reorder ${C.title}`,"aria-disabled":!x||void 0,color:"icon-subtlest",onKeyDown:b=>{x&&(b.key==="ArrowUp"?(b.preventDefault(),y(p,-1)):b.key==="ArrowDown"&&(b.preventDefault(),y(p,1)))},style:{display:"inline-flex",cursor:x?"grab":"default",opacity:x?1:.4},children:e.jsx(F.Icon,{name:"DragVertical",width:16,height:16})}),C.icon&&e.jsx(u.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:C.icon}),e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:C.title}),e.jsx(u.Box,{direction:"column",style:{marginLeft:"auto"},children:e.jsx(or.Toggle,{size:"sm",checked:C.visible,disabled:C.locked,onChange:()=>l(C.key),"aria-label":`Toggle ${C.title} column`})})]},C.key)})})]})})})]})},al=({views:r,onApply:t,onDelete:l,onSave:n})=>{const[o,c]=h.useState(""),s=()=>{const i=o.trim();i&&(n(i),c(""))};return e.jsxs(I.Menu,{position:"bottom-right",children:[e.jsx(I.MenuButton,{children:e.jsx(P.Button,{variant:r.length>0?"secondary":"outline",tone:(r.length>0,"neutral"),size:"sm",iconLeft:e.jsx(F.Icon,{name:"Bookmark",size:"sm"}),"aria-label":"Saved views"})}),e.jsxs(I.MenuLists,{style:{width:"260px"},children:[e.jsx(I.MenuBody,{children:e.jsxs(u.Box,{direction:"column",padding:"xs",gap:"sm",children:[e.jsx(k.Text,{fontWeight:"semibold",color:"primary",children:"Saved Views"}),e.jsx(u.Box,{direction:"column",overflow:"overflow-y-auto",children:r.length===0?e.jsx(u.Box,{direction:"column",paddingBlock:"sm",children:e.jsx(k.Text,{fontSize:"sm",color:"subtlest",children:"No saved views yet"})}):r.map(i=>e.jsx(I.MenuItem,{startIcon:e.jsx(F.Icon,{name:"Bookmark"}),onClick:()=>t(i),endIcon:e.jsx(P.Button,{variant:"link",tone:"error",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Trash2"}),"aria-label":`Delete ${i.name}`,onClick:a=>{a.stopPropagation(),l(i.id)}}),children:i.name},i.id))})]})}),e.jsx(I.MenuFooter,{children:e.jsxs(u.Box,{direction:"row",gap:"xs",children:[e.jsx(u.Box,{direction:"column",style:{flex:"1 0 0",minWidth:0},children:e.jsx(Ge.Input,{size:"sm",fullWidth:!0,placeholder:"Save current view as…",value:o,onChange:i=>c(i.target.value),onKeyDown:i=>{i.key==="Enter"&&s()}})}),e.jsx(P.Button,{variant:"primary",tone:"brand",size:"sm",disabled:!o.trim(),onClick:s,children:"Save"})]})})]})]})},Mo=({isOpen:r,onClose:t,configs:l,activeKeys:n,configByKey:o,hasActiveFilter:c,onToggle:s,onReset:i,getValue:a,setValue:d,clearValue:y,removeFilter:C})=>{const p=n.length;return e.jsx(pr.Drawer,{position:"bottom",isShow:r,onHide:t,children:e.jsxs(u.Box,{direction:"column",customMaxHeight:"85vh",style:{minHeight:280},children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",paddingInline:"md",paddingBlock:"sm",style:{borderBottom:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.14))"},children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsx(k.Text,{fontWeight:"semibold",color:"primary",children:"Filter"}),p>0&&e.jsxs(k.Text,{fontSize:"sm",color:"subtle",children:["(",p,")"]})]}),e.jsx(P.Button,{variant:"link",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"Cross"}),"aria-label":"Close filter",onClick:t})]}),e.jsxs(u.Box,{direction:"column",gap:"lg",padding:"md",overflow:"overflow-y-auto",style:{flex:"1 1 auto",minHeight:0},children:[p>0&&e.jsxs(u.Box,{direction:"column",gap:"sm",children:[e.jsx(k.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Filter aktif"}),e.jsx(u.Box,{direction:"row",display:"flex",wrap:"wrap",gap:"sm",align:"center",children:e.jsx(nl,{activeKeys:n,configByKey:o,getValue:a,setValue:d,clearValue:y,removeFilter:C})})]}),l.length>0&&e.jsxs(u.Box,{direction:"column",gap:"sm",children:[e.jsx(k.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Tambah filter"}),e.jsx(u.Box,{direction:"column",children:l.map(x=>{const O=n.includes(x.key),b=!!x.locked;return e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",paddingBlock:"sm",style:{opacity:b?.5:1,borderTop:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.08))"},children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{minWidth:0},children:[x.icon&&e.jsx(u.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:x.icon}),e.jsx(k.Text,{fontSize:"sm",color:"primary",truncate:!0,children:x.label})]}),e.jsx(or.Toggle,{size:"sm",checked:O||b,disabled:b,onChange:()=>s(x.key),"aria-label":`Toggle ${x.label}`})]},x.key)})})]})]}),e.jsxs(u.Box,{direction:"row",display:"flex",gap:"sm",paddingInline:"md",paddingBlock:"sm",style:{borderTop:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.14))"},children:[e.jsx(u.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(P.Button,{variant:"outline",tone:"neutral",size:"md",fullWidth:!0,disabled:!c,onClick:i,children:"Reset"})}),e.jsx(u.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(P.Button,{variant:"primary",tone:"brand",size:"md",fullWidth:!0,onClick:t,children:"Selesai"})})]})]})})},Lo=r=>`${r} Rows`,To=({perPageKey:r,pageKey:t,pageSizeOptions:l,defaultPerPage:n=10,showPageSize:o})=>{const{searchQueries:c,setSearchParams:s,searchParams:i}=ke(),a=i.get(r),d=a?Number(a):n,y=C=>{s({...c,[r]:C,[t]:"1"})};return o?e.jsxs(I.Menu,{position:"bottom-right",children:[e.jsx(I.MenuButton,{children:e.jsx(P.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"MenuVertical",size:"sm"}),"aria-label":"More options"})}),e.jsx(I.MenuLists,{children:e.jsxs(I.MenuBody,{style:{minWidth:200},children:[e.jsx(u.Box,{paddingInline:"sm",paddingBlock:"xs",children:e.jsx(k.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Rows per page"})}),l.map(C=>e.jsx(I.MenuItem,{selected:C===d,endIcon:C===d?e.jsx(F.Icon,{name:"Check"}):void 0,onClick:()=>y(String(C)),children:Lo(C)},C))]})})]}):null},Io=r=>{var je;const{withPadding:t,configs:l,activeKeys:n,configByKey:o,hasActiveFilter:c,toggleFilter:s,removeFilter:i,getValue:a,setValue:d,clearValue:y,onReset:C,searchable:p,searchKey:x,filterKey:O,pageKey:b,searchPlaceholder:B,searchShortcut:L,pagination:S,perPageKey:z,pageSizeOptions:w,defaultPerPage:V,showPagination:A,showResultCount:D,showPageSize:M,hasColumns:N,orderedColumns:Q,allVisible:q,onToggleVisibility:$,onReorder:ie,onSetAllHidden:pe,showSavedViews:te,savedViews:de,onApplyView:R,onDeleteView:_,onSaveView:oe}=r,[se,fe]=h.useState(!1),{searchQueries:Fe,setSearchParams:Ie}=ke(),ge=(S==null?void 0:S.rangeStart)??(((S==null?void 0:S.currentPage)||0)>1?(((S==null?void 0:S.currentPage)||0)-1)*((S==null?void 0:S.perPage)||0)+1:1),Ee=(S==null?void 0:S.rangeEnd)??((S==null?void 0:S.totalCurrentPage)!==(S==null?void 0:S.perPage)?S==null?void 0:S.totalData:((S==null?void 0:S.currentPage)||1)*((S==null?void 0:S.totalCurrentPage)||0)),_e=be=>{Ie({...Fe,[b]:String(be)})},we=D||A&&!!(S!=null&&S.totalPage),qe=()=>{C(),fe(!1)};return e.jsxs(u.Box,{direction:"column",gap:"sm",fullWidth:!0,paddingTop:t?"sm":void 0,paddingBottom:t?"sm":void 0,paddingLeft:t?"md":void 0,paddingRight:t?"md":void 0,role:"toolbar","aria-label":"Filter bar",children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",wrap:"wrap",gap:"sm",fullWidth:!0,overflow:"overflow-auto",children:[p&&e.jsx(il,{searchKey:x,filterKey:O,pageKey:b,placeholder:B,shortcut:L}),e.jsx(P.Button,{variant:c?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(F.Icon,{name:"FilterHorizontal"}),onClick:()=>fe(!0),"aria-label":"Open filters",children:c?`Filter: ${n.length}`:null}),e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{marginLeft:"auto"},children:[te&&e.jsx(al,{views:de,onApply:R,onDelete:_,onSave:oe}),N&&e.jsx(sl,{columns:Q,allVisible:q,onToggle:$,onReorder:ie,onSetAllHidden:pe}),e.jsx(To,{perPageKey:z,pageKey:b,pageSizeOptions:w,defaultPerPage:V,showPageSize:M})]})]}),we&&e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",fullWidth:!0,children:[D?e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${ge}-${Ee} of ${((je=S==null?void 0:S.totalData)==null?void 0:je.toLocaleString())||0}`}):e.jsx(u.Box,{direction:"column"}),A&&!!(S!=null&&S.totalPage)&&e.jsx(hr.Pagination,{size:"xs",variant:"neutral",siblingCount:0,currentPage:S!=null&&S.currentPage?Number(S.currentPage):1,totalPages:Number(S.totalPage),onPageChange:_e})]}),e.jsx(Mo,{isOpen:se,onClose:()=>fe(!1),configs:l,activeKeys:n,configByKey:o,hasActiveFilter:c,onToggle:s,onReset:qe,getValue:a,setValue:d,clearValue:y,removeFilter:i})]})},Oo=({withPadding:r=!1,filterConfigs:t=[],filterKey:l="filter",activeFilterKey:n="filters",pageKey:o="page",perPageKey:c="perPage",pageSizeOptions:s=[25,50,100],defaultPerPage:i,showPagination:a=!0,showResultCount:d=!0,showPageSize:y=!0,searchable:C=!1,searchKey:p="q",searchPlaceholder:x="Search",searchShortcut:O="/",pagination:b,columns:B=[],onColumnsChange:L,columnsState:S,scopeId:z,savedViews:w,persistLastState:V=!0,storage:A=$r,onReset:D})=>{const M=z??(w==null?void 0:w.scopeId),{activeKeys:N,configByKey:Q,hasActiveFilter:q,toggleFilter:$,removeFilter:ie,getValue:pe,setValue:te,clearValue:de,clearAll:R}=Kr({configs:t,filterKey:l,activeFilterKey:n,pageKey:o,searchKey:p}),_=lo({columns:B,scopeId:M,storage:A,onColumnsChange:L,value:S}),oe=oo({scopeId:M,storage:A,snapshotKeys:[n,l,c],pageKey:o,getColumns:()=>_.state,applyColumns:_.applyState}),se=no({scopeId:M,storage:A,snapshotKeys:[n,l,o],enabled:V}),fe=co({scopeId:M,storage:A,perPageKey:c,pageSizeOptions:s,enabled:V});so({enabled:V&&!!M,snapshotKeys:[n,l,o],perPageKey:c,readSnapshot:se.read,readPerPage:fe.read});const Fe=i??s[0]??25,Ie=!!(w!=null&&w.enabled)&&oe.enabled,ge=()=>{R(),se.clear(),D==null||D()};return ue.useMediaQuery("md")?e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",gap:"sm",wrap:"wrap",fullWidth:!0,paddingTop:r?"sm":void 0,paddingBottom:r?"sm":void 0,paddingLeft:r?"md":void 0,paddingRight:r?"md":void 0,role:"toolbar","aria-label":"Filter bar",children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(ao,{configs:t,activeKeys:N,onToggle:$,hasActiveFilter:q,onReset:ge}),e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",overflow:"overflow-x-auto",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(nl,{activeKeys:N,configByKey:Q,getValue:pe,setValue:te,clearValue:de,removeFilter:ie}),q&&e.jsx(P.Button,{variant:"link",tone:"brand",size:"sm",onClick:ge,children:"Reset"})]})]}),e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",children:[e.jsx(mo,{pagination:b,pageKey:o,perPageKey:c,pageSizeOptions:s,defaultPerPage:Fe,showPagination:a,showResultCount:d,showPageSize:y}),C&&e.jsx(il,{searchKey:p,filterKey:l,pageKey:o,placeholder:x,shortcut:O}),Ie&&e.jsx(al,{views:oe.views,onApply:oe.applyView,onDelete:oe.deleteView,onSave:oe.saveView}),B.length>0&&e.jsx(sl,{columns:_.orderedColumns,allVisible:_.allVisible,onToggle:_.toggleVisibility,onReorder:_.reorder,onSetAllHidden:_.setAllHidden})]})]}):e.jsx(Io,{withPadding:r,configs:t,activeKeys:N,configByKey:Q,hasActiveFilter:q,toggleFilter:$,removeFilter:ie,getValue:pe,setValue:te,clearValue:de,onReset:ge,searchable:C,searchKey:p,filterKey:l,pageKey:o,searchPlaceholder:x,searchShortcut:O,pagination:b,perPageKey:c,pageSizeOptions:s,defaultPerPage:Fe,showPagination:a,showResultCount:d,showPageSize:y,hasColumns:B.length>0,orderedColumns:_.orderedColumns,allVisible:_.allVisible,onToggleVisibility:_.toggleVisibility,onReorder:_.reorder,onSetAllHidden:_.setAllHidden,showSavedViews:Ie,savedViews:oe.views,onApplyView:oe.applyView,onDeleteView:oe.deleteView,onSaveView:oe.saveView})},Wo=r=>{if(!Array.isArray(r)||r.length===0)return;const t=r[0];return(t==null?void 0:t.value)!=null?String(t.value):void 0},Ao=r=>{if(!Array.isArray(r)||r.length===0)return;const t=r.map(l=>(l==null?void 0:l.value)!=null?String(l.value):null).filter(l=>l!=null);return t.length?t:void 0},zo=(r,t)=>{switch(r.type){case"dropdown":case"radio":return Wo(t);case"dropdown-multiple":case"checkbox-multiple":return Ao(t);case"date":return t instanceof Date?t.toISOString():void 0;case"date-compact":return t;default:return}},dl=(r,t)=>{if(r==null||r==="")return t;const l=Number(r);return Number.isFinite(l)&&l>0?l:t},Vo=r=>{const{filterConfigs:t,filterKey:l="filter",activeFilterKey:n="filters",pageKey:o="page",perPageKey:c="perPage",searchKey:s="q",defaultPage:i=1,defaultPerPage:a=10,paramKeys:d,serialize:y}=r,{activeKeys:C,configByKey:p,hasActiveFilter:x,getValue:O}=Kr({configs:t,filterKey:l,activeFilterKey:n,pageKey:o,searchKey:s}),{searchParams:b}=ke(),B=b.toString();return h.useMemo(()=>{const S={},z={},w=dl(b.get(o),i),V=dl(b.get(c),a);S[(d==null?void 0:d.page)??"page"]=w,S[(d==null?void 0:d.perPage)??"perPage"]=V;const A=Dr(s,b,l)||"";A&&(S[(d==null?void 0:d.search)??"search"]=A);let D=!1;for(const M of C){const N=p[M];if(!N)continue;const Q=O(N);z[M]=Q;const q=y==null?void 0:y[M],$=q?q(Q):zo(N,Q);if($==null||Array.isArray($)&&$.length===0)continue;const ie=(d==null?void 0:d[M])??M;S[ie]=$,D=!0}return{params:S,raw:z,hasActiveFilter:x||!!A||D}},[B,C.join("|"),l,n,o,c,s,i,a,d,y,p])},Ho=["dropdown","dropdown-multiple","checkbox-multiple","radio"],Po=({filterConfigs:r,filterKey:t,activeFilterKey:l,pageKey:n,searchKey:o})=>{const{configByKey:c,getValue:s,setValue:i,removeFilter:a,clearAll:d,hasActiveFilter:y}=Kr({configs:r,filterKey:t,activeFilterKey:l,pageKey:n,searchKey:o}),C=(L,S)=>{var w;const z=L.options;return((w=z==null?void 0:z.find(V=>V.value===S))==null?void 0:w.label)??S},p=h.useCallback(L=>{const S=c[L];if(!S)return[];const z=s(S);return Array.isArray(z)?z.map(w=>String(w.value)):[]},[c,s]),x=h.useCallback((L,S)=>{const z=c[L];if(!z||!Ho.includes(z.type))return;const w=Array.isArray(S)?S:[S];if(w.length===0){a(L);return}i(z,w.map(V=>({label:C(z,V),value:V})))},[c,i,a]),O=h.useCallback((L,S)=>{const z=p(L);x(L,z.includes(S)?z.filter(w=>w!==S):[...z,S])},[p,x]),b=h.useCallback((L,S)=>p(L).includes(S),[p]),B=h.useCallback(L=>a(L),[a]);return{set:x,toggle:O,clear:B,clearAll:d,isActive:b,values:p,hasActiveFilter:y}},jo=(r,t)=>{if(!r)return{};const{fromKey:l,toKey:n,opKey:o}=t,c={};switch(r.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return r.date&&(c[l]=new Date(r.date).toISOString()),o&&(c[o]=r.op),c;case"is-between":return r.from&&(c[l]=new Date(r.from).toISOString()),r.to&&(c[n]=new Date(r.to).toISOString()),c;case"is-relative-to-today":{if(!r.relative)return c;const{from:s,to:i}=Rt(r.relative);return c[l]=s.toISOString(),c[n]=i.toISOString(),c}case"is-empty":case"is-not-empty":return o&&(c[o]=r.op==="is-empty"?"empty":"not-empty"),c;default:return c}},hl=({children:r,borderRadius:t,height:l})=>{const n=h.useRef(null),[o,c]=h.useState("100vh");return h.useEffect(()=>{if(l)return;const s=()=>{if(n.current){const i=n.current.getBoundingClientRect().top;c(`calc(100vh - ${i}px)`)}};return s(),window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[l]),e.jsx(u.Box,{ref:n,fullWidth:!0,borderStyle:"border-solid",borderWidth:"border",borderColor:"border-base",borderRadius:t||"rounded-xs",style:{height:l??o,display:"flex",flexDirection:"column"},children:r})},fl=({action:r,rightContent:t,leftContent:l,headerSlot:n,advanceFilter:o,showFilter:c=!0})=>{const s=ue.useMediaQuery("md"),i=c?e.jsx(Kt,{...o}):null,a=()=>r?h.isValidElement(r)?r:e.jsx(u.Box,{style:{display:"flex",flexDirection:s?"row":"column",gap:"8px",width:s?"auto":"100%",textWrap:"nowrap"},children:r.map(({title:d,icon:y,buttonProps:C,onClick:p},x)=>!d&&!y?null:e.jsx(P.Button,{fullWidth:!s,iconLeft:y?e.jsx(F.Icon,{name:y}):void 0,onClick:p,...C,children:d},`action-${x}`))}):null;return e.jsx(u.Box,{style:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center",paddingLeft:"8px",paddingRight:"8px",paddingTop:"8px",paddingBottom:"8px",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",flexShrink:0,position:"relative",zIndex:10,flexDirection:s?"row":"column-reverse",gap:"16px"},children:n?n({filter:i}):e.jsxs(e.Fragment,{children:[e.jsxs(u.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flex:1,minWidth:0},children:[i,l]}),e.jsxs(u.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flexShrink:0},children:[t,a()]})]})})},No=({totalData:r,withMarginBottom:t=!0,withMarginTop:l=!0})=>e.jsxs(u.Box,{style:{display:"flex",gap:"4px",flexDirection:"row",alignItems:"center",marginBottom:t?"16px":void 0,marginTop:l?"16px":void 0},children:[e.jsxs(Te.Body1,{props:{color:"gray-500"},children:["Total data:"," "]}),e.jsx(Te.Body1,{children:r||0})]}),gl=({pagination:r,pageKey:t="page",perPageKey:l="perPage",defaultPerPage:n=10,showPagination:o=!0,totalData:c})=>{const{searchQueries:s,setSearchParams:i,searchParams:a}=ke(),d=a.get(l),y=O=>{i({...s,[t]:String(O)})},C=O=>{i({...s,[l]:O,[t]:"1"})},p=(r==null?void 0:r.rangeStart)??(((r==null?void 0:r.currentPage)||0)>1?(((r==null?void 0:r.currentPage)||0)-1)*((r==null?void 0:r.perPage)||0)+1:1),x=(r==null?void 0:r.rangeEnd)??((r==null?void 0:r.totalCurrentPage)!==(r==null?void 0:r.perPage)?r==null?void 0:r.totalData:((r==null?void 0:r.currentPage)||1)*((r==null?void 0:r.totalCurrentPage)||0));return e.jsx(u.Box,{style:{display:"flex",width:"100%",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px",borderTop:"1px solid var(--sa-border-subtle, #0b120e24)",flexShrink:0},children:o?e.jsxs(e.Fragment,{children:[e.jsxs(u.Box,{style:{display:"flex",flexDirection:"row",gap:"8px",alignItems:"center",textWrap:"nowrap"},children:[e.jsx(k.Text,{children:"Rows Per Page: "}),e.jsx(rr.Dropdown,{dropdownLists:[{label:"5",value:"5"},{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"},{label:"100",value:"100"}],onChange:O=>{C(O[0].value)},value:d?[{label:`${d} per row`,value:d}]:[{label:`${n} per row`,value:`${n}`}],defaultValue:d?[{label:`${d} per row`,value:d}]:[{label:`${n} per row`,value:`${n}`}]}),e.jsx(k.Text,{children:`${p}-${x} of ${(r==null?void 0:r.totalData)||0}`})]}),e.jsx(hr.Pagination,{currentPage:r!=null&&r.currentPage?Number(r==null?void 0:r.currentPage):1,totalPages:r!=null&&r.totalPage?Number(r==null?void 0:r.totalPage):1,onPageChange:y})]}):e.jsx(No,{totalData:c,withMarginBottom:!1,withMarginTop:!1})})},ul=({filter:r,columnTitle:t})=>{const[l,n]=h.useState(!1),o=h.useRef(null),c=h.useRef(null),s=h.useRef(null),[i,a]=h.useState(""),[d,y]=h.useState({top:0,left:0}),C=r.selectedValues,p=h.useMemo(()=>i?r.options.filter(b=>b.label.toLowerCase().includes(i.toLowerCase())):r.options,[r.options,i]);h.useEffect(()=>{if(l&&c.current){const b=c.current.getBoundingClientRect(),B=280,L={top:b.bottom+8};r.position==="left"||b.left+B>window.innerWidth?L.right=window.innerWidth-b.right:L.left=b.left,y(L)}},[l,r.position]),h.useEffect(()=>{l&&s.current?setTimeout(()=>{var b;return(b=s.current)==null?void 0:b.focus()},50):a("")},[l]),h.useEffect(()=>{const b=B=>{o.current&&!o.current.contains(B.target)&&c.current&&!c.current.contains(B.target)&&n(!1)};return l&&document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[l]);const x=b=>{const B=C.includes(b)?C.filter(L=>L!==b):[...C,b];r.onFilterChange(B)},O=()=>r.onFilterChange([]);return e.jsxs(u.Box,{direction:"column",style:{position:"relative"},children:[e.jsx(u.Box,{ref:c,style:{display:"flex",flexDirection:"row",alignItems:"center",cursor:"pointer"},onClick:b=>{var B;b.stopPropagation(),l||(B=r.onOpen)==null||B.call(r),n(L=>!L)},children:e.jsx(F.Icon,{name:l?"ChevronUp":"ChevronDown",size:"sm",style:{color:C.length>0?"var(--sa-color-brand-500, #1a4fa0)":"var(--sa-text-subtle, #8c8f97)"}})}),l&&e.jsxs(u.Box,{ref:o,style:{position:"fixed",top:`${d.top}px`,...d.left!==void 0?{left:`${d.left}px`}:{right:`${d.right}px`},backgroundColor:"white",borderRadius:"4px",minWidth:"280px",maxHeight:"400px",display:"flex",flexDirection:"column",zIndex:9999,animation:"fadeInDropdown 0.15s ease-out",border:"1px solid var(--sa-border-subtle, #0b120e24)"},children:[e.jsxs(u.Box,{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingTop:"12px",paddingBottom:"12px",paddingLeft:"16px",paddingRight:"16px",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"},children:[e.jsxs(k.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-700",children:["Filter ",t]}),C.length>0&&e.jsx(u.Box,{direction:"column",style:{cursor:"pointer"},children:e.jsx(k.Text,{fontSize:"xs",color:"primary",fontWeight:"semibold",onClick:b=>{b.stopPropagation(),O()},children:"CLEAR"})})]}),!r.hideSearch&&e.jsx(u.Box,{direction:"column",style:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px"},children:e.jsx(Ge.Input,{ref:s,placeholder:`Search ${t.toLowerCase()}...`,leftIcon:e.jsx(F.Icon,{name:"Search",size:"sm"}),value:i,onChange:b=>a(b.target.value),style:{fontSize:"14px"}})}),e.jsx(u.Box,{direction:"column",className:"ts-filter-dropdown-options",style:{overflowY:"auto",maxHeight:"250px",paddingLeft:"8px",paddingRight:"8px"},children:r.isLoadingOptions?e.jsxs(u.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(F.Icon,{name:"Loading",size:"lg",style:{color:"var(--sa-background-brand, #04254f)",animation:"spin 1s linear infinite"}}),e.jsx(k.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"Loading options..."})]}):p.length>0?e.jsx(u.Box,{direction:"column",style:{gap:"2px",paddingTop:"4px",paddingBottom:"4px"},children:p.map(b=>e.jsxs(u.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",paddingTop:"8px",paddingBottom:"8px",paddingLeft:"8px",paddingRight:"8px",cursor:"pointer",borderRadius:"8px",transition:"all 0.2s ease",backgroundColor:C.includes(b.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent"},onClick:B=>{B.stopPropagation(),x(b.value)},onMouseEnter:B=>{C.includes(b.value)||(B.currentTarget.style.backgroundColor="var(--sa-background-primary, #ffffff)"),B.currentTarget.style.transform="translateX(2px)"},onMouseLeave:B=>{B.currentTarget.style.backgroundColor=C.includes(b.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent",B.currentTarget.style.transform="translateX(0)"},children:[e.jsx(nr.Checkbox,{checked:C.includes(b.value),onChange:()=>{}}),e.jsx(k.Text,{fontSize:"sm",fontWeight:C.includes(b.value)?"medium":"normal",color:C.includes(b.value)?"primary":"gray-700",children:b.label})]},b.value))}):e.jsxs(u.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(F.Icon,{name:"Search",size:"lg",style:{color:"var(--sa-text-subtle, #8c8f97)"}}),e.jsx(k.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"No results found"})]})}),C.length>0&&e.jsx(u.Box,{direction:"column",style:{paddingTop:"8px",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"16px",borderTop:"1px solid var(--sa-border-subtle, #0b120e24)",backgroundColor:"var(--sa-color-brand-50, #e6edf6)",marginTop:"auto"},children:e.jsxs(u.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsx(u.Box,{direction:"column",style:{backgroundColor:"var(--sa-background-brand, #04254f)",borderRadius:"12px",padding:"2px 8px",fontSize:"11px",fontWeight:600,color:"white"},children:C.length}),e.jsxs(k.Text,{fontSize:"xs",color:"primary",fontWeight:"medium",children:["item",C.length>1?"s":""," selected"]})]})})]})]})},_o=({direction:r})=>{const t="var(--sa-text-primary, #292a2e)",l="var(--sa-text-subtle, #8c8f97)",n=r==="asc"?t:l,o=r==="desc"?t:l,c=r==="asc"?1:.45,s=r==="desc"?1:.45;return e.jsxs("span",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flexShrink:0,lineHeight:0},"aria-hidden":!0,children:[e.jsx("svg",{width:"8",height:"5",viewBox:"0 0 8 5",style:{color:n,opacity:c,marginBottom:1},children:e.jsx("path",{d:"M4 0 L8 5 L0 5 Z",fill:"currentColor"})}),e.jsx("svg",{width:"8",height:"5",viewBox:"0 0 8 5",style:{color:o,opacity:s},children:e.jsx("path",{d:"M0 0 L8 0 L4 5 Z",fill:"currentColor"})})]})},qo=({frozen:r})=>e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:r?"currentColor":"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e.jsx("path",{d:r?"M7 11V7a5 5 0 0 1 10 0v4":"M7 11V7a5 5 0 0 1 9.9-1"})]}),lt="var(--sa-background-primary, #ffffff)",yl="var(--sa-background-primary-inverse, #f8f8f8)",pl=({columns:r,records:t,handleDetail:l,handleUpdate:n,handleDelete:o,isLoading:c,visibleHandleDelete:s,visibleHandleUpdate:i,visibleHandleDetail:a,showHeadBorder:d=!1,scrollParentRef:y,frozenCount:C=0,onFrozenCountChange:p,customActions:x,actionsOrder:O=["detail","update","delete","custom"],customEmptyState:b,enableColumnResize:B=!1,defaultColumnWidths:L,onColumnWidthsChange:S,defaultMinColumnWidth:z=60,sort:w,defaultSort:V,onSortChange:A,showActionDivider:D=!1})=>{const M=w!==void 0,[N,Q]=h.useState(V??null),q=M?w??null:N,$=T=>{if(T.sortKey)return T.sortKey;if(typeof T.accessor=="string")return T.accessor},ie=T=>{const H=$(T);if(!H)return;let j;!q||q.key!==H?j={key:H,direction:"asc"}:q.direction==="asc"?j={key:H,direction:"desc"}:j=null,M||Q(j),A==null||A(j)},te=[l,n,o].filter(T=>T!==void 0).length,de=!!x,R=!!l||!!n||!!o||de,_="var(--sa-border-subtle, #0b120e24)",oe=`1px solid ${_}`,se=`inset 1px 0 0 ${_}`,fe=`inset -1px 0 0 ${_}`,Fe=te===3?de?"178px":"140px":te===2?de?"140px":"102px":te===1?de?"112px":"74px":de?"74px":"",Ie=(T,H)=>{if(!H)return T;if(typeof H=="function")return H(T);if(typeof H=="string")return T[H]},[ge,Ee]=h.useState(!1);h.useEffect(()=>{if(!(y!=null&&y.current))return;const T=y.current;Ee(T.scrollHeight>T.clientHeight)},[t,y]);const _e=h.useRef(null),[we,qe]=h.useState([]),[je,be]=h.useState(()=>L??{}),Oe=h.useRef(null);h.useLayoutEffect(()=>{if(!C||!_e.current){qe([]);return}const T=Array.from(_e.current.querySelectorAll("thead tr th")),H=[];let j=0;T.forEach((G,K)=>{H[K]=j,K<C&&(j+=G.offsetWidth)}),qe(H)},[C,r,t,je]);const Je=T=>{p&&p(T<C?T:T+1)},m=(T,H)=>{const j=je[T];if(j!==void 0){const G=`${j}px`;return{width:G,minWidth:G,maxWidth:G}}return H?{width:H}:{}},U=T=>B&&(T.resizable??!0),Z=(T,H)=>{T.preventDefault(),T.stopPropagation();const j=T.currentTarget.closest("th");if(!j)return;const G=Math.round(j.getBoundingClientRect().width);Oe.current={colIndex:H,startX:T.clientX,startWidth:G};const K=document.body.style.userSelect,ve=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";const Be=Ae=>{var Ke;const Me=Oe.current;if(!Me)return;const Ye=((Ke=r[Me.colIndex])==null?void 0:Ke.minWidth)??z,Xe=Math.max(Ye,Me.startWidth+(Ae.clientX-Me.startX));be(ze=>ze[Me.colIndex]===Xe?ze:{...ze,[Me.colIndex]:Xe})},We=()=>{document.removeEventListener("mousemove",Be),document.removeEventListener("mouseup",We),document.body.style.userSelect=K,document.body.style.cursor=ve,Oe.current=null,S&&be(Ae=>(S(Ae),Ae))};document.addEventListener("mousemove",Be),document.addEventListener("mouseup",We)};return e.jsx("div",{ref:_e,children:e.jsxs(J.Table,{fullWidth:!0,children:[e.jsx(J.Thead,{style:{height:"40px",whiteSpace:"nowrap"},children:e.jsxs(J.Tr,{children:[r.map((T,H)=>{var ir,sr;const j=C>0&&H<C,G=we[H]??0,K=U(T),Be=H===r.length-1&&R&&D,We=$(T),Ae=!!T.sortable&&!!We,Me=Ae&&(q==null?void 0:q.key)===We?q.direction:null,Ye=T.title||((ir=T.accessor)==null?void 0:ir.toString())||"",Xe=(sr=T.headerTooltip)!=null&&sr.showIcon?e.jsx(F.Icon,{name:"InfoCircle",size:"xs",style:{flexShrink:0,color:"var(--sa-icon-subtle, #8c8f97)",opacity:.75}}):null,Ke=e.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Ye}),ze=Ae?e.jsxs("button",{type:"button",onClick:()=>ie(T),title:Me==="asc"?"Sorted ascending — click to sort descending":Me==="desc"?"Sorted descending — click to clear":"Click to sort ascending",style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4,background:"none",border:"none",padding:0,margin:0,font:"inherit",color:"inherit",cursor:"pointer",textAlign:T.textAlign==="text-right"?"right":T.textAlign==="text-center"?"center":"left"},children:[Ke,Xe,e.jsx(_o,{direction:Me})]}):e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4},children:[Ke,Xe]});return e.jsxs(J.Th,{style:{position:"sticky",top:0,left:j?G:void 0,zIndex:j?4:2,paddingLeft:H===0?"12px":"",borderRight:d&&!Be&&!j?oe:void 0,borderBottom:d?oe:void 0,boxShadow:d&&j?fe:void 0,backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",textAlign:T.textAlign==="text-right"?"right":T.textAlign==="text-center"?"center":"left",...m(H,T.width)},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"space-between",minWidth:0},children:[T.headerTooltip?e.jsx(De.Tooltip,{label:T.headerTooltip.content,position:"bottom",children:ze}):ze,T.filter&&e.jsx(ul,{filter:T.filter,columnTitle:T.title}),p&&e.jsx("button",{onClick:()=>Je(H),title:j?"Unfreeze column":"Freeze column",style:{background:"none",border:"none",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",flexShrink:0,color:j?"var(--sa-background-brand, #04254f)":"var(--sa-text-subtle, #8c8f97)",opacity:j?1:.45,transition:"opacity 0.15s"},children:e.jsx(qo,{frozen:j})})]}),K&&e.jsx("div",{onMouseDown:ar=>Z(ar,H),onClick:ar=>ar.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-${H}`)}),R?e.jsx(J.Th,{style:{backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",position:"sticky",top:0,right:0,zIndex:3,borderBottom:d?oe:void 0,boxShadow:d&&D?se:void 0}}):null]})}),e.jsx(J.Tbody,{children:c?e.jsx(J.Tr,{children:e.jsx(J.Td,{colSpan:r.length+1,children:e.jsxs(u.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"})]})})}):!(t!=null&&t.length)&&b?e.jsx(J.Tr,{children:e.jsx(J.Td,{colSpan:r.length+1,children:b})}):t==null?void 0:t.map((T,H)=>e.jsxs(J.Tr,{style:{transition:"background-color 0.3s ease",padding:0,borderBottom:H===t.length-1&&ge?void 0:"1px solid var(--sa-border-subtle, #0b120e24)"},onMouseEnter:j=>{const G=j.currentTarget;G.style.backgroundColor=yl,Array.from(G.querySelectorAll("td")).forEach(K=>{K.style.position==="sticky"&&(K.style.backgroundColor=yl)})},onMouseLeave:j=>{const G=j.currentTarget;G.style.backgroundColor="",Array.from(G.querySelectorAll("td")).forEach(K=>{K.style.position==="sticky"&&(K.style.backgroundColor=lt)})},children:[r.map((j,G)=>{const K=j.render?j.render(T,H,t):Ie(T,j.accessor),ve=C>0&&G<C,Be=we[G]??0,We=je[G]!==void 0,Ae=ve&&G===C-1;return e.jsx(J.Td,{style:{position:ve?"sticky":void 0,left:ve?Be:void 0,zIndex:ve?1:void 0,backgroundColor:ve?lt:void 0,transition:ve?"background-color 0.3s ease":void 0,paddingLeft:G===0?"12px":"",whiteSpace:"nowrap",overflow:We?"hidden":void 0,borderLeft:j.showBorderLeft?oe:void 0,borderRight:j.showBorderRight?oe:void 0,boxShadow:Ae?fe:void 0,textAlign:j.textAlign==="text-right"?"right":j.textAlign==="text-center"?"center":"left",...m(G,j.width)},children:typeof K=="string"?e.jsx(k.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:j.textAlign==="text-right"?"right":j.textAlign==="text-center"?"center":"left"},children:K}):K},`row-${H}-col-${G}`)}),R?e.jsx(J.Td,{style:{width:Fe,position:"sticky",right:0,zIndex:1,backgroundColor:lt,boxShadow:D?se:void 0,transition:"background-color 0.3s ease"},children:e.jsx(ne.Flex,{direction:"row",align:"center",justify:"center",gap:"sm",children:O.map(j=>{const G=H===t.length-1?"top":"bottom";return j==="detail"&&l&&(a==null?void 0:a(T))!==!1?e.jsx(De.Tooltip,{label:"Detail",position:G,children:e.jsx(P.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>l(T.id,T),iconLeft:e.jsx(F.Icon,{name:"DocumentClean",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"detail"):j==="update"&&n&&(i==null?void 0:i(T))!==!1?e.jsx(De.Tooltip,{label:"Update",position:G,children:e.jsx(P.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>n(T),iconLeft:e.jsx(F.Icon,{name:"Edit1",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"update"):j==="delete"&&o&&(s==null?void 0:s(T))!==!1?e.jsx(De.Tooltip,{label:"Delete",position:G,children:e.jsx(P.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>o(T.id,T),iconLeft:e.jsx(F.Icon,{name:"Trash1",size:"sm",style:{color:"var(--sa-color-error-600, #c9184a)"}})})},"delete"):j==="custom"?e.jsx(h.Fragment,{children:x==null?void 0:x(T)},"custom"):null})})}):null]},`${T}${H}`))})]})})},Zo=({wrapperProps:r,dataTableProps:t,headerProps:l,footerProps:n})=>{var C;const o=h.useRef(null),[c,s]=h.useState((t==null?void 0:t.defaultFrozenCount)??0),i=(l==null?void 0:l.show)??!0,a=h.useRef(null),d=(C=t==null?void 0:t.pagination)==null?void 0:C.totalData;typeof d=="number"&&(a.current=d);const y=(n==null?void 0:n.showFooter)??(d===void 0?a.current!==0:d!==0);return e.jsxs(hl,{...r,children:[i&&e.jsx(fl,{...l}),e.jsx(u.Box,{direction:"column",ref:o,style:{flex:1,overflowY:"auto",overflowX:"auto"},children:t?e.jsx(pl,{...t,scrollParentRef:o,frozenCount:t!=null&&t.enableFreezeColumns?c:0,onFrozenCountChange:t!=null&&t.enableFreezeColumns?s:void 0}):null}),y&&e.jsx(gl,{pagination:t==null?void 0:t.pagination,pageKey:t==null?void 0:t.pageKey,perPageKey:t==null?void 0:t.perPageKey,defaultPerPage:t==null?void 0:t.defaultPerPage,showPagination:t==null?void 0:t.showPagination,totalData:n==null?void 0:n.totalData})]})};function Go(r){return h.memo(r)}const Qo=Go(Zo),Cl=200,ot="1px solid var(--sa-border-subtle, #0b120e24)",Uo=({sortDir:r,frozen:t})=>r==="asc"?e.jsx(F.Icon,{name:"ChevronSmallUp"}):r==="desc"?e.jsx(F.Icon,{name:"ChevronSmallDown"}):t?e.jsx(F.Icon,{name:"LockOn",size:"xs"}):e.jsx(F.Icon,{name:"Filter",size:"xs"}),Fr=({icon:r,label:t,active:l,danger:n,onClick:o})=>{const c=n?"var(--sa-color-error-600, #c9184a)":"var(--sa-text-primary, #292a2e)";return e.jsxs("button",{type:"button",onClick:o,style:{display:"flex",alignItems:"center",gap:12,width:"100%",padding:"8px 12px",background:l?"var(--sa-background-brand-subtlest, #e6edf6)":"none",border:"none",cursor:"pointer",font:"inherit",color:c,textAlign:"left"},onMouseEnter:s=>{l||(s.currentTarget.style.background="var(--sa-background-primary-inverse, #f8f8f8)")},onMouseLeave:s=>{s.currentTarget.style.background=l?"var(--sa-background-brand-subtlest, #e6edf6)":"none"},children:[e.jsx(F.Icon,{name:r,size:"sm",style:{color:c,flexShrink:0}}),e.jsx(k.Text,{as:"span",style:{color:c},children:t})]})},bl=({active:r,canSort:t,canHide:l,sortDir:n,frozen:o,onSort:c,onClearSort:s,onToggleFreeze:i,onHide:a})=>{const[d,y]=h.useState(!1),C=h.useRef(null),p=h.useRef(null),[x,O]=h.useState({top:0,left:0});h.useEffect(()=>{if(d&&C.current){const B=C.current.getBoundingClientRect(),L=B.left+Cl>window.innerWidth;O({top:B.bottom+6,...L?{right:window.innerWidth-B.right}:{left:B.left}})}},[d]),h.useEffect(()=>{if(!d)return;const B=L=>{p.current&&!p.current.contains(L.target)&&C.current&&!C.current.contains(L.target)&&y(!1)};return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[d]);const b=B=>{B(),y(!1)};return e.jsxs(e.Fragment,{children:[e.jsx("button",{ref:C,type:"button",className:"sa-tl-menu-trigger","data-active":r||d?"true":"false",onClick:B=>{B.stopPropagation(),y(L=>!L)},title:"Column options",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:"var(--sa-radii-sm, 6px)",border:ot,background:"var(--sa-background-primary, #ffffff)",cursor:"pointer",color:"var(--sa-text-subtle, #8c8f97)",flexShrink:0},children:e.jsx(Uo,{sortDir:n,frozen:o})}),d&&e.jsxs(u.Box,{ref:p,onClick:B=>B.stopPropagation(),style:{position:"fixed",top:`${x.top}px`,...x.left!==void 0?{left:`${x.left}px`}:{right:`${x.right}px`},minWidth:Cl,backgroundColor:"var(--sa-background-primary, #ffffff)",border:ot,borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"0 6px 24px rgba(0,0,0,0.12)",zIndex:9999,padding:"4px",display:"flex",flexDirection:"column"},children:[t&&e.jsxs(e.Fragment,{children:[e.jsx(Fr,{icon:"ChevronUp",label:"Ascending",active:n==="asc",onClick:()=>b(()=>n==="asc"?s():c("asc"))}),e.jsx(Fr,{icon:"ChevronDown",label:"Descending",active:n==="desc",onClick:()=>b(()=>n==="desc"?s():c("desc"))}),e.jsx("div",{style:{borderTop:ot,margin:"4px 0"}})]}),e.jsx(Fr,{icon:"Pin1",label:o?"Unfreeze":"Freeze",active:o,onClick:()=>b(i)}),l&&e.jsx(Fr,{icon:"EyeClosed",label:"Hide column",danger:!0,onClick:()=>b(a)})]})]})},Er="1px solid var(--sa-border-subtle, #0b120e24)",Jo="var(--sa-text-subtle, #8c8f97)",ur="var(--sa-background-neutral, #f0f1f2)",vl="2px 0 4px -2px rgba(0,0,0,0.15)",Mr={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},xl="sa-table-layout-styles",Yo=()=>{if(typeof document>"u"||document.getElementById(xl))return;const r=document.createElement("style");r.id=xl,r.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(r)},lt=r=>r==="right"?"right":r==="center"?"center":"left",Jo=(r,t)=>{if(t)return r[t]},Yo=(r,t)=>r==null&&t==null?0:r==null?-1:t==null?1:typeof r=="number"&&typeof t=="number"?r-t:String(r).localeCompare(String(t)),Xo=({columns:r,data:t,getRowKey:l,size:n="md",resizable:o=!1,widthStorageKey:c,columnState:s,onColumnStateChange:i,columnMenu:a=!1,sort:d,defaultSort:u,onSortChange:p,height:C,mobileLayout:v="cards",mobileBreakpoint:T="md",groupSeparator:b,summary:B,emptyState:E,rowActions:S})=>{Uo();const w=!ue.useMediaQuery(T)&&v!=="scroll",z=!!(S!=null&&S.length),[W,D]=h.useState(null);h.useEffect(()=>{if(!W)return;const x=()=>D(null),L=setTimeout(()=>document.addEventListener("click",x),0);return()=>{clearTimeout(L),document.removeEventListener("click",x)}},[W]);const[O,q]=h.useState(()=>new Set),U=s!==void 0,[G,$]=h.useState({}),te=s??G,he=x=>{i==null||i(x),U||$(x)},ie=d!==void 0,[se,ee]=h.useState(u??null),P=ie?d??null:se,le=!p,pe=x=>{p==null||p(x),ie||ee(x)},{headerGroups:fe,leafColumns:ge,hasGroups:me}=h.useMemo(()=>{var be;const x=new Set(te.hidden??[]),L=(R,de)=>R.key??(typeof R.accessor=="string"?R.accessor:`col-${de}`),A=r.map((R,de)=>{var He;if((He=R.children)!=null&&He.length){const ir=R.children.map((Ke,ht)=>({col:Ke,key:L(Ke,`${de}-${ht}`)})).filter(Ke=>!x.has(Ke.key));return{col:R,key:R.key??`group-${de}`,isGroup:!0,leaves:ir}}const Fe={col:R,key:L(R,`${de}`)};return{col:R,key:Fe.key,isGroup:!1,leaves:x.has(Fe.key)?[]:[Fe]}}).filter(R=>R.leaves.length>0),K=A.some(R=>R.isGroup);let ae=A.flatMap(R=>R.leaves);if(!K&&((be=te.order)!=null&&be.length)){const R=new Map(te.order.map((de,Fe)=>[de,Fe]));ae=[...ae].sort((de,Fe)=>(R.get(de.key)??1/0)-(R.get(Fe.key)??1/0))}return{headerGroups:A,leafColumns:ae,hasGroups:K}},[r,te]),We=h.useMemo(()=>new Map(ge.map((x,L)=>[x.key,L])),[ge]),Pe=ge.map(x=>x.key).join("|"),je=(x,L)=>{const A=x.sortKey??(typeof x.accessor=="string"?x.accessor:void 0);return A?L[A]:void 0},we=x=>x.sortable??(!!x.sortKey||typeof x.accessor=="string"),De=h.useMemo(()=>{if(!le||!P)return t;const x=ge.find(A=>A.key===P.key);if(!x)return t;const L=P.direction==="asc"?1:-1;return[...t].sort((A,K)=>Yo(je(x.col,A),je(x.col,K))*L)},[t,le,P,ge]),Ee=!me,ze=!!c&&Ee,[Qe,cr]=Y.useColumnWidths(c??""),m=ze?Qe:void 0,_=h.useRef(null),[j,M]=h.useState();h.useLayoutEffect(()=>{M(void 0)},[Pe]),h.useLayoutEffect(()=>{if(!Ee||j||!_.current)return;const x=_.current.querySelectorAll("th.sa-tl-leaf");M(Array.from(x).map(L=>L.offsetWidth))},[j,Ee]);const[Q,N]=h.useState(0);h.useLayoutEffect(()=>{if(!me||!_.current)return;const x=_.current.querySelector(":scope > tr");x&&N(x.offsetHeight)},[me,Pe]);const Z=(x,L)=>{if((m==null?void 0:m[L])!=null)return m[L];if(x.width!=null)return x.width;if((j==null?void 0:j[L])!=null)return j[L]},X=(x,L)=>typeof x.width=="number"?x.width:j==null?void 0:j[L],Ce=te.frozenKey&&!me?ge.findIndex(x=>x.key===te.frozenKey):-1,ke=x=>x<=Ce,Ae=x=>{if(!j)return 0;let L=0;for(let A=0;A<x;A++)L+=j[A]??0;return L},Me=h.useRef(null),[Te,gr]=h.useState("100vh");h.useLayoutEffect(()=>{if(C!==void 0)return;const x=()=>{if(Me.current){const L=Me.current.getBoundingClientRect().top;gr(`calc(100vh - ${L}px)`)}};return x(),window.addEventListener("resize",x),()=>window.removeEventListener("resize",x)},[C]);const Ve=(x,L)=>l?l(x,L):L,qe=(x,L,A)=>x.render?x.render(L,A,De):Jo(L,x.accessor),Ne=ge.length+(z?1:0),Or=(x,L)=>{L||he({...te,hidden:[...te.hidden??[],x]})},Wr=x=>he({...te,frozenKey:te.frozenKey===x?void 0:x}),Ue=x=>(S??[]).filter(L=>{var A;return!((A=L.hidden)!=null&&A.call(L,x))}),Bl={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)"},zr=(x,L,A,K)=>{var He;const ae=(He=x.disabled)==null?void 0:He.call(x,L),be=(K==null?void 0:K.showLabel)??x.showLabel,R=(K==null?void 0:K.size)??"xs",de=e.jsx(H.Button,{size:R,variant:x.variant??"tertiary",tone:x.tone??"neutral",disabled:ae,onClick:()=>x.onClick(L,A),iconLeft:x.icon?e.jsx(F.Icon,{name:x.icon,size:"sm"}):void 0,children:be&&x.label}),Fe=x.tooltip;return Fe?e.jsx(xe.Tooltip,{label:Fe,position:"top-end",children:de}):de},fc=(x,L)=>{const A=Ue(x);if(!A.length)return null;if(A.length>5){const ae=Ve(x,L),be=(W==null?void 0:W.rowKey)===ae;return e.jsx("div",{className:"sa-tl-row-actions",style:Bl,onClick:R=>R.stopPropagation(),children:e.jsx(xe.Tooltip,{label:"Aksi lainnya",position:"top",children:e.jsx(H.Button,{size:"xs",variant:"tertiary",onClick:R=>{const de=R.currentTarget.getBoundingClientRect();D(be?null:{rowKey:ae,top:de.bottom+4,right:window.innerWidth-de.right})},children:e.jsx(F.Icon,{name:"MenuVertical",size:"sm"})})})})}return e.jsx("div",{className:"sa-tl-row-actions",style:Bl,children:A.map(ae=>e.jsx(h.Fragment,{children:zr(ae,x,L)},ae.key))})},gc=(x,L)=>{const A=Ue(x);return A.length?e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",paddingTop:8,marginTop:8,borderTop:tt},children:A.map(K=>e.jsx(h.Fragment,{children:zr(K,x,L,{showLabel:!0,size:"sm"})},K.key))}):null},uc=(x,L)=>{const A=Ue(x);return A.length?e.jsx("div",{style:{display:"flex",gap:4,paddingRight:8,flexShrink:0},children:A.map(K=>e.jsx(h.Fragment,{children:zr(K,x,L,{showLabel:!1})},K.key))}):null},ct=(x,L)=>{const{col:A,key:K}=x,ae=We.get(K)??0,be=ke(ae),R=be&&ae===Ce,de=(P==null?void 0:P.key)===K?P.direction:null,Fe=a&&!A.disableMenu?e.jsx(Cl,{active:!!de||be,canSort:we(A),canHide:!A.locked,sortDir:de,frozen:be,onSort:ht=>pe({key:K,direction:ht}),onClearSort:()=>pe(null),onToggleFreeze:()=>Wr(K),onHide:()=>Or(K,A.locked)}):null,He=A.align==="right",ir=A.align==="right"?"flex-end":A.align==="center"?"center":"flex-start",Ke=e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:6,justifyContent:ir,overflow:"hidden"},children:[A.icon&&e.jsx(F.Icon,{name:A.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:mr,children:A.title})]});return e.jsx(Y.Th,{className:`sa-tl-leaf${be?" sa-tl-frozen":""}`,rowSpan:L==null?void 0:L.rowSpan,minWidth:A.minWidth,resizable:Ee?A.resizable:!1,defaultWidth:X(A,ae),style:{textAlign:lt(A.align),width:Z(A,ae),position:"sticky",top:(L==null?void 0:L.top)??0,left:be?Ae(ae):void 0,zIndex:be?3:2,backgroundColor:hr,boxShadow:R?bl:void 0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:He?e.jsxs(e.Fragment,{children:[Fe,Ke]}):e.jsxs(e.Fragment,{children:[Ke,Fe]})})},`th-${K}`)},it=ge.filter(x=>!x.col.hideOnMobile),st=it.find(x=>x.col.primary)??it[0],yc=it.filter(x=>x!==st),pc=x=>q(L=>{const A=new Set(L);return A.has(x)?A.delete(x):A.add(x),A}),ml=(x,L)=>yc.map(({col:A,key:K})=>{const ae=qe(A,x,L),be=typeof ae=="string"||typeof ae=="number"?e.jsx(k.Text,{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:ae}):e.jsx("div",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:ae});return e.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"space-between",alignItems:"baseline"},children:[typeof A.title=="string"?e.jsx(k.Text,{color:"subtle",fontWeight:"medium",style:{color:Qo,flexShrink:0},children:A.title}):e.jsx("div",{style:{flexShrink:0},children:A.title}),be]},K)}),Fl=(x,L)=>{const A=st?qe(st.col,x,L):null;return typeof A=="string"||typeof A=="number"?e.jsx(k.Text,{as:"span",style:mr,children:A}):e.jsx("span",{style:mr,children:A})},Cc=De.length===0?e.jsx(y.Box,{style:{padding:16,textAlign:"center"},children:E}):v==="expand"?e.jsx(y.Box,{style:{display:"flex",flexDirection:"column"},children:De.map((x,L)=>{const A=Ve(x,L),K=O.has(A);return e.jsxs("div",{style:{borderBottom:tt},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[e.jsxs("button",{type:"button",onClick:()=>pc(A),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:[Fl(x,L),e.jsx(F.Icon,{name:K?"ChevronUp":"ChevronDown",size:"sm",style:{flexShrink:0}})]}),z&&uc(x,L)]}),K&&e.jsx("div",{style:{padding:"0 12px 12px",display:"flex",flexDirection:"column",gap:6},children:ml(x,L)})]},A)})}):e.jsx(y.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:De.map((x,L)=>e.jsxs(y.Box,{style:{border:tt,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:6},children:[Fl(x,L),ml(x,L),z&&gc(x,L)]},Ve(x,L)))}),bc=o&&Ee&&j!==void 0,vc=e.jsxs(Y.Table,{className:"sa-table-layout",fullWidth:!0,size:n,resizable:bc,onWidthsChange:ze?cr:void 0,children:[e.jsx(Y.Thead,{ref:_,children:me?e.jsxs(e.Fragment,{children:[e.jsxs(Y.Tr,{children:[fe.map(x=>x.isGroup?e.jsx(Y.Th,{colSpan:x.leaves.length,style:{textAlign:"center",position:"sticky",top:0,zIndex:2,backgroundColor:hr},children:e.jsx("span",{style:mr,children:x.col.title})},`grp-${x.key}`):ct(x.leaves[0],{rowSpan:2})),z&&e.jsx(Y.Th,{rowSpan:2,style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:hr}})]}),e.jsx(Y.Tr,{children:fe.flatMap(x=>x.isGroup?x.leaves.map(L=>ct(L,{top:Q})):[])})]}):e.jsxs(Y.Tr,{children:[ge.map(x=>ct(x)),z&&e.jsx(Y.Th,{style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:hr}})]})}),e.jsx(Y.Tbody,{children:De.length===0?e.jsx(Y.Tr,{children:e.jsx(Y.Td,{colSpan:Ne,children:E})}):e.jsxs(e.Fragment,{children:[De.map((x,L)=>{const A=b==null?void 0:b(x,L,L>0?De[L-1]:void 0);return e.jsxs(h.Fragment,{children:[A!=null&&A!==!1&&e.jsx(Y.Tr,{children:e.jsx(Y.Td,{colSpan:Ne,style:{backgroundColor:hr},children:A})}),e.jsxs(Y.Tr,{children:[ge.map(({col:K,key:ae},be)=>{var ir;const R=(ir=K.cellProps)==null?void 0:ir.call(K,x,L,De);if(R!=null&&R.hidden)return null;const de=ke(be),Fe=de&&be===Ce,He=qe(K,x,L);return e.jsx(Y.Td,{className:de?"sa-tl-frozen":void 0,colSpan:R==null?void 0:R.colSpan,rowSpan:R==null?void 0:R.rowSpan,style:{textAlign:lt(K.align),width:Z(K,be),minWidth:K.minWidth,position:de?"sticky":void 0,left:de?Ae(be):void 0,zIndex:de?1:void 0,boxShadow:Fe?bl:void 0},children:typeof He=="string"?e.jsx(k.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:lt(K.align)},children:He}):He},`tl-cell-${L}-${ae}`)}),z&&e.jsx(Y.Td,{style:{position:"sticky",right:0,width:1,padding:0,overflow:"visible",zIndex:2,border:"none"},children:fc(x,L)})]})]},Ve(x,L))}),B!=null&&e.jsx(Y.Tr,{children:e.jsx(Y.Td,{colSpan:Ne,children:B})})]})})]}),at=W?De.findIndex((x,L)=>Ve(x,L)===W.rowKey):-1,dt=at>=0?De[at]:null;return e.jsxs(e.Fragment,{children:[e.jsx(y.Box,{ref:Me,fullWidth:!0,style:{overflow:"auto",height:C??Te},children:w?Cc:vc}),W&&dt&&e.jsx("div",{className:"sa-tl-kebab-menu",style:{top:W.top,right:W.right},onClick:x=>x.stopPropagation(),children:Ue(dt).map(x=>e.jsx("div",{style:{padding:"2px 4px"},children:zr(x,dt,at,{showLabel:!0,size:"sm"})},x.key))})]})},ot=r=>r==="asc"||r==="desc",Ko=(r={})=>{const{sortKeyParam:t="sortBy",sortOrderParam:l="sortOrder",pageKey:n="page",defaultSort:o=null,paramKeys:c,scopeId:s,storage:i=Yr}=r,{searchParams:a,setSearchParams:d,searchQueries:u}=Be(),p=a.toString(),C=s?nr.tableSort(s):void 0,v=h.useRef(!1);h.useEffect(()=>{if(v.current||(v.current=!0,!C)||a.has(t)||a.has(l))return;const V=i.get(C);!(V!=null&&V.key)||!ot(V.direction)||d({...Object.fromEntries(a.entries()),[t]:V.key,[l]:V.direction})},[]);const T=h.useMemo(()=>{const V=a.get(t),w=a.get(l);return V&&ot(w)?{key:V,direction:w}:o},[p,t,l,o]);h.useEffect(()=>{if(!C)return;const V=a.get(t),w=a.get(l);V&&ot(w)?i.set(C,{key:V,direction:w}):i.remove(C)},[p,C,t,l,i]);const b=(c==null?void 0:c.sortBy)??"sortBy",B=(c==null?void 0:c.sortOrder)??"sortOrder",E=h.useMemo(()=>T?{[b]:T.key,[B]:T.direction}:{},[T,b,B]),S=h.useCallback(V=>{const w={...u};V?(w[t]=V.key,w[l]=V.direction):(delete w[t],delete w[l]),delete w[n],d(w)},[u,t,l,n,d]);return{sort:T,setSort:S,params:E}},Fr=({of:r,render:t})=>h.Children.toArray(r==null?void 0:r.map((l,n,o)=>t(l,n,o))),oe=({condition:r,fallback:t,children:l,loading:n,isLoading:o})=>e.jsx(e.Fragment,{children:o?n:r?l:t}),ce=r=>e.jsx(k.Text,{...r,fontFamily:"Poppins",fontSize:r.fontSize||"md",fontWeight:r.fontWeight||"medium",color:r.color||"gray-700",children:r.children}),_e=r=>e.jsx(k.Text,{color:"red-600",fontSize:"sm",children:r.message}),$o=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,...o})=>{var i,a,d;const c=o.hideMessageError||!1,s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(y.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(oe,{condition:!!o.inputProps.required,fallback:e.jsxs(y.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ce,{children:o.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})]}),children:e.jsxs(y.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:r,children:o.title}),e.jsx(ce,{color:"error",fontSize:r,children:l}),e.jsx(oe,{condition:!!((i=o.tooltip)!=null&&i.label),children:e.jsx(xe.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!o.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})})]})}),e.jsxs(y.Box,{direction:"column",gap:"xs",fullWidth:o.inputProps.fullWidth||!1,children:[e.jsx(Ge.Input,{ref:o.inputRef,size:r,...o.inputProps,status:o.errorMessage?"error":"default",fullWidth:!0}),!c&&o.errorMessage&&e.jsx(_e,{message:o.errorMessage}),o.inputProps.extended&&o.inputProps.extended]})]})},Ro=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,...o})=>{var i,a,d;const c=o.hideMessageError||!1,s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(y.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",onClick:o.onClickContainer,children:[o.title&&e.jsx(oe,{condition:!!o.inputProps.required,fallback:e.jsxs(y.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ce,{children:o.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})]}),children:e.jsxs(y.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:r,children:o.title}),e.jsx(ce,{color:"error",fontSize:r,children:l}),e.jsx(oe,{condition:!!((i=o.tooltip)!=null&&i.label),children:e.jsx(xe.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!o.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})})]})}),e.jsxs(y.Box,{direction:"column",gap:"xs",fullWidth:o.inputProps.fullWidth||!1,children:[e.jsx(y.Box,{direction:"column",style:{width:o.inputProps.fullWidth?"100%":t==="horizontal"&&o.customWidth?o.customWidth:t==="horizontal"?"343px":""},children:e.jsx(er.Dropdown,{size:r,...o.inputProps,error:!!o.errorMessage})}),!c&&o.errorMessage&&e.jsx(_e,{message:o.errorMessage}),o.inputProps.extended&&o.inputProps.extended]})]})},en=(r,t)=>typeof r=="string"&&r||t==="error"?"var(--sa-border-danger)":"var(--sa-border-subtle)",rn=r=>{var i;const[t,l]=h.useState(!1),n=a=>{a.preventDefault(),a.stopPropagation()},o=a=>{a.preventDefault(),a.stopPropagation(),a.dataTransfer&&r.handleOnFileChange(a.dataTransfer.files.item(0))},c=a=>{a.preventDefault(),l(!0)},s=a=>{a.preventDefault(),l(!1)};return e.jsxs(y.Box,{width:"width-full",paddingInline:"md",direction:"row",gap:"sm",align:"center",onClick:r.handleOnClick,onDragOver:n,onDrop:o,onDragEnter:c,onDragLeave:s,paddingBlock:"md",borderRadius:"rounded-md",style:{border:t?"1px solid var(--sa-border-info)":`1px solid ${en(r.errorMessage,r.status)}`},children:[e.jsx(F.Icon,{name:"Upload",size:"lg",style:{width:30,height:30}}),e.jsxs(ne.Flex,{direction:"column",gap:"xs",children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",children:[e.jsx(k.Text,{fontWeight:"medium",color:"gray-500",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"Click your upload"}),e.jsx(k.Text,{fontWeight:"medium",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"or Drag & Drop"})]}),e.jsx(k.Text,{fontSize:"sm",color:"gray-500",children:(i=r.fileSupports)==null?void 0:i.map(a=>a.toLocaleUpperCase()).join(", ")})]})]})};function tn(r){return r.split(" ").map(t=>t[0]).join("").slice(0,2).toUpperCase()}const xl=r=>{const t={day:"2-digit",month:"short",year:"numeric"};return r.toLocaleDateString("id-ID",t)},ln=r=>{const t={Jan:0,Feb:1,Mar:2,Apr:3,Mei:4,Jun:5,Jul:6,Agu:7,Sep:8,Okt:9,Nov:10,Des:11},l=r.split(" ");if(l.length!==3)return null;const n=parseInt(l[0],10),o=t[l[1]],c=parseInt(l[2],10);return isNaN(n)||isNaN(o)||isNaN(c)?null:new Date(c,o,n)};function on(r,t=!0){if(!r)return"Rp 0";const l=typeof r=="number"?r.toString():r;if(isNaN(Number(l)))return"Rp 0";const n=l.split("."),o=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,"."),c=n.length===2?o+"."+n[1]:o;return t?"Rp"+c:c}String.prototype.toTitleCase=function(){return this.toLowerCase().split(" ").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")},String.prototype.toNumber=function(){return Number(this)};const nn=r=>{const t=r.split(" ");let l=t[0].charAt(0);return t.length>1&&(l+=""+t[1].charAt(0)),l.toUpperCase()};function cn(r){const t=typeof r=="string"?new Date(r):r;if(isNaN(t.getTime()))throw new Error("Invalid date format");const l=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0");return`${l}-${n}-${o}`}const sn="sa-admin",Oe=r=>`var(--${sn}-${r})`,an={base:{borderColor:Oe("base-border-color"),textColor:Oe("base-text-color"),iconColor:Oe("base-icon-color"),placeholderColor:Oe("base-placeholder-color")},document:{bgColor:Oe("document-bg-color")},sidebar:{bgColor:Oe("sidebar-bg-color"),borderColor:Oe("sidebar-border-color"),maxWidth:Oe("sidebar-max-width"),width:Oe("sidebar-width"),collapseWidth:Oe("sidebar-collapse-width"),collapseV2Width:Oe("sidebar-v2-collapse-width")}},dn=24*60*60*1e3,hn=r=>{const t="14px poppins",n=document.createElement("canvas").getContext("2d");n.font=t;const o=n.measureText(r).width;return Number(Math.ceil(o))},fn=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,gn=/--+/,un=/-$/;function yn(r,t){return JSON.stringify(r)!==JSON.stringify(t)}function pn(r){return/^(?:\+62|62|0)8[1-9][0-9]{7,10}$/.test(r)}function Cn(r){return/^[A-Za-z\s]+$/.test(r)}const bn=r=>{const t=/^[0-9]$/,l=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&(r.key==="a"||r.key==="c"||r.key==="v")||!t.test(r.key)&&!l.includes(r.key)&&r.preventDefault()},vn=r=>{const t=/^[0-9]$/,l=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&r.key==="v"||t.test(r.key)&&!l.includes(r.key)&&r.preventDefault()},xn=r=>{const t=/^[0-9.]$/,l=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&r.key==="v"||!t.test(r.key)&&!l.includes(r.key)&&r.preventDefault()},wn=r=>fn.test(r);function Dn(r){return!(gn.test(r)||un.test(r))}const Sn=r=>{const t=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab","Home","End"];if((r.ctrlKey||r.metaKey)&&["a","c","v","x"].includes(r.key.toLowerCase()))return;const l=r.currentTarget.value;/^[0-9]$/.test(r.key)||r.key==="."&&!l.includes(".")||r.key==="-"&&l.length===0&&!l.includes("-")||t.includes(r.key)||r.preventDefault()},kn=r=>{const t=document.getElementById(r);if(t){const l=t.getBoundingClientRect(),n=window.scrollY+l.top-80;window.scrollTo({top:n,behavior:"smooth"})}};function Bn(r){const t=r.toLowerCase();if(["kb","mb","gb"].find(c=>t.endsWith(c)))return r;const o=Number(r);if(isNaN(o))throw new Error("Invalid size format");return o>=1e6?`${(o/1e6).toFixed(2)}MB`:o>=1e3?`${(o/1e3).toFixed(2)}KB`:`${o}B`}function mn(r){const t=r.split("/");return t[t.length-1]}const Fn=r=>{var t,l;return e.jsxs(y.Box,{width:"width-full",paddingInline:"md",height:"height-full",direction:"row",justify:"space-between",align:"center",onClick:r.handleOnClickFile,fullHeight:!0,paddingBlock:"md",id:"file-item",borderRadius:"rounded-md",style:{border:"1px solid var(--sa-border-subtle)",cursor:"pointer"},children:[e.jsxs(ne.Flex,{direction:"row",align:"center",gap:"sm",style:{flex:1,minWidth:0},children:[e.jsx(F.Icon,{name:"DocumentFilled",size:"lg",style:{color:"var(--sa-icon-brand)",width:30,height:30,flexShrink:0}}),e.jsxs(ne.Flex,{direction:"column",style:{minWidth:0,flex:1},children:[e.jsx(k.Text,{fontWeight:"bold",style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:r.defaultFile?mn(r.defaultFile.url):(t=r.fileSelected)==null?void 0:t.name}),r.defaultFile?(r.defaultFile.size||r.defaultFile.date)&&e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[r.defaultFile.size&&e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",children:r.defaultFile.size}),r.defaultFile.size&&r.defaultFile.date&&e.jsx(F.Icon,{name:"Dot",size:"xs"}),r.defaultFile.date&&e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:r.defaultFile.date})]}):e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",children:Bn(((l=r.fileSelected)==null?void 0:l.size.toString())||"100000")}),e.jsx(F.Icon,{name:"Dot",size:"xs"}),e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:xl(new Date)})]})]})]}),e.jsx(H.Button,{size:"xs",variant:"tertiary",tone:"error",type:"button",onClick:n=>{n.stopPropagation(),r.handleOnDeleteFile()},iconLeft:e.jsx(F.Icon,{name:"Trash1"})})]})},wl=({status:r="default",labelPosition:t="outside-top",...l})=>{var C;const n=h.useRef(null),o=()=>{if(l.defaultFile){window.open(l.defaultFile.url);return}n.current&&n.current.click()},c=ue.useMediaQuery("md"),s=r==="error"||typeof l.errorMessage=="string"&&!!l.errorMessage,i=l.label?e.jsxs(ne.Flex,{direction:"row",align:"center",gap:"xs",children:[e.jsx(k.Text,{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-primary)"},children:l.label}),l.optional&&e.jsx("span",{style:{background:"var(--sa-background-neutral)",border:"1px solid var(--sa-border-subtle)",borderRadius:"4px",padding:"0 8px",fontSize:"10px",fontWeight:500,lineHeight:"18px",color:"var(--sa-text-primary)",display:"inline-flex",alignItems:"center"},children:"Optional"}),l.required&&e.jsx("span",{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-error)"},children:"*"})]}):null,a=l.description?e.jsx(k.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:l.description}):null,d=e.jsxs(e.Fragment,{children:[l.helperText&&e.jsx(k.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:l.helperText}),l.errorText&&r==="error"&&e.jsx(k.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:l.errorText}),l.errorMessage&&!l.errorText&&e.jsx(k.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:l.errorMessage})]}),u=e.jsx("input",{type:"file",style:{display:"none"},ref:n,onChange:v=>{var T;return l.handleOnChangeFile(((T=v.target.files)==null?void 0:T.item(0))||null)},accept:(C=l.fileSupportOption)==null?void 0:C.map(v=>"."+(v==null?void 0:v.toLowerCase())).join(", ")}),p=e.jsxs(y.Box,{direction:"column",fullWidth:!0,style:{minHeight:"69px"},borderRadius:"rounded-md",display:"flex",justify:"center",align:"center",cursor:"pointer",gap:"md",...l.containerProps,children:[u,(l.fileSelected||l.defaultFile)&&e.jsx(Fn,{fileSelected:l.fileSelected,defaultFile:l.defaultFile,handleOnDeleteFile:l.handleOnDeleteFile,handleOnClickFile:o}),!l.fileSelected&&!l.defaultFile&&e.jsx(rn,{fileSupports:l.fileSupportOption,isDesktop:c,errorMessage:s?l.errorText||l.errorMessage||" ":void 0,status:s?"error":"default",handleOnClick:o,handleOnFileChange:l.handleOnChangeFile})]});return t==="outside-left"?e.jsxs(ne.Flex,{direction:"row",align:"flex-start",gap:"sm",style:{width:"100%"},children:[e.jsxs(ne.Flex,{direction:"column",gap:"xs",style:{width:"40%",minWidth:"120px",paddingTop:"10px"},children:[i,a]}),e.jsxs(ne.Flex,{direction:"column",gap:"sm",style:{flex:1,minWidth:0},children:[p,d]})]}):e.jsxs(ne.Flex,{direction:"column",gap:"sm",style:{width:"100%"},children:[i,a,p,d]})},En=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,...o})=>{var i,a,d;const c=o.hideMessageError||!1,s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(y.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(oe,{condition:!!o.inputProps.required,fallback:e.jsxs(y.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ce,{children:o.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})]}),children:e.jsxs(y.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:r,children:o.title}),e.jsx(ce,{color:"error",fontSize:r,children:l}),e.jsx(oe,{condition:!!((i=o.tooltip)!=null&&i.label),children:e.jsx(xe.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!o.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})})]})}),e.jsxs(ne.Flex,{direction:"column",gap:"xs",children:[e.jsx(wl,{...o.inputProps,status:o.errorMessage?"error":"default"}),!c&&o.errorMessage&&e.jsx(_e,{message:o.errorMessage})]})]})},Mn=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,required:o=!1,...c})=>{var a,d,u,p;const s=c.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(y.Box,{gap:t==="horizontal"||t==="horizontal-inline"?"spacing-96":"sm",direction:t==="horizontal"||t==="horizontal-inline"?"row":"column",...c.containerProps,children:[c.title&&e.jsx(oe,{condition:!!o,fallback:e.jsxs(y.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(ce,{children:c.title}),e.jsx(Ie.Body3,{props:{color:"gray-500"},children:c.description})]}),children:e.jsxs(y.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:r,children:c.title}),e.jsx(ce,{color:"error",fontSize:r,children:l}),e.jsx(oe,{condition:!!((a=c.tooltip)!=null&&a.label),children:e.jsx(xe.Tooltip,{label:(d=c.tooltip)==null?void 0:d.label,arrowPosition:(u=c.tooltip)==null?void 0:u.arrowPosition,...c.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!c.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:c.description})})]})}),e.jsx(y.Box,{gap:t==="horizontal-inline"?"xl":"md",direction:t==="horizontal-inline"?"row":"column",align:"flex-start",children:e.jsx(Fr,{of:(p=c.checkBoxesList)==null?void 0:p.map(C=>({...C,isChecked:c.checkBoxesAreChecked.includes(C.id)})),render:C=>C.renderBadge?e.jsxs(y.Box,{direction:"row",justify:"space-between",gap:"lg",...c.badgeContainerProps,children:[e.jsx(or.Checkbox,{name:C.name,value:C.id,checked:C.isChecked,onChange:v=>c.onChecked(v.target.value,C),label:C.name,description:C.description}),C.renderBadge]}):e.jsx(or.Checkbox,{name:C.name,value:C.id,checked:C.isChecked,onChange:v=>c.onChecked(v.target.value,C),label:C.name,description:C.description})})}),!s&&c.errorMessage&&e.jsx(_e,{message:c.errorMessage})]})},Ln=({position:r="vertical",size:t="md",fullWidth:l=!1,...n})=>{var c;const o=r==="horizontal-inline"||r==="horizontal-block"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(y.Box,{gap:r==="horizontal-inline"||r==="horizontal-block"?"spacing-96":"sm",direction:r==="horizontal-inline"||r==="horizontal-block"?"row":"column",children:[e.jsx(oe,{condition:!!n.description||!!n.title,children:e.jsxs(y.Box,{direction:"column",customMaxWidth:o,fullWidth:l,children:[n.title&&e.jsx(ce,{children:n.title}),e.jsx(oe,{condition:!!n.description,children:e.jsx(k.Text,{color:"gray-500",children:n.description})})]})}),e.jsx(y.Box,{gap:"sm",direction:r==="horizontal"||r==="horizontal-inline"?"row":"column",align:"flex-start",flexWrap:"wrap",children:e.jsx(Fr,{of:(c=n.radioList)==null?void 0:c.map(s=>({...s,isChecked:n.radioIsChecked===s.id})),render:({value:s,id:i,isChecked:a,subInput:d,label:u,description:p})=>e.jsxs(y.Box,{direction:"column",gap:"xs",customMaxWidth:o,children:[e.jsx(Vr.Radio,{id:`${i.toString()}-${s}`,name:n.groupName||u,label:u,value:s,checked:a,onChange:C=>n.onChecked({id:i,label:C.target.name,value:C.target.value}),disabled:n.disableAll},i),p&&e.jsx(k.Text,{color:"gray-500",style:{marginLeft:28},children:p}),d]})})}),n.errorMessage&&e.jsx(_e,{message:n.errorMessage})]})},In=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,...o})=>{var i,a,d;const c=o.hideMessageError||!1,s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(y.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(oe,{condition:!!o.inputProps.required,fallback:e.jsxs(y.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ce,{children:o.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})]}),children:e.jsxs(y.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:r,children:o.title}),e.jsx(ce,{color:"error",fontSize:r,children:l}),e.jsx(oe,{condition:!!((i=o.tooltip)!=null&&i.label),children:e.jsx(xe.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!o.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})})]})}),e.jsxs(ne.Flex,{direction:"column",gap:"xs",children:[e.jsx(Ar.Textarea,{ref:o.inputRef,size:r,...o.inputProps,status:o.errorMessage?"error":"default"}),!c&&o.errorMessage&&e.jsx(_e,{message:o.errorMessage})]})]})},Tn=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",required:n=!1,fullWidth:o=!1,...c})=>{var i,a,d;const s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(y.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...c.containerProps,children:[c.title&&e.jsx(oe,{condition:n,fallback:e.jsxs(y.Box,{direction:"column",customMaxWidth:s,fullWidth:o,children:[e.jsx(ce,{children:c.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:c.titleDescription})]}),children:e.jsxs(y.Box,{direction:"column",customMaxWidth:s,fullWidth:o,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:r,children:c.title}),e.jsx(ce,{color:"error",fontSize:r,children:l}),e.jsx(oe,{condition:!!((i=c.tooltip)!=null&&i.label),children:e.jsx(xe.Tooltip,{label:(a=c.tooltip)==null?void 0:a.label,arrowPosition:(d=c.tooltip)==null?void 0:d.arrowPosition,...c.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!c.titleDescription,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:c.titleDescription})})]})}),e.jsx(lr.Toggle,{checked:c.checked,onChange:c.onChange,label:c.label,description:c.description}),c.errorMessage&&e.jsx(_e,{message:c.errorMessage})]})},On=({variant:r="primary",size:t="md",...l})=>{const n=tr.useColor(),o=s=>{var a,d,u,p,C,v;if(!s)return;const i=l.disabled?"var(--sa-text-disable, #181a198f)":r==="secondary"?"var(--sa-text-subtle, #8c8f97)":r==="secondary-danger"?(d=(a=n==null?void 0:n.computed)==null?void 0:a.red)==null?void 0:d[600]:r==="secondary-primary"?(p=(u=n==null?void 0:n.computed)==null?void 0:u.blue)==null?void 0:p[700]:(v=(C=n==null?void 0:n.computed)==null?void 0:C.gray)==null?void 0:v[50];return e.jsx(F.Icon,{name:s,size:t,style:{color:i}})},c=()=>{var i,a,d,u;if(r!=="secondary-danger"&&r!=="secondary-primary")return l.title;const s={color:l.disabled?"var(--sa-text-disable, #181a198f)":r==="secondary-danger"?(a=(i=n==null?void 0:n.computed)==null?void 0:i.red)==null?void 0:a[600]:(u=(d=n==null?void 0:n.computed)==null?void 0:d.blue)==null?void 0:u[700]};switch(t){case"xs":return e.jsx(Ie.Body2,{props:{style:s},children:l.title});case"sm":case"md":return e.jsx(Ie.SubH3,{props:{style:s},children:l.title});case"lg":return e.jsx(Ie.SubH2,{props:{style:s},children:l.title});default:return l.title}};return e.jsx(H.Button,{fullWidth:!0,disabled:l.disabled,primary:r==="primary",secondary:r==="secondary"||r==="secondary-danger"||r==="secondary-primary",success:r==="success",onClick:l.onClick,type:l.type,iconLeft:o(l.iconLeft),iconRight:o(l.iconRight),size:t,children:c()})},Wn=r=>e.jsx(Ie.H5,{props:{...r},children:r.title}),zn=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,...o})=>{var i,a,d;const c=o.hideMessageError||!1,s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(y.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",onClick:o.onClickContainer,children:[o.title&&e.jsx(oe,{condition:!!o.inputProps.required,fallback:e.jsxs(y.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ce,{children:o.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})]}),children:e.jsxs(y.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:r,children:o.title}),e.jsx(ce,{color:"error",fontSize:r,children:l}),e.jsx(oe,{condition:!!((i=o.tooltip)!=null&&i.label),children:e.jsx(xe.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!o.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})})]})}),e.jsxs(ne.Flex,{direction:"column",gap:"xs",children:[e.jsx(y.Box,{direction:"column",style:{width:t==="horizontal"&&o.customWidth?o.customWidth:t==="horizontal"?"343px":""},children:e.jsx(Je.StarasiaDate,{size:r,...o.inputProps,status:o.errorMessage?"error":void 0})}),!c&&o.errorMessage&&e.jsx(_e,{message:o.errorMessage})]})]})};async function An(r,t){const l=new Image;l.src=r,await new Promise((c,s)=>{l.onload=c,l.onerror=s});const n=document.createElement("canvas");n.width=t.width,n.height=t.height;const o=n.getContext("2d",{alpha:!0});if(!o)throw new Error("No 2D context");return o.drawImage(l,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise((c,s)=>{n.toBlob(i=>{if(!i)return s("Canvas is empty");const a=new File([i],"cropped.png",{type:"image/png"});c(a)},"image/png")})}const Dl={"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},Sl=h.forwardRef(({handleUpload:r,urlImage:t,isUploading:l,croppedImage:n,setCroppedImage:o,size:c="96",aspect:s="1:1",containerProps:i,maxFileSize:a=2,onError:d},u)=>{const p=ue.useMediaQuery("md"),[C,v]=h.useState(!1),[T,b]=h.useState(null),[B,E]=h.useState(!1),[S,V]=h.useState({x:0,y:0}),[w,z]=h.useState(1),[W,D]=h.useState(null);h.useEffect(()=>{t===null&&o(null)},[t]);const O=h.useCallback((ee,P)=>{D(P)},[]),q=ee=>{var pe;const P=(pe=ee.target.files)==null?void 0:pe[0];if(!P)return;const le=new FileReader;le.onload=()=>{b(le.result),E(!0)},le.readAsDataURL(P)},U=async()=>{if(!(!T||!W))try{const ee=await An(T,W);if(a&&ee.size>a*1024*1024){d==null||d(`Ukuran file maksimal ${a}MB`);return}r==null||r(ee);const P=URL.createObjectURL(ee);o(P,ee),E(!1)}catch{d==null||d("Gagal memproses gambar")}},G=h.useRef(null),$=()=>{G.current&&G.current.click()};h.useImperativeHandle(u,()=>({openFileDialog:()=>{var ee;(ee=G.current)==null||ee.click()}}));const te=parseInt(c,10),he=Dl[s];let ie,se;return he>=1?(se=te,ie=te*he):(ie=te,se=te/he),e.jsxs(y.Box,{direction:"column",display:"flex",position:"relative",bg:(i==null?void 0:i.bg)||"gray-200",borderStyle:(i==null?void 0:i.borderStyle)||"border-none",borderColor:(i==null?void 0:i.borderColor)||"gray-200",borderWidth:(i==null?void 0:i.borderWidth)||"border-2",borderRadius:(i==null?void 0:i.borderRadius)||"rounded-md",overflow:"overflow-hidden",align:"center",justify:"center",style:{width:i!=null&&i.fullWidth?"100%":`${ie}px`,height:i!=null&&i.fullWidth?"auto":`${se}px`,aspectRatio:he,flexShrink:0},onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),children:[n||t?e.jsx("img",{src:n||t||void 0,alt:"Profile",style:{objectFit:"cover",width:"100%",height:"100%"}}):e.jsx(y.Box,{display:"flex",direction:"column",align:"center",justify:"center",padding:"spacing-4",children:e.jsx(F.Icon,{name:"Image",style:{color:"var(--sa-text-subtle, #8c8f97)",width:Number(c)/2<40?Number(c)/2:40,height:Number(c)/2<40?Number(c)/2:40}})}),e.jsxs(y.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:C?1:0,transition:"opacity 0.3s ease-in-out"},onClick:$,children:[e.jsx("input",{ref:G,type:"file",accept:"image/*",onChange:q,disabled:l,style:{display:"none"}}),e.jsxs(y.Box,{display:"flex",align:"center",gap:"spacing-2",direction:"row",children:[e.jsx(F.Icon,{name:"Edit3",style:{color:"var(--sa-background-primary, #ffffff)"}}),e.jsx(oe,{condition:c.toNumber()>80,children:e.jsx(k.Text,{color:"gray-50",fontSize:c.toNumber()>80?"sm":"md",fontWeight:"medium",children:"Edit Image"})})]})]}),l&&e.jsx(y.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(y.Box,{direction:"column",borderRadius:"rounded-full",style:{animation:"spin 1s linear infinite",border:"2px solid transparent",height:"2rem",width:"2rem"},borderColor:"info-600"})}),B&&Hr.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:p?s==="1:1"?"min(90vw, 480px)":`min(90vw, ${ie*2}px)`:"calc(100vw - 2rem)",display:"flex",flexDirection:"column"},onClick:ee=>ee.stopPropagation(),children:[e.jsx("div",{style:{position:"relative",width:"100%",height:"20rem",backgroundColor:"var(--sa-color-gray-100)"},children:T&&e.jsx(El,{image:T,crop:S,zoom:w,aspect:s?Dl[s]:void 0,onCropChange:V,onZoomChange:z,onCropComplete:O,objectFit:"contain",minZoom:.5,restrictPosition:!1})}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"0.5rem",padding:"0.75rem 1rem",borderTop:"1px solid var(--sa-border-subtle)"},children:[e.jsx(H.Button,{size:"sm",secondary:!0,onClick:()=>E(!1),children:"Cancel"}),e.jsx(H.Button,{size:"sm",primary:!0,onClick:U,children:"Crop"})]})]})}),document.body)]})}),Vn=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,required:o=!1,...c})=>{var a,d,u;const s=c.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(y.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...c.containerProps,children:[c.title&&e.jsx(oe,{condition:!!o,fallback:e.jsxs(y.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(ce,{children:c.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:c.description})]}),children:e.jsxs(y.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:r,children:c.title}),e.jsx(ce,{color:"error",fontSize:r,children:l}),e.jsx(oe,{condition:!!((a=c.tooltip)!=null&&a.label),children:e.jsx(xe.Tooltip,{label:(d=c.tooltip)==null?void 0:d.label,arrowPosition:(u=c.tooltip)==null?void 0:u.arrowPosition,...c.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!c.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:c.description})})]})}),e.jsxs(ne.Flex,{direction:"column",gap:"xs",children:[e.jsx(Sl,{...c.inputProps}),!s&&c.errorMessage&&e.jsx(_e,{message:c.errorMessage})]})]})},Hn=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,...o})=>{var s,i,a;const c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(y.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(oe,{condition:!!o.inputProps.required,fallback:e.jsxs(y.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsx(ce,{children:o.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})]}),children:e.jsxs(y.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:r,children:o.title}),e.jsx(ce,{color:"error",fontSize:r,children:l}),e.jsx(oe,{condition:!!((s=o.tooltip)!=null&&s.label),children:e.jsx(xe.Tooltip,{label:(i=o.tooltip)==null?void 0:i.label,arrowPosition:(a=o.tooltip)==null?void 0:a.arrowPosition,...o.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!o.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})})]})}),o.inputProps.extended&&o.inputProps.extended]})},Pn=({items:r,id:t,handleOnUpdate:l,width:n,toggleShow:o=!0,disabled:c=!1})=>{var u;const[s,i]=h.useState([]);h.useEffect(()=>{r&&i([...r.map(p=>({id:p.id,isActive:p.isActive}))])},[r]);const a=(u=s.find(p=>p.id===t))==null?void 0:u.isActive,d=h.useCallback(()=>{i(p=>p.map(C=>C.id===t?{...C,isActive:!C.isActive}:C)),l&&l(!a)},[t,l,a]);return e.jsx(y.Box,{direction:"row",gap:"md",style:{width:n},children:o&&e.jsx(lr.Toggle,{disabled:c,checked:a,onChange:d,label:a?"Active":"Inactive"})})},jn={InputText:$o,InputDropdown:Ro,InputSingleFile:En,CheckBoxOptions:Mn,RadioOptions:Ln,InputTextArea:In,ToggleForm:Tn,ActionButton:On,FormTitle:Wn,InputDate:zn,InputImgFile:Vn,Custom:Hn},kl=({customBottom:r})=>{const[t,l]=h.useState(!1),n=()=>{window.scrollY>window.screenY?l(!0):l(!1)},o=()=>{window.scrollTo({top:0,behavior:"smooth"})};return h.useEffect(()=>(window.addEventListener("scroll",n),()=>{window.removeEventListener("scroll",n)}),[]),e.jsx(y.Box,{direction:"column",style:{position:"fixed",bottom:0,right:0},children:e.jsx(y.Box,{direction:"column",position:"absolute",style:{bottom:r||"1.6rem",right:"2rem",transform:t?"scale(1)":"scale(0)",transition:"transform 0.2s ease-in-out"},children:e.jsx(H.Button,{secondary:!0,size:"xs",onClick:o,type:"button",iconLeft:e.jsx(F.Icon,{width:16,size:"xs",name:"ArrowPullUp",style:{color:"var(--sa-background-brand, #04254f)"}})})})})},Nn=({pageLayout:r,children:t,wrapperProps:l,containerProps:n})=>{const o=ue.useMediaQuery("md"),c=(n==null?void 0:n.customWidth)??264;return e.jsxs(y.Box,{display:"block",direction:"row",...l,style:{marginRight:o?c:24,...(l==null?void 0:l.style)??{}},children:[r,e.jsx(y.Box,{direction:"column",show:"desktop",as:"aside",position:"fixed",top:"top-0",bottom:"bottom-0",right:"right-0",customWidth:264,borderStyle:"border-solid-l",borderWidth:"border-l",...n,style:{marginTop:"4rem",backgroundColor:"var(--sa-background-white, #ffffff)",borderColor:"var(--sa-border-subtle, #0b120e24)",...(n==null?void 0:n.style)??{}},children:t})]})},_n=({children:r,withScrollToTopButton:t=!1,scrollToTopButtonProps:l,containerProps:n})=>e.jsx(y.Box,{direction:"column",position:"absolute",width:"width-full",style:{zIndex:"var(--app-footer-zindex, 999)"},children:e.jsxs(y.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:(n==null?void 0:n.justify)||"flex-end",borderStyle:"border-solid-t",borderWidth:"border-t",children:[t&&e.jsx(kl,{...l,customBottom:(l==null?void 0:l.customBottom)||"5.7rem"}),r]})}),qn=({fields:r})=>e.jsx(y.Box,{display:"flex",direction:"column",gap:"lg",children:e.jsx(Fr,{of:r,render:(t,l)=>e.jsx(Zn,{...t},l)})}),Zn=({title:r,value:t,icon:l})=>e.jsxs(y.Box,{display:"flex",direction:"column",gap:"sm",children:[l?e.jsxs(y.Box,{display:"flex",direction:"row",align:"center",gap:"xs",children:[e.jsx(F.Icon,{name:l,color:"subtle"}),e.jsx(k.Text,{color:"gray-500",variant:"sub-h3",children:r})]}):e.jsx(k.Text,{color:"gray-500",variant:"sub-h3",children:r}),typeof t=="string"?e.jsx(k.Text,{variant:"sub-h3",children:t}):t]}),ve={silhouette:"#A7B0AC",accent:"#78867F"};function Gn({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r||"100",height:t||"90",viewBox:"0 0 102 90",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M51.0002 16.8145C36.0811 16.8145 24.8296 21.3801 24.8296 27.4328V76.5344C24.8296 82.573 36.0799 87.127 51.0002 87.127C65.9204 87.127 77.1707 82.573 77.1707 76.5344V27.4328C77.1707 21.3801 65.9204 16.8145 51.0002 16.8145ZM51.0002 19.1582C65.0602 19.1582 74.8582 23.5187 74.8582 27.4328C74.8582 30.1363 70.1615 32.9664 63.1708 34.4746C55.861 36.0543 46.1416 36.0543 38.8318 34.4746C31.8399 32.9664 27.1432 30.1363 27.1432 27.4328C27.1432 23.5187 36.9402 19.1582 51.0002 19.1582ZM74.8582 31.9199V43.784C74.8582 46.532 70.3142 49.2941 63.2737 50.8328C63.2391 50.8375 63.2032 50.8434 63.1697 50.8504C57.6867 52.0352 50.8498 52.3305 44.6893 51.7387C42.6358 51.5418 40.6575 51.2453 38.8306 50.8504C38.8029 50.8445 38.7682 50.8387 38.7347 50.8352C32.5707 49.4898 28.318 47.2047 27.3514 44.8141C27.2138 44.4719 27.1421 44.1285 27.1421 43.7852V31.9199C27.1999 31.9715 27.2693 32.0207 27.3294 32.0723C27.5052 32.2246 27.6902 32.3758 27.8844 32.5234C27.9954 32.609 28.1064 32.6934 28.2232 32.7766C28.4371 32.9301 28.6637 33.0801 28.8973 33.2289C29.0083 33.2992 29.1135 33.3719 29.2291 33.441C29.5702 33.6473 29.9275 33.8488 30.3044 34.0434C30.3195 34.0516 30.3333 34.0598 30.3484 34.068C30.7427 34.2707 31.1601 34.4652 31.5925 34.6551C31.7301 34.716 31.8758 34.7734 32.0168 34.832C32.3221 34.9598 32.6331 35.0852 32.9557 35.207C33.1303 35.2727 33.3095 35.3359 33.4887 35.4004C33.8032 35.5117 34.1247 35.6207 34.4542 35.7273C34.6404 35.7871 34.8254 35.8469 35.015 35.9043C35.3734 36.0133 35.7434 36.1164 36.1181 36.2184C36.2915 36.2652 36.4603 36.3145 36.6361 36.3602C37.1911 36.5031 37.7588 36.6402 38.3485 36.7668C42.1595 37.5906 46.5336 38.0254 50.999 38.0254C55.4644 38.0254 59.8397 37.5906 63.6495 36.768C64.2404 36.6402 64.8092 36.5031 65.3666 36.3602C65.5377 36.3156 65.7007 36.2688 65.8684 36.223C66.2499 36.1199 66.6246 36.0145 66.9888 35.9031C67.1749 35.8469 67.3553 35.7883 67.5368 35.7309C67.8745 35.623 68.2028 35.5105 68.5243 35.3969C68.6966 35.3359 68.8677 35.275 69.0353 35.2117C69.3672 35.0863 69.6852 34.9574 69.9985 34.8262C70.1326 34.7699 70.2725 34.7148 70.4032 34.6574C70.8379 34.4664 71.2576 34.2707 71.6542 34.0668C71.66 34.0633 71.6658 34.0609 71.6716 34.0574C72.0589 33.8582 72.4243 33.6508 72.7735 33.441C72.8868 33.3719 72.9909 33.3016 73.1007 33.2313C73.3354 33.0813 73.5632 32.9312 73.7794 32.7766C73.8951 32.6934 74.0049 32.609 74.1159 32.5258C74.3102 32.377 74.4963 32.2258 74.6732 32.0723C74.7322 32.0207 74.8027 31.9727 74.8594 31.9211L74.8582 31.9199ZM74.8582 48.2887V60.1598C74.8582 62.8773 70.3396 65.6359 63.335 67.2004C63.2737 67.2051 63.2136 67.2156 63.1547 67.2285C59.5021 68.016 55.2482 68.4109 50.9955 68.4098C48.8692 68.4098 46.7428 68.3113 44.6917 68.1145C42.6405 67.9176 40.6656 67.6211 38.8399 67.2273C38.7832 67.2133 38.7266 67.2051 38.6699 67.2004C31.663 65.6359 27.1432 62.8785 27.1432 60.1598V48.2887C27.2022 48.3426 27.2739 48.393 27.3352 48.4457C27.5075 48.5945 27.6878 48.7422 27.8763 48.8875C27.9908 48.9754 28.1052 49.0633 28.2255 49.15C28.4348 49.3 28.6568 49.4477 28.8834 49.593C28.999 49.6668 29.1089 49.7418 29.228 49.8145C29.5633 50.0172 29.9136 50.2152 30.2825 50.4074C30.3114 50.4227 30.338 50.4379 30.3669 50.452C30.7507 50.6488 31.1566 50.8398 31.5775 51.0262C31.722 51.0895 31.8746 51.1504 32.0226 51.2125C32.3198 51.3379 32.6227 51.4609 32.9372 51.5793C33.1164 51.6473 33.2991 51.7129 33.4841 51.7785C33.7917 51.8887 34.1073 51.9953 34.4299 52.0996C34.6196 52.1605 34.8092 52.2227 35.0046 52.2812C35.3584 52.3891 35.7238 52.4922 36.0938 52.593C36.2684 52.641 36.4395 52.6902 36.6176 52.7359C37.1714 52.8789 37.738 53.016 38.3253 53.1426C38.3554 53.1496 38.3889 53.1555 38.4236 53.159C42.2161 53.9723 46.5636 54.4023 51.0013 54.4023C55.439 54.4023 59.7784 53.9734 63.5697 53.1613C63.6056 53.1566 63.6414 53.1508 63.6773 53.1426C64.2647 53.0148 64.8312 52.8789 65.3851 52.7359C65.5643 52.6902 65.7342 52.6398 65.9088 52.593C66.2788 52.4922 66.6442 52.3891 66.998 52.2812C67.1934 52.2215 67.3831 52.1605 67.5727 52.0996C67.8953 51.9953 68.2109 51.8887 68.5185 51.7785C68.7023 51.7129 68.8862 51.6473 69.0654 51.5793C69.3799 51.4598 69.6817 51.3367 69.98 51.2125C70.128 51.1504 70.2806 51.0895 70.4252 51.0262C70.846 50.841 71.2507 50.65 71.6357 50.452C71.6646 50.4367 71.6912 50.4215 71.7201 50.4074C72.0901 50.2152 72.4405 50.0172 72.7747 49.8145C72.8949 49.7418 73.0036 49.6668 73.1192 49.593C73.347 49.4477 73.5678 49.3 73.7771 49.15C73.8974 49.0633 74.0118 48.9766 74.1263 48.8875C74.3148 48.7422 74.4952 48.5945 74.6674 48.4457C74.7287 48.393 74.7992 48.3426 74.8582 48.2887ZM74.8582 76.5355C74.8582 80.4367 65.0602 84.7844 51.0002 84.7844C36.9402 84.7844 27.1421 80.4367 27.1421 76.5355V64.6469C27.1987 64.6984 27.2693 64.7477 27.3282 64.7992C27.5028 64.9504 27.6844 65.0992 27.8763 65.2469C27.9873 65.3324 28.0995 65.418 28.2162 65.5023C28.4302 65.6559 28.6568 65.807 28.8892 65.9559C28.9979 66.0262 29.1019 66.0977 29.2152 66.1656C29.5691 66.3801 29.9367 66.591 30.3299 66.7937C30.331 66.7937 30.3322 66.7938 30.3333 66.7961C30.7253 66.9988 31.1404 67.1945 31.5694 67.3855C31.7058 67.4465 31.8515 67.5039 31.9914 67.5637C32.2955 67.6926 32.6054 67.8191 32.928 67.9422C33.1002 68.0078 33.2772 68.0711 33.4541 68.1355C33.7674 68.248 34.0888 68.3582 34.4184 68.466C34.6034 68.5258 34.7872 68.5867 34.9768 68.6453C35.3341 68.7555 35.703 68.8609 36.0764 68.9641C36.2476 69.0109 36.4141 69.0602 36.5887 69.1059C37.1413 69.2512 37.7079 69.3895 38.2941 69.5195C38.3462 69.5312 38.3993 69.5383 38.4514 69.543C42.2369 70.3516 46.5717 70.7793 50.999 70.7793C55.4263 70.7793 59.7599 70.3527 63.5478 69.543C63.5998 69.5383 63.653 69.5312 63.705 69.5195C64.2912 69.3906 64.8578 69.2512 65.4105 69.1059C65.5839 69.0602 65.7493 69.0121 65.9192 68.9652C66.295 68.8621 66.665 68.7555 67.0246 68.6453C67.2131 68.5879 67.3958 68.5281 67.5785 68.4684C67.9092 68.3605 68.2329 68.2492 68.5486 68.1355C68.7231 68.0723 68.8977 68.009 69.0689 67.9445C69.3938 67.8203 69.7071 67.6926 70.0135 67.5625C70.1511 67.5039 70.2933 67.4477 70.4275 67.3879C71.29 67.0047 72.0774 66.5969 72.7851 66.1668C72.8972 66.0988 73.0001 66.0273 73.1088 65.9582C73.3424 65.8082 73.5702 65.657 73.7852 65.5023C73.9008 65.4191 74.0118 65.3336 74.1217 65.2492C74.3148 65.1016 74.4975 64.9516 74.6732 64.7992C74.7322 64.7488 74.8016 64.6996 74.8582 64.648V76.5355Z",fill:ve.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:ve.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:ve.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:ve.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:ve.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:ve.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:ve.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:ve.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:ve.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:ve.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:ve.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:ve.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:ve.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:ve.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:ve.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:ve.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:ve.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:ve.accent,fillOpacity:"0.65"})]})})}const Qn=({title:r="create",children:t,onClickAction:l,variant:n="primary",variantTitle:o,leftIcon:c,showButton:s=!0,customHeight:i,childrenButton:a,customIcon:d})=>{const u=()=>{switch(n){case"primary":return e.jsx(e.Fragment,{children:c?e.jsx(H.Button,{primary:!0,iconLeft:c,onClick:l,children:a||r}):e.jsx(H.Button,{primary:!0,onClick:l,children:a||r})});case"secondary":return e.jsx(e.Fragment,{children:c?e.jsx(H.Button,{secondary:!0,iconLeft:c,onClick:l,children:o?e.jsx(k.Text,{fontFamily:"Poppins",fontSize:"md",fontWeight:"medium",style:{color:"var(--sa-background-success, #28ac6e)"},children:a||r}):r}):e.jsx(H.Button,{secondary:!0,onClick:l,children:a||r})});case"success":return e.jsx(e.Fragment,{children:c?e.jsx(H.Button,{success:!0,iconLeft:c,onClick:l,children:a||r}):e.jsx(H.Button,{success:!0,onClick:l,children:a||r})});default:return e.jsx(e.Fragment,{children:c?e.jsx(H.Button,{primary:!0,iconLeft:c,onClick:l,children:a||r}):e.jsx(H.Button,{primary:!0,onClick:l,children:a||r})})}};return e.jsxs(y.Box,{height:"height-full",display:"flex",direction:"column",gap:"sm",justify:"center",align:"center",marginBlock:"auto",customHeight:i,children:[d||e.jsx(Gn,{}),e.jsx(y.Box,{direction:"column",children:t.map((p,C)=>e.jsx(Ie.Body1,{props:{align:"center",textAlign:"center"},children:C>2?null:p},C))}),s?u():null]})},J={c001A72:"#001A72",c64B5F6:"#64B5F6",c98B4CB:"#98B4CB",cBBDEFB:"#BBDEFB",cD0E5F7:"#D0E5F7",cD6EBFD:"#D6EBFD",c000000:"#000000",cFFFFFF:"#FFFFFF"};function Un({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 622 271",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M32.4375 254.5H612.437",stroke: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 Jn({onClick:r}){const t=ue.useMediaQuery("md");return e.jsxs(y.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(Un,{width:t?600:300}),e.jsx(k.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Page Not Found"}),e.jsx(k.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"Sorry, we couldn't find the page you are looking for"}),r&&e.jsx(H.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const re={c46F16B:"#46F16B",c48504C:"#48504C",c64B5F6:"#64B5F6",c67AEE6:"#67AEE6",c86512B:"#86512B",c956847:"#956847",cBBC3F5:"#BBC3F5",cBBDEFB:"#BBDEFB",cC0B2A2:"#C0B2A2",cC8CEF4:"#C8CEF4",cCABEB1:"#CABEB1",cD5C7BD:"#D5C7BD",cD6D6D6:"#D6D6D6",cD6EBFD:"#D6EBFD",cE5EE80:"#E5EE80",cEE8080:"#EE8080",cEFF3F8:"#EFF3F8",cF4F4F4:"#F4F4F4",cFFFFFF:"#FFFFFF"};function Yn({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 654 258",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{x:"228",y:"55.5",width:"55",height:"20",fill:re.cD6EBFD}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M75 238.124V197.28L163.523 63.5H217.029V194.32H240V238.124H217.029V252.5H169.126V238.124H75ZM125.424 194.32L172.487 119.143V194.32H125.424Z",fill:re.cBBDEFB,fillOpacity:"0.6"}),e.jsxs("g",{clipPath:"url(#clip0_2949_9690)",children:[e.jsx("path",{d:"M334.5 274.5C381.168 274.5 419 227.266 419 169C419 110.734 381.168 63.5 334.5 63.5C287.832 63.5 250 110.734 250 169C250 227.266 287.832 274.5 334.5 274.5Z",fill:re.cEFF3F8,stroke:re.c67AEE6,strokeWidth:"5"}),e.jsx("path",{d:"M413 197.5C411.397 211.835 402.919 230.898 389.361 246.49C375.596 262.32 356.651 274.5 334.496 274.5C311.331 274.5 292.389 261.672 278.878 245.52C265.592 229.638 257.606 210.603 256 197.5H413Z",fill:re.cD5C7BD}),e.jsx("path",{d:"M278.887 211.766H391.104L392.583 222.856C392.687 223.635 392.08 224.328 391.294 224.328H277.961C277.14 224.328 276.525 223.577 276.686 222.773L278.887 211.766Z",fill:re.cCABEB1}),e.jsx("path",{d:"M287.68 218.884L289.354 213.022H378.961L381.473 218.884H287.68Z",fill:re.cC0B2A2}),e.jsx("path",{d:"M381.944 218.803L381.58 212.266H386.385L386.022 218.803H381.944Z",fill:re.c956847,stroke:re.c48504C}),e.jsx("path",{d:"M283.124 218.803L282.768 213.104H287.565L287.209 218.803H283.124Z",fill:re.c956847,stroke:re.c48504C}),e.jsx("path",{d:"M285.902 212.103L284.935 186.306H279.606C278.151 186.306 277.004 187.542 277.113 188.993L278.673 209.79C278.77 211.095 279.857 212.103 281.166 212.103H285.902Z",fill:re.cC8CEF4,stroke:re.c48504C}),e.jsx("path",{d:"M383.256 212.103L384.638 186.306H389.556C391.007 186.306 392.153 187.537 392.05 188.984L390.564 209.782C390.471 211.09 389.382 212.103 388.07 212.103H383.256Z",fill:re.cC8CEF4,stroke:re.c48504C}),e.jsx("path",{d:"M284.497 178.155C284.455 176.194 286.034 174.581 287.996 174.581H381.904C383.895 174.581 385.485 176.24 385.401 178.23L384.066 209.59C383.987 211.463 382.445 212.941 380.569 212.941H288.663C286.759 212.941 285.205 211.419 285.164 209.515L284.497 178.155Z",fill:re.cC8CEF4,stroke:re.c48504C}),e.jsx("path",{d:"M284.845 181.524C284.792 179.279 286.598 177.431 288.844 177.431H380.687C382.948 177.431 384.76 179.304 384.684 181.565L383.774 208.737C383.701 210.893 381.933 212.603 379.776 212.603H289.48C287.307 212.603 285.532 210.869 285.481 208.697L284.845 181.524Z",fill:re.cBBC3F5}),e.jsx("mask",{id:"mask0_2949_9690",maskUnits:"userSpaceOnUse",x:"301",y:"144",width:"68",height:"17",style:{maskType:"luminance"},children:e.jsx("path",{d:"M301 146.5C301 145.395 301.887 144.5 302.98 144.5H367.02C368.114 144.5 369 145.395 369 146.5V160.411H301V146.5Z",fill:re.cFFFFFF})}),e.jsxs("g",{mask:"url(#mask0_2949_9690)",children:[e.jsx("path",{d:"M301 146.191C301 145.257 301.748 144.5 302.671 144.5H356.701C357.624 144.5 358.372 145.257 358.372 146.191V157.949H301V146.191Z",fill:re.cFFFFFF}),e.jsx("path",{d:"M301.336 146.607C301.336 145.673 302.08 144.916 302.999 144.916H367.01C367.929 144.916 368.673 145.673 368.673 146.607V152.523H301.336V146.607Z",fill:re.cD6D6D6}),e.jsx("path",{d:"M368.673 152.523H301.336V174.5H368.673V152.523Z",fill:re.cF4F4F4}),e.jsx("path",{d:"M307.685 150.417C308.607 150.417 309.356 149.66 309.356 148.726C309.356 147.793 308.607 147.036 307.685 147.036C306.762 147.036 306.014 147.793 306.014 148.726C306.014 149.66 306.762 150.417 307.685 150.417Z",fill:re.cEE8080}),e.jsx("path",{d:"M313.532 150.417C314.455 150.417 315.203 149.66 315.203 148.726C315.203 147.793 314.455 147.036 313.532 147.036C312.609 147.036 311.861 147.793 311.861 148.726C311.861 149.66 312.609 150.417 313.532 150.417Z",fill:re.cE5EE80}),e.jsx("path",{d:"M318.546 150.417C319.469 150.417 320.217 149.66 320.217 148.726C320.217 147.793 319.469 147.036 318.546 147.036C317.623 147.036 316.875 147.793 316.875 148.726C316.875 149.66 317.623 150.417 318.546 150.417Z",fill:re.c46F16B})]}),e.jsx("path",{d:"M301.16 146C301.16 145.172 301.832 144.5 302.66 144.5H367.33C368.159 144.5 368.83 145.172 368.83 146V174.419H301.16V146Z",stroke:re.c48504C}),e.jsx("path",{d:"M395.29 207.579H423.344M354.255 236.889H369.329M327.038 222.234H347.556M350.905 222.234H358.024M288.097 230.19H304.846M253.344 210.091H272.605M278.467 246.938H295.216M297.309 246.938H303.59M337.088 252.801H354.255",stroke:re.c86512B,strokeWidth:"2",strokeLinecap:"round"})]}),e.jsx("path",{d:"M430.241 125.78C430.987 105.807 437.521 90.4065 449.841 79.5799C462.161 68.7532 478.867 63.3398 499.961 63.3398C513.961 63.3398 525.907 65.7665 535.801 70.6199C545.881 75.4732 553.441 82.0998 558.481 90.4998C563.707 98.8998 566.321 108.327 566.321 118.78C566.321 131.1 563.241 141.18 557.081 149.02C550.921 156.673 543.734 161.9 535.521 164.7V165.82C546.161 169.367 554.561 175.247 560.721 183.46C566.881 191.673 569.961 202.22 569.961 215.1C569.961 226.673 567.254 236.94 561.841 245.9C560.436 248.258 558.849 250.481 557.081 252.569L443.5 252.662C432.5 241 427.721 230.5 427.721 207.82H474.201C474.387 216.033 476.721 222.567 481.201 227.42C485.681 232.087 492.214 234.42 500.801 234.42C508.081 234.42 513.681 232.367 517.601 228.26C521.707 223.967 523.761 218.367 523.761 211.46C523.761 202.5 520.867 196.06 515.081 192.14C509.481 188.033 500.427 185.98 487.921 185.98H478.961V147.06H487.921C497.441 147.06 505.094 145.473 510.881 142.3C516.854 138.94 519.841 133.06 519.841 124.66C519.841 117.94 517.974 112.713 514.241 108.98C510.507 105.247 505.374 103.38 498.841 103.38C491.747 103.38 486.427 105.527 482.881 109.82C479.521 114.113 477.561 119.433 477.001 125.78H430.241Z",fill:re.cBBDEFB,fillOpacity:"0.6"}),e.jsx("rect",{x:"43",y:"87.5",width:"46",height:"20",fill:re.cD6EBFD}),e.jsx("rect",{x:"29",y:"109.5",width:"46",height:"20",fill:re.cD6EBFD}),e.jsx("rect",{x:"29",y:"65.5",width:"46",height:"20",fill:re.cD6EBFD}),e.jsx("rect",{x:"356",y:"0.5",width:"55",height:"20",fill:re.cD6EBFD}),e.jsx("rect",{x:"572",y:"142.5",width:"55",height:"20",fill:re.cD6EBFD}),e.jsx("rect",{x:"589",y:"120.5",width:"55",height:"20",fill:re.cD6EBFD}),e.jsx("path",{d:"M3 255.5L651 255.5",stroke:re.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_2949_9690",children:e.jsx("rect",{width:"179",height:"192",fill:re.cFFFFFF,transform:"translate(246 60.5)"})})})]})})}function Xn({onClick:r}){const t=ue.useMediaQuery("md");return e.jsxs(y.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(Yn,{width:t?600:300}),e.jsx(k.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",children:"We Are Sorry ..."}),r&&e.jsx(H.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const f={c000D58:"#000D58",c001174:"#001174",c28AC6E:"#28AC6E",c48504C:"#48504C",c64B5F6:"#64B5F6",c90CAF9:"#90CAF9",cC9184A:"#C9184A",cD6D6D6:"#D6D6D6",cD6EBFD:"#D6EBFD",cD9D9D9:"#D9D9D9",cDEECF8:"#DEECF8",cE7EAE9:"#E7EAE9",cF3F8FD:"#F3F8FD",cFFE18B:"#FFE18B",cFFFFFF:"#FFFFFF"};function Kn({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 622 287",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M406.562 180.997C406.562 148.544 412.16 122.978 423.356 104.299C434.721 85.6199 452.957 76.2803 478.063 76.2803C503.168 76.2803 521.319 85.6199 532.514 104.299C543.88 122.978 549.562 148.544 549.562 180.997C549.562 213.827 543.88 239.582 532.514 258.261C521.319 276.941 503.168 286.28 478.063 286.28C452.957 286.28 434.721 276.941 423.356 258.261C412.16 239.582 406.562 213.827 406.562 180.997ZM506.815 180.997C506.815 161.941 504.949 147.318 501.217 137.129C497.485 126.752 489.767 121.563 478.063 121.563C466.358 121.563 458.64 126.752 454.908 137.129C451.176 147.318 449.31 161.941 449.31 180.997C449.31 193.827 449.988 204.488 451.345 212.978C452.703 221.28 455.417 228.073 459.488 233.356C463.729 238.45 469.92 240.997 478.063 240.997C486.205 240.997 492.312 238.45 496.383 233.356C500.624 228.073 503.423 221.28 504.78 212.978C506.137 204.488 506.815 193.827 506.815 180.997Z",fill:f.cD6EBFD}),e.jsx("path",{d:"M246.562 180.558C246.562 148.105 252.16 122.539 263.356 103.86C274.721 85.1804 292.957 75.8408 318.063 75.8408C343.168 75.8408 361.319 85.1804 372.514 103.86C383.88 122.539 389.562 148.105 389.562 180.558C389.562 213.388 383.88 239.143 372.514 257.822C361.319 276.501 343.168 285.841 318.063 285.841C292.957 285.841 274.721 276.501 263.356 257.822C252.16 239.143 246.562 213.388 246.562 180.558ZM346.815 180.558C346.815 161.501 344.949 146.879 341.217 136.69C337.485 126.313 329.767 121.124 318.063 121.124C306.358 121.124 298.64 126.313 294.908 136.69C291.176 146.879 289.31 161.501 289.31 180.558C289.31 193.388 289.988 204.048 291.345 212.539C292.702 220.841 295.417 227.633 299.488 232.916C303.729 238.011 309.92 240.558 318.063 240.558C326.205 240.558 332.312 238.011 336.383 232.916C340.624 227.633 343.423 220.841 344.78 212.539C346.137 204.048 346.815 193.388 346.815 180.558Z",fill:f.cD6EBFD}),e.jsx("path",{d:"M222.808 118.703H128.062V159.858C132.111 155.484 137.779 151.905 145.067 149.122C152.356 146.338 160.251 144.946 168.754 144.946C183.938 144.946 196.49 148.326 206.41 155.086C216.532 161.846 223.922 170.594 228.578 181.329C233.234 192.065 235.562 203.696 235.562 216.221C235.562 239.483 228.882 257.972 215.52 271.691C202.158 285.21 183.357 282.89 159.062 282.89C142.867 282.89 131.098 284.939 116.826 283.918C104.881 278.351 95.6695 270.697 89.1911 260.955C82.7127 251.213 79.1698 239.98 78.5625 227.256H129.276C130.491 233.419 133.426 238.588 138.083 242.763C142.739 246.739 149.116 248.728 157.214 248.728C166.729 248.728 173.815 245.745 178.472 239.781C183.128 233.817 185.456 225.864 185.456 215.923C185.456 206.181 183.027 198.726 178.168 193.557C173.309 188.387 166.223 185.803 156.911 185.803C150.027 185.803 144.359 187.493 139.905 190.873C135.451 194.054 132.515 198.328 131.098 203.696H80.9919V73.9697H222.808V118.703Z",fill:f.cD6EBFD}),e.jsx("rect",{x:"216.562",y:"45.7803",width:"55",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"90",width:"46",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"112",width:"46",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"68",width:"46",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.719727",width:"55",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"87",width:"55",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"65",width:"55",height:"20",fill:f.cD6EBFD}),e.jsx("path",{d:"M25.8125 282.22H605.812",stroke:f.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"263.012",y:"175.42",width:"104.6",height:"31.2833",rx:"3.3",fill:f.cFFFFFF,stroke:f.c001174,strokeWidth:"1.4"}),e.jsx("path",{d:"M269.878 200.539C269.878 200.263 270.101 200.039 270.377 200.039L305.476 199.955C305.753 199.955 305.978 200.179 305.978 200.455V206.461H269.878V200.539Z",stroke:f.c001174}),e.jsx("rect",{x:"263.012",y:"210.752",width:"104.6",height:"31.2833",rx:"3.3",fill:f.cFFFFFF,stroke:f.c001174,strokeWidth:"1.4"}),e.jsx("path",{d:"M269.878 235.871C269.878 235.595 270.101 235.372 270.377 235.371L305.476 235.288C305.753 235.287 305.978 235.511 305.978 235.788V241.794H269.878V235.871Z",stroke:f.c001174}),e.jsx("rect",{x:"263.012",y:"246.969",width:"104.6",height:"31.2833",rx:"3.3",fill:f.cFFFFFF,stroke:f.c001174,strokeWidth:"1.4"}),e.jsx("path",{d:"M269.878 272.088C269.878 271.812 270.101 271.589 270.377 271.588L305.476 271.505C305.753 271.504 305.978 271.728 305.978 272.005V278.011H269.878V272.088Z",stroke:f.c001174}),e.jsx("path",{d:"M279.095 176.348H364.373C365.459 176.348 366.125 176.992 366.986 178.252V202.985C366.986 202.985 366.986 203.869 366.545 204.752C366.103 205.635 365.661 206.077 365.661 206.077L306.478 206.163V199.452L279.095 199.518V176.348Z",fill:f.cF3F8FD}),e.jsx("path",{d:"M279.095 211.093H364.373C365.459 211.093 366.125 211.736 366.986 212.997V237.73C366.986 237.73 366.986 238.613 366.545 239.497C366.103 240.38 365.661 240.822 365.661 240.822L306.478 240.908V234.197L279.095 234.262V211.093Z",fill:f.cF3F8FD}),e.jsx("path",{d:"M279.095 248.008H364.373C365.459 248.008 366.125 248.652 366.986 249.912V274.646C366.986 274.646 366.986 275.529 366.545 276.412C366.103 277.296 365.661 277.737 365.661 277.737L306.478 277.824V271.112L279.095 271.178V248.008Z",fill:f.cF3F8FD}),e.jsx("circle",{cx:"270.258",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"4.45833",stroke:f.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"2.20833",fill:f.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"186.553",width:"36.4",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"4.45833",stroke:f.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"2.20833",fill:f.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"221.885",width:"36.4",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"4.45833",stroke:f.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"2.20833",fill:f.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"258.102",width:"36.4",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"270.261",y:"200.336",width:"8.83333",height:"6.18333",fill:f.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"235.668",width:"8.83333",height:"6.18333",fill:f.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"271.885",width:"8.83333",height:"6.18333",fill:f.cFFFFFF}),e.jsx("rect",{x:"279.095",y:"200.336",width:"26.5",height:"6.18333",fill:f.cDEECF8}),e.jsx("rect",{x:"279.095",y:"235.668",width:"26.5",height:"6.18333",fill:f.cDEECF8}),e.jsx("rect",{x:"279.095",y:"271.885",width:"26.5",height:"6.18333",fill:f.cDEECF8}),e.jsx("path",{d:"M268.053 210.494C268.483 209.112 268.564 208.343 268.053 206.961H362.569C361.955 208.363 361.972 209.136 362.569 210.494H268.053Z",fill:f.c000D58,stroke:f.c001174}),e.jsx("path",{d:"M268.053 246.269C268.483 244.887 268.564 244.118 268.053 242.736H362.569C361.955 244.138 361.972 244.911 362.569 246.269H268.053Z",fill:f.c000D58,stroke:f.c001174}),e.jsx("path",{d:"M283.312 130.775C283.312 129.64 283.987 128.72 284.82 128.72H349.805C350.638 128.72 351.312 129.64 351.312 130.775V169.72H283.312V130.775Z",fill:f.cFFFFFF,stroke:f.c48504C,strokeWidth:"2"}),e.jsx("path",{d:"M279.574 171.847C279.381 171.283 279.267 170.624 279.33 169.72H355.195C355.423 170.925 355.287 171.695 355.063 172.241C354.834 172.802 354.506 173.186 354.101 173.66C354.084 173.68 354.067 173.7 354.05 173.72H280.503C280.468 173.658 280.434 173.598 280.4 173.539C280.051 172.922 279.774 172.434 279.574 171.847Z",stroke:f.c48504C,strokeWidth:"2"}),e.jsx("path",{d:"M350.312 133.72V129.726L284.812 129.72C284.312 129.726 284.312 129.726 284.312 130.125V133.72H350.312Z",fill:f.cD6D6D6}),e.jsx("circle",{cx:"287.212",cy:"131.62",r:"0.9",fill:f.c28AC6E}),e.jsx("circle",{cx:"289.812",cy:"131.62",r:"0.9",fill:f.cC9184A}),e.jsx("circle",{cx:"292.412",cy:"131.62",r:"0.9",fill:f.cFFE18B}),e.jsx("rect",{x:"315.312",y:"133.72",width:"35",height:"35",fill:f.c90CAF9}),e.jsx("path",{d:"M319.312 153.22H341.312",stroke:f.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 150.72H310.312",stroke:f.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 156.22H336.312",stroke:f.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 153.72H305.312",stroke:f.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 159.22H336.312",stroke:f.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 156.72H305.312",stroke:f.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M337.312 139.72L328.312 148.72M328.313 139.72L337.313 148.72",stroke:f.cFFFFFF,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function $n({onClick:r}){const t=ue.useMediaQuery("md");return e.jsxs(y.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",overflow:"overflow-hidden",children:[e.jsx(Kn,{width:t?600:300}),e.jsx(k.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Server Problem"}),e.jsx(k.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"we are trying to fix the problem"}),r&&e.jsx(H.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const Rn=r=>{var l,n,o,c,s;const t=ue.useMediaQuery("md");return e.jsxs(Le.Dialog,{isShow:r.isShow,onHide:r.onHide,style:{...t?{minWidth:r.customMinWidth||"458px"}:{maxWidth:r.customMinWidth||"458px"}},children:[e.jsx(Le.DialogTitle,{...r.dialogTitleProps,children:typeof r.title=="string"?e.jsx(k.Text,{fontSize:"lg",fontWeight:"medium",children:r.title}):r.title}),e.jsx(Le.DialogBody,{children:typeof r.description=="string"?e.jsx(k.Text,{fontSize:"md",lineHeight:"leading-6",color:"brand",children:r.description}):r.description}),e.jsx(Le.DialogFooter,{children:e.jsx(y.Box,{display:"flex",direction:((l=r.containerConfirmBtnProps)==null?void 0:l.direction)||"row",justify:((n=r.containerConfirmBtnProps)==null?void 0:n.justify)||"flex-end",...r.containerConfirmBtnProps,children:e.jsxs(y.Box,{display:"flex",direction:((o=r.wrapperConfirmBtnProps)==null?void 0:o.direction)||"row",justify:((c=r.wrapperConfirmBtnProps)==null?void 0:c.justify)||"flex-end",gap:((s=r.wrapperConfirmBtnProps)==null?void 0:s.gap)||"sm",...r.wrapperConfirmBtnProps,children:[r.onCancel&&e.jsx(H.Button,{secondary:!0,onClick:r.onCancel,size:"md",fullWidth:!0,children:r.titleCancelBtn||"Cancel"}),e.jsx(y.Box,{direction:"column",fullWidth:!0,style:{textWrap:"nowrap"},children:e.jsx(H.Button,{...r.buttonConfirmProps,onClick:r.onConfirm,size:"md",fullWidth:!0,children:r.titleConfirmBtn||"Ok"})})]})})})]},r.key)},ec=h.memo(({children:r,height:t,minHeight:l,customHeight:n,paddingInline:o="spacing-0",paddingBlock:c="spacing-0",header:s,footer:i,title:a,titleTag:d,action:u,actionContainer:p,containerProps:C,bodyProps:v,headerProps:T={borderBottom:!0},footerProps:b={borderTop:!0},variantTag:B="info"})=>{const E=h.useRef(null),[S,V]=h.useState("100vh");h.useEffect(()=>{const D=()=>{if(E.current){const O=E.current.getBoundingClientRect().top;V(`calc(100vh - ${O}px)`)}};return D(),window.addEventListener("resize",D),()=>window.removeEventListener("resize",D)},[]);const w=()=>d?e.jsxs(y.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(k.Text,{fontWeight:"medium",children:a}),e.jsx(Ze.Badges,{border:!0,text:d,variant:B})]}):e.jsx(k.Text,{fontWeight:"medium",children:a}),z=()=>s||e.jsxs(y.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(y.Box,{direction:"column",children:a?w():null}),e.jsx(y.Box,{direction:"column",...p,children:u??null})]}),W=!!(s||a||u);return e.jsxs(y.Box,{ref:E,height:t,customMinHeight:l,customHeight:n,paddingBlock:c,paddingInline:o,bg:"white",direction:"column",...C,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",display:"flex",minHeight:S,...(C==null?void 0:C.style)??{}},children:[s!==null&&W?e.jsx(Qr,{...T,children:z()}):null,e.jsx(y.Box,{direction:"column",padding:"spacing-0",...v,style:{flex:1,overflow:"auto",...(v==null?void 0:v.style)??{}},children:r}),i?e.jsx(Ur,{...b,children:i}):null]})}),rc=h.memo(({value:r,options:t=[],onChange:l,multiple:n})=>{const o=(r==null?void 0:r.map(i=>i.value))||[],c=(t==null?void 0:t.filter(i=>o.includes(i.value)))||[],s=i=>{const a=[...c];let d=[];n?d=o.includes(i.value)?a.filter(u=>u.value!==i.value):[...a,i]:d=[i],l==null||l(d)};return e.jsx(y.Box,{direction:"row",gap:"sm",flexWrap:"wrap",children:t==null?void 0:t.map((i,a)=>e.jsx(H.Button,{...o.includes(i.value)?{primary:!0}:{secondary:!0},onClick:()=>s(i),children:i.label},a))})});function Er(r){return null}Er.displayName="LayoutDialog.Header";function Mr(r){return null}Mr.displayName="LayoutDialog.Body";function Lr(r){return null}Lr.displayName="LayoutDialog.Aside";function Ir(r){return null}Ir.displayName="LayoutDialog.Footer";const Se={"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"},tc=[{mode:"sidebar",label:"Sidebar",icon:e.jsx(oc,{})},{mode:"modal",label:"Modal",icon:e.jsx(F.Icon,{name:"Newscreen",size:"sm"})},{mode:"fullscreen",label:"Fullscreen",icon:e.jsx(F.Icon,{name:"Fullscreen",size:"sm"})}];function lc({value:r,onChange:t}){return e.jsx("div",{className:Se["lyd-vm-group"],role:"group","aria-label":"View mode",children:tc.map(l=>e.jsx("button",{type:"button",className:Se["lyd-vm-btn"],"data-active":r===l.mode,"aria-label":`Switch to ${l.label} view`,"aria-pressed":r===l.mode,onClick:()=>t(l.mode),children:l.icon},l.mode))})}function oc(){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 nt={md:"768px",lg:"1024px",xl:"1200px","2xl":"1440px"};function nc(r){return r?r in nt?nt[r]:r:nt.xl}function Tr(r,t){let l=null;return h.Children.forEach(r,n=>{h.isValidElement(n)&&n.type===t&&(l=n.props.children??null)}),l}function cc(r){const{isOpen:t,onClose:l,viewMode:n,defaultViewMode:o="modal",onViewModeChange:c,showViewModeToggle:s=!0,showCloseButton:i=!0,size:a,asideWidth:d,disableEscapeClose:u=!1,disableBackdropClose:p=!1,lockBodyScroll:C=!0,children:v}=r,[T,b]=h.useState(o),B=n??T,S=ue.useMediaQuery("md")?B:"fullscreen",V=h.useCallback($=>{n===void 0&&b($),c==null||c($)},[n,c]),w=h.useRef(null);h.useEffect(()=>{if(!(!t||!C))return w.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=w.current??""}},[t,C]),h.useEffect(()=>{if(!t||u)return;const $=te=>{te.key==="Escape"&&l()};return window.addEventListener("keydown",$),()=>window.removeEventListener("keydown",$)},[t,u,l]);const z=h.useMemo(()=>Tr(v,Er),[v]),W=h.useMemo(()=>Tr(v,Mr),[v]),D=h.useMemo(()=>Tr(v,Lr),[v]),O=h.useMemo(()=>Tr(v,Ir),[v]);if(!t)return null;const q=[Se["lyd-panel"],S==="modal"&&Se["lyd-modal"],S==="fullscreen"&&Se["lyd-fullscreen"],S==="sidebar"&&Se["lyd-sidebar"]].filter(Boolean).join(" "),U={"--lyd-max-w":nc(a),...d!==void 0&&{"--lyd-aside-w":d}},G=()=>{p||l()};return e.jsxs("div",{className:Se["lyd-root"],style:U,role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:Se["lyd-backdrop"],onClick:G,"aria-hidden":"true"}),e.jsxs("div",{className:q,children:[e.jsxs("div",{className:Se["lyd-header"],children:[e.jsx("div",{className:Se["lyd-header-content"],children:z}),e.jsxs("div",{className:Se["lyd-header-actions"],children:[s&&e.jsx(lc,{value:B,onChange:V}),i&&e.jsx("button",{type:"button",className:Se["lyd-close-btn"],onClick:l,"aria-label":"Close dialog",children:e.jsx(F.Icon,{name:"Cross",size:"md"})})]})]}),e.jsxs("div",{className:Se["lyd-main"],children:[e.jsx("div",{className:Se["lyd-body"],children:W}),D&&e.jsx("aside",{className:Se["lyd-aside"],children:D})]}),O&&e.jsx("div",{className:Se["lyd-footer"],children:O})]})]})}const fr=cc;fr.Header=Er,fr.Body=Mr,fr.Aside=Lr,fr.Footer=Ir;function ic({url:r,filename:t,onClose:l}){return h.useEffect(()=>{const n=o=>{o.key==="Escape"&&l()};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[l]),e.jsxs("div",{onClick:l,style:{position:"fixed",inset:0,zIndex:9999,backgroundColor:"rgba(0,0,0,0.85)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"12px"},children:[e.jsxs("div",{onClick:n=>n.stopPropagation(),style:{position:"absolute",top:"16px",right:"16px",display:"flex",gap:"8px"},children:[e.jsx("a",{href:r,download:t,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 12px",backgroundColor:"rgba(255,255,255,0.15)",color:"#fff",borderRadius:"var(--sa-radii-sm, 6px)",fontSize:"13px",textDecoration:"none",backdropFilter:"blur(4px)"},children:"Download"}),e.jsx("button",{onClick:l,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",backgroundColor:"rgba(255,255,255,0.15)",border:"none",borderRadius:"var(--sa-radii-sm, 6px)",color:"#fff",cursor:"pointer",backdropFilter:"blur(4px)"},"aria-label":"Close preview",children:"✕"})]}),e.jsx("img",{src:r,alt:t,onClick:n=>n.stopPropagation(),style:{maxWidth:"90vw",maxHeight:"85vh",objectFit:"contain",borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"var(--sa-shadow-lg, 0 25px 50px rgba(0,0,0,0.5))"}}),e.jsx("span",{style:{color:"rgba(255,255,255,0.6)",fontSize:"12px"},children:t})]})}const sc=r=>{const{defaultTab:t=0,paramKey:l="tab"}=r||{},[n,o]=ye.useSearchParams(),c=rr.searchParamsToObject(n.toString());return{activeTab:c[l]?parseInt(c[l]):t,handleTabChange:a=>{o({...c,[l]:a.toString()})},searchQueries:c}};function ac({appName:r,menuConfig:t,formatTitle:l}){const n=ye.useLocation();h.useEffect(()=>{let o=null,c=null;for(const a of t){const d=a.items.find(u=>u.to?u.to==="/"?n.pathname==="/":!!(u.to===n.pathname||n.pathname.startsWith(u.to+"/")):!1);if(d){o=d,c=a;break}}const s=[];o!=null&&o.title&&s.push(o.title),c!=null&&c.name&&s.push(c.name.toTitleCase());const i=(a,d)=>a.length>0?`${a.join(" - ")} | ${d}`:d;document.title=(l||i)(s,r)},[n.pathname])}const dc=()=>{const[r,t]=ye.useSearchParams(),l=rr.searchParamsToObject(r.toString()),n=ye.useParams(),o=ye.useLocation(),c=n.id;return{setSearchParams:t,searchParams:r,searchQueries:l,isHasQuery:(u,p)=>r.has(u)&&r.get(u)===p,getQueryParam:u=>r.get(u),getRouteParam:u=>n[u],params:n,location:o,id:c,hasId:!!c}};function hc(r){var n,o;const t=r.decodedAccessToken;return h.useMemo(()=>{var a,d;const c=((d=(a=t==null?void 0:t.access)==null?void 0:a.role)==null?void 0:d.code)??"",s=Object.keys(r.role).reduce((u,p)=>{const C=`is${p.toLowerCase().replace(/(^\w|_\w)/g,v=>v.replace("_","").toUpperCase())}`;return{...u,[C]:!1}},{});return{...Object.keys(r.role).reduce((u,p)=>{const C=`is${p.toLowerCase().replace(/(^\w|_\w)/g,v=>v.replace("_","").toUpperCase())}`;return{...u,[C]:c===r.role[p]}},s),hasRole:u=>c===r.role[u],getRoleKey:()=>c}},[(o=(n=t==null?void 0:t.access)==null?void 0:n.role)==null?void 0:o.code,r])}g.AdvanceFilterBar=Xt,g.App=Ll,g.AppComponent=Bt,g.AppContext=Pr,g.AppLayout=Wl,g.AsideBar=Nn,g.BackButton=Al,g.ColumnFilterDropdown=gl,g.ColumnMenu=Cl,g.ConfirmationDialog=Rn,g.DataTable=yl,g.DecisionWrapper=oe,g.EachUtils=Fr,g.EmptyStatePage=Qn,g.FilterBar=Io,g.FilterDrawer=Yt,g.FloatingFooter=_n,g.ForbiddenPage=Xn,g.Form=jn,g.FullSection=ec,g.HeaderLeftSlot=Il,g.HeaderLeftSlotOutlet=Et,g.HeaderLeftSlotProvider=Ft,g.HorizontalField=Nl,g.ImagePreview=ic,g.InputFile=wl,g.InputImage=Sl,g.LayoutDialog=fr,g.LayoutDialogAside=Lr,g.LayoutDialogBody=Mr,g.LayoutDialogFooter=Ir,g.LayoutDialogHeader=Er,g.ModuleSwitcher=Vl,g.ModuleSwitcherModal=jt,g.NotFoundPage=Jn,g.PageLayout=Zl,g.Pressable=br,g.RightDrawer=_t,g.ScrollToTopButton=kl,g.Section=Jl,g.SectionFooter=Ur,g.SectionHeader=Qr,g.SelectButton=rc,g.ServerErrorPage=$n,g.SidebarBadgesProvider=St,g.SidebarGroupSlot=Tl,g.SidebarGroupSlotOutlet=Lt,g.SidebarGroupSlotProvider=Mt,g.SidebarHeaderSlot=mt,g.TableFooter=fl,g.TableHeader=hl,g.TableLayout=Xo,g.TableSection=Zo,g.TableWrapper=dl,g.ToggleStatus=Pn,g.Typography=Ie,g.VerticalField=qn,g.clearModuleSelection=Ol,g.createInitialFromUserName=tn,g.cssVars=an,g.expandDateCompact=Ho,g.formHasChanged=yn,g.formatDate=cn,g.formatDateToIndonesian=xl,g.formatRupiah=on,g.getDateFilterValue=Jt,g.getDateRangeFilterValue=$l,g.getInitials=nn,g.getValueDropdownMultipleFilter=Ut,g.getValueRadioFilter=Kl,g.getValueSearch=xr,g.getValuesFilter=vr,g.handleChangeFilter=dr,g.handleOnScroll=kn,g.isEmail=wn,g.isFilterActive=Rl,g.isOnlyLettersAndSpaces=Cn,g.isPhoneNumber=pn,g.isSlug=Dn,g.localStorageAdapter=Yr,g.oneDayInMs=dn,g.parseIndonesianDateToDate=ln,g.preventNonCoordinateInput=Sn,g.preventNonNumberAndDecimalInput=xn,g.preventNonNumberInput=bn,g.preventNumberInput=vn,g.resolveDateRangeValueToString=Gt,g.resolveDateValueToString=Qt,g.resolveDropdownValueToString=qt,g.resolveRadioValueToString=Zt,g.resolveSidebarBadge=yr,g.storageKeys=nr,g.textWidth=hn,g.useApp=jr,g.useAppState=wt,g.useAuthRole=hc,g.useDynamicTitle=ac,g.useFilterBarApiParams=zo,g.useFilterBarControls=Vo,g.useModuleSelection=Zr,g.useRouteInfo=Be,g.useRouteParams=dc,g.useSidebarBadges=kt,g.useTabState=sc,g.useTableSortApiParams=Ko,Object.keys($e).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>$e[r]})}),Object.keys(Ze).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ze[r]})}),Object.keys(y).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>y[r]})}),Object.keys(Re).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Re[r]})}),Object.keys(H).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>H[r]})}),Object.keys(ft).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>ft[r]})}),Object.keys(Je).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Je[r]})}),Object.keys(Le).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Le[r]})}),Object.keys(ur).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>ur[r]})}),Object.keys(er).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>er[r]})}),Object.keys(ue).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>ue[r]})}),Object.keys(rr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>rr[r]})}),Object.keys(Ge).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ge[r]})}),Object.keys(I).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>I[r]})}),Object.keys(sr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>sr[r]})}),Object.keys(ar).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>ar[r]})}),Object.keys(Y).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Y[r]})}),Object.keys(gt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>gt[r]})}),Object.keys(Ar).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ar[r]})}),Object.keys(tr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>tr[r]})}),Object.keys(ut).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>ut[r]})}),Object.keys(lr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>lr[r]})}),Object.keys(xe).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>xe[r]})}),Object.keys(or).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>or[r]})}),Object.keys(Vr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Vr[r]})}),Object.keys(k).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>k[r]})}),Object.keys(F).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>F[r]})}),Object.keys(ne).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>ne[r]})}),Object.keys(yt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>yt[r]})}),Object.keys(pt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>pt[r]})}),Object.keys(Ct).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ct[r]})}),Object.keys(bt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>bt[r]})}),Object.keys(vt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>vt[r]})}),Object.keys(Ye).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ye[r]})}),Object.keys(xt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>xt[r]})}),Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
|
|
43
|
+
`,document.head.appendChild(r)},Lr=r=>r==="right"?"right":r==="center"?"center":"left",Xo=(r,t)=>{if(t)return r[t]},Ko=(r,t)=>r==null&&t==null?0:r==null?-1:t==null?1:typeof r=="number"&&typeof t=="number"?r-t:String(r).localeCompare(String(t)),$o=({columns:r,data:t,getRowKey:l,size:n="md",resizable:o=!1,widthStorageKey:c,columnState:s,onColumnStateChange:i,columnMenu:a=!1,sort:d,defaultSort:y,onSortChange:C,height:p,mobileLayout:x="cards",mobileBreakpoint:O="md",groupSeparator:b,summary:B,emptyState:L,loading:S=!1,loadingRows:z=8,rowActions:w})=>{Yo();const A=!ue.useMediaQuery(O)&&x!=="scroll",D=!!(w!=null&&w.length),[M,N]=h.useState(null);h.useEffect(()=>{if(!M)return;const v=()=>N(null),E=setTimeout(()=>document.addEventListener("click",v),0);return()=>{clearTimeout(E),document.removeEventListener("click",v)}},[M]);const[Q,q]=h.useState(()=>new Set),$=s!==void 0,[ie,pe]=h.useState({}),te=s??ie,de=v=>{i==null||i(v),$||pe(v)},R=d!==void 0,[_,oe]=h.useState(y??null),se=R?d??null:_,fe=!C,Fe=v=>{C==null||C(v),R||oe(v)},{headerGroups:Ie,leafColumns:ge,hasGroups:Ee}=h.useMemo(()=>{var Ce;const v=new Set(te.hidden??[]),E=(ee,he)=>ee.key??(typeof ee.accessor=="string"?ee.accessor:`col-${he}`),W=r.map((ee,he)=>{var Pe;if((Pe=ee.children)!=null&&Pe.length){const dr=ee.children.map(($e,ft)=>({col:$e,key:E($e,`${he}-${ft}`)})).filter($e=>!v.has($e.key));return{col:ee,key:ee.key??`group-${he}`,isGroup:!0,leaves:dr}}const me={col:ee,key:E(ee,`${he}`)};return{col:ee,key:me.key,isGroup:!1,leaves:v.has(me.key)?[]:[me]}}).filter(ee=>ee.leaves.length>0),X=W.some(ee=>ee.isGroup);let ae=W.flatMap(ee=>ee.leaves);if(!X&&((Ce=te.order)!=null&&Ce.length)){const ee=new Map(te.order.map((he,me)=>[he,me]));ae=[...ae].sort((he,me)=>(ee.get(he.key)??1/0)-(ee.get(me.key)??1/0))}return{headerGroups:W,leafColumns:ae,hasGroups:X}},[r,te]),_e=h.useMemo(()=>new Map(ge.map((v,E)=>[v.key,E])),[ge]),we=ge.map(v=>v.key).join("|"),qe=(v,E)=>{const W=v.sortKey??(typeof v.accessor=="string"?v.accessor:void 0);return W?E[W]:void 0},je=v=>v.sortable??(!!v.sortKey||typeof v.accessor=="string"),be=h.useMemo(()=>{if(!fe||!se)return t;const v=ge.find(W=>W.key===se.key);if(!v)return t;const E=se.direction==="asc"?1:-1;return[...t].sort((W,X)=>Ko(qe(v.col,W),qe(v.col,X))*E)},[t,fe,se,ge]),Oe=!Ee,Je=!!c&&Oe,[m,U]=J.useColumnWidths(c??""),Z=Je?m:void 0,T=h.useRef(null),[H,j]=h.useState();h.useLayoutEffect(()=>{j(void 0)},[we]),h.useLayoutEffect(()=>{if(!Oe||H||!T.current)return;const v=T.current.querySelectorAll("th.sa-tl-leaf");j(Array.from(v).map(E=>E.offsetWidth))},[H,Oe]);const[G,K]=h.useState(0);h.useLayoutEffect(()=>{if(!Ee||!T.current)return;const v=T.current.querySelector(":scope > tr");v&&K(v.offsetHeight)},[Ee,we]);const ve=(v,E)=>{if((Z==null?void 0:Z[E])!=null)return Z[E];if(v.width!=null)return v.width;if((H==null?void 0:H[E])!=null)return H[E]},Be=(v,E)=>typeof v.width=="number"?v.width:H==null?void 0:H[E],We=te.frozenKey&&!Ee?ge.findIndex(v=>v.key===te.frozenKey):-1,Ae=v=>v<=We,Me=v=>{if(!H)return 0;let E=0;for(let W=0;W<v;W++)E+=H[W]??0;return E},Ye=h.useRef(null),[Xe,Ke]=h.useState("100vh");h.useLayoutEffect(()=>{if(p!==void 0)return;const v=()=>{if(Ye.current){const E=Ye.current.getBoundingClientRect().top;Ke(`calc(100vh - ${E}px)`)}};return v(),window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)},[p]);const ze=(v,E)=>l?l(v,E):E,ir=(v,E,W)=>v.render?v.render(E,W,be):Xo(E,v.accessor),sr=ge.length+(D?1:0),ar=["80%","55%","70%","45%","90%","60%"],uc=(v,E)=>ar[(v*7+E*3)%ar.length],yc=(v,E)=>e.jsx(Ve.Skeleton,{height:14,width:uc(v,E),borderRadius:"rounded-sm"}),pc=Array.from({length:z},(v,E)=>e.jsxs(J.Tr,{children:[ge.map(({col:W,key:X},ae)=>e.jsx(J.Td,{style:{textAlign:Lr(W.align)},children:yc(E,ae)},`sa-tl-sk-${E}-${X}`)),D&&e.jsx(J.Td,{style:{width:1,padding:0,border:"none"}})]},`sa-tl-sk-${E}`)),Cc=(v,E)=>{E||de({...te,hidden:[...te.hidden??[],v]})},bc=v=>de({...te,frozenKey:te.frozenKey===v?void 0:v}),Vr=v=>(w??[]).filter(E=>{var W;return!((W=E.hidden)!=null&&W.call(E,v))}),ml={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)"},Hr=(v,E,W,X)=>{var Pe;const ae=(Pe=v.disabled)==null?void 0:Pe.call(v,E),Ce=(X==null?void 0:X.showLabel)??v.showLabel,ee=(X==null?void 0:X.size)??"xs",he=e.jsx(P.Button,{size:ee,variant:v.variant??"tertiary",tone:v.tone??"neutral",disabled:ae,onClick:()=>v.onClick(E,W),iconLeft:v.icon?e.jsx(F.Icon,{name:v.icon,size:"sm"}):void 0,children:Ce&&v.label}),me=v.tooltip;return me?e.jsx(De.Tooltip,{label:me,position:"top-end",children:he}):he},vc=(v,E)=>{const W=Vr(v);if(!W.length)return null;if(W.length>5){const ae=ze(v,E),Ce=(M==null?void 0:M.rowKey)===ae;return e.jsx("div",{className:"sa-tl-row-actions",style:ml,onClick:ee=>ee.stopPropagation(),children:e.jsx(De.Tooltip,{label:"Aksi lainnya",position:"top",children:e.jsx(P.Button,{size:"xs",variant:"tertiary",onClick:ee=>{const he=ee.currentTarget.getBoundingClientRect();N(Ce?null:{rowKey:ae,top:he.bottom+4,right:window.innerWidth-he.right})},children:e.jsx(F.Icon,{name:"MenuVertical",size:"sm"})})})})}return e.jsx("div",{className:"sa-tl-row-actions",style:ml,children:W.map(ae=>e.jsx(h.Fragment,{children:Hr(ae,v,E)},ae.key))})},xc=(v,E)=>{const W=Vr(v);return W.length?e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",paddingTop:8,marginTop:8,borderTop:Er},children:W.map(X=>e.jsx(h.Fragment,{children:Hr(X,v,E,{showLabel:!0,size:"sm"})},X.key))}):null},wc=(v,E)=>{const W=Vr(v);return W.length?e.jsx("div",{style:{display:"flex",gap:4,paddingRight:8,flexShrink:0},children:W.map(X=>e.jsx(h.Fragment,{children:Hr(X,v,E,{showLabel:!1})},X.key))}):null},it=(v,E)=>{const{col:W,key:X}=v,ae=_e.get(X)??0,Ce=Ae(ae),ee=Ce&&ae===We,he=(se==null?void 0:se.key)===X?se.direction:null,me=a&&!W.disableMenu?e.jsx(bl,{active:!!he||Ce,canSort:je(W),canHide:!W.locked,sortDir:he,frozen:Ce,onSort:ft=>Fe({key:X,direction:ft}),onClearSort:()=>Fe(null),onToggleFreeze:()=>bc(X),onHide:()=>Cc(X,W.locked)}):null,Pe=W.align==="right",dr=W.align==="right"?"flex-end":W.align==="center"?"center":"flex-start",$e=e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:6,justifyContent:dr,overflow:"hidden"},children:[W.icon&&e.jsx(F.Icon,{name:W.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:Mr,children:W.title})]});return e.jsx(J.Th,{className:`sa-tl-leaf${Ce?" sa-tl-frozen":""}`,rowSpan:E==null?void 0:E.rowSpan,minWidth:W.minWidth,resizable:Oe?W.resizable:!1,defaultWidth:Be(W,ae),style:{textAlign:Lr(W.align),width:ve(W,ae),position:"sticky",top:(E==null?void 0:E.top)??0,left:Ce?Me(ae):void 0,zIndex:Ce?3:2,backgroundColor:ur,boxShadow:ee?vl:void 0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:Pe?e.jsxs(e.Fragment,{children:[me,$e]}):e.jsxs(e.Fragment,{children:[$e,me]})})},`th-${X}`)},st=ge.filter(v=>!v.col.hideOnMobile),at=st.find(v=>v.col.primary)??st[0],Dc=st.filter(v=>v!==at),Sc=v=>q(E=>{const W=new Set(E);return W.has(v)?W.delete(v):W.add(v),W}),Fl=(v,E)=>Dc.map(({col:W,key:X})=>{const ae=ir(W,v,E),Ce=typeof ae=="string"||typeof ae=="number"?e.jsx(k.Text,{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:ae}):e.jsx("div",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:ae});return e.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"space-between",alignItems:"baseline"},children:[typeof W.title=="string"?e.jsx(k.Text,{color:"subtle",fontWeight:"medium",style:{color:Jo,flexShrink:0},children:W.title}):e.jsx("div",{style:{flexShrink:0},children:W.title}),Ce]},X)}),El=(v,E)=>{const W=at?ir(at.col,v,E):null;return typeof W=="string"||typeof W=="number"?e.jsx(k.Text,{as:"span",style:Mr,children:W}):e.jsx("span",{style:Mr,children:W})},kc=e.jsx(u.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:Array.from({length:z},(v,E)=>e.jsxs(u.Box,{style:{border:Er,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-${E}`))}),Ml=e.jsx(u.Box,{fullWidth:!0,style:{minHeight:(L==null?void 0:L.minHeight)??320,display:"flex",alignItems:"center",justifyContent:"center",padding:16},children:L==null?void 0:L.content}),Bc=S?kc:be.length===0?Ml:x==="expand"?e.jsx(u.Box,{style:{display:"flex",flexDirection:"column"},children:be.map((v,E)=>{const W=ze(v,E),X=Q.has(W);return e.jsxs("div",{style:{borderBottom:Er},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[e.jsxs("button",{type:"button",onClick:()=>Sc(W),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:[El(v,E),e.jsx(F.Icon,{name:X?"ChevronUp":"ChevronDown",size:"sm",style:{flexShrink:0}})]}),D&&wc(v,E)]}),X&&e.jsx("div",{style:{padding:"0 12px 12px",display:"flex",flexDirection:"column",gap:6},children:Fl(v,E)})]},W)})}):e.jsx(u.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:be.map((v,E)=>e.jsxs(u.Box,{style:{border:Er,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:6},children:[El(v,E),Fl(v,E),D&&xc(v,E)]},ze(v,E)))}),mc=o&&Oe&&H!==void 0,Fc=e.jsxs(J.Table,{className:"sa-table-layout",fullWidth:!0,size:n,resizable:mc,onWidthsChange:Je?U:void 0,children:[e.jsx(J.Thead,{ref:T,children:Ee?e.jsxs(e.Fragment,{children:[e.jsxs(J.Tr,{children:[Ie.map(v=>v.isGroup?e.jsx(J.Th,{colSpan:v.leaves.length,style:{textAlign:"center",position:"sticky",top:0,zIndex:2,backgroundColor:ur},children:e.jsx("span",{style:Mr,children:v.col.title})},`grp-${v.key}`):it(v.leaves[0],{rowSpan:2})),D&&e.jsx(J.Th,{rowSpan:2,style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:ur}})]}),e.jsx(J.Tr,{children:Ie.flatMap(v=>v.isGroup?v.leaves.map(E=>it(E,{top:G})):[])})]}):e.jsxs(J.Tr,{children:[ge.map(v=>it(v)),D&&e.jsx(J.Th,{style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:ur}})]})}),e.jsx(J.Tbody,{children:S?pc:be.length===0?e.jsx(J.Tr,{children:e.jsx(J.Td,{colSpan:sr,children:Ml})}):e.jsxs(e.Fragment,{children:[be.map((v,E)=>{const W=b==null?void 0:b(v,E,E>0?be[E-1]:void 0);return e.jsxs(h.Fragment,{children:[W!=null&&W!==!1&&e.jsx(J.Tr,{children:e.jsx(J.Td,{colSpan:sr,style:{backgroundColor:ur},children:W})}),e.jsxs(J.Tr,{children:[ge.map(({col:X,key:ae},Ce)=>{var dr;const ee=(dr=X.cellProps)==null?void 0:dr.call(X,v,E,be);if(ee!=null&&ee.hidden)return null;const he=Ae(Ce),me=he&&Ce===We,Pe=ir(X,v,E);return e.jsx(J.Td,{className:he?"sa-tl-frozen":void 0,colSpan:ee==null?void 0:ee.colSpan,rowSpan:ee==null?void 0:ee.rowSpan,style:{textAlign:Lr(X.align),width:ve(X,Ce),minWidth:X.minWidth,position:he?"sticky":void 0,left:he?Me(Ce):void 0,zIndex:he?1:void 0,boxShadow:me?vl:void 0},children:typeof Pe=="string"?e.jsx(k.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:Lr(X.align)},children:Pe}):Pe},`tl-cell-${E}-${ae}`)}),D&&e.jsx(J.Td,{style:{position:"sticky",right:0,width:1,padding:0,overflow:"visible",zIndex:2,border:"none"},children:vc(v,E)})]})]},ze(v,E))}),B!=null&&e.jsx(J.Tr,{children:e.jsx(J.Td,{colSpan:sr,children:B})})]})})]}),dt=M?be.findIndex((v,E)=>ze(v,E)===M.rowKey):-1,ht=dt>=0?be[dt]:null;return e.jsxs(e.Fragment,{children:[e.jsx(u.Box,{ref:Ye,fullWidth:!0,style:{overflow:"auto",height:p??Xe},children:A?Bc:Fc}),M&&ht&&e.jsx("div",{className:"sa-tl-kebab-menu",style:{top:M.top,right:M.right},onClick:v=>v.stopPropagation(),children:Vr(ht).map(v=>e.jsx("div",{style:{padding:"2px 4px"},children:Hr(v,ht,dt,{showLabel:!0,size:"sm"})},v.key))})]})},nt=r=>r==="asc"||r==="desc",Ro=(r={})=>{const{sortKeyParam:t="sortBy",sortOrderParam:l="sortOrder",pageKey:n="page",defaultSort:o=null,paramKeys:c,scopeId:s,storage:i=$r}=r,{searchParams:a,setSearchParams:d,searchQueries:y}=ke(),C=a.toString(),p=s?cr.tableSort(s):void 0,x=h.useRef(!1);h.useEffect(()=>{if(x.current||(x.current=!0,!p)||a.has(t)||a.has(l))return;const z=i.get(p);!(z!=null&&z.key)||!nt(z.direction)||d({...Object.fromEntries(a.entries()),[t]:z.key,[l]:z.direction})},[]);const O=h.useMemo(()=>{const z=a.get(t),w=a.get(l);return z&&nt(w)?{key:z,direction:w}:o},[C,t,l,o]);h.useEffect(()=>{if(!p)return;const z=a.get(t),w=a.get(l);z&&nt(w)?i.set(p,{key:z,direction:w}):i.remove(p)},[C,p,t,l,i]);const b=(c==null?void 0:c.sortBy)??"sortBy",B=(c==null?void 0:c.sortOrder)??"sortOrder",L=h.useMemo(()=>O?{[b]:O.key,[B]:O.direction}:{},[O,b,B]),S=h.useCallback(z=>{const w={...y};z?(w[t]=z.key,w[l]=z.direction):(delete w[t],delete w[l]),delete w[n],d(w)},[y,t,l,n,d]);return{sort:O,setSort:S,params:L}},Tr=({of:r,render:t})=>h.Children.toArray(r==null?void 0:r.map((l,n,o)=>t(l,n,o))),le=({condition:r,fallback:t,children:l,loading:n,isLoading:o})=>e.jsx(e.Fragment,{children:o?n:r?l:t}),ce=r=>e.jsx(k.Text,{...r,fontFamily:"Poppins",fontSize:r.fontSize||"md",fontWeight:r.fontWeight||"medium",color:r.color||"gray-700",children:r.children}),Ne=r=>e.jsx(k.Text,{color:"red-600",fontSize:"sm",children:r.message}),en=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,...o})=>{var i,a,d;const c=o.hideMessageError||!1,s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(le,{condition:!!o.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ce,{children:o.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:r,children:o.title}),e.jsx(ce,{color:"error",fontSize:r,children:l}),e.jsx(le,{condition:!!((i=o.tooltip)!=null&&i.label),children:e.jsx(De.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(le,{condition:!!o.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})})]})}),e.jsxs(u.Box,{direction:"column",gap:"xs",fullWidth:o.inputProps.fullWidth||!1,children:[e.jsx(Ge.Input,{ref:o.inputRef,size:r,...o.inputProps,status:o.errorMessage?"error":"default",fullWidth:!0}),!c&&o.errorMessage&&e.jsx(Ne,{message:o.errorMessage}),o.inputProps.extended&&o.inputProps.extended]})]})},rn=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,...o})=>{var i,a,d;const c=o.hideMessageError||!1,s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",onClick:o.onClickContainer,children:[o.title&&e.jsx(le,{condition:!!o.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ce,{children:o.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:r,children:o.title}),e.jsx(ce,{color:"error",fontSize:r,children:l}),e.jsx(le,{condition:!!((i=o.tooltip)!=null&&i.label),children:e.jsx(De.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(le,{condition:!!o.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})})]})}),e.jsxs(u.Box,{direction:"column",gap:"xs",fullWidth:o.inputProps.fullWidth||!1,children:[e.jsx(u.Box,{direction:"column",style:{width:o.inputProps.fullWidth?"100%":t==="horizontal"&&o.customWidth?o.customWidth:t==="horizontal"?"343px":""},children:e.jsx(rr.Dropdown,{size:r,...o.inputProps,error:!!o.errorMessage})}),!c&&o.errorMessage&&e.jsx(Ne,{message:o.errorMessage}),o.inputProps.extended&&o.inputProps.extended]})]})},tn=(r,t)=>typeof r=="string"&&r||t==="error"?"var(--sa-border-danger)":"var(--sa-border-subtle)",ln=r=>{var i;const[t,l]=h.useState(!1),n=a=>{a.preventDefault(),a.stopPropagation()},o=a=>{a.preventDefault(),a.stopPropagation(),a.dataTransfer&&r.handleOnFileChange(a.dataTransfer.files.item(0))},c=a=>{a.preventDefault(),l(!0)},s=a=>{a.preventDefault(),l(!1)};return e.jsxs(u.Box,{width:"width-full",paddingInline:"md",direction:"row",gap:"sm",align:"center",onClick:r.handleOnClick,onDragOver:n,onDrop:o,onDragEnter:c,onDragLeave:s,paddingBlock:"md",borderRadius:"rounded-md",style:{border:t?"1px solid var(--sa-border-info)":`1px solid ${tn(r.errorMessage,r.status)}`},children:[e.jsx(F.Icon,{name:"Upload",size:"lg",style:{width:30,height:30}}),e.jsxs(ne.Flex,{direction:"column",gap:"xs",children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",children:[e.jsx(k.Text,{fontWeight:"medium",color:"gray-500",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"Click your upload"}),e.jsx(k.Text,{fontWeight:"medium",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"or Drag & Drop"})]}),e.jsx(k.Text,{fontSize:"sm",color:"gray-500",children:(i=r.fileSupports)==null?void 0:i.map(a=>a.toLocaleUpperCase()).join(", ")})]})]})};function on(r){return r.split(" ").map(t=>t[0]).join("").slice(0,2).toUpperCase()}const wl=r=>{const t={day:"2-digit",month:"short",year:"numeric"};return r.toLocaleDateString("id-ID",t)},nn=r=>{const t={Jan:0,Feb:1,Mar:2,Apr:3,Mei:4,Jun:5,Jul:6,Agu:7,Sep:8,Okt:9,Nov:10,Des:11},l=r.split(" ");if(l.length!==3)return null;const n=parseInt(l[0],10),o=t[l[1]],c=parseInt(l[2],10);return isNaN(n)||isNaN(o)||isNaN(c)?null:new Date(c,o,n)};function cn(r,t=!0){if(!r)return"Rp 0";const l=typeof r=="number"?r.toString():r;if(isNaN(Number(l)))return"Rp 0";const n=l.split("."),o=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,"."),c=n.length===2?o+"."+n[1]:o;return t?"Rp"+c:c}String.prototype.toTitleCase=function(){return this.toLowerCase().split(" ").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")},String.prototype.toNumber=function(){return Number(this)};const sn=r=>{const t=r.split(" ");let l=t[0].charAt(0);return t.length>1&&(l+=""+t[1].charAt(0)),l.toUpperCase()};function an(r){const t=typeof r=="string"?new Date(r):r;if(isNaN(t.getTime()))throw new Error("Invalid date format");const l=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0");return`${l}-${n}-${o}`}const dn="sa-admin",He=r=>`var(--${dn}-${r})`,hn={base:{borderColor:He("base-border-color"),textColor:He("base-text-color"),iconColor:He("base-icon-color"),placeholderColor:He("base-placeholder-color")},document:{bgColor:He("document-bg-color")},sidebar:{bgColor:He("sidebar-bg-color"),borderColor:He("sidebar-border-color"),maxWidth:He("sidebar-max-width"),width:He("sidebar-width"),collapseWidth:He("sidebar-collapse-width"),collapseV2Width:He("sidebar-v2-collapse-width")}},fn=24*60*60*1e3,gn=r=>{const t="14px poppins",n=document.createElement("canvas").getContext("2d");n.font=t;const o=n.measureText(r).width;return Number(Math.ceil(o))},un=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,yn=/--+/,pn=/-$/;function Cn(r,t){return JSON.stringify(r)!==JSON.stringify(t)}function bn(r){return/^(?:\+62|62|0)8[1-9][0-9]{7,10}$/.test(r)}function vn(r){return/^[A-Za-z\s]+$/.test(r)}const xn=r=>{const t=/^[0-9]$/,l=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&(r.key==="a"||r.key==="c"||r.key==="v")||!t.test(r.key)&&!l.includes(r.key)&&r.preventDefault()},wn=r=>{const t=/^[0-9]$/,l=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&r.key==="v"||t.test(r.key)&&!l.includes(r.key)&&r.preventDefault()},Dn=r=>{const t=/^[0-9.]$/,l=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&r.key==="v"||!t.test(r.key)&&!l.includes(r.key)&&r.preventDefault()},Sn=r=>un.test(r);function kn(r){return!(yn.test(r)||pn.test(r))}const Bn=r=>{const t=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab","Home","End"];if((r.ctrlKey||r.metaKey)&&["a","c","v","x"].includes(r.key.toLowerCase()))return;const l=r.currentTarget.value;/^[0-9]$/.test(r.key)||r.key==="."&&!l.includes(".")||r.key==="-"&&l.length===0&&!l.includes("-")||t.includes(r.key)||r.preventDefault()},mn=r=>{const t=document.getElementById(r);if(t){const l=t.getBoundingClientRect(),n=window.scrollY+l.top-80;window.scrollTo({top:n,behavior:"smooth"})}};function Fn(r){const t=r.toLowerCase();if(["kb","mb","gb"].find(c=>t.endsWith(c)))return r;const o=Number(r);if(isNaN(o))throw new Error("Invalid size format");return o>=1e6?`${(o/1e6).toFixed(2)}MB`:o>=1e3?`${(o/1e3).toFixed(2)}KB`:`${o}B`}function En(r){const t=r.split("/");return t[t.length-1]}const Mn=r=>{var t,l;return e.jsxs(u.Box,{width:"width-full",paddingInline:"md",height:"height-full",direction:"row",justify:"space-between",align:"center",onClick:r.handleOnClickFile,fullHeight:!0,paddingBlock:"md",id:"file-item",borderRadius:"rounded-md",style:{border:"1px solid var(--sa-border-subtle)",cursor:"pointer"},children:[e.jsxs(ne.Flex,{direction:"row",align:"center",gap:"sm",style:{flex:1,minWidth:0},children:[e.jsx(F.Icon,{name:"DocumentFilled",size:"lg",style:{color:"var(--sa-icon-brand)",width:30,height:30,flexShrink:0}}),e.jsxs(ne.Flex,{direction:"column",style:{minWidth:0,flex:1},children:[e.jsx(k.Text,{fontWeight:"bold",style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:r.defaultFile?En(r.defaultFile.url):(t=r.fileSelected)==null?void 0:t.name}),r.defaultFile?(r.defaultFile.size||r.defaultFile.date)&&e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[r.defaultFile.size&&e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",children:r.defaultFile.size}),r.defaultFile.size&&r.defaultFile.date&&e.jsx(F.Icon,{name:"Dot",size:"xs"}),r.defaultFile.date&&e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:r.defaultFile.date})]}):e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",children:Fn(((l=r.fileSelected)==null?void 0:l.size.toString())||"100000")}),e.jsx(F.Icon,{name:"Dot",size:"xs"}),e.jsx(k.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:wl(new Date)})]})]})]}),e.jsx(P.Button,{size:"xs",variant:"tertiary",tone:"error",type:"button",onClick:n=>{n.stopPropagation(),r.handleOnDeleteFile()},iconLeft:e.jsx(F.Icon,{name:"Trash1"})})]})},Dl=({status:r="default",labelPosition:t="outside-top",...l})=>{var p;const n=h.useRef(null),o=()=>{if(l.defaultFile){window.open(l.defaultFile.url);return}n.current&&n.current.click()},c=ue.useMediaQuery("md"),s=r==="error"||typeof l.errorMessage=="string"&&!!l.errorMessage,i=l.label?e.jsxs(ne.Flex,{direction:"row",align:"center",gap:"xs",children:[e.jsx(k.Text,{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-primary)"},children:l.label}),l.optional&&e.jsx("span",{style:{background:"var(--sa-background-neutral)",border:"1px solid var(--sa-border-subtle)",borderRadius:"4px",padding:"0 8px",fontSize:"10px",fontWeight:500,lineHeight:"18px",color:"var(--sa-text-primary)",display:"inline-flex",alignItems:"center"},children:"Optional"}),l.required&&e.jsx("span",{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-error)"},children:"*"})]}):null,a=l.description?e.jsx(k.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:l.description}):null,d=e.jsxs(e.Fragment,{children:[l.helperText&&e.jsx(k.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:l.helperText}),l.errorText&&r==="error"&&e.jsx(k.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:l.errorText}),l.errorMessage&&!l.errorText&&e.jsx(k.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:l.errorMessage})]}),y=e.jsx("input",{type:"file",style:{display:"none"},ref:n,onChange:x=>{var O;return l.handleOnChangeFile(((O=x.target.files)==null?void 0:O.item(0))||null)},accept:(p=l.fileSupportOption)==null?void 0:p.map(x=>"."+(x==null?void 0:x.toLowerCase())).join(", ")}),C=e.jsxs(u.Box,{direction:"column",fullWidth:!0,style:{minHeight:"69px"},borderRadius:"rounded-md",display:"flex",justify:"center",align:"center",cursor:"pointer",gap:"md",...l.containerProps,children:[y,(l.fileSelected||l.defaultFile)&&e.jsx(Mn,{fileSelected:l.fileSelected,defaultFile:l.defaultFile,handleOnDeleteFile:l.handleOnDeleteFile,handleOnClickFile:o}),!l.fileSelected&&!l.defaultFile&&e.jsx(ln,{fileSupports:l.fileSupportOption,isDesktop:c,errorMessage:s?l.errorText||l.errorMessage||" ":void 0,status:s?"error":"default",handleOnClick:o,handleOnFileChange:l.handleOnChangeFile})]});return t==="outside-left"?e.jsxs(ne.Flex,{direction:"row",align:"flex-start",gap:"sm",style:{width:"100%"},children:[e.jsxs(ne.Flex,{direction:"column",gap:"xs",style:{width:"40%",minWidth:"120px",paddingTop:"10px"},children:[i,a]}),e.jsxs(ne.Flex,{direction:"column",gap:"sm",style:{flex:1,minWidth:0},children:[C,d]})]}):e.jsxs(ne.Flex,{direction:"column",gap:"sm",style:{width:"100%"},children:[i,a,C,d]})},Ln=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,...o})=>{var i,a,d;const c=o.hideMessageError||!1,s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(le,{condition:!!o.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ce,{children:o.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:r,children:o.title}),e.jsx(ce,{color:"error",fontSize:r,children:l}),e.jsx(le,{condition:!!((i=o.tooltip)!=null&&i.label),children:e.jsx(De.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(le,{condition:!!o.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})})]})}),e.jsxs(ne.Flex,{direction:"column",gap:"xs",children:[e.jsx(Dl,{...o.inputProps,status:o.errorMessage?"error":"default"}),!c&&o.errorMessage&&e.jsx(Ne,{message:o.errorMessage})]})]})},Tn=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,required:o=!1,...c})=>{var a,d,y,C;const s=c.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"||t==="horizontal-inline"?"spacing-96":"sm",direction:t==="horizontal"||t==="horizontal-inline"?"row":"column",...c.containerProps,children:[c.title&&e.jsx(le,{condition:!!o,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(ce,{children:c.title}),e.jsx(Te.Body3,{props:{color:"gray-500"},children:c.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:r,children:c.title}),e.jsx(ce,{color:"error",fontSize:r,children:l}),e.jsx(le,{condition:!!((a=c.tooltip)!=null&&a.label),children:e.jsx(De.Tooltip,{label:(d=c.tooltip)==null?void 0:d.label,arrowPosition:(y=c.tooltip)==null?void 0:y.arrowPosition,...c.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(le,{condition:!!c.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:c.description})})]})}),e.jsx(u.Box,{gap:t==="horizontal-inline"?"xl":"md",direction:t==="horizontal-inline"?"row":"column",align:"flex-start",children:e.jsx(Tr,{of:(C=c.checkBoxesList)==null?void 0:C.map(p=>({...p,isChecked:c.checkBoxesAreChecked.includes(p.id)})),render:p=>p.renderBadge?e.jsxs(u.Box,{direction:"row",justify:"space-between",gap:"lg",...c.badgeContainerProps,children:[e.jsx(nr.Checkbox,{name:p.name,value:p.id,checked:p.isChecked,onChange:x=>c.onChecked(x.target.value,p),label:p.name,description:p.description}),p.renderBadge]}):e.jsx(nr.Checkbox,{name:p.name,value:p.id,checked:p.isChecked,onChange:x=>c.onChecked(x.target.value,p),label:p.name,description:p.description})})}),!s&&c.errorMessage&&e.jsx(Ne,{message:c.errorMessage})]})},In=({position:r="vertical",size:t="md",fullWidth:l=!1,...n})=>{var c;const o=r==="horizontal-inline"||r==="horizontal-block"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:r==="horizontal-inline"||r==="horizontal-block"?"spacing-96":"sm",direction:r==="horizontal-inline"||r==="horizontal-block"?"row":"column",children:[e.jsx(le,{condition:!!n.description||!!n.title,children:e.jsxs(u.Box,{direction:"column",customMaxWidth:o,fullWidth:l,children:[n.title&&e.jsx(ce,{children:n.title}),e.jsx(le,{condition:!!n.description,children:e.jsx(k.Text,{color:"gray-500",children:n.description})})]})}),e.jsx(u.Box,{gap:"sm",direction:r==="horizontal"||r==="horizontal-inline"?"row":"column",align:"flex-start",flexWrap:"wrap",children:e.jsx(Tr,{of:(c=n.radioList)==null?void 0:c.map(s=>({...s,isChecked:n.radioIsChecked===s.id})),render:({value:s,id:i,isChecked:a,subInput:d,label:y,description:C})=>e.jsxs(u.Box,{direction:"column",gap:"xs",customMaxWidth:o,children:[e.jsx(jr.Radio,{id:`${i.toString()}-${s}`,name:n.groupName||y,label:y,value:s,checked:a,onChange:p=>n.onChecked({id:i,label:p.target.name,value:p.target.value}),disabled:n.disableAll},i),C&&e.jsx(k.Text,{color:"gray-500",style:{marginLeft:28},children:C}),d]})})}),n.errorMessage&&e.jsx(Ne,{message:n.errorMessage})]})},On=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,...o})=>{var i,a,d;const c=o.hideMessageError||!1,s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(le,{condition:!!o.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ce,{children:o.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:r,children:o.title}),e.jsx(ce,{color:"error",fontSize:r,children:l}),e.jsx(le,{condition:!!((i=o.tooltip)!=null&&i.label),children:e.jsx(De.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(le,{condition:!!o.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})})]})}),e.jsxs(ne.Flex,{direction:"column",gap:"xs",children:[e.jsx(Pr.Textarea,{ref:o.inputRef,size:r,...o.inputProps,status:o.errorMessage?"error":"default"}),!c&&o.errorMessage&&e.jsx(Ne,{message:o.errorMessage})]})]})},Wn=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",required:n=!1,fullWidth:o=!1,...c})=>{var i,a,d;const s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...c.containerProps,children:[c.title&&e.jsx(le,{condition:n,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:o,children:[e.jsx(ce,{children:c.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:c.titleDescription})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:o,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:r,children:c.title}),e.jsx(ce,{color:"error",fontSize:r,children:l}),e.jsx(le,{condition:!!((i=c.tooltip)!=null&&i.label),children:e.jsx(De.Tooltip,{label:(a=c.tooltip)==null?void 0:a.label,arrowPosition:(d=c.tooltip)==null?void 0:d.arrowPosition,...c.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(le,{condition:!!c.titleDescription,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:c.titleDescription})})]})}),e.jsx(or.Toggle,{checked:c.checked,onChange:c.onChange,label:c.label,description:c.description}),c.errorMessage&&e.jsx(Ne,{message:c.errorMessage})]})},An=({variant:r="primary",size:t="md",...l})=>{const n=lr.useColor(),o=s=>{var a,d,y,C,p,x;if(!s)return;const i=l.disabled?"var(--sa-text-disable, #181a198f)":r==="secondary"?"var(--sa-text-subtle, #8c8f97)":r==="secondary-danger"?(d=(a=n==null?void 0:n.computed)==null?void 0:a.red)==null?void 0:d[600]:r==="secondary-primary"?(C=(y=n==null?void 0:n.computed)==null?void 0:y.blue)==null?void 0:C[700]:(x=(p=n==null?void 0:n.computed)==null?void 0:p.gray)==null?void 0:x[50];return e.jsx(F.Icon,{name:s,size:t,style:{color:i}})},c=()=>{var i,a,d,y;if(r!=="secondary-danger"&&r!=="secondary-primary")return l.title;const s={color:l.disabled?"var(--sa-text-disable, #181a198f)":r==="secondary-danger"?(a=(i=n==null?void 0:n.computed)==null?void 0:i.red)==null?void 0:a[600]:(y=(d=n==null?void 0:n.computed)==null?void 0:d.blue)==null?void 0:y[700]};switch(t){case"xs":return e.jsx(Te.Body2,{props:{style:s},children:l.title});case"sm":case"md":return e.jsx(Te.SubH3,{props:{style:s},children:l.title});case"lg":return e.jsx(Te.SubH2,{props:{style:s},children:l.title});default:return l.title}};return e.jsx(P.Button,{fullWidth:!0,disabled:l.disabled,primary:r==="primary",secondary:r==="secondary"||r==="secondary-danger"||r==="secondary-primary",success:r==="success",onClick:l.onClick,type:l.type,iconLeft:o(l.iconLeft),iconRight:o(l.iconRight),size:t,children:c()})},zn=r=>e.jsx(Te.H5,{props:{...r},children:r.title}),Vn=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,...o})=>{var i,a,d;const c=o.hideMessageError||!1,s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",onClick:o.onClickContainer,children:[o.title&&e.jsx(le,{condition:!!o.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ce,{children:o.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:r,children:o.title}),e.jsx(ce,{color:"error",fontSize:r,children:l}),e.jsx(le,{condition:!!((i=o.tooltip)!=null&&i.label),children:e.jsx(De.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(le,{condition:!!o.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})})]})}),e.jsxs(ne.Flex,{direction:"column",gap:"xs",children:[e.jsx(u.Box,{direction:"column",style:{width:t==="horizontal"&&o.customWidth?o.customWidth:t==="horizontal"?"343px":""},children:e.jsx(Qe.StarasiaDate,{size:r,...o.inputProps,status:o.errorMessage?"error":void 0})}),!c&&o.errorMessage&&e.jsx(Ne,{message:o.errorMessage})]})]})};async function Hn(r,t){const l=new Image;l.src=r,await new Promise((c,s)=>{l.onload=c,l.onerror=s});const n=document.createElement("canvas");n.width=t.width,n.height=t.height;const o=n.getContext("2d",{alpha:!0});if(!o)throw new Error("No 2D context");return o.drawImage(l,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise((c,s)=>{n.toBlob(i=>{if(!i)return s("Canvas is empty");const a=new File([i],"cropped.png",{type:"image/png"});c(a)},"image/png")})}const Sl={"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},kl=h.forwardRef(({handleUpload:r,urlImage:t,isUploading:l,croppedImage:n,setCroppedImage:o,size:c="96",aspect:s="1:1",containerProps:i,maxFileSize:a=2,onError:d},y)=>{const C=ue.useMediaQuery("md"),[p,x]=h.useState(!1),[O,b]=h.useState(null),[B,L]=h.useState(!1),[S,z]=h.useState({x:0,y:0}),[w,V]=h.useState(1),[A,D]=h.useState(null);h.useEffect(()=>{t===null&&o(null)},[t]);const M=h.useCallback((R,_)=>{D(_)},[]),N=R=>{var se;const _=(se=R.target.files)==null?void 0:se[0];if(!_)return;const oe=new FileReader;oe.onload=()=>{b(oe.result),L(!0)},oe.readAsDataURL(_)},Q=async()=>{if(!(!O||!A))try{const R=await Hn(O,A);if(a&&R.size>a*1024*1024){d==null||d(`Ukuran file maksimal ${a}MB`);return}r==null||r(R);const _=URL.createObjectURL(R);o(_,R),L(!1)}catch{d==null||d("Gagal memproses gambar")}},q=h.useRef(null),$=()=>{q.current&&q.current.click()};h.useImperativeHandle(y,()=>({openFileDialog:()=>{var R;(R=q.current)==null||R.click()}}));const ie=parseInt(c,10),pe=Sl[s];let te,de;return pe>=1?(de=ie,te=ie*pe):(te=ie,de=ie/pe),e.jsxs(u.Box,{direction:"column",display:"flex",position:"relative",bg:(i==null?void 0:i.bg)||"gray-200",borderStyle:(i==null?void 0:i.borderStyle)||"border-none",borderColor:(i==null?void 0:i.borderColor)||"gray-200",borderWidth:(i==null?void 0:i.borderWidth)||"border-2",borderRadius:(i==null?void 0:i.borderRadius)||"rounded-md",overflow:"overflow-hidden",align:"center",justify:"center",style:{width:i!=null&&i.fullWidth?"100%":`${te}px`,height:i!=null&&i.fullWidth?"auto":`${de}px`,aspectRatio:pe,flexShrink:0},onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),children:[n||t?e.jsx("img",{src:n||t||void 0,alt:"Profile",style:{objectFit:"cover",width:"100%",height:"100%"}}):e.jsx(u.Box,{display:"flex",direction:"column",align:"center",justify:"center",padding:"spacing-4",children:e.jsx(F.Icon,{name:"Image",style:{color:"var(--sa-text-subtle, #8c8f97)",width:Number(c)/2<40?Number(c)/2:40,height:Number(c)/2<40?Number(c)/2:40}})}),e.jsxs(u.Box,{direction:"column",position:"absolute",display:"flex",align:"center",justify:"center",cursor:"pointer",style:{inset:0,backgroundColor:"var(--sa-color-black-alpha-a30, #080f214a)",opacity:p?1:0,transition:"opacity 0.3s ease-in-out"},onClick:$,children:[e.jsx("input",{ref:q,type:"file",accept:"image/*",onChange:N,disabled:l,style:{display:"none"}}),e.jsxs(u.Box,{display:"flex",align:"center",gap:"spacing-2",direction:"row",children:[e.jsx(F.Icon,{name:"Edit3",style:{color:"var(--sa-background-primary, #ffffff)"}}),e.jsx(le,{condition:c.toNumber()>80,children:e.jsx(k.Text,{color:"gray-50",fontSize:c.toNumber()>80?"sm":"md",fontWeight:"medium",children:"Edit Image"})})]})]}),l&&e.jsx(u.Box,{direction:"column",position:"absolute",display:"flex",align:"center",justify:"center",style:{inset:0,zIndex:20,backgroundColor:"var(--sa-color-white-alpha-a80, #e5e9f640)"},children:e.jsx(u.Box,{direction:"column",borderRadius:"rounded-full",style:{animation:"spin 1s linear infinite",border:"2px solid transparent",height:"2rem",width:"2rem"},borderColor:"info-600"})}),B&&Nr.createPortal(e.jsx("div",{style:{position:"fixed",inset:0,zIndex:19999,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.6)"},onClick:()=>L(!1),children:e.jsxs("div",{style:{backgroundColor:"var(--sa-background-primary)",borderRadius:"var(--sa-radii-md)",boxShadow:"0 20px 60px rgba(0,0,0,0.3)",overflow:"hidden",width:C?s==="1:1"?"min(90vw, 480px)":`min(90vw, ${te*2}px)`:"calc(100vw - 2rem)",display:"flex",flexDirection:"column"},onClick:R=>R.stopPropagation(),children:[e.jsx("div",{style:{position:"relative",width:"100%",height:"20rem",backgroundColor:"var(--sa-color-gray-100)"},children:O&&e.jsx(Ll,{image:O,crop:S,zoom:w,aspect:s?Sl[s]:void 0,onCropChange:z,onZoomChange:V,onCropComplete:M,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(P.Button,{size:"sm",secondary:!0,onClick:()=>L(!1),children:"Cancel"}),e.jsx(P.Button,{size:"sm",primary:!0,onClick:Q,children:"Crop"})]})]})}),document.body)]})}),Pn=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,required:o=!1,...c})=>{var a,d,y;const s=c.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...c.containerProps,children:[c.title&&e.jsx(le,{condition:!!o,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(ce,{children:c.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:c.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:r,children:c.title}),e.jsx(ce,{color:"error",fontSize:r,children:l}),e.jsx(le,{condition:!!((a=c.tooltip)!=null&&a.label),children:e.jsx(De.Tooltip,{label:(d=c.tooltip)==null?void 0:d.label,arrowPosition:(y=c.tooltip)==null?void 0:y.arrowPosition,...c.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(le,{condition:!!c.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:c.description})})]})}),e.jsxs(ne.Flex,{direction:"column",gap:"xs",children:[e.jsx(kl,{...c.inputProps}),!s&&c.errorMessage&&e.jsx(Ne,{message:c.errorMessage})]})]})},jn=({size:r="md",direction:t="vertical",requiredTitle:l="(Required)",fullWidth:n=!1,...o})=>{var s,i,a;const c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(le,{condition:!!o.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsx(ce,{children:o.title}),e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:r,children:o.title}),e.jsx(ce,{color:"error",fontSize:r,children:l}),e.jsx(le,{condition:!!((s=o.tooltip)!=null&&s.label),children:e.jsx(De.Tooltip,{label:(i=o.tooltip)==null?void 0:i.label,arrowPosition:(a=o.tooltip)==null?void 0:a.arrowPosition,...o.tooltip,children:e.jsx(F.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(le,{condition:!!o.description,children:e.jsx(k.Text,{fontSize:r,color:"gray-500",children:o.description})})]})}),o.inputProps.extended&&o.inputProps.extended]})},Nn=({items:r,id:t,handleOnUpdate:l,width:n,toggleShow:o=!0,disabled:c=!1})=>{var y;const[s,i]=h.useState([]);h.useEffect(()=>{r&&i([...r.map(C=>({id:C.id,isActive:C.isActive}))])},[r]);const a=(y=s.find(C=>C.id===t))==null?void 0:y.isActive,d=h.useCallback(()=>{i(C=>C.map(p=>p.id===t?{...p,isActive:!p.isActive}:p)),l&&l(!a)},[t,l,a]);return e.jsx(u.Box,{direction:"row",gap:"md",style:{width:n},children:o&&e.jsx(or.Toggle,{disabled:c,checked:a,onChange:d,label:a?"Active":"Inactive"})})},_n={InputText:en,InputDropdown:rn,InputSingleFile:Ln,CheckBoxOptions:Tn,RadioOptions:In,InputTextArea:On,ToggleForm:Wn,ActionButton:An,FormTitle:zn,InputDate:Vn,InputImgFile:Pn,Custom:jn},Bl=({customBottom:r})=>{const[t,l]=h.useState(!1),n=()=>{window.scrollY>window.screenY?l(!0):l(!1)},o=()=>{window.scrollTo({top:0,behavior:"smooth"})};return h.useEffect(()=>(window.addEventListener("scroll",n),()=>{window.removeEventListener("scroll",n)}),[]),e.jsx(u.Box,{direction:"column",style:{position:"fixed",bottom:0,right:0},children:e.jsx(u.Box,{direction:"column",position:"absolute",style:{bottom:r||"1.6rem",right:"2rem",transform:t?"scale(1)":"scale(0)",transition:"transform 0.2s ease-in-out"},children:e.jsx(P.Button,{secondary:!0,size:"xs",onClick:o,type:"button",iconLeft:e.jsx(F.Icon,{width:16,size:"xs",name:"ArrowPullUp",style:{color:"var(--sa-background-brand, #04254f)"}})})})})},qn=({pageLayout:r,children:t,wrapperProps:l,containerProps:n})=>{const o=ue.useMediaQuery("md"),c=(n==null?void 0:n.customWidth)??264;return e.jsxs(u.Box,{display:"block",direction:"row",...l,style:{marginRight:o?c:24,...(l==null?void 0:l.style)??{}},children:[r,e.jsx(u.Box,{direction:"column",show:"desktop",as:"aside",position:"fixed",top:"top-0",bottom:"bottom-0",right:"right-0",customWidth:264,borderStyle:"border-solid-l",borderWidth:"border-l",...n,style:{marginTop:"4rem",backgroundColor:"var(--sa-background-white, #ffffff)",borderColor:"var(--sa-border-subtle, #0b120e24)",...(n==null?void 0:n.style)??{}},children:t})]})},Zn=({children:r,withScrollToTopButton:t=!1,scrollToTopButtonProps:l,containerProps:n})=>e.jsx(u.Box,{direction:"column",position:"absolute",width:"width-full",style:{zIndex:"var(--app-footer-zindex, 999)"},children:e.jsxs(u.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:(n==null?void 0:n.justify)||"flex-end",borderStyle:"border-solid-t",borderWidth:"border-t",children:[t&&e.jsx(Bl,{...l,customBottom:(l==null?void 0:l.customBottom)||"5.7rem"}),r]})}),Gn=({fields:r})=>e.jsx(u.Box,{display:"flex",direction:"column",gap:"lg",children:e.jsx(Tr,{of:r,render:(t,l)=>e.jsx(Qn,{...t},l)})}),Qn=({title:r,value:t,icon:l})=>e.jsxs(u.Box,{display:"flex",direction:"column",gap:"sm",children:[l?e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",gap:"xs",children:[e.jsx(F.Icon,{name:l,color:"subtle"}),e.jsx(k.Text,{color:"gray-500",variant:"sub-h3",children:r})]}):e.jsx(k.Text,{color:"gray-500",variant:"sub-h3",children:r}),typeof t=="string"?e.jsx(k.Text,{variant:"sub-h3",children:t}):t]}),xe={silhouette:"#A7B0AC",accent:"#78867F"};function Un({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r||"100",height:t||"90",viewBox:"0 0 102 90",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M51.0002 16.8145C36.0811 16.8145 24.8296 21.3801 24.8296 27.4328V76.5344C24.8296 82.573 36.0799 87.127 51.0002 87.127C65.9204 87.127 77.1707 82.573 77.1707 76.5344V27.4328C77.1707 21.3801 65.9204 16.8145 51.0002 16.8145ZM51.0002 19.1582C65.0602 19.1582 74.8582 23.5187 74.8582 27.4328C74.8582 30.1363 70.1615 32.9664 63.1708 34.4746C55.861 36.0543 46.1416 36.0543 38.8318 34.4746C31.8399 32.9664 27.1432 30.1363 27.1432 27.4328C27.1432 23.5187 36.9402 19.1582 51.0002 19.1582ZM74.8582 31.9199V43.784C74.8582 46.532 70.3142 49.2941 63.2737 50.8328C63.2391 50.8375 63.2032 50.8434 63.1697 50.8504C57.6867 52.0352 50.8498 52.3305 44.6893 51.7387C42.6358 51.5418 40.6575 51.2453 38.8306 50.8504C38.8029 50.8445 38.7682 50.8387 38.7347 50.8352C32.5707 49.4898 28.318 47.2047 27.3514 44.8141C27.2138 44.4719 27.1421 44.1285 27.1421 43.7852V31.9199C27.1999 31.9715 27.2693 32.0207 27.3294 32.0723C27.5052 32.2246 27.6902 32.3758 27.8844 32.5234C27.9954 32.609 28.1064 32.6934 28.2232 32.7766C28.4371 32.9301 28.6637 33.0801 28.8973 33.2289C29.0083 33.2992 29.1135 33.3719 29.2291 33.441C29.5702 33.6473 29.9275 33.8488 30.3044 34.0434C30.3195 34.0516 30.3333 34.0598 30.3484 34.068C30.7427 34.2707 31.1601 34.4652 31.5925 34.6551C31.7301 34.716 31.8758 34.7734 32.0168 34.832C32.3221 34.9598 32.6331 35.0852 32.9557 35.207C33.1303 35.2727 33.3095 35.3359 33.4887 35.4004C33.8032 35.5117 34.1247 35.6207 34.4542 35.7273C34.6404 35.7871 34.8254 35.8469 35.015 35.9043C35.3734 36.0133 35.7434 36.1164 36.1181 36.2184C36.2915 36.2652 36.4603 36.3145 36.6361 36.3602C37.1911 36.5031 37.7588 36.6402 38.3485 36.7668C42.1595 37.5906 46.5336 38.0254 50.999 38.0254C55.4644 38.0254 59.8397 37.5906 63.6495 36.768C64.2404 36.6402 64.8092 36.5031 65.3666 36.3602C65.5377 36.3156 65.7007 36.2688 65.8684 36.223C66.2499 36.1199 66.6246 36.0145 66.9888 35.9031C67.1749 35.8469 67.3553 35.7883 67.5368 35.7309C67.8745 35.623 68.2028 35.5105 68.5243 35.3969C68.6966 35.3359 68.8677 35.275 69.0353 35.2117C69.3672 35.0863 69.6852 34.9574 69.9985 34.8262C70.1326 34.7699 70.2725 34.7148 70.4032 34.6574C70.8379 34.4664 71.2576 34.2707 71.6542 34.0668C71.66 34.0633 71.6658 34.0609 71.6716 34.0574C72.0589 33.8582 72.4243 33.6508 72.7735 33.441C72.8868 33.3719 72.9909 33.3016 73.1007 33.2313C73.3354 33.0813 73.5632 32.9312 73.7794 32.7766C73.8951 32.6934 74.0049 32.609 74.1159 32.5258C74.3102 32.377 74.4963 32.2258 74.6732 32.0723C74.7322 32.0207 74.8027 31.9727 74.8594 31.9211L74.8582 31.9199ZM74.8582 48.2887V60.1598C74.8582 62.8773 70.3396 65.6359 63.335 67.2004C63.2737 67.2051 63.2136 67.2156 63.1547 67.2285C59.5021 68.016 55.2482 68.4109 50.9955 68.4098C48.8692 68.4098 46.7428 68.3113 44.6917 68.1145C42.6405 67.9176 40.6656 67.6211 38.8399 67.2273C38.7832 67.2133 38.7266 67.2051 38.6699 67.2004C31.663 65.6359 27.1432 62.8785 27.1432 60.1598V48.2887C27.2022 48.3426 27.2739 48.393 27.3352 48.4457C27.5075 48.5945 27.6878 48.7422 27.8763 48.8875C27.9908 48.9754 28.1052 49.0633 28.2255 49.15C28.4348 49.3 28.6568 49.4477 28.8834 49.593C28.999 49.6668 29.1089 49.7418 29.228 49.8145C29.5633 50.0172 29.9136 50.2152 30.2825 50.4074C30.3114 50.4227 30.338 50.4379 30.3669 50.452C30.7507 50.6488 31.1566 50.8398 31.5775 51.0262C31.722 51.0895 31.8746 51.1504 32.0226 51.2125C32.3198 51.3379 32.6227 51.4609 32.9372 51.5793C33.1164 51.6473 33.2991 51.7129 33.4841 51.7785C33.7917 51.8887 34.1073 51.9953 34.4299 52.0996C34.6196 52.1605 34.8092 52.2227 35.0046 52.2812C35.3584 52.3891 35.7238 52.4922 36.0938 52.593C36.2684 52.641 36.4395 52.6902 36.6176 52.7359C37.1714 52.8789 37.738 53.016 38.3253 53.1426C38.3554 53.1496 38.3889 53.1555 38.4236 53.159C42.2161 53.9723 46.5636 54.4023 51.0013 54.4023C55.439 54.4023 59.7784 53.9734 63.5697 53.1613C63.6056 53.1566 63.6414 53.1508 63.6773 53.1426C64.2647 53.0148 64.8312 52.8789 65.3851 52.7359C65.5643 52.6902 65.7342 52.6398 65.9088 52.593C66.2788 52.4922 66.6442 52.3891 66.998 52.2812C67.1934 52.2215 67.3831 52.1605 67.5727 52.0996C67.8953 51.9953 68.2109 51.8887 68.5185 51.7785C68.7023 51.7129 68.8862 51.6473 69.0654 51.5793C69.3799 51.4598 69.6817 51.3367 69.98 51.2125C70.128 51.1504 70.2806 51.0895 70.4252 51.0262C70.846 50.841 71.2507 50.65 71.6357 50.452C71.6646 50.4367 71.6912 50.4215 71.7201 50.4074C72.0901 50.2152 72.4405 50.0172 72.7747 49.8145C72.8949 49.7418 73.0036 49.6668 73.1192 49.593C73.347 49.4477 73.5678 49.3 73.7771 49.15C73.8974 49.0633 74.0118 48.9766 74.1263 48.8875C74.3148 48.7422 74.4952 48.5945 74.6674 48.4457C74.7287 48.393 74.7992 48.3426 74.8582 48.2887ZM74.8582 76.5355C74.8582 80.4367 65.0602 84.7844 51.0002 84.7844C36.9402 84.7844 27.1421 80.4367 27.1421 76.5355V64.6469C27.1987 64.6984 27.2693 64.7477 27.3282 64.7992C27.5028 64.9504 27.6844 65.0992 27.8763 65.2469C27.9873 65.3324 28.0995 65.418 28.2162 65.5023C28.4302 65.6559 28.6568 65.807 28.8892 65.9559C28.9979 66.0262 29.1019 66.0977 29.2152 66.1656C29.5691 66.3801 29.9367 66.591 30.3299 66.7937C30.331 66.7937 30.3322 66.7938 30.3333 66.7961C30.7253 66.9988 31.1404 67.1945 31.5694 67.3855C31.7058 67.4465 31.8515 67.5039 31.9914 67.5637C32.2955 67.6926 32.6054 67.8191 32.928 67.9422C33.1002 68.0078 33.2772 68.0711 33.4541 68.1355C33.7674 68.248 34.0888 68.3582 34.4184 68.466C34.6034 68.5258 34.7872 68.5867 34.9768 68.6453C35.3341 68.7555 35.703 68.8609 36.0764 68.9641C36.2476 69.0109 36.4141 69.0602 36.5887 69.1059C37.1413 69.2512 37.7079 69.3895 38.2941 69.5195C38.3462 69.5312 38.3993 69.5383 38.4514 69.543C42.2369 70.3516 46.5717 70.7793 50.999 70.7793C55.4263 70.7793 59.7599 70.3527 63.5478 69.543C63.5998 69.5383 63.653 69.5312 63.705 69.5195C64.2912 69.3906 64.8578 69.2512 65.4105 69.1059C65.5839 69.0602 65.7493 69.0121 65.9192 68.9652C66.295 68.8621 66.665 68.7555 67.0246 68.6453C67.2131 68.5879 67.3958 68.5281 67.5785 68.4684C67.9092 68.3605 68.2329 68.2492 68.5486 68.1355C68.7231 68.0723 68.8977 68.009 69.0689 67.9445C69.3938 67.8203 69.7071 67.6926 70.0135 67.5625C70.1511 67.5039 70.2933 67.4477 70.4275 67.3879C71.29 67.0047 72.0774 66.5969 72.7851 66.1668C72.8972 66.0988 73.0001 66.0273 73.1088 65.9582C73.3424 65.8082 73.5702 65.657 73.7852 65.5023C73.9008 65.4191 74.0118 65.3336 74.1217 65.2492C74.3148 65.1016 74.4975 64.9516 74.6732 64.7992C74.7322 64.7488 74.8016 64.6996 74.8582 64.648V76.5355Z",fill:xe.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:xe.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:xe.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:xe.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:xe.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:xe.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:xe.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:xe.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:xe.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:xe.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:xe.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:xe.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:xe.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:xe.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:xe.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:xe.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:xe.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:xe.accent,fillOpacity:"0.65"})]})})}const Jn=({title:r="create",children:t,onClickAction:l,variant:n="primary",variantTitle:o,leftIcon:c,showButton:s=!0,customHeight:i,childrenButton:a,customIcon:d})=>{const y=()=>{switch(n){case"primary":return e.jsx(e.Fragment,{children:c?e.jsx(P.Button,{primary:!0,iconLeft:c,onClick:l,children:a||r}):e.jsx(P.Button,{primary:!0,onClick:l,children:a||r})});case"secondary":return e.jsx(e.Fragment,{children:c?e.jsx(P.Button,{secondary:!0,iconLeft:c,onClick:l,children:o?e.jsx(k.Text,{fontFamily:"Poppins",fontSize:"md",fontWeight:"medium",style:{color:"var(--sa-background-success, #28ac6e)"},children:a||r}):r}):e.jsx(P.Button,{secondary:!0,onClick:l,children:a||r})});case"success":return e.jsx(e.Fragment,{children:c?e.jsx(P.Button,{success:!0,iconLeft:c,onClick:l,children:a||r}):e.jsx(P.Button,{success:!0,onClick:l,children:a||r})});default:return e.jsx(e.Fragment,{children:c?e.jsx(P.Button,{primary:!0,iconLeft:c,onClick:l,children:a||r}):e.jsx(P.Button,{primary:!0,onClick:l,children:a||r})})}};return e.jsxs(u.Box,{height:"height-full",display:"flex",direction:"column",gap:"sm",justify:"center",align:"center",marginBlock:"auto",customHeight:i,children:[d||e.jsx(Un,{}),e.jsx(u.Box,{direction:"column",children:t.map((C,p)=>e.jsx(Te.Body1,{props:{align:"center",textAlign:"center"},children:p>2?null:C},p))}),s?y():null]})},Y={c001A72:"#001A72",c64B5F6:"#64B5F6",c98B4CB:"#98B4CB",cBBDEFB:"#BBDEFB",cD0E5F7:"#D0E5F7",cD6EBFD:"#D6EBFD",c000000:"#000000",cFFFFFF:"#FFFFFF"};function Yn({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 622 271",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M32.4375 254.5H612.437",stroke:Y.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"216.562",y:"45.5605",width:"55",height:"20",fill:Y.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"89.7803",width:"46",height:"20",fill:Y.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"111.78",width:"46",height:"20",fill:Y.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"67.7803",width:"46",height:"20",fill:Y.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.5",width:"55",height:"20",fill:Y.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"86.7803",width:"55",height:"20",fill:Y.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"64.7803",width:"55",height:"20",fill:Y.cD6EBFD}),e.jsx("path",{d:"M233.438 165.217C233.438 132.764 239.035 107.198 250.231 88.5189C261.596 69.8396 279.832 60.5 304.938 60.5C330.043 60.5 348.194 69.8396 359.389 88.5189C370.755 107.198 376.438 132.764 376.438 165.217C376.438 198.047 370.755 223.802 359.389 242.481C348.194 261.16 330.043 270.5 304.938 270.5C279.832 270.5 261.596 261.16 250.231 242.481C239.035 223.802 233.438 198.047 233.438 165.217ZM333.69 165.217C333.69 146.16 331.824 131.538 328.092 121.349C324.36 110.972 316.642 105.783 304.938 105.783C293.233 105.783 285.515 110.972 281.783 121.349C278.051 131.538 276.185 146.16 276.185 165.217C276.185 178.047 276.863 188.708 278.22 197.198C279.577 205.5 282.292 212.292 286.363 217.575C290.604 222.67 296.795 225.217 304.938 225.217C313.08 225.217 319.187 222.67 323.258 217.575C327.499 212.292 330.298 205.5 331.655 197.198C333.012 188.708 333.69 178.047 333.69 165.217Z",fill:Y.cD0E5F7}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.4375 235.124V194.28L138.96 60.5H192.466V191.32H215.438V235.124H192.466V249.5H144.563V235.124H50.4375ZM100.862 191.32L147.925 116.143V191.32H100.862Z",fill:Y.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M394.438 235.124V194.28L482.96 60.5H536.466V191.32H559.438V235.124H536.466V249.5H488.563V235.124H394.438ZM444.862 191.32L491.925 116.143V191.32H444.862Z",fill:Y.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{d:"M349.472 171.5H261.64V186.396H349.472V171.5Z",fill:Y.c98B4CB}),e.jsx("path",{d:"M261.64 171.5L244.719 186.396H261.64V171.5Z",fill:Y.c98B4CB}),e.jsx("path",{d:"M363.574 186.396L349.472 171.5V186.396H363.574Z",fill:Y.c98B4CB}),e.jsx("path",{d:"M244.719 200.89V264.5H363.574V200.89M244.719 200.89H233.438L244.719 186.396M244.719 200.89H363.574M363.574 200.89H372.437L363.574 186.396M244.719 186.396L261.64 171.5M244.719 186.396H261.64M363.574 186.396L349.472 171.5M363.574 186.396H349.472M261.64 171.5H349.472M261.64 171.5V186.396M349.472 171.5V186.396M349.472 186.396H261.64",stroke:Y.c000000,strokeWidth:"2"}),e.jsx("rect",{x:"246.438",y:"202.5",width:"116",height:"60",fill:Y.cFFFFFF}),e.jsx("path",{d:"M245.536 187.5H362.959L369.438 198.5H237.438L245.536 187.5Z",fill:Y.cFFFFFF}),e.jsx("path",{d:"M332.438 129.846C332.438 141.175 329.183 152.403 323.949 160.772C318.699 169.168 311.592 174.5 303.938 174.5C296.283 174.5 289.176 169.168 283.926 160.772C278.692 152.403 275.438 141.175 275.438 129.846C275.438 118.458 277.838 109.628 282.543 103.663C287.216 97.7387 294.274 94.5 303.938 94.5C313.601 94.5 320.659 97.7387 325.332 103.663C330.037 109.628 332.438 118.458 332.438 129.846Z",fill:Y.cFFFFFF,stroke:Y.c000000,strokeWidth:"2"}),e.jsx("path",{d:"M281.438 145.5C284.032 154.136 285.762 158.682 290.951 164.591M292.681 166.409C293.624 167.647 295.708 169.591 297.438 170.5",stroke:Y.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M304.438 175C299.54 176.339 297.208 177.876 293.938 182.5M304.438 175C301.183 178.041 299.537 178.883 299.438 182.5M304.438 175C308.173 177.107 309.635 178.834 311.438 182.5",stroke:Y.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M304.936 175.5C303.438 180 302.529 181.628 304.936 186.5",stroke:Y.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M288.178 120.981C289.969 120.93 290.921 121.313 292.167 122.754",stroke:Y.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"291.724",cy:"118.765",r:"3.1027",fill:Y.c000000}),e.jsx("path",{d:"M308.128 122.463C309.123 120.973 309.987 120.418 311.883 120.237",stroke:Y.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"307.681",cy:"118.765",r:"3.1027",fill:Y.c000000}),e.jsx("ellipse",{cx:"297.938",cy:"134.5",rx:"2.5",ry:"2",fill:Y.c000000}),e.jsx("path",{d:"M340.437 97.5L333.438 104.5M333.438 97.5L340.438 104.5",stroke:Y.c001A72,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M265.437 115.5L260.438 120.5M260.438 115.5L265.438 120.5",stroke:Y.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M288.437 87.5L283.438 92.5M283.438 87.5L288.438 92.5",stroke:Y.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M305.437 83.5L298.438 90.5M298.438 83.5L305.438 90.5",stroke:Y.c001A72,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M342.437 145.5L337.438 150.5M337.438 145.5L342.438 150.5",stroke:Y.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"339.938",cy:"111",r:"2.5",fill:Y.c001A72}),e.jsx("circle",{cx:"336.438",cy:"94.5",r:"1",fill:Y.c001A72}),e.jsx("circle",{cx:"347.438",cy:"99.5",r:"1",fill:Y.c001A72}),e.jsx("circle",{cx:"267.438",cy:"109.5",r:"2",fill:Y.c001A72}),e.jsx("circle",{cx:"293.438",cy:"85.5",r:"2",fill:Y.c001A72}),e.jsx("circle",{cx:"339.438",cy:"138.5",r:"2",fill:Y.c001A72}),e.jsx("circle",{cx:"267.438",cy:"150.5",r:"2",fill:Y.c001A72}),e.jsx("circle",{cx:"268.438",cy:"118.5",r:"1",fill:Y.c001A72}),e.jsx("circle",{cx:"260.438",cy:"124.5",r:"1",fill:Y.c001A72})]})})}function Xn({onClick:r}){const t=ue.useMediaQuery("md");return e.jsxs(u.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(Yn,{width:t?600:300}),e.jsx(k.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Page Not Found"}),e.jsx(k.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"Sorry, we couldn't find the page you are looking for"}),r&&e.jsx(P.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const re={c46F16B:"#46F16B",c48504C:"#48504C",c64B5F6:"#64B5F6",c67AEE6:"#67AEE6",c86512B:"#86512B",c956847:"#956847",cBBC3F5:"#BBC3F5",cBBDEFB:"#BBDEFB",cC0B2A2:"#C0B2A2",cC8CEF4:"#C8CEF4",cCABEB1:"#CABEB1",cD5C7BD:"#D5C7BD",cD6D6D6:"#D6D6D6",cD6EBFD:"#D6EBFD",cE5EE80:"#E5EE80",cEE8080:"#EE8080",cEFF3F8:"#EFF3F8",cF4F4F4:"#F4F4F4",cFFFFFF:"#FFFFFF"};function Kn({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 654 258",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{x:"228",y:"55.5",width:"55",height:"20",fill:re.cD6EBFD}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M75 238.124V197.28L163.523 63.5H217.029V194.32H240V238.124H217.029V252.5H169.126V238.124H75ZM125.424 194.32L172.487 119.143V194.32H125.424Z",fill:re.cBBDEFB,fillOpacity:"0.6"}),e.jsxs("g",{clipPath:"url(#clip0_2949_9690)",children:[e.jsx("path",{d:"M334.5 274.5C381.168 274.5 419 227.266 419 169C419 110.734 381.168 63.5 334.5 63.5C287.832 63.5 250 110.734 250 169C250 227.266 287.832 274.5 334.5 274.5Z",fill:re.cEFF3F8,stroke:re.c67AEE6,strokeWidth:"5"}),e.jsx("path",{d:"M413 197.5C411.397 211.835 402.919 230.898 389.361 246.49C375.596 262.32 356.651 274.5 334.496 274.5C311.331 274.5 292.389 261.672 278.878 245.52C265.592 229.638 257.606 210.603 256 197.5H413Z",fill:re.cD5C7BD}),e.jsx("path",{d:"M278.887 211.766H391.104L392.583 222.856C392.687 223.635 392.08 224.328 391.294 224.328H277.961C277.14 224.328 276.525 223.577 276.686 222.773L278.887 211.766Z",fill:re.cCABEB1}),e.jsx("path",{d:"M287.68 218.884L289.354 213.022H378.961L381.473 218.884H287.68Z",fill:re.cC0B2A2}),e.jsx("path",{d:"M381.944 218.803L381.58 212.266H386.385L386.022 218.803H381.944Z",fill:re.c956847,stroke:re.c48504C}),e.jsx("path",{d:"M283.124 218.803L282.768 213.104H287.565L287.209 218.803H283.124Z",fill:re.c956847,stroke:re.c48504C}),e.jsx("path",{d:"M285.902 212.103L284.935 186.306H279.606C278.151 186.306 277.004 187.542 277.113 188.993L278.673 209.79C278.77 211.095 279.857 212.103 281.166 212.103H285.902Z",fill:re.cC8CEF4,stroke:re.c48504C}),e.jsx("path",{d:"M383.256 212.103L384.638 186.306H389.556C391.007 186.306 392.153 187.537 392.05 188.984L390.564 209.782C390.471 211.09 389.382 212.103 388.07 212.103H383.256Z",fill:re.cC8CEF4,stroke:re.c48504C}),e.jsx("path",{d:"M284.497 178.155C284.455 176.194 286.034 174.581 287.996 174.581H381.904C383.895 174.581 385.485 176.24 385.401 178.23L384.066 209.59C383.987 211.463 382.445 212.941 380.569 212.941H288.663C286.759 212.941 285.205 211.419 285.164 209.515L284.497 178.155Z",fill:re.cC8CEF4,stroke:re.c48504C}),e.jsx("path",{d:"M284.845 181.524C284.792 179.279 286.598 177.431 288.844 177.431H380.687C382.948 177.431 384.76 179.304 384.684 181.565L383.774 208.737C383.701 210.893 381.933 212.603 379.776 212.603H289.48C287.307 212.603 285.532 210.869 285.481 208.697L284.845 181.524Z",fill:re.cBBC3F5}),e.jsx("mask",{id:"mask0_2949_9690",maskUnits:"userSpaceOnUse",x:"301",y:"144",width:"68",height:"17",style:{maskType:"luminance"},children:e.jsx("path",{d:"M301 146.5C301 145.395 301.887 144.5 302.98 144.5H367.02C368.114 144.5 369 145.395 369 146.5V160.411H301V146.5Z",fill:re.cFFFFFF})}),e.jsxs("g",{mask:"url(#mask0_2949_9690)",children:[e.jsx("path",{d:"M301 146.191C301 145.257 301.748 144.5 302.671 144.5H356.701C357.624 144.5 358.372 145.257 358.372 146.191V157.949H301V146.191Z",fill:re.cFFFFFF}),e.jsx("path",{d:"M301.336 146.607C301.336 145.673 302.08 144.916 302.999 144.916H367.01C367.929 144.916 368.673 145.673 368.673 146.607V152.523H301.336V146.607Z",fill:re.cD6D6D6}),e.jsx("path",{d:"M368.673 152.523H301.336V174.5H368.673V152.523Z",fill:re.cF4F4F4}),e.jsx("path",{d:"M307.685 150.417C308.607 150.417 309.356 149.66 309.356 148.726C309.356 147.793 308.607 147.036 307.685 147.036C306.762 147.036 306.014 147.793 306.014 148.726C306.014 149.66 306.762 150.417 307.685 150.417Z",fill:re.cEE8080}),e.jsx("path",{d:"M313.532 150.417C314.455 150.417 315.203 149.66 315.203 148.726C315.203 147.793 314.455 147.036 313.532 147.036C312.609 147.036 311.861 147.793 311.861 148.726C311.861 149.66 312.609 150.417 313.532 150.417Z",fill:re.cE5EE80}),e.jsx("path",{d:"M318.546 150.417C319.469 150.417 320.217 149.66 320.217 148.726C320.217 147.793 319.469 147.036 318.546 147.036C317.623 147.036 316.875 147.793 316.875 148.726C316.875 149.66 317.623 150.417 318.546 150.417Z",fill:re.c46F16B})]}),e.jsx("path",{d:"M301.16 146C301.16 145.172 301.832 144.5 302.66 144.5H367.33C368.159 144.5 368.83 145.172 368.83 146V174.419H301.16V146Z",stroke:re.c48504C}),e.jsx("path",{d:"M395.29 207.579H423.344M354.255 236.889H369.329M327.038 222.234H347.556M350.905 222.234H358.024M288.097 230.19H304.846M253.344 210.091H272.605M278.467 246.938H295.216M297.309 246.938H303.59M337.088 252.801H354.255",stroke:re.c86512B,strokeWidth:"2",strokeLinecap:"round"})]}),e.jsx("path",{d:"M430.241 125.78C430.987 105.807 437.521 90.4065 449.841 79.5799C462.161 68.7532 478.867 63.3398 499.961 63.3398C513.961 63.3398 525.907 65.7665 535.801 70.6199C545.881 75.4732 553.441 82.0998 558.481 90.4998C563.707 98.8998 566.321 108.327 566.321 118.78C566.321 131.1 563.241 141.18 557.081 149.02C550.921 156.673 543.734 161.9 535.521 164.7V165.82C546.161 169.367 554.561 175.247 560.721 183.46C566.881 191.673 569.961 202.22 569.961 215.1C569.961 226.673 567.254 236.94 561.841 245.9C560.436 248.258 558.849 250.481 557.081 252.569L443.5 252.662C432.5 241 427.721 230.5 427.721 207.82H474.201C474.387 216.033 476.721 222.567 481.201 227.42C485.681 232.087 492.214 234.42 500.801 234.42C508.081 234.42 513.681 232.367 517.601 228.26C521.707 223.967 523.761 218.367 523.761 211.46C523.761 202.5 520.867 196.06 515.081 192.14C509.481 188.033 500.427 185.98 487.921 185.98H478.961V147.06H487.921C497.441 147.06 505.094 145.473 510.881 142.3C516.854 138.94 519.841 133.06 519.841 124.66C519.841 117.94 517.974 112.713 514.241 108.98C510.507 105.247 505.374 103.38 498.841 103.38C491.747 103.38 486.427 105.527 482.881 109.82C479.521 114.113 477.561 119.433 477.001 125.78H430.241Z",fill:re.cBBDEFB,fillOpacity:"0.6"}),e.jsx("rect",{x:"43",y:"87.5",width:"46",height:"20",fill:re.cD6EBFD}),e.jsx("rect",{x:"29",y:"109.5",width:"46",height:"20",fill:re.cD6EBFD}),e.jsx("rect",{x:"29",y:"65.5",width:"46",height:"20",fill:re.cD6EBFD}),e.jsx("rect",{x:"356",y:"0.5",width:"55",height:"20",fill:re.cD6EBFD}),e.jsx("rect",{x:"572",y:"142.5",width:"55",height:"20",fill:re.cD6EBFD}),e.jsx("rect",{x:"589",y:"120.5",width:"55",height:"20",fill:re.cD6EBFD}),e.jsx("path",{d:"M3 255.5L651 255.5",stroke:re.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_2949_9690",children:e.jsx("rect",{width:"179",height:"192",fill:re.cFFFFFF,transform:"translate(246 60.5)"})})})]})})}function $n({onClick:r}){const t=ue.useMediaQuery("md");return e.jsxs(u.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(Kn,{width:t?600:300}),e.jsx(k.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",children:"We Are Sorry ..."}),r&&e.jsx(P.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const f={c000D58:"#000D58",c001174:"#001174",c28AC6E:"#28AC6E",c48504C:"#48504C",c64B5F6:"#64B5F6",c90CAF9:"#90CAF9",cC9184A:"#C9184A",cD6D6D6:"#D6D6D6",cD6EBFD:"#D6EBFD",cD9D9D9:"#D9D9D9",cDEECF8:"#DEECF8",cE7EAE9:"#E7EAE9",cF3F8FD:"#F3F8FD",cFFE18B:"#FFE18B",cFFFFFF:"#FFFFFF"};function Rn({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 622 287",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M406.562 180.997C406.562 148.544 412.16 122.978 423.356 104.299C434.721 85.6199 452.957 76.2803 478.063 76.2803C503.168 76.2803 521.319 85.6199 532.514 104.299C543.88 122.978 549.562 148.544 549.562 180.997C549.562 213.827 543.88 239.582 532.514 258.261C521.319 276.941 503.168 286.28 478.063 286.28C452.957 286.28 434.721 276.941 423.356 258.261C412.16 239.582 406.562 213.827 406.562 180.997ZM506.815 180.997C506.815 161.941 504.949 147.318 501.217 137.129C497.485 126.752 489.767 121.563 478.063 121.563C466.358 121.563 458.64 126.752 454.908 137.129C451.176 147.318 449.31 161.941 449.31 180.997C449.31 193.827 449.988 204.488 451.345 212.978C452.703 221.28 455.417 228.073 459.488 233.356C463.729 238.45 469.92 240.997 478.063 240.997C486.205 240.997 492.312 238.45 496.383 233.356C500.624 228.073 503.423 221.28 504.78 212.978C506.137 204.488 506.815 193.827 506.815 180.997Z",fill:f.cD6EBFD}),e.jsx("path",{d:"M246.562 180.558C246.562 148.105 252.16 122.539 263.356 103.86C274.721 85.1804 292.957 75.8408 318.063 75.8408C343.168 75.8408 361.319 85.1804 372.514 103.86C383.88 122.539 389.562 148.105 389.562 180.558C389.562 213.388 383.88 239.143 372.514 257.822C361.319 276.501 343.168 285.841 318.063 285.841C292.957 285.841 274.721 276.501 263.356 257.822C252.16 239.143 246.562 213.388 246.562 180.558ZM346.815 180.558C346.815 161.501 344.949 146.879 341.217 136.69C337.485 126.313 329.767 121.124 318.063 121.124C306.358 121.124 298.64 126.313 294.908 136.69C291.176 146.879 289.31 161.501 289.31 180.558C289.31 193.388 289.988 204.048 291.345 212.539C292.702 220.841 295.417 227.633 299.488 232.916C303.729 238.011 309.92 240.558 318.063 240.558C326.205 240.558 332.312 238.011 336.383 232.916C340.624 227.633 343.423 220.841 344.78 212.539C346.137 204.048 346.815 193.388 346.815 180.558Z",fill:f.cD6EBFD}),e.jsx("path",{d:"M222.808 118.703H128.062V159.858C132.111 155.484 137.779 151.905 145.067 149.122C152.356 146.338 160.251 144.946 168.754 144.946C183.938 144.946 196.49 148.326 206.41 155.086C216.532 161.846 223.922 170.594 228.578 181.329C233.234 192.065 235.562 203.696 235.562 216.221C235.562 239.483 228.882 257.972 215.52 271.691C202.158 285.21 183.357 282.89 159.062 282.89C142.867 282.89 131.098 284.939 116.826 283.918C104.881 278.351 95.6695 270.697 89.1911 260.955C82.7127 251.213 79.1698 239.98 78.5625 227.256H129.276C130.491 233.419 133.426 238.588 138.083 242.763C142.739 246.739 149.116 248.728 157.214 248.728C166.729 248.728 173.815 245.745 178.472 239.781C183.128 233.817 185.456 225.864 185.456 215.923C185.456 206.181 183.027 198.726 178.168 193.557C173.309 188.387 166.223 185.803 156.911 185.803C150.027 185.803 144.359 187.493 139.905 190.873C135.451 194.054 132.515 198.328 131.098 203.696H80.9919V73.9697H222.808V118.703Z",fill:f.cD6EBFD}),e.jsx("rect",{x:"216.562",y:"45.7803",width:"55",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"90",width:"46",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"112",width:"46",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"68",width:"46",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.719727",width:"55",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"87",width:"55",height:"20",fill:f.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"65",width:"55",height:"20",fill:f.cD6EBFD}),e.jsx("path",{d:"M25.8125 282.22H605.812",stroke:f.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"263.012",y:"175.42",width:"104.6",height:"31.2833",rx:"3.3",fill:f.cFFFFFF,stroke:f.c001174,strokeWidth:"1.4"}),e.jsx("path",{d:"M269.878 200.539C269.878 200.263 270.101 200.039 270.377 200.039L305.476 199.955C305.753 199.955 305.978 200.179 305.978 200.455V206.461H269.878V200.539Z",stroke:f.c001174}),e.jsx("rect",{x:"263.012",y:"210.752",width:"104.6",height:"31.2833",rx:"3.3",fill:f.cFFFFFF,stroke:f.c001174,strokeWidth:"1.4"}),e.jsx("path",{d:"M269.878 235.871C269.878 235.595 270.101 235.372 270.377 235.371L305.476 235.288C305.753 235.287 305.978 235.511 305.978 235.788V241.794H269.878V235.871Z",stroke:f.c001174}),e.jsx("rect",{x:"263.012",y:"246.969",width:"104.6",height:"31.2833",rx:"3.3",fill:f.cFFFFFF,stroke:f.c001174,strokeWidth:"1.4"}),e.jsx("path",{d:"M269.878 272.088C269.878 271.812 270.101 271.589 270.377 271.588L305.476 271.505C305.753 271.504 305.978 271.728 305.978 272.005V278.011H269.878V272.088Z",stroke:f.c001174}),e.jsx("path",{d:"M279.095 176.348H364.373C365.459 176.348 366.125 176.992 366.986 178.252V202.985C366.986 202.985 366.986 203.869 366.545 204.752C366.103 205.635 365.661 206.077 365.661 206.077L306.478 206.163V199.452L279.095 199.518V176.348Z",fill:f.cF3F8FD}),e.jsx("path",{d:"M279.095 211.093H364.373C365.459 211.093 366.125 211.736 366.986 212.997V237.73C366.986 237.73 366.986 238.613 366.545 239.497C366.103 240.38 365.661 240.822 365.661 240.822L306.478 240.908V234.197L279.095 234.262V211.093Z",fill:f.cF3F8FD}),e.jsx("path",{d:"M279.095 248.008H364.373C365.459 248.008 366.125 248.652 366.986 249.912V274.646C366.986 274.646 366.986 275.529 366.545 276.412C366.103 277.296 365.661 277.737 365.661 277.737L306.478 277.824V271.112L279.095 271.178V248.008Z",fill:f.cF3F8FD}),e.jsx("circle",{cx:"270.258",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"179.136",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"181.786",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"200.336",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"202.986",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"4.45833",stroke:f.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"2.20833",fill:f.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"186.553",width:"36.4",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"214.468",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"217.118",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"235.668",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"238.318",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"4.45833",stroke:f.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"2.20833",fill:f.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"221.885",width:"36.4",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"250.685",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"253.335",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"271.885",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"274.535",r:"0.883333",fill:f.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"4.45833",stroke:f.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"2.20833",fill:f.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"258.102",width:"36.4",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:f.cE7EAE9,stroke:f.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"270.261",y:"200.336",width:"8.83333",height:"6.18333",fill:f.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"235.668",width:"8.83333",height:"6.18333",fill:f.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"271.885",width:"8.83333",height:"6.18333",fill:f.cFFFFFF}),e.jsx("rect",{x:"279.095",y:"200.336",width:"26.5",height:"6.18333",fill:f.cDEECF8}),e.jsx("rect",{x:"279.095",y:"235.668",width:"26.5",height:"6.18333",fill:f.cDEECF8}),e.jsx("rect",{x:"279.095",y:"271.885",width:"26.5",height:"6.18333",fill:f.cDEECF8}),e.jsx("path",{d:"M268.053 210.494C268.483 209.112 268.564 208.343 268.053 206.961H362.569C361.955 208.363 361.972 209.136 362.569 210.494H268.053Z",fill:f.c000D58,stroke:f.c001174}),e.jsx("path",{d:"M268.053 246.269C268.483 244.887 268.564 244.118 268.053 242.736H362.569C361.955 244.138 361.972 244.911 362.569 246.269H268.053Z",fill:f.c000D58,stroke:f.c001174}),e.jsx("path",{d:"M283.312 130.775C283.312 129.64 283.987 128.72 284.82 128.72H349.805C350.638 128.72 351.312 129.64 351.312 130.775V169.72H283.312V130.775Z",fill:f.cFFFFFF,stroke:f.c48504C,strokeWidth:"2"}),e.jsx("path",{d:"M279.574 171.847C279.381 171.283 279.267 170.624 279.33 169.72H355.195C355.423 170.925 355.287 171.695 355.063 172.241C354.834 172.802 354.506 173.186 354.101 173.66C354.084 173.68 354.067 173.7 354.05 173.72H280.503C280.468 173.658 280.434 173.598 280.4 173.539C280.051 172.922 279.774 172.434 279.574 171.847Z",stroke:f.c48504C,strokeWidth:"2"}),e.jsx("path",{d:"M350.312 133.72V129.726L284.812 129.72C284.312 129.726 284.312 129.726 284.312 130.125V133.72H350.312Z",fill:f.cD6D6D6}),e.jsx("circle",{cx:"287.212",cy:"131.62",r:"0.9",fill:f.c28AC6E}),e.jsx("circle",{cx:"289.812",cy:"131.62",r:"0.9",fill:f.cC9184A}),e.jsx("circle",{cx:"292.412",cy:"131.62",r:"0.9",fill:f.cFFE18B}),e.jsx("rect",{x:"315.312",y:"133.72",width:"35",height:"35",fill:f.c90CAF9}),e.jsx("path",{d:"M319.312 153.22H341.312",stroke:f.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 150.72H310.312",stroke:f.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 156.22H336.312",stroke:f.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 153.72H305.312",stroke:f.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 159.22H336.312",stroke:f.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 156.72H305.312",stroke:f.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M337.312 139.72L328.312 148.72M328.313 139.72L337.313 148.72",stroke:f.cFFFFFF,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function ec({onClick:r}){const t=ue.useMediaQuery("md");return e.jsxs(u.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",overflow:"overflow-hidden",children:[e.jsx(Rn,{width:t?600:300}),e.jsx(k.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Server Problem"}),e.jsx(k.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"we are trying to fix the problem"}),r&&e.jsx(P.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const rc=r=>{var l,n,o,c,s;const t=ue.useMediaQuery("md");return e.jsxs(Le.Dialog,{isShow:r.isShow,onHide:r.onHide,style:{...t?{minWidth:r.customMinWidth||"458px"}:{maxWidth:r.customMinWidth||"458px"}},children:[e.jsx(Le.DialogTitle,{...r.dialogTitleProps,children:typeof r.title=="string"?e.jsx(k.Text,{fontSize:"lg",fontWeight:"medium",children:r.title}):r.title}),e.jsx(Le.DialogBody,{children:typeof r.description=="string"?e.jsx(k.Text,{fontSize:"md",lineHeight:"leading-6",color:"brand",children:r.description}):r.description}),e.jsx(Le.DialogFooter,{children:e.jsx(u.Box,{display:"flex",direction:((l=r.containerConfirmBtnProps)==null?void 0:l.direction)||"row",justify:((n=r.containerConfirmBtnProps)==null?void 0:n.justify)||"flex-end",...r.containerConfirmBtnProps,children:e.jsxs(u.Box,{display:"flex",direction:((o=r.wrapperConfirmBtnProps)==null?void 0:o.direction)||"row",justify:((c=r.wrapperConfirmBtnProps)==null?void 0:c.justify)||"flex-end",gap:((s=r.wrapperConfirmBtnProps)==null?void 0:s.gap)||"sm",...r.wrapperConfirmBtnProps,children:[r.onCancel&&e.jsx(P.Button,{secondary:!0,onClick:r.onCancel,size:"md",fullWidth:!0,children:r.titleCancelBtn||"Cancel"}),e.jsx(u.Box,{direction:"column",fullWidth:!0,style:{textWrap:"nowrap"},children:e.jsx(P.Button,{...r.buttonConfirmProps,onClick:r.onConfirm,size:"md",fullWidth:!0,children:r.titleConfirmBtn||"Ok"})})]})})})]},r.key)},tc=h.memo(({children:r,height:t,minHeight:l,customHeight:n,paddingInline:o="spacing-0",paddingBlock:c="spacing-0",header:s,footer:i,title:a,titleTag:d,action:y,actionContainer:C,containerProps:p,bodyProps:x,headerProps:O={borderBottom:!0},footerProps:b={borderTop:!0},variantTag:B="info"})=>{const L=h.useRef(null),[S,z]=h.useState("100vh");h.useEffect(()=>{const D=()=>{if(L.current){const M=L.current.getBoundingClientRect().top;z(`calc(100vh - ${M}px)`)}};return D(),window.addEventListener("resize",D),()=>window.removeEventListener("resize",D)},[]);const w=()=>d?e.jsxs(u.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(k.Text,{fontWeight:"medium",children:a}),e.jsx(Ze.Badges,{border:!0,text:d,variant:B})]}):e.jsx(k.Text,{fontWeight:"medium",children:a}),V=()=>s||e.jsxs(u.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(u.Box,{direction:"column",children:a?w():null}),e.jsx(u.Box,{direction:"column",...C,children:y??null})]}),A=!!(s||a||y);return e.jsxs(u.Box,{ref:L,height:t,customMinHeight:l,customHeight:n,paddingBlock:c,paddingInline:o,bg:"white",direction:"column",...p,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",display:"flex",minHeight:S,...(p==null?void 0:p.style)??{}},children:[s!==null&&A?e.jsx(Yr,{...O,children:V()}):null,e.jsx(u.Box,{direction:"column",padding:"spacing-0",...x,style:{flex:1,overflow:"auto",...(x==null?void 0:x.style)??{}},children:r}),i?e.jsx(Xr,{...b,children:i}):null]})}),lc=h.memo(({value:r,options:t=[],onChange:l,multiple:n})=>{const o=(r==null?void 0:r.map(i=>i.value))||[],c=(t==null?void 0:t.filter(i=>o.includes(i.value)))||[],s=i=>{const a=[...c];let d=[];n?d=o.includes(i.value)?a.filter(y=>y.value!==i.value):[...a,i]:d=[i],l==null||l(d)};return e.jsx(u.Box,{direction:"row",gap:"sm",flexWrap:"wrap",children:t==null?void 0:t.map((i,a)=>e.jsx(P.Button,{...o.includes(i.value)?{primary:!0}:{secondary:!0},onClick:()=>s(i),children:i.label},a))})});function Ir(r){return null}Ir.displayName="LayoutDialog.Header";function Or(r){return null}Or.displayName="LayoutDialog.Body";function Wr(r){return null}Wr.displayName="LayoutDialog.Aside";function Ar(r){return null}Ar.displayName="LayoutDialog.Footer";const Se={"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"},oc=[{mode:"sidebar",label:"Sidebar",icon:e.jsx(cc,{})},{mode:"modal",label:"Modal",icon:e.jsx(F.Icon,{name:"Newscreen",size:"sm"})},{mode:"fullscreen",label:"Fullscreen",icon:e.jsx(F.Icon,{name:"Fullscreen",size:"sm"})}];function nc({value:r,onChange:t}){return e.jsx("div",{className:Se["lyd-vm-group"],role:"group","aria-label":"View mode",children:oc.map(l=>e.jsx("button",{type:"button",className:Se["lyd-vm-btn"],"data-active":r===l.mode,"aria-label":`Switch to ${l.label} view`,"aria-pressed":r===l.mode,onClick:()=>t(l.mode),children:l.icon},l.mode))})}function cc(){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 ct={md:"768px",lg:"1024px",xl:"1200px","2xl":"1440px"};function ic(r){return r?r in ct?ct[r]:r:ct.xl}function zr(r,t){let l=null;return h.Children.forEach(r,n=>{h.isValidElement(n)&&n.type===t&&(l=n.props.children??null)}),l}function sc(r){const{isOpen:t,onClose:l,viewMode:n,defaultViewMode:o="modal",onViewModeChange:c,showViewModeToggle:s=!0,showCloseButton:i=!0,size:a,asideWidth:d,disableEscapeClose:y=!1,disableBackdropClose:C=!1,lockBodyScroll:p=!0,children:x}=r,[O,b]=h.useState(o),B=n??O,S=ue.useMediaQuery("md")?B:"fullscreen",z=h.useCallback($=>{n===void 0&&b($),c==null||c($)},[n,c]),w=h.useRef(null);h.useEffect(()=>{if(!(!t||!p))return w.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=w.current??""}},[t,p]),h.useEffect(()=>{if(!t||y)return;const $=ie=>{ie.key==="Escape"&&l()};return window.addEventListener("keydown",$),()=>window.removeEventListener("keydown",$)},[t,y,l]);const V=h.useMemo(()=>zr(x,Ir),[x]),A=h.useMemo(()=>zr(x,Or),[x]),D=h.useMemo(()=>zr(x,Wr),[x]),M=h.useMemo(()=>zr(x,Ar),[x]);if(!t)return null;const N=[Se["lyd-panel"],S==="modal"&&Se["lyd-modal"],S==="fullscreen"&&Se["lyd-fullscreen"],S==="sidebar"&&Se["lyd-sidebar"]].filter(Boolean).join(" "),Q={"--lyd-max-w":ic(a),...d!==void 0&&{"--lyd-aside-w":d}},q=()=>{C||l()};return e.jsxs("div",{className:Se["lyd-root"],style:Q,role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:Se["lyd-backdrop"],onClick:q,"aria-hidden":"true"}),e.jsxs("div",{className:N,children:[e.jsxs("div",{className:Se["lyd-header"],children:[e.jsx("div",{className:Se["lyd-header-content"],children:V}),e.jsxs("div",{className:Se["lyd-header-actions"],children:[s&&e.jsx(nc,{value:B,onChange:z}),i&&e.jsx("button",{type:"button",className:Se["lyd-close-btn"],onClick:l,"aria-label":"Close dialog",children:e.jsx(F.Icon,{name:"Cross",size:"md"})})]})]}),e.jsxs("div",{className:Se["lyd-main"],children:[e.jsx("div",{className:Se["lyd-body"],children:A}),D&&e.jsx("aside",{className:Se["lyd-aside"],children:D})]}),M&&e.jsx("div",{className:Se["lyd-footer"],children:M})]})]})}const yr=sc;yr.Header=Ir,yr.Body=Or,yr.Aside=Wr,yr.Footer=Ar;function ac({url:r,filename:t,onClose:l}){return h.useEffect(()=>{const n=o=>{o.key==="Escape"&&l()};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[l]),e.jsxs("div",{onClick:l,style:{position:"fixed",inset:0,zIndex:9999,backgroundColor:"rgba(0,0,0,0.85)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"12px"},children:[e.jsxs("div",{onClick:n=>n.stopPropagation(),style:{position:"absolute",top:"16px",right:"16px",display:"flex",gap:"8px"},children:[e.jsx("a",{href:r,download:t,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 12px",backgroundColor:"rgba(255,255,255,0.15)",color:"#fff",borderRadius:"var(--sa-radii-sm, 6px)",fontSize:"13px",textDecoration:"none",backdropFilter:"blur(4px)"},children:"Download"}),e.jsx("button",{onClick:l,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",backgroundColor:"rgba(255,255,255,0.15)",border:"none",borderRadius:"var(--sa-radii-sm, 6px)",color:"#fff",cursor:"pointer",backdropFilter:"blur(4px)"},"aria-label":"Close preview",children:"✕"})]}),e.jsx("img",{src:r,alt:t,onClick:n=>n.stopPropagation(),style:{maxWidth:"90vw",maxHeight:"85vh",objectFit:"contain",borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"var(--sa-shadow-lg, 0 25px 50px rgba(0,0,0,0.5))"}}),e.jsx("span",{style:{color:"rgba(255,255,255,0.6)",fontSize:"12px"},children:t})]})}const dc=r=>{const{defaultTab:t=0,paramKey:l="tab"}=r||{},[n,o]=ye.useSearchParams(),c=tr.searchParamsToObject(n.toString());return{activeTab:c[l]?parseInt(c[l]):t,handleTabChange:a=>{o({...c,[l]:a.toString()})},searchQueries:c}};function hc({appName:r,menuConfig:t,formatTitle:l}){const n=ye.useLocation();h.useEffect(()=>{let o=null,c=null;for(const a of t){const d=a.items.find(y=>y.to?y.to==="/"?n.pathname==="/":!!(y.to===n.pathname||n.pathname.startsWith(y.to+"/")):!1);if(d){o=d,c=a;break}}const s=[];o!=null&&o.title&&s.push(o.title),c!=null&&c.name&&s.push(c.name.toTitleCase());const i=(a,d)=>a.length>0?`${a.join(" - ")} | ${d}`:d;document.title=(l||i)(s,r)},[n.pathname])}const fc=()=>{const[r,t]=ye.useSearchParams(),l=tr.searchParamsToObject(r.toString()),n=ye.useParams(),o=ye.useLocation(),c=n.id;return{setSearchParams:t,searchParams:r,searchQueries:l,isHasQuery:(y,C)=>r.has(y)&&r.get(y)===C,getQueryParam:y=>r.get(y),getRouteParam:y=>n[y],params:n,location:o,id:c,hasId:!!c}};function gc(r){var n,o;const t=r.decodedAccessToken;return h.useMemo(()=>{var a,d;const c=((d=(a=t==null?void 0:t.access)==null?void 0:a.role)==null?void 0:d.code)??"",s=Object.keys(r.role).reduce((y,C)=>{const p=`is${C.toLowerCase().replace(/(^\w|_\w)/g,x=>x.replace("_","").toUpperCase())}`;return{...y,[p]:!1}},{});return{...Object.keys(r.role).reduce((y,C)=>{const p=`is${C.toLowerCase().replace(/(^\w|_\w)/g,x=>x.replace("_","").toUpperCase())}`;return{...y,[p]:c===r.role[C]}},s),hasRole:y=>c===r.role[y],getRoleKey:()=>c}},[(o=(n=t==null?void 0:t.access)==null?void 0:n.role)==null?void 0:o.code,r])}g.AdvanceFilterBar=Kt,g.App=Il,g.AppComponent=mt,g.AppContext=_r,g.AppLayout=zl,g.AsideBar=qn,g.BackButton=Hl,g.ColumnFilterDropdown=ul,g.ColumnMenu=bl,g.ConfirmationDialog=rc,g.DataTable=pl,g.DecisionWrapper=le,g.EachUtils=Tr,g.EmptyStatePage=Jn,g.FilterBar=Oo,g.FilterDrawer=Xt,g.FloatingFooter=Zn,g.ForbiddenPage=$n,g.Form=_n,g.FullSection=tc,g.HeaderLeftSlot=Ol,g.HeaderLeftSlotOutlet=Mt,g.HeaderLeftSlotProvider=Et,g.HorizontalField=ql,g.ImagePreview=ac,g.InputFile=Dl,g.InputImage=kl,g.LayoutDialog=yr,g.LayoutDialogAside=Wr,g.LayoutDialogBody=Or,g.LayoutDialogFooter=Ar,g.LayoutDialogHeader=Ir,g.ModuleSwitcher=Pl,g.ModuleSwitcherModal=Nt,g.NotFoundPage=Xn,g.PageLayout=Ql,g.Pressable=xr,g.RightDrawer=qt,g.ScrollToTopButton=Bl,g.Section=Xl,g.SectionFooter=Xr,g.SectionHeader=Yr,g.SelectButton=lc,g.ServerErrorPage=ec,g.SidebarBadgesProvider=kt,g.SidebarGroupSlot=Wl,g.SidebarGroupSlotOutlet=Tt,g.SidebarGroupSlotProvider=Lt,g.SidebarHeaderSlot=Ft,g.TableFooter=gl,g.TableHeader=fl,g.TableLayout=$o,g.TableSection=Qo,g.TableWrapper=hl,g.ToggleStatus=Nn,g.Typography=Te,g.VerticalField=Gn,g.clearModuleSelection=Al,g.createInitialFromUserName=on,g.cssVars=hn,g.expandDateCompact=jo,g.formHasChanged=Cn,g.formatDate=an,g.formatDateToIndonesian=wl,g.formatRupiah=cn,g.getDateFilterValue=Yt,g.getDateRangeFilterValue=eo,g.getInitials=sn,g.getValueDropdownMultipleFilter=Jt,g.getValueRadioFilter=Rl,g.getValueSearch=Dr,g.getValuesFilter=wr,g.handleChangeFilter=gr,g.handleOnScroll=mn,g.isEmail=Sn,g.isFilterActive=ro,g.isOnlyLettersAndSpaces=vn,g.isPhoneNumber=bn,g.isSlug=kn,g.localStorageAdapter=$r,g.oneDayInMs=fn,g.parseIndonesianDateToDate=nn,g.preventNonCoordinateInput=Bn,g.preventNonNumberAndDecimalInput=Dn,g.preventNonNumberInput=xn,g.preventNumberInput=wn,g.resolveDateRangeValueToString=Qt,g.resolveDateValueToString=Ut,g.resolveDropdownValueToString=Zt,g.resolveRadioValueToString=Gt,g.resolveSidebarBadge=Cr,g.storageKeys=cr,g.textWidth=gn,g.useApp=qr,g.useAppState=Dt,g.useAuthRole=gc,g.useDynamicTitle=hc,g.useFilterBarApiParams=Vo,g.useFilterBarControls=Po,g.useModuleSelection=Ur,g.useRouteInfo=ke,g.useRouteParams=fc,g.useSidebarBadges=Bt,g.useTabState=dc,g.useTableSortApiParams=Ro,Object.keys(Re).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Re[r]})}),Object.keys(Ze).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ze[r]})}),Object.keys(u).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>u[r]})}),Object.keys(er).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>er[r]})}),Object.keys(P).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>P[r]})}),Object.keys(gt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>gt[r]})}),Object.keys(Qe).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Qe[r]})}),Object.keys(Le).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Le[r]})}),Object.keys(pr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>pr[r]})}),Object.keys(rr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>rr[r]})}),Object.keys(ue).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>ue[r]})}),Object.keys(tr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>tr[r]})}),Object.keys(Ge).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ge[r]})}),Object.keys(I).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>I[r]})}),Object.keys(hr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>hr[r]})}),Object.keys(fr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>fr[r]})}),Object.keys(J).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>J[r]})}),Object.keys(ut).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>ut[r]})}),Object.keys(Pr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Pr[r]})}),Object.keys(lr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>lr[r]})}),Object.keys(yt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>yt[r]})}),Object.keys(or).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>or[r]})}),Object.keys(De).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>De[r]})}),Object.keys(nr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>nr[r]})}),Object.keys(jr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>jr[r]})}),Object.keys(k).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>k[r]})}),Object.keys(F).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>F[r]})}),Object.keys(ne).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>ne[r]})}),Object.keys(pt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>pt[r]})}),Object.keys(Ct).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ct[r]})}),Object.keys(bt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>bt[r]})}),Object.keys(vt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>vt[r]})}),Object.keys(xt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>xt[r]})}),Object.keys(Ve).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>Ve[r]})}),Object.keys(wt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(g,r)&&Object.defineProperty(g,r,{enumerable:!0,get:()=>wt[r]})}),Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
|