@gomeniucivan/ui 1.0.26 → 1.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +6 -6
- package/dist/index.d.ts +1 -2153
- package/dist/index.js +6 -6
- package/dist/style.css +2 -2
- package/package.json +33 -33
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
'use strict';var X=require('react'),lucideReact=require('lucide-react'),jsxRuntime=require('react/jsx-runtime'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),reactTable=require('@tanstack/react-table'),radixUi=require('radix-ui'),classVarianceAuthority=require('class-variance-authority'),reactDayPicker=require('react-day-picker'),Vc=require('embla-carousel-react'),sonner=require('sonner'),framerMotion=require('framer-motion'),pn=require('recharts'),cmdk=require('cmdk'),dateFns=require('date-fns');require('@gomeniucivan/ui/style.css');var vaul=require('vaul'),inputOtp=require('input-otp'),Sn=require('react-resizable-panels'),core=require('@dnd-kit/core'),modifiers=require('@dnd-kit/modifiers'),sortable=require('@dnd-kit/sortable'),utilities=require('@dnd-kit/utilities');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var X__namespace=/*#__PURE__*/_interopNamespace(X);var Vc__default=/*#__PURE__*/_interopDefault(Vc);var pn__namespace=/*#__PURE__*/_interopNamespace(pn);var Sn__namespace=/*#__PURE__*/_interopNamespace(Sn);function yr(e){return typeof document=="undefined"?[]:Array.from(document.querySelectorAll(e))}function Bg(e){for(let t of yr('[data-slot="sidebar-inset"]'))t.dataset.contentLayout=e;}function zg(e){for(let t of yr("header[data-navbar-style]"))t.dataset.navbarStyle=e;}var xr={fieldCy:false,fieldName:false},wr=xr,so=new Map,an=[],Rr=()=>{let e=an[an.length-1];wr=e?so.get(e):xr;},Cr=()=>Symbol("theme-extras-provider"),Tr=()=>wr,Pr=(e,t)=>{let o={fieldCy:t.fieldCy,fieldName:t.fieldName};so.set(e,o),an.includes(e)||an.push(e),Rr();},Nr=e=>{if(!so.has(e))return;so.delete(e);let t=an.indexOf(e);t!==-1&&an.splice(t,1),Rr();};var Jl=new Set(["input","select","textarea","form","button"]),ta=(e,t)=>{if(t===null||typeof t!="object"||typeof e!="string")return t;let o=Tr(),a=!o.fieldCy,r=!o.fieldName&&Jl.has(e);if(!a&&!r)return t;let i=t,c=null,u=()=>(c||(c={...i}),c);if(a&&Object.prototype.hasOwnProperty.call(i,"data-cy")){let d=u();delete d["data-cy"];}if(r&&Object.prototype.hasOwnProperty.call(i,"name")){let d=u();delete d.name;}return c!=null?c:i};var n=(e,t,o)=>jsxRuntime.jsx(e,ta(e,t),o),s=(e,t,o)=>jsxRuntime.jsxs(e,ta(e,t),o);var oa=X.createContext(null),Hn=null;function na(){return typeof window=="undefined"?"/":window.location.pathname||"/"}function kr({children:e}){let[t,o]=X.useState(()=>na()),a=X.useCallback((i,c={})=>{typeof window!="undefined"&&(c.replace?window.history.replaceState(null,"",i):window.history.pushState(null,"",i),o(na()));},[]);X.useEffect(()=>{Hn=a;let i=()=>{o(na());};return window.addEventListener("popstate",i),()=>{window.removeEventListener("popstate",i),Hn===a&&(Hn=null);}},[a]);let r=X.useMemo(()=>({pathname:t,navigate:a}),[t,a]);return n(oa.Provider,{value:r,children:e})}function Jg(){let e=X.useContext(oa);if(!e)throw new Error("usePathname must be used within a RouterProvider");return e.pathname}function Xg(){let e=X.useContext(oa);if(!e)throw new Error("useNavigate must be used within a RouterProvider");return e.navigate}function Mr(e){if(Hn){Hn(e,{replace:true});return}typeof window!="undefined"&&window.location.replace(e);}var Er=["auto","light","dark"],ac=[{label:"Default",value:"default",primary:{light:"oklch(0.205 0 0)",dark:"oklch(0.922 0 0)"}},{label:"Brutalist",value:"brutalist",primary:{light:"oklch(0.6489 0.2370 26.9728)",dark:"oklch(0.7044 0.1872 23.1858)"}},{label:"Soft Pop",value:"soft-pop",primary:{light:"oklch(0.5106 0.2301 276.9656)",dark:"oklch(0.6801 0.1583 276.9349)"}},{label:"Tangerine",value:"tangerine",primary:{light:"oklch(0.64 0.17 36.44)",dark:"oklch(0.64 0.17 36.44)"}}],eb=ac.map(e=>e.value);var sn="gi_theme",lo="gi-theme-mode-change",rc=new Set(Er);function aa(){return typeof window!="undefined"?window:void 0}function ra(){return typeof document!="undefined"?document.documentElement:null}function ic(){var t,o,a;let e=aa();return e&&(a=(o=(t=e.matchMedia)==null?void 0:t.call(e,"(prefers-color-scheme: dark)"))==null?void 0:o.matches)!=null?a:false}function rn(e){return typeof e=="string"&&rc.has(e)}function On(e){return e==="auto"?ic()?"dark":"light":e}function co(e){let t=ra();if(!t)return;let o=On(e);t.dataset.themeMode=e,t.dataset.themeModeResolved=o,t.classList.toggle("dark",o==="dark");}function Dr(e="auto"){var o;co(e);let t=aa();if(t){try{(o=t.localStorage)==null||o.setItem(sn,e);}catch{}t.dispatchEvent(new CustomEvent(lo,{detail:e}));}}function ob(){var r,i;let e=ra(),t=(r=e==null?void 0:e.dataset)==null?void 0:r.themeMode;if(rn(t))return t;let o=aa(),a=(i=o==null?void 0:o.localStorage)==null?void 0:i.getItem(sn);return rn(a)?a:"auto"}function ab(e){let t=ra();t&&(t.dataset.themePreset=e);}function l(...e){return tailwindMerge.twMerge(clsx.clsx(e))}function lb(e,t={}){let{currency:o="USD",noDecimals:a=false}=t;return new Intl.NumberFormat("en-US",{style:"currency",currency:o,minimumFractionDigits:a?0:2,maximumFractionDigits:a?0:2}).format(e)}function cb(e){return e.split(" ").filter(Boolean).map(t=>{var o,a;return (a=(o=t[0])==null?void 0:o.toUpperCase())!=null?a:""}).join("").slice(0,2)}function pb(e){let t=new Set,o={};function a(){return o}function r(c){let u=o,d=typeof c=="function"?c(u):c;if(!d)return;let b=false,m={...u};for(let[h,x]of Object.entries(d)){let f=h,v=x;Object.is(m[f],v)||(b=true,m[f]=v);}b&&(o=m,t.forEach(h=>h(m,u)));}o=e(r,a);function i(c){return t.add(c),()=>t.delete(c)}return {getState:a,setState:r,subscribe:i}}function mb(e,t){return X.useSyncExternalStore(o=>e.subscribe(()=>o()),()=>t(e.getState()),()=>t(e.getState()))}var yt="h-10 md:h-9";var uo=false,cn=false,ln=null,dc=()=>typeof window!="undefined"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,Lr=e=>{if(!e||typeof e.scrollIntoView!="function")return;let t=dc(),o=()=>e.scrollIntoView({behavior:t?"auto":"smooth",block:"center",inline:"nearest"});if(typeof window!="undefined"&&typeof window.requestAnimationFrame=="function"){window.requestAnimationFrame(o);return}o();},uc=e=>{if(typeof window=="undefined")return;let t=window.visualViewport;if(!t)return;let o=null,a,r=false,i,c=()=>{t.removeEventListener("resize",u),t.removeEventListener("scroll",u),typeof i=="number"&&window.clearTimeout(i),o!==null&&typeof window.cancelAnimationFrame=="function"&&(window.cancelAnimationFrame(o),o=null),typeof a=="number"&&(window.clearTimeout(a),a=void 0),r=false;},u=()=>{if(typeof document!="undefined"&&document.activeElement!==e||!e.isConnected){c();return}let d=()=>{o=null,Ir(e)||(c(),Lr(e));};if(!r){if(r=true,typeof window.requestAnimationFrame=="function"){o=window.requestAnimationFrame(()=>{r=false,o=null,d();});return}a=window.setTimeout(()=>{a=void 0,r=false,d();},0);}};t.addEventListener("resize",u,{passive:true}),t.addEventListener("scroll",u,{passive:true}),i=window.setTimeout(c,700);},pc=(e,t)=>{let o=e.height+e.offsetTop,a=t-o;return Math.max(0,a)},mc=()=>{if(uo)return Promise.resolve(true);if(cn)return Promise.resolve(false);if(typeof window=="undefined")return cn=true,Promise.resolve(false);let e=window.visualViewport;return e?ln||(ln=new Promise(t=>{let o=false,a,r=Math.max(e.height+e.offsetTop,typeof window!="undefined"?window.innerHeight:0),i=u=>{o||(o=true,e.removeEventListener("resize",c),e.removeEventListener("scroll",c),typeof a=="number"&&window.clearTimeout(a),u?uo=true:cn=true,t(u));},c=()=>{pc(e,r)>80&&i(true);};a=window.setTimeout(()=>i(false),600),c(),o||(e.addEventListener("resize",c,{passive:true}),e.addEventListener("scroll",c,{passive:true}));}).finally(()=>{ln=null;}),ln):(cn=true,Promise.resolve(false))},Ir=e=>{if(typeof window=="undefined")return true;let t=e.getBoundingClientRect(),o=window.visualViewport;if(!o){let i=window.innerHeight||0;return t.top>=0&&t.bottom<=i}let a=o.offsetTop,r=a+o.height;return t.top>=a&&t.bottom<=r},po=e=>{e&&mc().then(t=>{if(!t||typeof document!="undefined"&&document.activeElement!==e||!e.isConnected)return;if(Ir(e)){uc(e);return}let o=()=>Lr(e);if(typeof window!="undefined"&&typeof window.requestAnimationFrame=="function"){window.requestAnimationFrame(o);return}o();});},bb={get isVirtualKeyboardLikelyDevice(){return uo},get hasAttemptedVirtualKeyboardDetection(){return cn},reset(){uo=false,cn=false,ln=null;}};function Ar({data:e,columns:t,enableRowSelection:o=true,defaultPageIndex:a,defaultPageSize:r,getRowId:i}){let[c,u]=X__namespace.useState({}),[d,b]=X__namespace.useState({}),[m,h]=X__namespace.useState([]),[x,f]=X__namespace.useState([]),[v,p]=X__namespace.useState({pageIndex:a!=null?a:0,pageSize:r!=null?r:10});return reactTable.useReactTable({data:e,columns:t,state:{sorting:x,columnVisibility:d,rowSelection:c,columnFilters:m,pagination:v},enableRowSelection:o,getRowId:i!=null?i:(w=>w.id.toString()),onRowSelectionChange:u,onSortingChange:f,onColumnFiltersChange:h,onColumnVisibilityChange:b,onPaginationChange:p,getCoreRowModel:reactTable.getCoreRowModel(),getFilteredRowModel:reactTable.getFilteredRowModel(),getPaginationRowModel:reactTable.getPaginationRowModel(),getSortedRowModel:reactTable.getSortedRowModel(),getFacetedRowModel:reactTable.getFacetedRowModel(),getFacetedUniqueValues:reactTable.getFacetedUniqueValues()})}function Sb({...e}){return n(radixUi.Accordion.Root,{"data-slot":"accordion",...e})}function kb({className:e,...t}){return n(radixUi.Accordion.Item,{"data-slot":"accordion-item",className:l("border-b last:border-b-0",e),...t})}function Mb({className:e,children:t,...o}){return n(radixUi.Accordion.Header,{className:"flex",children:s(radixUi.Accordion.Trigger,{"data-slot":"accordion-trigger",className:l("focus-visible:border-primary focus-visible:ring-primary/40 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",e),...o,children:[t,n(lucideReact.ChevronDownIcon,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"})]})})}function Eb({className:e,children:t,...o}){return n(radixUi.Accordion.Content,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...o,children:n("div",{className:l("pt-0 pb-4",e),children:t})})}var Cc=classVarianceAuthority.cva("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function nt({className:e,variant:t,...o}){return n("div",{"data-slot":"alert",role:"alert",className:l(Cc({variant:t}),e),...o})}function ot({className:e,...t}){return n("div",{"data-slot":"alert-title",className:l("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function at({className:e,...t}){return n("div",{"data-slot":"alert-description",className:l("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}var Mt=classVarianceAuthority.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-primary focus-visible:ring-primary/40 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 hover:bg-primary/90",destructive:"bg-destructive text-white 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 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"}}),J=X__namespace.forwardRef(({className:e,variant:t,size:o,asChild:a=false,loading:r=false,loadingText:i,children:c,disabled:u,...d},b)=>{let m=a?radixUi.Slot.Slot:"button";return s(m,{"data-slot":"button",className:l(Mt({variant:t,size:o,className:e}),r?"relative":"disabled:opacity-50"),disabled:r||u,"data-loading":r?"":void 0,ref:b,...d,children:[n("span",{className:l("pointer-events-none inline-flex items-center justify-center gap-2 w-full",r&&"invisible"),children:c}),r?s("span",{className:"pointer-events-none absolute inset-0 inline-flex items-center justify-center gap-2",children:[i!=null?i:n(lucideReact.Loader2,{className:"size-4 animate-spin","aria-hidden":"true"}),n("span",{className:"sr-only",children:typeof i=="string"?i:"Loading"})]}):null]})});J.displayName="Button";function qb({...e}){return n(radixUi.AlertDialog.Root,{"data-slot":"alert-dialog",...e})}function Wb({...e}){return n(radixUi.AlertDialog.Trigger,{"data-slot":"alert-dialog-trigger",...e})}function Sc({...e}){return n(radixUi.AlertDialog.Portal,{"data-slot":"alert-dialog-portal",...e})}function kc({className:e,...t}){return n(radixUi.AlertDialog.Overlay,{"data-slot":"alert-dialog-overlay",className:l("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 Yb({className:e,...t}){return s(Sc,{children:[n(kc,{}),n(radixUi.AlertDialog.Content,{"data-slot":"alert-dialog-content",className:l("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...t})]})}function Kb({className:e,...t}){return n("div",{"data-slot":"alert-dialog-header",className:l("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Jb({className:e,...t}){return n("div",{"data-slot":"alert-dialog-footer",className:l("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function Xb({className:e,...t}){return n(radixUi.AlertDialog.Title,{"data-slot":"alert-dialog-title",className:l("text-lg font-semibold",e),...t})}function Zb({className:e,...t}){return n(radixUi.AlertDialog.Description,{"data-slot":"alert-dialog-description",className:l("text-muted-foreground text-sm",e),...t})}function Qb({className:e,...t}){return n(radixUi.AlertDialog.Action,{className:l(Mt(),e),...t})}function ev({className:e,...t}){return n(radixUi.AlertDialog.Cancel,{className:l(Mt({variant:"outline"}),e),...t})}function av({...e}){return n(radixUi.AspectRatio.Root,{"data-slot":"aspect-ratio",...e})}function cv({className:e,...t}){return n(radixUi.Avatar.Root,{"data-slot":"avatar",className:l("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...t})}function dv({className:e,...t}){return n(radixUi.Avatar.Image,{"data-slot":"avatar-image",className:l("aspect-square size-full",e),...t})}function uv({className:e,...t}){return n(radixUi.Avatar.Fallback,{"data-slot":"avatar-fallback",className:l("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}var Lc=classVarianceAuthority.cva("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-primary focus-visible:ring-primary/40 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"}});function $t({className:e,variant:t,asChild:o=false,...a}){let r=o?radixUi.Slot.Slot:"span";return n(r,{"data-slot":"badge",className:l(Lc({variant:t}),e),...a})}function Rv({...e}){return n("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function Cv({className:e,...t}){return n("ol",{"data-slot":"breadcrumb-list",className:l("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...t})}function Tv({className:e,...t}){return n("li",{"data-slot":"breadcrumb-item",className:l("inline-flex items-center gap-1.5",e),...t})}function Pv({asChild:e,className:t,...o}){let a=e?radixUi.Slot.Slot:"a";return n(a,{"data-slot":"breadcrumb-link",className:l("hover:text-foreground transition-colors",t),...o})}function Nv({className:e,...t}){return n("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:l("text-foreground font-normal",e),...t})}function Sv({children:e,className:t,...o}){return n("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:l("[&>svg]:size-3.5",t),...o,children:e!=null?e:n(lucideReact.ChevronRight,{})})}function kv({className:e,...t}){return s("span",{"data-slot":"breadcrumb-ellipsis",role:"presentation","aria-hidden":"true",className:l("flex size-9 items-center justify-center",e),...t,children:[n(lucideReact.MoreHorizontal,{className:"size-4"}),n("span",{className:"sr-only",children:"More"})]})}function Fv({className:e,classNames:t,showOutsideDays:o=true,captionLayout:a="label",buttonVariant:r="ghost",formatters:i,components:c,...u}){let d=reactDayPicker.getDefaultClassNames();return n(reactDayPicker.DayPicker,{showOutsideDays:o,className:l("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:a,formatters:{formatMonthDropdown:b=>b.toLocaleString("default",{month:"short"}),...i},classNames:{root:l("w-fit",d.root),months:l("flex gap-4 flex-col md:flex-row relative",d.months),month:l("flex flex-col w-full gap-4",d.month),nav:l("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",d.nav),button_previous:l(Mt({variant:r}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",d.button_previous),button_next:l(Mt({variant:r}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",d.button_next),month_caption:l("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",d.month_caption),dropdowns:l("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",d.dropdowns),dropdown_root:l("relative has-focus:border-primary border border-input shadow-xs has-focus:ring-primary/40 has-focus:ring-[3px] rounded-md",d.dropdown_root),dropdown:l("absolute bg-popover inset-0 opacity-0",d.dropdown),caption_label:l("select-none font-medium",a==="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",d.caption_label),table:"w-full border-collapse",weekdays:l("flex",d.weekdays),weekday:l("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",d.weekday),week:l("flex w-full mt-2",d.week),week_number_header:l("select-none w-(--cell-size)",d.week_number_header),week_number:l("text-[0.8rem] select-none text-muted-foreground",d.week_number),day:l("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",d.day),range_start:l("rounded-l-md bg-accent",d.range_start),range_middle:l("rounded-none",d.range_middle),range_end:l("rounded-r-md bg-accent",d.range_end),today:l("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",d.today),outside:l("text-muted-foreground aria-selected:text-muted-foreground",d.outside),disabled:l("text-muted-foreground opacity-50",d.disabled),hidden:l("invisible",d.hidden),...t},components:{Root:({className:b,rootRef:m,...h})=>n("div",{"data-slot":"calendar",ref:m,className:l(b),...h}),Chevron:({className:b,orientation:m,...h})=>m==="left"?n(lucideReact.ChevronLeftIcon,{className:l("size-4",b),...h}):m==="right"?n(lucideReact.ChevronRightIcon,{className:l("size-4",b),...h}):n(lucideReact.ChevronDownIcon,{className:l("size-4",b),...h}),DayButton:zc,WeekNumber:({children:b,...m})=>n("td",{...m,children:n("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:b})}),...c},...u})}function zc({className:e,day:t,modifiers:o,...a}){let r=reactDayPicker.getDefaultClassNames(),i=X__namespace.useRef(null);return X__namespace.useEffect(()=>{var c;o.focused&&((c=i.current)==null||c.focus());},[o.focused]),n(J,{ref:i,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":o.selected&&!o.range_start&&!o.range_end&&!o.range_middle,"data-range-start":o.range_start,"data-range-end":o.range_end,"data-range-middle":o.range_middle,className:l("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-primary group-data-[focused=true]/day:ring-primary/40 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",r.day,e),...a})}function Ge({className:e,...t}){return n("div",{"data-slot":"card",className:l("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6",e),...t})}function Ke({className:e,...t}){return n("div",{"data-slot":"card-header",className:l("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function Je({className:e,...t}){return n("div",{"data-slot":"card-title",className:l("leading-none font-semibold",e),...t})}function Xe({className:e,...t}){return n("div",{"data-slot":"card-description",className:l("text-muted-foreground text-sm",e),...t})}function zv({className:e,...t}){return n("div",{"data-slot":"card-action",className:l("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...t})}function $e({className:e,...t}){return n("div",{"data-slot":"card-content",className:l("px-6",e),...t})}function Vv({className:e,...t}){return n("div",{"data-slot":"card-footer",className:l("flex items-center px-6 [.border-t]:pt-6",e),...t})}var Hr=X__namespace.createContext(null);function fo(){let e=X__namespace.useContext(Hr);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}function Yv({orientation:e="horizontal",opts:t,setApi:o,plugins:a,className:r,children:i,...c}){let[u,d]=Vc__default.default({...t,axis:e==="horizontal"?"x":"y"},a),[b,m]=X__namespace.useState(false),[h,x]=X__namespace.useState(false),f=X__namespace.useCallback(w=>{w&&(m(w.canScrollPrev()),x(w.canScrollNext()));},[]),v=X__namespace.useCallback(()=>{d==null||d.scrollPrev();},[d]),p=X__namespace.useCallback(()=>{d==null||d.scrollNext();},[d]),y=X__namespace.useCallback(w=>{w.key==="ArrowLeft"?(w.preventDefault(),v()):w.key==="ArrowRight"&&(w.preventDefault(),p());},[v,p]);return X__namespace.useEffect(()=>{!d||!o||o(d);},[d,o]),X__namespace.useEffect(()=>{if(d)return f(d),d.on("reInit",f),d.on("select",f),()=>{d==null||d.off("select",f);}},[d,f]),n(Hr.Provider,{value:{carouselRef:u,api:d,opts:t,orientation:e||((t==null?void 0:t.axis)==="y"?"vertical":"horizontal"),scrollPrev:v,scrollNext:p,canScrollPrev:b,canScrollNext:h},children:n("div",{onKeyDownCapture:y,className:l("relative",r),role:"region","aria-roledescription":"carousel","data-slot":"carousel",...c,children:i})})}function Kv({className:e,...t}){let{carouselRef:o,orientation:a}=fo();return n("div",{ref:o,className:"overflow-hidden","data-slot":"carousel-content",children:n("div",{className:l("flex",a==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})}function Jv({className:e,...t}){let{orientation:o}=fo();return n("div",{role:"group","aria-roledescription":"slide","data-slot":"carousel-item",className:l("min-w-0 shrink-0 grow-0 basis-full",o==="horizontal"?"pl-4":"pt-4",e),...t})}function Xv({className:e,variant:t="outline",size:o="icon",...a}){let{orientation:r,scrollPrev:i,canScrollPrev:c}=fo();return s(J,{"data-slot":"carousel-previous",variant:t,size:o,className:l("absolute size-8 rounded-full",r==="horizontal"?"top-1/2 -left-12 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!c,onClick:i,...a,children:[n(lucideReact.ArrowLeft,{}),n("span",{className:"sr-only",children:"Previous slide"})]})}function Zv({className:e,variant:t="outline",size:o="icon",...a}){let{orientation:r,scrollNext:i,canScrollNext:c}=fo();return s(J,{"data-slot":"carousel-next",variant:t,size:o,className:l("absolute size-8 rounded-full",r==="horizontal"?"top-1/2 -right-12 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!c,onClick:i,...a,children:[n(lucideReact.ArrowRight,{}),n("span",{className:"sr-only",children:"Next slide"})]})}var $c=50,qc=10;function zr(e){let t=X.useRef(null),o=X.useRef(null),[a,r]=X.useState(true),i=()=>{t.current&&(t.current.scrollTop=t.current.scrollHeight);},c=()=>{if(t.current){let{scrollTop:d,scrollHeight:b,clientHeight:m}=t.current,h=Math.abs(b-d-m),x=o.current?d<o.current:false,f=o.current?o.current-d:0;if(x&&f>qc)r(false);else {let p=h<$c;r(p);}o.current=d;}},u=()=>{r(false);};return X.useEffect(()=>{t.current&&(o.current=t.current.scrollTop);},[]),X.useEffect(()=>{a&&i();},e),{containerRef:t,scrollToBottom:i,handleScroll:c,shouldAutoScroll:a,handleTouchStart:u}}function jr({text:e,copyMessage:t="Copied to clipboard!"}){let[o,a]=X.useState(false),r=X.useRef(null),i=X.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{sonner.toast.success(t),a(true),r.current&&(clearTimeout(r.current),r.current=null),r.current=setTimeout(()=>{a(false);},2e3);}).catch(()=>{sonner.toast.error("Failed to copy to clipboard.");});},[e,t]);return {isCopied:o,handleCopy:i}}function sa({content:e,copyMessage:t}){let{isCopied:o,handleCopy:a}=jr({text:e,copyMessage:t});return s(J,{variant:"ghost",size:"icon",className:"relative h-6 w-6","aria-label":"Copy to clipboard",onClick:a,children:[n("div",{className:"absolute inset-0 flex items-center justify-center",children:n(lucideReact.Check,{className:l("h-4 w-4 transition-transform ease-in-out",o?"scale-100":"scale-0")})}),n(lucideReact.Copy,{className:l("h-4 w-4 transition-transform ease-in-out",o?"scale-0":"scale-100")})]})}function Ur({ref:e,maxHeight:t=Number.MAX_SAFE_INTEGER,borderWidth:o=0,dependencies:a}){let r=X.useRef(null);X.useLayoutEffect(()=>{if(!e.current)return;let i=e.current,c=o*2;r.current===null&&(r.current=i.scrollHeight-c),i.style.removeProperty("height");let u=i.scrollHeight,d=Math.min(u,t),b=Math.max(d,r.current);i.style.height=`${b+c}px`;},[t,e,...a]);}var Vn=X__namespace.default.forwardRef((e,t)=>e.file.type.startsWith("image/")?n(Gr,{...e,ref:t}):e.file.type.startsWith("text/")||e.file.name.endsWith(".txt")||e.file.name.endsWith(".md")?n($r,{...e,ref:t}):n(qr,{...e,ref:t}));Vn.displayName="FilePreview";var Gr=X__namespace.default.forwardRef(({file:e,onRemove:t},o)=>s(framerMotion.motion.div,{ref:o,className:"relative flex max-w-[200px] rounded-md border p-1.5 pr-2 text-xs",layout:true,initial:{opacity:0,y:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:"100%"},children:[s("div",{className:"flex w-full items-center space-x-2",children:[n("img",{alt:`Attachment ${e.name}`,className:"grid h-10 w-10 shrink-0 place-items-center rounded-sm border bg-muted object-cover",src:URL.createObjectURL(e)}),n("span",{className:"w-full truncate text-muted-foreground",children:e.name})]}),t?n("button",{className:"absolute -right-2 -top-2 flex h-4 w-4 items-center justify-center rounded-full border bg-background",type:"button",onClick:t,"aria-label":"Remove attachment",children:n(lucideReact.X,{className:"h-2.5 w-2.5"})}):null]}));Gr.displayName="ImageFilePreview";var $r=X__namespace.default.forwardRef(({file:e,onRemove:t},o)=>{let[a,r]=X__namespace.default.useState("");return X.useEffect(()=>{let i=new FileReader;i.onload=c=>{var d;let u=(d=c.target)==null?void 0:d.result;r(u.slice(0,50)+(u.length>50?"...":""));},i.readAsText(e);},[e]),s(framerMotion.motion.div,{ref:o,className:"relative flex max-w-[200px] rounded-md border p-1.5 pr-2 text-xs",layout:true,initial:{opacity:0,y:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:"100%"},children:[s("div",{className:"flex w-full items-center space-x-2",children:[n("div",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-sm border bg-muted p-0.5",children:n("div",{className:"h-full w-full overflow-hidden text-[6px] leading-none text-muted-foreground",children:a||"Loading..."})}),n("span",{className:"w-full truncate text-muted-foreground",children:e.name})]}),t?n("button",{className:"absolute -right-2 -top-2 flex h-4 w-4 items-center justify-center rounded-full border bg-background",type:"button",onClick:t,"aria-label":"Remove attachment",children:n(lucideReact.X,{className:"h-2.5 w-2.5"})}):null]})});$r.displayName="TextFilePreview";var qr=X__namespace.default.forwardRef(({file:e,onRemove:t},o)=>s(framerMotion.motion.div,{ref:o,className:"relative flex max-w-[200px] rounded-md border p-1.5 pr-2 text-xs",layout:true,initial:{opacity:0,y:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:"100%"},children:[s("div",{className:"flex w-full items-center space-x-2",children:[n("div",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-sm border bg-muted",children:n(lucideReact.FileIcon,{className:"h-6 w-6 text-foreground"})}),n("span",{className:"w-full truncate text-muted-foreground",children:e.name})]}),t?n("button",{className:"absolute -right-2 -top-2 flex h-4 w-4 items-center justify-center rounded-full border bg-background",type:"button",onClick:t,"aria-label":"Remove attachment",children:n(lucideReact.X,{className:"h-2.5 w-2.5"})}):null]}));qr.displayName="GenericFilePreview";function da(e){if(e.allowAttachments){let{allowAttachments:a,files:r,setFiles:i,...c}=e;return n(Wr,{...c,allowAttachments:true,files:r,setFiles:i})}let{allowAttachments:t,...o}=e;return n(Wr,{...o,allowAttachments:false,files:null})}da.displayName="MessageInput";function Wr({placeholder:e="Ask AI...",className:t,submitOnEnter:o=true,stop:a,isGenerating:r,allowAttachments:i,files:c,setFiles:u,onKeyDown:d,value:b,...m}){let h=X.useRef(null),[x,f]=X.useState(false),v=i&&!!c&&c.length>0;Ur({ref:h,maxHeight:240,borderWidth:1,dependencies:[b,v]});let p=X.useCallback(g=>{!i||!u||!(g!=null&&g.length)||u(M=>M!=null&&M.length?[...M,...g]:g);},[i,u]),y=X.useCallback(g=>{!i||!u||u(M=>{if(!M)return null;let E=M.filter(S=>S!==g);return E.length>0?E:null});},[i,u]),w=X.useCallback(g=>{i&&(g.preventDefault(),f(true));},[i]),R=X.useCallback(g=>{i&&(g.preventDefault(),f(false));},[i]),N=X.useCallback(g=>{if(!i)return;g.preventDefault(),f(false);let M=Array.from(g.dataTransfer.files);p(M);},[p,i]),C=X.useCallback(g=>{var T;if(!i)return;let M=(T=g.clipboardData)==null?void 0:T.items;if(!M)return;let E=g.clipboardData.getData("text");if(E&&E.length>500){g.preventDefault();let P=new Blob([E],{type:"text/plain"}),F=new File([P],"Pasted text",{type:"text/plain",lastModified:Date.now()});p([F]);return}let S=Array.from(M).map(P=>P.getAsFile()).filter(P=>P!==null);S.length>0&&(g.preventDefault(),p(S));},[p,i]),k=X.useCallback(g=>{var M;o&&g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),r&&a&&a(),(M=g.currentTarget.form)==null||M.requestSubmit()),d==null||d(g);},[r,d,a,o]);return s("div",{className:"relative flex w-full",onDragOver:w,onDragLeave:R,onDrop:N,children:[n("div",{className:"relative flex w-full items-center space-x-2",children:s("div",{className:"relative flex-1",children:[n("textarea",{"aria-label":"Write your prompt here",placeholder:e,ref:h,onPaste:C,onKeyDown:k,className:l("z-10 w-full grow resize-none rounded-xl border border-input bg-background p-3 pr-24 text-sm ring-offset-background transition-[border] placeholder:text-muted-foreground focus-visible:border-primary focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",v&&"pb-16",t),value:b,...m}),i&&n("div",{className:"absolute inset-x-3 bottom-0 z-20 overflow-x-auto py-3",children:n("div",{className:"flex space-x-3",children:n(framerMotion.AnimatePresence,{mode:"popLayout",children:c==null?void 0:c.map(g=>n(Vn,{file:g,onRemove:()=>y(g)},g.name+String(g.lastModified)))})})})]})}),s("div",{className:"absolute right-3 top-3 z-20 flex gap-2",children:[i&&n(J,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8","aria-label":"Attach a file",onClick:async()=>{let g=await ld();p(g);},children:n(lucideReact.Paperclip,{className:"h-4 w-4"})}),r&&a?n(J,{type:"button",size:"icon",className:"h-8 w-8","aria-label":"Stop generating",onClick:a,children:n(lucideReact.Square,{className:"h-3 w-3 animate-pulse",fill:"currentColor"})}):n(J,{type:"submit",size:"icon",className:"h-8 w-8 transition-opacity","aria-label":"Send message",disabled:b.trim()===""&&(!i||!(c!=null&&c.length))||r,children:n(lucideReact.ArrowUp,{className:"h-5 w-5"})})]}),i&&n(sd,{isDragging:x})]})}function sd({isDragging:e}){return n(framerMotion.AnimatePresence,{children:e&&s(framerMotion.motion.div,{className:"pointer-events-none absolute inset-0 z-20 flex items-center justify-center space-x-2 rounded-xl border border-dashed border-border bg-background text-sm text-muted-foreground",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},"aria-hidden":true,children:[n(lucideReact.Paperclip,{className:"h-4 w-4"}),n("span",{children:"Drop your files here to attach them."})]})})}function ld(){let e=document.createElement("input");return e.type="file",e.multiple=true,e.accept="*/*",e.click(),new Promise(t=>{e.onchange=o=>{let r=o.currentTarget.files;if(r){t(Array.from(r));return}t(null);};})}function Jr({...e}){return n(radixUi.Collapsible.Root,{"data-slot":"collapsible",...e})}function Xr({...e}){return n(radixUi.Collapsible.CollapsibleTrigger,{"data-slot":"collapsible-trigger",...e})}function Zr({...e}){return n(radixUi.Collapsible.CollapsibleContent,{"data-slot":"collapsible-content",...e})}var pd={h1:["text-2xl","font-semibold"],h2:["text-xl","font-semibold"],h3:["text-lg","font-semibold"],h4:["text-base","font-semibold"],h5:["text-sm","font-semibold"],h6:["text-sm","font-semibold"],p:["whitespace-pre-wrap"],ul:["list-disc","space-y-1.5","pl-6"],ol:["list-decimal","space-y-1.5","pl-6"],li:["leading-relaxed"],blockquote:["border-l-2","border-primary/60","pl-4","italic","text-muted-foreground"],table:["w-full","border-collapse","overflow-hidden","rounded-md","border"],th:["border","border-foreground/20","bg-muted/50","px-4","py-2","text-left","font-semibold"],td:["border","border-foreground/20","px-4","py-2","align-top"],tr:["even:bg-muted/40"],hr:["my-4","border-foreground/20"],img:["rounded-md","border","max-w-full"],strong:["font-semibold"],em:["italic"]},md="absolute right-2 top-2 rounded-md border bg-background/80 px-2 py-1 text-xs font-medium shadow-sm backdrop-blur transition hover:bg-background",fd=["relative","overflow-x-auto","rounded-md","border","bg-background/50","p-4","font-mono","text-sm"];function un({children:e,className:t}){let o=X.useRef(null),a=X.useMemo(()=>gd(e!=null?e:""),[e]);return X.useEffect(()=>{let r=o.current;if(!r)return;bd(r);let i=vd(r);return ()=>{i();}},[a]),n("div",{ref:o,className:l("space-y-4 text-sm leading-relaxed",t),dangerouslySetInnerHTML:{__html:a}})}un.displayName="HtmlRenderer";var Ih=un;function gd(e){return e?e.replace(/<(script|style|iframe|object|embed|link|meta)[^>]*>[\s\S]*?<\/\1>/gi,"").replace(/<(script|style|iframe|object|embed|link|meta)[^>]*\/>/gi,"").replace(/<(script|style|iframe|object|embed|link|meta)[^>]*>/gi,"").replace(/ on[a-z]+="[^"]*"/gi,"").replace(/ on[a-z]+='[^']*'/gi,"").replace(/javascript:/gi,""):""}function bd(e){Object.entries(pd).forEach(([t,o])=>{e.querySelectorAll(t).forEach(a=>{o.forEach(r=>a.classList.add(r));});}),e.querySelectorAll("a").forEach(t=>{var a,r;t.classList.add("text-primary","underline","underline-offset-4");let o=(a=t.getAttribute("href"))!=null?a:"";if(/^javascript:/i.test(o)&&t.removeAttribute("href"),t.getAttribute("target")==="_blank"){let i=(r=t.getAttribute("rel"))!=null?r:"";/noopener|noreferrer/i.test(i)||t.setAttribute("rel",`${i} noopener noreferrer`.trim());}}),e.querySelectorAll("code").forEach(t=>{var o;((o=t.parentElement)==null?void 0:o.tagName)!=="PRE"&&t.classList.add("rounded","bg-muted/70","px-1.5","py-0.5","font-mono","text-[0.85em]");}),e.querySelectorAll("table").forEach(t=>{var a;if(t.parentElement&&t.parentElement.dataset.htmlRendererTable==="true")return;let o=document.createElement("div");o.dataset.htmlRendererTable="true",o.className="overflow-x-auto rounded-md border border-foreground/20",(a=t.parentElement)==null||a.insertBefore(o,t),o.appendChild(t);});}function vd(e){let t=[];return e.querySelectorAll("button[data-html-renderer-copy]").forEach(o=>{o.remove();}),e.querySelectorAll("pre").forEach(o=>{fd.forEach(d=>o.classList.add(d));let a=document.createElement("button");a.type="button",a.dataset.htmlRendererCopy="true",a.textContent="Copy",a.className=md;let r="Copy",i="Copied!",c="Copy failed",u=async()=>{var b;let d=(b=o.textContent)!=null?b:"";try{if(navigator.clipboard&&navigator.clipboard.writeText)await navigator.clipboard.writeText(d.trimEnd()),a.textContent=i;else throw new Error("Clipboard API unavailable")}catch(m){console.error(m),a.textContent=c;}window.setTimeout(()=>{a.textContent=r;},1500);};a.addEventListener("click",u),o.appendChild(a),t.push(()=>{a.removeEventListener("click",u),a.remove();});}),()=>{t.forEach(o=>o());}}var pa=classVarianceAuthority.cva("group/message relative break-words rounded-lg p-3 text-sm sm:max-w-[70%]",{variants:{isUser:{true:"bg-primary text-primary-foreground",false:"bg-muted text-foreground"},animation:{none:"",slide:"duration-300 animate-in fade-in-0",scale:"duration-300 animate-in fade-in-0 zoom-in-75",fade:"duration-500 animate-in fade-in-0"}},compoundVariants:[{isUser:true,animation:"slide",class:"slide-in-from-right"},{isUser:false,animation:"slide",class:"slide-in-from-left"},{isUser:true,animation:"scale",class:"origin-bottom-right"},{isUser:false,animation:"scale",class:"origin-bottom-left"}]}),ei=({role:e,content:t,createdAt:o,showTimeStamp:a=false,animation:r="scale",actions:i,experimental_attachments:c,toolInvocations:u,parts:d})=>{let b=X.useMemo(()=>c==null?void 0:c.map(x=>{var p;let f=Sd(x.url);return new File([f],(p=x.name)!=null?p:"Unknown",{type:x.contentType})}),[c]),m=e==="user",h=o==null?void 0:o.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});return m?s("div",{className:l("flex flex-col",m?"items-end":"items-start"),children:[b?n("div",{className:"mb-1 flex flex-wrap gap-2",children:b.map((x,f)=>n(Vn,{file:x},f))}):null,n("div",{className:l(pa({isUser:m,animation:r})),children:n(un,{children:t})}),a&&o?n("time",{dateTime:o.toISOString(),className:l("mt-1 block px-1 text-xs opacity-50",r!=="none"&&"duration-500 animate-in fade-in-0"),children:h}):null]}):d&&d.length>0?d.map((x,f)=>x.type==="text"?s("div",{className:l("flex flex-col",m?"items-end":"items-start"),children:[s("div",{className:l(pa({isUser:m,animation:r})),children:[n(un,{children:x.text}),i?n("div",{className:"absolute -bottom-4 right-2 flex space-x-1 rounded-lg border bg-background p-1 text-foreground opacity-0 transition-opacity group-hover/message:opacity-100",children:i}):null]}),a&&o?n("time",{dateTime:o.toISOString(),className:l("mt-1 block px-1 text-xs opacity-50",r!=="none"&&"duration-500 animate-in fade-in-0"),children:h}):null]},`text-${f}`):x.type==="reasoning"?n(kd,{part:x},`reasoning-${f}`):x.type==="tool-invocation"?n(Qr,{toolInvocations:[x.toolInvocation]},`tool-${f}`):null):u&&u.length>0?n(Qr,{toolInvocations:u}):s("div",{className:l("flex flex-col",m?"items-end":"items-start"),children:[s("div",{className:l(pa({isUser:m,animation:r})),children:[n(un,{children:t}),i?n("div",{className:"absolute -bottom-4 right-2 flex space-x-1 rounded-lg border bg-background p-1 text-foreground opacity-0 transition-opacity group-hover/message:opacity-100",children:i}):null]}),a&&o?n("time",{dateTime:o.toISOString(),className:l("mt-1 block px-1 text-xs opacity-50",r!=="none"&&"duration-500 animate-in fade-in-0"),children:h}):null]})};function Sd(e){let[,t=""]=e.split(",");if(!t)return new Uint8Array;if(typeof atob=="function"){let o=atob(t),a=new Uint8Array(o.length);for(let r=0;r<o.length;r+=1)a[r]=o.charCodeAt(r);return a}return typeof Buffer!="undefined"?new Uint8Array(Buffer.from(t,"base64")):new Uint8Array}var kd=({part:e})=>{let[t,o]=X.useState(false);return n("div",{className:"mb-2 flex flex-col items-start sm:max-w-[70%]",children:s(Jr,{open:t,onOpenChange:o,className:"group w-full overflow-hidden rounded-lg border bg-muted/50",children:[n("div",{className:"flex items-center p-2",children:n(Xr,{asChild:true,children:s("button",{className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground",children:[n(lucideReact.ChevronRight,{className:"h-4 w-4 transition-transform group-data-[state=open]:rotate-90"}),n("span",{children:"Thinking"})]})})}),n(Zr,{forceMount:true,children:n(framerMotion.motion.div,{initial:false,animate:t?"open":"closed",variants:{open:{height:"auto",opacity:1},closed:{height:0,opacity:0}},transition:{duration:.3,ease:[.04,.62,.23,.98]},className:"border-t",children:n("div",{className:"p-2",children:n("div",{className:"whitespace-pre-wrap text-xs",children:e.reasoning})})})})]})})};function Qr({toolInvocations:e}){return e!=null&&e.length?n("div",{className:"flex flex-col items-start gap-2",children:e.map((t,o)=>{if(t.state==="result"&&t.result.__cancelled===true)return s("div",{className:"flex items-center gap-2 rounded-lg border bg-muted/50 px-3 py-2 text-sm text-muted-foreground",children:[n(lucideReact.Ban,{className:"h-4 w-4"}),s("span",{children:["Cancelled"," ",s("span",{className:"font-mono",children:["`",t.toolName,"`"]})]})]},o);switch(t.state){case "partial-call":case "call":return s("div",{className:"flex items-center gap-2 rounded-lg border bg-muted/50 px-3 py-2 text-sm text-muted-foreground",children:[n(lucideReact.Terminal,{className:"h-4 w-4"}),s("span",{children:["Calling"," ",s("span",{className:"font-mono",children:["`",t.toolName,"`"]}),"..."]}),n(lucideReact.Loader2,{className:"h-3 w-3 animate-spin"})]},o);case "result":return s("div",{className:"flex flex-col gap-1.5 rounded-lg border bg-muted/50 px-3 py-2 text-sm",children:[s("div",{className:"flex items-center gap-2 text-muted-foreground",children:[n(lucideReact.Code2,{className:"h-4 w-4"}),s("span",{children:["Result from"," ",s("span",{className:"font-mono",children:["`",t.toolName,"`"]})]})]}),n("pre",{className:"overflow-x-auto whitespace-pre-wrap text-foreground",children:JSON.stringify(t.result,null,2)})]},o);default:return null}})}):null}function ti(){return n("div",{className:"justify-left flex space-x-1",children:n("div",{className:"rounded-lg bg-muted p-3",children:s("div",{className:"flex -space-x-2.5",children:[n(lucideReact.Dot,{className:"h-5 w-5 animate-typing-dot-bounce"}),n(lucideReact.Dot,{className:"h-5 w-5 animate-typing-dot-bounce [animation-delay:90ms]"}),n(lucideReact.Dot,{className:"h-5 w-5 animate-typing-dot-bounce [animation-delay:180ms]"})]})})})}function ni({messages:e,showTimeStamps:t=true,isTyping:o=false,messageOptions:a}){return s("div",{className:"space-y-4 overflow-visible",children:[e.map((r,i)=>{let c=typeof a=="function"?a(r):a;return n(ei,{showTimeStamp:t,...r,...c},i)}),o&&n(ti,{})]})}function oi({label:e,append:t,suggestions:o}){return s("div",{className:"space-y-6",children:[n("h2",{className:"text-center text-2xl font-bold",children:e}),n("div",{className:"flex gap-6 text-sm",children:o.map(a=>n("button",{onClick:()=>t({role:"user",content:a}),className:"h-max flex-1 rounded-xl border bg-background p-4 hover:bg-muted",children:n("p",{children:a})},a))})]})}function Ad({messages:e,handleSubmit:t,input:o,handleInputChange:a,stop:r,isGenerating:i,append:c,suggestions:u,className:d,onRateResponse:b,setMessages:m}){let h=e.at(-1),x=e.length===0,f=(h==null?void 0:h.role)==="user",v=X.useRef(e);v.current=e;let p=X.useCallback(()=>{if(r==null||r(),!m)return;let w=[...v.current],R;for(let k=w.length-1;k>=0;k-=1){let g=w[k];if(g.role==="assistant"){R=g;break}}if(!R)return;let N=false,C={...R};if(R.toolInvocations){let k=R.toolInvocations.map(g=>g.state==="call"?(N=true,{...g,state:"result",result:{content:"Tool execution was cancelled",__cancelled:true}}):g);N&&(C={...C,toolInvocations:k});}if(R.parts&&R.parts.length>0){let k=R.parts.map(g=>{if(g.type==="tool-invocation"&&g.toolInvocation.state==="call"){N=true;let M={...g.toolInvocation,state:"result",result:{content:"Tool execution was cancelled",__cancelled:true}};return {...g,toolInvocation:M}}return g});N&&(C={...C,parts:k});}if(N){let k=w.findIndex(g=>g.id===R.id);k!==-1&&(w[k]=C,m(w));}},[r,m,v]),y=X.useCallback(w=>({actions:b?s(jsxRuntime.Fragment,{children:[n("div",{className:"border-r pr-1",children:n(sa,{content:w.content,copyMessage:"Copied response to clipboard!"})}),n(J,{size:"icon",variant:"ghost",className:"h-6 w-6",onClick:()=>b(w.id,"thumbs-up"),children:n(lucideReact.ThumbsUp,{className:"h-4 w-4"})}),n(J,{size:"icon",variant:"ghost",className:"h-6 w-6",onClick:()=>b(w.id,"thumbs-down"),children:n(lucideReact.ThumbsDown,{className:"h-4 w-4"})})]}):n(sa,{content:w.content,copyMessage:"Copied response to clipboard!"})}),[b]);return s(ii,{className:d,children:[x&&c&&u?n(oi,{label:"Try these prompts \u2728",append:c,suggestions:u}):null,e.length>0?n(_d,{messages:e,children:n(ni,{messages:e,isTyping:f,messageOptions:y})}):null,n(si,{className:"mt-auto",handleSubmit:t,children:({files:w,setFiles:R})=>n(da,{value:o,onChange:a,allowAttachments:true,files:w,setFiles:R,stop:p,isGenerating:i})})]})}Ad.displayName="Chat";function _d({messages:e,children:t}){let{containerRef:o,scrollToBottom:a,handleScroll:r,shouldAutoScroll:i,handleTouchStart:c}=zr([e]);return s("div",{className:"grid grid-cols-1 overflow-y-auto pb-4",ref:o,onScroll:r,onTouchStart:c,children:[n("div",{className:"max-w-full [grid-column:1/1] [grid-row:1/1]",children:t}),!i&&n("div",{className:"pointer-events-none flex flex-1 items-end justify-end [grid-column:1/1] [grid-row:1/1]",children:n("div",{className:"sticky bottom-0 left-0 flex w-full justify-end",children:n(J,{onClick:a,className:"pointer-events-auto h-8 w-8 rounded-full ease-in-out animate-in fade-in-0 slide-in-from-bottom-1",size:"icon",variant:"ghost",children:n(lucideReact.ArrowDown,{className:"h-4 w-4"})})})})]})}var ii=X.forwardRef(({className:e,...t},o)=>n("div",{ref:o,className:l("grid max-h-full w-full grid-rows-[1fr_auto]",e),...t}));ii.displayName="ChatContainer";var si=X.forwardRef(({children:e,handleSubmit:t,className:o},a)=>{let[r,i]=X.useState(null);return n("form",{ref:a,onSubmit:u=>{if(!r){t(u);return}let d=Fd(r);t(u,{experimental_attachments:d}),i(null);},className:o,children:e({files:r,setFiles:i})})});si.displayName="ChatForm";function Fd(e){let t=new DataTransfer;for(let o of Array.from(e))t.items.add(o);return t.files}var Hd={light:"",dark:".dark"},li=X__namespace.createContext(null);function ci(){let e=X__namespace.useContext(li);if(!e)throw new Error("useChart must be used within a <ChartContainer />");return e}function fy({id:e,className:t,children:o,config:a,...r}){let i=X__namespace.useId(),c=`chart-${e||i.replace(/:/g,"")}`;return n(li.Provider,{value:{config:a},children:s("div",{"data-slot":"chart","data-chart":c,className:l("[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",t),...r,children:[n(Od,{id:c,config:a}),n(pn__namespace.ResponsiveContainer,{children:o})]})})}var Od=({id:e,config:t})=>{let o=Object.entries(t).filter(([,a])=>a.theme||a.color);return o.length?n("style",{dangerouslySetInnerHTML:{__html:Object.entries(Hd).map(([a,r])=>`
|
|
2
|
-
${
|
|
3
|
-
${
|
|
1
|
+
'use strict';var J=require('react'),lucideReact=require('lucide-react'),jsxRuntime=require('react/jsx-runtime'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),reactTable=require('@tanstack/react-table'),radixUi=require('radix-ui'),classVarianceAuthority=require('class-variance-authority'),reactDayPicker=require('react-day-picker'),Vc=require('embla-carousel-react'),sonner=require('sonner'),framerMotion=require('framer-motion'),ua=require('recharts'),cmdk=require('cmdk'),dateFns=require('date-fns'),vaul=require('vaul'),inputOtp=require('input-otp'),Pa=require('react-resizable-panels'),core=require('@dnd-kit/core'),modifiers=require('@dnd-kit/modifiers'),sortable=require('@dnd-kit/sortable'),utilities=require('@dnd-kit/utilities');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var J__namespace=/*#__PURE__*/_interopNamespace(J);var Vc__default=/*#__PURE__*/_interopDefault(Vc);var ua__namespace=/*#__PURE__*/_interopNamespace(ua);var Pa__namespace=/*#__PURE__*/_interopNamespace(Pa);function wn(e){return typeof document=="undefined"?[]:Array.from(document.querySelectorAll(e))}function Og(e){for(let t of wn('[data-slot="sidebar-inset"]'))t.dataset.contentLayout=e;}function Bg(e){for(let t of wn("header[data-navbar-style]"))t.dataset.navbarStyle=e;}var xn={fieldCy:false,fieldName:false},yn=xn,ir=new Map,oa=[],kn=()=>{let e=oa[oa.length-1];yn=e?ir.get(e):xn;},Rn=()=>Symbol("theme-extras-provider"),Cn=()=>yn,Tn=(e,t)=>{let r={fieldCy:t.fieldCy,fieldName:t.fieldName};ir.set(e,r),oa.includes(e)||oa.push(e),kn();},Pn=e=>{if(!ir.has(e))return;ir.delete(e);let t=oa.indexOf(e);t!==-1&&oa.splice(t,1),kn();};var Xl=new Set(["input","select","textarea","form","button"]),Qr=(e,t)=>{if(t===null||typeof t!="object"||typeof e!="string")return t;let r=Cn(),o=!r.fieldCy,n=!r.fieldName&&Xl.has(e);if(!o&&!n)return t;let i=t,c=null,u=()=>(c||(c={...i}),c);if(o&&Object.prototype.hasOwnProperty.call(i,"data-cy")){let d=u();delete d["data-cy"];}if(n&&Object.prototype.hasOwnProperty.call(i,"name")){let d=u();delete d.name;}return c!=null?c:i};var a=(e,t,r)=>jsxRuntime.jsx(e,Qr(e,t),r),s=(e,t,r)=>jsxRuntime.jsxs(e,Qr(e,t),r);var to=J.createContext(null),Aa=null;function eo(){return typeof window=="undefined"?"/":window.location.pathname||"/"}function Sn({children:e}){let[t,r]=J.useState(()=>eo()),o=J.useCallback((i,c={})=>{typeof window!="undefined"&&(c.replace?window.history.replaceState(null,"",i):window.history.pushState(null,"",i),r(eo()));},[]);J.useEffect(()=>{Aa=o;let i=()=>{r(eo());};return window.addEventListener("popstate",i),()=>{window.removeEventListener("popstate",i),Aa===o&&(Aa=null);}},[o]);let n=J.useMemo(()=>({pathname:t,navigate:o}),[t,o]);return a(to.Provider,{value:n,children:e})}function Xg(){let e=J.useContext(to);if(!e)throw new Error("usePathname must be used within a RouterProvider");return e.pathname}function Jg(){let e=J.useContext(to);if(!e)throw new Error("useNavigate must be used within a RouterProvider");return e.navigate}function Mn(e){if(Aa){Aa(e,{replace:true});return}typeof window!="undefined"&&window.location.replace(e);}var En=["auto","light","dark"],oc=[{label:"Default",value:"default",primary:{light:"oklch(0.205 0 0)",dark:"oklch(0.922 0 0)"}},{label:"Brutalist",value:"brutalist",primary:{light:"oklch(0.6489 0.2370 26.9728)",dark:"oklch(0.7044 0.1872 23.1858)"}},{label:"Soft Pop",value:"soft-pop",primary:{light:"oklch(0.5106 0.2301 276.9656)",dark:"oklch(0.6801 0.1583 276.9349)"}},{label:"Tangerine",value:"tangerine",primary:{light:"oklch(0.64 0.17 36.44)",dark:"oklch(0.64 0.17 36.44)"}}],ev=oc.map(e=>e.value);var ia="gi_theme",sr="gi-theme-mode-change",nc=new Set(En);function ao(){return typeof window!="undefined"?window:void 0}function ro(){return typeof document!="undefined"?document.documentElement:null}function ic(){var t,r,o;let e=ao();return e&&(o=(r=(t=e.matchMedia)==null?void 0:t.call(e,"(prefers-color-scheme: dark)"))==null?void 0:r.matches)!=null?o:false}function na(e){return typeof e=="string"&&nc.has(e)}function Fa(e){return e==="auto"?ic()?"dark":"light":e}function lr(e){let t=ro();if(!t)return;let r=Fa(e);t.dataset.themeMode=e,t.dataset.themeModeResolved=r,t.classList.toggle("dark",r==="dark");}function Dn(e="auto"){var r;lr(e);let t=ao();if(t){try{(r=t.localStorage)==null||r.setItem(ia,e);}catch{}t.dispatchEvent(new CustomEvent(sr,{detail:e}));}}function rv(){var n,i;let e=ro(),t=(n=e==null?void 0:e.dataset)==null?void 0:n.themeMode;if(na(t))return t;let r=ao(),o=(i=r==null?void 0:r.localStorage)==null?void 0:i.getItem(ia);return na(o)?o:"auto"}function ov(e){let t=ro();t&&(t.dataset.themePreset=e);}function l(...e){return tailwindMerge.twMerge(clsx.clsx(e))}function lv(e,t={}){let{currency:r="USD",noDecimals:o=false}=t;return new Intl.NumberFormat("en-US",{style:"currency",currency:r,minimumFractionDigits:o?0:2,maximumFractionDigits:o?0:2}).format(e)}function cv(e){return e.split(" ").filter(Boolean).map(t=>{var r,o;return (o=(r=t[0])==null?void 0:r.toUpperCase())!=null?o:""}).join("").slice(0,2)}function pv(e){let t=new Set,r={};function o(){return r}function n(c){let u=r,d=typeof c=="function"?c(u):c;if(!d)return;let v=false,m={...u};for(let[h,x]of Object.entries(d)){let f=h,b=x;Object.is(m[f],b)||(v=true,m[f]=b);}v&&(r=m,t.forEach(h=>h(m,u)));}r=e(n,o);function i(c){return t.add(c),()=>t.delete(c)}return {getState:o,setState:n,subscribe:i}}function mv(e,t){return J.useSyncExternalStore(r=>e.subscribe(()=>r()),()=>t(e.getState()),()=>t(e.getState()))}var wt="h-10 md:h-9";var cr=false,la=false,sa=null,dc=()=>typeof window!="undefined"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,Ln=e=>{if(!e||typeof e.scrollIntoView!="function")return;let t=dc(),r=()=>e.scrollIntoView({behavior:t?"auto":"smooth",block:"center",inline:"nearest"});if(typeof window!="undefined"&&typeof window.requestAnimationFrame=="function"){window.requestAnimationFrame(r);return}r();},uc=e=>{if(typeof window=="undefined")return;let t=window.visualViewport;if(!t)return;let r=null,o,n=false,i,c=()=>{t.removeEventListener("resize",u),t.removeEventListener("scroll",u),typeof i=="number"&&window.clearTimeout(i),r!==null&&typeof window.cancelAnimationFrame=="function"&&(window.cancelAnimationFrame(r),r=null),typeof o=="number"&&(window.clearTimeout(o),o=void 0),n=false;},u=()=>{if(typeof document!="undefined"&&document.activeElement!==e||!e.isConnected){c();return}let d=()=>{r=null,In(e)||(c(),Ln(e));};if(!n){if(n=true,typeof window.requestAnimationFrame=="function"){r=window.requestAnimationFrame(()=>{n=false,r=null,d();});return}o=window.setTimeout(()=>{o=void 0,n=false,d();},0);}};t.addEventListener("resize",u,{passive:true}),t.addEventListener("scroll",u,{passive:true}),i=window.setTimeout(c,700);},pc=(e,t)=>{let r=e.height+e.offsetTop,o=t-r;return Math.max(0,o)},mc=()=>{if(cr)return Promise.resolve(true);if(la)return Promise.resolve(false);if(typeof window=="undefined")return la=true,Promise.resolve(false);let e=window.visualViewport;return e?sa||(sa=new Promise(t=>{let r=false,o,n=Math.max(e.height+e.offsetTop,typeof window!="undefined"?window.innerHeight:0),i=u=>{r||(r=true,e.removeEventListener("resize",c),e.removeEventListener("scroll",c),typeof o=="number"&&window.clearTimeout(o),u?cr=true:la=true,t(u));},c=()=>{pc(e,n)>80&&i(true);};o=window.setTimeout(()=>i(false),600),c(),r||(e.addEventListener("resize",c,{passive:true}),e.addEventListener("scroll",c,{passive:true}));}).finally(()=>{sa=null;}),sa):(la=true,Promise.resolve(false))},In=e=>{if(typeof window=="undefined")return true;let t=e.getBoundingClientRect(),r=window.visualViewport;if(!r){let i=window.innerHeight||0;return t.top>=0&&t.bottom<=i}let o=r.offsetTop,n=o+r.height;return t.top>=o&&t.bottom<=n},dr=e=>{e&&mc().then(t=>{if(!t||typeof document!="undefined"&&document.activeElement!==e||!e.isConnected)return;if(In(e)){uc(e);return}let r=()=>Ln(e);if(typeof window!="undefined"&&typeof window.requestAnimationFrame=="function"){window.requestAnimationFrame(r);return}r();});},vv={get isVirtualKeyboardLikelyDevice(){return cr},get hasAttemptedVirtualKeyboardDetection(){return la},reset(){cr=false,la=false,sa=null;}};function _n({data:e,columns:t,enableRowSelection:r=true,defaultPageIndex:o,defaultPageSize:n,getRowId:i}){let[c,u]=J__namespace.useState({}),[d,v]=J__namespace.useState({}),[m,h]=J__namespace.useState([]),[x,f]=J__namespace.useState([]),[b,p]=J__namespace.useState({pageIndex:o!=null?o:0,pageSize:n!=null?n:10});return reactTable.useReactTable({data:e,columns:t,state:{sorting:x,columnVisibility:d,rowSelection:c,columnFilters:m,pagination:b},enableRowSelection:r,getRowId:i!=null?i:(y=>y.id.toString()),onRowSelectionChange:u,onSortingChange:f,onColumnFiltersChange:h,onColumnVisibilityChange:v,onPaginationChange:p,getCoreRowModel:reactTable.getCoreRowModel(),getFilteredRowModel:reactTable.getFilteredRowModel(),getPaginationRowModel:reactTable.getPaginationRowModel(),getSortedRowModel:reactTable.getSortedRowModel(),getFacetedRowModel:reactTable.getFacetedRowModel(),getFacetedUniqueValues:reactTable.getFacetedUniqueValues()})}function Nv({...e}){return a(radixUi.Accordion.Root,{"data-slot":"accordion",...e})}function Sv({className:e,...t}){return a(radixUi.Accordion.Item,{"data-slot":"accordion-item",className:l("border-b last:border-b-0",e),...t})}function Mv({className:e,children:t,...r}){return a(radixUi.Accordion.Header,{className:"flex",children:s(radixUi.Accordion.Trigger,{"data-slot":"accordion-trigger",className:l("focus-visible:border-primary focus-visible:ring-primary/40 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",e),...r,children:[t,a(lucideReact.ChevronDownIcon,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"})]})})}function Ev({className:e,children:t,...r}){return a(radixUi.Accordion.Content,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...r,children:a("div",{className:l("pt-0 pb-4",e),children:t})})}var Rc=classVarianceAuthority.cva("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function at({className:e,variant:t,...r}){return a("div",{"data-slot":"alert",role:"alert",className:l(Rc({variant:t}),e),...r})}function rt({className:e,...t}){return a("div",{"data-slot":"alert-title",className:l("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function ot({className:e,...t}){return a("div",{"data-slot":"alert-description",className:l("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}var Mt=classVarianceAuthority.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-primary focus-visible:ring-primary/40 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 hover:bg-primary/90",destructive:"bg-destructive text-white 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 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"}}),X=J__namespace.forwardRef(({className:e,variant:t,size:r,asChild:o=false,loading:n=false,loadingText:i,children:c,disabled:u,...d},v)=>{let m=o?radixUi.Slot.Slot:"button";return s(m,{"data-slot":"button",className:l(Mt({variant:t,size:r,className:e}),n?"relative":"disabled:opacity-50"),disabled:n||u,"data-loading":n?"":void 0,ref:v,...d,children:[a("span",{className:l("pointer-events-none inline-flex items-center justify-center gap-2 w-full",n&&"invisible"),children:c}),n?s("span",{className:"pointer-events-none absolute inset-0 inline-flex items-center justify-center gap-2",children:[i!=null?i:a(lucideReact.Loader2,{className:"size-4 animate-spin","aria-hidden":"true"}),a("span",{className:"sr-only",children:typeof i=="string"?i:"Loading"})]}):null]})});X.displayName="Button";function qv({...e}){return a(radixUi.AlertDialog.Root,{"data-slot":"alert-dialog",...e})}function Wv({...e}){return a(radixUi.AlertDialog.Trigger,{"data-slot":"alert-dialog-trigger",...e})}function Nc({...e}){return a(radixUi.AlertDialog.Portal,{"data-slot":"alert-dialog-portal",...e})}function Sc({className:e,...t}){return a(radixUi.AlertDialog.Overlay,{"data-slot":"alert-dialog-overlay",className:l("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 Yv({className:e,...t}){return s(Nc,{children:[a(Sc,{}),a(radixUi.AlertDialog.Content,{"data-slot":"alert-dialog-content",className:l("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...t})]})}function Kv({className:e,...t}){return a("div",{"data-slot":"alert-dialog-header",className:l("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Xv({className:e,...t}){return a("div",{"data-slot":"alert-dialog-footer",className:l("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function Jv({className:e,...t}){return a(radixUi.AlertDialog.Title,{"data-slot":"alert-dialog-title",className:l("text-lg font-semibold",e),...t})}function Zv({className:e,...t}){return a(radixUi.AlertDialog.Description,{"data-slot":"alert-dialog-description",className:l("text-muted-foreground text-sm",e),...t})}function Qv({className:e,...t}){return a(radixUi.AlertDialog.Action,{className:l(Mt(),e),...t})}function eb({className:e,...t}){return a(radixUi.AlertDialog.Cancel,{className:l(Mt({variant:"outline"}),e),...t})}function ob({...e}){return a(radixUi.AspectRatio.Root,{"data-slot":"aspect-ratio",...e})}function cb({className:e,...t}){return a(radixUi.Avatar.Root,{"data-slot":"avatar",className:l("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...t})}function db({className:e,...t}){return a(radixUi.Avatar.Image,{"data-slot":"avatar-image",className:l("aspect-square size-full",e),...t})}function ub({className:e,...t}){return a(radixUi.Avatar.Fallback,{"data-slot":"avatar-fallback",className:l("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}var Lc=classVarianceAuthority.cva("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-primary focus-visible:ring-primary/40 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"}});function $t({className:e,variant:t,asChild:r=false,...o}){let n=r?radixUi.Slot.Slot:"span";return a(n,{"data-slot":"badge",className:l(Lc({variant:t}),e),...o})}function kb({...e}){return a("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function Rb({className:e,...t}){return a("ol",{"data-slot":"breadcrumb-list",className:l("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...t})}function Cb({className:e,...t}){return a("li",{"data-slot":"breadcrumb-item",className:l("inline-flex items-center gap-1.5",e),...t})}function Tb({asChild:e,className:t,...r}){let o=e?radixUi.Slot.Slot:"a";return a(o,{"data-slot":"breadcrumb-link",className:l("hover:text-foreground transition-colors",t),...r})}function Pb({className:e,...t}){return a("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:l("text-foreground font-normal",e),...t})}function Nb({children:e,className:t,...r}){return a("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:l("[&>svg]:size-3.5",t),...r,children:e!=null?e:a(lucideReact.ChevronRight,{})})}function Sb({className:e,...t}){return s("span",{"data-slot":"breadcrumb-ellipsis",role:"presentation","aria-hidden":"true",className:l("flex size-9 items-center justify-center",e),...t,children:[a(lucideReact.MoreHorizontal,{className:"size-4"}),a("span",{className:"sr-only",children:"More"})]})}function Ab({className:e,classNames:t,showOutsideDays:r=true,captionLayout:o="label",buttonVariant:n="ghost",formatters:i,components:c,...u}){let d=reactDayPicker.getDefaultClassNames();return a(reactDayPicker.DayPicker,{showOutsideDays:r,className:l("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:o,formatters:{formatMonthDropdown:v=>v.toLocaleString("default",{month:"short"}),...i},classNames:{root:l("w-fit",d.root),months:l("flex gap-4 flex-col md:flex-row relative",d.months),month:l("flex flex-col w-full gap-4",d.month),nav:l("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",d.nav),button_previous:l(Mt({variant:n}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",d.button_previous),button_next:l(Mt({variant:n}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",d.button_next),month_caption:l("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",d.month_caption),dropdowns:l("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",d.dropdowns),dropdown_root:l("relative has-focus:border-primary border border-input shadow-xs has-focus:ring-primary/40 has-focus:ring-[3px] rounded-md",d.dropdown_root),dropdown:l("absolute bg-popover inset-0 opacity-0",d.dropdown),caption_label:l("select-none font-medium",o==="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",d.caption_label),table:"w-full border-collapse",weekdays:l("flex",d.weekdays),weekday:l("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",d.weekday),week:l("flex w-full mt-2",d.week),week_number_header:l("select-none w-(--cell-size)",d.week_number_header),week_number:l("text-[0.8rem] select-none text-muted-foreground",d.week_number),day:l("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",d.day),range_start:l("rounded-l-md bg-accent",d.range_start),range_middle:l("rounded-none",d.range_middle),range_end:l("rounded-r-md bg-accent",d.range_end),today:l("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",d.today),outside:l("text-muted-foreground aria-selected:text-muted-foreground",d.outside),disabled:l("text-muted-foreground opacity-50",d.disabled),hidden:l("invisible",d.hidden),...t},components:{Root:({className:v,rootRef:m,...h})=>a("div",{"data-slot":"calendar",ref:m,className:l(v),...h}),Chevron:({className:v,orientation:m,...h})=>m==="left"?a(lucideReact.ChevronLeftIcon,{className:l("size-4",v),...h}):m==="right"?a(lucideReact.ChevronRightIcon,{className:l("size-4",v),...h}):a(lucideReact.ChevronDownIcon,{className:l("size-4",v),...h}),DayButton:Bc,WeekNumber:({children:v,...m})=>a("td",{...m,children:a("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:v})}),...c},...u})}function Bc({className:e,day:t,modifiers:r,...o}){let n=reactDayPicker.getDefaultClassNames(),i=J__namespace.useRef(null);return J__namespace.useEffect(()=>{var c;r.focused&&((c=i.current)==null||c.focus());},[r.focused]),a(X,{ref:i,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":r.selected&&!r.range_start&&!r.range_end&&!r.range_middle,"data-range-start":r.range_start,"data-range-end":r.range_end,"data-range-middle":r.range_middle,className:l("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-primary group-data-[focused=true]/day:ring-primary/40 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",n.day,e),...o})}function Ge({className:e,...t}){return a("div",{"data-slot":"card",className:l("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6",e),...t})}function Ke({className:e,...t}){return a("div",{"data-slot":"card-header",className:l("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function Xe({className:e,...t}){return a("div",{"data-slot":"card-title",className:l("leading-none font-semibold",e),...t})}function Je({className:e,...t}){return a("div",{"data-slot":"card-description",className:l("text-muted-foreground text-sm",e),...t})}function Bb({className:e,...t}){return a("div",{"data-slot":"card-action",className:l("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...t})}function $e({className:e,...t}){return a("div",{"data-slot":"card-content",className:l("px-6",e),...t})}function Vb({className:e,...t}){return a("div",{"data-slot":"card-footer",className:l("flex items-center px-6 [.border-t]:pt-6",e),...t})}var Fn=J__namespace.createContext(null);function pr(){let e=J__namespace.useContext(Fn);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}function Yb({orientation:e="horizontal",opts:t,setApi:r,plugins:o,className:n,children:i,...c}){let[u,d]=Vc__default.default({...t,axis:e==="horizontal"?"x":"y"},o),[v,m]=J__namespace.useState(false),[h,x]=J__namespace.useState(false),f=J__namespace.useCallback(y=>{y&&(m(y.canScrollPrev()),x(y.canScrollNext()));},[]),b=J__namespace.useCallback(()=>{d==null||d.scrollPrev();},[d]),p=J__namespace.useCallback(()=>{d==null||d.scrollNext();},[d]),w=J__namespace.useCallback(y=>{y.key==="ArrowLeft"?(y.preventDefault(),b()):y.key==="ArrowRight"&&(y.preventDefault(),p());},[b,p]);return J__namespace.useEffect(()=>{!d||!r||r(d);},[d,r]),J__namespace.useEffect(()=>{if(d)return f(d),d.on("reInit",f),d.on("select",f),()=>{d==null||d.off("select",f);}},[d,f]),a(Fn.Provider,{value:{carouselRef:u,api:d,opts:t,orientation:e||((t==null?void 0:t.axis)==="y"?"vertical":"horizontal"),scrollPrev:b,scrollNext:p,canScrollPrev:v,canScrollNext:h},children:a("div",{onKeyDownCapture:w,className:l("relative",n),role:"region","aria-roledescription":"carousel","data-slot":"carousel",...c,children:i})})}function Kb({className:e,...t}){let{carouselRef:r,orientation:o}=pr();return a("div",{ref:r,className:"overflow-hidden","data-slot":"carousel-content",children:a("div",{className:l("flex",o==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})}function Xb({className:e,...t}){let{orientation:r}=pr();return a("div",{role:"group","aria-roledescription":"slide","data-slot":"carousel-item",className:l("min-w-0 shrink-0 grow-0 basis-full",r==="horizontal"?"pl-4":"pt-4",e),...t})}function Jb({className:e,variant:t="outline",size:r="icon",...o}){let{orientation:n,scrollPrev:i,canScrollPrev:c}=pr();return s(X,{"data-slot":"carousel-previous",variant:t,size:r,className:l("absolute size-8 rounded-full",n==="horizontal"?"top-1/2 -left-12 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!c,onClick:i,...o,children:[a(lucideReact.ArrowLeft,{}),a("span",{className:"sr-only",children:"Previous slide"})]})}function Zb({className:e,variant:t="outline",size:r="icon",...o}){let{orientation:n,scrollNext:i,canScrollNext:c}=pr();return s(X,{"data-slot":"carousel-next",variant:t,size:r,className:l("absolute size-8 rounded-full",n==="horizontal"?"top-1/2 -right-12 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!c,onClick:i,...o,children:[a(lucideReact.ArrowRight,{}),a("span",{className:"sr-only",children:"Next slide"})]})}var $c=50,qc=10;function Bn(e){let t=J.useRef(null),r=J.useRef(null),[o,n]=J.useState(true),i=()=>{t.current&&(t.current.scrollTop=t.current.scrollHeight);},c=()=>{if(t.current){let{scrollTop:d,scrollHeight:v,clientHeight:m}=t.current,h=Math.abs(v-d-m),x=r.current?d<r.current:false,f=r.current?r.current-d:0;if(x&&f>qc)n(false);else {let p=h<$c;n(p);}r.current=d;}},u=()=>{n(false);};return J.useEffect(()=>{t.current&&(r.current=t.current.scrollTop);},[]),J.useEffect(()=>{o&&i();},e),{containerRef:t,scrollToBottom:i,handleScroll:c,shouldAutoScroll:o,handleTouchStart:u}}function jn({text:e,copyMessage:t="Copied to clipboard!"}){let[r,o]=J.useState(false),n=J.useRef(null),i=J.useCallback(()=>{navigator.clipboard.writeText(e).then(()=>{sonner.toast.success(t),o(true),n.current&&(clearTimeout(n.current),n.current=null),n.current=setTimeout(()=>{o(false);},2e3);}).catch(()=>{sonner.toast.error("Failed to copy to clipboard.");});},[e,t]);return {isCopied:r,handleCopy:i}}function no({content:e,copyMessage:t}){let{isCopied:r,handleCopy:o}=jn({text:e,copyMessage:t});return s(X,{variant:"ghost",size:"icon",className:"relative h-6 w-6","aria-label":"Copy to clipboard",onClick:o,children:[a("div",{className:"absolute inset-0 flex items-center justify-center",children:a(lucideReact.Check,{className:l("h-4 w-4 transition-transform ease-in-out",r?"scale-100":"scale-0")})}),a(lucideReact.Copy,{className:l("h-4 w-4 transition-transform ease-in-out",r?"scale-0":"scale-100")})]})}function Un({ref:e,maxHeight:t=Number.MAX_SAFE_INTEGER,borderWidth:r=0,dependencies:o}){let n=J.useRef(null);J.useLayoutEffect(()=>{if(!e.current)return;let i=e.current,c=r*2;n.current===null&&(n.current=i.scrollHeight-c),i.style.removeProperty("height");let u=i.scrollHeight,d=Math.min(u,t),v=Math.max(d,n.current);i.style.height=`${v+c}px`;},[t,e,...o]);}var Ba=J__namespace.default.forwardRef((e,t)=>e.file.type.startsWith("image/")?a(Gn,{...e,ref:t}):e.file.type.startsWith("text/")||e.file.name.endsWith(".txt")||e.file.name.endsWith(".md")?a($n,{...e,ref:t}):a(qn,{...e,ref:t}));Ba.displayName="FilePreview";var Gn=J__namespace.default.forwardRef(({file:e,onRemove:t},r)=>s(framerMotion.motion.div,{ref:r,className:"relative flex max-w-[200px] rounded-md border p-1.5 pr-2 text-xs",layout:true,initial:{opacity:0,y:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:"100%"},children:[s("div",{className:"flex w-full items-center space-x-2",children:[a("img",{alt:`Attachment ${e.name}`,className:"grid h-10 w-10 shrink-0 place-items-center rounded-sm border bg-muted object-cover",src:URL.createObjectURL(e)}),a("span",{className:"w-full truncate text-muted-foreground",children:e.name})]}),t?a("button",{className:"absolute -right-2 -top-2 flex h-4 w-4 items-center justify-center rounded-full border bg-background",type:"button",onClick:t,"aria-label":"Remove attachment",children:a(lucideReact.X,{className:"h-2.5 w-2.5"})}):null]}));Gn.displayName="ImageFilePreview";var $n=J__namespace.default.forwardRef(({file:e,onRemove:t},r)=>{let[o,n]=J__namespace.default.useState("");return J.useEffect(()=>{let i=new FileReader;i.onload=c=>{var d;let u=(d=c.target)==null?void 0:d.result;n(u.slice(0,50)+(u.length>50?"...":""));},i.readAsText(e);},[e]),s(framerMotion.motion.div,{ref:r,className:"relative flex max-w-[200px] rounded-md border p-1.5 pr-2 text-xs",layout:true,initial:{opacity:0,y:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:"100%"},children:[s("div",{className:"flex w-full items-center space-x-2",children:[a("div",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-sm border bg-muted p-0.5",children:a("div",{className:"h-full w-full overflow-hidden text-[6px] leading-none text-muted-foreground",children:o||"Loading..."})}),a("span",{className:"w-full truncate text-muted-foreground",children:e.name})]}),t?a("button",{className:"absolute -right-2 -top-2 flex h-4 w-4 items-center justify-center rounded-full border bg-background",type:"button",onClick:t,"aria-label":"Remove attachment",children:a(lucideReact.X,{className:"h-2.5 w-2.5"})}):null]})});$n.displayName="TextFilePreview";var qn=J__namespace.default.forwardRef(({file:e,onRemove:t},r)=>s(framerMotion.motion.div,{ref:r,className:"relative flex max-w-[200px] rounded-md border p-1.5 pr-2 text-xs",layout:true,initial:{opacity:0,y:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:"100%"},children:[s("div",{className:"flex w-full items-center space-x-2",children:[a("div",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-sm border bg-muted",children:a(lucideReact.FileIcon,{className:"h-6 w-6 text-foreground"})}),a("span",{className:"w-full truncate text-muted-foreground",children:e.name})]}),t?a("button",{className:"absolute -right-2 -top-2 flex h-4 w-4 items-center justify-center rounded-full border bg-background",type:"button",onClick:t,"aria-label":"Remove attachment",children:a(lucideReact.X,{className:"h-2.5 w-2.5"})}):null]}));qn.displayName="GenericFilePreview";function lo(e){if(e.allowAttachments){let{allowAttachments:o,files:n,setFiles:i,...c}=e;return a(Wn,{...c,allowAttachments:true,files:n,setFiles:i})}let{allowAttachments:t,...r}=e;return a(Wn,{...r,allowAttachments:false,files:null})}lo.displayName="MessageInput";function Wn({placeholder:e="Ask AI...",className:t,submitOnEnter:r=true,stop:o,isGenerating:n,allowAttachments:i,files:c,setFiles:u,onKeyDown:d,value:v,...m}){let h=J.useRef(null),[x,f]=J.useState(false),b=i&&!!c&&c.length>0;Un({ref:h,maxHeight:240,borderWidth:1,dependencies:[v,b]});let p=J.useCallback(g=>{!i||!u||!(g!=null&&g.length)||u(M=>M!=null&&M.length?[...M,...g]:g);},[i,u]),w=J.useCallback(g=>{!i||!u||u(M=>{if(!M)return null;let E=M.filter(N=>N!==g);return E.length>0?E:null});},[i,u]),y=J.useCallback(g=>{i&&(g.preventDefault(),f(true));},[i]),k=J.useCallback(g=>{i&&(g.preventDefault(),f(false));},[i]),P=J.useCallback(g=>{if(!i)return;g.preventDefault(),f(false);let M=Array.from(g.dataTransfer.files);p(M);},[p,i]),R=J.useCallback(g=>{var C;if(!i)return;let M=(C=g.clipboardData)==null?void 0:C.items;if(!M)return;let E=g.clipboardData.getData("text");if(E&&E.length>500){g.preventDefault();let T=new Blob([E],{type:"text/plain"}),A=new File([T],"Pasted text",{type:"text/plain",lastModified:Date.now()});p([A]);return}let N=Array.from(M).map(T=>T.getAsFile()).filter(T=>T!==null);N.length>0&&(g.preventDefault(),p(N));},[p,i]),S=J.useCallback(g=>{var M;r&&g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),n&&o&&o(),(M=g.currentTarget.form)==null||M.requestSubmit()),d==null||d(g);},[n,d,o,r]);return s("div",{className:"relative flex w-full",onDragOver:y,onDragLeave:k,onDrop:P,children:[a("div",{className:"relative flex w-full items-center space-x-2",children:s("div",{className:"relative flex-1",children:[a("textarea",{"aria-label":"Write your prompt here",placeholder:e,ref:h,onPaste:R,onKeyDown:S,className:l("z-10 w-full grow resize-none rounded-xl border border-input bg-background p-3 pr-24 text-sm ring-offset-background transition-[border] placeholder:text-muted-foreground focus-visible:border-primary focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",b&&"pb-16",t),value:v,...m}),i&&a("div",{className:"absolute inset-x-3 bottom-0 z-20 overflow-x-auto py-3",children:a("div",{className:"flex space-x-3",children:a(framerMotion.AnimatePresence,{mode:"popLayout",children:c==null?void 0:c.map(g=>a(Ba,{file:g,onRemove:()=>w(g)},g.name+String(g.lastModified)))})})})]})}),s("div",{className:"absolute right-3 top-3 z-20 flex gap-2",children:[i&&a(X,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8","aria-label":"Attach a file",onClick:async()=>{let g=await ld();p(g);},children:a(lucideReact.Paperclip,{className:"h-4 w-4"})}),n&&o?a(X,{type:"button",size:"icon",className:"h-8 w-8","aria-label":"Stop generating",onClick:o,children:a(lucideReact.Square,{className:"h-3 w-3 animate-pulse",fill:"currentColor"})}):a(X,{type:"submit",size:"icon",className:"h-8 w-8 transition-opacity","aria-label":"Send message",disabled:v.trim()===""&&(!i||!(c!=null&&c.length))||n,children:a(lucideReact.ArrowUp,{className:"h-5 w-5"})})]}),i&&a(sd,{isDragging:x})]})}function sd({isDragging:e}){return a(framerMotion.AnimatePresence,{children:e&&s(framerMotion.motion.div,{className:"pointer-events-none absolute inset-0 z-20 flex items-center justify-center space-x-2 rounded-xl border border-dashed border-border bg-background text-sm text-muted-foreground",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},"aria-hidden":true,children:[a(lucideReact.Paperclip,{className:"h-4 w-4"}),a("span",{children:"Drop your files here to attach them."})]})})}function ld(){let e=document.createElement("input");return e.type="file",e.multiple=true,e.accept="*/*",e.click(),new Promise(t=>{e.onchange=r=>{let n=r.currentTarget.files;if(n){t(Array.from(n));return}t(null);};})}function Xn({...e}){return a(radixUi.Collapsible.Root,{"data-slot":"collapsible",...e})}function Jn({...e}){return a(radixUi.Collapsible.CollapsibleTrigger,{"data-slot":"collapsible-trigger",...e})}function Zn({...e}){return a(radixUi.Collapsible.CollapsibleContent,{"data-slot":"collapsible-content",...e})}var pd={h1:["text-2xl","font-semibold"],h2:["text-xl","font-semibold"],h3:["text-lg","font-semibold"],h4:["text-base","font-semibold"],h5:["text-sm","font-semibold"],h6:["text-sm","font-semibold"],p:["whitespace-pre-wrap"],ul:["list-disc","space-y-1.5","pl-6"],ol:["list-decimal","space-y-1.5","pl-6"],li:["leading-relaxed"],blockquote:["border-l-2","border-primary/60","pl-4","italic","text-muted-foreground"],table:["w-full","border-collapse","overflow-hidden","rounded-md","border"],th:["border","border-foreground/20","bg-muted/50","px-4","py-2","text-left","font-semibold"],td:["border","border-foreground/20","px-4","py-2","align-top"],tr:["even:bg-muted/40"],hr:["my-4","border-foreground/20"],img:["rounded-md","border","max-w-full"],strong:["font-semibold"],em:["italic"]},md="absolute right-2 top-2 rounded-md border bg-background/80 px-2 py-1 text-xs font-medium shadow-sm backdrop-blur transition hover:bg-background",fd=["relative","overflow-x-auto","rounded-md","border","bg-background/50","p-4","font-mono","text-sm"];function da({children:e,className:t}){let r=J.useRef(null),o=J.useMemo(()=>gd(e!=null?e:""),[e]);return J.useEffect(()=>{let n=r.current;if(!n)return;vd(n);let i=bd(n);return ()=>{i();}},[o]),a("div",{ref:r,className:l("space-y-4 text-sm leading-relaxed",t),dangerouslySetInnerHTML:{__html:o}})}da.displayName="HtmlRenderer";var Ih=da;function gd(e){return e?e.replace(/<(script|style|iframe|object|embed|link|meta)[^>]*>[\s\S]*?<\/\1>/gi,"").replace(/<(script|style|iframe|object|embed|link|meta)[^>]*\/>/gi,"").replace(/<(script|style|iframe|object|embed|link|meta)[^>]*>/gi,"").replace(/ on[a-z]+="[^"]*"/gi,"").replace(/ on[a-z]+='[^']*'/gi,"").replace(/javascript:/gi,""):""}function vd(e){Object.entries(pd).forEach(([t,r])=>{e.querySelectorAll(t).forEach(o=>{r.forEach(n=>o.classList.add(n));});}),e.querySelectorAll("a").forEach(t=>{var o,n;t.classList.add("text-primary","underline","underline-offset-4");let r=(o=t.getAttribute("href"))!=null?o:"";if(/^javascript:/i.test(r)&&t.removeAttribute("href"),t.getAttribute("target")==="_blank"){let i=(n=t.getAttribute("rel"))!=null?n:"";/noopener|noreferrer/i.test(i)||t.setAttribute("rel",`${i} noopener noreferrer`.trim());}}),e.querySelectorAll("code").forEach(t=>{var r;((r=t.parentElement)==null?void 0:r.tagName)!=="PRE"&&t.classList.add("rounded","bg-muted/70","px-1.5","py-0.5","font-mono","text-[0.85em]");}),e.querySelectorAll("table").forEach(t=>{var o;if(t.parentElement&&t.parentElement.dataset.htmlRendererTable==="true")return;let r=document.createElement("div");r.dataset.htmlRendererTable="true",r.className="overflow-x-auto rounded-md border border-foreground/20",(o=t.parentElement)==null||o.insertBefore(r,t),r.appendChild(t);});}function bd(e){let t=[];return e.querySelectorAll("button[data-html-renderer-copy]").forEach(r=>{r.remove();}),e.querySelectorAll("pre").forEach(r=>{fd.forEach(d=>r.classList.add(d));let o=document.createElement("button");o.type="button",o.dataset.htmlRendererCopy="true",o.textContent="Copy",o.className=md;let n="Copy",i="Copied!",c="Copy failed",u=async()=>{var v;let d=(v=r.textContent)!=null?v:"";try{if(navigator.clipboard&&navigator.clipboard.writeText)await navigator.clipboard.writeText(d.trimEnd()),o.textContent=i;else throw new Error("Clipboard API unavailable")}catch(m){console.error(m),o.textContent=c;}window.setTimeout(()=>{o.textContent=n;},1500);};o.addEventListener("click",u),r.appendChild(o),t.push(()=>{o.removeEventListener("click",u),o.remove();});}),()=>{t.forEach(r=>r());}}var uo=classVarianceAuthority.cva("group/message relative break-words rounded-lg p-3 text-sm sm:max-w-[70%]",{variants:{isUser:{true:"bg-primary text-primary-foreground",false:"bg-muted text-foreground"},animation:{none:"",slide:"duration-300 animate-in fade-in-0",scale:"duration-300 animate-in fade-in-0 zoom-in-75",fade:"duration-500 animate-in fade-in-0"}},compoundVariants:[{isUser:true,animation:"slide",class:"slide-in-from-right"},{isUser:false,animation:"slide",class:"slide-in-from-left"},{isUser:true,animation:"scale",class:"origin-bottom-right"},{isUser:false,animation:"scale",class:"origin-bottom-left"}]}),ei=({role:e,content:t,createdAt:r,showTimeStamp:o=false,animation:n="scale",actions:i,experimental_attachments:c,toolInvocations:u,parts:d})=>{let v=J.useMemo(()=>c==null?void 0:c.map(x=>{var p;let f=Nd(x.url);return new File([f],(p=x.name)!=null?p:"Unknown",{type:x.contentType})}),[c]),m=e==="user",h=r==null?void 0:r.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});return m?s("div",{className:l("flex flex-col",m?"items-end":"items-start"),children:[v?a("div",{className:"mb-1 flex flex-wrap gap-2",children:v.map((x,f)=>a(Ba,{file:x},f))}):null,a("div",{className:l(uo({isUser:m,animation:n})),children:a(da,{children:t})}),o&&r?a("time",{dateTime:r.toISOString(),className:l("mt-1 block px-1 text-xs opacity-50",n!=="none"&&"duration-500 animate-in fade-in-0"),children:h}):null]}):d&&d.length>0?d.map((x,f)=>x.type==="text"?s("div",{className:l("flex flex-col",m?"items-end":"items-start"),children:[s("div",{className:l(uo({isUser:m,animation:n})),children:[a(da,{children:x.text}),i?a("div",{className:"absolute -bottom-4 right-2 flex space-x-1 rounded-lg border bg-background p-1 text-foreground opacity-0 transition-opacity group-hover/message:opacity-100",children:i}):null]}),o&&r?a("time",{dateTime:r.toISOString(),className:l("mt-1 block px-1 text-xs opacity-50",n!=="none"&&"duration-500 animate-in fade-in-0"),children:h}):null]},`text-${f}`):x.type==="reasoning"?a(Sd,{part:x},`reasoning-${f}`):x.type==="tool-invocation"?a(Qn,{toolInvocations:[x.toolInvocation]},`tool-${f}`):null):u&&u.length>0?a(Qn,{toolInvocations:u}):s("div",{className:l("flex flex-col",m?"items-end":"items-start"),children:[s("div",{className:l(uo({isUser:m,animation:n})),children:[a(da,{children:t}),i?a("div",{className:"absolute -bottom-4 right-2 flex space-x-1 rounded-lg border bg-background p-1 text-foreground opacity-0 transition-opacity group-hover/message:opacity-100",children:i}):null]}),o&&r?a("time",{dateTime:r.toISOString(),className:l("mt-1 block px-1 text-xs opacity-50",n!=="none"&&"duration-500 animate-in fade-in-0"),children:h}):null]})};function Nd(e){let[,t=""]=e.split(",");if(!t)return new Uint8Array;if(typeof atob=="function"){let r=atob(t),o=new Uint8Array(r.length);for(let n=0;n<r.length;n+=1)o[n]=r.charCodeAt(n);return o}return typeof Buffer!="undefined"?new Uint8Array(Buffer.from(t,"base64")):new Uint8Array}var Sd=({part:e})=>{let[t,r]=J.useState(false);return a("div",{className:"mb-2 flex flex-col items-start sm:max-w-[70%]",children:s(Xn,{open:t,onOpenChange:r,className:"group w-full overflow-hidden rounded-lg border bg-muted/50",children:[a("div",{className:"flex items-center p-2",children:a(Jn,{asChild:true,children:s("button",{className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground",children:[a(lucideReact.ChevronRight,{className:"h-4 w-4 transition-transform group-data-[state=open]:rotate-90"}),a("span",{children:"Thinking"})]})})}),a(Zn,{forceMount:true,children:a(framerMotion.motion.div,{initial:false,animate:t?"open":"closed",variants:{open:{height:"auto",opacity:1},closed:{height:0,opacity:0}},transition:{duration:.3,ease:[.04,.62,.23,.98]},className:"border-t",children:a("div",{className:"p-2",children:a("div",{className:"whitespace-pre-wrap text-xs",children:e.reasoning})})})})]})})};function Qn({toolInvocations:e}){return e!=null&&e.length?a("div",{className:"flex flex-col items-start gap-2",children:e.map((t,r)=>{if(t.state==="result"&&t.result.__cancelled===true)return s("div",{className:"flex items-center gap-2 rounded-lg border bg-muted/50 px-3 py-2 text-sm text-muted-foreground",children:[a(lucideReact.Ban,{className:"h-4 w-4"}),s("span",{children:["Cancelled"," ",s("span",{className:"font-mono",children:["`",t.toolName,"`"]})]})]},r);switch(t.state){case "partial-call":case "call":return s("div",{className:"flex items-center gap-2 rounded-lg border bg-muted/50 px-3 py-2 text-sm text-muted-foreground",children:[a(lucideReact.Terminal,{className:"h-4 w-4"}),s("span",{children:["Calling"," ",s("span",{className:"font-mono",children:["`",t.toolName,"`"]}),"..."]}),a(lucideReact.Loader2,{className:"h-3 w-3 animate-spin"})]},r);case "result":return s("div",{className:"flex flex-col gap-1.5 rounded-lg border bg-muted/50 px-3 py-2 text-sm",children:[s("div",{className:"flex items-center gap-2 text-muted-foreground",children:[a(lucideReact.Code2,{className:"h-4 w-4"}),s("span",{children:["Result from"," ",s("span",{className:"font-mono",children:["`",t.toolName,"`"]})]})]}),a("pre",{className:"overflow-x-auto whitespace-pre-wrap text-foreground",children:JSON.stringify(t.result,null,2)})]},r);default:return null}})}):null}function ti(){return a("div",{className:"justify-left flex space-x-1",children:a("div",{className:"rounded-lg bg-muted p-3",children:s("div",{className:"flex -space-x-2.5",children:[a(lucideReact.Dot,{className:"h-5 w-5 animate-typing-dot-bounce [animation-delay:-0.4s]"}),a(lucideReact.Dot,{className:"h-5 w-5 animate-typing-dot-bounce [animation-delay:-0.2s]"}),a(lucideReact.Dot,{className:"h-5 w-5 animate-typing-dot-bounce"})]})})})}function ai({messages:e,showTimeStamps:t=true,isTyping:r=false,messageOptions:o}){return s("div",{className:"space-y-4 overflow-visible",children:[e.map((n,i)=>{let c=typeof o=="function"?o(n):o;return a(ei,{showTimeStamp:t,...n,...c},i)}),r&&a(ti,{})]})}function ri({label:e,append:t,suggestions:r}){return s("div",{className:"space-y-6",children:[a("h2",{className:"text-center text-2xl font-bold",children:e}),a("div",{className:"flex gap-6 text-sm",children:r.map(o=>a("button",{onClick:()=>t({role:"user",content:o}),className:"h-max flex-1 rounded-xl border bg-background p-4 hover:bg-muted",children:a("p",{children:o})},o))})]})}function _d({messages:e,handleSubmit:t,input:r,handleInputChange:o,stop:n,isGenerating:i,append:c,suggestions:u,className:d,onRateResponse:v,setMessages:m}){let h=e.at(-1),x=e.length===0,f=(h==null?void 0:h.role)==="user",b=J.useRef(e);b.current=e;let p=J.useCallback(()=>{if(n==null||n(),!m)return;let y=[...b.current],k;for(let S=y.length-1;S>=0;S-=1){let g=y[S];if(g.role==="assistant"){k=g;break}}if(!k)return;let P=false,R={...k};if(k.toolInvocations){let S=k.toolInvocations.map(g=>g.state==="call"?(P=true,{...g,state:"result",result:{content:"Tool execution was cancelled",__cancelled:true}}):g);P&&(R={...R,toolInvocations:S});}if(k.parts&&k.parts.length>0){let S=k.parts.map(g=>{if(g.type==="tool-invocation"&&g.toolInvocation.state==="call"){P=true;let M={...g.toolInvocation,state:"result",result:{content:"Tool execution was cancelled",__cancelled:true}};return {...g,toolInvocation:M}}return g});P&&(R={...R,parts:S});}if(P){let S=y.findIndex(g=>g.id===k.id);S!==-1&&(y[S]=R,m(y));}},[n,m,b]),w=J.useCallback(y=>({actions:v?s(jsxRuntime.Fragment,{children:[a("div",{className:"border-r pr-1",children:a(no,{content:y.content,copyMessage:"Copied response to clipboard!"})}),a(X,{size:"icon",variant:"ghost",className:"h-6 w-6",onClick:()=>v(y.id,"thumbs-up"),children:a(lucideReact.ThumbsUp,{className:"h-4 w-4"})}),a(X,{size:"icon",variant:"ghost",className:"h-6 w-6",onClick:()=>v(y.id,"thumbs-down"),children:a(lucideReact.ThumbsDown,{className:"h-4 w-4"})})]}):a(no,{content:y.content,copyMessage:"Copied response to clipboard!"})}),[v]);return s(ii,{className:d,children:[x&&c&&u?a(ri,{label:"Try these prompts \u2728",append:c,suggestions:u}):null,e.length>0?a(zd,{messages:e,children:a(ai,{messages:e,isTyping:f,messageOptions:w})}):null,a(si,{className:"mt-auto",handleSubmit:t,children:({files:y,setFiles:k})=>a(lo,{value:r,onChange:o,allowAttachments:true,files:y,setFiles:k,stop:p,isGenerating:i})})]})}_d.displayName="Chat";function zd({messages:e,children:t}){let{containerRef:r,scrollToBottom:o,handleScroll:n,shouldAutoScroll:i,handleTouchStart:c}=Bn([e]);return s("div",{className:"grid grid-cols-1 overflow-y-auto pb-4",ref:r,onScroll:n,onTouchStart:c,children:[a("div",{className:"max-w-full [grid-column:1/1] [grid-row:1/1]",children:t}),!i&&a("div",{className:"pointer-events-none flex flex-1 items-end justify-end [grid-column:1/1] [grid-row:1/1]",children:a("div",{className:"sticky bottom-0 left-0 flex w-full justify-end",children:a(X,{onClick:o,className:"pointer-events-auto h-8 w-8 rounded-full ease-in-out animate-in fade-in-0 slide-in-from-bottom-1",size:"icon",variant:"ghost",children:a(lucideReact.ArrowDown,{className:"h-4 w-4"})})})})]})}var ii=J.forwardRef(({className:e,...t},r)=>a("div",{ref:r,className:l("grid max-h-full w-full grid-rows-[1fr_auto]",e),...t}));ii.displayName="ChatContainer";var si=J.forwardRef(({children:e,handleSubmit:t,className:r},o)=>{let[n,i]=J.useState(null);return a("form",{ref:o,onSubmit:u=>{if(!n){t(u);return}let d=Ad(n);t(u,{experimental_attachments:d}),i(null);},className:r,children:e({files:n,setFiles:i})})});si.displayName="ChatForm";function Ad(e){let t=new DataTransfer;for(let r of Array.from(e))t.items.add(r);return t.files}var Fd={light:"",dark:".dark"},li=J__namespace.createContext(null);function ci(){let e=J__namespace.useContext(li);if(!e)throw new Error("useChart must be used within a <ChartContainer />");return e}function fw({id:e,className:t,children:r,config:o,...n}){let i=J__namespace.useId(),c=`chart-${e||i.replace(/:/g,"")}`;return a(li.Provider,{value:{config:o},children:s("div",{"data-slot":"chart","data-chart":c,className:l("[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",t),...n,children:[a(Hd,{id:c,config:o}),a(ua__namespace.ResponsiveContainer,{children:r})]})})}var Hd=({id:e,config:t})=>{let r=Object.entries(t).filter(([,o])=>o.theme||o.color);return r.length?a("style",{dangerouslySetInnerHTML:{__html:Object.entries(Fd).map(([o,n])=>`
|
|
2
|
+
${n} [data-chart=${e}] {
|
|
3
|
+
${r.map(([i,c])=>{var d;let u=((d=c.theme)==null?void 0:d[o])||c.color;return u?` --color-${i}: ${u};`:null}).join(`
|
|
4
4
|
`)}
|
|
5
5
|
}
|
|
6
6
|
`).join(`
|
|
7
|
-
`)}}):null},gy=pn__namespace.Tooltip;function by({active:e,payload:t,className:o,indicator:a="dot",hideLabel:r=false,hideIndicator:i=false,label:c,labelFormatter:u,labelClassName:d,formatter:b,color:m,nameKey:h,labelKey:x}){let{config:f}=ci(),v=X__namespace.useMemo(()=>{var C;if(r||!(t!=null&&t.length))return null;let[y]=t,w=`${x||(y==null?void 0:y.dataKey)||(y==null?void 0:y.name)||"value"}`,R=fa(f,y,w),N=!x&&typeof c=="string"?((C=f[c])==null?void 0:C.label)||c:R==null?void 0:R.label;return u?n("div",{className:l("font-medium",d),children:u(N,t)}):N?n("div",{className:l("font-medium",d),children:N}):null},[c,u,t,r,d,f,x]);if(!e||!(t!=null&&t.length))return null;let p=t.length===1&&a!=="dot";return s("div",{className:l("border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl",o),children:[p?null:v,n("div",{className:"grid gap-1.5",children:t.filter(y=>y.type!=="none").map((y,w)=>{let R=`${h||y.name||y.dataKey||"value"}`,N=fa(f,y,R),C=m||y.payload.fill||y.color;return n("div",{className:l("[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",a==="dot"&&"items-center"),children:b&&(y==null?void 0:y.value)!==void 0&&y.name?b(y.value,y.name,y,w,y.payload):s(jsxRuntime.Fragment,{children:[N!=null&&N.icon?n(N.icon,{}):!i&&n("div",{className:l("shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",{"h-2.5 w-2.5":a==="dot","w-1":a==="line","w-0 border-[1.5px] border-dashed bg-transparent":a==="dashed","my-0.5":p&&a==="dashed"}),style:{"--color-bg":C,"--color-border":C}}),s("div",{className:l("flex flex-1 justify-between leading-none",p?"items-end":"items-center"),children:[s("div",{className:"grid gap-1.5",children:[p?v:null,n("span",{className:"text-muted-foreground",children:(N==null?void 0:N.label)||y.name})]}),y.value&&n("span",{className:"text-foreground font-mono font-medium tabular-nums",children:y.value.toLocaleString()})]})]})},y.dataKey)})})]})}var vy=pn__namespace.Legend;function hy({className:e,hideIcon:t=false,payload:o,verticalAlign:a="bottom",nameKey:r}){let{config:i}=ci();return o!=null&&o.length?n("div",{className:l("flex items-center justify-center gap-4",a==="top"?"pb-3":"pt-3",e),children:o.filter(c=>c.type!=="none").map(c=>{let u=`${r||c.dataKey||"value"}`,d=fa(i,c,u);return s("div",{className:l("[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"),children:[d!=null&&d.icon&&!t?n(d.icon,{}):n("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:c.color}}),d==null?void 0:d.label]},c.value)})}):null}function fa(e,t,o){if(typeof t!="object"||t===null)return;let a="payload"in t&&typeof t.payload=="object"&&t.payload!==null?t.payload:void 0,r=o;return o in t&&typeof t[o]=="string"?r=t[o]:a&&o in a&&typeof a[o]=="string"&&(r=a[o]),r in e?e[r]:e[o]}var jn=X__namespace.forwardRef(function({className:t,...o},a){return n(radixUi.Checkbox.Root,{ref:a,"data-slot":"checkbox",className:l("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-primary focus-visible:ring-primary/40 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",t),...o,children:n(radixUi.Checkbox.Indicator,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:n(lucideReact.CheckIcon,{className:"size-3.5"})})})});function mn({...e}){return n(radixUi.Dialog.Root,{"data-slot":"dialog",...e})}function pi({...e}){return n(radixUi.Dialog.Trigger,{"data-slot":"dialog-trigger",...e})}function Vd({...e}){return n(radixUi.Dialog.Portal,{"data-slot":"dialog-portal",...e})}function My({...e}){return n(radixUi.Dialog.Close,{"data-slot":"dialog-close",...e})}function jd({className:e,...t}){return n(radixUi.Dialog.Overlay,{"data-slot":"dialog-overlay",className:l("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 fn({className:e,children:t,showCloseButton:o=true,...a}){return s(Vd,{"data-slot":"dialog-portal",children:[n(jd,{}),s(radixUi.Dialog.Content,{"data-slot":"dialog-content",className:l("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...a,children:[t,o&&s(radixUi.Dialog.Close,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground 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 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[n(lucideReact.XIcon,{}),n("span",{className:"sr-only",children:"Close"})]})]})]})}function gn({className:e,...t}){return n("div",{"data-slot":"dialog-header",className:l("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Ey({className:e,...t}){return n("div",{"data-slot":"dialog-footer",className:l("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function bn({className:e,...t}){return n(radixUi.Dialog.Title,{"data-slot":"dialog-title",className:l("text-lg leading-none font-semibold",e),...t})}function vn({className:e,...t}){return n(radixUi.Dialog.Description,{"data-slot":"dialog-description",className:l("text-muted-foreground text-sm",e),...t})}function ga({className:e,...t}){return n(cmdk.Command,{"data-slot":"command",className:l("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function Hy({title:e="Command Palette",description:t="Search for a command to run...",children:o,className:a,showCloseButton:r=true,...i}){return s(mn,{...i,children:[s(gn,{className:"sr-only",children:[n(bn,{children:e}),n(vn,{children:t})]}),n(fn,{className:l("overflow-hidden p-0",a),showCloseButton:r,children:n(ga,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:o})})]})}function mi({className:e,...t}){return s("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[n(lucideReact.SearchIcon,{className:"size-4 shrink-0 opacity-50"}),n(cmdk.Command.Input,{"data-slot":"command-input",className:l("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function fi({className:e,...t}){return n(cmdk.Command.List,{"data-slot":"command-list",className:l("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function gi({...e}){return n(cmdk.Command.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function Oy({className:e,...t}){return n(cmdk.Command.Group,{"data-slot":"command-group",className:l("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}function By({className:e,...t}){return n(cmdk.Command.Separator,{"data-slot":"command-separator",className:l("bg-border -mx-1 h-px",e),...t})}function bi({className:e,...t}){return n(cmdk.Command.Item,{"data-slot":"command-item",className:l("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function zy({className:e,...t}){return n("span",{"data-slot":"command-shortcut",className:l("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}function qy({...e}){return n(radixUi.ContextMenu.Root,{"data-slot":"context-menu",...e})}function Wy({...e}){return n(radixUi.ContextMenu.Trigger,{"data-slot":"context-menu-trigger",...e})}function Yy({...e}){return n(radixUi.ContextMenu.Group,{"data-slot":"context-menu-group",...e})}function Ky({...e}){return n(radixUi.ContextMenu.Portal,{"data-slot":"context-menu-portal",...e})}function Jy({...e}){return n(radixUi.ContextMenu.Sub,{"data-slot":"context-menu-sub",...e})}function Xy({...e}){return n(radixUi.ContextMenu.RadioGroup,{"data-slot":"context-menu-radio-group",...e})}function Zy({className:e,inset:t,children:o,...a}){return s(radixUi.ContextMenu.SubTrigger,{"data-slot":"context-menu-sub-trigger","data-inset":t,className:l("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 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...a,children:[o,n(lucideReact.ChevronRightIcon,{className:"ml-auto"})]})}function Qy({className:e,...t}){return n(radixUi.ContextMenu.SubContent,{"data-slot":"context-menu-sub-content",className:l("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-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",e),...t})}function ex({className:e,...t}){return n(radixUi.ContextMenu.Portal,{children:n(radixUi.ContextMenu.Content,{"data-slot":"context-menu-content",className:l("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-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...t})})}function tx({className:e,inset:t,variant:o="default",...a}){return n(radixUi.ContextMenu.Item,{"data-slot":"context-menu-item","data-inset":t,"data-variant":o,className:l("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 cursor-default 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),...a})}function nx({className:e,children:t,checked:o,...a}){return s(radixUi.ContextMenu.CheckboxItem,{"data-slot":"context-menu-checkbox-item",className:l("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:o,...a,children:[n("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:n(radixUi.ContextMenu.ItemIndicator,{children:n(lucideReact.CheckIcon,{className:"size-4"})})}),t]})}function ox({className:e,children:t,...o}){return s(radixUi.ContextMenu.RadioItem,{"data-slot":"context-menu-radio-item",className:l("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),...o,children:[n("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:n(radixUi.ContextMenu.ItemIndicator,{children:n(lucideReact.CircleIcon,{className:"size-2 fill-current"})})}),t]})}function ax({className:e,inset:t,...o}){return n(radixUi.ContextMenu.Label,{"data-slot":"context-menu-label","data-inset":t,className:l("text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...o})}function rx({className:e,...t}){return n(radixUi.ContextMenu.Separator,{"data-slot":"context-menu-separator",className:l("bg-border -mx-1 my-1 h-px",e),...t})}function ix({className:e,...t}){return n("span",{"data-slot":"context-menu-shortcut",className:l("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}var su={YYYY:"yyyy",YY:"yy",MM:"MM",M:"M",DD:"dd",D:"d"},lu=e=>{var t;return (t=su[e])!=null?t:e},cu=/(YYYY|YY|MM|M|DD|D|HH|H|mm|m|ss|s)/g,ba=e=>e.replace(cu,t=>t==="HH"?"HH":t==="H"?"H":t==="mm"?"mm":t==="m"?"m":t==="ss"?"ss":t==="s"?"s":lu(t)),bo=e=>!Number.isNaN(e.getTime()),Yt=class e{constructor(t){this.value=t;}create(t){return new e(t)}clone(){return this.create(new Date(this.value.getTime()))}add(t,o){switch(o){case "month":return this.create(dateFns.addMonths(this.value,t));case "year":return this.create(dateFns.addYears(this.value,t));default:return this.create(dateFns.addDays(this.value,t))}}subtract(t,o){return this.add(-t,o)}startOf(t){switch(t){case "month":return this.create(dateFns.startOfMonth(this.value));case "year":return this.create(dateFns.startOfYear(this.value));case "week":return this.create(dateFns.startOfWeek(this.value,{weekStartsOn:0}));default:return this.create(dateFns.startOfDay(this.value))}}endOf(t){if(t==="year")return this.create(dateFns.endOfYear(this.value));if(t==="month"){let r=dateFns.startOfMonth(this.value),i=dateFns.addDays(dateFns.addMonths(r,1),-1);return this.create(i)}let o=dateFns.startOfDay(this.value),a=dateFns.addDays(o,1);return this.create(dateFns.addDays(a,-1))}isSame(t,o="day"){switch(o){case "month":return dateFns.isSameMonth(this.value,t.toDate());case "year":return dateFns.isSameYear(this.value,t.toDate());case "week":return this.startOf("week").valueOf()===t.startOf("week").valueOf();default:return dateFns.isSameDay(this.value,t.toDate())}}isBefore(t,o){if(o){let a=this.startOf(o),r=t.startOf(o);return a.valueOf()<r.valueOf()}return dateFns.isBefore(this.value,t.toDate())}isAfter(t,o){if(o){let a=this.startOf(o),r=t.startOf(o);return a.valueOf()>r.valueOf()}return dateFns.isAfter(this.value,t.toDate())}format(t){return dateFns.format(this.value,ba(t))}daysInMonth(){return dateFns.getDaysInMonth(this.value)}month(t){return typeof t=="number"?this.create(dateFns.setMonth(this.value,t)):this.value.getMonth()}year(t){return typeof t=="number"?this.create(dateFns.setYear(this.value,t)):this.value.getFullYear()}date(t){return typeof t=="number"?this.create(dateFns.setDate(this.value,t)):this.value.getDate()}isValid(){return bo(this.value)}toDate(){return new Date(this.value.getTime())}valueOf(){return this.value.getTime()}},du=e=>{if(e instanceof Yt)return e.toDate();if(e instanceof Date)return new Date(e.getTime());if(typeof e=="number")return new Date(e);if(typeof e=="string"){let t=new Date(e);if(bo(t))return t}return new Date},xt=(e,t)=>{if(typeof e=="string"&&t){let o=dateFns.parse(e,ba(t),new Date);return bo(o)?new Yt(o):new Yt(new Date(NaN))}return new Yt(du(e))},wi=(e,t)=>{let o=dateFns.parse(e,ba(t),new Date);return bo(o)?new Yt(o):null};function va(e){return Object.keys(e).reduce((t,o)=>{let a=e[o];return a&&(t[o]=a),t},{})}function px(e){let[t,o]=X.useState({values:e.initialValues,errors:{},fieldErrors:{},touched:{},isSubmitting:false,isValid:false,validationSequence:0}),a=X.useCallback((f=t.values)=>{let v=e.validate?e.validate(f):{},p=va({...v,...t.fieldErrors}),y=Object.keys(p).length===0;return o(w=>({...w,errors:p,isValid:y})),y},[e.validate,t.fieldErrors,t.values]),r=X.useCallback((f,v)=>{o(p=>{let y={...p.values,[f]:v},w={...p.fieldErrors};delete w[f];let R=e.validate?e.validate(y):{},N=va({...R,...w}),C=Object.keys(N).length===0;return {...p,values:y,fieldErrors:w,errors:N,isValid:C}});},[e.validate]),i=X.useCallback((f,v=true)=>{o(p=>({...p,touched:{...p.touched,[f]:v}}));},[]),c=X.useCallback((f,v)=>{o(p=>{let y={...p.fieldErrors};v?y[f]=v:delete y[f];let w=e.validate?e.validate(p.values):{},R=va({...w,...y}),N=Object.keys(R).length===0;return {...p,fieldErrors:y,errors:R,isValid:N}});},[e.validate]),u=X.useCallback(()=>{o(f=>({...f,validationSequence:f.validationSequence+1}));},[]),d=X.useCallback(f=>{let{name:v,value:p}=f.target;r(v,p);},[r]),b=X.useCallback(f=>{let{name:v}=f.target;i(v,true),a();},[i,a]),m=X.useCallback(async f=>{f&&(f.preventDefault(),f.stopPropagation()),o(y=>{let w=Object.keys(y.values).reduce((R,N)=>(R[N]=true,R),{});return {...y,touched:w,validationSequence:y.validationSequence+1}});let v=t.values;if(a(v)&&!(Object.keys(t.fieldErrors).length>0)){o(y=>({...y,isSubmitting:true}));try{await e.onSubmit(v);}catch(y){console.error("Form submission error:",y);}finally{o(y=>({...y,isSubmitting:false}));}}},[e.onSubmit,a,t.values]),h=X.useCallback(()=>{o({values:e.initialValues,errors:{},fieldErrors:{},touched:{},isSubmitting:false,isValid:false,validationSequence:0});},[e.initialValues]);return {...t,...{setFieldValue:r,setFieldTouched:i,setFieldError:c,handleChange:d,handleBlur:b,handleSubmit:m,resetForm:h,validateForm:()=>a(),triggerValidation:u},form:{values:t.values,errors:t.errors,fieldErrors:t.fieldErrors,touched:t.touched,validationSequence:t.validationSequence,setFieldValue:(f,v)=>{r(f,v);},setFieldError:(f,v)=>{c(f,v);},setFieldTouched:(f,v)=>{i(f,v);},handleChange:d,handleBlur:b,handleSubmit:m,resetForm:h,validateForm:()=>a(),triggerValidation:u,isSubmitting:t.isSubmitting,isValid:t.isValid}}}var Ri=768;function ha(){var i,c;if(typeof window=="undefined")return false;let e=window.innerWidth<Ri,t=window.navigator,o=(t.userAgent||"").toLowerCase(),a=/android|iphone|ipad|ipod|blackberry|iemobile|opera mini/.test(o),r=(c=(i=t.userAgentData)==null?void 0:i.mobile)!=null?c:false;return e||a||r}function rt(){let[e,t]=X__namespace.useState(()=>ha());return X__namespace.useEffect(()=>{let o=window.matchMedia(`(max-width: ${Ri-1}px)`),a=()=>{t(ha());};return typeof o.addEventListener=="function"?o.addEventListener("change",a):typeof o.addListener=="function"&&o.addListener(a),t(ha()),()=>{typeof o.removeEventListener=="function"?o.removeEventListener("change",a):typeof o.removeListener=="function"&&o.removeListener(a);}},[]),e}var Ci=e=>({title:"",subtitle:void 0,supportingText:void 0,heroBadge:void 0,icon:void 0,back:void 0,actions:void 0,variant:void 0,...e}),Ti=e=>{let t=X.useMemo(()=>Ci(e),[e]),[o,a]=X.useState([t]),r=o[o.length-1],i=o.length>1,c=X.useCallback(m=>{a(h=>{let x=[...h],f=x.length-1;return x[f]={...t,...m},x});},[t]),u=X.useCallback(m=>{a(h=>[...h,{...t,...m}]);},[t]),d=X.useCallback(()=>{i&&a(m=>m.slice(0,-1));},[i]),b=X.useCallback(m=>{a([Ci(m!=null?m:t)]);},[t]);return {header:r,navigationState:r,navigationStack:o,setHeader:c,navigateTo:u,navigateBack:d,canGoBack:i,resetNavigation:b}},bu=()=>{let e=globalThis;return e.__GOMENIUCIVAN_MOBILE_HEADER_CONTEXT__||(e.__GOMENIUCIVAN_MOBILE_HEADER_CONTEXT__=X.createContext(null)),e.__GOMENIUCIVAN_MOBILE_HEADER_CONTEXT__},Pi=bu(),Ni=({initialState:e,children:t})=>{let o=Ti(e);return n(Pi.Provider,{value:o,children:t})},Si=e=>{let t=X.useContext(Pi);return t||Ti(e)};var hu=400,Ei=200,Di=.95,Li=()=>typeof window=="undefined"?"":`${window.location.pathname}${window.location.search}${window.location.hash}`,Ii=(e,t)=>{if(typeof window=="undefined")return ()=>{};let o=window.history,a=o[e];return a?(o[e]=function(...i){let c=a.apply(this,i);return t(),c},()=>{o[e]=a;}):()=>{}},yu=(e,t)=>{if(typeof window=="undefined")return ()=>{};let o=[],a=null,r={current:Li()},i=()=>{a&&window.clearTimeout(a),a=window.setTimeout(()=>{a=null,t();},hu);},c=()=>{let m=Li();if(m===r.current){t();return}r.current=m,e(),i();};o.push(Ii("pushState",c)),o.push(Ii("replaceState",c));let u=()=>{c();};window.addEventListener("popstate",u),o.push(()=>window.removeEventListener("popstate",u));let d=()=>{c();};window.addEventListener("hashchange",d),o.push(()=>window.removeEventListener("hashchange",d));let b=()=>{a&&(window.clearTimeout(a),a=null),t();};return window.addEventListener("load",b),window.addEventListener("pageshow",b),o.push(()=>{window.removeEventListener("load",b),window.removeEventListener("pageshow",b);}),()=>{o.forEach(m=>m()),a&&window.clearTimeout(a);}},xu=({color:e,framework:t})=>{let[o,a]=X.useState(false),r=X.useRef(o),[i,c]=X.useState(0),u=X.useRef(null),d=X.useRef(null),b=X.useCallback(()=>{d.current&&(window.clearTimeout(d.current),d.current=null),r.current=true,a(true),c(x=>x>0&&x<.2?x:.2);},[]),m=X.useCallback(()=>{r.current&&(u.current&&(window.clearTimeout(u.current),u.current=null),c(1),d.current=window.setTimeout(()=>{r.current=false,a(false),c(0);},200));},[]);X.useEffect(()=>{r.current=o;},[o]),X.useEffect(()=>typeof window=="undefined"?()=>{}:yu(b,m),[b,m,t]),X.useEffect(()=>{if(!o){u.current&&(window.clearTimeout(u.current),u.current=null);return}let x=()=>{c(f=>{if(f>=Di)return f;let v=(1-f)*.1;return Math.min(f+v,Di)}),u.current=window.setTimeout(x,Ei);};return u.current=window.setTimeout(x,Ei),()=>{u.current&&(window.clearTimeout(u.current),u.current=null);}},[o]),X.useEffect(()=>()=>{u.current&&window.clearTimeout(u.current),d.current&&window.clearTimeout(d.current);},[]);let h=X.useMemo(()=>({position:"fixed",top:0,left:0,height:"2px",width:`${Math.max(i*100,0)}%`,backgroundColor:e,boxShadow:"0 0 8px rgba(0, 0, 0, 0.15)",opacity:o?1:0,transition:"width 0.2s ease, opacity 0.2s ease",transform:"translateZ(0)",zIndex:9999}),[e,i,o]);return n("div",{"aria-hidden":"true",style:h})},xo=xu;var Ai=({color:e,framework:t})=>n(xo,{color:e,framework:t});var _i=({color:e,framework:t})=>n(xo,{color:e,framework:t});var wu={nextjs:_i},Fi=e=>{var t;return (t=wu[e])!=null?t:Ai};var Hi=({color:e,framework:t})=>{let[o,a]=X.useState(false);if(X.useEffect(()=>{a(true);},[]),!o)return null;let r=Fi(t);return n(r,{color:e,framework:t})};var xa=e=>{if(e===void 0||e===""||e===null||e==="undefined"||e==="null")return true;let t=e.toString();try{t=t.trim();}catch{return true}return !t||t.length===0};var Kt=e=>{if(xa(e))return false;if(typeof e=="boolean")return e;if(typeof e=="string"){let t=e.toLowerCase();return t==="true"||t==="yes"||t==="1"}else return !!e};var zi,wt=typeof process!="undefined"&&!!((zi=process==null?void 0:process.versions)!=null&&zi.node),wa=null,Ra=null,Vi=Function("specifier","return import(specifier);"),Jt=()=>wt?(wa||(wa=Vi("node:"+["fs","promises"].join("/"))),wa):null,Un=()=>wt?(Ra||(Ra=Vi("node:path")),Ra):null,Oi={debug:10,info:20,warning:30,error:40,critical:50},Tu=30,Pu=1e3,Nu=20,Su=e=>e===false?null:typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):Tu,Bi=e=>{var u,d,b,m,h,x,f;let t=typeof process!="undefined"?(u=process==null?void 0:process.env)==null?void 0:u.NODE_ENV:void 0,o=Su(e==null?void 0:e.storeDays),a=(d=e==null?void 0:e.level)!=null?d:"info",r=(b=e==null?void 0:e.consoleLogging)!=null?b:t!=="production",c=!!(e!=null&&e.enable)&&(t==="production"||!!(e!=null&&e.writeToFileInDev))&&wt;return {enable:!!(e!=null&&e.enable),level:a,retentionDays:o,json:!!(e!=null&&e.json),slowRequestThresholdMs:(m=e==null?void 0:e.slowRequestThresholdMs)!=null?m:Pu,maxFileSizeBytes:Math.max(1,(h=e==null?void 0:e.maxFileSizeMB)!=null?h:Nu)*1024*1024,directory:(x=e==null?void 0:e.directory)!=null?x:"monitoring",consoleLogging:r,captureUnhandled:(f=e==null?void 0:e.captureUnhandled)!=null?f:true,writeToFile:c}},ku=(e,t)=>Oi[e]>=Oi[t],Mu=e=>{var t;if(e)return e instanceof Error?{name:e.name,message:e.message,stack:e.stack}:typeof e=="object"?{name:e.name,message:String((t=e.message)!=null?t:e),stack:e.stack,raw:e}:{message:String(e)}},Eu=e=>typeof(e==null?void 0:e.then)=="function",wo=class{constructor(t){this.directoryCache=null;this.initialized=false;this.options=Bi(t),this.publicApi=this.createPublicApi(),this.options.enable&&this.initialize();}get api(){return this.publicApi}updateOptions(t){let o=this.options.enable,a=this.options.level,r=this.options.json,i=this.options.slowRequestThresholdMs,c=this.options.retentionDays,u=this.options.directory,d=this.options.writeToFile;if(this.options=Bi(t),this.options.directory!==u&&(this.directoryCache=null),!this.options.enable){this.detachProcessHandlers();return}(!o||this.options.level!==a||this.options.json!==r||this.options.slowRequestThresholdMs!==i||this.options.retentionDays!==c||this.options.directory!==u||this.options.writeToFile!==d)&&this.initialize();}async initialize(){if(this.initialized){await this.ensureDirectory(),this.options.retentionDays!==null&&await this.purgeLogs(),this.ensureProcessHandlers();return}await this.ensureDirectory(),this.options.retentionDays!==null&&await this.purgeLogs(),this.ensureProcessHandlers(),this.initialized=true;}createPublicApi(){return {log:(t,o,a)=>this.log(t,o,a),debug:(t,o)=>this.log("debug",t,o),info:(t,o)=>this.log("info",t,o),warning:(t,o)=>this.log("warning",t,o),error:(t,o)=>this.log("error",t,o),critical:(t,o)=>this.log("critical",t,o),logRequest:t=>this.logRequest(t),monitorRequest:(t,o)=>this.monitorRequest(t,o),deleteLogFile:t=>this.deleteLogFile(t),purgeLogs:()=>this.purgeLogs(),listLogFiles:()=>this.listLogFiles(),getLogDirectory:()=>this.getDirectoryPath(),getOptions:()=>this.options,updateOptions:t=>this.updateOptions(t)}}async getDirectoryPath(){if(!wt)return null;if(this.directoryCache)return this.directoryCache;let t=await Un();if(!t)return null;let o=this.options.directory,a=t.isAbsolute(o)?o:t.join(process.cwd(),o);return this.directoryCache=a,a}async ensureDirectory(){if(!this.options.enable||!wt)return;let t=await Jt(),o=await this.getDirectoryPath();if(!(!t||!o))try{await t.mkdir(o,{recursive:!0});}catch(a){this.options.consoleLogging&&console.error("[monitoring] Failed to create directory",a);}}ensureProcessHandlers(){if(!this.options.enable||!this.options.captureUnhandled||!wt)return;let t=process;if(!(t!=null&&t.on)||this.processHandlers)return;let o=(...r)=>{let[i]=r;this.log("critical","Uncaught exception detected",{error:i});},a=(...r)=>{let[i]=r;this.log("error","Unhandled promise rejection detected",{error:i});};t.on("uncaughtException",o),t.on("unhandledRejection",a),this.processHandlers={exception:o,rejection:a};}detachProcessHandlers(){if(!this.processHandlers||!wt)return;let t=process,{exception:o,rejection:a}=this.processHandlers;t!=null&&t.off?(t.off("uncaughtException",o),t.off("unhandledRejection",a)):t!=null&&t.removeListener&&(t.removeListener("uncaughtException",o),t.removeListener("unhandledRejection",a)),this.processHandlers=void 0;}resolveLogEntry(t,o,a){let r=a==null?void 0:a.context,i=Mu(a==null?void 0:a.error),{error:c,context:u,metadata:d,...b}=a!=null?a:{},m={};return d&&typeof d=="object"&&(m.metadata=d),Object.assign(m,b),{timestamp:new Date,level:t,message:o,context:r,error:i,metadata:Object.keys(m).length>0?m:void 0}}async log(t,o,a){if(!ku(t,this.options.level))return;let i=this.resolveLogEntry(t,o,a);this.options.consoleLogging&&this.consoleLog(i),!(!this.options.enable||!this.options.writeToFile||!wt)&&(await this.writeLogEntry(i),this.options.retentionDays!==null&&await this.purgeLogs());}consoleLog(t){let o=t.timestamp.toISOString(),a={...t.metadata,context:t.context,error:t.error},r=[`[monitoring] ${o} [${t.level.toUpperCase()}] ${t.message}`,a];switch(t.level){case "error":case "critical":console.error(...r);break;case "warning":console.warn(...r);break;case "info":console.info(...r);break;default:console.debug(...r);break}}async writeLogEntry(t){let o=await Jt(),a=await Un(),r=await this.getDirectoryPath();if(!(!o||!a||!r))try{let i=await this.resolveLogFilePath(r);if(!i)return;let c=this.options.json?this.serializeJsonEntry(t):this.serializeTextEntry(t);await o.appendFile(i,c+`
|
|
8
|
-
`);}catch(i){this.options.consoleLogging&&console.error("[monitoring] Failed to write log entry",i);}}serializeTextEntry(t){let a=[`[${t.timestamp.toISOString()}]`,`[${t.level.toUpperCase()}]`,t.message];return t.context&&Object.keys(t.context).length>0&&a.push(`context=${JSON.stringify(t.context)}`),t.metadata&&Object.keys(t.metadata).length>0&&a.push(`metadata=${JSON.stringify(t.metadata)}`),t.error&&a.push(`error=${JSON.stringify(t.error)}`),a.join(" ")}serializeJsonEntry(t){return JSON.stringify({timestamp:t.timestamp.toISOString(),level:t.level,message:t.message,context:t.context,metadata:t.metadata,error:t.error})}async resolveLogFilePath(t){let o=await Jt(),a=await Un();if(!o||!a)return null;let r=new Date,i=[r.getFullYear(),String(r.getMonth()+1).padStart(2,"0"),String(r.getDate()).padStart(2,"0")].join("-"),c=this.options.json?"jsonl":"log",u=`${i}.${c}`,d=a.join(t,u);if(!await this.isFileExceedingSize(d))return d;let b=1;for(;;){let m=`${i}-${b}.${c}`,h=a.join(t,m);if(!await this.isFileExceedingSize(h))return h;b+=1;}}async isFileExceedingSize(t){let o=await Jt();if(!o)return false;try{return (await o.stat(t)).size>=this.options.maxFileSizeBytes}catch(a){if(a.code==="ENOENT")return false;throw a}}async logRequest(t){var c,u,d;let o=(c=t.thresholdMs)!=null?c:this.options.slowRequestThresholdMs;if(t.durationMs<o)return;let a=((u=t.method)!=null?u:"REQUEST").toUpperCase(),r=`Slow request detected for ${a} ${(d=t.url)!=null?d:""}`,i=t.durationMs>=o*2?"error":"warning";await this.log(i,r,{context:{method:a,url:t.url,durationMs:t.durationMs,statusCode:t.statusCode,thresholdMs:o},metadata:t.metadata});}async monitorRequest(t,o){let a=Date.now();try{let r=o();return Eu(r)?await r:r}catch(r){throw await this.log("error","Monitored request failed",{context:{method:t.method,url:t.url,operationName:t.operationName,statusCode:t.statusCode},error:r}),r}finally{let r=Date.now()-a;await this.logRequest({...t,durationMs:r});}}async purgeLogs(){if(!this.options.enable||this.options.retentionDays===null)return;let t=await Jt(),o=await Un(),a=await this.getDirectoryPath();if(!(!t||!o||!a))try{let r=await t.readdir(a,{withFileTypes:!0}),i=Date.now()-this.options.retentionDays*24*60*60*1e3;await Promise.all(r.filter(c=>c.isFile()).map(async c=>{let u=o.join(a,c.name);try{(await t.stat(u)).mtime.getTime()<i&&await t.rm(u,{force:!0});}catch(d){this.options.consoleLogging&&console.warn("[monitoring] Failed to purge log file",d);}}));}catch(r){this.options.consoleLogging&&console.error("[monitoring] Failed to read monitoring directory",r);}}async deleteLogFile(t){if(!wt)return;let o=await Jt(),a=await Un(),r=await this.getDirectoryPath();if(!(!o||!a||!r))try{if(!t){let u=await o.readdir(r,{withFileTypes:!0});await Promise.all(u.map(async d=>{let b=a.join(r,d.name);await o.rm(b,{force:!0,recursive:d.isDirectory()});}));return}let i=a.basename(t),c=a.join(r,i);await o.rm(c,{force:!0});}catch(i){this.options.consoleLogging&&console.error("[monitoring] Failed to delete log file",i);}}async listLogFiles(){if(!wt)return [];let t=await Jt(),o=await this.getDirectoryPath();if(!t||!o)return [];try{return (await t.readdir(o)).sort()}catch(a){return this.options.consoleLogging&&console.error("[monitoring] Failed to list log files",a),[]}}},Xt=null,Du=()=>(Xt||(Xt=new wo),Xt),Ro=e=>(Xt?Xt.updateOptions(e):Xt=new wo(e),Xt.api),ji=()=>Du().api,Lu=e=>{let t=X__namespace.useRef();return X__namespace.useEffect(()=>{if(!e)return;let o=t.current,a=JSON.stringify(e),r=o?JSON.stringify(o):void 0;a!==r&&(t.current=e,Ro(e));},[e]),X__namespace.useMemo(()=>ji(),[])};function $n(e,t="info",o){let{title:a,description:r,duration:i=4e3,action:c}=o||{},u={duration:i,...c&&{action:{label:c.label,onClick:c.onClick}}};switch(t){case "success":sonner.toast.success(a||e,{description:r,...u});break;case "error":sonner.toast.error(a||e,{description:r,...u});break;case "warning":sonner.toast.warning(a||e,{description:r,...u});break;case "info":default:sonner.toast.info(a||e,{description:r,...u});break}}var Iu=(e,t)=>$n(e,"success",t),Au=(e,t)=>$n(e,"error",t),_u=(e,t)=>$n(e,"warning",t),Fu=(e,t)=>$n(e,"info",t);var zu=()=>{let[e,t]=X.useState([]),[o,a]=X.useState(true),[r,i]=X.useState(null);return X.useEffect(()=>{let c=false;return (async()=>{if(typeof caches=="undefined")throw new Error("The Cache Storage API is not available in this environment.");let d=await caches.keys();c||t(d);})().catch(d=>{c||i(d instanceof Error?d.message:String(d));}).finally(()=>{c||a(false);}),()=>{c=true;}},[]),s(Ge,{className:"h-full",children:[s(Ke,{children:[s(Je,{className:"flex items-center gap-2 text-base",children:[n(lucideReact.HardDrive,{className:"size-4"}),"Cache storage"]}),n(Xe,{children:"Inspect browser-managed caches available to this origin."})]}),n($e,{className:"flex h-full flex-col gap-4",children:o?s("div",{className:"flex flex-1 items-center justify-center text-muted-foreground",children:[n(lucideReact.Loader2,{className:"size-5 animate-spin"})," Loading caches\u2026"]}):r?s(nt,{variant:"destructive",children:[n(ot,{children:"Unable to load caches"}),n(at,{children:r})]}):e.length===0?s(nt,{children:[n(ot,{children:"No caches detected"}),n(at,{children:"Service worker caches will appear here when they are created in development."})]}):n(It,{className:"max-h-[360px] pr-2",children:n("div",{className:"space-y-2",children:e.map(c=>s("div",{className:"flex items-center justify-between rounded-md border bg-muted/30 px-3 py-2",children:[n("span",{className:"font-medium",children:c}),n($t,{variant:"outline",children:"Cache"})]},c))})})})]})},Ui=zu;var Yi={};var Uu=["NEXT_PUBLIC_SUPABASE_SCHEMA","VITE_SUPABASE_SCHEMA","SUPABASE_SCHEMA"],Gu=["NEXT_PUBLIC_SUPABASE_URL","VITE_SUPABASE_URL","SUPABASE_URL"],$u=["NEXT_PUBLIC_SUPABASE_ANON_KEY","VITE_SUPABASE_ANON_KEY","SUPABASE_ANON_KEY","SUPABASE_SERVICE_ROLE_KEY"],Ta=e=>{var t;for(let o of e){if(typeof process!="undefined"&&typeof process.env=="object"){let a=process.env[o];if(typeof a=="string"&&a.length>0)return a}if(typeof Yi!="undefined"){let a=Yi.env,r=a==null?void 0:a[o];if(typeof r=="string"&&r.length>0)return r}if(typeof globalThis!="undefined"){let a=globalThis[o];if(typeof a=="string"&&a.length>0)return a;let r=(t=globalThis.__env__)==null?void 0:t[o];if(typeof r=="string"&&r.length>0)return r}}},qu=()=>{var r,i,c,u,d,b;let e=(i=typeof globalThis!="undefined"&&(r=globalThis.__DEVPANEL_SUPABASE__)!=null?r:null)!=null?i:null,t=(u=(c=e==null?void 0:e.schema)!=null?c:Ta(Uu))!=null?u:"public",o=(d=e==null?void 0:e.url)!=null?d:Ta(Gu),a=(b=e==null?void 0:e.key)!=null?b:Ta($u);return !o||!a?null:{url:o,key:a,schema:t}},Wu=e=>({apikey:e.key,Authorization:`Bearer ${e.key}`,Accept:"application/json","Content-Type":"application/json",Prefer:"count=exact"}),Wi=e=>{if(e instanceof Error)return e.message;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return "Unknown error"}},Yu=e=>{var a;if(!e)return;let t=/\/(\d+)$/.exec(e);if(!t)return;let o=Number.parseInt((a=t[1])!=null?a:"",10);return Number.isFinite(o)?o:void 0},Ku=({provider:e})=>{let[t]=X.useState(()=>qu()),[o,a]=X.useState([]),[r,i]=X.useState([]),[c,u]=X.useState([]),[d,b]=X.useState(false),[m,h]=X.useState(false),[x,f]=X.useState(null),[v,p]=X.useState(null),[y,w]=X.useState(null),[R,N]=X.useState(void 0),C=e==="supabase",k=X.useMemo(()=>t?Wu(t):null,[t]);return X.useEffect(()=>{if(!C||!t||!k)return;let g=new AbortController;return b(true),w(null),(async()=>{let E=await fetch(`${t.url}/rest/v1/information_schema.tables?select=table_name,table_schema&table_schema=eq.${encodeURIComponent(t.schema)}&order=table_name`,{headers:k,signal:g.signal});if(!E.ok)throw new Error(`Failed to load Supabase schema (${E.status})`);let S=await E.json();a(S.map(T=>({name:T.table_name,schema:T.table_schema})));})().catch(E=>{g.signal.aborted||w(Wi(E));}).finally(()=>{g.signal.aborted||b(false);}),()=>g.abort()},[t,k,C]),X.useEffect(()=>{if(!C||!t||!k||!x)return;let g=new AbortController;h(true),p(null);let M=async()=>{let S=await fetch(`${t.url}/rest/v1/information_schema.columns?select=column_name,data_type,is_nullable&table_schema=eq.${encodeURIComponent(t.schema)}&table_name=eq.${encodeURIComponent(x)}&order=ordinal_position`,{headers:k,signal:g.signal});if(!S.ok)throw new Error(`Failed to load column metadata (${S.status})`);let T=await S.json();i(T.map(P=>({name:P.column_name,type:P.data_type,nullable:P.is_nullable==="YES"})));},E=async()=>{let S=await fetch(`${t.url}/rest/v1/${encodeURIComponent(x)}?select=*&limit=200`,{headers:k,signal:g.signal});if(!S.ok)throw new Error(`Failed to load data (${S.status})`);let T=await S.json();u(T),N(Yu(S.headers.get("content-range")));};return Promise.all([M(),E()]).catch(S=>{g.signal.aborted||(p(Wi(S)),i([]),u([]),N(void 0));}).finally(()=>{g.signal.aborted||h(false);}),()=>g.abort()},[t,k,C,x]),C?t?s("div",{className:"grid gap-4 lg:grid-cols-[260px,1fr]",children:[s(Ge,{className:"h-full min-h-[320px]",children:[s(Ke,{children:[s(Je,{className:"flex items-center gap-2 text-base",children:[n(lucideReact.Database,{className:"size-4"})," Tables"]}),s(Xe,{children:["Schema ",n("code",{children:t.schema})]})]}),n($e,{className:"flex h-full flex-col gap-3",children:y?s(nt,{variant:"destructive",children:[n(lucideReact.ServerOff,{}),n(ot,{children:"Unable to load tables"}),n(at,{children:y})]}):d?n("div",{className:"space-y-2",children:[0,1,2,3,4].map(g=>n(gt,{className:"h-9 w-full"},g))}):o.length===0?s(nt,{children:[n(lucideReact.Table,{className:"text-muted-foreground"}),n(ot,{children:"No tables found"}),s(at,{children:["The schema ",n("code",{children:t.schema})," does not contain any tables accessible via the REST API."]})]}):n(It,{className:"max-h-[360px] pr-2",children:n("div",{className:"space-y-2",children:o.map(g=>{let M=g.name===x;return s(J,{variant:M?"default":"outline",className:"w-full justify-start gap-2",onClick:()=>f(g.name),children:[n(lucideReact.Table,{className:"size-4"}),n("span",{className:"truncate",children:g.name})]},g.name)})})})})]}),n("div",{className:"flex h-full min-h-[320px] flex-col gap-4",children:x?s(jsxRuntime.Fragment,{children:[s(Ge,{children:[s(Ke,{className:"flex flex-col gap-1",children:[s("div",{className:"flex items-center gap-2",children:[n(Je,{className:"text-base",children:x}),R!=null&&s($t,{variant:"outline",children:[R," rows"]})]}),s(Xe,{children:["Columns available in ",n("code",{children:x})]})]}),n($e,{children:v?s(nt,{variant:"destructive",children:[n(lucideReact.ServerOff,{}),n(ot,{children:"Unable to load table metadata"}),n(at,{children:v})]}):m&&r.length===0?n("div",{className:"space-y-2",children:[0,1,2].map(g=>n(gt,{className:"h-6 w-full"},g))}):n("div",{className:"flex flex-wrap gap-2",children:r.map(g=>s("div",{className:"rounded-md border bg-muted/40 px-3 py-1 text-xs",children:[n("div",{className:"font-semibold text-foreground",children:g.name}),s("div",{className:"text-muted-foreground",children:[g.type,!g.nullable&&n($t,{className:"ml-2",variant:"secondary",children:"NOT NULL"})]})]},g.name))})})]}),s(Ge,{className:"flex flex-1 flex-col overflow-hidden",children:[s(Ke,{className:"border-b border-border/60 pb-4",children:[n(Je,{className:"text-base",children:"Table data"}),s(Xe,{children:["Showing up to 200 rows from ",n("code",{children:x})]})]}),n($e,{className:"flex flex-1 flex-col overflow-hidden",children:v?s(nt,{variant:"destructive",children:[n(lucideReact.ServerOff,{}),n(ot,{children:"Unable to load table data"}),n(at,{children:v})]}):m&&c.length===0?n("div",{className:"flex flex-1 items-center justify-center",children:n(lucideReact.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}):c.length===0?n("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:"No rows returned for this table."}):n(It,{className:"-mx-2 flex-1",children:s(ut,{children:[n(pt,{children:n(Ce,{children:(r.length?r.map(g=>g.name):Object.keys(c[0])).map(g=>n(Be,{className:"whitespace-nowrap",children:g},g))})}),n(mt,{children:c.map((g,M)=>n(Ce,{children:(r.length?r.map(E=>E.name):Object.keys(g)).map(E=>{let S=g[E];return S==null?n(Re,{className:"text-muted-foreground",children:"NULL"},`${x}-${M}-${E}`):typeof S=="object"?n(Re,{className:"max-w-[220px] whitespace-pre-wrap text-xs",children:JSON.stringify(S)},`${x}-${M}-${E}`):n(Re,{className:"max-w-[220px] truncate",children:String(S)},`${x}-${M}-${E}`)})},`${x}-${M}`))})]})})})]})]}):n(Ge,{className:"flex flex-1 items-center justify-center",children:s($e,{className:"flex flex-col items-center gap-2 text-center",children:[n(lucideReact.Database,{className:"size-8 text-muted-foreground"}),n("p",{className:"font-medium",children:"Select a table to inspect its structure and rows."})]})})})]}):s(nt,{variant:"destructive",children:[n(lucideReact.ServerOff,{}),n(ot,{children:"Supabase credentials missing"}),s(at,{children:["Provide ",n("code",{children:"SUPABASE_URL"})," and ",n("code",{children:"SUPABASE_ANON_KEY"})," (or their public variants) in your environment or set",n("code",{children:"globalThis.__DEVPANEL_SUPABASE__"})," at runtime."]})]}):s(nt,{children:[n(lucideReact.ServerOff,{className:"text-muted-foreground"}),n(ot,{children:"Database tooling is not configured"}),s(at,{children:["Configure ",n("code",{children:"extras.database"})," to ",n("code",{children:"'supabase'"})," to enable the database inspector."]})]})},Ki=Ku;var Qu=()=>{if(typeof globalThis=="undefined")return null;let e=[globalThis.__FEATURE_FLAGS__,globalThis.__DEVPANEL_FLAGS__];for(let t of e)if(t){if(typeof t=="object"&&t!==null&&"flags"in t){let o=t.flags;if(o&&typeof o=="object")return o}if(typeof t=="object")return t}return null},ep=()=>{let e=X.useMemo(()=>Qu(),[]);return s(Ge,{className:"h-full",children:[s(Ke,{children:[s(Je,{className:"flex items-center gap-2 text-base",children:[n(lucideReact.Flag,{className:"size-4"}),"Feature flags"]}),n(Xe,{children:"Inspect runtime feature toggles exposed on the client."})]}),n($e,{children:!e||Object.keys(e).length===0?s(nt,{children:[n(lucideReact.Info,{className:"text-muted-foreground"}),n(ot,{children:"No feature flags detected"}),s(at,{children:["Populate ",n("code",{children:"globalThis.__FEATURE_FLAGS__"})," or",n("code",{children:"globalThis.__DEVPANEL_FLAGS__"})," to inspect values here."]})]}):s(ut,{children:[n(pt,{children:s(Ce,{children:[n(Be,{children:"Flag"}),n(Be,{children:"Value"})]})}),n(mt,{children:Object.entries(e).map(([t,o])=>s(Ce,{children:[n(Re,{className:"font-medium",children:t}),n(Re,{className:"max-w-[320px] whitespace-pre-wrap break-words text-sm",children:typeof o=="object"&&o!==null?JSON.stringify(o):String(o)})]},t))})]})})]})},Ji=ep;var ap=()=>{let[e,t]=X.useState(null);return X.useEffect(()=>{var b,m;if(typeof document=="undefined")return;let a=Array.from(document.querySelectorAll("meta")).map(h=>{var x,f,v,p;return {name:(f=(x=h.getAttribute("name"))!=null?x:h.getAttribute("http-equiv"))!=null?f:"",property:(v=h.getAttribute("property"))!=null?v:"",content:(p=h.getAttribute("content"))!=null?p:""}}).filter(h=>h.content),r=a.filter(h=>h.name&&!h.property).map(h=>({name:h.name,content:h.content})),i=a.filter(h=>{var x,f;return ((x=h.property)==null?void 0:x.startsWith("og:"))||((f=h.property)==null?void 0:f.startsWith("twitter:"))}).map(h=>({property:h.property,content:h.content})),c=Array.from(document.querySelectorAll("link")).map(h=>({rel:h.getAttribute("rel"),href:h.getAttribute("href")})).filter(h=>h.rel||h.href),u=a.find(h=>h.name==="description"),d=c.find(h=>h.rel==="canonical");t({title:document.title,description:(b=u==null?void 0:u.content)!=null?b:null,canonicalUrl:(m=d==null?void 0:d.href)!=null?m:null,metas:r,og:i,links:c});},[]),e?s(It,{className:"h-full pr-4",children:[s("div",{className:"space-y-6",children:[s(Ge,{children:[s(Ke,{children:[n(Je,{children:"Document overview"}),n(Xe,{children:"Information sourced from the active document."})]}),s($e,{className:"space-y-2 text-sm",children:[s("div",{children:[n("span",{className:"font-semibold",children:"Title:"})," ",e.title||"\u2014"]}),s("div",{children:[n("span",{className:"font-semibold",children:"Description:"})," ",e.description||"\u2014"]}),s("div",{children:[n("span",{className:"font-semibold",children:"Canonical URL:"})," ",e.canonicalUrl||"\u2014"]})]})]}),s(Ge,{children:[s(Ke,{children:[n(Je,{children:"Meta tags"}),n(Xe,{children:"Standard meta tags extracted from the document head."})]}),n($e,{children:e.metas.length===0?n("div",{className:"text-sm text-muted-foreground",children:"No meta tags detected."}):s(ut,{children:[n(pt,{children:s(Ce,{children:[n(Be,{children:"Name"}),n(Be,{children:"Content"})]})}),n(mt,{children:e.metas.map(o=>s(Ce,{children:[n(Re,{className:"font-medium",children:o.name}),n(Re,{className:"max-w-[320px] whitespace-pre-wrap break-words text-sm",children:o.content})]},`${o.name}-${o.content}`))})]})})]}),s(Ge,{children:[s(Ke,{children:[n(Je,{children:"Open Graph & Twitter tags"}),n(Xe,{children:"Social graph data detected in the document."})]}),n($e,{children:e.og.length===0?n("div",{className:"text-sm text-muted-foreground",children:"No Open Graph or Twitter tags found."}):s(ut,{children:[n(pt,{children:s(Ce,{children:[n(Be,{children:"Property"}),n(Be,{children:"Content"})]})}),n(mt,{children:e.og.map(o=>s(Ce,{children:[n(Re,{className:"font-medium",children:o.property}),n(Re,{className:"max-w-[320px] whitespace-pre-wrap break-words text-sm",children:o.content})]},`${o.property}-${o.content}`))})]})})]}),s(Ge,{children:[s(Ke,{children:[n(Je,{children:"Link tags"}),n(Xe,{children:"All link elements found in the document head."})]}),n($e,{children:e.links.length===0?n("div",{className:"text-sm text-muted-foreground",children:"No link tags detected."}):s(ut,{children:[n(pt,{children:s(Ce,{children:[n(Be,{children:"Rel"}),n(Be,{children:"Href"})]})}),n(mt,{children:e.links.map((o,a)=>s(Ce,{children:[n(Re,{children:o.rel||"\u2014"}),n(Re,{className:"max-w-[320px] whitespace-pre-wrap break-words text-sm",children:o.href||"\u2014"})]},`${o.rel}-${o.href}-${a}`))})]})})]})]}),n(Co,{className:"my-6"})]}):s(nt,{children:[n(lucideReact.Globe,{className:"text-muted-foreground"}),n(ot,{children:"Metadata unavailable"}),n(at,{children:"Client-side metadata will appear once the page has finished loading."})]})},Xi=ap;var lp=()=>{let e=X.useMemo(()=>{var a,r,i;if(typeof window=="undefined")return {};let t=window.navigator,o={"User agent":t.userAgent,Platform:t.platform,Language:t.language,Online:t.onLine?"yes":"no",Cookies:t.cookieEnabled?"enabled":"disabled"};return "hardwareConcurrency"in t&&(o["Logical cores"]=String((a=t.hardwareConcurrency)!=null?a:"unknown")),"deviceMemory"in t&&(o["Approx. memory (GB)"]=String((r=t.deviceMemory)!=null?r:"unknown")),o["Viewport size"]=`${window.innerWidth} \xD7 ${window.innerHeight}`,o["Screen size"]=`${window.screen.width} \xD7 ${window.screen.height}`,typeof window.location!="undefined"&&(o.Location=window.location.href),o["Time zone"]=(i=Intl.DateTimeFormat().resolvedOptions().timeZone)!=null?i:"unknown",typeof window.matchMedia=="function"&&(o["Prefers reduced motion"]=window.matchMedia("(prefers-reduced-motion: reduce)").matches?"yes":"no",o["Prefers dark color scheme"]=window.matchMedia("(prefers-color-scheme: dark)").matches?"yes":"no"),o},[]);return s(Ge,{className:"h-full",children:[s(Ke,{children:[s(Je,{className:"flex items-center gap-2 text-base",children:[n(lucideReact.Cpu,{className:"size-4"}),"System status"]}),n(Xe,{children:"Runtime information about the current browser session."})]}),n($e,{className:"h-full",children:n(It,{className:"max-h-[360px] pr-2",children:s(ut,{children:[n(pt,{children:s(Ce,{children:[n(Be,{children:"Property"}),n(Be,{children:"Value"})]})}),n(mt,{children:Object.entries(e).map(([t,o])=>s(Ce,{children:[n(Re,{className:"font-medium",children:s("div",{className:"flex items-center gap-2",children:[n(lucideReact.MonitorSmartphone,{className:"size-4 text-muted-foreground"}),t]})}),n(Re,{className:"max-w-[320px] whitespace-pre-wrap break-words text-sm",children:o})]},t))})]})})})]})},Zi=lp;var bp=e=>e!=="supabase"?null:{key:"database",label:"Database",icon:lucideReact.DatabaseIcon,content:n(Ki,{provider:e})},vp=()=>{let e=ns(),[t,o]=X.useState(false),[a,r]=X.useState(null),i=X.useMemo(()=>{let c=[{key:"metadata",label:"Metadata",icon:lucideReact.BookText,content:n(Xi,{})},{key:"cache",label:"Caches",icon:lucideReact.GlobeLockIcon,content:n(Ui,{})},{key:"flags",label:"Feature flags",icon:lucideReact.FlagIcon,content:n(Ji,{})},{key:"system",label:"System",icon:lucideReact.Cog,content:n(Zi,{})}],u=bp(e.database);return u?[u,...c]:c},[e.database]);return X.useEffect(()=>{if(i.length===0){r(null);return}r(c=>!c||!i.some(u=>u.key===c)?i[0].key:c);},[i]),!e.enabled||e.framework!=="nextjs"?null:s(mn,{open:t,onOpenChange:o,children:[n(pi,{asChild:true,children:s(J,{className:"fixed bottom-6 right-6 z-50 shadow-lg",size:"lg",variant:"default",children:[n(lucideReact.BugIcon,{className:"mr-2 size-4"}),"Developer tools"]})}),s(fn,{className:"flex h-[min(85vh,720px)] w-[min(90vw,1024px)] flex-col overflow-hidden",children:[s(gn,{children:[s(bn,{className:"flex items-center gap-2",children:[n(lucideReact.BugIcon,{className:"size-5"})," Developer tools"]}),s(vn,{children:["Framework detected: ",n("strong",{children:e.framework}),e.database!=="unknown"&&s(jsxRuntime.Fragment,{children:[" \xB7 ","Database: ",n("strong",{children:e.database})]})]})]}),a&&n(To,{className:"flex h-full flex-col gap-4",contentClassName:"flex-1 overflow-hidden",listClassName:"max-w-full flex-wrap",onValueChange:r,value:a,items:i.map(c=>({key:c.key,label:s("span",{className:"flex items-center gap-2",children:[n(c.icon,{className:"size-4"}),c.label]}),children:n("div",{className:"flex h-full flex-col overflow-hidden",children:c.content})})),variant:"boxed"})]})]})},ts=vp;var as=X.createContext(void 0),xp={enabled:false,framework:"auto",database:"auto",fieldName:"auto",fieldCy:"auto"},wp=new Set(["","email","number","password","search","tel","text","url","date","datetime-local","month","time","week"]),Rp=()=>{var o;if(typeof window!="undefined"){if(window.__NEXT_DATA__)return "nextjs";if(window.__vite_plugin_react_preamble_installed__)return "vite"}if(typeof document!="undefined"&&document.querySelector('script[src*="@vite/client"]'))return "vite";let e=typeof globalThis!="undefined"&&(o=globalThis.process)!=null?o:void 0,t=e==null?void 0:e.env;if(t){if(t.NEXT_PHASE||t.__NEXT_PREVIEW_MODE)return "nextjs";if(t.VITE_DEV_SERVER_URL||t.VITE_USER_NODE_ENV)return "vite";if(t.BABEL_ENV)return "babel";if(t.WEBPACK||t.WEBPACK_DEV_SERVER)return "webpack"}return typeof globalThis!="undefined"&&globalThis.__webpack_require__?"webpack":"unknown"},Cp=e=>{var b,m;let t={...xp,...e!=null?e:{}},o=(b=t.framework)!=null?b:"auto",a=o==="auto"?Rp():o,r=(m=t.database)!=null?m:"auto",i=r==="auto"?"unknown":r,c=!!t.enabled,u=t.fieldName==="auto"?c:!!t.fieldName,d=t.fieldCy==="auto"?c:!!t.fieldCy;return {enabled:c,debug:c,framework:a,requestedFramework:o,database:i,requestedDatabase:r,fieldName:u,fieldCy:d}},Vw=({children:e,defaultTheme:t="system",nativeApp:o=false,extras:a,monitoring:r,siderbar:i})=>{var T,P,F,H,q;let[c,u]=X.useState(!!o),d=rt(),b=X.useMemo(()=>Cr(),[]),m=X.useMemo(()=>{let L=Cp(a);return Pr(b,L),L},[a,b]),h=X.useMemo(()=>r||{enable:false},[r]);X.useEffect(()=>{Ro(h);},[h]),X.useEffect(()=>()=>{Nr(b);},[b]),X.useEffect(()=>{u(!!o);},[o]);let x=()=>{var A;if(typeof window=="undefined")return t==="system"?"auto":t;let L=(A=window.localStorage)==null?void 0:A.getItem(sn);return rn(L)?L:t==="system"?"auto":t},[f,v]=X.useState(()=>x()),[p,y]=X.useState(()=>On(x())),[w,R]=X.useState(null);X.useEffect(()=>{y(On(f)),Dr(f);},[f]),X.useEffect(()=>{var O;if(typeof window=="undefined")return;let L=(O=window.localStorage)==null?void 0:O.getItem(sn);if(rn(L))return;let A=t==="system"?"auto":t;v(D=>D===A?D:A);},[t]),X.useEffect(()=>{if(typeof window=="undefined"||f!=="auto")return;let L=window.matchMedia("(prefers-color-scheme: dark)"),A=D=>{let U=D.matches?"dark":"light";y(V=>V===U?V:U),co("auto");},O=On("auto");return y(D=>D===O?D:O),co("auto"),L.addEventListener("change",A),()=>L.removeEventListener("change",A)},[f]),X.useEffect(()=>{if(typeof window=="undefined")return;let L=A=>{let O=A.detail;O&&v(D=>D===O?D:O);};return window.addEventListener(lo,L),()=>window.removeEventListener(lo,L)},[]),X.useEffect(()=>{if(typeof window=="undefined")return;let L=A=>{if(A.key!==sn||!A.newValue||!rn(A.newValue))return;let O=A.newValue;v(D=>D===O?D:O);};return window.addEventListener("storage",L),()=>window.removeEventListener("storage",L)},[]);let N=p==="dark";X.useEffect(()=>{if(typeof document=="undefined")return;let L=document.documentElement;L.dataset.framework=m.framework,L.dataset.database=m.database,L.dataset.debug=m.enabled?"true":"false";},[m]);let C=c,k=C||d;X.useEffect(()=>{if(typeof document=="undefined"||typeof window=="undefined"||!k)return;let L=150,A=$=>$ instanceof HTMLElement?$.isContentEditable||$ instanceof HTMLTextAreaElement?true:$ instanceof HTMLInputElement?wp.has($.type):false:false,O=$=>{let j=$.getBoundingClientRect(),G=window.innerHeight||document.documentElement.clientHeight,_=window.innerWidth||document.documentElement.clientWidth,te=j.top>=0&&j.bottom<=G,K=j.left>=0&&j.right<=_;return te&&K},D=$=>{window.setTimeout(()=>{O($)||$.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"});},L);},U=$=>{if(!($ instanceof Element))return null;if(A($))return $;let j=$.closest('input, textarea, [contenteditable="true"]');return j&&A(j)?j:null},V=$=>{let j=U($.target);j&&D(j);},z=$=>{if($.pointerType&&$.pointerType!=="touch"&&$.pointerType!=="pen")return;let j=U($.target);j&&D(j);};return document.addEventListener("focusin",V,true),document.addEventListener("pointerdown",z,true),()=>{document.removeEventListener("focusin",V,true),document.removeEventListener("pointerdown",z,true);}},[k]);let g=X.useCallback(L=>{v(A=>A===L?A:L);},[v]),M=X.useCallback(L=>{g(L?"dark":"light");},[g]),E=X.useMemo(()=>N?"#fff":"#000",[N]),S={isDarkMode:N,themeMode:f,isNativeApp:c,isNativeLike:C,isNative:C,extras:m,nativeOverlayContainer:w,setIsDarkMode:M,setThemeMode:g,setNativeApp:u,setNativeOverlayContainer:R};return n(as.Provider,{value:S,children:s(kr,{children:[n(Hi,{color:E,framework:m.framework}),s(Pa,{delayDuration:0,children:[Kt(i==null?void 0:i.show)&&s(rs,{children:[s(is,{...i==null?void 0:i.props,children:[Kt((T=i==null?void 0:i.header)==null?void 0:T.show)&&n(ls,{children:n(us,{children:n(ps,{children:n(ms,{asChild:true,className:"data-[slot=sidebar-menu-button]:!p-1.5",children:"Header"})})})}),Kt((P=i==null?void 0:i.content)==null?void 0:P.show)&&n(ds,{children:(F=i==null?void 0:i.content)==null?void 0:F.children}),Kt((H=i==null?void 0:i.footer)==null?void 0:H.show)&&n(cs,{children:(q=i==null?void 0:i.footer)==null?void 0:q.children})]}),n(ss,{"data-content-layout":i==null?void 0:i.contentLayout,className:l("data-[content-layout=centered]:!mx-auto data-[content-layout=centered]:max-w-screen-2xl","max-[113rem]:peer-data-[variant=inset]:!mr-2 min-[101rem]:peer-data-[variant=inset]:peer-data-[state=collapsed]:!mr-auto"),children:n("div",{className:"h-full p-4 md:p-6",children:e})})]}),!Kt(i==null?void 0:i.show)&&n(jsxRuntime.Fragment,{children:e}),n(ts,{})]})]})})},At=()=>{let e=X.useContext(as);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e},ns=()=>{let{extras:e}=At();return e};var Na=X__namespace.forwardRef(({className:e,...t},o)=>s("svg",{ref:o,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:e,...t,children:[n("path",{d:"M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7Z"}),n("circle",{cx:12,cy:12,r:3})]}));Na.displayName="EyeIcon";var Sa=X__namespace.forwardRef(({className:e,...t},o)=>s("svg",{ref:o,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:e,...t,children:[n("path",{d:"M3.12 3.12 5.3 5.3C3.42 6.78 2 9 2 9s4 7 10 7a9.78 9.78 0 0 0 4.68-1.07l1.92 1.92M9.88 9.88a3 3 0 0 0 4.24 4.24"}),n("path",{d:"M10.73 5.08A9.77 9.77 0 0 1 12 5c6 0 10 7 10 7a16.85 16.85 0 0 1-3.24 4.13"}),n("line",{x1:1,x2:23,y1:1,y2:23})]}));Sa.displayName="EyeOffIcon";var Qe=X__namespace.forwardRef(({className:e,type:t,onFocus:o,...a},r)=>{let i=X__namespace.useCallback(v=>{typeof r=="function"?r(v):r&&(r.current=v);},[r]),c=X__namespace.useCallback(v=>{o==null||o(v),!v.defaultPrevented&&po(v.currentTarget);},[o]),[u,d]=X__namespace.useState(false),b=t!=null?t:"text",m=b==="password",h=m&&u?"text":b;X__namespace.useEffect(()=>{!m&&u&&d(false);},[m,u]);let x=u?"Hide password":"Show password",f=l(yt,"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base transition-colors 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-primary focus-visible:ring-primary/40 focus-visible:ring-0","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",m?"pr-10":void 0,e);return m?s("div",{className:l("relative inline-flex w-full",e),children:[n("input",{ref:i,type:h,"data-slot":"input",onFocus:c,className:f,...a}),m&&n("button",{type:"button",onClick:()=>d(v=>!v),className:"ring-offset-background focus-visible:ring-ring absolute inset-y-0 right-0 flex items-center px-3 text-muted-foreground transition-colors hover:text-foreground focus-visible:rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-1","aria-label":x,"aria-pressed":u,children:u?n(Sa,{"aria-hidden":true,className:"size-4"}):n(Na,{"aria-hidden":true,className:"size-4"})})]}):n("input",{ref:i,type:h,"data-slot":"input",onFocus:c,className:f,...a})});Qe.displayName="Input";var ka=(e,t)=>{if(typeof t=="number"){let o=Math.pow(10,t);return (Math.round(e*o)/o).toString()}return e.toString()},Tp=e=>e==null?"":typeof e=="number"?e.toString():e.trim(),Pp=e=>e===0?/^-?\d*$/:typeof e=="number"?new RegExp(`^-?\\d*(\\.\\d{0,${e}})?$`):/^-?\d*(\.\d*)?$/,Np=e=>e===""||e==="-"||e==="."||e==="-.",Ma=(e,t)=>{if(Np(e))return null;let o=Number(e);if(Number.isNaN(o))return null;if(typeof t=="number"){let a=Math.pow(10,t);return Math.round(o*a)/a}return o},Ea=X__namespace.forwardRef(({value:e,defaultValue:t,onChange:o,min:a,max:r,decimals:i,formatter:c,parser:u,onBlur:d,onFocus:b,inputMode:m,pattern:h,...x},f)=>{let v=X__namespace.useMemo(()=>Pp(i),[i]),p=X__namespace.useMemo(()=>{var T;let S=(T=e!=null?e:t)!=null?T:null;return S===null?"":ka(S,i)},[e,t,i]),[y,w]=X__namespace.useState(p),[R,N]=X__namespace.useState(false);X__namespace.useEffect(()=>{if(e===void 0)return;let S=e===null?"":ka(e,i);w(T=>T===S?T:S);},[e,i]);let C=X__namespace.useCallback(S=>{if(S===null)return null;let T=S;return typeof a=="number"&&(T=Math.max(a,T)),typeof r=="number"&&(T=Math.min(r,T)),T},[a,r]),k=S=>{let T=u?Tp(u(S.target.value)):S.target.value;if(!v.test(T)&&T!=="")return;w(T);let P=Ma(T,i);o==null||o(P);},g=S=>{N(true),b==null||b(S);},M=S=>{N(false);let T=Ma(y,i),P=C(T);if(P===null)y!==""&&(w(""),o==null||o(null));else if(P!==T){let F=ka(P,i);w(F),o==null||o(P);}d==null||d(S);},E=X__namespace.useMemo(()=>{if(R)return y;if(c){let S=Ma(y,i),T=S!=null?S:y===""?null:y;return c(T)}return y},[c,R,y,i]);return n(Qe,{ref:f,value:E,onChange:k,onFocus:g,onBlur:M,inputMode:m!=null?m:i===0?"numeric":"decimal",pattern:h!=null?h:i===0?"-?\\d*":void 0,...x})});Ea.displayName="InputNumeric";var bs="X",Sp=e=>e.replace(/\D/g,""),kp=(e,t)=>e.split("").reduce((o,a)=>a===t?o+1:o,0),Mp=(e,t,o)=>{if(!t)return e;let a="",r=0;for(let i of t)if(i===o)if(r<e.length)a+=e[r],r+=1;else break;else (e.length>0||a.length>0)&&(a+=i);return a},Da=X__namespace.forwardRef(({mask:e,placeholderChar:t=bs,value:o,defaultValue:a,onChange:r,inputMode:i,...c},u)=>{var p;let d=(p=t[0])!=null?p:bs,b=X__namespace.useMemo(()=>kp(e,d),[e,d]),m=X__namespace.useCallback(y=>{if(!y)return "";let w=Sp(y);return b===0?"":w.slice(0,b)},[b]),[h,x]=X__namespace.useState(()=>{var y;return m((y=o!=null?o:a)!=null?y:"")});X__namespace.useEffect(()=>{if(o===void 0)return;let y=m(o);x(w=>w===y?w:y);},[o,m]),X__namespace.useEffect(()=>{o===void 0&&x(y=>m(y));},[e,d,m,o]);let f=y=>{let w=m(y.target.value);o===void 0&&x(w),r==null||r(w);},v=X__namespace.useMemo(()=>Mp(h,e,d),[e,d,h]);return n(Qe,{ref:u,value:v,onChange:f,inputMode:i!=null?i:"numeric",...c})});Da.displayName="InputMask";function yn({...e}){return n(radixUi.Popover.Root,{"data-slot":"popover",...e})}function vs({...e}){return n(radixUi.Popover.Trigger,{"data-slot":"popover-trigger",...e})}function xn({className:e,align:t="center",sideOffset:o=4,...a}){return n(radixUi.Popover.Portal,{children:n(radixUi.Popover.Content,{"data-slot":"popover-content",align:t,sideOffset:o,className:l("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),...a})})}function So({...e}){return n(radixUi.Popover.Anchor,{"data-slot":"popover-anchor",...e})}function wn({...e}){return n(vaul.Drawer.Root,{"data-slot":"drawer",...e})}function ko({...e}){return n(vaul.Drawer.Trigger,{"data-slot":"drawer-trigger",...e})}function Ep({...e}){return n(vaul.Drawer.Portal,{"data-slot":"drawer-portal",...e})}function Mo({...e}){return n(vaul.Drawer.Close,{"data-slot":"drawer-close",...e})}function Dp({className:e,...t}){return n(vaul.Drawer.Overlay,{"data-slot":"drawer-overlay",className:l("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 Rn({className:e,children:t,...o}){return s(Ep,{"data-slot":"drawer-portal",children:[n(Dp,{}),s(vaul.Drawer.Content,{"data-slot":"drawer-content",className:l("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",e),...o,children:[n("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),t]})]})}function Cn({className:e,...t}){return n("div",{"data-slot":"drawer-header",className:l("flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left",e),...t})}function hs({className:e,...t}){return n("div",{"data-slot":"drawer-footer",className:l("mt-auto flex flex-col gap-2 p-4",e),...t})}function Tn({className:e,...t}){return n(vaul.Drawer.Title,{"data-slot":"drawer-title",className:l("text-foreground font-semibold",e),...t})}function uR({className:e,...t}){return n(vaul.Drawer.Description,{"data-slot":"drawer-description",className:l("text-muted-foreground text-sm",e),...t})}var Ha="YYYY-MM-DD",Op=["Su","Mo","Tu","We","Th","Fr","Sa"],Bp=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],La={bottomLeft:{side:"bottom",align:"start"},bottomRight:{side:"bottom",align:"end"},topLeft:{side:"top",align:"start"},topRight:{side:"top",align:"end"}},zp=e=>{var t;return e&&(t=La[e])!=null?t:La.bottomLeft},ws=e=>e?typeof e=="function"?[Ha]:Array.isArray(e)?e:[e]:[Ha],Eo=(e,t)=>{if(!e)return "";if(typeof t=="function")return t(e);let o=ws(t),[a]=o;return e.format(a!=null?a:Ha)},Vp=(e,t)=>{let o=e.trim();if(!o)return null;if(t&&typeof t=="function"){let i=xt(o);return i.isValid()?i:null}let a=ws(t);for(let i of a){let c=wi(o,i);if(c!=null&&c.isValid())return c}let r=xt(o);return r.isValid()?r:null},Ia=(e,t,o)=>{if(!e||!t)return false;switch(o){case "month":return e.isSame(t,"month");case "year":case "decade":return e.isSame(t,"year");default:return e.isSame(t,"day")}},jp=e=>{let t=Math.floor(e.year()/10)*10;return e.year(t).startOf("year")},Do=e=>{let t=jp(e),o=t.add(9,"year").endOf("year");return {start:t,end:o}},Zt=(e,t,o)=>{let a=e;return t&&a.isBefore(t)&&(a=t),o&&a.isAfter(o)&&(a=o),a},Qt=44,Lo=5,ys=40,Aa=6,xs=(e,t)=>t<=0?0:Math.min(Math.max(e,0),t),_a=({label:e,options:t,selectedValue:o,onValueChange:a,open:r,infinite:i=true})=>{let c=X__namespace.useRef(null),u=X__namespace.useRef(null),[d,b]=X__namespace.useState(()=>({start:0,end:Math.min(t.length,Lo+Aa)}));X__namespace.useEffect(()=>{i||b(R=>{if(t.length===0)return {start:0,end:0};let N=t.length-1,C=Math.min(R.start,N),k=Lo+Aa,g=Math.max(C+k,C+1),M=Math.min(t.length,g);return R.start===C&&R.end===M?R:{start:C,end:M}});},[i,t.length]);let m=X__namespace.useCallback(R=>{if(i||t.length===0)return;let N=xs(R,t.length-1),C=Lo+Aa,k=Math.floor(C/2),g=Math.max(0,N-k),M=Math.min(t.length,N+k+1);b(E=>E.start===g&&E.end===M?E:{start:g,end:M});},[i,t.length]),h=X__namespace.useMemo(()=>{if(t.length===0)return [];if(!i)return t;let R=[];for(let N=0;N<ys;N+=1)for(let C of t)R.push(C);return R},[i,t]),x=X__namespace.useCallback((R,N="auto")=>{if(!c.current||t.length===0||h.length===0)return;let C=t.findIndex(S=>S.value===R),k=C>=0?C:0,g=Math.floor(ys/2),E=(i?k+t.length*g:k)*Qt;c.current.scrollTo({top:E,behavior:N}),i||m(k);},[h.length,i,t,m]);X__namespace.useLayoutEffect(()=>{r&&x(o);},[x,r,t,o]),X__namespace.useEffect(()=>{if(i||!r)return;let R=t.findIndex(N=>N.value===o);m(R>=0?R:0);},[i,r,t,o,m]),X__namespace.useEffect(()=>()=>{u.current!==null&&clearTimeout(u.current);},[]);let f=X__namespace.useCallback(R=>{h.length===0||t.length===0||(u.current!==null&&clearTimeout(u.current),u.current=setTimeout(()=>{var g,M;if(!c.current)return;let N=Math.round(c.current.scrollTop/Qt);i||(N=xs(N,h.length-1));let C=h[N];if(!C)return;if(!a(C.value)){x(o,"smooth");return}if(i){let E=t.length,S=h.length-t.length-1;if(N<=E||N>=S)x(C.value);else {let T=N*Qt;(g=c.current)==null||g.scrollTo({top:T});}}else {m(N);let E=N*Qt;(M=c.current)==null||M.scrollTo({top:E});}},80));},[x,h,i,a,t,t.length,o,m]);if(t.length===0)return n("div",{className:"flex-1",children:n("p",{className:"text-center text-sm text-muted-foreground",children:"No options"})});let v=(Lo-1)/2*Qt,p=i?h:t.slice(d.start,d.end),y=d.start*Qt,w=t.length*Qt;return s("div",{className:"flex flex-1 flex-col items-center gap-2",children:[n("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:e}),s("div",{className:"relative h-56 w-full overflow-hidden",children:[n("div",{className:"pointer-events-none absolute inset-x-0 top-1/2 -translate-y-1/2 border-y border-primary/30"}),n("div",{ref:c,onScroll:f,className:"h-56 overflow-y-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",style:{paddingTop:v,paddingBottom:v,WebkitOverflowScrolling:"touch"},children:i?h.map((R,N)=>{let C=`${N}-${R.value}`,k=R.value===o;return n("div",{className:l("flex h-11 items-center justify-center text-base transition-colors",k?"font-medium text-foreground":"text-muted-foreground"),children:R.label},C)}):n("div",{style:{height:w},children:n("div",{style:{transform:`translateY(${y}px)`},children:p.map((R,N)=>{let k=`${d.start+N}-${R.value}`,g=R.value===o;return n("div",{className:l("flex h-11 items-center justify-center text-base transition-colors",g?"font-medium text-foreground":"text-muted-foreground"),children:R.label},k)})})})})]})]})},Up=(e,t)=>e&&e!=="time"?e:t==="month"?"month":t==="year"?"year":"date",Gp=e=>{switch(e){case "month":case "year":return e;case "decade":return "year";default:return "day"}},$p=(e,t,o,a="date")=>{let r=Gp(a);return !(t&&e.isBefore(t,r)||o&&e.isAfter(o,r))},qp=e=>{var t,o,a,r,i,c,u;return {placeholder:(t=e==null?void 0:e.placeholder)!=null?t:"Select date",today:(o=e==null?void 0:e.today)!=null?o:"Today",clear:(a=e==null?void 0:e.clear)!=null?a:"Clear",months:(r=e==null?void 0:e.months)!=null?r:Bp,weekDays:(i=e==null?void 0:e.weekDays)!=null?i:Op,yearFormat:(c=e==null?void 0:e.yearFormat)!=null?c:"YYYY",decadeFormat:(u=e==null?void 0:e.decadeFormat)!=null?u:((d,b)=>`${d.format("YYYY")}-${b.format("YYYY")}`)}},Fa=e=>{let t=X__namespace.useRef(e);return X__namespace.useEffect(()=>{t.current=e;},[e]),t},Wp="hsl(var(--primary))",Oa=X__namespace.forwardRef((e,t)=>{var pr,mr,fr,gr,br,vr,hr;let{value:o,defaultValue:a=null,onChange:r,onOpenChange:i,allowClear:c=true,autoFocus:u=false,defaultOpen:d,disabled:b=false,disabledDate:m,format:h,preserveInvalidOnBlur:x=false,inputReadOnly:f=false,locale:v,minDate:p,maxDate:y,mode:w,needConfirm:R=false,open:N,panelRender:C,picker:k,placeholder:g,placement:M="bottomLeft",prefix:E,presets:S,size:T="middle",status:P,variant:F="outlined",className:H,style:q,inputClassName:L,inputStyle:A,onFocus:O,onBlur:D,name:U,id:V,...z}=e,{isNative:$}=At(),j=rt(),G=$||j,[_,te]=X__namespace.useState(null),K=X__namespace.useMemo(()=>qp(v),[v]),ce=Fa(r),le=Fa(i),re=Fa(h),ge=o!==void 0,[fe,W]=X__namespace.useState(a),ie=(pr=ge?o:fe)!=null?pr:null,pe=X__namespace.useMemo(()=>Up(w,k),[w,k]),[he,Te]=X__namespace.useState(pe),oe=X__namespace.useCallback(I=>{var B;ge||W(I),(B=ce.current)==null||B.call(ce,I,Eo(I,re.current));},[re,ge,ce]),[ne,ye]=X__namespace.useState(ie);X__namespace.useEffect(()=>{ye(ie);},[ie]);let[de,we]=X__namespace.useState(()=>{let I=ie!=null?ie:xt();return Zt(I,p,y)}),Se=N!==void 0,[me,Ie]=X__namespace.useState(!!d),Ne=Se?!!N:me,ke=X__namespace.useCallback(I=>{var B;Se||Ie(I),(B=le.current)==null||B.call(le,I);},[Se,le]),be=R?ne:ie;X__namespace.useEffect(()=>{Ne&&(Te(pe),we(I=>Zt(be!=null?be:I,p,y)));},[be,pe,y,p,Ne]);let[Nt,xe]=X__namespace.useState(()=>Eo(be,re.current)),Ut=X__namespace.useRef(false);X__namespace.useEffect(()=>{Ut.current||xe(Eo(be,re.current));},[be,re]);let We=X__namespace.useMemo(()=>({"--date-primary-color":Wp}),[]),Ht=X__namespace.useRef(null),vt=X__namespace.useCallback(I=>{b||(ke(I),I&&(Te(pe),we(B=>Zt(be!=null?be:B,p,y))));},[be,b,pe,y,p,ke]),Ot=X__namespace.useCallback(I=>Vp(I,re.current),[re]),Le=X__namespace.useCallback((I,B)=>$p(I,p,y,B)?m?m(I,{type:B}):false:true,[m,y,p]),Pe=X__namespace.useCallback(I=>Eo(I,re.current),[re]),Gt=X__namespace.useCallback(I=>{Le(I,"date")||(R?(ye(I),xe(Pe(I))):(oe(I),xe(Pe(I)),ke(false)));},[oe,Pe,Le,R,ke]),nn=I=>{let B=de.month(I);if(we(B),pe==="month"){let Y=B.startOf("month");if(Le(Y,"month"))return;R?(ye(Y),xe(Pe(Y))):(oe(Y),xe(Pe(Y)),ke(false));}else Te("date");},ae=I=>{let B=de.year(I);if(we(B),pe==="year"){let Y=B.startOf("year");if(Le(Y,"year"))return;R?(ye(Y),xe(Pe(Y))):(oe(Y),xe(Pe(Y)),ke(false));}else Te("month");},it=I=>{let B=de.year(I);we(B),Te("year");},Ye=I=>{we(B=>{let Y=I==="date"?B.subtract(1,"month"):I==="month"?B.subtract(1,"year"):B.subtract(10,"year");return Zt(Y,p,y)});},St=I=>{we(B=>{let Y=I==="date"?B.add(1,"month"):I==="month"?B.add(1,"year"):B.add(10,"year");return Zt(Y,p,y)});},qo=()=>{let B=de.startOf("month").startOf("week"),Y=[];for(let Q=0;Q<6;Q+=1){let He=[];for(let tt=0;tt<7;tt+=1){let Me=B.add(Q*7+tt,"day"),kt=Me.month()===de.month()&&Me.year()===de.year(),Fn=Ia(Me,be,"date"),Kl=Me.isSame(xt(),"day"),ea=Le(Me,"date");He.push(n("button",{type:"button",disabled:ea,onClick:()=>Gt(Me),className:l("flex h-8 w-8 items-center justify-center rounded-md text-sm transition",!kt&&"text-muted-foreground/70",Fn&&"bg-[var(--date-primary-color)] text-white",Kl&&!Fn&&"border border-[var(--date-primary-color)]",ea&&"cursor-not-allowed opacity-40",!ea&&!Fn&&"hover:bg-muted"),style:We,children:Me.date()},Me.format("YYYY-MM-DD")));}Y.push(n("div",{className:"grid grid-cols-7 gap-1",children:He},`week-${Q}`));}return s("div",{className:"space-y-1",children:[n("div",{className:"grid grid-cols-7 gap-1 text-center text-xs text-muted-foreground",children:K.weekDays.map(Q=>n("div",{children:Q},Q))}),n("div",{className:"space-y-1",children:Y})]})},ao=()=>n("div",{className:"grid grid-cols-3 gap-2",children:K.months.map((I,B)=>{let Y=de.month(B),Q=Ia(Y,be,"month"),He=Le(Y.startOf("month"),"month");return n("button",{type:"button",disabled:He,onClick:()=>nn(B),className:l("flex h-12 flex-col items-center justify-center rounded-md text-sm transition",Q&&"bg-[var(--date-primary-color)] text-white",He&&"cursor-not-allowed opacity-40",!He&&!Q&&"hover:bg-muted"),style:We,children:I},I)})}),Wo=()=>{let{start:I}=Do(de),B=[];for(let Y=-1;Y<11;Y+=1)B.push(I.year()+Y);return n("div",{className:"grid grid-cols-4 gap-2",children:B.map(Y=>{let Q=de.year(Y),He=Ia(Q,be,"year"),tt=Le(Q.startOf("year"),"year"),Me=Y<I.year()||Y>I.year()+9;return n("button",{type:"button",disabled:tt,onClick:()=>ae(Y),className:l("flex h-12 flex-col items-center justify-center rounded-md text-sm transition",He&&"bg-[var(--date-primary-color)] text-white",tt&&"cursor-not-allowed opacity-40",!tt&&!He&&"hover:bg-muted",Me&&"text-muted-foreground/70"),style:We,children:Y},Y)})})},ro=()=>{let{start:I}=Do(de),B=I.year()-10,Y=[];for(let Q=0;Q<12;Q+=1)Y.push(B+Q*10);return n("div",{className:"grid grid-cols-4 gap-2",children:Y.map(Q=>{let He=Q+9,tt=be==null?void 0:be.year(),Me=tt!==void 0&&tt>=Q&&tt<=He,kt=Le(de.year(Q).startOf("year"),"year"),Fn=He<I.year()||Q>I.year()+9;return s("button",{type:"button",disabled:kt,onClick:()=>it(Q),className:l("flex h-12 flex-col items-center justify-center rounded-md text-sm transition",Me&&"bg-[var(--date-primary-color)] text-white",kt&&"cursor-not-allowed opacity-40",!kt&&!Me&&"hover:bg-muted",Fn&&"text-muted-foreground/70"),style:We,children:[Q,"-",He]},`${Q}-${He}`)})})},Yo=()=>{switch(he){case "month":return ao();case "year":return Wo();case "decade":return ro();default:return qo()}},Ko=I=>{Ut.current=true,xe(I.target.value);},Jo=I=>{O==null||O(I),vt(true);},io=I=>{D==null||D(I);let B=()=>{Ut.current=false;let Y=Ot(Nt);Y&&!Le(Y,"date")?R?(ye(Y),xe(Pe(Y))):(oe(Y),xe(Pe(Y))):x||xe(Pe(be));};typeof window!="undefined"?window.setTimeout(B,50):B();},on=I=>{I==null||I.preventDefault(),I==null||I.stopPropagation(),!b&&(ye(null),we(()=>Zt(xt(),p,y)),R?xe(""):(oe(null),xe(""),ke(false)));},In=()=>{let I=xt();Le(I,"date")||(R?(ye(I),xe(Pe(I))):(oe(I),xe(Pe(I)),ke(false)));},An=()=>{R&&(oe(ne!=null?ne:null),ke(false));},Z=()=>{R&&(ye(ie),xe(Pe(ie)),ke(false));},ue=typeof c=="object"&&c!==null&&!Array.isArray(c)?c:void 0,et=!!c&&!b&&!!Nt,ht=(mr=ue==null?void 0:ue.clearIcon)!=null?mr:n(lucideReact.X,{className:"h-4 w-4",strokeWidth:2}),{side:Xo,align:_l}=zp(M),Fl=(fr={large:"lg",middle:"md",small:"sm"}[T])!=null?fr:"md",Hl={error:{borderColor:"hsl(var(--destructive))","--active-border-color":"hsl(var(--destructive))","--input-active-border-color":"hsl(var(--destructive))"},warning:{borderColor:"var(--warning, hsl(var(--primary)))","--active-border-color":"var(--warning, hsl(var(--primary)))","--input-active-border-color":"var(--warning, hsl(var(--primary)))"}},Ol={outlined:"",borderless:"border-transparent shadow-none focus:border-transparent focus:ring-0 focus:ring-offset-0",filled:"border-transparent bg-muted/60 focus:bg-muted",underlined:"border-x-0 border-t-0 rounded-none focus:ring-offset-0"},Bl={...P?Hl[P]:{},...A!=null?A:{}},zl={sm:"h-8 text-sm",md:`${yt} text-sm`,lg:"h-11 text-base"},Vl={error:"border-destructive focus-visible:border-destructive focus-visible:ring-destructive/30",warning:"border-yellow-500 focus-visible:border-yellow-500 focus-visible:ring-yellow-500/30"},rr=s("div",{className:"w-[280px] select-none",role:"dialog","aria-modal":"true",children:[s("div",{className:"flex items-center justify-between px-2 pt-2",children:[s("div",{className:"flex items-center gap-1",children:[n("button",{type:"button",className:"flex h-8 w-8 items-center justify-center rounded-md hover:bg-muted",onClick:()=>Ye(he==="date"?"month":he==="month"?"year":"decade"),children:n(lucideReact.ChevronsLeft,{className:"h-4 w-4"})}),he==="date"&&n("button",{type:"button",className:"flex h-8 w-8 items-center justify-center rounded-md hover:bg-muted",onClick:()=>Ye("date"),children:n(lucideReact.ChevronLeft,{className:"h-4 w-4"})})]}),n("div",{className:"flex flex-col items-center",children:s("button",{type:"button",className:"text-sm font-medium hover:text-[var(--date-primary-color)]",style:We,onClick:()=>{he==="date"?Te("month"):he==="month"?Te("year"):he==="year"&&Te("decade");},children:[he==="date"&&`${K.months[de.month()]} ${de.format(K.yearFormat)}`,he==="month"&&de.format(K.yearFormat),he==="year"&&(()=>{let{start:I,end:B}=Do(de);return K.decadeFormat(I,B)})(),he==="decade"&&(()=>{let{start:I,end:B}=Do(de);return `${I.subtract(10,"year").format(K.yearFormat)}-${B.add(10,"year").format(K.yearFormat)}`})()]})}),s("div",{className:"flex items-center gap-1",children:[he==="date"&&n("button",{type:"button",className:"flex h-8 w-8 items-center justify-center rounded-md hover:bg-muted",onClick:()=>St("date"),children:n(lucideReact.ChevronRight,{className:"h-4 w-4"})}),n("button",{type:"button",className:"flex h-8 w-8 items-center justify-center rounded-md hover:bg-muted",onClick:()=>St(he==="date"?"month":he==="month"?"year":"decade"),children:n(lucideReact.ChevronsRight,{className:"h-4 w-4"})})]})]}),n("div",{className:"px-2 pb-2 pt-3",children:Yo()}),s("div",{className:"flex items-center justify-between gap-2 border-t px-2 py-2",children:[n("div",{className:"flex flex-wrap items-center gap-2",children:S==null?void 0:S.map((I,B)=>{let Y=typeof I.value=="function"?I.value():I.value,Q=Y?Le(Y,"date"):false;return n("button",{type:"button",disabled:Q,onClick:()=>{!Y||Q||(R?(ye(Y),xe(Pe(Y))):(oe(Y),xe(Pe(Y)),ke(false)));},className:l("rounded-md px-2 py-1 text-xs transition",Q?"cursor-not-allowed bg-muted text-muted-foreground":"bg-muted hover:bg-muted/80"),children:I.label},B)})}),s("div",{className:"flex items-center gap-2",children:[n("button",{type:"button",onClick:In,className:"text-xs font-medium text-[var(--date-primary-color)] hover:underline disabled:text-muted-foreground",disabled:Le(xt(),"date"),style:We,children:K.today}),R?s("div",{className:"flex items-center gap-2",children:[n("button",{type:"button",className:"rounded-md px-2 py-1 text-xs hover:bg-muted",onClick:Z,children:K.clear}),n("button",{type:"button",className:"rounded-md bg-[var(--date-primary-color)] px-2 py-1 text-xs font-medium text-white hover:opacity-90",style:We,onClick:An,children:"OK"})]}):n("button",{type:"button",className:"rounded-md px-2 py-1 text-xs hover:bg-muted",onClick:I=>on(I),disabled:!ie,children:K.clear})]})]})]}),jl=C?C(rr):rr;X__namespace.useEffect(()=>{if(!u)return;let I=()=>{var B;(B=Ht.current)==null||B.focus();};typeof window!="undefined"?window.setTimeout(I,0):I();},[u]),X__namespace.useImperativeHandle(t,()=>Ht.current);let Ul=!b&&(f||G),ir=s("div",{role:"combobox","aria-expanded":Ne,"aria-haspopup":"dialog",className:l("relative w-full",H),style:q,children:[E&&n("div",{className:"pointer-events-none absolute inset-y-0 left-3 flex items-center text-muted-foreground",children:E}),n(Qe,{...z,ref:Ht,value:Nt,onChange:Ko,onFocus:Jo,onBlur:io,autoFocus:u,readOnly:f||G,disabled:b,placeholder:g!=null?g:K.placeholder,name:U,id:V,className:l("pr-10 text-sm",Ol[F],E&&"pl-10",b&&"cursor-not-allowed opacity-60",Ul&&"cursor-pointer",zl[Fl],P?Vl[P]:void 0,L),style:Bl,onClick:I=>{var B;(B=z.onClick)==null||B.call(z,I),!b&&G&&vt(true);}}),et&&n("button",{type:"button",className:"absolute inset-y-0 right-8 flex items-center text-muted-foreground transition hover:text-foreground",onMouseDown:I=>{I.preventDefault(),I.stopPropagation();},onClick:I=>on(I),children:ht}),n("div",{className:"pointer-events-none absolute inset-y-0 right-3 flex items-center text-muted-foreground",children:n(lucideReact.Calendar,{className:"h-4 w-4"})})]}),_n=X__namespace.useMemo(()=>{var B,Y;return ((Y=R?(B=ne!=null?ne:ie)!=null?B:de:be!=null?be:de)!=null?Y:xt()).clone()},[be,ne,R,ie,de]),Gl=X__namespace.useMemo(()=>K.months.map((I,B)=>({label:I,value:B})),[K.months]),sr=_n.daysInMonth(),$l=X__namespace.useMemo(()=>Array.from({length:sr},(I,B)=>({label:String(B+1).padStart(2,"0"),value:B+1})),[sr]),lr=_n.year(),cr=(gr=p==null?void 0:p.year())!=null?gr:lr-100,dr=(br=y==null?void 0:y.year())!=null?br:lr+100,Zo=Math.min(cr,dr),ur=Math.max(cr,dr),ql=X__namespace.useMemo(()=>Array.from({length:ur-Zo+1},(I,B)=>{let Y=Zo+B;return {label:String(Y),value:Y}}),[ur,Zo]),Qo=X__namespace.useCallback((I,B)=>{var He,tt;let Q=(tt=R?(He=ne!=null?ne:ie)!=null?He:de:ie!=null?ie:de)!=null?tt:xt();if(I==="month"){let Me=Q.month(B),kt=Math.min(Q.date(),Me.daysInMonth());Q=Me.date(kt);}else if(I==="date"){let Me=Math.min(B,Q.daysInMonth());Q=Q.date(Me);}else {let Me=Q.year(B),kt=Math.min(Q.date(),Me.daysInMonth());Q=Me.date(kt);}return Q=Zt(Q,p,y),Le(Q,"date")?false:(R?(ye(Q),xe(Pe(Q))):(oe(Q),xe(Pe(Q))),we(Q),true)},[oe,ne,Pe,Le,y,p,R,ie,we,de]),Wl=(hr=(vr=typeof z["aria-label"]=="string"?z["aria-label"]:void 0)!=null?vr:g)!=null?hr:K.placeholder,Yl=X__namespace.useCallback(I=>{vt(I);},[vt]);if(X__namespace.useEffect(()=>{var B,Y;if(!G||!Ne||!V||typeof document=="undefined")return;te(null);let I=document.querySelector(`label[for="${V}"]`);I&&te((Y=(B=I.textContent)==null?void 0:B.trim())!=null?Y:null);},[V,Ne,G]),G){let I=_!=null?_:Wl;return s(wn,{open:Ne,onOpenChange:Yl,children:[n(ko,{asChild:true,children:ir}),s(Rn,{className:"mt-10 max-h-[min(540px,calc(100dvh-6rem))] rounded-t-3xl bg-background",children:[n(Cn,{className:"px-6 pb-2 pt-4",children:n(Tn,{className:"text-base font-medium text-foreground",children:I})}),s("div",{className:"flex flex-1 flex-col gap-6 px-6 pb-6",children:[s("div",{className:"flex gap-4",children:[n(_a,{open:Ne,label:"Month",options:Gl,selectedValue:_n.month(),onValueChange:B=>Qo("month",B)}),n(_a,{open:Ne,label:"Day",options:$l,selectedValue:_n.date(),onValueChange:B=>Qo("date",B)}),n(_a,{open:Ne,label:"Year",options:ql,selectedValue:_n.year(),onValueChange:B=>Qo("year",B),infinite:false})]}),s("div",{className:"mt-auto flex items-center justify-between",children:[n(J,{type:"button",variant:"ghost",size:"sm",className:"text-[var(--date-primary-color)] hover:bg-[var(--date-primary-color)]/10 focus-visible:ring-[var(--date-primary-color)]/30",style:We,onClick:In,children:K.today}),s("div",{className:"flex items-center gap-3",children:[c?n(J,{type:"button",variant:"outline",size:"sm",className:"text-muted-foreground hover:text-foreground",onClick:B=>on(B),children:K.clear}):null,R?s(jsxRuntime.Fragment,{children:[n(J,{type:"button",variant:"ghost",size:"sm",className:"hover:bg-muted",onClick:Z,children:"Cancel"}),n(J,{type:"button",variant:"default",size:"sm",className:"bg-[var(--date-primary-color)] text-white hover:opacity-90 focus-visible:ring-[var(--date-primary-color)]/30",style:We,onClick:An,children:"OK"})]}):n(Mo,{asChild:true,children:n(J,{type:"button",variant:"default",size:"sm",className:"bg-[var(--date-primary-color)] text-white hover:opacity-90 focus-visible:ring-[var(--date-primary-color)]/30",style:We,children:"Done"})})]})]})]})]})]})}return s(yn,{open:Ne,onOpenChange:vt,children:[n(So,{asChild:true,children:ir}),n(xn,{className:"w-auto border border-border bg-popover p-0",align:_l,side:Xo,children:jl})]})});Oa.displayName="DatePicker";function Rs({...e}){return n(radixUi.DropdownMenu.Root,{"data-slot":"dropdown-menu",...e})}function kR({...e}){return n(radixUi.DropdownMenu.Portal,{"data-slot":"dropdown-menu-portal",...e})}var Ba=X__namespace.forwardRef(({...e},t)=>n(radixUi.DropdownMenu.Trigger,{ref:t,"data-slot":"dropdown-menu-trigger",...e}));Ba.displayName=radixUi.DropdownMenu.Trigger.displayName;var za=X__namespace.forwardRef(({className:e,sideOffset:t=4,...o},a)=>n(radixUi.DropdownMenu.Portal,{children:n(radixUi.DropdownMenu.Content,{ref:a,"data-slot":"dropdown-menu-content",sideOffset:t,className:l("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) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...o})}));za.displayName=radixUi.DropdownMenu.Content.displayName;function MR({...e}){return n(radixUi.DropdownMenu.Group,{"data-slot":"dropdown-menu-group",...e})}function ER({className:e,inset:t,variant:o="default",...a}){return n(radixUi.DropdownMenu.Item,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":o,className:l("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 cursor-default 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),...a})}function Cs({className:e,children:t,checked:o,...a}){return s(radixUi.DropdownMenu.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:l("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:o,...a,children:[n("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:n(radixUi.DropdownMenu.ItemIndicator,{children:n(lucideReact.CheckIcon,{className:"size-4"})})}),t]})}function DR({...e}){return n(radixUi.DropdownMenu.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...e})}function LR({className:e,children:t,...o}){return s(radixUi.DropdownMenu.RadioItem,{"data-slot":"dropdown-menu-radio-item",className:l("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),...o,children:[n("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:n(radixUi.DropdownMenu.ItemIndicator,{children:n(lucideReact.CircleIcon,{className:"size-2 fill-current"})})}),t]})}function Ts({className:e,inset:t,...o}){return n(radixUi.DropdownMenu.Label,{"data-slot":"dropdown-menu-label","data-inset":t,className:l("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...o})}function Ps({className:e,...t}){return n(radixUi.DropdownMenu.Separator,{"data-slot":"dropdown-menu-separator",className:l("bg-border -mx-1 my-1 h-px",e),...t})}function IR({className:e,...t}){return n("span",{"data-slot":"dropdown-menu-shortcut",className:l("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}function AR({...e}){return n(radixUi.DropdownMenu.Sub,{"data-slot":"dropdown-menu-sub",...e})}var Xp=X__namespace.forwardRef(({className:e,inset:t,children:o,...a},r)=>s(radixUi.DropdownMenu.SubTrigger,{ref:r,"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:l("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),...a,children:[o,n(lucideReact.ChevronRightIcon,{className:"ml-auto size-4"})]}));Xp.displayName=radixUi.DropdownMenu.SubTrigger.displayName;var Zp=X__namespace.forwardRef(({className:e,...t},o)=>n(radixUi.DropdownMenu.SubContent,{ref:o,"data-slot":"dropdown-menu-sub-content",className:l("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}));Zp.displayName=radixUi.DropdownMenu.SubContent.displayName;var Qp=({children:e,...t})=>n("form",{...t,children:e});var Kn=({className:e,...t})=>n("p",{"data-slot":"form-description",className:l("text-muted-foreground text-sm",e),...t});Kn.displayName="FormDescription";var Jn=({className:e,...t})=>{let o=t.children;return o?n("p",{"data-slot":"form-message",className:l("text-destructive text-sm",e),...t,children:o}):null};Jn.displayName="FormMessage";var Xn=({className:e,...t})=>n(De,{"data-slot":"form-label",className:e,...t});Xn.displayName="FormLabel";var em=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange?e:(t=e.form)!=null?t:e},tm=({name:e,label:t,description:o,className:a,checked:r,defaultChecked:i,onCheckedChange:c,checkboxProps:u,error:d,form:b,rules:m})=>{var S,T;let{onCheckedChange:h,...x}=u!=null?u:{},f=em(b),v=f==null?void 0:f.values,p=f==null?void 0:f.errors,y=f==null?void 0:f.touched,w=v==null?void 0:v[e],R=p==null?void 0:p[e],N=y==null?void 0:y[e],C=(S=f==null?void 0:f.validationSequence)!=null?S:0,k=(T=N?R:void 0)!=null?T:d,g=w!==void 0?!!w:r!==void 0?r:void 0,M=P=>{var L,A,O;let F=P===true,q=!!m?Ns(F,m):void 0;if((L=f==null?void 0:f.setFieldError)==null||L.call(f,e,q),(A=f==null?void 0:f.setFieldValue)==null||A.call(f,e,F),(O=f==null?void 0:f.setFieldTouched)==null||O.call(f,e,true),f!=null&&f.handleChange){let D={target:{name:e,value:F,checked:F}};f.handleChange(D);}c==null||c(F),h==null||h(P);},E=X__namespace.useRef(C);return X__namespace.useEffect(()=>{let P=!!m,F=C!==E.current;if(!(f!=null&&f.setFieldError)||!P){E.current=C;return}if(!N&&!F){E.current=C;return}let q=Ns(w!==void 0?!!w:r!==void 0?r:!!i,m);q!==R&&f.setFieldError(e,q),E.current=C;},[r,i,R,N,w,e,f,m,C]),s("div",{className:l("items-start gap-2",a),children:[s("div",{className:"flex items-start gap-3",children:[n("div",{children:n(jn,{name:e,...x,...g!==void 0?{checked:g}:{defaultChecked:i},"aria-invalid":!!k,onCheckedChange:M})}),s("div",{className:"grid gap-1.5 leading-none",children:[t?n(Xn,{className:"text-sm font-medium leading-none",children:t}):null,o?n(Kn,{children:o}):null]})]}),n(Jn,{children:k})]})};tm.displayName="FormCheckbox";function Ns(e,t){if(t){if(t.required&&!e)return typeof t.required=="string"?t.required:"This field is required";if(t.validate){let o=t.validate(e);if(typeof o=="string")return o;if(o===false)return "Invalid value"}}}var nm={row:"flex-row","row-reverse":"flex-row-reverse",column:"flex-col","column-reverse":"flex-col-reverse"},om={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},am={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},Ao={nowrap:"flex-nowrap",wrap:"flex-wrap","wrap-reverse":"flex-wrap-reverse"},_o={none:{all:"gap-0",x:"gap-x-0",y:"gap-y-0"},xs:{all:"gap-1",x:"gap-x-1",y:"gap-y-1"},sm:{all:"gap-2",x:"gap-x-2",y:"gap-y-2"},md:{all:"gap-3",x:"gap-x-3",y:"gap-y-3"},lg:{all:"gap-4",x:"gap-x-4",y:"gap-y-4"},xl:{all:"gap-6",x:"gap-x-6",y:"gap-y-6"},"2xl":{all:"gap-8",x:"gap-x-8",y:"gap-y-8"}},Va={..._o,small:_o.sm,middle:_o.md,large:_o.lg},rm=X__namespace.forwardRef(({direction:e,vertical:t,align:o,justify:a,wrap:r=false,gap:i,gapX:c,gapY:u,inline:d=false,className:b,children:m,...h},x)=>{var p;let f=e!=null?e:t?"column":"row",v=typeof r=="boolean"?r?Ao.wrap:Ao.nowrap:(p=Ao[r])!=null?p:Ao.nowrap;return n("div",{ref:x,"data-slot":"flex",className:l(d?"inline-flex":"flex",nm[f],o?om[o]:null,a?am[a]:null,v,i?Va[i].all:null,c?Va[c].x:null,u?Va[u].y:null,b),...h,children:m})});rm.displayName="Flex";function lC({...e}){return n(radixUi.HoverCard.Root,{"data-slot":"hover-card",...e})}function cC({...e}){return n(radixUi.HoverCard.Trigger,{"data-slot":"hover-card-trigger",...e})}function dC({className:e,align:t="center",sideOffset:o=4,...a}){return n(radixUi.HoverCard.Portal,{"data-slot":"hover-card-portal",children:n(radixUi.HoverCard.Content,{"data-slot":"hover-card-content",align:t,sideOffset:o,className:l("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-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...a})})}function bC({className:e,containerClassName:t,...o}){return n(inputOtp.OTPInput,{"data-slot":"input-otp",containerClassName:l("flex items-center gap-2 has-disabled:opacity-50",t),className:l("disabled:cursor-not-allowed",e),...o})}function vC({className:e,...t}){return n("div",{"data-slot":"input-otp-group",className:l("flex items-center",e),...t})}function hC({index:e,className:t,...o}){var u;let a=X__namespace.useContext(inputOtp.OTPInputContext),{char:r,hasFakeCaret:i,isActive:c}=(u=a==null?void 0:a.slots[e])!=null?u:{};return s("div",{"data-slot":"input-otp-slot","data-active":c,className:l("data-[active=true]:border-primary data-[active=true]:ring-primary/40 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",t),...o,children:[r,i&&n("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:n("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function yC({...e}){return n("div",{"data-slot":"input-otp-separator",role:"separator",...e,children:n(lucideReact.MinusIcon,{})})}function De({className:e,...t}){return n(radixUi.Label.Root,{"data-slot":"label",className:l("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function MC({className:e,...t}){return n(radixUi.Menubar.Root,{"data-slot":"menubar",className:l("bg-background flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs",e),...t})}function EC({...e}){return n(radixUi.Menubar.Menu,{"data-slot":"menubar-menu",...e})}function DC({...e}){return n(radixUi.Menubar.Group,{"data-slot":"menubar-group",...e})}function mm({...e}){return n(radixUi.Menubar.Portal,{"data-slot":"menubar-portal",...e})}function LC({...e}){return n(radixUi.Menubar.RadioGroup,{"data-slot":"menubar-radio-group",...e})}function IC({className:e,...t}){return n(radixUi.Menubar.Trigger,{"data-slot":"menubar-trigger",className:l("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none",e),...t})}function AC({className:e,align:t="start",alignOffset:o=-4,sideOffset:a=8,...r}){return n(mm,{children:n(radixUi.Menubar.Content,{"data-slot":"menubar-content",align:t,alignOffset:o,sideOffset:a,className:l("bg-popover text-popover-foreground data-[state=open]:animate-in 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-[12rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-md",e),...r})})}function _C({className:e,inset:t,variant:o="default",...a}){return n(radixUi.Menubar.Item,{"data-slot":"menubar-item","data-inset":t,"data-variant":o,className:l("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 cursor-default 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),...a})}function FC({className:e,children:t,checked:o,...a}){return s(radixUi.Menubar.CheckboxItem,{"data-slot":"menubar-checkbox-item",className:l("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs 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:o,...a,children:[n("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:n(radixUi.Menubar.ItemIndicator,{children:n(lucideReact.CheckIcon,{className:"size-4"})})}),t]})}function HC({className:e,children:t,...o}){return s(radixUi.Menubar.RadioItem,{"data-slot":"menubar-radio-item",className:l("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs 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),...o,children:[n("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:n(radixUi.Menubar.ItemIndicator,{children:n(lucideReact.CircleIcon,{className:"size-2 fill-current"})})}),t]})}function OC({className:e,inset:t,...o}){return n(radixUi.Menubar.Label,{"data-slot":"menubar-label","data-inset":t,className:l("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...o})}function BC({className:e,...t}){return n(radixUi.Menubar.Separator,{"data-slot":"menubar-separator",className:l("bg-border -mx-1 my-1 h-px",e),...t})}function zC({className:e,...t}){return n("span",{"data-slot":"menubar-shortcut",className:l("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}function VC({...e}){return n(radixUi.Menubar.Sub,{"data-slot":"menubar-sub",...e})}function jC({className:e,inset:t,children:o,...a}){return s(radixUi.Menubar.SubTrigger,{"data-slot":"menubar-sub-trigger","data-inset":t,className:l("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-none select-none data-[inset]:pl-8",e),...a,children:[o,n(lucideReact.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]})}function UC({className:e,...t}){return n(radixUi.Menubar.SubContent,{"data-slot":"menubar-sub-content",className:l("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-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",e),...t})}var fm="relative isolate overflow-hidden rounded-md bg-muted text-transparent",gm="after:absolute after:inset-0 after:-translate-x-full after:animate-[shimmer_1.6s_linear_infinite] after:bg-gradient-to-r after:from-transparent after:via-foreground/10 after:to-transparent after:content-['']",Oo=X__namespace.forwardRef(({className:e,...t},o)=>n("div",{ref:o,"data-slot":"skeleton",className:l(fm,gm,e),...t}));Oo.displayName="Skeleton";var Ms=X__namespace.forwardRef(({className:e,...t},o)=>n(Oo,{ref:o,className:l("h-9 w-32 rounded-md",e),...t}));Ms.displayName="Skeleton.Button";var Es=X__namespace.forwardRef(({className:e,...t},o)=>n(Oo,{ref:o,className:l("h-9 w-full rounded-md",e),...t}));Es.displayName="Skeleton.Input";var gt=Object.assign(Oo,{Button:Ms,Input:Es});var vm={sm:"sm:max-w-sm",md:"sm:max-w-lg",lg:"sm:max-w-2xl",xl:"sm:max-w-3xl"},hm=s("div",{className:"space-y-3","aria-hidden":true,children:[n(gt,{className:"h-4 w-2/3"}),n(gt,{className:"h-4 w-full"}),n(gt,{className:"h-4 w-5/6"}),n(gt,{className:"h-4 w-3/4"})]}),ym=e=>{switch(e){case "destructive":return "destructive";case "default":return "outline";case "primary":default:return "default"}},xm=({title:e,description:t,closable:o=true,className:a,classNames:r,loading:i=false,maskClosable:c=false,style:u,footer:d,onOk:b,onCancel:m,children:h,onOpenChange:x,size:f="md",...v})=>{var E,S,T,P,F,H,q;let p={show:(E=d==null?void 0:d.show)!=null?E:true,render:d==null?void 0:d.render,onOk:d==null?void 0:d.onOk,onCancel:d==null?void 0:d.onCancel,showOk:(S=d==null?void 0:d.showOk)!=null?S:true,showCancel:(T=d==null?void 0:d.showCancel)!=null?T:true,okText:(P=d==null?void 0:d.okText)!=null?P:"Save changes",cancelText:(F=d==null?void 0:d.cancelText)!=null?F:"Cancel",okLoading:d==null?void 0:d.okLoading,cancelLoading:d==null?void 0:d.cancelLoading,okDisabled:d==null?void 0:d.okDisabled,cancelDisabled:(H=d==null?void 0:d.cancelDisabled)!=null?H:d==null?void 0:d.cancelDisable,okType:d==null?void 0:d.okType,okButtonProps:d==null?void 0:d.okButtonProps,cancelButtonProps:d==null?void 0:d.cancelButtonProps,size:(q=d==null?void 0:d.size)!=null?q:"default"},y=X__namespace.useCallback(()=>{var L;(L=p.onCancel)==null||L.call(p),m==null||m();},[p.onCancel,m]),w=X__namespace.useCallback(()=>{var L;(L=p.onOk)==null||L.call(p),b==null||b();},[p.onOk,b]),R=X__namespace.useCallback(L=>{L||y(),x==null||x(L);},[y,x]),N=X__namespace.useCallback(L=>{c||L.preventDefault();},[c]),C=X__namespace.useCallback(L=>{o||L.preventDefault();},[o]),k=l(vm[f],a,r==null?void 0:r.content),g=n(framerMotion.AnimatePresence,{mode:"wait",children:i?n(framerMotion.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.18,ease:"easeInOut"},className:l("space-y-4",r==null?void 0:r.body),children:hm},"modal-loading"):n(framerMotion.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.18,ease:"easeInOut"},className:l("space-y-3 text-sm text-muted-foreground",r==null?void 0:r.body),"aria-busy":i,children:h},"modal-content")}),M=()=>{var le,re,ge,fe,W,ie,pe,he,Te,oe;if(!p.show)return null;if(p.render)return n("div",{className:l("mt-2",r==null?void 0:r.footer),children:p.render});if(!p.showOk&&!p.showCancel)return null;let{onClick:L,variant:A,size:O,loading:D,disabled:U,...V}=(le=p.okButtonProps)!=null?le:{},{onClick:z,variant:$,size:j,loading:G,disabled:_,...te}=(re=p.cancelButtonProps)!=null?re:{},K=ne=>{L==null||L(ne),!ne.defaultPrevented&&w();},ce=ne=>{z==null||z(ne),!ne.defaultPrevented&&y();};return n("div",{className:l("mt-4",r==null?void 0:r.footer),children:s("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",children:[p.showCancel?n(J,{variant:$!=null?$:"outline",size:j!=null?j:p.size,loading:(fe=(ge=p.cancelLoading)!=null?ge:G)!=null?fe:false,disabled:(ie=(W=p.cancelDisabled)!=null?W:_)!=null?ie:false,...te,onClick:ce,children:p.cancelText}):null,p.showOk?n(J,{variant:A!=null?A:ym(p.okType),size:O!=null?O:p.size,loading:(he=(pe=p.okLoading)!=null?pe:D)!=null?he:false,disabled:(oe=(Te=p.okDisabled)!=null?Te:U)!=null?oe:false,...V,onClick:K,children:p.okText}):null]})})};return n(mn,{...v,onOpenChange:R,children:n(fn,{showCloseButton:o,className:k,style:u,onInteractOutside:N,onEscapeKeyDown:C,children:s(framerMotion.motion.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},transition:{duration:.2,ease:"easeOut"},className:"flex flex-col gap-4",children:[(e||t)&&s(gn,{className:r==null?void 0:r.header,children:[e?n(bn,{className:r==null?void 0:r.title,children:e}):null,t?n(vn,{className:r==null?void 0:r.description,children:t}):null]}),g,M()]})})})};xm.displayName="Modal";function en({open:e,onOpenChange:t,title:o,children:a,footer:r,footerClassName:i,contentClassName:c,disableContentWrapper:u=false,options:d,selectedValues:b,onSelect:m,isMulti:h=false}){let x=y=>{m==null||m(y),h||t(false);},f=y=>h&&Array.isArray(b)?b.includes(y):b===y,v=()=>d?n("div",{className:"max-h-[75vh] overflow-y-auto",children:d.map(y=>s("button",{className:l("w-full flex items-center justify-between px-4 py-4 text-left transition-colors","min-h-[50px] h-auto",y.disabled?"opacity-50 cursor-not-allowed":"hover:bg-accent active:bg-accent/80",f(y.value)&&"bg-accent"),onClick:()=>!y.disabled&&x(y.value),disabled:y.disabled,children:[n("span",{className:"flex-1",children:y.label}),f(y.value)&&n(lucideReact.CheckIcon,{className:"h-4 w-4 text-primary flex-shrink-0 ml-2"})]},y.value))}):null,p=u?a:n("div",{className:l(c),children:a});return n(wn,{open:e,onOpenChange:t,direction:"bottom",children:s(Rn,{className:"p-0 pb-4 rounded-t-2xl border-t bg-background",children:[o?n(Cn,{className:"px-4 pb-2 pt-4 text-left border-b",children:typeof o=="string"||typeof o=="number"?n(Tn,{children:o}):o}):null,d?v():p,r?n(hs,{className:l("border-border/60 border-t px-4 pt-3",i),children:r}):null]})})}var Rm={floating:{label:"Floating Glow",description:"Glassmorphism-inspired bar with a floating circular highlight around the active tab."},pill:{label:"Soft Pill",description:"Rounded pill navigation with a smooth capsule indicator that slides beneath the active item."},minimal:{label:"Minimal Line",description:"Lightweight footer that focuses on iconography with a subtle underline transition."},curved:{label:"Curved Wave",description:"Playful curved dock that mimics native device docks with a spotlighted active state."}},lT=Object.keys(Rm),Cm=()=>{},Ua=X__namespace.forwardRef(({items:e,value:t,defaultValue:o,onChange:a=Cm,className:r,variant:i="floating",forceLabels:c=false,...u},d)=>{let[b,m]=X__namespace.useState(()=>{var T,P;return t!==void 0?t:o||((P=(T=e[0])==null?void 0:T.value)!=null?P:"")}),h=t!==void 0,x=h?t:b;X__namespace.useEffect(()=>{var P;if(!e.length)return;if(!e.some(F=>F.value===x)){let F=(P=e[0])==null?void 0:P.value;if(!F)return;h||m(F),a(F);}},[e,x,h,a]);let f=X__namespace.useCallback(T=>{T!==x&&(h||m(T),a(T));},[h,a,x]);if(!e.length)return null;let v=Math.max(e.findIndex(T=>T.value===x),0),p=100/e.length,y=X__namespace.useMemo(()=>{let P=p/2;return {width:72,height:72,left:`calc(${p}% * ${v} + ${P}% - ${72/2}px)`}},[v,p]),w=X__namespace.useMemo(()=>({width:`calc((100% / ${e.length}) - 0.75rem)`,left:`calc((100% / ${e.length}) * ${v} + 0.375rem)`}),[v,e.length]),R=X__namespace.useMemo(()=>({width:`calc((100% / ${e.length}) * 0.6)`,left:`calc((100% / ${e.length}) * ${v} + (100% / ${e.length}) * 0.2)`}),[v,e.length]),N=X__namespace.useMemo(()=>{let P=p/2;return {width:64,height:64,left:`calc(${p}% * ${v} + ${P}%)`}},[v,p]),C=()=>{switch(i){case "floating":return n("span",{"aria-hidden":true,style:y,className:"pointer-events-none absolute -top-7 z-0 rounded-full bg-primary/25 blur-2xl transition-[left] duration-500 ease-out"});case "pill":return n("span",{"aria-hidden":true,style:w,className:"pointer-events-none absolute inset-y-2 z-0 rounded-full border border-primary/20 bg-primary/10 shadow-inner transition-[left] duration-500 ease-out"});case "minimal":return n("span",{"aria-hidden":true,style:R,className:"pointer-events-none absolute bottom-1 left-0 h-1 rounded-full bg-primary transition-[left] duration-500 ease-out"});case "curved":return n("span",{"aria-hidden":true,style:N,className:"pointer-events-none absolute -top-6 z-0 -translate-x-1/2 rounded-full border border-primary/20 bg-primary/20 shadow-[0_12px_30px_-15px_rgba(59,130,246,0.65)] transition-[left] duration-500 ease-out"});default:return null}},k=T=>{switch(i){case "floating":return l("group relative z-10 flex flex-1 flex-col items-center gap-1 rounded-2xl px-2 pb-1 pt-3 text-[0.7rem] font-medium transition-all duration-300 ease-out",T?"text-primary":"text-muted-foreground");case "pill":return l("group relative z-10 flex flex-1 items-center justify-center gap-2 rounded-full px-3 text-sm font-medium transition-all duration-300 ease-out",T?"text-primary":"text-muted-foreground");case "minimal":return l("group relative flex flex-1 flex-col items-center gap-1 rounded-2xl px-2 py-2 text-[0.7rem] font-medium transition-all duration-300 ease-out",T?"text-primary":"text-muted-foreground/80");case "curved":return l("group relative z-10 flex flex-1 flex-col items-center gap-1 rounded-2xl px-3 pb-2 pt-5 text-[0.7rem] font-medium transition-all duration-300 ease-out",T?"text-primary":"text-muted-foreground/90");default:return ""}},g=T=>{switch(i){case "floating":return l("flex size-12 items-center justify-center rounded-full border border-border/50 bg-muted/60 text-base transition-all duration-300 ease-out",T?"scale-100 border-primary/40 bg-primary text-primary-foreground shadow-lg shadow-primary/30":"scale-95 text-muted-foreground");case "pill":return l("flex size-9 items-center justify-center rounded-full text-base transition-all duration-300 ease-out",T?"bg-primary text-primary-foreground shadow-lg shadow-primary/30":"bg-transparent text-muted-foreground");case "minimal":return l("flex size-10 items-center justify-center rounded-full text-base transition-all duration-300 ease-out",T?"scale-105 bg-primary/10 text-primary":"scale-95 text-muted-foreground/80");case "curved":return l("flex size-12 items-center justify-center rounded-full border border-border/60 bg-muted/70 text-base transition-all duration-300 ease-out",T?"-translate-y-3 border-primary/40 bg-primary text-primary-foreground shadow-xl shadow-primary/40":"translate-y-0 text-muted-foreground");default:return ""}},M=T=>{let P="transition-all duration-300 ease-out";switch(i){case "floating":return l(P,T?"translate-y-0 opacity-100":"translate-y-[2px] opacity-90",c?"block":"");case "pill":return l(P,"text-xs",T?"opacity-100":"opacity-90");case "minimal":return l(P,"text-xs",T||c?"opacity-100":"opacity-0");case "curved":return l(P,"text-xs",T||c?"opacity-100":"opacity-0 group-hover:opacity-80");default:return P}},E=(T,P)=>T?n("span",{className:l("pointer-events-none absolute -right-0.5 -top-0.5 min-w-4 rounded-full bg-destructive px-1.5 text-[10px] font-semibold leading-none text-destructive-foreground shadow-sm",P?"scale-105":"scale-100 opacity-95"),children:T}):null,S=()=>{switch(i){case "floating":return s("div",{className:"relative isolate flex h-24 w-full items-end rounded-[26px] border border-border/40 bg-card/90 px-4 pb-3 pt-5 shadow-[0_20px_40px_-24px_rgba(15,23,42,0.35)] backdrop-blur-xl",children:[C(),e.map(T=>{let P=T.value===x;return s("button",{type:"button",className:k(P),onClick:()=>f(T.value),"data-active":P?"true":void 0,"aria-pressed":P,"aria-current":P?"page":void 0,"aria-label":T.label,children:[s("span",{className:"relative",children:[n("span",{className:g(P),children:T.icon}),E(T.badge,P)]}),(P||c)&&T.label?n("span",{className:M(P),children:T.label}):T.label&&!c?n("span",{className:l(M(P),"sr-only"),children:T.label}):null]},T.value)})]});case "pill":return s("div",{className:"relative isolate flex h-20 w-full items-center rounded-full border border-border/40 bg-card/95 px-2 shadow-[0_24px_50px_-24px_rgba(15,23,42,0.45)] backdrop-blur",children:[C(),e.map(T=>{let P=T.value===x;return s("button",{type:"button",className:k(P),onClick:()=>f(T.value),"data-active":P?"true":void 0,"aria-pressed":P,"aria-current":P?"page":void 0,"aria-label":T.label,children:[s("span",{className:"relative flex items-center gap-2",children:[n("span",{className:g(P),children:T.icon}),(P||c)&&T.label?n("span",{className:M(P),children:T.label}):null]}),E(T.badge,P)]},T.value)})]});case "minimal":return s("div",{className:"relative isolate flex h-[4.5rem] w-full items-center justify-between rounded-3xl border border-border/30 bg-background/60 px-4 py-3 shadow-[0_18px_35px_-24px_rgba(15,23,42,0.35)]",children:[C(),e.map(T=>{let P=T.value===x;return s("button",{type:"button",className:k(P),onClick:()=>f(T.value),"data-active":P?"true":void 0,"aria-pressed":P,"aria-current":P?"page":void 0,"aria-label":T.label,children:[s("span",{className:"relative",children:[n("span",{className:g(P),children:T.icon}),E(T.badge,P)]}),(P||c)&&T.label?n("span",{className:M(P),children:T.label}):null]},T.value)})]});case "curved":return s("div",{className:"relative isolate flex h-28 w-full items-end justify-center",children:[n("div",{className:"absolute inset-x-3 bottom-0 h-20 rounded-t-[36px] border border-border/35 bg-card/95 shadow-[0_-30px_45px_-28px_rgba(15,23,42,0.55)]"}),s("div",{className:"relative z-10 flex h-24 w-[92%] items-end justify-between px-5 pb-4 pt-6",children:[C(),e.map(T=>{let P=T.value===x;return s("button",{type:"button",className:k(P),onClick:()=>f(T.value),"data-active":P?"true":void 0,"aria-pressed":P,"aria-current":P?"page":void 0,"aria-label":T.label,children:[s("span",{className:"relative",children:[n("span",{className:g(P),children:T.icon}),E(T.badge,P)]}),(P||c)&&T.label?n("span",{className:M(P),children:T.label}):null]},T.value)})]})]});default:return null}};return n("nav",{ref:d,className:l("relative flex w-full justify-center",r),...u,children:S()})});Ua.displayName="MobileFooter";var Tm={hero:{label:"Hero Spotlight",description:"Immersive header with a leading action row, large title block, and optional hero media thumbnail."},stories:{label:"Stories Carousel",description:"Horizontal story rail with rounded action chips that mimic social media story pickers."},minimal:{label:"Minimal Bar",description:"Compact navigation bar with centered title and contextual leading/trailing actions."},search:{label:"Search Hub",description:"Two-line header with quick actions and an inline search field anchored by an avatar trigger."}},pT=Object.keys(Tm),Pm=()=>{},Nm=()=>s("svg",{"aria-hidden":true,viewBox:"0 0 24 24",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[n("circle",{cx:11,cy:11,r:7}),n("path",{d:"m20 20-3-3"})]}),Zn=(e,t=false)=>e?n("span",{className:l("pointer-events-none absolute -right-0.5 -top-0.5 min-w-4 rounded-full bg-destructive px-1.5 text-[10px] font-semibold leading-none text-destructive-foreground shadow-sm",t?"scale-105":"scale-100"),children:e}):null,Ga=X__namespace.forwardRef(({title:e,subtitle:t,supportingText:o,heroBadge:a,heroMedia:r,heroImage:i,heroAlt:c,leadingAction:u,trailingActions:d,trailingContent:b,stories:m,searchPlaceholder:h,searchValue:x,defaultSearchValue:f,onSearchChange:v=Pm,searchIcon:p,variant:y="hero",className:w,children:R,...N},C)=>{let[k,g]=X__namespace.useState(()=>f!=null?f:""),M=x!==void 0,E=M?x:k,S=X__namespace.useCallback(D=>{let U=D.target.value;M||g(U),v(U);},[M,v]),T=(D,U)=>{var V,z,$;return D?s("button",{type:"button",onClick:D.onClick,"aria-label":(z=(V=D.ariaLabel)!=null?V:D.label)!=null?z:D.value,className:"relative inline-flex size-10 items-center justify-center rounded-full border border-border/50 bg-background/80 text-base font-medium text-foreground shadow-[0_8px_24px_-18px_rgba(59,130,246,0.8)] transition-transform duration-200 ease-out hover:-translate-y-0.5",children:[n("span",{className:"pointer-events-none text-lg",children:($=D.icon)!=null?$:D.label}),Zn(D.badge)]},D.value):U?n("span",{className:"size-10","aria-hidden":true},U):null},P=D=>{var U,V,z;return D?s("button",{type:"button",onClick:D.onClick,"aria-label":(V=(U=D.ariaLabel)!=null?U:D.label)!=null?V:D.value,className:"relative inline-flex size-10 items-center justify-center rounded-full border border-border/40 bg-card/80 text-base text-foreground shadow-sm transition-colors duration-200 ease-out hover:bg-card",children:[n("span",{className:"pointer-events-none text-lg",children:(z=D.icon)!=null?z:D.label}),Zn(D.badge)]},D.value):null},F=D=>{var U,V,z;return D?s("button",{type:"button",onClick:D.onClick,"aria-label":(V=(U=D.ariaLabel)!=null?U:D.label)!=null?V:D.value,className:"relative inline-flex size-10 items-center justify-center rounded-full text-base text-muted-foreground transition-colors duration-200 ease-out hover:text-foreground",children:[n("span",{className:"pointer-events-none text-lg",children:(z=D.icon)!=null?z:D.label}),Zn(D.badge)]},D.value):null},H=D=>{var U,V,z;return s("button",{type:"button",onClick:D.onClick,"aria-label":(V=(U=D.ariaLabel)!=null?U:D.label)!=null?V:D.value,className:"group relative flex w-24 shrink-0 flex-col items-center gap-2 rounded-2xl border border-border/40 bg-card/60 px-3 py-3 text-center shadow-[0_12px_30px_-22px_rgba(59,130,246,0.45)] transition-all duration-300 ease-out hover:-translate-y-1 hover:border-primary/40",children:[s("span",{className:"relative inline-flex size-14 items-center justify-center overflow-hidden rounded-full border border-border/40 bg-background/80 text-lg text-foreground shadow-sm",children:[(z=D.icon)!=null?z:D.label,Zn(D.badge,true)]}),D.label?n("span",{className:"text-xs font-medium text-foreground transition-colors group-hover:text-primary",children:D.label}):null,D.description?n("span",{className:"text-[11px] text-muted-foreground transition-opacity group-hover:opacity-90",children:D.description}):null]},D.value)},q=()=>s("div",{className:"relative isolate w-full overflow-hidden rounded-[28px] border border-border/30 bg-gradient-to-br from-background/95 via-background/90 to-background/70 px-5 pb-6 pt-5 shadow-[0_28px_60px_-35px_rgba(15,23,42,0.55)] backdrop-blur",children:[n("div",{className:"pointer-events-none absolute inset-0 -z-10 bg-[radial-gradient(circle_at_top,_rgba(59,130,246,0.18),_transparent_55%)]"}),s("div",{className:"flex items-center justify-between",children:[T(u!=null?u:null,"hero-leading-placeholder"),n("div",{className:"flex items-center gap-2",children:d==null?void 0:d.map(D=>T(D))})]}),s("div",{className:"mt-7 flex items-end justify-between gap-6",children:[s("div",{className:"space-y-3",children:[a?n("span",{className:"inline-flex items-center gap-2 rounded-full border border-primary/20 bg-primary/10 px-3 py-1 text-xs font-medium text-primary",children:a}):null,e?n("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:e}):null,t?n("p",{className:"text-sm text-muted-foreground",children:t}):null,o?n("p",{className:"text-xs text-muted-foreground/90",children:o}):null]}),n("div",{className:"shrink-0",children:r?n("div",{className:"relative h-24 w-24 overflow-hidden rounded-2xl border border-border/40 shadow-[0_24px_40px_-28px_rgba(59,130,246,0.75)]",children:r}):i?n("div",{className:"relative h-24 w-24 overflow-hidden rounded-2xl border border-border/40 shadow-[0_24px_40px_-28px_rgba(59,130,246,0.75)]",children:n("img",{src:i,alt:c!=null?c:"",className:"size-full object-cover"})}):null})]}),R?n("div",{className:"mt-6",children:R}):null]}),L=()=>{var D;return s("div",{className:"relative isolate w-full overflow-hidden rounded-[26px] border border-border/35 bg-background/90 px-4 pb-5 pt-4 shadow-[0_24px_50px_-35px_rgba(15,23,42,0.55)]",children:[s("div",{className:"flex items-center justify-between gap-3",children:[s("div",{className:"flex items-center gap-3",children:[u?s("div",{className:"flex items-center gap-2 rounded-full border border-border/40 bg-card/80 px-3 py-1.5 text-sm font-medium text-foreground shadow-sm",children:[n("span",{className:"text-base",children:(D=u.icon)!=null?D:u.label}),u.label?n("span",{children:u.label}):null]}):null,e?n("h2",{className:"text-lg font-semibold text-foreground",children:e}):null]}),n("div",{className:"flex items-center gap-2",children:d==null?void 0:d.map(U=>F(U))})]}),t?n("p",{className:"mt-2 text-sm text-muted-foreground",children:t}):null,n("div",{className:"mt-4 flex gap-3 overflow-x-auto pb-1",children:m==null?void 0:m.map(U=>H(U))}),R?n("div",{className:"mt-4",children:R}):null]})},A=()=>s("div",{className:"relative isolate flex h-16 w-full items-center gap-3 rounded-[22px] border border-border/40 bg-background/95 px-2 shadow-[0_18px_35px_-28px_rgba(15,23,42,0.45)]",children:[n("div",{className:"flex items-center",children:u?P(u):n("span",{className:"size-10","aria-hidden":true})}),s("div",{className:"flex flex-1 flex-col items-center justify-center text-center",children:[t?n("span",{className:"text-[11px] uppercase tracking-[0.18em] text-muted-foreground",children:t}):null,e?n("span",{className:"text-base font-semibold text-foreground",children:e}):null]}),n("div",{className:"flex items-center gap-2",children:b!=null?b:d==null?void 0:d.map(D=>P(D))})]}),O=()=>{var D,U,V;return s("div",{className:"relative isolate w-full overflow-hidden rounded-[26px] border border-border/35 bg-background/95 px-4 pb-5 pt-4 shadow-[0_26px_54px_-34px_rgba(15,23,42,0.55)]",children:[s("div",{className:"flex items-start justify-between gap-4",children:[s("div",{className:"space-y-1",children:[t?n("span",{className:"text-[11px] uppercase tracking-[0.18em] text-muted-foreground",children:t}):null,e?n("h2",{className:"text-lg font-semibold text-foreground",children:e}):null,o?n("p",{className:"text-xs text-muted-foreground/90",children:o}):null]}),n("div",{className:"flex items-center gap-2",children:d==null?void 0:d.map(z=>F(z))})]}),s("div",{className:"mt-4 flex items-center gap-3",children:[u?s("button",{type:"button",onClick:u.onClick,"aria-label":(U=(D=u.ariaLabel)!=null?D:u.label)!=null?U:u.value,className:"relative inline-flex size-12 items-center justify-center rounded-full border border-border/40 bg-card/80 text-base text-foreground shadow-sm",children:[n("span",{className:"pointer-events-none text-lg",children:(V=u.icon)!=null?V:u.label}),Zn(u.badge)]}):null,s("div",{className:"relative flex-1",children:[n("span",{className:"pointer-events-none absolute inset-y-0 left-3 flex items-center",children:p!=null?p:n(Nm,{})}),n("input",{type:"search",value:E,onChange:S,placeholder:h,className:"h-12 w-full rounded-full border border-border/40 bg-card/70 pl-10 pr-4 text-sm text-foreground shadow-inner shadow-primary/5 outline-none transition focus:border-primary/40 focus:bg-card"})]})]}),R?n("div",{className:"mt-4",children:R}):null]})};return n("header",{ref:C,className:l("relative flex w-full justify-center",w),...N,children:(()=>{switch(y){case "hero":return q();case "stories":return L();case "minimal":return A();case "search":return O();default:return null}})()})});Ga.displayName="MobileHeader";function Ds(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t);}function Ls(...e){return t=>{let o=false,a=e.map(r=>{let i=Ds(r,t);return !o&&typeof i=="function"&&(o=true),i});if(o)return ()=>{for(let r=0;r<a.length;r++){let i=a[r];typeof i=="function"?i():Ds(e[r],null);}}}}function km(e){let t=Mm(e),o=X__namespace.forwardRef((a,r)=>{let{children:i,...c}=a,u=X__namespace.Children.toArray(i),d=u.find(Dm);if(d){let b=d.props.children,m=u.map(h=>h===d?X__namespace.Children.count(b)>1?X__namespace.Children.only(null):X__namespace.isValidElement(b)?b.props.children:null:h);return jsxRuntime.jsx(t,{...c,ref:r,children:X__namespace.isValidElement(b)?X__namespace.cloneElement(b,void 0,m):null})}return jsxRuntime.jsx(t,{...c,ref:r,children:i})});return o.displayName=`${e}.Slot`,o}var As=km("Slot");function Mm(e){let t=X__namespace.forwardRef((o,a)=>{let{children:r,...i}=o;if(X__namespace.isValidElement(r)){let c=Im(r),u=Lm(i,r.props);return r.type!==X__namespace.Fragment&&(u.ref=a?Ls(a,c):c),X__namespace.cloneElement(r,u)}return X__namespace.Children.count(r)>1?X__namespace.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Em=Symbol("radix.slottable");function Dm(e){return X__namespace.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Em}function Lm(e,t){let o={...t};for(let a in t){let r=e[a],i=t[a];/^on[A-Z]/.test(a)?r&&i?o[a]=(...u)=>{let d=i(...u);return r(...u),d}:r&&(o[a]=r):a==="style"?o[a]={...r,...i}:a==="className"&&(o[a]=[r,i].filter(Boolean).join(" "));}return {...e,...o}}function Im(e){var a,r;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}var Am=["top","right","bottom","left"],Bo=(e,t)=>e.includes(t)?`env(safe-area-inset-${t})`:void 0,zo=X__namespace.forwardRef(({edges:e=Am,asChild:t,className:o,style:a,...r},i)=>{var u,d,b,m;return n(t?As:"div",{ref:i,className:l("relative",o),style:{paddingTop:(u=a==null?void 0:a.paddingTop)!=null?u:Bo(e,"top"),paddingRight:(d=a==null?void 0:a.paddingRight)!=null?d:Bo(e,"right"),paddingBottom:(b=a==null?void 0:a.paddingBottom)!=null?b:Bo(e,"bottom"),paddingLeft:(m=a==null?void 0:a.paddingLeft)!=null?m:Bo(e,"left"),...a},...r})});zo.displayName="SafeArea";var Fm=({header:e,footer:t,children:o,className:a,safeArea:r})=>{var E,S,T,P,F;let{header:i,navigateBack:c,canGoBack:u}=Si(),d=X__namespace.useMemo(()=>{let H=[];return r.top&&H.push("top"),r.left&&H.push("left"),r.right&&H.push("right"),H},[r.top,r.left,r.right]),b=X__namespace.useMemo(()=>{let H=[];return r.bottom&&H.push("bottom"),r.left&&H.push("left"),r.right&&H.push("right"),H},[r.bottom,r.left,r.right]),m=X__namespace.useCallback(()=>{if(u){c();return}typeof window!="undefined"&&window.history.back();},[u,c]),h=(E=i.back)!=null?E:u,x=X__namespace.useMemo(()=>{if(h)return {value:"mobile-header-back",icon:n(lucideReact.ArrowLeft,{className:"size-5","aria-hidden":true}),ariaLabel:"Go back",onClick:m};if(i.icon)return {value:"mobile-header-icon",icon:i.icon}},[h,i.icon,m]),{show:f=true,className:v,variant:p,type:y}=e,w=(P=(T=(S=i.variant)!=null?S:p)!=null?T:y)!=null?P:"hero",{show:R=true,activeKey:N,onChange:C,...k}=t,g=(F=k.value)!=null?F:N,M=X__namespace.useCallback(H=>{C==null||C(H);},[C]);return s("div",{className:l("flex min-h-svh w-full flex-col bg-background",a),children:[f&&n("div",{className:"sticky top-0 z-20 bg-background",children:n(zo,{edges:d,className:"bg-background",children:n(Ga,{variant:w,className:v,title:i.title,subtitle:i.subtitle,supportingText:i.supportingText,heroBadge:i.heroBadge,leadingAction:x,trailingContent:i.actions})})}),n("div",{className:"flex-1 overflow-y-auto bg-muted/10",children:o}),R&&n("div",{className:"sticky bottom-0 z-20 bg-background",children:n(zo,{edges:b,className:"bg-background px-4 pb-4 pt-2",children:n(Ua,{...k,value:g,onChange:M})})})]})},Hm=({header:e={show:true},footer:t={show:true,items:[]},children:o,className:a,safeArea:r={top:true,bottom:true,left:true,right:true}})=>n(Ni,{children:n(Fm,{header:e,footer:t,className:a,safeArea:r,children:o})});function OT({className:e,children:t,viewport:o=true,...a}){return s(radixUi.NavigationMenu.Root,{"data-slot":"navigation-menu","data-viewport":o,className:l("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",e),...a,children:[t,o&&n(Vm,{})]})}function BT({className:e,...t}){return n(radixUi.NavigationMenu.List,{"data-slot":"navigation-menu-list",className:l("group flex flex-1 list-none items-center justify-center gap-1",e),...t})}function zT({className:e,...t}){return n(radixUi.NavigationMenu.Item,{"data-slot":"navigation-menu-item",className:l("relative",e),...t})}var zm=classVarianceAuthority.cva("group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-primary/40 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1");function VT({className:e,children:t,...o}){return s(radixUi.NavigationMenu.Trigger,{"data-slot":"navigation-menu-trigger",className:l(zm(),"group",e),...o,children:[t," ",n(lucideReact.ChevronDownIcon,{className:"relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180","aria-hidden":"true"})]})}function jT({className:e,...t}){return n(radixUi.NavigationMenu.Content,{"data-slot":"navigation-menu-content",className:l("data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto","group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none",e),...t})}function Vm({className:e,...t}){return n("div",{className:l("absolute top-full left-0 isolate z-50 flex justify-center"),children:n(radixUi.NavigationMenu.Viewport,{"data-slot":"navigation-menu-viewport",className:l("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",e),...t})})}function UT({className:e,...t}){return n(radixUi.NavigationMenu.Link,{"data-slot":"navigation-menu-link",className:l("data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-primary/40 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",e),...t})}function GT({className:e,...t}){return n(radixUi.NavigationMenu.Indicator,{"data-slot":"navigation-menu-indicator",className:l("data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden",e),...t,children:n("div",{className:"bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md"})})}function XT({className:e,...t}){return n("nav",{role:"navigation","aria-label":"pagination","data-slot":"pagination",className:l("mx-auto flex w-full justify-center",e),...t})}function ZT({className:e,...t}){return n("ul",{"data-slot":"pagination-content",className:l("flex flex-row items-center gap-1",e),...t})}function QT({...e}){return n("li",{"data-slot":"pagination-item",...e})}function Fs({className:e,isActive:t,size:o="icon",...a}){return n("a",{"aria-current":t?"page":void 0,"data-slot":"pagination-link","data-active":t,className:l(Mt({variant:t?"outline":"ghost",size:o}),e),...a})}function eP({className:e,...t}){return s(Fs,{"aria-label":"Go to previous page",size:"default",className:l("gap-1 px-2.5 sm:pl-2.5",e),...t,children:[n(lucideReact.ChevronLeftIcon,{}),n("span",{className:"hidden sm:block",children:"Previous"})]})}function tP({className:e,...t}){return s(Fs,{"aria-label":"Go to next page",size:"default",className:l("gap-1 px-2.5 sm:pr-2.5",e),...t,children:[n("span",{className:"hidden sm:block",children:"Next"}),n(lucideReact.ChevronRightIcon,{})]})}function nP({className:e,...t}){return s("span",{"aria-hidden":true,"data-slot":"pagination-ellipsis",className:l("flex size-9 items-center justify-center",e),...t,children:[n(lucideReact.MoreHorizontalIcon,{className:"size-4"}),n("span",{className:"sr-only",children:"More pages"})]})}function sP({className:e,value:t,...o}){return n(radixUi.Progress.Root,{"data-slot":"progress",className:l("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",e),...o,children:n(radixUi.Progress.Indicator,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})})}function Os({className:e,...t}){return n(radixUi.RadioGroup.Root,{"data-slot":"radio-group",className:l("grid gap-3",e),...t})}function Bs({className:e,...t}){return n(radixUi.RadioGroup.Item,{"data-slot":"radio-group-item",className:l("border-input text-primary focus-visible:border-primary focus-visible:ring-primary/40 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:n(radixUi.RadioGroup.Indicator,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:n(lucideReact.CircleIcon,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function vP({className:e,...t}){return n(Sn__namespace.PanelGroup,{"data-slot":"resizable-panel-group",className:l("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t})}function hP({...e}){return n(Sn__namespace.Panel,{"data-slot":"resizable-panel",...e})}function yP({withHandle:e,className:t,...o}){return n(Sn__namespace.PanelResizeHandle,{"data-slot":"resizable-handle",className:l("bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...o,children:e&&n("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:n(lucideReact.GripVerticalIcon,{className:"size-2.5"})})})}function It({className:e,children:t,...o}){return s(radixUi.ScrollArea.Root,{"data-slot":"scroll-area",className:l("relative",e),...o,children:[n(radixUi.ScrollArea.Viewport,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-primary/40 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),n(Wm,{}),n(radixUi.ScrollArea.Corner,{})]})}function Wm({className:e,orientation:t="vertical",...o}){return n(radixUi.ScrollArea.ScrollAreaScrollbar,{"data-slot":"scroll-area-scrollbar",orientation:t,className:l("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...o,children:n(radixUi.ScrollArea.ScrollAreaThumb,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}var Vs=X__namespace.createContext(void 0);function qa(){let e=X__namespace.useContext(Vs);if(!e)throw new Error("useNativeSelectContext must be used within a Select component");return e}function Jm({open:e,defaultOpen:t,onOpenChange:o,children:a,...r}){let{isNative:i}=At(),c=rt(),u=i||c,[d,b]=X__namespace.useState(t!=null?t:false),m=e!=null?e:d,h=X__namespace.useCallback(f=>{e===void 0&&b(f),o==null||o(f);},[e,o]),x=X__namespace.useMemo(()=>({isNative:u,open:m,setOpen:h,closeOnSelect:true}),[u,m,h]);return n(Vs.Provider,{value:x,children:n(radixUi.Select.Root,{"data-slot":"select",open:m,onOpenChange:h,...r,children:a})})}function Xm({className:e,size:t="default",children:o,...a}){let{isNative:r,open:i,setOpen:c}=qa();return s(radixUi.Select.Trigger,{"data-slot":"select-trigger","data-size":t,onClick:u=>{r&&(u.preventDefault(),u.stopPropagation(),c(!i));},className:l(yt,"border-input flex w-full items-center gap-2 rounded-md border bg-transparent px-3 py-2 text-sm transition-colors cursor-pointer","data-[state=open]:border-primary focus-visible:ring-0 data-[state=open]:ring-0",e),...a,children:[n("span",{className:"flex-1 min-w-0 text-left [&_[data-slot=select-value]]:min-w-0 [&_[data-slot=select-value]]:flex [&_[data-slot=select-value]]:flex-1 [&_[data-slot=select-value]]:truncate",children:o}),n(radixUi.Select.Icon,{className:"pointer-events-none shrink-0 text-muted-foreground",children:n(lucideReact.ChevronDownIcon,{className:"size-4"})})]})}function Zm({className:e,children:t,position:o="popper",title:a,...r}){let i=qa();return n(radixUi.Select.Portal,{children:n(radixUi.Select.Content,{"data-slot":"select-content",className:l(i.isNative?"fixed inset-x-0 bottom-0 z-[9999] rounded-t-2xl border-t bg-background":"bg-popover text-popover-foreground relative z-50 rounded-md border",e),position:o,...r,children:i.isNative?n(en,{open:i.open,onOpenChange:i.setOpen,title:a,disableContentWrapper:true,children:n(radixUi.Select.Viewport,{className:"max-h-[75vh] overflow-y-auto",children:t})}):s(jsxRuntime.Fragment,{children:[n(ef,{}),n(radixUi.Select.Viewport,{className:"p-1",children:t}),n(tf,{})]})})})}function Qm({className:e,children:t,onSelect:o,...a}){let r=qa(),i=X__namespace.useCallback(c=>{o==null||o(c),r.isNative&&r.closeOnSelect&&!c.defaultPrevented&&setTimeout(()=>{r.setOpen(false);});},[r,o]);return s(radixUi.Select.Item,{"data-slot":"select-item",onSelect:i,className:l("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm select-none",e),...a,children:[n("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:n(radixUi.Select.ItemIndicator,{children:n(lucideReact.CheckIcon,{className:"size-4"})})}),n(radixUi.Select.ItemText,{children:t})]})}function ef({className:e,...t}){return n(radixUi.Select.ScrollUpButton,{className:l("flex items-center justify-center py-1",e),...t,children:n(lucideReact.ChevronUpIcon,{className:"size-4"})})}function tf({className:e,...t}){return n(radixUi.Select.ScrollDownButton,{className:l("flex items-center justify-center py-1",e),...t,children:n(lucideReact.ChevronDownIcon,{className:"size-4"})})}function nf({className:e,...t}){return n(radixUi.Select.Value,{"data-slot":"select-value",className:l("flex-1 min-w-0 truncate text-left data-[placeholder]:text-muted-foreground",e),...t})}function Vo({options:e,placeholder:t="Select an option",triggerProps:o,contentProps:a,...r}){let i=o!=null?o:{},c=a!=null?a:{};return s(Jm,{...r,children:[n(Xm,{...i,children:n(nf,{placeholder:t})}),n(Zm,{...c,children:e.map(u=>{var d,b;return n(Qm,{value:u.value,disabled:u.disabled,className:u.className,children:(b=u.label)!=null?b:u.value},(d=u.key)!=null?d:u.value)})})]})}var Wa=()=>{},js=X__namespace.createContext({isNative:false,selectedValues:[],setSelectedValues:Wa,toggleValue:Wa,isSelected:()=>false,open:false,setOpen:Wa});function jo(){return X__namespace.useContext(js)}function Us({value:e,defaultValue:t=[],onValueChange:o,open:a,defaultOpen:r,onOpenChange:i,children:c}){let{isNative:u}=At(),d=rt(),b=u||d,[m,h]=X__namespace.useState(t),[x,f]=X__namespace.useState(r!=null?r:false);X__namespace.useEffect(()=>{e!==void 0&&h(e);},[e]),X__namespace.useEffect(()=>{a!==void 0&&f(a);},[a]);let v=e!=null?e:m,p=a!=null?a:x,y=X__namespace.useCallback(g=>{let M=typeof g=="function"?g(v):g;e===void 0&&h(M),o==null||o(M);},[o,v,e]),w=X__namespace.useCallback(g=>{y(M=>M.includes(g)?M.filter(E=>E!==g):[...M,g]);},[y]),R=X__namespace.useCallback(g=>v.includes(g),[v]),N=X__namespace.useCallback(g=>{a===void 0&&f(g),i==null||i(g);},[i,a]),C=X__namespace.useMemo(()=>({isNative:b,selectedValues:v,setSelectedValues:y,toggleValue:w,isSelected:R,open:p,setOpen:N}),[b,p,N,v,y,w,R]),k=b?c:n(yn,{open:p,onOpenChange:N,children:c});return n(js.Provider,{value:C,children:k})}function Gs({className:e,children:t,disabled:o,onClick:a,...r}){let i=jo(),c=X__namespace.useCallback(d=>{a==null||a(d),i.isNative&&!o&&i.setOpen(!i.open);},[i,o,a]),u=s("button",{type:"button","data-slot":"multi-select-trigger","data-state":i.open?"open":"closed",className:l(yt,"border-input focus-visible:border-primary focus-visible:ring-primary/40 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 relative flex w-full min-w-0 items-center gap-2 rounded-md border bg-transparent py-2 pl-3 pr-9 text-sm transition-colors outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),"aria-haspopup":"listbox","aria-expanded":i.open,disabled:o,onClick:c,...r,children:[n("span",{className:"flex-1 min-w-0 text-left",children:t}),n(lucideReact.ChevronDownIcon,{className:"pointer-events-none absolute right-3 top-1/2 size-4 -translate-y-1/2 opacity-50"})]});return i.isNative?u:n(vs,{asChild:true,children:u})}function $s({placeholder:e="Select options",className:t,separator:o=", ",formatValue:a}){let{selectedValues:r,isNative:i}=jo(),c=X__namespace.useMemo(()=>a?a(r):r.length===0?e:i?r.map(u=>n($t,{variant:"secondary",children:u},u)):r.join(o),[a,i,e,r,o]);return n("span",{"data-slot":"multi-select-value",className:l("flex min-h-4 flex-wrap items-center gap-1 text-sm",r.length===0&&"text-muted-foreground",t),children:c})}function qs({className:e,title:t,children:o,commandClassName:a,showSearch:r=false,searchPlaceholder:i="Search...",emptyMessage:c="No options found.",sideOffset:u=4,align:d="start",...b}){let m=jo(),h=s(ga,{className:l("w-full",a),children:[r?n(mi,{placeholder:i}):null,s(fi,{children:[c!==null?n(gi,{children:c}):null,o]})]});return m.isNative?n(en,{open:m.open,onOpenChange:m.setOpen,title:t,contentClassName:l("px-2 pb-2",e),footer:n(J,{type:"button",variant:"outline",onClick:()=>m.setOpen(false),children:"Close"}),children:h}):n(xn,{"data-slot":"multi-select-content",className:l("w-64 p-0",e),sideOffset:u,align:d,...b,children:h})}function Ws({value:e,children:t,className:o,disabled:a,...r}){let i=jo(),c=i.isSelected(e);return s(bi,{...r,value:e,onSelect:()=>{a||i.toggleValue(e);},"data-slot":"multi-select-item",disabled:a,className:l("gap-2",o),children:[n("span",{className:"flex size-4 items-center justify-center",children:n(lucideReact.CheckIcon,{className:l("size-4",c?"opacity-100":"opacity-0")})}),n("span",{children:t})]})}function Co({className:e,orientation:t="horizontal",decorative:o=true,...a}){return n(radixUi.Separator.Root,{"data-slot":"separator",decorative:o,orientation:t,className:l("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),...a})}function Ys({...e}){return n(radixUi.Dialog.Root,{"data-slot":"sheet",...e})}function ZP({...e}){return n(radixUi.Dialog.Trigger,{"data-slot":"sheet-trigger",...e})}function QP({...e}){return n(radixUi.Dialog.Close,{"data-slot":"sheet-close",...e})}function lf({...e}){return n(radixUi.Dialog.Portal,{"data-slot":"sheet-portal",...e})}function cf({className:e,...t}){return n(radixUi.Dialog.Overlay,{"data-slot":"sheet-overlay",className:l("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 Ks({className:e,children:t,side:o="right",...a}){return s(lf,{children:[n(cf,{}),s(radixUi.Dialog.Content,{"data-slot":"sheet-content",className:l("bg-background fixed z-50 flex flex-col gap-4 shadow-lg outline-none transition-transform ease-in-out data-[state=open]:duration-300 data-[state=closed]:duration-200",o==="right"&&"inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm data-[state=closed]:translate-x-full data-[state=open]:translate-x-0",o==="left"&&"inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm data-[state=closed]:-translate-x-full data-[state=open]:translate-x-0",o==="top"&&"inset-x-0 top-0 h-auto border-b data-[state=closed]:-translate-y-full data-[state=open]:translate-y-0",o==="bottom"&&"inset-x-0 bottom-0 h-auto border-t data-[state=closed]:translate-y-full data-[state=open]:translate-y-0",e),...a,children:[t,s(radixUi.Dialog.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[n(lucideReact.XIcon,{className:"size-4"}),n("span",{className:"sr-only",children:"Close"})]})]})]})}function Js({className:e,...t}){return n("div",{"data-slot":"sheet-header",className:l("flex flex-col gap-1.5 p-4",e),...t})}function eN({className:e,...t}){return n("div",{"data-slot":"sheet-footer",className:l("mt-auto flex flex-col gap-2 p-4",e),...t})}function Xs({className:e,...t}){return n(radixUi.Dialog.Title,{"data-slot":"sheet-title",className:l("text-foreground font-semibold",e),...t})}function Zs({className:e,...t}){return n(radixUi.Dialog.Description,{"data-slot":"sheet-description",className:l("text-muted-foreground text-sm",e),...t})}function Pa({delayDuration:e=0,...t}){return n(radixUi.Tooltip.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Qs({...e}){return n(Pa,{children:n(radixUi.Tooltip.Root,{"data-slot":"tooltip",...e})})}function el({...e}){return n(radixUi.Tooltip.Trigger,{"data-slot":"tooltip-trigger",...e})}function tl({className:e,sideOffset:t=0,children:o,...a}){return n(radixUi.Tooltip.Portal,{children:s(radixUi.Tooltip.Content,{"data-slot":"tooltip-content",sideOffset:t,className:l("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),...a,children:[o,n(radixUi.Tooltip.Arrow,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}var pf="sidebar_state",mf=3600*24*7,ff="16rem",gf="18rem",bf="3rem",vf="b",nl=X__namespace.createContext(null);function to(){let e=X__namespace.useContext(nl);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function rs({defaultOpen:e=true,open:t,onOpenChange:o,className:a,style:r,children:i,...c}){let u=rt(),[d,b]=X__namespace.useState(false),[m,h]=X__namespace.useState(e),x=t!=null?t:m,f=X__namespace.useCallback(w=>{let R=typeof w=="function"?w(x):w;o?o(R):h(R),document.cookie=`${pf}=${R}; path=/; max-age=${mf}`;},[o,x]),v=X__namespace.useCallback(()=>u?b(w=>!w):f(w=>!w),[u,f,b]);X__namespace.useEffect(()=>{let w=R=>{R.key===vf&&(R.metaKey||R.ctrlKey)&&(R.preventDefault(),v());};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[v]);let p=x?"expanded":"collapsed",y=X__namespace.useMemo(()=>({state:p,open:x,setOpen:f,isMobile:u,openMobile:d,setOpenMobile:b,toggleSidebar:v}),[p,x,f,u,d,b,v]);return n(nl.Provider,{value:y,children:n("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":ff,"--sidebar-width-icon":bf,...r},className:l("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",a),...c,children:i})})}function is({side:e="left",variant:t="sidebar",collapsible:o="icon",className:a,children:r,...i}){let{isMobile:c,state:u,openMobile:d,setOpenMobile:b}=to();return o==="none"?n("div",{"data-slot":"sidebar",className:l("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",a),...i,children:r}):c?n(Ys,{open:d,onOpenChange:b,...i,children:s(Ks,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":gf},side:e,children:[s(Js,{className:"sr-only",children:[n(Xs,{children:"Sidebar"}),n(Zs,{children:"Displays the mobile sidebar."})]}),n("div",{className:"flex h-full w-full flex-col",children:r})]})}):s("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":u,"data-collapsible":u==="collapsed"?o:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[n("div",{"data-slot":"sidebar-gap",className:l("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),n("div",{"data-slot":"sidebar-container",className:l("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",a),...i,children:n("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:r})})]})}function yN({className:e,onClick:t,...o}){let{toggleSidebar:a}=to();return s(J,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:l("size-7",e),onClick:r=>{t==null||t(r),a();},...o,children:[n(lucideReact.PanelLeftIcon,{}),n("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function xN({className:e,...t}){let{toggleSidebar:o}=to();return n("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:o,title:"Toggle Sidebar",className:l("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})}function ss({className:e,...t}){return n("main",{"data-slot":"sidebar-inset",className:l("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function wN({className:e,...t}){return n(Qe,{"data-slot":"sidebar-input","data-sidebar":"input",className:l("bg-background h-8 w-full shadow-none",e),...t})}function ls({className:e,sticky:t=false,...o}){return n("div",{"data-slot":"sidebar-header","data-sidebar":"header","data-sticky":t?"true":void 0,className:l("flex flex-col gap-2 p-2",t&&"sticky top-0 z-20 bg-sidebar/95 backdrop-blur supports-[backdrop-filter]:bg-sidebar/75",e),...o})}function cs({className:e,...t}){return n("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:l("flex flex-col gap-2 p-2",e),...t})}function RN({className:e,...t}){return n(Co,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:l("bg-sidebar-border mx-2 w-auto",e),...t})}function ds({className:e,...t}){return n("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:l("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function CN({className:e,...t}){return n("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:l("relative flex w-full min-w-0 flex-col p-2",e),...t})}function TN({className:e,asChild:t=false,...o}){let a=t?radixUi.Slot.Slot:"div";return n(a,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:l("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...o})}function PN({className:e,asChild:t=false,...o}){let a=t?radixUi.Slot.Slot:"button";return n(a,{"data-slot":"sidebar-group-action","data-sidebar":"group-action",className:l("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",e),...o})}function NN({className:e,...t}){return n("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:l("w-full text-sm",e),...t})}function us({className:e,...t}){return n("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:l("flex w-full min-w-0 flex-col gap-1",e),...t})}function ps({className:e,...t}){return n("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:l("group/menu-item relative",e),...t})}var hf=classVarianceAuthority.cva("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function ms({asChild:e=false,isActive:t=false,variant:o="default",size:a="default",tooltip:r,className:i,onClick:c,...u}){let d=e?radixUi.Slot.Slot:"button",{isMobile:b,setOpenMobile:m,state:h}=to(),x=X__namespace.useCallback(v=>{c&&c(v),!v.defaultPrevented&&b&&m(false);},[b,c,m]),f=n(d,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":a,"data-active":t,className:l(hf({variant:o,size:a}),i),onClick:x,...u});return r?(typeof r=="string"&&(r={children:r}),s(Qs,{children:[n(el,{asChild:true,children:f}),n(tl,{side:"right",align:"center",hidden:h!=="collapsed"||b,...r})]})):f}function SN({className:e,asChild:t=false,showOnHover:o=false,...a}){let r=t?radixUi.Slot.Slot:"button";return n(r,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:l("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",o&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",e),...a})}function kN({className:e,...t}){return n("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:l("text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t})}function MN({className:e,showIcon:t=false,...o}){let a=X__namespace.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return s("div",{"data-slot":"sidebar-menu-skeleton","data-sidebar":"menu-skeleton",className:l("flex h-8 items-center gap-2 rounded-md px-2",e),...o,children:[t&&n(gt,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),n(gt,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":a}})]})}function EN({className:e,...t}){return n("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:l("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t})}function DN({className:e,...t}){return n("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:l("group/menu-sub-item relative",e),...t})}function LN({asChild:e=false,size:t="md",isActive:o=false,className:a,onClick:r,...i}){let c=e?radixUi.Slot.Slot:"a",{isMobile:u,setOpenMobile:d}=to(),b=X__namespace.useCallback(m=>{r&&r(m),!m.defaultPrevented&&u&&d(false);},[u,r,d]);return n(c,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":t,"data-active":o,className:l("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",a),onClick:b,...i})}function HN({className:e,defaultValue:t,value:o,min:a=0,max:r=100,...i}){let c=X__namespace.useMemo(()=>Array.isArray(o)?o:Array.isArray(t)?t:[a,r],[o,t,a,r]);return s(radixUi.Slider.Root,{"data-slot":"slider",defaultValue:t,value:o,min:a,max:r,className:l("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...i,children:[n(radixUi.Slider.Track,{"data-slot":"slider-track",className:l("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:n(radixUi.Slider.Range,{"data-slot":"slider-range",className:l("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:c.length},(u,d)=>n(radixUi.Slider.Thumb,{"data-slot":"slider-thumb",className:"border-primary bg-background ring-primary/40 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},d))]})}var VN=({...e})=>n(sonner.Toaster,{theme:"dark",className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},...e});function rl({className:e,...t}){return n(radixUi.Switch.Root,{"data-slot":"switch",className:l("peer cursor-pointer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-primary focus-visible:ring-primary/40 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:n(radixUi.Switch.Thumb,{"data-slot":"switch-thumb",className:l("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function ut({className:e,...t}){return n("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto overflow-y-visible",children:n("table",{"data-slot":"table",className:l("w-full caption-bottom text-sm",e),...t})})}function pt({className:e,...t}){return n("thead",{"data-slot":"table-header",className:l("[&_tr]:border-b",e),...t})}function mt({className:e,...t}){return n("tbody",{"data-slot":"table-body",className:l("[&_tr:last-child]:border-0",e),...t})}function KN({className:e,...t}){return n("tfoot",{"data-slot":"table-footer",className:l("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t})}function Ce({className:e,...t}){return n("tr",{"data-slot":"table-row",className:l("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function Be({className:e,...t}){return n("th",{"data-slot":"table-head",className:l("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function Re({className:e,...t}){return n("td",{"data-slot":"table-cell",className:l("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function JN({className:e,...t}){return n("caption",{"data-slot":"table-caption",className:l("text-muted-foreground mt-4 text-sm",e),...t})}var il=X__namespace.createContext(null),Ya=e=>{let t=X__namespace.useContext(il);if(!t)throw new Error(`${e} must be used within <Tabs>`);return t},sl=X__namespace.createContext("default"),Ka=e=>{let t=X__namespace.useContext(sl);return e!=null?e:t},xf={default:"h-10 justify-start rounded-md bg-muted p-1 text-muted-foreground md:justify-center",solid:"justify-start gap-1 rounded-full bg-muted/80 p-1 text-muted-foreground",segmented:"justify-start gap-1 rounded-xl bg-muted/70 p-1 text-muted-foreground",underline:"justify-start gap-6 border-b border-border bg-transparent p-0 text-muted-foreground",boxed:"justify-start gap-1 rounded-t-xl border border-border/60 bg-muted/40 p-1 text-muted-foreground"},wf="relative z-10 inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-colors focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50",Rf={default:"min-w-[120px] rounded-md px-3 py-1.5 text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=active]:text-foreground",solid:"rounded-full px-4 py-1.5 text-foreground/80 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=active]:text-background",segmented:"rounded-lg px-4 py-1.5 text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=active]:text-foreground",underline:"rounded-none border-b-2 border-transparent px-1 pb-2 pt-1 text-sm text-muted-foreground focus-visible:ring-0 focus-visible:ring-offset-0 data-[state=active]:border-foreground data-[state=active]:text-foreground",boxed:"rounded-md border border-transparent px-4 py-2 text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=active]:text-foreground"},Cf={default:"mt-2",solid:"mt-3",segmented:"mt-3",underline:"mt-4",boxed:"mt-0 rounded-b-xl border border-border border-t-0 bg-card p-6 shadow-sm"},Tf=new Set(["default","solid","segmented","boxed"]),Pf={default:"rounded-md bg-background shadow-sm",solid:"rounded-full bg-foreground",segmented:"rounded-lg bg-background shadow-sm",boxed:"rounded-md border border-border bg-background shadow-sm"},Nf="pointer-events-none absolute left-0 top-0 z-0 transition-all duration-300 ease-out will-change-transform",ll=(...e)=>t=>{e.forEach(o=>{if(typeof o=="function")o(t);else if(o!=null){let a=o;a.current=t;}});},To=X__namespace.forwardRef(({className:e,value:t,defaultValue:o,onValueChange:a,activationMode:r="automatic",variant:i="default",orientation:c="horizontal",items:u,listClassName:d,triggerClassName:b,contentClassName:m,renderList:h,...x},f)=>{var q;let v=X__namespace.useId(),p=t!==void 0,[y,w]=X__namespace.useState(()=>o!=null?o:null),R=(q=p?t:y)!=null?q:null,N=X__namespace.useRef(new Map),C=X__namespace.useCallback(L=>{p||w(L),a==null||a(L);},[p,a]),k=X__namespace.useCallback((L,A)=>{if(A){let O=N.current.size===0;N.current.set(L,A),!p&&R==null&&o==null&&O&&w(L);}else N.current.delete(L);},[o,p,w,R]),g=X__namespace.useCallback(L=>{var A;return L&&(A=N.current.get(L))!=null?A:null},[]),M=X__namespace.useCallback(L=>{let A=Array.from(N.current.keys());if(!A.length)return;let O=(L%A.length+A.length)%A.length,D=A[O],U=N.current.get(D);U==null||U.focus(),r!=="manual"&&C(D);},[r,C]),E=X__namespace.useCallback((L,A)=>{let D=Array.from(N.current.keys()).indexOf(L);D!==-1&&M(D+A);},[M]),S=X__namespace.useCallback(L=>{let A=Array.from(N.current.keys());A.length&&M(L==="first"?0:A.length-1);},[M]),[T,P]=X__namespace.useState(c),F=X__namespace.useCallback(L=>{P(L);},[]);X__namespace.useEffect(()=>{P(c);},[c]),X__namespace.useEffect(()=>{!p&&R==null&&o&&w(o);},[o,p,w,R]);let H=X__namespace.useMemo(()=>({id:v,value:R,setValue:C,activationMode:r,registerTrigger:k,getTriggerNode:g,focusNextTrigger:E,focusEdgeTrigger:S,orientation:T,setOrientation:F}),[v,R,C,r,k,E,S,T,F]);return n(sl.Provider,{value:i,children:n(il.Provider,{value:H,children:s("div",{ref:f,className:l("flex flex-col gap-2",e),...x,children:[(h!=null?h:(L=>L))(n(cl,{className:d,variant:i,orientation:c,children:u.map(L=>{let{triggerProps:A,contentProps:O,...D}=L,{className:U,...V}=A!=null?A:{};return n(dl,{value:D.key,disabled:D.disabled,className:l(b,D.triggerClassName,U),variant:i,...V,children:D.label},D.key)})})),u.map(L=>{let{triggerProps:A,contentProps:O,...D}=L,{className:U,...V}=O!=null?O:{};return n(ul,{value:D.key,variant:i,className:l(m,D.contentClassName,U),...V,children:D.children},D.key)})]})})})});To.displayName="Tabs";var cl=X__namespace.forwardRef(({className:e,variant:t,orientation:o="horizontal",...a},r)=>{let{value:i,setOrientation:c,getTriggerNode:u}=Ya("TabsList"),d=Ka(t),b=Pf[d],m=X__namespace.useRef(null),[h,x]=X__namespace.useState(null),f=Tf.has(d),[v,p]=X__namespace.useState(false),[y,w]=X__namespace.useState(false),R=X__namespace.useCallback(k=>{if(o!=="horizontal")return;let g=m.current;if(!g||!k)return;let M=u(k);if(!M)return;let E=32,S=g.scrollLeft,T=S+g.clientWidth,P=M.offsetLeft,F=P+M.offsetWidth;if(P<S){let H=Math.max(0,P-E);typeof g.scrollTo=="function"?g.scrollTo({left:H,behavior:"smooth"}):g.scrollLeft=H;}else if(F>T){let H=Math.max(0,g.scrollWidth-g.clientWidth),q=Math.min(H,F-g.clientWidth+E);typeof g.scrollTo=="function"?g.scrollTo({left:q,behavior:"smooth"}):g.scrollLeft=q;}},[u,o]),N=X__namespace.useCallback(()=>{if(!f){x(null);return}let k=m.current,g=u(i);if(!k||!g){x(null);return}let M=g.offsetWidth,E=g.offsetHeight,S=g.offsetLeft,T=g.offsetTop,P=g.offsetParent;for(;P&&P!==k;)S+=P.offsetLeft-P.scrollLeft,T+=P.offsetTop-P.scrollTop,P=P.offsetParent;if(P!==k){let F=g.getBoundingClientRect(),H=k.getBoundingClientRect();S=F.left-H.left+k.scrollLeft,T=F.top-H.top+k.scrollTop;}x({width:M,height:E,transform:`translate3d(${S}px, ${T}px, 0)`});},[i,u,f]);X__namespace.useEffect(()=>{c(o);},[o,c]),X__namespace.useLayoutEffect(()=>{N();},[N]),X__namespace.useEffect(()=>{if(o!=="horizontal"){p(false),w(false);return}let k=m.current;if(!k)return;let g=()=>{let{scrollLeft:T,scrollWidth:P,clientWidth:F}=k;if(!(P-F>1)){p(false),w(false);return}p(T>1),w(T<P-F-1);};g(),R(i);let M=()=>g(),E=()=>{g(),R(i);},S=typeof ResizeObserver!="undefined"?new ResizeObserver(()=>E()):null;return k.addEventListener("scroll",M,{passive:true}),S==null||S.observe(k),window.addEventListener("resize",E),()=>{k.removeEventListener("scroll",M),S==null||S.disconnect(),window.removeEventListener("resize",E);}},[i,R,o]),X__namespace.useEffect(()=>{R(i);},[i,R]),X__namespace.useEffect(()=>{if(!f||typeof ResizeObserver=="undefined")return;let k=m.current;if(!k)return;let g=new ResizeObserver(()=>{N();});g.observe(k);let M=u(i);return M&&g.observe(M),()=>{g.disconnect();}},[i,u,f,N]),X__namespace.useEffect(()=>{if(!f||typeof MutationObserver=="undefined")return;let k=m.current;if(!k)return;let g=new MutationObserver(()=>{N();});return g.observe(k,{childList:true,subtree:true}),()=>{g.disconnect();}},[f,N]),X__namespace.useEffect(()=>{if(!f)return;let k=()=>{N();};return window.addEventListener("resize",k),()=>{window.removeEventListener("resize",k);}},[f,N]);let C=o==="horizontal";return s("div",{className:l("relative",C&&"max-w-full overflow-hidden"),children:[s("div",{ref:ll(m,r),role:"tablist","aria-orientation":o,className:l("relative inline-flex items-center",C&&"w-full max-w-full overflow-x-auto overflow-y-hidden [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",xf[d],e),...a,children:[f&&h&&b?n("span",{"aria-hidden":"true",className:l(Nf,b),style:h}):null,a.children]}),C&&v?n("div",{className:"pointer-events-none absolute inset-y-0 left-0 w-8 bg-gradient-to-r from-background to-transparent"}):null,C&&y?n("div",{className:"pointer-events-none absolute inset-y-0 right-0 w-8 bg-gradient-to-l from-background to-transparent"}):null]})});cl.displayName="TabsList";var dl=X__namespace.forwardRef(({className:e,variant:t,value:o,disabled:a,onClick:r,onKeyDown:i,...c},u)=>{let{id:d,value:b,setValue:m,registerTrigger:h,focusNextTrigger:x,focusEdgeTrigger:f,orientation:v}=Ya("TabsTrigger"),p=Ka(t),y=X__namespace.useRef(null),w=b===o,R=`${d}-trigger-${o}`,N=`${d}-content-${o}`;X__namespace.useEffect(()=>(h(o,y.current),()=>h(o,null)),[h,o]);let C=g=>{r==null||r(g),!(g.defaultPrevented||a)&&m(o);},k=g=>{if(i==null||i(g),!g.defaultPrevented){if(v==="horizontal"){if(g.key==="ArrowRight"){g.preventDefault(),x(o,1);return}if(g.key==="ArrowLeft"){g.preventDefault(),x(o,-1);return}}else {if(g.key==="ArrowDown"){g.preventDefault(),x(o,1);return}if(g.key==="ArrowUp"){g.preventDefault(),x(o,-1);return}}if(g.key==="Home"){g.preventDefault(),f("first");return}if(g.key==="End"){g.preventDefault(),f("last");return}(g.key===" "||g.key==="Enter")&&(g.preventDefault(),m(o));}};return n("button",{type:"button",role:"tab",id:R,"aria-selected":w,"aria-controls":N,tabIndex:w?0:-1,"data-state":w?"active":"inactive",disabled:a,ref:ll(y,u),className:l(wf,Rf[p],e),onClick:C,onKeyDown:k,...c})});dl.displayName="TabsTrigger";var ul=X__namespace.forwardRef(({className:e,variant:t,value:o,...a},r)=>{let{id:i,value:c}=Ya("TabsContent"),u=Ka(t),d=c===o,b=`${i}-trigger-${o}`,m=`${i}-content-${o}`;return n("div",{ref:r,role:"tabpanel",id:m,"aria-labelledby":b,hidden:!d,"data-state":d?"active":"inactive",className:l("focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",Cf[u],e),...a})});ul.displayName="TabsContent";var Ja=X__namespace.forwardRef(({className:e,onFocus:t,...o},a)=>{let r=X__namespace.useCallback(c=>{typeof a=="function"?a(c):a&&(a.current=c);},[a]),i=X__namespace.useCallback(c=>{t==null||t(c),!c.defaultPrevented&&po(c.currentTarget);},[t]);return n("textarea",{ref:r,"data-slot":"textarea",onFocus:i,className:l("border-input placeholder:text-muted-foreground focus-visible:border-primary focus-visible:ring-primary/40 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-0 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...o})});Ja.displayName="Textarea";var Xa=classVarianceAuthority.cva("inline-flex 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 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-primary focus-visible:ring-primary/40 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:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function dS({className:e,variant:t,size:o,...a}){return n(radixUi.Toggle.Root,{"data-slot":"toggle",className:l(Xa({variant:t,size:o,className:e})),...a})}var ml=X__namespace.createContext({size:"default",variant:"default"});function bS({className:e,variant:t,size:o,children:a,...r}){return n(radixUi.ToggleGroup.Root,{"data-slot":"toggle-group","data-variant":t,"data-size":o,className:l("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",e),...r,children:n(ml.Provider,{value:{variant:t,size:o},children:a})})}function vS({className:e,children:t,variant:o,size:a,...r}){let i=X__namespace.useContext(ml);return n(radixUi.ToggleGroup.Item,{"data-slot":"toggle-group-item","data-variant":i.variant||o,"data-size":i.size||a,className:l(Xa({variant:i.variant||o,size:i.size||a}),"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",e),...r,children:t})}var Df="hsl(var(--primary))",Za={bottomLeft:{side:"bottom",align:"start"},bottomRight:{side:"bottom",align:"end"},topLeft:{side:"top",align:"start"},topRight:{side:"top",align:"end"}},Lf=e=>{var t;return e&&(t=Za[e])!=null?t:Za.bottomLeft},dt=e=>String(e).padStart(2,"0"),If=(e,t)=>{let o=e.hour>=12?"PM":"AM",a=(e.hour+11)%12+1,r={HH:dt(e.hour),H:String(e.hour),hh:dt(a),h:String(a),mm:dt(e.minute),m:String(e.minute),ss:dt(e.second),s:String(e.second),A:o,a:o.toLowerCase()};return t.replace(/HH|H|hh|h|mm|m|ss|s|A|a/g,i=>r[i])},Af=(e,t)=>t?`${dt(e.hour)}:${dt(e.minute)}:${dt(e.second)}`:`${dt(e.hour)}:${dt(e.minute)}`,_f=e=>{let t=e.match(/\b(AM|PM)\b/i);return t?t[1].toUpperCase()==="AM"?"AM":"PM":null},fl=e=>{if(!e)return null;let t=e.trim();if(!t)return null;let o=_f(t),a=o?t.replace(/\s?(AM|PM)\b/i,"").trim():t,[r,i,c]=a.split(":");if(!r||!i)return null;let u=Number.parseInt(r,10),d=Number.parseInt(i,10),b=c?Number.parseInt(c,10):0;if([u,d,b].some(h=>Number.isNaN(h)))return null;let m=u;if(o){let h=Math.min(Math.max(m%12||12,1),12);m=o==="PM"?h%12+12:h%12,o==="AM"&&h===12&&(m=0),o==="PM"&&h===12&&(m=12);}return {hour:Math.min(Math.max(m,0),23),minute:Math.min(Math.max(d,0),59),second:Math.min(Math.max(b,0),59)}},Ff=e=>{let t=e%12;return t===0?12:t},Hf=(e,t)=>{let o=e%12;return t==="PM"?o+12:o===12?0:o},Qa=({label:e,options:t,selectedValue:o,onSelect:a})=>s("div",{className:"flex w-20 min-w-0 flex-col gap-2",children:[n("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:e}),n("div",{role:"listbox",className:"max-h-48 overflow-y-auto rounded-md border border-border/60 p-1","aria-label":e,children:t.map(r=>{let i=r.value===o;return n("button",{type:"button",role:"option","aria-selected":i,className:l("w-full rounded-sm px-2 py-1 text-sm transition-colors",i?"bg-primary text-primary-foreground":"hover:bg-muted hover:text-foreground"),onClick:()=>a(r.value),children:r.label},r.value)})})]}),$o=44,Of=5,gl=40;function er({label:e,options:t,selectedValue:o,onValueChange:a,open:r,infinite:i=true}){let c=X__namespace.useRef(null),u=X__namespace.useRef(null),d=X__namespace.useMemo(()=>{if(t.length===0)return [];if(!i)return t;let x=[];for(let f=0;f<gl;f+=1)for(let v of t)x.push(v);return x},[i,t]),b=X__namespace.useCallback((x,f="auto")=>{if(!c.current||t.length===0||d.length===0)return;let v=t.findIndex(N=>N.value===x),p=v>=0?v:0,y=Math.floor(gl/2),R=(i?p+t.length*y:p)*$o;c.current.scrollTo({top:R,behavior:f});},[d.length,i,t]);X__namespace.useLayoutEffect(()=>{r&&b(o);},[b,r,t,o]),X__namespace.useEffect(()=>()=>{u.current!==null&&clearTimeout(u.current);},[]);let m=X__namespace.useCallback(x=>{if(d.length===0||t.length===0)return;let f=x.currentTarget,v=Math.round(f.scrollTop/$o),p=d.length-1,y=Math.max(0,Math.min(v,p));u.current!==null&&clearTimeout(u.current),u.current=setTimeout(()=>{var N;let w=d[y];if(!w)return;if(!a(w.value)){b(o,"smooth");return}if(i){let C=t.length,k=d.length-t.length-1;if(v<=C||v>=k)b(w.value);else {let g=v*$o;(N=c.current)==null||N.scrollTo({top:g});}return}b(w.value);},80);},[b,d,i,a,t,o]);if(t.length===0)return n("div",{className:"flex-1",children:n("p",{className:"text-center text-sm text-muted-foreground",children:"No options"})});let h=(Of-1)/2*$o;return s("div",{className:"flex flex-1 flex-col items-center gap-2",children:[n("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:e}),s("div",{className:"relative h-56 w-full overflow-hidden",children:[n("div",{className:"pointer-events-none absolute inset-x-0 top-1/2 -translate-y-1/2 border-y border-primary/30"}),n("div",{ref:c,onScroll:m,className:"h-56 overflow-y-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",style:{paddingTop:h,paddingBottom:h,WebkitOverflowScrolling:"touch"},children:d.map((x,f)=>{let v=`${f}-${x.value}`,p=x.value===o;return n("div",{className:l("flex h-11 items-center justify-center text-base transition-colors",p?"font-medium text-foreground":"text-muted-foreground"),children:x.label},v)})})]})]})}var Bf=({value:e,onChange:t})=>s("div",{className:"flex w-20 min-w-0 flex-col gap-2",children:[n("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Period"}),n("div",{role:"radiogroup",className:"grid gap-2",children:["AM","PM"].map(o=>{let a=o===e;return n("button",{type:"button",role:"radio","aria-checked":a,className:l("rounded-sm px-2 py-1 text-sm transition-colors",a?"bg-primary text-primary-foreground":"border border-border/60 hover:bg-muted hover:text-foreground"),onClick:()=>t(o),children:o},o)})})]}),tr=X__namespace.forwardRef((e,t)=>{var io,on,In,An;let{value:o,defaultValue:a=null,onChange:r,onOpenChange:i,hourStep:c=1,minuteStep:u=1,secondStep:d=1,showSeconds:b,use12Hours:m=false,allowClear:h=true,format:x,placeholder:f,placement:v="bottomLeft",size:p="middle",status:y,variant:w="outlined",inputClassName:R,inputStyle:N,prefix:C,open:k,defaultOpen:g,inputReadOnly:M=true,className:E,style:S,disabled:T=false,name:P,id:F,...H}=e,{onBlur:q,onFocus:L,onClick:A,...O}=H,{isNative:D}=At(),U=rt(),V=D||U,z=o!==void 0,[$,j]=X__namespace.useState(a),G=(io=z?o:$)!=null?io:null,_=X__namespace.useMemo(()=>fl(G),[G]),te=X__namespace.useMemo(()=>{var Z;return ((Z=_==null?void 0:_.hour)!=null?Z:0)>=12?"PM":"AM"},[_==null?void 0:_.hour]),[K,ce]=X__namespace.useState(te);X__namespace.useEffect(()=>{ce(te);},[te]);let le=X__namespace.useMemo(()=>typeof b=="boolean"?b:typeof x=="string"?/s/.test(x):!!(G&&G.split(":").length===3),[G,x,b]),re=X__namespace.useMemo(()=>m?le?"hh:mm:ss A":"hh:mm A":le?"HH:mm:ss":"HH:mm",[le,m]),ge=typeof x=="string"?x:re,fe=X__namespace.useCallback(Z=>Z?typeof x=="function"?x(Z):If(Z,ge):"",[x,ge]),[W,ie]=X__namespace.useState(()=>fe(_));X__namespace.useEffect(()=>{ie(fe(_));},[fe,_]);let pe=typeof h=="object"&&h!==null&&!Array.isArray(h)?h:void 0,he=(on=pe==null?void 0:pe.clearIcon)!=null?on:n(lucideReact.X,{className:"h-4 w-4",strokeWidth:2}),Te=!!h&&!T&&!!G,oe=X__namespace.useMemo(()=>({"--date-primary-color":Df}),[]),ne=k!==void 0,[ye,de]=X__namespace.useState(!!g),we=ne?!!k:ye,Se=X__namespace.useCallback(Z=>{T||(ne||de(Z),i==null||i(Z));},[T,ne,i]),me=X__namespace.useCallback(Z=>{if(!Z){z||j(null),ie(""),r==null||r(null,"");return}let ue=Af(Z,le);z||j(ue);let et=fe(Z);ie(et),r==null||r(ue,et);},[fe,le,z,r]),Ie=_!=null?_:{hour:0,minute:0,second:0},Ne=Math.max(1,Math.floor(c)),ke=Math.max(1,Math.floor(u)),be=Math.max(1,Math.floor(d)),Nt=X__namespace.useMemo(()=>{if(m){let ue=[];for(let ht=1;ht<=12;ht+=Ne)ue.push(Math.min(ht,12));return ue.includes(12)||ue.push(12),Array.from(new Set(ue)).sort((ht,Xo)=>ht-Xo).map(ht=>({label:dt(ht),value:ht}))}let Z=[];for(let ue=0;ue<24;ue+=Ne)Z.push({label:dt(ue),value:ue});return Z},[Ne,m]),xe=X__namespace.useMemo(()=>{let Z=[];for(let ue=0;ue<60;ue+=ke)Z.push({label:dt(ue),value:ue});return Z},[ke]),Ut=X__namespace.useMemo(()=>{if(!le)return [];let Z=[];for(let ue=0;ue<60;ue+=be)Z.push({label:dt(ue),value:ue});return Z},[le,be]),We=X__namespace.useMemo(()=>_?m?Ff(_.hour):_.hour:m?12:0,[_,m]),Ht=(In=_==null?void 0:_.minute)!=null?In:0,vt=(An=_==null?void 0:_.second)!=null?An:0,Ot=X__namespace.useCallback(Z=>{if(m){let ue=Hf(Z,K);me({...Ie,hour:ue});}else me({...Ie,hour:Z});},[Ie,me,K,m]),Le=X__namespace.useCallback(Z=>{me({...Ie,minute:Z});},[Ie,me]),Pe=X__namespace.useCallback(Z=>{me({...Ie,second:Z});},[Ie,me]),Gt=X__namespace.useCallback(Z=>{ce(Z);let ue=_!=null?_:Ie,et=ue.hour;Z==="AM"&&et>=12&&(et-=12),Z==="PM"&&et<12&&(et+=12),me({...ue,hour:et});},[Ie,me,_]),nn=X__namespace.useCallback(Z=>{let ue=Z.target.value;if(ie(ue),!ue.trim()){me(null);return}let et=fl(ue);et&&me(et);},[me]),{side:ae,align:it}=Lf(v),Ye={small:"h-8 text-sm",middle:`${yt} text-sm`,large:"h-11 text-base"},St={error:"border-destructive focus-visible:border-destructive focus-visible:ring-destructive/30",warning:"border-yellow-500 focus-visible:border-yellow-500 focus-visible:ring-yellow-500/30"},qo={outlined:"",borderless:"border-transparent shadow-none focus:border-transparent focus:ring-0 focus:ring-offset-0",filled:"border-transparent bg-muted/60 focus:bg-muted",underlined:"border-x-0 border-t-0 rounded-none focus:ring-offset-0"},ao=M||V,Wo=f!=null?f:"Select time",ro=s("div",{role:"combobox","aria-expanded":we,"aria-haspopup":"dialog",className:l("relative w-full",E),style:S,children:[C&&n("div",{className:"pointer-events-none absolute inset-y-0 left-3 flex items-center text-muted-foreground",children:C}),n(Qe,{...O,ref:t,value:W,onChange:ao?void 0:nn,onFocus:L,onBlur:q,readOnly:ao,disabled:T,placeholder:Wo,name:P,id:F,className:l("pr-10 text-sm",qo[w],C&&"pl-10",T&&"cursor-not-allowed opacity-60",!T&&"cursor-pointer",Ye[p],y?St[y]:void 0,R),style:{...y==="error"?{borderColor:"hsl(var(--destructive))",boxShadow:"0 0 0 3px hsl(var(--destructive) / 0.2)"}:{},...y==="warning"?{borderColor:"var(--warning, hsl(var(--primary)))",boxShadow:"0 0 0 3px hsl(var(--primary) / 0.2)"}:{},...N!=null?N:{}},onClick:Z=>{A==null||A(Z),!T&&Se(true);}}),Te&&n("button",{type:"button",className:"absolute inset-y-0 right-8 flex items-center text-muted-foreground transition hover:text-foreground",onMouseDown:Z=>{Z.preventDefault(),Z.stopPropagation();},onClick:Z=>{Z.preventDefault(),Z.stopPropagation(),me(null);},children:he}),n("div",{className:"pointer-events-none absolute inset-y-0 right-3 flex items-center text-muted-foreground",children:n(lucideReact.Clock,{className:"h-4 w-4"})})]}),Yo=X__namespace.useMemo(()=>[{label:"AM",value:"AM"},{label:"PM",value:"PM"}],[]),Ko=s("div",{className:"flex w-max gap-4 p-4",role:"dialog","aria-modal":"true",children:[n(Qa,{label:"Hour",options:Nt,selectedValue:We,onSelect:Ot}),n(Qa,{label:"Minute",options:xe,selectedValue:Ht,onSelect:Le}),le?n(Qa,{label:"Second",options:Ut,selectedValue:vt,onSelect:Pe}):null,m?n(Bf,{value:K,onChange:Gt}):null]}),Jo=s("div",{className:"flex w-full gap-4",children:[n(er,{open:we,label:"Hour",options:Nt,selectedValue:We,onValueChange:Z=>(Ot(Z),true)}),n(er,{open:we,label:"Minute",options:xe,selectedValue:Ht,onValueChange:Z=>(Le(Z),true)}),m?n(er,{open:we,label:"Period",options:Yo,selectedValue:K,infinite:false,onValueChange:Z=>(Gt(Z),true)}):null]});return V?s(wn,{open:we,onOpenChange:Se,children:[n(ko,{asChild:true,children:ro}),s(Rn,{className:"mt-10 max-h-[min(540px,calc(100dvh-6rem))] rounded-t-3xl bg-background",children:[n(Cn,{className:"px-6 pb-2 pt-4",children:n(Tn,{className:"text-base font-medium text-foreground",children:"Select time"})}),s("div",{className:"flex flex-1 flex-col gap-6 px-6 pb-6",children:[n("div",{className:"flex w-full gap-4",children:Jo}),s("div",{className:"mt-auto flex items-center justify-between",children:[n("div",{className:"flex-1"}),s("div",{className:"flex items-center gap-3",children:[h?n(J,{type:"button",variant:"outline",size:"sm",className:"text-muted-foreground hover:text-foreground",onClick:()=>me(null),children:"Clear"}):null,n(Mo,{asChild:true,children:n(J,{type:"button",variant:"default",size:"sm",className:"bg-[var(--date-primary-color)] text-white hover:opacity-90 focus-visible:ring-[var(--date-primary-color)]/30",style:oe,children:"Done"})})]})]})]})]})]}):s(yn,{open:we,onOpenChange:Se,children:[n(So,{asChild:true,children:ro}),n(xn,{className:"w-auto border border-border bg-popover p-0 shadow-lg",align:it,side:ae,children:Ko})]})});tr.displayName="TimePicker";function bl({row:e}){let{transform:t,transition:o,setNodeRef:a,isDragging:r}=sortable.useSortable({id:e.original.id});return n(Ce,{"data-state":e.getIsSelected()&&"selected","data-dragging":r,ref:a,className:"relative z-0 data-[dragging=true]:z-10 data-[dragging=true]:opacity-80",style:{transform:utilities.CSS.Transform.toString(t),transition:o},children:e.getVisibleCells().map(i=>n(Re,{children:reactTable.flexRender(i.column.columnDef.cell,i.getContext())},i.id))})}function Qf({columns:e,dndEnabled:t,dataIds:o,rows:a}){return a.length?t?n(sortable.SortableContext,{items:o,strategy:sortable.verticalListSortingStrategy,children:a.map(r=>n(bl,{row:r},r.id))}):a.map(r=>n(Ce,{"data-state":r.getIsSelected()&&"selected",children:r.getVisibleCells().map(i=>{let c=i.column.columnDef.meta;return n(Re,{className:c==null?void 0:c.cellClassName,style:c==null?void 0:c.cellStyle,children:reactTable.flexRender(i.column.columnDef.cell,i.getContext())},i.id)})},r.id)):n(Ce,{children:n(Re,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})}function yl({table:e,columns:t,dndEnabled:o=false,onReorder:a,virtualizedRows:r}){var h;let i=(h=r==null?void 0:r.rows)!=null?h:e.getRowModel().rows,c=o?i.map(x=>Number(x.id)):[],u=X__namespace.useId(),d=core.useSensors(core.useSensor(core.MouseSensor,{}),core.useSensor(core.TouchSensor,{}),core.useSensor(core.KeyboardSensor,{}));function b(x){let{active:f,over:v}=x;if(f&&v&&f.id!==v.id&&a){let p=c.indexOf(f.id),y=c.indexOf(v.id),w=sortable.arrayMove(e.options.data,p,y);a(w);}}let m=s(ut,{className:"table-fixed min-w-full",children:[n(pt,{className:"sticky top-0 z-20 bg-muted",children:e.getHeaderGroups().map(x=>n(Ce,{children:x.headers.map(f=>{let v=f.column.columnDef.meta;return n(Be,{colSpan:f.colSpan,className:l("sticky top-0 z-30 bg-muted",v==null?void 0:v.headerClassName),style:v==null?void 0:v.headerStyle,children:f.isPlaceholder?null:reactTable.flexRender(f.column.columnDef.header,f.getContext())},f.id)})},x.id))}),s(mt,{className:"**:data-[slot=table-cell]:first:w-8",children:[r!=null&&r.paddingTop?n(Ce,{className:"pointer-events-none border-0",children:n(Re,{colSpan:t.length,className:"p-0",style:{height:r.paddingTop}})}):null,Qf({columns:t,dndEnabled:o,dataIds:c,rows:i}),r!=null&&r.paddingBottom?n(Ce,{className:"pointer-events-none border-0",children:n(Re,{colSpan:t.length,className:"p-0",style:{height:r.paddingBottom}})}):null]})]});return o?n(core.DndContext,{collisionDetection:core.closestCenter,modifiers:[modifiers.restrictToVerticalAxis],onDragEnd:b,sensors:d,id:u,children:m}):m}function og(e){switch(e){case "desc":return n(lucideReact.ArrowDown,{className:"ml-2 h-4 w-4"});case "asc":return n(lucideReact.ArrowUp,{className:"ml-2 h-4 w-4"});default:return n(lucideReact.ChevronsUpDown,{className:"ml-2 h-4 w-4"})}}function xl({column:e,title:t,className:o}){if(!e.getCanSort())return n("div",{className:l(o),children:t});let a=r=>{let i=r.shiftKey||r.metaKey||r.ctrlKey,c=e.getNextSortingOrder();if(!c){e.clearSorting();return}e.toggleSorting(c==="desc",i);};return n("div",{className:l("flex items-center space-x-2",o),children:s(J,{type:"button",variant:"ghost",size:"sm",className:"-ml-3 h-8 justify-start",onClick:a,children:[n("span",{children:t}),og(e.getIsSorted())]})})}function wl({table:e,showPageSize:t=true,pageSizeOptions:o=[10,20,30,40,50]}){return s("div",{className:"flex items-center justify-between px-4",children:[s("div",{className:"text-muted-foreground hidden flex-1 text-sm lg:flex",children:[e.getFilteredSelectedRowModel().rows.length," of ",e.getFilteredRowModel().rows.length," row(s) selected."]}),s("div",{className:"flex w-full items-center gap-8 lg:w-fit",children:[t?s("div",{className:"hidden items-center gap-2 lg:flex",children:[n(De,{htmlFor:"rows-per-page",className:"text-sm font-medium",children:"Rows per page"}),n(Vo,{value:`${e.getState().pagination.pageSize}`,onValueChange:a=>{e.setPageSize(Number(a));},options:o.map(a=>({value:`${a}`,label:a})),triggerProps:{size:"sm",className:"w-20",id:"rows-per-page"},contentProps:{side:"top"}})]}):null,s("div",{className:"flex w-fit items-center justify-center text-sm font-medium",children:["Page ",e.getState().pagination.pageIndex+1," of ",e.getPageCount()]}),s("div",{className:"ml-auto flex items-center gap-2 lg:ml-0",children:[s(J,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),children:[n("span",{className:"sr-only",children:"Go to first page"}),n(lucideReact.ChevronsLeft,{})]}),s(J,{variant:"outline",className:"size-8",size:"icon",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),children:[n("span",{className:"sr-only",children:"Go to previous page"}),n(lucideReact.ChevronLeft,{})]}),s(J,{variant:"outline",className:"size-8",size:"icon",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),children:[n("span",{className:"sr-only",children:"Go to next page"}),n(lucideReact.ChevronRight,{})]}),s(J,{variant:"outline",className:"hidden size-8 lg:flex",size:"icon",onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),children:[n("span",{className:"sr-only",children:"Go to last page"}),n(lucideReact.ChevronsRight,{})]})]})]})]})}function Rl({table:e}){return s(Rs,{children:[n(Ba,{asChild:true,children:s(J,{variant:"outline",size:"sm",className:"ml-auto hidden h-8 lg:flex",children:[n(lucideReact.Settings2,{}),"View"]})}),s(za,{align:"end",className:"w-[150px]",children:[n(Ts,{children:"Toggle columns"}),n(Ps,{}),e.getAllColumns().filter(t=>typeof t.accessorFn!="undefined"&&t.getCanHide()).map(t=>n(Cs,{className:"capitalize",checked:t.getIsVisible(),onCheckedChange:o=>t.toggleVisibility(!!o),children:t.id},t.id))]})]})}function ug({id:e}){let{attributes:t,listeners:o}=sortable.useSortable({id:e});return s(J,{...t,...o,variant:"ghost",size:"icon",className:"text-muted-foreground size-7 hover:bg-transparent",children:[n(lucideReact.GripVertical,{className:"text-muted-foreground size-3"}),n("span",{className:"sr-only",children:"Drag to reorder"})]})}var Cl={id:"drag",header:()=>null,cell:({row:e})=>n(ug,{id:e.original.id}),enableSorting:false,enableHiding:false};function b0(e){return [Cl,...e]}function or(e,t){return t?t.split(".").reduce((o,a)=>{if(!(o===null||typeof o!="object"))return o[a]},e):e}function fg(e){if(e)return typeof e=="number"?{width:e,minWidth:e}:{width:e,minWidth:e}}function gg(e){var d,b,m;if(!e)return null;let t=(d=e.body)!=null?d:e.payload,o=e.params,a=e.headers,r=e.resultKey,i=e.mapData,c=e.delay;if(typeof e.get=="string")return {method:"get",url:e.get,params:o,headers:a,resultKey:r,mapData:i,delay:c};if(typeof e.post=="string")return {method:"post",url:e.post,body:t,params:o,headers:a,resultKey:r,mapData:i,delay:c};let u=(b=e.url)!=null?b:e.reul;return typeof u=="string"?{method:(m=e.method)!=null?m:"get",url:u,body:t,params:o,headers:a,resultKey:r,mapData:i,delay:c}:null}function bg(e,t){return e.map(o=>{var d,b,m,h;let a=o.item?x=>or(x,o.item):x=>x,r=o.align==="right"?"text-right justify-end":o.align==="center"?"text-center justify-center":void 0,i=l(r,o.headerClassName),c=l(o.align==="right"?"text-right":o.align==="center"?"text-center":void 0,o.cellClassName),u=fg(o.width);return {id:o.key,accessorFn:a,header:({column:x})=>n(xl,{column:x,title:o.title,className:r}),cell:({row:x})=>{let f=x.original,v=o.item?or(f,o.item):a(f);return o.func?o.func(f,{value:v,rowIndex:x.index}):v},enableSorting:t&&((d=o.sortable)!=null?d:true)&&!!o.item,enableHiding:(b=o.hiddeable)!=null?b:true,meta:{headerClassName:i,headerStyle:(m=o.headerStyle)!=null?m:u,cellClassName:c,cellStyle:(h=o.cellStyle)!=null?h:u}}})}function vg(e,t){if(Array.isArray(e))return e;if(e&&typeof e=="object"){if(t&&Array.isArray(e[t]))return e[t];if(Array.isArray(e.data))return e.data}return []}function hg(e,t){if(!t||Object.keys(t).length===0)return e;try{let o=new URL(e,typeof window!="undefined"?window.location.origin:"http://localhost");return Object.entries(t).forEach(([a,r])=>{r!=null&&o.searchParams.set(a,String(r));}),o.toString()}catch{let a=new URLSearchParams(Object.entries(t).reduce((i,[c,u])=>(u==null||(i[c]=String(u)),i),{})),r=e.includes("?")?"&":"?";return `${e}${r}${a.toString()}`}}function yg({data:e,columns:t,pagination:o=true,sortable:a=true,reload:r=false,filterable:i=false,selectable:c=false,height:u=480,rowHeight:d=48,overscan:b=5,defaultPageSize:m=25,pageSize:h,className:x,emptyState:f,onDataChange:v,loading:p}){var pe,he,Te;let y=X__namespace.useMemo(()=>gg(e.read),[e.read]),w=X__namespace.useMemo(()=>{var oe;return (oe=e.bind)!=null?oe:[]},[e.bind]),R=(pe=h==null?void 0:h.count)!=null?pe:m,N=(he=h==null?void 0:h.options)!=null?he:[10,20,30,40,50],C=(Te=h==null?void 0:h.visible)!=null?Te:true,[k,g]=X__namespace.useState(()=>w),[M,E]=X__namespace.useState(false),[S,T]=X__namespace.useState(null),P=X__namespace.useRef(null),[F,H]=X__namespace.useState(0),[q,L]=X__namespace.useState(u),A=X__namespace.useRef(null),[O,D]=X__namespace.useState(""),U=X__namespace.useMemo(()=>bg(t,a),[t,a]),V=X__namespace.useMemo(()=>c?[{id:"__select",enableHiding:false,enableSorting:false,size:44,header:({table:ne})=>n("div",{className:"flex items-center justify-center",children:n(jn,{"aria-label":"Select all rows",checked:ne.getIsAllPageRowsSelected()||ne.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:ye=>ne.toggleAllPageRowsSelected(ye===true)})}),cell:({row:ne})=>n("div",{className:"flex items-center justify-center",children:n(jn,{"aria-label":"Select row",checked:ne.getIsSelected(),onCheckedChange:ye=>ne.toggleSelected(ye===true)})}),meta:{headerClassName:"w-11 px-2",headerStyle:{width:44,minWidth:44},cellClassName:"w-11 px-2",cellStyle:{width:44,minWidth:44}}},...U]:U,[U,c]),z=X__namespace.useMemo(()=>t.filter(oe=>!!oe.item),[t]),$=X__namespace.useMemo(()=>{if(!i||!O.trim())return k;let oe=O.trim().toLowerCase();return k.filter(ne=>z.some(ye=>{let de=or(ne,ye.item);return de==null?false:String(de).toLowerCase().includes(oe)}))},[k,i,O,z]),j=Ar({data:$,columns:V,enableRowSelection:c,defaultPageSize:o?R:$.length||10,getRowId:(oe,ne)=>ne.toString()});X__namespace.useEffect(()=>{o||(j.setPageIndex(0),j.setPageSize($.length||1));},[o,$.length,j]),X__namespace.useEffect(()=>{o&&j.setPageSize(R);},[o,R,j]),X__namespace.useEffect(()=>{g(w);},[w]),X__namespace.useEffect(()=>{i||D("");},[i]);let G=X__namespace.useCallback(async()=>{var ne,ye;if(!y)return;(ne=A.current)==null||ne.abort();let oe=new AbortController;A.current=oe,E(true),T(null);try{let de=hg(y.url,y.params),we=new Headers(y.headers),Se;y.method==="post"&&y.body!==void 0&&(Se=typeof y.body=="string"?y.body:JSON.stringify(y.body),we.has("Content-Type")||we.set("Content-Type","application/json"));let me=await fetch(de,{method:y.method.toUpperCase(),headers:we,body:Se,signal:oe.signal});if(!me.ok)throw new Error(`Request failed with status ${me.status}`);y.delay&&y.delay>0&&await new Promise(ke=>setTimeout(ke,y.delay));let Ie=await me.json(),Ne=y.mapData?y.mapData(Ie):vg(Ie,y.resultKey);g(Ne),T(null),v==null||v(Ne);}catch(de){if(de.name==="AbortError")return;T((ye=de.message)!=null?ye:"Unable to fetch data");}finally{E(false);}},[y,v]);X__namespace.useEffect(()=>(y&&G().catch(()=>{}),()=>{var oe;(oe=A.current)==null||oe.abort();}),[y,G]),X__namespace.useEffect(()=>{if(!P.current)return;let oe=P.current;L(oe.clientHeight||u);let ne=()=>{L(oe.clientHeight||u);};return typeof window!="undefined"&&window.addEventListener("resize",ne),()=>{typeof window!="undefined"&&window.removeEventListener("resize",ne);}},[u]);let _=j.getRowModel().rows,te=_.length,K=j.getFilteredSelectedRowModel().rows.length,ce=j.getFilteredRowModel().rows.length;X__namespace.useEffect(()=>{P.current&&(P.current.scrollTop=0),H(0);},[te]);let le=te*d,re=Math.max(0,Math.floor(F/d)-b),ge=Math.min(_.length,Math.ceil((F+q)/d)+b),fe=X__namespace.useMemo(()=>{if(!_.length)return null;let oe=_.slice(re,ge),ne=re*d,ye=oe.length*d,de=Math.max(le-ne-ye,0);return {rows:oe,paddingTop:ne,paddingBottom:de}},[_,re,ge,d,le]),W=!!p||M,ie=!W&&k.length===0&&!!f;return s("div",{className:l("flex w-full flex-col gap-4",x),children:[s("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[i?s("div",{className:"relative flex w-full max-w-md items-center",children:[n(lucideReact.Search,{className:"pointer-events-none absolute left-3 h-4 w-4 text-muted-foreground"}),n(Qe,{className:"pl-9",placeholder:"Search rows...",value:O,onChange:oe=>D(oe.target.value)})]}):n("div",{className:"h-9"}),s("div",{className:"flex items-center justify-end gap-2",children:[r&&y?s(J,{variant:"outline",size:"sm",onClick:()=>{G().catch(()=>{});},disabled:M||!!p,children:[M||p?n(lucideReact.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):n(lucideReact.RotateCcw,{className:"mr-2 h-4 w-4"}),"Reload"]}):null,n(Rl,{table:j})]})]}),s("div",{className:"relative overflow-hidden rounded-lg border",children:[ie?n("div",{className:"flex items-center justify-center p-6 text-sm text-muted-foreground",children:f}):n("div",{ref:P,className:"max-h-full overflow-auto",style:{maxHeight:u},onScroll:oe=>H(oe.currentTarget.scrollTop),children:n(yl,{table:j,columns:V,virtualizedRows:fe!=null?fe:void 0})}),W?n("div",{className:"absolute inset-0 flex items-center justify-center bg-background/70 backdrop-blur-sm",children:s("div",{className:"flex flex-col items-center gap-2 text-sm text-muted-foreground",children:[n(lucideReact.Loader2,{className:"h-5 w-5 animate-spin"}),n("span",{children:"Loading data\u2026"})]})}):null]}),S?n("div",{className:"text-destructive text-sm",children:S}):null,o?n(wl,{table:j,showPageSize:C,pageSizeOptions:N}):c?n("div",{className:"flex items-center justify-between px-4 text-sm text-muted-foreground",children:s("span",{children:[K," of ",ce," row(s) selected."]})}):null]})}yg.displayName="DataGrid";function wg({onReset:e}){return s("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-background px-6 py-16 text-center",children:[s("div",{className:"space-y-3",children:[n("h1",{className:"text-3xl font-semibold tracking-tight text-foreground",children:"Something went wrong"}),n("p",{className:"text-base text-muted-foreground",children:"We hit an unexpected error. You can try again or head back to the dashboard."})]}),s("div",{className:"flex flex-wrap items-center justify-center gap-3",children:[n(J,{onClick:()=>{e(),Mr("/dashboard/default");},children:"Back to home"}),n(J,{variant:"outline",onClick:()=>{e();},children:"Try again"})]})]})}var Pl=class extends X.Component{constructor(){super(...arguments);this.state={hasError:false};this.resetBoundary=()=>{this.setState({hasError:false});};}static getDerivedStateFromError(){return {hasError:true}}componentDidCatch(o,a){var r,i;process.env.NODE_ENV!=="production"&&console.error("ErrorBoundary caught an error",o,a),(i=(r=this.props).onError)==null||i.call(r,o,a);}render(){if(this.state.hasError){let{fallback:o}=this.props;return o?typeof o=="function"?o(this.resetBoundary):o:n(wg,{onReset:this.resetBoundary})}return this.props.children}};var je=X__namespace.forwardRef(({className:e,...t},o)=>n("div",{ref:o,className:l("flex flex-col gap-2",e),...t}));je.displayName="FormBlock";var Ue=X__namespace.forwardRef(({message:e,children:t,className:o,...a},r)=>!e&&!t?null:n("p",{ref:r,className:l("text-sm text-destructive",o),role:"alert",...a,children:e!=null?e:t}));Ue.displayName="FormError";var Rg=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange||e.handleBlur?e:(t=e.form)!=null?t:e},Cg=X__namespace.forwardRef(({label:e,name:t,type:o="text",placeholder:a,required:r=false,error:i,value:c,onChange:u,onBlur:d,className:b,description:m,autoComplete:h,labelProps:x={},inputProps:f={},form:v,rules:p},y)=>{var ce,le;let w=Rg(v),R=w==null?void 0:w.values,N=w==null?void 0:w.errors,C=w==null?void 0:w.touched,k=R==null?void 0:R[t],g=N==null?void 0:N[t],M=C==null?void 0:C[t],E=(ce=w==null?void 0:w.validationSequence)!=null?ce:0,S=w==null?void 0:w.handleChange,T=w==null?void 0:w.handleBlur,P=w==null?void 0:w.setFieldValue,F=w==null?void 0:w.setFieldError,H=w==null?void 0:w.setFieldTouched,{onChange:q,onBlur:L,className:A,type:O,autoComplete:D,...U}=f,{children:V,...z}=x,$=O!=null?O:o,j=re=>{let ge=re.target.value,W=!!p||r?kl(ge,p,r):void 0;F==null||F(t,W),P==null||P(t,ge),S==null||S(re),u==null||u(ge),q==null||q(re);},G=re=>{H==null||H(t,true),T==null||T(re),d==null||d(),L==null||L(re);},_=k!==void 0?k:c!==void 0?c:"",te=(le=M?g:void 0)!=null?le:i,K=X__namespace.useRef(E);return X__namespace.useEffect(()=>{let re=!!p||r,ge=E!==K.current;if(!F||!re){K.current=E;return}if(!M&&!ge){K.current=E;return}let fe=typeof _=="string"?_:_!=null?String(_):"",W=kl(fe,p,r);W!==g&&F(t,W),K.current=E;},[_,g,F,M,t,r,p,E]),s(je,{className:b,children:[e&&n(De,{htmlFor:t,...z,children:V!=null?V:s("span",{className:"flex items-center gap-1",children:[n("span",{children:e}),r&&n("span",{className:"text-destructive",children:"*"})]})}),m&&n("p",{className:"text-sm text-muted-foreground",children:m}),n(Qe,{ref:y,id:t,name:t,type:$,placeholder:a,value:_,onChange:j,onBlur:G,"aria-invalid":!!te,autoComplete:D!=null?D:h,className:A,...U}),n(Ue,{message:te})]})});function kl(e,t,o){if(o&&!e)return typeof(t==null?void 0:t.required)=="string"?t.required:"This field is required";if(e){if(t!=null&&t.minLength&&e.length<t.minLength.value)return t.minLength.message;if(t!=null&&t.maxLength&&e.length>t.maxLength.value)return t.maxLength.message;if(t!=null&&t.pattern&&!t.pattern.value.test(e))return t.pattern.message;if(t!=null&&t.validate){let a=t.validate(e);if(typeof a=="string")return a;if(a===false)return "Invalid value"}}}Cg.displayName="FormInput";var Tg=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange||e.handleBlur?e:(t=e.form)!=null?t:e},Pg=X__namespace.forwardRef(({label:e,name:t,mask:o,placeholderChar:a,placeholder:r,required:i=false,error:c,value:u,onChange:d,onBlur:b,className:m,description:h,labelProps:x={},inputProps:f={},form:v,rules:p},y)=>{var j,G;let w=Tg(v),R=w==null?void 0:w.values,N=w==null?void 0:w.errors,C=w==null?void 0:w.touched,k=R==null?void 0:R[t],g=N==null?void 0:N[t],M=C==null?void 0:C[t],E=(j=w==null?void 0:w.validationSequence)!=null?j:0,S=w==null?void 0:w.setFieldValue,T=w==null?void 0:w.setFieldError,P=w==null?void 0:w.setFieldTouched,{className:F,onBlur:H,onChange:q,...L}=f,{children:A,...O}=x,D=_=>{let K=!!p||i?Ml(_,p,i):void 0;T==null||T(t,K),S==null||S(t,_),d==null||d(_),q==null||q(_);},U=_=>{P==null||P(t,true),b==null||b(),H==null||H(_);},V=k!==void 0?k:u!==void 0?u:"",z=(G=M?g:void 0)!=null?G:c,$=X__namespace.useRef(E);return X__namespace.useEffect(()=>{let _=!!p||i,te=E!==$.current;if(!T||!_){$.current=E;return}if(!M&&!te){$.current=E;return}let K=Ml(V,p,i);K!==g&&T(t,K),$.current=E;},[V,g,T,M,t,i,p,E]),s(je,{className:m,children:[e&&n(De,{htmlFor:t,...O,children:A!=null?A:s("span",{className:"flex items-center gap-1",children:[n("span",{children:e}),i&&n("span",{className:"text-destructive",children:"*"})]})}),h&&n("p",{className:"text-sm text-muted-foreground",children:h}),n(Da,{ref:y,id:t,name:t,mask:o,placeholderChar:a,placeholder:r,value:V,onChange:D,onBlur:U,"aria-invalid":!!z,className:F,...L}),n(Ue,{message:z})]})});Pg.displayName="FormInputMask";function Ml(e,t,o){if(o&&!e)return t&&typeof t.required=="string"?t.required:"This field is required";if(e){if(t!=null&&t.minLength&&e.length<t.minLength.value)return t.minLength.message;if(t!=null&&t.maxLength&&e.length>t.maxLength.value)return t.maxLength.message;if(t!=null&&t.pattern&&!t.pattern.value.test(e))return t.pattern.message;if(t!=null&&t.validate){let a=t.validate(e);if(typeof a=="string")return a;if(a===false)return "Invalid value"}}}var Ng=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange||e.handleBlur?e:(t=e.form)!=null?t:e},Sg=X__namespace.forwardRef(({label:e,name:t,placeholder:o,required:a=false,error:r,value:i,onChange:c,onBlur:u,className:d,description:b,labelProps:m={},inputProps:h={},form:x,min:f,max:v,decimals:p,formatter:y,parser:w,rules:R},N)=>{var te,K;let C=Ng(x),k=C==null?void 0:C.values,g=C==null?void 0:C.errors,M=C==null?void 0:C.touched,E=k==null?void 0:k[t],S=g==null?void 0:g[t],T=M==null?void 0:M[t],P=(te=C==null?void 0:C.validationSequence)!=null?te:0,F=C==null?void 0:C.setFieldValue,H=C==null?void 0:C.setFieldError,q=C==null?void 0:C.setFieldTouched,{className:L,onBlur:A,onChange:O,...D}=h,{children:U,...V}=m,z=ce=>{let re=!!R||a?El(ce,R,a):void 0;H==null||H(t,re),F==null||F(t,ce),c==null||c(ce),O==null||O(ce);},$=ce=>{q==null||q(t,true),u==null||u(),A==null||A(ce);},j=E!==void 0?E:i!==void 0?i:null,G=(K=T?S:void 0)!=null?K:r,_=X__namespace.useRef(P);return X__namespace.useEffect(()=>{let ce=!!R||a,le=P!==_.current;if(!H||!ce){_.current=P;return}if(!T&&!le){_.current=P;return}let re=El(j,R,a);re!==S&&H(t,re),_.current=P;},[j,S,H,T,t,a,R,P]),s(je,{className:d,children:[e&&n(De,{htmlFor:t,...V,children:U!=null?U:s("span",{className:"flex items-center gap-1",children:[n("span",{children:e}),a&&n("span",{className:"text-destructive",children:"*"})]})}),b&&n("p",{className:"text-sm text-muted-foreground",children:b}),n(Ea,{ref:N,id:t,name:t,placeholder:o,value:j,onChange:z,onBlur:$,"aria-invalid":!!G,min:f,max:v,decimals:p,formatter:y,parser:w,className:L,...D}),n(Ue,{message:G})]})});Sg.displayName="FormInputNumeric";function El(e,t,o){if(o&&e==null)return t&&typeof t.required=="string"?t.required:"This field is required";if(e!=null){if(t!=null&&t.min&&e<t.min.value)return t.min.message;if(t!=null&&t.max&&e>t.max.value)return t.max.message;if(t!=null&&t.validate){let a=t.validate(e);if(typeof a=="string")return a;if(a===false)return "Invalid value"}}}var Mg=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange||e.handleBlur?e:(t=e.form)!=null?t:e};function pk({label:e,name:t,description:o,placeholder:a="Select an option",required:r=false,error:i,value:c,defaultValue:u,onChange:d,onBlur:b,className:m,disabled:h,labelProps:x={},selectProps:f={},triggerProps:v={},contentProps:p={},multiSelectProps:y={},multiSelectTriggerProps:w={},multiSelectValueProps:R={},multiSelectContentProps:N={},form:C,options:k,isMulti:g=false,rules:M}){var Pe,Gt,nn;let E=rt(),S=Mg(C),T=S==null?void 0:S.values,P=S==null?void 0:S.errors,F=S==null?void 0:S.touched,H=T==null?void 0:T[t],q=P==null?void 0:P[t],L=F==null?void 0:F[t],A=S==null?void 0:S.setFieldValue,O=S==null?void 0:S.setFieldError,D=S==null?void 0:S.setFieldTouched,U=S==null?void 0:S.handleChange,V=S==null?void 0:S.handleBlur,z=(Pe=S==null?void 0:S.validationSequence)!=null?Pe:0,{onValueChange:$,value:j,defaultValue:G,..._}=f,{onBlur:te,...K}=v,ce={...K,disabled:h!=null?h:K.disabled},{title:le,...re}=p,{onValueChange:ge,value:fe,defaultValue:W,...ie}=y,{onBlur:pe,...he}=w,{title:Te,...oe}=N,[ne,ye]=X__namespace.useState(typeof u=="string"?u:""),[de,we]=X__namespace.useState(Array.isArray(u)?u:[]);X__namespace.useEffect(()=>{typeof u=="string"&&j===void 0&&H===void 0&&c===void 0&&ye(u);},[u,H,j,c]),X__namespace.useEffect(()=>{Array.isArray(u)&&fe===void 0&&!Array.isArray(H)&&!Array.isArray(c)&&we(u);},[u,H,fe,c]);let Se=typeof j=="string"?j:typeof H=="string"?H:typeof c=="string"?c:ne,me=Array.isArray(fe)?fe:Array.isArray(H)?H:Array.isArray(c)?c:de,Ie=(Gt=L?q:void 0)!=null?Gt:i,Ne=X__namespace.useRef(z);X__namespace.useEffect(()=>{let ae=!!M||r,it=z!==Ne.current;if(!O||!ae){Ne.current=z;return}if(!L&&!it){Ne.current=z;return}let Ye=g?me:Se!=null?Se:"",St=ar(Ye,M,r);St!==q&&O(t,St),Ne.current=z;},[me,Se,q,O,L,g,t,r,M,z]);let ke=X__namespace.useCallback(ae=>{Array.isArray(ae)?(A==null||A(t,ae),U&&U({target:{name:t,value:ae}})):(A==null||A(t,ae),U&&U({target:{name:t,value:ae}}));},[U,A,t]),be=X__namespace.useCallback(ae=>{j===void 0&&H===void 0&&c===void 0&&ye(ae);let Ye=!!M||r?ar(ae,M,r):void 0;O==null||O(t,Ye),ke(ae),d==null||d(ae),$==null||$(ae);},[H,ke,d,$,j,c,M,r,O,t]),Nt=X__namespace.useCallback(ae=>{fe===void 0&&!Array.isArray(H)&&!Array.isArray(c)&&we(ae);let Ye=!!M||r?ar(ae,M,r):void 0;O==null||O(t,Ye),ke(ae),d==null||d(ae),ge==null||ge(ae);},[H,ke,ge,fe,d,c,M,r,O,t]),xe=X__namespace.useCallback(ae=>{D==null||D(t,true),V==null||V({target:{name:t}}),b==null||b(),te==null||te(ae);},[V,D,t,b,te]),Ut=X__namespace.useCallback(ae=>{D==null||D(t,true),V==null||V({target:{name:t}}),b==null||b(),pe==null||pe(ae);},[V,D,t,pe,b]),We=G!=null?G:typeof u=="string"?u:void 0,Ht=W!=null?W:Array.isArray(u)?u:void 0,[vt,Ot]=X__namespace.useState(false),Le=({isMulti:ae=false})=>{var Ye;let it=ae?me.length>0?`${me.length} selected`:a:((Ye=k.find(St=>St.value===Se))==null?void 0:Ye.label)||a;return s(J,{variant:"outline",className:l("w-full justify-between border-input bg-transparent px-3 py-2 text-sm","flex items-center gap-2",ce.disabled&&"opacity-50 cursor-not-allowed",!!Ie&&"border-destructive",ce.className),onClick:()=>!ce.disabled&&Ot(true),disabled:ce.disabled,type:"button",children:[n("span",{className:"flex-1 text-left truncate",children:it}),n(lucideReact.ChevronDownIcon,{className:"h-4 w-4 opacity-50 flex-shrink-0"})]})};return s(je,{className:m,children:[e&&n(De,{htmlFor:t,...x,children:(nn=x.children)!=null?nn:s("span",{className:"flex items-center gap-1",children:[n("span",{children:e}),r&&n("span",{className:"text-destructive",children:"*"})]})}),g?s(jsxRuntime.Fragment,{children:[E?s(jsxRuntime.Fragment,{children:[n(Le,{isMulti:true}),n(en,{open:vt,onOpenChange:Ot,title:Te!=null?Te:e,options:k,selectedValues:me,onSelect:ae=>{let it=me.includes(ae)?me.filter(Ye=>Ye!==ae):[...me,ae];Nt(it);},isMulti:true})]}):s(Us,{...ie,value:me,defaultValue:Ht,onValueChange:Nt,children:[n(Gs,{"data-name":t,"aria-invalid":!!Ie,...he,...ce,onBlur:Ut,children:n($s,{placeholder:a,...R})}),n(qs,{title:Te!=null?Te:e,...oe,children:k.map(ae=>n(Ws,{value:ae.value,disabled:ae.disabled,children:ae.label},ae.value))})]}),n("input",{type:"hidden",name:t,value:me.join(",")})]}):s(jsxRuntime.Fragment,{children:[E?s(jsxRuntime.Fragment,{children:[n(Le,{}),n(en,{open:vt,onOpenChange:Ot,title:le!=null?le:e,options:k,selectedValues:Se,onSelect:be,isMulti:false})]}):n(Vo,{..._,value:Se,defaultValue:We,onValueChange:be,options:k.map(ae=>({value:ae.value,label:ae.label,disabled:ae.disabled})),placeholder:a,triggerProps:{...ce,id:t,"aria-invalid":!!Ie,onBlur:xe},contentProps:{...re,title:le!=null?le:e}}),n("input",{type:"hidden",name:t,value:Se!=null?Se:""})]}),n(Ue,{message:Ie}),o&&n("p",{className:"text-sm text-muted-foreground",children:o})]})}function ar(e,t,o){if(o){if(Array.isArray(e)){if(e.length===0)return typeof(t==null?void 0:t.required)=="string"?t.required:"This field is required"}else if(!e)return typeof(t==null?void 0:t.required)=="string"?t.required:"This field is required"}if(t!=null&&t.validate){let a=t.validate(e);if(typeof a=="string")return a;if(a===false)return "Invalid value"}}var Eg=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange||e.handleBlur?e:(t=e.form)!=null?t:e},Dg=X__namespace.forwardRef(({label:e,name:t,placeholder:o,required:a=false,error:r,value:i,onChange:c,onBlur:u,className:d,labelProps:b={},textareaProps:m={},form:h,rules:x},f)=>{var $,j;let v=Eg(h),p=v==null?void 0:v.values,y=v==null?void 0:v.errors,w=v==null?void 0:v.touched,R=p==null?void 0:p[t],N=y==null?void 0:y[t],C=w==null?void 0:w[t],k=($=v==null?void 0:v.validationSequence)!=null?$:0,g=v==null?void 0:v.handleChange,M=v==null?void 0:v.handleBlur,E=v==null?void 0:v.setFieldError,S=v==null?void 0:v.setFieldValue,T=v==null?void 0:v.setFieldTouched,{onChange:P,onBlur:F,className:H,...q}=m,{children:L,...A}=b,O=G=>{let _=G.target.value,K=!!x||a?Dl(_,x,a):void 0;E==null||E(t,K),S==null||S(t,_),g==null||g(G),c==null||c(_),P==null||P(G);},D=G=>{T==null||T(t,true),M==null||M(G),u==null||u(),F==null||F(G);},U=R!==void 0?String(R):i!==void 0?i:"",V=(j=C?N:void 0)!=null?j:r,z=X__namespace.useRef(k);return X__namespace.useEffect(()=>{let G=!!x||a,_=k!==z.current;if(!E||!G){z.current=k;return}if(!C&&!_){z.current=k;return}let te=Dl(U,x,a);te!==N&&E(t,te),z.current=k;},[U,N,E,C,t,a,x,k]),s(je,{className:d,children:[e&&n(De,{htmlFor:t,...A,children:L!=null?L:s("span",{className:"flex items-center gap-1",children:[n("span",{children:e}),a&&n("span",{className:"text-destructive",children:"*"})]})}),n(Ja,{ref:f,id:t,name:t,placeholder:o,value:U,onChange:O,onBlur:D,"aria-invalid":!!V,className:H,...q}),n(Ue,{message:V})]})});function Dl(e,t,o){if(o&&!e)return typeof(t==null?void 0:t.required)=="string"?t.required:"This field is required";if(e){if(t!=null&&t.minLength&&e.length<t.minLength.value)return t.minLength.message;if(t!=null&&t.maxLength&&e.length>t.maxLength.value)return t.maxLength.message;if(t!=null&&t.pattern&&!t.pattern.value.test(e))return t.pattern.message;if(t!=null&&t.validate){let a=t.validate(e);if(typeof a=="string")return a;if(a===false)return "Invalid value"}}}Dg.displayName="FormTextarea";var Lg=e=>{var t;if(e)return e.setFieldValue||e.setFieldTouched||e.handleBlur?e:(t=e.form)!=null?t:e},Ig=X__namespace.forwardRef(({label:e,description:t,name:o,required:a=false,error:r,value:i,defaultValue:c,onChange:u,onBlur:d,form:b,options:m,className:h,labelProps:x={},radioGroupProps:f={},optionLabelProps:v={},optionWrapperClassName:p,...y},w)=>{var $,j;let R=Lg(b),N=R==null?void 0:R.values,C=R==null?void 0:R.errors,k=R==null?void 0:R.touched,g=N==null?void 0:N[o],M=C==null?void 0:C[o],S=($=(k==null?void 0:k[o])?M:void 0)!=null?$:r,{className:T,onValueChange:P,onBlur:F,value:H,defaultValue:q,...L}=f,A=(j=i!=null?i:H!==void 0?H:void 0)!=null?j:g!=null?String(g):void 0,O=A===void 0?c!=null?c:q:void 0,D=X__namespace.useCallback(G=>{var _;(_=R==null?void 0:R.setFieldValue)==null||_.call(R,o,G),u==null||u(G),P==null||P(G);},[R,o,u,P]),U=X__namespace.useCallback(G=>{var _,te;(_=R==null?void 0:R.setFieldTouched)==null||_.call(R,o,true),(te=R==null?void 0:R.handleBlur)==null||te.call(R,{target:{name:o}}),d==null||d(),F==null||F(G);},[R,o,d,F]),{className:V,...z}=v;return s(je,{ref:w,className:l("gap-3",h),...y,children:[(e||t)&&s("div",{className:"space-y-1",children:[e&&n(De,{...x,children:s("span",{className:"flex items-center gap-1",children:[n("span",{children:e}),a&&n("span",{className:"text-destructive",children:"*"})]})}),t?n("p",{className:"text-sm text-muted-foreground",children:t}):null]}),n(Os,{"aria-invalid":!!S,...L,...A!==void 0?{value:A}:O!==void 0?{defaultValue:O}:{},onValueChange:D,onBlur:U,className:l("grid gap-3",T),children:m.map(G=>{let _=`${o}-${G.value}`;return s("div",{className:l("flex items-start gap-3 rounded-lg border border-input bg-background p-3 shadow-xs",p,G.className,G.disabled&&"opacity-60"),children:[n(Bs,{id:_,value:G.value,disabled:G.disabled,"aria-invalid":!!S,className:"mt-1"}),s(De,{htmlFor:_,className:l("flex-col items-start gap-1 font-normal sm:flex-row sm:items-center sm:gap-2",V),...z,children:[n("span",{className:"text-sm font-medium text-foreground",children:G.label}),G.description?n("span",{className:"block text-sm text-muted-foreground",children:G.description}):null]})]},G.value)})}),n(Ue,{message:S})]})});Ig.displayName="FormRadioGroup";var Ag=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange||e.handleBlur?e:(t=e.form)!=null?t:e};function Lk({label:e,name:t,placeholder:o,required:a=false,error:r,value:i,defaultValue:c=null,onChange:u,onBlur:d,className:b,description:m,labelProps:h={},datePickerProps:x={},form:f,rules:v}){var re,ge,fe;let p=Ag(f),y=p==null?void 0:p.values,w=p==null?void 0:p.errors,R=p==null?void 0:p.touched,N=p==null?void 0:p.setFieldValue,C=p==null?void 0:p.setFieldError,k=p==null?void 0:p.setFieldTouched,g=p==null?void 0:p.handleChange,M=p==null?void 0:p.handleBlur,E=y==null?void 0:y[t],S=w==null?void 0:w[t],T=R==null?void 0:R[t],P=(re=p==null?void 0:p.validationSequence)!=null?re:0,{onChange:F,onBlur:H,value:q,defaultValue:L,placeholder:A,status:O,...D}=x,[U,V]=X__namespace.useState((ge=L!=null?L:c)!=null?ge:null);X__namespace.useEffect(()=>{var W;q===void 0&&i===void 0&&E===void 0&&V((W=L!=null?L:c)!=null?W:null);},[L,q,c,E,i]);let z=q!==void 0?q!=null?q:null:E!==void 0?E!=null?E:null:i!==void 0?i!=null?i:null:U,$=(fe=T?S:void 0)!=null?fe:r,j=O!=null?O:$?"error":void 0,G=A!=null?A:o,{children:_,...te}=h,K=X__namespace.useRef(P);X__namespace.useEffect(()=>{let W=!!v||a,ie=P!==K.current;if(!C||!W){K.current=P;return}if(!T&&!ie){K.current=P;return}let pe=Ll(z!=null?z:null,v,a);pe!==S&&C(t,pe),K.current=P;},[z,S,C,T,t,a,v,P]);let ce=X__namespace.useCallback((W,ie)=>{q===void 0&&i===void 0&&E===void 0&&V(W!=null?W:null);let pe=Ll(W,v,a);C==null||C(t,pe),N?N(t,W!=null?W:null):g&&g({target:{name:t,value:ie}}),u==null||u(W!=null?W:null),F==null||F(W!=null?W:null,ie);},[F,q,g,C,N,E,t,u,a,v,i]),le=X__namespace.useCallback(W=>{k==null||k(t,true),M==null||M({target:{name:t}}),d==null||d(),H==null||H(W);},[H,M,k,t,d]);return s(je,{className:b,children:[e&&n(De,{htmlFor:t,...te,children:_!=null?_:s("span",{className:"flex items-center gap-1",children:[n("span",{children:e}),a&&n("span",{className:"text-destructive",children:"*"})]})}),m&&n("p",{className:"text-sm text-muted-foreground",children:m}),n(Oa,{id:t,name:t,value:z!=null?z:null,onChange:ce,onBlur:le,placeholder:G,status:j,"aria-invalid":!!$,...D}),n(Ue,{message:$})]})}function Ll(e,t,o){if(o&&!e)return t&&typeof t.required=="string"?t.required:"This field is required";if(e){if(t!=null&&t.minDate&&e.isBefore(t.minDate.value,"day"))return t.minDate.message;if(t!=null&&t.maxDate&&e.isAfter(t.maxDate.value,"day"))return t.maxDate.message}if(t!=null&&t.validate){let a=t.validate(e!=null?e:null);if(typeof a=="string")return a;if(a===false)return "Invalid value"}}var _g=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange||e.handleBlur?e:(t=e.form)!=null?t:e};function Bk({label:e,name:t,placeholder:o,required:a=false,error:r,value:i,defaultValue:c=null,onChange:u,onBlur:d,className:b,description:m,labelProps:h={},timePickerProps:x={},form:f,rules:v}){var re,ge,fe;let p=_g(f),y=p==null?void 0:p.values,w=p==null?void 0:p.errors,R=p==null?void 0:p.touched,N=p==null?void 0:p.setFieldValue,C=p==null?void 0:p.setFieldError,k=p==null?void 0:p.setFieldTouched,g=p==null?void 0:p.handleChange,M=p==null?void 0:p.handleBlur,E=y==null?void 0:y[t],S=w==null?void 0:w[t],T=R==null?void 0:R[t],P=(re=p==null?void 0:p.validationSequence)!=null?re:0,{onChange:F,onBlur:H,value:q,defaultValue:L,placeholder:A,status:O,...D}=x,[U,V]=X__namespace.useState((ge=L!=null?L:c)!=null?ge:null);X__namespace.useEffect(()=>{var W;q===void 0&&i===void 0&&E===void 0&&V((W=L!=null?L:c)!=null?W:null);},[c,E,L,q,i]);let z=q!==void 0?q!=null?q:null:E!==void 0?E!=null?E:null:i!==void 0?i!=null?i:null:U,$=(fe=T?S:void 0)!=null?fe:r,j=O!=null?O:$?"error":void 0,G=A!=null?A:o,{children:_,...te}=h,K=X__namespace.useRef(P);X__namespace.useEffect(()=>{let W=!!v||a,ie=P!==K.current;if(!C||!W){K.current=P;return}if(!T&&!ie){K.current=P;return}let pe=Il(z!=null?z:null,v,a);pe!==S&&C(t,pe),K.current=P;},[z,S,C,T,t,a,v,P]);let ce=X__namespace.useCallback((W,ie)=>{q===void 0&&i===void 0&&E===void 0&&V(W!=null?W:null);let pe=Il(W,v,a);C==null||C(t,pe),N?N(t,W!=null?W:null):g&&g({target:{name:t,value:ie}}),u==null||u(W!=null?W:null),F==null||F(W!=null?W:null,ie);},[g,C,N,E,t,u,a,v,F,q,i]),le=X__namespace.useCallback(W=>{k==null||k(t,true),M==null||M({target:{name:t}}),d==null||d(),H==null||H(W);},[M,k,t,d,H]);return s(je,{className:b,children:[e&&n(De,{htmlFor:t,...te,children:_!=null?_:s("span",{className:"flex items-center gap-1",children:[n("span",{children:e}),a&&n("span",{className:"text-destructive",children:"*"})]})}),m&&n("p",{className:"text-sm text-muted-foreground",children:m}),n(tr,{id:t,name:t,value:z!=null?z:null,onChange:ce,onBlur:le,placeholder:G,status:j,"aria-invalid":!!$,...D}),n(Ue,{message:$})]})}function Il(e,t,o){if(o&&!e)return t&&typeof t.required=="string"?t.required:"This field is required";if(t!=null&&t.validate){let a=t.validate(e!=null?e:null);if(typeof a=="string")return a;if(a===false)return "Invalid value"}}var Fg=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange?e:(t=e.form)!=null?t:e},Hg=({name:e,label:t,description:o,className:a,checked:r,defaultChecked:i,onCheckedChange:c,switchProps:u,error:d,form:b,rules:m})=>{var z,$;let h=X__namespace.useId(),{id:x,onCheckedChange:f,className:v,disabled:p,"aria-describedby":y,"aria-labelledby":w,...R}=u!=null?u:{},N=x!=null?x:h,C=Fg(b),k=C==null?void 0:C.values,g=C==null?void 0:C.errors,M=C==null?void 0:C.touched,E=k==null?void 0:k[e],S=g==null?void 0:g[e],T=M==null?void 0:M[e],P=(z=C==null?void 0:C.validationSequence)!=null?z:0,F=($=T?S:void 0)!=null?$:d,H=E!==void 0?!!E:r!==void 0?r:void 0,q=o?`${N}-description`:void 0,L=F?`${N}-error`:void 0,A=[y,q,L].filter(Boolean).join(" ").trim()||void 0,O=t?[w,`${N}-label`].filter(Boolean).join(" ").trim()||void 0:w,D=X__namespace.useCallback(j=>{if(p)return;let G=document.getElementById(N);if(G){if(j.preventDefault(),typeof G.focus=="function")try{G.focus({preventScroll:!0});}catch{G.focus();}G.click();}},[p,N]),U=j=>{var te,K,ce;let _=!!m?Al(j,m):void 0;if((te=C==null?void 0:C.setFieldError)==null||te.call(C,e,_),(K=C==null?void 0:C.setFieldValue)==null||K.call(C,e,j),(ce=C==null?void 0:C.setFieldTouched)==null||ce.call(C,e,true),C!=null&&C.handleChange){let le={target:{name:e,value:j,checked:j}};C.handleChange(le);}c==null||c(j),f==null||f(j);},V=X__namespace.useRef(P);return X__namespace.useEffect(()=>{let j=!!m,G=P!==V.current;if(!(C!=null&&C.setFieldError)||!j){V.current=P;return}if(!T&&!G){V.current=P;return}let te=Al(E!==void 0?!!E:r!==void 0?r:!!i,m);te!==S&&C.setFieldError(e,te),V.current=P;},[r,i,S,T,E,e,C,m,P]),s("div",{className:l("flex items-start justify-between gap-4",a),children:[s("div",{className:"flex-1 space-y-2",children:[t?n(Xn,{id:`${N}-label`,htmlFor:N,onClick:D,className:l("text-sm leading-none font-medium",p?"cursor-not-allowed":"cursor-pointer"),children:t}):null,o?n(Kn,{id:q,children:o}):null,n(Jn,{id:L,children:F})]}),n(rl,{name:e,id:N,"aria-invalid":!!F,"aria-describedby":A,"aria-labelledby":O,className:l("cursor-pointer",v),disabled:p,...R,...H!==void 0?{checked:H}:{defaultChecked:i},onCheckedChange:U})]})};Hg.displayName="FormSwitch";function Al(e,t){if(t){if(t.required&&!e)return typeof t.required=="string"?t.required:"This field is required";if(t.validate){let o=t.validate(e);if(typeof o=="string")return o;if(o===false)return "Invalid value"}}}var Kk=["sidebar","floating","inset"],Jk=["offcanvas","icon","none"],Xk=["centered","full-width"],Zk=["sticky","scroll"];
|
|
9
|
-
Object.defineProperty(exports,"toast",{enumerable:true,get:function(){return sonner.toast}});exports.Accordion=
|
|
7
|
+
`)}}):null},gw=ua__namespace.Tooltip;function vw({active:e,payload:t,className:r,indicator:o="dot",hideLabel:n=false,hideIndicator:i=false,label:c,labelFormatter:u,labelClassName:d,formatter:v,color:m,nameKey:h,labelKey:x}){let{config:f}=ci(),b=J__namespace.useMemo(()=>{var R;if(n||!(t!=null&&t.length))return null;let[w]=t,y=`${x||(w==null?void 0:w.dataKey)||(w==null?void 0:w.name)||"value"}`,k=mo(f,w,y),P=!x&&typeof c=="string"?((R=f[c])==null?void 0:R.label)||c:k==null?void 0:k.label;return u?a("div",{className:l("font-medium",d),children:u(P,t)}):P?a("div",{className:l("font-medium",d),children:P}):null},[c,u,t,n,d,f,x]);if(!e||!(t!=null&&t.length))return null;let p=t.length===1&&o!=="dot";return s("div",{className:l("border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl",r),children:[p?null:b,a("div",{className:"grid gap-1.5",children:t.filter(w=>w.type!=="none").map((w,y)=>{let k=`${h||w.name||w.dataKey||"value"}`,P=mo(f,w,k),R=m||w.payload.fill||w.color;return a("div",{className:l("[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",o==="dot"&&"items-center"),children:v&&(w==null?void 0:w.value)!==void 0&&w.name?v(w.value,w.name,w,y,w.payload):s(jsxRuntime.Fragment,{children:[P!=null&&P.icon?a(P.icon,{}):!i&&a("div",{className:l("shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",{"h-2.5 w-2.5":o==="dot","w-1":o==="line","w-0 border-[1.5px] border-dashed bg-transparent":o==="dashed","my-0.5":p&&o==="dashed"}),style:{"--color-bg":R,"--color-border":R}}),s("div",{className:l("flex flex-1 justify-between leading-none",p?"items-end":"items-center"),children:[s("div",{className:"grid gap-1.5",children:[p?b:null,a("span",{className:"text-muted-foreground",children:(P==null?void 0:P.label)||w.name})]}),w.value&&a("span",{className:"text-foreground font-mono font-medium tabular-nums",children:w.value.toLocaleString()})]})]})},w.dataKey)})})]})}var bw=ua__namespace.Legend;function hw({className:e,hideIcon:t=false,payload:r,verticalAlign:o="bottom",nameKey:n}){let{config:i}=ci();return r!=null&&r.length?a("div",{className:l("flex items-center justify-center gap-4",o==="top"?"pb-3":"pt-3",e),children:r.filter(c=>c.type!=="none").map(c=>{let u=`${n||c.dataKey||"value"}`,d=mo(i,c,u);return s("div",{className:l("[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"),children:[d!=null&&d.icon&&!t?a(d.icon,{}):a("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:c.color}}),d==null?void 0:d.label]},c.value)})}):null}function mo(e,t,r){if(typeof t!="object"||t===null)return;let o="payload"in t&&typeof t.payload=="object"&&t.payload!==null?t.payload:void 0,n=r;return r in t&&typeof t[r]=="string"?n=t[r]:o&&r in o&&typeof o[r]=="string"&&(n=o[r]),n in e?e[n]:e[r]}var Va=J__namespace.forwardRef(function({className:t,...r},o){return a(radixUi.Checkbox.Root,{ref:o,"data-slot":"checkbox",className:l("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-primary focus-visible:ring-primary/40 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",t),...r,children:a(radixUi.Checkbox.Indicator,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:a(lucideReact.CheckIcon,{className:"size-3.5"})})})});function pa({...e}){return a(radixUi.Dialog.Root,{"data-slot":"dialog",...e})}function pi({...e}){return a(radixUi.Dialog.Trigger,{"data-slot":"dialog-trigger",...e})}function Vd({...e}){return a(radixUi.Dialog.Portal,{"data-slot":"dialog-portal",...e})}function Mw({...e}){return a(radixUi.Dialog.Close,{"data-slot":"dialog-close",...e})}function jd({className:e,...t}){return a(radixUi.Dialog.Overlay,{"data-slot":"dialog-overlay",className:l("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 ma({className:e,children:t,showCloseButton:r=true,...o}){return s(Vd,{"data-slot":"dialog-portal",children:[a(jd,{}),s(radixUi.Dialog.Content,{"data-slot":"dialog-content",className:l("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...o,children:[t,r&&s(radixUi.Dialog.Close,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground 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 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[a(lucideReact.XIcon,{}),a("span",{className:"sr-only",children:"Close"})]})]})]})}function fa({className:e,...t}){return a("div",{"data-slot":"dialog-header",className:l("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Ew({className:e,...t}){return a("div",{"data-slot":"dialog-footer",className:l("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function ga({className:e,...t}){return a(radixUi.Dialog.Title,{"data-slot":"dialog-title",className:l("text-lg leading-none font-semibold",e),...t})}function va({className:e,...t}){return a(radixUi.Dialog.Description,{"data-slot":"dialog-description",className:l("text-muted-foreground text-sm",e),...t})}function fo({className:e,...t}){return a(cmdk.Command,{"data-slot":"command",className:l("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function Fw({title:e="Command Palette",description:t="Search for a command to run...",children:r,className:o,showCloseButton:n=true,...i}){return s(pa,{...i,children:[s(fa,{className:"sr-only",children:[a(ga,{children:e}),a(va,{children:t})]}),a(ma,{className:l("overflow-hidden p-0",o),showCloseButton:n,children:a(fo,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:r})})]})}function mi({className:e,...t}){return s("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[a(lucideReact.SearchIcon,{className:"size-4 shrink-0 opacity-50"}),a(cmdk.Command.Input,{"data-slot":"command-input",className:l("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function fi({className:e,...t}){return a(cmdk.Command.List,{"data-slot":"command-list",className:l("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function gi({...e}){return a(cmdk.Command.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function Hw({className:e,...t}){return a(cmdk.Command.Group,{"data-slot":"command-group",className:l("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}function Ow({className:e,...t}){return a(cmdk.Command.Separator,{"data-slot":"command-separator",className:l("bg-border -mx-1 h-px",e),...t})}function vi({className:e,...t}){return a(cmdk.Command.Item,{"data-slot":"command-item",className:l("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function Bw({className:e,...t}){return a("span",{"data-slot":"command-shortcut",className:l("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}function qw({...e}){return a(radixUi.ContextMenu.Root,{"data-slot":"context-menu",...e})}function Ww({...e}){return a(radixUi.ContextMenu.Trigger,{"data-slot":"context-menu-trigger",...e})}function Yw({...e}){return a(radixUi.ContextMenu.Group,{"data-slot":"context-menu-group",...e})}function Kw({...e}){return a(radixUi.ContextMenu.Portal,{"data-slot":"context-menu-portal",...e})}function Xw({...e}){return a(radixUi.ContextMenu.Sub,{"data-slot":"context-menu-sub",...e})}function Jw({...e}){return a(radixUi.ContextMenu.RadioGroup,{"data-slot":"context-menu-radio-group",...e})}function Zw({className:e,inset:t,children:r,...o}){return s(radixUi.ContextMenu.SubTrigger,{"data-slot":"context-menu-sub-trigger","data-inset":t,className:l("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 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...o,children:[r,a(lucideReact.ChevronRightIcon,{className:"ml-auto"})]})}function Qw({className:e,...t}){return a(radixUi.ContextMenu.SubContent,{"data-slot":"context-menu-sub-content",className:l("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-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",e),...t})}function ex({className:e,...t}){return a(radixUi.ContextMenu.Portal,{children:a(radixUi.ContextMenu.Content,{"data-slot":"context-menu-content",className:l("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-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...t})})}function tx({className:e,inset:t,variant:r="default",...o}){return a(radixUi.ContextMenu.Item,{"data-slot":"context-menu-item","data-inset":t,"data-variant":r,className:l("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 cursor-default 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),...o})}function ax({className:e,children:t,checked:r,...o}){return s(radixUi.ContextMenu.CheckboxItem,{"data-slot":"context-menu-checkbox-item",className:l("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:r,...o,children:[a("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:a(radixUi.ContextMenu.ItemIndicator,{children:a(lucideReact.CheckIcon,{className:"size-4"})})}),t]})}function rx({className:e,children:t,...r}){return s(radixUi.ContextMenu.RadioItem,{"data-slot":"context-menu-radio-item",className:l("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),...r,children:[a("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:a(radixUi.ContextMenu.ItemIndicator,{children:a(lucideReact.CircleIcon,{className:"size-2 fill-current"})})}),t]})}function ox({className:e,inset:t,...r}){return a(radixUi.ContextMenu.Label,{"data-slot":"context-menu-label","data-inset":t,className:l("text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...r})}function nx({className:e,...t}){return a(radixUi.ContextMenu.Separator,{"data-slot":"context-menu-separator",className:l("bg-border -mx-1 my-1 h-px",e),...t})}function ix({className:e,...t}){return a("span",{"data-slot":"context-menu-shortcut",className:l("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}var su={YYYY:"yyyy",YY:"yy",MM:"MM",M:"M",DD:"dd",D:"d"},lu=e=>{var t;return (t=su[e])!=null?t:e},cu=/(YYYY|YY|MM|M|DD|D|HH|H|mm|m|ss|s)/g,go=e=>e.replace(cu,t=>t==="HH"?"HH":t==="H"?"H":t==="mm"?"mm":t==="m"?"m":t==="ss"?"ss":t==="s"?"s":lu(t)),fr=e=>!Number.isNaN(e.getTime()),Yt=class e{constructor(t){this.value=t;}create(t){return new e(t)}clone(){return this.create(new Date(this.value.getTime()))}add(t,r){switch(r){case "month":return this.create(dateFns.addMonths(this.value,t));case "year":return this.create(dateFns.addYears(this.value,t));default:return this.create(dateFns.addDays(this.value,t))}}subtract(t,r){return this.add(-t,r)}startOf(t){switch(t){case "month":return this.create(dateFns.startOfMonth(this.value));case "year":return this.create(dateFns.startOfYear(this.value));case "week":return this.create(dateFns.startOfWeek(this.value,{weekStartsOn:0}));default:return this.create(dateFns.startOfDay(this.value))}}endOf(t){if(t==="year")return this.create(dateFns.endOfYear(this.value));if(t==="month"){let n=dateFns.startOfMonth(this.value),i=dateFns.addDays(dateFns.addMonths(n,1),-1);return this.create(i)}let r=dateFns.startOfDay(this.value),o=dateFns.addDays(r,1);return this.create(dateFns.addDays(o,-1))}isSame(t,r="day"){switch(r){case "month":return dateFns.isSameMonth(this.value,t.toDate());case "year":return dateFns.isSameYear(this.value,t.toDate());case "week":return this.startOf("week").valueOf()===t.startOf("week").valueOf();default:return dateFns.isSameDay(this.value,t.toDate())}}isBefore(t,r){if(r){let o=this.startOf(r),n=t.startOf(r);return o.valueOf()<n.valueOf()}return dateFns.isBefore(this.value,t.toDate())}isAfter(t,r){if(r){let o=this.startOf(r),n=t.startOf(r);return o.valueOf()>n.valueOf()}return dateFns.isAfter(this.value,t.toDate())}format(t){return dateFns.format(this.value,go(t))}daysInMonth(){return dateFns.getDaysInMonth(this.value)}month(t){return typeof t=="number"?this.create(dateFns.setMonth(this.value,t)):this.value.getMonth()}year(t){return typeof t=="number"?this.create(dateFns.setYear(this.value,t)):this.value.getFullYear()}date(t){return typeof t=="number"?this.create(dateFns.setDate(this.value,t)):this.value.getDate()}isValid(){return fr(this.value)}toDate(){return new Date(this.value.getTime())}valueOf(){return this.value.getTime()}},du=e=>{if(e instanceof Yt)return e.toDate();if(e instanceof Date)return new Date(e.getTime());if(typeof e=="number")return new Date(e);if(typeof e=="string"){let t=new Date(e);if(fr(t))return t}return new Date},xt=(e,t)=>{if(typeof e=="string"&&t){let r=dateFns.parse(e,go(t),new Date);return fr(r)?new Yt(r):new Yt(new Date(NaN))}return new Yt(du(e))},yi=(e,t)=>{let r=dateFns.parse(e,go(t),new Date);return fr(r)?new Yt(r):null};function vo(e){return Object.keys(e).reduce((t,r)=>{let o=e[r];return o&&(t[r]=o),t},{})}function px(e){let[t,r]=J.useState({values:e.initialValues,errors:{},fieldErrors:{},touched:{},isSubmitting:false,isValid:false,validationSequence:0}),o=J.useCallback((f=t.values)=>{let b=e.validate?e.validate(f):{},p=vo({...b,...t.fieldErrors}),w=Object.keys(p).length===0;return r(y=>({...y,errors:p,isValid:w})),w},[e.validate,t.fieldErrors,t.values]),n=J.useCallback((f,b)=>{r(p=>{let w={...p.values,[f]:b},y={...p.fieldErrors};delete y[f];let k=e.validate?e.validate(w):{},P=vo({...k,...y}),R=Object.keys(P).length===0;return {...p,values:w,fieldErrors:y,errors:P,isValid:R}});},[e.validate]),i=J.useCallback((f,b=true)=>{r(p=>({...p,touched:{...p.touched,[f]:b}}));},[]),c=J.useCallback((f,b)=>{r(p=>{let w={...p.fieldErrors};b?w[f]=b:delete w[f];let y=e.validate?e.validate(p.values):{},k=vo({...y,...w}),P=Object.keys(k).length===0;return {...p,fieldErrors:w,errors:k,isValid:P}});},[e.validate]),u=J.useCallback(()=>{r(f=>({...f,validationSequence:f.validationSequence+1}));},[]),d=J.useCallback(f=>{let{name:b,value:p}=f.target;n(b,p);},[n]),v=J.useCallback(f=>{let{name:b}=f.target;i(b,true),o();},[i,o]),m=J.useCallback(async f=>{f&&(f.preventDefault(),f.stopPropagation()),r(w=>{let y=Object.keys(w.values).reduce((k,P)=>(k[P]=true,k),{});return {...w,touched:y,validationSequence:w.validationSequence+1}});let b=t.values;if(o(b)&&!(Object.keys(t.fieldErrors).length>0)){r(w=>({...w,isSubmitting:true}));try{await e.onSubmit(b);}catch(w){console.error("Form submission error:",w);}finally{r(w=>({...w,isSubmitting:false}));}}},[e.onSubmit,o,t.values]),h=J.useCallback(()=>{r({values:e.initialValues,errors:{},fieldErrors:{},touched:{},isSubmitting:false,isValid:false,validationSequence:0});},[e.initialValues]);return {...t,...{setFieldValue:n,setFieldTouched:i,setFieldError:c,handleChange:d,handleBlur:v,handleSubmit:m,resetForm:h,validateForm:()=>o(),triggerValidation:u},form:{values:t.values,errors:t.errors,fieldErrors:t.fieldErrors,touched:t.touched,validationSequence:t.validationSequence,setFieldValue:(f,b)=>{n(f,b);},setFieldError:(f,b)=>{c(f,b);},setFieldTouched:(f,b)=>{i(f,b);},handleChange:d,handleBlur:v,handleSubmit:m,resetForm:h,validateForm:()=>o(),triggerValidation:u,isSubmitting:t.isSubmitting,isValid:t.isValid}}}var ki=768;function bo(){var i,c;if(typeof window=="undefined")return false;let e=window.innerWidth<ki,t=window.navigator,r=(t.userAgent||"").toLowerCase(),o=/android|iphone|ipad|ipod|blackberry|iemobile|opera mini/.test(r),n=(c=(i=t.userAgentData)==null?void 0:i.mobile)!=null?c:false;return e||o||n}function nt(){let[e,t]=J__namespace.useState(()=>bo());return J__namespace.useEffect(()=>{let r=window.matchMedia(`(max-width: ${ki-1}px)`),o=()=>{t(bo());};return typeof r.addEventListener=="function"?r.addEventListener("change",o):typeof r.addListener=="function"&&r.addListener(o),t(bo()),()=>{typeof r.removeEventListener=="function"?r.removeEventListener("change",o):typeof r.removeListener=="function"&&r.removeListener(o);}},[]),e}var Ri=e=>({title:"",subtitle:void 0,supportingText:void 0,heroBadge:void 0,icon:void 0,back:void 0,actions:void 0,variant:void 0,...e}),Ci=e=>{let t=J.useMemo(()=>Ri(e),[e]),[r,o]=J.useState([t]),n=r[r.length-1],i=r.length>1,c=J.useCallback(m=>{o(h=>{let x=[...h],f=x.length-1;return x[f]={...t,...m},x});},[t]),u=J.useCallback(m=>{o(h=>[...h,{...t,...m}]);},[t]),d=J.useCallback(()=>{i&&o(m=>m.slice(0,-1));},[i]),v=J.useCallback(m=>{o([Ri(m!=null?m:t)]);},[t]);return {header:n,navigationState:n,navigationStack:r,setHeader:c,navigateTo:u,navigateBack:d,canGoBack:i,resetNavigation:v}},vu=()=>{let e=globalThis;return e.__GOMENIUCIVAN_MOBILE_HEADER_CONTEXT__||(e.__GOMENIUCIVAN_MOBILE_HEADER_CONTEXT__=J.createContext(null)),e.__GOMENIUCIVAN_MOBILE_HEADER_CONTEXT__},Ti=vu(),Pi=({initialState:e,children:t})=>{let r=Ci(e);return a(Ti.Provider,{value:r,children:t})},Ni=e=>{let t=J.useContext(Ti);return t||Ci(e)};var hu=400,Ei=200,Di=.95,Li=()=>typeof window=="undefined"?"":`${window.location.pathname}${window.location.search}${window.location.hash}`,Ii=(e,t)=>{if(typeof window=="undefined")return ()=>{};let r=window.history,o=r[e];return o?(r[e]=function(...i){let c=o.apply(this,i);return t(),c},()=>{r[e]=o;}):()=>{}},wu=(e,t)=>{if(typeof window=="undefined")return ()=>{};let r=[],o=null,n={current:Li()},i=()=>{o&&window.clearTimeout(o),o=window.setTimeout(()=>{o=null,t();},hu);},c=()=>{let m=Li();if(m===n.current){t();return}n.current=m,e(),i();};r.push(Ii("pushState",c)),r.push(Ii("replaceState",c));let u=()=>{c();};window.addEventListener("popstate",u),r.push(()=>window.removeEventListener("popstate",u));let d=()=>{c();};window.addEventListener("hashchange",d),r.push(()=>window.removeEventListener("hashchange",d));let v=()=>{o&&(window.clearTimeout(o),o=null),t();};return window.addEventListener("load",v),window.addEventListener("pageshow",v),r.push(()=>{window.removeEventListener("load",v),window.removeEventListener("pageshow",v);}),()=>{r.forEach(m=>m()),o&&window.clearTimeout(o);}},xu=({color:e,framework:t})=>{let[r,o]=J.useState(false),n=J.useRef(r),[i,c]=J.useState(0),u=J.useRef(null),d=J.useRef(null),v=J.useCallback(()=>{d.current&&(window.clearTimeout(d.current),d.current=null),n.current=true,o(true),c(x=>x>0&&x<.2?x:.2);},[]),m=J.useCallback(()=>{n.current&&(u.current&&(window.clearTimeout(u.current),u.current=null),c(1),d.current=window.setTimeout(()=>{n.current=false,o(false),c(0);},200));},[]);J.useEffect(()=>{n.current=r;},[r]),J.useEffect(()=>typeof window=="undefined"?()=>{}:wu(v,m),[v,m,t]),J.useEffect(()=>{if(!r){u.current&&(window.clearTimeout(u.current),u.current=null);return}let x=()=>{c(f=>{if(f>=Di)return f;let b=(1-f)*.1;return Math.min(f+b,Di)}),u.current=window.setTimeout(x,Ei);};return u.current=window.setTimeout(x,Ei),()=>{u.current&&(window.clearTimeout(u.current),u.current=null);}},[r]),J.useEffect(()=>()=>{u.current&&window.clearTimeout(u.current),d.current&&window.clearTimeout(d.current);},[]);let h=J.useMemo(()=>({position:"fixed",top:0,left:0,height:"2px",width:`${Math.max(i*100,0)}%`,backgroundColor:e,boxShadow:"0 0 8px rgba(0, 0, 0, 0.15)",opacity:r?1:0,transition:"width 0.2s ease, opacity 0.2s ease",transform:"translateZ(0)",zIndex:9999}),[e,i,r]);return a("div",{"aria-hidden":"true",style:h})},hr=xu;var _i=({color:e,framework:t})=>a(hr,{color:e,framework:t});var zi=({color:e,framework:t})=>a(hr,{color:e,framework:t});var yu={nextjs:zi},Ai=e=>{var t;return (t=yu[e])!=null?t:_i};var Fi=({color:e,framework:t})=>{let[r,o]=J.useState(false);if(J.useEffect(()=>{o(true);},[]),!r)return null;let n=Ai(t);return a(n,{color:e,framework:t})};var wo=e=>{if(e===void 0||e===""||e===null||e==="undefined"||e==="null")return true;let t=e.toString();try{t=t.trim();}catch{return true}return !t||t.length===0};var Kt=e=>{if(wo(e))return false;if(typeof e=="boolean")return e;if(typeof e=="string"){let t=e.toLowerCase();return t==="true"||t==="yes"||t==="1"}else return !!e};var Bi,yt=typeof process!="undefined"&&!!((Bi=process==null?void 0:process.versions)!=null&&Bi.node),xo=null,yo=null,Vi=Function("specifier","return import(specifier);"),Xt=()=>yt?(xo||(xo=Vi("node:"+["fs","promises"].join("/"))),xo):null,ja=()=>yt?(yo||(yo=Vi("node:path")),yo):null,Hi={debug:10,info:20,warning:30,error:40,critical:50},Cu=30,Tu=1e3,Pu=20,Nu=e=>e===false?null:typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):Cu,Oi=e=>{var u,d,v,m,h,x,f;let t=typeof process!="undefined"?(u=process==null?void 0:process.env)==null?void 0:u.NODE_ENV:void 0,r=Nu(e==null?void 0:e.storeDays),o=(d=e==null?void 0:e.level)!=null?d:"info",n=(v=e==null?void 0:e.consoleLogging)!=null?v:t!=="production",c=!!(e!=null&&e.enable)&&(t==="production"||!!(e!=null&&e.writeToFileInDev))&&yt;return {enable:!!(e!=null&&e.enable),level:o,retentionDays:r,json:!!(e!=null&&e.json),slowRequestThresholdMs:(m=e==null?void 0:e.slowRequestThresholdMs)!=null?m:Tu,maxFileSizeBytes:Math.max(1,(h=e==null?void 0:e.maxFileSizeMB)!=null?h:Pu)*1024*1024,directory:(x=e==null?void 0:e.directory)!=null?x:"monitoring",consoleLogging:n,captureUnhandled:(f=e==null?void 0:e.captureUnhandled)!=null?f:true,writeToFile:c}},Su=(e,t)=>Hi[e]>=Hi[t],Mu=e=>{var t;if(e)return e instanceof Error?{name:e.name,message:e.message,stack:e.stack}:typeof e=="object"?{name:e.name,message:String((t=e.message)!=null?t:e),stack:e.stack,raw:e}:{message:String(e)}},Eu=e=>typeof(e==null?void 0:e.then)=="function",wr=class{constructor(t){this.directoryCache=null;this.initialized=false;this.options=Oi(t),this.publicApi=this.createPublicApi(),this.options.enable&&this.initialize();}get api(){return this.publicApi}updateOptions(t){let r=this.options.enable,o=this.options.level,n=this.options.json,i=this.options.slowRequestThresholdMs,c=this.options.retentionDays,u=this.options.directory,d=this.options.writeToFile;if(this.options=Oi(t),this.options.directory!==u&&(this.directoryCache=null),!this.options.enable){this.detachProcessHandlers();return}(!r||this.options.level!==o||this.options.json!==n||this.options.slowRequestThresholdMs!==i||this.options.retentionDays!==c||this.options.directory!==u||this.options.writeToFile!==d)&&this.initialize();}async initialize(){if(this.initialized){await this.ensureDirectory(),this.options.retentionDays!==null&&await this.purgeLogs(),this.ensureProcessHandlers();return}await this.ensureDirectory(),this.options.retentionDays!==null&&await this.purgeLogs(),this.ensureProcessHandlers(),this.initialized=true;}createPublicApi(){return {log:(t,r,o)=>this.log(t,r,o),debug:(t,r)=>this.log("debug",t,r),info:(t,r)=>this.log("info",t,r),warning:(t,r)=>this.log("warning",t,r),error:(t,r)=>this.log("error",t,r),critical:(t,r)=>this.log("critical",t,r),logRequest:t=>this.logRequest(t),monitorRequest:(t,r)=>this.monitorRequest(t,r),deleteLogFile:t=>this.deleteLogFile(t),purgeLogs:()=>this.purgeLogs(),listLogFiles:()=>this.listLogFiles(),getLogDirectory:()=>this.getDirectoryPath(),getOptions:()=>this.options,updateOptions:t=>this.updateOptions(t)}}async getDirectoryPath(){if(!yt)return null;if(this.directoryCache)return this.directoryCache;let t=await ja();if(!t)return null;let r=this.options.directory,o=t.isAbsolute(r)?r:t.join(process.cwd(),r);return this.directoryCache=o,o}async ensureDirectory(){if(!this.options.enable||!yt)return;let t=await Xt(),r=await this.getDirectoryPath();if(!(!t||!r))try{await t.mkdir(r,{recursive:!0});}catch(o){this.options.consoleLogging&&console.error("[monitoring] Failed to create directory",o);}}ensureProcessHandlers(){if(!this.options.enable||!this.options.captureUnhandled||!yt)return;let t=process;if(!(t!=null&&t.on)||this.processHandlers)return;let r=(...n)=>{let[i]=n;this.log("critical","Uncaught exception detected",{error:i});},o=(...n)=>{let[i]=n;this.log("error","Unhandled promise rejection detected",{error:i});};t.on("uncaughtException",r),t.on("unhandledRejection",o),this.processHandlers={exception:r,rejection:o};}detachProcessHandlers(){if(!this.processHandlers||!yt)return;let t=process,{exception:r,rejection:o}=this.processHandlers;t!=null&&t.off?(t.off("uncaughtException",r),t.off("unhandledRejection",o)):t!=null&&t.removeListener&&(t.removeListener("uncaughtException",r),t.removeListener("unhandledRejection",o)),this.processHandlers=void 0;}resolveLogEntry(t,r,o){let n=o==null?void 0:o.context,i=Mu(o==null?void 0:o.error),{error:c,context:u,metadata:d,...v}=o!=null?o:{},m={};return d&&typeof d=="object"&&(m.metadata=d),Object.assign(m,v),{timestamp:new Date,level:t,message:r,context:n,error:i,metadata:Object.keys(m).length>0?m:void 0}}async log(t,r,o){if(!Su(t,this.options.level))return;let i=this.resolveLogEntry(t,r,o);this.options.consoleLogging&&this.consoleLog(i),!(!this.options.enable||!this.options.writeToFile||!yt)&&(await this.writeLogEntry(i),this.options.retentionDays!==null&&await this.purgeLogs());}consoleLog(t){let r=t.timestamp.toISOString(),o={...t.metadata,context:t.context,error:t.error},n=[`[monitoring] ${r} [${t.level.toUpperCase()}] ${t.message}`,o];switch(t.level){case "error":case "critical":console.error(...n);break;case "warning":console.warn(...n);break;case "info":console.info(...n);break;default:console.debug(...n);break}}async writeLogEntry(t){let r=await Xt(),o=await ja(),n=await this.getDirectoryPath();if(!(!r||!o||!n))try{let i=await this.resolveLogFilePath(n);if(!i)return;let c=this.options.json?this.serializeJsonEntry(t):this.serializeTextEntry(t);await r.appendFile(i,c+`
|
|
8
|
+
`);}catch(i){this.options.consoleLogging&&console.error("[monitoring] Failed to write log entry",i);}}serializeTextEntry(t){let o=[`[${t.timestamp.toISOString()}]`,`[${t.level.toUpperCase()}]`,t.message];return t.context&&Object.keys(t.context).length>0&&o.push(`context=${JSON.stringify(t.context)}`),t.metadata&&Object.keys(t.metadata).length>0&&o.push(`metadata=${JSON.stringify(t.metadata)}`),t.error&&o.push(`error=${JSON.stringify(t.error)}`),o.join(" ")}serializeJsonEntry(t){return JSON.stringify({timestamp:t.timestamp.toISOString(),level:t.level,message:t.message,context:t.context,metadata:t.metadata,error:t.error})}async resolveLogFilePath(t){let r=await Xt(),o=await ja();if(!r||!o)return null;let n=new Date,i=[n.getFullYear(),String(n.getMonth()+1).padStart(2,"0"),String(n.getDate()).padStart(2,"0")].join("-"),c=this.options.json?"jsonl":"log",u=`${i}.${c}`,d=o.join(t,u);if(!await this.isFileExceedingSize(d))return d;let v=1;for(;;){let m=`${i}-${v}.${c}`,h=o.join(t,m);if(!await this.isFileExceedingSize(h))return h;v+=1;}}async isFileExceedingSize(t){let r=await Xt();if(!r)return false;try{return (await r.stat(t)).size>=this.options.maxFileSizeBytes}catch(o){if(o.code==="ENOENT")return false;throw o}}async logRequest(t){var c,u,d;let r=(c=t.thresholdMs)!=null?c:this.options.slowRequestThresholdMs;if(t.durationMs<r)return;let o=((u=t.method)!=null?u:"REQUEST").toUpperCase(),n=`Slow request detected for ${o} ${(d=t.url)!=null?d:""}`,i=t.durationMs>=r*2?"error":"warning";await this.log(i,n,{context:{method:o,url:t.url,durationMs:t.durationMs,statusCode:t.statusCode,thresholdMs:r},metadata:t.metadata});}async monitorRequest(t,r){let o=Date.now();try{let n=r();return Eu(n)?await n:n}catch(n){throw await this.log("error","Monitored request failed",{context:{method:t.method,url:t.url,operationName:t.operationName,statusCode:t.statusCode},error:n}),n}finally{let n=Date.now()-o;await this.logRequest({...t,durationMs:n});}}async purgeLogs(){if(!this.options.enable||this.options.retentionDays===null)return;let t=await Xt(),r=await ja(),o=await this.getDirectoryPath();if(!(!t||!r||!o))try{let n=await t.readdir(o,{withFileTypes:!0}),i=Date.now()-this.options.retentionDays*24*60*60*1e3;await Promise.all(n.filter(c=>c.isFile()).map(async c=>{let u=r.join(o,c.name);try{(await t.stat(u)).mtime.getTime()<i&&await t.rm(u,{force:!0});}catch(d){this.options.consoleLogging&&console.warn("[monitoring] Failed to purge log file",d);}}));}catch(n){this.options.consoleLogging&&console.error("[monitoring] Failed to read monitoring directory",n);}}async deleteLogFile(t){if(!yt)return;let r=await Xt(),o=await ja(),n=await this.getDirectoryPath();if(!(!r||!o||!n))try{if(!t){let u=await r.readdir(n,{withFileTypes:!0});await Promise.all(u.map(async d=>{let v=o.join(n,d.name);await r.rm(v,{force:!0,recursive:d.isDirectory()});}));return}let i=o.basename(t),c=o.join(n,i);await r.rm(c,{force:!0});}catch(i){this.options.consoleLogging&&console.error("[monitoring] Failed to delete log file",i);}}async listLogFiles(){if(!yt)return [];let t=await Xt(),r=await this.getDirectoryPath();if(!t||!r)return [];try{return (await t.readdir(r)).sort()}catch(o){return this.options.consoleLogging&&console.error("[monitoring] Failed to list log files",o),[]}}},Jt=null,Du=()=>(Jt||(Jt=new wr),Jt),xr=e=>(Jt?Jt.updateOptions(e):Jt=new wr(e),Jt.api),ji=()=>Du().api,Lu=e=>{let t=J__namespace.useRef(null);return J__namespace.useEffect(()=>{if(!e)return;let r=t.current,o=JSON.stringify(e),n=r?JSON.stringify(r):void 0;o!==n&&(t.current=e,xr(e));},[e]),J__namespace.useMemo(()=>ji(),[])};function Ga(e,t="info",r){let{title:o,description:n,duration:i=4e3,action:c}=r||{},u={duration:i,...c&&{action:{label:c.label,onClick:c.onClick}}};switch(t){case "success":sonner.toast.success(o||e,{description:n,...u});break;case "error":sonner.toast.error(o||e,{description:n,...u});break;case "warning":sonner.toast.warning(o||e,{description:n,...u});break;case "info":default:sonner.toast.info(o||e,{description:n,...u});break}}var Iu=(e,t)=>Ga(e,"success",t),_u=(e,t)=>Ga(e,"error",t),zu=(e,t)=>Ga(e,"warning",t),Au=(e,t)=>Ga(e,"info",t);var Bu=()=>{let[e,t]=J.useState([]),[r,o]=J.useState(true),[n,i]=J.useState(null);return J.useEffect(()=>{let c=false;return (async()=>{if(typeof caches=="undefined")throw new Error("The Cache Storage API is not available in this environment.");let d=await caches.keys();c||t(d);})().catch(d=>{c||i(d instanceof Error?d.message:String(d));}).finally(()=>{c||o(false);}),()=>{c=true;}},[]),s(Ge,{className:"h-full",children:[s(Ke,{children:[s(Xe,{className:"flex items-center gap-2 text-base",children:[a(lucideReact.HardDrive,{className:"size-4"}),"Cache storage"]}),a(Je,{children:"Inspect browser-managed caches available to this origin."})]}),a($e,{className:"flex h-full flex-col gap-4",children:r?s("div",{className:"flex flex-1 items-center justify-center text-muted-foreground",children:[a(lucideReact.Loader2,{className:"size-5 animate-spin"})," Loading caches\u2026"]}):n?s(at,{variant:"destructive",children:[a(rt,{children:"Unable to load caches"}),a(ot,{children:n})]}):e.length===0?s(at,{children:[a(rt,{children:"No caches detected"}),a(ot,{children:"Service worker caches will appear here when they are created in development."})]}):a(It,{className:"max-h-[360px] pr-2",children:a("div",{className:"space-y-2",children:e.map(c=>s("div",{className:"flex items-center justify-between rounded-md border bg-muted/30 px-3 py-2",children:[a("span",{className:"font-medium",children:c}),a($t,{variant:"outline",children:"Cache"})]},c))})})})]})},Ui=Bu;var Yi={};var Uu=["NEXT_PUBLIC_SUPABASE_SCHEMA","VITE_SUPABASE_SCHEMA","SUPABASE_SCHEMA"],Gu=["NEXT_PUBLIC_SUPABASE_URL","VITE_SUPABASE_URL","SUPABASE_URL"],$u=["NEXT_PUBLIC_SUPABASE_ANON_KEY","VITE_SUPABASE_ANON_KEY","SUPABASE_ANON_KEY","SUPABASE_SERVICE_ROLE_KEY"],Ro=e=>{var t;for(let r of e){if(typeof process!="undefined"&&typeof process.env=="object"){let o=process.env[r];if(typeof o=="string"&&o.length>0)return o}if(typeof Yi!="undefined"){let o=Yi.env,n=o==null?void 0:o[r];if(typeof n=="string"&&n.length>0)return n}if(typeof globalThis!="undefined"){let o=globalThis[r];if(typeof o=="string"&&o.length>0)return o;let n=(t=globalThis.__env__)==null?void 0:t[r];if(typeof n=="string"&&n.length>0)return n}}},qu=()=>{var n,i,c,u,d,v;let e=(i=typeof globalThis!="undefined"&&(n=globalThis.__DEVPANEL_SUPABASE__)!=null?n:null)!=null?i:null,t=(u=(c=e==null?void 0:e.schema)!=null?c:Ro(Uu))!=null?u:"public",r=(d=e==null?void 0:e.url)!=null?d:Ro(Gu),o=(v=e==null?void 0:e.key)!=null?v:Ro($u);return !r||!o?null:{url:r,key:o,schema:t}},Wu=e=>({apikey:e.key,Authorization:`Bearer ${e.key}`,Accept:"application/json","Content-Type":"application/json",Prefer:"count=exact"}),Wi=e=>{if(e instanceof Error)return e.message;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return "Unknown error"}},Yu=e=>{var o;if(!e)return;let t=/\/(\d+)$/.exec(e);if(!t)return;let r=Number.parseInt((o=t[1])!=null?o:"",10);return Number.isFinite(r)?r:void 0},Ku=({provider:e})=>{let[t]=J.useState(()=>qu()),[r,o]=J.useState([]),[n,i]=J.useState([]),[c,u]=J.useState([]),[d,v]=J.useState(false),[m,h]=J.useState(false),[x,f]=J.useState(null),[b,p]=J.useState(null),[w,y]=J.useState(null),[k,P]=J.useState(void 0),R=e==="supabase",S=J.useMemo(()=>t?Wu(t):null,[t]);return J.useEffect(()=>{if(!R||!t||!S)return;let g=new AbortController;return v(true),y(null),(async()=>{let E=await fetch(`${t.url}/rest/v1/information_schema.tables?select=table_name,table_schema&table_schema=eq.${encodeURIComponent(t.schema)}&order=table_name`,{headers:S,signal:g.signal});if(!E.ok)throw new Error(`Failed to load Supabase schema (${E.status})`);let N=await E.json();o(N.map(C=>({name:C.table_name,schema:C.table_schema})));})().catch(E=>{g.signal.aborted||y(Wi(E));}).finally(()=>{g.signal.aborted||v(false);}),()=>g.abort()},[t,S,R]),J.useEffect(()=>{if(!R||!t||!S||!x)return;let g=new AbortController;h(true),p(null);let M=async()=>{let N=await fetch(`${t.url}/rest/v1/information_schema.columns?select=column_name,data_type,is_nullable&table_schema=eq.${encodeURIComponent(t.schema)}&table_name=eq.${encodeURIComponent(x)}&order=ordinal_position`,{headers:S,signal:g.signal});if(!N.ok)throw new Error(`Failed to load column metadata (${N.status})`);let C=await N.json();i(C.map(T=>({name:T.column_name,type:T.data_type,nullable:T.is_nullable==="YES"})));},E=async()=>{let N=await fetch(`${t.url}/rest/v1/${encodeURIComponent(x)}?select=*&limit=200`,{headers:S,signal:g.signal});if(!N.ok)throw new Error(`Failed to load data (${N.status})`);let C=await N.json();u(C),P(Yu(N.headers.get("content-range")));};return Promise.all([M(),E()]).catch(N=>{g.signal.aborted||(p(Wi(N)),i([]),u([]),P(void 0));}).finally(()=>{g.signal.aborted||h(false);}),()=>g.abort()},[t,S,R,x]),R?t?s("div",{className:"grid gap-4 lg:grid-cols-[260px,1fr]",children:[s(Ge,{className:"h-full min-h-[320px]",children:[s(Ke,{children:[s(Xe,{className:"flex items-center gap-2 text-base",children:[a(lucideReact.Database,{className:"size-4"})," Tables"]}),s(Je,{children:["Schema ",a("code",{children:t.schema})]})]}),a($e,{className:"flex h-full flex-col gap-3",children:w?s(at,{variant:"destructive",children:[a(lucideReact.ServerOff,{}),a(rt,{children:"Unable to load tables"}),a(ot,{children:w})]}):d?a("div",{className:"space-y-2",children:[0,1,2,3,4].map(g=>a(gt,{className:"h-9 w-full"},g))}):r.length===0?s(at,{children:[a(lucideReact.Table,{className:"text-muted-foreground"}),a(rt,{children:"No tables found"}),s(ot,{children:["The schema ",a("code",{children:t.schema})," does not contain any tables accessible via the REST API."]})]}):a(It,{className:"max-h-[360px] pr-2",children:a("div",{className:"space-y-2",children:r.map(g=>{let M=g.name===x;return s(X,{variant:M?"default":"outline",className:"w-full justify-start gap-2",onClick:()=>f(g.name),children:[a(lucideReact.Table,{className:"size-4"}),a("span",{className:"truncate",children:g.name})]},g.name)})})})})]}),a("div",{className:"flex h-full min-h-[320px] flex-col gap-4",children:x?s(jsxRuntime.Fragment,{children:[s(Ge,{children:[s(Ke,{className:"flex flex-col gap-1",children:[s("div",{className:"flex items-center gap-2",children:[a(Xe,{className:"text-base",children:x}),k!=null&&s($t,{variant:"outline",children:[k," rows"]})]}),s(Je,{children:["Columns available in ",a("code",{children:x})]})]}),a($e,{children:b?s(at,{variant:"destructive",children:[a(lucideReact.ServerOff,{}),a(rt,{children:"Unable to load table metadata"}),a(ot,{children:b})]}):m&&n.length===0?a("div",{className:"space-y-2",children:[0,1,2].map(g=>a(gt,{className:"h-6 w-full"},g))}):a("div",{className:"flex flex-wrap gap-2",children:n.map(g=>s("div",{className:"rounded-md border bg-muted/40 px-3 py-1 text-xs",children:[a("div",{className:"font-semibold text-foreground",children:g.name}),s("div",{className:"text-muted-foreground",children:[g.type,!g.nullable&&a($t,{className:"ml-2",variant:"secondary",children:"NOT NULL"})]})]},g.name))})})]}),s(Ge,{className:"flex flex-1 flex-col overflow-hidden",children:[s(Ke,{className:"border-b border-border/60 pb-4",children:[a(Xe,{className:"text-base",children:"Table data"}),s(Je,{children:["Showing up to 200 rows from ",a("code",{children:x})]})]}),a($e,{className:"flex flex-1 flex-col overflow-hidden",children:b?s(at,{variant:"destructive",children:[a(lucideReact.ServerOff,{}),a(rt,{children:"Unable to load table data"}),a(ot,{children:b})]}):m&&c.length===0?a("div",{className:"flex flex-1 items-center justify-center",children:a(lucideReact.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}):c.length===0?a("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:"No rows returned for this table."}):a(It,{className:"-mx-2 flex-1",children:s(ut,{children:[a(pt,{children:a(Re,{children:(n.length?n.map(g=>g.name):Object.keys(c[0])).map(g=>a(Oe,{className:"whitespace-nowrap",children:g},g))})}),a(mt,{children:c.map((g,M)=>a(Re,{children:(n.length?n.map(E=>E.name):Object.keys(g)).map(E=>{let N=g[E];return N==null?a(ke,{className:"text-muted-foreground",children:"NULL"},`${x}-${M}-${E}`):typeof N=="object"?a(ke,{className:"max-w-[220px] whitespace-pre-wrap text-xs",children:JSON.stringify(N)},`${x}-${M}-${E}`):a(ke,{className:"max-w-[220px] truncate",children:String(N)},`${x}-${M}-${E}`)})},`${x}-${M}`))})]})})})]})]}):a(Ge,{className:"flex flex-1 items-center justify-center",children:s($e,{className:"flex flex-col items-center gap-2 text-center",children:[a(lucideReact.Database,{className:"size-8 text-muted-foreground"}),a("p",{className:"font-medium",children:"Select a table to inspect its structure and rows."})]})})})]}):s(at,{variant:"destructive",children:[a(lucideReact.ServerOff,{}),a(rt,{children:"Supabase credentials missing"}),s(ot,{children:["Provide ",a("code",{children:"SUPABASE_URL"})," and ",a("code",{children:"SUPABASE_ANON_KEY"})," (or their public variants) in your environment or set",a("code",{children:"globalThis.__DEVPANEL_SUPABASE__"})," at runtime."]})]}):s(at,{children:[a(lucideReact.ServerOff,{className:"text-muted-foreground"}),a(rt,{children:"Database tooling is not configured"}),s(ot,{children:["Configure ",a("code",{children:"extras.database"})," to ",a("code",{children:"'supabase'"})," to enable the database inspector."]})]})},Ki=Ku;var Qu=()=>{if(typeof globalThis=="undefined")return null;let e=[globalThis.__FEATURE_FLAGS__,globalThis.__DEVPANEL_FLAGS__];for(let t of e)if(t){if(typeof t=="object"&&t!==null&&"flags"in t){let r=t.flags;if(r&&typeof r=="object")return r}if(typeof t=="object")return t}return null},ep=()=>{let e=J.useMemo(()=>Qu(),[]);return s(Ge,{className:"h-full",children:[s(Ke,{children:[s(Xe,{className:"flex items-center gap-2 text-base",children:[a(lucideReact.Flag,{className:"size-4"}),"Feature flags"]}),a(Je,{children:"Inspect runtime feature toggles exposed on the client."})]}),a($e,{children:!e||Object.keys(e).length===0?s(at,{children:[a(lucideReact.Info,{className:"text-muted-foreground"}),a(rt,{children:"No feature flags detected"}),s(ot,{children:["Populate ",a("code",{children:"globalThis.__FEATURE_FLAGS__"})," or",a("code",{children:"globalThis.__DEVPANEL_FLAGS__"})," to inspect values here."]})]}):s(ut,{children:[a(pt,{children:s(Re,{children:[a(Oe,{children:"Flag"}),a(Oe,{children:"Value"})]})}),a(mt,{children:Object.entries(e).map(([t,r])=>s(Re,{children:[a(ke,{className:"font-medium",children:t}),a(ke,{className:"max-w-[320px] whitespace-pre-wrap break-words text-sm",children:typeof r=="object"&&r!==null?JSON.stringify(r):String(r)})]},t))})]})})]})},Xi=ep;var op=()=>{let[e,t]=J.useState(null);return J.useEffect(()=>{var v,m;if(typeof document=="undefined")return;let o=Array.from(document.querySelectorAll("meta")).map(h=>{var x,f,b,p;return {name:(f=(x=h.getAttribute("name"))!=null?x:h.getAttribute("http-equiv"))!=null?f:"",property:(b=h.getAttribute("property"))!=null?b:"",content:(p=h.getAttribute("content"))!=null?p:""}}).filter(h=>h.content),n=o.filter(h=>h.name&&!h.property).map(h=>({name:h.name,content:h.content})),i=o.filter(h=>{var x,f;return ((x=h.property)==null?void 0:x.startsWith("og:"))||((f=h.property)==null?void 0:f.startsWith("twitter:"))}).map(h=>({property:h.property,content:h.content})),c=Array.from(document.querySelectorAll("link")).map(h=>({rel:h.getAttribute("rel"),href:h.getAttribute("href")})).filter(h=>h.rel||h.href),u=o.find(h=>h.name==="description"),d=c.find(h=>h.rel==="canonical");t({title:document.title,description:(v=u==null?void 0:u.content)!=null?v:null,canonicalUrl:(m=d==null?void 0:d.href)!=null?m:null,metas:n,og:i,links:c});},[]),e?s(It,{className:"h-full pr-4",children:[s("div",{className:"space-y-6",children:[s(Ge,{children:[s(Ke,{children:[a(Xe,{children:"Document overview"}),a(Je,{children:"Information sourced from the active document."})]}),s($e,{className:"space-y-2 text-sm",children:[s("div",{children:[a("span",{className:"font-semibold",children:"Title:"})," ",e.title||"\u2014"]}),s("div",{children:[a("span",{className:"font-semibold",children:"Description:"})," ",e.description||"\u2014"]}),s("div",{children:[a("span",{className:"font-semibold",children:"Canonical URL:"})," ",e.canonicalUrl||"\u2014"]})]})]}),s(Ge,{children:[s(Ke,{children:[a(Xe,{children:"Meta tags"}),a(Je,{children:"Standard meta tags extracted from the document head."})]}),a($e,{children:e.metas.length===0?a("div",{className:"text-sm text-muted-foreground",children:"No meta tags detected."}):s(ut,{children:[a(pt,{children:s(Re,{children:[a(Oe,{children:"Name"}),a(Oe,{children:"Content"})]})}),a(mt,{children:e.metas.map(r=>s(Re,{children:[a(ke,{className:"font-medium",children:r.name}),a(ke,{className:"max-w-[320px] whitespace-pre-wrap break-words text-sm",children:r.content})]},`${r.name}-${r.content}`))})]})})]}),s(Ge,{children:[s(Ke,{children:[a(Xe,{children:"Open Graph & Twitter tags"}),a(Je,{children:"Social graph data detected in the document."})]}),a($e,{children:e.og.length===0?a("div",{className:"text-sm text-muted-foreground",children:"No Open Graph or Twitter tags found."}):s(ut,{children:[a(pt,{children:s(Re,{children:[a(Oe,{children:"Property"}),a(Oe,{children:"Content"})]})}),a(mt,{children:e.og.map(r=>s(Re,{children:[a(ke,{className:"font-medium",children:r.property}),a(ke,{className:"max-w-[320px] whitespace-pre-wrap break-words text-sm",children:r.content})]},`${r.property}-${r.content}`))})]})})]}),s(Ge,{children:[s(Ke,{children:[a(Xe,{children:"Link tags"}),a(Je,{children:"All link elements found in the document head."})]}),a($e,{children:e.links.length===0?a("div",{className:"text-sm text-muted-foreground",children:"No link tags detected."}):s(ut,{children:[a(pt,{children:s(Re,{children:[a(Oe,{children:"Rel"}),a(Oe,{children:"Href"})]})}),a(mt,{children:e.links.map((r,o)=>s(Re,{children:[a(ke,{children:r.rel||"\u2014"}),a(ke,{className:"max-w-[320px] whitespace-pre-wrap break-words text-sm",children:r.href||"\u2014"})]},`${r.rel}-${r.href}-${o}`))})]})})]})]}),a(yr,{className:"my-6"})]}):s(at,{children:[a(lucideReact.Globe,{className:"text-muted-foreground"}),a(rt,{children:"Metadata unavailable"}),a(ot,{children:"Client-side metadata will appear once the page has finished loading."})]})},Ji=op;var lp=()=>{let e=J.useMemo(()=>{var o,n,i;if(typeof window=="undefined")return {};let t=window.navigator,r={"User agent":t.userAgent,Platform:t.platform,Language:t.language,Online:t.onLine?"yes":"no",Cookies:t.cookieEnabled?"enabled":"disabled"};return "hardwareConcurrency"in t&&(r["Logical cores"]=String((o=t.hardwareConcurrency)!=null?o:"unknown")),"deviceMemory"in t&&(r["Approx. memory (GB)"]=String((n=t.deviceMemory)!=null?n:"unknown")),r["Viewport size"]=`${window.innerWidth} \xD7 ${window.innerHeight}`,r["Screen size"]=`${window.screen.width} \xD7 ${window.screen.height}`,typeof window.location!="undefined"&&(r.Location=window.location.href),r["Time zone"]=(i=Intl.DateTimeFormat().resolvedOptions().timeZone)!=null?i:"unknown",typeof window.matchMedia=="function"&&(r["Prefers reduced motion"]=window.matchMedia("(prefers-reduced-motion: reduce)").matches?"yes":"no",r["Prefers dark color scheme"]=window.matchMedia("(prefers-color-scheme: dark)").matches?"yes":"no"),r},[]);return s(Ge,{className:"h-full",children:[s(Ke,{children:[s(Xe,{className:"flex items-center gap-2 text-base",children:[a(lucideReact.Cpu,{className:"size-4"}),"System status"]}),a(Je,{children:"Runtime information about the current browser session."})]}),a($e,{className:"h-full",children:a(It,{className:"max-h-[360px] pr-2",children:s(ut,{children:[a(pt,{children:s(Re,{children:[a(Oe,{children:"Property"}),a(Oe,{children:"Value"})]})}),a(mt,{children:Object.entries(e).map(([t,r])=>s(Re,{children:[a(ke,{className:"font-medium",children:s("div",{className:"flex items-center gap-2",children:[a(lucideReact.MonitorSmartphone,{className:"size-4 text-muted-foreground"}),t]})}),a(ke,{className:"max-w-[320px] whitespace-pre-wrap break-words text-sm",children:r})]},t))})]})})})]})},Zi=lp;var vp=e=>e!=="supabase"?null:{key:"database",label:"Database",icon:lucideReact.DatabaseIcon,content:a(Ki,{provider:e})},bp=()=>{let e=as(),[t,r]=J.useState(false),[o,n]=J.useState(null),i=J.useMemo(()=>{let c=[{key:"metadata",label:"Metadata",icon:lucideReact.BookText,content:a(Ji,{})},{key:"cache",label:"Caches",icon:lucideReact.GlobeLockIcon,content:a(Ui,{})},{key:"flags",label:"Feature flags",icon:lucideReact.FlagIcon,content:a(Xi,{})},{key:"system",label:"System",icon:lucideReact.Cog,content:a(Zi,{})}],u=vp(e.database);return u?[u,...c]:c},[e.database]);return J.useEffect(()=>{if(i.length===0){n(null);return}n(c=>!c||!i.some(u=>u.key===c)?i[0].key:c);},[i]),!e.enabled||e.framework!=="nextjs"?null:s(pa,{open:t,onOpenChange:r,children:[a(pi,{asChild:true,children:s(X,{className:"fixed bottom-6 right-6 z-50 shadow-lg",size:"lg",variant:"default",children:[a(lucideReact.BugIcon,{className:"mr-2 size-4"}),"Developer tools"]})}),s(ma,{className:"flex h-[min(85vh,720px)] w-[min(90vw,1024px)] flex-col overflow-hidden",children:[s(fa,{children:[s(ga,{className:"flex items-center gap-2",children:[a(lucideReact.BugIcon,{className:"size-5"})," Developer tools"]}),s(va,{children:["Framework detected: ",a("strong",{children:e.framework}),e.database!=="unknown"&&s(jsxRuntime.Fragment,{children:[" \xB7 ","Database: ",a("strong",{children:e.database})]})]})]}),o&&a(kr,{className:"flex h-full flex-col gap-4",contentClassName:"flex-1 overflow-hidden",listClassName:"max-w-full flex-wrap",onValueChange:n,value:o,items:i.map(c=>({key:c.key,label:s("span",{className:"flex items-center gap-2",children:[a(c.icon,{className:"size-4"}),c.label]}),children:a("div",{className:"flex h-full flex-col overflow-hidden",children:c.content})})),variant:"boxed"})]})]})},ts=bp;var os=J.createContext(void 0),xp={enabled:false,framework:"auto",database:"auto",fieldName:"auto",fieldCy:"auto"},yp=new Set(["","email","number","password","search","tel","text","url","date","datetime-local","month","time","week"]),kp=()=>{var r;if(typeof window!="undefined"){if(window.__NEXT_DATA__)return "nextjs";if(window.__vite_plugin_react_preamble_installed__)return "vite"}if(typeof document!="undefined"&&document.querySelector('script[src*="@vite/client"]'))return "vite";let e=typeof globalThis!="undefined"&&(r=globalThis.process)!=null?r:void 0,t=e==null?void 0:e.env;if(t){if(t.NEXT_PHASE||t.__NEXT_PREVIEW_MODE)return "nextjs";if(t.VITE_DEV_SERVER_URL||t.VITE_USER_NODE_ENV)return "vite";if(t.BABEL_ENV)return "babel";if(t.WEBPACK||t.WEBPACK_DEV_SERVER)return "webpack"}return typeof globalThis!="undefined"&&globalThis.__webpack_require__?"webpack":"unknown"},Rp=e=>{var v,m;let t={...xp,...e!=null?e:{}},r=(v=t.framework)!=null?v:"auto",o=r==="auto"?kp():r,n=(m=t.database)!=null?m:"auto",i=n==="auto"?"unknown":n,c=!!t.enabled,u=t.fieldName==="auto"?c:!!t.fieldName,d=t.fieldCy==="auto"?c:!!t.fieldCy;return {enabled:c,debug:c,framework:o,requestedFramework:r,database:i,requestedDatabase:n,fieldName:u,fieldCy:d}},Uy=({children:e,defaultTheme:t="system",nativeApp:r=false,extras:o,monitoring:n,siderbar:i})=>{var C,T,A,F,q;let[c,u]=J.useState(!!r),d=nt(),v=J.useMemo(()=>Rn(),[]),m=J.useMemo(()=>{let L=Rp(o);return Tn(v,L),L},[o,v]),h=J.useMemo(()=>n||{enable:false},[n]);J.useEffect(()=>{xr(h);},[h]),J.useEffect(()=>()=>{Pn(v);},[v]),J.useEffect(()=>{u(!!r);},[r]);let x=()=>{var _;if(typeof window=="undefined")return t==="system"?"auto":t;let L=(_=window.localStorage)==null?void 0:_.getItem(ia);return na(L)?L:t==="system"?"auto":t},[f,b]=J.useState(()=>x()),[p,w]=J.useState(()=>Fa(x())),[y,k]=J.useState(null);J.useEffect(()=>{w(Fa(f)),Dn(f);},[f]),J.useEffect(()=>{var H;if(typeof window=="undefined")return;let L=(H=window.localStorage)==null?void 0:H.getItem(ia);if(na(L))return;let _=t==="system"?"auto":t;b(D=>D===_?D:_);},[t]),J.useEffect(()=>{if(typeof window=="undefined"||f!=="auto")return;let L=window.matchMedia("(prefers-color-scheme: dark)"),_=D=>{let U=D.matches?"dark":"light";w(V=>V===U?V:U),lr("auto");},H=Fa("auto");return w(D=>D===H?D:H),lr("auto"),L.addEventListener("change",_),()=>L.removeEventListener("change",_)},[f]),J.useEffect(()=>{if(typeof window=="undefined")return;let L=_=>{let H=_.detail;H&&b(D=>D===H?D:H);};return window.addEventListener(sr,L),()=>window.removeEventListener(sr,L)},[]),J.useEffect(()=>{if(typeof window=="undefined")return;let L=_=>{if(_.key!==ia||!_.newValue||!na(_.newValue))return;let H=_.newValue;b(D=>D===H?D:H);};return window.addEventListener("storage",L),()=>window.removeEventListener("storage",L)},[]);let P=p==="dark";J.useEffect(()=>{if(typeof document=="undefined")return;let L=document.documentElement;L.dataset.framework=m.framework,L.dataset.database=m.database,L.dataset.debug=m.enabled?"true":"false";},[m]);let R=c,S=R||d;J.useEffect(()=>{if(typeof document=="undefined"||typeof window=="undefined"||!S)return;let L=150,_=$=>$ instanceof HTMLElement?$.isContentEditable||$ instanceof HTMLTextAreaElement?true:$ instanceof HTMLInputElement?yp.has($.type):false:false,H=$=>{let j=$.getBoundingClientRect(),G=window.innerHeight||document.documentElement.clientHeight,z=window.innerWidth||document.documentElement.clientWidth,te=j.top>=0&&j.bottom<=G,K=j.left>=0&&j.right<=z;return te&&K},D=$=>{window.setTimeout(()=>{H($)||$.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"});},L);},U=$=>{if(!($ instanceof Element))return null;if(_($))return $;let j=$.closest('input, textarea, [contenteditable="true"]');return j&&_(j)?j:null},V=$=>{let j=U($.target);j&&D(j);},B=$=>{if($.pointerType&&$.pointerType!=="touch"&&$.pointerType!=="pen")return;let j=U($.target);j&&D(j);};return document.addEventListener("focusin",V,true),document.addEventListener("pointerdown",B,true),()=>{document.removeEventListener("focusin",V,true),document.removeEventListener("pointerdown",B,true);}},[S]);let g=J.useCallback(L=>{b(_=>_===L?_:L);},[b]),M=J.useCallback(L=>{g(L?"dark":"light");},[g]),E=J.useMemo(()=>P?"#fff":"#000",[P]),N={isDarkMode:P,themeMode:f,isNativeApp:c,isNativeLike:R,isNative:R,extras:m,nativeOverlayContainer:y,setIsDarkMode:M,setThemeMode:g,setNativeApp:u,setNativeOverlayContainer:k};return a(os.Provider,{value:N,children:s(Sn,{children:[a(Fi,{color:E,framework:m.framework}),s(Co,{delayDuration:0,children:[Kt(i==null?void 0:i.show)&&s(ns,{children:[s(is,{...i==null?void 0:i.props,children:[Kt((C=i==null?void 0:i.header)==null?void 0:C.show)&&a(ls,{children:a(us,{children:a(ps,{children:a(ms,{asChild:true,className:"data-[slot=sidebar-menu-button]:!p-1.5",children:"Header"})})})}),Kt((T=i==null?void 0:i.content)==null?void 0:T.show)&&a(ds,{children:(A=i==null?void 0:i.content)==null?void 0:A.children}),Kt((F=i==null?void 0:i.footer)==null?void 0:F.show)&&a(cs,{children:(q=i==null?void 0:i.footer)==null?void 0:q.children})]}),a(ss,{"data-content-layout":i==null?void 0:i.contentLayout,className:l("data-[content-layout=centered]:!mx-auto data-[content-layout=centered]:max-w-screen-2xl","max-[113rem]:peer-data-[variant=inset]:!mr-2 min-[101rem]:peer-data-[variant=inset]:peer-data-[state=collapsed]:!mr-auto"),children:a("div",{className:"h-full p-4 md:p-6",children:e})})]}),!Kt(i==null?void 0:i.show)&&a(jsxRuntime.Fragment,{children:e}),a(ts,{})]})]})})},_t=()=>{let e=J.useContext(os);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e},as=()=>{let{extras:e}=_t();return e};var To=J__namespace.forwardRef(({className:e,...t},r)=>s("svg",{ref:r,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:e,...t,children:[a("path",{d:"M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7Z"}),a("circle",{cx:12,cy:12,r:3})]}));To.displayName="EyeIcon";var Po=J__namespace.forwardRef(({className:e,...t},r)=>s("svg",{ref:r,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:e,...t,children:[a("path",{d:"M3.12 3.12 5.3 5.3C3.42 6.78 2 9 2 9s4 7 10 7a9.78 9.78 0 0 0 4.68-1.07l1.92 1.92M9.88 9.88a3 3 0 0 0 4.24 4.24"}),a("path",{d:"M10.73 5.08A9.77 9.77 0 0 1 12 5c6 0 10 7 10 7a16.85 16.85 0 0 1-3.24 4.13"}),a("line",{x1:1,x2:23,y1:1,y2:23})]}));Po.displayName="EyeOffIcon";var Qe=J__namespace.forwardRef(({className:e,type:t,onFocus:r,...o},n)=>{let i=J__namespace.useCallback(b=>{typeof n=="function"?n(b):n&&(n.current=b);},[n]),c=J__namespace.useCallback(b=>{r==null||r(b),!b.defaultPrevented&&dr(b.currentTarget);},[r]),[u,d]=J__namespace.useState(false),v=t!=null?t:"text",m=v==="password",h=m&&u?"text":v;J__namespace.useEffect(()=>{!m&&u&&d(false);},[m,u]);let x=u?"Hide password":"Show password",f=l(wt,"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base transition-colors 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-primary focus-visible:ring-primary/40 focus-visible:ring-0","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",m?"pr-10":void 0,e);return m?s("div",{className:l("relative inline-flex w-full",e),children:[a("input",{ref:i,type:h,"data-slot":"input",onFocus:c,className:f,...o}),m&&a("button",{type:"button",onClick:()=>d(b=>!b),className:"ring-offset-background focus-visible:ring-ring absolute inset-y-0 right-0 flex items-center px-3 text-muted-foreground transition-colors hover:text-foreground focus-visible:rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-1","aria-label":x,"aria-pressed":u,children:u?a(Po,{"aria-hidden":true,className:"size-4"}):a(To,{"aria-hidden":true,className:"size-4"})})]}):a("input",{ref:i,type:h,"data-slot":"input",onFocus:c,className:f,...o})});Qe.displayName="Input";var No=(e,t)=>{if(typeof t=="number"){let r=Math.pow(10,t);return (Math.round(e*r)/r).toString()}return e.toString()},Cp=e=>e==null?"":typeof e=="number"?e.toString():e.trim(),Tp=e=>e===0?/^-?\d*$/:typeof e=="number"?new RegExp(`^-?\\d*(\\.\\d{0,${e}})?$`):/^-?\d*(\.\d*)?$/,Pp=e=>e===""||e==="-"||e==="."||e==="-.",So=(e,t)=>{if(Pp(e))return null;let r=Number(e);if(Number.isNaN(r))return null;if(typeof t=="number"){let o=Math.pow(10,t);return Math.round(r*o)/o}return r},Mo=J__namespace.forwardRef(({value:e,defaultValue:t,onChange:r,min:o,max:n,decimals:i,formatter:c,parser:u,onBlur:d,onFocus:v,inputMode:m,pattern:h,...x},f)=>{let b=J__namespace.useMemo(()=>Tp(i),[i]),p=J__namespace.useMemo(()=>{var C;let N=(C=e!=null?e:t)!=null?C:null;return N===null?"":No(N,i)},[e,t,i]),[w,y]=J__namespace.useState(p),[k,P]=J__namespace.useState(false);J__namespace.useEffect(()=>{if(e===void 0)return;let N=e===null?"":No(e,i);y(C=>C===N?C:N);},[e,i]);let R=J__namespace.useCallback(N=>{if(N===null)return null;let C=N;return typeof o=="number"&&(C=Math.max(o,C)),typeof n=="number"&&(C=Math.min(n,C)),C},[o,n]),S=N=>{let C=u?Cp(u(N.target.value)):N.target.value;if(!b.test(C)&&C!=="")return;y(C);let T=So(C,i);r==null||r(T);},g=N=>{P(true),v==null||v(N);},M=N=>{P(false);let C=So(w,i),T=R(C);if(T===null)w!==""&&(y(""),r==null||r(null));else if(T!==C){let A=No(T,i);y(A),r==null||r(T);}d==null||d(N);},E=J__namespace.useMemo(()=>{if(k)return w;if(c){let N=So(w,i),C=N!=null?N:w===""?null:w;return c(C)}return w},[c,k,w,i]);return a(Qe,{ref:f,value:E,onChange:S,onFocus:g,onBlur:M,inputMode:m!=null?m:i===0?"numeric":"decimal",pattern:h!=null?h:i===0?"-?\\d*":void 0,...x})});Mo.displayName="InputNumeric";var vs="X",Np=e=>e.replace(/\D/g,""),Sp=(e,t)=>e.split("").reduce((r,o)=>o===t?r+1:r,0),Mp=(e,t,r)=>{if(!t)return e;let o="",n=0;for(let i of t)if(i===r)if(n<e.length)o+=e[n],n+=1;else break;else (e.length>0||o.length>0)&&(o+=i);return o},Eo=J__namespace.forwardRef(({mask:e,placeholderChar:t=vs,value:r,defaultValue:o,onChange:n,inputMode:i,...c},u)=>{var p;let d=(p=t[0])!=null?p:vs,v=J__namespace.useMemo(()=>Sp(e,d),[e,d]),m=J__namespace.useCallback(w=>{if(!w)return "";let y=Np(w);return v===0?"":y.slice(0,v)},[v]),[h,x]=J__namespace.useState(()=>{var w;return m((w=r!=null?r:o)!=null?w:"")});J__namespace.useEffect(()=>{if(r===void 0)return;let w=m(r);x(y=>y===w?y:w);},[r,m]),J__namespace.useEffect(()=>{r===void 0&&x(w=>m(w));},[e,d,m,r]);let f=w=>{let y=m(w.target.value);r===void 0&&x(y),n==null||n(y);},b=J__namespace.useMemo(()=>Mp(h,e,d),[e,d,h]);return a(Qe,{ref:u,value:b,onChange:f,inputMode:i!=null?i:"numeric",...c})});Eo.displayName="InputMask";function ha({...e}){return a(radixUi.Popover.Root,{"data-slot":"popover",...e})}function bs({...e}){return a(radixUi.Popover.Trigger,{"data-slot":"popover-trigger",...e})}function wa({className:e,align:t="center",sideOffset:r=4,...o}){return a(radixUi.Popover.Portal,{children:a(radixUi.Popover.Content,{"data-slot":"popover-content",align:t,sideOffset:r,className:l("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),...o})})}function Tr({...e}){return a(radixUi.Popover.Anchor,{"data-slot":"popover-anchor",...e})}function xa({...e}){return a(vaul.Drawer.Root,{"data-slot":"drawer",...e})}function Pr({...e}){return a(vaul.Drawer.Trigger,{"data-slot":"drawer-trigger",...e})}function Ep({...e}){return a(vaul.Drawer.Portal,{"data-slot":"drawer-portal",...e})}function Nr({...e}){return a(vaul.Drawer.Close,{"data-slot":"drawer-close",...e})}function Dp({className:e,...t}){return a(vaul.Drawer.Overlay,{"data-slot":"drawer-overlay",className:l("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 ya({className:e,children:t,...r}){return s(Ep,{"data-slot":"drawer-portal",children:[a(Dp,{}),s(vaul.Drawer.Content,{"data-slot":"drawer-content",className:l("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",e),...r,children:[a("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),t]})]})}function ka({className:e,...t}){return a("div",{"data-slot":"drawer-header",className:l("flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left",e),...t})}function hs({className:e,...t}){return a("div",{"data-slot":"drawer-footer",className:l("mt-auto flex flex-col gap-2 p-4",e),...t})}function Ra({className:e,...t}){return a(vaul.Drawer.Title,{"data-slot":"drawer-title",className:l("text-foreground font-semibold",e),...t})}function m0({className:e,...t}){return a(vaul.Drawer.Description,{"data-slot":"drawer-description",className:l("text-muted-foreground text-sm",e),...t})}var Ao="YYYY-MM-DD",Hp=["Su","Mo","Tu","We","Th","Fr","Sa"],Op=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Do={bottomLeft:{side:"bottom",align:"start"},bottomRight:{side:"bottom",align:"end"},topLeft:{side:"top",align:"start"},topRight:{side:"top",align:"end"}},Bp=e=>{var t;return e&&(t=Do[e])!=null?t:Do.bottomLeft},ys=e=>e?typeof e=="function"?[Ao]:Array.isArray(e)?e:[e]:[Ao],Sr=(e,t)=>{if(!e)return "";if(typeof t=="function")return t(e);let r=ys(t),[o]=r;return e.format(o!=null?o:Ao)},Vp=(e,t)=>{let r=e.trim();if(!r)return null;if(t&&typeof t=="function"){let i=xt(r);return i.isValid()?i:null}let o=ys(t);for(let i of o){let c=yi(r,i);if(c!=null&&c.isValid())return c}let n=xt(r);return n.isValid()?n:null},Lo=(e,t,r)=>{if(!e||!t)return false;switch(r){case "month":return e.isSame(t,"month");case "year":case "decade":return e.isSame(t,"year");default:return e.isSame(t,"day")}},jp=e=>{let t=Math.floor(e.year()/10)*10;return e.year(t).startOf("year")},Mr=e=>{let t=jp(e),r=t.add(9,"year").endOf("year");return {start:t,end:r}},Zt=(e,t,r)=>{let o=e;return t&&o.isBefore(t)&&(o=t),r&&o.isAfter(r)&&(o=r),o},Qt=44,Er=5,ws=40,Io=6,xs=(e,t)=>t<=0?0:Math.min(Math.max(e,0),t),_o=({label:e,options:t,selectedValue:r,onValueChange:o,open:n,infinite:i=true})=>{let c=J__namespace.useRef(null),u=J__namespace.useRef(null),[d,v]=J__namespace.useState(()=>({start:0,end:Math.min(t.length,Er+Io)}));J__namespace.useEffect(()=>{i||v(k=>{if(t.length===0)return {start:0,end:0};let P=t.length-1,R=Math.min(k.start,P),S=Er+Io,g=Math.max(R+S,R+1),M=Math.min(t.length,g);return k.start===R&&k.end===M?k:{start:R,end:M}});},[i,t.length]);let m=J__namespace.useCallback(k=>{if(i||t.length===0)return;let P=xs(k,t.length-1),R=Er+Io,S=Math.floor(R/2),g=Math.max(0,P-S),M=Math.min(t.length,P+S+1);v(E=>E.start===g&&E.end===M?E:{start:g,end:M});},[i,t.length]),h=J__namespace.useMemo(()=>{if(t.length===0)return [];if(!i)return t;let k=[];for(let P=0;P<ws;P+=1)for(let R of t)k.push(R);return k},[i,t]),x=J__namespace.useCallback((k,P="auto")=>{if(!c.current||t.length===0||h.length===0)return;let R=t.findIndex(N=>N.value===k),S=R>=0?R:0,g=Math.floor(ws/2),E=(i?S+t.length*g:S)*Qt;c.current.scrollTo({top:E,behavior:P}),i||m(S);},[h.length,i,t,m]);J__namespace.useLayoutEffect(()=>{n&&x(r);},[x,n,t,r]),J__namespace.useEffect(()=>{if(i||!n)return;let k=t.findIndex(P=>P.value===r);m(k>=0?k:0);},[i,n,t,r,m]),J__namespace.useEffect(()=>()=>{u.current!==null&&clearTimeout(u.current);},[]);let f=J__namespace.useCallback(k=>{h.length===0||t.length===0||(u.current!==null&&clearTimeout(u.current),u.current=setTimeout(()=>{var g,M;if(!c.current)return;let P=Math.round(c.current.scrollTop/Qt);i||(P=xs(P,h.length-1));let R=h[P];if(!R)return;if(!o(R.value)){x(r,"smooth");return}if(i){let E=t.length,N=h.length-t.length-1;if(P<=E||P>=N)x(R.value);else {let C=P*Qt;(g=c.current)==null||g.scrollTo({top:C});}}else {m(P);let E=P*Qt;(M=c.current)==null||M.scrollTo({top:E});}},80));},[x,h,i,o,t,t.length,r,m]);if(t.length===0)return a("div",{className:"flex-1",children:a("p",{className:"text-center text-sm text-muted-foreground",children:"No options"})});let b=(Er-1)/2*Qt,p=i?h:t.slice(d.start,d.end),w=d.start*Qt,y=t.length*Qt;return s("div",{className:"flex flex-1 flex-col items-center gap-2",children:[a("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:e}),s("div",{className:"relative h-56 w-full overflow-hidden",children:[a("div",{className:"pointer-events-none absolute inset-x-0 top-1/2 -translate-y-1/2 border-y border-primary/30"}),a("div",{ref:c,onScroll:f,className:"h-56 overflow-y-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",style:{paddingTop:b,paddingBottom:b,WebkitOverflowScrolling:"touch"},children:i?h.map((k,P)=>{let R=`${P}-${k.value}`,S=k.value===r;return a("div",{className:l("flex h-11 items-center justify-center text-base transition-colors",S?"font-medium text-foreground":"text-muted-foreground"),children:k.label},R)}):a("div",{style:{height:y},children:a("div",{style:{transform:`translateY(${w}px)`},children:p.map((k,P)=>{let S=`${d.start+P}-${k.value}`,g=k.value===r;return a("div",{className:l("flex h-11 items-center justify-center text-base transition-colors",g?"font-medium text-foreground":"text-muted-foreground"),children:k.label},S)})})})})]})]})},Up=(e,t)=>e&&e!=="time"?e:t==="month"?"month":t==="year"?"year":"date",Gp=e=>{switch(e){case "month":case "year":return e;case "decade":return "year";default:return "day"}},$p=(e,t,r,o="date")=>{let n=Gp(o);return !(t&&e.isBefore(t,n)||r&&e.isAfter(r,n))},qp=e=>{var t,r,o,n,i,c,u;return {placeholder:(t=e==null?void 0:e.placeholder)!=null?t:"Select date",today:(r=e==null?void 0:e.today)!=null?r:"Today",clear:(o=e==null?void 0:e.clear)!=null?o:"Clear",months:(n=e==null?void 0:e.months)!=null?n:Op,weekDays:(i=e==null?void 0:e.weekDays)!=null?i:Hp,yearFormat:(c=e==null?void 0:e.yearFormat)!=null?c:"YYYY",decadeFormat:(u=e==null?void 0:e.decadeFormat)!=null?u:((d,v)=>`${d.format("YYYY")}-${v.format("YYYY")}`)}},zo=e=>{let t=J__namespace.useRef(e);return J__namespace.useEffect(()=>{t.current=e;},[e]),t},Wp="hsl(var(--primary))",Fo=J__namespace.forwardRef((e,t)=>{var pn,mn,fn,gn,vn,bn,hn;let{value:r,defaultValue:o=null,onChange:n,onOpenChange:i,allowClear:c=true,autoFocus:u=false,defaultOpen:d,disabled:v=false,disabledDate:m,format:h,preserveInvalidOnBlur:x=false,inputReadOnly:f=false,locale:b,minDate:p,maxDate:w,mode:y,needConfirm:k=false,open:P,panelRender:R,picker:S,placeholder:g,placement:M="bottomLeft",prefix:E,presets:N,size:C="middle",status:T,variant:A="outlined",className:F,style:q,inputClassName:L,inputStyle:_,onFocus:H,onBlur:D,name:U,id:V,...B}=e,{isNative:$}=_t(),j=nt(),G=$||j,[z,te]=J__namespace.useState(null),K=J__namespace.useMemo(()=>qp(b),[b]),ce=zo(n),le=zo(i),ne=zo(h),ge=r!==void 0,[fe,W]=J__namespace.useState(o),ie=(pn=ge?r:fe)!=null?pn:null,pe=J__namespace.useMemo(()=>Up(y,S),[y,S]),[he,Ce]=J__namespace.useState(pe),re=J__namespace.useCallback(I=>{var O;ge||W(I),(O=ce.current)==null||O.call(ce,I,Sr(I,ne.current));},[ne,ge,ce]),[ae,we]=J__namespace.useState(ie);J__namespace.useEffect(()=>{we(ie);},[ie]);let[de,ye]=J__namespace.useState(()=>{let I=ie!=null?ie:xt();return Zt(I,p,w)}),Ne=P!==void 0,[me,Ie]=J__namespace.useState(!!d),Pe=Ne?!!P:me,Se=J__namespace.useCallback(I=>{var O;Ne||Ie(I),(O=le.current)==null||O.call(le,I);},[Ne,le]),ve=k?ae:ie;J__namespace.useEffect(()=>{Pe&&(Ce(pe),ye(I=>Zt(ve!=null?ve:I,p,w)));},[ve,pe,w,p,Pe]);let[Pt,xe]=J__namespace.useState(()=>Sr(ve,ne.current)),Ut=J__namespace.useRef(false);J__namespace.useEffect(()=>{Ut.current||xe(Sr(ve,ne.current));},[ve,ne]);let We=J__namespace.useMemo(()=>({"--date-primary-color":Wp}),[]),Ft=J__namespace.useRef(null),bt=J__namespace.useCallback(I=>{v||(Se(I),I&&(Ce(pe),ye(O=>Zt(ve!=null?ve:O,p,w))));},[ve,v,pe,w,p,Se]),Ht=J__namespace.useCallback(I=>Vp(I,ne.current),[ne]),Le=J__namespace.useCallback((I,O)=>$p(I,p,w,O)?m?m(I,{type:O}):false:true,[m,w,p]),Te=J__namespace.useCallback(I=>Sr(I,ne.current),[ne]),Gt=J__namespace.useCallback(I=>{Le(I,"date")||(k?(we(I),xe(Te(I))):(re(I),xe(Te(I)),Se(false)));},[re,Te,Le,k,Se]),aa=I=>{let O=de.month(I);if(ye(O),pe==="month"){let Y=O.startOf("month");if(Le(Y,"month"))return;k?(we(Y),xe(Te(Y))):(re(Y),xe(Te(Y)),Se(false));}else Ce("date");},oe=I=>{let O=de.year(I);if(ye(O),pe==="year"){let Y=O.startOf("year");if(Le(Y,"year"))return;k?(we(Y),xe(Te(Y))):(re(Y),xe(Te(Y)),Se(false));}else Ce("month");},it=I=>{let O=de.year(I);ye(O),Ce("year");},Ye=I=>{ye(O=>{let Y=I==="date"?O.subtract(1,"month"):I==="month"?O.subtract(1,"year"):O.subtract(10,"year");return Zt(Y,p,w)});},Nt=I=>{ye(O=>{let Y=I==="date"?O.add(1,"month"):I==="month"?O.add(1,"year"):O.add(10,"year");return Zt(Y,p,w)});},Gr=()=>{let O=de.startOf("month").startOf("week"),Y=[];for(let Q=0;Q<6;Q+=1){let Fe=[];for(let tt=0;tt<7;tt+=1){let Me=O.add(Q*7+tt,"day"),St=Me.month()===de.month()&&Me.year()===de.year(),za=Lo(Me,ve,"date"),Kl=Me.isSame(xt(),"day"),Zr=Le(Me,"date");Fe.push(a("button",{type:"button",disabled:Zr,onClick:()=>Gt(Me),className:l("flex h-8 w-8 items-center justify-center rounded-md text-sm transition",!St&&"text-muted-foreground/70",za&&"bg-[var(--date-primary-color)] text-white",Kl&&!za&&"border border-[var(--date-primary-color)]",Zr&&"cursor-not-allowed opacity-40",!Zr&&!za&&"hover:bg-muted"),style:We,children:Me.date()},Me.format("YYYY-MM-DD")));}Y.push(a("div",{className:"grid grid-cols-7 gap-1",children:Fe},`week-${Q}`));}return s("div",{className:"space-y-1",children:[a("div",{className:"grid grid-cols-7 gap-1 text-center text-xs text-muted-foreground",children:K.weekDays.map(Q=>a("div",{children:Q},Q))}),a("div",{className:"space-y-1",children:Y})]})},rr=()=>a("div",{className:"grid grid-cols-3 gap-2",children:K.months.map((I,O)=>{let Y=de.month(O),Q=Lo(Y,ve,"month"),Fe=Le(Y.startOf("month"),"month");return a("button",{type:"button",disabled:Fe,onClick:()=>aa(O),className:l("flex h-12 flex-col items-center justify-center rounded-md text-sm transition",Q&&"bg-[var(--date-primary-color)] text-white",Fe&&"cursor-not-allowed opacity-40",!Fe&&!Q&&"hover:bg-muted"),style:We,children:I},I)})}),$r=()=>{let{start:I}=Mr(de),O=[];for(let Y=-1;Y<11;Y+=1)O.push(I.year()+Y);return a("div",{className:"grid grid-cols-4 gap-2",children:O.map(Y=>{let Q=de.year(Y),Fe=Lo(Q,ve,"year"),tt=Le(Q.startOf("year"),"year"),Me=Y<I.year()||Y>I.year()+9;return a("button",{type:"button",disabled:tt,onClick:()=>oe(Y),className:l("flex h-12 flex-col items-center justify-center rounded-md text-sm transition",Fe&&"bg-[var(--date-primary-color)] text-white",tt&&"cursor-not-allowed opacity-40",!tt&&!Fe&&"hover:bg-muted",Me&&"text-muted-foreground/70"),style:We,children:Y},Y)})})},or=()=>{let{start:I}=Mr(de),O=I.year()-10,Y=[];for(let Q=0;Q<12;Q+=1)Y.push(O+Q*10);return a("div",{className:"grid grid-cols-4 gap-2",children:Y.map(Q=>{let Fe=Q+9,tt=ve==null?void 0:ve.year(),Me=tt!==void 0&&tt>=Q&&tt<=Fe,St=Le(de.year(Q).startOf("year"),"year"),za=Fe<I.year()||Q>I.year()+9;return s("button",{type:"button",disabled:St,onClick:()=>it(Q),className:l("flex h-12 flex-col items-center justify-center rounded-md text-sm transition",Me&&"bg-[var(--date-primary-color)] text-white",St&&"cursor-not-allowed opacity-40",!St&&!Me&&"hover:bg-muted",za&&"text-muted-foreground/70"),style:We,children:[Q,"-",Fe]},`${Q}-${Fe}`)})})},qr=()=>{switch(he){case "month":return rr();case "year":return $r();case "decade":return or();default:return Gr()}},Wr=I=>{Ut.current=true,xe(I.target.value);},Yr=I=>{H==null||H(I),bt(true);},nr=I=>{D==null||D(I);let O=()=>{Ut.current=false;let Y=Ht(Pt);Y&&!Le(Y,"date")?k?(we(Y),xe(Te(Y))):(re(Y),xe(Te(Y))):x||xe(Te(ve));};typeof window!="undefined"?window.setTimeout(O,50):O();},ra=I=>{I==null||I.preventDefault(),I==null||I.stopPropagation(),!v&&(we(null),ye(()=>Zt(xt(),p,w)),k?xe(""):(re(null),xe(""),Se(false)));},La=()=>{let I=xt();Le(I,"date")||(k?(we(I),xe(Te(I))):(re(I),xe(Te(I)),Se(false)));},Ia=()=>{k&&(re(ae!=null?ae:null),Se(false));},Z=()=>{k&&(we(ie),xe(Te(ie)),Se(false));},ue=typeof c=="object"&&c!==null&&!Array.isArray(c)?c:void 0,et=!!c&&!v&&!!Pt,ht=(mn=ue==null?void 0:ue.clearIcon)!=null?mn:a(lucideReact.X,{className:"h-4 w-4",strokeWidth:2}),{side:Kr,align:zl}=Bp(M),Al=(fn={large:"lg",middle:"md",small:"sm"}[C])!=null?fn:"md",Fl={error:{borderColor:"hsl(var(--destructive))","--active-border-color":"hsl(var(--destructive))","--input-active-border-color":"hsl(var(--destructive))"},warning:{borderColor:"var(--warning, hsl(var(--primary)))","--active-border-color":"var(--warning, hsl(var(--primary)))","--input-active-border-color":"var(--warning, hsl(var(--primary)))"}},Hl={outlined:"",borderless:"border-transparent shadow-none focus:border-transparent focus:ring-0 focus:ring-offset-0",filled:"border-transparent bg-muted/60 focus:bg-muted",underlined:"border-x-0 border-t-0 rounded-none focus:ring-offset-0"},Ol={...T?Fl[T]:{},..._!=null?_:{}},Bl={sm:"h-8 text-sm",md:`${wt} text-sm`,lg:"h-11 text-base"},Vl={error:"border-destructive focus-visible:border-destructive focus-visible:ring-destructive/30",warning:"border-yellow-500 focus-visible:border-yellow-500 focus-visible:ring-yellow-500/30"},on=s("div",{className:"w-[280px] select-none",role:"dialog","aria-modal":"true",children:[s("div",{className:"flex items-center justify-between px-2 pt-2",children:[s("div",{className:"flex items-center gap-1",children:[a("button",{type:"button",className:"flex h-8 w-8 items-center justify-center rounded-md hover:bg-muted",onClick:()=>Ye(he==="date"?"month":he==="month"?"year":"decade"),children:a(lucideReact.ChevronsLeft,{className:"h-4 w-4"})}),he==="date"&&a("button",{type:"button",className:"flex h-8 w-8 items-center justify-center rounded-md hover:bg-muted",onClick:()=>Ye("date"),children:a(lucideReact.ChevronLeft,{className:"h-4 w-4"})})]}),a("div",{className:"flex flex-col items-center",children:s("button",{type:"button",className:"text-sm font-medium hover:text-[var(--date-primary-color)]",style:We,onClick:()=>{he==="date"?Ce("month"):he==="month"?Ce("year"):he==="year"&&Ce("decade");},children:[he==="date"&&`${K.months[de.month()]} ${de.format(K.yearFormat)}`,he==="month"&&de.format(K.yearFormat),he==="year"&&(()=>{let{start:I,end:O}=Mr(de);return K.decadeFormat(I,O)})(),he==="decade"&&(()=>{let{start:I,end:O}=Mr(de);return `${I.subtract(10,"year").format(K.yearFormat)}-${O.add(10,"year").format(K.yearFormat)}`})()]})}),s("div",{className:"flex items-center gap-1",children:[he==="date"&&a("button",{type:"button",className:"flex h-8 w-8 items-center justify-center rounded-md hover:bg-muted",onClick:()=>Nt("date"),children:a(lucideReact.ChevronRight,{className:"h-4 w-4"})}),a("button",{type:"button",className:"flex h-8 w-8 items-center justify-center rounded-md hover:bg-muted",onClick:()=>Nt(he==="date"?"month":he==="month"?"year":"decade"),children:a(lucideReact.ChevronsRight,{className:"h-4 w-4"})})]})]}),a("div",{className:"px-2 pb-2 pt-3",children:qr()}),s("div",{className:"flex items-center justify-between gap-2 border-t px-2 py-2",children:[a("div",{className:"flex flex-wrap items-center gap-2",children:N==null?void 0:N.map((I,O)=>{let Y=typeof I.value=="function"?I.value():I.value,Q=Y?Le(Y,"date"):false;return a("button",{type:"button",disabled:Q,onClick:()=>{!Y||Q||(k?(we(Y),xe(Te(Y))):(re(Y),xe(Te(Y)),Se(false)));},className:l("rounded-md px-2 py-1 text-xs transition",Q?"cursor-not-allowed bg-muted text-muted-foreground":"bg-muted hover:bg-muted/80"),children:I.label},O)})}),s("div",{className:"flex items-center gap-2",children:[a("button",{type:"button",onClick:La,className:"text-xs font-medium text-[var(--date-primary-color)] hover:underline disabled:text-muted-foreground",disabled:Le(xt(),"date"),style:We,children:K.today}),k?s("div",{className:"flex items-center gap-2",children:[a("button",{type:"button",className:"rounded-md px-2 py-1 text-xs hover:bg-muted",onClick:Z,children:K.clear}),a("button",{type:"button",className:"rounded-md bg-[var(--date-primary-color)] px-2 py-1 text-xs font-medium text-white hover:opacity-90",style:We,onClick:Ia,children:"OK"})]}):a("button",{type:"button",className:"rounded-md px-2 py-1 text-xs hover:bg-muted",onClick:I=>ra(I),disabled:!ie,children:K.clear})]})]})]}),jl=R?R(on):on;J__namespace.useEffect(()=>{if(!u)return;let I=()=>{var O;(O=Ft.current)==null||O.focus();};typeof window!="undefined"?window.setTimeout(I,0):I();},[u]),J__namespace.useImperativeHandle(t,()=>Ft.current);let Ul=!v&&(f||G),nn=s("div",{role:"combobox","aria-expanded":Pe,"aria-haspopup":"dialog",className:l("relative w-full",F),style:q,children:[E&&a("div",{className:"pointer-events-none absolute inset-y-0 left-3 flex items-center text-muted-foreground",children:E}),a(Qe,{...B,ref:Ft,value:Pt,onChange:Wr,onFocus:Yr,onBlur:nr,autoFocus:u,readOnly:f||G,disabled:v,placeholder:g!=null?g:K.placeholder,name:U,id:V,className:l("pr-10 text-sm",Hl[A],E&&"pl-10",v&&"cursor-not-allowed opacity-60",Ul&&"cursor-pointer",Bl[Al],T?Vl[T]:void 0,L),style:Ol,onClick:I=>{var O;(O=B.onClick)==null||O.call(B,I),!v&&G&&bt(true);}}),et&&a("button",{type:"button",className:"absolute inset-y-0 right-8 flex items-center text-muted-foreground transition hover:text-foreground",onMouseDown:I=>{I.preventDefault(),I.stopPropagation();},onClick:I=>ra(I),children:ht}),a("div",{className:"pointer-events-none absolute inset-y-0 right-3 flex items-center text-muted-foreground",children:a(lucideReact.Calendar,{className:"h-4 w-4"})})]}),_a=J__namespace.useMemo(()=>{var O,Y;return ((Y=k?(O=ae!=null?ae:ie)!=null?O:de:ve!=null?ve:de)!=null?Y:xt()).clone()},[ve,ae,k,ie,de]),Gl=J__namespace.useMemo(()=>K.months.map((I,O)=>({label:I,value:O})),[K.months]),sn=_a.daysInMonth(),$l=J__namespace.useMemo(()=>Array.from({length:sn},(I,O)=>({label:String(O+1).padStart(2,"0"),value:O+1})),[sn]),ln=_a.year(),cn=(gn=p==null?void 0:p.year())!=null?gn:ln-100,dn=(vn=w==null?void 0:w.year())!=null?vn:ln+100,Xr=Math.min(cn,dn),un=Math.max(cn,dn),ql=J__namespace.useMemo(()=>Array.from({length:un-Xr+1},(I,O)=>{let Y=Xr+O;return {label:String(Y),value:Y}}),[un,Xr]),Jr=J__namespace.useCallback((I,O)=>{var Fe,tt;let Q=(tt=k?(Fe=ae!=null?ae:ie)!=null?Fe:de:ie!=null?ie:de)!=null?tt:xt();if(I==="month"){let Me=Q.month(O),St=Math.min(Q.date(),Me.daysInMonth());Q=Me.date(St);}else if(I==="date"){let Me=Math.min(O,Q.daysInMonth());Q=Q.date(Me);}else {let Me=Q.year(O),St=Math.min(Q.date(),Me.daysInMonth());Q=Me.date(St);}return Q=Zt(Q,p,w),Le(Q,"date")?false:(k?(we(Q),xe(Te(Q))):(re(Q),xe(Te(Q))),ye(Q),true)},[re,ae,Te,Le,w,p,k,ie,ye,de]),Wl=(hn=(bn=typeof B["aria-label"]=="string"?B["aria-label"]:void 0)!=null?bn:g)!=null?hn:K.placeholder,Yl=J__namespace.useCallback(I=>{bt(I);},[bt]);if(J__namespace.useEffect(()=>{var O,Y;if(!G||!Pe||!V||typeof document=="undefined")return;te(null);let I=document.querySelector(`label[for="${V}"]`);I&&te((Y=(O=I.textContent)==null?void 0:O.trim())!=null?Y:null);},[V,Pe,G]),G){let I=z!=null?z:Wl;return s(xa,{open:Pe,onOpenChange:Yl,children:[a(Pr,{asChild:true,children:nn}),s(ya,{className:"mt-10 max-h-[min(540px,calc(100dvh-6rem))] rounded-t-3xl bg-background",children:[a(ka,{className:"px-6 pb-2 pt-4",children:a(Ra,{className:"text-base font-medium text-foreground",children:I})}),s("div",{className:"flex flex-1 flex-col gap-6 px-6 pb-6",children:[s("div",{className:"flex gap-4",children:[a(_o,{open:Pe,label:"Month",options:Gl,selectedValue:_a.month(),onValueChange:O=>Jr("month",O)}),a(_o,{open:Pe,label:"Day",options:$l,selectedValue:_a.date(),onValueChange:O=>Jr("date",O)}),a(_o,{open:Pe,label:"Year",options:ql,selectedValue:_a.year(),onValueChange:O=>Jr("year",O),infinite:false})]}),s("div",{className:"mt-auto flex items-center justify-between",children:[a(X,{type:"button",variant:"ghost",size:"sm",className:"text-[var(--date-primary-color)] hover:bg-[var(--date-primary-color)]/10 focus-visible:ring-[var(--date-primary-color)]/30",style:We,onClick:La,children:K.today}),s("div",{className:"flex items-center gap-3",children:[c?a(X,{type:"button",variant:"outline",size:"sm",className:"text-muted-foreground hover:text-foreground",onClick:O=>ra(O),children:K.clear}):null,k?s(jsxRuntime.Fragment,{children:[a(X,{type:"button",variant:"ghost",size:"sm",className:"hover:bg-muted",onClick:Z,children:"Cancel"}),a(X,{type:"button",variant:"default",size:"sm",className:"bg-[var(--date-primary-color)] text-white hover:opacity-90 focus-visible:ring-[var(--date-primary-color)]/30",style:We,onClick:Ia,children:"OK"})]}):a(Nr,{asChild:true,children:a(X,{type:"button",variant:"default",size:"sm",className:"bg-[var(--date-primary-color)] text-white hover:opacity-90 focus-visible:ring-[var(--date-primary-color)]/30",style:We,children:"Done"})})]})]})]})]})]})}return s(ha,{open:Pe,onOpenChange:bt,children:[a(Tr,{asChild:true,children:nn}),a(wa,{className:"w-auto border border-border bg-popover p-0",align:zl,side:Kr,children:jl})]})});Fo.displayName="DatePicker";function ks({...e}){return a(radixUi.DropdownMenu.Root,{"data-slot":"dropdown-menu",...e})}function E0({...e}){return a(radixUi.DropdownMenu.Portal,{"data-slot":"dropdown-menu-portal",...e})}var Ho=J__namespace.forwardRef(({...e},t)=>a(radixUi.DropdownMenu.Trigger,{ref:t,"data-slot":"dropdown-menu-trigger",...e}));Ho.displayName=radixUi.DropdownMenu.Trigger.displayName;var Oo=J__namespace.forwardRef(({className:e,sideOffset:t=4,...r},o)=>a(radixUi.DropdownMenu.Portal,{children:a(radixUi.DropdownMenu.Content,{ref:o,"data-slot":"dropdown-menu-content",sideOffset:t,className:l("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) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...r})}));Oo.displayName=radixUi.DropdownMenu.Content.displayName;function D0({...e}){return a(radixUi.DropdownMenu.Group,{"data-slot":"dropdown-menu-group",...e})}function L0({className:e,inset:t,variant:r="default",...o}){return a(radixUi.DropdownMenu.Item,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":r,className:l("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 cursor-default 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),...o})}function Rs({className:e,children:t,checked:r,...o}){return s(radixUi.DropdownMenu.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:l("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:r,...o,children:[a("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:a(radixUi.DropdownMenu.ItemIndicator,{children:a(lucideReact.CheckIcon,{className:"size-4"})})}),t]})}function I0({...e}){return a(radixUi.DropdownMenu.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...e})}function _0({className:e,children:t,...r}){return s(radixUi.DropdownMenu.RadioItem,{"data-slot":"dropdown-menu-radio-item",className:l("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),...r,children:[a("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:a(radixUi.DropdownMenu.ItemIndicator,{children:a(lucideReact.CircleIcon,{className:"size-2 fill-current"})})}),t]})}function Cs({className:e,inset:t,...r}){return a(radixUi.DropdownMenu.Label,{"data-slot":"dropdown-menu-label","data-inset":t,className:l("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...r})}function Ts({className:e,...t}){return a(radixUi.DropdownMenu.Separator,{"data-slot":"dropdown-menu-separator",className:l("bg-border -mx-1 my-1 h-px",e),...t})}function z0({className:e,...t}){return a("span",{"data-slot":"dropdown-menu-shortcut",className:l("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}function A0({...e}){return a(radixUi.DropdownMenu.Sub,{"data-slot":"dropdown-menu-sub",...e})}var Jp=J__namespace.forwardRef(({className:e,inset:t,children:r,...o},n)=>s(radixUi.DropdownMenu.SubTrigger,{ref:n,"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:l("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),...o,children:[r,a(lucideReact.ChevronRightIcon,{className:"ml-auto size-4"})]}));Jp.displayName=radixUi.DropdownMenu.SubTrigger.displayName;var Zp=J__namespace.forwardRef(({className:e,...t},r)=>a(radixUi.DropdownMenu.SubContent,{ref:r,"data-slot":"dropdown-menu-sub-content",className:l("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}));Zp.displayName=radixUi.DropdownMenu.SubContent.displayName;var Qp=({children:e,...t})=>a("form",{...t,children:e});var Ya=({className:e,...t})=>a("p",{"data-slot":"form-description",className:l("text-muted-foreground text-sm",e),...t});Ya.displayName="FormDescription";var Ka=({className:e,...t})=>{let r=t.children;return r?a("p",{"data-slot":"form-message",className:l("text-destructive text-sm",e),...t,children:r}):null};Ka.displayName="FormMessage";var Xa=({className:e,...t})=>a(De,{"data-slot":"form-label",className:e,...t});Xa.displayName="FormLabel";var em=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange?e:(t=e.form)!=null?t:e},tm=({name:e,label:t,description:r,className:o,checked:n,defaultChecked:i,onCheckedChange:c,checkboxProps:u,error:d,form:v,rules:m})=>{var N,C;let{onCheckedChange:h,...x}=u!=null?u:{},f=em(v),b=f==null?void 0:f.values,p=f==null?void 0:f.errors,w=f==null?void 0:f.touched,y=b==null?void 0:b[e],k=p==null?void 0:p[e],P=w==null?void 0:w[e],R=(N=f==null?void 0:f.validationSequence)!=null?N:0,S=(C=P?k:void 0)!=null?C:d,g=y!==void 0?!!y:n!==void 0?n:void 0,M=T=>{var L,_,H;let A=T===true,q=!!m?Ps(A,m):void 0;if((L=f==null?void 0:f.setFieldError)==null||L.call(f,e,q),(_=f==null?void 0:f.setFieldValue)==null||_.call(f,e,A),(H=f==null?void 0:f.setFieldTouched)==null||H.call(f,e,true),f!=null&&f.handleChange){let D={target:{name:e,value:A,checked:A}};f.handleChange(D);}c==null||c(A),h==null||h(T);},E=J__namespace.useRef(R);return J__namespace.useEffect(()=>{let T=!!m,A=R!==E.current;if(!(f!=null&&f.setFieldError)||!T){E.current=R;return}if(!P&&!A){E.current=R;return}let q=Ps(y!==void 0?!!y:n!==void 0?n:!!i,m);q!==k&&f.setFieldError(e,q),E.current=R;},[n,i,k,P,y,e,f,m,R]),s("div",{className:l("items-start gap-2",o),children:[s("div",{className:"flex items-start gap-3",children:[a("div",{children:a(Va,{name:e,...x,...g!==void 0?{checked:g}:{defaultChecked:i},"aria-invalid":!!S,onCheckedChange:M})}),s("div",{className:"grid gap-1.5 leading-none",children:[t?a(Xa,{className:"text-sm font-medium leading-none",children:t}):null,r?a(Ya,{children:r}):null]})]}),a(Ka,{children:S})]})};tm.displayName="FormCheckbox";function Ps(e,t){if(t){if(t.required&&!e)return typeof t.required=="string"?t.required:"This field is required";if(t.validate){let r=t.validate(e);if(typeof r=="string")return r;if(r===false)return "Invalid value"}}}var am={row:"flex-row","row-reverse":"flex-row-reverse",column:"flex-col","column-reverse":"flex-col-reverse"},rm={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},om={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},Lr={nowrap:"flex-nowrap",wrap:"flex-wrap","wrap-reverse":"flex-wrap-reverse"},Ir={none:{all:"gap-0",x:"gap-x-0",y:"gap-y-0"},xs:{all:"gap-1",x:"gap-x-1",y:"gap-y-1"},sm:{all:"gap-2",x:"gap-x-2",y:"gap-y-2"},md:{all:"gap-3",x:"gap-x-3",y:"gap-y-3"},lg:{all:"gap-4",x:"gap-x-4",y:"gap-y-4"},xl:{all:"gap-6",x:"gap-x-6",y:"gap-y-6"},"2xl":{all:"gap-8",x:"gap-x-8",y:"gap-y-8"}},Bo={...Ir,small:Ir.sm,middle:Ir.md,large:Ir.lg},nm=J__namespace.forwardRef(({direction:e,vertical:t,align:r,justify:o,wrap:n=false,gap:i,gapX:c,gapY:u,inline:d=false,className:v,children:m,...h},x)=>{var p;let f=e!=null?e:t?"column":"row",b=typeof n=="boolean"?n?Lr.wrap:Lr.nowrap:(p=Lr[n])!=null?p:Lr.nowrap;return a("div",{ref:x,"data-slot":"flex",className:l(d?"inline-flex":"flex",am[f],r?rm[r]:null,o?om[o]:null,b,i?Bo[i].all:null,c?Bo[c].x:null,u?Bo[u].y:null,v),...h,children:m})});nm.displayName="Flex";function dk({...e}){return a(radixUi.HoverCard.Root,{"data-slot":"hover-card",...e})}function uk({...e}){return a(radixUi.HoverCard.Trigger,{"data-slot":"hover-card-trigger",...e})}function pk({className:e,align:t="center",sideOffset:r=4,...o}){return a(radixUi.HoverCard.Portal,{"data-slot":"hover-card-portal",children:a(radixUi.HoverCard.Content,{"data-slot":"hover-card-content",align:t,sideOffset:r,className:l("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-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...o})})}function hk({className:e,containerClassName:t,...r}){return a(inputOtp.OTPInput,{"data-slot":"input-otp",containerClassName:l("flex items-center gap-2 has-disabled:opacity-50",t),className:l("disabled:cursor-not-allowed",e),...r})}function wk({className:e,...t}){return a("div",{"data-slot":"input-otp-group",className:l("flex items-center",e),...t})}function xk({index:e,className:t,...r}){var u;let o=J__namespace.useContext(inputOtp.OTPInputContext),{char:n,hasFakeCaret:i,isActive:c}=(u=o==null?void 0:o.slots[e])!=null?u:{};return s("div",{"data-slot":"input-otp-slot","data-active":c,className:l("data-[active=true]:border-primary data-[active=true]:ring-primary/40 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",t),...r,children:[n,i&&a("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:a("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function yk({...e}){return a("div",{"data-slot":"input-otp-separator",role:"separator",...e,children:a(lucideReact.MinusIcon,{})})}function De({className:e,...t}){return a(radixUi.Label.Root,{"data-slot":"label",className:l("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function Dk({className:e,...t}){return a(radixUi.Menubar.Root,{"data-slot":"menubar",className:l("bg-background flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs",e),...t})}function Lk({...e}){return a(radixUi.Menubar.Menu,{"data-slot":"menubar-menu",...e})}function Ik({...e}){return a(radixUi.Menubar.Group,{"data-slot":"menubar-group",...e})}function mm({...e}){return a(radixUi.Menubar.Portal,{"data-slot":"menubar-portal",...e})}function _k({...e}){return a(radixUi.Menubar.RadioGroup,{"data-slot":"menubar-radio-group",...e})}function zk({className:e,...t}){return a(radixUi.Menubar.Trigger,{"data-slot":"menubar-trigger",className:l("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none",e),...t})}function Ak({className:e,align:t="start",alignOffset:r=-4,sideOffset:o=8,...n}){return a(mm,{children:a(radixUi.Menubar.Content,{"data-slot":"menubar-content",align:t,alignOffset:r,sideOffset:o,className:l("bg-popover text-popover-foreground data-[state=open]:animate-in 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-[12rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-md",e),...n})})}function Fk({className:e,inset:t,variant:r="default",...o}){return a(radixUi.Menubar.Item,{"data-slot":"menubar-item","data-inset":t,"data-variant":r,className:l("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 cursor-default 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),...o})}function Hk({className:e,children:t,checked:r,...o}){return s(radixUi.Menubar.CheckboxItem,{"data-slot":"menubar-checkbox-item",className:l("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs 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:r,...o,children:[a("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:a(radixUi.Menubar.ItemIndicator,{children:a(lucideReact.CheckIcon,{className:"size-4"})})}),t]})}function Ok({className:e,children:t,...r}){return s(radixUi.Menubar.RadioItem,{"data-slot":"menubar-radio-item",className:l("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs 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),...r,children:[a("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:a(radixUi.Menubar.ItemIndicator,{children:a(lucideReact.CircleIcon,{className:"size-2 fill-current"})})}),t]})}function Bk({className:e,inset:t,...r}){return a(radixUi.Menubar.Label,{"data-slot":"menubar-label","data-inset":t,className:l("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...r})}function Vk({className:e,...t}){return a(radixUi.Menubar.Separator,{"data-slot":"menubar-separator",className:l("bg-border -mx-1 my-1 h-px",e),...t})}function jk({className:e,...t}){return a("span",{"data-slot":"menubar-shortcut",className:l("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}function Uk({...e}){return a(radixUi.Menubar.Sub,{"data-slot":"menubar-sub",...e})}function Gk({className:e,inset:t,children:r,...o}){return s(radixUi.Menubar.SubTrigger,{"data-slot":"menubar-sub-trigger","data-inset":t,className:l("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-none select-none data-[inset]:pl-8",e),...o,children:[r,a(lucideReact.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]})}function $k({className:e,...t}){return a(radixUi.Menubar.SubContent,{"data-slot":"menubar-sub-content",className:l("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-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",e),...t})}var fm="relative isolate overflow-hidden rounded-md bg-muted text-transparent",gm="after:absolute after:inset-0 after:-translate-x-full after:animate-[shimmer_1.6s_linear_infinite] after:bg-gradient-to-r after:from-transparent after:via-foreground/10 after:to-transparent after:content-['']",Ar=J__namespace.forwardRef(({className:e,...t},r)=>a("div",{ref:r,"data-slot":"skeleton",className:l(fm,gm,e),...t}));Ar.displayName="Skeleton";var Ms=J__namespace.forwardRef(({className:e,...t},r)=>a(Ar,{ref:r,className:l("h-9 w-32 rounded-md",e),...t}));Ms.displayName="Skeleton.Button";var Es=J__namespace.forwardRef(({className:e,...t},r)=>a(Ar,{ref:r,className:l("h-9 w-full rounded-md",e),...t}));Es.displayName="Skeleton.Input";var gt=Object.assign(Ar,{Button:Ms,Input:Es});var bm={sm:"sm:max-w-sm",md:"sm:max-w-lg",lg:"sm:max-w-2xl",xl:"sm:max-w-3xl"},hm=s("div",{className:"space-y-3","aria-hidden":true,children:[a(gt,{className:"h-4 w-2/3"}),a(gt,{className:"h-4 w-full"}),a(gt,{className:"h-4 w-5/6"}),a(gt,{className:"h-4 w-3/4"})]}),wm=e=>{switch(e){case "destructive":return "destructive";case "default":return "outline";case "primary":default:return "default"}},xm=({title:e,description:t,closable:r=true,className:o,classNames:n,loading:i=false,maskClosable:c=false,style:u,footer:d,onOk:v,onCancel:m,children:h,onOpenChange:x,size:f="md",...b})=>{var E,N,C,T,A,F,q;let p={show:(E=d==null?void 0:d.show)!=null?E:true,render:d==null?void 0:d.render,onOk:d==null?void 0:d.onOk,onCancel:d==null?void 0:d.onCancel,showOk:(N=d==null?void 0:d.showOk)!=null?N:true,showCancel:(C=d==null?void 0:d.showCancel)!=null?C:true,okText:(T=d==null?void 0:d.okText)!=null?T:"Save changes",cancelText:(A=d==null?void 0:d.cancelText)!=null?A:"Cancel",okLoading:d==null?void 0:d.okLoading,cancelLoading:d==null?void 0:d.cancelLoading,okDisabled:d==null?void 0:d.okDisabled,cancelDisabled:(F=d==null?void 0:d.cancelDisabled)!=null?F:d==null?void 0:d.cancelDisable,okType:d==null?void 0:d.okType,okButtonProps:d==null?void 0:d.okButtonProps,cancelButtonProps:d==null?void 0:d.cancelButtonProps,size:(q=d==null?void 0:d.size)!=null?q:"default"},w=J__namespace.useCallback(()=>{var L;(L=p.onCancel)==null||L.call(p),m==null||m();},[p.onCancel,m]),y=J__namespace.useCallback(()=>{var L;(L=p.onOk)==null||L.call(p),v==null||v();},[p.onOk,v]),k=J__namespace.useCallback(L=>{L||w(),x==null||x(L);},[w,x]),P=J__namespace.useCallback(L=>{c||L.preventDefault();},[c]),R=J__namespace.useCallback(L=>{r||L.preventDefault();},[r]),S=l(bm[f],o,n==null?void 0:n.content),g=a(framerMotion.AnimatePresence,{mode:"wait",children:i?a(framerMotion.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.18,ease:"easeInOut"},className:l("space-y-4",n==null?void 0:n.body),children:hm},"modal-loading"):a(framerMotion.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.18,ease:"easeInOut"},className:l("space-y-3 text-sm text-muted-foreground",n==null?void 0:n.body),"aria-busy":i,children:h},"modal-content")}),M=()=>{var le,ne,ge,fe,W,ie,pe,he,Ce,re;if(!p.show)return null;if(p.render)return a("div",{className:l("mt-2",n==null?void 0:n.footer),children:p.render});if(!p.showOk&&!p.showCancel)return null;let{onClick:L,variant:_,size:H,loading:D,disabled:U,...V}=(le=p.okButtonProps)!=null?le:{},{onClick:B,variant:$,size:j,loading:G,disabled:z,...te}=(ne=p.cancelButtonProps)!=null?ne:{},K=ae=>{L==null||L(ae),!ae.defaultPrevented&&y();},ce=ae=>{B==null||B(ae),!ae.defaultPrevented&&w();};return a("div",{className:l("mt-4",n==null?void 0:n.footer),children:s("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",children:[p.showCancel?a(X,{variant:$!=null?$:"outline",size:j!=null?j:p.size,loading:(fe=(ge=p.cancelLoading)!=null?ge:G)!=null?fe:false,disabled:(ie=(W=p.cancelDisabled)!=null?W:z)!=null?ie:false,...te,onClick:ce,children:p.cancelText}):null,p.showOk?a(X,{variant:_!=null?_:wm(p.okType),size:H!=null?H:p.size,loading:(he=(pe=p.okLoading)!=null?pe:D)!=null?he:false,disabled:(re=(Ce=p.okDisabled)!=null?Ce:U)!=null?re:false,...V,onClick:K,children:p.okText}):null]})})};return a(pa,{...b,onOpenChange:k,children:a(ma,{showCloseButton:r,className:S,style:u,onInteractOutside:P,onEscapeKeyDown:R,children:s(framerMotion.motion.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.98},transition:{duration:.2,ease:"easeOut"},className:"flex flex-col gap-4",children:[(e||t)&&s(fa,{className:n==null?void 0:n.header,children:[e?a(ga,{className:n==null?void 0:n.title,children:e}):null,t?a(va,{className:n==null?void 0:n.description,children:t}):null]}),g,M()]})})})};xm.displayName="Modal";function ea({open:e,onOpenChange:t,title:r,children:o,footer:n,footerClassName:i,contentClassName:c,disableContentWrapper:u=false,options:d,selectedValues:v,onSelect:m,isMulti:h=false}){let x=w=>{m==null||m(w),h||t(false);},f=w=>h&&Array.isArray(v)?v.includes(w):v===w,b=()=>d?a("div",{className:"max-h-[75vh] overflow-y-auto",children:d.map(w=>s("button",{className:l("w-full flex items-center justify-between px-4 py-4 text-left transition-colors","min-h-[50px] h-auto",w.disabled?"opacity-50 cursor-not-allowed":"hover:bg-accent active:bg-accent/80",f(w.value)&&"bg-accent"),onClick:()=>!w.disabled&&x(w.value),disabled:w.disabled,children:[a("span",{className:"flex-1",children:w.label}),f(w.value)&&a(lucideReact.CheckIcon,{className:"h-4 w-4 text-primary flex-shrink-0 ml-2"})]},w.value))}):null,p=u?o:a("div",{className:l(c),children:o});return a(xa,{open:e,onOpenChange:t,direction:"bottom",children:s(ya,{className:"p-0 pb-4 rounded-t-2xl border-t bg-background",children:[r?a(ka,{className:"px-4 pb-2 pt-4 text-left border-b",children:typeof r=="string"||typeof r=="number"?a(Ra,{children:r}):r}):null,d?b():p,n?a(hs,{className:l("border-border/60 border-t px-4 pt-3",i),children:n}):null]})})}var km={floating:{label:"Floating Glow",description:"Glassmorphism-inspired bar with a floating circular highlight around the active tab."},pill:{label:"Soft Pill",description:"Rounded pill navigation with a smooth capsule indicator that slides beneath the active item."},minimal:{label:"Minimal Line",description:"Lightweight footer that focuses on iconography with a subtle underline transition."},curved:{label:"Curved Wave",description:"Playful curved dock that mimics native device docks with a spotlighted active state."}},dR=Object.keys(km),Rm=()=>{},jo=J__namespace.forwardRef(({items:e,value:t,defaultValue:r,onChange:o=Rm,className:n,variant:i="floating",forceLabels:c=false,...u},d)=>{let[v,m]=J__namespace.useState(()=>{var C,T;return t!==void 0?t:r||((T=(C=e[0])==null?void 0:C.value)!=null?T:"")}),h=t!==void 0,x=h?t:v;J__namespace.useEffect(()=>{var T;if(!e.length)return;if(!e.some(A=>A.value===x)){let A=(T=e[0])==null?void 0:T.value;if(!A)return;h||m(A),o(A);}},[e,x,h,o]);let f=J__namespace.useCallback(C=>{C!==x&&(h||m(C),o(C));},[h,o,x]);if(!e.length)return null;let b=Math.max(e.findIndex(C=>C.value===x),0),p=100/e.length,w=J__namespace.useMemo(()=>{let T=p/2;return {width:72,height:72,left:`calc(${p}% * ${b} + ${T}% - ${72/2}px)`}},[b,p]),y=J__namespace.useMemo(()=>({width:`calc((100% / ${e.length}) - 0.75rem)`,left:`calc((100% / ${e.length}) * ${b} + 0.375rem)`}),[b,e.length]),k=J__namespace.useMemo(()=>({width:`calc((100% / ${e.length}) * 0.6)`,left:`calc((100% / ${e.length}) * ${b} + (100% / ${e.length}) * 0.2)`}),[b,e.length]),P=J__namespace.useMemo(()=>{let T=p/2;return {width:64,height:64,left:`calc(${p}% * ${b} + ${T}%)`}},[b,p]),R=()=>{switch(i){case "floating":return a("span",{"aria-hidden":true,style:w,className:"pointer-events-none absolute -top-7 z-0 rounded-full bg-primary/25 blur-2xl transition-[left] duration-500 ease-out"});case "pill":return a("span",{"aria-hidden":true,style:y,className:"pointer-events-none absolute inset-y-2 z-0 rounded-full border border-primary/20 bg-primary/10 shadow-inner transition-[left] duration-500 ease-out"});case "minimal":return a("span",{"aria-hidden":true,style:k,className:"pointer-events-none absolute bottom-1 left-0 h-1 rounded-full bg-primary transition-[left] duration-500 ease-out"});case "curved":return a("span",{"aria-hidden":true,style:P,className:"pointer-events-none absolute -top-6 z-0 -translate-x-1/2 rounded-full border border-primary/20 bg-primary/20 shadow-[0_12px_30px_-15px_rgba(59,130,246,0.65)] transition-[left] duration-500 ease-out"});default:return null}},S=C=>{switch(i){case "floating":return l("group relative z-10 flex flex-1 flex-col items-center gap-1 rounded-2xl px-2 pb-1 pt-3 text-[0.7rem] font-medium transition-all duration-300 ease-out",C?"text-primary":"text-muted-foreground");case "pill":return l("group relative z-10 flex flex-1 items-center justify-center gap-2 rounded-full px-3 text-sm font-medium transition-all duration-300 ease-out",C?"text-primary":"text-muted-foreground");case "minimal":return l("group relative flex flex-1 flex-col items-center gap-1 rounded-2xl px-2 py-2 text-[0.7rem] font-medium transition-all duration-300 ease-out",C?"text-primary":"text-muted-foreground/80");case "curved":return l("group relative z-10 flex flex-1 flex-col items-center gap-1 rounded-2xl px-3 pb-2 pt-5 text-[0.7rem] font-medium transition-all duration-300 ease-out",C?"text-primary":"text-muted-foreground/90");default:return ""}},g=C=>{switch(i){case "floating":return l("flex size-12 items-center justify-center rounded-full border border-border/50 bg-muted/60 text-base transition-all duration-300 ease-out",C?"scale-100 border-primary/40 bg-primary text-primary-foreground shadow-lg shadow-primary/30":"scale-95 text-muted-foreground");case "pill":return l("flex size-9 items-center justify-center rounded-full text-base transition-all duration-300 ease-out",C?"bg-primary text-primary-foreground shadow-lg shadow-primary/30":"bg-transparent text-muted-foreground");case "minimal":return l("flex size-10 items-center justify-center rounded-full text-base transition-all duration-300 ease-out",C?"scale-105 bg-primary/10 text-primary":"scale-95 text-muted-foreground/80");case "curved":return l("flex size-12 items-center justify-center rounded-full border border-border/60 bg-muted/70 text-base transition-all duration-300 ease-out",C?"-translate-y-3 border-primary/40 bg-primary text-primary-foreground shadow-xl shadow-primary/40":"translate-y-0 text-muted-foreground");default:return ""}},M=C=>{let T="transition-all duration-300 ease-out";switch(i){case "floating":return l(T,C?"translate-y-0 opacity-100":"translate-y-[2px] opacity-90",c?"block":"");case "pill":return l(T,"text-xs",C?"opacity-100":"opacity-90");case "minimal":return l(T,"text-xs",C||c?"opacity-100":"opacity-0");case "curved":return l(T,"text-xs",C||c?"opacity-100":"opacity-0 group-hover:opacity-80");default:return T}},E=(C,T)=>C?a("span",{className:l("pointer-events-none absolute -right-0.5 -top-0.5 min-w-4 rounded-full bg-destructive px-1.5 text-[10px] font-semibold leading-none text-destructive-foreground shadow-sm",T?"scale-105":"scale-100 opacity-95"),children:C}):null,N=()=>{switch(i){case "floating":return s("div",{className:"relative isolate flex h-24 w-full items-end rounded-[26px] border border-border/40 bg-card/90 px-4 pb-3 pt-5 shadow-[0_20px_40px_-24px_rgba(15,23,42,0.35)] backdrop-blur-xl",children:[R(),e.map(C=>{let T=C.value===x;return s("button",{type:"button",className:S(T),onClick:()=>f(C.value),"data-active":T?"true":void 0,"aria-pressed":T,"aria-current":T?"page":void 0,"aria-label":C.label,children:[s("span",{className:"relative",children:[a("span",{className:g(T),children:C.icon}),E(C.badge,T)]}),(T||c)&&C.label?a("span",{className:M(T),children:C.label}):C.label&&!c?a("span",{className:l(M(T),"sr-only"),children:C.label}):null]},C.value)})]});case "pill":return s("div",{className:"relative isolate flex h-20 w-full items-center rounded-full border border-border/40 bg-card/95 px-2 shadow-[0_24px_50px_-24px_rgba(15,23,42,0.45)] backdrop-blur",children:[R(),e.map(C=>{let T=C.value===x;return s("button",{type:"button",className:S(T),onClick:()=>f(C.value),"data-active":T?"true":void 0,"aria-pressed":T,"aria-current":T?"page":void 0,"aria-label":C.label,children:[s("span",{className:"relative flex items-center gap-2",children:[a("span",{className:g(T),children:C.icon}),(T||c)&&C.label?a("span",{className:M(T),children:C.label}):null]}),E(C.badge,T)]},C.value)})]});case "minimal":return s("div",{className:"relative isolate flex h-[4.5rem] w-full items-center justify-between rounded-3xl border border-border/30 bg-background/60 px-4 py-3 shadow-[0_18px_35px_-24px_rgba(15,23,42,0.35)]",children:[R(),e.map(C=>{let T=C.value===x;return s("button",{type:"button",className:S(T),onClick:()=>f(C.value),"data-active":T?"true":void 0,"aria-pressed":T,"aria-current":T?"page":void 0,"aria-label":C.label,children:[s("span",{className:"relative",children:[a("span",{className:g(T),children:C.icon}),E(C.badge,T)]}),(T||c)&&C.label?a("span",{className:M(T),children:C.label}):null]},C.value)})]});case "curved":return s("div",{className:"relative isolate flex h-28 w-full items-end justify-center",children:[a("div",{className:"absolute inset-x-3 bottom-0 h-20 rounded-t-[36px] border border-border/35 bg-card/95 shadow-[0_-30px_45px_-28px_rgba(15,23,42,0.55)]"}),s("div",{className:"relative z-10 flex h-24 w-[92%] items-end justify-between px-5 pb-4 pt-6",children:[R(),e.map(C=>{let T=C.value===x;return s("button",{type:"button",className:S(T),onClick:()=>f(C.value),"data-active":T?"true":void 0,"aria-pressed":T,"aria-current":T?"page":void 0,"aria-label":C.label,children:[s("span",{className:"relative",children:[a("span",{className:g(T),children:C.icon}),E(C.badge,T)]}),(T||c)&&C.label?a("span",{className:M(T),children:C.label}):null]},C.value)})]})]});default:return null}};return a("nav",{ref:d,className:l("relative flex w-full justify-center",n),...u,children:N()})});jo.displayName="MobileFooter";var Cm={hero:{label:"Hero Spotlight",description:"Immersive header with a leading action row, large title block, and optional hero media thumbnail."},stories:{label:"Stories Carousel",description:"Horizontal story rail with rounded action chips that mimic social media story pickers."},minimal:{label:"Minimal Bar",description:"Compact navigation bar with centered title and contextual leading/trailing actions."},search:{label:"Search Hub",description:"Two-line header with quick actions and an inline search field anchored by an avatar trigger."}},fR=Object.keys(Cm),Tm=()=>{},Pm=()=>s("svg",{"aria-hidden":true,viewBox:"0 0 24 24",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[a("circle",{cx:11,cy:11,r:7}),a("path",{d:"m20 20-3-3"})]}),Ja=(e,t=false)=>e?a("span",{className:l("pointer-events-none absolute -right-0.5 -top-0.5 min-w-4 rounded-full bg-destructive px-1.5 text-[10px] font-semibold leading-none text-destructive-foreground shadow-sm",t?"scale-105":"scale-100"),children:e}):null,Uo=J__namespace.forwardRef(({title:e,subtitle:t,supportingText:r,heroBadge:o,heroMedia:n,heroImage:i,heroAlt:c,leadingAction:u,trailingActions:d,trailingContent:v,stories:m,searchPlaceholder:h,searchValue:x,defaultSearchValue:f,onSearchChange:b=Tm,searchIcon:p,variant:w="hero",className:y,children:k,...P},R)=>{let[S,g]=J__namespace.useState(()=>f!=null?f:""),M=x!==void 0,E=M?x:S,N=J__namespace.useCallback(D=>{let U=D.target.value;M||g(U),b(U);},[M,b]),C=(D,U)=>{var V,B,$;return D?s("button",{type:"button",onClick:D.onClick,"aria-label":(B=(V=D.ariaLabel)!=null?V:D.label)!=null?B:D.value,className:"relative inline-flex size-10 items-center justify-center rounded-full border border-border/50 bg-background/80 text-base font-medium text-foreground shadow-[0_8px_24px_-18px_rgba(59,130,246,0.8)] transition-transform duration-200 ease-out hover:-translate-y-0.5",children:[a("span",{className:"pointer-events-none text-lg",children:($=D.icon)!=null?$:D.label}),Ja(D.badge)]},D.value):U?a("span",{className:"size-10","aria-hidden":true},U):null},T=D=>{var U,V,B;return D?s("button",{type:"button",onClick:D.onClick,"aria-label":(V=(U=D.ariaLabel)!=null?U:D.label)!=null?V:D.value,className:"relative inline-flex size-10 items-center justify-center rounded-full border border-border/40 bg-card/80 text-base text-foreground shadow-sm transition-colors duration-200 ease-out hover:bg-card",children:[a("span",{className:"pointer-events-none text-lg",children:(B=D.icon)!=null?B:D.label}),Ja(D.badge)]},D.value):null},A=D=>{var U,V,B;return D?s("button",{type:"button",onClick:D.onClick,"aria-label":(V=(U=D.ariaLabel)!=null?U:D.label)!=null?V:D.value,className:"relative inline-flex size-10 items-center justify-center rounded-full text-base text-muted-foreground transition-colors duration-200 ease-out hover:text-foreground",children:[a("span",{className:"pointer-events-none text-lg",children:(B=D.icon)!=null?B:D.label}),Ja(D.badge)]},D.value):null},F=D=>{var U,V,B;return s("button",{type:"button",onClick:D.onClick,"aria-label":(V=(U=D.ariaLabel)!=null?U:D.label)!=null?V:D.value,className:"group relative flex w-24 shrink-0 flex-col items-center gap-2 rounded-2xl border border-border/40 bg-card/60 px-3 py-3 text-center shadow-[0_12px_30px_-22px_rgba(59,130,246,0.45)] transition-all duration-300 ease-out hover:-translate-y-1 hover:border-primary/40",children:[s("span",{className:"relative inline-flex size-14 items-center justify-center overflow-hidden rounded-full border border-border/40 bg-background/80 text-lg text-foreground shadow-sm",children:[(B=D.icon)!=null?B:D.label,Ja(D.badge,true)]}),D.label?a("span",{className:"text-xs font-medium text-foreground transition-colors group-hover:text-primary",children:D.label}):null,D.description?a("span",{className:"text-[11px] text-muted-foreground transition-opacity group-hover:opacity-90",children:D.description}):null]},D.value)},q=()=>s("div",{className:"relative isolate w-full overflow-hidden rounded-[28px] border border-border/30 bg-gradient-to-br from-background/95 via-background/90 to-background/70 px-5 pb-6 pt-5 shadow-[0_28px_60px_-35px_rgba(15,23,42,0.55)] backdrop-blur",children:[a("div",{className:"pointer-events-none absolute inset-0 -z-10 bg-[radial-gradient(circle_at_top,_rgba(59,130,246,0.18),_transparent_55%)]"}),s("div",{className:"flex items-center justify-between",children:[C(u!=null?u:null,"hero-leading-placeholder"),a("div",{className:"flex items-center gap-2",children:d==null?void 0:d.map(D=>C(D))})]}),s("div",{className:"mt-7 flex items-end justify-between gap-6",children:[s("div",{className:"space-y-3",children:[o?a("span",{className:"inline-flex items-center gap-2 rounded-full border border-primary/20 bg-primary/10 px-3 py-1 text-xs font-medium text-primary",children:o}):null,e?a("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:e}):null,t?a("p",{className:"text-sm text-muted-foreground",children:t}):null,r?a("p",{className:"text-xs text-muted-foreground/90",children:r}):null]}),a("div",{className:"shrink-0",children:n?a("div",{className:"relative h-24 w-24 overflow-hidden rounded-2xl border border-border/40 shadow-[0_24px_40px_-28px_rgba(59,130,246,0.75)]",children:n}):i?a("div",{className:"relative h-24 w-24 overflow-hidden rounded-2xl border border-border/40 shadow-[0_24px_40px_-28px_rgba(59,130,246,0.75)]",children:a("img",{src:i,alt:c!=null?c:"",className:"size-full object-cover"})}):null})]}),k?a("div",{className:"mt-6",children:k}):null]}),L=()=>{var D;return s("div",{className:"relative isolate w-full overflow-hidden rounded-[26px] border border-border/35 bg-background/90 px-4 pb-5 pt-4 shadow-[0_24px_50px_-35px_rgba(15,23,42,0.55)]",children:[s("div",{className:"flex items-center justify-between gap-3",children:[s("div",{className:"flex items-center gap-3",children:[u?s("div",{className:"flex items-center gap-2 rounded-full border border-border/40 bg-card/80 px-3 py-1.5 text-sm font-medium text-foreground shadow-sm",children:[a("span",{className:"text-base",children:(D=u.icon)!=null?D:u.label}),u.label?a("span",{children:u.label}):null]}):null,e?a("h2",{className:"text-lg font-semibold text-foreground",children:e}):null]}),a("div",{className:"flex items-center gap-2",children:d==null?void 0:d.map(U=>A(U))})]}),t?a("p",{className:"mt-2 text-sm text-muted-foreground",children:t}):null,a("div",{className:"mt-4 flex gap-3 overflow-x-auto pb-1",children:m==null?void 0:m.map(U=>F(U))}),k?a("div",{className:"mt-4",children:k}):null]})},_=()=>s("div",{className:"relative isolate flex h-16 w-full items-center gap-3 rounded-[22px] border border-border/40 bg-background/95 px-2 shadow-[0_18px_35px_-28px_rgba(15,23,42,0.45)]",children:[a("div",{className:"flex items-center",children:u?T(u):a("span",{className:"size-10","aria-hidden":true})}),s("div",{className:"flex flex-1 flex-col items-center justify-center text-center",children:[t?a("span",{className:"text-[11px] uppercase tracking-[0.18em] text-muted-foreground",children:t}):null,e?a("span",{className:"text-base font-semibold text-foreground",children:e}):null]}),a("div",{className:"flex items-center gap-2",children:v!=null?v:d==null?void 0:d.map(D=>T(D))})]}),H=()=>{var D,U,V;return s("div",{className:"relative isolate w-full overflow-hidden rounded-[26px] border border-border/35 bg-background/95 px-4 pb-5 pt-4 shadow-[0_26px_54px_-34px_rgba(15,23,42,0.55)]",children:[s("div",{className:"flex items-start justify-between gap-4",children:[s("div",{className:"space-y-1",children:[t?a("span",{className:"text-[11px] uppercase tracking-[0.18em] text-muted-foreground",children:t}):null,e?a("h2",{className:"text-lg font-semibold text-foreground",children:e}):null,r?a("p",{className:"text-xs text-muted-foreground/90",children:r}):null]}),a("div",{className:"flex items-center gap-2",children:d==null?void 0:d.map(B=>A(B))})]}),s("div",{className:"mt-4 flex items-center gap-3",children:[u?s("button",{type:"button",onClick:u.onClick,"aria-label":(U=(D=u.ariaLabel)!=null?D:u.label)!=null?U:u.value,className:"relative inline-flex size-12 items-center justify-center rounded-full border border-border/40 bg-card/80 text-base text-foreground shadow-sm",children:[a("span",{className:"pointer-events-none text-lg",children:(V=u.icon)!=null?V:u.label}),Ja(u.badge)]}):null,s("div",{className:"relative flex-1",children:[a("span",{className:"pointer-events-none absolute inset-y-0 left-3 flex items-center",children:p!=null?p:a(Pm,{})}),a("input",{type:"search",value:E,onChange:N,placeholder:h,className:"h-12 w-full rounded-full border border-border/40 bg-card/70 pl-10 pr-4 text-sm text-foreground shadow-inner shadow-primary/5 outline-none transition focus:border-primary/40 focus:bg-card"})]})]}),k?a("div",{className:"mt-4",children:k}):null]})};return a("header",{ref:R,className:l("relative flex w-full justify-center",y),...P,children:(()=>{switch(w){case "hero":return q();case "stories":return L();case "minimal":return _();case "search":return H();default:return null}})()})});Uo.displayName="MobileHeader";function Ds(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t);}function Ls(...e){return t=>{let r=false,o=e.map(n=>{let i=Ds(n,t);return !r&&typeof i=="function"&&(r=true),i});if(r)return ()=>{for(let n=0;n<o.length;n++){let i=o[n];typeof i=="function"?i():Ds(e[n],null);}}}}function Sm(e){let t=Mm(e),r=J__namespace.forwardRef((o,n)=>{let{children:i,...c}=o,u=J__namespace.Children.toArray(i),d=u.find(Dm);if(d){let v=d.props.children,m=u.map(h=>h===d?J__namespace.Children.count(v)>1?J__namespace.Children.only(null):J__namespace.isValidElement(v)?v.props.children:null:h);return jsxRuntime.jsx(t,{...c,ref:n,children:J__namespace.isValidElement(v)?J__namespace.cloneElement(v,void 0,m):null})}return jsxRuntime.jsx(t,{...c,ref:n,children:i})});return r.displayName=`${e}.Slot`,r}var _s=Sm("Slot");function Mm(e){let t=J__namespace.forwardRef((r,o)=>{let{children:n,...i}=r;if(J__namespace.isValidElement(n)){let c=Im(n),u=Lm(i,n.props);return n.type!==J__namespace.Fragment&&(u.ref=o?Ls(o,c):c),J__namespace.cloneElement(n,u)}return J__namespace.Children.count(n)>1?J__namespace.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Em=Symbol("radix.slottable");function Dm(e){return J__namespace.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Em}function Lm(e,t){let r={...t};for(let o in t){let n=e[o],i=t[o];/^on[A-Z]/.test(o)?n&&i?r[o]=(...u)=>{let d=i(...u);return n(...u),d}:n&&(r[o]=n):o==="style"?r[o]={...n,...i}:o==="className"&&(r[o]=[n,i].filter(Boolean).join(" "));}return {...e,...r}}function Im(e){var o,n;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(n=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var _m=["top","right","bottom","left"],Fr=(e,t)=>e.includes(t)?`env(safe-area-inset-${t})`:void 0,Hr=J__namespace.forwardRef(({edges:e=_m,asChild:t,className:r,style:o,...n},i)=>{var u,d,v,m;return a(t?_s:"div",{ref:i,className:l("relative",r),style:{paddingTop:(u=o==null?void 0:o.paddingTop)!=null?u:Fr(e,"top"),paddingRight:(d=o==null?void 0:o.paddingRight)!=null?d:Fr(e,"right"),paddingBottom:(v=o==null?void 0:o.paddingBottom)!=null?v:Fr(e,"bottom"),paddingLeft:(m=o==null?void 0:o.paddingLeft)!=null?m:Fr(e,"left"),...o},...n})});Hr.displayName="SafeArea";var Am=({header:e,footer:t,children:r,className:o,safeArea:n})=>{var E,N,C,T,A;let{header:i,navigateBack:c,canGoBack:u}=Ni(),d=J__namespace.useMemo(()=>{let F=[];return n.top&&F.push("top"),n.left&&F.push("left"),n.right&&F.push("right"),F},[n.top,n.left,n.right]),v=J__namespace.useMemo(()=>{let F=[];return n.bottom&&F.push("bottom"),n.left&&F.push("left"),n.right&&F.push("right"),F},[n.bottom,n.left,n.right]),m=J__namespace.useCallback(()=>{if(u){c();return}typeof window!="undefined"&&window.history.back();},[u,c]),h=(E=i.back)!=null?E:u,x=J__namespace.useMemo(()=>{if(h)return {value:"mobile-header-back",icon:a(lucideReact.ArrowLeft,{className:"size-5","aria-hidden":true}),ariaLabel:"Go back",onClick:m};if(i.icon)return {value:"mobile-header-icon",icon:i.icon}},[h,i.icon,m]),{show:f=true,className:b,variant:p,type:w}=e,y=(T=(C=(N=i.variant)!=null?N:p)!=null?C:w)!=null?T:"hero",{show:k=true,activeKey:P,onChange:R,...S}=t,g=(A=S.value)!=null?A:P,M=J__namespace.useCallback(F=>{R==null||R(F);},[R]);return s("div",{className:l("flex min-h-svh w-full flex-col bg-background",o),children:[f&&a("div",{className:"sticky top-0 z-20 bg-background",children:a(Hr,{edges:d,className:"bg-background",children:a(Uo,{variant:y,className:b,title:i.title,subtitle:i.subtitle,supportingText:i.supportingText,heroBadge:i.heroBadge,leadingAction:x,trailingContent:i.actions})})}),a("div",{className:"flex-1 overflow-y-auto bg-muted/10",children:r}),k&&a("div",{className:"sticky bottom-0 z-20 bg-background",children:a(Hr,{edges:v,className:"bg-background px-4 pb-4 pt-2",children:a(jo,{...S,value:g,onChange:M})})})]})},Fm=({header:e={show:true},footer:t={show:true,items:[]},children:r,className:o,safeArea:n={top:true,bottom:true,left:true,right:true}})=>a(Pi,{children:a(Am,{header:e,footer:t,className:o,safeArea:n,children:r})});function BR({className:e,children:t,viewport:r=true,...o}){return s(radixUi.NavigationMenu.Root,{"data-slot":"navigation-menu","data-viewport":r,className:l("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",e),...o,children:[t,r&&a(Vm,{})]})}function VR({className:e,...t}){return a(radixUi.NavigationMenu.List,{"data-slot":"navigation-menu-list",className:l("group flex flex-1 list-none items-center justify-center gap-1",e),...t})}function jR({className:e,...t}){return a(radixUi.NavigationMenu.Item,{"data-slot":"navigation-menu-item",className:l("relative",e),...t})}var Bm=classVarianceAuthority.cva("group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-primary/40 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1");function UR({className:e,children:t,...r}){return s(radixUi.NavigationMenu.Trigger,{"data-slot":"navigation-menu-trigger",className:l(Bm(),"group",e),...r,children:[t," ",a(lucideReact.ChevronDownIcon,{className:"relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180","aria-hidden":"true"})]})}function GR({className:e,...t}){return a(radixUi.NavigationMenu.Content,{"data-slot":"navigation-menu-content",className:l("data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto","group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none",e),...t})}function Vm({className:e,...t}){return a("div",{className:l("absolute top-full left-0 isolate z-50 flex justify-center"),children:a(radixUi.NavigationMenu.Viewport,{"data-slot":"navigation-menu-viewport",className:l("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",e),...t})})}function $R({className:e,...t}){return a(radixUi.NavigationMenu.Link,{"data-slot":"navigation-menu-link",className:l("data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-primary/40 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",e),...t})}function qR({className:e,...t}){return a(radixUi.NavigationMenu.Indicator,{"data-slot":"navigation-menu-indicator",className:l("data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden",e),...t,children:a("div",{className:"bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md"})})}function QR({className:e,...t}){return a("nav",{role:"navigation","aria-label":"pagination","data-slot":"pagination",className:l("mx-auto flex w-full justify-center",e),...t})}function eC({className:e,...t}){return a("ul",{"data-slot":"pagination-content",className:l("flex flex-row items-center gap-1",e),...t})}function tC({...e}){return a("li",{"data-slot":"pagination-item",...e})}function As({className:e,isActive:t,size:r="icon",...o}){return a("a",{"aria-current":t?"page":void 0,"data-slot":"pagination-link","data-active":t,className:l(Mt({variant:t?"outline":"ghost",size:r}),e),...o})}function aC({className:e,...t}){return s(As,{"aria-label":"Go to previous page",size:"default",className:l("gap-1 px-2.5 sm:pl-2.5",e),...t,children:[a(lucideReact.ChevronLeftIcon,{}),a("span",{className:"hidden sm:block",children:"Previous"})]})}function rC({className:e,...t}){return s(As,{"aria-label":"Go to next page",size:"default",className:l("gap-1 px-2.5 sm:pr-2.5",e),...t,children:[a("span",{className:"hidden sm:block",children:"Next"}),a(lucideReact.ChevronRightIcon,{})]})}function oC({className:e,...t}){return s("span",{"aria-hidden":true,"data-slot":"pagination-ellipsis",className:l("flex size-9 items-center justify-center",e),...t,children:[a(lucideReact.MoreHorizontalIcon,{className:"size-4"}),a("span",{className:"sr-only",children:"More pages"})]})}function cC({className:e,value:t,...r}){return a(radixUi.Progress.Root,{"data-slot":"progress",className:l("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",e),...r,children:a(radixUi.Progress.Indicator,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})})}function Hs({className:e,...t}){return a(radixUi.RadioGroup.Root,{"data-slot":"radio-group",className:l("grid gap-3",e),...t})}function Os({className:e,...t}){return a(radixUi.RadioGroup.Item,{"data-slot":"radio-group-item",className:l("border-input text-primary focus-visible:border-primary focus-visible:ring-primary/40 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:a(radixUi.RadioGroup.Indicator,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:a(lucideReact.CircleIcon,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function wC({className:e,...t}){return a(Pa__namespace.PanelGroup,{"data-slot":"resizable-panel-group",className:l("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t})}function xC({...e}){return a(Pa__namespace.Panel,{"data-slot":"resizable-panel",...e})}function yC({withHandle:e,className:t,...r}){return a(Pa__namespace.PanelResizeHandle,{"data-slot":"resizable-handle",className:l("bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...r,children:e&&a("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:a(lucideReact.GripVerticalIcon,{className:"size-2.5"})})})}function It({className:e,children:t,...r}){return s(radixUi.ScrollArea.Root,{"data-slot":"scroll-area",className:l("relative",e),...r,children:[a(radixUi.ScrollArea.Viewport,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-primary/40 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),a(Wm,{}),a(radixUi.ScrollArea.Corner,{})]})}function Wm({className:e,orientation:t="vertical",...r}){return a(radixUi.ScrollArea.ScrollAreaScrollbar,{"data-slot":"scroll-area-scrollbar",orientation:t,className:l("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...r,children:a(radixUi.ScrollArea.ScrollAreaThumb,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}var Vs=J__namespace.createContext(void 0);function $o(){let e=J__namespace.useContext(Vs);if(!e)throw new Error("useNativeSelectContext must be used within a Select component");return e}function Xm({open:e,defaultOpen:t,onOpenChange:r,children:o,...n}){let{isNative:i}=_t(),c=nt(),u=i||c,[d,v]=J__namespace.useState(t!=null?t:false),m=e!=null?e:d,h=J__namespace.useCallback(f=>{e===void 0&&v(f),r==null||r(f);},[e,r]),x=J__namespace.useMemo(()=>({isNative:u,open:m,setOpen:h,closeOnSelect:true}),[u,m,h]);return a(Vs.Provider,{value:x,children:a(radixUi.Select.Root,{"data-slot":"select",open:m,onOpenChange:h,...n,children:o})})}function Jm({className:e,size:t="default",children:r,...o}){let{isNative:n,open:i,setOpen:c}=$o();return s(radixUi.Select.Trigger,{"data-slot":"select-trigger","data-size":t,onClick:u=>{n&&(u.preventDefault(),u.stopPropagation(),c(!i));},className:l(wt,"border-input flex w-full items-center gap-2 rounded-md border bg-transparent px-3 py-2 text-sm transition-colors cursor-pointer","data-[state=open]:border-primary focus-visible:ring-0 data-[state=open]:ring-0",e),...o,children:[a("span",{className:"flex-1 min-w-0 text-left [&_[data-slot=select-value]]:min-w-0 [&_[data-slot=select-value]]:flex [&_[data-slot=select-value]]:flex-1 [&_[data-slot=select-value]]:truncate",children:r}),a(radixUi.Select.Icon,{className:"pointer-events-none shrink-0 text-muted-foreground",children:a(lucideReact.ChevronDownIcon,{className:"size-4"})})]})}function Zm({className:e,children:t,position:r="popper",title:o,...n}){let i=$o();return a(radixUi.Select.Portal,{children:a(radixUi.Select.Content,{"data-slot":"select-content",className:l(i.isNative?"fixed inset-x-0 bottom-0 z-[9999] rounded-t-2xl border-t bg-background":"bg-popover text-popover-foreground relative z-50 rounded-md border",e),position:r,...n,children:i.isNative?a(ea,{open:i.open,onOpenChange:i.setOpen,title:o,disableContentWrapper:true,children:a(radixUi.Select.Viewport,{className:"max-h-[75vh] overflow-y-auto",children:t})}):s(jsxRuntime.Fragment,{children:[a(ef,{}),a(radixUi.Select.Viewport,{className:"p-1",children:t}),a(tf,{})]})})})}function Qm({className:e,children:t,onSelect:r,...o}){let n=$o(),i=J__namespace.useCallback(c=>{r==null||r(c),n.isNative&&n.closeOnSelect&&!c.defaultPrevented&&setTimeout(()=>{n.setOpen(false);});},[n,r]);return s(radixUi.Select.Item,{"data-slot":"select-item",onSelect:i,className:l("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm select-none",e),...o,children:[a("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:a(radixUi.Select.ItemIndicator,{children:a(lucideReact.CheckIcon,{className:"size-4"})})}),a(radixUi.Select.ItemText,{children:t})]})}function ef({className:e,...t}){return a(radixUi.Select.ScrollUpButton,{className:l("flex items-center justify-center py-1",e),...t,children:a(lucideReact.ChevronUpIcon,{className:"size-4"})})}function tf({className:e,...t}){return a(radixUi.Select.ScrollDownButton,{className:l("flex items-center justify-center py-1",e),...t,children:a(lucideReact.ChevronDownIcon,{className:"size-4"})})}function af({className:e,...t}){return a(radixUi.Select.Value,{"data-slot":"select-value",className:l("flex-1 min-w-0 truncate text-left data-[placeholder]:text-muted-foreground",e),...t})}function Or({options:e,placeholder:t="Select an option",triggerProps:r,contentProps:o,...n}){let i=r!=null?r:{},c=o!=null?o:{};return s(Xm,{...n,children:[a(Jm,{...i,children:a(af,{placeholder:t})}),a(Zm,{...c,children:e.map(u=>{var d,v;return a(Qm,{value:u.value,disabled:u.disabled,className:u.className,children:(v=u.label)!=null?v:u.value},(d=u.key)!=null?d:u.value)})})]})}var qo=()=>{},js=J__namespace.createContext({isNative:false,selectedValues:[],setSelectedValues:qo,toggleValue:qo,isSelected:()=>false,open:false,setOpen:qo});function Br(){return J__namespace.useContext(js)}function Us({value:e,defaultValue:t=[],onValueChange:r,open:o,defaultOpen:n,onOpenChange:i,children:c}){let{isNative:u}=_t(),d=nt(),v=u||d,[m,h]=J__namespace.useState(t),[x,f]=J__namespace.useState(n!=null?n:false);J__namespace.useEffect(()=>{e!==void 0&&h(e);},[e]),J__namespace.useEffect(()=>{o!==void 0&&f(o);},[o]);let b=e!=null?e:m,p=o!=null?o:x,w=J__namespace.useCallback(g=>{let M=typeof g=="function"?g(b):g;e===void 0&&h(M),r==null||r(M);},[r,b,e]),y=J__namespace.useCallback(g=>{w(M=>M.includes(g)?M.filter(E=>E!==g):[...M,g]);},[w]),k=J__namespace.useCallback(g=>b.includes(g),[b]),P=J__namespace.useCallback(g=>{o===void 0&&f(g),i==null||i(g);},[i,o]),R=J__namespace.useMemo(()=>({isNative:v,selectedValues:b,setSelectedValues:w,toggleValue:y,isSelected:k,open:p,setOpen:P}),[v,p,P,b,w,y,k]),S=v?c:a(ha,{open:p,onOpenChange:P,children:c});return a(js.Provider,{value:R,children:S})}function Gs({className:e,children:t,disabled:r,onClick:o,...n}){let i=Br(),c=J__namespace.useCallback(d=>{o==null||o(d),i.isNative&&!r&&i.setOpen(!i.open);},[i,r,o]),u=s("button",{type:"button","data-slot":"multi-select-trigger","data-state":i.open?"open":"closed",className:l(wt,"border-input focus-visible:border-primary focus-visible:ring-primary/40 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 relative flex w-full min-w-0 items-center gap-2 rounded-md border bg-transparent py-2 pl-3 pr-9 text-sm transition-colors outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),"aria-haspopup":"listbox","aria-expanded":i.open,disabled:r,onClick:c,...n,children:[a("span",{className:"flex-1 min-w-0 text-left",children:t}),a(lucideReact.ChevronDownIcon,{className:"pointer-events-none absolute right-3 top-1/2 size-4 -translate-y-1/2 opacity-50"})]});return i.isNative?u:a(bs,{asChild:true,children:u})}function $s({placeholder:e="Select options",className:t,separator:r=", ",formatValue:o}){let{selectedValues:n,isNative:i}=Br(),c=J__namespace.useMemo(()=>o?o(n):n.length===0?e:i?n.map(u=>a($t,{variant:"secondary",children:u},u)):n.join(r),[o,i,e,n,r]);return a("span",{"data-slot":"multi-select-value",className:l("flex min-h-4 flex-wrap items-center gap-1 text-sm",n.length===0&&"text-muted-foreground",t),children:c})}function qs({className:e,title:t,children:r,commandClassName:o,showSearch:n=false,searchPlaceholder:i="Search...",emptyMessage:c="No options found.",sideOffset:u=4,align:d="start",...v}){let m=Br(),h=s(fo,{className:l("w-full",o),children:[n?a(mi,{placeholder:i}):null,s(fi,{children:[c!==null?a(gi,{children:c}):null,r]})]});return m.isNative?a(ea,{open:m.open,onOpenChange:m.setOpen,title:t,contentClassName:l("px-2 pb-2",e),footer:a(X,{type:"button",variant:"outline",onClick:()=>m.setOpen(false),children:"Close"}),children:h}):a(wa,{"data-slot":"multi-select-content",className:l("w-64 p-0",e),sideOffset:u,align:d,...v,children:h})}function Ws({value:e,children:t,className:r,disabled:o,...n}){let i=Br(),c=i.isSelected(e);return s(vi,{...n,value:e,onSelect:()=>{o||i.toggleValue(e);},"data-slot":"multi-select-item",disabled:o,className:l("gap-2",r),children:[a("span",{className:"flex size-4 items-center justify-center",children:a(lucideReact.CheckIcon,{className:l("size-4",c?"opacity-100":"opacity-0")})}),a("span",{children:t})]})}function yr({className:e,orientation:t="horizontal",decorative:r=true,...o}){return a(radixUi.Separator.Root,{"data-slot":"separator",decorative:r,orientation:t,className:l("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),...o})}function Ys({...e}){return a(radixUi.Dialog.Root,{"data-slot":"sheet",...e})}function eT({...e}){return a(radixUi.Dialog.Trigger,{"data-slot":"sheet-trigger",...e})}function tT({...e}){return a(radixUi.Dialog.Close,{"data-slot":"sheet-close",...e})}function lf({...e}){return a(radixUi.Dialog.Portal,{"data-slot":"sheet-portal",...e})}function cf({className:e,...t}){return a(radixUi.Dialog.Overlay,{"data-slot":"sheet-overlay",className:l("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 Ks({className:e,children:t,side:r="right",...o}){return s(lf,{children:[a(cf,{}),s(radixUi.Dialog.Content,{"data-slot":"sheet-content",className:l("bg-background fixed z-50 flex flex-col gap-4 shadow-lg outline-none transition-transform ease-in-out data-[state=open]:duration-300 data-[state=closed]:duration-200",r==="right"&&"inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm data-[state=closed]:translate-x-full data-[state=open]:translate-x-0",r==="left"&&"inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm data-[state=closed]:-translate-x-full data-[state=open]:translate-x-0",r==="top"&&"inset-x-0 top-0 h-auto border-b data-[state=closed]:-translate-y-full data-[state=open]:translate-y-0",r==="bottom"&&"inset-x-0 bottom-0 h-auto border-t data-[state=closed]:translate-y-full data-[state=open]:translate-y-0",e),...o,children:[t,s(radixUi.Dialog.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[a(lucideReact.XIcon,{className:"size-4"}),a("span",{className:"sr-only",children:"Close"})]})]})]})}function Xs({className:e,...t}){return a("div",{"data-slot":"sheet-header",className:l("flex flex-col gap-1.5 p-4",e),...t})}function aT({className:e,...t}){return a("div",{"data-slot":"sheet-footer",className:l("mt-auto flex flex-col gap-2 p-4",e),...t})}function Js({className:e,...t}){return a(radixUi.Dialog.Title,{"data-slot":"sheet-title",className:l("text-foreground font-semibold",e),...t})}function Zs({className:e,...t}){return a(radixUi.Dialog.Description,{"data-slot":"sheet-description",className:l("text-muted-foreground text-sm",e),...t})}function Co({delayDuration:e=0,...t}){return a(radixUi.Tooltip.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Qs({...e}){return a(Co,{children:a(radixUi.Tooltip.Root,{"data-slot":"tooltip",...e})})}function el({...e}){return a(radixUi.Tooltip.Trigger,{"data-slot":"tooltip-trigger",...e})}function tl({className:e,sideOffset:t=0,children:r,...o}){return a(radixUi.Tooltip.Portal,{children:s(radixUi.Tooltip.Content,{"data-slot":"tooltip-content",sideOffset:t,className:l("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),...o,children:[r,a(radixUi.Tooltip.Arrow,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}var pf="sidebar_state",mf=3600*24*7,ff="16rem",gf="18rem",vf="3rem",bf="b",al=J__namespace.createContext(null);function er(){let e=J__namespace.useContext(al);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function ns({defaultOpen:e=true,open:t,onOpenChange:r,className:o,style:n,children:i,...c}){let u=nt(),[d,v]=J__namespace.useState(false),[m,h]=J__namespace.useState(e),x=t!=null?t:m,f=J__namespace.useCallback(y=>{let k=typeof y=="function"?y(x):y;r?r(k):h(k),document.cookie=`${pf}=${k}; path=/; max-age=${mf}`;},[r,x]),b=J__namespace.useCallback(()=>u?v(y=>!y):f(y=>!y),[u,f,v]);J__namespace.useEffect(()=>{let y=k=>{k.key===bf&&(k.metaKey||k.ctrlKey)&&(k.preventDefault(),b());};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[b]);let p=x?"expanded":"collapsed",w=J__namespace.useMemo(()=>({state:p,open:x,setOpen:f,isMobile:u,openMobile:d,setOpenMobile:v,toggleSidebar:b}),[p,x,f,u,d,v,b]);return a(al.Provider,{value:w,children:a("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":ff,"--sidebar-width-icon":vf,...n},className:l("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",o),...c,children:i})})}function is({side:e="left",variant:t="sidebar",collapsible:r="icon",className:o,children:n,...i}){let{isMobile:c,state:u,openMobile:d,setOpenMobile:v}=er();return r==="none"?a("div",{"data-slot":"sidebar",className:l("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",o),...i,children:n}):c?a(Ys,{open:d,onOpenChange:v,...i,children:s(Ks,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":gf},side:e,children:[s(Xs,{className:"sr-only",children:[a(Js,{children:"Sidebar"}),a(Zs,{children:"Displays the mobile sidebar."})]}),a("div",{className:"flex h-full w-full flex-col",children:n})]})}):s("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":u,"data-collapsible":u==="collapsed"?r:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[a("div",{"data-slot":"sidebar-gap",className:l("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),a("div",{"data-slot":"sidebar-container",className:l("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",o),...i,children:a("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:n})})]})}function yT({className:e,onClick:t,...r}){let{toggleSidebar:o}=er();return s(X,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:l("size-7",e),onClick:n=>{t==null||t(n),o();},...r,children:[a(lucideReact.PanelLeftIcon,{}),a("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function kT({className:e,...t}){let{toggleSidebar:r}=er();return a("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:l("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})}function ss({className:e,...t}){return a("main",{"data-slot":"sidebar-inset",className:l("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function RT({className:e,...t}){return a(Qe,{"data-slot":"sidebar-input","data-sidebar":"input",className:l("bg-background h-8 w-full shadow-none",e),...t})}function ls({className:e,sticky:t=false,...r}){return a("div",{"data-slot":"sidebar-header","data-sidebar":"header","data-sticky":t?"true":void 0,className:l("flex flex-col gap-2 p-2",t&&"sticky top-0 z-20 bg-sidebar/95 backdrop-blur supports-[backdrop-filter]:bg-sidebar/75",e),...r})}function cs({className:e,...t}){return a("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:l("flex flex-col gap-2 p-2",e),...t})}function CT({className:e,...t}){return a(yr,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:l("bg-sidebar-border mx-2 w-auto",e),...t})}function ds({className:e,...t}){return a("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:l("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function TT({className:e,...t}){return a("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:l("relative flex w-full min-w-0 flex-col p-2",e),...t})}function PT({className:e,asChild:t=false,...r}){let o=t?radixUi.Slot.Slot:"div";return a(o,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:l("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...r})}function NT({className:e,asChild:t=false,...r}){let o=t?radixUi.Slot.Slot:"button";return a(o,{"data-slot":"sidebar-group-action","data-sidebar":"group-action",className:l("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",e),...r})}function ST({className:e,...t}){return a("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:l("w-full text-sm",e),...t})}function us({className:e,...t}){return a("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:l("flex w-full min-w-0 flex-col gap-1",e),...t})}function ps({className:e,...t}){return a("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:l("group/menu-item relative",e),...t})}var hf=classVarianceAuthority.cva("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function ms({asChild:e=false,isActive:t=false,variant:r="default",size:o="default",tooltip:n,className:i,onClick:c,...u}){let d=e?radixUi.Slot.Slot:"button",{isMobile:v,setOpenMobile:m,state:h}=er(),x=J__namespace.useCallback(b=>{c&&c(b),!b.defaultPrevented&&v&&m(false);},[v,c,m]),f=a(d,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":o,"data-active":t,className:l(hf({variant:r,size:o}),i),onClick:x,...u});return n?(typeof n=="string"&&(n={children:n}),s(Qs,{children:[a(el,{asChild:true,children:f}),a(tl,{side:"right",align:"center",hidden:h!=="collapsed"||v,...n})]})):f}function MT({className:e,asChild:t=false,showOnHover:r=false,...o}){let n=t?radixUi.Slot.Slot:"button";return a(n,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:l("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",e),...o})}function ET({className:e,...t}){return a("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:l("text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t})}function DT({className:e,showIcon:t=false,...r}){let o=J__namespace.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return s("div",{"data-slot":"sidebar-menu-skeleton","data-sidebar":"menu-skeleton",className:l("flex h-8 items-center gap-2 rounded-md px-2",e),...r,children:[t&&a(gt,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),a(gt,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":o}})]})}function LT({className:e,...t}){return a("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:l("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t})}function IT({className:e,...t}){return a("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:l("group/menu-sub-item relative",e),...t})}function _T({asChild:e=false,size:t="md",isActive:r=false,className:o,onClick:n,...i}){let c=e?radixUi.Slot.Slot:"a",{isMobile:u,setOpenMobile:d}=er(),v=J__namespace.useCallback(m=>{n&&n(m),!m.defaultPrevented&&u&&d(false);},[u,n,d]);return a(c,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":t,"data-active":r,className:l("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",o),onClick:v,...i})}function OT({className:e,defaultValue:t,value:r,min:o=0,max:n=100,...i}){let c=J__namespace.useMemo(()=>Array.isArray(r)?r:Array.isArray(t)?t:[o,n],[r,t,o,n]);return s(radixUi.Slider.Root,{"data-slot":"slider",defaultValue:t,value:r,min:o,max:n,className:l("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...i,children:[a(radixUi.Slider.Track,{"data-slot":"slider-track",className:l("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:a(radixUi.Slider.Range,{"data-slot":"slider-range",className:l("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:c.length},(u,d)=>a(radixUi.Slider.Thumb,{"data-slot":"slider-thumb",className:"border-primary bg-background ring-primary/40 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},d))]})}var UT=({...e})=>a(sonner.Toaster,{theme:"dark",className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},...e});function nl({className:e,...t}){return a(radixUi.Switch.Root,{"data-slot":"switch",className:l("peer cursor-pointer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-primary focus-visible:ring-primary/40 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:a(radixUi.Switch.Thumb,{"data-slot":"switch-thumb",className:l("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function ut({className:e,...t}){return a("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto overflow-y-visible",children:a("table",{"data-slot":"table",className:l("w-full caption-bottom text-sm",e),...t})})}function pt({className:e,...t}){return a("thead",{"data-slot":"table-header",className:l("[&_tr]:border-b",e),...t})}function mt({className:e,...t}){return a("tbody",{"data-slot":"table-body",className:l("[&_tr:last-child]:border-0",e),...t})}function JT({className:e,...t}){return a("tfoot",{"data-slot":"table-footer",className:l("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t})}function Re({className:e,...t}){return a("tr",{"data-slot":"table-row",className:l("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function Oe({className:e,...t}){return a("th",{"data-slot":"table-head",className:l("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function ke({className:e,...t}){return a("td",{"data-slot":"table-cell",className:l("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function ZT({className:e,...t}){return a("caption",{"data-slot":"table-caption",className:l("text-muted-foreground mt-4 text-sm",e),...t})}var il=J__namespace.createContext(null),Wo=e=>{let t=J__namespace.useContext(il);if(!t)throw new Error(`${e} must be used within <Tabs>`);return t},sl=J__namespace.createContext("default"),Yo=e=>{let t=J__namespace.useContext(sl);return e!=null?e:t},xf={default:"h-10 justify-start rounded-md bg-muted p-1 text-muted-foreground md:justify-center",solid:"justify-start gap-1 rounded-full bg-muted/80 p-1 text-muted-foreground",segmented:"justify-start gap-1 rounded-xl bg-muted/70 p-1 text-muted-foreground",underline:"justify-start gap-6 border-b border-border bg-transparent p-0 text-muted-foreground",boxed:"justify-start gap-1 rounded-t-xl border border-border/60 bg-muted/40 p-1 text-muted-foreground"},yf="relative z-10 inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-colors focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50",kf={default:"min-w-[120px] rounded-md px-3 py-1.5 text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=active]:text-foreground",solid:"rounded-full px-4 py-1.5 text-foreground/80 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=active]:text-background",segmented:"rounded-lg px-4 py-1.5 text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=active]:text-foreground",underline:"rounded-none border-b-2 border-transparent px-1 pb-2 pt-1 text-sm text-muted-foreground focus-visible:ring-0 focus-visible:ring-offset-0 data-[state=active]:border-foreground data-[state=active]:text-foreground",boxed:"rounded-md border border-transparent px-4 py-2 text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=active]:text-foreground"},Rf={default:"mt-2",solid:"mt-3",segmented:"mt-3",underline:"mt-4",boxed:"mt-0 rounded-b-xl border border-border border-t-0 bg-card p-6 shadow-sm"},Cf=new Set(["default","solid","segmented","boxed"]),Tf={default:"rounded-md bg-background shadow-sm",solid:"rounded-full bg-foreground",segmented:"rounded-lg bg-background shadow-sm",boxed:"rounded-md border border-border bg-background shadow-sm"},Pf="pointer-events-none absolute left-0 top-0 z-0 transition-all duration-300 ease-out will-change-transform",ll=(...e)=>t=>{e.forEach(r=>{if(typeof r=="function")r(t);else if(r!=null){let o=r;o.current=t;}});},kr=J__namespace.forwardRef(({className:e,value:t,defaultValue:r,onValueChange:o,activationMode:n="automatic",variant:i="default",orientation:c="horizontal",items:u,listClassName:d,triggerClassName:v,contentClassName:m,renderList:h,...x},f)=>{var q;let b=J__namespace.useId(),p=t!==void 0,[w,y]=J__namespace.useState(()=>r!=null?r:null),k=(q=p?t:w)!=null?q:null,P=J__namespace.useRef(new Map),R=J__namespace.useCallback(L=>{p||y(L),o==null||o(L);},[p,o]),S=J__namespace.useCallback((L,_)=>{if(_){let H=P.current.size===0;P.current.set(L,_),!p&&k==null&&r==null&&H&&y(L);}else P.current.delete(L);},[r,p,y,k]),g=J__namespace.useCallback(L=>{var _;return L&&(_=P.current.get(L))!=null?_:null},[]),M=J__namespace.useCallback(L=>{let _=Array.from(P.current.keys());if(!_.length)return;let H=(L%_.length+_.length)%_.length,D=_[H],U=P.current.get(D);U==null||U.focus(),n!=="manual"&&R(D);},[n,R]),E=J__namespace.useCallback((L,_)=>{let D=Array.from(P.current.keys()).indexOf(L);D!==-1&&M(D+_);},[M]),N=J__namespace.useCallback(L=>{let _=Array.from(P.current.keys());_.length&&M(L==="first"?0:_.length-1);},[M]),[C,T]=J__namespace.useState(c),A=J__namespace.useCallback(L=>{T(L);},[]);J__namespace.useEffect(()=>{T(c);},[c]),J__namespace.useEffect(()=>{!p&&k==null&&r&&y(r);},[r,p,y,k]);let F=J__namespace.useMemo(()=>({id:b,value:k,setValue:R,activationMode:n,registerTrigger:S,getTriggerNode:g,focusNextTrigger:E,focusEdgeTrigger:N,orientation:C,setOrientation:A}),[b,k,R,n,S,E,N,C,A]);return a(sl.Provider,{value:i,children:a(il.Provider,{value:F,children:s("div",{ref:f,className:l("flex flex-col gap-2",e),...x,children:[(h!=null?h:(L=>L))(a(cl,{className:d,variant:i,orientation:c,children:u.map(L=>{let{triggerProps:_,contentProps:H,...D}=L,{className:U,...V}=_!=null?_:{};return a(dl,{value:D.key,disabled:D.disabled,className:l(v,D.triggerClassName,U),variant:i,...V,children:D.label},D.key)})})),u.map(L=>{let{triggerProps:_,contentProps:H,...D}=L,{className:U,...V}=H!=null?H:{};return a(ul,{value:D.key,variant:i,className:l(m,D.contentClassName,U),...V,children:D.children},D.key)})]})})})});kr.displayName="Tabs";var cl=J__namespace.forwardRef(({className:e,variant:t,orientation:r="horizontal",...o},n)=>{let{value:i,setOrientation:c,getTriggerNode:u}=Wo("TabsList"),d=Yo(t),v=Tf[d],m=J__namespace.useRef(null),[h,x]=J__namespace.useState(null),f=Cf.has(d),[b,p]=J__namespace.useState(false),[w,y]=J__namespace.useState(false),k=J__namespace.useCallback(S=>{if(r!=="horizontal")return;let g=m.current;if(!g||!S)return;let M=u(S);if(!M)return;let E=32,N=g.scrollLeft,C=N+g.clientWidth,T=M.offsetLeft,A=T+M.offsetWidth;if(T<N){let F=Math.max(0,T-E);typeof g.scrollTo=="function"?g.scrollTo({left:F,behavior:"smooth"}):g.scrollLeft=F;}else if(A>C){let F=Math.max(0,g.scrollWidth-g.clientWidth),q=Math.min(F,A-g.clientWidth+E);typeof g.scrollTo=="function"?g.scrollTo({left:q,behavior:"smooth"}):g.scrollLeft=q;}},[u,r]),P=J__namespace.useCallback(()=>{if(!f){x(null);return}let S=m.current,g=u(i);if(!S||!g){x(null);return}let M=g.offsetWidth,E=g.offsetHeight,N=g.offsetLeft,C=g.offsetTop,T=g.offsetParent;for(;T&&T!==S;)N+=T.offsetLeft-T.scrollLeft,C+=T.offsetTop-T.scrollTop,T=T.offsetParent;if(T!==S){let A=g.getBoundingClientRect(),F=S.getBoundingClientRect();N=A.left-F.left+S.scrollLeft,C=A.top-F.top+S.scrollTop;}x({width:M,height:E,transform:`translate3d(${N}px, ${C}px, 0)`});},[i,u,f]);J__namespace.useEffect(()=>{c(r);},[r,c]),J__namespace.useLayoutEffect(()=>{P();},[P]),J__namespace.useEffect(()=>{if(r!=="horizontal"){p(false),y(false);return}let S=m.current;if(!S)return;let g=()=>{let{scrollLeft:C,scrollWidth:T,clientWidth:A}=S;if(!(T-A>1)){p(false),y(false);return}p(C>1),y(C<T-A-1);};g(),k(i);let M=()=>g(),E=()=>{g(),k(i);},N=typeof ResizeObserver!="undefined"?new ResizeObserver(()=>E()):null;return S.addEventListener("scroll",M,{passive:true}),N==null||N.observe(S),window.addEventListener("resize",E),()=>{S.removeEventListener("scroll",M),N==null||N.disconnect(),window.removeEventListener("resize",E);}},[i,k,r]),J__namespace.useEffect(()=>{k(i);},[i,k]),J__namespace.useEffect(()=>{if(!f||typeof ResizeObserver=="undefined")return;let S=m.current;if(!S)return;let g=new ResizeObserver(()=>{P();});g.observe(S);let M=u(i);return M&&g.observe(M),()=>{g.disconnect();}},[i,u,f,P]),J__namespace.useEffect(()=>{if(!f||typeof MutationObserver=="undefined")return;let S=m.current;if(!S)return;let g=new MutationObserver(()=>{P();});return g.observe(S,{childList:true,subtree:true}),()=>{g.disconnect();}},[f,P]),J__namespace.useEffect(()=>{if(!f)return;let S=()=>{P();};return window.addEventListener("resize",S),()=>{window.removeEventListener("resize",S);}},[f,P]);let R=r==="horizontal";return s("div",{className:l("relative",R&&"max-w-full overflow-hidden"),children:[s("div",{ref:ll(m,n),role:"tablist","aria-orientation":r,className:l("relative inline-flex items-center",R&&"w-full max-w-full overflow-x-auto overflow-y-hidden [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",xf[d],e),...o,children:[f&&h&&v?a("span",{"aria-hidden":"true",className:l(Pf,v),style:h}):null,o.children]}),R&&b?a("div",{className:"pointer-events-none absolute inset-y-0 left-0 w-8 bg-gradient-to-r from-background to-transparent"}):null,R&&w?a("div",{className:"pointer-events-none absolute inset-y-0 right-0 w-8 bg-gradient-to-l from-background to-transparent"}):null]})});cl.displayName="TabsList";var dl=J__namespace.forwardRef(({className:e,variant:t,value:r,disabled:o,onClick:n,onKeyDown:i,...c},u)=>{let{id:d,value:v,setValue:m,registerTrigger:h,focusNextTrigger:x,focusEdgeTrigger:f,orientation:b}=Wo("TabsTrigger"),p=Yo(t),w=J__namespace.useRef(null),y=v===r,k=`${d}-trigger-${r}`,P=`${d}-content-${r}`;J__namespace.useEffect(()=>(h(r,w.current),()=>h(r,null)),[h,r]);let R=g=>{n==null||n(g),!(g.defaultPrevented||o)&&m(r);},S=g=>{if(i==null||i(g),!g.defaultPrevented){if(b==="horizontal"){if(g.key==="ArrowRight"){g.preventDefault(),x(r,1);return}if(g.key==="ArrowLeft"){g.preventDefault(),x(r,-1);return}}else {if(g.key==="ArrowDown"){g.preventDefault(),x(r,1);return}if(g.key==="ArrowUp"){g.preventDefault(),x(r,-1);return}}if(g.key==="Home"){g.preventDefault(),f("first");return}if(g.key==="End"){g.preventDefault(),f("last");return}(g.key===" "||g.key==="Enter")&&(g.preventDefault(),m(r));}};return a("button",{type:"button",role:"tab",id:k,"aria-selected":y,"aria-controls":P,tabIndex:y?0:-1,"data-state":y?"active":"inactive",disabled:o,ref:ll(w,u),className:l(yf,kf[p],e),onClick:R,onKeyDown:S,...c})});dl.displayName="TabsTrigger";var ul=J__namespace.forwardRef(({className:e,variant:t,value:r,...o},n)=>{let{id:i,value:c}=Wo("TabsContent"),u=Yo(t),d=c===r,v=`${i}-trigger-${r}`,m=`${i}-content-${r}`;return a("div",{ref:n,role:"tabpanel",id:m,"aria-labelledby":v,hidden:!d,"data-state":d?"active":"inactive",className:l("focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",Rf[u],e),...o})});ul.displayName="TabsContent";var Ko=J__namespace.forwardRef(({className:e,onFocus:t,...r},o)=>{let n=J__namespace.useCallback(c=>{typeof o=="function"?o(c):o&&(o.current=c);},[o]),i=J__namespace.useCallback(c=>{t==null||t(c),!c.defaultPrevented&&dr(c.currentTarget);},[t]);return a("textarea",{ref:n,"data-slot":"textarea",onFocus:i,className:l("border-input placeholder:text-muted-foreground focus-visible:border-primary focus-visible:ring-primary/40 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-0 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...r})});Ko.displayName="Textarea";var Xo=classVarianceAuthority.cva("inline-flex 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 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-primary focus-visible:ring-primary/40 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:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function pP({className:e,variant:t,size:r,...o}){return a(radixUi.Toggle.Root,{"data-slot":"toggle",className:l(Xo({variant:t,size:r,className:e})),...o})}var ml=J__namespace.createContext({size:"default",variant:"default"});function hP({className:e,variant:t,size:r,children:o,...n}){return a(radixUi.ToggleGroup.Root,{"data-slot":"toggle-group","data-variant":t,"data-size":r,className:l("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",e),...n,children:a(ml.Provider,{value:{variant:t,size:r},children:o})})}function wP({className:e,children:t,variant:r,size:o,...n}){let i=J__namespace.useContext(ml);return a(radixUi.ToggleGroup.Item,{"data-slot":"toggle-group-item","data-variant":i.variant||r,"data-size":i.size||o,className:l(Xo({variant:i.variant||r,size:i.size||o}),"min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",e),...n,children:t})}var Df="hsl(var(--primary))",Jo={bottomLeft:{side:"bottom",align:"start"},bottomRight:{side:"bottom",align:"end"},topLeft:{side:"top",align:"start"},topRight:{side:"top",align:"end"}},Lf=e=>{var t;return e&&(t=Jo[e])!=null?t:Jo.bottomLeft},dt=e=>String(e).padStart(2,"0"),If=(e,t)=>{let r=e.hour>=12?"PM":"AM",o=(e.hour+11)%12+1,n={HH:dt(e.hour),H:String(e.hour),hh:dt(o),h:String(o),mm:dt(e.minute),m:String(e.minute),ss:dt(e.second),s:String(e.second),A:r,a:r.toLowerCase()};return t.replace(/HH|H|hh|h|mm|m|ss|s|A|a/g,i=>n[i])},_f=(e,t)=>t?`${dt(e.hour)}:${dt(e.minute)}:${dt(e.second)}`:`${dt(e.hour)}:${dt(e.minute)}`,zf=e=>{let t=e.match(/\b(AM|PM)\b/i);return t?t[1].toUpperCase()==="AM"?"AM":"PM":null},fl=e=>{if(!e)return null;let t=e.trim();if(!t)return null;let r=zf(t),o=r?t.replace(/\s?(AM|PM)\b/i,"").trim():t,[n,i,c]=o.split(":");if(!n||!i)return null;let u=Number.parseInt(n,10),d=Number.parseInt(i,10),v=c?Number.parseInt(c,10):0;if([u,d,v].some(h=>Number.isNaN(h)))return null;let m=u;if(r){let h=Math.min(Math.max(m%12||12,1),12);m=r==="PM"?h%12+12:h%12,r==="AM"&&h===12&&(m=0),r==="PM"&&h===12&&(m=12);}return {hour:Math.min(Math.max(m,0),23),minute:Math.min(Math.max(d,0),59),second:Math.min(Math.max(v,0),59)}},Af=e=>{let t=e%12;return t===0?12:t},Ff=(e,t)=>{let r=e%12;return t==="PM"?r+12:r===12?0:r},Zo=({label:e,options:t,selectedValue:r,onSelect:o})=>s("div",{className:"flex w-20 min-w-0 flex-col gap-2",children:[a("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:e}),a("div",{role:"listbox",className:"max-h-48 overflow-y-auto rounded-md border border-border/60 p-1","aria-label":e,children:t.map(n=>{let i=n.value===r;return a("button",{type:"button",role:"option","aria-selected":i,className:l("w-full rounded-sm px-2 py-1 text-sm transition-colors",i?"bg-primary text-primary-foreground":"hover:bg-muted hover:text-foreground"),onClick:()=>o(n.value),children:n.label},n.value)})})]}),Ur=44,Hf=5,gl=40;function Qo({label:e,options:t,selectedValue:r,onValueChange:o,open:n,infinite:i=true}){let c=J__namespace.useRef(null),u=J__namespace.useRef(null),d=J__namespace.useMemo(()=>{if(t.length===0)return [];if(!i)return t;let x=[];for(let f=0;f<gl;f+=1)for(let b of t)x.push(b);return x},[i,t]),v=J__namespace.useCallback((x,f="auto")=>{if(!c.current||t.length===0||d.length===0)return;let b=t.findIndex(P=>P.value===x),p=b>=0?b:0,w=Math.floor(gl/2),k=(i?p+t.length*w:p)*Ur;c.current.scrollTo({top:k,behavior:f});},[d.length,i,t]);J__namespace.useLayoutEffect(()=>{n&&v(r);},[v,n,t,r]),J__namespace.useEffect(()=>()=>{u.current!==null&&clearTimeout(u.current);},[]);let m=J__namespace.useCallback(x=>{if(d.length===0||t.length===0)return;let f=x.currentTarget,b=Math.round(f.scrollTop/Ur),p=d.length-1,w=Math.max(0,Math.min(b,p));u.current!==null&&clearTimeout(u.current),u.current=setTimeout(()=>{var P;let y=d[w];if(!y)return;if(!o(y.value)){v(r,"smooth");return}if(i){let R=t.length,S=d.length-t.length-1;if(b<=R||b>=S)v(y.value);else {let g=b*Ur;(P=c.current)==null||P.scrollTo({top:g});}return}v(y.value);},80);},[v,d,i,o,t,r]);if(t.length===0)return a("div",{className:"flex-1",children:a("p",{className:"text-center text-sm text-muted-foreground",children:"No options"})});let h=(Hf-1)/2*Ur;return s("div",{className:"flex flex-1 flex-col items-center gap-2",children:[a("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:e}),s("div",{className:"relative h-56 w-full overflow-hidden",children:[a("div",{className:"pointer-events-none absolute inset-x-0 top-1/2 -translate-y-1/2 border-y border-primary/30"}),a("div",{ref:c,onScroll:m,className:"h-56 overflow-y-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",style:{paddingTop:h,paddingBottom:h,WebkitOverflowScrolling:"touch"},children:d.map((x,f)=>{let b=`${f}-${x.value}`,p=x.value===r;return a("div",{className:l("flex h-11 items-center justify-center text-base transition-colors",p?"font-medium text-foreground":"text-muted-foreground"),children:x.label},b)})})]})]})}var Of=({value:e,onChange:t})=>s("div",{className:"flex w-20 min-w-0 flex-col gap-2",children:[a("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Period"}),a("div",{role:"radiogroup",className:"grid gap-2",children:["AM","PM"].map(r=>{let o=r===e;return a("button",{type:"button",role:"radio","aria-checked":o,className:l("rounded-sm px-2 py-1 text-sm transition-colors",o?"bg-primary text-primary-foreground":"border border-border/60 hover:bg-muted hover:text-foreground"),onClick:()=>t(r),children:r},r)})})]}),en=J__namespace.forwardRef((e,t)=>{var nr,ra,La,Ia;let{value:r,defaultValue:o=null,onChange:n,onOpenChange:i,hourStep:c=1,minuteStep:u=1,secondStep:d=1,showSeconds:v,use12Hours:m=false,allowClear:h=true,format:x,placeholder:f,placement:b="bottomLeft",size:p="middle",status:w,variant:y="outlined",inputClassName:k,inputStyle:P,prefix:R,open:S,defaultOpen:g,inputReadOnly:M=true,className:E,style:N,disabled:C=false,name:T,id:A,...F}=e,{onBlur:q,onFocus:L,onClick:_,...H}=F,{isNative:D}=_t(),U=nt(),V=D||U,B=r!==void 0,[$,j]=J__namespace.useState(o),G=(nr=B?r:$)!=null?nr:null,z=J__namespace.useMemo(()=>fl(G),[G]),te=J__namespace.useMemo(()=>{var Z;return ((Z=z==null?void 0:z.hour)!=null?Z:0)>=12?"PM":"AM"},[z==null?void 0:z.hour]),[K,ce]=J__namespace.useState(te);J__namespace.useEffect(()=>{ce(te);},[te]);let le=J__namespace.useMemo(()=>typeof v=="boolean"?v:typeof x=="string"?/s/.test(x):!!(G&&G.split(":").length===3),[G,x,v]),ne=J__namespace.useMemo(()=>m?le?"hh:mm:ss A":"hh:mm A":le?"HH:mm:ss":"HH:mm",[le,m]),ge=typeof x=="string"?x:ne,fe=J__namespace.useCallback(Z=>Z?typeof x=="function"?x(Z):If(Z,ge):"",[x,ge]),[W,ie]=J__namespace.useState(()=>fe(z));J__namespace.useEffect(()=>{ie(fe(z));},[fe,z]);let pe=typeof h=="object"&&h!==null&&!Array.isArray(h)?h:void 0,he=(ra=pe==null?void 0:pe.clearIcon)!=null?ra:a(lucideReact.X,{className:"h-4 w-4",strokeWidth:2}),Ce=!!h&&!C&&!!G,re=J__namespace.useMemo(()=>({"--date-primary-color":Df}),[]),ae=S!==void 0,[we,de]=J__namespace.useState(!!g),ye=ae?!!S:we,Ne=J__namespace.useCallback(Z=>{C||(ae||de(Z),i==null||i(Z));},[C,ae,i]),me=J__namespace.useCallback(Z=>{if(!Z){B||j(null),ie(""),n==null||n(null,"");return}let ue=_f(Z,le);B||j(ue);let et=fe(Z);ie(et),n==null||n(ue,et);},[fe,le,B,n]),Ie=z!=null?z:{hour:0,minute:0,second:0},Pe=Math.max(1,Math.floor(c)),Se=Math.max(1,Math.floor(u)),ve=Math.max(1,Math.floor(d)),Pt=J__namespace.useMemo(()=>{if(m){let ue=[];for(let ht=1;ht<=12;ht+=Pe)ue.push(Math.min(ht,12));return ue.includes(12)||ue.push(12),Array.from(new Set(ue)).sort((ht,Kr)=>ht-Kr).map(ht=>({label:dt(ht),value:ht}))}let Z=[];for(let ue=0;ue<24;ue+=Pe)Z.push({label:dt(ue),value:ue});return Z},[Pe,m]),xe=J__namespace.useMemo(()=>{let Z=[];for(let ue=0;ue<60;ue+=Se)Z.push({label:dt(ue),value:ue});return Z},[Se]),Ut=J__namespace.useMemo(()=>{if(!le)return [];let Z=[];for(let ue=0;ue<60;ue+=ve)Z.push({label:dt(ue),value:ue});return Z},[le,ve]),We=J__namespace.useMemo(()=>z?m?Af(z.hour):z.hour:m?12:0,[z,m]),Ft=(La=z==null?void 0:z.minute)!=null?La:0,bt=(Ia=z==null?void 0:z.second)!=null?Ia:0,Ht=J__namespace.useCallback(Z=>{if(m){let ue=Ff(Z,K);me({...Ie,hour:ue});}else me({...Ie,hour:Z});},[Ie,me,K,m]),Le=J__namespace.useCallback(Z=>{me({...Ie,minute:Z});},[Ie,me]),Te=J__namespace.useCallback(Z=>{me({...Ie,second:Z});},[Ie,me]),Gt=J__namespace.useCallback(Z=>{ce(Z);let ue=z!=null?z:Ie,et=ue.hour;Z==="AM"&&et>=12&&(et-=12),Z==="PM"&&et<12&&(et+=12),me({...ue,hour:et});},[Ie,me,z]),aa=J__namespace.useCallback(Z=>{let ue=Z.target.value;if(ie(ue),!ue.trim()){me(null);return}let et=fl(ue);et&&me(et);},[me]),{side:oe,align:it}=Lf(b),Ye={small:"h-8 text-sm",middle:`${wt} text-sm`,large:"h-11 text-base"},Nt={error:"border-destructive focus-visible:border-destructive focus-visible:ring-destructive/30",warning:"border-yellow-500 focus-visible:border-yellow-500 focus-visible:ring-yellow-500/30"},Gr={outlined:"",borderless:"border-transparent shadow-none focus:border-transparent focus:ring-0 focus:ring-offset-0",filled:"border-transparent bg-muted/60 focus:bg-muted",underlined:"border-x-0 border-t-0 rounded-none focus:ring-offset-0"},rr=M||V,$r=f!=null?f:"Select time",or=s("div",{role:"combobox","aria-expanded":ye,"aria-haspopup":"dialog",className:l("relative w-full",E),style:N,children:[R&&a("div",{className:"pointer-events-none absolute inset-y-0 left-3 flex items-center text-muted-foreground",children:R}),a(Qe,{...H,ref:t,value:W,onChange:rr?void 0:aa,onFocus:L,onBlur:q,readOnly:rr,disabled:C,placeholder:$r,name:T,id:A,className:l("pr-10 text-sm",Gr[y],R&&"pl-10",C&&"cursor-not-allowed opacity-60",!C&&"cursor-pointer",Ye[p],w?Nt[w]:void 0,k),style:{...w==="error"?{borderColor:"hsl(var(--destructive))",boxShadow:"0 0 0 3px hsl(var(--destructive) / 0.2)"}:{},...w==="warning"?{borderColor:"var(--warning, hsl(var(--primary)))",boxShadow:"0 0 0 3px hsl(var(--primary) / 0.2)"}:{},...P!=null?P:{}},onClick:Z=>{_==null||_(Z),!C&&Ne(true);}}),Ce&&a("button",{type:"button",className:"absolute inset-y-0 right-8 flex items-center text-muted-foreground transition hover:text-foreground",onMouseDown:Z=>{Z.preventDefault(),Z.stopPropagation();},onClick:Z=>{Z.preventDefault(),Z.stopPropagation(),me(null);},children:he}),a("div",{className:"pointer-events-none absolute inset-y-0 right-3 flex items-center text-muted-foreground",children:a(lucideReact.Clock,{className:"h-4 w-4"})})]}),qr=J__namespace.useMemo(()=>[{label:"AM",value:"AM"},{label:"PM",value:"PM"}],[]),Wr=s("div",{className:"flex w-max gap-4 p-4",role:"dialog","aria-modal":"true",children:[a(Zo,{label:"Hour",options:Pt,selectedValue:We,onSelect:Ht}),a(Zo,{label:"Minute",options:xe,selectedValue:Ft,onSelect:Le}),le?a(Zo,{label:"Second",options:Ut,selectedValue:bt,onSelect:Te}):null,m?a(Of,{value:K,onChange:Gt}):null]}),Yr=s("div",{className:"flex w-full gap-4",children:[a(Qo,{open:ye,label:"Hour",options:Pt,selectedValue:We,onValueChange:Z=>(Ht(Z),true)}),a(Qo,{open:ye,label:"Minute",options:xe,selectedValue:Ft,onValueChange:Z=>(Le(Z),true)}),m?a(Qo,{open:ye,label:"Period",options:qr,selectedValue:K,infinite:false,onValueChange:Z=>(Gt(Z),true)}):null]});return V?s(xa,{open:ye,onOpenChange:Ne,children:[a(Pr,{asChild:true,children:or}),s(ya,{className:"mt-10 max-h-[min(540px,calc(100dvh-6rem))] rounded-t-3xl bg-background",children:[a(ka,{className:"px-6 pb-2 pt-4",children:a(Ra,{className:"text-base font-medium text-foreground",children:"Select time"})}),s("div",{className:"flex flex-1 flex-col gap-6 px-6 pb-6",children:[a("div",{className:"flex w-full gap-4",children:Yr}),s("div",{className:"mt-auto flex items-center justify-between",children:[a("div",{className:"flex-1"}),s("div",{className:"flex items-center gap-3",children:[h?a(X,{type:"button",variant:"outline",size:"sm",className:"text-muted-foreground hover:text-foreground",onClick:()=>me(null),children:"Clear"}):null,a(Nr,{asChild:true,children:a(X,{type:"button",variant:"default",size:"sm",className:"bg-[var(--date-primary-color)] text-white hover:opacity-90 focus-visible:ring-[var(--date-primary-color)]/30",style:re,children:"Done"})})]})]})]})]})]}):s(ha,{open:ye,onOpenChange:Ne,children:[a(Tr,{asChild:true,children:or}),a(wa,{className:"w-auto border border-border bg-popover p-0 shadow-lg",align:it,side:oe,children:Wr})]})});en.displayName="TimePicker";function vl({row:e}){let{transform:t,transition:r,setNodeRef:o,isDragging:n}=sortable.useSortable({id:e.original.id});return a(Re,{"data-state":e.getIsSelected()&&"selected","data-dragging":n,ref:o,className:"relative z-0 data-[dragging=true]:z-10 data-[dragging=true]:opacity-80",style:{transform:utilities.CSS.Transform.toString(t),transition:r},children:e.getVisibleCells().map(i=>a(ke,{children:reactTable.flexRender(i.column.columnDef.cell,i.getContext())},i.id))})}function Qf({columns:e,dndEnabled:t,dataIds:r,rows:o}){return o.length?t?a(sortable.SortableContext,{items:r,strategy:sortable.verticalListSortingStrategy,children:o.map(n=>a(vl,{row:n},n.id))}):o.map(n=>a(Re,{"data-state":n.getIsSelected()&&"selected",children:n.getVisibleCells().map(i=>{let c=i.column.columnDef.meta;return a(ke,{className:c==null?void 0:c.cellClassName,style:c==null?void 0:c.cellStyle,children:reactTable.flexRender(i.column.columnDef.cell,i.getContext())},i.id)})},n.id)):a(Re,{children:a(ke,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})}function wl({table:e,columns:t,dndEnabled:r=false,onReorder:o,virtualizedRows:n}){var h;let i=(h=n==null?void 0:n.rows)!=null?h:e.getRowModel().rows,c=r?i.map(x=>Number(x.id)):[],u=J__namespace.useId(),d=core.useSensors(core.useSensor(core.MouseSensor,{}),core.useSensor(core.TouchSensor,{}),core.useSensor(core.KeyboardSensor,{}));function v(x){let{active:f,over:b}=x;if(f&&b&&f.id!==b.id&&o){let p=c.indexOf(f.id),w=c.indexOf(b.id),y=sortable.arrayMove(e.options.data,p,w);o(y);}}let m=s(ut,{className:"table-fixed min-w-full",children:[a(pt,{className:"sticky top-0 z-20 bg-muted",children:e.getHeaderGroups().map(x=>a(Re,{children:x.headers.map(f=>{let b=f.column.columnDef.meta;return a(Oe,{colSpan:f.colSpan,className:l("sticky top-0 z-30 bg-muted",b==null?void 0:b.headerClassName),style:b==null?void 0:b.headerStyle,children:f.isPlaceholder?null:reactTable.flexRender(f.column.columnDef.header,f.getContext())},f.id)})},x.id))}),s(mt,{className:"**:data-[slot=table-cell]:first:w-8",children:[n!=null&&n.paddingTop?a(Re,{className:"pointer-events-none border-0",children:a(ke,{colSpan:t.length,className:"p-0",style:{height:n.paddingTop}})}):null,Qf({columns:t,dndEnabled:r,dataIds:c,rows:i}),n!=null&&n.paddingBottom?a(Re,{className:"pointer-events-none border-0",children:a(ke,{colSpan:t.length,className:"p-0",style:{height:n.paddingBottom}})}):null]})]});return r?a(core.DndContext,{collisionDetection:core.closestCenter,modifiers:[modifiers.restrictToVerticalAxis],onDragEnd:v,sensors:d,id:u,children:m}):m}function rg(e){switch(e){case "desc":return a(lucideReact.ArrowDown,{className:"ml-2 h-4 w-4"});case "asc":return a(lucideReact.ArrowUp,{className:"ml-2 h-4 w-4"});default:return a(lucideReact.ChevronsUpDown,{className:"ml-2 h-4 w-4"})}}function xl({column:e,title:t,className:r}){if(!e.getCanSort())return a("div",{className:l(r),children:t});let o=n=>{let i=n.shiftKey||n.metaKey||n.ctrlKey,c=e.getNextSortingOrder();if(!c){e.clearSorting();return}e.toggleSorting(c==="desc",i);};return a("div",{className:l("flex items-center space-x-2",r),children:s(X,{type:"button",variant:"ghost",size:"sm",className:"-ml-3 h-8 justify-start",onClick:o,children:[a("span",{children:t}),rg(e.getIsSorted())]})})}function yl({table:e,showPageSize:t=true,pageSizeOptions:r=[10,20,30,40,50]}){return s("div",{className:"flex items-center justify-between px-4",children:[s("div",{className:"text-muted-foreground hidden flex-1 text-sm lg:flex",children:[e.getFilteredSelectedRowModel().rows.length," of ",e.getFilteredRowModel().rows.length," row(s) selected."]}),s("div",{className:"flex w-full items-center gap-8 lg:w-fit",children:[t?s("div",{className:"hidden items-center gap-2 lg:flex",children:[a(De,{htmlFor:"rows-per-page",className:"text-sm font-medium",children:"Rows per page"}),a(Or,{value:`${e.getState().pagination.pageSize}`,onValueChange:o=>{e.setPageSize(Number(o));},options:r.map(o=>({value:`${o}`,label:o})),triggerProps:{size:"sm",className:"w-20",id:"rows-per-page"},contentProps:{side:"top"}})]}):null,s("div",{className:"flex w-fit items-center justify-center text-sm font-medium",children:["Page ",e.getState().pagination.pageIndex+1," of ",e.getPageCount()]}),s("div",{className:"ml-auto flex items-center gap-2 lg:ml-0",children:[s(X,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),children:[a("span",{className:"sr-only",children:"Go to first page"}),a(lucideReact.ChevronsLeft,{})]}),s(X,{variant:"outline",className:"size-8",size:"icon",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),children:[a("span",{className:"sr-only",children:"Go to previous page"}),a(lucideReact.ChevronLeft,{})]}),s(X,{variant:"outline",className:"size-8",size:"icon",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),children:[a("span",{className:"sr-only",children:"Go to next page"}),a(lucideReact.ChevronRight,{})]}),s(X,{variant:"outline",className:"hidden size-8 lg:flex",size:"icon",onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),children:[a("span",{className:"sr-only",children:"Go to last page"}),a(lucideReact.ChevronsRight,{})]})]})]})]})}function kl({table:e}){return s(ks,{children:[a(Ho,{asChild:true,children:s(X,{variant:"outline",size:"sm",className:"ml-auto hidden h-8 lg:flex",children:[a(lucideReact.Settings2,{}),"View"]})}),s(Oo,{align:"end",className:"w-[150px]",children:[a(Cs,{children:"Toggle columns"}),a(Ts,{}),e.getAllColumns().filter(t=>typeof t.accessorFn!="undefined"&&t.getCanHide()).map(t=>a(Rs,{className:"capitalize",checked:t.getIsVisible(),onCheckedChange:r=>t.toggleVisibility(!!r),children:t.id},t.id))]})]})}function ug({id:e}){let{attributes:t,listeners:r}=sortable.useSortable({id:e});return s(X,{...t,...r,variant:"ghost",size:"icon",className:"text-muted-foreground size-7 hover:bg-transparent",children:[a(lucideReact.GripVertical,{className:"text-muted-foreground size-3"}),a("span",{className:"sr-only",children:"Drag to reorder"})]})}var Rl={id:"drag",header:()=>null,cell:({row:e})=>a(ug,{id:e.original.id}),enableSorting:false,enableHiding:false};function hN(e){return [Rl,...e]}function an(e,t){return t?t.split(".").reduce((r,o)=>{if(!(r===null||typeof r!="object"))return r[o]},e):e}function fg(e){if(e)return typeof e=="number"?{width:e,minWidth:e}:{width:e,minWidth:e}}function gg(e){var d,v,m;if(!e)return null;let t=(d=e.body)!=null?d:e.payload,r=e.params,o=e.headers,n=e.resultKey,i=e.mapData,c=e.delay;if(typeof e.get=="string")return {method:"get",url:e.get,params:r,headers:o,resultKey:n,mapData:i,delay:c};if(typeof e.post=="string")return {method:"post",url:e.post,body:t,params:r,headers:o,resultKey:n,mapData:i,delay:c};let u=(v=e.url)!=null?v:e.reul;return typeof u=="string"?{method:(m=e.method)!=null?m:"get",url:u,body:t,params:r,headers:o,resultKey:n,mapData:i,delay:c}:null}function vg(e,t){return e.map(r=>{var d,v,m,h;let o=r.item?x=>an(x,r.item):x=>x,n=r.align==="right"?"text-right justify-end":r.align==="center"?"text-center justify-center":void 0,i=l(n,r.headerClassName),c=l(r.align==="right"?"text-right":r.align==="center"?"text-center":void 0,r.cellClassName),u=fg(r.width);return {id:r.key,accessorFn:o,header:({column:x})=>a(xl,{column:x,title:r.title,className:n}),cell:({row:x})=>{let f=x.original,b=r.item?an(f,r.item):o(f);return r.func?r.func(f,{value:b,rowIndex:x.index}):b},enableSorting:t&&((d=r.sortable)!=null?d:true)&&!!r.item,enableHiding:(v=r.hiddeable)!=null?v:true,meta:{headerClassName:i,headerStyle:(m=r.headerStyle)!=null?m:u,cellClassName:c,cellStyle:(h=r.cellStyle)!=null?h:u}}})}function bg(e,t){if(Array.isArray(e))return e;if(e&&typeof e=="object"){if(t&&Array.isArray(e[t]))return e[t];if(Array.isArray(e.data))return e.data}return []}function hg(e,t){if(!t||Object.keys(t).length===0)return e;try{let r=new URL(e,typeof window!="undefined"?window.location.origin:"http://localhost");return Object.entries(t).forEach(([o,n])=>{n!=null&&r.searchParams.set(o,String(n));}),r.toString()}catch{let o=new URLSearchParams(Object.entries(t).reduce((i,[c,u])=>(u==null||(i[c]=String(u)),i),{})),n=e.includes("?")?"&":"?";return `${e}${n}${o.toString()}`}}function wg({data:e,columns:t,pagination:r=true,sortable:o=true,reload:n=false,filterable:i=false,selectable:c=false,height:u=480,rowHeight:d=48,overscan:v=5,defaultPageSize:m=25,pageSize:h,className:x,emptyState:f,onDataChange:b,loading:p}){var pe,he,Ce;let w=J__namespace.useMemo(()=>gg(e.read),[e.read]),y=J__namespace.useMemo(()=>{var re;return (re=e.bind)!=null?re:[]},[e.bind]),k=(pe=h==null?void 0:h.count)!=null?pe:m,P=(he=h==null?void 0:h.options)!=null?he:[10,20,30,40,50],R=(Ce=h==null?void 0:h.visible)!=null?Ce:true,[S,g]=J__namespace.useState(()=>y),[M,E]=J__namespace.useState(false),[N,C]=J__namespace.useState(null),T=J__namespace.useRef(null),[A,F]=J__namespace.useState(0),[q,L]=J__namespace.useState(u),_=J__namespace.useRef(null),[H,D]=J__namespace.useState(""),U=J__namespace.useMemo(()=>vg(t,o),[t,o]),V=J__namespace.useMemo(()=>c?[{id:"__select",enableHiding:false,enableSorting:false,size:44,header:({table:ae})=>a("div",{className:"flex items-center justify-center",children:a(Va,{"aria-label":"Select all rows",checked:ae.getIsAllPageRowsSelected()||ae.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:we=>ae.toggleAllPageRowsSelected(we===true)})}),cell:({row:ae})=>a("div",{className:"flex items-center justify-center",children:a(Va,{"aria-label":"Select row",checked:ae.getIsSelected(),onCheckedChange:we=>ae.toggleSelected(we===true)})}),meta:{headerClassName:"w-11 px-2",headerStyle:{width:44,minWidth:44},cellClassName:"w-11 px-2",cellStyle:{width:44,minWidth:44}}},...U]:U,[U,c]),B=J__namespace.useMemo(()=>t.filter(re=>!!re.item),[t]),$=J__namespace.useMemo(()=>{if(!i||!H.trim())return S;let re=H.trim().toLowerCase();return S.filter(ae=>B.some(we=>{let de=an(ae,we.item);return de==null?false:String(de).toLowerCase().includes(re)}))},[S,i,H,B]),j=_n({data:$,columns:V,enableRowSelection:c,defaultPageSize:r?k:$.length||10,getRowId:(re,ae)=>ae.toString()});J__namespace.useEffect(()=>{r||(j.setPageIndex(0),j.setPageSize($.length||1));},[r,$.length,j]),J__namespace.useEffect(()=>{r&&j.setPageSize(k);},[r,k,j]),J__namespace.useEffect(()=>{g(y);},[y]),J__namespace.useEffect(()=>{i||D("");},[i]);let G=J__namespace.useCallback(async()=>{var ae,we;if(!w)return;(ae=_.current)==null||ae.abort();let re=new AbortController;_.current=re,E(true),C(null);try{let de=hg(w.url,w.params),ye=new Headers(w.headers),Ne;w.method==="post"&&w.body!==void 0&&(Ne=typeof w.body=="string"?w.body:JSON.stringify(w.body),ye.has("Content-Type")||ye.set("Content-Type","application/json"));let me=await fetch(de,{method:w.method.toUpperCase(),headers:ye,body:Ne,signal:re.signal});if(!me.ok)throw new Error(`Request failed with status ${me.status}`);w.delay&&w.delay>0&&await new Promise(Se=>setTimeout(Se,w.delay));let Ie=await me.json(),Pe=w.mapData?w.mapData(Ie):bg(Ie,w.resultKey);g(Pe),C(null),b==null||b(Pe);}catch(de){if(de.name==="AbortError")return;C((we=de.message)!=null?we:"Unable to fetch data");}finally{E(false);}},[w,b]);J__namespace.useEffect(()=>(w&&G().catch(()=>{}),()=>{var re;(re=_.current)==null||re.abort();}),[w,G]),J__namespace.useEffect(()=>{if(!T.current)return;let re=T.current;L(re.clientHeight||u);let ae=()=>{L(re.clientHeight||u);};return typeof window!="undefined"&&window.addEventListener("resize",ae),()=>{typeof window!="undefined"&&window.removeEventListener("resize",ae);}},[u]);let z=j.getRowModel().rows,te=z.length,K=j.getFilteredSelectedRowModel().rows.length,ce=j.getFilteredRowModel().rows.length;J__namespace.useEffect(()=>{T.current&&(T.current.scrollTop=0),F(0);},[te]);let le=te*d,ne=Math.max(0,Math.floor(A/d)-v),ge=Math.min(z.length,Math.ceil((A+q)/d)+v),fe=J__namespace.useMemo(()=>{if(!z.length)return null;let re=z.slice(ne,ge),ae=ne*d,we=re.length*d,de=Math.max(le-ae-we,0);return {rows:re,paddingTop:ae,paddingBottom:de}},[z,ne,ge,d,le]),W=!!p||M,ie=!W&&S.length===0&&!!f;return s("div",{className:l("flex w-full flex-col gap-4",x),children:[s("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[i?s("div",{className:"relative flex w-full max-w-md items-center",children:[a(lucideReact.Search,{className:"pointer-events-none absolute left-3 h-4 w-4 text-muted-foreground"}),a(Qe,{className:"pl-9",placeholder:"Search rows...",value:H,onChange:re=>D(re.target.value)})]}):a("div",{className:"h-9"}),s("div",{className:"flex items-center justify-end gap-2",children:[n&&w?s(X,{variant:"outline",size:"sm",onClick:()=>{G().catch(()=>{});},disabled:M||!!p,children:[M||p?a(lucideReact.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):a(lucideReact.RotateCcw,{className:"mr-2 h-4 w-4"}),"Reload"]}):null,a(kl,{table:j})]})]}),s("div",{className:"relative overflow-hidden rounded-lg border",children:[ie?a("div",{className:"flex items-center justify-center p-6 text-sm text-muted-foreground",children:f}):a("div",{ref:T,className:"max-h-full overflow-auto",style:{maxHeight:u},onScroll:re=>F(re.currentTarget.scrollTop),children:a(wl,{table:j,columns:V,virtualizedRows:fe!=null?fe:void 0})}),W?a("div",{className:"absolute inset-0 flex items-center justify-center bg-background/70 backdrop-blur-sm",children:s("div",{className:"flex flex-col items-center gap-2 text-sm text-muted-foreground",children:[a(lucideReact.Loader2,{className:"h-5 w-5 animate-spin"}),a("span",{children:"Loading data\u2026"})]})}):null]}),N?a("div",{className:"text-destructive text-sm",children:N}):null,r?a(yl,{table:j,showPageSize:R,pageSizeOptions:P}):c?a("div",{className:"flex items-center justify-between px-4 text-sm text-muted-foreground",children:s("span",{children:[K," of ",ce," row(s) selected."]})}):null]})}wg.displayName="DataGrid";function yg({onReset:e}){return s("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-background px-6 py-16 text-center",children:[s("div",{className:"space-y-3",children:[a("h1",{className:"text-3xl font-semibold tracking-tight text-foreground",children:"Something went wrong"}),a("p",{className:"text-base text-muted-foreground",children:"We hit an unexpected error. You can try again or head back to the dashboard."})]}),s("div",{className:"flex flex-wrap items-center justify-center gap-3",children:[a(X,{onClick:()=>{e(),Mn("/dashboard/default");},children:"Back to home"}),a(X,{variant:"outline",onClick:()=>{e();},children:"Try again"})]})]})}var Tl=class extends J.Component{constructor(){super(...arguments);this.state={hasError:false};this.resetBoundary=()=>{this.setState({hasError:false});};}static getDerivedStateFromError(){return {hasError:true}}componentDidCatch(r,o){var n,i;process.env.NODE_ENV!=="production"&&console.error("ErrorBoundary caught an error",r,o),(i=(n=this.props).onError)==null||i.call(n,r,o);}render(){if(this.state.hasError){let{fallback:r}=this.props;return r?typeof r=="function"?r(this.resetBoundary):r:a(yg,{onReset:this.resetBoundary})}return this.props.children}};var je=J__namespace.forwardRef(({className:e,...t},r)=>a("div",{ref:r,className:l("flex flex-col gap-2",e),...t}));je.displayName="FormBlock";var Ue=J__namespace.forwardRef(({message:e,children:t,className:r,...o},n)=>!e&&!t?null:a("p",{ref:n,className:l("text-sm text-destructive",r),role:"alert",...o,children:e!=null?e:t}));Ue.displayName="FormError";var kg=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange||e.handleBlur?e:(t=e.form)!=null?t:e},Rg=J__namespace.forwardRef(({label:e,name:t,type:r="text",placeholder:o,required:n=false,error:i,value:c,onChange:u,onBlur:d,className:v,description:m,autoComplete:h,labelProps:x={},inputProps:f={},form:b,rules:p},w)=>{var ce,le;let y=kg(b),k=y==null?void 0:y.values,P=y==null?void 0:y.errors,R=y==null?void 0:y.touched,S=k==null?void 0:k[t],g=P==null?void 0:P[t],M=R==null?void 0:R[t],E=(ce=y==null?void 0:y.validationSequence)!=null?ce:0,N=y==null?void 0:y.handleChange,C=y==null?void 0:y.handleBlur,T=y==null?void 0:y.setFieldValue,A=y==null?void 0:y.setFieldError,F=y==null?void 0:y.setFieldTouched,{onChange:q,onBlur:L,className:_,type:H,autoComplete:D,...U}=f,{children:V,...B}=x,$=H!=null?H:r,j=ne=>{let ge=ne.target.value,W=!!p||n?Sl(ge,p,n):void 0;A==null||A(t,W),T==null||T(t,ge),N==null||N(ne),u==null||u(ge),q==null||q(ne);},G=ne=>{F==null||F(t,true),C==null||C(ne),d==null||d(),L==null||L(ne);},z=S!==void 0?S:c!==void 0?c:"",te=(le=M?g:void 0)!=null?le:i,K=J__namespace.useRef(E);return J__namespace.useEffect(()=>{let ne=!!p||n,ge=E!==K.current;if(!A||!ne){K.current=E;return}if(!M&&!ge){K.current=E;return}let fe=typeof z=="string"?z:z!=null?String(z):"",W=Sl(fe,p,n);W!==g&&A(t,W),K.current=E;},[z,g,A,M,t,n,p,E]),s(je,{className:v,children:[e&&a(De,{htmlFor:t,...B,children:V!=null?V:s("span",{className:"flex items-center gap-1",children:[a("span",{children:e}),n&&a("span",{className:"text-destructive",children:"*"})]})}),m&&a("p",{className:"text-sm text-muted-foreground",children:m}),a(Qe,{ref:w,id:t,name:t,type:$,placeholder:o,value:z,onChange:j,onBlur:G,"aria-invalid":!!te,autoComplete:D!=null?D:h,className:_,...U}),a(Ue,{message:te})]})});function Sl(e,t,r){if(r&&!e)return typeof(t==null?void 0:t.required)=="string"?t.required:"This field is required";if(e){if(t!=null&&t.minLength&&e.length<t.minLength.value)return t.minLength.message;if(t!=null&&t.maxLength&&e.length>t.maxLength.value)return t.maxLength.message;if(t!=null&&t.pattern&&!t.pattern.value.test(e))return t.pattern.message;if(t!=null&&t.validate){let o=t.validate(e);if(typeof o=="string")return o;if(o===false)return "Invalid value"}}}Rg.displayName="FormInput";var Cg=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange||e.handleBlur?e:(t=e.form)!=null?t:e},Tg=J__namespace.forwardRef(({label:e,name:t,mask:r,placeholderChar:o,placeholder:n,required:i=false,error:c,value:u,onChange:d,onBlur:v,className:m,description:h,labelProps:x={},inputProps:f={},form:b,rules:p},w)=>{var j,G;let y=Cg(b),k=y==null?void 0:y.values,P=y==null?void 0:y.errors,R=y==null?void 0:y.touched,S=k==null?void 0:k[t],g=P==null?void 0:P[t],M=R==null?void 0:R[t],E=(j=y==null?void 0:y.validationSequence)!=null?j:0,N=y==null?void 0:y.setFieldValue,C=y==null?void 0:y.setFieldError,T=y==null?void 0:y.setFieldTouched,{className:A,onBlur:F,onChange:q,...L}=f,{children:_,...H}=x,D=z=>{let K=!!p||i?Ml(z,p,i):void 0;C==null||C(t,K),N==null||N(t,z),d==null||d(z),q==null||q(z);},U=z=>{T==null||T(t,true),v==null||v(),F==null||F(z);},V=S!==void 0?S:u!==void 0?u:"",B=(G=M?g:void 0)!=null?G:c,$=J__namespace.useRef(E);return J__namespace.useEffect(()=>{let z=!!p||i,te=E!==$.current;if(!C||!z){$.current=E;return}if(!M&&!te){$.current=E;return}let K=Ml(V,p,i);K!==g&&C(t,K),$.current=E;},[V,g,C,M,t,i,p,E]),s(je,{className:m,children:[e&&a(De,{htmlFor:t,...H,children:_!=null?_:s("span",{className:"flex items-center gap-1",children:[a("span",{children:e}),i&&a("span",{className:"text-destructive",children:"*"})]})}),h&&a("p",{className:"text-sm text-muted-foreground",children:h}),a(Eo,{ref:w,id:t,name:t,mask:r,placeholderChar:o,placeholder:n,value:V,onChange:D,onBlur:U,"aria-invalid":!!B,className:A,...L}),a(Ue,{message:B})]})});Tg.displayName="FormInputMask";function Ml(e,t,r){if(r&&!e)return t&&typeof t.required=="string"?t.required:"This field is required";if(e){if(t!=null&&t.minLength&&e.length<t.minLength.value)return t.minLength.message;if(t!=null&&t.maxLength&&e.length>t.maxLength.value)return t.maxLength.message;if(t!=null&&t.pattern&&!t.pattern.value.test(e))return t.pattern.message;if(t!=null&&t.validate){let o=t.validate(e);if(typeof o=="string")return o;if(o===false)return "Invalid value"}}}var Pg=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange||e.handleBlur?e:(t=e.form)!=null?t:e},Ng=J__namespace.forwardRef(({label:e,name:t,placeholder:r,required:o=false,error:n,value:i,onChange:c,onBlur:u,className:d,description:v,labelProps:m={},inputProps:h={},form:x,min:f,max:b,decimals:p,formatter:w,parser:y,rules:k},P)=>{var te,K;let R=Pg(x),S=R==null?void 0:R.values,g=R==null?void 0:R.errors,M=R==null?void 0:R.touched,E=S==null?void 0:S[t],N=g==null?void 0:g[t],C=M==null?void 0:M[t],T=(te=R==null?void 0:R.validationSequence)!=null?te:0,A=R==null?void 0:R.setFieldValue,F=R==null?void 0:R.setFieldError,q=R==null?void 0:R.setFieldTouched,{className:L,onBlur:_,onChange:H,...D}=h,{children:U,...V}=m,B=ce=>{let ne=!!k||o?El(ce,k,o):void 0;F==null||F(t,ne),A==null||A(t,ce),c==null||c(ce),H==null||H(ce);},$=ce=>{q==null||q(t,true),u==null||u(),_==null||_(ce);},j=E!==void 0?E:i!==void 0?i:null,G=(K=C?N:void 0)!=null?K:n,z=J__namespace.useRef(T);return J__namespace.useEffect(()=>{let ce=!!k||o,le=T!==z.current;if(!F||!ce){z.current=T;return}if(!C&&!le){z.current=T;return}let ne=El(j,k,o);ne!==N&&F(t,ne),z.current=T;},[j,N,F,C,t,o,k,T]),s(je,{className:d,children:[e&&a(De,{htmlFor:t,...V,children:U!=null?U:s("span",{className:"flex items-center gap-1",children:[a("span",{children:e}),o&&a("span",{className:"text-destructive",children:"*"})]})}),v&&a("p",{className:"text-sm text-muted-foreground",children:v}),a(Mo,{ref:P,id:t,name:t,placeholder:r,value:j,onChange:B,onBlur:$,"aria-invalid":!!G,min:f,max:b,decimals:p,formatter:w,parser:y,className:L,...D}),a(Ue,{message:G})]})});Ng.displayName="FormInputNumeric";function El(e,t,r){if(r&&e==null)return t&&typeof t.required=="string"?t.required:"This field is required";if(e!=null){if(t!=null&&t.min&&e<t.min.value)return t.min.message;if(t!=null&&t.max&&e>t.max.value)return t.max.message;if(t!=null&&t.validate){let o=t.validate(e);if(typeof o=="string")return o;if(o===false)return "Invalid value"}}}var Mg=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange||e.handleBlur?e:(t=e.form)!=null?t:e};function f1({label:e,name:t,description:r,placeholder:o="Select an option",required:n=false,error:i,value:c,defaultValue:u,onChange:d,onBlur:v,className:m,disabled:h,labelProps:x={},selectProps:f={},triggerProps:b={},contentProps:p={},multiSelectProps:w={},multiSelectTriggerProps:y={},multiSelectValueProps:k={},multiSelectContentProps:P={},form:R,options:S,isMulti:g=false,rules:M}){var Te,Gt,aa;let E=nt(),N=Mg(R),C=N==null?void 0:N.values,T=N==null?void 0:N.errors,A=N==null?void 0:N.touched,F=C==null?void 0:C[t],q=T==null?void 0:T[t],L=A==null?void 0:A[t],_=N==null?void 0:N.setFieldValue,H=N==null?void 0:N.setFieldError,D=N==null?void 0:N.setFieldTouched,U=N==null?void 0:N.handleChange,V=N==null?void 0:N.handleBlur,B=(Te=N==null?void 0:N.validationSequence)!=null?Te:0,{onValueChange:$,value:j,defaultValue:G,...z}=f,{onBlur:te,...K}=b,ce={...K,disabled:h!=null?h:K.disabled},{title:le,...ne}=p,{onValueChange:ge,value:fe,defaultValue:W,...ie}=w,{onBlur:pe,...he}=y,{title:Ce,...re}=P,[ae,we]=J__namespace.useState(typeof u=="string"?u:""),[de,ye]=J__namespace.useState(Array.isArray(u)?u:[]);J__namespace.useEffect(()=>{typeof u=="string"&&j===void 0&&F===void 0&&c===void 0&&we(u);},[u,F,j,c]),J__namespace.useEffect(()=>{Array.isArray(u)&&fe===void 0&&!Array.isArray(F)&&!Array.isArray(c)&&ye(u);},[u,F,fe,c]);let Ne=typeof j=="string"?j:typeof F=="string"?F:typeof c=="string"?c:ae,me=Array.isArray(fe)?fe:Array.isArray(F)?F:Array.isArray(c)?c:de,Ie=(Gt=L?q:void 0)!=null?Gt:i,Pe=J__namespace.useRef(B);J__namespace.useEffect(()=>{let oe=!!M||n,it=B!==Pe.current;if(!H||!oe){Pe.current=B;return}if(!L&&!it){Pe.current=B;return}let Ye=g?me:Ne!=null?Ne:"",Nt=rn(Ye,M,n);Nt!==q&&H(t,Nt),Pe.current=B;},[me,Ne,q,H,L,g,t,n,M,B]);let Se=J__namespace.useCallback(oe=>{Array.isArray(oe)?(_==null||_(t,oe),U&&U({target:{name:t,value:oe}})):(_==null||_(t,oe),U&&U({target:{name:t,value:oe}}));},[U,_,t]),ve=J__namespace.useCallback(oe=>{j===void 0&&F===void 0&&c===void 0&&we(oe);let Ye=!!M||n?rn(oe,M,n):void 0;H==null||H(t,Ye),Se(oe),d==null||d(oe),$==null||$(oe);},[F,Se,d,$,j,c,M,n,H,t]),Pt=J__namespace.useCallback(oe=>{fe===void 0&&!Array.isArray(F)&&!Array.isArray(c)&&ye(oe);let Ye=!!M||n?rn(oe,M,n):void 0;H==null||H(t,Ye),Se(oe),d==null||d(oe),ge==null||ge(oe);},[F,Se,ge,fe,d,c,M,n,H,t]),xe=J__namespace.useCallback(oe=>{D==null||D(t,true),V==null||V({target:{name:t}}),v==null||v(),te==null||te(oe);},[V,D,t,v,te]),Ut=J__namespace.useCallback(oe=>{D==null||D(t,true),V==null||V({target:{name:t}}),v==null||v(),pe==null||pe(oe);},[V,D,t,pe,v]),We=G!=null?G:typeof u=="string"?u:void 0,Ft=W!=null?W:Array.isArray(u)?u:void 0,[bt,Ht]=J__namespace.useState(false),Le=({isMulti:oe=false})=>{var Ye;let it=oe?me.length>0?`${me.length} selected`:o:((Ye=S.find(Nt=>Nt.value===Ne))==null?void 0:Ye.label)||o;return s(X,{variant:"outline",className:l("w-full justify-between border-input bg-transparent px-3 py-2 text-sm","flex items-center gap-2",ce.disabled&&"opacity-50 cursor-not-allowed",!!Ie&&"border-destructive",ce.className),onClick:()=>!ce.disabled&&Ht(true),disabled:ce.disabled,type:"button",children:[a("span",{className:"flex-1 text-left truncate",children:it}),a(lucideReact.ChevronDownIcon,{className:"h-4 w-4 opacity-50 flex-shrink-0"})]})};return s(je,{className:m,children:[e&&a(De,{htmlFor:t,...x,children:(aa=x.children)!=null?aa:s("span",{className:"flex items-center gap-1",children:[a("span",{children:e}),n&&a("span",{className:"text-destructive",children:"*"})]})}),g?s(jsxRuntime.Fragment,{children:[E?s(jsxRuntime.Fragment,{children:[a(Le,{isMulti:true}),a(ea,{open:bt,onOpenChange:Ht,title:Ce!=null?Ce:e,options:S,selectedValues:me,onSelect:oe=>{let it=me.includes(oe)?me.filter(Ye=>Ye!==oe):[...me,oe];Pt(it);},isMulti:true})]}):s(Us,{...ie,value:me,defaultValue:Ft,onValueChange:Pt,children:[a(Gs,{"data-name":t,"aria-invalid":!!Ie,...he,...ce,onBlur:Ut,children:a($s,{placeholder:o,...k})}),a(qs,{title:Ce!=null?Ce:e,...re,children:S.map(oe=>a(Ws,{value:oe.value,disabled:oe.disabled,children:oe.label},oe.value))})]}),a("input",{type:"hidden",name:t,value:me.join(",")})]}):s(jsxRuntime.Fragment,{children:[E?s(jsxRuntime.Fragment,{children:[a(Le,{}),a(ea,{open:bt,onOpenChange:Ht,title:le!=null?le:e,options:S,selectedValues:Ne,onSelect:ve,isMulti:false})]}):a(Or,{...z,value:Ne,defaultValue:We,onValueChange:ve,options:S.map(oe=>({value:oe.value,label:oe.label,disabled:oe.disabled})),placeholder:o,triggerProps:{...ce,id:t,"aria-invalid":!!Ie,onBlur:xe},contentProps:{...ne,title:le!=null?le:e}}),a("input",{type:"hidden",name:t,value:Ne!=null?Ne:""})]}),a(Ue,{message:Ie}),r&&a("p",{className:"text-sm text-muted-foreground",children:r})]})}function rn(e,t,r){if(r){if(Array.isArray(e)){if(e.length===0)return typeof(t==null?void 0:t.required)=="string"?t.required:"This field is required"}else if(!e)return typeof(t==null?void 0:t.required)=="string"?t.required:"This field is required"}if(t!=null&&t.validate){let o=t.validate(e);if(typeof o=="string")return o;if(o===false)return "Invalid value"}}var Eg=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange||e.handleBlur?e:(t=e.form)!=null?t:e},Dg=J__namespace.forwardRef(({label:e,name:t,placeholder:r,required:o=false,error:n,value:i,onChange:c,onBlur:u,className:d,labelProps:v={},textareaProps:m={},form:h,rules:x},f)=>{var $,j;let b=Eg(h),p=b==null?void 0:b.values,w=b==null?void 0:b.errors,y=b==null?void 0:b.touched,k=p==null?void 0:p[t],P=w==null?void 0:w[t],R=y==null?void 0:y[t],S=($=b==null?void 0:b.validationSequence)!=null?$:0,g=b==null?void 0:b.handleChange,M=b==null?void 0:b.handleBlur,E=b==null?void 0:b.setFieldError,N=b==null?void 0:b.setFieldValue,C=b==null?void 0:b.setFieldTouched,{onChange:T,onBlur:A,className:F,...q}=m,{children:L,..._}=v,H=G=>{let z=G.target.value,K=!!x||o?Dl(z,x,o):void 0;E==null||E(t,K),N==null||N(t,z),g==null||g(G),c==null||c(z),T==null||T(G);},D=G=>{C==null||C(t,true),M==null||M(G),u==null||u(),A==null||A(G);},U=k!==void 0?String(k):i!==void 0?i:"",V=(j=R?P:void 0)!=null?j:n,B=J__namespace.useRef(S);return J__namespace.useEffect(()=>{let G=!!x||o,z=S!==B.current;if(!E||!G){B.current=S;return}if(!R&&!z){B.current=S;return}let te=Dl(U,x,o);te!==P&&E(t,te),B.current=S;},[U,P,E,R,t,o,x,S]),s(je,{className:d,children:[e&&a(De,{htmlFor:t,..._,children:L!=null?L:s("span",{className:"flex items-center gap-1",children:[a("span",{children:e}),o&&a("span",{className:"text-destructive",children:"*"})]})}),a(Ko,{ref:f,id:t,name:t,placeholder:r,value:U,onChange:H,onBlur:D,"aria-invalid":!!V,className:F,...q}),a(Ue,{message:V})]})});function Dl(e,t,r){if(r&&!e)return typeof(t==null?void 0:t.required)=="string"?t.required:"This field is required";if(e){if(t!=null&&t.minLength&&e.length<t.minLength.value)return t.minLength.message;if(t!=null&&t.maxLength&&e.length>t.maxLength.value)return t.maxLength.message;if(t!=null&&t.pattern&&!t.pattern.value.test(e))return t.pattern.message;if(t!=null&&t.validate){let o=t.validate(e);if(typeof o=="string")return o;if(o===false)return "Invalid value"}}}Dg.displayName="FormTextarea";var Lg=e=>{var t;if(e)return e.setFieldValue||e.setFieldTouched||e.handleBlur?e:(t=e.form)!=null?t:e},Ig=J__namespace.forwardRef(({label:e,description:t,name:r,required:o=false,error:n,value:i,defaultValue:c,onChange:u,onBlur:d,form:v,options:m,className:h,labelProps:x={},radioGroupProps:f={},optionLabelProps:b={},optionWrapperClassName:p,...w},y)=>{var $,j;let k=Lg(v),P=k==null?void 0:k.values,R=k==null?void 0:k.errors,S=k==null?void 0:k.touched,g=P==null?void 0:P[r],M=R==null?void 0:R[r],N=($=(S==null?void 0:S[r])?M:void 0)!=null?$:n,{className:C,onValueChange:T,onBlur:A,value:F,defaultValue:q,...L}=f,_=(j=i!=null?i:F!==void 0?F:void 0)!=null?j:g!=null?String(g):void 0,H=_===void 0?c!=null?c:q:void 0,D=J__namespace.useCallback(G=>{var z;(z=k==null?void 0:k.setFieldValue)==null||z.call(k,r,G),u==null||u(G),T==null||T(G);},[k,r,u,T]),U=J__namespace.useCallback(G=>{var z,te;(z=k==null?void 0:k.setFieldTouched)==null||z.call(k,r,true),(te=k==null?void 0:k.handleBlur)==null||te.call(k,{target:{name:r}}),d==null||d(),A==null||A(G);},[k,r,d,A]),{className:V,...B}=b;return s(je,{ref:y,className:l("gap-3",h),...w,children:[(e||t)&&s("div",{className:"space-y-1",children:[e&&a(De,{...x,children:s("span",{className:"flex items-center gap-1",children:[a("span",{children:e}),o&&a("span",{className:"text-destructive",children:"*"})]})}),t?a("p",{className:"text-sm text-muted-foreground",children:t}):null]}),a(Hs,{"aria-invalid":!!N,...L,..._!==void 0?{value:_}:H!==void 0?{defaultValue:H}:{},onValueChange:D,onBlur:U,className:l("grid gap-3",C),children:m.map(G=>{let z=`${r}-${G.value}`;return s("div",{className:l("flex items-start gap-3 rounded-lg border border-input bg-background p-3 shadow-xs",p,G.className,G.disabled&&"opacity-60"),children:[a(Os,{id:z,value:G.value,disabled:G.disabled,"aria-invalid":!!N,className:"mt-1"}),s(De,{htmlFor:z,className:l("flex-col items-start gap-1 font-normal sm:flex-row sm:items-center sm:gap-2",V),...B,children:[a("span",{className:"text-sm font-medium text-foreground",children:G.label}),G.description?a("span",{className:"block text-sm text-muted-foreground",children:G.description}):null]})]},G.value)})}),a(Ue,{message:N})]})});Ig.displayName="FormRadioGroup";var _g=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange||e.handleBlur?e:(t=e.form)!=null?t:e};function _1({label:e,name:t,placeholder:r,required:o=false,error:n,value:i,defaultValue:c=null,onChange:u,onBlur:d,className:v,description:m,labelProps:h={},datePickerProps:x={},form:f,rules:b}){var ne,ge,fe;let p=_g(f),w=p==null?void 0:p.values,y=p==null?void 0:p.errors,k=p==null?void 0:p.touched,P=p==null?void 0:p.setFieldValue,R=p==null?void 0:p.setFieldError,S=p==null?void 0:p.setFieldTouched,g=p==null?void 0:p.handleChange,M=p==null?void 0:p.handleBlur,E=w==null?void 0:w[t],N=y==null?void 0:y[t],C=k==null?void 0:k[t],T=(ne=p==null?void 0:p.validationSequence)!=null?ne:0,{onChange:A,onBlur:F,value:q,defaultValue:L,placeholder:_,status:H,...D}=x,[U,V]=J__namespace.useState((ge=L!=null?L:c)!=null?ge:null);J__namespace.useEffect(()=>{var W;q===void 0&&i===void 0&&E===void 0&&V((W=L!=null?L:c)!=null?W:null);},[L,q,c,E,i]);let B=q!==void 0?q!=null?q:null:E!==void 0?E!=null?E:null:i!==void 0?i!=null?i:null:U,$=(fe=C?N:void 0)!=null?fe:n,j=H!=null?H:$?"error":void 0,G=_!=null?_:r,{children:z,...te}=h,K=J__namespace.useRef(T);J__namespace.useEffect(()=>{let W=!!b||o,ie=T!==K.current;if(!R||!W){K.current=T;return}if(!C&&!ie){K.current=T;return}let pe=Ll(B!=null?B:null,b,o);pe!==N&&R(t,pe),K.current=T;},[B,N,R,C,t,o,b,T]);let ce=J__namespace.useCallback((W,ie)=>{q===void 0&&i===void 0&&E===void 0&&V(W!=null?W:null);let pe=Ll(W,b,o);R==null||R(t,pe),P?P(t,W!=null?W:null):g&&g({target:{name:t,value:ie}}),u==null||u(W!=null?W:null),A==null||A(W!=null?W:null,ie);},[A,q,g,R,P,E,t,u,o,b,i]),le=J__namespace.useCallback(W=>{S==null||S(t,true),M==null||M({target:{name:t}}),d==null||d(),F==null||F(W);},[F,M,S,t,d]);return s(je,{className:v,children:[e&&a(De,{htmlFor:t,...te,children:z!=null?z:s("span",{className:"flex items-center gap-1",children:[a("span",{children:e}),o&&a("span",{className:"text-destructive",children:"*"})]})}),m&&a("p",{className:"text-sm text-muted-foreground",children:m}),a(Fo,{id:t,name:t,value:B!=null?B:null,onChange:ce,onBlur:le,placeholder:G,status:j,"aria-invalid":!!$,...D}),a(Ue,{message:$})]})}function Ll(e,t,r){if(r&&!e)return t&&typeof t.required=="string"?t.required:"This field is required";if(e){if(t!=null&&t.minDate&&e.isBefore(t.minDate.value,"day"))return t.minDate.message;if(t!=null&&t.maxDate&&e.isAfter(t.maxDate.value,"day"))return t.maxDate.message}if(t!=null&&t.validate){let o=t.validate(e!=null?e:null);if(typeof o=="string")return o;if(o===false)return "Invalid value"}}var zg=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange||e.handleBlur?e:(t=e.form)!=null?t:e};function V1({label:e,name:t,placeholder:r,required:o=false,error:n,value:i,defaultValue:c=null,onChange:u,onBlur:d,className:v,description:m,labelProps:h={},timePickerProps:x={},form:f,rules:b}){var ne,ge,fe;let p=zg(f),w=p==null?void 0:p.values,y=p==null?void 0:p.errors,k=p==null?void 0:p.touched,P=p==null?void 0:p.setFieldValue,R=p==null?void 0:p.setFieldError,S=p==null?void 0:p.setFieldTouched,g=p==null?void 0:p.handleChange,M=p==null?void 0:p.handleBlur,E=w==null?void 0:w[t],N=y==null?void 0:y[t],C=k==null?void 0:k[t],T=(ne=p==null?void 0:p.validationSequence)!=null?ne:0,{onChange:A,onBlur:F,value:q,defaultValue:L,placeholder:_,status:H,...D}=x,[U,V]=J__namespace.useState((ge=L!=null?L:c)!=null?ge:null);J__namespace.useEffect(()=>{var W;q===void 0&&i===void 0&&E===void 0&&V((W=L!=null?L:c)!=null?W:null);},[c,E,L,q,i]);let B=q!==void 0?q!=null?q:null:E!==void 0?E!=null?E:null:i!==void 0?i!=null?i:null:U,$=(fe=C?N:void 0)!=null?fe:n,j=H!=null?H:$?"error":void 0,G=_!=null?_:r,{children:z,...te}=h,K=J__namespace.useRef(T);J__namespace.useEffect(()=>{let W=!!b||o,ie=T!==K.current;if(!R||!W){K.current=T;return}if(!C&&!ie){K.current=T;return}let pe=Il(B!=null?B:null,b,o);pe!==N&&R(t,pe),K.current=T;},[B,N,R,C,t,o,b,T]);let ce=J__namespace.useCallback((W,ie)=>{q===void 0&&i===void 0&&E===void 0&&V(W!=null?W:null);let pe=Il(W,b,o);R==null||R(t,pe),P?P(t,W!=null?W:null):g&&g({target:{name:t,value:ie}}),u==null||u(W!=null?W:null),A==null||A(W!=null?W:null,ie);},[g,R,P,E,t,u,o,b,A,q,i]),le=J__namespace.useCallback(W=>{S==null||S(t,true),M==null||M({target:{name:t}}),d==null||d(),F==null||F(W);},[M,S,t,d,F]);return s(je,{className:v,children:[e&&a(De,{htmlFor:t,...te,children:z!=null?z:s("span",{className:"flex items-center gap-1",children:[a("span",{children:e}),o&&a("span",{className:"text-destructive",children:"*"})]})}),m&&a("p",{className:"text-sm text-muted-foreground",children:m}),a(en,{id:t,name:t,value:B!=null?B:null,onChange:ce,onBlur:le,placeholder:G,status:j,"aria-invalid":!!$,...D}),a(Ue,{message:$})]})}function Il(e,t,r){if(r&&!e)return t&&typeof t.required=="string"?t.required:"This field is required";if(t!=null&&t.validate){let o=t.validate(e!=null?e:null);if(typeof o=="string")return o;if(o===false)return "Invalid value"}}var Ag=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange?e:(t=e.form)!=null?t:e},Fg=({name:e,label:t,description:r,className:o,checked:n,defaultChecked:i,onCheckedChange:c,switchProps:u,error:d,form:v,rules:m})=>{var B,$;let h=J__namespace.useId(),{id:x,onCheckedChange:f,className:b,disabled:p,"aria-describedby":w,"aria-labelledby":y,...k}=u!=null?u:{},P=x!=null?x:h,R=Ag(v),S=R==null?void 0:R.values,g=R==null?void 0:R.errors,M=R==null?void 0:R.touched,E=S==null?void 0:S[e],N=g==null?void 0:g[e],C=M==null?void 0:M[e],T=(B=R==null?void 0:R.validationSequence)!=null?B:0,A=($=C?N:void 0)!=null?$:d,F=E!==void 0?!!E:n!==void 0?n:void 0,q=r?`${P}-description`:void 0,L=A?`${P}-error`:void 0,_=[w,q,L].filter(Boolean).join(" ").trim()||void 0,H=t?[y,`${P}-label`].filter(Boolean).join(" ").trim()||void 0:y,D=J__namespace.useCallback(j=>{if(p)return;let G=document.getElementById(P);if(G){if(j.preventDefault(),typeof G.focus=="function")try{G.focus({preventScroll:!0});}catch{G.focus();}G.click();}},[p,P]),U=j=>{var te,K,ce;let z=!!m?_l(j,m):void 0;if((te=R==null?void 0:R.setFieldError)==null||te.call(R,e,z),(K=R==null?void 0:R.setFieldValue)==null||K.call(R,e,j),(ce=R==null?void 0:R.setFieldTouched)==null||ce.call(R,e,true),R!=null&&R.handleChange){let le={target:{name:e,value:j,checked:j}};R.handleChange(le);}c==null||c(j),f==null||f(j);},V=J__namespace.useRef(T);return J__namespace.useEffect(()=>{let j=!!m,G=T!==V.current;if(!(R!=null&&R.setFieldError)||!j){V.current=T;return}if(!C&&!G){V.current=T;return}let te=_l(E!==void 0?!!E:n!==void 0?n:!!i,m);te!==N&&R.setFieldError(e,te),V.current=T;},[n,i,N,C,E,e,R,m,T]),s("div",{className:l("flex items-start justify-between gap-4",o),children:[s("div",{className:"flex-1 space-y-2",children:[t?a(Xa,{id:`${P}-label`,htmlFor:P,onClick:D,className:l("text-sm leading-none font-medium",p?"cursor-not-allowed":"cursor-pointer"),children:t}):null,r?a(Ya,{id:q,children:r}):null,a(Ka,{id:L,children:A})]}),a(nl,{name:e,id:P,"aria-invalid":!!A,"aria-describedby":_,"aria-labelledby":H,className:l("cursor-pointer",b),disabled:p,...k,...F!==void 0?{checked:F}:{defaultChecked:i},onCheckedChange:U})]})};Fg.displayName="FormSwitch";function _l(e,t){if(t){if(t.required&&!e)return typeof t.required=="string"?t.required:"This field is required";if(t.validate){let r=t.validate(e);if(typeof r=="string")return r;if(r===false)return "Invalid value"}}}var J1=["sidebar","floating","inset"],Z1=["offcanvas","icon","none"],Q1=["centered","full-width"],e2=["sticky","scroll"];
|
|
9
|
+
Object.defineProperty(exports,"toast",{enumerable:true,get:function(){return sonner.toast}});exports.Accordion=Nv;exports.AccordionContent=Ev;exports.AccordionItem=Sv;exports.AccordionTrigger=Mv;exports.Alert=at;exports.AlertDescription=ot;exports.AlertDialog=qv;exports.AlertDialogAction=Qv;exports.AlertDialogCancel=eb;exports.AlertDialogContent=Yv;exports.AlertDialogDescription=Zv;exports.AlertDialogFooter=Xv;exports.AlertDialogHeader=Kv;exports.AlertDialogOverlay=Sc;exports.AlertDialogPortal=Nc;exports.AlertDialogTitle=Jv;exports.AlertDialogTrigger=Wv;exports.AlertTitle=rt;exports.AspectRatio=ob;exports.Avatar=cb;exports.AvatarFallback=ub;exports.AvatarImage=db;exports.Badge=$t;exports.Breadcrumb=kb;exports.BreadcrumbEllipsis=Sb;exports.BreadcrumbItem=Cb;exports.BreadcrumbLink=Tb;exports.BreadcrumbList=Rb;exports.BreadcrumbPage=Pb;exports.BreadcrumbSeparator=Nb;exports.Button=X;exports.CONTENT_LAYOUT_VALUES=Q1;exports.Calendar=Ab;exports.CalendarDayButton=Bc;exports.Card=Ge;exports.CardAction=Bb;exports.CardContent=$e;exports.CardDescription=Je;exports.CardFooter=Vb;exports.CardHeader=Ke;exports.CardTitle=Xe;exports.Carousel=Yb;exports.CarouselContent=Kb;exports.CarouselItem=Xb;exports.CarouselNext=Zb;exports.CarouselPrevious=Jb;exports.ChartContainer=fw;exports.ChartLegend=bw;exports.ChartLegendContent=hw;exports.ChartStyle=Hd;exports.ChartTooltip=gw;exports.ChartTooltipContent=vw;exports.Chat=_d;exports.ChatContainer=ii;exports.ChatForm=si;exports.ChatMessage=ei;exports.ChatMessages=zd;exports.Checkbox=Va;exports.Collapsible=Xn;exports.CollapsibleContent=Zn;exports.CollapsibleTrigger=Jn;exports.Command=fo;exports.CommandDialog=Fw;exports.CommandEmpty=gi;exports.CommandGroup=Hw;exports.CommandInput=mi;exports.CommandItem=vi;exports.CommandList=fi;exports.CommandSeparator=Ow;exports.CommandShortcut=Bw;exports.ContextMenu=qw;exports.ContextMenuCheckboxItem=ax;exports.ContextMenuContent=ex;exports.ContextMenuGroup=Yw;exports.ContextMenuItem=tx;exports.ContextMenuLabel=ox;exports.ContextMenuPortal=Kw;exports.ContextMenuRadioGroup=Jw;exports.ContextMenuRadioItem=rx;exports.ContextMenuSeparator=nx;exports.ContextMenuShortcut=ix;exports.ContextMenuSub=Xw;exports.ContextMenuSubContent=Qw;exports.ContextMenuSubTrigger=Zw;exports.ContextMenuTrigger=Ww;exports.CopyButton=no;exports.DataGrid=wg;exports.DataTable=wl;exports.DataTableColumnHeader=xl;exports.DataTablePagination=yl;exports.DataTableViewOptions=kl;exports.DatePicker=Fo;exports.Dialog=pa;exports.DialogClose=Mw;exports.DialogContent=ma;exports.DialogDescription=va;exports.DialogFooter=Ew;exports.DialogHeader=fa;exports.DialogOverlay=jd;exports.DialogPortal=Vd;exports.DialogTitle=ga;exports.DialogTrigger=pi;exports.DraggableRow=vl;exports.Drawer=xa;exports.DrawerClose=Nr;exports.DrawerContent=ya;exports.DrawerDescription=m0;exports.DrawerFooter=hs;exports.DrawerHeader=ka;exports.DrawerOverlay=Dp;exports.DrawerPortal=Ep;exports.DrawerTitle=Ra;exports.DrawerTrigger=Pr;exports.DropdownMenu=ks;exports.DropdownMenuCheckboxItem=Rs;exports.DropdownMenuContent=Oo;exports.DropdownMenuGroup=D0;exports.DropdownMenuItem=L0;exports.DropdownMenuLabel=Cs;exports.DropdownMenuPortal=E0;exports.DropdownMenuRadioGroup=I0;exports.DropdownMenuRadioItem=_0;exports.DropdownMenuSeparator=Ts;exports.DropdownMenuShortcut=z0;exports.DropdownMenuSub=A0;exports.DropdownMenuSubContent=Zp;exports.DropdownMenuSubTrigger=Jp;exports.DropdownMenuTrigger=Ho;exports.ErrorBoundary=Tl;exports.FIELD_HEIGHT_MOBILE_CLASS=wt;exports.Flex=nm;exports.Form=Qp;exports.FormBlock=je;exports.FormCheckbox=tm;exports.FormDatePicker=_1;exports.FormError=Ue;exports.FormInput=Rg;exports.FormInputMask=Tg;exports.FormInputNumeric=Ng;exports.FormRadioGroup=Ig;exports.FormSelect=f1;exports.FormSwitch=Fg;exports.FormTextarea=Dg;exports.FormTimePicker=V1;exports.HoverCard=dk;exports.HoverCardContent=pk;exports.HoverCardTrigger=uk;exports.HtmlRenderer=da;exports.Input=Qe;exports.InputMask=Eo;exports.InputNumeric=Mo;exports.InputOTP=hk;exports.InputOTPGroup=wk;exports.InputOTPSeparator=yk;exports.InputOTPSlot=xk;exports.Label=De;exports.MarkdownRenderer=Ih;exports.Menubar=Dk;exports.MenubarCheckboxItem=Hk;exports.MenubarContent=Ak;exports.MenubarGroup=Ik;exports.MenubarItem=Fk;exports.MenubarLabel=Bk;exports.MenubarMenu=Lk;exports.MenubarPortal=mm;exports.MenubarRadioGroup=_k;exports.MenubarRadioItem=Ok;exports.MenubarSeparator=Vk;exports.MenubarShortcut=jk;exports.MenubarSub=Uk;exports.MenubarSubContent=$k;exports.MenubarSubTrigger=Gk;exports.MenubarTrigger=zk;exports.MessageInput=lo;exports.MessageList=ai;exports.MobileFooter=jo;exports.MobileHeader=Uo;exports.MobileHeaderProvider=Pi;exports.MobileLayout=Fm;exports.MobileSelectDrawer=ea;exports.Modal=xm;exports.MultiSelect=Us;exports.MultiSelectContent=qs;exports.MultiSelectItem=Ws;exports.MultiSelectTrigger=Gs;exports.MultiSelectValue=$s;exports.NAVBAR_STYLE_VALUES=e2;exports.NavigationMenu=BR;exports.NavigationMenuContent=GR;exports.NavigationMenuIndicator=qR;exports.NavigationMenuItem=jR;exports.NavigationMenuLink=$R;exports.NavigationMenuList=VR;exports.NavigationMenuTrigger=UR;exports.NavigationMenuViewport=Vm;exports.Pagination=QR;exports.PaginationContent=eC;exports.PaginationEllipsis=oC;exports.PaginationItem=tC;exports.PaginationLink=As;exports.PaginationNext=rC;exports.PaginationPrevious=aC;exports.Popover=ha;exports.PopoverAnchor=Tr;exports.PopoverContent=wa;exports.PopoverTrigger=bs;exports.Progress=cC;exports.PromptSuggestions=ri;exports.RadioGroup=Hs;exports.RadioGroupItem=Os;exports.ResizableHandle=yC;exports.ResizablePanel=xC;exports.ResizablePanelGroup=wC;exports.RouterProvider=Sn;exports.SIDEBAR_COLLAPSIBLE_VALUES=Z1;exports.SIDEBAR_VARIANT_VALUES=J1;exports.SafeArea=Hr;exports.ScrollArea=It;exports.ScrollBar=Wm;exports.Select=Or;exports.SelectContent=Zm;exports.SelectItem=Qm;exports.SelectRoot=Xm;exports.SelectScrollDownButton=tf;exports.SelectScrollUpButton=ef;exports.SelectTrigger=Jm;exports.SelectValue=af;exports.Separator=yr;exports.Sheet=Ys;exports.SheetClose=tT;exports.SheetContent=Ks;exports.SheetDescription=Zs;exports.SheetFooter=aT;exports.SheetHeader=Xs;exports.SheetTitle=Js;exports.SheetTrigger=eT;exports.Sidebar=is;exports.SidebarContent=ds;exports.SidebarFooter=cs;exports.SidebarGroup=TT;exports.SidebarGroupAction=NT;exports.SidebarGroupContent=ST;exports.SidebarGroupLabel=PT;exports.SidebarHeader=ls;exports.SidebarInput=RT;exports.SidebarInset=ss;exports.SidebarMenu=us;exports.SidebarMenuAction=MT;exports.SidebarMenuBadge=ET;exports.SidebarMenuButton=ms;exports.SidebarMenuItem=ps;exports.SidebarMenuSkeleton=DT;exports.SidebarMenuSub=LT;exports.SidebarMenuSubButton=_T;exports.SidebarMenuSubItem=IT;exports.SidebarProvider=ns;exports.SidebarRail=kT;exports.SidebarSeparator=CT;exports.SidebarTrigger=yT;exports.Skeleton=gt;exports.Slider=OT;exports.Switch=nl;exports.THEME_MODE_CHANGE_EVENT=sr;exports.THEME_MODE_STORAGE_KEY=ia;exports.THEME_MODE_VALUES=En;exports.THEME_PRESET_OPTIONS=oc;exports.THEME_PRESET_VALUES=ev;exports.Table=ut;exports.TableBody=mt;exports.TableCaption=ZT;exports.TableCell=ke;exports.TableFooter=JT;exports.TableHead=Oe;exports.TableHeader=pt;exports.TableRow=Re;exports.Tabs=kr;exports.Textarea=Ko;exports.ThemeProvider=Uy;exports.TimePicker=en;exports.Toaster=UT;exports.Toggle=pP;exports.ToggleGroup=hP;exports.ToggleGroupItem=wP;exports.Tooltip=Qs;exports.TooltipContent=tl;exports.TooltipProvider=Co;exports.TooltipTrigger=el;exports.TypingIndicator=ti;exports.__virtualKeyboardTesting=vv;exports.badgeVariants=Lc;exports.buttonVariants=Mt;exports.cn=l;exports.createStore=pv;exports.detectVirtualKeyboardDevice=mc;exports.dragColumn=Rl;exports.formatCurrency=lv;exports.getInitials=cv;exports.getMonitor=ji;exports.getThemeMode=rv;exports.initializeMonitoring=xr;exports.isNullOrEmpty=wo;exports.isThemeMode=na;exports.maybeScrollElementIntoView=dr;exports.mobileFooterVariantMeta=km;exports.mobileFooterVariants=dR;exports.mobileHeaderVariantMeta=Cm;exports.mobileHeaderVariants=fR;exports.navigationMenuTriggerStyle=Bm;exports.redirect=Mn;exports.resolveThemeMode=Fa;exports.setThemeMode=Dn;exports.showError=_u;exports.showInfo=Au;exports.showSonner=Ga;exports.showSuccess=Iu;exports.showWarning=zu;exports.toBool=Kt;exports.toggleVariants=Xo;exports.updateContentLayout=Og;exports.updateNavbarStyle=Bg;exports.updateThemeMode=lr;exports.updateThemePreset=ov;exports.useDataTableInstance=_n;exports.useForm=px;exports.useIsMobile=nt;exports.useMobileHeader=Ni;exports.useMonitor=Lu;exports.useNavigate=Jg;exports.usePathname=Xg;exports.useSidebar=er;exports.useStore=mv;exports.useTheme=_t;exports.useThemeExtras=as;exports.withDndColumn=hN;//# sourceMappingURL=index.cjs.map
|
|
10
10
|
//# sourceMappingURL=index.cjs.map
|