@akshar-technosoft/ui 1.0.19 → 1.0.21
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/data/data-table/data-table.cjs +1 -1
- package/dist/components/data/data-table/data-table.cjs.map +1 -1
- package/dist/components/data/data-table/data-table.js +1 -1
- package/dist/components/data/data-table/data-table.js.map +1 -1
- package/dist/components/data/data-table/index.cjs +1 -1
- package/dist/components/data/data-table/index.cjs.map +1 -1
- package/dist/components/data/data-table/index.js +1 -1
- package/dist/components/data/data-table/index.js.map +1 -1
- package/dist/components/layouts/app-content.cjs +1 -1
- package/dist/components/layouts/app-content.cjs.map +1 -1
- package/dist/components/layouts/app-content.js +1 -1
- package/dist/components/layouts/app-content.js.map +1 -1
- package/dist/components/layouts/factories.cjs +1 -1
- package/dist/components/layouts/factories.cjs.map +1 -1
- package/dist/components/layouts/factories.js +1 -1
- package/dist/components/layouts/factories.js.map +1 -1
- package/dist/components/layouts/index.cjs +1 -1
- package/dist/components/layouts/index.cjs.map +1 -1
- package/dist/components/layouts/index.js +1 -1
- package/dist/components/layouts/index.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client"
|
|
2
|
-
"use strict";var zn=Object.create;var uo=Object.defineProperty;var An=Object.getOwnPropertyDescriptor;var In=Object.getOwnPropertyNames;var Fn=Object.getPrototypeOf,Bn=Object.prototype.hasOwnProperty;var Ln=(e,t)=>{for(var a in t)uo(e,a,{get:t[a],enumerable:!0})},fa=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of In(t))!Bn.call(e,d)&&d!==a&&uo(e,d,{get:()=>t[d],enumerable:!(r=An(t,d))||r.enumerable});return e};var It=(e,t,a)=>(a=e!=null?zn(Fn(e)):{},fa(t||!e||!e.__esModule?uo(a,"default",{value:e,enumerable:!0}):a,e)),On=e=>fa(uo({},"__esModule",{value:!0}),e);var er={};Ln(er,{AppMetaProvider:()=>dn,CurrencyTransfer:()=>na,DataTable:()=>jo,DataTableActionBar:()=>$o,DataTableActionBarAction:()=>Uo,DataTableActionBarSelection:()=>Wo,DataTemplate:()=>Ko,DataTemplateActionBar:()=>Yo,DataTemplateActionBarAction:()=>Zo,DataTemplateActionBarSelection:()=>Qo,ErrorComponent:()=>aa,GeneralHelper:()=>To,Loader:()=>ra,NotFound:()=>sa,OfflineUI:()=>ia,Unauthorized:()=>la,createLayoutComponents:()=>ln,createPageTemplateHook:()=>mn,createTypedAppMetaContext:()=>cn});module.exports=On(er);var Se=require("@tanstack/react-table"),ee=require("lucide-react");var ha=require("radix-ui"),xa=require("class-variance-authority");var ba=require("clsx"),va=require("tailwind-merge");function o(...e){return(0,va.twMerge)((0,ba.clsx)(e))}var ya=require("react/jsx-runtime"),go=(0,xa.cva)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function h({className:e,variant:t,size:a,asChild:r=!1,...d}){let l=r?ha.Slot.Slot:"button";return(0,ya.jsx)(l,{"data-slot":"button",className:o(go({variant:t,size:a,className:e}),"transition-none"),...d})}var Ze=require("react/jsx-runtime");function zo({className:e,...t}){return(0,Ze.jsx)("div",{"data-slot":"table-container",className:"relative w-full h-full max-h-full overflow-auto",children:(0,Ze.jsx)("table",{"data-slot":"table",className:o("w-full caption-bottom text-sm",e),...t})})}function Ca({className:e,...t}){return(0,Ze.jsx)("thead",{"data-slot":"table-header",className:o("[&_tr]:border-b",e),...t})}function wa({className:e,...t}){return(0,Ze.jsx)("tbody",{"data-slot":"table-body",className:o("[&_tr:last-child]:border-0",e),...t})}function Ao({className:e,...t}){return(0,Ze.jsx)("tfoot",{"data-slot":"table-footer",className:o("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t})}function Qe({className:e,...t}){return(0,Ze.jsx)("tr",{"data-slot":"table-row",className:o("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function Na({className:e,...t}){return(0,Ze.jsx)("th",{"data-slot":"table-head",className:o("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap",e),...t})}function et({className:e,...t}){return(0,Ze.jsx)("td",{"data-slot":"table-cell",className:o("p-2 align-middle whitespace-nowrap",e),...t})}var Io=require("react/jsx-runtime");function tt({className:e,...t}){return(0,Io.jsx)("div",{"data-slot":"card",className:o("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function ot({className:e,...t}){return(0,Io.jsx)("div",{"data-slot":"card-content",className:o("px-6",e),...t})}var yt=require("radix-ui");var at=require("react/jsx-runtime");function Ct({delayDuration:e=0,...t}){return(0,at.jsx)(yt.Tooltip.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function lt({...e}){return(0,at.jsx)(Ct,{children:(0,at.jsx)(yt.Tooltip.Root,{"data-slot":"tooltip",...e})})}function dt({...e}){return(0,at.jsx)(yt.Tooltip.Trigger,{"data-slot":"tooltip-trigger",...e})}function ct({className:e,sideOffset:t=0,children:a,...r}){return(0,at.jsx)(yt.Tooltip.Portal,{children:(0,at.jsxs)(yt.Tooltip.Content,{"data-slot":"tooltip-content",sideOffset:t,className:o("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...r,children:[a,(0,at.jsx)(yt.Tooltip.Arrow,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}var L=require("lucide-react");var Ta=require("react/jsx-runtime");function Ft({className:e,type:t,...a}){return(0,Ta.jsx)("input",{type:t,"data-slot":"input",className:o("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...a})}var wt=require("cmdk"),Pa=require("lucide-react");var _n=require("radix-ui"),Vn=require("lucide-react");var Sa=require("react/jsx-runtime");var Je=require("react/jsx-runtime");function Fo({className:e,...t}){return(0,Je.jsx)(wt.Command,{"data-slot":"command",className:o("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function Bo({className:e,...t}){return(0,Je.jsxs)("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[(0,Je.jsx)(Pa.SearchIcon,{className:"size-4 shrink-0 opacity-50"}),(0,Je.jsx)(wt.Command.Input,{"data-slot":"command-input",className:o("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function Lo({className:e,...t}){return(0,Je.jsx)(wt.Command.List,{"data-slot":"command-list",className:o("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function Oo({...e}){return(0,Je.jsx)(wt.Command.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function _o({className:e,...t}){return(0,Je.jsx)(wt.Command.Group,{"data-slot":"command-group",className:o("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}function fo({className:e,...t}){return(0,Je.jsx)(wt.Command.Item,{"data-slot":"command-item",className:o("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}var we=require("radix-ui"),Kt=require("lucide-react");var ie=require("react/jsx-runtime");function Be({...e}){return(0,ie.jsx)(we.DropdownMenu.Root,{"data-slot":"dropdown-menu",...e})}function Le({...e}){return(0,ie.jsx)(we.DropdownMenu.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}function Oe({className:e,sideOffset:t=4,...a}){return(0,ie.jsx)(we.DropdownMenu.Portal,{children:(0,ie.jsx)(we.DropdownMenu.Content,{"data-slot":"dropdown-menu-content",sideOffset:t,className:o("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) rounded-md border p-1 shadow-md",e),...a})})}function Vo({...e}){return(0,ie.jsx)(we.DropdownMenu.Group,{"data-slot":"dropdown-menu-group",...e})}function re({className:e,inset:t,variant:a="default",...r}){return(0,ie.jsx)(we.DropdownMenu.Item,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":a,className:o("cursor-pointer focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function Yt({className:e,children:t,checked:a,...r}){return(0,ie.jsxs)(we.DropdownMenu.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:o("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:a,...r,children:[(0,ie.jsx)("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:(0,ie.jsx)(we.DropdownMenu.ItemIndicator,{children:(0,ie.jsx)(Kt.CheckIcon,{className:"size-4"})})}),t]})}function xe({className:e,inset:t,...a}){return(0,ie.jsx)(we.DropdownMenu.Label,{"data-slot":"dropdown-menu-label","data-inset":t,className:o("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...a})}function Ne({className:e,...t}){return(0,ie.jsx)(we.DropdownMenu.Separator,{"data-slot":"dropdown-menu-separator",className:o("bg-border -mx-1 my-1 h-px",e),...t})}function ka({...e}){return(0,ie.jsx)(we.DropdownMenu.Sub,{"data-slot":"dropdown-menu-sub",...e})}function Da({className:e,inset:t,children:a,...r}){return(0,ie.jsxs)(we.DropdownMenu.SubTrigger,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:o("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",e),...r,children:[a,(0,ie.jsx)(Kt.ChevronRightIcon,{className:"ml-auto size-4"})]})}function Ra({className:e,...t}){return(0,ie.jsx)(we.DropdownMenu.SubContent,{"data-slot":"dropdown-menu-sub-content",className:o("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",e),...t})}var no=require("react");var Ot=require("react"),za=require("lucide-react"),Lt=require("date-fns");var Zt=require("radix-ui");var Qt=require("react/jsx-runtime");function eo({...e}){return(0,Qt.jsx)(Zt.Popover.Root,{"data-slot":"popover",...e})}function to({...e}){return(0,Qt.jsx)(Zt.Popover.Trigger,{"data-slot":"popover-trigger",...e})}function oo({className:e,align:t="center",sideOffset:a=4,...r}){return(0,Qt.jsx)(Zt.Popover.Portal,{children:(0,Qt.jsx)(Zt.Popover.Content,{"data-slot":"popover-content",align:t,sideOffset:a,className:o("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...r})})}var bo=It(require("react"),1),Bt=require("lucide-react"),ao=require("react-day-picker");var nt=require("react/jsx-runtime");function Ma({className:e,classNames:t,showOutsideDays:a=!0,captionLayout:r="label",buttonVariant:d="ghost",formatters:l,components:g,...N}){let p=(0,ao.getDefaultClassNames)();return(0,nt.jsx)(ao.DayPicker,{showOutsideDays:a,className:o("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:r,formatters:{formatMonthDropdown:b=>b.toLocaleString("default",{month:"short"}),...l},classNames:{root:o("w-fit",p.root),months:o("flex gap-4 flex-col md:flex-row relative",p.months),month:o("flex flex-col w-full gap-4",p.month),nav:o("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",p.nav),button_previous:o(go({variant:d}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",p.button_previous),button_next:o(go({variant:d}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",p.button_next),month_caption:o("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",p.month_caption),dropdowns:o("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",p.dropdowns),dropdown_root:o("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",p.dropdown_root),dropdown:o("absolute bg-popover inset-0 opacity-0",p.dropdown),caption_label:o("select-none font-medium",r==="label"?"text-sm":"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",p.caption_label),table:"w-full border-collapse",weekdays:o("flex",p.weekdays),weekday:o("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",p.weekday),week:o("flex w-full mt-2",p.week),week_number_header:o("select-none w-(--cell-size)",p.week_number_header),week_number:o("text-[0.8rem] select-none text-muted-foreground",p.week_number),day:o("relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",p.day),range_start:o("rounded-l-md bg-accent",p.range_start),range_middle:o("rounded-none",p.range_middle),range_end:o("rounded-r-md bg-accent",p.range_end),today:o("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",p.today),outside:o("text-muted-foreground aria-selected:text-muted-foreground",p.outside),disabled:o("text-muted-foreground opacity-50",p.disabled),hidden:o("invisible",p.hidden),...t},components:{Root:({className:b,rootRef:u,...S})=>(0,nt.jsx)("div",{"data-slot":"calendar",ref:u,className:o(b),...S}),Chevron:({className:b,orientation:u,...S})=>u==="left"?(0,nt.jsx)(Bt.ChevronLeftIcon,{className:o("size-4",b),...S}):u==="right"?(0,nt.jsx)(Bt.ChevronRightIcon,{className:o("size-4",b),...S}):(0,nt.jsx)(Bt.ChevronDownIcon,{className:o("size-4",b),...S}),DayButton:Hn,WeekNumber:({children:b,...u})=>(0,nt.jsx)("td",{...u,children:(0,nt.jsx)("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:b})}),...g},...N})}function Hn({className:e,day:t,modifiers:a,...r}){let d=(0,ao.getDefaultClassNames)(),l=bo.useRef(null);return bo.useEffect(()=>{a.focused&&l.current?.focus()},[a.focused]),(0,nt.jsx)(h,{ref:l,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":a.selected&&!a.range_start&&!a.range_end&&!a.range_middle,"data-range-start":a.range_start,"data-range-end":a.range_end,"data-range-middle":a.range_middle,className:o("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",d.day,e),...r})}var Te=require("react/jsx-runtime");function Aa({value:e,onChange:t,placeholder:a,mode:r,externalSearch:d,onExternalChange:l,onlyExternal:g=!1}){let[N,p]=(0,Ot.useState)(!1),[b,u]=(0,Ot.useState)(e),[S,E]=(0,Ot.useState)(e);(0,Ot.useEffect)(()=>{g||E(e)},[e,g]);let _=()=>{g||t(b),E(b),d&&l&&l(b),p(!1)},F=()=>{u(S),p(!1)},k=()=>{let P=r==="single"?null:{from:null,to:null};u(P),g||t(P),E(P),d&&l&&l(P),p(!1)},j=()=>{let P=g?S:e;return P?r==="single"?(0,Lt.format)(P,"PPP"):P.from&&P.to?`${(0,Lt.format)(P.from,"MMM dd")} - ${(0,Lt.format)(P.to,"MMM dd, yyyy")}`:P.from?`From ${(0,Lt.format)(P.from,"MMM dd, yyyy")}`:P.to?`To ${(0,Lt.format)(P.to,"MMM dd, yyyy")}`:a:a},G=P=>{u(r==="single"?P:P||{from:null,to:null})};return(0,Te.jsxs)(eo,{open:N,onOpenChange:p,children:[(0,Te.jsx)(to,{className:"h-8",asChild:!0,children:(0,Te.jsxs)(h,{variant:"outline",className:o("w-full justify-start text-left font-normal h-9",!j()&&"text-muted-foreground"),children:[(0,Te.jsx)(za.Calendar,{className:"mr-2 h-4 w-4"}),j()]})}),(0,Te.jsxs)(oo,{className:"w-auto p-0",align:"start",children:[(0,Te.jsx)("div",{className:"p-3",children:(0,Te.jsx)(Ma,{mode:r,selected:b,onSelect:G,numberOfMonths:r==="range"?2:1,className:"rounded-md border",...r==="range"&&{required:!0}})}),(0,Te.jsxs)("div",{className:"flex items-center justify-between p-3 border-t",children:[(0,Te.jsx)(h,{variant:"ghost",size:"sm",onClick:k,children:"Clear"}),(0,Te.jsxs)("div",{className:"flex gap-2",children:[(0,Te.jsx)(h,{variant:"outline",size:"sm",onClick:F,children:"Cancel"}),(0,Te.jsx)(h,{size:"sm",onClick:_,disabled:r==="range"&&(!b?.from||!b?.to),children:"Apply"})]})]})]})]})}var Ho=require("radix-ui"),Ia=require("lucide-react");var vo=require("react/jsx-runtime");function Nt({className:e,...t}){return(0,vo.jsx)(Ho.Checkbox.Root,{"data-slot":"checkbox",className:o("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:(0,vo.jsx)(Ho.Checkbox.Indicator,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:(0,vo.jsx)(Ia.CheckIcon,{className:"size-3.5"})})})}var s=require("react/jsx-runtime"),Fa=[{value:"sum",label:"Sum",description:"Total of all values"},{value:"average",label:"Average",description:"Mean value"},{value:"min",label:"Minimum",description:"Smallest value"},{value:"max",label:"Maximum",description:"Largest value"},{value:"count",label:"Count",description:"Number of rows"},{value:"unique",label:"Unique",description:"Count of distinct values"},{value:"median",label:"Median",description:"Middle value"}];function Eo({table:e,filters:t=[],globalFilter:a,onGlobalFilterChange:r,enableGlobalFilter:d=!0,onExport:l,onRefresh:g,loading:N=!1,enableColumnVisibility:p=!0,data:b,onClearSorting:u,onClearFilters:S,enableColumnPinning:E=!1,onExternalSearch:_,onCustomFilterChange:F,aggregations:k={},onAggregationChange:j,enableGroupedGlobalFilter:G=!1,groupedFilterLabel:P="Search in",onGroupedFilterChange:ne}){let[C,$]=(0,no.useState)({}),[Pe,Ve]=(0,no.useState)({}),[ge,ft]=(0,no.useState)({}),[ke,fe]=(0,no.useState)("all"),Ue=()=>e.getAllLeafColumns().filter(n=>n.getCanHide?.()!==!1),de=()=>e.getAllColumns().filter(n=>!e.getAllLeafColumns().includes(n)&&n.columns?.length&&n.columns.some(v=>v.getCanHide?.()!==!1)),De=()=>{let n=new Set(de().flatMap(v=>v.columns?.filter(w=>w.getCanHide?.()!==!1).map(w=>w.id)||[]));return Ue().filter(v=>!n.has(v.id))},Ye=(n,v)=>v&&n.startsWith(`${v}.`)?n.replace(`${v}.`,"").split("_").map(U=>U.slice(1)).join(" "):n.split("_").map(w=>w.charAt(0).toUpperCase()+w.slice(1)).join(" "),Re=(n,v)=>{let w={...C,[n]:v};$(w)},kt=(n,v)=>{let w={...Pe,[n]:v};Ve(w),F&&F(n,v),t.find(U=>U.key===n)?.externalSearch&&Re(n,v)},We=()=>{_&&_(C)},rt=()=>{$({}),Ve({}),S(),_&&_({}),F&&Object.keys(Pe).forEach(n=>{F(n,"")})},be=n=>t.find(w=>w.key===n)?.customFilter?Pe[n]??"":e.getColumn(n)?.getFilterValue(),He=(n,v)=>{let w=t.find(U=>U.key===n);w?.customFilter?kt(n,v):(e.getColumn(n)?.setFilterValue(v),w?.externalSearch&&Re(n,v))},ye=(n,v)=>{ft(w=>({...w,[n]:v}))},Ie=n=>{if(j){let v=k[n],w={enabled:!v?.enabled,functions:v?.functions||["sum","average"]};j(n,w)}},Fe=(n,v)=>{if(j){let U=k[n]?.functions||[],le=U.includes(v)?U.filter(Rt=>Rt!==v):[...U,v];j(n,{enabled:le.length>0,functions:le})}},Me=()=>{j&&Object.keys(k).forEach(n=>{let v=k[n];v&&j(n,{...v,enabled:!1,functions:[]})})},Ce=()=>Ue().filter(n=>n.id==="select"||n.id==="serialNumber"?!1:n.columnDef.meta?.aggregatable?!0:e.getRowModel().rows.slice(0,5).some(U=>{let le=U.getValue(n.id);return typeof le=="number"||typeof le=="string"&&!isNaN(parseFloat(String(le)))||typeof le=="object"&&le!==null&&"props"in le})),lo=n=>{fe(n),ne&&ne(n,a)},Dt=n=>{r(n),ne&&G&&ne(ke,n)},bt=Ce(),K=Object.values(k).some(n=>n?.enabled),vt=[{value:"all",label:"All Fields"},...t.map(n=>({value:n.key,label:n.placeholder}))];return(0,s.jsx)("div",{className:"rounded-xl",children:(0,s.jsx)("div",{className:"px-2",children:(0,s.jsx)("div",{className:"flex flex-col gap-6",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("div",{className:"flex items-center gap-3",children:t.length>0&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsx)("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:(0,s.jsx)(L.Filter,{className:"size-4"})}),t.map(n=>!e.getColumn(n.key)&&!n.customFilter&&!n.externalSearch?null:(0,s.jsx)("div",{className:o("relative min-w-[150px]",n.width),children:n.type==="select"?(0,s.jsxs)(eo,{open:ge[n.key],onOpenChange:w=>ye(n.key,w),children:[(0,s.jsx)(to,{asChild:!0,children:(0,s.jsxs)("div",{className:"relative w-full",children:[n.icon&&(0,s.jsx)(n.icon,{className:"absolute -translate-y-1/2 size-4 left-3 top-1/2 text-muted-foreground pointer-events-none z-10"}),(0,s.jsxs)(h,{variant:"outline",role:"combobox","aria-expanded":ge[n.key],className:o("h-8 sm:h-8 rounded-lg w-full justify-between font-normal",!be(n.key)&&"text-muted-foreground"),children:[(0,s.jsx)("span",{className:o("truncate",n.icon&&"pl-6"),children:be(n.key)?n.options?.find(w=>w.value===be(n.key))?.label:n.placeholder}),(0,s.jsx)(L.ChevronDown,{className:"ml-2 opacity-50 size-4 shrink-0"})]})]})}),(0,s.jsx)(oo,{className:"w-[--radix-popover-trigger-width] p-0 rounded-lg",children:(0,s.jsxs)(Fo,{className:"rounded-lg",children:[(0,s.jsx)(Bo,{placeholder:`Search ${n.placeholder?.toLowerCase()}...`}),(0,s.jsxs)(Lo,{children:[(0,s.jsx)(Oo,{children:"No option found."}),(0,s.jsxs)(_o,{children:[(0,s.jsxs)(fo,{value:"all",onSelect:()=>{He(n.key,""),ye(n.key,!1)},className:"flex items-center cursor-pointer",children:[(0,s.jsx)(L.Check,{className:o("mr-2 size-4 shrink-0",be(n.key)?"opacity-0":"opacity-100")}),(0,s.jsx)("span",{children:"All"})]}),n.options?.map(w=>(0,s.jsxs)(fo,{value:w.label,onSelect:()=>{He(n.key,w.value),ye(n.key,!1)},className:"flex items-center cursor-pointer",children:[(0,s.jsx)(L.Check,{className:o("mr-2 size-4 shrink-0",be(n.key)===w.value?"opacity-100":"opacity-0")}),(0,s.jsx)("span",{children:w.label})]},w.label))]})]})]})})]}):n.type==="date"?(0,s.jsx)(Aa,{value:be(n.key),onChange:w=>{n.onlyExternal||He(n.key,w)},placeholder:n.placeholder,mode:n.dateMode||"single",externalSearch:n.externalSearch,onlyExternal:n.onlyExternal,onExternalChange:w=>Re(n.key,w)}):(0,s.jsxs)("div",{className:"relative",children:[n.icon&&(0,s.jsx)(n.icon,{className:"absolute -translate-y-1/2 size-4 left-3 top-1/2 text-muted-foreground"}),(0,s.jsx)(Ft,{placeholder:n.placeholder,value:be(n.key)??"",onChange:w=>{He(n.key,w.target.value)},className:o("h-8 rounded-lg",n.icon&&"pl-9"),type:n.type==="number"?"number":"text"})]})},n.key)),(t.some(n=>n.externalSearch)||t.some(n=>n.customFilter))&&(0,s.jsxs)(h,{variant:"default",size:"sm",onClick:We,className:"rounded-lg h-7",children:[(0,s.jsx)(L.Search,{className:"size-4"}),t.find(n=>n.externalSearch||n.customFilter)?.searchButtonText||"Search"]})]})}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[d&&(0,s.jsxs)("div",{className:o("flex items-center",G?"bg-background border rounded-lg":""),children:[G&&(0,s.jsxs)(Be,{children:[(0,s.jsx)(Le,{asChild:!0,children:(0,s.jsxs)(h,{variant:"ghost",size:"sm",className:"gap-1 border-0 border-r rounded-r-none hover:bg-transparent",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:P}),(0,s.jsx)(L.ChevronDown,{className:"opacity-50 size-4"})]})}),(0,s.jsx)(Oe,{align:"end",className:"w-48 rounded-lg",children:vt.map(n=>(0,s.jsxs)(re,{onClick:()=>lo(n.value),className:"flex items-center justify-between",children:[(0,s.jsx)("span",{children:n.label}),ke===n.value&&(0,s.jsx)(L.Check,{className:"size-4 text-primary"})]},n.value))})]}),(0,s.jsxs)("div",{className:"relative flex-1",children:[(0,s.jsx)(L.Search,{className:"absolute -translate-y-1/2 size-4 left-3 top-1/2 text-muted-foreground"}),(0,s.jsx)(Ft,{placeholder:G&&ke!=="all"?`Search in ${vt.find(n=>n.value===ke)?.label}...`:"Global search...",value:a??"",onChange:n=>Dt(n.target.value),className:o("pl-9 h-8 max-w-max",G&&"border-0 rounded-l-none")})]})]}),bt.length>0&&j&&(0,s.jsxs)(Be,{children:[(0,s.jsx)(Le,{asChild:!0,children:(0,s.jsxs)(h,{variant:"outline",size:"sm",className:o("rounded-lg gap-1",K&&"bg-primary/10 dark:bg-primary/10 border-primary/20 dark:border-primary/20"),children:[(0,s.jsx)(L.Calculator,{className:"size-4"}),(0,s.jsx)("span",{children:"Aggregations"}),(0,s.jsx)(L.ChevronDown,{className:"opacity-50 size-4"})]})}),(0,s.jsxs)(Oe,{align:"end",className:"w-64 rounded-lg max-h-[500px] overflow-y-auto",children:[(0,s.jsxs)(xe,{className:"flex items-center justify-between px-4 py-2",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:"Column Aggregations"}),K&&(0,s.jsx)(h,{variant:"ghost",size:"sm",onClick:Me,className:"h-6 px-2 text-xs",children:"Clear All"})]}),(0,s.jsx)(Ne,{}),bt.map(n=>{let v=k[n.id],w=v?.enabled;return(0,s.jsxs)(ka,{children:[(0,s.jsx)(Da,{className:"text-sm",children:(0,s.jsxs)("div",{className:"flex items-center w-full gap-2",children:[(0,s.jsx)(Nt,{checked:w,onCheckedChange:()=>Ie(n.id),className:"data-[state=checked]:bg-primary"}),(0,s.jsx)("span",{className:o("flex-1",w&&"font-medium text-primary"),children:Ye(n.id)}),w&&(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[v?.functions?.slice(0,2).map(U=>(0,s.jsx)("div",{className:"w-2 h-2 rounded-full bg-primary",title:Fa.find(le=>le.value===U)?.label},U)),v?.functions&&v.functions.length>2&&(0,s.jsxs)("div",{className:"text-xs text-muted-foreground",children:["+",v.functions.length-2]})]})]})}),(0,s.jsxs)(Ra,{className:"w-48 rounded-lg",children:[(0,s.jsx)(xe,{className:"px-3 py-2 text-xs font-medium text-muted-foreground",children:"Select Functions"}),Fa.map(U=>(0,s.jsx)(Yt,{checked:v?.functions?.includes(U.value)||!1,onCheckedChange:()=>Fe(n.id,U.value),className:"py-2 text-sm",children:(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("span",{children:U.label}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:U.description})]})},U.value))]})]},n.id)}),bt.length===0&&(0,s.jsxs)("div",{className:"px-3 py-4 text-center",children:[(0,s.jsx)(L.Calculator,{className:"w-8 h-8 mx-auto mb-2 opacity-50 text-muted-foreground"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"No numeric columns available for aggregation"})]})]})]}),l&&(0,s.jsxs)(h,{variant:"outline",size:"sm",onClick:()=>l(b),className:"rounded-lg",children:[(0,s.jsx)(L.Download,{className:"size-4"}),"Export"]}),p&&(0,s.jsxs)(Be,{children:[(0,s.jsx)(Le,{asChild:!0,className:"h-7",children:(0,s.jsxs)(h,{variant:"outline",size:"sm",className:"gap-1 rounded-lg",children:[(0,s.jsx)("span",{children:"Columns"}),(0,s.jsx)(L.ChevronDown,{className:"opacity-50 size-4"})]})}),(0,s.jsxs)(Oe,{align:"end",className:"w-[220px] rounded-lg max-h-[400px] overflow-y-auto",children:[(0,s.jsx)(xe,{className:"px-4 py-2 text-sm font-medium",children:"Toggle Columns"}),(0,s.jsx)(Ne,{}),De().length>0&&(0,s.jsxs)(Vo,{children:[(0,s.jsx)(xe,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:"General"}),De().map(n=>(0,s.jsx)(Yt,{className:"text-sm",checked:n.getIsVisible(),onCheckedChange:v=>n.toggleVisibility(!!v),children:Ye(n.id)},n.id))]}),de().map(n=>(0,s.jsxs)(Vo,{children:[(0,s.jsx)(Ne,{}),(0,s.jsx)(xe,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:n.id}),n.columns?.filter(v=>v.getCanHide?.()!==!1).map(v=>(0,s.jsx)(Yt,{className:"text-sm",checked:v.getIsVisible(),onCheckedChange:w=>v.toggleVisibility(!!w),children:Ye(v.id,n.id)},v.id))]},n.id))]})]}),(0,s.jsxs)(Be,{children:[(0,s.jsx)(Le,{asChild:!0,className:"h-7",children:(0,s.jsx)(h,{variant:"outline",size:"sm",className:"rounded-lg h-7",children:(0,s.jsx)(L.Settings2,{className:"size-4"})})}),(0,s.jsxs)(Oe,{align:"end",className:"w-[200px] rounded-lg",children:[(0,s.jsx)(xe,{children:"Table Settings"}),(0,s.jsx)(Ne,{}),(0,s.jsxs)(re,{onClick:u,children:[(0,s.jsx)(L.ArrowUpDown,{className:"size-4"}),"Clear All Sorting"]}),(0,s.jsxs)(re,{onClick:rt,children:[(0,s.jsx)(L.Filter,{className:"size-4"}),"Clear All Filters"]}),K&&(0,s.jsxs)(re,{onClick:Me,children:[(0,s.jsx)(L.Calculator,{className:"size-4"}),"Clear Aggregations"]}),E&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Ne,{}),(0,s.jsx)(xe,{children:"Column Pinning"}),(0,s.jsxs)(re,{onClick:()=>e.setColumnPinning({left:[],right:[]}),children:[(0,s.jsx)(L.PinOff,{className:"size-4"}),"Reset All Pinning"]}),(0,s.jsxs)(re,{onClick:()=>{let n=Ue().filter(v=>v.getCanPin?.()!==!1).map(v=>v.id);e.setColumnPinning({left:[],right:n})},children:[(0,s.jsx)(L.Pin,{className:"-rotate-90 size-4"}),"Pin All Right"]})]})]})]}),g&&(0,s.jsx)(h,{variant:"outline",size:"sm",onClick:g,disabled:N,className:"rounded-lg",children:(0,s.jsx)(L.RefreshCw,{className:o("h-4 w-4",N&&"animate-spin")})})]})]})})})})}var ze=require("radix-ui"),Tt=require("lucide-react");var ae=require("react/jsx-runtime");function _t({...e}){return(0,ae.jsx)(ze.Select.Root,{"data-slot":"select",...e})}function Vt({...e}){return(0,ae.jsx)(ze.Select.Value,{"data-slot":"select-value",...e})}function Ht({className:e,size:t="default",children:a,...r}){return(0,ae.jsxs)(ze.Select.Trigger,{"data-slot":"select-trigger","data-size":t,className:o("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[a,(0,ae.jsx)(ze.Select.Icon,{asChild:!0,children:(0,ae.jsx)(Tt.ChevronDownIcon,{className:"size-4 opacity-50"})})]})}function Et({className:e,children:t,position:a="popper",...r}){return(0,ae.jsx)(ze.Select.Portal,{children:(0,ae.jsxs)(ze.Select.Content,{"data-slot":"select-content",className:o("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:a,...r,children:[(0,ae.jsx)(En,{}),(0,ae.jsx)(ze.Select.Viewport,{className:o("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),(0,ae.jsx)(Gn,{})]})})}function St({className:e,children:t,...a}){return(0,ae.jsxs)(ze.Select.Item,{"data-slot":"select-item",className:o("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...a,children:[(0,ae.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,ae.jsx)(ze.Select.ItemIndicator,{children:(0,ae.jsx)(Tt.CheckIcon,{className:"size-4"})})}),(0,ae.jsx)(ze.Select.ItemText,{children:t})]})}function En({className:e,...t}){return(0,ae.jsx)(ze.Select.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:o("flex cursor-default items-center justify-center py-1",e),...t,children:(0,ae.jsx)(Tt.ChevronUpIcon,{className:"size-4"})})}function Gn({className:e,...t}){return(0,ae.jsx)(ze.Select.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:o("flex cursor-default items-center justify-center py-1",e),...t,children:(0,ae.jsx)(Tt.ChevronDownIcon,{className:"size-4"})})}var Q=require("react/jsx-runtime");function Go({table:e,config:t}){return t.enabled?(0,Q.jsx)("div",{className:"rounded-xl",children:(0,Q.jsx)("div",{children:(0,Q.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Q.jsx)("div",{className:"flex items-center gap-6 text-sm text-muted-foreground",children:t.showInfo!==!1&&(0,Q.jsxs)("span",{children:["Showing ",e.getState().pagination.pageIndex*e.getState().pagination.pageSize+1," to"," ",Math.min((e.getState().pagination.pageIndex+1)*e.getState().pagination.pageSize,e.getFilteredRowModel().rows.length)," ","of ",e.getFilteredRowModel().rows.length," entries"]})}),(0,Q.jsxs)("div",{className:"flex items-center gap-4",children:[t.pageSizeOptions&&(0,Q.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Q.jsx)("span",{className:"text-sm font-medium",children:"Rows per page:"}),(0,Q.jsxs)(_t,{value:`${e.getState().pagination.pageSize}`,onValueChange:a=>e.setPageSize(Number(a)),children:[(0,Q.jsx)(Ht,{className:"h-9 w-[70px] rounded-lg",children:(0,Q.jsx)(Vt,{})}),(0,Q.jsx)(Et,{side:"top",className:"rounded-lg",children:t.pageSizeOptions.map(a=>(0,Q.jsx)(St,{value:`${a}`,children:a},a))})]})]}),(0,Q.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Q.jsx)(h,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"First"}),(0,Q.jsx)(h,{variant:"outline",size:"sm",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"Previous"}),t.showPageNumbers&&(0,Q.jsx)("div",{className:"flex items-center gap-1",children:Array.from({length:Math.min(5,e.getPageCount())},(a,r)=>{let d=e.getState().pagination.pageIndex,l=d+r;return l<1||l>e.getPageCount()?null:(0,Q.jsx)(h,{variant:l===d+1?"default":"outline",size:"sm",className:"size-8 p-0 rounded-lg",onClick:()=>e.setPageIndex(l-1),children:l},l)})}),(0,Q.jsx)(h,{variant:"outline",size:"sm",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Next"}),(0,Q.jsx)(h,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Last"})]})]})]})})}):null}var Ba=require("radix-ui"),La=require("class-variance-authority");var _a=require("react/jsx-runtime"),jn=(0,La.cva)("inline-flex cursor-pointer items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{sm:"h-7 px-0 min-w-7",default:"h-8 px-1 min-w-8",lg:"h-9 px-2 min-w-10"},bg:{enabled:"data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",disabled:""}},defaultVariants:{variant:"default",size:"default",bg:"enabled"}});function Oa({className:e,variant:t,size:a,noBg:r,...d}){return(0,_a.jsx)(Ba.Toggle.Root,{"data-slot":"toggle",className:o(jn({className:e,variant:t,size:a,bg:r?"disabled":"enabled"})),...d})}var z=require("react"),i=require("react/jsx-runtime"),Va={sum:e=>e.reduce((t,a)=>t+a,0),average:e=>e.length>0?e.reduce((t,a)=>t+a,0)/e.length:0,min:e=>e.length>0?Math.min(...e):0,max:e=>e.length>0?Math.max(...e):0,count:e=>e.length,unique:e=>new Set(e).size,median:e=>{if(e.length===0)return 0;let t=[...e].sort((r,d)=>r-d),a=Math.floor(t.length/2);return t.length%2===0?(t[a-1]+t[a])/2:t[a]}};function jo({data:e,columns:t,filters:a=[],pagination:r={enabled:!1},settings:d={},header:l,footer:g,className:N="",maxHeight:p="100%",loading:b=!1,error:u,emptyMessage:S="No data available",onRowSelectionChange:E,onExport:_,onRefresh:F,onTableReady:k,children:j,isRowDisabled:G,isRowSelectable:P,onExternalSearch:ne,aggregations:C={},onAggregationChange:$,rowClassName:Pe}){let[Ve,ge]=(0,z.useState)([]),[ft,ke]=(0,z.useState)([]),[fe,Ue]=(0,z.useState)({}),[de,De]=(0,z.useState)({}),[Ye,Re]=(0,z.useState)(""),[kt,We]=(0,z.useState)([]),[rt,be]=(0,z.useState)(d.enableColumnPinning?{left:[],right:[]}:{}),[He,ye]=(0,z.useState)({}),Ie=(0,z.useRef)(null),Fe=(0,z.useRef)(null),Me=(0,z.useRef)(null),Ce=(0,z.useRef)(null),[lo,Dt]=(0,z.useState)(0),[bt,K]=(0,z.useState)(0),[vt,n]=(0,z.useState)(0),[v,w]=(0,z.useState)(0),U=(0,z.useRef)(null),[le,Rt]=(0,z.useState)(!1),{enableSorting:Jt=!0,enableFiltering:Mt=!0,enableGlobalFilter:zt=!0,enableColumnVisibility:Xt=!0,enableRowSelection:ve=!0,stickyHeader:da=!0,toolbar:M=!1,disableHeaderCheckbox:W=!1,toolbarPosition:D="default",showSerialNumbers:Y=!0,fixedCheckboxColumn:ce=!0,striped:qe=!0,hoverable:ht=!0,compact:Ee=!0,bordered:ca=!0,fullHeight:vn=!1,enableColumnResizing:ma=!1,enableColumnPinning:he=!0,hideHeader:hn=!1,selectionMode:st="multiple",showCheckBox:xn=!0,checkboxColumnPosition:pa=0,rounded:ko=!0}=d;(0,z.useEffect)(()=>{let f=()=>{U.current&&Rt(U.current.scrollTop>0)},y=U.current;if(y)return y.addEventListener("scroll",f),()=>y.removeEventListener("scroll",f)},[]),(0,z.useEffect)(()=>{let f=()=>{Ie.current&&Dt(Ie.current.offsetHeight+16),Fe.current&&K(Fe.current.offsetHeight+16),Me.current&&n(Me.current.offsetHeight+16),Ce.current&&w(Ce.current.offsetHeight+16)};f();let y=new ResizeObserver(()=>{setTimeout(f,50)});return Ie.current&&y.observe(Ie.current),Fe.current&&y.observe(Fe.current),Me.current&&y.observe(Me.current),Ce.current&&y.observe(Ce.current),()=>{y.disconnect()}},[M,l,D]);let yn=(f,y)=>y.split(".").reduce((m,c)=>m&&m[c],f),Do=(0,z.useMemo)(()=>Object.keys(He).length===0?e:e.filter(f=>Object.entries(He).every(([y,m])=>{if(!m||m==="")return!0;let c=yn(f,y);return typeof m=="string"?String(c).toLowerCase().includes(m.toLowerCase()):c===m})),[e,He]),Cn=(0,z.useCallback)((f,y)=>{ye(m=>{let c={...m};return y===""||y===null||y===void 0?delete c[f]:c[f]=y,c})},[]),At=(0,z.useMemo)(()=>{let f=[...t],y=T=>T.map(R=>{if(R.id==="select"||R.id==="serialNumber")return R;let V={...R,enablePinning:!0};return R.columns&&(V.columns=y(R.columns)),V}),m=y(f),c={id:"select",header:({table:T})=>{if(st==="single")return null;let R=T.getRowModel().rows.filter(se=>!G?.(se.original)&&(P?P(se.original):!0)),V=R.length>0&&R.every(se=>se.getIsSelected()),Z=R.some(se=>se.getIsSelected());return(0,i.jsx)(Nt,{checked:V||Z&&"indeterminate",onCheckedChange:se=>{R.forEach(me=>me.toggleSelected(!!se))},disabled:W||R.length===0,"aria-label":"Select all selectable rows"})},cell:({row:T})=>{let R=G?G(T.original):!1,V=P?P(T.original):!0;return(0,i.jsx)("div",{className:o("flex items-center justify-center",R&&"opacity-50"),children:st==="multiple"?(0,i.jsx)(Nt,{checked:T.getIsSelected(),onCheckedChange:Z=>V&&T.toggleSelected(!!Z),"aria-label":"Select row",disabled:R||!V}):xn?(0,i.jsx)("input",{type:"radio",checked:T.getIsSelected(),onChange:()=>V&&T.toggleSelected(!0),disabled:R||!V,className:"w-4 h-4 rounded-full border-primary text-primary focus:ring-primary"}):null})},enableSorting:!1,enableHiding:!1,enablePinning:!0,headerAlign:"center",size:st==="multiple"?40:30};if(ve){let T=pa;T<0&&(T=m.length+T+1),T=Math.max(0,Math.min(T,m.length)),m.splice(T,0,c)}if(Y){let T={id:"serialNumber",header:"No.",cell:({row:R})=>(0,i.jsx)("div",{className:"font-medium text-center text-muted-foreground",children:R.index+1}),enableSorting:!0,enableHiding:!1,enablePinning:!0,size:60,headerAlign:"center"};m.unshift(T)}return m},[t,Y,ve,ce,G,P,st,pa]),B=(0,Se.useReactTable)({data:Do,columns:At,onSortingChange:Jt?ge:void 0,onColumnFiltersChange:Mt?ke:void 0,onGlobalFilterChange:zt?Re:void 0,getCoreRowModel:(0,Se.getCoreRowModel)(),getPaginationRowModel:r.enabled?(0,Se.getPaginationRowModel)():void 0,getSortedRowModel:Jt?(0,Se.getSortedRowModel)():void 0,getFilteredRowModel:Mt?(0,Se.getFilteredRowModel)():void 0,onColumnVisibilityChange:Xt?Ue:void 0,onRowSelectionChange:ve?De:void 0,onColumnOrderChange:We,onColumnPinningChange:he?be:void 0,state:{sorting:Jt?Ve:void 0,columnFilters:Mt?ft:void 0,columnVisibility:Xt?fe:void 0,rowSelection:ve?de:{},globalFilter:Ye,columnOrder:kt,columnPinning:he?rt:{}},initialState:{pagination:r.enabled?{pageSize:r.pageSize||10}:void 0,columnPinning:he?{left:[...Y?["serialNumber"]:[],...ve?["select"]:[]],right:[]}:void 0},enableRowSelection:ve,enableColumnResizing:ma,enableColumnPinning:he,columnResizeMode:"onChange"}),ua=(0,z.useMemo)(()=>{if(!C||Object.keys(C).length===0)return{};let f={},y=B.getFilteredRowModel().rows;return Object.entries(C).forEach(([m,c])=>{if(!c?.enabled)return;let T=y.map(V=>{if(c.accessor)return c.accessor(V.original);{let Z=V.getValue(m);return typeof Z=="number"?Z:parseFloat(String(Z))||0}}).filter(V=>V!==null&&!isNaN(V)),R={};c.functions?.forEach(V=>{Va[V]&&(R[V]=Va[V](T))}),Object.keys(R).length>0&&(f[m]=R)}),f},[Do,C,B?.getFilteredRowModel().rows]);(0,z.useEffect)(()=>{if(ve&&E){let f=B.getFilteredSelectedRowModel().rows.filter(y=>!G?.(y.original)&&(P?P(y.original):!0)).map(y=>y.original);E(f)}},[de,ve,E,B,G,P]);let wn=(0,z.useCallback)(f=>{st==="single"?(B.resetRowSelection(),f.toggleSelected(!0)):f.toggleSelected()},[st,B]);(0,z.useEffect)(()=>{k&&k(B)},[B,k]);let Nn=(0,z.useCallback)(()=>{ge([])},[]),Tn=(0,z.useCallback)(()=>{ke([]),Re("")},[]),ga=(f,y)=>{if(!he)return;let m=[...Y?["serialNumber"]:[],...ve&&ce?["select"]:[]],c={left:[...(rt.left??[]).filter(T=>m.includes(T))],right:[...rt.right??[]]};y===!1?(c.left=c.left.filter(T=>T!==f),c.right=c.right.filter(T=>T!==f)):y==="right"?(c.left=c.left.filter(T=>T!==f),c.right.includes(f)||c.right.push(f)):y==="left"&&(c.right=c.right.filter(T=>T!==f),!c.left.includes(f)&&!m.includes(f)&&c.left.push(f)),B.setColumnPinning(c)},Sn=()=>{let f=Object.keys(ua).length>0,y=B.getHeaderGroups()[0]?.headers.some(c=>c.column.columnDef.customFooter),m=Y&&B.getFilteredRowModel().rows.length>0&&(f||y);return!f&&!y&&!m?null:(0,i.jsx)(Ao,{className:"sticky bottom-0 border-t bg-sidebar z-20",children:(0,i.jsx)(Qe,{className:"hover:bg-transparent bg-sidebar",children:B.getHeaderGroups()[0]?.headers.map((c,T)=>{let R=c.column.id,V=ua[R],Z=he&&(c.column.getIsPinned()==="left"||c.column.id==="serialNumber"||c.column.id==="select"&&ve),se=he&&c.column.getIsPinned()==="right",me=c.column.id==="serialNumber",it=c.column.id==="select",pe=c.column.columnDef.customFooter;return V||pe||me&&m?(0,i.jsx)(et,{className:o("font-semibold text-sm py-2 px-2 border-r",Ee&&"py-1",Z&&"sticky left-0 z-30 bg-sidebar/95",se&&"sticky right-0 z-30 bg-sidebar/95",(me||it)&&"sticky left-0 z-30 bg-sidebar/95",pe?.className),style:{width:c.getSize()!==150?c.getSize():"auto",minWidth:c.getSize()!==150?c.getSize():"auto",...Z&&{left:me?0:it?Y&&B.getColumn("serialNumber")?.getSize()||0:co(c.column)},...se&&{right:mo(c.column)},...me&&{left:0}},children:(()=>{if(pe?.content){let xt=typeof pe.content=="function"?pe.content(B):pe.content;return(0,i.jsx)("div",{className:o("w-full h-full",pe.align==="center"&&"text-center",pe.align==="right"&&"text-right",pe.align==="left"&&"text-left"),children:xt})}return V?(0,i.jsx)("div",{className:"flex flex-col gap-0.5 text-xs",children:Object.entries(V).map(([xt,Mn])=>(0,i.jsxs)("div",{className:"flex items-center justify-between text-muted-foreground",children:[(0,i.jsxs)("span",{className:"text-xs capitalize",children:[xt,":"]}),(0,i.jsx)("span",{className:"font-medium text-foreground",children:Pn(xt,Mn)})]},xt))}):me&&m?(0,i.jsxs)("div",{className:"text-xs text-center text-muted-foreground",children:["Total: ",B.getFilteredRowModel().rows.length]}):null})()},`agg-${c.id}`):(0,i.jsx)(et,{className:o("py-0 px-0 border-r",Ee&&"py-0",Z&&"sticky left-0 z-30 bg-sidebar/95",se&&"sticky right-0 z-30 bg-sidebar/95",(me||it)&&"sticky left-0 z-30 bg-sidebar/95"),style:{width:c.getSize()!==150?c.getSize():"auto",minWidth:c.getSize()!==150?c.getSize():"auto",...Z&&{left:me?0:it?Y&&B.getColumn("serialNumber")?.getSize()||0:co(c.column)},...se&&{right:mo(c.column)},...me&&{left:0}}},`agg-${c.id}`)})})})},Pn=(f,y)=>typeof y=="number"?f==="count"||f==="unique"?y.toLocaleString():y.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2}):y,kn=()=>B.getHeaderGroups().map((f,y)=>(0,i.jsx)(Qe,{className:"hover:bg-transparent",children:f.headers.map((m,c)=>{let T=m.depth===0&&m.colSpan>1,R=he&&(m.column.getIsPinned()==="left"||m.column.id==="serialNumber"||m.column.id==="select"&&ve),V=he&&m.column.getIsPinned()==="right",Z=m.column.getCanSort(),se=he&&m.column.columnDef.enablePinning!==!1,me=m.column.id==="serialNumber",it=m.column.id==="select",Mo=me||it&&ce,pe=m.column.columnDef.headerAlign||"left",po=C&&C[m.column.id]?.enabled,xt={left:"justify-start",center:"justify-center",right:"justify-end"}[pe];return(0,i.jsxs)(Na,{colSpan:m.colSpan,className:o("font-semibold text-foreground bg-sidebar group px-0",!Ee&&"py-2",ca&&c<f.headers.length-1&&"border-r","relative",R&&"sticky left-0 z-25 bg-sidebar",V&&"sticky right-0 z-25 bg-sidebar",(me||it)&&"sticky left-0 z-25 bg-sidebar",T?"text-center":"text-left",po&&"border-b-2 border-primary/30"),style:{width:m.getSize()!==150?m.getSize():"auto",minWidth:m.getSize()!==150?m.getSize():"auto",...R&&{left:me?0:it?Y&&B.getColumn("serialNumber")?.getSize()||0:co(m.column)},...V&&{right:mo(m.column)},...me&&{left:0}},children:[T?(0,i.jsxs)("div",{className:"flex items-center justify-center",children:[(0,Se.flexRender)(m.column.columnDef.header,m.getContext()),po&&(0,i.jsx)(ee.Calculator,{className:"w-3 h-3 ml-1 text-primary"})]}):(0,i.jsxs)("div",{className:o("relative flex items-center w-full px-2",xt),children:[(0,i.jsxs)("div",{className:"flex items-center gap-1",children:[po&&(0,i.jsx)(ee.Calculator,{className:"w-3 h-3 mr-1 text-primary"}),Z&&pe==="right"&&(0,i.jsx)("span",{className:"order-2 ml-1",children:m.column.getIsSorted()&&{asc:(0,i.jsx)(ee.ChevronUp,{className:"w-4 h-4"}),desc:(0,i.jsx)(ee.ChevronDown,{className:"w-4 h-4"})}[m.column.getIsSorted()]}),m.isPlaceholder?null:(0,Se.flexRender)(m.column.columnDef.header,m.getContext()),Z&&pe!=="right"&&m.column.getIsSorted()&&(0,i.jsx)("span",{className:"order-2 ml-1",children:m.column.getIsSorted()&&{asc:(0,i.jsx)(ee.ChevronUp,{className:"w-4 h-4"}),desc:(0,i.jsx)(ee.ChevronDown,{className:"w-4 h-4"})}[m.column.getIsSorted()]})]}),(Z||se&&!Mo)&&(0,i.jsxs)(Be,{children:[(0,i.jsx)(Le,{asChild:!0,className:o("absolute",pe==="left"&&"right-1",pe==="center"&&"right-1",pe==="right"&&"left-1"),children:(0,i.jsx)(Oa,{variant:"default",size:"sm",noBg:!0,tabIndex:-1,className:"opacity-0 group-hover:opacity-70 hover:opacity-100 data-[state=open]:opacity-100",children:(0,i.jsx)(ee.MoreHorizontal,{className:"w-4 h-4"})})}),(0,i.jsxs)(Oe,{align:"end",className:"w-48",children:[Z&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xe,{children:"Sorting"}),(0,i.jsxs)(re,{onClick:()=>m.column.toggleSorting(!1),children:[(0,i.jsx)(ee.ChevronUp,{className:"w-4 h-4 mr-2"}),"Sort Ascending"]}),(0,i.jsxs)(re,{onClick:()=>m.column.toggleSorting(!0),children:[(0,i.jsx)(ee.ChevronDown,{className:"w-4 h-4 mr-2"}),"Sort Descending"]}),(0,i.jsxs)(re,{onClick:()=>m.column.clearSorting(),disabled:!m.column.getIsSorted(),children:[(0,i.jsx)(ee.ChevronsUpDown,{className:"w-4 h-4 mr-2"}),"Clear Sort"]}),(0,i.jsx)(Ne,{})]}),se&&!Mo&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(xe,{children:"Pin Column"}),(0,i.jsxs)(re,{onClick:()=>ga(m.column.id,"right"),disabled:m.column.getIsPinned()==="right",children:[(0,i.jsx)(ee.MoveRightIcon,{}),"Pin Right"]}),(0,i.jsxs)(re,{onClick:()=>ga(m.column.id,!1),disabled:!m.column.getIsPinned(),children:[(0,i.jsx)(ee.PinOffIcon,{}),"Unpin"]})]})]})]})]}),ma&&m.column.getCanResize()&&!T&&m.colSpan===1&&(0,i.jsx)("div",{className:"absolute top-0 right-0 w-1 h-full transition-opacity opacity-0 bg-border hover:bg-primary cursor-col-resize hover:opacity-100",onMouseDown:m.getResizeHandler()})]},m.id)})},f.id)),co=f=>{if(!he)return;let y=0,m=B.getLeftHeaderGroups()[0]?.headers||[],c=[...Y?["serialNumber"]:[],...ve?["select"]:[]];for(let T of m){if(T.id===f.id)break;if(c.includes(T.id)){let R=B.getColumn(T.id);R&&(y+=R.getSize())}}return y},mo=f=>{if(!he)return;let y=B.getState().columnPinning.right||[],m=y.indexOf(f.id);if(m===-1)return;let c=0;for(let T=m+1;T<y.length;T++){let R=B.getColumn(y[T]);R&&(c+=R.getSize())}return c};if(u)return(0,i.jsx)(tt,{className:"w-full shadow-sm rounded-xl",children:(0,i.jsx)(ot,{className:"flex items-center justify-center",children:(0,i.jsxs)("div",{className:"text-center",children:[(0,i.jsx)("div",{className:"mb-3 text-2xl text-red-500",children:"\u26A0\uFE0F"}),(0,i.jsx)("p",{className:"mb-4 text-sm text-muted-foreground",children:u}),F&&(0,i.jsxs)(h,{variant:"outline",size:"sm",onClick:F,className:"rounded-lg",children:[(0,i.jsx)(ee.Loader2,{className:"w-4 h-4 mr-2"}),"Try Again"]})]})})});let Dn=f=>f&&typeof f=="object"&&"content"in f,Ge=(0,z.useMemo)(()=>l?Dn(l)?{content:l.content,align:l.align||"left",className:l.className||"",sticky:l.sticky!==void 0?l.sticky:!0,showOnEmpty:l.showOnEmpty!==void 0?l.showOnEmpty:!0}:{content:l,align:"left",className:"",sticky:!0,showOnEmpty:!0}:null,[l]),Ro=()=>M?(0,i.jsx)(Eo,{table:B,filters:a,globalFilter:Ye,onGlobalFilterChange:Re,enableGlobalFilter:zt,onExport:_,onRefresh:F,loading:b,enableColumnVisibility:Xt,enableColumnPinning:he,data:Do,onClearSorting:Nn,onClearFilters:Tn,onExternalSearch:ne,onCustomFilterChange:Cn,aggregations:C,onAggregationChange:$}):null,Rn=()=>{let f=0;return D==="above-header"&&(f+=bt),Ge&&(f+=v),D==="below-header"&&(f+=vt),f};return(0,i.jsx)(Ct,{children:(0,i.jsxs)("div",{className:o("w-full space-y-2 flex flex-col h-full",N),children:[M&&D==="default"&&(0,i.jsx)("div",{ref:Ie,className:"relative z-40",children:Ro()}),(0,i.jsx)(tt,{className:o("shadow-sm overflow-hidden py-0",vn&&"flex-1",!ko&&"rounded-none"),children:(0,i.jsx)(ot,{className:"h-full p-0",children:(0,i.jsxs)("div",{className:"relative flex flex-col justify-between h-full",children:[b&&(0,i.jsx)("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm rounded-xl",children:(0,i.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3 rounded-lg shadow-sm bg-background/90",children:[(0,i.jsx)(ee.Loader2,{className:"size-5 animate-spin text-primary"}),(0,i.jsx)("span",{className:"text-sm font-medium text-muted-foreground",children:"Loading..."})]})}),(0,i.jsx)("div",{ref:U,className:o("relative overflow-auto border-b rounded-t-xl",B.getRowModel().rows?.length===0&&"h-full"),style:{maxHeight:p},children:(0,i.jsxs)(zo,{className:o("w-full border-collapse relative",B.getRowModel().rows?.length===0&&"h-full",!ko&&"rounded-none"),children:[M&&D==="above-header"&&(0,i.jsx)("thead",{className:"sticky top-0 z-40 bg-sidebar border-b",children:(0,i.jsx)(Qe,{className:"hover:bg-transparent",children:(0,i.jsx)(et,{colSpan:At.length,className:o("p-2 bg-sidebar border-b shadow-sm",!ko&&"rounded-none"),children:(0,i.jsx)("div",{ref:Fe,children:Ro()})})})}),Ge&&(Ge.showOnEmpty||B.getRowModel().rows?.length>0)&&(0,i.jsx)("thead",{className:o("sticky bg-sidebar border-b",le&&"shadow-sm"),style:{top:D==="above-header"?`${bt}px`:"0px",zIndex:35},children:(0,i.jsx)(Qe,{className:"hover:bg-transparent",children:(0,i.jsx)(et,{colSpan:At.length,className:o("p-2 font-semibold text-foreground bg-sidebar",Ee?"py-2":"py-4",Ge.className),children:(0,i.jsx)("div",{ref:Ce,className:o("flex items-center w-full",Ge.align==="center"&&"justify-center",Ge.align==="right"&&"justify-end",Ge.align==="left"&&"justify-start"),children:typeof Ge.content=="string"?(0,i.jsx)("span",{className:"text-lg font-bold tracking-tight text-foreground",children:Ge.content}):Ge.content})})})}),M&&D==="below-header"&&(0,i.jsx)("thead",{className:o("sticky bg-sidebar border-b",le&&"shadow-sm"),style:{top:Ge?`${v}px`:"0px",zIndex:35},children:(0,i.jsx)(Qe,{className:"hover:bg-transparent",children:(0,i.jsx)(et,{colSpan:At.length,className:"p-2 bg-sidebar",children:(0,i.jsx)("div",{ref:Me,children:Ro()})})})}),!hn&&(0,i.jsx)(Ca,{className:o("sticky bg-sidebar",le&&"shadow-sm"),style:{top:`${Rn()}px`,zIndex:30},children:kn()}),(0,i.jsx)(wa,{children:B.getRowModel().rows?.length?B.getRowModel().rows.map((f,y)=>{let m=Pe?Pe(f):"";return(0,i.jsx)(Qe,{"data-state":f.getIsSelected()&&"selected",className:o(ht&&"hover:bg-muted/50",qe&&y%2===0&&"bg-muted/20",f.getIsSelected()&&"bg-muted","border-b last:border-b-0",st==="single"&&"cursor-pointer",m),onClick:()=>{st==="single"&&wn(f)},children:f.getVisibleCells().map((c,T)=>{let R=he&&(c.column.getIsPinned()==="left"||c.column.id==="serialNumber"||c.column.id==="select"&&ve),V=he&&c.column.getIsPinned()==="right",Z=c.column.id==="serialNumber",se=c.column.id==="select",me=Z||se&&ce;return(0,i.jsx)(et,{className:o(Ee?"py-2":"py-4",ca&&T<f.getVisibleCells().length&&"border-r",R&&"sticky left-0 z-20 bg-sidebar/95",V&&"sticky right-0 z-20 bg-sidebar/95",Z&&"sticky left-0 z-20 bg-sidebar/95","p-1"),style:{width:c.column.getSize()!==150?c.column.getSize():"auto",minWidth:c.column.getSize()!==150?c.column.getSize():"auto",...R&&{left:Z?0:se?Y&&B.getColumn("serialNumber")?.getSize()||0:co(c.column)},...V&&{right:mo(c.column)},...Z&&{left:0}},children:(0,Se.flexRender)(c.column.columnDef.cell,c.getContext())},c.id)})},f.id)}):(0,i.jsx)(Qe,{children:(0,i.jsx)(et,{colSpan:At.length,className:"h-32 text-center border-0",children:(0,i.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,i.jsx)("div",{className:"text-6xl text-muted-foreground",children:"\u{1F4CB}"}),(0,i.jsx)("p",{className:"font-medium text-muted-foreground",children:S})]})})})}),Sn()]})}),g&&(0,i.jsx)("div",{className:"sticky bottom-0 z-10 w-full bg-sidebar",style:{width:"100%",minWidth:"fit-content"},children:(0,i.jsx)(zo,{children:(0,i.jsx)(Ao,{children:(0,i.jsx)(Qe,{className:"bg-sidebar",children:(0,i.jsx)(et,{colSpan:At.length,className:"p-2",children:g})})})})})]})})}),(0,i.jsx)(Go,{table:B,config:r}),j&&j(B)]})})}var Ha=require("radix-ui");var Ea=require("react/jsx-runtime");function ro({className:e,orientation:t="horizontal",decorative:a=!0,...r}){return(0,Ea.jsx)(Ha.Separator.Root,{"data-slot":"separator-root",decorative:a,orientation:t,className:o("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}var ho=require("lucide-react"),xo=require("framer-motion"),mt=It(require("react"),1),Ga=It(require("react-dom"),1),te=require("react/jsx-runtime");function $o({table:e,visible:t,container:a,children:r,className:d,...l}){let[g,N]=mt.useState(!1);mt.useLayoutEffect(()=>{N(!0)},[]),mt.useEffect(()=>{function u(S){S.key==="Escape"&&e&&e.toggleAllRowsSelected(!1)}return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[e]);let p=a??(g?globalThis.document?.body:null);if(!p||!e)return null;let b=t??e.getFilteredSelectedRowModel().rows.length>0;return Ga.createPortal((0,te.jsx)(xo.AnimatePresence,{children:b&&(0,te.jsx)(xo.motion.div,{role:"toolbar","aria-orientation":"horizontal",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3,ease:"easeInOut"},className:o("fixed inset-x-0 bottom-6 z-50 mx-auto flex w-fit flex-wrap items-center justify-center gap-2 rounded-xl border bg-primary/10 backdrop-blur-sm p-3 text-foreground ring-5 ring-primary/5",d),...l,children:(0,te.jsx)(Ct,{children:r})})}),p)}function Uo({size:e="sm",tooltip:t,isPending:a,disabled:r,className:d,children:l,...g}){let N=(0,te.jsx)(h,{variant:"secondary",size:e,className:o("gap-1.5 rounded-lg border border-secondary bg-secondary/50 hover:bg-secondary/70 transition-all duration-200",e==="icon"?"size-8":"h-8 px-3",d),disabled:r||a,...g,children:a?(0,te.jsx)(ho.Loader,{className:"animate-spin"}):l});return t?(0,te.jsxs)(lt,{children:[(0,te.jsx)(dt,{asChild:!0,children:N}),(0,te.jsx)(ct,{sideOffset:8,className:"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden",children:(0,te.jsx)("p",{children:t})})]}):N}function Wo({table:e}){let t=mt.useCallback(()=>{e&&e.toggleAllRowsSelected(!1)},[e]);return e?(0,te.jsxs)("div",{className:"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3",children:[(0,te.jsxs)("span",{className:"whitespace-nowrap text-sm font-medium",children:[e.getFilteredSelectedRowModel().rows.length," selected"]}),(0,te.jsx)(ro,{orientation:"vertical",className:"mr-2 ml-3 data-[orientation=vertical]:h-4"}),(0,te.jsxs)(lt,{children:[(0,te.jsx)(dt,{asChild:!0,children:(0,te.jsx)(h,{variant:"ghost",size:"icon",className:"size-6 rounded-md",onClick:t,children:(0,te.jsx)(ho.X,{className:"size-3.5"})})}),(0,te.jsxs)(ct,{sideOffset:10,className:"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foregroun bg-secondary [&>span]:hidden",children:[(0,te.jsx)("p",{children:"Clear selection"}),(0,te.jsx)("kbd",{className:"select-none rounded border bg-primary/50 px-2 py-1 font-mono font-normal text-[0.7rem] text-foreground shadow-sm",children:(0,te.jsx)("abbr",{title:"Escape",className:"no-underline",children:"Esc"})})]})]})]}):null}var ja=require("lucide-react");var $a=require("react/jsx-runtime");var Ua=require("lucide-react");var Wa=require("react/jsx-runtime");var $n=require("radix-ui"),qa=require("class-variance-authority");var Un=require("react/jsx-runtime"),Ms=(0,qa.cva)("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});var Ja=require("lucide-react"),qo=require("react/jsx-runtime");var q=require("react"),Xo=require("lucide-react");var _e=require("lucide-react");var x=require("react/jsx-runtime");function Jo({fields:e,filters:t,globalFilter:a,onGlobalFilterChange:r,fieldFilters:d,onFieldFilterChange:l,sortField:g,sortDirection:N,onSortChange:p,selectedCount:b,totalCount:u,visibleCount:S,onExport:E,onRefresh:_,loading:F,onClearFilters:k,onClearSorting:j}){let G=e.filter(C=>C.sortable),P=Object.values(d).some(C=>C!=null&&C!=="")||a!=="",ne=g!=="";return(0,x.jsx)("div",{className:"rounded-xl p-0.5",children:(0,x.jsx)("div",{className:"px-2",children:(0,x.jsx)("div",{className:"flex flex-col gap-6",children:(0,x.jsxs)("div",{className:"flex items-center justify-between",children:[(0,x.jsx)("div",{className:"flex items-center gap-3",children:t.length>0&&(0,x.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,x.jsx)("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:(0,x.jsx)(_e.Filter,{className:"h-4 w-4"})}),t.map(C=>(0,x.jsx)("div",{className:"relative min-w-[150px]",children:C.type==="select"?(0,x.jsxs)(_t,{value:d[C.key]||"all",onValueChange:$=>l(C.key,$),children:[C.icon&&(0,x.jsx)(C.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),(0,x.jsx)(Ht,{className:o("h-9 rounded-lg w-full",C.icon&&"pl-9"),children:(0,x.jsx)(Vt,{placeholder:C.placeholder||"Select..."})}),(0,x.jsxs)(Et,{className:"rounded-lg",children:[(0,x.jsx)(St,{value:"all",children:"All"}),C.options?.map($=>(0,x.jsx)(St,{value:$.value,children:$.label},$.value))]})]}):(0,x.jsxs)("div",{className:"relative",children:[C.icon&&(0,x.jsx)(C.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),(0,x.jsx)(Ft,{type:C.type,placeholder:C.placeholder,value:d[C.key]||"",onChange:$=>l(C.key,$.target.value),className:o("h-9 rounded-lg",C.icon&&"pl-9")})]})},String(C.key)))]})}),(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsxs)("div",{className:"relative",children:[(0,x.jsx)(_e.Search,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,x.jsx)(Ft,{placeholder:"Global search...",value:a,onChange:C=>r(C.target.value),className:"pl-9 h-9 rounded-lg max-w-max"})]}),G.length>0&&(0,x.jsxs)(Be,{children:[(0,x.jsx)(Le,{asChild:!0,children:(0,x.jsxs)(h,{variant:"outline",size:"sm",className:"rounded-lg gap-1",children:[(0,x.jsx)("span",{children:"Sort"}),(0,x.jsx)(_e.ChevronDown,{className:"h-4 w-4 opacity-50"})]})}),(0,x.jsxs)(Oe,{align:"end",className:"w-[200px] rounded-lg",children:[(0,x.jsx)(xe,{children:"Sort By"}),(0,x.jsx)(Ne,{}),G.map(C=>(0,x.jsxs)("div",{children:[(0,x.jsxs)(re,{onClick:()=>p(C.key,"asc"),children:[C.label," (A-Z)"]}),(0,x.jsxs)(re,{onClick:()=>p(C.key,"desc"),children:[C.label," (Z-A)"]})]},String(C.key))),ne&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Ne,{}),(0,x.jsx)(re,{onClick:j,children:"Clear All Sorting"})]})]})]}),(0,x.jsxs)(Be,{children:[(0,x.jsx)(Le,{asChild:!0,children:(0,x.jsx)(h,{variant:"outline",size:"sm",className:"rounded-lg",children:(0,x.jsx)(_e.Settings2,{className:"h-4 w-4"})})}),(0,x.jsxs)(Oe,{align:"end",className:"w-[200px] rounded-lg",children:[(0,x.jsx)(xe,{children:"Table Settings"}),(0,x.jsx)(Ne,{}),(0,x.jsx)(re,{onClick:j,children:"Clear All Sorting"}),(0,x.jsx)(re,{onClick:k,children:"Clear All Filters"})]})]}),E&&(0,x.jsxs)(h,{variant:"outline",size:"sm",onClick:E,className:"rounded-lg",children:[(0,x.jsx)(_e.Download,{className:"mr-2 h-4 w-4"}),"Export"]}),_&&(0,x.jsx)(h,{variant:"outline",size:"sm",onClick:_,disabled:F,className:"rounded-lg",children:(0,x.jsx)(_e.RefreshCw,{className:o("h-4 w-4",F&&"animate-spin")})})]})]})})})})}var pt=require("lucide-react");var I=require("react/jsx-runtime");function Xa({currentPage:e,totalPages:t,pageSize:a,totalItems:r,onPageChange:d,onPageSizeChange:l,config:g}){if(!g.enabled)return null;let N=g.pageSizeOptions||[10,20,50,100],p=(e-1)*a+1,b=Math.min(e*a,r),u=e>1,S=e<t,E=()=>{let F=[],k=[];for(let j=Math.max(2,e-2);j<=Math.min(t-1,e+2);j++)F.push(j);return e-2>2?k.push(1,"..."):k.push(1),k.push(...F),e+2<t-1?k.push("...",t):t>1&&k.push(t),k};return(0,I.jsx)("div",{className:"rounded-xl",children:(0,I.jsxs)("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4",children:[(0,I.jsx)("div",{className:"flex items-center gap-6 text-sm text-muted-foreground",children:g.showInfo!==!1&&(0,I.jsxs)("span",{children:["Showing ",p," to ",b," of ",r," entries"]})}),(0,I.jsxs)("div",{className:"flex flex-col sm:flex-row items-center gap-4",children:[N&&(0,I.jsxs)("div",{className:"flex items-center gap-2",children:[(0,I.jsx)("span",{className:"text-sm font-medium whitespace-nowrap",children:"Page size:"}),(0,I.jsxs)(_t,{value:`${a}`,onValueChange:_=>l(Number(_)),children:[(0,I.jsx)(Ht,{className:"h-9 w-[70px] rounded-lg",children:(0,I.jsx)(Vt,{})}),(0,I.jsx)(Et,{side:"top",className:"rounded-lg",children:N.map(_=>(0,I.jsx)(St,{value:`${_}`,children:_},_))})]})]}),(0,I.jsxs)("div",{className:"flex items-center gap-2",children:[(0,I.jsxs)(h,{variant:"outline",size:"sm",onClick:()=>d(1),disabled:!u,className:"hidden sm:flex rounded-lg",children:[(0,I.jsx)(pt.ChevronsLeft,{className:"h-4 w-4"}),(0,I.jsx)("span",{className:"sr-only",children:"Go to first page"})]}),(0,I.jsxs)(h,{variant:"outline",size:"sm",onClick:()=>d(e-1),disabled:!u,className:"rounded-lg",children:[(0,I.jsx)(pt.ChevronLeft,{className:"h-4 w-4 sm:mr-2"}),(0,I.jsx)("span",{className:"hidden sm:inline",children:"Previous"}),(0,I.jsx)("span",{className:"sr-only sm:hidden",children:"Go to previous page"})]}),g.showPageNumbers&&t>1&&(0,I.jsx)("div",{className:"hidden sm:flex items-center gap-1",children:E().map((_,F)=>{if(_==="...")return(0,I.jsx)("span",{className:"px-2 py-1 text-sm text-muted-foreground",children:"..."},`dots-${F}`);let k=_;return(0,I.jsx)(h,{variant:k===e?"default":"outline",size:"sm",className:"w-9 h-9 p-0 rounded-lg",onClick:()=>d(k),children:k},k)})}),(0,I.jsxs)("div",{className:"sm:hidden flex items-center gap-2 px-3 py-1 text-sm font-medium bg-muted rounded-lg",children:[e," of ",t]}),(0,I.jsxs)(h,{variant:"outline",size:"sm",onClick:()=>d(e+1),disabled:!S,className:"rounded-lg",children:[(0,I.jsx)("span",{className:"hidden sm:inline",children:"Next"}),(0,I.jsx)(pt.ChevronRight,{className:"h-4 w-4 sm:ml-2"}),(0,I.jsx)("span",{className:"sr-only sm:hidden",children:"Go to next page"})]}),(0,I.jsxs)(h,{variant:"outline",size:"sm",onClick:()=>d(t),disabled:!S,className:"hidden sm:flex rounded-lg",children:[(0,I.jsx)(pt.ChevronsRight,{className:"h-4 w-4"}),(0,I.jsx)("span",{className:"sr-only",children:"Go to last page"})]})]})]})]})})}var O=require("react/jsx-runtime");function Ko({data:e,template:t,fields:a=[],filters:r=[],pagination:d={enabled:!1},settings:l={},header:g,footer:N,className:p="",loading:b=!1,error:u,emptyMessage:S="No items found",emptyIcon:E,onSelectionChange:_,onExport:F,onRefresh:k,onTemplateReady:j,children:G}){let{enableSorting:P=!0,enableFiltering:ne=!0,enableGlobalSearch:C=!0,enableSelection:$=!1,enableExport:Pe=!1,toolbar:Ve=!0,selectionMode:ge="multiple",gridCols:ft={default:3,sm:1,md:2,lg:3,xl:4,"2xl":6},gap:ke=4,aspectRatio:fe="auto",minCardWidth:Ue=350,maxCardWidth:de=350}=l,[De,Ye]=(0,q.useState)(""),[Re,kt]=(0,q.useState)({}),[We,rt]=(0,q.useState)(""),[be,He]=(0,q.useState)("asc"),[ye,Ie]=(0,q.useState)(new Set),[Fe,Me]=(0,q.useState)(1),[Ce,lo]=(0,q.useState)(d.pageSize||12),[Dt,bt]=(0,q.useState)(ft.default),K=(0,q.useMemo)(()=>{let M=[...e];if(C&&De){let W=a.filter(D=>D.searchable!==!1);M=M.filter(D=>W.some(Y=>D[Y.key]?.toString().toLowerCase().includes(De.toLowerCase())))}if(ne&&Object.keys(Re).forEach(W=>{let D=Re[W];if(D!=null&&D!==""){let Y=a.find(ce=>ce.key===W);Y&&(M=M.filter(ce=>{let qe=ce[W];return Y.type==="boolean"?qe===(D==="true"):Y.type==="number"?qe===Number(D):qe?.toString().toLowerCase().includes(String(D).toLowerCase())}))}}),P&&We){let W=a.find(D=>D.key===We);W&&M.sort((D,Y)=>{let ce=D[We],qe=Y[We];if(W.type==="number")return be==="asc"?Number(ce)-Number(qe):Number(qe)-Number(ce);if(W.type==="date"){let ht=new Date(ce),Ee=new Date(qe);return be==="asc"?ht.getTime()-Ee.getTime():Ee.getTime()-ht.getTime()}else{let ht=String(ce).toLowerCase(),Ee=String(qe).toLowerCase();return be==="asc"?ht.localeCompare(Ee):Ee.localeCompare(ht)}})}return M},[e,De,Re,We,be,a,C,ne,P]),vt=(0,q.useMemo)(()=>{if(!d.enabled)return K;let M=(Fe-1)*Ce,W=M+Ce;return K.slice(M,W)},[K,Fe,Ce,d.enabled]),n=Math.ceil(K.length/Ce),v=(0,q.useCallback)(M=>{$&&Ie(W=>{let D=new Set(W);return ge==="single"?(D.clear(),D.add(M)):D.has(M)?D.delete(M):D.add(M),D})},[$,ge]),w=(0,q.useCallback)(()=>{!$||ge==="single"||(ye.size===K.length?Ie(new Set):Ie(new Set(K.map((M,W)=>W))))},[$,ge,ye.size,K.length]),U=(0,q.useCallback)((M,W)=>{kt(D=>({...D,[M]:W})),Me(1)},[]),le=(0,q.useCallback)((M,W)=>{rt(M),He(W)},[]),Rt=(0,q.useCallback)(()=>{Ye(""),kt({}),Me(1)},[]),Jt=(0,q.useCallback)(()=>{rt(""),He("asc")},[]),Mt=(0,q.useMemo)(()=>({getSelectedItems:()=>Array.from(ye).map(M=>K[M]),clearSelection:()=>Ie(new Set),selectAll:w,getFilteredData:()=>K,getTotalCount:()=>e.length,getVisibleCount:()=>K.length,refresh:()=>k?.(),exportData:()=>F?.(K)}),[ye,K,e.length,w,k,F]),zt=(0,q.useRef)(null);zt.current=Mt,(0,q.useEffect)(()=>{j&&zt.current&&j(zt.current)},[]),(0,q.useEffect)(()=>{if($&&_){let M=Array.from(ye).map(W=>K[W]);_(M)}},[ye]);let Xt=o("w-full","overflow-hidden",p),ve=o("grid",`gap-${ke}`,"w-full","mx-auto","items-start"),da={gridTemplateColumns:Dt===0?"repeat(auto-fill, 1fr)":`repeat(auto-fill, minmax(clamp(${Ue}px, calc(100%/${Dt} - ${ke*4}px), ${de}px), 1fr))`,justifyItems:"center",alignItems:"stretch",gridAutoRows:"1fr",gridAutoFlow:"dense"};return u?(0,O.jsx)(tt,{className:"w-full",children:(0,O.jsx)(ot,{className:"flex items-center justify-center py-12",children:(0,O.jsxs)("div",{className:"text-center",children:[(0,O.jsx)("div",{className:"text-red-500 mb-3 text-2xl",children:"\u26A0\uFE0F"}),(0,O.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:u}),k&&(0,O.jsxs)(h,{variant:"outline",size:"sm",onClick:k,children:[(0,O.jsx)(Xo.Loader2,{className:"mr-2 h-4 w-4"}),"Try Again"]})]})})}):(0,O.jsxs)("div",{className:o("w-full flex gap-2 flex-col h-full",Xt),children:[g&&(0,O.jsx)(tt,{className:"shadow-sm border-0 py-0 text-xl font-bold",children:(0,O.jsx)(ot,{className:"p-2",children:g})}),Ve&&(0,O.jsx)(Jo,{fields:a,filters:r,globalFilter:De,onGlobalFilterChange:Ye,fieldFilters:Re,onFieldFilterChange:U,sortField:We,sortDirection:be,onSortChange:le,selectedCount:ye.size,totalCount:e.length,visibleCount:K.length,onExport:Pe?()=>F?.(K):void 0,onRefresh:k,loading:b,onClearFilters:Rt,onClearSorting:Jt}),(0,O.jsx)(tt,{className:"border-0 overflow-auto shadow-none py-0 p-2 flex-1",children:(0,O.jsx)(ot,{className:"px-0",children:(0,O.jsxs)("div",{className:"relative",children:[b&&(0,O.jsx)("div",{className:"absolute inset-0 bg-background/80 backdrop-blur-sm z-50 flex items-center justify-center rounded-lg",children:(0,O.jsxs)("div",{className:"flex items-center gap-3 bg-background/90 px-4 py-3 rounded-lg shadow-sm",children:[(0,O.jsx)(Xo.Loader2,{className:"size-5 animate-spin text-primary"}),(0,O.jsx)("span",{className:"text-sm font-medium text-muted-foreground",children:"Loading..."})]})}),vt.length>0?(0,O.jsx)("div",{className:o(ve),style:da,children:vt.map((M,W)=>{let D=d.enabled?(Fe-1)*Ce+W:W,Y=ye.has(D);return(0,O.jsxs)("div",{className:o("relative h-full w-full flex flex-col","transition-all duration-200 overflow-hidden","rounded-2xl","border border-border/20 hover:border-border/50",fe==="square"?"aspect-square":"",fe==="video"?"aspect-video":"",$?"cursor-pointer":"",Y?"ring-2 ring-primary":""),onClick:()=>$&&v(D),children:[$&&ge==="multiple"&&(0,O.jsx)("div",{className:"absolute top-2 right-2 z-10",children:(0,O.jsx)(Nt,{checked:Y,onCheckedChange:()=>v(D),className:"bg-background/80 backdrop-blur-sm",onClick:ce=>ce.stopPropagation()})}),t(M,W,Y,()=>v(D))]},D)})}):(0,O.jsxs)("div",{className:"flex flex-col gap-4 items-center justify-center py-12 text-center",children:[(0,O.jsx)("div",{className:"text-6xl",children:E||"\u{1F4CB}"}),(0,O.jsx)("p",{className:"text-lg font-medium text-muted-foreground mb-2",children:S}),(De||Object.values(Re).some(M=>M))&&(0,O.jsx)(h,{variant:"outline",onClick:Rt,children:"Clear Filters"})]})]})})}),d.enabled&&(0,O.jsx)("div",{className:"pb-1",children:(0,O.jsx)(Xa,{currentPage:Fe,totalPages:n,pageSize:Ce,totalItems:K.length,onPageChange:Me,onPageSizeChange:M=>{lo(M),Me(1)},config:d})}),N&&(0,O.jsx)("div",{className:"p-2 m-0.5",children:N}),G&&G(Mt)]})}var yo=require("lucide-react"),Co=require("framer-motion"),ut=It(require("react"),1),Ka=It(require("react-dom"),1),oe=require("react/jsx-runtime");function Yo({controller:e,visible:t,container:a,children:r,className:d,...l}){let[g,N]=ut.useState(!1);ut.useLayoutEffect(()=>{N(!0)},[]),ut.useEffect(()=>{function S(E){E.key==="Escape"&&e&&e.clearSelection()}return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[e]);let p=a??(g?globalThis.document?.body:null);if(!p||!e)return null;let b=e.getSelectedItems(),u=t??b.length>0;return Ka.createPortal((0,oe.jsx)(Co.AnimatePresence,{children:u&&(0,oe.jsx)(Co.motion.div,{role:"toolbar","aria-orientation":"horizontal",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3,ease:"easeInOut"},className:o("fixed inset-x-0 bottom-6 z-50 mx-auto flex w-fit flex-wrap items-center justify-center gap-2 rounded-xl border bg-primary/10 backdrop-blur-sm p-3 text-foreground ring-8 ring-primary/5",d),...l,children:(0,oe.jsx)(Ct,{children:r})})}),p)}function Zo({size:e="sm",variant:t="secondary",tooltip:a,isPending:r,disabled:d,className:l,children:g,onClick:N,...p}){let b=(0,oe.jsx)(h,{variant:t,size:e,className:o("gap-1.5 rounded-lg border border-secondary bg-secondary/50 hover:bg-secondary/70 transition-all duration-200",e==="icon"?"size-8":"h-8 px-3",l),disabled:d||r,onClick:N,...p,children:r?(0,oe.jsx)(yo.Loader,{className:"animate-spin"}):g});return a?(0,oe.jsxs)(lt,{children:[(0,oe.jsx)(dt,{asChild:!0,children:b}),(0,oe.jsx)(ct,{sideOffset:8,className:"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden",children:(0,oe.jsx)("p",{children:a})})]}):b}function Qo({controller:e}){let t=ut.useCallback(()=>{e&&e.clearSelection()},[e]);if(!e)return null;let a=e.getSelectedItems();return(0,oe.jsxs)("div",{className:"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3",children:[(0,oe.jsxs)("span",{className:"whitespace-nowrap text-sm font-medium",children:[a.length," selected"]}),(0,oe.jsx)(ro,{orientation:"vertical",className:"mr-2 ml-3 data-[orientation=vertical]:h-4"}),(0,oe.jsxs)(lt,{children:[(0,oe.jsx)(dt,{asChild:!0,children:(0,oe.jsx)(h,{variant:"ghost",size:"icon",className:"size-6 rounded-md",onClick:t,children:(0,oe.jsx)(yo.X,{className:"size-3.5"})})}),(0,oe.jsxs)(ct,{sideOffset:10,className:"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foreground bg-secondary [&>span]:hidden",children:[(0,oe.jsx)("p",{children:"Clear selection"}),(0,oe.jsx)("kbd",{className:"select-none rounded border bg-primary/50 px-2 py-1 font-mono font-normal text-[0.7rem] text-foreground shadow-sm",children:(0,oe.jsx)("abbr",{title:"Escape",className:"no-underline",children:"Esc"})})]})]})]})}var Za=require("react/jsx-runtime"),Wn={none:"gap-0",tight:"gap-2",default:"gap-4",loose:"gap-6","extra-loose":"gap-8"},qn={none:"p-0",tight:"p-2",default:"p-4",loose:"p-6"},Ya=({children:e,className:t,spacing:a="tight",padding:r="none"})=>(0,Za.jsx)("div",{className:o("flex flex-col h-full",Wn[a],qn[r],t),children:e});var so=require("lucide-react");var Qa=require("react-router"),J=require("react/jsx-runtime"),en=({className:e,columns:t=[],showBackButton:a=!0,meta:r={title:""}})=>{let d=()=>{if(!r.backAction||!a)return null;let u={variant:"secondary",size:"icon",className:"hover:bg-primary/20 inline-flex"};return r.backAction.href?(0,J.jsx)(Qa.NavLink,{to:r.backAction.href,children:(0,J.jsxs)(h,{...u,children:[(0,J.jsx)(so.ArrowLeftIcon,{className:"size-6"}),r.backAction.content]})}):(0,J.jsxs)(h,{...u,onClick:r.backAction.onClick,children:[(0,J.jsx)(so.ArrowLeftIcon,{className:"size-6"}),r.backAction.content]})},l=()=>!r.metadata||r.metadata.length===0?null:(0,J.jsx)("div",{className:"flex gap-4",children:r.metadata.map((u,S)=>u.value&&(0,J.jsxs)("div",{className:"text-sm",children:[(0,J.jsxs)("span",{className:"text-muted-foreground",children:[u.label," "]}),(0,J.jsx)("span",{children:u.value})]},S))}),g=()=>r.status?(0,J.jsx)("span",{className:o("inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",{success:"bg-green-100 text-green-800",warning:"bg-yellow-100 text-yellow-800",critical:"bg-red-100 text-red-800",info:"bg-blue-100 text-blue-800",default:"bg-gray-100 text-gray-800"}[r.status.color]),children:r.status.content}):null,N={content:(0,J.jsxs)("div",{className:"flex gap-2 items-center",children:[d(),(0,J.jsxs)("div",{className:"flex flex-col gap-2 w-max",children:[(0,J.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:r.title}),g(),r.description&&(0,J.jsx)("p",{className:"text-muted-foreground",children:r.description}),l(),r.breadcrumbs&&r.breadcrumbs.length>0&&(0,J.jsx)("div",{className:"flex items-center text-sm text-muted-foreground",children:r.breadcrumbs.map((u,S)=>(0,J.jsxs)("div",{className:"flex items-center",children:[u.href?(0,J.jsx)("span",{className:"hover:text-primary hover:underline",children:u.label}):(0,J.jsx)("span",{children:u.label}),S<r.breadcrumbs.length-1&&(0,J.jsx)(so.ChevronRight,{className:"mx-2 h-4 w-4"})]},S))})]})]}),align:"left",width:"fill"},p={content:r.primaryActions,align:"right",width:"auto"},b=[N,...t.filter(u=>u!==void 0),p];return(0,J.jsx)("div",{className:o("flex items-center w-full gap-4 p-2",e),children:b.map((u,S)=>(0,J.jsx)("div",{className:o("flex items-center h-full",u.className,{"justify-start":u.align==="left","justify-center":u.align==="center","justify-end":u.align==="right","flex-1":u.width==="fill"}),children:u.content},S))})};var gt=It(require("react"),1);var Gt=require("radix-ui"),tn=require("lucide-react");var je=require("react/jsx-runtime");function on({...e}){return(0,je.jsx)(Gt.Dialog.Root,{"data-slot":"sheet",...e})}function ea({...e}){return(0,je.jsx)(Gt.Dialog.Portal,{"data-slot":"sheet-portal",...e})}function Jn({className:e,...t}){return(0,je.jsx)(Gt.Dialog.Overlay,{"data-slot":"sheet-overlay",className:o("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function an({className:e,children:t,side:a="right",...r}){return(0,je.jsxs)(ea,{children:[(0,je.jsx)(Jn,{}),(0,je.jsxs)(Gt.Dialog.Content,{"data-slot":"sheet-content",className:o("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",a==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",a==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",a==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",a==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...r,children:[t,(0,je.jsxs)(Gt.Dialog.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[(0,je.jsx)(tn.XIcon,{className:"size-4"}),(0,je.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}var H=require("react/jsx-runtime"),nn=(0,gt.createContext)(!1),wo={"one-half":["w-1/2","w-1/2"],"one-third":["w-1/3","w-2/3"],"two-third":["w-2/3","w-1/3"],"one-fourth":["w-1/4","w-3/4"],"three-fourth":["w-3/4","w-1/4"],"one-fifth":["w-1/5","w-4/5"],"four-fifth":["w-4/5","w-1/5"]},jt={none:"p-0",tight:"p-2",default:"p-4",loose:"p-6"},Xn=(e,t)=>{let[a,r]=wo[t];return{container:"inset-y-0 z-50 transition-all duration-500 ease-in-out",content:o("h-full bg-background transition-all duration-500 ease-in-out",e==="right"?"border-l":"border-r"),transform:e==="right"?"translate-x-full":"-translate-x-full",transformOpen:"translate-x-0",contentPushClass:e==="right"?r:a,sheetPushClass:e==="right"?a:r}},Kn="flex flex-col overflow-hidden rounded-2xl relative",Yn={default:"bg-background",card:"bg-background shadow-sm border",border:"bg-background border-2",transparent:"bg-transparent"},rn=e=>{let{children:t,className:a,variant:r="default",layout:d="full",header:l,footer:g,headerClassName:N,contentClassName:p,footerClassName:b,parentContainer:u=!1,padding:S=u?"none":"tight"}=e,E=(0,gt.useContext)(nn),[_,F]=(0,gt.useState)(!1),k=gt.default.useCallback(G=>(0,H.jsx)("div",{className:o("flex-1 overflow-auto h-full no-scrollbar",u&&"flex",!u&&jt[S],p),children:G}),[S,u,p]),j=()=>{switch(d){case"split":{let{splitRatio:G="three-fourth",reverse:P=!1}=e;if(!Array.isArray(t)||t.length!==2)return(0,H.jsx)("div",{className:"flex items-center justify-center h-full text-red-500",children:'Error: AppContent with layout="split" requires exactly 2 children'});let[ne,C]=wo[G],[$,Pe]=P?[t[1],t[0]]:[t[0],t[1]],[Ve,ge]=P?[C,ne]:[ne,C];return(0,H.jsxs)("div",{className:"flex h-full gap-2",children:[(0,H.jsx)("div",{className:o(Ve,"overflow-auto"),children:k($)}),(0,H.jsx)("div",{className:o(ge,"overflow-auto"),children:k(Pe)})]})}case"with-sheet":{let{sheetContent:G,sheetWidth:P="four-fifth",sheetSide:ne="right",sheetMode:C="container",sheetClassName:$,isSheetOpen:Pe,onSheetOpenChange:Ve,disableOverlay:ge=!0,showSheetOverlay:ft=!0}=e,ke=Pe!==void 0&&Ve,fe=ke?Pe:_,Ue=ke?Ve:F;if(C==="container"){let de=Xn(ne,P),De=wo[P][0];return ge?(0,H.jsxs)("div",{className:o("flex relative flex-1 overflow-hidden",p),children:[(0,H.jsx)("div",{className:o("h-full overflow-auto transition-all duration-500",fe?de.contentPushClass:"w-full",fe&&"overflow-y-auto overflow-x-hidden"),children:(0,H.jsx)("div",{className:o("h-full",!u&&jt[S]),children:t})}),(0,H.jsx)("div",{className:o(de.container,"transition-all duration-500 ease-in-out h-full",De,fe&&["left","right"].includes(ne)?o(de.sheetPushClass,"overflow-y-auto"):fe?de.transformOpen:o(de.transform,"hidden"),"overflow-y-auto"),children:(0,H.jsx)("div",{className:o(de.content,$,"h-full"),children:G})})]}):(0,H.jsxs)("div",{className:o("flex relative flex-1 overflow-hidden",p),children:[(0,H.jsx)("div",{className:o("h-full overflow-auto w-full transition-all duration-500 relative z-10"),children:(0,H.jsx)("div",{className:o("h-full",!u&&jt[S]),children:t})}),(0,H.jsxs)("div",{className:o("absolute inset-0 z-20",!fe&&"pointer-events-none"),children:[ft&&(0,H.jsx)("div",{className:o("absolute inset-0 bg-black/50 transition-opacity duration-500",fe?"opacity-100":"opacity-0 pointer-events-none"),onClick:()=>Ue(!1)}),(0,H.jsx)("div",{className:o(de.container,"transition-all duration-500 backdrop-blur-2xl ease-in-out h-full absolute",De,fe?"translate-x-0 opacity-100":o(ne==="right"?"translate-x-full":"-translate-x-full","opacity-0 pointer-events-none"),"overflow-y-auto"),style:{[ne]:0},tabIndex:-1,children:(0,H.jsx)("div",{className:o(de.content,$,"h-full"),children:G})})]})]})}return(0,H.jsxs)(H.Fragment,{children:[t,(0,H.jsx)(on,{open:fe,onOpenChange:Ue,children:(0,H.jsx)(ea,{children:(0,H.jsx)(an,{side:ne,className:o("fixed bg-background border sm:max-w-full","transition-all duration-500 ease-in-out",wo[P][0],$),children:G})})})]})}default:return k(t)}};return(0,H.jsx)(nn.Provider,{value:!0,children:(0,H.jsxs)("div",{className:o(Kn,Yn[r],jt[S],E&&"flex-1",u&&"h-full",!u&&"rounded-2xl",a),children:[l&&(0,H.jsx)("div",{className:o("border-b",N,r==="card"&&!u&&"rounded-t-2xl",r==="border"&&"border-b-2",jt[S]),children:l}),j(),g&&(0,H.jsx)("div",{className:o("border-t",b,r==="card"&&!u&&"rounded-b-2xl",r==="border"&&"border-t-2",jt[S]),children:g})]})})};var No=require("react/jsx-runtime"),sn=({className:e,columns:t=[],meta:a={title:""}})=>{let r={content:(0,No.jsx)("div",{className:"flex items-center gap-4 p-2",children:a.secondaryActions}),align:"right",width:"fill"},d=[...t.filter(l=>l!==void 0),r];return(0,No.jsx)("div",{className:o("flex items-center w-full gap-4",e),children:d.map((l,g)=>(0,No.jsx)("div",{className:o("flex items-center h-full",l.className,{"justify-start":l.align==="left","justify-center":l.align==="center","justify-end":l.align==="right","flex-1":l.width==="fill"}),children:l.content},g))})};var io=require("react/jsx-runtime");function ln({useTypedAppMeta:e}){return{AppHeader:l=>{let{meta:g}=e();return(0,io.jsx)(en,{...l,meta:g})},AppFooter:l=>{let{meta:g}=e();return(0,io.jsx)(sn,{...l,meta:g})},AppContent:l=>(0,io.jsx)(rn,{...l}),AppContainer:l=>(0,io.jsx)(Ya,{...l})}}var ue=require("react"),ta=require("react/jsx-runtime"),Zn=(0,ue.createContext)(void 0),dn=({children:e})=>{let[t,a]=(0,ue.useState)({title:"",description:"",breadcrumbs:[]}),r=(0,ue.useCallback)(g=>{a(N=>Object.keys(g).some(b=>JSON.stringify(N[b])!==JSON.stringify(g[b]))?{...N,...g}:N)},[]),d=(0,ue.useCallback)(()=>{a(g=>g.title===""&&g.description===""&&(g.breadcrumbs?.length??0)===0?g:{title:"",description:"",breadcrumbs:[]})},[]),l=(0,ue.useMemo)(()=>({meta:t,setMeta:r,resetMeta:d}),[t,r,d]);return(0,ta.jsx)(Zn.Provider,{value:l,children:e})};function cn(){let e=(0,ue.createContext)(void 0);return{TypedAppMetaProvider:({children:r})=>{let[d,l]=(0,ue.useState)({title:"",description:"",breadcrumbs:[]}),g=(0,ue.useCallback)(b=>{l(u=>Object.keys(b).some(E=>{let _=u[E],F=b[E];return JSON.stringify(_)!==JSON.stringify(F)})?{...u,...b}:u)},[]),N=(0,ue.useCallback)(()=>{l(b=>b.title===""&&b.description===""&&(b.breadcrumbs?.length??0)===0?b:{title:"",description:"",breadcrumbs:[]})},[]),p=(0,ue.useMemo)(()=>({meta:d,setMeta:g,resetMeta:N}),[d,g,N]);return(0,ta.jsx)(e.Provider,{value:p,children:r})},useTypedAppMeta:()=>{let r=(0,ue.useContext)(e);if(!r)throw new Error("useTypedAppMeta must be used within a TypedAppMetaProvider");return r},TypedAppMetaContext:e}}var $t=require("react");function mn({useTypedAppMeta:e}){function t(a){let{setMeta:r,resetMeta:d}=e(),l=(0,$t.useMemo)(()=>{if(a.backAction)return{...a.backAction,onClick:a.backAction.onClick}},[a.backAction?.content,a.backAction?.href,a.backAction?.onClick?.toString()]),g=(0,$t.useMemo)(()=>a.metadata,[JSON.stringify(a.metadata)]),N=(0,$t.useMemo)(()=>({...a,backAction:l,metadata:g}),[a.title,a.description,a.breadcrumbs,a.primaryActions,a.secondaryActions,a.pagination,a.status,l,g]);(0,$t.useEffect)(()=>(r(N),()=>d()),[N,r,d])}return{usePageTemplate:t}}var oa=require("react"),Ut=require("lucide-react");var Ae=require("react/jsx-runtime"),To=class{static currencyFormatter=new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",maximumFractionDigits:2});static compactFormatter=new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",notation:"compact",maximumFractionDigits:1});static MONTH_NAMES_SHORT=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];static async copyToClipboard(t){if(t)try{await navigator.clipboard.writeText(t)}catch(a){throw console.error("Failed to copy text:",a),a}}static CopyToClipboard=({text:t,children:a,className:r,size:d="icon",variant:l="ghost"})=>{let[g,N]=(0,oa.useState)(!1),[p,b]=(0,oa.useState)(!1),u=async()=>{if(!(!t||p)){b(!0);try{await this.copyToClipboard(t),N(!0),setTimeout(()=>N(!1),2e3)}catch(S){console.error("Failed to copy text:",S)}finally{b(!1)}}};return(0,Ae.jsxs)(lt,{children:[(0,Ae.jsx)(dt,{asChild:!0,children:(0,Ae.jsx)(h,{variant:l,size:d,className:o(d==="icon"&&"size-6",r),onClick:u,disabled:p||!t,children:p?(0,Ae.jsx)(Ut.Loader2Icon,{className:"animate-spin"}):g?(0,Ae.jsx)(Ut.Check,{className:"h-3 w-3"}):a||(0,Ae.jsx)(Ut.Copy,{className:"h-3 w-3"})})}),(0,Ae.jsx)(ct,{children:g?"Copied!":p?"Copying...":"Copy to clipboard"})]})};static formatINR(t,a={}){let{prefix:r="",suffix:d="",withSymbol:l=!0,compact:g=!1}=a;if(typeof t!="number"||isNaN(t))return`${r}${l?"\u20B9 ":""}0.00${d}`;let N=t<0,p=Math.abs(t),u=(g&&p>=1e5?this.compactFormatter:this.currencyFormatter).format(p).replace("\u20B9","");return`${r}${N?"- ":""}${l?"\u20B9 ":""}${u}${d}`}static formatDate(t,a={}){let{format:r="dd-mm-yyyy",separator:d="-"}=a,l=new Date(t);if(isNaN(l.getTime()))return"";let g=String(l.getDate()).padStart(2,"0"),N=String(l.getMonth()+1).padStart(2,"0"),p=this.MONTH_NAMES_SHORT[l.getMonth()],b=l.getFullYear();switch(r){case"dd-mmm-yyyy":return`${g}${d}${p}${d}${b}`;case"iso":return l.toISOString().split("T")[0];case"long":return l.toLocaleDateString("en-IN",{year:"numeric",month:"long",day:"numeric"});case"short":return l.toLocaleDateString("en-IN");default:return`${g}${d}${N}${d}${b}`}}static toProperCase(t){return t?t.toLowerCase().split(" ").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "):""}static toProperCaseAdvanced(t){return t?t.toLowerCase().split(/(\s+|['-])/).map((a,r,d)=>["-","'"," "].includes(a)||r>0&&["-","'"].includes(d[r-1])?a:a.charAt(0).toUpperCase()+a.slice(1)).join(""):""}static StatusBadge=({status:t,className:a,showDot:r=!0,capitalize:d=!0,size:l="md",variant:g="outline",customColors:N,icon:p,trueMessage:b="active",falseMessage:u="inactive"})=>{let S=typeof t=="boolean"?t?b:u:typeof t=="number"?t>0?b:u:t.toLowerCase(),E={active:{label:"active",solid:{bg:"bg-emerald-500",text:"text-white",border:"border-emerald-600",dot:"bg-white"},outline:{bg:"bg-emerald-50",text:"text-emerald-700",border:"border-emerald-100",dot:"bg-emerald-500"},subtle:{bg:"bg-emerald-50",text:"text-emerald-700",border:"border-transparent",dot:"bg-emerald-500"}},pending:{label:"pending",solid:{bg:"bg-amber-500",text:"text-white",border:"border-amber-600",dot:"bg-white"},outline:{bg:"bg-amber-50",text:"text-amber-700",border:"border-amber-100",dot:"bg-amber-500"},subtle:{bg:"bg-amber-50",text:"text-amber-700",border:"border-transparent",dot:"bg-amber-500"}},inactive:{label:"inactive",solid:{bg:"bg-rose-500",text:"text-white",border:"border-rose-600",dot:"bg-white"},outline:{bg:"bg-rose-50",text:"text-rose-700",border:"border-rose-100",dot:"bg-rose-500"},subtle:{bg:"bg-rose-50",text:"text-rose-700",border:"border-transparent",dot:"bg-rose-500"}},draft:{label:"draft",solid:{bg:"bg-gray-500",text:"text-white",border:"border-gray-600",dot:"bg-white"},outline:{bg:"bg-gray-50",text:"text-gray-700",border:"border-gray-100",dot:"bg-gray-500"},subtle:{bg:"bg-gray-50",text:"text-gray-700",border:"border-transparent",dot:"bg-gray-500"}},completed:{label:"completed",solid:{bg:"bg-indigo-500",text:"text-white",border:"border-indigo-600",dot:"bg-white"},outline:{bg:"bg-indigo-50",text:"text-indigo-700",border:"border-indigo-100",dot:"bg-indigo-500"},subtle:{bg:"bg-indigo-50",text:"text-indigo-700",border:"border-transparent",dot:"bg-indigo-500"}}},_=E[S.toLowerCase()]||E.inactive,F=N||_[g],k={sm:"text-xs px-2 py-0.5",md:"text-xs px-2.5 py-0.5",lg:"text-sm px-3 py-1"},j=d?S.charAt(0).toUpperCase()+S.slice(1):S;return(0,Ae.jsx)("div",{className:"flex justify-center",children:(0,Ae.jsxs)("span",{className:o("inline-flex items-center gap-1.5 rounded-full border font-medium",F.bg,F.text,F.border,k[l],a),children:[r&&(p?(0,Ae.jsx)("span",{className:"flex items-center",children:p}):(0,Ae.jsx)("span",{className:o("size-2 rounded-full",F.dot),"aria-hidden":"true"})),j]})})}};var pn=require("lucide-react"),Wt=require("react-router"),X=require("react/jsx-runtime"),aa=()=>{let e=(0,Wt.useRouteError)(),t=(0,Wt.useNavigate)();return(0,X.jsx)("div",{className:"rounded-2xl flex justify-center items-center h-full bg-sidebar px-4",children:(0,X.jsxs)("div",{className:"flex flex-col items-center space-y-4 text-center",children:[(0,X.jsx)(pn.AlertTriangleIcon,{className:"h-16 w-16 text-destructive"}),(0,Wt.isRouteErrorResponse)(e)?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)("h2",{className:"text-3xl font-semibold text-destructive",children:["Error ",e.status,": ",e.statusText]}),typeof e.data=="string"?(0,X.jsx)("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:e.data}):e.data?.message&&(0,X.jsx)("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:e.data.message})]}):e instanceof Error?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)("h2",{className:"text-3xl font-semibold text-destructive",children:"Unexpected Error"}),(0,X.jsx)("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:e.message}),e.stack&&(0,X.jsxs)("details",{className:"mt-2 text-sm text-muted-foreground max-w-4xl text-left",children:[(0,X.jsx)("summary",{className:"cursor-pointer underline",children:"Stack Trace"}),(0,X.jsx)("pre",{className:"whitespace-pre-wrap",children:e.stack})]})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)("h2",{className:"text-3xl font-semibold text-destructive",children:"Unknown Error"}),(0,X.jsx)("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:typeof e=="string"?e:JSON.stringify(e,null,2)})]}),(0,X.jsx)(h,{variant:"outline",onClick:()=>t(-1),children:"Go Back"})]})})};var Xe=require("framer-motion");var A=require("react/jsx-runtime");function Qn({size:e=100,strokeWidth:t=2,color:a="currentColor",className:r=""}){return(0,A.jsxs)(Xe.motion.svg,{width:e,height:e,viewBox:"0 0 100 100",initial:"hidden",animate:"visible",className:r,children:[(0,A.jsx)("title",{children:"Animated Checkmark"}),(0,A.jsx)(Xe.motion.circle,{cx:"50",cy:"50",r:"40",stroke:a,custom:0,style:{strokeWidth:t,strokeLinecap:"round",fill:"transparent"}}),(0,A.jsx)(Xe.motion.path,{d:"M30 50L45 65L70 35",stroke:a,custom:1,style:{strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round",fill:"transparent"}})]})}function na(){return(0,A.jsx)(tt,{className:"w-full max-w-sm mx-auto p-6 min-h-[300px] flex flex-col justify-center bg-background",children:(0,A.jsxs)(ot,{className:"space-y-4 flex flex-col items-center justify-center",children:[(0,A.jsx)(Xe.motion.div,{className:"flex justify-center",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{duration:.4,ease:[.4,0,.2,1],scale:{type:"spring",damping:15,stiffness:200}},children:(0,A.jsxs)("div",{className:"relative",children:[(0,A.jsx)(Xe.motion.div,{className:"absolute inset-0 bg-primary/5 rounded-full",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:.2,duration:.8,ease:"circOut"}}),(0,A.jsx)(Qn,{size:80,strokeWidth:4,color:"rgb(16 185 129)",className:"relative z-10 dark:drop-shadow-[0_0_10px_rgba(0,0,0,0.1)]"})]})}),(0,A.jsxs)(Xe.motion.div,{className:"space-y-2 text-center w-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.2,duration:.6,ease:[.4,0,.2,1]},children:[(0,A.jsx)(Xe.motion.h2,{className:"text-lg text-zinc-100 dark:text-zinc-900 tracking-tighter font-semibold uppercase",initial:{opacity:0,y:5},animate:{opacity:1,y:0},transition:{delay:1,duration:.4},children:"Transfer Successful"}),(0,A.jsx)("div",{className:"flex items-center gap-4",children:(0,A.jsx)(Xe.motion.div,{className:"flex-1 bg-zinc-800/50 dark:bg-zinc-50/50 rounded-xl p-3 border border-zinc-700/50 dark:border-zinc-200/50 backdrop-blur-md",initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{delay:1.2,duration:.4,ease:[.4,0,.2,1]},children:(0,A.jsxs)("div",{className:"flex flex-col items-start gap-2",children:[(0,A.jsxs)("div",{className:"space-y-1.5",children:[(0,A.jsxs)("span",{className:"text-xs font-medium text-secondary-foreground flex items-center gap-1.5",children:[(0,A.jsxs)("svg",{className:"w-3 h-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,A.jsx)("title",{children:"From"}),(0,A.jsx)("path",{d:"M12 19V5M5 12l7-7 7 7"})]}),"From"]}),(0,A.jsxs)("div",{className:"flex items-center gap-2.5 group transition-all",children:[(0,A.jsx)("span",{className:"inline-flex items-center justify-center w-7 h-7 rounded-lg bg-zinc-900 dark:bg-white shadow-lg border border-zinc-700 dark:border-zinc-300 text-sm font-medium text-zinc-100 dark:text-zinc-900 group-hover:scale-105 transition-transform",children:"$"}),(0,A.jsx)("span",{className:"font-medium text-zinc-100 dark:text-zinc-900 tracking-tight",children:"500.00 USD"})]})]}),(0,A.jsx)("div",{className:"w-full h-px bg-gradient-to-r from-transparent via-zinc-700 dark:via-zinc-300 to-transparent"}),(0,A.jsxs)("div",{className:"space-y-1.5",children:[(0,A.jsxs)("span",{className:"text-xs font-medium text-secondary-foreground flex items-center gap-1.5",children:[(0,A.jsxs)("svg",{className:"w-3 h-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,A.jsx)("title",{children:"To"}),(0,A.jsx)("path",{d:"M12 5v14M5 12l7 7 7-7"})]}),"To"]}),(0,A.jsxs)("div",{className:"flex items-center gap-2.5 group transition-all",children:[(0,A.jsx)("span",{className:"inline-flex items-center justify-center w-7 h-7 rounded-lg bg-zinc-900 dark:bg-white shadow-lg border border-zinc-700 dark:border-zinc-300 text-sm font-medium text-zinc-100 dark:text-zinc-900 group-hover:scale-105 transition-transform",children:"\u20AC"}),(0,A.jsx)("span",{className:"font-medium text-zinc-100 dark:text-zinc-900 tracking-tight",children:"460.00 EUR"})]})]})]})})}),(0,A.jsx)(Xe.motion.div,{className:"w-full text-xs text-secondary-foreground mt-2 text-center",initial:{opacity:0},animate:{opacity:1},transition:{delay:1.4,duration:.4},children:"Exchange Rate: 1 USD = 0.92 EUR"})]})]})})}var Pt=require("react/jsx-runtime"),ra=()=>(0,Pt.jsx)("div",{className:"rounded-2xl flex justify-center items-center h-full bg-transparent",children:(0,Pt.jsxs)("div",{className:"flex flex-col items-center space-y-4",children:[(0,Pt.jsx)("div",{className:"animate-spin rounded-full border-t-4 border-ring h-16 w-16 mb-4"}),(0,Pt.jsx)("h2",{className:"text-xl font-semibold text-muted-foreground",children:"Loading, please wait..."}),(0,Pt.jsx)("p",{className:"text-sm text-muted-foreground",children:"Your content is on its way."})]})});var un=require("react-router");var gn=require("lucide-react"),So=require("react-router"),$e=require("react/jsx-runtime"),sa=()=>{let e=(0,un.useLocation)(),t=(0,So.useNavigate)(),a=()=>{window.history.length>2?t(-1):t("/")};return(0,$e.jsxs)("div",{className:"rounded-2xl flex flex-col items-center justify-center h-full p-6 text-center bg-sidebar text-muted-foreground select-none",children:[(0,$e.jsx)(gn.GhostIcon,{className:"h-15 w-15 text-destructive mb-4"}),(0,$e.jsx)("h1",{className:"text-2xl font-bold text-destructive mb-2",children:"Page Not Found"}),(0,$e.jsxs)("p",{className:"text-xl mb-4",children:["The page ",(0,$e.jsx)("code",{className:"px-1 py-0.5 rounded bg-muted text-foreground",children:e.pathname})," doesn't exist or has been moved."]}),(0,$e.jsxs)("div",{className:"flex space-x-4",children:[(0,$e.jsx)(h,{variant:"outline",onClick:a,children:"Go Back"}),(0,$e.jsx)(h,{variant:"ghost",children:(0,$e.jsx)(So.NavLink,{to:"/",children:"Return Home"})})]})]})};var fn=require("lucide-react"),qt=require("react/jsx-runtime"),ia=()=>(0,qt.jsxs)("div",{className:"rounded-2xl flex flex-col items-center justify-center h-screen p-6 text-center text-muted-foreground bg-background select-none",children:[(0,qt.jsx)(fn.WifiOffIcon,{className:"h-15 w-15 text-destructive mb-4"}),(0,qt.jsx)("h1",{className:"text-3xl font-bold text-destructive mb-2",children:"You're offline"}),(0,qt.jsx)("p",{className:"text-xl max-w-md",children:"We couldn't connect to the server."})]});var bn=require("lucide-react");var Po=require("react-router"),Ke=require("react/jsx-runtime"),la=()=>{let e=(0,Po.useNavigate)();return(0,Ke.jsxs)("div",{className:"rounded-2xl flex flex-col items-center justify-center h-full p-6 text-center bg-sidebar text-muted-foreground select-none",children:[(0,Ke.jsx)(bn.ShieldOffIcon,{className:"h-15 w-15 text-destructive mb-4"}),(0,Ke.jsx)("h1",{className:"text-2xl font-bold text-destructive mb-2",children:"Access Denied"}),(0,Ke.jsx)("p",{className:"text-xl mb-4",children:"You don't have permission to view this page. Please sign in with an authorized account or contact your administrator."}),(0,Ke.jsxs)("div",{className:"flex space-x-4",children:[(0,Ke.jsx)(h,{variant:"outline",onClick:()=>{window.history.length>2?e(-1):e("/")},children:"Go Back"}),(0,Ke.jsx)(h,{variant:"ghost",children:(0,Ke.jsx)(Po.NavLink,{to:"/",children:"Go to Home"})})]})]})};0&&(module.exports={AppMetaProvider,CurrencyTransfer,DataTable,DataTableActionBar,DataTableActionBarAction,DataTableActionBarSelection,DataTemplate,DataTemplateActionBar,DataTemplateActionBarAction,DataTemplateActionBarSelection,ErrorComponent,GeneralHelper,Loader,NotFound,OfflineUI,Unauthorized,createLayoutComponents,createPageTemplateHook,createTypedAppMetaContext});
|
|
2
|
+
"use strict";var Ln=Object.create;var fo=Object.defineProperty;var On=Object.getOwnPropertyDescriptor;var _n=Object.getOwnPropertyNames;var Vn=Object.getPrototypeOf,Hn=Object.prototype.hasOwnProperty;var En=(e,t)=>{for(var a in t)fo(e,a,{get:t[a],enumerable:!0})},ha=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of _n(t))!Hn.call(e,c)&&c!==a&&fo(e,c,{get:()=>t[c],enumerable:!(r=On(t,c))||r.enumerable});return e};var zt=(e,t,a)=>(a=e!=null?Ln(Vn(e)):{},ha(t||!e||!e.__esModule?fo(a,"default",{value:e,enumerable:!0}):a,e)),Gn=e=>ha(fo({},"__esModule",{value:!0}),e);var rr={};En(rr,{AppMetaProvider:()=>pn,CurrencyTransfer:()=>la,DataTable:()=>qo,DataTableActionBar:()=>Jo,DataTableActionBarAction:()=>Xo,DataTableActionBarSelection:()=>Ko,DataTemplate:()=>ea,DataTemplateActionBar:()=>ta,DataTemplateActionBarAction:()=>oa,DataTemplateActionBarSelection:()=>aa,ErrorComponent:()=>ia,GeneralHelper:()=>Po,Loader:()=>da,NotFound:()=>ca,OfflineUI:()=>ma,Unauthorized:()=>pa,createLayoutComponents:()=>mn,createPageTemplateHook:()=>gn,createTypedAppMetaContext:()=>un});module.exports=Gn(rr);var Se=require("@tanstack/react-table"),Q=require("lucide-react");var Ca=require("radix-ui"),wa=require("class-variance-authority");var xa=require("clsx"),ya=require("tailwind-merge");function o(...e){return(0,ya.twMerge)((0,xa.clsx)(e))}var Na=require("react/jsx-runtime"),bo=(0,wa.cva)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function v({className:e,variant:t,size:a,asChild:r=!1,...c}){let l=r?Ca.Slot.Slot:"button";return(0,Na.jsx)(l,{"data-slot":"button",className:o(bo({variant:t,size:a,className:e}),"transition-none"),...c})}var et=require("react/jsx-runtime");function Bo({className:e,...t}){return(0,et.jsx)("div",{"data-slot":"table-container",className:"relative w-full h-full max-h-full overflow-auto",children:(0,et.jsx)("table",{"data-slot":"table",className:o("w-full caption-bottom text-sm",e),...t})})}function Ta({className:e,...t}){return(0,et.jsx)("thead",{"data-slot":"table-header",className:o("[&_tr]:border-b",e),...t})}function Sa({className:e,...t}){return(0,et.jsx)("tbody",{"data-slot":"table-body",className:o("[&_tr:last-child]:border-0",e),...t})}function Lo({className:e,...t}){return(0,et.jsx)("tfoot",{"data-slot":"table-footer",className:o("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t})}function tt({className:e,...t}){return(0,et.jsx)("tr",{"data-slot":"table-row",className:o("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function Pa({className:e,...t}){return(0,et.jsx)("th",{"data-slot":"table-head",className:o("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap",e),...t})}function ot({className:e,...t}){return(0,et.jsx)("td",{"data-slot":"table-cell",className:o("p-2 align-middle whitespace-nowrap",e),...t})}var Oo=require("react/jsx-runtime");function at({className:e,...t}){return(0,Oo.jsx)("div",{"data-slot":"card",className:o("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function nt({className:e,...t}){return(0,Oo.jsx)("div",{"data-slot":"card-content",className:o("px-6",e),...t})}var wt=require("radix-ui");var rt=require("react/jsx-runtime");function Nt({delayDuration:e=0,...t}){return(0,rt.jsx)(wt.Tooltip.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function mt({...e}){return(0,rt.jsx)(Nt,{children:(0,rt.jsx)(wt.Tooltip.Root,{"data-slot":"tooltip",...e})})}function pt({...e}){return(0,rt.jsx)(wt.Tooltip.Trigger,{"data-slot":"tooltip-trigger",...e})}function ut({className:e,sideOffset:t=0,children:a,...r}){return(0,rt.jsx)(wt.Tooltip.Portal,{children:(0,rt.jsxs)(wt.Tooltip.Content,{"data-slot":"tooltip-content",sideOffset:t,className:o("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...r,children:[a,(0,rt.jsx)(wt.Tooltip.Arrow,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}var L=require("lucide-react");var ka=require("react/jsx-runtime");function At({className:e,type:t,...a}){return(0,ka.jsx)("input",{type:t,"data-slot":"input",className:o("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...a})}var Tt=require("cmdk"),Ra=require("lucide-react");var jn=require("radix-ui"),$n=require("lucide-react");var Da=require("react/jsx-runtime");var Je=require("react/jsx-runtime");function _o({className:e,...t}){return(0,Je.jsx)(Tt.Command,{"data-slot":"command",className:o("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function Vo({className:e,...t}){return(0,Je.jsxs)("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[(0,Je.jsx)(Ra.SearchIcon,{className:"size-4 shrink-0 opacity-50"}),(0,Je.jsx)(Tt.Command.Input,{"data-slot":"command-input",className:o("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function Ho({className:e,...t}){return(0,Je.jsx)(Tt.Command.List,{"data-slot":"command-list",className:o("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function Eo({...e}){return(0,Je.jsx)(Tt.Command.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function Go({className:e,...t}){return(0,Je.jsx)(Tt.Command.Group,{"data-slot":"command-group",className:o("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}function vo({className:e,...t}){return(0,Je.jsx)(Tt.Command.Item,{"data-slot":"command-item",className:o("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}var we=require("radix-ui"),Yt=require("lucide-react");var le=require("react/jsx-runtime");function Fe({...e}){return(0,le.jsx)(we.DropdownMenu.Root,{"data-slot":"dropdown-menu",...e})}function Be({...e}){return(0,le.jsx)(we.DropdownMenu.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}function Le({className:e,sideOffset:t=4,...a}){return(0,le.jsx)(we.DropdownMenu.Portal,{children:(0,le.jsx)(we.DropdownMenu.Content,{"data-slot":"dropdown-menu-content",sideOffset:t,className:o("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) rounded-md border p-1 shadow-md",e),...a})})}function jo({...e}){return(0,le.jsx)(we.DropdownMenu.Group,{"data-slot":"dropdown-menu-group",...e})}function ne({className:e,inset:t,variant:a="default",...r}){return(0,le.jsx)(we.DropdownMenu.Item,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":a,className:o("cursor-pointer focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function Zt({className:e,children:t,checked:a,...r}){return(0,le.jsxs)(we.DropdownMenu.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:o("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:a,...r,children:[(0,le.jsx)("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:(0,le.jsx)(we.DropdownMenu.ItemIndicator,{children:(0,le.jsx)(Yt.CheckIcon,{className:"size-4"})})}),t]})}function ye({className:e,inset:t,...a}){return(0,le.jsx)(we.DropdownMenu.Label,{"data-slot":"dropdown-menu-label","data-inset":t,className:o("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...a})}function Ne({className:e,...t}){return(0,le.jsx)(we.DropdownMenu.Separator,{"data-slot":"dropdown-menu-separator",className:o("bg-border -mx-1 my-1 h-px",e),...t})}function Ma({...e}){return(0,le.jsx)(we.DropdownMenu.Sub,{"data-slot":"dropdown-menu-sub",...e})}function za({className:e,inset:t,children:a,...r}){return(0,le.jsxs)(we.DropdownMenu.SubTrigger,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:o("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",e),...r,children:[a,(0,le.jsx)(Yt.ChevronRightIcon,{className:"ml-auto size-4"})]})}function Aa({className:e,...t}){return(0,le.jsx)(we.DropdownMenu.SubContent,{"data-slot":"dropdown-menu-sub-content",className:o("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",e),...t})}var ro=require("react");var Bt=require("react"),Fa=require("lucide-react"),Ft=require("date-fns");var Qt=require("radix-ui");var eo=require("react/jsx-runtime");function to({...e}){return(0,eo.jsx)(Qt.Popover.Root,{"data-slot":"popover",...e})}function oo({...e}){return(0,eo.jsx)(Qt.Popover.Trigger,{"data-slot":"popover-trigger",...e})}function ao({className:e,align:t="center",sideOffset:a=4,...r}){return(0,eo.jsx)(Qt.Popover.Portal,{children:(0,eo.jsx)(Qt.Popover.Content,{"data-slot":"popover-content",align:t,sideOffset:a,className:o("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...r})})}var ho=zt(require("react"),1),It=require("lucide-react"),no=require("react-day-picker");var st=require("react/jsx-runtime");function Ia({className:e,classNames:t,showOutsideDays:a=!0,captionLayout:r="label",buttonVariant:c="ghost",formatters:l,components:f,...T}){let p=(0,no.getDefaultClassNames)();return(0,st.jsx)(no.DayPicker,{showOutsideDays:a,className:o("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:r,formatters:{formatMonthDropdown:b=>b.toLocaleString("default",{month:"short"}),...l},classNames:{root:o("w-fit",p.root),months:o("flex gap-4 flex-col md:flex-row relative",p.months),month:o("flex flex-col w-full gap-4",p.month),nav:o("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",p.nav),button_previous:o(bo({variant:c}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",p.button_previous),button_next:o(bo({variant:c}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",p.button_next),month_caption:o("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",p.month_caption),dropdowns:o("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",p.dropdowns),dropdown_root:o("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",p.dropdown_root),dropdown:o("absolute bg-popover inset-0 opacity-0",p.dropdown),caption_label:o("select-none font-medium",r==="label"?"text-sm":"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",p.caption_label),table:"w-full border-collapse",weekdays:o("flex",p.weekdays),weekday:o("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",p.weekday),week:o("flex w-full mt-2",p.week),week_number_header:o("select-none w-(--cell-size)",p.week_number_header),week_number:o("text-[0.8rem] select-none text-muted-foreground",p.week_number),day:o("relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",p.day),range_start:o("rounded-l-md bg-accent",p.range_start),range_middle:o("rounded-none",p.range_middle),range_end:o("rounded-r-md bg-accent",p.range_end),today:o("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",p.today),outside:o("text-muted-foreground aria-selected:text-muted-foreground",p.outside),disabled:o("text-muted-foreground opacity-50",p.disabled),hidden:o("invisible",p.hidden),...t},components:{Root:({className:b,rootRef:u,...S})=>(0,st.jsx)("div",{"data-slot":"calendar",ref:u,className:o(b),...S}),Chevron:({className:b,orientation:u,...S})=>u==="left"?(0,st.jsx)(It.ChevronLeftIcon,{className:o("size-4",b),...S}):u==="right"?(0,st.jsx)(It.ChevronRightIcon,{className:o("size-4",b),...S}):(0,st.jsx)(It.ChevronDownIcon,{className:o("size-4",b),...S}),DayButton:Un,WeekNumber:({children:b,...u})=>(0,st.jsx)("td",{...u,children:(0,st.jsx)("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:b})}),...f},...T})}function Un({className:e,day:t,modifiers:a,...r}){let c=(0,no.getDefaultClassNames)(),l=ho.useRef(null);return ho.useEffect(()=>{a.focused&&l.current?.focus()},[a.focused]),(0,st.jsx)(v,{ref:l,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":a.selected&&!a.range_start&&!a.range_end&&!a.range_middle,"data-range-start":a.range_start,"data-range-end":a.range_end,"data-range-middle":a.range_middle,className:o("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",c.day,e),...r})}var Te=require("react/jsx-runtime");function Ba({value:e,onChange:t,placeholder:a,mode:r,externalSearch:c,onExternalChange:l,onlyExternal:f=!1}){let[T,p]=(0,Bt.useState)(!1),[b,u]=(0,Bt.useState)(e),[S,E]=(0,Bt.useState)(e);(0,Bt.useEffect)(()=>{f||E(e)},[e,f]);let _=()=>{f||t(b),E(b),c&&l&&l(b),p(!1)},F=()=>{u(S),p(!1)},D=()=>{let k=r==="single"?null:{from:null,to:null};u(k),f||t(k),E(k),c&&l&&l(k),p(!1)},j=()=>{let k=f?S:e;return k?r==="single"?(0,Ft.format)(k,"PPP"):k.from&&k.to?`${(0,Ft.format)(k.from,"MMM dd")} - ${(0,Ft.format)(k.to,"MMM dd, yyyy")}`:k.from?`From ${(0,Ft.format)(k.from,"MMM dd, yyyy")}`:k.to?`To ${(0,Ft.format)(k.to,"MMM dd, yyyy")}`:a:a},G=k=>{u(r==="single"?k:k||{from:null,to:null})};return(0,Te.jsxs)(to,{open:T,onOpenChange:p,children:[(0,Te.jsx)(oo,{className:"h-8",asChild:!0,children:(0,Te.jsxs)(v,{variant:"outline",className:o("w-full justify-start text-left font-normal h-9",!j()&&"text-muted-foreground"),children:[(0,Te.jsx)(Fa.Calendar,{className:"mr-2 h-4 w-4"}),j()]})}),(0,Te.jsxs)(ao,{className:"w-auto p-0",align:"start",children:[(0,Te.jsx)("div",{className:"p-3",children:(0,Te.jsx)(Ia,{mode:r,selected:b,onSelect:G,numberOfMonths:r==="range"?2:1,className:"rounded-md border",...r==="range"&&{required:!0}})}),(0,Te.jsxs)("div",{className:"flex items-center justify-between p-3 border-t",children:[(0,Te.jsx)(v,{variant:"ghost",size:"sm",onClick:D,children:"Clear"}),(0,Te.jsxs)("div",{className:"flex gap-2",children:[(0,Te.jsx)(v,{variant:"outline",size:"sm",onClick:F,children:"Cancel"}),(0,Te.jsx)(v,{size:"sm",onClick:_,disabled:r==="range"&&(!b?.from||!b?.to),children:"Apply"})]})]})]})]})}var $o=require("radix-ui"),La=require("lucide-react");var xo=require("react/jsx-runtime");function St({className:e,...t}){return(0,xo.jsx)($o.Checkbox.Root,{"data-slot":"checkbox",className:o("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:(0,xo.jsx)($o.Checkbox.Indicator,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:(0,xo.jsx)(La.CheckIcon,{className:"size-3.5"})})})}var s=require("react/jsx-runtime"),Oa=[{value:"sum",label:"Sum",description:"Total of all values"},{value:"average",label:"Average",description:"Mean value"},{value:"min",label:"Minimum",description:"Smallest value"},{value:"max",label:"Maximum",description:"Largest value"},{value:"count",label:"Count",description:"Number of rows"},{value:"unique",label:"Unique",description:"Count of distinct values"},{value:"median",label:"Median",description:"Middle value"}];function Uo({table:e,filters:t=[],globalFilter:a,onGlobalFilterChange:r,enableGlobalFilter:c=!0,onExport:l,onRefresh:f,loading:T=!1,enableColumnVisibility:p=!0,data:b,onClearSorting:u,onClearFilters:S,enableColumnPinning:E=!1,onExternalSearch:_,onCustomFilterChange:F,aggregations:D={},onAggregationChange:j,enableGroupedGlobalFilter:G=!1,groupedFilterLabel:k="Search in",onGroupedFilterChange:ae}){let[w,$]=(0,ro.useState)({}),[Pe,_e]=(0,ro.useState)({}),[ue,ht]=(0,ro.useState)({}),[ke,ge]=(0,ro.useState)("all"),je=()=>e.getAllLeafColumns().filter(n=>n.getCanHide?.()!==!1),de=()=>e.getAllColumns().filter(n=>!e.getAllLeafColumns().includes(n)&&n.columns?.length&&n.columns.some(h=>h.getCanHide?.()!==!1)),De=()=>{let n=new Set(de().flatMap(h=>h.columns?.filter(N=>N.getCanHide?.()!==!1).map(N=>N.id)||[]));return je().filter(h=>!n.has(h.id))},Re=(n,h)=>h&&n.startsWith(`${h}.`)?n.replace(`${h}.`,"").split("_").map(W=>W.slice(1)).join(" "):n.split("_").map(N=>N.charAt(0).toUpperCase()+N.slice(1)).join(" "),fe=(n,h)=>{let N={...w,[n]:h};$(N)},Rt=(n,h)=>{let N={...Pe,[n]:h};_e(N),F&&F(n,h),t.find(W=>W.key===n)?.externalSearch&&fe(n,h)},$e=()=>{_&&_(w)},it=()=>{$({}),_e({}),S(),_&&_({}),F&&Object.keys(Pe).forEach(n=>{F(n,"")})},be=n=>t.find(N=>N.key===n)?.customFilter?Pe[n]??"":e.getColumn(n)?.getFilterValue(),Ve=(n,h)=>{let N=t.find(W=>W.key===n);N?.customFilter?Rt(n,h):(e.getColumn(n)?.setFilterValue(h),N?.externalSearch&&fe(n,h))},ve=(n,h)=>{ht(N=>({...N,[n]:h}))},Ue=n=>{if(j){let h=D[n],N={enabled:!h?.enabled,functions:h?.functions||["sum","average"]};j(n,N)}},Ye=(n,h)=>{if(j){let W=D[n]?.functions||[],he=W.includes(h)?W.filter(Qe=>Qe!==h):[...W,h];j(n,{enabled:he.length>0,functions:he})}},Me=()=>{j&&Object.keys(D).forEach(n=>{let h=D[n];h&&j(n,{...h,enabled:!1,functions:[]})})},Ce=()=>je().filter(n=>n.id==="select"||n.id==="serialNumber"?!1:n.columnDef.meta?.aggregatable?!0:e.getRowModel().rows.slice(0,5).some(W=>{let he=W.getValue(n.id);return typeof he=="number"||typeof he=="string"&&!isNaN(parseFloat(String(he)))||typeof he=="object"&&he!==null&&"props"in he})),Ze=n=>{ge(n),ae&&ae(n,a)},We=n=>{r(n),ae&&G&&ae(ke,n)},Wt=Ce(),K=Object.values(D).some(n=>n?.enabled),lt=[{value:"all",label:"All Fields"},...t.map(n=>({value:n.key,label:n.placeholder}))];return(0,s.jsx)("div",{className:"rounded-xl",children:(0,s.jsx)("div",{className:"px-2",children:(0,s.jsx)("div",{className:"flex flex-col gap-6",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("div",{className:"flex items-center gap-3",children:t.length>0&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsx)("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:(0,s.jsx)(L.Filter,{className:"size-4"})}),t.map(n=>!e.getColumn(n.key)&&!n.customFilter&&!n.externalSearch?null:(0,s.jsx)("div",{className:o("relative min-w-[150px]",n.width),children:n.type==="select"?(0,s.jsxs)(to,{open:ue[n.key],onOpenChange:N=>ve(n.key,N),children:[(0,s.jsx)(oo,{asChild:!0,children:(0,s.jsxs)("div",{className:"relative w-full",children:[n.icon&&(0,s.jsx)(n.icon,{className:"absolute -translate-y-1/2 size-4 left-3 top-1/2 text-muted-foreground pointer-events-none z-10"}),(0,s.jsxs)(v,{variant:"outline",role:"combobox","aria-expanded":ue[n.key],className:o("h-8 sm:h-8 rounded-lg w-full justify-between font-normal",!be(n.key)&&"text-muted-foreground"),children:[(0,s.jsx)("span",{className:o("truncate",n.icon&&"pl-6"),children:be(n.key)?n.options?.find(N=>N.value===be(n.key))?.label:n.placeholder}),(0,s.jsx)(L.ChevronDown,{className:"ml-2 opacity-50 size-4 shrink-0"})]})]})}),(0,s.jsx)(ao,{className:"w-[--radix-popover-trigger-width] p-0 rounded-lg",children:(0,s.jsxs)(_o,{className:"rounded-lg",children:[(0,s.jsx)(Vo,{placeholder:`Search ${n.placeholder?.toLowerCase()}...`}),(0,s.jsxs)(Ho,{children:[(0,s.jsx)(Eo,{children:"No option found."}),(0,s.jsxs)(Go,{children:[(0,s.jsxs)(vo,{value:"all",onSelect:()=>{Ve(n.key,""),ve(n.key,!1)},className:"flex items-center cursor-pointer",children:[(0,s.jsx)(L.Check,{className:o("mr-2 size-4 shrink-0",be(n.key)?"opacity-0":"opacity-100")}),(0,s.jsx)("span",{children:"All"})]}),n.options?.map(N=>(0,s.jsxs)(vo,{value:N.label,onSelect:()=>{Ve(n.key,N.value),ve(n.key,!1)},className:"flex items-center cursor-pointer",children:[(0,s.jsx)(L.Check,{className:o("mr-2 size-4 shrink-0",be(n.key)===N.value?"opacity-100":"opacity-0")}),(0,s.jsx)("span",{children:N.label})]},N.label))]})]})]})})]}):n.type==="date"?(0,s.jsx)(Ba,{value:be(n.key),onChange:N=>{n.onlyExternal||Ve(n.key,N)},placeholder:n.placeholder,mode:n.dateMode||"single",externalSearch:n.externalSearch,onlyExternal:n.onlyExternal,onExternalChange:N=>fe(n.key,N)}):(0,s.jsxs)("div",{className:"relative",children:[n.icon&&(0,s.jsx)(n.icon,{className:"absolute -translate-y-1/2 size-4 left-3 top-1/2 text-muted-foreground"}),(0,s.jsx)(At,{placeholder:n.placeholder,value:be(n.key)??"",onChange:N=>{Ve(n.key,N.target.value)},className:o("h-8 rounded-lg",n.icon&&"pl-9"),type:n.type==="number"?"number":"text"})]})},n.key)),(t.some(n=>n.externalSearch)||t.some(n=>n.customFilter))&&(0,s.jsxs)(v,{variant:"default",size:"sm",onClick:$e,className:"rounded-lg h-7",children:[(0,s.jsx)(L.Search,{className:"size-4"}),t.find(n=>n.externalSearch||n.customFilter)?.searchButtonText||"Search"]})]})}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[c&&(0,s.jsxs)("div",{className:o("flex items-center",G?"bg-background border rounded-lg":""),children:[G&&(0,s.jsxs)(Fe,{children:[(0,s.jsx)(Be,{asChild:!0,children:(0,s.jsxs)(v,{variant:"ghost",size:"sm",className:"gap-1 border-0 border-r rounded-r-none hover:bg-transparent",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:k}),(0,s.jsx)(L.ChevronDown,{className:"opacity-50 size-4"})]})}),(0,s.jsx)(Le,{align:"end",className:"w-48 rounded-lg",children:lt.map(n=>(0,s.jsxs)(ne,{onClick:()=>Ze(n.value),className:"flex items-center justify-between",children:[(0,s.jsx)("span",{children:n.label}),ke===n.value&&(0,s.jsx)(L.Check,{className:"size-4 text-primary"})]},n.value))})]}),(0,s.jsxs)("div",{className:"relative flex-1",children:[(0,s.jsx)(L.Search,{className:"absolute -translate-y-1/2 size-4 left-3 top-1/2 text-muted-foreground"}),(0,s.jsx)(At,{placeholder:G&&ke!=="all"?`Search in ${lt.find(n=>n.value===ke)?.label}...`:"Global search...",value:a??"",onChange:n=>We(n.target.value),className:o("pl-9 h-8 max-w-max",G&&"border-0 rounded-l-none")})]})]}),Wt.length>0&&j&&(0,s.jsxs)(Fe,{children:[(0,s.jsx)(Be,{asChild:!0,children:(0,s.jsxs)(v,{variant:"outline",size:"sm",className:o("rounded-lg gap-1",K&&"bg-primary/10 dark:bg-primary/10 border-primary/20 dark:border-primary/20"),children:[(0,s.jsx)(L.Calculator,{className:"size-4"}),(0,s.jsx)("span",{children:"Aggregations"}),(0,s.jsx)(L.ChevronDown,{className:"opacity-50 size-4"})]})}),(0,s.jsxs)(Le,{align:"end",className:"w-64 rounded-lg max-h-[500px] overflow-y-auto",children:[(0,s.jsxs)(ye,{className:"flex items-center justify-between px-4 py-2",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:"Column Aggregations"}),K&&(0,s.jsx)(v,{variant:"ghost",size:"sm",onClick:Me,className:"h-6 px-2 text-xs",children:"Clear All"})]}),(0,s.jsx)(Ne,{}),Wt.map(n=>{let h=D[n.id],N=h?.enabled;return(0,s.jsxs)(Ma,{children:[(0,s.jsx)(za,{className:"text-sm",children:(0,s.jsxs)("div",{className:"flex items-center w-full gap-2",children:[(0,s.jsx)(St,{checked:N,onCheckedChange:()=>Ue(n.id),className:"data-[state=checked]:bg-primary"}),(0,s.jsx)("span",{className:o("flex-1",N&&"font-medium text-primary"),children:Re(n.id)}),N&&(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[h?.functions?.slice(0,2).map(W=>(0,s.jsx)("div",{className:"w-2 h-2 rounded-full bg-primary",title:Oa.find(he=>he.value===W)?.label},W)),h?.functions&&h.functions.length>2&&(0,s.jsxs)("div",{className:"text-xs text-muted-foreground",children:["+",h.functions.length-2]})]})]})}),(0,s.jsxs)(Aa,{className:"w-48 rounded-lg",children:[(0,s.jsx)(ye,{className:"px-3 py-2 text-xs font-medium text-muted-foreground",children:"Select Functions"}),Oa.map(W=>(0,s.jsx)(Zt,{checked:h?.functions?.includes(W.value)||!1,onCheckedChange:()=>Ye(n.id,W.value),className:"py-2 text-sm",children:(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("span",{children:W.label}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:W.description})]})},W.value))]})]},n.id)}),Wt.length===0&&(0,s.jsxs)("div",{className:"px-3 py-4 text-center",children:[(0,s.jsx)(L.Calculator,{className:"w-8 h-8 mx-auto mb-2 opacity-50 text-muted-foreground"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"No numeric columns available for aggregation"})]})]})]}),l&&(0,s.jsxs)(v,{variant:"outline",size:"sm",onClick:()=>l(b),className:"rounded-lg",children:[(0,s.jsx)(L.Download,{className:"size-4"}),"Export"]}),p&&(0,s.jsxs)(Fe,{children:[(0,s.jsx)(Be,{asChild:!0,className:"h-7",children:(0,s.jsxs)(v,{variant:"outline",size:"sm",className:"gap-1 rounded-lg",children:[(0,s.jsx)("span",{children:"Columns"}),(0,s.jsx)(L.ChevronDown,{className:"opacity-50 size-4"})]})}),(0,s.jsxs)(Le,{align:"end",className:"w-[220px] rounded-lg max-h-[400px] overflow-y-auto",children:[(0,s.jsx)(ye,{className:"px-4 py-2 text-sm font-medium",children:"Toggle Columns"}),(0,s.jsx)(Ne,{}),De().length>0&&(0,s.jsxs)(jo,{children:[(0,s.jsx)(ye,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:"General"}),De().map(n=>(0,s.jsx)(Zt,{className:"text-sm",checked:n.getIsVisible(),onCheckedChange:h=>n.toggleVisibility(!!h),children:Re(n.id)},n.id))]}),de().map(n=>(0,s.jsxs)(jo,{children:[(0,s.jsx)(Ne,{}),(0,s.jsx)(ye,{className:"px-4 py-1.5 text-sm font-medium text-muted-foreground",children:n.id}),n.columns?.filter(h=>h.getCanHide?.()!==!1).map(h=>(0,s.jsx)(Zt,{className:"text-sm",checked:h.getIsVisible(),onCheckedChange:N=>h.toggleVisibility(!!N),children:Re(h.id,n.id)},h.id))]},n.id))]})]}),(0,s.jsxs)(Fe,{children:[(0,s.jsx)(Be,{asChild:!0,className:"h-7",children:(0,s.jsx)(v,{variant:"outline",size:"sm",className:"rounded-lg h-7",children:(0,s.jsx)(L.Settings2,{className:"size-4"})})}),(0,s.jsxs)(Le,{align:"end",className:"w-[200px] rounded-lg",children:[(0,s.jsx)(ye,{children:"Table Settings"}),(0,s.jsx)(Ne,{}),(0,s.jsxs)(ne,{onClick:u,children:[(0,s.jsx)(L.ArrowUpDown,{className:"size-4"}),"Clear All Sorting"]}),(0,s.jsxs)(ne,{onClick:it,children:[(0,s.jsx)(L.Filter,{className:"size-4"}),"Clear All Filters"]}),K&&(0,s.jsxs)(ne,{onClick:Me,children:[(0,s.jsx)(L.Calculator,{className:"size-4"}),"Clear Aggregations"]}),E&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Ne,{}),(0,s.jsx)(ye,{children:"Column Pinning"}),(0,s.jsxs)(ne,{onClick:()=>e.setColumnPinning({left:[],right:[]}),children:[(0,s.jsx)(L.PinOff,{className:"size-4"}),"Reset All Pinning"]}),(0,s.jsxs)(ne,{onClick:()=>{let n=je().filter(h=>h.getCanPin?.()!==!1).map(h=>h.id);e.setColumnPinning({left:[],right:n})},children:[(0,s.jsx)(L.Pin,{className:"-rotate-90 size-4"}),"Pin All Right"]})]})]})]}),f&&(0,s.jsx)(v,{variant:"outline",size:"sm",onClick:f,disabled:T,className:"rounded-lg",children:(0,s.jsx)(L.RefreshCw,{className:o("h-4 w-4",T&&"animate-spin")})})]})]})})})})}var Ae=require("radix-ui"),Pt=require("lucide-react");var oe=require("react/jsx-runtime");function Lt({...e}){return(0,oe.jsx)(Ae.Select.Root,{"data-slot":"select",...e})}function Ot({...e}){return(0,oe.jsx)(Ae.Select.Value,{"data-slot":"select-value",...e})}function _t({className:e,size:t="default",children:a,...r}){return(0,oe.jsxs)(Ae.Select.Trigger,{"data-slot":"select-trigger","data-size":t,className:o("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[a,(0,oe.jsx)(Ae.Select.Icon,{asChild:!0,children:(0,oe.jsx)(Pt.ChevronDownIcon,{className:"size-4 opacity-50"})})]})}function Vt({className:e,children:t,position:a="popper",...r}){return(0,oe.jsx)(Ae.Select.Portal,{children:(0,oe.jsxs)(Ae.Select.Content,{"data-slot":"select-content",className:o("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:a,...r,children:[(0,oe.jsx)(Wn,{}),(0,oe.jsx)(Ae.Select.Viewport,{className:o("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),(0,oe.jsx)(qn,{})]})})}function kt({className:e,children:t,...a}){return(0,oe.jsxs)(Ae.Select.Item,{"data-slot":"select-item",className:o("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...a,children:[(0,oe.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,oe.jsx)(Ae.Select.ItemIndicator,{children:(0,oe.jsx)(Pt.CheckIcon,{className:"size-4"})})}),(0,oe.jsx)(Ae.Select.ItemText,{children:t})]})}function Wn({className:e,...t}){return(0,oe.jsx)(Ae.Select.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:o("flex cursor-default items-center justify-center py-1",e),...t,children:(0,oe.jsx)(Pt.ChevronUpIcon,{className:"size-4"})})}function qn({className:e,...t}){return(0,oe.jsx)(Ae.Select.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:o("flex cursor-default items-center justify-center py-1",e),...t,children:(0,oe.jsx)(Pt.ChevronDownIcon,{className:"size-4"})})}var Z=require("react/jsx-runtime");function Wo({table:e,config:t}){return t.enabled?(0,Z.jsx)("div",{className:"rounded-xl",children:(0,Z.jsx)("div",{children:(0,Z.jsxs)("div",{className:"flex items-center justify-between",children:[(0,Z.jsx)("div",{className:"flex items-center gap-6 text-sm text-muted-foreground",children:t.showInfo!==!1&&(0,Z.jsxs)("span",{children:["Showing ",e.getState().pagination.pageIndex*e.getState().pagination.pageSize+1," to"," ",Math.min((e.getState().pagination.pageIndex+1)*e.getState().pagination.pageSize,e.getFilteredRowModel().rows.length)," ","of ",e.getFilteredRowModel().rows.length," entries"]})}),(0,Z.jsxs)("div",{className:"flex items-center gap-4",children:[t.pageSizeOptions&&(0,Z.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Z.jsx)("span",{className:"text-sm font-medium",children:"Rows per page:"}),(0,Z.jsxs)(Lt,{value:`${e.getState().pagination.pageSize}`,onValueChange:a=>e.setPageSize(Number(a)),children:[(0,Z.jsx)(_t,{className:"h-9 w-[70px] rounded-lg",children:(0,Z.jsx)(Ot,{})}),(0,Z.jsx)(Vt,{side:"top",className:"rounded-lg",children:t.pageSizeOptions.map(a=>(0,Z.jsx)(kt,{value:`${a}`,children:a},a))})]})]}),(0,Z.jsxs)("div",{className:"flex items-center gap-2",children:[(0,Z.jsx)(v,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"First"}),(0,Z.jsx)(v,{variant:"outline",size:"sm",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),className:"rounded-lg",children:"Previous"}),t.showPageNumbers&&(0,Z.jsx)("div",{className:"flex items-center gap-1",children:Array.from({length:Math.min(5,e.getPageCount())},(a,r)=>{let c=e.getState().pagination.pageIndex,l=c+r;return l<1||l>e.getPageCount()?null:(0,Z.jsx)(v,{variant:l===c+1?"default":"outline",size:"sm",className:"size-8 p-0 rounded-lg",onClick:()=>e.setPageIndex(l-1),children:l},l)})}),(0,Z.jsx)(v,{variant:"outline",size:"sm",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Next"}),(0,Z.jsx)(v,{variant:"outline",size:"sm",onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),className:"rounded-lg",children:"Last"})]})]})]})})}):null}var _a=require("radix-ui"),Va=require("class-variance-authority");var Ea=require("react/jsx-runtime"),Jn=(0,Va.cva)("inline-flex cursor-pointer items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{sm:"h-7 px-0 min-w-7",default:"h-8 px-1 min-w-8",lg:"h-9 px-2 min-w-10"},bg:{enabled:"data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",disabled:""}},defaultVariants:{variant:"default",size:"default",bg:"enabled"}});function Ha({className:e,variant:t,size:a,noBg:r,...c}){return(0,Ea.jsx)(_a.Toggle.Root,{"data-slot":"toggle",className:o(Jn({className:e,variant:t,size:a,bg:r?"disabled":"enabled"})),...c})}var M=require("react"),i=require("react/jsx-runtime"),Ga={sum:e=>e.reduce((t,a)=>t+a,0),average:e=>e.length>0?e.reduce((t,a)=>t+a,0)/e.length:0,min:e=>e.length>0?Math.min(...e):0,max:e=>e.length>0?Math.max(...e):0,count:e=>e.length,unique:e=>new Set(e).size,median:e=>{if(e.length===0)return 0;let t=[...e].sort((r,c)=>r-c),a=Math.floor(t.length/2);return t.length%2===0?(t[a-1]+t[a])/2:t[a]}};function qo({data:e,columns:t,filters:a=[],pagination:r={enabled:!1},settings:c={},header:l,footer:f,className:T="",maxHeight:p="100%",loading:b=!1,error:u,emptyMessage:S="No data available",onRowSelectionChange:E,onExport:_,onRefresh:F,onTableReady:D,children:j,isRowDisabled:G,isRowSelectable:k,onExternalSearch:ae,aggregations:w={},onAggregationChange:$,rowClassName:Pe}){let[_e,ue]=(0,M.useState)([]),[ht,ke]=(0,M.useState)([]),[ge,je]=(0,M.useState)({}),[de,De]=(0,M.useState)({}),[Re,fe]=(0,M.useState)(""),[Rt,$e]=(0,M.useState)([]),[it,be]=(0,M.useState)(c.enableColumnPinning?{left:[],right:[]}:{}),[Ve,ve]=(0,M.useState)({}),[Ue,Ye]=(0,M.useState)({group:"all",value:""}),Me=(0,M.useRef)(null),Ce=(0,M.useRef)(null),Ze=(0,M.useRef)(null),We=(0,M.useRef)(null),[Wt,K]=(0,M.useState)(0),[lt,n]=(0,M.useState)(0),[h,N]=(0,M.useState)(0),[W,he]=(0,M.useState)(0),Qe=(0,M.useRef)(null),[qt,co]=(0,M.useState)(!1),{enableSorting:xt=!0,enableFiltering:Jt=!0,enableGlobalFilter:mo=!0,enableColumnVisibility:Xt=!0,enableRowSelection:P=!0,stickyHeader:U=!0,toolbar:z=!1,disableHeaderCheckbox:ze=!1,toolbarPosition:re="default",showSerialNumbers:se=!0,fixedCheckboxColumn:qe=!0,striped:yt=!0,hoverable:yn=!0,compact:Kt=!0,bordered:ua=!0,fullHeight:Cn=!1,enableColumnResizing:ga=!1,enableColumnPinning:xe=!0,hideHeader:wn=!1,selectionMode:dt="multiple",showCheckBox:Nn=!0,checkboxColumnPosition:fa=0,rounded:Ro=!0,enableGroupedGlobalFilter:Mo=!1,groupedFilterLabel:Tn="Search in"}=c;(0,M.useEffect)(()=>{let g=()=>{Qe.current&&co(Qe.current.scrollTop>0)},x=Qe.current;if(x)return x.addEventListener("scroll",g),()=>x.removeEventListener("scroll",g)},[]),(0,M.useEffect)(()=>{let g=()=>{Me.current&&K(Me.current.offsetHeight+16),Ce.current&&n(Ce.current.offsetHeight+16),Ze.current&&N(Ze.current.offsetHeight+16),We.current&&he(We.current.offsetHeight+16)};g();let x=new ResizeObserver(()=>{setTimeout(g,50)});return Me.current&&x.observe(Me.current),Ce.current&&x.observe(Ce.current),Ze.current&&x.observe(Ze.current),We.current&&x.observe(We.current),()=>{x.disconnect()}},[z,l,re]);let zo=(g,x)=>x.split(".").reduce((m,d)=>m&&m[d],g),Ao=(0,M.useMemo)(()=>{let g=e;return Object.keys(Ve).length>0&&(g=g.filter(x=>Object.entries(Ve).every(([m,d])=>{if(!d||d==="")return!0;let y=zo(x,m);return typeof d=="string"?String(y).toLowerCase().includes(d.toLowerCase()):y===d}))),Re&&Mo&&(g=g.filter(x=>{if(Ue.group==="all")return Object.keys(x).some(m=>{let d=zo(x,m);if(d==null)return!1;let y=String(d).toLowerCase(),R=Re.toLowerCase();return y.includes(R)});{let m=zo(x,Ue.group);if(m==null)return!1;let d=String(m).toLowerCase(),y=Re.toLowerCase();return d.includes(y)}})),g},[e,Ve,Re,Ue,Mo]),Sn=(0,M.useCallback)((g,x)=>{ve(m=>{let d={...m};return x===""||x===null||x===void 0?delete d[g]:d[g]=x,d})},[]),Pn=(0,M.useCallback)((g,x)=>{Ye({group:g,value:x}),fe(x)},[]),Mt=(0,M.useMemo)(()=>{let g=[...t],x=y=>y.map(R=>{if(R.id==="select"||R.id==="serialNumber")return R;let V={...R,enablePinning:!0};return R.columns&&(V.columns=x(R.columns)),V}),m=x(g),d={id:"select",header:({table:y})=>{if(dt==="single")return null;let R=y.getRowModel().rows.filter(ie=>!G?.(ie.original)&&(k?k(ie.original):!0)),V=R.length>0&&R.every(ie=>ie.getIsSelected()),Y=R.some(ie=>ie.getIsSelected());return(0,i.jsx)(St,{checked:V||Y&&"indeterminate",onCheckedChange:ie=>{R.forEach(ce=>ce.toggleSelected(!!ie))},disabled:ze||R.length===0,"aria-label":"Select all selectable rows"})},cell:({row:y})=>{let R=G?G(y.original):!1,V=k?k(y.original):!0;return(0,i.jsx)("div",{className:o("flex items-center justify-center",R&&"opacity-50"),children:dt==="multiple"?(0,i.jsx)(St,{checked:y.getIsSelected(),onCheckedChange:Y=>V&&y.toggleSelected(!!Y),"aria-label":"Select row",disabled:R||!V}):Nn?(0,i.jsx)("input",{type:"radio",checked:y.getIsSelected(),onChange:()=>V&&y.toggleSelected(!0),disabled:R||!V,className:"w-4 h-4 rounded-full border-primary text-primary focus:ring-primary"}):null})},enableSorting:!1,enableHiding:!1,enablePinning:!0,headerAlign:"center",size:dt==="multiple"?40:30};if(P){let y=fa;y<0&&(y=m.length+y+1),y=Math.max(0,Math.min(y,m.length)),m.splice(y,0,d)}if(se){let y={id:"serialNumber",header:"No.",cell:({row:R})=>(0,i.jsx)("div",{className:"font-medium text-center text-muted-foreground",children:R.index+1}),enableSorting:!0,enableHiding:!1,enablePinning:!0,size:60,headerAlign:"center"};m.unshift(y)}return m},[t,se,P,qe,G,k,dt,fa]),B=(0,Se.useReactTable)({data:Ao,columns:Mt,onSortingChange:xt?ue:void 0,onColumnFiltersChange:Jt?ke:void 0,onGlobalFilterChange:mo?fe:void 0,getCoreRowModel:(0,Se.getCoreRowModel)(),getPaginationRowModel:r.enabled?(0,Se.getPaginationRowModel)():void 0,getSortedRowModel:xt?(0,Se.getSortedRowModel)():void 0,getFilteredRowModel:Jt?(0,Se.getFilteredRowModel)():void 0,onColumnVisibilityChange:Xt?je:void 0,onRowSelectionChange:P?De:void 0,onColumnOrderChange:$e,onColumnPinningChange:xe?be:void 0,state:{sorting:xt?_e:void 0,columnFilters:Jt?ht:void 0,columnVisibility:Xt?ge:void 0,rowSelection:P?de:{},globalFilter:Re,columnOrder:Rt,columnPinning:xe?it:{}},initialState:{pagination:r.enabled?{pageSize:r.pageSize||10}:void 0,columnPinning:xe?{left:[...se?["serialNumber"]:[],...P?["select"]:[]],right:[]}:void 0},enableRowSelection:P,enableColumnResizing:ga,enableColumnPinning:xe,columnResizeMode:"onChange"}),ba=(0,M.useMemo)(()=>{if(!w||Object.keys(w).length===0)return{};let g={},x=B.getFilteredRowModel().rows;return Object.entries(w).forEach(([m,d])=>{if(!d?.enabled)return;let y=x.map(V=>{if(d.accessor)return d.accessor(V.original);{let Y=V.getValue(m);return typeof Y=="number"?Y:parseFloat(String(Y))||0}}).filter(V=>V!==null&&!isNaN(V)),R={};d.functions?.forEach(V=>{Ga[V]&&(R[V]=Ga[V](y))}),Object.keys(R).length>0&&(g[m]=R)}),g},[Ao,w,B?.getFilteredRowModel().rows]);(0,M.useEffect)(()=>{if(P&&E){let g=B.getFilteredSelectedRowModel().rows.filter(x=>!G?.(x.original)&&(k?k(x.original):!0)).map(x=>x.original);E(g)}},[de,P,E,B,G,k]);let kn=(0,M.useCallback)(g=>{dt==="single"?(B.resetRowSelection(),g.toggleSelected(!0)):g.toggleSelected()},[dt,B]);(0,M.useEffect)(()=>{D&&D(B)},[B,D]);let Dn=(0,M.useCallback)(()=>{ue([])},[]),Rn=(0,M.useCallback)(()=>{ke([]),fe(""),Ye({group:"all",value:""}),ve({})},[]),va=(g,x)=>{if(!xe)return;let m=[...se?["serialNumber"]:[],...P&&qe?["select"]:[]],d={left:[...(it.left??[]).filter(y=>m.includes(y))],right:[...it.right??[]]};x===!1?(d.left=d.left.filter(y=>y!==g),d.right=d.right.filter(y=>y!==g)):x==="right"?(d.left=d.left.filter(y=>y!==g),d.right.includes(g)||d.right.push(g)):x==="left"&&(d.right=d.right.filter(y=>y!==g),!d.left.includes(g)&&!m.includes(g)&&d.left.push(g)),B.setColumnPinning(d)},Mn=()=>{let g=Object.keys(ba).length>0,x=B.getHeaderGroups()[0]?.headers.some(d=>d.column.columnDef.customFooter),m=se&&B.getFilteredRowModel().rows.length>0&&(g||x);return!g&&!x&&!m?null:(0,i.jsx)(Lo,{className:"sticky bottom-0 border-t bg-sidebar z-20",children:(0,i.jsx)(tt,{className:"hover:bg-transparent bg-sidebar",children:B.getHeaderGroups()[0]?.headers.map((d,y)=>{let R=d.column.id,V=ba[R],Y=xe&&(d.column.getIsPinned()==="left"||d.column.id==="serialNumber"||d.column.id==="select"&&P),ie=xe&&d.column.getIsPinned()==="right",ce=d.column.id==="serialNumber",ct=d.column.id==="select",me=d.column.columnDef.customFooter;return V||me||ce&&m?(0,i.jsx)(ot,{className:o("font-semibold text-sm py-2 px-2 border-r",Kt&&"py-1",Y&&"sticky left-0 z-30 bg-sidebar/95",ie&&"sticky right-0 z-30 bg-sidebar/95",(ce||ct)&&"sticky left-0 z-30 bg-sidebar/95",me?.className),style:{width:d.getSize()!==150?d.getSize():"auto",minWidth:d.getSize()!==150?d.getSize():"auto",...Y&&{left:ce?0:ct?se&&B.getColumn("serialNumber")?.getSize()||0:po(d.column)},...ie&&{right:uo(d.column)},...ce&&{left:0}},children:(()=>{if(me?.content){let Ct=typeof me.content=="function"?me.content(B):me.content;return(0,i.jsx)("div",{className:o("w-full h-full",me.align==="center"&&"text-center",me.align==="right"&&"text-right",me.align==="left"&&"text-left"),children:Ct})}return V?(0,i.jsx)("div",{className:"flex flex-col gap-0.5 text-xs",children:Object.entries(V).map(([Ct,Bn])=>(0,i.jsxs)("div",{className:"flex items-center justify-between text-muted-foreground",children:[(0,i.jsxs)("span",{className:"text-xs capitalize",children:[Ct,":"]}),(0,i.jsx)("span",{className:"font-medium text-foreground",children:zn(Ct,Bn)})]},Ct))}):ce&&m?(0,i.jsxs)("div",{className:"text-xs text-center text-muted-foreground",children:["Total: ",B.getFilteredRowModel().rows.length]}):null})()},`agg-${d.id}`):(0,i.jsx)(ot,{className:o("py-0 px-0 border-r",Kt&&"py-0",Y&&"sticky left-0 z-30 bg-sidebar/95",ie&&"sticky right-0 z-30 bg-sidebar/95",(ce||ct)&&"sticky left-0 z-30 bg-sidebar/95"),style:{width:d.getSize()!==150?d.getSize():"auto",minWidth:d.getSize()!==150?d.getSize():"auto",...Y&&{left:ce?0:ct?se&&B.getColumn("serialNumber")?.getSize()||0:po(d.column)},...ie&&{right:uo(d.column)},...ce&&{left:0}}},`agg-${d.id}`)})})})},zn=(g,x)=>typeof x=="number"?g==="count"||g==="unique"?x.toLocaleString():x.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2}):x,An=()=>B.getHeaderGroups().map((g,x)=>(0,i.jsx)(tt,{className:"hover:bg-transparent",children:g.headers.map((m,d)=>{let y=m.depth===0&&m.colSpan>1,R=xe&&(m.column.getIsPinned()==="left"||m.column.id==="serialNumber"||m.column.id==="select"&&P),V=xe&&m.column.getIsPinned()==="right",Y=m.column.getCanSort(),ie=xe&&m.column.columnDef.enablePinning!==!1,ce=m.column.id==="serialNumber",ct=m.column.id==="select",Fo=ce||ct&&qe,me=m.column.columnDef.headerAlign||"left",go=w&&w[m.column.id]?.enabled,Ct={left:"justify-start",center:"justify-center",right:"justify-end"}[me];return(0,i.jsxs)(Pa,{colSpan:m.colSpan,className:o("font-semibold text-foreground bg-sidebar group px-0",!Kt&&"py-2",ua&&d<g.headers.length-1&&"border-r","relative",R&&"sticky left-0 z-25 bg-sidebar",V&&"sticky right-0 z-25 bg-sidebar",(ce||ct)&&"sticky left-0 z-25 bg-sidebar",y?"text-center":"text-left",go&&"border-b-2 border-primary/30"),style:{width:m.getSize()!==150?m.getSize():"auto",minWidth:m.getSize()!==150?m.getSize():"auto",...R&&{left:ce?0:ct?se&&B.getColumn("serialNumber")?.getSize()||0:po(m.column)},...V&&{right:uo(m.column)},...ce&&{left:0}},children:[y?(0,i.jsxs)("div",{className:"flex items-center justify-center",children:[(0,Se.flexRender)(m.column.columnDef.header,m.getContext()),go&&(0,i.jsx)(Q.Calculator,{className:"w-3 h-3 ml-1 text-primary"})]}):(0,i.jsxs)("div",{className:o("relative flex items-center w-full px-2",Ct),children:[(0,i.jsxs)("div",{className:"flex items-center gap-1",children:[go&&(0,i.jsx)(Q.Calculator,{className:"w-3 h-3 mr-1 text-primary"}),Y&&me==="right"&&(0,i.jsx)("span",{className:"order-2 ml-1",children:m.column.getIsSorted()&&{asc:(0,i.jsx)(Q.ChevronUp,{className:"w-4 h-4"}),desc:(0,i.jsx)(Q.ChevronDown,{className:"w-4 h-4"})}[m.column.getIsSorted()]}),m.isPlaceholder?null:(0,Se.flexRender)(m.column.columnDef.header,m.getContext()),Y&&me!=="right"&&m.column.getIsSorted()&&(0,i.jsx)("span",{className:"order-2 ml-1",children:m.column.getIsSorted()&&{asc:(0,i.jsx)(Q.ChevronUp,{className:"w-4 h-4"}),desc:(0,i.jsx)(Q.ChevronDown,{className:"w-4 h-4"})}[m.column.getIsSorted()]})]}),(Y||ie&&!Fo)&&(0,i.jsxs)(Fe,{children:[(0,i.jsx)(Be,{asChild:!0,className:o("absolute",me==="left"&&"right-1",me==="center"&&"right-1",me==="right"&&"left-1"),children:(0,i.jsx)(Ha,{variant:"default",size:"sm",noBg:!0,tabIndex:-1,className:"opacity-0 group-hover:opacity-70 hover:opacity-100 data-[state=open]:opacity-100",children:(0,i.jsx)(Q.MoreHorizontal,{className:"w-4 h-4"})})}),(0,i.jsxs)(Le,{align:"end",className:"w-48",children:[Y&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ye,{children:"Sorting"}),(0,i.jsxs)(ne,{onClick:()=>m.column.toggleSorting(!1),children:[(0,i.jsx)(Q.ChevronUp,{className:"w-4 h-4 mr-2"}),"Sort Ascending"]}),(0,i.jsxs)(ne,{onClick:()=>m.column.toggleSorting(!0),children:[(0,i.jsx)(Q.ChevronDown,{className:"w-4 h-4 mr-2"}),"Sort Descending"]}),(0,i.jsxs)(ne,{onClick:()=>m.column.clearSorting(),disabled:!m.column.getIsSorted(),children:[(0,i.jsx)(Q.ChevronsUpDown,{className:"w-4 h-4 mr-2"}),"Clear Sort"]}),(0,i.jsx)(Ne,{})]}),ie&&!Fo&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ye,{children:"Pin Column"}),(0,i.jsxs)(ne,{onClick:()=>va(m.column.id,"right"),disabled:m.column.getIsPinned()==="right",children:[(0,i.jsx)(Q.MoveRightIcon,{}),"Pin Right"]}),(0,i.jsxs)(ne,{onClick:()=>va(m.column.id,!1),disabled:!m.column.getIsPinned(),children:[(0,i.jsx)(Q.PinOffIcon,{}),"Unpin"]})]})]})]})]}),ga&&m.column.getCanResize()&&!y&&m.colSpan===1&&(0,i.jsx)("div",{className:"absolute top-0 right-0 w-1 h-full transition-opacity opacity-0 bg-border hover:bg-primary cursor-col-resize hover:opacity-100",onMouseDown:m.getResizeHandler()})]},m.id)})},g.id)),po=g=>{if(!xe)return;let x=0,m=B.getLeftHeaderGroups()[0]?.headers||[],d=[...se?["serialNumber"]:[],...P?["select"]:[]];for(let y of m){if(y.id===g.id)break;if(d.includes(y.id)){let R=B.getColumn(y.id);R&&(x+=R.getSize())}}return x},uo=g=>{if(!xe)return;let x=B.getState().columnPinning.right||[],m=x.indexOf(g.id);if(m===-1)return;let d=0;for(let y=m+1;y<x.length;y++){let R=B.getColumn(x[y]);R&&(d+=R.getSize())}return d};if(u)return(0,i.jsx)(at,{className:"w-full shadow-sm rounded-xl",children:(0,i.jsx)(nt,{className:"flex items-center justify-center",children:(0,i.jsxs)("div",{className:"text-center",children:[(0,i.jsx)("div",{className:"mb-3 text-2xl text-red-500",children:"\u26A0\uFE0F"}),(0,i.jsx)("p",{className:"mb-4 text-sm text-muted-foreground",children:u}),F&&(0,i.jsxs)(v,{variant:"outline",size:"sm",onClick:F,className:"rounded-lg",children:[(0,i.jsx)(Q.Loader2,{className:"w-4 h-4 mr-2"}),"Try Again"]})]})})});let In=g=>g&&typeof g=="object"&&"content"in g,He=(0,M.useMemo)(()=>l?In(l)?{content:l.content,align:l.align||"left",className:l.className||"",sticky:l.sticky!==void 0?l.sticky:!0,showOnEmpty:l.showOnEmpty!==void 0?l.showOnEmpty:!0}:{content:l,align:"left",className:"",sticky:!0,showOnEmpty:!0}:null,[l]),Io=()=>z?(0,i.jsx)(Uo,{table:B,filters:a,globalFilter:Re,onGlobalFilterChange:fe,enableGlobalFilter:mo,onExport:_,onRefresh:F,loading:b,enableColumnVisibility:Xt,enableColumnPinning:xe,data:Ao,onClearSorting:Dn,onClearFilters:Rn,onExternalSearch:ae,onCustomFilterChange:Sn,aggregations:w,onAggregationChange:$,enableGroupedGlobalFilter:Mo,groupedFilterLabel:Tn,onGroupedFilterChange:Pn}):null,Fn=()=>{let g=0;return re==="above-header"&&(g+=lt),He&&(g+=W),re==="below-header"&&(g+=h),g};return(0,i.jsx)(Nt,{children:(0,i.jsxs)("div",{className:o("w-full space-y-2 flex flex-col h-full",T),children:[z&&re==="default"&&(0,i.jsx)("div",{ref:Me,className:"relative z-40",children:Io()}),(0,i.jsx)(at,{className:o("shadow-sm overflow-hidden py-0",Cn&&"flex-1",!Ro&&"rounded-none"),children:(0,i.jsx)(nt,{className:"h-full p-0",children:(0,i.jsxs)("div",{className:"relative flex flex-col justify-between h-full",children:[b&&(0,i.jsx)("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm rounded-xl",children:(0,i.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3 rounded-lg shadow-sm bg-background/90",children:[(0,i.jsx)(Q.Loader2,{className:"size-5 animate-spin text-primary"}),(0,i.jsx)("span",{className:"text-sm font-medium text-muted-foreground",children:"Loading..."})]})}),(0,i.jsx)("div",{ref:Qe,className:o("relative overflow-auto border-b",B.getRowModel().rows?.length===0&&"h-full",Ro&&"rounded-t-xl"),style:{maxHeight:p},children:(0,i.jsxs)(Bo,{className:o("w-full border-collapse relative",B.getRowModel().rows?.length===0&&"h-full"),children:[z&&re==="above-header"&&(0,i.jsx)("thead",{className:"sticky top-0 z-40 bg-sidebar border-b",children:(0,i.jsx)(tt,{className:"hover:bg-transparent",children:(0,i.jsx)(ot,{colSpan:Mt.length,className:o("p-2 bg-sidebar border-b shadow-sm",!Ro&&"rounded-none"),children:(0,i.jsx)("div",{ref:Ce,children:Io()})})})}),He&&(He.showOnEmpty||B.getRowModel().rows?.length>0)&&(0,i.jsx)("thead",{className:o("sticky bg-sidebar border-b",qt&&"shadow-sm"),style:{top:re==="above-header"?`${lt}px`:"0px",zIndex:35},children:(0,i.jsx)(tt,{className:"hover:bg-transparent",children:(0,i.jsx)(ot,{colSpan:Mt.length,className:o("p-2 font-semibold text-foreground bg-sidebar",Kt?"py-2":"py-4",He.className),children:(0,i.jsx)("div",{ref:We,className:o("flex items-center w-full",He.align==="center"&&"justify-center",He.align==="right"&&"justify-end",He.align==="left"&&"justify-start"),children:typeof He.content=="string"?(0,i.jsx)("span",{className:"text-lg font-bold tracking-tight text-foreground",children:He.content}):He.content})})})}),z&&re==="below-header"&&(0,i.jsx)("thead",{className:o("sticky bg-sidebar border-b",qt&&"shadow-sm"),style:{top:He?`${W}px`:"0px",zIndex:35},children:(0,i.jsx)(tt,{className:"hover:bg-transparent",children:(0,i.jsx)(ot,{colSpan:Mt.length,className:"p-2 bg-sidebar",children:(0,i.jsx)("div",{ref:Ze,children:Io()})})})}),!wn&&(0,i.jsx)(Ta,{className:o("sticky bg-sidebar",qt&&"shadow-sm"),style:{top:`${Fn()}px`,zIndex:30},children:An()}),(0,i.jsx)(Sa,{children:B.getRowModel().rows?.length?B.getRowModel().rows.map((g,x)=>{let m=Pe?Pe(g):"";return(0,i.jsx)(tt,{"data-state":g.getIsSelected()&&"selected",className:o(yn&&"hover:bg-muted/50",yt&&x%2===0&&"bg-muted/20",g.getIsSelected()&&"bg-muted","border-b last:border-b-0",dt==="single"&&"cursor-pointer",m),onClick:()=>{dt==="single"&&kn(g)},children:g.getVisibleCells().map((d,y)=>{let R=xe&&(d.column.getIsPinned()==="left"||d.column.id==="serialNumber"||d.column.id==="select"&&P),V=xe&&d.column.getIsPinned()==="right",Y=d.column.id==="serialNumber",ie=d.column.id==="select",ce=Y||ie&&qe;return(0,i.jsx)(ot,{className:o(Kt?"py-2":"py-4",ua&&y<g.getVisibleCells().length&&"border-r",R&&"sticky left-0 z-20 bg-sidebar/95",V&&"sticky right-0 z-20 bg-sidebar/95",Y&&"sticky left-0 z-20 bg-sidebar/95","p-1"),style:{width:d.column.getSize()!==150?d.column.getSize():"auto",minWidth:d.column.getSize()!==150?d.column.getSize():"auto",...R&&{left:Y?0:ie?se&&B.getColumn("serialNumber")?.getSize()||0:po(d.column)},...V&&{right:uo(d.column)},...Y&&{left:0}},children:(0,Se.flexRender)(d.column.columnDef.cell,d.getContext())},d.id)})},g.id)}):(0,i.jsx)(tt,{children:(0,i.jsx)(ot,{colSpan:Mt.length,className:"h-32 text-center border-0",children:(0,i.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,i.jsx)("div",{className:"text-6xl text-muted-foreground",children:"\u{1F4CB}"}),(0,i.jsx)("p",{className:"font-medium text-muted-foreground",children:S})]})})})}),Mn()]})}),f&&(0,i.jsx)("div",{className:"sticky bottom-0 z-10 w-full bg-sidebar",style:{width:"100%",minWidth:"fit-content"},children:(0,i.jsx)(Bo,{children:(0,i.jsx)(Lo,{children:(0,i.jsx)(tt,{className:"bg-sidebar",children:(0,i.jsx)(ot,{colSpan:Mt.length,className:"p-2",children:f})})})})})]})})}),(0,i.jsx)(Wo,{table:B,config:r}),j&&j(B)]})})}var ja=require("radix-ui");var $a=require("react/jsx-runtime");function so({className:e,orientation:t="horizontal",decorative:a=!0,...r}){return(0,$a.jsx)(ja.Separator.Root,{"data-slot":"separator-root",decorative:a,orientation:t,className:o("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}var yo=require("lucide-react"),Co=require("framer-motion"),gt=zt(require("react"),1),Ua=zt(require("react-dom"),1),ee=require("react/jsx-runtime");function Jo({table:e,visible:t,container:a,children:r,className:c,...l}){let[f,T]=gt.useState(!1);gt.useLayoutEffect(()=>{T(!0)},[]),gt.useEffect(()=>{function u(S){S.key==="Escape"&&e&&e.toggleAllRowsSelected(!1)}return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[e]);let p=a??(f?globalThis.document?.body:null);if(!p||!e)return null;let b=t??e.getFilteredSelectedRowModel().rows.length>0;return Ua.createPortal((0,ee.jsx)(Co.AnimatePresence,{children:b&&(0,ee.jsx)(Co.motion.div,{role:"toolbar","aria-orientation":"horizontal",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3,ease:"easeInOut"},className:o("fixed inset-x-0 bottom-6 z-50 mx-auto flex w-fit flex-wrap items-center justify-center gap-2 rounded-xl border bg-primary/10 backdrop-blur-sm p-3 text-foreground ring-5 ring-primary/5",c),...l,children:(0,ee.jsx)(Nt,{children:r})})}),p)}function Xo({size:e="sm",tooltip:t,isPending:a,disabled:r,className:c,children:l,...f}){let T=(0,ee.jsx)(v,{variant:"secondary",size:e,className:o("gap-1.5 rounded-lg border border-secondary bg-secondary/50 hover:bg-secondary/70 transition-all duration-200",e==="icon"?"size-8":"h-8 px-3",c),disabled:r||a,...f,children:a?(0,ee.jsx)(yo.Loader,{className:"animate-spin"}):l});return t?(0,ee.jsxs)(mt,{children:[(0,ee.jsx)(pt,{asChild:!0,children:T}),(0,ee.jsx)(ut,{sideOffset:8,className:"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden",children:(0,ee.jsx)("p",{children:t})})]}):T}function Ko({table:e}){let t=gt.useCallback(()=>{e&&e.toggleAllRowsSelected(!1)},[e]);return e?(0,ee.jsxs)("div",{className:"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3",children:[(0,ee.jsxs)("span",{className:"whitespace-nowrap text-sm font-medium",children:[e.getFilteredSelectedRowModel().rows.length," selected"]}),(0,ee.jsx)(so,{orientation:"vertical",className:"mr-2 ml-3 data-[orientation=vertical]:h-4"}),(0,ee.jsxs)(mt,{children:[(0,ee.jsx)(pt,{asChild:!0,children:(0,ee.jsx)(v,{variant:"ghost",size:"icon",className:"size-6 rounded-md",onClick:t,children:(0,ee.jsx)(yo.X,{className:"size-3.5"})})}),(0,ee.jsxs)(ut,{sideOffset:10,className:"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foregroun bg-secondary [&>span]:hidden",children:[(0,ee.jsx)("p",{children:"Clear selection"}),(0,ee.jsx)("kbd",{className:"select-none rounded border bg-primary/50 px-2 py-1 font-mono font-normal text-[0.7rem] text-foreground shadow-sm",children:(0,ee.jsx)("abbr",{title:"Escape",className:"no-underline",children:"Esc"})})]})]})]}):null}var Wa=require("lucide-react");var qa=require("react/jsx-runtime");var Ja=require("lucide-react");var Xa=require("react/jsx-runtime");var Xn=require("radix-ui"),Ka=require("class-variance-authority");var Kn=require("react/jsx-runtime"),Bs=(0,Ka.cva)("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});var Ya=require("lucide-react"),Yo=require("react/jsx-runtime");var q=require("react"),Qo=require("lucide-react");var Oe=require("lucide-react");var C=require("react/jsx-runtime");function Zo({fields:e,filters:t,globalFilter:a,onGlobalFilterChange:r,fieldFilters:c,onFieldFilterChange:l,sortField:f,sortDirection:T,onSortChange:p,selectedCount:b,totalCount:u,visibleCount:S,onExport:E,onRefresh:_,loading:F,onClearFilters:D,onClearSorting:j}){let G=e.filter(w=>w.sortable),k=Object.values(c).some(w=>w!=null&&w!=="")||a!=="",ae=f!=="";return(0,C.jsx)("div",{className:"rounded-xl p-0.5",children:(0,C.jsx)("div",{className:"px-2",children:(0,C.jsx)("div",{className:"flex flex-col gap-6",children:(0,C.jsxs)("div",{className:"flex items-center justify-between",children:[(0,C.jsx)("div",{className:"flex items-center gap-3",children:t.length>0&&(0,C.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,C.jsx)("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:(0,C.jsx)(Oe.Filter,{className:"h-4 w-4"})}),t.map(w=>(0,C.jsx)("div",{className:"relative min-w-[150px]",children:w.type==="select"?(0,C.jsxs)(Lt,{value:c[w.key]||"all",onValueChange:$=>l(w.key,$),children:[w.icon&&(0,C.jsx)(w.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),(0,C.jsx)(_t,{className:o("h-9 rounded-lg w-full",w.icon&&"pl-9"),children:(0,C.jsx)(Ot,{placeholder:w.placeholder||"Select..."})}),(0,C.jsxs)(Vt,{className:"rounded-lg",children:[(0,C.jsx)(kt,{value:"all",children:"All"}),w.options?.map($=>(0,C.jsx)(kt,{value:$.value,children:$.label},$.value))]})]}):(0,C.jsxs)("div",{className:"relative",children:[w.icon&&(0,C.jsx)(w.icon,{className:"size-4 absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),(0,C.jsx)(At,{type:w.type,placeholder:w.placeholder,value:c[w.key]||"",onChange:$=>l(w.key,$.target.value),className:o("h-9 rounded-lg",w.icon&&"pl-9")})]})},String(w.key)))]})}),(0,C.jsxs)("div",{className:"flex items-center gap-2",children:[(0,C.jsxs)("div",{className:"relative",children:[(0,C.jsx)(Oe.Search,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,C.jsx)(At,{placeholder:"Global search...",value:a,onChange:w=>r(w.target.value),className:"pl-9 h-9 rounded-lg max-w-max"})]}),G.length>0&&(0,C.jsxs)(Fe,{children:[(0,C.jsx)(Be,{asChild:!0,children:(0,C.jsxs)(v,{variant:"outline",size:"sm",className:"rounded-lg gap-1",children:[(0,C.jsx)("span",{children:"Sort"}),(0,C.jsx)(Oe.ChevronDown,{className:"h-4 w-4 opacity-50"})]})}),(0,C.jsxs)(Le,{align:"end",className:"w-[200px] rounded-lg",children:[(0,C.jsx)(ye,{children:"Sort By"}),(0,C.jsx)(Ne,{}),G.map(w=>(0,C.jsxs)("div",{children:[(0,C.jsxs)(ne,{onClick:()=>p(w.key,"asc"),children:[w.label," (A-Z)"]}),(0,C.jsxs)(ne,{onClick:()=>p(w.key,"desc"),children:[w.label," (Z-A)"]})]},String(w.key))),ae&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(Ne,{}),(0,C.jsx)(ne,{onClick:j,children:"Clear All Sorting"})]})]})]}),(0,C.jsxs)(Fe,{children:[(0,C.jsx)(Be,{asChild:!0,children:(0,C.jsx)(v,{variant:"outline",size:"sm",className:"rounded-lg",children:(0,C.jsx)(Oe.Settings2,{className:"h-4 w-4"})})}),(0,C.jsxs)(Le,{align:"end",className:"w-[200px] rounded-lg",children:[(0,C.jsx)(ye,{children:"Table Settings"}),(0,C.jsx)(Ne,{}),(0,C.jsx)(ne,{onClick:j,children:"Clear All Sorting"}),(0,C.jsx)(ne,{onClick:D,children:"Clear All Filters"})]})]}),E&&(0,C.jsxs)(v,{variant:"outline",size:"sm",onClick:E,className:"rounded-lg",children:[(0,C.jsx)(Oe.Download,{className:"mr-2 h-4 w-4"}),"Export"]}),_&&(0,C.jsx)(v,{variant:"outline",size:"sm",onClick:_,disabled:F,className:"rounded-lg",children:(0,C.jsx)(Oe.RefreshCw,{className:o("h-4 w-4",F&&"animate-spin")})})]})]})})})})}var ft=require("lucide-react");var I=require("react/jsx-runtime");function Za({currentPage:e,totalPages:t,pageSize:a,totalItems:r,onPageChange:c,onPageSizeChange:l,config:f}){if(!f.enabled)return null;let T=f.pageSizeOptions||[10,20,50,100],p=(e-1)*a+1,b=Math.min(e*a,r),u=e>1,S=e<t,E=()=>{let F=[],D=[];for(let j=Math.max(2,e-2);j<=Math.min(t-1,e+2);j++)F.push(j);return e-2>2?D.push(1,"..."):D.push(1),D.push(...F),e+2<t-1?D.push("...",t):t>1&&D.push(t),D};return(0,I.jsx)("div",{className:"rounded-xl",children:(0,I.jsxs)("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4",children:[(0,I.jsx)("div",{className:"flex items-center gap-6 text-sm text-muted-foreground",children:f.showInfo!==!1&&(0,I.jsxs)("span",{children:["Showing ",p," to ",b," of ",r," entries"]})}),(0,I.jsxs)("div",{className:"flex flex-col sm:flex-row items-center gap-4",children:[T&&(0,I.jsxs)("div",{className:"flex items-center gap-2",children:[(0,I.jsx)("span",{className:"text-sm font-medium whitespace-nowrap",children:"Page size:"}),(0,I.jsxs)(Lt,{value:`${a}`,onValueChange:_=>l(Number(_)),children:[(0,I.jsx)(_t,{className:"h-9 w-[70px] rounded-lg",children:(0,I.jsx)(Ot,{})}),(0,I.jsx)(Vt,{side:"top",className:"rounded-lg",children:T.map(_=>(0,I.jsx)(kt,{value:`${_}`,children:_},_))})]})]}),(0,I.jsxs)("div",{className:"flex items-center gap-2",children:[(0,I.jsxs)(v,{variant:"outline",size:"sm",onClick:()=>c(1),disabled:!u,className:"hidden sm:flex rounded-lg",children:[(0,I.jsx)(ft.ChevronsLeft,{className:"h-4 w-4"}),(0,I.jsx)("span",{className:"sr-only",children:"Go to first page"})]}),(0,I.jsxs)(v,{variant:"outline",size:"sm",onClick:()=>c(e-1),disabled:!u,className:"rounded-lg",children:[(0,I.jsx)(ft.ChevronLeft,{className:"h-4 w-4 sm:mr-2"}),(0,I.jsx)("span",{className:"hidden sm:inline",children:"Previous"}),(0,I.jsx)("span",{className:"sr-only sm:hidden",children:"Go to previous page"})]}),f.showPageNumbers&&t>1&&(0,I.jsx)("div",{className:"hidden sm:flex items-center gap-1",children:E().map((_,F)=>{if(_==="...")return(0,I.jsx)("span",{className:"px-2 py-1 text-sm text-muted-foreground",children:"..."},`dots-${F}`);let D=_;return(0,I.jsx)(v,{variant:D===e?"default":"outline",size:"sm",className:"w-9 h-9 p-0 rounded-lg",onClick:()=>c(D),children:D},D)})}),(0,I.jsxs)("div",{className:"sm:hidden flex items-center gap-2 px-3 py-1 text-sm font-medium bg-muted rounded-lg",children:[e," of ",t]}),(0,I.jsxs)(v,{variant:"outline",size:"sm",onClick:()=>c(e+1),disabled:!S,className:"rounded-lg",children:[(0,I.jsx)("span",{className:"hidden sm:inline",children:"Next"}),(0,I.jsx)(ft.ChevronRight,{className:"h-4 w-4 sm:ml-2"}),(0,I.jsx)("span",{className:"sr-only sm:hidden",children:"Go to next page"})]}),(0,I.jsxs)(v,{variant:"outline",size:"sm",onClick:()=>c(t),disabled:!S,className:"hidden sm:flex rounded-lg",children:[(0,I.jsx)(ft.ChevronsRight,{className:"h-4 w-4"}),(0,I.jsx)("span",{className:"sr-only",children:"Go to last page"})]})]})]})]})})}var O=require("react/jsx-runtime");function ea({data:e,template:t,fields:a=[],filters:r=[],pagination:c={enabled:!1},settings:l={},header:f,footer:T,className:p="",loading:b=!1,error:u,emptyMessage:S="No items found",emptyIcon:E,onSelectionChange:_,onExport:F,onRefresh:D,onTemplateReady:j,children:G}){let{enableSorting:k=!0,enableFiltering:ae=!0,enableGlobalSearch:w=!0,enableSelection:$=!1,enableExport:Pe=!1,toolbar:_e=!0,selectionMode:ue="multiple",gridCols:ht={default:3,sm:1,md:2,lg:3,xl:4,"2xl":6},gap:ke=4,aspectRatio:ge="auto",minCardWidth:je=350,maxCardWidth:de=350}=l,[De,Re]=(0,q.useState)(""),[fe,Rt]=(0,q.useState)({}),[$e,it]=(0,q.useState)(""),[be,Ve]=(0,q.useState)("asc"),[ve,Ue]=(0,q.useState)(new Set),[Ye,Me]=(0,q.useState)(1),[Ce,Ze]=(0,q.useState)(c.pageSize||12),[We,Wt]=(0,q.useState)(ht.default),K=(0,q.useMemo)(()=>{let P=[...e];if(w&&De){let U=a.filter(z=>z.searchable!==!1);P=P.filter(z=>U.some(ze=>z[ze.key]?.toString().toLowerCase().includes(De.toLowerCase())))}if(ae&&Object.keys(fe).forEach(U=>{let z=fe[U];if(z!=null&&z!==""){let ze=a.find(re=>re.key===U);ze&&(P=P.filter(re=>{let se=re[U];return ze.type==="boolean"?se===(z==="true"):ze.type==="number"?se===Number(z):se?.toString().toLowerCase().includes(String(z).toLowerCase())}))}}),k&&$e){let U=a.find(z=>z.key===$e);U&&P.sort((z,ze)=>{let re=z[$e],se=ze[$e];if(U.type==="number")return be==="asc"?Number(re)-Number(se):Number(se)-Number(re);if(U.type==="date"){let qe=new Date(re),yt=new Date(se);return be==="asc"?qe.getTime()-yt.getTime():yt.getTime()-qe.getTime()}else{let qe=String(re).toLowerCase(),yt=String(se).toLowerCase();return be==="asc"?qe.localeCompare(yt):yt.localeCompare(qe)}})}return P},[e,De,fe,$e,be,a,w,ae,k]),lt=(0,q.useMemo)(()=>{if(!c.enabled)return K;let P=(Ye-1)*Ce,U=P+Ce;return K.slice(P,U)},[K,Ye,Ce,c.enabled]),n=Math.ceil(K.length/Ce),h=(0,q.useCallback)(P=>{$&&Ue(U=>{let z=new Set(U);return ue==="single"?(z.clear(),z.add(P)):z.has(P)?z.delete(P):z.add(P),z})},[$,ue]),N=(0,q.useCallback)(()=>{!$||ue==="single"||(ve.size===K.length?Ue(new Set):Ue(new Set(K.map((P,U)=>U))))},[$,ue,ve.size,K.length]),W=(0,q.useCallback)((P,U)=>{Rt(z=>({...z,[P]:U})),Me(1)},[]),he=(0,q.useCallback)((P,U)=>{it(P),Ve(U)},[]),Qe=(0,q.useCallback)(()=>{Re(""),Rt({}),Me(1)},[]),qt=(0,q.useCallback)(()=>{it(""),Ve("asc")},[]),co=(0,q.useMemo)(()=>({getSelectedItems:()=>Array.from(ve).map(P=>K[P]),clearSelection:()=>Ue(new Set),selectAll:N,getFilteredData:()=>K,getTotalCount:()=>e.length,getVisibleCount:()=>K.length,refresh:()=>D?.(),exportData:()=>F?.(K)}),[ve,K,e.length,N,D,F]),xt=(0,q.useRef)(null);xt.current=co,(0,q.useEffect)(()=>{j&&xt.current&&j(xt.current)},[]),(0,q.useEffect)(()=>{if($&&_){let P=Array.from(ve).map(U=>K[U]);_(P)}},[ve]);let Jt=o("w-full","overflow-hidden",p),mo=o("grid",`gap-${ke}`,"w-full","mx-auto","items-start"),Xt={gridTemplateColumns:We===0?"repeat(auto-fill, 1fr)":`repeat(auto-fill, minmax(clamp(${je}px, calc(100%/${We} - ${ke*4}px), ${de}px), 1fr))`,justifyItems:"center",alignItems:"stretch",gridAutoRows:"1fr",gridAutoFlow:"dense"};return u?(0,O.jsx)(at,{className:"w-full",children:(0,O.jsx)(nt,{className:"flex items-center justify-center py-12",children:(0,O.jsxs)("div",{className:"text-center",children:[(0,O.jsx)("div",{className:"text-red-500 mb-3 text-2xl",children:"\u26A0\uFE0F"}),(0,O.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:u}),D&&(0,O.jsxs)(v,{variant:"outline",size:"sm",onClick:D,children:[(0,O.jsx)(Qo.Loader2,{className:"mr-2 h-4 w-4"}),"Try Again"]})]})})}):(0,O.jsxs)("div",{className:o("w-full flex gap-2 flex-col h-full",Jt),children:[f&&(0,O.jsx)(at,{className:"shadow-sm border-0 py-0 text-xl font-bold",children:(0,O.jsx)(nt,{className:"p-2",children:f})}),_e&&(0,O.jsx)(Zo,{fields:a,filters:r,globalFilter:De,onGlobalFilterChange:Re,fieldFilters:fe,onFieldFilterChange:W,sortField:$e,sortDirection:be,onSortChange:he,selectedCount:ve.size,totalCount:e.length,visibleCount:K.length,onExport:Pe?()=>F?.(K):void 0,onRefresh:D,loading:b,onClearFilters:Qe,onClearSorting:qt}),(0,O.jsx)(at,{className:"border-0 overflow-auto shadow-none py-0 p-2 flex-1",children:(0,O.jsx)(nt,{className:"px-0",children:(0,O.jsxs)("div",{className:"relative",children:[b&&(0,O.jsx)("div",{className:"absolute inset-0 bg-background/80 backdrop-blur-sm z-50 flex items-center justify-center rounded-lg",children:(0,O.jsxs)("div",{className:"flex items-center gap-3 bg-background/90 px-4 py-3 rounded-lg shadow-sm",children:[(0,O.jsx)(Qo.Loader2,{className:"size-5 animate-spin text-primary"}),(0,O.jsx)("span",{className:"text-sm font-medium text-muted-foreground",children:"Loading..."})]})}),lt.length>0?(0,O.jsx)("div",{className:o(mo),style:Xt,children:lt.map((P,U)=>{let z=c.enabled?(Ye-1)*Ce+U:U,ze=ve.has(z);return(0,O.jsxs)("div",{className:o("relative h-full w-full flex flex-col","transition-all duration-200 overflow-hidden","rounded-2xl","border border-border/20 hover:border-border/50",ge==="square"?"aspect-square":"",ge==="video"?"aspect-video":"",$?"cursor-pointer":"",ze?"ring-2 ring-primary":""),onClick:()=>$&&h(z),children:[$&&ue==="multiple"&&(0,O.jsx)("div",{className:"absolute top-2 right-2 z-10",children:(0,O.jsx)(St,{checked:ze,onCheckedChange:()=>h(z),className:"bg-background/80 backdrop-blur-sm",onClick:re=>re.stopPropagation()})}),t(P,U,ze,()=>h(z))]},z)})}):(0,O.jsxs)("div",{className:"flex flex-col gap-4 items-center justify-center py-12 text-center",children:[(0,O.jsx)("div",{className:"text-6xl",children:E||"\u{1F4CB}"}),(0,O.jsx)("p",{className:"text-lg font-medium text-muted-foreground mb-2",children:S}),(De||Object.values(fe).some(P=>P))&&(0,O.jsx)(v,{variant:"outline",onClick:Qe,children:"Clear Filters"})]})]})})}),c.enabled&&(0,O.jsx)("div",{className:"pb-1",children:(0,O.jsx)(Za,{currentPage:Ye,totalPages:n,pageSize:Ce,totalItems:K.length,onPageChange:Me,onPageSizeChange:P=>{Ze(P),Me(1)},config:c})}),T&&(0,O.jsx)("div",{className:"p-2 m-0.5",children:T}),G&&G(co)]})}var wo=require("lucide-react"),No=require("framer-motion"),bt=zt(require("react"),1),Qa=zt(require("react-dom"),1),te=require("react/jsx-runtime");function ta({controller:e,visible:t,container:a,children:r,className:c,...l}){let[f,T]=bt.useState(!1);bt.useLayoutEffect(()=>{T(!0)},[]),bt.useEffect(()=>{function S(E){E.key==="Escape"&&e&&e.clearSelection()}return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[e]);let p=a??(f?globalThis.document?.body:null);if(!p||!e)return null;let b=e.getSelectedItems(),u=t??b.length>0;return Qa.createPortal((0,te.jsx)(No.AnimatePresence,{children:u&&(0,te.jsx)(No.motion.div,{role:"toolbar","aria-orientation":"horizontal",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3,ease:"easeInOut"},className:o("fixed inset-x-0 bottom-6 z-50 mx-auto flex w-fit flex-wrap items-center justify-center gap-2 rounded-xl border bg-primary/10 backdrop-blur-sm p-3 text-foreground ring-8 ring-primary/5",c),...l,children:(0,te.jsx)(Nt,{children:r})})}),p)}function oa({size:e="sm",variant:t="secondary",tooltip:a,isPending:r,disabled:c,className:l,children:f,onClick:T,...p}){let b=(0,te.jsx)(v,{variant:t,size:e,className:o("gap-1.5 rounded-lg border border-secondary bg-secondary/50 hover:bg-secondary/70 transition-all duration-200",e==="icon"?"size-8":"h-8 px-3",l),disabled:c||r,onClick:T,...p,children:r?(0,te.jsx)(wo.Loader,{className:"animate-spin"}):f});return a?(0,te.jsxs)(mt,{children:[(0,te.jsx)(pt,{asChild:!0,children:b}),(0,te.jsx)(ut,{sideOffset:8,className:"rounded-lg border font-semibold text-foreground bg-secondary [&>span]:hidden",children:(0,te.jsx)("p",{children:a})})]}):b}function aa({controller:e}){let t=bt.useCallback(()=>{e&&e.clearSelection()},[e]);if(!e)return null;let a=e.getSelectedItems();return(0,te.jsxs)("div",{className:"flex h-8 items-center rounded-lg border bg-muted/50 pr-1 pl-3",children:[(0,te.jsxs)("span",{className:"whitespace-nowrap text-sm font-medium",children:[a.length," selected"]}),(0,te.jsx)(so,{orientation:"vertical",className:"mr-2 ml-3 data-[orientation=vertical]:h-4"}),(0,te.jsxs)(mt,{children:[(0,te.jsx)(pt,{asChild:!0,children:(0,te.jsx)(v,{variant:"ghost",size:"icon",className:"size-6 rounded-md",onClick:t,children:(0,te.jsx)(wo.X,{className:"size-3.5"})})}),(0,te.jsxs)(ut,{sideOffset:10,className:"flex items-center gap-2 rounded-lg border px-3 py-2 font-semibold text-foreground bg-secondary [&>span]:hidden",children:[(0,te.jsx)("p",{children:"Clear selection"}),(0,te.jsx)("kbd",{className:"select-none rounded border bg-primary/50 px-2 py-1 font-mono font-normal text-[0.7rem] text-foreground shadow-sm",children:(0,te.jsx)("abbr",{title:"Escape",className:"no-underline",children:"Esc"})})]})]})]})}var tn=require("react/jsx-runtime"),Yn={none:"gap-0",tight:"gap-2",default:"gap-4",loose:"gap-6","extra-loose":"gap-8"},Zn={none:"p-0",tight:"p-2",default:"p-4",loose:"p-6"},en=({children:e,className:t,spacing:a="tight",padding:r="none"})=>(0,tn.jsx)("div",{className:o("flex flex-col h-full",Yn[a],Zn[r],t),children:e});var io=require("lucide-react");var on=require("react-router"),J=require("react/jsx-runtime"),an=({className:e,columns:t=[],showBackButton:a=!0,meta:r={title:""}})=>{let c=()=>{if(!r.backAction||!a)return null;let u={variant:"secondary",size:"icon",className:"hover:bg-primary/20 inline-flex"};return r.backAction.href?(0,J.jsx)(on.NavLink,{to:r.backAction.href,children:(0,J.jsxs)(v,{...u,children:[(0,J.jsx)(io.ArrowLeftIcon,{className:"size-6"}),r.backAction.content]})}):(0,J.jsxs)(v,{...u,onClick:r.backAction.onClick,children:[(0,J.jsx)(io.ArrowLeftIcon,{className:"size-6"}),r.backAction.content]})},l=()=>!r.metadata||r.metadata.length===0?null:(0,J.jsx)("div",{className:"flex gap-4",children:r.metadata.map((u,S)=>u.value&&(0,J.jsxs)("div",{className:"text-sm",children:[(0,J.jsxs)("span",{className:"text-muted-foreground",children:[u.label," "]}),(0,J.jsx)("span",{children:u.value})]},S))}),f=()=>r.status?(0,J.jsx)("span",{className:o("inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",{success:"bg-green-100 text-green-800",warning:"bg-yellow-100 text-yellow-800",critical:"bg-red-100 text-red-800",info:"bg-blue-100 text-blue-800",default:"bg-gray-100 text-gray-800"}[r.status.color]),children:r.status.content}):null,T={content:(0,J.jsxs)("div",{className:"flex gap-2 items-center",children:[c(),(0,J.jsxs)("div",{className:"flex flex-col gap-2 w-max",children:[(0,J.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:r.title}),f(),r.description&&(0,J.jsx)("p",{className:"text-muted-foreground",children:r.description}),l(),r.breadcrumbs&&r.breadcrumbs.length>0&&(0,J.jsx)("div",{className:"flex items-center text-sm text-muted-foreground",children:r.breadcrumbs.map((u,S)=>(0,J.jsxs)("div",{className:"flex items-center",children:[u.href?(0,J.jsx)("span",{className:"hover:text-primary hover:underline",children:u.label}):(0,J.jsx)("span",{children:u.label}),S<r.breadcrumbs.length-1&&(0,J.jsx)(io.ChevronRight,{className:"mx-2 h-4 w-4"})]},S))})]})]}),align:"left",width:"fill"},p={content:r.primaryActions,align:"right",width:"auto"},b=[T,...t.filter(u=>u!==void 0),p];return(0,J.jsx)("div",{className:o("flex items-center w-full gap-4 p-2",e),children:b.map((u,S)=>(0,J.jsx)("div",{className:o("flex items-center h-full",u.className,{"justify-start":u.align==="left","justify-center":u.align==="center","justify-end":u.align==="right","flex-1":u.width==="fill"}),children:u.content},S))})};var vt=zt(require("react"),1);var Ht=require("radix-ui"),nn=require("lucide-react");var Ee=require("react/jsx-runtime");function rn({...e}){return(0,Ee.jsx)(Ht.Dialog.Root,{"data-slot":"sheet",...e})}function na({...e}){return(0,Ee.jsx)(Ht.Dialog.Portal,{"data-slot":"sheet-portal",...e})}function Qn({className:e,...t}){return(0,Ee.jsx)(Ht.Dialog.Overlay,{"data-slot":"sheet-overlay",className:o("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function sn({className:e,children:t,side:a="right",...r}){return(0,Ee.jsxs)(na,{children:[(0,Ee.jsx)(Qn,{}),(0,Ee.jsxs)(Ht.Dialog.Content,{"data-slot":"sheet-content",className:o("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",a==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",a==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",a==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",a==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...r,children:[t,(0,Ee.jsxs)(Ht.Dialog.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[(0,Ee.jsx)(nn.XIcon,{className:"size-4"}),(0,Ee.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}var H=require("react/jsx-runtime"),ln=(0,vt.createContext)(!1),To={"one-half":["w-1/2","w-1/2"],"one-third":["w-1/3","w-2/3"],"two-third":["w-2/3","w-1/3"],"one-fourth":["w-1/4","w-3/4"],"three-fourth":["w-3/4","w-1/4"],"one-fifth":["w-1/5","w-4/5"],"four-fifth":["w-4/5","w-1/5"]},Et={none:"p-0",tight:"p-2",default:"p-4",loose:"p-6"},er=(e,t)=>{let[a,r]=To[t];return{container:"inset-y-0 z-50 transition-all duration-500 ease-in-out",content:o("h-full bg-background transition-all duration-500 ease-in-out",e==="right"?"border-l":"border-r"),transform:e==="right"?"translate-x-full":"-translate-x-full",transformOpen:"translate-x-0",contentPushClass:e==="right"?r:a,sheetPushClass:e==="right"?a:r}},tr="flex flex-col overflow-hidden rounded-2xl relative",or={default:"bg-background",card:"bg-background shadow-sm border",border:"bg-background border-2",transparent:"bg-transparent"},dn=e=>{let{children:t,className:a,variant:r="default",layout:c="full",header:l,footer:f,headerClassName:T,contentClassName:p,footerClassName:b,parentContainer:u=!1,padding:S=u?"none":"tight"}=e,E=(0,vt.useContext)(ln),[_,F]=(0,vt.useState)(!1),D=vt.default.useCallback(G=>(0,H.jsx)("div",{className:o("flex-1 overflow-auto h-full no-scrollbar",u&&"flex",!u&&Et[S],p),children:G}),[S,u,p]),j=()=>{switch(c){case"split":{let{splitRatio:G="three-fourth",reverse:k=!1}=e;if(!Array.isArray(t)||t.length!==2)return(0,H.jsx)("div",{className:"flex items-center justify-center h-full text-red-500",children:'Error: AppContent with layout="split" requires exactly 2 children'});let[ae,w]=To[G],[$,Pe]=k?[t[1],t[0]]:[t[0],t[1]],[_e,ue]=k?[w,ae]:[ae,w];return(0,H.jsxs)("div",{className:"flex h-full gap-2",children:[(0,H.jsx)("div",{className:o(_e,"overflow-auto"),children:D($)}),(0,H.jsx)("div",{className:o(ue,"overflow-auto"),children:D(Pe)})]})}case"with-sheet":{let{sheetContent:G,sheetWidth:k="four-fifth",sheetSide:ae="right",sheetMode:w="container",sheetClassName:$,isSheetOpen:Pe,onSheetOpenChange:_e,disableOverlay:ue=!0,showSheetOverlay:ht=!0}=e,ke=Pe!==void 0&&_e,ge=ke?Pe:_,je=ke?_e:F;if(w==="container"){let de=er(ae,k),De=To[k][0];return ue?(0,H.jsxs)("div",{className:o("flex relative flex-1 overflow-hidden",p),children:[(0,H.jsx)("div",{className:o("h-full overflow-auto transition-all duration-500",ge?de.contentPushClass:"w-full",ge&&"overflow-y-auto overflow-x-hidden"),children:(0,H.jsx)("div",{className:o("h-full",!u&&Et[S]),children:t})}),(0,H.jsx)("div",{className:o(de.container,"transition-all duration-500 ease-in-out h-full",De,ge&&["left","right"].includes(ae)?o(de.sheetPushClass,"overflow-y-auto"):ge?de.transformOpen:o(de.transform,"hidden"),"overflow-y-auto"),children:(0,H.jsx)("div",{className:o(de.content,$,"h-full"),children:G})})]}):(0,H.jsxs)("div",{tabIndex:-1,className:o("flex relative flex-1 overflow-hidden",p),children:[(0,H.jsx)("div",{className:o("h-full overflow-auto w-full transition-all duration-500 relative z-10"),children:(0,H.jsx)("div",{className:o("h-full",!u&&Et[S]),children:t})}),(0,H.jsxs)("div",{tabIndex:-1,className:o("absolute inset-0 z-20",!ge&&"pointer-events-none"),children:[ht&&(0,H.jsx)("div",{className:o("absolute inset-0 bg-black/50 transition-opacity duration-500",ge?"opacity-100":"opacity-0 pointer-events-none"),onClick:()=>je(!1)}),(0,H.jsx)("div",{className:o(de.container,"transition-all duration-500 backdrop-blur-2xl ease-in-out h-full absolute",De,ge?"translate-x-0 opacity-100":o(ae==="right"?"translate-x-full":"-translate-x-full","opacity-0 pointer-events-none"),"overflow-y-auto"),style:{[ae]:0},tabIndex:-1,children:(0,H.jsx)("div",{className:o(de.content,$,"h-full"),children:G})})]})]})}return(0,H.jsxs)(H.Fragment,{children:[t,(0,H.jsx)(rn,{open:ge,onOpenChange:je,children:(0,H.jsx)(na,{children:(0,H.jsx)(sn,{side:ae,className:o("fixed bg-background border sm:max-w-full","transition-all duration-500 ease-in-out",To[k][0],$),children:G})})})]})}default:return D(t)}};return(0,H.jsx)(ln.Provider,{value:!0,children:(0,H.jsxs)("div",{className:o(tr,or[r],Et[S],E&&"flex-1",u&&"h-full",!u&&"rounded-2xl",a),children:[l&&(0,H.jsx)("div",{className:o("border-b",T,r==="card"&&!u&&"rounded-t-2xl",r==="border"&&"border-b-2",Et[S]),children:l}),j(),f&&(0,H.jsx)("div",{className:o("border-t",b,r==="card"&&!u&&"rounded-b-2xl",r==="border"&&"border-t-2",Et[S]),children:f})]})})};var So=require("react/jsx-runtime"),cn=({className:e,columns:t=[],meta:a={title:""}})=>{let r={content:(0,So.jsx)("div",{className:"flex items-center gap-4 p-2",children:a.secondaryActions}),align:"right",width:"fill"},c=[...t.filter(l=>l!==void 0),r];return(0,So.jsx)("div",{className:o("flex items-center w-full gap-4",e),children:c.map((l,f)=>(0,So.jsx)("div",{className:o("flex items-center h-full",l.className,{"justify-start":l.align==="left","justify-center":l.align==="center","justify-end":l.align==="right","flex-1":l.width==="fill"}),children:l.content},f))})};var lo=require("react/jsx-runtime");function mn({useTypedAppMeta:e}){return{AppHeader:l=>{let{meta:f}=e();return(0,lo.jsx)(an,{...l,meta:f})},AppFooter:l=>{let{meta:f}=e();return(0,lo.jsx)(cn,{...l,meta:f})},AppContent:l=>(0,lo.jsx)(dn,{...l}),AppContainer:l=>(0,lo.jsx)(en,{...l})}}var pe=require("react"),ra=require("react/jsx-runtime"),ar=(0,pe.createContext)(void 0),pn=({children:e})=>{let[t,a]=(0,pe.useState)({title:"",description:"",breadcrumbs:[]}),r=(0,pe.useCallback)(f=>{a(T=>Object.keys(f).some(b=>JSON.stringify(T[b])!==JSON.stringify(f[b]))?{...T,...f}:T)},[]),c=(0,pe.useCallback)(()=>{a(f=>f.title===""&&f.description===""&&(f.breadcrumbs?.length??0)===0?f:{title:"",description:"",breadcrumbs:[]})},[]),l=(0,pe.useMemo)(()=>({meta:t,setMeta:r,resetMeta:c}),[t,r,c]);return(0,ra.jsx)(ar.Provider,{value:l,children:e})};function un(){let e=(0,pe.createContext)(void 0);return{TypedAppMetaProvider:({children:r})=>{let[c,l]=(0,pe.useState)({title:"",description:"",breadcrumbs:[]}),f=(0,pe.useCallback)(b=>{l(u=>Object.keys(b).some(E=>{let _=u[E],F=b[E];return JSON.stringify(_)!==JSON.stringify(F)})?{...u,...b}:u)},[]),T=(0,pe.useCallback)(()=>{l(b=>b.title===""&&b.description===""&&(b.breadcrumbs?.length??0)===0?b:{title:"",description:"",breadcrumbs:[]})},[]),p=(0,pe.useMemo)(()=>({meta:c,setMeta:f,resetMeta:T}),[c,f,T]);return(0,ra.jsx)(e.Provider,{value:p,children:r})},useTypedAppMeta:()=>{let r=(0,pe.useContext)(e);if(!r)throw new Error("useTypedAppMeta must be used within a TypedAppMetaProvider");return r},TypedAppMetaContext:e}}var Gt=require("react");function gn({useTypedAppMeta:e}){function t(a){let{setMeta:r,resetMeta:c}=e(),l=(0,Gt.useMemo)(()=>{if(a.backAction)return{...a.backAction,onClick:a.backAction.onClick}},[a.backAction?.content,a.backAction?.href,a.backAction?.onClick?.toString()]),f=(0,Gt.useMemo)(()=>a.metadata,[JSON.stringify(a.metadata)]),T=(0,Gt.useMemo)(()=>({...a,backAction:l,metadata:f}),[a.title,a.description,a.breadcrumbs,a.primaryActions,a.secondaryActions,a.pagination,a.status,l,f]);(0,Gt.useEffect)(()=>(r(T),()=>c()),[T,r,c])}return{usePageTemplate:t}}var sa=require("react"),jt=require("lucide-react");var Ie=require("react/jsx-runtime"),Po=class{static currencyFormatter=new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",maximumFractionDigits:2});static compactFormatter=new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",notation:"compact",maximumFractionDigits:1});static MONTH_NAMES_SHORT=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];static async copyToClipboard(t){if(t)try{await navigator.clipboard.writeText(t)}catch(a){throw console.error("Failed to copy text:",a),a}}static CopyToClipboard=({text:t,children:a,className:r,size:c="icon",variant:l="ghost"})=>{let[f,T]=(0,sa.useState)(!1),[p,b]=(0,sa.useState)(!1),u=async()=>{if(!(!t||p)){b(!0);try{await this.copyToClipboard(t),T(!0),setTimeout(()=>T(!1),2e3)}catch(S){console.error("Failed to copy text:",S)}finally{b(!1)}}};return(0,Ie.jsxs)(mt,{children:[(0,Ie.jsx)(pt,{asChild:!0,children:(0,Ie.jsx)(v,{variant:l,size:c,className:o(c==="icon"&&"size-6",r),onClick:u,disabled:p||!t,children:p?(0,Ie.jsx)(jt.Loader2Icon,{className:"animate-spin"}):f?(0,Ie.jsx)(jt.Check,{className:"h-3 w-3"}):a||(0,Ie.jsx)(jt.Copy,{className:"h-3 w-3"})})}),(0,Ie.jsx)(ut,{children:f?"Copied!":p?"Copying...":"Copy to clipboard"})]})};static formatINR(t,a={}){let{prefix:r="",suffix:c="",withSymbol:l=!0,compact:f=!1}=a;if(typeof t!="number"||isNaN(t))return`${r}${l?"\u20B9 ":""}0.00${c}`;let T=t<0,p=Math.abs(t),u=(f&&p>=1e5?this.compactFormatter:this.currencyFormatter).format(p).replace("\u20B9","");return`${r}${T?"- ":""}${l?"\u20B9 ":""}${u}${c}`}static formatDate(t,a={}){let{format:r="dd-mm-yyyy",separator:c="-"}=a,l=new Date(t);if(isNaN(l.getTime()))return"";let f=String(l.getDate()).padStart(2,"0"),T=String(l.getMonth()+1).padStart(2,"0"),p=this.MONTH_NAMES_SHORT[l.getMonth()],b=l.getFullYear();switch(r){case"dd-mmm-yyyy":return`${f}${c}${p}${c}${b}`;case"iso":return l.toISOString().split("T")[0];case"long":return l.toLocaleDateString("en-IN",{year:"numeric",month:"long",day:"numeric"});case"short":return l.toLocaleDateString("en-IN");default:return`${f}${c}${T}${c}${b}`}}static toProperCase(t){return t?t.toLowerCase().split(" ").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "):""}static toProperCaseAdvanced(t){return t?t.toLowerCase().split(/(\s+|['-])/).map((a,r,c)=>["-","'"," "].includes(a)||r>0&&["-","'"].includes(c[r-1])?a:a.charAt(0).toUpperCase()+a.slice(1)).join(""):""}static StatusBadge=({status:t,className:a,showDot:r=!0,capitalize:c=!0,size:l="md",variant:f="outline",customColors:T,icon:p,trueMessage:b="active",falseMessage:u="inactive"})=>{let S=typeof t=="boolean"?t?b:u:typeof t=="number"?t>0?b:u:t.toLowerCase(),E={active:{label:"active",solid:{bg:"bg-emerald-500",text:"text-white",border:"border-emerald-600",dot:"bg-white"},outline:{bg:"bg-emerald-50",text:"text-emerald-700",border:"border-emerald-100",dot:"bg-emerald-500"},subtle:{bg:"bg-emerald-50",text:"text-emerald-700",border:"border-transparent",dot:"bg-emerald-500"}},pending:{label:"pending",solid:{bg:"bg-amber-500",text:"text-white",border:"border-amber-600",dot:"bg-white"},outline:{bg:"bg-amber-50",text:"text-amber-700",border:"border-amber-100",dot:"bg-amber-500"},subtle:{bg:"bg-amber-50",text:"text-amber-700",border:"border-transparent",dot:"bg-amber-500"}},inactive:{label:"inactive",solid:{bg:"bg-rose-500",text:"text-white",border:"border-rose-600",dot:"bg-white"},outline:{bg:"bg-rose-50",text:"text-rose-700",border:"border-rose-100",dot:"bg-rose-500"},subtle:{bg:"bg-rose-50",text:"text-rose-700",border:"border-transparent",dot:"bg-rose-500"}},draft:{label:"draft",solid:{bg:"bg-gray-500",text:"text-white",border:"border-gray-600",dot:"bg-white"},outline:{bg:"bg-gray-50",text:"text-gray-700",border:"border-gray-100",dot:"bg-gray-500"},subtle:{bg:"bg-gray-50",text:"text-gray-700",border:"border-transparent",dot:"bg-gray-500"}},completed:{label:"completed",solid:{bg:"bg-indigo-500",text:"text-white",border:"border-indigo-600",dot:"bg-white"},outline:{bg:"bg-indigo-50",text:"text-indigo-700",border:"border-indigo-100",dot:"bg-indigo-500"},subtle:{bg:"bg-indigo-50",text:"text-indigo-700",border:"border-transparent",dot:"bg-indigo-500"}}},_=E[S.toLowerCase()]||E.inactive,F=T||_[f],D={sm:"text-xs px-2 py-0.5",md:"text-xs px-2.5 py-0.5",lg:"text-sm px-3 py-1"},j=c?S.charAt(0).toUpperCase()+S.slice(1):S;return(0,Ie.jsx)("div",{className:"flex justify-center",children:(0,Ie.jsxs)("span",{className:o("inline-flex items-center gap-1.5 rounded-full border font-medium",F.bg,F.text,F.border,D[l],a),children:[r&&(p?(0,Ie.jsx)("span",{className:"flex items-center",children:p}):(0,Ie.jsx)("span",{className:o("size-2 rounded-full",F.dot),"aria-hidden":"true"})),j]})})}};var fn=require("lucide-react"),$t=require("react-router"),X=require("react/jsx-runtime"),ia=()=>{let e=(0,$t.useRouteError)(),t=(0,$t.useNavigate)();return(0,X.jsx)("div",{className:"rounded-2xl flex justify-center items-center h-full bg-sidebar px-4",children:(0,X.jsxs)("div",{className:"flex flex-col items-center space-y-4 text-center",children:[(0,X.jsx)(fn.AlertTriangleIcon,{className:"h-16 w-16 text-destructive"}),(0,$t.isRouteErrorResponse)(e)?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)("h2",{className:"text-3xl font-semibold text-destructive",children:["Error ",e.status,": ",e.statusText]}),typeof e.data=="string"?(0,X.jsx)("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:e.data}):e.data?.message&&(0,X.jsx)("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:e.data.message})]}):e instanceof Error?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)("h2",{className:"text-3xl font-semibold text-destructive",children:"Unexpected Error"}),(0,X.jsx)("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:e.message}),e.stack&&(0,X.jsxs)("details",{className:"mt-2 text-sm text-muted-foreground max-w-4xl text-left",children:[(0,X.jsx)("summary",{className:"cursor-pointer underline",children:"Stack Trace"}),(0,X.jsx)("pre",{className:"whitespace-pre-wrap",children:e.stack})]})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)("h2",{className:"text-3xl font-semibold text-destructive",children:"Unknown Error"}),(0,X.jsx)("pre",{className:"text-lg text-muted-foreground whitespace-pre-wrap max-w-4xl text-left",children:typeof e=="string"?e:JSON.stringify(e,null,2)})]}),(0,X.jsx)(v,{variant:"outline",onClick:()=>t(-1),children:"Go Back"})]})})};var Xe=require("framer-motion");var A=require("react/jsx-runtime");function nr({size:e=100,strokeWidth:t=2,color:a="currentColor",className:r=""}){return(0,A.jsxs)(Xe.motion.svg,{width:e,height:e,viewBox:"0 0 100 100",initial:"hidden",animate:"visible",className:r,children:[(0,A.jsx)("title",{children:"Animated Checkmark"}),(0,A.jsx)(Xe.motion.circle,{cx:"50",cy:"50",r:"40",stroke:a,custom:0,style:{strokeWidth:t,strokeLinecap:"round",fill:"transparent"}}),(0,A.jsx)(Xe.motion.path,{d:"M30 50L45 65L70 35",stroke:a,custom:1,style:{strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round",fill:"transparent"}})]})}function la(){return(0,A.jsx)(at,{className:"w-full max-w-sm mx-auto p-6 min-h-[300px] flex flex-col justify-center bg-background",children:(0,A.jsxs)(nt,{className:"space-y-4 flex flex-col items-center justify-center",children:[(0,A.jsx)(Xe.motion.div,{className:"flex justify-center",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{duration:.4,ease:[.4,0,.2,1],scale:{type:"spring",damping:15,stiffness:200}},children:(0,A.jsxs)("div",{className:"relative",children:[(0,A.jsx)(Xe.motion.div,{className:"absolute inset-0 bg-primary/5 rounded-full",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:.2,duration:.8,ease:"circOut"}}),(0,A.jsx)(nr,{size:80,strokeWidth:4,color:"rgb(16 185 129)",className:"relative z-10 dark:drop-shadow-[0_0_10px_rgba(0,0,0,0.1)]"})]})}),(0,A.jsxs)(Xe.motion.div,{className:"space-y-2 text-center w-full",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.2,duration:.6,ease:[.4,0,.2,1]},children:[(0,A.jsx)(Xe.motion.h2,{className:"text-lg text-zinc-100 dark:text-zinc-900 tracking-tighter font-semibold uppercase",initial:{opacity:0,y:5},animate:{opacity:1,y:0},transition:{delay:1,duration:.4},children:"Transfer Successful"}),(0,A.jsx)("div",{className:"flex items-center gap-4",children:(0,A.jsx)(Xe.motion.div,{className:"flex-1 bg-zinc-800/50 dark:bg-zinc-50/50 rounded-xl p-3 border border-zinc-700/50 dark:border-zinc-200/50 backdrop-blur-md",initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{delay:1.2,duration:.4,ease:[.4,0,.2,1]},children:(0,A.jsxs)("div",{className:"flex flex-col items-start gap-2",children:[(0,A.jsxs)("div",{className:"space-y-1.5",children:[(0,A.jsxs)("span",{className:"text-xs font-medium text-secondary-foreground flex items-center gap-1.5",children:[(0,A.jsxs)("svg",{className:"w-3 h-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,A.jsx)("title",{children:"From"}),(0,A.jsx)("path",{d:"M12 19V5M5 12l7-7 7 7"})]}),"From"]}),(0,A.jsxs)("div",{className:"flex items-center gap-2.5 group transition-all",children:[(0,A.jsx)("span",{className:"inline-flex items-center justify-center w-7 h-7 rounded-lg bg-zinc-900 dark:bg-white shadow-lg border border-zinc-700 dark:border-zinc-300 text-sm font-medium text-zinc-100 dark:text-zinc-900 group-hover:scale-105 transition-transform",children:"$"}),(0,A.jsx)("span",{className:"font-medium text-zinc-100 dark:text-zinc-900 tracking-tight",children:"500.00 USD"})]})]}),(0,A.jsx)("div",{className:"w-full h-px bg-gradient-to-r from-transparent via-zinc-700 dark:via-zinc-300 to-transparent"}),(0,A.jsxs)("div",{className:"space-y-1.5",children:[(0,A.jsxs)("span",{className:"text-xs font-medium text-secondary-foreground flex items-center gap-1.5",children:[(0,A.jsxs)("svg",{className:"w-3 h-3",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,A.jsx)("title",{children:"To"}),(0,A.jsx)("path",{d:"M12 5v14M5 12l7 7 7-7"})]}),"To"]}),(0,A.jsxs)("div",{className:"flex items-center gap-2.5 group transition-all",children:[(0,A.jsx)("span",{className:"inline-flex items-center justify-center w-7 h-7 rounded-lg bg-zinc-900 dark:bg-white shadow-lg border border-zinc-700 dark:border-zinc-300 text-sm font-medium text-zinc-100 dark:text-zinc-900 group-hover:scale-105 transition-transform",children:"\u20AC"}),(0,A.jsx)("span",{className:"font-medium text-zinc-100 dark:text-zinc-900 tracking-tight",children:"460.00 EUR"})]})]})]})})}),(0,A.jsx)(Xe.motion.div,{className:"w-full text-xs text-secondary-foreground mt-2 text-center",initial:{opacity:0},animate:{opacity:1},transition:{delay:1.4,duration:.4},children:"Exchange Rate: 1 USD = 0.92 EUR"})]})]})})}var Dt=require("react/jsx-runtime"),da=()=>(0,Dt.jsx)("div",{className:"rounded-2xl flex justify-center items-center h-full bg-transparent",children:(0,Dt.jsxs)("div",{className:"flex flex-col items-center space-y-4",children:[(0,Dt.jsx)("div",{className:"animate-spin rounded-full border-t-4 border-ring h-16 w-16 mb-4"}),(0,Dt.jsx)("h2",{className:"text-xl font-semibold text-muted-foreground",children:"Loading, please wait..."}),(0,Dt.jsx)("p",{className:"text-sm text-muted-foreground",children:"Your content is on its way."})]})});var bn=require("react-router");var vn=require("lucide-react"),ko=require("react-router"),Ge=require("react/jsx-runtime"),ca=()=>{let e=(0,bn.useLocation)(),t=(0,ko.useNavigate)(),a=()=>{window.history.length>2?t(-1):t("/")};return(0,Ge.jsxs)("div",{className:"rounded-2xl flex flex-col items-center justify-center h-full p-6 text-center bg-sidebar text-muted-foreground select-none",children:[(0,Ge.jsx)(vn.GhostIcon,{className:"h-15 w-15 text-destructive mb-4"}),(0,Ge.jsx)("h1",{className:"text-2xl font-bold text-destructive mb-2",children:"Page Not Found"}),(0,Ge.jsxs)("p",{className:"text-xl mb-4",children:["The page ",(0,Ge.jsx)("code",{className:"px-1 py-0.5 rounded bg-muted text-foreground",children:e.pathname})," doesn't exist or has been moved."]}),(0,Ge.jsxs)("div",{className:"flex space-x-4",children:[(0,Ge.jsx)(v,{variant:"outline",onClick:a,children:"Go Back"}),(0,Ge.jsx)(v,{variant:"ghost",children:(0,Ge.jsx)(ko.NavLink,{to:"/",children:"Return Home"})})]})]})};var hn=require("lucide-react"),Ut=require("react/jsx-runtime"),ma=()=>(0,Ut.jsxs)("div",{className:"rounded-2xl flex flex-col items-center justify-center h-screen p-6 text-center text-muted-foreground bg-background select-none",children:[(0,Ut.jsx)(hn.WifiOffIcon,{className:"h-15 w-15 text-destructive mb-4"}),(0,Ut.jsx)("h1",{className:"text-3xl font-bold text-destructive mb-2",children:"You're offline"}),(0,Ut.jsx)("p",{className:"text-xl max-w-md",children:"We couldn't connect to the server."})]});var xn=require("lucide-react");var Do=require("react-router"),Ke=require("react/jsx-runtime"),pa=()=>{let e=(0,Do.useNavigate)();return(0,Ke.jsxs)("div",{className:"rounded-2xl flex flex-col items-center justify-center h-full p-6 text-center bg-sidebar text-muted-foreground select-none",children:[(0,Ke.jsx)(xn.ShieldOffIcon,{className:"h-15 w-15 text-destructive mb-4"}),(0,Ke.jsx)("h1",{className:"text-2xl font-bold text-destructive mb-2",children:"Access Denied"}),(0,Ke.jsx)("p",{className:"text-xl mb-4",children:"You don't have permission to view this page. Please sign in with an authorized account or contact your administrator."}),(0,Ke.jsxs)("div",{className:"flex space-x-4",children:[(0,Ke.jsx)(v,{variant:"outline",onClick:()=>{window.history.length>2?e(-1):e("/")},children:"Go Back"}),(0,Ke.jsx)(v,{variant:"ghost",children:(0,Ke.jsx)(Do.NavLink,{to:"/",children:"Go to Home"})})]})]})};0&&(module.exports={AppMetaProvider,CurrencyTransfer,DataTable,DataTableActionBar,DataTableActionBarAction,DataTableActionBarSelection,DataTemplate,DataTemplateActionBar,DataTemplateActionBarAction,DataTemplateActionBarSelection,ErrorComponent,GeneralHelper,Loader,NotFound,OfflineUI,Unauthorized,createLayoutComponents,createPageTemplateHook,createTypedAppMetaContext});
|
|
3
3
|
//# sourceMappingURL=index.cjs.map
|