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