@gomeniucivan/ui 1.0.18 → 1.0.20
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 +2149 -1
- package/dist/index.js +6 -6
- package/package.json +1 -2
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'),mc=require('embla-carousel-react'),sonner=require('sonner'),framerMotion=require('framer-motion'),Xt=require('recharts'),cmdk=require('cmdk'),dateFns=require('date-fns'),vaul=require('vaul'),inputOtp=require('input-otp'),ir=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 mc__default=/*#__PURE__*/_interopDefault(mc);var Xt__namespace=/*#__PURE__*/_interopNamespace(Xt);var ir__namespace=/*#__PURE__*/_interopNamespace(ir);function Qo(e){return typeof document=="undefined"?[]:Array.from(document.querySelectorAll(e))}function Ng(e){for(let t of Qo('[data-slot="sidebar-inset"]'))t.dataset.contentLayout=e;}function Sg(e){for(let t of Qo("header[data-navbar-style]"))t.dataset.navbarStyle=e;}var Zo={fieldCy:false,fieldName:false},en=Zo,Ar=new Map,Ut=[],tn=()=>{let e=Ut[Ut.length-1];en=e?Ar.get(e):Zo;},rn=()=>Symbol("theme-extras-provider"),an=()=>en,on=(e,t)=>{let a={fieldCy:t.fieldCy,fieldName:t.fieldName};Ar.set(e,a),Ut.includes(e)||Ut.push(e),tn();},nn=e=>{if(!Ar.has(e))return;Ar.delete(e);let t=Ut.indexOf(e);t!==-1&&Ut.splice(t,1),tn();};var kl=new Set(["input","select","textarea","form","button"]),za=(e,t)=>{if(t===null||typeof t!="object"||typeof e!="string")return t;let a=an(),o=!a.fieldCy,n=!a.fieldName&&kl.has(e);if(!o&&!n)return t;let i=t,c=null,d=()=>(c||(c={...i}),c);if(o&&Object.prototype.hasOwnProperty.call(i,"data-cy")){let l=d();delete l["data-cy"];}if(n&&Object.prototype.hasOwnProperty.call(i,"name")){let l=d();delete l.name;}return c!=null?c:i};var r=(e,t,a)=>jsxRuntime.jsx(e,za(e,t),a),u=(e,t,a)=>jsxRuntime.jsxs(e,za(e,t),a);var Ha=X.createContext(null),vr=null;function Fa(){return typeof window=="undefined"?"/":window.location.pathname||"/"}function ln({children:e}){let[t,a]=X.useState(()=>Fa()),o=X.useCallback((i,c={})=>{typeof window!="undefined"&&(c.replace?window.history.replaceState(null,"",i):window.history.pushState(null,"",i),a(Fa()));},[]);X.useEffect(()=>{vr=o;let i=()=>{a(Fa());};return window.addEventListener("popstate",i),()=>{window.removeEventListener("popstate",i),vr===o&&(vr=null);}},[o]);let n=X.useMemo(()=>({pathname:t,navigate:o}),[t,o]);return r(Ha.Provider,{value:n,children:e})}function Og(){let e=X.useContext(Ha);if(!e)throw new Error("usePathname must be used within a RouterProvider");return e.pathname}function Ag(){let e=X.useContext(Ha);if(!e)throw new Error("useNavigate must be used within a RouterProvider");return e.navigate}function cn(e){if(vr){vr(e,{replace:true});return}typeof window!="undefined"&&window.location.replace(e);}var dn=["auto","light","dark"],El=[{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)"}}],jg=El.map(e=>e.value);var Gt="gi_theme",Br="gi-theme-mode-change",Dl=new Set(dn);function Oa(){return typeof window!="undefined"?window:void 0}function Aa(){return typeof document!="undefined"?document.documentElement:null}function Ll(){var t,a,o;let e=Oa();return e&&(o=(a=(t=e.matchMedia)==null?void 0:t.call(e,"(prefers-color-scheme: dark)"))==null?void 0:a.matches)!=null?o:false}function qt(e){return typeof e=="string"&&Dl.has(e)}function br(e){return e==="auto"?Ll()?"dark":"light":e}function Vr(e){let t=Aa();if(!t)return;let a=br(e);t.dataset.themeMode=e,t.dataset.themeModeResolved=a,t.classList.toggle("dark",a==="dark");}function un(e="auto"){var a;Vr(e);let t=Oa();if(t){try{(a=t.localStorage)==null||a.setItem(Gt,e);}catch{}t.dispatchEvent(new CustomEvent(Br,{detail:e}));}}function Gg(){var n,i;let e=Aa(),t=(n=e==null?void 0:e.dataset)==null?void 0:n.themeMode;if(qt(t))return t;let a=Oa(),o=(i=a==null?void 0:a.localStorage)==null?void 0:i.getItem(Gt);return qt(o)?o:"auto"}function Wg(e){let t=Aa();t&&(t.dataset.themePreset=e);}function s(...e){return tailwindMerge.twMerge(clsx.clsx(e))}function Xg(e,t={}){let{currency:a="USD",noDecimals:o=false}=t;return new Intl.NumberFormat("en-US",{style:"currency",currency:a,minimumFractionDigits:o?0:2,maximumFractionDigits:o?0:2}).format(e)}function Jg(e){return e.split(" ").filter(Boolean).map(t=>{var a,o;return (o=(a=t[0])==null?void 0:a.toUpperCase())!=null?o:""}).join("").slice(0,2)}function ef(e){let t=new Set,a={};function o(){return a}function n(c){let d=a,l=typeof c=="function"?c(d):c;if(!l)return;let f=false,m={...d};for(let[R,k]of Object.entries(l)){let g=R,v=k;Object.is(m[g],v)||(f=true,m[g]=v);}f&&(a=m,t.forEach(R=>R(m,d)));}a=e(n,o);function i(c){return t.add(c),()=>t.delete(c)}return {getState:o,setState:n,subscribe:i}}function tf(e,t){return X.useSyncExternalStore(a=>e.subscribe(()=>a()),()=>t(e.getState()),()=>t(e.getState()))}var ot="h-10 md:h-9";var jr=false,$t=false,Wt=null,Fl=()=>typeof window!="undefined"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,pn=e=>{if(!e||typeof e.scrollIntoView!="function")return;let t=Fl(),a=()=>e.scrollIntoView({behavior:t?"auto":"smooth",block:"center",inline:"nearest"});if(typeof window!="undefined"&&typeof window.requestAnimationFrame=="function"){window.requestAnimationFrame(a);return}a();},Hl=e=>{if(typeof window=="undefined")return;let t=window.visualViewport;if(!t)return;let a=null,o,n=false,i,c=()=>{t.removeEventListener("resize",d),t.removeEventListener("scroll",d),typeof i=="number"&&window.clearTimeout(i),a!==null&&typeof window.cancelAnimationFrame=="function"&&(window.cancelAnimationFrame(a),a=null),typeof o=="number"&&(window.clearTimeout(o),o=void 0),n=false;},d=()=>{if(typeof document!="undefined"&&document.activeElement!==e||!e.isConnected){c();return}let l=()=>{a=null,mn(e)||(c(),pn(e));};if(!n){if(n=true,typeof window.requestAnimationFrame=="function"){a=window.requestAnimationFrame(()=>{n=false,a=null,l();});return}o=window.setTimeout(()=>{o=void 0,n=false,l();},0);}};t.addEventListener("resize",d,{passive:true}),t.addEventListener("scroll",d,{passive:true}),i=window.setTimeout(c,700);},Ol=(e,t)=>{let a=e.height+e.offsetTop,o=t-a;return Math.max(0,o)},Al=()=>{if(jr)return Promise.resolve(true);if($t)return Promise.resolve(false);if(typeof window=="undefined")return $t=true,Promise.resolve(false);let e=window.visualViewport;return e?Wt||(Wt=new Promise(t=>{let a=false,o,n=Math.max(e.height+e.offsetTop,typeof window!="undefined"?window.innerHeight:0),i=d=>{a||(a=true,e.removeEventListener("resize",c),e.removeEventListener("scroll",c),typeof o=="number"&&window.clearTimeout(o),d?jr=true:$t=true,t(d));},c=()=>{Ol(e,n)>80&&i(true);};o=window.setTimeout(()=>i(false),600),c(),a||(e.addEventListener("resize",c,{passive:true}),e.addEventListener("scroll",c,{passive:true}));}).finally(()=>{Wt=null;}),Wt):($t=true,Promise.resolve(false))},mn=e=>{if(typeof window=="undefined")return true;let t=e.getBoundingClientRect(),a=window.visualViewport;if(!a){let i=window.innerHeight||0;return t.top>=0&&t.bottom<=i}let o=a.offsetTop,n=o+a.height;return t.top>=o&&t.bottom<=n},Ur=e=>{e&&Al().then(t=>{if(!t||typeof document!="undefined"&&document.activeElement!==e||!e.isConnected)return;if(mn(e)){Hl(e);return}let a=()=>pn(e);if(typeof window!="undefined"&&typeof window.requestAnimationFrame=="function"){window.requestAnimationFrame(a);return}a();});},of={get isVirtualKeyboardLikelyDevice(){return jr},get hasAttemptedVirtualKeyboardDetection(){return $t},reset(){jr=false,$t=false,Wt=null;}};function gn({data:e,columns:t,enableRowSelection:a=true,defaultPageIndex:o,defaultPageSize:n,getRowId:i}){let[c,d]=X__namespace.useState({}),[l,f]=X__namespace.useState({}),[m,R]=X__namespace.useState([]),[k,g]=X__namespace.useState([]),[v,p]=X__namespace.useState({pageIndex:o!=null?o:0,pageSize:n!=null?n:10});return reactTable.useReactTable({data:e,columns:t,state:{sorting:k,columnVisibility:l,rowSelection:c,columnFilters:m,pagination:v},enableRowSelection:a,getRowId:i!=null?i:(w=>w.id.toString()),onRowSelectionChange:d,onSortingChange:g,onColumnFiltersChange:R,onColumnVisibilityChange:f,onPaginationChange:p,getCoreRowModel:reactTable.getCoreRowModel(),getFilteredRowModel:reactTable.getFilteredRowModel(),getPaginationRowModel:reactTable.getPaginationRowModel(),getSortedRowModel:reactTable.getSortedRowModel(),getFacetedRowModel:reactTable.getFacetedRowModel(),getFacetedUniqueValues:reactTable.getFacetedUniqueValues()})}function vf({...e}){return r(radixUi.Accordion.Root,{"data-slot":"accordion",...e})}function bf({className:e,...t}){return r(radixUi.Accordion.Item,{"data-slot":"accordion-item",className:s("border-b last:border-b-0",e),...t})}function hf({className:e,children:t,...a}){return r(radixUi.Accordion.Header,{className:"flex",children:u(radixUi.Accordion.Trigger,{"data-slot":"accordion-trigger",className:s("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),...a,children:[t,r(lucideReact.ChevronDownIcon,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"})]})})}function wf({className:e,children:t,...a}){return r(radixUi.Accordion.Content,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...a,children:r("div",{className:s("pt-0 pb-4",e),children:t})})}var Kl=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 Cf({className:e,variant:t,...a}){return r("div",{"data-slot":"alert",role:"alert",className:s(Kl({variant:t}),e),...a})}function Pf({className:e,...t}){return r("div",{"data-slot":"alert-title",className:s("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function Tf({className:e,...t}){return r("div",{"data-slot":"alert-description",className:s("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"}}),Q=X__namespace.forwardRef(({className:e,variant:t,size:a,asChild:o=false,loading:n=false,loadingText:i,children:c,disabled:d,...l},f)=>{let m=o?radixUi.Slot.Slot:"button";return u(m,{"data-slot":"button",className:s(mt({variant:t,size:a,className:e}),n?"relative":"disabled:opacity-50"),disabled:n||d,"data-loading":n?"":void 0,ref:f,...l,children:[r("span",{className:s("pointer-events-none inline-flex items-center justify-center gap-2 w-full",n&&"invisible"),children:c}),n?u("span",{className:"pointer-events-none absolute inset-0 inline-flex items-center justify-center gap-2",children:[i!=null?i:r(lucideReact.Loader2,{className:"size-4 animate-spin","aria-hidden":"true"}),r("span",{className:"sr-only",children:typeof i=="string"?i:"Loading"})]}):null]})});Q.displayName="Button";function Of({...e}){return r(radixUi.AlertDialog.Root,{"data-slot":"alert-dialog",...e})}function Af({...e}){return r(radixUi.AlertDialog.Trigger,{"data-slot":"alert-dialog-trigger",...e})}function Zl({...e}){return r(radixUi.AlertDialog.Portal,{"data-slot":"alert-dialog-portal",...e})}function ec({className:e,...t}){return r(radixUi.AlertDialog.Overlay,{"data-slot":"alert-dialog-overlay",className:s("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 Bf({className:e,...t}){return u(Zl,{children:[r(ec,{}),r(radixUi.AlertDialog.Content,{"data-slot":"alert-dialog-content",className:s("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 Vf({className:e,...t}){return r("div",{"data-slot":"alert-dialog-header",className:s("flex flex-col gap-2 text-center sm:text-left",e),...t})}function jf({className:e,...t}){return r("div",{"data-slot":"alert-dialog-footer",className:s("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function Uf({className:e,...t}){return r(radixUi.AlertDialog.Title,{"data-slot":"alert-dialog-title",className:s("text-lg font-semibold",e),...t})}function qf({className:e,...t}){return r(radixUi.AlertDialog.Description,{"data-slot":"alert-dialog-description",className:s("text-muted-foreground text-sm",e),...t})}function Gf({className:e,...t}){return r(radixUi.AlertDialog.Action,{className:s(mt(),e),...t})}function Wf({className:e,...t}){return r(radixUi.AlertDialog.Cancel,{className:s(mt({variant:"outline"}),e),...t})}function Xf({...e}){return r(radixUi.AspectRatio.Root,{"data-slot":"aspect-ratio",...e})}function tv({className:e,...t}){return r(radixUi.Avatar.Root,{"data-slot":"avatar",className:s("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...t})}function rv({className:e,...t}){return r(radixUi.Avatar.Image,{"data-slot":"avatar-image",className:s("aspect-square size-full",e),...t})}function av({className:e,...t}){return r(radixUi.Avatar.Fallback,{"data-slot":"avatar-fallback",className:s("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}var oc=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 vn({className:e,variant:t,asChild:a=false,...o}){let n=a?radixUi.Slot.Slot:"span";return r(n,{"data-slot":"badge",className:s(oc({variant:t}),e),...o})}function gv({...e}){return r("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function fv({className:e,...t}){return r("ol",{"data-slot":"breadcrumb-list",className:s("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...t})}function vv({className:e,...t}){return r("li",{"data-slot":"breadcrumb-item",className:s("inline-flex items-center gap-1.5",e),...t})}function bv({asChild:e,className:t,...a}){let o=e?radixUi.Slot.Slot:"a";return r(o,{"data-slot":"breadcrumb-link",className:s("hover:text-foreground transition-colors",t),...a})}function hv({className:e,...t}){return r("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:s("text-foreground font-normal",e),...t})}function wv({children:e,className:t,...a}){return r("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:s("[&>svg]:size-3.5",t),...a,children:e!=null?e:r(lucideReact.ChevronRight,{})})}function xv({className:e,...t}){return u("span",{"data-slot":"breadcrumb-ellipsis",role:"presentation","aria-hidden":"true",className:s("flex size-9 items-center justify-center",e),...t,children:[r(lucideReact.MoreHorizontal,{className:"size-4"}),r("span",{className:"sr-only",children:"More"})]})}function Sv({className:e,classNames:t,showOutsideDays:a=true,captionLayout:o="label",buttonVariant:n="ghost",formatters:i,components:c,...d}){let l=reactDayPicker.getDefaultClassNames();return r(reactDayPicker.DayPicker,{showOutsideDays:a,className:s("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:f=>f.toLocaleString("default",{month:"short"}),...i},classNames:{root:s("w-fit",l.root),months:s("flex gap-4 flex-col md:flex-row relative",l.months),month:s("flex flex-col w-full gap-4",l.month),nav:s("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",l.nav),button_previous:s(mt({variant:n}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",l.button_previous),button_next:s(mt({variant:n}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",l.button_next),month_caption:s("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",l.month_caption),dropdowns:s("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",l.dropdowns),dropdown_root:s("relative has-focus:border-primary border border-input shadow-xs has-focus:ring-primary/40 has-focus:ring-[3px] rounded-md",l.dropdown_root),dropdown:s("absolute bg-popover inset-0 opacity-0",l.dropdown),caption_label:s("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",l.caption_label),table:"w-full border-collapse",weekdays:s("flex",l.weekdays),weekday:s("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",l.weekday),week:s("flex w-full mt-2",l.week),week_number_header:s("select-none w-(--cell-size)",l.week_number_header),week_number:s("text-[0.8rem] select-none text-muted-foreground",l.week_number),day:s("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",l.day),range_start:s("rounded-l-md bg-accent",l.range_start),range_middle:s("rounded-none",l.range_middle),range_end:s("rounded-r-md bg-accent",l.range_end),today:s("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",l.today),outside:s("text-muted-foreground aria-selected:text-muted-foreground",l.outside),disabled:s("text-muted-foreground opacity-50",l.disabled),hidden:s("invisible",l.hidden),...t},components:{Root:({className:f,rootRef:m,...R})=>r("div",{"data-slot":"calendar",ref:m,className:s(f),...R}),Chevron:({className:f,orientation:m,...R})=>m==="left"?r(lucideReact.ChevronLeftIcon,{className:s("size-4",f),...R}):m==="right"?r(lucideReact.ChevronRightIcon,{className:s("size-4",f),...R}):r(lucideReact.ChevronDownIcon,{className:s("size-4",f),...R}),DayButton:pc,WeekNumber:({children:f,...m})=>r("td",{...m,children:r("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:f})}),...c},...d})}function pc({className:e,day:t,modifiers:a,...o}){let n=reactDayPicker.getDefaultClassNames(),i=X__namespace.useRef(null);return X__namespace.useEffect(()=>{var c;a.focused&&((c=i.current)==null||c.focus());},[a.focused]),r(Q,{ref:i,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":a.selected&&!a.range_start&&!a.range_end&&!a.range_middle,"data-range-start":a.range_start,"data-range-end":a.range_end,"data-range-middle":a.range_middle,className:s("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 Lv({className:e,...t}){return r("div",{"data-slot":"card",className:s("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6",e),...t})}function Iv({className:e,...t}){return r("div",{"data-slot":"card-header",className:s("@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 _v({className:e,...t}){return r("div",{"data-slot":"card-title",className:s("leading-none font-semibold",e),...t})}function zv({className:e,...t}){return r("div",{"data-slot":"card-description",className:s("text-muted-foreground text-sm",e),...t})}function Fv({className:e,...t}){return r("div",{"data-slot":"card-action",className:s("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...t})}function Hv({className:e,...t}){return r("div",{"data-slot":"card-content",className:s("px-6",e),...t})}function Ov({className:e,...t}){return r("div",{"data-slot":"card-footer",className:s("flex items-center px-6 [.border-t]:pt-6",e),...t})}var hn=X__namespace.createContext(null);function Gr(){let e=X__namespace.useContext(hn);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}function Gv({orientation:e="horizontal",opts:t,setApi:a,plugins:o,className:n,children:i,...c}){let[d,l]=mc__default.default({...t,axis:e==="horizontal"?"x":"y"},o),[f,m]=X__namespace.useState(false),[R,k]=X__namespace.useState(false),g=X__namespace.useCallback(w=>{w&&(m(w.canScrollPrev()),k(w.canScrollNext()));},[]),v=X__namespace.useCallback(()=>{l==null||l.scrollPrev();},[l]),p=X__namespace.useCallback(()=>{l==null||l.scrollNext();},[l]),b=X__namespace.useCallback(w=>{w.key==="ArrowLeft"?(w.preventDefault(),v()):w.key==="ArrowRight"&&(w.preventDefault(),p());},[v,p]);return X__namespace.useEffect(()=>{!l||!a||a(l);},[l,a]),X__namespace.useEffect(()=>{if(l)return g(l),l.on("reInit",g),l.on("select",g),()=>{l==null||l.off("select",g);}},[l,g]),r(hn.Provider,{value:{carouselRef:d,api:l,opts:t,orientation:e||((t==null?void 0:t.axis)==="y"?"vertical":"horizontal"),scrollPrev:v,scrollNext:p,canScrollPrev:f,canScrollNext:R},children:r("div",{onKeyDownCapture:b,className:s("relative",n),role:"region","aria-roledescription":"carousel","data-slot":"carousel",...c,children:i})})}function Wv({className:e,...t}){let{carouselRef:a,orientation:o}=Gr();return r("div",{ref:a,className:"overflow-hidden","data-slot":"carousel-content",children:r("div",{className:s("flex",o==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})}function $v({className:e,...t}){let{orientation:a}=Gr();return r("div",{role:"group","aria-roledescription":"slide","data-slot":"carousel-item",className:s("min-w-0 shrink-0 grow-0 basis-full",a==="horizontal"?"pl-4":"pt-4",e),...t})}function Yv({className:e,variant:t="outline",size:a="icon",...o}){let{orientation:n,scrollPrev:i,canScrollPrev:c}=Gr();return u(Q,{"data-slot":"carousel-previous",variant:t,size:a,className:s("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:[r(lucideReact.ArrowLeft,{}),r("span",{className:"sr-only",children:"Previous slide"})]})}function Kv({className:e,variant:t="outline",size:a="icon",...o}){let{orientation:n,scrollNext:i,canScrollNext:c}=Gr();return u(Q,{"data-slot":"carousel-next",variant:t,size:a,className:s("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:[r(lucideReact.ArrowRight,{}),r("span",{className:"sr-only",children:"Next slide"})]})}var bc=50,hc=10;function yn(e){let t=X.useRef(null),a=X.useRef(null),[o,n]=X.useState(true),i=()=>{t.current&&(t.current.scrollTop=t.current.scrollHeight);},c=()=>{if(t.current){let{scrollTop:l,scrollHeight:f,clientHeight:m}=t.current,R=Math.abs(f-l-m),k=a.current?l<a.current:false,g=a.current?a.current-l:0;if(k&&g>hc)n(false);else {let p=R<bc;n(p);}a.current=l;}},d=()=>{n(false);};return X.useEffect(()=>{t.current&&(a.current=t.current.scrollTop);},[]),X.useEffect(()=>{o&&i();},e),{containerRef:t,scrollToBottom:i,handleScroll:c,shouldAutoScroll:o,handleTouchStart:d}}function Rn({text:e,copyMessage:t="Copied to clipboard!"}){let[a,o]=X.useState(false),n=X.useRef(null),i=X.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:a,handleCopy:i}}function Va({content:e,copyMessage:t}){let{isCopied:a,handleCopy:o}=Rn({text:e,copyMessage:t});return u(Q,{variant:"ghost",size:"icon",className:"relative h-6 w-6","aria-label":"Copy to clipboard",onClick:o,children:[r("div",{className:"absolute inset-0 flex items-center justify-center",children:r(lucideReact.Check,{className:s("h-4 w-4 transition-transform ease-in-out",a?"scale-100":"scale-0")})}),r(lucideReact.Copy,{className:s("h-4 w-4 transition-transform ease-in-out",a?"scale-0":"scale-100")})]})}function Cn({ref:e,maxHeight:t=Number.MAX_SAFE_INTEGER,borderWidth:a=0,dependencies:o}){let n=X.useRef(null);X.useLayoutEffect(()=>{if(!e.current)return;let i=e.current,c=a*2;n.current===null&&(n.current=i.scrollHeight-c),i.style.removeProperty("height");let d=i.scrollHeight,l=Math.min(d,t),f=Math.max(l,n.current);i.style.height=`${f+c}px`;},[t,e,...o]);}var xr=X__namespace.default.forwardRef((e,t)=>e.file.type.startsWith("image/")?r(Pn,{...e,ref:t}):e.file.type.startsWith("text/")||e.file.name.endsWith(".txt")||e.file.name.endsWith(".md")?r(Tn,{...e,ref:t}):r(Nn,{...e,ref:t}));xr.displayName="FilePreview";var Pn=X__namespace.default.forwardRef(({file:e,onRemove:t},a)=>u(framerMotion.motion.div,{ref:a,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:[u("div",{className:"flex w-full items-center space-x-2",children:[r("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)}),r("span",{className:"w-full truncate text-muted-foreground",children:e.name})]}),t?r("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:r(lucideReact.X,{className:"h-2.5 w-2.5"})}):null]}));Pn.displayName="ImageFilePreview";var Tn=X__namespace.default.forwardRef(({file:e,onRemove:t},a)=>{let[o,n]=X__namespace.default.useState("");return X.useEffect(()=>{let i=new FileReader;i.onload=c=>{var l;let d=(l=c.target)==null?void 0:l.result;n(d.slice(0,50)+(d.length>50?"...":""));},i.readAsText(e);},[e]),u(framerMotion.motion.div,{ref:a,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:[u("div",{className:"flex w-full items-center space-x-2",children:[r("div",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-sm border bg-muted p-0.5",children:r("div",{className:"h-full w-full overflow-hidden text-[6px] leading-none text-muted-foreground",children:o||"Loading..."})}),r("span",{className:"w-full truncate text-muted-foreground",children:e.name})]}),t?r("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:r(lucideReact.X,{className:"h-2.5 w-2.5"})}):null]})});Tn.displayName="TextFilePreview";var Nn=X__namespace.default.forwardRef(({file:e,onRemove:t},a)=>u(framerMotion.motion.div,{ref:a,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:[u("div",{className:"flex w-full items-center space-x-2",children:[r("div",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-sm border bg-muted",children:r(lucideReact.FileIcon,{className:"h-6 w-6 text-foreground"})}),r("span",{className:"w-full truncate text-muted-foreground",children:e.name})]}),t?r("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:r(lucideReact.X,{className:"h-2.5 w-2.5"})}):null]}));Nn.displayName="GenericFilePreview";function qa(e){if(e.allowAttachments){let{allowAttachments:o,files:n,setFiles:i,...c}=e;return r(Sn,{...c,allowAttachments:true,files:n,setFiles:i})}let{allowAttachments:t,...a}=e;return r(Sn,{...a,allowAttachments:false,files:null})}qa.displayName="MessageInput";function Sn({placeholder:e="Ask AI...",className:t,submitOnEnter:a=true,stop:o,isGenerating:n,allowAttachments:i,files:c,setFiles:d,onKeyDown:l,value:f,...m}){let R=X.useRef(null),[k,g]=X.useState(false),v=i&&!!c&&c.length>0;Cn({ref:R,maxHeight:240,borderWidth:1,dependencies:[f,v]});let p=X.useCallback(h=>{!i||!d||!(h!=null&&h.length)||d(E=>E!=null&&E.length?[...E,...h]:h);},[i,d]),b=X.useCallback(h=>{!i||!d||d(E=>{if(!E)return null;let L=E.filter(S=>S!==h);return L.length>0?L:null});},[i,d]),w=X.useCallback(h=>{i&&(h.preventDefault(),g(true));},[i]),x=X.useCallback(h=>{i&&(h.preventDefault(),g(false));},[i]),T=X.useCallback(h=>{if(!i)return;h.preventDefault(),g(false);let E=Array.from(h.dataTransfer.files);p(E);},[p,i]),y=X.useCallback(h=>{var C;if(!i)return;let E=(C=h.clipboardData)==null?void 0:C.items;if(!E)return;let L=h.clipboardData.getData("text");if(L&&L.length>500){h.preventDefault();let P=new Blob([L],{type:"text/plain"}),F=new File([P],"Pasted text",{type:"text/plain",lastModified:Date.now()});p([F]);return}let S=Array.from(E).map(P=>P.getAsFile()).filter(P=>P!==null);S.length>0&&(h.preventDefault(),p(S));},[p,i]),N=X.useCallback(h=>{var E;a&&h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),n&&o&&o(),(E=h.currentTarget.form)==null||E.requestSubmit()),l==null||l(h);},[n,l,o,a]);return u("div",{className:"relative flex w-full",onDragOver:w,onDragLeave:x,onDrop:T,children:[r("div",{className:"relative flex w-full items-center space-x-2",children:u("div",{className:"relative flex-1",children:[r("textarea",{"aria-label":"Write your prompt here",placeholder:e,ref:R,onPaste:y,onKeyDown:N,className:s("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:f,...m}),i&&r("div",{className:"absolute inset-x-3 bottom-0 z-20 overflow-x-auto py-3",children:r("div",{className:"flex space-x-3",children:r(framerMotion.AnimatePresence,{mode:"popLayout",children:c==null?void 0:c.map(h=>r(xr,{file:h,onRemove:()=>b(h)},h.name+String(h.lastModified)))})})})]})}),u("div",{className:"absolute right-3 top-3 z-20 flex gap-2",children:[i&&r(Q,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8","aria-label":"Attach a file",onClick:async()=>{let h=await _c();p(h);},children:r(lucideReact.Paperclip,{className:"h-4 w-4"})}),n&&o?r(Q,{type:"button",size:"icon",className:"h-8 w-8","aria-label":"Stop generating",onClick:o,children:r(lucideReact.Square,{className:"h-3 w-3 animate-pulse",fill:"currentColor"})}):r(Q,{type:"submit",size:"icon",className:"h-8 w-8 transition-opacity","aria-label":"Send message",disabled:f.trim()===""&&(!i||!(c!=null&&c.length))||n,children:r(lucideReact.ArrowUp,{className:"h-5 w-5"})})]}),i&&r(Ic,{isDragging:k})]})}function Ic({isDragging:e}){return r(framerMotion.AnimatePresence,{children:e&&u(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:[r(lucideReact.Paperclip,{className:"h-4 w-4"}),r("span",{children:"Drop your files here to attach them."})]})})}function _c(){let e=document.createElement("input");return e.type="file",e.multiple=true,e.accept="*/*",e.click(),new Promise(t=>{e.onchange=a=>{let n=a.currentTarget.files;if(n){t(Array.from(n));return}t(null);};})}function Dn({...e}){return r(radixUi.Collapsible.Root,{"data-slot":"collapsible",...e})}function Ln({...e}){return r(radixUi.Collapsible.CollapsibleTrigger,{"data-slot":"collapsible-trigger",...e})}function In({...e}){return r(radixUi.Collapsible.CollapsibleContent,{"data-slot":"collapsible-content",...e})}var Oc={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"]},Ac="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",Bc=["relative","overflow-x-auto","rounded-md","border","bg-background/50","p-4","font-mono","text-sm"];function Kt({children:e,className:t}){let a=X.useRef(null),o=X.useMemo(()=>Vc(e!=null?e:""),[e]);return X.useEffect(()=>{let n=a.current;if(!n)return;jc(n);let i=Uc(n);return ()=>{i();}},[o]),r("div",{ref:a,className:s("space-y-4 text-sm leading-relaxed",t),dangerouslySetInnerHTML:{__html:o}})}Kt.displayName="HtmlRenderer";var Eb=Kt;function Vc(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 jc(e){Object.entries(Oc).forEach(([t,a])=>{e.querySelectorAll(t).forEach(o=>{a.forEach(n=>o.classList.add(n));});}),e.querySelectorAll("a").forEach(t=>{var o,n;t.classList.add("text-primary","underline","underline-offset-4");let a=(o=t.getAttribute("href"))!=null?o:"";if(/^javascript:/i.test(a)&&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 a;((a=t.parentElement)==null?void 0:a.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 a=document.createElement("div");a.dataset.htmlRendererTable="true",a.className="overflow-x-auto rounded-md border border-foreground/20",(o=t.parentElement)==null||o.insertBefore(a,t),a.appendChild(t);});}function Uc(e){let t=[];return e.querySelectorAll("button[data-html-renderer-copy]").forEach(a=>{a.remove();}),e.querySelectorAll("pre").forEach(a=>{Bc.forEach(l=>a.classList.add(l));let o=document.createElement("button");o.type="button",o.dataset.htmlRendererCopy="true",o.textContent="Copy",o.className=Ac;let n="Copy",i="Copied!",c="Copy failed",d=async()=>{var f;let l=(f=a.textContent)!=null?f:"";try{if(navigator.clipboard&&navigator.clipboard.writeText)await navigator.clipboard.writeText(l.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",d),a.appendChild(o),t.push(()=>{o.removeEventListener("click",d),o.remove();});}),()=>{t.forEach(a=>a());}}var Wa=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"}]}),zn=({role:e,content:t,createdAt:a,showTimeStamp:o=false,animation:n="scale",actions:i,experimental_attachments:c,toolInvocations:d,parts:l})=>{let f=X.useMemo(()=>c==null?void 0:c.map(k=>{var p;let g=Zc(k.url);return new File([g],(p=k.name)!=null?p:"Unknown",{type:k.contentType})}),[c]),m=e==="user",R=a==null?void 0:a.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});return m?u("div",{className:s("flex flex-col",m?"items-end":"items-start"),children:[f?r("div",{className:"mb-1 flex flex-wrap gap-2",children:f.map((k,g)=>r(xr,{file:k},g))}):null,r("div",{className:s(Wa({isUser:m,animation:n})),children:r(Kt,{children:t})}),o&&a?r("time",{dateTime:a.toISOString(),className:s("mt-1 block px-1 text-xs opacity-50",n!=="none"&&"duration-500 animate-in fade-in-0"),children:R}):null]}):l&&l.length>0?l.map((k,g)=>k.type==="text"?u("div",{className:s("flex flex-col",m?"items-end":"items-start"),children:[u("div",{className:s(Wa({isUser:m,animation:n})),children:[r(Kt,{children:k.text}),i?r("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&&a?r("time",{dateTime:a.toISOString(),className:s("mt-1 block px-1 text-xs opacity-50",n!=="none"&&"duration-500 animate-in fade-in-0"),children:R}):null]},`text-${g}`):k.type==="reasoning"?r(ed,{part:k},`reasoning-${g}`):k.type==="tool-invocation"?r(_n,{toolInvocations:[k.toolInvocation]},`tool-${g}`):null):d&&d.length>0?r(_n,{toolInvocations:d}):u("div",{className:s("flex flex-col",m?"items-end":"items-start"),children:[u("div",{className:s(Wa({isUser:m,animation:n})),children:[r(Kt,{children:t}),i?r("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&&a?r("time",{dateTime:a.toISOString(),className:s("mt-1 block px-1 text-xs opacity-50",n!=="none"&&"duration-500 animate-in fade-in-0"),children:R}):null]})};function Zc(e){let[,t=""]=e.split(",");if(!t)return new Uint8Array;if(typeof atob=="function"){let a=atob(t),o=new Uint8Array(a.length);for(let n=0;n<a.length;n+=1)o[n]=a.charCodeAt(n);return o}return typeof Buffer!="undefined"?new Uint8Array(Buffer.from(t,"base64")):new Uint8Array}var ed=({part:e})=>{let[t,a]=X.useState(false);return r("div",{className:"mb-2 flex flex-col items-start sm:max-w-[70%]",children:u(Dn,{open:t,onOpenChange:a,className:"group w-full overflow-hidden rounded-lg border bg-muted/50",children:[r("div",{className:"flex items-center p-2",children:r(Ln,{asChild:true,children:u("button",{className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground",children:[r(lucideReact.ChevronRight,{className:"h-4 w-4 transition-transform group-data-[state=open]:rotate-90"}),r("span",{children:"Thinking"})]})})}),r(In,{forceMount:true,children:r(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:r("div",{className:"p-2",children:r("div",{className:"whitespace-pre-wrap text-xs",children:e.reasoning})})})})]})})};function _n({toolInvocations:e}){return e!=null&&e.length?r("div",{className:"flex flex-col items-start gap-2",children:e.map((t,a)=>{if(t.state==="result"&&t.result.__cancelled===true)return u("div",{className:"flex items-center gap-2 rounded-lg border bg-muted/50 px-3 py-2 text-sm text-muted-foreground",children:[r(lucideReact.Ban,{className:"h-4 w-4"}),u("span",{children:["Cancelled"," ",u("span",{className:"font-mono",children:["`",t.toolName,"`"]})]})]},a);switch(t.state){case "partial-call":case "call":return u("div",{className:"flex items-center gap-2 rounded-lg border bg-muted/50 px-3 py-2 text-sm text-muted-foreground",children:[r(lucideReact.Terminal,{className:"h-4 w-4"}),u("span",{children:["Calling"," ",u("span",{className:"font-mono",children:["`",t.toolName,"`"]}),"..."]}),r(lucideReact.Loader2,{className:"h-3 w-3 animate-spin"})]},a);case "result":return u("div",{className:"flex flex-col gap-1.5 rounded-lg border bg-muted/50 px-3 py-2 text-sm",children:[u("div",{className:"flex items-center gap-2 text-muted-foreground",children:[r(lucideReact.Code2,{className:"h-4 w-4"}),u("span",{children:["Result from"," ",u("span",{className:"font-mono",children:["`",t.toolName,"`"]})]})]}),r("pre",{className:"overflow-x-auto whitespace-pre-wrap text-foreground",children:JSON.stringify(t.result,null,2)})]},a);default:return null}})}):null}function Fn(){return r("div",{className:"justify-left flex space-x-1",children:r("div",{className:"rounded-lg bg-muted p-3",children:u("div",{className:"flex -space-x-2.5",children:[r(lucideReact.Dot,{className:"h-5 w-5 animate-typing-dot-bounce"}),r(lucideReact.Dot,{className:"h-5 w-5 animate-typing-dot-bounce [animation-delay:90ms]"}),r(lucideReact.Dot,{className:"h-5 w-5 animate-typing-dot-bounce [animation-delay:180ms]"})]})})})}function Hn({messages:e,showTimeStamps:t=true,isTyping:a=false,messageOptions:o}){return u("div",{className:"space-y-4 overflow-visible",children:[e.map((n,i)=>{let c=typeof o=="function"?o(n):o;return r(zn,{showTimeStamp:t,...n,...c},i)}),a&&r(Fn,{})]})}function On({label:e,append:t,suggestions:a}){return u("div",{className:"space-y-6",children:[r("h2",{className:"text-center text-2xl font-bold",children:e}),r("div",{className:"flex gap-6 text-sm",children:a.map(o=>r("button",{onClick:()=>t({role:"user",content:o}),className:"h-max flex-1 rounded-xl border bg-background p-4 hover:bg-muted",children:r("p",{children:o})},o))})]})}function id({messages:e,handleSubmit:t,input:a,handleInputChange:o,stop:n,isGenerating:i,append:c,suggestions:d,className:l,onRateResponse:f,setMessages:m}){let R=e.at(-1),k=e.length===0,g=(R==null?void 0:R.role)==="user",v=X.useRef(e);v.current=e;let p=X.useCallback(()=>{if(n==null||n(),!m)return;let w=[...v.current],x;for(let N=w.length-1;N>=0;N-=1){let h=w[N];if(h.role==="assistant"){x=h;break}}if(!x)return;let T=false,y={...x};if(x.toolInvocations){let N=x.toolInvocations.map(h=>h.state==="call"?(T=true,{...h,state:"result",result:{content:"Tool execution was cancelled",__cancelled:true}}):h);T&&(y={...y,toolInvocations:N});}if(x.parts&&x.parts.length>0){let N=x.parts.map(h=>{if(h.type==="tool-invocation"&&h.toolInvocation.state==="call"){T=true;let E={...h.toolInvocation,state:"result",result:{content:"Tool execution was cancelled",__cancelled:true}};return {...h,toolInvocation:E}}return h});T&&(y={...y,parts:N});}if(T){let N=w.findIndex(h=>h.id===x.id);N!==-1&&(w[N]=y,m(w));}},[n,m,v]),b=X.useCallback(w=>({actions:f?u(jsxRuntime.Fragment,{children:[r("div",{className:"border-r pr-1",children:r(Va,{content:w.content,copyMessage:"Copied response to clipboard!"})}),r(Q,{size:"icon",variant:"ghost",className:"h-6 w-6",onClick:()=>f(w.id,"thumbs-up"),children:r(lucideReact.ThumbsUp,{className:"h-4 w-4"})}),r(Q,{size:"icon",variant:"ghost",className:"h-6 w-6",onClick:()=>f(w.id,"thumbs-down"),children:r(lucideReact.ThumbsDown,{className:"h-4 w-4"})})]}):r(Va,{content:w.content,copyMessage:"Copied response to clipboard!"})}),[f]);return u(Vn,{className:l,children:[k&&c&&d?r(On,{label:"Try these prompts \u2728",append:c,suggestions:d}):null,e.length>0?r(sd,{messages:e,children:r(Hn,{messages:e,isTyping:g,messageOptions:b})}):null,r(jn,{className:"mt-auto",handleSubmit:t,children:({files:w,setFiles:x})=>r(qa,{value:a,onChange:o,allowAttachments:true,files:w,setFiles:x,stop:p,isGenerating:i})})]})}id.displayName="Chat";function sd({messages:e,children:t}){let{containerRef:a,scrollToBottom:o,handleScroll:n,shouldAutoScroll:i,handleTouchStart:c}=yn([e]);return u("div",{className:"grid grid-cols-1 overflow-y-auto pb-4",ref:a,onScroll:n,onTouchStart:c,children:[r("div",{className:"max-w-full [grid-column:1/1] [grid-row:1/1]",children:t}),!i&&r("div",{className:"pointer-events-none flex flex-1 items-end justify-end [grid-column:1/1] [grid-row:1/1]",children:r("div",{className:"sticky bottom-0 left-0 flex w-full justify-end",children:r(Q,{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:r(lucideReact.ArrowDown,{className:"h-4 w-4"})})})})]})}var Vn=X.forwardRef(({className:e,...t},a)=>r("div",{ref:a,className:s("grid max-h-full w-full grid-rows-[1fr_auto]",e),...t}));Vn.displayName="ChatContainer";var jn=X.forwardRef(({children:e,handleSubmit:t,className:a},o)=>{let[n,i]=X.useState(null);return r("form",{ref:o,onSubmit:d=>{if(!n){t(d);return}let l=ld(n);t(d,{experimental_attachments:l}),i(null);},className:a,children:e({files:n,setFiles:i})})});jn.displayName="ChatForm";function ld(e){let t=new DataTransfer;for(let a of Array.from(e))t.items.add(a);return t.files}var cd={light:"",dark:".dark"},Un=X__namespace.createContext(null);function qn(){let e=X__namespace.useContext(Un);if(!e)throw new Error("useChart must be used within a <ChartContainer />");return e}function uh({id:e,className:t,children:a,config:o,...n}){let i=X__namespace.useId(),c=`chart-${e||i.replace(/:/g,"")}`;return r(Un.Provider,{value:{config:o},children:u("div",{"data-slot":"chart","data-chart":c,className:s("[&_.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:[r(dd,{id:c,config:o}),r(Xt__namespace.ResponsiveContainer,{children:a})]})})}var dd=({id:e,config:t})=>{let a=Object.entries(t).filter(([,o])=>o.theme||o.color);return a.length?r("style",{dangerouslySetInnerHTML:{__html:Object.entries(cd).map(([o,n])=>`
|
|
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'),gc=require('embla-carousel-react'),sonner=require('sonner'),framerMotion=require('framer-motion'),Jt=require('recharts'),cmdk=require('cmdk'),dateFns=require('date-fns'),vaul=require('vaul'),inputOtp=require('input-otp'),io=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 gc__default=/*#__PURE__*/_interopDefault(gc);var Jt__namespace=/*#__PURE__*/_interopNamespace(Jt);var io__namespace=/*#__PURE__*/_interopNamespace(io);var Za=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,n)=>(typeof require!="undefined"?require:t)[n]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});function er(e){return typeof document=="undefined"?[]:Array.from(document.querySelectorAll(e))}function If(e){for(let t of er('[data-slot="sidebar-inset"]'))t.dataset.contentLayout=e;}function Ff(e){for(let t of er("header[data-navbar-style]"))t.dataset.navbarStyle=e;}var tr={fieldCy:false,fieldName:false},or=tr,Bo=new Map,Ut=[],nr=()=>{let e=Ut[Ut.length-1];or=e?Bo.get(e):tr;},ar=()=>Symbol("theme-extras-provider"),rr=()=>or,ir=(e,t)=>{let n={fieldCy:t.fieldCy,fieldName:t.fieldName};Bo.set(e,n),Ut.includes(e)||Ut.push(e),nr();},sr=e=>{if(!Bo.has(e))return;Bo.delete(e);let t=Ut.indexOf(e);t!==-1&&Ut.splice(t,1),nr();};var Pl=new Set(["input","select","textarea","form","button"]),On=(e,t)=>{if(t===null||typeof t!="object"||typeof e!="string")return t;let n=rr(),a=!n.fieldCy,r=!n.fieldName&&Pl.has(e);if(!a&&!r)return t;let i=t,c=null,d=()=>(c||(c={...i}),c);if(a&&Object.prototype.hasOwnProperty.call(i,"data-cy")){let l=d();delete l["data-cy"];}if(r&&Object.prototype.hasOwnProperty.call(i,"name")){let l=d();delete l.name;}return c!=null?c:i};var o=(e,t,n)=>jsxRuntime.jsx(e,On(e,t),n),u=(e,t,n)=>jsxRuntime.jsxs(e,On(e,t),n);var zn=J.createContext(null),vo=null;function An(){return typeof window=="undefined"?"/":window.location.pathname||"/"}function cr({children:e}){let[t,n]=J.useState(()=>An()),a=J.useCallback((i,c={})=>{typeof window!="undefined"&&(c.replace?window.history.replaceState(null,"",i):window.history.pushState(null,"",i),n(An()));},[]);J.useEffect(()=>{vo=a;let i=()=>{n(An());};return window.addEventListener("popstate",i),()=>{window.removeEventListener("popstate",i),vo===a&&(vo=null);}},[a]);let r=J.useMemo(()=>({pathname:t,navigate:a}),[t,a]);return o(zn.Provider,{value:r,children:e})}function Gf(){let e=J.useContext(zn);if(!e)throw new Error("usePathname must be used within a RouterProvider");return e.pathname}function qf(){let e=J.useContext(zn);if(!e)throw new Error("useNavigate must be used within a RouterProvider");return e.navigate}function dr(e){if(vo){vo(e,{replace:true});return}typeof window!="undefined"&&window.location.replace(e);}var ur=["auto","light","dark"],Ll=[{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)"}}],Yf=Ll.map(e=>e.value);var qt="gi_theme",Vo="gi-theme-mode-change",Il=new Set(ur);function Bn(){return typeof window!="undefined"?window:void 0}function Vn(){return typeof document!="undefined"?document.documentElement:null}function Fl(){var t,n,a;let e=Bn();return e&&(a=(n=(t=e.matchMedia)==null?void 0:t.call(e,"(prefers-color-scheme: dark)"))==null?void 0:n.matches)!=null?a:false}function Gt(e){return typeof e=="string"&&Il.has(e)}function ho(e){return e==="auto"?Fl()?"dark":"light":e}function jo(e){let t=Vn();if(!t)return;let n=ho(e);t.dataset.themeMode=e,t.dataset.themeModeResolved=n,t.classList.toggle("dark",n==="dark");}function pr(e="auto"){var n;jo(e);let t=Bn();if(t){try{(n=t.localStorage)==null||n.setItem(qt,e);}catch{}t.dispatchEvent(new CustomEvent(Vo,{detail:e}));}}function Xf(){var r,i;let e=Vn(),t=(r=e==null?void 0:e.dataset)==null?void 0:r.themeMode;if(Gt(t))return t;let n=Bn(),a=(i=n==null?void 0:n.localStorage)==null?void 0:i.getItem(qt);return Gt(a)?a:"auto"}function Qf(e){let t=Vn();t&&(t.dataset.themePreset=e);}function s(...e){return tailwindMerge.twMerge(clsx.clsx(e))}function og(e,t={}){let{currency:n="USD",noDecimals:a=false}=t;return new Intl.NumberFormat("en-US",{style:"currency",currency:n,minimumFractionDigits:a?0:2,maximumFractionDigits:a?0:2}).format(e)}function ng(e){return e.split(" ").filter(Boolean).map(t=>{var n,a;return (a=(n=t[0])==null?void 0:n.toUpperCase())!=null?a:""}).join("").slice(0,2)}function ig(e){let t=new Set,n={};function a(){return n}function r(c){let d=n,l=typeof c=="function"?c(d):c;if(!l)return;let g=false,m={...d};for(let[C,R]of Object.entries(l)){let f=C,b=R;Object.is(m[f],b)||(g=true,m[f]=b);}g&&(n=m,t.forEach(C=>C(m,d)));}n=e(r,a);function i(c){return t.add(c),()=>t.delete(c)}return {getState:a,setState:r,subscribe:i}}function sg(e,t){return J.useSyncExternalStore(n=>e.subscribe(()=>n()),()=>t(e.getState()),()=>t(e.getState()))}var at="h-10 md:h-9";var Uo=false,$t=false,Wt=null,Al=()=>typeof window!="undefined"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,mr=e=>{if(!e||typeof e.scrollIntoView!="function")return;let t=Al(),n=()=>e.scrollIntoView({behavior:t?"auto":"smooth",block:"center",inline:"nearest"});if(typeof window!="undefined"&&typeof window.requestAnimationFrame=="function"){window.requestAnimationFrame(n);return}n();},zl=e=>{if(typeof window=="undefined")return;let t=window.visualViewport;if(!t)return;let n=null,a,r=false,i,c=()=>{t.removeEventListener("resize",d),t.removeEventListener("scroll",d),typeof i=="number"&&window.clearTimeout(i),n!==null&&typeof window.cancelAnimationFrame=="function"&&(window.cancelAnimationFrame(n),n=null),typeof a=="number"&&(window.clearTimeout(a),a=void 0),r=false;},d=()=>{if(typeof document!="undefined"&&document.activeElement!==e||!e.isConnected){c();return}let l=()=>{n=null,fr(e)||(c(),mr(e));};if(!r){if(r=true,typeof window.requestAnimationFrame=="function"){n=window.requestAnimationFrame(()=>{r=false,n=null,l();});return}a=window.setTimeout(()=>{a=void 0,r=false,l();},0);}};t.addEventListener("resize",d,{passive:true}),t.addEventListener("scroll",d,{passive:true}),i=window.setTimeout(c,700);},Bl=(e,t)=>{let n=e.height+e.offsetTop,a=t-n;return Math.max(0,a)},Vl=()=>{if(Uo)return Promise.resolve(true);if($t)return Promise.resolve(false);if(typeof window=="undefined")return $t=true,Promise.resolve(false);let e=window.visualViewport;return e?Wt||(Wt=new Promise(t=>{let n=false,a,r=Math.max(e.height+e.offsetTop,typeof window!="undefined"?window.innerHeight:0),i=d=>{n||(n=true,e.removeEventListener("resize",c),e.removeEventListener("scroll",c),typeof a=="number"&&window.clearTimeout(a),d?Uo=true:$t=true,t(d));},c=()=>{Bl(e,r)>80&&i(true);};a=window.setTimeout(()=>i(false),600),c(),n||(e.addEventListener("resize",c,{passive:true}),e.addEventListener("scroll",c,{passive:true}));}).finally(()=>{Wt=null;}),Wt):($t=true,Promise.resolve(false))},fr=e=>{if(typeof window=="undefined")return true;let t=e.getBoundingClientRect(),n=window.visualViewport;if(!n){let i=window.innerHeight||0;return t.top>=0&&t.bottom<=i}let a=n.offsetTop,r=a+n.height;return t.top>=a&&t.bottom<=r},Go=e=>{e&&Vl().then(t=>{if(!t||typeof document!="undefined"&&document.activeElement!==e||!e.isConnected)return;if(fr(e)){zl(e);return}let n=()=>mr(e);if(typeof window!="undefined"&&typeof window.requestAnimationFrame=="function"){window.requestAnimationFrame(n);return}n();});},dg={get isVirtualKeyboardLikelyDevice(){return Uo},get hasAttemptedVirtualKeyboardDetection(){return $t},reset(){Uo=false,$t=false,Wt=null;}};function gr({data:e,columns:t,enableRowSelection:n=true,defaultPageIndex:a,defaultPageSize:r,getRowId:i}){let[c,d]=J__namespace.useState({}),[l,g]=J__namespace.useState({}),[m,C]=J__namespace.useState([]),[R,f]=J__namespace.useState([]),[b,p]=J__namespace.useState({pageIndex:a!=null?a:0,pageSize:r!=null?r:10});return reactTable.useReactTable({data:e,columns:t,state:{sorting:R,columnVisibility:l,rowSelection:c,columnFilters:m,pagination:b},enableRowSelection:n,getRowId:i!=null?i:(y=>y.id.toString()),onRowSelectionChange:d,onSortingChange:f,onColumnFiltersChange:C,onColumnVisibilityChange:g,onPaginationChange:p,getCoreRowModel:reactTable.getCoreRowModel(),getFilteredRowModel:reactTable.getFilteredRowModel(),getPaginationRowModel:reactTable.getPaginationRowModel(),getSortedRowModel:reactTable.getSortedRowModel(),getFacetedRowModel:reactTable.getFacetedRowModel(),getFacetedUniqueValues:reactTable.getFacetedUniqueValues()})}function wg({...e}){return o(radixUi.Accordion.Root,{"data-slot":"accordion",...e})}function Rg({className:e,...t}){return o(radixUi.Accordion.Item,{"data-slot":"accordion-item",className:s("border-b last:border-b-0",e),...t})}function Cg({className:e,children:t,...n}){return o(radixUi.Accordion.Header,{className:"flex",children:u(radixUi.Accordion.Trigger,{"data-slot":"accordion-trigger",className:s("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),...n,children:[t,o(lucideReact.ChevronDownIcon,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"})]})})}function Pg({className:e,children:t,...n}){return o(radixUi.Accordion.Content,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...n,children:o("div",{className:s("pt-0 pb-4",e),children:t})})}var Xl=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 Mg({className:e,variant:t,...n}){return o("div",{"data-slot":"alert",role:"alert",className:s(Xl({variant:t}),e),...n})}function Eg({className:e,...t}){return o("div",{"data-slot":"alert-title",className:s("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function Dg({className:e,...t}){return o("div",{"data-slot":"alert-description",className:s("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"}}),Q=J__namespace.forwardRef(({className:e,variant:t,size:n,asChild:a=false,loading:r=false,loadingText:i,children:c,disabled:d,...l},g)=>{let m=a?radixUi.Slot.Slot:"button";return u(m,{"data-slot":"button",className:s(mt({variant:t,size:n,className:e}),r?"relative":"disabled:opacity-50"),disabled:r||d,"data-loading":r?"":void 0,ref:g,...l,children:[o("span",{className:s("pointer-events-none inline-flex items-center justify-center gap-2 w-full",r&&"invisible"),children:c}),r?u("span",{className:"pointer-events-none absolute inset-0 inline-flex items-center justify-center gap-2",children:[i!=null?i:o(lucideReact.Loader2,{className:"size-4 animate-spin","aria-hidden":"true"}),o("span",{className:"sr-only",children:typeof i=="string"?i:"Loading"})]}):null]})});Q.displayName="Button";function Ug({...e}){return o(radixUi.AlertDialog.Root,{"data-slot":"alert-dialog",...e})}function Gg({...e}){return o(radixUi.AlertDialog.Trigger,{"data-slot":"alert-dialog-trigger",...e})}function tc({...e}){return o(radixUi.AlertDialog.Portal,{"data-slot":"alert-dialog-portal",...e})}function oc({className:e,...t}){return o(radixUi.AlertDialog.Overlay,{"data-slot":"alert-dialog-overlay",className:s("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 qg({className:e,...t}){return u(tc,{children:[o(oc,{}),o(radixUi.AlertDialog.Content,{"data-slot":"alert-dialog-content",className:s("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 Wg({className:e,...t}){return o("div",{"data-slot":"alert-dialog-header",className:s("flex flex-col gap-2 text-center sm:text-left",e),...t})}function $g({className:e,...t}){return o("div",{"data-slot":"alert-dialog-footer",className:s("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function Yg({className:e,...t}){return o(radixUi.AlertDialog.Title,{"data-slot":"alert-dialog-title",className:s("text-lg font-semibold",e),...t})}function Kg({className:e,...t}){return o(radixUi.AlertDialog.Description,{"data-slot":"alert-dialog-description",className:s("text-muted-foreground text-sm",e),...t})}function Jg({className:e,...t}){return o(radixUi.AlertDialog.Action,{className:s(mt(),e),...t})}function Xg({className:e,...t}){return o(radixUi.AlertDialog.Cancel,{className:s(mt({variant:"outline"}),e),...t})}function tb({...e}){return o(radixUi.AspectRatio.Root,{"data-slot":"aspect-ratio",...e})}function ib({className:e,...t}){return o(radixUi.Avatar.Root,{"data-slot":"avatar",className:s("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...t})}function sb({className:e,...t}){return o(radixUi.Avatar.Image,{"data-slot":"avatar-image",className:s("aspect-square size-full",e),...t})}function lb({className:e,...t}){return o(radixUi.Avatar.Fallback,{"data-slot":"avatar-fallback",className:s("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}var ic=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 vr({className:e,variant:t,asChild:n=false,...a}){let r=n?radixUi.Slot.Slot:"span";return o(r,{"data-slot":"badge",className:s(ic({variant:t}),e),...a})}function yb({...e}){return o("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function xb({className:e,...t}){return o("ol",{"data-slot":"breadcrumb-list",className:s("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...t})}function wb({className:e,...t}){return o("li",{"data-slot":"breadcrumb-item",className:s("inline-flex items-center gap-1.5",e),...t})}function Rb({asChild:e,className:t,...n}){let a=e?radixUi.Slot.Slot:"a";return o(a,{"data-slot":"breadcrumb-link",className:s("hover:text-foreground transition-colors",t),...n})}function Cb({className:e,...t}){return o("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:s("text-foreground font-normal",e),...t})}function Pb({children:e,className:t,...n}){return o("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:s("[&>svg]:size-3.5",t),...n,children:e!=null?e:o(lucideReact.ChevronRight,{})})}function Tb({className:e,...t}){return u("span",{"data-slot":"breadcrumb-ellipsis",role:"presentation","aria-hidden":"true",className:s("flex size-9 items-center justify-center",e),...t,children:[o(lucideReact.MoreHorizontal,{className:"size-4"}),o("span",{className:"sr-only",children:"More"})]})}function Ib({className:e,classNames:t,showOutsideDays:n=true,captionLayout:a="label",buttonVariant:r="ghost",formatters:i,components:c,...d}){let l=reactDayPicker.getDefaultClassNames();return o(reactDayPicker.DayPicker,{showOutsideDays:n,className:s("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:g=>g.toLocaleString("default",{month:"short"}),...i},classNames:{root:s("w-fit",l.root),months:s("flex gap-4 flex-col md:flex-row relative",l.months),month:s("flex flex-col w-full gap-4",l.month),nav:s("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",l.nav),button_previous:s(mt({variant:r}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",l.button_previous),button_next:s(mt({variant:r}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",l.button_next),month_caption:s("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",l.month_caption),dropdowns:s("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",l.dropdowns),dropdown_root:s("relative has-focus:border-primary border border-input shadow-xs has-focus:ring-primary/40 has-focus:ring-[3px] rounded-md",l.dropdown_root),dropdown:s("absolute bg-popover inset-0 opacity-0",l.dropdown),caption_label:s("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",l.caption_label),table:"w-full border-collapse",weekdays:s("flex",l.weekdays),weekday:s("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",l.weekday),week:s("flex w-full mt-2",l.week),week_number_header:s("select-none w-(--cell-size)",l.week_number_header),week_number:s("text-[0.8rem] select-none text-muted-foreground",l.week_number),day:s("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",l.day),range_start:s("rounded-l-md bg-accent",l.range_start),range_middle:s("rounded-none",l.range_middle),range_end:s("rounded-r-md bg-accent",l.range_end),today:s("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",l.today),outside:s("text-muted-foreground aria-selected:text-muted-foreground",l.outside),disabled:s("text-muted-foreground opacity-50",l.disabled),hidden:s("invisible",l.hidden),...t},components:{Root:({className:g,rootRef:m,...C})=>o("div",{"data-slot":"calendar",ref:m,className:s(g),...C}),Chevron:({className:g,orientation:m,...C})=>m==="left"?o(lucideReact.ChevronLeftIcon,{className:s("size-4",g),...C}):m==="right"?o(lucideReact.ChevronRightIcon,{className:s("size-4",g),...C}):o(lucideReact.ChevronDownIcon,{className:s("size-4",g),...C}),DayButton:fc,WeekNumber:({children:g,...m})=>o("td",{...m,children:o("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:g})}),...c},...d})}function fc({className:e,day:t,modifiers:n,...a}){let r=reactDayPicker.getDefaultClassNames(),i=J__namespace.useRef(null);return J__namespace.useEffect(()=>{var c;n.focused&&((c=i.current)==null||c.focus());},[n.focused]),o(Q,{ref:i,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:s("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 Ob({className:e,...t}){return o("div",{"data-slot":"card",className:s("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6",e),...t})}function Ab({className:e,...t}){return o("div",{"data-slot":"card-header",className:s("@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 zb({className:e,...t}){return o("div",{"data-slot":"card-title",className:s("leading-none font-semibold",e),...t})}function Bb({className:e,...t}){return o("div",{"data-slot":"card-description",className:s("text-muted-foreground text-sm",e),...t})}function Vb({className:e,...t}){return o("div",{"data-slot":"card-action",className:s("col-start-2 row-span-2 row-start-1 self-start justify-self-end",e),...t})}function jb({className:e,...t}){return o("div",{"data-slot":"card-content",className:s("px-6",e),...t})}function Ub({className:e,...t}){return o("div",{"data-slot":"card-footer",className:s("flex items-center px-6 [.border-t]:pt-6",e),...t})}var yr=J__namespace.createContext(null);function Wo(){let e=J__namespace.useContext(yr);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}function Jb({orientation:e="horizontal",opts:t,setApi:n,plugins:a,className:r,children:i,...c}){let[d,l]=gc__default.default({...t,axis:e==="horizontal"?"x":"y"},a),[g,m]=J__namespace.useState(false),[C,R]=J__namespace.useState(false),f=J__namespace.useCallback(y=>{y&&(m(y.canScrollPrev()),R(y.canScrollNext()));},[]),b=J__namespace.useCallback(()=>{l==null||l.scrollPrev();},[l]),p=J__namespace.useCallback(()=>{l==null||l.scrollNext();},[l]),v=J__namespace.useCallback(y=>{y.key==="ArrowLeft"?(y.preventDefault(),b()):y.key==="ArrowRight"&&(y.preventDefault(),p());},[b,p]);return J__namespace.useEffect(()=>{!l||!n||n(l);},[l,n]),J__namespace.useEffect(()=>{if(l)return f(l),l.on("reInit",f),l.on("select",f),()=>{l==null||l.off("select",f);}},[l,f]),o(yr.Provider,{value:{carouselRef:d,api:l,opts:t,orientation:e||((t==null?void 0:t.axis)==="y"?"vertical":"horizontal"),scrollPrev:b,scrollNext:p,canScrollPrev:g,canScrollNext:C},children:o("div",{onKeyDownCapture:v,className:s("relative",r),role:"region","aria-roledescription":"carousel","data-slot":"carousel",...c,children:i})})}function Xb({className:e,...t}){let{carouselRef:n,orientation:a}=Wo();return o("div",{ref:n,className:"overflow-hidden","data-slot":"carousel-content",children:o("div",{className:s("flex",a==="horizontal"?"-ml-4":"-mt-4 flex-col",e),...t})})}function Qb({className:e,...t}){let{orientation:n}=Wo();return o("div",{role:"group","aria-roledescription":"slide","data-slot":"carousel-item",className:s("min-w-0 shrink-0 grow-0 basis-full",n==="horizontal"?"pl-4":"pt-4",e),...t})}function Zb({className:e,variant:t="outline",size:n="icon",...a}){let{orientation:r,scrollPrev:i,canScrollPrev:c}=Wo();return u(Q,{"data-slot":"carousel-previous",variant:t,size:n,className:s("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:[o(lucideReact.ArrowLeft,{}),o("span",{className:"sr-only",children:"Previous slide"})]})}function ev({className:e,variant:t="outline",size:n="icon",...a}){let{orientation:r,scrollNext:i,canScrollNext:c}=Wo();return u(Q,{"data-slot":"carousel-next",variant:t,size:n,className:s("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:[o(lucideReact.ArrowRight,{}),o("span",{className:"sr-only",children:"Next slide"})]})}var yc=50,xc=10;function Rr(e){let t=J.useRef(null),n=J.useRef(null),[a,r]=J.useState(true),i=()=>{t.current&&(t.current.scrollTop=t.current.scrollHeight);},c=()=>{if(t.current){let{scrollTop:l,scrollHeight:g,clientHeight:m}=t.current,C=Math.abs(g-l-m),R=n.current?l<n.current:false,f=n.current?n.current-l:0;if(R&&f>xc)r(false);else {let p=C<yc;r(p);}n.current=l;}},d=()=>{r(false);};return J.useEffect(()=>{t.current&&(n.current=t.current.scrollTop);},[]),J.useEffect(()=>{a&&i();},e),{containerRef:t,scrollToBottom:i,handleScroll:c,shouldAutoScroll:a,handleTouchStart:d}}function Pr({text:e,copyMessage:t="Copied to clipboard!"}){let[n,a]=J.useState(false),r=J.useRef(null),i=J.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:n,handleCopy:i}}function Un({content:e,copyMessage:t}){let{isCopied:n,handleCopy:a}=Pr({text:e,copyMessage:t});return u(Q,{variant:"ghost",size:"icon",className:"relative h-6 w-6","aria-label":"Copy to clipboard",onClick:a,children:[o("div",{className:"absolute inset-0 flex items-center justify-center",children:o(lucideReact.Check,{className:s("h-4 w-4 transition-transform ease-in-out",n?"scale-100":"scale-0")})}),o(lucideReact.Copy,{className:s("h-4 w-4 transition-transform ease-in-out",n?"scale-0":"scale-100")})]})}function Tr({ref:e,maxHeight:t=Number.MAX_SAFE_INTEGER,borderWidth:n=0,dependencies:a}){let r=J.useRef(null);J.useLayoutEffect(()=>{if(!e.current)return;let i=e.current,c=n*2;r.current===null&&(r.current=i.scrollHeight-c),i.style.removeProperty("height");let d=i.scrollHeight,l=Math.min(d,t),g=Math.max(l,r.current);i.style.height=`${g+c}px`;},[t,e,...a]);}var wo=J__namespace.default.forwardRef((e,t)=>e.file.type.startsWith("image/")?o(Nr,{...e,ref:t}):e.file.type.startsWith("text/")||e.file.name.endsWith(".txt")||e.file.name.endsWith(".md")?o(Sr,{...e,ref:t}):o(kr,{...e,ref:t}));wo.displayName="FilePreview";var Nr=J__namespace.default.forwardRef(({file:e,onRemove:t},n)=>u(framerMotion.motion.div,{ref:n,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:[u("div",{className:"flex w-full items-center space-x-2",children:[o("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)}),o("span",{className:"w-full truncate text-muted-foreground",children:e.name})]}),t?o("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:o(lucideReact.X,{className:"h-2.5 w-2.5"})}):null]}));Nr.displayName="ImageFilePreview";var Sr=J__namespace.default.forwardRef(({file:e,onRemove:t},n)=>{let[a,r]=J__namespace.default.useState("");return J.useEffect(()=>{let i=new FileReader;i.onload=c=>{var l;let d=(l=c.target)==null?void 0:l.result;r(d.slice(0,50)+(d.length>50?"...":""));},i.readAsText(e);},[e]),u(framerMotion.motion.div,{ref:n,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:[u("div",{className:"flex w-full items-center space-x-2",children:[o("div",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-sm border bg-muted p-0.5",children:o("div",{className:"h-full w-full overflow-hidden text-[6px] leading-none text-muted-foreground",children:a||"Loading..."})}),o("span",{className:"w-full truncate text-muted-foreground",children:e.name})]}),t?o("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:o(lucideReact.X,{className:"h-2.5 w-2.5"})}):null]})});Sr.displayName="TextFilePreview";var kr=J__namespace.default.forwardRef(({file:e,onRemove:t},n)=>u(framerMotion.motion.div,{ref:n,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:[u("div",{className:"flex w-full items-center space-x-2",children:[o("div",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-sm border bg-muted",children:o(lucideReact.FileIcon,{className:"h-6 w-6 text-foreground"})}),o("span",{className:"w-full truncate text-muted-foreground",children:e.name})]}),t?o("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:o(lucideReact.X,{className:"h-2.5 w-2.5"})}):null]}));kr.displayName="GenericFilePreview";function Wn(e){if(e.allowAttachments){let{allowAttachments:a,files:r,setFiles:i,...c}=e;return o(Mr,{...c,allowAttachments:true,files:r,setFiles:i})}let{allowAttachments:t,...n}=e;return o(Mr,{...n,allowAttachments:false,files:null})}Wn.displayName="MessageInput";function Mr({placeholder:e="Ask AI...",className:t,submitOnEnter:n=true,stop:a,isGenerating:r,allowAttachments:i,files:c,setFiles:d,onKeyDown:l,value:g,...m}){let C=J.useRef(null),[R,f]=J.useState(false),b=i&&!!c&&c.length>0;Tr({ref:C,maxHeight:240,borderWidth:1,dependencies:[g,b]});let p=J.useCallback(h=>{!i||!d||!(h!=null&&h.length)||d(E=>E!=null&&E.length?[...E,...h]:h);},[i,d]),v=J.useCallback(h=>{!i||!d||d(E=>{if(!E)return null;let L=E.filter(k=>k!==h);return L.length>0?L:null});},[i,d]),y=J.useCallback(h=>{i&&(h.preventDefault(),f(true));},[i]),x=J.useCallback(h=>{i&&(h.preventDefault(),f(false));},[i]),N=J.useCallback(h=>{if(!i)return;h.preventDefault(),f(false);let E=Array.from(h.dataTransfer.files);p(E);},[p,i]),w=J.useCallback(h=>{var P;if(!i)return;let E=(P=h.clipboardData)==null?void 0:P.items;if(!E)return;let L=h.clipboardData.getData("text");if(L&&L.length>500){h.preventDefault();let T=new Blob([L],{type:"text/plain"}),_=new File([T],"Pasted text",{type:"text/plain",lastModified:Date.now()});p([_]);return}let k=Array.from(E).map(T=>T.getAsFile()).filter(T=>T!==null);k.length>0&&(h.preventDefault(),p(k));},[p,i]),S=J.useCallback(h=>{var E;n&&h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),r&&a&&a(),(E=h.currentTarget.form)==null||E.requestSubmit()),l==null||l(h);},[r,l,a,n]);return u("div",{className:"relative flex w-full",onDragOver:y,onDragLeave:x,onDrop:N,children:[o("div",{className:"relative flex w-full items-center space-x-2",children:u("div",{className:"relative flex-1",children:[o("textarea",{"aria-label":"Write your prompt here",placeholder:e,ref:C,onPaste:w,onKeyDown:S,className:s("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:g,...m}),i&&o("div",{className:"absolute inset-x-3 bottom-0 z-20 overflow-x-auto py-3",children:o("div",{className:"flex space-x-3",children:o(framerMotion.AnimatePresence,{mode:"popLayout",children:c==null?void 0:c.map(h=>o(wo,{file:h,onRemove:()=>v(h)},h.name+String(h.lastModified)))})})})]})}),u("div",{className:"absolute right-3 top-3 z-20 flex gap-2",children:[i&&o(Q,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8","aria-label":"Attach a file",onClick:async()=>{let h=await _c();p(h);},children:o(lucideReact.Paperclip,{className:"h-4 w-4"})}),r&&a?o(Q,{type:"button",size:"icon",className:"h-8 w-8","aria-label":"Stop generating",onClick:a,children:o(lucideReact.Square,{className:"h-3 w-3 animate-pulse",fill:"currentColor"})}):o(Q,{type:"submit",size:"icon",className:"h-8 w-8 transition-opacity","aria-label":"Send message",disabled:g.trim()===""&&(!i||!(c!=null&&c.length))||r,children:o(lucideReact.ArrowUp,{className:"h-5 w-5"})})]}),i&&o(Hc,{isDragging:R})]})}function Hc({isDragging:e}){return o(framerMotion.AnimatePresence,{children:e&&u(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:[o(lucideReact.Paperclip,{className:"h-4 w-4"}),o("span",{children:"Drop your files here to attach them."})]})})}function _c(){let e=document.createElement("input");return e.type="file",e.multiple=true,e.accept="*/*",e.click(),new Promise(t=>{e.onchange=n=>{let r=n.currentTarget.files;if(r){t(Array.from(r));return}t(null);};})}function Lr({...e}){return o(radixUi.Collapsible.Root,{"data-slot":"collapsible",...e})}function Ir({...e}){return o(radixUi.Collapsible.CollapsibleTrigger,{"data-slot":"collapsible-trigger",...e})}function Fr({...e}){return o(radixUi.Collapsible.CollapsibleContent,{"data-slot":"collapsible-content",...e})}var Bc={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"]},Vc="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",jc=["relative","overflow-x-auto","rounded-md","border","bg-background/50","p-4","font-mono","text-sm"];function Kt({children:e,className:t}){let n=J.useRef(null),a=J.useMemo(()=>Uc(e!=null?e:""),[e]);return J.useEffect(()=>{let r=n.current;if(!r)return;Gc(r);let i=qc(r);return ()=>{i();}},[a]),o("div",{ref:n,className:s("space-y-4 text-sm leading-relaxed",t),dangerouslySetInnerHTML:{__html:a}})}Kt.displayName="HtmlRenderer";var Hv=Kt;function Uc(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 Gc(e){Object.entries(Bc).forEach(([t,n])=>{e.querySelectorAll(t).forEach(a=>{n.forEach(r=>a.classList.add(r));});}),e.querySelectorAll("a").forEach(t=>{var a,r;t.classList.add("text-primary","underline","underline-offset-4");let n=(a=t.getAttribute("href"))!=null?a:"";if(/^javascript:/i.test(n)&&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 n;((n=t.parentElement)==null?void 0:n.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 n=document.createElement("div");n.dataset.htmlRendererTable="true",n.className="overflow-x-auto rounded-md border border-foreground/20",(a=t.parentElement)==null||a.insertBefore(n,t),n.appendChild(t);});}function qc(e){let t=[];return e.querySelectorAll("button[data-html-renderer-copy]").forEach(n=>{n.remove();}),e.querySelectorAll("pre").forEach(n=>{jc.forEach(l=>n.classList.add(l));let a=document.createElement("button");a.type="button",a.dataset.htmlRendererCopy="true",a.textContent="Copy",a.className=Vc;let r="Copy",i="Copied!",c="Copy failed",d=async()=>{var g;let l=(g=n.textContent)!=null?g:"";try{if(navigator.clipboard&&navigator.clipboard.writeText)await navigator.clipboard.writeText(l.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",d),n.appendChild(a),t.push(()=>{a.removeEventListener("click",d),a.remove();});}),()=>{t.forEach(n=>n());}}var Yn=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"}]}),_r=({role:e,content:t,createdAt:n,showTimeStamp:a=false,animation:r="scale",actions:i,experimental_attachments:c,toolInvocations:d,parts:l})=>{let g=J.useMemo(()=>c==null?void 0:c.map(R=>{var p;let f=td(R.url);return new File([f],(p=R.name)!=null?p:"Unknown",{type:R.contentType})}),[c]),m=e==="user",C=n==null?void 0:n.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"});return m?u("div",{className:s("flex flex-col",m?"items-end":"items-start"),children:[g?o("div",{className:"mb-1 flex flex-wrap gap-2",children:g.map((R,f)=>o(wo,{file:R},f))}):null,o("div",{className:s(Yn({isUser:m,animation:r})),children:o(Kt,{children:t})}),a&&n?o("time",{dateTime:n.toISOString(),className:s("mt-1 block px-1 text-xs opacity-50",r!=="none"&&"duration-500 animate-in fade-in-0"),children:C}):null]}):l&&l.length>0?l.map((R,f)=>R.type==="text"?u("div",{className:s("flex flex-col",m?"items-end":"items-start"),children:[u("div",{className:s(Yn({isUser:m,animation:r})),children:[o(Kt,{children:R.text}),i?o("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&&n?o("time",{dateTime:n.toISOString(),className:s("mt-1 block px-1 text-xs opacity-50",r!=="none"&&"duration-500 animate-in fade-in-0"),children:C}):null]},`text-${f}`):R.type==="reasoning"?o(od,{part:R},`reasoning-${f}`):R.type==="tool-invocation"?o(Hr,{toolInvocations:[R.toolInvocation]},`tool-${f}`):null):d&&d.length>0?o(Hr,{toolInvocations:d}):u("div",{className:s("flex flex-col",m?"items-end":"items-start"),children:[u("div",{className:s(Yn({isUser:m,animation:r})),children:[o(Kt,{children:t}),i?o("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&&n?o("time",{dateTime:n.toISOString(),className:s("mt-1 block px-1 text-xs opacity-50",r!=="none"&&"duration-500 animate-in fade-in-0"),children:C}):null]})};function td(e){let[,t=""]=e.split(",");if(!t)return new Uint8Array;if(typeof atob=="function"){let n=atob(t),a=new Uint8Array(n.length);for(let r=0;r<n.length;r+=1)a[r]=n.charCodeAt(r);return a}return typeof Buffer!="undefined"?new Uint8Array(Buffer.from(t,"base64")):new Uint8Array}var od=({part:e})=>{let[t,n]=J.useState(false);return o("div",{className:"mb-2 flex flex-col items-start sm:max-w-[70%]",children:u(Lr,{open:t,onOpenChange:n,className:"group w-full overflow-hidden rounded-lg border bg-muted/50",children:[o("div",{className:"flex items-center p-2",children:o(Ir,{asChild:true,children:u("button",{className:"flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground",children:[o(lucideReact.ChevronRight,{className:"h-4 w-4 transition-transform group-data-[state=open]:rotate-90"}),o("span",{children:"Thinking"})]})})}),o(Fr,{forceMount:true,children:o(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:o("div",{className:"p-2",children:o("div",{className:"whitespace-pre-wrap text-xs",children:e.reasoning})})})})]})})};function Hr({toolInvocations:e}){return e!=null&&e.length?o("div",{className:"flex flex-col items-start gap-2",children:e.map((t,n)=>{if(t.state==="result"&&t.result.__cancelled===true)return u("div",{className:"flex items-center gap-2 rounded-lg border bg-muted/50 px-3 py-2 text-sm text-muted-foreground",children:[o(lucideReact.Ban,{className:"h-4 w-4"}),u("span",{children:["Cancelled"," ",u("span",{className:"font-mono",children:["`",t.toolName,"`"]})]})]},n);switch(t.state){case "partial-call":case "call":return u("div",{className:"flex items-center gap-2 rounded-lg border bg-muted/50 px-3 py-2 text-sm text-muted-foreground",children:[o(lucideReact.Terminal,{className:"h-4 w-4"}),u("span",{children:["Calling"," ",u("span",{className:"font-mono",children:["`",t.toolName,"`"]}),"..."]}),o(lucideReact.Loader2,{className:"h-3 w-3 animate-spin"})]},n);case "result":return u("div",{className:"flex flex-col gap-1.5 rounded-lg border bg-muted/50 px-3 py-2 text-sm",children:[u("div",{className:"flex items-center gap-2 text-muted-foreground",children:[o(lucideReact.Code2,{className:"h-4 w-4"}),u("span",{children:["Result from"," ",u("span",{className:"font-mono",children:["`",t.toolName,"`"]})]})]}),o("pre",{className:"overflow-x-auto whitespace-pre-wrap text-foreground",children:JSON.stringify(t.result,null,2)})]},n);default:return null}})}):null}function Or(){return o("div",{className:"justify-left flex space-x-1",children:o("div",{className:"rounded-lg bg-muted p-3",children:u("div",{className:"flex -space-x-2.5",children:[o(lucideReact.Dot,{className:"h-5 w-5 animate-typing-dot-bounce"}),o(lucideReact.Dot,{className:"h-5 w-5 animate-typing-dot-bounce [animation-delay:90ms]"}),o(lucideReact.Dot,{className:"h-5 w-5 animate-typing-dot-bounce [animation-delay:180ms]"})]})})})}function Ar({messages:e,showTimeStamps:t=true,isTyping:n=false,messageOptions:a}){return u("div",{className:"space-y-4 overflow-visible",children:[e.map((r,i)=>{let c=typeof a=="function"?a(r):a;return o(_r,{showTimeStamp:t,...r,...c},i)}),n&&o(Or,{})]})}function zr({label:e,append:t,suggestions:n}){return u("div",{className:"space-y-6",children:[o("h2",{className:"text-center text-2xl font-bold",children:e}),o("div",{className:"flex gap-6 text-sm",children:n.map(a=>o("button",{onClick:()=>t({role:"user",content:a}),className:"h-max flex-1 rounded-xl border bg-background p-4 hover:bg-muted",children:o("p",{children:a})},a))})]})}function ld({messages:e,handleSubmit:t,input:n,handleInputChange:a,stop:r,isGenerating:i,append:c,suggestions:d,className:l,onRateResponse:g,setMessages:m}){let C=e.at(-1),R=e.length===0,f=(C==null?void 0:C.role)==="user",b=J.useRef(e);b.current=e;let p=J.useCallback(()=>{if(r==null||r(),!m)return;let y=[...b.current],x;for(let S=y.length-1;S>=0;S-=1){let h=y[S];if(h.role==="assistant"){x=h;break}}if(!x)return;let N=false,w={...x};if(x.toolInvocations){let S=x.toolInvocations.map(h=>h.state==="call"?(N=true,{...h,state:"result",result:{content:"Tool execution was cancelled",__cancelled:true}}):h);N&&(w={...w,toolInvocations:S});}if(x.parts&&x.parts.length>0){let S=x.parts.map(h=>{if(h.type==="tool-invocation"&&h.toolInvocation.state==="call"){N=true;let E={...h.toolInvocation,state:"result",result:{content:"Tool execution was cancelled",__cancelled:true}};return {...h,toolInvocation:E}}return h});N&&(w={...w,parts:S});}if(N){let S=y.findIndex(h=>h.id===x.id);S!==-1&&(y[S]=w,m(y));}},[r,m,b]),v=J.useCallback(y=>({actions:g?u(jsxRuntime.Fragment,{children:[o("div",{className:"border-r pr-1",children:o(Un,{content:y.content,copyMessage:"Copied response to clipboard!"})}),o(Q,{size:"icon",variant:"ghost",className:"h-6 w-6",onClick:()=>g(y.id,"thumbs-up"),children:o(lucideReact.ThumbsUp,{className:"h-4 w-4"})}),o(Q,{size:"icon",variant:"ghost",className:"h-6 w-6",onClick:()=>g(y.id,"thumbs-down"),children:o(lucideReact.ThumbsDown,{className:"h-4 w-4"})})]}):o(Un,{content:y.content,copyMessage:"Copied response to clipboard!"})}),[g]);return u(jr,{className:l,children:[R&&c&&d?o(zr,{label:"Try these prompts \u2728",append:c,suggestions:d}):null,e.length>0?o(cd,{messages:e,children:o(Ar,{messages:e,isTyping:f,messageOptions:v})}):null,o(Ur,{className:"mt-auto",handleSubmit:t,children:({files:y,setFiles:x})=>o(Wn,{value:n,onChange:a,allowAttachments:true,files:y,setFiles:x,stop:p,isGenerating:i})})]})}ld.displayName="Chat";function cd({messages:e,children:t}){let{containerRef:n,scrollToBottom:a,handleScroll:r,shouldAutoScroll:i,handleTouchStart:c}=Rr([e]);return u("div",{className:"grid grid-cols-1 overflow-y-auto pb-4",ref:n,onScroll:r,onTouchStart:c,children:[o("div",{className:"max-w-full [grid-column:1/1] [grid-row:1/1]",children:t}),!i&&o("div",{className:"pointer-events-none flex flex-1 items-end justify-end [grid-column:1/1] [grid-row:1/1]",children:o("div",{className:"sticky bottom-0 left-0 flex w-full justify-end",children:o(Q,{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:o(lucideReact.ArrowDown,{className:"h-4 w-4"})})})})]})}var jr=J.forwardRef(({className:e,...t},n)=>o("div",{ref:n,className:s("grid max-h-full w-full grid-rows-[1fr_auto]",e),...t}));jr.displayName="ChatContainer";var Ur=J.forwardRef(({children:e,handleSubmit:t,className:n},a)=>{let[r,i]=J.useState(null);return o("form",{ref:a,onSubmit:d=>{if(!r){t(d);return}let l=dd(r);t(d,{experimental_attachments:l}),i(null);},className:n,children:e({files:r,setFiles:i})})});Ur.displayName="ChatForm";function dd(e){let t=new DataTransfer;for(let n of Array.from(e))t.items.add(n);return t.files}var ud={light:"",dark:".dark"},Gr=J__namespace.createContext(null);function qr(){let e=J__namespace.useContext(Gr);if(!e)throw new Error("useChart must be used within a <ChartContainer />");return e}function bh({id:e,className:t,children:n,config:a,...r}){let i=J__namespace.useId(),c=`chart-${e||i.replace(/:/g,"")}`;return o(Gr.Provider,{value:{config:a},children:u("div",{"data-slot":"chart","data-chart":c,className:s("[&_.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:[o(pd,{id:c,config:a}),o(Jt__namespace.ResponsiveContainer,{children:n})]})})}var pd=({id:e,config:t})=>{let n=Object.entries(t).filter(([,a])=>a.theme||a.color);return n.length?o("style",{dangerouslySetInnerHTML:{__html:Object.entries(ud).map(([a,r])=>`
|
|
2
|
+
${r} [data-chart=${e}] {
|
|
3
|
+
${n.map(([i,c])=>{var l;let d=((l=c.theme)==null?void 0:l[a])||c.color;return d?` --color-${i}: ${d};`:null}).join(`
|
|
4
4
|
`)}
|
|
5
5
|
}
|
|
6
6
|
`).join(`
|
|
7
|
-
`)}}):null},ph=Xt__namespace.Tooltip;function mh({active:e,payload:t,className:a,indicator:o="dot",hideLabel:n=false,hideIndicator:i=false,label:c,labelFormatter:d,labelClassName:l,formatter:f,color:m,nameKey:R,labelKey:k}){let{config:g}=qn(),v=X__namespace.useMemo(()=>{var y;if(n||!(t!=null&&t.length))return null;let[b]=t,w=`${k||(b==null?void 0:b.dataKey)||(b==null?void 0:b.name)||"value"}`,x=Ya(g,b,w),T=!k&&typeof c=="string"?((y=g[c])==null?void 0:y.label)||c:x==null?void 0:x.label;return d?r("div",{className:s("font-medium",l),children:d(T,t)}):T?r("div",{className:s("font-medium",l),children:T}):null},[c,d,t,n,l,g,k]);if(!e||!(t!=null&&t.length))return null;let p=t.length===1&&o!=="dot";return u("div",{className:s("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",a),children:[p?null:v,r("div",{className:"grid gap-1.5",children:t.filter(b=>b.type!=="none").map((b,w)=>{let x=`${R||b.name||b.dataKey||"value"}`,T=Ya(g,b,x),y=m||b.payload.fill||b.color;return r("div",{className:s("[&>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:f&&(b==null?void 0:b.value)!==void 0&&b.name?f(b.value,b.name,b,w,b.payload):u(jsxRuntime.Fragment,{children:[T!=null&&T.icon?r(T.icon,{}):!i&&r("div",{className:s("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":y,"--color-border":y}}),u("div",{className:s("flex flex-1 justify-between leading-none",p?"items-end":"items-center"),children:[u("div",{className:"grid gap-1.5",children:[p?v:null,r("span",{className:"text-muted-foreground",children:(T==null?void 0:T.label)||b.name})]}),b.value&&r("span",{className:"text-foreground font-mono font-medium tabular-nums",children:b.value.toLocaleString()})]})]})},b.dataKey)})})]})}var gh=Xt__namespace.Legend;function fh({className:e,hideIcon:t=false,payload:a,verticalAlign:o="bottom",nameKey:n}){let{config:i}=qn();return a!=null&&a.length?r("div",{className:s("flex items-center justify-center gap-4",o==="top"?"pb-3":"pt-3",e),children:a.filter(c=>c.type!=="none").map(c=>{let d=`${n||c.dataKey||"value"}`,l=Ya(i,c,d);return u("div",{className:s("[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"),children:[l!=null&&l.icon&&!t?r(l.icon,{}):r("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:c.color}}),l==null?void 0:l.label]},c.value)})}):null}function Ya(e,t,a){if(typeof t!="object"||t===null)return;let o="payload"in t&&typeof t.payload=="object"&&t.payload!==null?t.payload:void 0,n=a;return a in t&&typeof t[a]=="string"?n=t[a]:o&&a in o&&typeof o[a]=="string"&&(n=o[a]),n in e?e[n]:e[a]}var yr=X__namespace.forwardRef(function({className:t,...a},o){return r(radixUi.Checkbox.Root,{ref:o,"data-slot":"checkbox",className:s("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),...a,children:r(radixUi.Checkbox.Indicator,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:r(lucideReact.CheckIcon,{className:"size-3.5"})})})});function Wr({...e}){return r(radixUi.Dialog.Root,{"data-slot":"dialog",...e})}function Th({...e}){return r(radixUi.Dialog.Trigger,{"data-slot":"dialog-trigger",...e})}function md({...e}){return r(radixUi.Dialog.Portal,{"data-slot":"dialog-portal",...e})}function Nh({...e}){return r(radixUi.Dialog.Close,{"data-slot":"dialog-close",...e})}function gd({className:e,...t}){return r(radixUi.Dialog.Overlay,{"data-slot":"dialog-overlay",className:s("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 $r({className:e,children:t,showCloseButton:a=true,...o}){return u(md,{"data-slot":"dialog-portal",children:[r(gd,{}),u(radixUi.Dialog.Content,{"data-slot":"dialog-content",className:s("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,a&&u(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:[r(lucideReact.XIcon,{}),r("span",{className:"sr-only",children:"Close"})]})]})]})}function Yr({className:e,...t}){return r("div",{"data-slot":"dialog-header",className:s("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Sh({className:e,...t}){return r("div",{"data-slot":"dialog-footer",className:s("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function Kr({className:e,...t}){return r(radixUi.Dialog.Title,{"data-slot":"dialog-title",className:s("text-lg leading-none font-semibold",e),...t})}function Xr({className:e,...t}){return r(radixUi.Dialog.Description,{"data-slot":"dialog-description",className:s("text-muted-foreground text-sm",e),...t})}function Ka({className:e,...t}){return r(cmdk.Command,{"data-slot":"command",className:s("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function zh({title:e="Command Palette",description:t="Search for a command to run...",children:a,className:o,showCloseButton:n=true,...i}){return u(Wr,{...i,children:[u(Yr,{className:"sr-only",children:[r(Kr,{children:e}),r(Xr,{children:t})]}),r($r,{className:s("overflow-hidden p-0",o),showCloseButton:n,children:r(Ka,{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:a})})]})}function $n({className:e,...t}){return u("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[r(lucideReact.SearchIcon,{className:"size-4 shrink-0 opacity-50"}),r(cmdk.Command.Input,{"data-slot":"command-input",className:s("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 Yn({className:e,...t}){return r(cmdk.Command.List,{"data-slot":"command-list",className:s("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function Kn({...e}){return r(cmdk.Command.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function Fh({className:e,...t}){return r(cmdk.Command.Group,{"data-slot":"command-group",className:s("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 Hh({className:e,...t}){return r(cmdk.Command.Separator,{"data-slot":"command-separator",className:s("bg-border -mx-1 h-px",e),...t})}function Xn({className:e,...t}){return r(cmdk.Command.Item,{"data-slot":"command-item",className:s("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 Oh({className:e,...t}){return r("span",{"data-slot":"command-shortcut",className:s("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}function qh({...e}){return r(radixUi.ContextMenu.Root,{"data-slot":"context-menu",...e})}function Gh({...e}){return r(radixUi.ContextMenu.Trigger,{"data-slot":"context-menu-trigger",...e})}function Wh({...e}){return r(radixUi.ContextMenu.Group,{"data-slot":"context-menu-group",...e})}function $h({...e}){return r(radixUi.ContextMenu.Portal,{"data-slot":"context-menu-portal",...e})}function Yh({...e}){return r(radixUi.ContextMenu.Sub,{"data-slot":"context-menu-sub",...e})}function Kh({...e}){return r(radixUi.ContextMenu.RadioGroup,{"data-slot":"context-menu-radio-group",...e})}function Xh({className:e,inset:t,children:a,...o}){return u(radixUi.ContextMenu.SubTrigger,{"data-slot":"context-menu-sub-trigger","data-inset":t,className:s("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:[a,r(lucideReact.ChevronRightIcon,{className:"ml-auto"})]})}function Jh({className:e,...t}){return r(radixUi.ContextMenu.SubContent,{"data-slot":"context-menu-sub-content",className:s("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 Qh({className:e,...t}){return r(radixUi.ContextMenu.Portal,{children:r(radixUi.ContextMenu.Content,{"data-slot":"context-menu-content",className:s("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 Zh({className:e,inset:t,variant:a="default",...o}){return r(radixUi.ContextMenu.Item,{"data-slot":"context-menu-item","data-inset":t,"data-variant":a,className:s("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 ew({className:e,children:t,checked:a,...o}){return u(radixUi.ContextMenu.CheckboxItem,{"data-slot":"context-menu-checkbox-item",className:s("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:a,...o,children:[r("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:r(radixUi.ContextMenu.ItemIndicator,{children:r(lucideReact.CheckIcon,{className:"size-4"})})}),t]})}function tw({className:e,children:t,...a}){return u(radixUi.ContextMenu.RadioItem,{"data-slot":"context-menu-radio-item",className:s("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),...a,children:[r("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:r(radixUi.ContextMenu.ItemIndicator,{children:r(lucideReact.CircleIcon,{className:"size-2 fill-current"})})}),t]})}function rw({className:e,inset:t,...a}){return r(radixUi.ContextMenu.Label,{"data-slot":"context-menu-label","data-inset":t,className:s("text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...a})}function aw({className:e,...t}){return r(radixUi.ContextMenu.Separator,{"data-slot":"context-menu-separator",className:s("bg-border -mx-1 my-1 h-px",e),...t})}function ow({className:e,...t}){return r("span",{"data-slot":"context-menu-shortcut",className:s("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}var Id={YYYY:"yyyy",YY:"yy",MM:"MM",M:"M",DD:"dd",D:"d"},_d=e=>{var t;return (t=Id[e])!=null?t:e},zd=/(YYYY|YY|MM|M|DD|D|HH|H|mm|m|ss|s)/g,Xa=e=>e.replace(zd,t=>t==="HH"?"HH":t==="H"?"H":t==="mm"?"mm":t==="m"?"m":t==="ss"?"ss":t==="s"?"s":_d(t)),Qr=e=>!Number.isNaN(e.getTime()),Lt=class e{constructor(t){this.value=t;}create(t){return new e(t)}clone(){return this.create(new Date(this.value.getTime()))}add(t,a){switch(a){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,a){return this.add(-t,a)}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 a=dateFns.startOfDay(this.value),o=dateFns.addDays(a,1);return this.create(dateFns.addDays(o,-1))}isSame(t,a="day"){switch(a){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,a){if(a){let o=this.startOf(a),n=t.startOf(a);return o.valueOf()<n.valueOf()}return dateFns.isBefore(this.value,t.toDate())}isAfter(t,a){if(a){let o=this.startOf(a),n=t.startOf(a);return o.valueOf()>n.valueOf()}return dateFns.isAfter(this.value,t.toDate())}format(t){return dateFns.format(this.value,Xa(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 Qr(this.value)}toDate(){return new Date(this.value.getTime())}valueOf(){return this.value.getTime()}},Fd=e=>{if(e instanceof Lt)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(Qr(t))return t}return new Date},nt=(e,t)=>{if(typeof e=="string"&&t){let a=dateFns.parse(e,Xa(t),new Date);return Qr(a)?new Lt(a):new Lt(new Date(NaN))}return new Lt(Fd(e))},ti=(e,t)=>{let a=dateFns.parse(e,Xa(t),new Date);return Qr(a)?new Lt(a):null};function Ja(e){return Object.keys(e).reduce((t,a)=>{let o=e[a];return o&&(t[a]=o),t},{})}function dw(e){let[t,a]=X.useState({values:e.initialValues,errors:{},fieldErrors:{},touched:{},isSubmitting:false,isValid:false,validationSequence:0}),o=X.useCallback((g=t.values)=>{let v=e.validate?e.validate(g):{},p=Ja({...v,...t.fieldErrors}),b=Object.keys(p).length===0;return a(w=>({...w,errors:p,isValid:b})),b},[e.validate,t.fieldErrors,t.values]),n=X.useCallback((g,v)=>{a(p=>{let b={...p.values,[g]:v},w={...p.fieldErrors};delete w[g];let x=e.validate?e.validate(b):{},T=Ja({...x,...w}),y=Object.keys(T).length===0;return {...p,values:b,fieldErrors:w,errors:T,isValid:y}});},[e.validate]),i=X.useCallback((g,v=true)=>{a(p=>({...p,touched:{...p.touched,[g]:v}}));},[]),c=X.useCallback((g,v)=>{a(p=>{let b={...p.fieldErrors};v?b[g]=v:delete b[g];let w=e.validate?e.validate(p.values):{},x=Ja({...w,...b}),T=Object.keys(x).length===0;return {...p,fieldErrors:b,errors:x,isValid:T}});},[e.validate]),d=X.useCallback(()=>{a(g=>({...g,validationSequence:g.validationSequence+1}));},[]),l=X.useCallback(g=>{let{name:v,value:p}=g.target;n(v,p);},[n]),f=X.useCallback(g=>{let{name:v}=g.target;i(v,true),o();},[i,o]),m=X.useCallback(async g=>{g&&(g.preventDefault(),g.stopPropagation()),a(b=>{let w=Object.keys(b.values).reduce((x,T)=>(x[T]=true,x),{});return {...b,touched:w,validationSequence:b.validationSequence+1}});let v=t.values;if(o(v)&&!(Object.keys(t.fieldErrors).length>0)){a(b=>({...b,isSubmitting:true}));try{await e.onSubmit(v);}catch(b){console.error("Form submission error:",b);}finally{a(b=>({...b,isSubmitting:false}));}}},[e.onSubmit,o,t.values]),R=X.useCallback(()=>{a({values:e.initialValues,errors:{},fieldErrors:{},touched:{},isSubmitting:false,isValid:false,validationSequence:0});},[e.initialValues]);return {...t,...{setFieldValue:n,setFieldTouched:i,setFieldError:c,handleChange:l,handleBlur:f,handleSubmit:m,resetForm:R,validateForm:()=>o(),triggerValidation:d},form:{values:t.values,errors:t.errors,fieldErrors:t.fieldErrors,touched:t.touched,validationSequence:t.validationSequence,setFieldValue:(g,v)=>{n(g,v);},setFieldError:(g,v)=>{c(g,v);},setFieldTouched:(g,v)=>{i(g,v);},handleChange:l,handleBlur:f,handleSubmit:m,resetForm:R,validateForm:()=>o(),triggerValidation:d,isSubmitting:t.isSubmitting,isValid:t.isValid}}}var ri=768;function Qa(){var i,c;if(typeof window=="undefined")return false;let e=window.innerWidth<ri,t=window.navigator,a=(t.userAgent||"").toLowerCase(),o=/android|iphone|ipad|ipod|blackberry|iemobile|opera mini/.test(a),n=(c=(i=t.userAgentData)==null?void 0:i.mobile)!=null?c:false;return e||o||n}function Ye(){let[e,t]=X__namespace.useState(()=>Qa());return X__namespace.useEffect(()=>{let a=window.matchMedia(`(max-width: ${ri-1}px)`),o=()=>{t(Qa());};return typeof a.addEventListener=="function"?a.addEventListener("change",o):typeof a.addListener=="function"&&a.addListener(o),t(Qa()),()=>{typeof a.removeEventListener=="function"?a.removeEventListener("change",o):typeof a.removeListener=="function"&&a.removeListener(o);}},[]),e}var ai=e=>({title:"",subtitle:void 0,supportingText:void 0,heroBadge:void 0,icon:void 0,back:void 0,actions:void 0,variant:void 0,...e}),oi=e=>{let t=X.useMemo(()=>ai(e),[e]),[a,o]=X.useState([t]),n=a[a.length-1],i=a.length>1,c=X.useCallback(m=>{o(R=>{let k=[...R],g=k.length-1;return k[g]={...t,...m},k});},[t]),d=X.useCallback(m=>{o(R=>[...R,{...t,...m}]);},[t]),l=X.useCallback(()=>{i&&o(m=>m.slice(0,-1));},[i]),f=X.useCallback(m=>{o([ai(m!=null?m:t)]);},[t]);return {header:n,navigationState:n,navigationStack:a,setHeader:c,navigateTo:d,navigateBack:l,canGoBack:i,resetNavigation:f}},jd=()=>{let e=globalThis;return e.__GOMENIUCIVAN_MOBILE_HEADER_CONTEXT__||(e.__GOMENIUCIVAN_MOBILE_HEADER_CONTEXT__=X.createContext(null)),e.__GOMENIUCIVAN_MOBILE_HEADER_CONTEXT__},ni=jd(),ii=({initialState:e,children:t})=>{let a=oi(e);return r(ni.Provider,{value:a,children:t})},si=e=>{let t=X.useContext(ni);return t||oi(e)};var qd=400,di=200,ui=.95,pi=()=>typeof window=="undefined"?"":`${window.location.pathname}${window.location.search}${window.location.hash}`,mi=(e,t)=>{if(typeof window=="undefined")return ()=>{};let a=window.history,o=a[e];return o?(a[e]=function(...i){let c=o.apply(this,i);return t(),c},()=>{a[e]=o;}):()=>{}},Gd=(e,t)=>{if(typeof window=="undefined")return ()=>{};let a=[],o=null,n={current:pi()},i=()=>{o&&window.clearTimeout(o),o=window.setTimeout(()=>{o=null,t();},qd);},c=()=>{let m=pi();if(m===n.current){t();return}n.current=m,e(),i();};a.push(mi("pushState",c)),a.push(mi("replaceState",c));let d=()=>{c();};window.addEventListener("popstate",d),a.push(()=>window.removeEventListener("popstate",d));let l=()=>{c();};window.addEventListener("hashchange",l),a.push(()=>window.removeEventListener("hashchange",l));let f=()=>{o&&(window.clearTimeout(o),o=null),t();};return window.addEventListener("load",f),window.addEventListener("pageshow",f),a.push(()=>{window.removeEventListener("load",f),window.removeEventListener("pageshow",f);}),()=>{a.forEach(m=>m()),o&&window.clearTimeout(o);}},Wd=({color:e,framework:t})=>{let[a,o]=X.useState(false),n=X.useRef(a),[i,c]=X.useState(0),d=X.useRef(null),l=X.useRef(null),f=X.useCallback(()=>{l.current&&(window.clearTimeout(l.current),l.current=null),n.current=true,o(true),c(k=>k>0&&k<.2?k:.2);},[]),m=X.useCallback(()=>{n.current&&(d.current&&(window.clearTimeout(d.current),d.current=null),c(1),l.current=window.setTimeout(()=>{n.current=false,o(false),c(0);},200));},[]);X.useEffect(()=>{n.current=a;},[a]),X.useEffect(()=>typeof window=="undefined"?()=>{}:Gd(f,m),[f,m,t]),X.useEffect(()=>{if(!a){d.current&&(window.clearTimeout(d.current),d.current=null);return}let k=()=>{c(g=>{if(g>=ui)return g;let v=(1-g)*.1;return Math.min(g+v,ui)}),d.current=window.setTimeout(k,di);};return d.current=window.setTimeout(k,di),()=>{d.current&&(window.clearTimeout(d.current),d.current=null);}},[a]),X.useEffect(()=>()=>{d.current&&window.clearTimeout(d.current),l.current&&window.clearTimeout(l.current);},[]);let R=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:a?1:0,transition:"width 0.2s ease, opacity 0.2s ease",transform:"translateZ(0)",zIndex:9999}),[e,i,a]);return r("div",{"aria-hidden":"true",style:R})},ra=Wd;var gi=({color:e,framework:t})=>r(ra,{color:e,framework:t});var fi=({color:e,framework:t})=>r(ra,{color:e,framework:t});var $d={nextjs:fi},vi=e=>{var t;return (t=$d[e])!=null?t:gi};var bi=({color:e,framework:t})=>{let a=vi(t);return typeof window=="undefined"?null:r(a,{color:e,framework:t})};var eo=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 It=e=>{if(eo(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 xi,it=typeof process!="undefined"&&!!((xi=process==null?void 0:process.versions)!=null&&xi.node),to=null,ro=null,yi=Function("specifier","return import(specifier);"),_t=()=>it?(to||(to=yi("node:"+["fs","promises"].join("/"))),to):null,kr=()=>it?(ro||(ro=yi("node:path")),ro):null,hi={debug:10,info:20,warning:30,error:40,critical:50},Yd=30,Kd=1e3,Xd=20,Jd=e=>e===false?null:typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):Yd,wi=e=>{var d,l,f,m,R,k,g;let t=typeof process!="undefined"?(d=process==null?void 0:process.env)==null?void 0:d.NODE_ENV:void 0,a=Jd(e==null?void 0:e.storeDays),o=(l=e==null?void 0:e.level)!=null?l:"info",n=(f=e==null?void 0:e.consoleLogging)!=null?f:t!=="production",c=!!(e!=null&&e.enable)&&(t==="production"||!!(e!=null&&e.writeToFileInDev))&⁢return {enable:!!(e!=null&&e.enable),level:o,retentionDays:a,json:!!(e!=null&&e.json),slowRequestThresholdMs:(m=e==null?void 0:e.slowRequestThresholdMs)!=null?m:Kd,maxFileSizeBytes:Math.max(1,(R=e==null?void 0:e.maxFileSizeMB)!=null?R:Xd)*1024*1024,directory:(k=e==null?void 0:e.directory)!=null?k:"monitoring",consoleLogging:n,captureUnhandled:(g=e==null?void 0:e.captureUnhandled)!=null?g:true,writeToFile:c}},Qd=(e,t)=>hi[e]>=hi[t],Zd=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",aa=class{constructor(t){this.directoryCache=null;this.initialized=false;this.options=wi(t),this.publicApi=this.createPublicApi(),this.options.enable&&this.initialize();}get api(){return this.publicApi}updateOptions(t){let a=this.options.enable,o=this.options.level,n=this.options.json,i=this.options.slowRequestThresholdMs,c=this.options.retentionDays,d=this.options.directory,l=this.options.writeToFile;if(this.options=wi(t),this.options.directory!==d&&(this.directoryCache=null),!this.options.enable){this.detachProcessHandlers();return}(!a||this.options.level!==o||this.options.json!==n||this.options.slowRequestThresholdMs!==i||this.options.retentionDays!==c||this.options.directory!==d||this.options.writeToFile!==l)&&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,a,o)=>this.log(t,a,o),debug:(t,a)=>this.log("debug",t,a),info:(t,a)=>this.log("info",t,a),warning:(t,a)=>this.log("warning",t,a),error:(t,a)=>this.log("error",t,a),critical:(t,a)=>this.log("critical",t,a),logRequest:t=>this.logRequest(t),monitorRequest:(t,a)=>this.monitorRequest(t,a),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(!it)return null;if(this.directoryCache)return this.directoryCache;let t=await kr();if(!t)return null;let a=this.options.directory,o=t.isAbsolute(a)?a:t.join(process.cwd(),a);return this.directoryCache=o,o}async ensureDirectory(){if(!this.options.enable||!it)return;let t=await _t(),a=await this.getDirectoryPath();if(!(!t||!a))try{await t.mkdir(a,{recursive:!0});}catch(o){this.options.consoleLogging&&console.error("[monitoring] Failed to create directory",o);}}ensureProcessHandlers(){if(!this.options.enable||!this.options.captureUnhandled||!it)return;let t=process;if(!(t!=null&&t.on)||this.processHandlers)return;let a=(...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",a),t.on("unhandledRejection",o),this.processHandlers={exception:a,rejection:o};}detachProcessHandlers(){if(!this.processHandlers||!it)return;let t=process,{exception:a,rejection:o}=this.processHandlers;t!=null&&t.off?(t.off("uncaughtException",a),t.off("unhandledRejection",o)):t!=null&&t.removeListener&&(t.removeListener("uncaughtException",a),t.removeListener("unhandledRejection",o)),this.processHandlers=void 0;}resolveLogEntry(t,a,o){let n=o==null?void 0:o.context,i=Zd(o==null?void 0:o.error),{error:c,context:d,metadata:l,...f}=o!=null?o:{},m={};return l&&typeof l=="object"&&(m.metadata=l),Object.assign(m,f),{timestamp:new Date,level:t,message:a,context:n,error:i,metadata:Object.keys(m).length>0?m:void 0}}async log(t,a,o){if(!Qd(t,this.options.level))return;let i=this.resolveLogEntry(t,a,o);this.options.consoleLogging&&this.consoleLog(i),!(!this.options.enable||!this.options.writeToFile||!it)&&(await this.writeLogEntry(i),this.options.retentionDays!==null&&await this.purgeLogs());}consoleLog(t){let a=t.timestamp.toISOString(),o={...t.metadata,context:t.context,error:t.error},n=[`[monitoring] ${a} [${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 a=await _t(),o=await kr(),n=await this.getDirectoryPath();if(!(!a||!o||!n))try{let i=await this.resolveLogFilePath(n);if(!i)return;let c=this.options.json?this.serializeJsonEntry(t):this.serializeTextEntry(t);await a.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 a=await _t(),o=await kr();if(!a||!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",d=`${i}.${c}`,l=o.join(t,d);if(!await this.isFileExceedingSize(l))return l;let f=1;for(;;){let m=`${i}-${f}.${c}`,R=o.join(t,m);if(!await this.isFileExceedingSize(R))return R;f+=1;}}async isFileExceedingSize(t){let a=await _t();if(!a)return false;try{return (await a.stat(t)).size>=this.options.maxFileSizeBytes}catch(o){if(o.code==="ENOENT")return false;throw o}}async logRequest(t){var c,d,l;let a=(c=t.thresholdMs)!=null?c:this.options.slowRequestThresholdMs;if(t.durationMs<a)return;let o=((d=t.method)!=null?d:"REQUEST").toUpperCase(),n=`Slow request detected for ${o} ${(l=t.url)!=null?l:""}`,i=t.durationMs>=a*2?"error":"warning";await this.log(i,n,{context:{method:o,url:t.url,durationMs:t.durationMs,statusCode:t.statusCode,thresholdMs:a},metadata:t.metadata});}async monitorRequest(t,a){let o=Date.now();try{let n=a();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 _t(),a=await kr(),o=await this.getDirectoryPath();if(!(!t||!a||!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 d=a.join(o,c.name);try{(await t.stat(d)).mtime.getTime()<i&&await t.rm(d,{force:!0});}catch(l){this.options.consoleLogging&&console.warn("[monitoring] Failed to purge log file",l);}}));}catch(n){this.options.consoleLogging&&console.error("[monitoring] Failed to read monitoring directory",n);}}async deleteLogFile(t){if(!it)return;let a=await _t(),o=await kr(),n=await this.getDirectoryPath();if(!(!a||!o||!n))try{if(!t){let d=await a.readdir(n,{withFileTypes:!0});await Promise.all(d.map(async l=>{let f=o.join(n,l.name);await a.rm(f,{force:!0,recursive:l.isDirectory()});}));return}let i=o.basename(t),c=o.join(n,i);await a.rm(c,{force:!0});}catch(i){this.options.consoleLogging&&console.error("[monitoring] Failed to delete log file",i);}}async listLogFiles(){if(!it)return [];let t=await _t(),a=await this.getDirectoryPath();if(!t||!a)return [];try{return (await t.readdir(a)).sort()}catch(o){return this.options.consoleLogging&&console.error("[monitoring] Failed to list log files",o),[]}}},zt=null,tu=()=>(zt||(zt=new aa),zt),oa=e=>(zt?zt.updateOptions(e):zt=new aa(e),zt.api),ki=()=>tu().api,ru=e=>{let t=X__namespace.useRef();return X__namespace.useEffect(()=>{if(!e)return;let a=t.current,o=JSON.stringify(e),n=a?JSON.stringify(a):void 0;o!==n&&(t.current=e,oa(e));},[e]),X__namespace.useMemo(()=>ki(),[])};function Cr(e,t="info",a){let{title:o,description:n,duration:i=4e3,action:c}=a||{},d={duration:i,...c&&{action:{label:c.label,onClick:c.onClick}}};switch(t){case "success":sonner.toast.success(o||e,{description:n,...d});break;case "error":sonner.toast.error(o||e,{description:n,...d});break;case "warning":sonner.toast.warning(o||e,{description:n,...d});break;case "info":default:sonner.toast.info(o||e,{description:n,...d});break}}var au=(e,t)=>Cr(e,"success",t),ou=(e,t)=>Cr(e,"error",t),nu=(e,t)=>Cr(e,"warning",t),iu=(e,t)=>Cr(e,"info",t);var Ci=X.createContext(void 0),cu={enabled:false,framework:"auto",fieldName:"auto",fieldCy:"auto"},du=new Set(["","email","number","password","search","tel","text","url","date","datetime-local","month","time","week"]),uu=()=>{var a;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"&&(a=globalThis.process)!=null?a: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"},pu=e=>{var d;let t={...cu,...e!=null?e:{}},a=(d=t.framework)!=null?d:"auto",o=a==="auto"?uu():a,n=!!t.enabled,i=t.fieldName==="auto"?n:!!t.fieldName,c=t.fieldCy==="auto"?n:!!t.fieldCy;return {enabled:n,debug:n,framework:o,requestedFramework:a,fieldName:i,fieldCy:c}},rx=({children:e,defaultTheme:t="system",nativeApp:a=false,extras:o,monitoring:n,siderbar:i})=>{var C,P,F,H,W;let[c,d]=X.useState(!!a),l=Ye(),f=X.useMemo(()=>rn(),[]),m=X.useMemo(()=>{let D=pu(o);return on(f,D),D},[o,f]),R=X.useMemo(()=>n||{enable:false},[n]);X.useEffect(()=>{oa(R);},[R]),X.useEffect(()=>()=>{nn(f);},[f]),X.useEffect(()=>{d(!!a);},[a]);let k=()=>{var _;if(typeof window=="undefined")return t==="system"?"auto":t;let D=(_=window.localStorage)==null?void 0:_.getItem(Gt);return qt(D)?D:t==="system"?"auto":t},[g,v]=X.useState(()=>k()),[p,b]=X.useState(()=>br(k())),[w,x]=X.useState(null);X.useEffect(()=>{b(br(g)),un(g);},[g]),X.useEffect(()=>{var O;if(typeof window=="undefined")return;let D=(O=window.localStorage)==null?void 0:O.getItem(Gt);if(qt(D))return;let _=t==="system"?"auto":t;v(M=>M===_?M:_);},[t]),X.useEffect(()=>{if(typeof window=="undefined"||g!=="auto")return;let D=window.matchMedia("(prefers-color-scheme: dark)"),_=M=>{let U=M.matches?"dark":"light";b(V=>V===U?V:U),Vr("auto");},O=br("auto");return b(M=>M===O?M:O),Vr("auto"),D.addEventListener("change",_),()=>D.removeEventListener("change",_)},[g]),X.useEffect(()=>{if(typeof window=="undefined")return;let D=_=>{let O=_.detail;O&&v(M=>M===O?M:O);};return window.addEventListener(Br,D),()=>window.removeEventListener(Br,D)},[]),X.useEffect(()=>{if(typeof window=="undefined")return;let D=_=>{if(_.key!==Gt||!_.newValue||!qt(_.newValue))return;let O=_.newValue;v(M=>M===O?M:O);};return window.addEventListener("storage",D),()=>window.removeEventListener("storage",D)},[]);let T=p==="dark";X.useEffect(()=>{if(typeof document=="undefined")return;let D=document.documentElement;D.dataset.framework=m.framework,D.dataset.debug=m.enabled?"true":"false";},[m]);let y=c,N=y||l;X.useEffect(()=>{if(typeof document=="undefined"||typeof window=="undefined"||!N)return;let D=150,_=G=>G instanceof HTMLElement?G.isContentEditable||G instanceof HTMLTextAreaElement?true:G instanceof HTMLInputElement?du.has(G.type):false:false,O=G=>{let j=G.getBoundingClientRect(),q=window.innerHeight||document.documentElement.clientHeight,z=window.innerWidth||document.documentElement.clientWidth,te=j.top>=0&&j.bottom<=q,K=j.left>=0&&j.right<=z;return te&&K},M=G=>{window.setTimeout(()=>{O(G)||G.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"});},D);},U=G=>{if(!(G instanceof Element))return null;if(_(G))return G;let j=G.closest('input, textarea, [contenteditable="true"]');return j&&_(j)?j:null},V=G=>{let j=U(G.target);j&&M(j);},B=G=>{if(G.pointerType&&G.pointerType!=="touch"&&G.pointerType!=="pen")return;let j=U(G.target);j&&M(j);};return document.addEventListener("focusin",V,true),document.addEventListener("pointerdown",B,true),()=>{document.removeEventListener("focusin",V,true),document.removeEventListener("pointerdown",B,true);}},[N]);let h=X.useCallback(D=>{v(_=>_===D?_:D);},[v]),E=X.useCallback(D=>{h(D?"dark":"light");},[h]),L=X.useMemo(()=>T?"#fff":"#000",[T]),S={isDarkMode:T,themeMode:g,isNativeApp:c,isNativeLike:y,isNative:y,extras:m,nativeOverlayContainer:w,setIsDarkMode:E,setThemeMode:h,setNativeApp:d,setNativeOverlayContainer:x};return r(Ci.Provider,{value:S,children:u(ln,{children:[r(bi,{color:L,framework:m.framework}),u(ao,{delayDuration:0,children:[It(i==null?void 0:i.show)&&u(Pi,{children:[u(Ti,{...i==null?void 0:i.props,children:[It((C=i==null?void 0:i.header)==null?void 0:C.show)&&r(Si,{children:r(Di,{children:r(Li,{children:r(Ii,{asChild:true,className:"data-[slot=sidebar-menu-button]:!p-1.5",children:"Header"})})})}),It((P=i==null?void 0:i.content)==null?void 0:P.show)&&r(Ei,{children:(F=i==null?void 0:i.content)==null?void 0:F.children}),It((H=i==null?void 0:i.footer)==null?void 0:H.show)&&r(Mi,{children:(W=i==null?void 0:i.footer)==null?void 0:W.children})]}),r(Ni,{"data-content-layout":i==null?void 0:i.contentLayout,className:s("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:r("div",{className:"h-full p-4 md:p-6",children:e})})]}),!It(i==null?void 0:i.show)&&r(jsxRuntime.Fragment,{children:e})]})]})})},bt=()=>{let e=X.useContext(Ci);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e},ax=()=>{let{extras:e}=bt();return e};var oo=X__namespace.forwardRef(({className:e,...t},a)=>u("svg",{ref:a,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:[r("path",{d:"M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7Z"}),r("circle",{cx:12,cy:12,r:3})]}));oo.displayName="EyeIcon";var no=X__namespace.forwardRef(({className:e,...t},a)=>u("svg",{ref:a,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:[r("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"}),r("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"}),r("line",{x1:1,x2:23,y1:1,y2:23})]}));no.displayName="EyeOffIcon";var Ge=X__namespace.forwardRef(({className:e,type:t,onFocus:a,...o},n)=>{let i=X__namespace.useCallback(v=>{typeof n=="function"?n(v):n&&(n.current=v);},[n]),c=X__namespace.useCallback(v=>{a==null||a(v),!v.defaultPrevented&&Ur(v.currentTarget);},[a]),[d,l]=X__namespace.useState(false),f=t!=null?t:"text",m=f==="password",R=m&&d?"text":f;X__namespace.useEffect(()=>{!m&&d&&l(false);},[m,d]);let k=d?"Hide password":"Show password",g=s(ot,"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?u("div",{className:s("relative inline-flex w-full",e),children:[r("input",{ref:i,type:R,"data-slot":"input",onFocus:c,className:g,...o}),m&&r("button",{type:"button",onClick:()=>l(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":k,"aria-pressed":d,children:d?r(no,{"aria-hidden":true,className:"size-4"}):r(oo,{"aria-hidden":true,className:"size-4"})})]}):r("input",{ref:i,type:R,"data-slot":"input",onFocus:c,className:g,...o})});Ge.displayName="Input";var io=(e,t)=>{if(typeof t=="number"){let a=Math.pow(10,t);return (Math.round(e*a)/a).toString()}return e.toString()},mu=e=>e==null?"":typeof e=="number"?e.toString():e.trim(),gu=e=>e===0?/^-?\d*$/:typeof e=="number"?new RegExp(`^-?\\d*(\\.\\d{0,${e}})?$`):/^-?\d*(\.\d*)?$/,fu=e=>e===""||e==="-"||e==="."||e==="-.",so=(e,t)=>{if(fu(e))return null;let a=Number(e);if(Number.isNaN(a))return null;if(typeof t=="number"){let o=Math.pow(10,t);return Math.round(a*o)/o}return a},lo=X__namespace.forwardRef(({value:e,defaultValue:t,onChange:a,min:o,max:n,decimals:i,formatter:c,parser:d,onBlur:l,onFocus:f,inputMode:m,pattern:R,...k},g)=>{let v=X__namespace.useMemo(()=>gu(i),[i]),p=X__namespace.useMemo(()=>{var C;let S=(C=e!=null?e:t)!=null?C:null;return S===null?"":io(S,i)},[e,t,i]),[b,w]=X__namespace.useState(p),[x,T]=X__namespace.useState(false);X__namespace.useEffect(()=>{if(e===void 0)return;let S=e===null?"":io(e,i);w(C=>C===S?C:S);},[e,i]);let y=X__namespace.useCallback(S=>{if(S===null)return null;let C=S;return typeof o=="number"&&(C=Math.max(o,C)),typeof n=="number"&&(C=Math.min(n,C)),C},[o,n]),N=S=>{let C=d?mu(d(S.target.value)):S.target.value;if(!v.test(C)&&C!=="")return;w(C);let P=so(C,i);a==null||a(P);},h=S=>{T(true),f==null||f(S);},E=S=>{T(false);let C=so(b,i),P=y(C);if(P===null)b!==""&&(w(""),a==null||a(null));else if(P!==C){let F=io(P,i);w(F),a==null||a(P);}l==null||l(S);},L=X__namespace.useMemo(()=>{if(x)return b;if(c){let S=so(b,i),C=S!=null?S:b===""?null:b;return c(C)}return b},[c,x,b,i]);return r(Ge,{ref:g,value:L,onChange:N,onFocus:h,onBlur:E,inputMode:m!=null?m:i===0?"numeric":"decimal",pattern:R!=null?R:i===0?"-?\\d*":void 0,...k})});lo.displayName="InputNumeric";var Fi="X",vu=e=>e.replace(/\D/g,""),bu=(e,t)=>e.split("").reduce((a,o)=>o===t?a+1:a,0),hu=(e,t,a)=>{if(!t)return e;let o="",n=0;for(let i of t)if(i===a)if(n<e.length)o+=e[n],n+=1;else break;else (e.length>0||o.length>0)&&(o+=i);return o},co=X__namespace.forwardRef(({mask:e,placeholderChar:t=Fi,value:a,defaultValue:o,onChange:n,inputMode:i,...c},d)=>{var p;let l=(p=t[0])!=null?p:Fi,f=X__namespace.useMemo(()=>bu(e,l),[e,l]),m=X__namespace.useCallback(b=>{if(!b)return "";let w=vu(b);return f===0?"":w.slice(0,f)},[f]),[R,k]=X__namespace.useState(()=>{var b;return m((b=a!=null?a:o)!=null?b:"")});X__namespace.useEffect(()=>{if(a===void 0)return;let b=m(a);k(w=>w===b?w:b);},[a,m]),X__namespace.useEffect(()=>{a===void 0&&k(b=>m(b));},[e,l,m,a]);let g=b=>{let w=m(b.target.value);a===void 0&&k(w),n==null||n(w);},v=X__namespace.useMemo(()=>hu(R,e,l),[e,l,R]);return r(Ge,{ref:d,value:v,onChange:g,inputMode:i!=null?i:"numeric",...c})});co.displayName="InputMask";function Qt({...e}){return r(radixUi.Popover.Root,{"data-slot":"popover",...e})}function Hi({...e}){return r(radixUi.Popover.Trigger,{"data-slot":"popover-trigger",...e})}function Zt({className:e,align:t="center",sideOffset:a=4,...o}){return r(radixUi.Popover.Portal,{children:r(radixUi.Popover.Content,{"data-slot":"popover-content",align:t,sideOffset:a,className:s("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 sa({...e}){return r(radixUi.Popover.Anchor,{"data-slot":"popover-anchor",...e})}function er({...e}){return r(vaul.Drawer.Root,{"data-slot":"drawer",...e})}function la({...e}){return r(vaul.Drawer.Trigger,{"data-slot":"drawer-trigger",...e})}function wu({...e}){return r(vaul.Drawer.Portal,{"data-slot":"drawer-portal",...e})}function ca({...e}){return r(vaul.Drawer.Close,{"data-slot":"drawer-close",...e})}function xu({className:e,...t}){return r(vaul.Drawer.Overlay,{"data-slot":"drawer-overlay",className:s("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 tr({className:e,children:t,...a}){return u(wu,{"data-slot":"drawer-portal",children:[r(xu,{}),u(vaul.Drawer.Content,{"data-slot":"drawer-content",className:s("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),...a,children:[r("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 rr({className:e,...t}){return r("div",{"data-slot":"drawer-header",className:s("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 Oi({className:e,...t}){return r("div",{"data-slot":"drawer-footer",className:s("mt-auto flex flex-col gap-2 p-4",e),...t})}function ar({className:e,...t}){return r(vaul.Drawer.Title,{"data-slot":"drawer-title",className:s("text-foreground font-semibold",e),...t})}function Nx({className:e,...t}){return r(vaul.Drawer.Description,{"data-slot":"drawer-description",className:s("text-muted-foreground text-sm",e),...t})}var vo="YYYY-MM-DD",Nu=["Su","Mo","Tu","We","Th","Fr","Sa"],Su=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],uo={bottomLeft:{side:"bottom",align:"start"},bottomRight:{side:"bottom",align:"end"},topLeft:{side:"top",align:"start"},topRight:{side:"top",align:"end"}},Mu=e=>{var t;return e&&(t=uo[e])!=null?t:uo.bottomLeft},Vi=e=>e?typeof e=="function"?[vo]:Array.isArray(e)?e:[e]:[vo],da=(e,t)=>{if(!e)return "";if(typeof t=="function")return t(e);let a=Vi(t),[o]=a;return e.format(o!=null?o:vo)},Eu=(e,t)=>{let a=e.trim();if(!a)return null;if(t&&typeof t=="function"){let i=nt(a);return i.isValid()?i:null}let o=Vi(t);for(let i of o){let c=ti(a,i);if(c!=null&&c.isValid())return c}let n=nt(a);return n.isValid()?n:null},po=(e,t,a)=>{if(!e||!t)return false;switch(a){case "month":return e.isSame(t,"month");case "year":case "decade":return e.isSame(t,"year");default:return e.isSame(t,"day")}},Du=e=>{let t=Math.floor(e.year()/10)*10;return e.year(t).startOf("year")},ua=e=>{let t=Du(e),a=t.add(9,"year").endOf("year");return {start:t,end:a}},Ft=(e,t,a)=>{let o=e;return t&&o.isBefore(t)&&(o=t),a&&o.isAfter(a)&&(o=a),o},Ht=44,pa=5,Ai=40,mo=6,Bi=(e,t)=>t<=0?0:Math.min(Math.max(e,0),t),go=({label:e,options:t,selectedValue:a,onValueChange:o,open:n,infinite:i=true})=>{let c=X__namespace.useRef(null),d=X__namespace.useRef(null),[l,f]=X__namespace.useState(()=>({start:0,end:Math.min(t.length,pa+mo)}));X__namespace.useEffect(()=>{i||f(x=>{if(t.length===0)return {start:0,end:0};let T=t.length-1,y=Math.min(x.start,T),N=pa+mo,h=Math.max(y+N,y+1),E=Math.min(t.length,h);return x.start===y&&x.end===E?x:{start:y,end:E}});},[i,t.length]);let m=X__namespace.useCallback(x=>{if(i||t.length===0)return;let T=Bi(x,t.length-1),y=pa+mo,N=Math.floor(y/2),h=Math.max(0,T-N),E=Math.min(t.length,T+N+1);f(L=>L.start===h&&L.end===E?L:{start:h,end:E});},[i,t.length]),R=X__namespace.useMemo(()=>{if(t.length===0)return [];if(!i)return t;let x=[];for(let T=0;T<Ai;T+=1)for(let y of t)x.push(y);return x},[i,t]),k=X__namespace.useCallback((x,T="auto")=>{if(!c.current||t.length===0||R.length===0)return;let y=t.findIndex(S=>S.value===x),N=y>=0?y:0,h=Math.floor(Ai/2),L=(i?N+t.length*h:N)*Ht;c.current.scrollTo({top:L,behavior:T}),i||m(N);},[R.length,i,t,m]);X__namespace.useLayoutEffect(()=>{n&&k(a);},[k,n,t,a]),X__namespace.useEffect(()=>{if(i||!n)return;let x=t.findIndex(T=>T.value===a);m(x>=0?x:0);},[i,n,t,a,m]),X__namespace.useEffect(()=>()=>{d.current!==null&&clearTimeout(d.current);},[]);let g=X__namespace.useCallback(x=>{R.length===0||t.length===0||(d.current!==null&&clearTimeout(d.current),d.current=setTimeout(()=>{var h,E;if(!c.current)return;let T=Math.round(c.current.scrollTop/Ht);i||(T=Bi(T,R.length-1));let y=R[T];if(!y)return;if(!o(y.value)){k(a,"smooth");return}if(i){let L=t.length,S=R.length-t.length-1;if(T<=L||T>=S)k(y.value);else {let C=T*Ht;(h=c.current)==null||h.scrollTo({top:C});}}else {m(T);let L=T*Ht;(E=c.current)==null||E.scrollTo({top:L});}},80));},[k,R,i,o,t,t.length,a,m]);if(t.length===0)return r("div",{className:"flex-1",children:r("p",{className:"text-center text-sm text-muted-foreground",children:"No options"})});let v=(pa-1)/2*Ht,p=i?R:t.slice(l.start,l.end),b=l.start*Ht,w=t.length*Ht;return u("div",{className:"flex flex-1 flex-col items-center gap-2",children:[r("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:e}),u("div",{className:"relative h-56 w-full overflow-hidden",children:[r("div",{className:"pointer-events-none absolute inset-x-0 top-1/2 -translate-y-1/2 border-y border-primary/30"}),r("div",{ref:c,onScroll:g,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?R.map((x,T)=>{let y=`${T}-${x.value}`,N=x.value===a;return r("div",{className:s("flex h-11 items-center justify-center text-base transition-colors",N?"font-medium text-foreground":"text-muted-foreground"),children:x.label},y)}):r("div",{style:{height:w},children:r("div",{style:{transform:`translateY(${b}px)`},children:p.map((x,T)=>{let N=`${l.start+T}-${x.value}`,h=x.value===a;return r("div",{className:s("flex h-11 items-center justify-center text-base transition-colors",h?"font-medium text-foreground":"text-muted-foreground"),children:x.label},N)})})})})]})]})},Lu=(e,t)=>e&&e!=="time"?e:t==="month"?"month":t==="year"?"year":"date",Iu=e=>{switch(e){case "month":case "year":return e;case "decade":return "year";default:return "day"}},_u=(e,t,a,o="date")=>{let n=Iu(o);return !(t&&e.isBefore(t,n)||a&&e.isAfter(a,n))},zu=e=>{var t,a,o,n,i,c,d;return {placeholder:(t=e==null?void 0:e.placeholder)!=null?t:"Select date",today:(a=e==null?void 0:e.today)!=null?a:"Today",clear:(o=e==null?void 0:e.clear)!=null?o:"Clear",months:(n=e==null?void 0:e.months)!=null?n:Su,weekDays:(i=e==null?void 0:e.weekDays)!=null?i:Nu,yearFormat:(c=e==null?void 0:e.yearFormat)!=null?c:"YYYY",decadeFormat:(d=e==null?void 0:e.decadeFormat)!=null?d:((l,f)=>`${l.format("YYYY")}-${f.format("YYYY")}`)}},fo=e=>{let t=X__namespace.useRef(e);return X__namespace.useEffect(()=>{t.current=e;},[e]),t},Fu="hsl(var(--primary))",bo=X__namespace.forwardRef((e,t)=>{var Go,Wo,$o,Yo,Ko,Xo,Jo;let{value:a,defaultValue:o=null,onChange:n,onOpenChange:i,allowClear:c=true,autoFocus:d=false,defaultOpen:l,disabled:f=false,disabledDate:m,format:R,preserveInvalidOnBlur:k=false,inputReadOnly:g=false,locale:v,minDate:p,maxDate:b,mode:w,needConfirm:x=false,open:T,panelRender:y,picker:N,placeholder:h,placement:E="bottomLeft",prefix:L,presets:S,size:C="middle",status:P,variant:F="outlined",className:H,style:W,inputClassName:D,inputStyle:_,onFocus:O,onBlur:M,name:U,id:V,...B}=e,{isNative:G}=bt(),j=Ye(),q=G||j,[z,te]=X__namespace.useState(null),K=X__namespace.useMemo(()=>zu(v),[v]),ce=fo(n),le=fo(i),ne=fo(R),fe=a!==void 0,[ge,$]=X__namespace.useState(o),ie=(Go=fe?a:ge)!=null?Go:null,pe=X__namespace.useMemo(()=>Lu(w,N),[w,N]),[he,ke]=X__namespace.useState(pe),ae=X__namespace.useCallback(I=>{var A;fe||$(I),(A=ce.current)==null||A.call(ce,I,da(I,ne.current));},[ne,fe,ce]),[re,we]=X__namespace.useState(ie);X__namespace.useEffect(()=>{we(ie);},[ie]);let[de,ye]=X__namespace.useState(()=>{let I=ie!=null?ie:nt();return Ft(I,p,b)}),Pe=T!==void 0,[me,De]=X__namespace.useState(!!l),Ce=Pe?!!T:me,Te=X__namespace.useCallback(I=>{var A;Pe||De(I),(A=le.current)==null||A.call(le,I);},[Pe,le]),ve=x?re:ie;X__namespace.useEffect(()=>{Ce&&(ke(pe),ye(I=>Ft(ve!=null?ve:I,p,b)));},[ve,pe,b,p,Ce]);let[dt,xe]=X__namespace.useState(()=>da(ve,ne.current)),St=X__namespace.useRef(false);X__namespace.useEffect(()=>{St.current||xe(da(ve,ne.current));},[ve,ne]);let Ve=X__namespace.useMemo(()=>({"--date-primary-color":Fu}),[]),xt=X__namespace.useRef(null),rt=X__namespace.useCallback(I=>{f||(Te(I),I&&(ke(pe),ye(A=>Ft(ve!=null?ve:A,p,b))));},[ve,f,pe,b,p,Te]),yt=X__namespace.useCallback(I=>Eu(I,ne.current),[ne]),Ee=X__namespace.useCallback((I,A)=>_u(I,p,b,A)?m?m(I,{type:A}):false:true,[m,b,p]),Re=X__namespace.useCallback(I=>da(I,ne.current),[ne]),Mt=X__namespace.useCallback(I=>{Ee(I,"date")||(x?(we(I),xe(Re(I))):(ae(I),xe(Re(I)),Te(false)));},[ae,Re,Ee,x,Te]),Vt=I=>{let A=de.month(I);if(ye(A),pe==="month"){let Y=A.startOf("month");if(Ee(Y,"month"))return;x?(we(Y),xe(Re(Y))):(ae(Y),xe(Re(Y)),Te(false));}else ke("date");},oe=I=>{let A=de.year(I);if(ye(A),pe==="year"){let Y=A.startOf("year");if(Ee(Y,"year"))return;x?(we(Y),xe(Re(Y))):(ae(Y),xe(Re(Y)),Te(false));}else ke("month");},Ke=I=>{let A=de.year(I);ye(A),ke("year");},je=I=>{ye(A=>{let Y=I==="date"?A.subtract(1,"month"):I==="month"?A.subtract(1,"year"):A.subtract(10,"year");return Ft(Y,p,b)});},ut=I=>{ye(A=>{let Y=I==="date"?A.add(1,"month"):I==="month"?A.add(1,"year"):A.add(10,"year");return Ft(Y,p,b)});},Ta=()=>{let A=de.startOf("month").startOf("week"),Y=[];for(let Z=0;Z<6;Z+=1){let _e=[];for(let $e=0;$e<7;$e+=1){let Ne=A.add(Z*7+$e,"day"),pt=Ne.month()===de.month()&&Ne.year()===de.year(),fr=po(Ne,ve,"date"),yl=Ne.isSame(nt(),"day"),_a=Ee(Ne,"date");_e.push(r("button",{type:"button",disabled:_a,onClick:()=>Mt(Ne),className:s("flex h-8 w-8 items-center justify-center rounded-md text-sm transition",!pt&&"text-muted-foreground/70",fr&&"bg-[var(--date-primary-color)] text-white",yl&&!fr&&"border border-[var(--date-primary-color)]",_a&&"cursor-not-allowed opacity-40",!_a&&!fr&&"hover:bg-muted"),style:Ve,children:Ne.date()},Ne.format("YYYY-MM-DD")));}Y.push(r("div",{className:"grid grid-cols-7 gap-1",children:_e},`week-${Z}`));}return u("div",{className:"space-y-1",children:[r("div",{className:"grid grid-cols-7 gap-1 text-center text-xs text-muted-foreground",children:K.weekDays.map(Z=>r("div",{children:Z},Z))}),r("div",{className:"space-y-1",children:Y})]})},Fr=()=>r("div",{className:"grid grid-cols-3 gap-2",children:K.months.map((I,A)=>{let Y=de.month(A),Z=po(Y,ve,"month"),_e=Ee(Y.startOf("month"),"month");return r("button",{type:"button",disabled:_e,onClick:()=>Vt(A),className:s("flex h-12 flex-col items-center justify-center rounded-md text-sm transition",Z&&"bg-[var(--date-primary-color)] text-white",_e&&"cursor-not-allowed opacity-40",!_e&&!Z&&"hover:bg-muted"),style:Ve,children:I},I)})}),Na=()=>{let{start:I}=ua(de),A=[];for(let Y=-1;Y<11;Y+=1)A.push(I.year()+Y);return r("div",{className:"grid grid-cols-4 gap-2",children:A.map(Y=>{let Z=de.year(Y),_e=po(Z,ve,"year"),$e=Ee(Z.startOf("year"),"year"),Ne=Y<I.year()||Y>I.year()+9;return r("button",{type:"button",disabled:$e,onClick:()=>oe(Y),className:s("flex h-12 flex-col items-center justify-center rounded-md text-sm transition",_e&&"bg-[var(--date-primary-color)] text-white",$e&&"cursor-not-allowed opacity-40",!$e&&!_e&&"hover:bg-muted",Ne&&"text-muted-foreground/70"),style:Ve,children:Y},Y)})})},Hr=()=>{let{start:I}=ua(de),A=I.year()-10,Y=[];for(let Z=0;Z<12;Z+=1)Y.push(A+Z*10);return r("div",{className:"grid grid-cols-4 gap-2",children:Y.map(Z=>{let _e=Z+9,$e=ve==null?void 0:ve.year(),Ne=$e!==void 0&&$e>=Z&&$e<=_e,pt=Ee(de.year(Z).startOf("year"),"year"),fr=_e<I.year()||Z>I.year()+9;return u("button",{type:"button",disabled:pt,onClick:()=>Ke(Z),className:s("flex h-12 flex-col items-center justify-center rounded-md text-sm transition",Ne&&"bg-[var(--date-primary-color)] text-white",pt&&"cursor-not-allowed opacity-40",!pt&&!Ne&&"hover:bg-muted",fr&&"text-muted-foreground/70"),style:Ve,children:[Z,"-",_e]},`${Z}-${_e}`)})})},Sa=()=>{switch(he){case "month":return Fr();case "year":return Na();case "decade":return Hr();default:return Ta()}},Ma=I=>{St.current=true,xe(I.target.value);},Ea=I=>{O==null||O(I),rt(true);},Or=I=>{M==null||M(I);let A=()=>{St.current=false;let Y=yt(dt);Y&&!Ee(Y,"date")?x?(we(Y),xe(Re(Y))):(ae(Y),xe(Re(Y))):k||xe(Re(ve));};typeof window!="undefined"?window.setTimeout(A,50):A();},jt=I=>{I==null||I.preventDefault(),I==null||I.stopPropagation(),!f&&(we(null),ye(()=>Ft(nt(),p,b)),x?xe(""):(ae(null),xe(""),Te(false)));},pr=()=>{let I=nt();Ee(I,"date")||(x?(we(I),xe(Re(I))):(ae(I),xe(Re(I)),Te(false)));},mr=()=>{x&&(ae(re!=null?re:null),Te(false));},J=()=>{x&&(we(ie),xe(Re(ie)),Te(false));},ue=typeof c=="object"&&c!==null&&!Array.isArray(c)?c:void 0,We=!!c&&!f&&!!dt,at=(Wo=ue==null?void 0:ue.clearIcon)!=null?Wo:r(lucideReact.X,{className:"h-4 w-4",strokeWidth:2}),{side:Da,align:sl}=Mu(E),ll=($o={large:"lg",middle:"md",small:"sm"}[C])!=null?$o:"md",cl={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)))"}},dl={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"},ul={...P?cl[P]:{},..._!=null?_:{}},pl={sm:"h-8 text-sm",md:`${ot} text-sm`,lg:"h-11 text-base"},ml={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"},Oo=u("div",{className:"w-[280px] select-none",role:"dialog","aria-modal":"true",children:[u("div",{className:"flex items-center justify-between px-2 pt-2",children:[u("div",{className:"flex items-center gap-1",children:[r("button",{type:"button",className:"flex h-8 w-8 items-center justify-center rounded-md hover:bg-muted",onClick:()=>je(he==="date"?"month":he==="month"?"year":"decade"),children:r(lucideReact.ChevronsLeft,{className:"h-4 w-4"})}),he==="date"&&r("button",{type:"button",className:"flex h-8 w-8 items-center justify-center rounded-md hover:bg-muted",onClick:()=>je("date"),children:r(lucideReact.ChevronLeft,{className:"h-4 w-4"})})]}),r("div",{className:"flex flex-col items-center",children:u("button",{type:"button",className:"text-sm font-medium hover:text-[var(--date-primary-color)]",style:Ve,onClick:()=>{he==="date"?ke("month"):he==="month"?ke("year"):he==="year"&&ke("decade");},children:[he==="date"&&`${K.months[de.month()]} ${de.format(K.yearFormat)}`,he==="month"&&de.format(K.yearFormat),he==="year"&&(()=>{let{start:I,end:A}=ua(de);return K.decadeFormat(I,A)})(),he==="decade"&&(()=>{let{start:I,end:A}=ua(de);return `${I.subtract(10,"year").format(K.yearFormat)}-${A.add(10,"year").format(K.yearFormat)}`})()]})}),u("div",{className:"flex items-center gap-1",children:[he==="date"&&r("button",{type:"button",className:"flex h-8 w-8 items-center justify-center rounded-md hover:bg-muted",onClick:()=>ut("date"),children:r(lucideReact.ChevronRight,{className:"h-4 w-4"})}),r("button",{type:"button",className:"flex h-8 w-8 items-center justify-center rounded-md hover:bg-muted",onClick:()=>ut(he==="date"?"month":he==="month"?"year":"decade"),children:r(lucideReact.ChevronsRight,{className:"h-4 w-4"})})]})]}),r("div",{className:"px-2 pb-2 pt-3",children:Sa()}),u("div",{className:"flex items-center justify-between gap-2 border-t px-2 py-2",children:[r("div",{className:"flex flex-wrap items-center gap-2",children:S==null?void 0:S.map((I,A)=>{let Y=typeof I.value=="function"?I.value():I.value,Z=Y?Ee(Y,"date"):false;return r("button",{type:"button",disabled:Z,onClick:()=>{!Y||Z||(x?(we(Y),xe(Re(Y))):(ae(Y),xe(Re(Y)),Te(false)));},className:s("rounded-md px-2 py-1 text-xs transition",Z?"cursor-not-allowed bg-muted text-muted-foreground":"bg-muted hover:bg-muted/80"),children:I.label},A)})}),u("div",{className:"flex items-center gap-2",children:[r("button",{type:"button",onClick:pr,className:"text-xs font-medium text-[var(--date-primary-color)] hover:underline disabled:text-muted-foreground",disabled:Ee(nt(),"date"),style:Ve,children:K.today}),x?u("div",{className:"flex items-center gap-2",children:[r("button",{type:"button",className:"rounded-md px-2 py-1 text-xs hover:bg-muted",onClick:J,children:K.clear}),r("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:Ve,onClick:mr,children:"OK"})]}):r("button",{type:"button",className:"rounded-md px-2 py-1 text-xs hover:bg-muted",onClick:I=>jt(I),disabled:!ie,children:K.clear})]})]})]}),gl=y?y(Oo):Oo;X__namespace.useEffect(()=>{if(!d)return;let I=()=>{var A;(A=xt.current)==null||A.focus();};typeof window!="undefined"?window.setTimeout(I,0):I();},[d]),X__namespace.useImperativeHandle(t,()=>xt.current);let fl=!f&&(g||q),Ao=u("div",{role:"combobox","aria-expanded":Ce,"aria-haspopup":"dialog",className:s("relative w-full",H),style:W,children:[L&&r("div",{className:"pointer-events-none absolute inset-y-0 left-3 flex items-center text-muted-foreground",children:L}),r(Ge,{...B,ref:xt,value:dt,onChange:Ma,onFocus:Ea,onBlur:Or,autoFocus:d,readOnly:g||q,disabled:f,placeholder:h!=null?h:K.placeholder,name:U,id:V,className:s("pr-10 text-sm",dl[F],L&&"pl-10",f&&"cursor-not-allowed opacity-60",fl&&"cursor-pointer",pl[ll],P?ml[P]:void 0,D),style:ul,onClick:I=>{var A;(A=B.onClick)==null||A.call(B,I),!f&&q&&rt(true);}}),We&&r("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=>jt(I),children:at}),r("div",{className:"pointer-events-none absolute inset-y-0 right-3 flex items-center text-muted-foreground",children:r(lucideReact.Calendar,{className:"h-4 w-4"})})]}),gr=X__namespace.useMemo(()=>{var A,Y;return ((Y=x?(A=re!=null?re:ie)!=null?A:de:ve!=null?ve:de)!=null?Y:nt()).clone()},[ve,re,x,ie,de]),vl=X__namespace.useMemo(()=>K.months.map((I,A)=>({label:I,value:A})),[K.months]),Bo=gr.daysInMonth(),bl=X__namespace.useMemo(()=>Array.from({length:Bo},(I,A)=>({label:String(A+1).padStart(2,"0"),value:A+1})),[Bo]),Vo=gr.year(),jo=(Yo=p==null?void 0:p.year())!=null?Yo:Vo-100,Uo=(Ko=b==null?void 0:b.year())!=null?Ko:Vo+100,La=Math.min(jo,Uo),qo=Math.max(jo,Uo),hl=X__namespace.useMemo(()=>Array.from({length:qo-La+1},(I,A)=>{let Y=La+A;return {label:String(Y),value:Y}}),[qo,La]),Ia=X__namespace.useCallback((I,A)=>{var _e,$e;let Z=($e=x?(_e=re!=null?re:ie)!=null?_e:de:ie!=null?ie:de)!=null?$e:nt();if(I==="month"){let Ne=Z.month(A),pt=Math.min(Z.date(),Ne.daysInMonth());Z=Ne.date(pt);}else if(I==="date"){let Ne=Math.min(A,Z.daysInMonth());Z=Z.date(Ne);}else {let Ne=Z.year(A),pt=Math.min(Z.date(),Ne.daysInMonth());Z=Ne.date(pt);}return Z=Ft(Z,p,b),Ee(Z,"date")?false:(x?(we(Z),xe(Re(Z))):(ae(Z),xe(Re(Z))),ye(Z),true)},[ae,re,Re,Ee,b,p,x,ie,ye,de]),wl=(Jo=(Xo=typeof B["aria-label"]=="string"?B["aria-label"]:void 0)!=null?Xo:h)!=null?Jo:K.placeholder,xl=X__namespace.useCallback(I=>{rt(I);},[rt]);if(X__namespace.useEffect(()=>{var A,Y;if(!q||!Ce||!V||typeof document=="undefined")return;te(null);let I=document.querySelector(`label[for="${V}"]`);I&&te((Y=(A=I.textContent)==null?void 0:A.trim())!=null?Y:null);},[V,Ce,q]),q){let I=z!=null?z:wl;return u(er,{open:Ce,onOpenChange:xl,children:[r(la,{asChild:true,children:Ao}),u(tr,{className:"mt-10 max-h-[min(540px,calc(100dvh-6rem))] rounded-t-3xl bg-background",children:[r(rr,{className:"px-6 pb-2 pt-4",children:r(ar,{className:"text-base font-medium text-foreground",children:I})}),u("div",{className:"flex flex-1 flex-col gap-6 px-6 pb-6",children:[u("div",{className:"flex gap-4",children:[r(go,{open:Ce,label:"Month",options:vl,selectedValue:gr.month(),onValueChange:A=>Ia("month",A)}),r(go,{open:Ce,label:"Day",options:bl,selectedValue:gr.date(),onValueChange:A=>Ia("date",A)}),r(go,{open:Ce,label:"Year",options:hl,selectedValue:gr.year(),onValueChange:A=>Ia("year",A),infinite:false})]}),u("div",{className:"mt-auto flex items-center justify-between",children:[r(Q,{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:Ve,onClick:pr,children:K.today}),u("div",{className:"flex items-center gap-3",children:[c?r(Q,{type:"button",variant:"outline",size:"sm",className:"text-muted-foreground hover:text-foreground",onClick:A=>jt(A),children:K.clear}):null,x?u(jsxRuntime.Fragment,{children:[r(Q,{type:"button",variant:"ghost",size:"sm",className:"hover:bg-muted",onClick:J,children:"Cancel"}),r(Q,{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:Ve,onClick:mr,children:"OK"})]}):r(ca,{asChild:true,children:r(Q,{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:Ve,children:"Done"})})]})]})]})]})]})}return u(Qt,{open:Ce,onOpenChange:rt,children:[r(sa,{asChild:true,children:Ao}),r(Zt,{className:"w-auto border border-border bg-popover p-0",align:sl,side:Da,children:gl})]})});bo.displayName="DatePicker";function ji({...e}){return r(radixUi.DropdownMenu.Root,{"data-slot":"dropdown-menu",...e})}function qx({...e}){return r(radixUi.DropdownMenu.Portal,{"data-slot":"dropdown-menu-portal",...e})}var ho=X__namespace.forwardRef(({...e},t)=>r(radixUi.DropdownMenu.Trigger,{ref:t,"data-slot":"dropdown-menu-trigger",...e}));ho.displayName=radixUi.DropdownMenu.Trigger.displayName;var wo=X__namespace.forwardRef(({className:e,sideOffset:t=4,...a},o)=>r(radixUi.DropdownMenu.Portal,{children:r(radixUi.DropdownMenu.Content,{ref:o,"data-slot":"dropdown-menu-content",sideOffset:t,className:s("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),...a})}));wo.displayName=radixUi.DropdownMenu.Content.displayName;function Gx({...e}){return r(radixUi.DropdownMenu.Group,{"data-slot":"dropdown-menu-group",...e})}function Wx({className:e,inset:t,variant:a="default",...o}){return r(radixUi.DropdownMenu.Item,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":a,className:s("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 Ui({className:e,children:t,checked:a,...o}){return u(radixUi.DropdownMenu.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:s("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:a,...o,children:[r("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:r(radixUi.DropdownMenu.ItemIndicator,{children:r(lucideReact.CheckIcon,{className:"size-4"})})}),t]})}function $x({...e}){return r(radixUi.DropdownMenu.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...e})}function Yx({className:e,children:t,...a}){return u(radixUi.DropdownMenu.RadioItem,{"data-slot":"dropdown-menu-radio-item",className:s("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),...a,children:[r("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:r(radixUi.DropdownMenu.ItemIndicator,{children:r(lucideReact.CircleIcon,{className:"size-2 fill-current"})})}),t]})}function qi({className:e,inset:t,...a}){return r(radixUi.DropdownMenu.Label,{"data-slot":"dropdown-menu-label","data-inset":t,className:s("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...a})}function Gi({className:e,...t}){return r(radixUi.DropdownMenu.Separator,{"data-slot":"dropdown-menu-separator",className:s("bg-border -mx-1 my-1 h-px",e),...t})}function Kx({className:e,...t}){return r("span",{"data-slot":"dropdown-menu-shortcut",className:s("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}function Xx({...e}){return r(radixUi.DropdownMenu.Sub,{"data-slot":"dropdown-menu-sub",...e})}var Bu=X__namespace.forwardRef(({className:e,inset:t,children:a,...o},n)=>u(radixUi.DropdownMenu.SubTrigger,{ref:n,"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:s("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:[a,r(lucideReact.ChevronRightIcon,{className:"ml-auto size-4"})]}));Bu.displayName=radixUi.DropdownMenu.SubTrigger.displayName;var Vu=X__namespace.forwardRef(({className:e,...t},a)=>r(radixUi.DropdownMenu.SubContent,{ref:a,"data-slot":"dropdown-menu-sub-content",className:s("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}));Vu.displayName=radixUi.DropdownMenu.SubContent.displayName;var ju=({children:e,...t})=>r("form",{...t,children:e});var Nr=({className:e,...t})=>r("p",{"data-slot":"form-description",className:s("text-muted-foreground text-sm",e),...t});Nr.displayName="FormDescription";var Sr=({className:e,...t})=>{let a=t.children;return a?r("p",{"data-slot":"form-message",className:s("text-destructive text-sm",e),...t,children:a}):null};Sr.displayName="FormMessage";var Mr=({className:e,...t})=>r(Me,{"data-slot":"form-label",className:e,...t});Mr.displayName="FormLabel";var Uu=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange?e:(t=e.form)!=null?t:e},qu=({name:e,label:t,description:a,className:o,checked:n,defaultChecked:i,onCheckedChange:c,checkboxProps:d,error:l,form:f,rules:m})=>{var S,C;let{onCheckedChange:R,...k}=d!=null?d:{},g=Uu(f),v=g==null?void 0:g.values,p=g==null?void 0:g.errors,b=g==null?void 0:g.touched,w=v==null?void 0:v[e],x=p==null?void 0:p[e],T=b==null?void 0:b[e],y=(S=g==null?void 0:g.validationSequence)!=null?S:0,N=(C=T?x:void 0)!=null?C:l,h=w!==void 0?!!w:n!==void 0?n:void 0,E=P=>{var D,_,O;let F=P===true,W=!!m?Wi(F,m):void 0;if((D=g==null?void 0:g.setFieldError)==null||D.call(g,e,W),(_=g==null?void 0:g.setFieldValue)==null||_.call(g,e,F),(O=g==null?void 0:g.setFieldTouched)==null||O.call(g,e,true),g!=null&&g.handleChange){let M={target:{name:e,value:F,checked:F}};g.handleChange(M);}c==null||c(F),R==null||R(P);},L=X__namespace.useRef(y);return X__namespace.useEffect(()=>{let P=!!m,F=y!==L.current;if(!(g!=null&&g.setFieldError)||!P){L.current=y;return}if(!T&&!F){L.current=y;return}let W=Wi(w!==void 0?!!w:n!==void 0?n:!!i,m);W!==x&&g.setFieldError(e,W),L.current=y;},[n,i,x,T,w,e,g,m,y]),u("div",{className:s("items-start gap-2",o),children:[u("div",{className:"flex items-start gap-3",children:[r("div",{children:r(yr,{name:e,...k,...h!==void 0?{checked:h}:{defaultChecked:i},"aria-invalid":!!N,onCheckedChange:E})}),u("div",{className:"grid gap-1.5 leading-none",children:[t?r(Mr,{className:"text-sm font-medium leading-none",children:t}):null,a?r(Nr,{children:a}):null]})]}),r(Sr,{children:N})]})};qu.displayName="FormCheckbox";function Wi(e,t){if(t){if(t.required&&!e)return typeof t.required=="string"?t.required:"This field is required";if(t.validate){let a=t.validate(e);if(typeof a=="string")return a;if(a===false)return "Invalid value"}}}var Gu={row:"flex-row","row-reverse":"flex-row-reverse",column:"flex-col","column-reverse":"flex-col-reverse"},Wu={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},$u={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},ga={nowrap:"flex-nowrap",wrap:"flex-wrap","wrap-reverse":"flex-wrap-reverse"},fa={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"}},xo={...fa,small:fa.sm,middle:fa.md,large:fa.lg},Yu=X__namespace.forwardRef(({direction:e,vertical:t,align:a,justify:o,wrap:n=false,gap:i,gapX:c,gapY:d,inline:l=false,className:f,children:m,...R},k)=>{var p;let g=e!=null?e:t?"column":"row",v=typeof n=="boolean"?n?ga.wrap:ga.nowrap:(p=ga[n])!=null?p:ga.nowrap;return r("div",{ref:k,"data-slot":"flex",className:s(l?"inline-flex":"flex",Gu[g],a?Wu[a]:null,o?$u[o]:null,v,i?xo[i].all:null,c?xo[c].x:null,d?xo[d].y:null,f),...R,children:m})});Yu.displayName="Flex";function Cy({...e}){return r(radixUi.HoverCard.Root,{"data-slot":"hover-card",...e})}function Py({...e}){return r(radixUi.HoverCard.Trigger,{"data-slot":"hover-card-trigger",...e})}function Ty({className:e,align:t="center",sideOffset:a=4,...o}){return r(radixUi.HoverCard.Portal,{"data-slot":"hover-card-portal",children:r(radixUi.HoverCard.Content,{"data-slot":"hover-card-content",align:t,sideOffset:a,className:s("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 Ly({className:e,containerClassName:t,...a}){return r(inputOtp.OTPInput,{"data-slot":"input-otp",containerClassName:s("flex items-center gap-2 has-disabled:opacity-50",t),className:s("disabled:cursor-not-allowed",e),...a})}function Iy({className:e,...t}){return r("div",{"data-slot":"input-otp-group",className:s("flex items-center",e),...t})}function _y({index:e,className:t,...a}){var d;let o=X__namespace.useContext(inputOtp.OTPInputContext),{char:n,hasFakeCaret:i,isActive:c}=(d=o==null?void 0:o.slots[e])!=null?d:{};return u("div",{"data-slot":"input-otp-slot","data-active":c,className:s("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),...a,children:[n,i&&r("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:r("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function zy({...e}){return r("div",{"data-slot":"input-otp-separator",role:"separator",...e,children:r(lucideReact.MinusIcon,{})})}function Me({className:e,...t}){return r(radixUi.Label.Root,{"data-slot":"label",className:s("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 Gy({className:e,...t}){return r(radixUi.Menubar.Root,{"data-slot":"menubar",className:s("bg-background flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs",e),...t})}function Wy({...e}){return r(radixUi.Menubar.Menu,{"data-slot":"menubar-menu",...e})}function $y({...e}){return r(radixUi.Menubar.Group,{"data-slot":"menubar-group",...e})}function rp({...e}){return r(radixUi.Menubar.Portal,{"data-slot":"menubar-portal",...e})}function Yy({...e}){return r(radixUi.Menubar.RadioGroup,{"data-slot":"menubar-radio-group",...e})}function Ky({className:e,...t}){return r(radixUi.Menubar.Trigger,{"data-slot":"menubar-trigger",className:s("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 Xy({className:e,align:t="start",alignOffset:a=-4,sideOffset:o=8,...n}){return r(rp,{children:r(radixUi.Menubar.Content,{"data-slot":"menubar-content",align:t,alignOffset:a,sideOffset:o,className:s("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 Jy({className:e,inset:t,variant:a="default",...o}){return r(radixUi.Menubar.Item,{"data-slot":"menubar-item","data-inset":t,"data-variant":a,className:s("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 Qy({className:e,children:t,checked:a,...o}){return u(radixUi.Menubar.CheckboxItem,{"data-slot":"menubar-checkbox-item",className:s("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:a,...o,children:[r("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:r(radixUi.Menubar.ItemIndicator,{children:r(lucideReact.CheckIcon,{className:"size-4"})})}),t]})}function Zy({className:e,children:t,...a}){return u(radixUi.Menubar.RadioItem,{"data-slot":"menubar-radio-item",className:s("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),...a,children:[r("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:r(radixUi.Menubar.ItemIndicator,{children:r(lucideReact.CircleIcon,{className:"size-2 fill-current"})})}),t]})}function e0({className:e,inset:t,...a}){return r(radixUi.Menubar.Label,{"data-slot":"menubar-label","data-inset":t,className:s("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...a})}function t0({className:e,...t}){return r(radixUi.Menubar.Separator,{"data-slot":"menubar-separator",className:s("bg-border -mx-1 my-1 h-px",e),...t})}function r0({className:e,...t}){return r("span",{"data-slot":"menubar-shortcut",className:s("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}function a0({...e}){return r(radixUi.Menubar.Sub,{"data-slot":"menubar-sub",...e})}function o0({className:e,inset:t,children:a,...o}){return u(radixUi.Menubar.SubTrigger,{"data-slot":"menubar-sub-trigger","data-inset":t,className:s("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:[a,r(lucideReact.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]})}function n0({className:e,...t}){return r(radixUi.Menubar.SubContent,{"data-slot":"menubar-sub-content",className:s("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 ap="relative isolate overflow-hidden rounded-md bg-muted text-transparent",op="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-['']",ha=X__namespace.forwardRef(({className:e,...t},a)=>r("div",{ref:a,"data-slot":"skeleton",className:s(ap,op,e),...t}));ha.displayName="Skeleton";var Ki=X__namespace.forwardRef(({className:e,...t},a)=>r(ha,{ref:a,className:s("h-9 w-32 rounded-md",e),...t}));Ki.displayName="Skeleton.Button";var Xi=X__namespace.forwardRef(({className:e,...t},a)=>r(ha,{ref:a,className:s("h-9 w-full rounded-md",e),...t}));Xi.displayName="Skeleton.Input";var Ct=Object.assign(ha,{Button:Ki,Input:Xi});var ip={sm:"sm:max-w-sm",md:"sm:max-w-lg",lg:"sm:max-w-2xl",xl:"sm:max-w-3xl"},sp=u("div",{className:"space-y-3","aria-hidden":true,children:[r(Ct,{className:"h-4 w-2/3"}),r(Ct,{className:"h-4 w-full"}),r(Ct,{className:"h-4 w-5/6"}),r(Ct,{className:"h-4 w-3/4"})]}),lp=e=>{switch(e){case "destructive":return "destructive";case "default":return "outline";case "primary":default:return "default"}},cp=({title:e,description:t,closable:a=true,className:o,classNames:n,loading:i=false,maskClosable:c=false,style:d,footer:l,onOk:f,onCancel:m,children:R,onOpenChange:k,size:g="md",...v})=>{var L,S,C,P,F,H,W;let p={show:(L=l==null?void 0:l.show)!=null?L:true,render:l==null?void 0:l.render,onOk:l==null?void 0:l.onOk,onCancel:l==null?void 0:l.onCancel,showOk:(S=l==null?void 0:l.showOk)!=null?S:true,showCancel:(C=l==null?void 0:l.showCancel)!=null?C:true,okText:(P=l==null?void 0:l.okText)!=null?P:"Save changes",cancelText:(F=l==null?void 0:l.cancelText)!=null?F:"Cancel",okLoading:l==null?void 0:l.okLoading,cancelLoading:l==null?void 0:l.cancelLoading,okDisabled:l==null?void 0:l.okDisabled,cancelDisabled:(H=l==null?void 0:l.cancelDisabled)!=null?H:l==null?void 0:l.cancelDisable,okType:l==null?void 0:l.okType,okButtonProps:l==null?void 0:l.okButtonProps,cancelButtonProps:l==null?void 0:l.cancelButtonProps,size:(W=l==null?void 0:l.size)!=null?W:"default"},b=X__namespace.useCallback(()=>{var D;(D=p.onCancel)==null||D.call(p),m==null||m();},[p.onCancel,m]),w=X__namespace.useCallback(()=>{var D;(D=p.onOk)==null||D.call(p),f==null||f();},[p.onOk,f]),x=X__namespace.useCallback(D=>{D||b(),k==null||k(D);},[b,k]),T=X__namespace.useCallback(D=>{c||D.preventDefault();},[c]),y=X__namespace.useCallback(D=>{a||D.preventDefault();},[a]),N=s(ip[g],o,n==null?void 0:n.content),h=r(framerMotion.AnimatePresence,{mode:"wait",children:i?r(framerMotion.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.18,ease:"easeInOut"},className:s("space-y-4",n==null?void 0:n.body),children:sp},"modal-loading"):r(framerMotion.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.18,ease:"easeInOut"},className:s("space-y-3 text-sm text-muted-foreground",n==null?void 0:n.body),"aria-busy":i,children:R},"modal-content")}),E=()=>{var le,ne,fe,ge,$,ie,pe,he,ke,ae;if(!p.show)return null;if(p.render)return r("div",{className:s("mt-2",n==null?void 0:n.footer),children:p.render});if(!p.showOk&&!p.showCancel)return null;let{onClick:D,variant:_,size:O,loading:M,disabled:U,...V}=(le=p.okButtonProps)!=null?le:{},{onClick:B,variant:G,size:j,loading:q,disabled:z,...te}=(ne=p.cancelButtonProps)!=null?ne:{},K=re=>{D==null||D(re),!re.defaultPrevented&&w();},ce=re=>{B==null||B(re),!re.defaultPrevented&&b();};return r("div",{className:s("mt-4",n==null?void 0:n.footer),children:u("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",children:[p.showCancel?r(Q,{variant:G!=null?G:"outline",size:j!=null?j:p.size,loading:(ge=(fe=p.cancelLoading)!=null?fe:q)!=null?ge:false,disabled:(ie=($=p.cancelDisabled)!=null?$:z)!=null?ie:false,...te,onClick:ce,children:p.cancelText}):null,p.showOk?r(Q,{variant:_!=null?_:lp(p.okType),size:O!=null?O:p.size,loading:(he=(pe=p.okLoading)!=null?pe:M)!=null?he:false,disabled:(ae=(ke=p.okDisabled)!=null?ke:U)!=null?ae:false,...V,onClick:K,children:p.okText}):null]})})};return r(Wr,{...v,onOpenChange:x,children:r($r,{showCloseButton:a,className:N,style:d,onInteractOutside:T,onEscapeKeyDown:y,children:u(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)&&u(Yr,{className:n==null?void 0:n.header,children:[e?r(Kr,{className:n==null?void 0:n.title,children:e}):null,t?r(Xr,{className:n==null?void 0:n.description,children:t}):null]}),h,E()]})})})};cp.displayName="Modal";function Ot({open:e,onOpenChange:t,title:a,children:o,footer:n,footerClassName:i,contentClassName:c,disableContentWrapper:d=false,options:l,selectedValues:f,onSelect:m,isMulti:R=false}){let k=b=>{m==null||m(b),R||t(false);},g=b=>R&&Array.isArray(f)?f.includes(b):f===b,v=()=>l?r("div",{className:"max-h-[75vh] overflow-y-auto",children:l.map(b=>u("button",{className:s("w-full flex items-center justify-between px-4 py-4 text-left transition-colors","min-h-[50px] h-auto",b.disabled?"opacity-50 cursor-not-allowed":"hover:bg-accent active:bg-accent/80",g(b.value)&&"bg-accent"),onClick:()=>!b.disabled&&k(b.value),disabled:b.disabled,children:[r("span",{className:"flex-1",children:b.label}),g(b.value)&&r(lucideReact.CheckIcon,{className:"h-4 w-4 text-primary flex-shrink-0 ml-2"})]},b.value))}):null,p=d?o:r("div",{className:s(c),children:o});return r(er,{open:e,onOpenChange:t,direction:"bottom",children:u(tr,{className:"p-0 pb-4 rounded-t-2xl border-t bg-background",children:[a?r(rr,{className:"px-4 pb-2 pt-4 text-left border-b",children:typeof a=="string"||typeof a=="number"?r(ar,{children:a}):a}):null,l?v():p,n?r(Oi,{className:s("border-border/60 border-t px-4 pt-3",i),children:n}):null]})})}var up={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."}},C0=Object.keys(up),pp=()=>{},ko=X__namespace.forwardRef(({items:e,value:t,defaultValue:a,onChange:o=pp,className:n,variant:i="floating",forceLabels:c=false,...d},l)=>{let[f,m]=X__namespace.useState(()=>{var C,P;return t!==void 0?t:a||((P=(C=e[0])==null?void 0:C.value)!=null?P:"")}),R=t!==void 0,k=R?t:f;X__namespace.useEffect(()=>{var P;if(!e.length)return;if(!e.some(F=>F.value===k)){let F=(P=e[0])==null?void 0:P.value;if(!F)return;R||m(F),o(F);}},[e,k,R,o]);let g=X__namespace.useCallback(C=>{C!==k&&(R||m(C),o(C));},[R,o,k]);if(!e.length)return null;let v=Math.max(e.findIndex(C=>C.value===k),0),p=100/e.length,b=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]),x=X__namespace.useMemo(()=>({width:`calc((100% / ${e.length}) * 0.6)`,left:`calc((100% / ${e.length}) * ${v} + (100% / ${e.length}) * 0.2)`}),[v,e.length]),T=X__namespace.useMemo(()=>{let P=p/2;return {width:64,height:64,left:`calc(${p}% * ${v} + ${P}%)`}},[v,p]),y=()=>{switch(i){case "floating":return r("span",{"aria-hidden":true,style:b,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 r("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 r("span",{"aria-hidden":true,style:x,className:"pointer-events-none absolute bottom-1 left-0 h-1 rounded-full bg-primary transition-[left] duration-500 ease-out"});case "curved":return r("span",{"aria-hidden":true,style:T,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}},N=C=>{switch(i){case "floating":return s("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 s("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 s("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 s("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 ""}},h=C=>{switch(i){case "floating":return s("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 s("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 s("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 s("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 ""}},E=C=>{let P="transition-all duration-300 ease-out";switch(i){case "floating":return s(P,C?"translate-y-0 opacity-100":"translate-y-[2px] opacity-90",c?"block":"");case "pill":return s(P,"text-xs",C?"opacity-100":"opacity-90");case "minimal":return s(P,"text-xs",C||c?"opacity-100":"opacity-0");case "curved":return s(P,"text-xs",C||c?"opacity-100":"opacity-0 group-hover:opacity-80");default:return P}},L=(C,P)=>C?r("span",{className:s("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:C}):null,S=()=>{switch(i){case "floating":return u("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:[y(),e.map(C=>{let P=C.value===k;return u("button",{type:"button",className:N(P),onClick:()=>g(C.value),"data-active":P?"true":void 0,"aria-pressed":P,"aria-current":P?"page":void 0,"aria-label":C.label,children:[u("span",{className:"relative",children:[r("span",{className:h(P),children:C.icon}),L(C.badge,P)]}),(P||c)&&C.label?r("span",{className:E(P),children:C.label}):C.label&&!c?r("span",{className:s(E(P),"sr-only"),children:C.label}):null]},C.value)})]});case "pill":return u("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:[y(),e.map(C=>{let P=C.value===k;return u("button",{type:"button",className:N(P),onClick:()=>g(C.value),"data-active":P?"true":void 0,"aria-pressed":P,"aria-current":P?"page":void 0,"aria-label":C.label,children:[u("span",{className:"relative flex items-center gap-2",children:[r("span",{className:h(P),children:C.icon}),(P||c)&&C.label?r("span",{className:E(P),children:C.label}):null]}),L(C.badge,P)]},C.value)})]});case "minimal":return u("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:[y(),e.map(C=>{let P=C.value===k;return u("button",{type:"button",className:N(P),onClick:()=>g(C.value),"data-active":P?"true":void 0,"aria-pressed":P,"aria-current":P?"page":void 0,"aria-label":C.label,children:[u("span",{className:"relative",children:[r("span",{className:h(P),children:C.icon}),L(C.badge,P)]}),(P||c)&&C.label?r("span",{className:E(P),children:C.label}):null]},C.value)})]});case "curved":return u("div",{className:"relative isolate flex h-28 w-full items-end justify-center",children:[r("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)]"}),u("div",{className:"relative z-10 flex h-24 w-[92%] items-end justify-between px-5 pb-4 pt-6",children:[y(),e.map(C=>{let P=C.value===k;return u("button",{type:"button",className:N(P),onClick:()=>g(C.value),"data-active":P?"true":void 0,"aria-pressed":P,"aria-current":P?"page":void 0,"aria-label":C.label,children:[u("span",{className:"relative",children:[r("span",{className:h(P),children:C.icon}),L(C.badge,P)]}),(P||c)&&C.label?r("span",{className:E(P),children:C.label}):null]},C.value)})]})]});default:return null}};return r("nav",{ref:l,className:s("relative flex w-full justify-center",n),...d,children:S()})});ko.displayName="MobileFooter";var mp={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."}},S0=Object.keys(mp),gp=()=>{},fp=()=>u("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:[r("circle",{cx:11,cy:11,r:7}),r("path",{d:"m20 20-3-3"})]}),Er=(e,t=false)=>e?r("span",{className:s("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,Ro=X__namespace.forwardRef(({title:e,subtitle:t,supportingText:a,heroBadge:o,heroMedia:n,heroImage:i,heroAlt:c,leadingAction:d,trailingActions:l,trailingContent:f,stories:m,searchPlaceholder:R,searchValue:k,defaultSearchValue:g,onSearchChange:v=gp,searchIcon:p,variant:b="hero",className:w,children:x,...T},y)=>{let[N,h]=X__namespace.useState(()=>g!=null?g:""),E=k!==void 0,L=E?k:N,S=X__namespace.useCallback(M=>{let U=M.target.value;E||h(U),v(U);},[E,v]),C=(M,U)=>{var V,B,G;return M?u("button",{type:"button",onClick:M.onClick,"aria-label":(B=(V=M.ariaLabel)!=null?V:M.label)!=null?B:M.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:[r("span",{className:"pointer-events-none text-lg",children:(G=M.icon)!=null?G:M.label}),Er(M.badge)]},M.value):U?r("span",{className:"size-10","aria-hidden":true},U):null},P=M=>{var U,V,B;return M?u("button",{type:"button",onClick:M.onClick,"aria-label":(V=(U=M.ariaLabel)!=null?U:M.label)!=null?V:M.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:[r("span",{className:"pointer-events-none text-lg",children:(B=M.icon)!=null?B:M.label}),Er(M.badge)]},M.value):null},F=M=>{var U,V,B;return M?u("button",{type:"button",onClick:M.onClick,"aria-label":(V=(U=M.ariaLabel)!=null?U:M.label)!=null?V:M.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:[r("span",{className:"pointer-events-none text-lg",children:(B=M.icon)!=null?B:M.label}),Er(M.badge)]},M.value):null},H=M=>{var U,V,B;return u("button",{type:"button",onClick:M.onClick,"aria-label":(V=(U=M.ariaLabel)!=null?U:M.label)!=null?V:M.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:[u("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=M.icon)!=null?B:M.label,Er(M.badge,true)]}),M.label?r("span",{className:"text-xs font-medium text-foreground transition-colors group-hover:text-primary",children:M.label}):null,M.description?r("span",{className:"text-[11px] text-muted-foreground transition-opacity group-hover:opacity-90",children:M.description}):null]},M.value)},W=()=>u("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:[r("div",{className:"pointer-events-none absolute inset-0 -z-10 bg-[radial-gradient(circle_at_top,_rgba(59,130,246,0.18),_transparent_55%)]"}),u("div",{className:"flex items-center justify-between",children:[C(d!=null?d:null,"hero-leading-placeholder"),r("div",{className:"flex items-center gap-2",children:l==null?void 0:l.map(M=>C(M))})]}),u("div",{className:"mt-7 flex items-end justify-between gap-6",children:[u("div",{className:"space-y-3",children:[o?r("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?r("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:e}):null,t?r("p",{className:"text-sm text-muted-foreground",children:t}):null,a?r("p",{className:"text-xs text-muted-foreground/90",children:a}):null]}),r("div",{className:"shrink-0",children:n?r("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?r("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("img",{src:i,alt:c!=null?c:"",className:"size-full object-cover"})}):null})]}),x?r("div",{className:"mt-6",children:x}):null]}),D=()=>{var M;return u("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:[u("div",{className:"flex items-center justify-between gap-3",children:[u("div",{className:"flex items-center gap-3",children:[d?u("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:[r("span",{className:"text-base",children:(M=d.icon)!=null?M:d.label}),d.label?r("span",{children:d.label}):null]}):null,e?r("h2",{className:"text-lg font-semibold text-foreground",children:e}):null]}),r("div",{className:"flex items-center gap-2",children:l==null?void 0:l.map(U=>F(U))})]}),t?r("p",{className:"mt-2 text-sm text-muted-foreground",children:t}):null,r("div",{className:"mt-4 flex gap-3 overflow-x-auto pb-1",children:m==null?void 0:m.map(U=>H(U))}),x?r("div",{className:"mt-4",children:x}):null]})},_=()=>u("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:[r("div",{className:"flex items-center",children:d?P(d):r("span",{className:"size-10","aria-hidden":true})}),u("div",{className:"flex flex-1 flex-col items-center justify-center text-center",children:[t?r("span",{className:"text-[11px] uppercase tracking-[0.18em] text-muted-foreground",children:t}):null,e?r("span",{className:"text-base font-semibold text-foreground",children:e}):null]}),r("div",{className:"flex items-center gap-2",children:f!=null?f:l==null?void 0:l.map(M=>P(M))})]}),O=()=>{var M,U,V;return u("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:[u("div",{className:"flex items-start justify-between gap-4",children:[u("div",{className:"space-y-1",children:[t?r("span",{className:"text-[11px] uppercase tracking-[0.18em] text-muted-foreground",children:t}):null,e?r("h2",{className:"text-lg font-semibold text-foreground",children:e}):null,a?r("p",{className:"text-xs text-muted-foreground/90",children:a}):null]}),r("div",{className:"flex items-center gap-2",children:l==null?void 0:l.map(B=>F(B))})]}),u("div",{className:"mt-4 flex items-center gap-3",children:[d?u("button",{type:"button",onClick:d.onClick,"aria-label":(U=(M=d.ariaLabel)!=null?M:d.label)!=null?U:d.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:[r("span",{className:"pointer-events-none text-lg",children:(V=d.icon)!=null?V:d.label}),Er(d.badge)]}):null,u("div",{className:"relative flex-1",children:[r("span",{className:"pointer-events-none absolute inset-y-0 left-3 flex items-center",children:p!=null?p:r(fp,{})}),r("input",{type:"search",value:L,onChange:S,placeholder:R,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"})]})]}),x?r("div",{className:"mt-4",children:x}):null]})};return r("header",{ref:y,className:s("relative flex w-full justify-center",w),...T,children:(()=>{switch(b){case "hero":return W();case "stories":return D();case "minimal":return _();case "search":return O();default:return null}})()})});Ro.displayName="MobileHeader";function Ji(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t);}function Qi(...e){return t=>{let a=false,o=e.map(n=>{let i=Ji(n,t);return !a&&typeof i=="function"&&(a=true),i});if(a)return ()=>{for(let n=0;n<o.length;n++){let i=o[n];typeof i=="function"?i():Ji(e[n],null);}}}}function bp(e){let t=hp(e),a=X__namespace.forwardRef((o,n)=>{let{children:i,...c}=o,d=X__namespace.Children.toArray(i),l=d.find(xp);if(l){let f=l.props.children,m=d.map(R=>R===l?X__namespace.Children.count(f)>1?X__namespace.Children.only(null):X__namespace.isValidElement(f)?f.props.children:null:R);return jsxRuntime.jsx(t,{...c,ref:n,children:X__namespace.isValidElement(f)?X__namespace.cloneElement(f,void 0,m):null})}return jsxRuntime.jsx(t,{...c,ref:n,children:i})});return a.displayName=`${e}.Slot`,a}var es=bp("Slot");function hp(e){let t=X__namespace.forwardRef((a,o)=>{let{children:n,...i}=a;if(X__namespace.isValidElement(n)){let c=kp(n),d=yp(i,n.props);return n.type!==X__namespace.Fragment&&(d.ref=o?Qi(o,c):c),X__namespace.cloneElement(n,d)}return X__namespace.Children.count(n)>1?X__namespace.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var wp=Symbol("radix.slottable");function xp(e){return X__namespace.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===wp}function yp(e,t){let a={...t};for(let o in t){let n=e[o],i=t[o];/^on[A-Z]/.test(o)?n&&i?a[o]=(...d)=>{let l=i(...d);return n(...d),l}:n&&(a[o]=n):o==="style"?a[o]={...n,...i}:o==="className"&&(a[o]=[n,i].filter(Boolean).join(" "));}return {...e,...a}}function kp(e){var o,n;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=(n=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:n.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var Rp=["top","right","bottom","left"],wa=(e,t)=>e.includes(t)?`env(safe-area-inset-${t})`:void 0,xa=X__namespace.forwardRef(({edges:e=Rp,asChild:t,className:a,style:o,...n},i)=>{var d,l,f,m;return r(t?es:"div",{ref:i,className:s("relative",a),style:{paddingTop:(d=o==null?void 0:o.paddingTop)!=null?d:wa(e,"top"),paddingRight:(l=o==null?void 0:o.paddingRight)!=null?l:wa(e,"right"),paddingBottom:(f=o==null?void 0:o.paddingBottom)!=null?f:wa(e,"bottom"),paddingLeft:(m=o==null?void 0:o.paddingLeft)!=null?m:wa(e,"left"),...o},...n})});xa.displayName="SafeArea";var Pp=({header:e,footer:t,children:a,className:o,safeArea:n})=>{var L,S,C,P,F;let{header:i,navigateBack:c,canGoBack:d}=si(),l=X__namespace.useMemo(()=>{let H=[];return n.top&&H.push("top"),n.left&&H.push("left"),n.right&&H.push("right"),H},[n.top,n.left,n.right]),f=X__namespace.useMemo(()=>{let H=[];return n.bottom&&H.push("bottom"),n.left&&H.push("left"),n.right&&H.push("right"),H},[n.bottom,n.left,n.right]),m=X__namespace.useCallback(()=>{if(d){c();return}typeof window!="undefined"&&window.history.back();},[d,c]),R=(L=i.back)!=null?L:d,k=X__namespace.useMemo(()=>{if(R)return {value:"mobile-header-back",icon:r(lucideReact.ArrowLeft,{className:"size-5","aria-hidden":true}),ariaLabel:"Go back",onClick:m};if(i.icon)return {value:"mobile-header-icon",icon:i.icon}},[R,i.icon,m]),{show:g=true,className:v,variant:p,type:b}=e,w=(P=(C=(S=i.variant)!=null?S:p)!=null?C:b)!=null?P:"hero",{show:x=true,activeKey:T,onChange:y,...N}=t,h=(F=N.value)!=null?F:T,E=X__namespace.useCallback(H=>{y==null||y(H);},[y]);return u("div",{className:s("flex min-h-svh w-full flex-col bg-background",o),children:[g&&r("div",{className:"sticky top-0 z-20 bg-background",children:r(xa,{edges:l,className:"bg-background",children:r(Ro,{variant:w,className:v,title:i.title,subtitle:i.subtitle,supportingText:i.supportingText,heroBadge:i.heroBadge,leadingAction:k,trailingContent:i.actions})})}),r("div",{className:"flex-1 overflow-y-auto bg-muted/10",children:a}),x&&r("div",{className:"sticky bottom-0 z-20 bg-background",children:r(xa,{edges:f,className:"bg-background px-4 pb-4 pt-2",children:r(ko,{...N,value:h,onChange:E})})})]})},Tp=({header:e={show:true},footer:t={show:true,items:[]},children:a,className:o,safeArea:n={top:true,bottom:true,left:true,right:true}})=>r(ii,{children:r(Pp,{header:e,footer:t,className:o,safeArea:n,children:a})});function ek({className:e,children:t,viewport:a=true,...o}){return u(radixUi.NavigationMenu.Root,{"data-slot":"navigation-menu","data-viewport":a,className:s("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",e),...o,children:[t,a&&r(Ep,{})]})}function tk({className:e,...t}){return r(radixUi.NavigationMenu.List,{"data-slot":"navigation-menu-list",className:s("group flex flex-1 list-none items-center justify-center gap-1",e),...t})}function rk({className:e,...t}){return r(radixUi.NavigationMenu.Item,{"data-slot":"navigation-menu-item",className:s("relative",e),...t})}var Mp=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 ak({className:e,children:t,...a}){return u(radixUi.NavigationMenu.Trigger,{"data-slot":"navigation-menu-trigger",className:s(Mp(),"group",e),...a,children:[t," ",r(lucideReact.ChevronDownIcon,{className:"relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180","aria-hidden":"true"})]})}function ok({className:e,...t}){return r(radixUi.NavigationMenu.Content,{"data-slot":"navigation-menu-content",className:s("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 Ep({className:e,...t}){return r("div",{className:s("absolute top-full left-0 isolate z-50 flex justify-center"),children:r(radixUi.NavigationMenu.Viewport,{"data-slot":"navigation-menu-viewport",className:s("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 nk({className:e,...t}){return r(radixUi.NavigationMenu.Link,{"data-slot":"navigation-menu-link",className:s("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 ik({className:e,...t}){return r(radixUi.NavigationMenu.Indicator,{"data-slot":"navigation-menu-indicator",className:s("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:r("div",{className:"bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md"})})}function mk({className:e,...t}){return r("nav",{role:"navigation","aria-label":"pagination","data-slot":"pagination",className:s("mx-auto flex w-full justify-center",e),...t})}function gk({className:e,...t}){return r("ul",{"data-slot":"pagination-content",className:s("flex flex-row items-center gap-1",e),...t})}function fk({...e}){return r("li",{"data-slot":"pagination-item",...e})}function rs({className:e,isActive:t,size:a="icon",...o}){return r("a",{"aria-current":t?"page":void 0,"data-slot":"pagination-link","data-active":t,className:s(mt({variant:t?"outline":"ghost",size:a}),e),...o})}function vk({className:e,...t}){return u(rs,{"aria-label":"Go to previous page",size:"default",className:s("gap-1 px-2.5 sm:pl-2.5",e),...t,children:[r(lucideReact.ChevronLeftIcon,{}),r("span",{className:"hidden sm:block",children:"Previous"})]})}function bk({className:e,...t}){return u(rs,{"aria-label":"Go to next page",size:"default",className:s("gap-1 px-2.5 sm:pr-2.5",e),...t,children:[r("span",{className:"hidden sm:block",children:"Next"}),r(lucideReact.ChevronRightIcon,{})]})}function hk({className:e,...t}){return u("span",{"aria-hidden":true,"data-slot":"pagination-ellipsis",className:s("flex size-9 items-center justify-center",e),...t,children:[r(lucideReact.MoreHorizontalIcon,{className:"size-4"}),r("span",{className:"sr-only",children:"More pages"})]})}function Rk({className:e,value:t,...a}){return r(radixUi.Progress.Root,{"data-slot":"progress",className:s("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",e),...a,children:r(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 r(radixUi.RadioGroup.Root,{"data-slot":"radio-group",className:s("grid gap-3",e),...t})}function ns({className:e,...t}){return r(radixUi.RadioGroup.Item,{"data-slot":"radio-group-item",className:s("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:r(radixUi.RadioGroup.Indicator,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:r(lucideReact.CircleIcon,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function Ik({className:e,...t}){return r(ir__namespace.PanelGroup,{"data-slot":"resizable-panel-group",className:s("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t})}function _k({...e}){return r(ir__namespace.Panel,{"data-slot":"resizable-panel",...e})}function zk({withHandle:e,className:t,...a}){return r(ir__namespace.PanelResizeHandle,{"data-slot":"resizable-handle",className:s("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),...a,children:e&&r("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:r(lucideReact.GripVerticalIcon,{className:"size-2.5"})})})}function Bk({className:e,children:t,...a}){return u(radixUi.ScrollArea.Root,{"data-slot":"scroll-area",className:s("relative",e),...a,children:[r(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}),r(Fp,{}),r(radixUi.ScrollArea.Corner,{})]})}function Fp({className:e,orientation:t="vertical",...a}){return r(radixUi.ScrollArea.ScrollAreaScrollbar,{"data-slot":"scroll-area-scrollbar",orientation:t,className:s("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),...a,children:r(radixUi.ScrollArea.ScrollAreaThumb,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}var ss=X__namespace.createContext(void 0);function Po(){let e=X__namespace.useContext(ss);if(!e)throw new Error("useNativeSelectContext must be used within a Select component");return e}function Ap({open:e,defaultOpen:t,onOpenChange:a,children:o,...n}){let{isNative:i}=bt(),c=Ye(),d=i||c,[l,f]=X__namespace.useState(t!=null?t:false),m=e!=null?e:l,R=X__namespace.useCallback(g=>{e===void 0&&f(g),a==null||a(g);},[e,a]),k=X__namespace.useMemo(()=>({isNative:d,open:m,setOpen:R,closeOnSelect:true}),[d,m,R]);return r(ss.Provider,{value:k,children:r(radixUi.Select.Root,{"data-slot":"select",open:m,onOpenChange:R,...n,children:o})})}function Bp({className:e,size:t="default",children:a,...o}){let{isNative:n,open:i,setOpen:c}=Po();return u(radixUi.Select.Trigger,{"data-slot":"select-trigger","data-size":t,onClick:d=>{n&&(d.preventDefault(),d.stopPropagation(),c(!i));},className:s(ot,"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:[r("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:a}),r(radixUi.Select.Icon,{className:"pointer-events-none shrink-0 text-muted-foreground",children:r(lucideReact.ChevronDownIcon,{className:"size-4"})})]})}function Vp({className:e,children:t,position:a="popper",title:o,...n}){let i=Po();return r(radixUi.Select.Portal,{children:r(radixUi.Select.Content,{"data-slot":"select-content",className:s(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:a,...n,children:i.isNative?r(Ot,{open:i.open,onOpenChange:i.setOpen,title:o,disableContentWrapper:true,children:r(radixUi.Select.Viewport,{className:"max-h-[75vh] overflow-y-auto",children:t})}):u(jsxRuntime.Fragment,{children:[r(Up,{}),r(radixUi.Select.Viewport,{className:"p-1",children:t}),r(qp,{})]})})})}function jp({className:e,children:t,onSelect:a,...o}){let n=Po(),i=X__namespace.useCallback(c=>{a==null||a(c),n.isNative&&n.closeOnSelect&&!c.defaultPrevented&&setTimeout(()=>{n.setOpen(false);});},[n,a]);return u(radixUi.Select.Item,{"data-slot":"select-item",onSelect:i,className:s("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:[r("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:r(radixUi.Select.ItemIndicator,{children:r(lucideReact.CheckIcon,{className:"size-4"})})}),r(radixUi.Select.ItemText,{children:t})]})}function Up({className:e,...t}){return r(radixUi.Select.ScrollUpButton,{className:s("flex items-center justify-center py-1",e),...t,children:r(lucideReact.ChevronUpIcon,{className:"size-4"})})}function qp({className:e,...t}){return r(radixUi.Select.ScrollDownButton,{className:s("flex items-center justify-center py-1",e),...t,children:r(lucideReact.ChevronDownIcon,{className:"size-4"})})}function Gp({className:e,...t}){return r(radixUi.Select.Value,{"data-slot":"select-value",className:s("flex-1 min-w-0 truncate text-left data-[placeholder]:text-muted-foreground",e),...t})}function ya({options:e,placeholder:t="Select an option",triggerProps:a,contentProps:o,...n}){let i=a!=null?a:{},c=o!=null?o:{};return u(Ap,{...n,children:[r(Bp,{...i,children:r(Gp,{placeholder:t})}),r(Vp,{...c,children:e.map(d=>{var l,f;return r(jp,{value:d.value,disabled:d.disabled,className:d.className,children:(f=d.label)!=null?f:d.value},(l=d.key)!=null?l:d.value)})})]})}var To=()=>{},ls=X__namespace.createContext({isNative:false,selectedValues:[],setSelectedValues:To,toggleValue:To,isSelected:()=>false,open:false,setOpen:To});function ka(){return X__namespace.useContext(ls)}function cs({value:e,defaultValue:t=[],onValueChange:a,open:o,defaultOpen:n,onOpenChange:i,children:c}){let{isNative:d}=bt(),l=Ye(),f=d||l,[m,R]=X__namespace.useState(t),[k,g]=X__namespace.useState(n!=null?n:false);X__namespace.useEffect(()=>{e!==void 0&&R(e);},[e]),X__namespace.useEffect(()=>{o!==void 0&&g(o);},[o]);let v=e!=null?e:m,p=o!=null?o:k,b=X__namespace.useCallback(h=>{let E=typeof h=="function"?h(v):h;e===void 0&&R(E),a==null||a(E);},[a,v,e]),w=X__namespace.useCallback(h=>{b(E=>E.includes(h)?E.filter(L=>L!==h):[...E,h]);},[b]),x=X__namespace.useCallback(h=>v.includes(h),[v]),T=X__namespace.useCallback(h=>{o===void 0&&g(h),i==null||i(h);},[i,o]),y=X__namespace.useMemo(()=>({isNative:f,selectedValues:v,setSelectedValues:b,toggleValue:w,isSelected:x,open:p,setOpen:T}),[f,p,T,v,b,w,x]),N=f?c:r(Qt,{open:p,onOpenChange:T,children:c});return r(ls.Provider,{value:y,children:N})}function ds({className:e,children:t,disabled:a,onClick:o,...n}){let i=ka(),c=X__namespace.useCallback(l=>{o==null||o(l),i.isNative&&!a&&i.setOpen(!i.open);},[i,a,o]),d=u("button",{type:"button","data-slot":"multi-select-trigger","data-state":i.open?"open":"closed",className:s(ot,"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:a,onClick:c,...n,children:[r("span",{className:"flex-1 min-w-0 text-left",children:t}),r(lucideReact.ChevronDownIcon,{className:"pointer-events-none absolute right-3 top-1/2 size-4 -translate-y-1/2 opacity-50"})]});return i.isNative?d:r(Hi,{asChild:true,children:d})}function us({placeholder:e="Select options",className:t,separator:a=", ",formatValue:o}){let{selectedValues:n,isNative:i}=ka(),c=X__namespace.useMemo(()=>o?o(n):n.length===0?e:i?n.map(d=>r(vn,{variant:"secondary",children:d},d)):n.join(a),[o,i,e,n,a]);return r("span",{"data-slot":"multi-select-value",className:s("flex min-h-4 flex-wrap items-center gap-1 text-sm",n.length===0&&"text-muted-foreground",t),children:c})}function ps({className:e,title:t,children:a,commandClassName:o,showSearch:n=false,searchPlaceholder:i="Search...",emptyMessage:c="No options found.",sideOffset:d=4,align:l="start",...f}){let m=ka(),R=u(Ka,{className:s("w-full",o),children:[n?r($n,{placeholder:i}):null,u(Yn,{children:[c!==null?r(Kn,{children:c}):null,a]})]});return m.isNative?r(Ot,{open:m.open,onOpenChange:m.setOpen,title:t,contentClassName:s("px-2 pb-2",e),footer:r(Q,{type:"button",variant:"outline",onClick:()=>m.setOpen(false),children:"Close"}),children:R}):r(Zt,{"data-slot":"multi-select-content",className:s("w-64 p-0",e),sideOffset:d,align:l,...f,children:R})}function ms({value:e,children:t,className:a,disabled:o,...n}){let i=ka(),c=i.isSelected(e);return u(Xn,{...n,value:e,onSelect:()=>{o||i.toggleValue(e);},"data-slot":"multi-select-item",disabled:o,className:s("gap-2",a),children:[r("span",{className:"flex size-4 items-center justify-center",children:r(lucideReact.CheckIcon,{className:s("size-4",c?"opacity-100":"opacity-0")})}),r("span",{children:t})]})}function gs({className:e,orientation:t="horizontal",decorative:a=true,...o}){return r(radixUi.Separator.Root,{"data-slot":"separator",decorative:a,orientation:t,className:s("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 fs({...e}){return r(radixUi.Dialog.Root,{"data-slot":"sheet",...e})}function fR({...e}){return r(radixUi.Dialog.Trigger,{"data-slot":"sheet-trigger",...e})}function vR({...e}){return r(radixUi.Dialog.Close,{"data-slot":"sheet-close",...e})}function Xp({...e}){return r(radixUi.Dialog.Portal,{"data-slot":"sheet-portal",...e})}function Jp({className:e,...t}){return r(radixUi.Dialog.Overlay,{"data-slot":"sheet-overlay",className:s("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 vs({className:e,children:t,side:a="right",...o}){return u(Xp,{children:[r(Jp,{}),u(radixUi.Dialog.Content,{"data-slot":"sheet-content",className:s("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",a==="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",a==="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",a==="top"&&"inset-x-0 top-0 h-auto border-b data-[state=closed]:-translate-y-full data-[state=open]:translate-y-0",a==="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,u(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:[r(lucideReact.XIcon,{className:"size-4"}),r("span",{className:"sr-only",children:"Close"})]})]})]})}function bs({className:e,...t}){return r("div",{"data-slot":"sheet-header",className:s("flex flex-col gap-1.5 p-4",e),...t})}function bR({className:e,...t}){return r("div",{"data-slot":"sheet-footer",className:s("mt-auto flex flex-col gap-2 p-4",e),...t})}function hs({className:e,...t}){return r(radixUi.Dialog.Title,{"data-slot":"sheet-title",className:s("text-foreground font-semibold",e),...t})}function ws({className:e,...t}){return r(radixUi.Dialog.Description,{"data-slot":"sheet-description",className:s("text-muted-foreground text-sm",e),...t})}function ao({delayDuration:e=0,...t}){return r(radixUi.Tooltip.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function xs({...e}){return r(ao,{children:r(radixUi.Tooltip.Root,{"data-slot":"tooltip",...e})})}function ys({...e}){return r(radixUi.Tooltip.Trigger,{"data-slot":"tooltip-trigger",...e})}function ks({className:e,sideOffset:t=0,children:a,...o}){return r(radixUi.Tooltip.Portal,{children:u(radixUi.Tooltip.Content,{"data-slot":"tooltip-content",sideOffset:t,className:s("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:[a,r(radixUi.Tooltip.Arrow,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}var em="sidebar_state",tm=3600*24*7,rm="16rem",am="18rem",om="3rem",nm="b",Rs=X__namespace.createContext(null);function Ir(){let e=X__namespace.useContext(Rs);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function Pi({defaultOpen:e=true,open:t,onOpenChange:a,className:o,style:n,children:i,...c}){let d=Ye(),[l,f]=X__namespace.useState(false),[m,R]=X__namespace.useState(e),k=t!=null?t:m,g=X__namespace.useCallback(w=>{let x=typeof w=="function"?w(k):w;a?a(x):R(x),document.cookie=`${em}=${x}; path=/; max-age=${tm}`;},[a,k]),v=X__namespace.useCallback(()=>d?f(w=>!w):g(w=>!w),[d,g,f]);X__namespace.useEffect(()=>{let w=x=>{x.key===nm&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),v());};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[v]);let p=k?"expanded":"collapsed",b=X__namespace.useMemo(()=>({state:p,open:k,setOpen:g,isMobile:d,openMobile:l,setOpenMobile:f,toggleSidebar:v}),[p,k,g,d,l,f,v]);return r(Rs.Provider,{value:b,children:r("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":rm,"--sidebar-width-icon":om,...n},className:s("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",o),...c,children:i})})}function Ti({side:e="left",variant:t="sidebar",collapsible:a="icon",className:o,children:n,...i}){let{isMobile:c,state:d,openMobile:l,setOpenMobile:f}=Ir();return a==="none"?r("div",{"data-slot":"sidebar",className:s("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",o),...i,children:n}):c?r(fs,{open:l,onOpenChange:f,...i,children:u(vs,{"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":am},side:e,children:[u(bs,{className:"sr-only",children:[r(hs,{children:"Sidebar"}),r(ws,{children:"Displays the mobile sidebar."})]}),r("div",{className:"flex h-full w-full flex-col",children:n})]})}):u("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":d,"data-collapsible":d==="collapsed"?a:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[r("div",{"data-slot":"sidebar-gap",className:s("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)")}),r("div",{"data-slot":"sidebar-container",className:s("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:r("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 FR({className:e,onClick:t,...a}){let{toggleSidebar:o}=Ir();return u(Q,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:s("size-7",e),onClick:n=>{t==null||t(n),o();},...a,children:[r(lucideReact.PanelLeftIcon,{}),r("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function HR({className:e,...t}){let{toggleSidebar:a}=Ir();return r("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:a,title:"Toggle Sidebar",className:s("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 Ni({className:e,...t}){return r("main",{"data-slot":"sidebar-inset",className:s("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 OR({className:e,...t}){return r(Ge,{"data-slot":"sidebar-input","data-sidebar":"input",className:s("bg-background h-8 w-full shadow-none",e),...t})}function Si({className:e,sticky:t=false,...a}){return r("div",{"data-slot":"sidebar-header","data-sidebar":"header","data-sticky":t?"true":void 0,className:s("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),...a})}function Mi({className:e,...t}){return r("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:s("flex flex-col gap-2 p-2",e),...t})}function AR({className:e,...t}){return r(gs,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:s("bg-sidebar-border mx-2 w-auto",e),...t})}function Ei({className:e,...t}){return r("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:s("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function BR({className:e,...t}){return r("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:s("relative flex w-full min-w-0 flex-col p-2",e),...t})}function VR({className:e,asChild:t=false,...a}){let o=t?radixUi.Slot.Slot:"div";return r(o,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:s("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),...a})}function jR({className:e,asChild:t=false,...a}){let o=t?radixUi.Slot.Slot:"button";return r(o,{"data-slot":"sidebar-group-action","data-sidebar":"group-action",className:s("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),...a})}function UR({className:e,...t}){return r("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:s("w-full text-sm",e),...t})}function Di({className:e,...t}){return r("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:s("flex w-full min-w-0 flex-col gap-1",e),...t})}function Li({className:e,...t}){return r("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:s("group/menu-item relative",e),...t})}var im=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 Ii({asChild:e=false,isActive:t=false,variant:a="default",size:o="default",tooltip:n,className:i,onClick:c,...d}){let l=e?radixUi.Slot.Slot:"button",{isMobile:f,setOpenMobile:m,state:R}=Ir(),k=X__namespace.useCallback(v=>{c&&c(v),!v.defaultPrevented&&f&&m(false);},[f,c,m]),g=r(l,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":o,"data-active":t,className:s(im({variant:a,size:o}),i),onClick:k,...d});return n?(typeof n=="string"&&(n={children:n}),u(xs,{children:[r(ys,{asChild:true,children:g}),r(ks,{side:"right",align:"center",hidden:R!=="collapsed"||f,...n})]})):g}function qR({className:e,asChild:t=false,showOnHover:a=false,...o}){let n=t?radixUi.Slot.Slot:"button";return r(n,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:s("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",a&&"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 GR({className:e,...t}){return r("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:s("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 WR({className:e,showIcon:t=false,...a}){let o=X__namespace.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return u("div",{"data-slot":"sidebar-menu-skeleton","data-sidebar":"menu-skeleton",className:s("flex h-8 items-center gap-2 rounded-md px-2",e),...a,children:[t&&r(Ct,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),r(Ct,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":o}})]})}function $R({className:e,...t}){return r("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:s("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 YR({className:e,...t}){return r("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:s("group/menu-sub-item relative",e),...t})}function KR({asChild:e=false,size:t="md",isActive:a=false,className:o,onClick:n,...i}){let c=e?radixUi.Slot.Slot:"a",{isMobile:d,setOpenMobile:l}=Ir(),f=X__namespace.useCallback(m=>{n&&n(m),!m.defaultPrevented&&d&&l(false);},[d,n,l]);return r(c,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":t,"data-active":a,className:s("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:f,...i})}function eC({className:e,defaultValue:t,value:a,min:o=0,max:n=100,...i}){let c=X__namespace.useMemo(()=>Array.isArray(a)?a:Array.isArray(t)?t:[o,n],[a,t,o,n]);return u(radixUi.Slider.Root,{"data-slot":"slider",defaultValue:t,value:a,min:o,max:n,className:s("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:[r(radixUi.Slider.Track,{"data-slot":"slider-track",className:s("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:r(radixUi.Slider.Range,{"data-slot":"slider-range",className:s("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:c.length},(d,l)=>r(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"},l))]})}var oC=({...e})=>r(sonner.Toaster,{theme:"dark",className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},...e});function Ts({className:e,...t}){return r(radixUi.Switch.Root,{"data-slot":"switch",className:s("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:r(radixUi.Switch.Thumb,{"data-slot":"switch-thumb",className:s("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 Ns({className:e,...t}){return r("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto overflow-y-visible",children:r("table",{"data-slot":"table",className:s("w-full caption-bottom text-sm",e),...t})})}function Ss({className:e,...t}){return r("thead",{"data-slot":"table-header",className:s("[&_tr]:border-b",e),...t})}function Ms({className:e,...t}){return r("tbody",{"data-slot":"table-body",className:s("[&_tr:last-child]:border-0",e),...t})}function pC({className:e,...t}){return r("tfoot",{"data-slot":"table-footer",className:s("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t})}function Tt({className:e,...t}){return r("tr",{"data-slot":"table-row",className:s("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function Es({className:e,...t}){return r("th",{"data-slot":"table-head",className:s("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 Bt({className:e,...t}){return r("td",{"data-slot":"table-cell",className:s("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function mC({className:e,...t}){return r("caption",{"data-slot":"table-caption",className:s("text-muted-foreground mt-4 text-sm",e),...t})}var Ds=X__namespace.createContext(null),No=e=>{let t=X__namespace.useContext(Ds);if(!t)throw new Error(`${e} must be used within <Tabs>`);return t},Ls=X__namespace.createContext("default"),So=e=>{let t=X__namespace.useContext(Ls);return e!=null?e:t},lm={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"},cm="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",dm={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"},um={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"},pm=new Set(["default","solid","segmented","boxed"]),mm={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"},gm="pointer-events-none absolute left-0 top-0 z-0 transition-all duration-300 ease-out will-change-transform",Is=(...e)=>t=>{e.forEach(a=>{if(typeof a=="function")a(t);else if(a!=null){let o=a;o.current=t;}});},_s=X__namespace.forwardRef(({className:e,value:t,defaultValue:a,onValueChange:o,activationMode:n="automatic",variant:i="default",orientation:c="horizontal",items:d,listClassName:l,triggerClassName:f,contentClassName:m,renderList:R,...k},g)=>{var W;let v=X__namespace.useId(),p=t!==void 0,[b,w]=X__namespace.useState(()=>a!=null?a:null),x=(W=p?t:b)!=null?W:null,T=X__namespace.useRef(new Map),y=X__namespace.useCallback(D=>{p||w(D),o==null||o(D);},[p,o]),N=X__namespace.useCallback((D,_)=>{if(_){let O=T.current.size===0;T.current.set(D,_),!p&&x==null&&a==null&&O&&w(D);}else T.current.delete(D);},[a,p,w,x]),h=X__namespace.useCallback(D=>{var _;return D&&(_=T.current.get(D))!=null?_:null},[]),E=X__namespace.useCallback(D=>{let _=Array.from(T.current.keys());if(!_.length)return;let O=(D%_.length+_.length)%_.length,M=_[O],U=T.current.get(M);U==null||U.focus(),n!=="manual"&&y(M);},[n,y]),L=X__namespace.useCallback((D,_)=>{let M=Array.from(T.current.keys()).indexOf(D);M!==-1&&E(M+_);},[E]),S=X__namespace.useCallback(D=>{let _=Array.from(T.current.keys());_.length&&E(D==="first"?0:_.length-1);},[E]),[C,P]=X__namespace.useState(c),F=X__namespace.useCallback(D=>{P(D);},[]);X__namespace.useEffect(()=>{P(c);},[c]),X__namespace.useEffect(()=>{!p&&x==null&&a&&w(a);},[a,p,w,x]);let H=X__namespace.useMemo(()=>({id:v,value:x,setValue:y,activationMode:n,registerTrigger:N,getTriggerNode:h,focusNextTrigger:L,focusEdgeTrigger:S,orientation:C,setOrientation:F}),[v,x,y,n,N,L,S,C,F]);return r(Ls.Provider,{value:i,children:r(Ds.Provider,{value:H,children:u("div",{ref:g,className:s("flex flex-col gap-2",e),...k,children:[(R!=null?R:(D=>D))(r(zs,{className:l,variant:i,orientation:c,children:d.map(D=>{let{triggerProps:_,contentProps:O,...M}=D,{className:U,...V}=_!=null?_:{};return r(Fs,{value:M.key,disabled:M.disabled,className:s(f,M.triggerClassName,U),variant:i,...V,children:M.label},M.key)})})),d.map(D=>{let{triggerProps:_,contentProps:O,...M}=D,{className:U,...V}=O!=null?O:{};return r(Hs,{value:M.key,variant:i,className:s(m,M.contentClassName,U),...V,children:M.children},M.key)})]})})})});_s.displayName="Tabs";var zs=X__namespace.forwardRef(({className:e,variant:t,orientation:a="horizontal",...o},n)=>{let{value:i,setOrientation:c,getTriggerNode:d}=No("TabsList"),l=So(t),f=mm[l],m=X__namespace.useRef(null),[R,k]=X__namespace.useState(null),g=pm.has(l),[v,p]=X__namespace.useState(false),[b,w]=X__namespace.useState(false),x=X__namespace.useCallback(N=>{if(a!=="horizontal")return;let h=m.current;if(!h||!N)return;let E=d(N);if(!E)return;let L=32,S=h.scrollLeft,C=S+h.clientWidth,P=E.offsetLeft,F=P+E.offsetWidth;if(P<S){let H=Math.max(0,P-L);typeof h.scrollTo=="function"?h.scrollTo({left:H,behavior:"smooth"}):h.scrollLeft=H;}else if(F>C){let H=Math.max(0,h.scrollWidth-h.clientWidth),W=Math.min(H,F-h.clientWidth+L);typeof h.scrollTo=="function"?h.scrollTo({left:W,behavior:"smooth"}):h.scrollLeft=W;}},[d,a]),T=X__namespace.useCallback(()=>{if(!g){k(null);return}let N=m.current,h=d(i);if(!N||!h){k(null);return}let E=h.offsetWidth,L=h.offsetHeight,S=h.offsetLeft,C=h.offsetTop,P=h.offsetParent;for(;P&&P!==N;)S+=P.offsetLeft-P.scrollLeft,C+=P.offsetTop-P.scrollTop,P=P.offsetParent;if(P!==N){let F=h.getBoundingClientRect(),H=N.getBoundingClientRect();S=F.left-H.left+N.scrollLeft,C=F.top-H.top+N.scrollTop;}k({width:E,height:L,transform:`translate3d(${S}px, ${C}px, 0)`});},[i,d,g]);X__namespace.useEffect(()=>{c(a);},[a,c]),X__namespace.useLayoutEffect(()=>{T();},[T]),X__namespace.useEffect(()=>{if(a!=="horizontal"){p(false),w(false);return}let N=m.current;if(!N)return;let h=()=>{let{scrollLeft:C,scrollWidth:P,clientWidth:F}=N;if(!(P-F>1)){p(false),w(false);return}p(C>1),w(C<P-F-1);};h(),x(i);let E=()=>h(),L=()=>{h(),x(i);},S=typeof ResizeObserver!="undefined"?new ResizeObserver(()=>L()):null;return N.addEventListener("scroll",E,{passive:true}),S==null||S.observe(N),window.addEventListener("resize",L),()=>{N.removeEventListener("scroll",E),S==null||S.disconnect(),window.removeEventListener("resize",L);}},[i,x,a]),X__namespace.useEffect(()=>{x(i);},[i,x]),X__namespace.useEffect(()=>{if(!g||typeof ResizeObserver=="undefined")return;let N=m.current;if(!N)return;let h=new ResizeObserver(()=>{T();});h.observe(N);let E=d(i);return E&&h.observe(E),()=>{h.disconnect();}},[i,d,g,T]),X__namespace.useEffect(()=>{if(!g||typeof MutationObserver=="undefined")return;let N=m.current;if(!N)return;let h=new MutationObserver(()=>{T();});return h.observe(N,{childList:true,subtree:true}),()=>{h.disconnect();}},[g,T]),X__namespace.useEffect(()=>{if(!g)return;let N=()=>{T();};return window.addEventListener("resize",N),()=>{window.removeEventListener("resize",N);}},[g,T]);let y=a==="horizontal";return u("div",{className:s("relative",y&&"max-w-full overflow-hidden"),children:[u("div",{ref:Is(m,n),role:"tablist","aria-orientation":a,className:s("relative inline-flex items-center",y&&"w-full max-w-full overflow-x-auto overflow-y-hidden [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",lm[l],e),...o,children:[g&&R&&f?r("span",{"aria-hidden":"true",className:s(gm,f),style:R}):null,o.children]}),y&&v?r("div",{className:"pointer-events-none absolute inset-y-0 left-0 w-8 bg-gradient-to-r from-background to-transparent"}):null,y&&b?r("div",{className:"pointer-events-none absolute inset-y-0 right-0 w-8 bg-gradient-to-l from-background to-transparent"}):null]})});zs.displayName="TabsList";var Fs=X__namespace.forwardRef(({className:e,variant:t,value:a,disabled:o,onClick:n,onKeyDown:i,...c},d)=>{let{id:l,value:f,setValue:m,registerTrigger:R,focusNextTrigger:k,focusEdgeTrigger:g,orientation:v}=No("TabsTrigger"),p=So(t),b=X__namespace.useRef(null),w=f===a,x=`${l}-trigger-${a}`,T=`${l}-content-${a}`;X__namespace.useEffect(()=>(R(a,b.current),()=>R(a,null)),[R,a]);let y=h=>{n==null||n(h),!(h.defaultPrevented||o)&&m(a);},N=h=>{if(i==null||i(h),!h.defaultPrevented){if(v==="horizontal"){if(h.key==="ArrowRight"){h.preventDefault(),k(a,1);return}if(h.key==="ArrowLeft"){h.preventDefault(),k(a,-1);return}}else {if(h.key==="ArrowDown"){h.preventDefault(),k(a,1);return}if(h.key==="ArrowUp"){h.preventDefault(),k(a,-1);return}}if(h.key==="Home"){h.preventDefault(),g("first");return}if(h.key==="End"){h.preventDefault(),g("last");return}(h.key===" "||h.key==="Enter")&&(h.preventDefault(),m(a));}};return r("button",{type:"button",role:"tab",id:x,"aria-selected":w,"aria-controls":T,tabIndex:w?0:-1,"data-state":w?"active":"inactive",disabled:o,ref:Is(b,d),className:s(cm,dm[p],e),onClick:y,onKeyDown:N,...c})});Fs.displayName="TabsTrigger";var Hs=X__namespace.forwardRef(({className:e,variant:t,value:a,...o},n)=>{let{id:i,value:c}=No("TabsContent"),d=So(t),l=c===a,f=`${i}-trigger-${a}`,m=`${i}-content-${a}`;return r("div",{ref:n,role:"tabpanel",id:m,"aria-labelledby":f,hidden:!l,"data-state":l?"active":"inactive",className:s("focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",um[d],e),...o})});Hs.displayName="TabsContent";var Mo=X__namespace.forwardRef(({className:e,onFocus:t,...a},o)=>{let n=X__namespace.useCallback(c=>{typeof o=="function"?o(c):o&&(o.current=c);},[o]),i=X__namespace.useCallback(c=>{t==null||t(c),!c.defaultPrevented&&Ur(c.currentTarget);},[t]);return r("textarea",{ref:n,"data-slot":"textarea",onFocus:i,className:s("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),...a})});Mo.displayName="Textarea";var Eo=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 NC({className:e,variant:t,size:a,...o}){return r(radixUi.Toggle.Root,{"data-slot":"toggle",className:s(Eo({variant:t,size:a,className:e})),...o})}var As=X__namespace.createContext({size:"default",variant:"default"});function IC({className:e,variant:t,size:a,children:o,...n}){return r(radixUi.ToggleGroup.Root,{"data-slot":"toggle-group","data-variant":t,"data-size":a,className:s("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",e),...n,children:r(As.Provider,{value:{variant:t,size:a},children:o})})}function _C({className:e,children:t,variant:a,size:o,...n}){let i=X__namespace.useContext(As);return r(radixUi.ToggleGroup.Item,{"data-slot":"toggle-group-item","data-variant":i.variant||a,"data-size":i.size||o,className:s(Eo({variant:i.variant||a,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 wm="hsl(var(--primary))",Do={bottomLeft:{side:"bottom",align:"start"},bottomRight:{side:"bottom",align:"end"},topLeft:{side:"top",align:"start"},topRight:{side:"top",align:"end"}},xm=e=>{var t;return e&&(t=Do[e])!=null?t:Do.bottomLeft},Ze=e=>String(e).padStart(2,"0"),ym=(e,t)=>{let a=e.hour>=12?"PM":"AM",o=(e.hour+11)%12+1,n={HH:Ze(e.hour),H:String(e.hour),hh:Ze(o),h:String(o),mm:Ze(e.minute),m:String(e.minute),ss:Ze(e.second),s:String(e.second),A:a,a:a.toLowerCase()};return t.replace(/HH|H|hh|h|mm|m|ss|s|A|a/g,i=>n[i])},km=(e,t)=>t?`${Ze(e.hour)}:${Ze(e.minute)}:${Ze(e.second)}`:`${Ze(e.hour)}:${Ze(e.minute)}`,Rm=e=>{let t=e.match(/\b(AM|PM)\b/i);return t?t[1].toUpperCase()==="AM"?"AM":"PM":null},Bs=e=>{if(!e)return null;let t=e.trim();if(!t)return null;let a=Rm(t),o=a?t.replace(/\s?(AM|PM)\b/i,"").trim():t,[n,i,c]=o.split(":");if(!n||!i)return null;let d=Number.parseInt(n,10),l=Number.parseInt(i,10),f=c?Number.parseInt(c,10):0;if([d,l,f].some(R=>Number.isNaN(R)))return null;let m=d;if(a){let R=Math.min(Math.max(m%12||12,1),12);m=a==="PM"?R%12+12:R%12,a==="AM"&&R===12&&(m=0),a==="PM"&&R===12&&(m=12);}return {hour:Math.min(Math.max(m,0),23),minute:Math.min(Math.max(l,0),59),second:Math.min(Math.max(f,0),59)}},Cm=e=>{let t=e%12;return t===0?12:t},Pm=(e,t)=>{let a=e%12;return t==="PM"?a+12:a===12?0:a},Lo=({label:e,options:t,selectedValue:a,onSelect:o})=>u("div",{className:"flex w-20 min-w-0 flex-col gap-2",children:[r("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:e}),r("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===a;return r("button",{type:"button",role:"option","aria-selected":i,className:s("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)})})]}),Pa=44,Tm=5,Vs=40;function Io({label:e,options:t,selectedValue:a,onValueChange:o,open:n,infinite:i=true}){let c=X__namespace.useRef(null),d=X__namespace.useRef(null),l=X__namespace.useMemo(()=>{if(t.length===0)return [];if(!i)return t;let k=[];for(let g=0;g<Vs;g+=1)for(let v of t)k.push(v);return k},[i,t]),f=X__namespace.useCallback((k,g="auto")=>{if(!c.current||t.length===0||l.length===0)return;let v=t.findIndex(T=>T.value===k),p=v>=0?v:0,b=Math.floor(Vs/2),x=(i?p+t.length*b:p)*Pa;c.current.scrollTo({top:x,behavior:g});},[l.length,i,t]);X__namespace.useLayoutEffect(()=>{n&&f(a);},[f,n,t,a]),X__namespace.useEffect(()=>()=>{d.current!==null&&clearTimeout(d.current);},[]);let m=X__namespace.useCallback(k=>{if(l.length===0||t.length===0)return;let g=k.currentTarget,v=Math.round(g.scrollTop/Pa),p=l.length-1,b=Math.max(0,Math.min(v,p));d.current!==null&&clearTimeout(d.current),d.current=setTimeout(()=>{var T;let w=l[b];if(!w)return;if(!o(w.value)){f(a,"smooth");return}if(i){let y=t.length,N=l.length-t.length-1;if(v<=y||v>=N)f(w.value);else {let h=v*Pa;(T=c.current)==null||T.scrollTo({top:h});}return}f(w.value);},80);},[f,l,i,o,t,a]);if(t.length===0)return r("div",{className:"flex-1",children:r("p",{className:"text-center text-sm text-muted-foreground",children:"No options"})});let R=(Tm-1)/2*Pa;return u("div",{className:"flex flex-1 flex-col items-center gap-2",children:[r("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:e}),u("div",{className:"relative h-56 w-full overflow-hidden",children:[r("div",{className:"pointer-events-none absolute inset-x-0 top-1/2 -translate-y-1/2 border-y border-primary/30"}),r("div",{ref:c,onScroll:m,className:"h-56 overflow-y-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",style:{paddingTop:R,paddingBottom:R,WebkitOverflowScrolling:"touch"},children:l.map((k,g)=>{let v=`${g}-${k.value}`,p=k.value===a;return r("div",{className:s("flex h-11 items-center justify-center text-base transition-colors",p?"font-medium text-foreground":"text-muted-foreground"),children:k.label},v)})})]})]})}var Nm=({value:e,onChange:t})=>u("div",{className:"flex w-20 min-w-0 flex-col gap-2",children:[r("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Period"}),r("div",{role:"radiogroup",className:"grid gap-2",children:["AM","PM"].map(a=>{let o=a===e;return r("button",{type:"button",role:"radio","aria-checked":o,className:s("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(a),children:a},a)})})]}),_o=X__namespace.forwardRef((e,t)=>{var Or,jt,pr,mr;let{value:a,defaultValue:o=null,onChange:n,onOpenChange:i,hourStep:c=1,minuteStep:d=1,secondStep:l=1,showSeconds:f,use12Hours:m=false,allowClear:R=true,format:k,placeholder:g,placement:v="bottomLeft",size:p="middle",status:b,variant:w="outlined",inputClassName:x,inputStyle:T,prefix:y,open:N,defaultOpen:h,inputReadOnly:E=true,className:L,style:S,disabled:C=false,name:P,id:F,...H}=e,{onBlur:W,onFocus:D,onClick:_,...O}=H,{isNative:M}=bt(),U=Ye(),V=M||U,B=a!==void 0,[G,j]=X__namespace.useState(o),q=(Or=B?a:G)!=null?Or:null,z=X__namespace.useMemo(()=>Bs(q),[q]),te=X__namespace.useMemo(()=>{var J;return ((J=z==null?void 0:z.hour)!=null?J:0)>=12?"PM":"AM"},[z==null?void 0:z.hour]),[K,ce]=X__namespace.useState(te);X__namespace.useEffect(()=>{ce(te);},[te]);let le=X__namespace.useMemo(()=>typeof f=="boolean"?f:typeof k=="string"?/s/.test(k):!!(q&&q.split(":").length===3),[q,k,f]),ne=X__namespace.useMemo(()=>m?le?"hh:mm:ss A":"hh:mm A":le?"HH:mm:ss":"HH:mm",[le,m]),fe=typeof k=="string"?k:ne,ge=X__namespace.useCallback(J=>J?typeof k=="function"?k(J):ym(J,fe):"",[k,fe]),[$,ie]=X__namespace.useState(()=>ge(z));X__namespace.useEffect(()=>{ie(ge(z));},[ge,z]);let pe=typeof R=="object"&&R!==null&&!Array.isArray(R)?R:void 0,he=(jt=pe==null?void 0:pe.clearIcon)!=null?jt:r(lucideReact.X,{className:"h-4 w-4",strokeWidth:2}),ke=!!R&&!C&&!!q,ae=X__namespace.useMemo(()=>({"--date-primary-color":wm}),[]),re=N!==void 0,[we,de]=X__namespace.useState(!!h),ye=re?!!N:we,Pe=X__namespace.useCallback(J=>{C||(re||de(J),i==null||i(J));},[C,re,i]),me=X__namespace.useCallback(J=>{if(!J){B||j(null),ie(""),n==null||n(null,"");return}let ue=km(J,le);B||j(ue);let We=ge(J);ie(We),n==null||n(ue,We);},[ge,le,B,n]),De=z!=null?z:{hour:0,minute:0,second:0},Ce=Math.max(1,Math.floor(c)),Te=Math.max(1,Math.floor(d)),ve=Math.max(1,Math.floor(l)),dt=X__namespace.useMemo(()=>{if(m){let ue=[];for(let at=1;at<=12;at+=Ce)ue.push(Math.min(at,12));return ue.includes(12)||ue.push(12),Array.from(new Set(ue)).sort((at,Da)=>at-Da).map(at=>({label:Ze(at),value:at}))}let J=[];for(let ue=0;ue<24;ue+=Ce)J.push({label:Ze(ue),value:ue});return J},[Ce,m]),xe=X__namespace.useMemo(()=>{let J=[];for(let ue=0;ue<60;ue+=Te)J.push({label:Ze(ue),value:ue});return J},[Te]),St=X__namespace.useMemo(()=>{if(!le)return [];let J=[];for(let ue=0;ue<60;ue+=ve)J.push({label:Ze(ue),value:ue});return J},[le,ve]),Ve=X__namespace.useMemo(()=>z?m?Cm(z.hour):z.hour:m?12:0,[z,m]),xt=(pr=z==null?void 0:z.minute)!=null?pr:0,rt=(mr=z==null?void 0:z.second)!=null?mr:0,yt=X__namespace.useCallback(J=>{if(m){let ue=Pm(J,K);me({...De,hour:ue});}else me({...De,hour:J});},[De,me,K,m]),Ee=X__namespace.useCallback(J=>{me({...De,minute:J});},[De,me]),Re=X__namespace.useCallback(J=>{me({...De,second:J});},[De,me]),Mt=X__namespace.useCallback(J=>{ce(J);let ue=z!=null?z:De,We=ue.hour;J==="AM"&&We>=12&&(We-=12),J==="PM"&&We<12&&(We+=12),me({...ue,hour:We});},[De,me,z]),Vt=X__namespace.useCallback(J=>{let ue=J.target.value;if(ie(ue),!ue.trim()){me(null);return}let We=Bs(ue);We&&me(We);},[me]),{side:oe,align:Ke}=xm(v),je={small:"h-8 text-sm",middle:`${ot} text-sm`,large:"h-11 text-base"},ut={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"},Ta={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"},Fr=E||V,Na=g!=null?g:"Select time",Hr=u("div",{role:"combobox","aria-expanded":ye,"aria-haspopup":"dialog",className:s("relative w-full",L),style:S,children:[y&&r("div",{className:"pointer-events-none absolute inset-y-0 left-3 flex items-center text-muted-foreground",children:y}),r(Ge,{...O,ref:t,value:$,onChange:Fr?void 0:Vt,onFocus:D,onBlur:W,readOnly:Fr,disabled:C,placeholder:Na,name:P,id:F,className:s("pr-10 text-sm",Ta[w],y&&"pl-10",C&&"cursor-not-allowed opacity-60",!C&&"cursor-pointer",je[p],b?ut[b]:void 0,x),style:{...b==="error"?{borderColor:"hsl(var(--destructive))",boxShadow:"0 0 0 3px hsl(var(--destructive) / 0.2)"}:{},...b==="warning"?{borderColor:"var(--warning, hsl(var(--primary)))",boxShadow:"0 0 0 3px hsl(var(--primary) / 0.2)"}:{},...T!=null?T:{}},onClick:J=>{_==null||_(J),!C&&Pe(true);}}),ke&&r("button",{type:"button",className:"absolute inset-y-0 right-8 flex items-center text-muted-foreground transition hover:text-foreground",onMouseDown:J=>{J.preventDefault(),J.stopPropagation();},onClick:J=>{J.preventDefault(),J.stopPropagation(),me(null);},children:he}),r("div",{className:"pointer-events-none absolute inset-y-0 right-3 flex items-center text-muted-foreground",children:r(lucideReact.Clock,{className:"h-4 w-4"})})]}),Sa=X__namespace.useMemo(()=>[{label:"AM",value:"AM"},{label:"PM",value:"PM"}],[]),Ma=u("div",{className:"flex w-max gap-4 p-4",role:"dialog","aria-modal":"true",children:[r(Lo,{label:"Hour",options:dt,selectedValue:Ve,onSelect:yt}),r(Lo,{label:"Minute",options:xe,selectedValue:xt,onSelect:Ee}),le?r(Lo,{label:"Second",options:St,selectedValue:rt,onSelect:Re}):null,m?r(Nm,{value:K,onChange:Mt}):null]}),Ea=u("div",{className:"flex w-full gap-4",children:[r(Io,{open:ye,label:"Hour",options:dt,selectedValue:Ve,onValueChange:J=>(yt(J),true)}),r(Io,{open:ye,label:"Minute",options:xe,selectedValue:xt,onValueChange:J=>(Ee(J),true)}),m?r(Io,{open:ye,label:"Period",options:Sa,selectedValue:K,infinite:false,onValueChange:J=>(Mt(J),true)}):null]});return V?u(er,{open:ye,onOpenChange:Pe,children:[r(la,{asChild:true,children:Hr}),u(tr,{className:"mt-10 max-h-[min(540px,calc(100dvh-6rem))] rounded-t-3xl bg-background",children:[r(rr,{className:"px-6 pb-2 pt-4",children:r(ar,{className:"text-base font-medium text-foreground",children:"Select time"})}),u("div",{className:"flex flex-1 flex-col gap-6 px-6 pb-6",children:[r("div",{className:"flex w-full gap-4",children:Ea}),u("div",{className:"mt-auto flex items-center justify-between",children:[r("div",{className:"flex-1"}),u("div",{className:"flex items-center gap-3",children:[R?r(Q,{type:"button",variant:"outline",size:"sm",className:"text-muted-foreground hover:text-foreground",onClick:()=>me(null),children:"Clear"}):null,r(ca,{asChild:true,children:r(Q,{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:ae,children:"Done"})})]})]})]})]})]}):u(Qt,{open:ye,onOpenChange:Pe,children:[r(sa,{asChild:true,children:Hr}),r(Zt,{className:"w-auto border border-border bg-popover p-0 shadow-lg",align:Ke,side:oe,children:Ma})]})});_o.displayName="TimePicker";function js({row:e}){let{transform:t,transition:a,setNodeRef:o,isDragging:n}=sortable.useSortable({id:e.original.id});return r(Tt,{"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:a},children:e.getVisibleCells().map(i=>r(Bt,{children:reactTable.flexRender(i.column.columnDef.cell,i.getContext())},i.id))})}function Vm({columns:e,dndEnabled:t,dataIds:a,rows:o}){return o.length?t?r(sortable.SortableContext,{items:a,strategy:sortable.verticalListSortingStrategy,children:o.map(n=>r(js,{row:n},n.id))}):o.map(n=>r(Tt,{"data-state":n.getIsSelected()&&"selected",children:n.getVisibleCells().map(i=>{let c=i.column.columnDef.meta;return r(Bt,{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)):r(Tt,{children:r(Bt,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})}function Gs({table:e,columns:t,dndEnabled:a=false,onReorder:o,virtualizedRows:n}){var R;let i=(R=n==null?void 0:n.rows)!=null?R:e.getRowModel().rows,c=a?i.map(k=>Number(k.id)):[],d=X__namespace.useId(),l=core.useSensors(core.useSensor(core.MouseSensor,{}),core.useSensor(core.TouchSensor,{}),core.useSensor(core.KeyboardSensor,{}));function f(k){let{active:g,over:v}=k;if(g&&v&&g.id!==v.id&&o){let p=c.indexOf(g.id),b=c.indexOf(v.id),w=sortable.arrayMove(e.options.data,p,b);o(w);}}let m=u(Ns,{className:"table-fixed min-w-full",children:[r(Ss,{className:"sticky top-0 z-20 bg-muted",children:e.getHeaderGroups().map(k=>r(Tt,{children:k.headers.map(g=>{let v=g.column.columnDef.meta;return r(Es,{colSpan:g.colSpan,className:s("sticky top-0 z-30 bg-muted",v==null?void 0:v.headerClassName),style:v==null?void 0:v.headerStyle,children:g.isPlaceholder?null:reactTable.flexRender(g.column.columnDef.header,g.getContext())},g.id)})},k.id))}),u(Ms,{className:"**:data-[slot=table-cell]:first:w-8",children:[n!=null&&n.paddingTop?r(Tt,{className:"pointer-events-none border-0",children:r(Bt,{colSpan:t.length,className:"p-0",style:{height:n.paddingTop}})}):null,Vm({columns:t,dndEnabled:a,dataIds:c,rows:i}),n!=null&&n.paddingBottom?r(Tt,{className:"pointer-events-none border-0",children:r(Bt,{colSpan:t.length,className:"p-0",style:{height:n.paddingBottom}})}):null]})]});return a?r(core.DndContext,{collisionDetection:core.closestCenter,modifiers:[modifiers.restrictToVerticalAxis],onDragEnd:f,sensors:l,id:d,children:m}):m}function Gm(e){switch(e){case "desc":return r(lucideReact.ArrowDown,{className:"ml-2 h-4 w-4"});case "asc":return r(lucideReact.ArrowUp,{className:"ml-2 h-4 w-4"});default:return r(lucideReact.ChevronsUpDown,{className:"ml-2 h-4 w-4"})}}function Ws({column:e,title:t,className:a}){if(!e.getCanSort())return r("div",{className:s(a),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 r("div",{className:s("flex items-center space-x-2",a),children:u(Q,{type:"button",variant:"ghost",size:"sm",className:"-ml-3 h-8 justify-start",onClick:o,children:[r("span",{children:t}),Gm(e.getIsSorted())]})})}function $s({table:e,showPageSize:t=true,pageSizeOptions:a=[10,20,30,40,50]}){return u("div",{className:"flex items-center justify-between px-4",children:[u("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."]}),u("div",{className:"flex w-full items-center gap-8 lg:w-fit",children:[t?u("div",{className:"hidden items-center gap-2 lg:flex",children:[r(Me,{htmlFor:"rows-per-page",className:"text-sm font-medium",children:"Rows per page"}),r(ya,{value:`${e.getState().pagination.pageSize}`,onValueChange:o=>{e.setPageSize(Number(o));},options:a.map(o=>({value:`${o}`,label:o})),triggerProps:{size:"sm",className:"w-20",id:"rows-per-page"},contentProps:{side:"top"}})]}):null,u("div",{className:"flex w-fit items-center justify-center text-sm font-medium",children:["Page ",e.getState().pagination.pageIndex+1," of ",e.getPageCount()]}),u("div",{className:"ml-auto flex items-center gap-2 lg:ml-0",children:[u(Q,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),children:[r("span",{className:"sr-only",children:"Go to first page"}),r(lucideReact.ChevronsLeft,{})]}),u(Q,{variant:"outline",className:"size-8",size:"icon",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),children:[r("span",{className:"sr-only",children:"Go to previous page"}),r(lucideReact.ChevronLeft,{})]}),u(Q,{variant:"outline",className:"size-8",size:"icon",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),children:[r("span",{className:"sr-only",children:"Go to next page"}),r(lucideReact.ChevronRight,{})]}),u(Q,{variant:"outline",className:"hidden size-8 lg:flex",size:"icon",onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),children:[r("span",{className:"sr-only",children:"Go to last page"}),r(lucideReact.ChevronsRight,{})]})]})]})]})}function Ys({table:e}){return u(ji,{children:[r(ho,{asChild:true,children:u(Q,{variant:"outline",size:"sm",className:"ml-auto hidden h-8 lg:flex",children:[r(lucideReact.Settings2,{}),"View"]})}),u(wo,{align:"end",className:"w-[150px]",children:[r(qi,{children:"Toggle columns"}),r(Gi,{}),e.getAllColumns().filter(t=>typeof t.accessorFn!="undefined"&&t.getCanHide()).map(t=>r(Ui,{className:"capitalize",checked:t.getIsVisible(),onCheckedChange:a=>t.toggleVisibility(!!a),children:t.id},t.id))]})]})}function Zm({id:e}){let{attributes:t,listeners:a}=sortable.useSortable({id:e});return u(Q,{...t,...a,variant:"ghost",size:"icon",className:"text-muted-foreground size-7 hover:bg-transparent",children:[r(lucideReact.GripVertical,{className:"text-muted-foreground size-3"}),r("span",{className:"sr-only",children:"Drag to reorder"})]})}var Ks={id:"drag",header:()=>null,cell:({row:e})=>r(Zm,{id:e.original.id}),enableSorting:false,enableHiding:false};function IP(e){return [Ks,...e]}function Fo(e,t){return t?t.split(".").reduce((a,o)=>{if(!(a===null||typeof a!="object"))return a[o]},e):e}function rg(e){if(e)return typeof e=="number"?{width:e,minWidth:e}:{width:e,minWidth:e}}function ag(e){var l,f,m;if(!e)return null;let t=(l=e.body)!=null?l:e.payload,a=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:a,headers:o,resultKey:n,mapData:i,delay:c};if(typeof e.post=="string")return {method:"post",url:e.post,body:t,params:a,headers:o,resultKey:n,mapData:i,delay:c};let d=(f=e.url)!=null?f:e.reul;return typeof d=="string"?{method:(m=e.method)!=null?m:"get",url:d,body:t,params:a,headers:o,resultKey:n,mapData:i,delay:c}:null}function og(e,t){return e.map(a=>{var l,f,m,R;let o=a.item?k=>Fo(k,a.item):k=>k,n=a.align==="right"?"text-right justify-end":a.align==="center"?"text-center justify-center":void 0,i=s(n,a.headerClassName),c=s(a.align==="right"?"text-right":a.align==="center"?"text-center":void 0,a.cellClassName),d=rg(a.width);return {id:a.key,accessorFn:o,header:({column:k})=>r(Ws,{column:k,title:a.title,className:n}),cell:({row:k})=>{let g=k.original,v=a.item?Fo(g,a.item):o(g);return a.func?a.func(g,{value:v,rowIndex:k.index}):v},enableSorting:t&&((l=a.sortable)!=null?l:true)&&!!a.item,enableHiding:(f=a.hiddeable)!=null?f:true,meta:{headerClassName:i,headerStyle:(m=a.headerStyle)!=null?m:d,cellClassName:c,cellStyle:(R=a.cellStyle)!=null?R:d}}})}function ng(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 ig(e,t){if(!t||Object.keys(t).length===0)return e;try{let a=new URL(e,typeof window!="undefined"?window.location.origin:"http://localhost");return Object.entries(t).forEach(([o,n])=>{n!=null&&a.searchParams.set(o,String(n));}),a.toString()}catch{let o=new URLSearchParams(Object.entries(t).reduce((i,[c,d])=>(d==null||(i[c]=String(d)),i),{})),n=e.includes("?")?"&":"?";return `${e}${n}${o.toString()}`}}function sg({data:e,columns:t,pagination:a=true,sortable:o=true,reload:n=false,filterable:i=false,selectable:c=false,height:d=480,rowHeight:l=48,overscan:f=5,defaultPageSize:m=25,pageSize:R,className:k,emptyState:g,onDataChange:v,loading:p}){var pe,he,ke;let b=X__namespace.useMemo(()=>ag(e.read),[e.read]),w=X__namespace.useMemo(()=>{var ae;return (ae=e.bind)!=null?ae:[]},[e.bind]),x=(pe=R==null?void 0:R.count)!=null?pe:m,T=(he=R==null?void 0:R.options)!=null?he:[10,20,30,40,50],y=(ke=R==null?void 0:R.visible)!=null?ke:true,[N,h]=X__namespace.useState(()=>w),[E,L]=X__namespace.useState(false),[S,C]=X__namespace.useState(null),P=X__namespace.useRef(null),[F,H]=X__namespace.useState(0),[W,D]=X__namespace.useState(d),_=X__namespace.useRef(null),[O,M]=X__namespace.useState(""),U=X__namespace.useMemo(()=>og(t,o),[t,o]),V=X__namespace.useMemo(()=>c?[{id:"__select",enableHiding:false,enableSorting:false,size:44,header:({table:re})=>r("div",{className:"flex items-center justify-center",children:r(yr,{"aria-label":"Select all rows",checked:re.getIsAllPageRowsSelected()||re.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:we=>re.toggleAllPageRowsSelected(we===true)})}),cell:({row:re})=>r("div",{className:"flex items-center justify-center",children:r(yr,{"aria-label":"Select row",checked:re.getIsSelected(),onCheckedChange:we=>re.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=X__namespace.useMemo(()=>t.filter(ae=>!!ae.item),[t]),G=X__namespace.useMemo(()=>{if(!i||!O.trim())return N;let ae=O.trim().toLowerCase();return N.filter(re=>B.some(we=>{let de=Fo(re,we.item);return de==null?false:String(de).toLowerCase().includes(ae)}))},[N,i,O,B]),j=gn({data:G,columns:V,enableRowSelection:c,defaultPageSize:a?x:G.length||10,getRowId:(ae,re)=>re.toString()});X__namespace.useEffect(()=>{a||(j.setPageIndex(0),j.setPageSize(G.length||1));},[a,G.length,j]),X__namespace.useEffect(()=>{a&&j.setPageSize(x);},[a,x,j]),X__namespace.useEffect(()=>{h(w);},[w]),X__namespace.useEffect(()=>{i||M("");},[i]);let q=X__namespace.useCallback(async()=>{var re,we;if(!b)return;(re=_.current)==null||re.abort();let ae=new AbortController;_.current=ae,L(true),C(null);try{let de=ig(b.url,b.params),ye=new Headers(b.headers),Pe;b.method==="post"&&b.body!==void 0&&(Pe=typeof b.body=="string"?b.body:JSON.stringify(b.body),ye.has("Content-Type")||ye.set("Content-Type","application/json"));let me=await fetch(de,{method:b.method.toUpperCase(),headers:ye,body:Pe,signal:ae.signal});if(!me.ok)throw new Error(`Request failed with status ${me.status}`);b.delay&&b.delay>0&&await new Promise(Te=>setTimeout(Te,b.delay));let De=await me.json(),Ce=b.mapData?b.mapData(De):ng(De,b.resultKey);h(Ce),C(null),v==null||v(Ce);}catch(de){if(de.name==="AbortError")return;C((we=de.message)!=null?we:"Unable to fetch data");}finally{L(false);}},[b,v]);X__namespace.useEffect(()=>(b&&q().catch(()=>{}),()=>{var ae;(ae=_.current)==null||ae.abort();}),[b,q]),X__namespace.useEffect(()=>{if(!P.current)return;let ae=P.current;D(ae.clientHeight||d);let re=()=>{D(ae.clientHeight||d);};return typeof window!="undefined"&&window.addEventListener("resize",re),()=>{typeof window!="undefined"&&window.removeEventListener("resize",re);}},[d]);let z=j.getRowModel().rows,te=z.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*l,ne=Math.max(0,Math.floor(F/l)-f),fe=Math.min(z.length,Math.ceil((F+W)/l)+f),ge=X__namespace.useMemo(()=>{if(!z.length)return null;let ae=z.slice(ne,fe),re=ne*l,we=ae.length*l,de=Math.max(le-re-we,0);return {rows:ae,paddingTop:re,paddingBottom:de}},[z,ne,fe,l,le]),$=!!p||E,ie=!$&&N.length===0&&!!g;return u("div",{className:s("flex w-full flex-col gap-4",k),children:[u("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[i?u("div",{className:"relative flex w-full max-w-md items-center",children:[r(lucideReact.Search,{className:"pointer-events-none absolute left-3 h-4 w-4 text-muted-foreground"}),r(Ge,{className:"pl-9",placeholder:"Search rows...",value:O,onChange:ae=>M(ae.target.value)})]}):r("div",{className:"h-9"}),u("div",{className:"flex items-center justify-end gap-2",children:[n&&b?u(Q,{variant:"outline",size:"sm",onClick:()=>{q().catch(()=>{});},disabled:E||!!p,children:[E||p?r(lucideReact.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):r(lucideReact.RotateCcw,{className:"mr-2 h-4 w-4"}),"Reload"]}):null,r(Ys,{table:j})]})]}),u("div",{className:"relative overflow-hidden rounded-lg border",children:[ie?r("div",{className:"flex items-center justify-center p-6 text-sm text-muted-foreground",children:g}):r("div",{ref:P,className:"max-h-full overflow-auto",style:{maxHeight:d},onScroll:ae=>H(ae.currentTarget.scrollTop),children:r(Gs,{table:j,columns:V,virtualizedRows:ge!=null?ge:void 0})}),$?r("div",{className:"absolute inset-0 flex items-center justify-center bg-background/70 backdrop-blur-sm",children:u("div",{className:"flex flex-col items-center gap-2 text-sm text-muted-foreground",children:[r(lucideReact.Loader2,{className:"h-5 w-5 animate-spin"}),r("span",{children:"Loading data\u2026"})]})}):null]}),S?r("div",{className:"text-destructive text-sm",children:S}):null,a?r($s,{table:j,showPageSize:y,pageSizeOptions:T}):c?r("div",{className:"flex items-center justify-between px-4 text-sm text-muted-foreground",children:u("span",{children:[K," of ",ce," row(s) selected."]})}):null]})}sg.displayName="DataGrid";function cg({onReset:e}){return u("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-background px-6 py-16 text-center",children:[u("div",{className:"space-y-3",children:[r("h1",{className:"text-3xl font-semibold tracking-tight text-foreground",children:"Something went wrong"}),r("p",{className:"text-base text-muted-foreground",children:"We hit an unexpected error. You can try again or head back to the dashboard."})]}),u("div",{className:"flex flex-wrap items-center justify-center gap-3",children:[r(Q,{onClick:()=>{e(),cn("/dashboard/default");},children:"Back to home"}),r(Q,{variant:"outline",onClick:()=>{e();},children:"Try again"})]})]})}var Js=class extends X.Component{constructor(){super(...arguments);this.state={hasError:false};this.resetBoundary=()=>{this.setState({hasError:false});};}static getDerivedStateFromError(){return {hasError:true}}componentDidCatch(a,o){var n,i;process.env.NODE_ENV!=="production"&&console.error("ErrorBoundary caught an error",a,o),(i=(n=this.props).onError)==null||i.call(n,a,o);}render(){if(this.state.hasError){let{fallback:a}=this.props;return a?typeof a=="function"?a(this.resetBoundary):a:r(cg,{onReset:this.resetBoundary})}return this.props.children}};var Oe=X__namespace.forwardRef(({className:e,...t},a)=>r("div",{ref:a,className:s("flex flex-col gap-2",e),...t}));Oe.displayName="FormBlock";var Ae=X__namespace.forwardRef(({message:e,children:t,className:a,...o},n)=>!e&&!t?null:r("p",{ref:n,className:s("text-sm text-destructive",a),role:"alert",...o,children:e!=null?e:t}));Ae.displayName="FormError";var dg=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange||e.handleBlur?e:(t=e.form)!=null?t:e},ug=X__namespace.forwardRef(({label:e,name:t,type:a="text",placeholder:o,required:n=false,error:i,value:c,onChange:d,onBlur:l,className:f,description:m,autoComplete:R,labelProps:k={},inputProps:g={},form:v,rules:p},b)=>{var ce,le;let w=dg(v),x=w==null?void 0:w.values,T=w==null?void 0:w.errors,y=w==null?void 0:w.touched,N=x==null?void 0:x[t],h=T==null?void 0:T[t],E=y==null?void 0:y[t],L=(ce=w==null?void 0:w.validationSequence)!=null?ce:0,S=w==null?void 0:w.handleChange,C=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:W,onBlur:D,className:_,type:O,autoComplete:M,...U}=g,{children:V,...B}=k,G=O!=null?O:a,j=ne=>{let fe=ne.target.value,$=!!p||n?el(fe,p,n):void 0;F==null||F(t,$),P==null||P(t,fe),S==null||S(ne),d==null||d(fe),W==null||W(ne);},q=ne=>{H==null||H(t,true),C==null||C(ne),l==null||l(),D==null||D(ne);},z=N!==void 0?N:c!==void 0?c:"",te=(le=E?h:void 0)!=null?le:i,K=X__namespace.useRef(L);return X__namespace.useEffect(()=>{let ne=!!p||n,fe=L!==K.current;if(!F||!ne){K.current=L;return}if(!E&&!fe){K.current=L;return}let ge=typeof z=="string"?z:z!=null?String(z):"",$=el(ge,p,n);$!==h&&F(t,$),K.current=L;},[z,h,F,E,t,n,p,L]),u(Oe,{className:f,children:[e&&r(Me,{htmlFor:t,...B,children:V!=null?V:u("span",{className:"flex items-center gap-1",children:[r("span",{children:e}),n&&r("span",{className:"text-destructive",children:"*"})]})}),m&&r("p",{className:"text-sm text-muted-foreground",children:m}),r(Ge,{ref:b,id:t,name:t,type:G,placeholder:o,value:z,onChange:j,onBlur:q,"aria-invalid":!!te,autoComplete:M!=null?M:R,className:_,...U}),r(Ae,{message:te})]})});function el(e,t,a){if(a&&!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"}}}ug.displayName="FormInput";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},mg=X__namespace.forwardRef(({label:e,name:t,mask:a,placeholderChar:o,placeholder:n,required:i=false,error:c,value:d,onChange:l,onBlur:f,className:m,description:R,labelProps:k={},inputProps:g={},form:v,rules:p},b)=>{var j,q;let w=pg(v),x=w==null?void 0:w.values,T=w==null?void 0:w.errors,y=w==null?void 0:w.touched,N=x==null?void 0:x[t],h=T==null?void 0:T[t],E=y==null?void 0:y[t],L=(j=w==null?void 0:w.validationSequence)!=null?j:0,S=w==null?void 0:w.setFieldValue,C=w==null?void 0:w.setFieldError,P=w==null?void 0:w.setFieldTouched,{className:F,onBlur:H,onChange:W,...D}=g,{children:_,...O}=k,M=z=>{let K=!!p||i?tl(z,p,i):void 0;C==null||C(t,K),S==null||S(t,z),l==null||l(z),W==null||W(z);},U=z=>{P==null||P(t,true),f==null||f(),H==null||H(z);},V=N!==void 0?N:d!==void 0?d:"",B=(q=E?h:void 0)!=null?q:c,G=X__namespace.useRef(L);return X__namespace.useEffect(()=>{let z=!!p||i,te=L!==G.current;if(!C||!z){G.current=L;return}if(!E&&!te){G.current=L;return}let K=tl(V,p,i);K!==h&&C(t,K),G.current=L;},[V,h,C,E,t,i,p,L]),u(Oe,{className:m,children:[e&&r(Me,{htmlFor:t,...O,children:_!=null?_:u("span",{className:"flex items-center gap-1",children:[r("span",{children:e}),i&&r("span",{className:"text-destructive",children:"*"})]})}),R&&r("p",{className:"text-sm text-muted-foreground",children:R}),r(co,{ref:b,id:t,name:t,mask:a,placeholderChar:o,placeholder:n,value:V,onChange:M,onBlur:U,"aria-invalid":!!B,className:F,...D}),r(Ae,{message:B})]})});mg.displayName="FormInputMask";function tl(e,t,a){if(a&&!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 gg=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange||e.handleBlur?e:(t=e.form)!=null?t:e},fg=X__namespace.forwardRef(({label:e,name:t,placeholder:a,required:o=false,error:n,value:i,onChange:c,onBlur:d,className:l,description:f,labelProps:m={},inputProps:R={},form:k,min:g,max:v,decimals:p,formatter:b,parser:w,rules:x},T)=>{var te,K;let y=gg(k),N=y==null?void 0:y.values,h=y==null?void 0:y.errors,E=y==null?void 0:y.touched,L=N==null?void 0:N[t],S=h==null?void 0:h[t],C=E==null?void 0:E[t],P=(te=y==null?void 0:y.validationSequence)!=null?te:0,F=y==null?void 0:y.setFieldValue,H=y==null?void 0:y.setFieldError,W=y==null?void 0:y.setFieldTouched,{className:D,onBlur:_,onChange:O,...M}=R,{children:U,...V}=m,B=ce=>{let ne=!!x||o?rl(ce,x,o):void 0;H==null||H(t,ne),F==null||F(t,ce),c==null||c(ce),O==null||O(ce);},G=ce=>{W==null||W(t,true),d==null||d(),_==null||_(ce);},j=L!==void 0?L:i!==void 0?i:null,q=(K=C?S:void 0)!=null?K:n,z=X__namespace.useRef(P);return X__namespace.useEffect(()=>{let ce=!!x||o,le=P!==z.current;if(!H||!ce){z.current=P;return}if(!C&&!le){z.current=P;return}let ne=rl(j,x,o);ne!==S&&H(t,ne),z.current=P;},[j,S,H,C,t,o,x,P]),u(Oe,{className:l,children:[e&&r(Me,{htmlFor:t,...V,children:U!=null?U:u("span",{className:"flex items-center gap-1",children:[r("span",{children:e}),o&&r("span",{className:"text-destructive",children:"*"})]})}),f&&r("p",{className:"text-sm text-muted-foreground",children:f}),r(lo,{ref:T,id:t,name:t,placeholder:a,value:j,onChange:B,onBlur:G,"aria-invalid":!!q,min:g,max:v,decimals:p,formatter:b,parser:w,className:D,...M}),r(Ae,{message:q})]})});fg.displayName="FormInputNumeric";function rl(e,t,a){if(a&&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 bg=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange||e.handleBlur?e:(t=e.form)!=null?t:e};function M1({label:e,name:t,description:a,placeholder:o="Select an option",required:n=false,error:i,value:c,defaultValue:d,onChange:l,onBlur:f,className:m,disabled:R,labelProps:k={},selectProps:g={},triggerProps:v={},contentProps:p={},multiSelectProps:b={},multiSelectTriggerProps:w={},multiSelectValueProps:x={},multiSelectContentProps:T={},form:y,options:N,isMulti:h=false,rules:E}){var Re,Mt,Vt;let L=Ye(),S=bg(y),C=S==null?void 0:S.values,P=S==null?void 0:S.errors,F=S==null?void 0:S.touched,H=C==null?void 0:C[t],W=P==null?void 0:P[t],D=F==null?void 0:F[t],_=S==null?void 0:S.setFieldValue,O=S==null?void 0:S.setFieldError,M=S==null?void 0:S.setFieldTouched,U=S==null?void 0:S.handleChange,V=S==null?void 0:S.handleBlur,B=(Re=S==null?void 0:S.validationSequence)!=null?Re:0,{onValueChange:G,value:j,defaultValue:q,...z}=g,{onBlur:te,...K}=v,ce={...K,disabled:R!=null?R:K.disabled},{title:le,...ne}=p,{onValueChange:fe,value:ge,defaultValue:$,...ie}=b,{onBlur:pe,...he}=w,{title:ke,...ae}=T,[re,we]=X__namespace.useState(typeof d=="string"?d:""),[de,ye]=X__namespace.useState(Array.isArray(d)?d:[]);X__namespace.useEffect(()=>{typeof d=="string"&&j===void 0&&H===void 0&&c===void 0&&we(d);},[d,H,j,c]),X__namespace.useEffect(()=>{Array.isArray(d)&&ge===void 0&&!Array.isArray(H)&&!Array.isArray(c)&&ye(d);},[d,H,ge,c]);let Pe=typeof j=="string"?j:typeof H=="string"?H:typeof c=="string"?c:re,me=Array.isArray(ge)?ge:Array.isArray(H)?H:Array.isArray(c)?c:de,De=(Mt=D?W:void 0)!=null?Mt:i,Ce=X__namespace.useRef(B);X__namespace.useEffect(()=>{let oe=!!E||n,Ke=B!==Ce.current;if(!O||!oe){Ce.current=B;return}if(!D&&!Ke){Ce.current=B;return}let je=h?me:Pe!=null?Pe:"",ut=Ho(je,E,n);ut!==W&&O(t,ut),Ce.current=B;},[me,Pe,W,O,D,h,t,n,E,B]);let Te=X__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=X__namespace.useCallback(oe=>{j===void 0&&H===void 0&&c===void 0&&we(oe);let je=!!E||n?Ho(oe,E,n):void 0;O==null||O(t,je),Te(oe),l==null||l(oe),G==null||G(oe);},[H,Te,l,G,j,c,E,n,O,t]),dt=X__namespace.useCallback(oe=>{ge===void 0&&!Array.isArray(H)&&!Array.isArray(c)&&ye(oe);let je=!!E||n?Ho(oe,E,n):void 0;O==null||O(t,je),Te(oe),l==null||l(oe),fe==null||fe(oe);},[H,Te,fe,ge,l,c,E,n,O,t]),xe=X__namespace.useCallback(oe=>{M==null||M(t,true),V==null||V({target:{name:t}}),f==null||f(),te==null||te(oe);},[V,M,t,f,te]),St=X__namespace.useCallback(oe=>{M==null||M(t,true),V==null||V({target:{name:t}}),f==null||f(),pe==null||pe(oe);},[V,M,t,pe,f]),Ve=q!=null?q:typeof d=="string"?d:void 0,xt=$!=null?$:Array.isArray(d)?d:void 0,[rt,yt]=X__namespace.useState(false),Ee=({isMulti:oe=false})=>{var je;let Ke=oe?me.length>0?`${me.length} selected`:o:((je=N.find(ut=>ut.value===Pe))==null?void 0:je.label)||o;return u(Q,{variant:"outline",className:s("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",!!De&&"border-destructive",ce.className),onClick:()=>!ce.disabled&&yt(true),disabled:ce.disabled,type:"button",children:[r("span",{className:"flex-1 text-left truncate",children:Ke}),r(lucideReact.ChevronDownIcon,{className:"h-4 w-4 opacity-50 flex-shrink-0"})]})};return u(Oe,{className:m,children:[e&&r(Me,{htmlFor:t,...k,children:(Vt=k.children)!=null?Vt:u("span",{className:"flex items-center gap-1",children:[r("span",{children:e}),n&&r("span",{className:"text-destructive",children:"*"})]})}),h?u(jsxRuntime.Fragment,{children:[L?u(jsxRuntime.Fragment,{children:[r(Ee,{isMulti:true}),r(Ot,{open:rt,onOpenChange:yt,title:ke!=null?ke:e,options:N,selectedValues:me,onSelect:oe=>{let Ke=me.includes(oe)?me.filter(je=>je!==oe):[...me,oe];dt(Ke);},isMulti:true})]}):u(cs,{...ie,value:me,defaultValue:xt,onValueChange:dt,children:[r(ds,{"data-name":t,"aria-invalid":!!De,...he,...ce,onBlur:St,children:r(us,{placeholder:o,...x})}),r(ps,{title:ke!=null?ke:e,...ae,children:N.map(oe=>r(ms,{value:oe.value,disabled:oe.disabled,children:oe.label},oe.value))})]}),r("input",{type:"hidden",name:t,value:me.join(",")})]}):u(jsxRuntime.Fragment,{children:[L?u(jsxRuntime.Fragment,{children:[r(Ee,{}),r(Ot,{open:rt,onOpenChange:yt,title:le!=null?le:e,options:N,selectedValues:Pe,onSelect:ve,isMulti:false})]}):r(ya,{...z,value:Pe,defaultValue:Ve,onValueChange:ve,options:N.map(oe=>({value:oe.value,label:oe.label,disabled:oe.disabled})),placeholder:o,triggerProps:{...ce,id:t,"aria-invalid":!!De,onBlur:xe},contentProps:{...ne,title:le!=null?le:e}}),r("input",{type:"hidden",name:t,value:Pe!=null?Pe:""})]}),r(Ae,{message:De}),a&&r("p",{className:"text-sm text-muted-foreground",children:a})]})}function Ho(e,t,a){if(a){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 hg=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange||e.handleBlur?e:(t=e.form)!=null?t:e},wg=X__namespace.forwardRef(({label:e,name:t,placeholder:a,required:o=false,error:n,value:i,onChange:c,onBlur:d,className:l,labelProps:f={},textareaProps:m={},form:R,rules:k},g)=>{var G,j;let v=hg(R),p=v==null?void 0:v.values,b=v==null?void 0:v.errors,w=v==null?void 0:v.touched,x=p==null?void 0:p[t],T=b==null?void 0:b[t],y=w==null?void 0:w[t],N=(G=v==null?void 0:v.validationSequence)!=null?G:0,h=v==null?void 0:v.handleChange,E=v==null?void 0:v.handleBlur,L=v==null?void 0:v.setFieldError,S=v==null?void 0:v.setFieldValue,C=v==null?void 0:v.setFieldTouched,{onChange:P,onBlur:F,className:H,...W}=m,{children:D,..._}=f,O=q=>{let z=q.target.value,K=!!k||o?al(z,k,o):void 0;L==null||L(t,K),S==null||S(t,z),h==null||h(q),c==null||c(z),P==null||P(q);},M=q=>{C==null||C(t,true),E==null||E(q),d==null||d(),F==null||F(q);},U=x!==void 0?String(x):i!==void 0?i:"",V=(j=y?T:void 0)!=null?j:n,B=X__namespace.useRef(N);return X__namespace.useEffect(()=>{let q=!!k||o,z=N!==B.current;if(!L||!q){B.current=N;return}if(!y&&!z){B.current=N;return}let te=al(U,k,o);te!==T&&L(t,te),B.current=N;},[U,T,L,y,t,o,k,N]),u(Oe,{className:l,children:[e&&r(Me,{htmlFor:t,..._,children:D!=null?D:u("span",{className:"flex items-center gap-1",children:[r("span",{children:e}),o&&r("span",{className:"text-destructive",children:"*"})]})}),r(Mo,{ref:g,id:t,name:t,placeholder:a,value:U,onChange:O,onBlur:M,"aria-invalid":!!V,className:H,...W}),r(Ae,{message:V})]})});function al(e,t,a){if(a&&!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"}}}wg.displayName="FormTextarea";var xg=e=>{var t;if(e)return e.setFieldValue||e.setFieldTouched||e.handleBlur?e:(t=e.form)!=null?t:e},yg=X__namespace.forwardRef(({label:e,description:t,name:a,required:o=false,error:n,value:i,defaultValue:c,onChange:d,onBlur:l,form:f,options:m,className:R,labelProps:k={},radioGroupProps:g={},optionLabelProps:v={},optionWrapperClassName:p,...b},w)=>{var G,j;let x=xg(f),T=x==null?void 0:x.values,y=x==null?void 0:x.errors,N=x==null?void 0:x.touched,h=T==null?void 0:T[a],E=y==null?void 0:y[a],S=(G=(N==null?void 0:N[a])?E:void 0)!=null?G:n,{className:C,onValueChange:P,onBlur:F,value:H,defaultValue:W,...D}=g,_=(j=i!=null?i:H!==void 0?H:void 0)!=null?j:h!=null?String(h):void 0,O=_===void 0?c!=null?c:W:void 0,M=X__namespace.useCallback(q=>{var z;(z=x==null?void 0:x.setFieldValue)==null||z.call(x,a,q),d==null||d(q),P==null||P(q);},[x,a,d,P]),U=X__namespace.useCallback(q=>{var z,te;(z=x==null?void 0:x.setFieldTouched)==null||z.call(x,a,true),(te=x==null?void 0:x.handleBlur)==null||te.call(x,{target:{name:a}}),l==null||l(),F==null||F(q);},[x,a,l,F]),{className:V,...B}=v;return u(Oe,{ref:w,className:s("gap-3",R),...b,children:[(e||t)&&u("div",{className:"space-y-1",children:[e&&r(Me,{...k,children:u("span",{className:"flex items-center gap-1",children:[r("span",{children:e}),o&&r("span",{className:"text-destructive",children:"*"})]})}),t?r("p",{className:"text-sm text-muted-foreground",children:t}):null]}),r(os,{"aria-invalid":!!S,...D,..._!==void 0?{value:_}:O!==void 0?{defaultValue:O}:{},onValueChange:M,onBlur:U,className:s("grid gap-3",C),children:m.map(q=>{let z=`${a}-${q.value}`;return u("div",{className:s("flex items-start gap-3 rounded-lg border border-input bg-background p-3 shadow-xs",p,q.className,q.disabled&&"opacity-60"),children:[r(ns,{id:z,value:q.value,disabled:q.disabled,"aria-invalid":!!S,className:"mt-1"}),u(Me,{htmlFor:z,className:s("flex-col items-start gap-1 font-normal sm:flex-row sm:items-center sm:gap-2",V),...B,children:[r("span",{className:"text-sm font-medium text-foreground",children:q.label}),q.description?r("span",{className:"block text-sm text-muted-foreground",children:q.description}):null]})]},q.value)})}),r(Ae,{message:S})]})});yg.displayName="FormRadioGroup";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};function K1({label:e,name:t,placeholder:a,required:o=false,error:n,value:i,defaultValue:c=null,onChange:d,onBlur:l,className:f,description:m,labelProps:R={},datePickerProps:k={},form:g,rules:v}){var ne,fe,ge;let p=kg(g),b=p==null?void 0:p.values,w=p==null?void 0:p.errors,x=p==null?void 0:p.touched,T=p==null?void 0:p.setFieldValue,y=p==null?void 0:p.setFieldError,N=p==null?void 0:p.setFieldTouched,h=p==null?void 0:p.handleChange,E=p==null?void 0:p.handleBlur,L=b==null?void 0:b[t],S=w==null?void 0:w[t],C=x==null?void 0:x[t],P=(ne=p==null?void 0:p.validationSequence)!=null?ne:0,{onChange:F,onBlur:H,value:W,defaultValue:D,placeholder:_,status:O,...M}=k,[U,V]=X__namespace.useState((fe=D!=null?D:c)!=null?fe:null);X__namespace.useEffect(()=>{var $;W===void 0&&i===void 0&&L===void 0&&V(($=D!=null?D:c)!=null?$:null);},[D,W,c,L,i]);let B=W!==void 0?W!=null?W:null:L!==void 0?L!=null?L:null:i!==void 0?i!=null?i:null:U,G=(ge=C?S:void 0)!=null?ge:n,j=O!=null?O:G?"error":void 0,q=_!=null?_:a,{children:z,...te}=R,K=X__namespace.useRef(P);X__namespace.useEffect(()=>{let $=!!v||o,ie=P!==K.current;if(!y||!$){K.current=P;return}if(!C&&!ie){K.current=P;return}let pe=ol(B!=null?B:null,v,o);pe!==S&&y(t,pe),K.current=P;},[B,S,y,C,t,o,v,P]);let ce=X__namespace.useCallback(($,ie)=>{W===void 0&&i===void 0&&L===void 0&&V($!=null?$:null);let pe=ol($,v,o);y==null||y(t,pe),T?T(t,$!=null?$:null):h&&h({target:{name:t,value:ie}}),d==null||d($!=null?$:null),F==null||F($!=null?$:null,ie);},[F,W,h,y,T,L,t,d,o,v,i]),le=X__namespace.useCallback($=>{N==null||N(t,true),E==null||E({target:{name:t}}),l==null||l(),H==null||H($);},[H,E,N,t,l]);return u(Oe,{className:f,children:[e&&r(Me,{htmlFor:t,...te,children:z!=null?z:u("span",{className:"flex items-center gap-1",children:[r("span",{children:e}),o&&r("span",{className:"text-destructive",children:"*"})]})}),m&&r("p",{className:"text-sm text-muted-foreground",children:m}),r(bo,{id:t,name:t,value:B!=null?B:null,onChange:ce,onBlur:le,placeholder:q,status:j,"aria-invalid":!!G,...M}),r(Ae,{message:G})]})}function ol(e,t,a){if(a&&!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 Rg=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange||e.handleBlur?e:(t=e.form)!=null?t:e};function rT({label:e,name:t,placeholder:a,required:o=false,error:n,value:i,defaultValue:c=null,onChange:d,onBlur:l,className:f,description:m,labelProps:R={},timePickerProps:k={},form:g,rules:v}){var ne,fe,ge;let p=Rg(g),b=p==null?void 0:p.values,w=p==null?void 0:p.errors,x=p==null?void 0:p.touched,T=p==null?void 0:p.setFieldValue,y=p==null?void 0:p.setFieldError,N=p==null?void 0:p.setFieldTouched,h=p==null?void 0:p.handleChange,E=p==null?void 0:p.handleBlur,L=b==null?void 0:b[t],S=w==null?void 0:w[t],C=x==null?void 0:x[t],P=(ne=p==null?void 0:p.validationSequence)!=null?ne:0,{onChange:F,onBlur:H,value:W,defaultValue:D,placeholder:_,status:O,...M}=k,[U,V]=X__namespace.useState((fe=D!=null?D:c)!=null?fe:null);X__namespace.useEffect(()=>{var $;W===void 0&&i===void 0&&L===void 0&&V(($=D!=null?D:c)!=null?$:null);},[c,L,D,W,i]);let B=W!==void 0?W!=null?W:null:L!==void 0?L!=null?L:null:i!==void 0?i!=null?i:null:U,G=(ge=C?S:void 0)!=null?ge:n,j=O!=null?O:G?"error":void 0,q=_!=null?_:a,{children:z,...te}=R,K=X__namespace.useRef(P);X__namespace.useEffect(()=>{let $=!!v||o,ie=P!==K.current;if(!y||!$){K.current=P;return}if(!C&&!ie){K.current=P;return}let pe=nl(B!=null?B:null,v,o);pe!==S&&y(t,pe),K.current=P;},[B,S,y,C,t,o,v,P]);let ce=X__namespace.useCallback(($,ie)=>{W===void 0&&i===void 0&&L===void 0&&V($!=null?$:null);let pe=nl($,v,o);y==null||y(t,pe),T?T(t,$!=null?$:null):h&&h({target:{name:t,value:ie}}),d==null||d($!=null?$:null),F==null||F($!=null?$:null,ie);},[h,y,T,L,t,d,o,v,F,W,i]),le=X__namespace.useCallback($=>{N==null||N(t,true),E==null||E({target:{name:t}}),l==null||l(),H==null||H($);},[E,N,t,l,H]);return u(Oe,{className:f,children:[e&&r(Me,{htmlFor:t,...te,children:z!=null?z:u("span",{className:"flex items-center gap-1",children:[r("span",{children:e}),o&&r("span",{className:"text-destructive",children:"*"})]})}),m&&r("p",{className:"text-sm text-muted-foreground",children:m}),r(_o,{id:t,name:t,value:B!=null?B:null,onChange:ce,onBlur:le,placeholder:q,status:j,"aria-invalid":!!G,...M}),r(Ae,{message:G})]})}function nl(e,t,a){if(a&&!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 Cg=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange?e:(t=e.form)!=null?t:e},Pg=({name:e,label:t,description:a,className:o,checked:n,defaultChecked:i,onCheckedChange:c,switchProps:d,error:l,form:f,rules:m})=>{var B,G;let R=X__namespace.useId(),{id:k,onCheckedChange:g,className:v,disabled:p,"aria-describedby":b,"aria-labelledby":w,...x}=d!=null?d:{},T=k!=null?k:R,y=Cg(f),N=y==null?void 0:y.values,h=y==null?void 0:y.errors,E=y==null?void 0:y.touched,L=N==null?void 0:N[e],S=h==null?void 0:h[e],C=E==null?void 0:E[e],P=(B=y==null?void 0:y.validationSequence)!=null?B:0,F=(G=C?S:void 0)!=null?G:l,H=L!==void 0?!!L:n!==void 0?n:void 0,W=a?`${T}-description`:void 0,D=F?`${T}-error`:void 0,_=[b,W,D].filter(Boolean).join(" ").trim()||void 0,O=t?[w,`${T}-label`].filter(Boolean).join(" ").trim()||void 0:w,M=X__namespace.useCallback(j=>{if(p)return;let q=document.getElementById(T);if(q){if(j.preventDefault(),typeof q.focus=="function")try{q.focus({preventScroll:!0});}catch{q.focus();}q.click();}},[p,T]),U=j=>{var te,K,ce;let z=!!m?il(j,m):void 0;if((te=y==null?void 0:y.setFieldError)==null||te.call(y,e,z),(K=y==null?void 0:y.setFieldValue)==null||K.call(y,e,j),(ce=y==null?void 0:y.setFieldTouched)==null||ce.call(y,e,true),y!=null&&y.handleChange){let le={target:{name:e,value:j,checked:j}};y.handleChange(le);}c==null||c(j),g==null||g(j);},V=X__namespace.useRef(P);return X__namespace.useEffect(()=>{let j=!!m,q=P!==V.current;if(!(y!=null&&y.setFieldError)||!j){V.current=P;return}if(!C&&!q){V.current=P;return}let te=il(L!==void 0?!!L:n!==void 0?n:!!i,m);te!==S&&y.setFieldError(e,te),V.current=P;},[n,i,S,C,L,e,y,m,P]),u("div",{className:s("flex items-start justify-between gap-4",o),children:[u("div",{className:"flex-1 space-y-2",children:[t?r(Mr,{id:`${T}-label`,htmlFor:T,onClick:M,className:s("text-sm leading-none font-medium",p?"cursor-not-allowed":"cursor-pointer"),children:t}):null,a?r(Nr,{id:W,children:a}):null,r(Sr,{id:D,children:F})]}),r(Ts,{name:e,id:T,"aria-invalid":!!F,"aria-describedby":_,"aria-labelledby":O,className:s("cursor-pointer",v),disabled:p,...x,...H!==void 0?{checked:H}:{defaultChecked:i},onCheckedChange:U})]})};Pg.displayName="FormSwitch";function il(e,t){if(t){if(t.required&&!e)return typeof t.required=="string"?t.required:"This field is required";if(t.validate){let a=t.validate(e);if(typeof a=="string")return a;if(a===false)return "Invalid value"}}}var pT=["sidebar","floating","inset"],mT=["offcanvas","icon","none"],gT=["centered","full-width"],fT=["sticky","scroll"];
|
|
9
|
-
Object.defineProperty(exports,"toast",{enumerable:true,get:function(){return sonner.toast}});exports.Accordion=
|
|
7
|
+
`)}}):null},vh=Jt__namespace.Tooltip;function hh({active:e,payload:t,className:n,indicator:a="dot",hideLabel:r=false,hideIndicator:i=false,label:c,labelFormatter:d,labelClassName:l,formatter:g,color:m,nameKey:C,labelKey:R}){let{config:f}=qr(),b=J__namespace.useMemo(()=>{var w;if(r||!(t!=null&&t.length))return null;let[v]=t,y=`${R||(v==null?void 0:v.dataKey)||(v==null?void 0:v.name)||"value"}`,x=Jn(f,v,y),N=!R&&typeof c=="string"?((w=f[c])==null?void 0:w.label)||c:x==null?void 0:x.label;return d?o("div",{className:s("font-medium",l),children:d(N,t)}):N?o("div",{className:s("font-medium",l),children:N}):null},[c,d,t,r,l,f,R]);if(!e||!(t!=null&&t.length))return null;let p=t.length===1&&a!=="dot";return u("div",{className:s("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",n),children:[p?null:b,o("div",{className:"grid gap-1.5",children:t.filter(v=>v.type!=="none").map((v,y)=>{let x=`${C||v.name||v.dataKey||"value"}`,N=Jn(f,v,x),w=m||v.payload.fill||v.color;return o("div",{className:s("[&>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:g&&(v==null?void 0:v.value)!==void 0&&v.name?g(v.value,v.name,v,y,v.payload):u(jsxRuntime.Fragment,{children:[N!=null&&N.icon?o(N.icon,{}):!i&&o("div",{className:s("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":w,"--color-border":w}}),u("div",{className:s("flex flex-1 justify-between leading-none",p?"items-end":"items-center"),children:[u("div",{className:"grid gap-1.5",children:[p?b:null,o("span",{className:"text-muted-foreground",children:(N==null?void 0:N.label)||v.name})]}),v.value&&o("span",{className:"text-foreground font-mono font-medium tabular-nums",children:v.value.toLocaleString()})]})]})},v.dataKey)})})]})}var yh=Jt__namespace.Legend;function xh({className:e,hideIcon:t=false,payload:n,verticalAlign:a="bottom",nameKey:r}){let{config:i}=qr();return n!=null&&n.length?o("div",{className:s("flex items-center justify-center gap-4",a==="top"?"pb-3":"pt-3",e),children:n.filter(c=>c.type!=="none").map(c=>{let d=`${r||c.dataKey||"value"}`,l=Jn(i,c,d);return u("div",{className:s("[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"),children:[l!=null&&l.icon&&!t?o(l.icon,{}):o("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:c.color}}),l==null?void 0:l.label]},c.value)})}):null}function Jn(e,t,n){if(typeof t!="object"||t===null)return;let a="payload"in t&&typeof t.payload=="object"&&t.payload!==null?t.payload:void 0,r=n;return n in t&&typeof t[n]=="string"?r=t[n]:a&&n in a&&typeof a[n]=="string"&&(r=a[n]),r in e?e[r]:e[n]}var Ro=J__namespace.forwardRef(function({className:t,...n},a){return o(radixUi.Checkbox.Root,{ref:a,"data-slot":"checkbox",className:s("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),...n,children:o(radixUi.Checkbox.Indicator,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:o(lucideReact.CheckIcon,{className:"size-3.5"})})})});function $o({...e}){return o(radixUi.Dialog.Root,{"data-slot":"dialog",...e})}function Dh({...e}){return o(radixUi.Dialog.Trigger,{"data-slot":"dialog-trigger",...e})}function gd({...e}){return o(radixUi.Dialog.Portal,{"data-slot":"dialog-portal",...e})}function Lh({...e}){return o(radixUi.Dialog.Close,{"data-slot":"dialog-close",...e})}function bd({className:e,...t}){return o(radixUi.Dialog.Overlay,{"data-slot":"dialog-overlay",className:s("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 Yo({className:e,children:t,showCloseButton:n=true,...a}){return u(gd,{"data-slot":"dialog-portal",children:[o(bd,{}),u(radixUi.Dialog.Content,{"data-slot":"dialog-content",className:s("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,n&&u(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:[o(lucideReact.XIcon,{}),o("span",{className:"sr-only",children:"Close"})]})]})]})}function Ko({className:e,...t}){return o("div",{"data-slot":"dialog-header",className:s("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Ih({className:e,...t}){return o("div",{"data-slot":"dialog-footer",className:s("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function Jo({className:e,...t}){return o(radixUi.Dialog.Title,{"data-slot":"dialog-title",className:s("text-lg leading-none font-semibold",e),...t})}function Xo({className:e,...t}){return o(radixUi.Dialog.Description,{"data-slot":"dialog-description",className:s("text-muted-foreground text-sm",e),...t})}function Xn({className:e,...t}){return o(cmdk.Command,{"data-slot":"command",className:s("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function Bh({title:e="Command Palette",description:t="Search for a command to run...",children:n,className:a,showCloseButton:r=true,...i}){return u($o,{...i,children:[u(Ko,{className:"sr-only",children:[o(Jo,{children:e}),o(Xo,{children:t})]}),o(Yo,{className:s("overflow-hidden p-0",a),showCloseButton:r,children:o(Xn,{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:n})})]})}function Yr({className:e,...t}){return u("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[o(lucideReact.SearchIcon,{className:"size-4 shrink-0 opacity-50"}),o(cmdk.Command.Input,{"data-slot":"command-input",className:s("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 Kr({className:e,...t}){return o(cmdk.Command.List,{"data-slot":"command-list",className:s("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function Jr({...e}){return o(cmdk.Command.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function Vh({className:e,...t}){return o(cmdk.Command.Group,{"data-slot":"command-group",className:s("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 jh({className:e,...t}){return o(cmdk.Command.Separator,{"data-slot":"command-separator",className:s("bg-border -mx-1 h-px",e),...t})}function Xr({className:e,...t}){return o(cmdk.Command.Item,{"data-slot":"command-item",className:s("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 Uh({className:e,...t}){return o("span",{"data-slot":"command-shortcut",className:s("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}function Kh({...e}){return o(radixUi.ContextMenu.Root,{"data-slot":"context-menu",...e})}function Jh({...e}){return o(radixUi.ContextMenu.Trigger,{"data-slot":"context-menu-trigger",...e})}function Xh({...e}){return o(radixUi.ContextMenu.Group,{"data-slot":"context-menu-group",...e})}function Qh({...e}){return o(radixUi.ContextMenu.Portal,{"data-slot":"context-menu-portal",...e})}function Zh({...e}){return o(radixUi.ContextMenu.Sub,{"data-slot":"context-menu-sub",...e})}function ey({...e}){return o(radixUi.ContextMenu.RadioGroup,{"data-slot":"context-menu-radio-group",...e})}function ty({className:e,inset:t,children:n,...a}){return u(radixUi.ContextMenu.SubTrigger,{"data-slot":"context-menu-sub-trigger","data-inset":t,className:s("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:[n,o(lucideReact.ChevronRightIcon,{className:"ml-auto"})]})}function oy({className:e,...t}){return o(radixUi.ContextMenu.SubContent,{"data-slot":"context-menu-sub-content",className:s("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 ny({className:e,...t}){return o(radixUi.ContextMenu.Portal,{children:o(radixUi.ContextMenu.Content,{"data-slot":"context-menu-content",className:s("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 ay({className:e,inset:t,variant:n="default",...a}){return o(radixUi.ContextMenu.Item,{"data-slot":"context-menu-item","data-inset":t,"data-variant":n,className:s("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 ry({className:e,children:t,checked:n,...a}){return u(radixUi.ContextMenu.CheckboxItem,{"data-slot":"context-menu-checkbox-item",className:s("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:n,...a,children:[o("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:o(radixUi.ContextMenu.ItemIndicator,{children:o(lucideReact.CheckIcon,{className:"size-4"})})}),t]})}function iy({className:e,children:t,...n}){return u(radixUi.ContextMenu.RadioItem,{"data-slot":"context-menu-radio-item",className:s("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),...n,children:[o("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:o(radixUi.ContextMenu.ItemIndicator,{children:o(lucideReact.CircleIcon,{className:"size-2 fill-current"})})}),t]})}function sy({className:e,inset:t,...n}){return o(radixUi.ContextMenu.Label,{"data-slot":"context-menu-label","data-inset":t,className:s("text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...n})}function ly({className:e,...t}){return o(radixUi.ContextMenu.Separator,{"data-slot":"context-menu-separator",className:s("bg-border -mx-1 my-1 h-px",e),...t})}function cy({className:e,...t}){return o("span",{"data-slot":"context-menu-shortcut",className:s("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}var Hd={YYYY:"yyyy",YY:"yy",MM:"MM",M:"M",DD:"dd",D:"d"},_d=e=>{var t;return (t=Hd[e])!=null?t:e},Od=/(YYYY|YY|MM|M|DD|D|HH|H|mm|m|ss|s)/g,Qn=e=>e.replace(Od,t=>t==="HH"?"HH":t==="H"?"H":t==="mm"?"mm":t==="m"?"m":t==="ss"?"ss":t==="s"?"s":_d(t)),Zo=e=>!Number.isNaN(e.getTime()),Lt=class e{constructor(t){this.value=t;}create(t){return new e(t)}clone(){return this.create(new Date(this.value.getTime()))}add(t,n){switch(n){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,n){return this.add(-t,n)}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 n=dateFns.startOfDay(this.value),a=dateFns.addDays(n,1);return this.create(dateFns.addDays(a,-1))}isSame(t,n="day"){switch(n){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,n){if(n){let a=this.startOf(n),r=t.startOf(n);return a.valueOf()<r.valueOf()}return dateFns.isBefore(this.value,t.toDate())}isAfter(t,n){if(n){let a=this.startOf(n),r=t.startOf(n);return a.valueOf()>r.valueOf()}return dateFns.isAfter(this.value,t.toDate())}format(t){return dateFns.format(this.value,Qn(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 Zo(this.value)}toDate(){return new Date(this.value.getTime())}valueOf(){return this.value.getTime()}},Ad=e=>{if(e instanceof Lt)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(Zo(t))return t}return new Date},rt=(e,t)=>{if(typeof e=="string"&&t){let n=dateFns.parse(e,Qn(t),new Date);return Zo(n)?new Lt(n):new Lt(new Date(NaN))}return new Lt(Ad(e))},oi=(e,t)=>{let n=dateFns.parse(e,Qn(t),new Date);return Zo(n)?new Lt(n):null};function Zn(e){return Object.keys(e).reduce((t,n)=>{let a=e[n];return a&&(t[n]=a),t},{})}function gy(e){let[t,n]=J.useState({values:e.initialValues,errors:{},fieldErrors:{},touched:{},isSubmitting:false,isValid:false,validationSequence:0}),a=J.useCallback((f=t.values)=>{let b=e.validate?e.validate(f):{},p=Zn({...b,...t.fieldErrors}),v=Object.keys(p).length===0;return n(y=>({...y,errors:p,isValid:v})),v},[e.validate,t.fieldErrors,t.values]),r=J.useCallback((f,b)=>{n(p=>{let v={...p.values,[f]:b},y={...p.fieldErrors};delete y[f];let x=e.validate?e.validate(v):{},N=Zn({...x,...y}),w=Object.keys(N).length===0;return {...p,values:v,fieldErrors:y,errors:N,isValid:w}});},[e.validate]),i=J.useCallback((f,b=true)=>{n(p=>({...p,touched:{...p.touched,[f]:b}}));},[]),c=J.useCallback((f,b)=>{n(p=>{let v={...p.fieldErrors};b?v[f]=b:delete v[f];let y=e.validate?e.validate(p.values):{},x=Zn({...y,...v}),N=Object.keys(x).length===0;return {...p,fieldErrors:v,errors:x,isValid:N}});},[e.validate]),d=J.useCallback(()=>{n(f=>({...f,validationSequence:f.validationSequence+1}));},[]),l=J.useCallback(f=>{let{name:b,value:p}=f.target;r(b,p);},[r]),g=J.useCallback(f=>{let{name:b}=f.target;i(b,true),a();},[i,a]),m=J.useCallback(async f=>{f&&(f.preventDefault(),f.stopPropagation()),n(v=>{let y=Object.keys(v.values).reduce((x,N)=>(x[N]=true,x),{});return {...v,touched:y,validationSequence:v.validationSequence+1}});let b=t.values;if(a(b)&&!(Object.keys(t.fieldErrors).length>0)){n(v=>({...v,isSubmitting:true}));try{await e.onSubmit(b);}catch(v){console.error("Form submission error:",v);}finally{n(v=>({...v,isSubmitting:false}));}}},[e.onSubmit,a,t.values]),C=J.useCallback(()=>{n({values:e.initialValues,errors:{},fieldErrors:{},touched:{},isSubmitting:false,isValid:false,validationSequence:0});},[e.initialValues]);return {...t,...{setFieldValue:r,setFieldTouched:i,setFieldError:c,handleChange:l,handleBlur:g,handleSubmit:m,resetForm:C,validateForm:()=>a(),triggerValidation:d},form:{values:t.values,errors:t.errors,fieldErrors:t.fieldErrors,touched:t.touched,validationSequence:t.validationSequence,setFieldValue:(f,b)=>{r(f,b);},setFieldError:(f,b)=>{c(f,b);},setFieldTouched:(f,b)=>{i(f,b);},handleChange:l,handleBlur:g,handleSubmit:m,resetForm:C,validateForm:()=>a(),triggerValidation:d,isSubmitting:t.isSubmitting,isValid:t.isValid}}}var ni=768;function ea(){var i,c;if(typeof window=="undefined")return false;let e=window.innerWidth<ni,t=window.navigator,n=(t.userAgent||"").toLowerCase(),a=/android|iphone|ipad|ipod|blackberry|iemobile|opera mini/.test(n),r=(c=(i=t.userAgentData)==null?void 0:i.mobile)!=null?c:false;return e||a||r}function Ye(){let[e,t]=J__namespace.useState(()=>ea());return J__namespace.useEffect(()=>{let n=window.matchMedia(`(max-width: ${ni-1}px)`),a=()=>{t(ea());};return typeof n.addEventListener=="function"?n.addEventListener("change",a):typeof n.addListener=="function"&&n.addListener(a),t(ea()),()=>{typeof n.removeEventListener=="function"?n.removeEventListener("change",a):typeof n.removeListener=="function"&&n.removeListener(a);}},[]),e}var ai=e=>({title:"",subtitle:void 0,supportingText:void 0,heroBadge:void 0,icon:void 0,back:void 0,actions:void 0,variant:void 0,...e}),ri=e=>{let t=J.useMemo(()=>ai(e),[e]),[n,a]=J.useState([t]),r=n[n.length-1],i=n.length>1,c=J.useCallback(m=>{a(C=>{let R=[...C],f=R.length-1;return R[f]={...t,...m},R});},[t]),d=J.useCallback(m=>{a(C=>[...C,{...t,...m}]);},[t]),l=J.useCallback(()=>{i&&a(m=>m.slice(0,-1));},[i]),g=J.useCallback(m=>{a([ai(m!=null?m:t)]);},[t]);return {header:r,navigationState:r,navigationStack:n,setHeader:c,navigateTo:d,navigateBack:l,canGoBack:i,resetNavigation:g}},Gd=()=>{let e=globalThis;return e.__GOMENIUCIVAN_MOBILE_HEADER_CONTEXT__||(e.__GOMENIUCIVAN_MOBILE_HEADER_CONTEXT__=J.createContext(null)),e.__GOMENIUCIVAN_MOBILE_HEADER_CONTEXT__},ii=Gd(),si=({initialState:e,children:t})=>{let n=ri(e);return o(ii.Provider,{value:n,children:t})},li=e=>{let t=J.useContext(ii);return t||ri(e)};var Wd=400,ui=200,pi=.95,mi=()=>typeof window=="undefined"?"":`${window.location.pathname}${window.location.search}${window.location.hash}`,fi=(e,t)=>{if(typeof window=="undefined")return ()=>{};let n=window.history,a=n[e];return a?(n[e]=function(...i){let c=a.apply(this,i);return t(),c},()=>{n[e]=a;}):()=>{}},$d=(e,t)=>{if(typeof window=="undefined")return ()=>{};let n=[],a=null,r={current:mi()},i=()=>{a&&window.clearTimeout(a),a=window.setTimeout(()=>{a=null,t();},Wd);},c=()=>{let m=mi();if(m===r.current){t();return}r.current=m,e(),i();};n.push(fi("pushState",c)),n.push(fi("replaceState",c));let d=()=>{c();};window.addEventListener("popstate",d),n.push(()=>window.removeEventListener("popstate",d));let l=()=>{c();};window.addEventListener("hashchange",l),n.push(()=>window.removeEventListener("hashchange",l));let g=()=>{a&&(window.clearTimeout(a),a=null),t();};return window.addEventListener("load",g),window.addEventListener("pageshow",g),n.push(()=>{window.removeEventListener("load",g),window.removeEventListener("pageshow",g);}),()=>{n.forEach(m=>m()),a&&window.clearTimeout(a);}},Yd=({color:e,framework:t})=>{let[n,a]=J.useState(false),r=J.useRef(n),[i,c]=J.useState(0),d=J.useRef(null),l=J.useRef(null),g=J.useCallback(()=>{l.current&&(window.clearTimeout(l.current),l.current=null),r.current=true,a(true),c(R=>R>0&&R<.2?R:.2);},[]),m=J.useCallback(()=>{r.current&&(d.current&&(window.clearTimeout(d.current),d.current=null),c(1),l.current=window.setTimeout(()=>{r.current=false,a(false),c(0);},200));},[]);J.useEffect(()=>{r.current=n;},[n]),J.useEffect(()=>typeof window=="undefined"?()=>{}:$d(g,m),[g,m,t]),J.useEffect(()=>{if(!n){d.current&&(window.clearTimeout(d.current),d.current=null);return}let R=()=>{c(f=>{if(f>=pi)return f;let b=(1-f)*.1;return Math.min(f+b,pi)}),d.current=window.setTimeout(R,ui);};return d.current=window.setTimeout(R,ui),()=>{d.current&&(window.clearTimeout(d.current),d.current=null);}},[n]),J.useEffect(()=>()=>{d.current&&window.clearTimeout(d.current),l.current&&window.clearTimeout(l.current);},[]);let C=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:n?1:0,transition:"width 0.2s ease, opacity 0.2s ease",transform:"translateZ(0)",zIndex:9999}),[e,i,n]);return o("div",{"aria-hidden":"true",style:C})},nn=Yd;var gi=({color:e,framework:t})=>o(nn,{color:e,framework:t});var bi=({color:e,framework:t})=>o(nn,{color:e,framework:t});var Kd={nextjs:bi},vi=e=>{var t;return (t=Kd[e])!=null?t:gi};var hi=({color:e,framework:t})=>{let n=vi(t);return typeof window=="undefined"?null:o(n,{color:e,framework:t})};var oa=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 It=e=>{if(oa(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 wi,it=typeof process!="undefined"&&!!((wi=process==null?void 0:process.versions)!=null&&wi.node),na=null,aa=null,Ri=Function("specifier","return import(specifier);"),Ft=()=>it?(na||(na=Ri("node:"+["fs","promises"].join("/"))),na):null,Co=()=>it?(aa||(aa=Ri("node:path")),aa):null,yi={debug:10,info:20,warning:30,error:40,critical:50},Jd=30,Xd=1e3,Qd=20,Zd=e=>e===false?null:typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):Jd,xi=e=>{var d,l,g,m,C,R,f;let t=typeof process!="undefined"?(d=process==null?void 0:process.env)==null?void 0:d.NODE_ENV:void 0,n=Zd(e==null?void 0:e.storeDays),a=(l=e==null?void 0:e.level)!=null?l:"info",r=(g=e==null?void 0:e.consoleLogging)!=null?g:t!=="production",c=!!(e!=null&&e.enable)&&(t==="production"||!!(e!=null&&e.writeToFileInDev))&⁢return {enable:!!(e!=null&&e.enable),level:a,retentionDays:n,json:!!(e!=null&&e.json),slowRequestThresholdMs:(m=e==null?void 0:e.slowRequestThresholdMs)!=null?m:Xd,maxFileSizeBytes:Math.max(1,(C=e==null?void 0:e.maxFileSizeMB)!=null?C:Qd)*1024*1024,directory:(R=e==null?void 0:e.directory)!=null?R:"monitoring",consoleLogging:r,captureUnhandled:(f=e==null?void 0:e.captureUnhandled)!=null?f:true,writeToFile:c}},eu=(e,t)=>yi[e]>=yi[t],tu=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)}},ou=e=>typeof(e==null?void 0:e.then)=="function",an=class{constructor(t){this.directoryCache=null;this.initialized=false;this.options=xi(t),this.publicApi=this.createPublicApi(),this.options.enable&&this.initialize();}get api(){return this.publicApi}updateOptions(t){let n=this.options.enable,a=this.options.level,r=this.options.json,i=this.options.slowRequestThresholdMs,c=this.options.retentionDays,d=this.options.directory,l=this.options.writeToFile;if(this.options=xi(t),this.options.directory!==d&&(this.directoryCache=null),!this.options.enable){this.detachProcessHandlers();return}(!n||this.options.level!==a||this.options.json!==r||this.options.slowRequestThresholdMs!==i||this.options.retentionDays!==c||this.options.directory!==d||this.options.writeToFile!==l)&&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,n,a)=>this.log(t,n,a),debug:(t,n)=>this.log("debug",t,n),info:(t,n)=>this.log("info",t,n),warning:(t,n)=>this.log("warning",t,n),error:(t,n)=>this.log("error",t,n),critical:(t,n)=>this.log("critical",t,n),logRequest:t=>this.logRequest(t),monitorRequest:(t,n)=>this.monitorRequest(t,n),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(!it)return null;if(this.directoryCache)return this.directoryCache;let t=await Co();if(!t)return null;let n=this.options.directory,a=t.isAbsolute(n)?n:t.join(process.cwd(),n);return this.directoryCache=a,a}async ensureDirectory(){if(!this.options.enable||!it)return;let t=await Ft(),n=await this.getDirectoryPath();if(!(!t||!n))try{await t.mkdir(n,{recursive:!0});}catch(a){this.options.consoleLogging&&console.error("[monitoring] Failed to create directory",a);}}ensureProcessHandlers(){if(!this.options.enable||!this.options.captureUnhandled||!it)return;let t=process;if(!(t!=null&&t.on)||this.processHandlers)return;let n=(...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",n),t.on("unhandledRejection",a),this.processHandlers={exception:n,rejection:a};}detachProcessHandlers(){if(!this.processHandlers||!it)return;let t=process,{exception:n,rejection:a}=this.processHandlers;t!=null&&t.off?(t.off("uncaughtException",n),t.off("unhandledRejection",a)):t!=null&&t.removeListener&&(t.removeListener("uncaughtException",n),t.removeListener("unhandledRejection",a)),this.processHandlers=void 0;}resolveLogEntry(t,n,a){let r=a==null?void 0:a.context,i=tu(a==null?void 0:a.error),{error:c,context:d,metadata:l,...g}=a!=null?a:{},m={};return l&&typeof l=="object"&&(m.metadata=l),Object.assign(m,g),{timestamp:new Date,level:t,message:n,context:r,error:i,metadata:Object.keys(m).length>0?m:void 0}}async log(t,n,a){if(!eu(t,this.options.level))return;let i=this.resolveLogEntry(t,n,a);this.options.consoleLogging&&this.consoleLog(i),!(!this.options.enable||!this.options.writeToFile||!it)&&(await this.writeLogEntry(i),this.options.retentionDays!==null&&await this.purgeLogs());}consoleLog(t){let n=t.timestamp.toISOString(),a={...t.metadata,context:t.context,error:t.error},r=[`[monitoring] ${n} [${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 n=await Ft(),a=await Co(),r=await this.getDirectoryPath();if(!(!n||!a||!r))try{let i=await this.resolveLogFilePath(r);if(!i)return;let c=this.options.json?this.serializeJsonEntry(t):this.serializeTextEntry(t);await n.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 n=await Ft(),a=await Co();if(!n||!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",d=`${i}.${c}`,l=a.join(t,d);if(!await this.isFileExceedingSize(l))return l;let g=1;for(;;){let m=`${i}-${g}.${c}`,C=a.join(t,m);if(!await this.isFileExceedingSize(C))return C;g+=1;}}async isFileExceedingSize(t){let n=await Ft();if(!n)return false;try{return (await n.stat(t)).size>=this.options.maxFileSizeBytes}catch(a){if(a.code==="ENOENT")return false;throw a}}async logRequest(t){var c,d,l;let n=(c=t.thresholdMs)!=null?c:this.options.slowRequestThresholdMs;if(t.durationMs<n)return;let a=((d=t.method)!=null?d:"REQUEST").toUpperCase(),r=`Slow request detected for ${a} ${(l=t.url)!=null?l:""}`,i=t.durationMs>=n*2?"error":"warning";await this.log(i,r,{context:{method:a,url:t.url,durationMs:t.durationMs,statusCode:t.statusCode,thresholdMs:n},metadata:t.metadata});}async monitorRequest(t,n){let a=Date.now();try{let r=n();return ou(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 Ft(),n=await Co(),a=await this.getDirectoryPath();if(!(!t||!n||!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 d=n.join(a,c.name);try{(await t.stat(d)).mtime.getTime()<i&&await t.rm(d,{force:!0});}catch(l){this.options.consoleLogging&&console.warn("[monitoring] Failed to purge log file",l);}}));}catch(r){this.options.consoleLogging&&console.error("[monitoring] Failed to read monitoring directory",r);}}async deleteLogFile(t){if(!it)return;let n=await Ft(),a=await Co(),r=await this.getDirectoryPath();if(!(!n||!a||!r))try{if(!t){let d=await n.readdir(r,{withFileTypes:!0});await Promise.all(d.map(async l=>{let g=a.join(r,l.name);await n.rm(g,{force:!0,recursive:l.isDirectory()});}));return}let i=a.basename(t),c=a.join(r,i);await n.rm(c,{force:!0});}catch(i){this.options.consoleLogging&&console.error("[monitoring] Failed to delete log file",i);}}async listLogFiles(){if(!it)return [];let t=await Ft(),n=await this.getDirectoryPath();if(!t||!n)return [];try{return (await t.readdir(n)).sort()}catch(a){return this.options.consoleLogging&&console.error("[monitoring] Failed to list log files",a),[]}}},Ht=null,nu=()=>(Ht||(Ht=new an),Ht),rn=e=>(Ht?Ht.updateOptions(e):Ht=new an(e),Ht.api),Ci=()=>nu().api,au=e=>{let t=J__namespace.useRef();return J__namespace.useEffect(()=>{if(!e)return;let n=t.current,a=JSON.stringify(e),r=n?JSON.stringify(n):void 0;a!==r&&(t.current=e,rn(e));},[e]),J__namespace.useMemo(()=>Ci(),[])};function To(e,t="info",n){let{title:a,description:r,duration:i=4e3,action:c}=n||{},d={duration:i,...c&&{action:{label:c.label,onClick:c.onClick}}};switch(t){case "success":sonner.toast.success(a||e,{description:r,...d});break;case "error":sonner.toast.error(a||e,{description:r,...d});break;case "warning":sonner.toast.warning(a||e,{description:r,...d});break;case "info":default:sonner.toast.info(a||e,{description:r,...d});break}}var ru=(e,t)=>To(e,"success",t),iu=(e,t)=>To(e,"error",t),su=(e,t)=>To(e,"warning",t),lu=(e,t)=>To(e,"info",t);var Pi="../styles/style.css",cu="@gomeniucivan/ui/style.css",du=()=>{try{return Za.resolve("@gomeniucivan/ui"),!0}catch{return false}};(async()=>{if(!du()){await import(Pi);return}try{await import(cu);}catch{await import(Pi);}})();var Ni=J.createContext(void 0),mu={enabled:false,framework:"auto",fieldName:"auto",fieldCy:"auto"},fu=new Set(["","email","number","password","search","tel","text","url","date","datetime-local","month","time","week"]),gu=()=>{var n;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"&&(n=globalThis.process)!=null?n: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"},bu=e=>{var d;let t={...mu,...e!=null?e:{}},n=(d=t.framework)!=null?d:"auto",a=n==="auto"?gu():n,r=!!t.enabled,i=t.fieldName==="auto"?r:!!t.fieldName,c=t.fieldCy==="auto"?r:!!t.fieldCy;return {enabled:r,debug:r,framework:a,requestedFramework:n,fieldName:i,fieldCy:c}},ax=({children:e,defaultTheme:t="system",nativeApp:n=false,extras:a,monitoring:r,siderbar:i})=>{var P,T,_,O,W;let[c,d]=J.useState(!!n),l=Ye(),g=J.useMemo(()=>ar(),[]),m=J.useMemo(()=>{let D=bu(a);return ir(g,D),D},[a,g]),C=J.useMemo(()=>r||{enable:false},[r]);J.useEffect(()=>{rn(C);},[C]),J.useEffect(()=>()=>{sr(g);},[g]),J.useEffect(()=>{d(!!n);},[n]);let R=()=>{var F;if(typeof window=="undefined")return t==="system"?"auto":t;let D=(F=window.localStorage)==null?void 0:F.getItem(qt);return Gt(D)?D:t==="system"?"auto":t},[f,b]=J.useState(()=>R()),[p,v]=J.useState(()=>ho(R())),[y,x]=J.useState(null);J.useEffect(()=>{v(ho(f)),pr(f);},[f]),J.useEffect(()=>{var A;if(typeof window=="undefined")return;let D=(A=window.localStorage)==null?void 0:A.getItem(qt);if(Gt(D))return;let F=t==="system"?"auto":t;b(M=>M===F?M:F);},[t]),J.useEffect(()=>{if(typeof window=="undefined"||f!=="auto")return;let D=window.matchMedia("(prefers-color-scheme: dark)"),F=M=>{let U=M.matches?"dark":"light";v(V=>V===U?V:U),jo("auto");},A=ho("auto");return v(M=>M===A?M:A),jo("auto"),D.addEventListener("change",F),()=>D.removeEventListener("change",F)},[f]),J.useEffect(()=>{if(typeof window=="undefined")return;let D=F=>{let A=F.detail;A&&b(M=>M===A?M:A);};return window.addEventListener(Vo,D),()=>window.removeEventListener(Vo,D)},[]),J.useEffect(()=>{if(typeof window=="undefined")return;let D=F=>{if(F.key!==qt||!F.newValue||!Gt(F.newValue))return;let A=F.newValue;b(M=>M===A?M:A);};return window.addEventListener("storage",D),()=>window.removeEventListener("storage",D)},[]);let N=p==="dark";J.useEffect(()=>{if(typeof document=="undefined")return;let D=document.documentElement;D.dataset.framework=m.framework,D.dataset.debug=m.enabled?"true":"false";},[m]);let w=c,S=w||l;J.useEffect(()=>{if(typeof document=="undefined"||typeof window=="undefined"||!S)return;let D=150,F=q=>q instanceof HTMLElement?q.isContentEditable||q instanceof HTMLTextAreaElement?true:q instanceof HTMLInputElement?fu.has(q.type):false:false,A=q=>{let j=q.getBoundingClientRect(),G=window.innerHeight||document.documentElement.clientHeight,H=window.innerWidth||document.documentElement.clientWidth,te=j.top>=0&&j.bottom<=G,K=j.left>=0&&j.right<=H;return te&&K},M=q=>{window.setTimeout(()=>{A(q)||q.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"});},D);},U=q=>{if(!(q instanceof Element))return null;if(F(q))return q;let j=q.closest('input, textarea, [contenteditable="true"]');return j&&F(j)?j:null},V=q=>{let j=U(q.target);j&&M(j);},B=q=>{if(q.pointerType&&q.pointerType!=="touch"&&q.pointerType!=="pen")return;let j=U(q.target);j&&M(j);};return document.addEventListener("focusin",V,true),document.addEventListener("pointerdown",B,true),()=>{document.removeEventListener("focusin",V,true),document.removeEventListener("pointerdown",B,true);}},[S]);let h=J.useCallback(D=>{b(F=>F===D?F:D);},[b]),E=J.useCallback(D=>{h(D?"dark":"light");},[h]),L=J.useMemo(()=>N?"#fff":"#000",[N]),k={isDarkMode:N,themeMode:f,isNativeApp:c,isNativeLike:w,isNative:w,extras:m,nativeOverlayContainer:y,setIsDarkMode:E,setThemeMode:h,setNativeApp:d,setNativeOverlayContainer:x};return o(Ni.Provider,{value:k,children:u(cr,{children:[o(hi,{color:L,framework:m.framework}),u(ra,{delayDuration:0,children:[It(i==null?void 0:i.show)&&u(Si,{children:[u(ki,{...i==null?void 0:i.props,children:[It((P=i==null?void 0:i.header)==null?void 0:P.show)&&o(Ei,{children:o(Ii,{children:o(Fi,{children:o(Hi,{asChild:true,className:"data-[slot=sidebar-menu-button]:!p-1.5",children:"Header"})})})}),It((T=i==null?void 0:i.content)==null?void 0:T.show)&&o(Li,{children:(_=i==null?void 0:i.content)==null?void 0:_.children}),It((O=i==null?void 0:i.footer)==null?void 0:O.show)&&o(Di,{children:(W=i==null?void 0:i.footer)==null?void 0:W.children})]}),o(Mi,{"data-content-layout":i==null?void 0:i.contentLayout,className:s("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:o("div",{className:"h-full p-4 md:p-6",children:e})})]}),!It(i==null?void 0:i.show)&&o(jsxRuntime.Fragment,{children:e})]})]})})},vt=()=>{let e=J.useContext(Ni);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e},rx=()=>{let{extras:e}=vt();return e};var ia=J__namespace.forwardRef(({className:e,...t},n)=>u("svg",{ref:n,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:[o("path",{d:"M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7Z"}),o("circle",{cx:12,cy:12,r:3})]}));ia.displayName="EyeIcon";var sa=J__namespace.forwardRef(({className:e,...t},n)=>u("svg",{ref:n,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:[o("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"}),o("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"}),o("line",{x1:1,x2:23,y1:1,y2:23})]}));sa.displayName="EyeOffIcon";var qe=J__namespace.forwardRef(({className:e,type:t,onFocus:n,...a},r)=>{let i=J__namespace.useCallback(b=>{typeof r=="function"?r(b):r&&(r.current=b);},[r]),c=J__namespace.useCallback(b=>{n==null||n(b),!b.defaultPrevented&&Go(b.currentTarget);},[n]),[d,l]=J__namespace.useState(false),g=t!=null?t:"text",m=g==="password",C=m&&d?"text":g;J__namespace.useEffect(()=>{!m&&d&&l(false);},[m,d]);let R=d?"Hide password":"Show password",f=s(at,"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?u("div",{className:s("relative inline-flex w-full",e),children:[o("input",{ref:i,type:C,"data-slot":"input",onFocus:c,className:f,...a}),m&&o("button",{type:"button",onClick:()=>l(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":R,"aria-pressed":d,children:d?o(sa,{"aria-hidden":true,className:"size-4"}):o(ia,{"aria-hidden":true,className:"size-4"})})]}):o("input",{ref:i,type:C,"data-slot":"input",onFocus:c,className:f,...a})});qe.displayName="Input";var la=(e,t)=>{if(typeof t=="number"){let n=Math.pow(10,t);return (Math.round(e*n)/n).toString()}return e.toString()},vu=e=>e==null?"":typeof e=="number"?e.toString():e.trim(),hu=e=>e===0?/^-?\d*$/:typeof e=="number"?new RegExp(`^-?\\d*(\\.\\d{0,${e}})?$`):/^-?\d*(\.\d*)?$/,yu=e=>e===""||e==="-"||e==="."||e==="-.",ca=(e,t)=>{if(yu(e))return null;let n=Number(e);if(Number.isNaN(n))return null;if(typeof t=="number"){let a=Math.pow(10,t);return Math.round(n*a)/a}return n},da=J__namespace.forwardRef(({value:e,defaultValue:t,onChange:n,min:a,max:r,decimals:i,formatter:c,parser:d,onBlur:l,onFocus:g,inputMode:m,pattern:C,...R},f)=>{let b=J__namespace.useMemo(()=>hu(i),[i]),p=J__namespace.useMemo(()=>{var P;let k=(P=e!=null?e:t)!=null?P:null;return k===null?"":la(k,i)},[e,t,i]),[v,y]=J__namespace.useState(p),[x,N]=J__namespace.useState(false);J__namespace.useEffect(()=>{if(e===void 0)return;let k=e===null?"":la(e,i);y(P=>P===k?P:k);},[e,i]);let w=J__namespace.useCallback(k=>{if(k===null)return null;let P=k;return typeof a=="number"&&(P=Math.max(a,P)),typeof r=="number"&&(P=Math.min(r,P)),P},[a,r]),S=k=>{let P=d?vu(d(k.target.value)):k.target.value;if(!b.test(P)&&P!=="")return;y(P);let T=ca(P,i);n==null||n(T);},h=k=>{N(true),g==null||g(k);},E=k=>{N(false);let P=ca(v,i),T=w(P);if(T===null)v!==""&&(y(""),n==null||n(null));else if(T!==P){let _=la(T,i);y(_),n==null||n(T);}l==null||l(k);},L=J__namespace.useMemo(()=>{if(x)return v;if(c){let k=ca(v,i),P=k!=null?k:v===""?null:v;return c(P)}return v},[c,x,v,i]);return o(qe,{ref:f,value:L,onChange:S,onFocus:h,onBlur:E,inputMode:m!=null?m:i===0?"numeric":"decimal",pattern:C!=null?C:i===0?"-?\\d*":void 0,...R})});da.displayName="InputNumeric";var Ai="X",xu=e=>e.replace(/\D/g,""),wu=(e,t)=>e.split("").reduce((n,a)=>a===t?n+1:n,0),Ru=(e,t,n)=>{if(!t)return e;let a="",r=0;for(let i of t)if(i===n)if(r<e.length)a+=e[r],r+=1;else break;else (e.length>0||a.length>0)&&(a+=i);return a},ua=J__namespace.forwardRef(({mask:e,placeholderChar:t=Ai,value:n,defaultValue:a,onChange:r,inputMode:i,...c},d)=>{var p;let l=(p=t[0])!=null?p:Ai,g=J__namespace.useMemo(()=>wu(e,l),[e,l]),m=J__namespace.useCallback(v=>{if(!v)return "";let y=xu(v);return g===0?"":y.slice(0,g)},[g]),[C,R]=J__namespace.useState(()=>{var v;return m((v=n!=null?n:a)!=null?v:"")});J__namespace.useEffect(()=>{if(n===void 0)return;let v=m(n);R(y=>y===v?y:v);},[n,m]),J__namespace.useEffect(()=>{n===void 0&&R(v=>m(v));},[e,l,m,n]);let f=v=>{let y=m(v.target.value);n===void 0&&R(y),r==null||r(y);},b=J__namespace.useMemo(()=>Ru(C,e,l),[e,l,C]);return o(qe,{ref:d,value:b,onChange:f,inputMode:i!=null?i:"numeric",...c})});ua.displayName="InputMask";function Qt({...e}){return o(radixUi.Popover.Root,{"data-slot":"popover",...e})}function zi({...e}){return o(radixUi.Popover.Trigger,{"data-slot":"popover-trigger",...e})}function Zt({className:e,align:t="center",sideOffset:n=4,...a}){return o(radixUi.Popover.Portal,{children:o(radixUi.Popover.Content,{"data-slot":"popover-content",align:t,sideOffset:n,className:s("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 cn({...e}){return o(radixUi.Popover.Anchor,{"data-slot":"popover-anchor",...e})}function eo({...e}){return o(vaul.Drawer.Root,{"data-slot":"drawer",...e})}function dn({...e}){return o(vaul.Drawer.Trigger,{"data-slot":"drawer-trigger",...e})}function Cu({...e}){return o(vaul.Drawer.Portal,{"data-slot":"drawer-portal",...e})}function un({...e}){return o(vaul.Drawer.Close,{"data-slot":"drawer-close",...e})}function Pu({className:e,...t}){return o(vaul.Drawer.Overlay,{"data-slot":"drawer-overlay",className:s("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 to({className:e,children:t,...n}){return u(Cu,{"data-slot":"drawer-portal",children:[o(Pu,{}),u(vaul.Drawer.Content,{"data-slot":"drawer-content",className:s("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),...n,children:[o("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 oo({className:e,...t}){return o("div",{"data-slot":"drawer-header",className:s("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 Bi({className:e,...t}){return o("div",{"data-slot":"drawer-footer",className:s("mt-auto flex flex-col gap-2 p-4",e),...t})}function no({className:e,...t}){return o(vaul.Drawer.Title,{"data-slot":"drawer-title",className:s("text-foreground font-semibold",e),...t})}function Ex({className:e,...t}){return o(vaul.Drawer.Description,{"data-slot":"drawer-description",className:s("text-muted-foreground text-sm",e),...t})}var va="YYYY-MM-DD",Du=["Su","Mo","Tu","We","Th","Fr","Sa"],Lu=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],pa={bottomLeft:{side:"bottom",align:"start"},bottomRight:{side:"bottom",align:"end"},topLeft:{side:"top",align:"start"},topRight:{side:"top",align:"end"}},Iu=e=>{var t;return e&&(t=pa[e])!=null?t:pa.bottomLeft},Ui=e=>e?typeof e=="function"?[va]:Array.isArray(e)?e:[e]:[va],pn=(e,t)=>{if(!e)return "";if(typeof t=="function")return t(e);let n=Ui(t),[a]=n;return e.format(a!=null?a:va)},Fu=(e,t)=>{let n=e.trim();if(!n)return null;if(t&&typeof t=="function"){let i=rt(n);return i.isValid()?i:null}let a=Ui(t);for(let i of a){let c=oi(n,i);if(c!=null&&c.isValid())return c}let r=rt(n);return r.isValid()?r:null},ma=(e,t,n)=>{if(!e||!t)return false;switch(n){case "month":return e.isSame(t,"month");case "year":case "decade":return e.isSame(t,"year");default:return e.isSame(t,"day")}},Hu=e=>{let t=Math.floor(e.year()/10)*10;return e.year(t).startOf("year")},mn=e=>{let t=Hu(e),n=t.add(9,"year").endOf("year");return {start:t,end:n}},_t=(e,t,n)=>{let a=e;return t&&a.isBefore(t)&&(a=t),n&&a.isAfter(n)&&(a=n),a},Ot=44,fn=5,Vi=40,fa=6,ji=(e,t)=>t<=0?0:Math.min(Math.max(e,0),t),ga=({label:e,options:t,selectedValue:n,onValueChange:a,open:r,infinite:i=true})=>{let c=J__namespace.useRef(null),d=J__namespace.useRef(null),[l,g]=J__namespace.useState(()=>({start:0,end:Math.min(t.length,fn+fa)}));J__namespace.useEffect(()=>{i||g(x=>{if(t.length===0)return {start:0,end:0};let N=t.length-1,w=Math.min(x.start,N),S=fn+fa,h=Math.max(w+S,w+1),E=Math.min(t.length,h);return x.start===w&&x.end===E?x:{start:w,end:E}});},[i,t.length]);let m=J__namespace.useCallback(x=>{if(i||t.length===0)return;let N=ji(x,t.length-1),w=fn+fa,S=Math.floor(w/2),h=Math.max(0,N-S),E=Math.min(t.length,N+S+1);g(L=>L.start===h&&L.end===E?L:{start:h,end:E});},[i,t.length]),C=J__namespace.useMemo(()=>{if(t.length===0)return [];if(!i)return t;let x=[];for(let N=0;N<Vi;N+=1)for(let w of t)x.push(w);return x},[i,t]),R=J__namespace.useCallback((x,N="auto")=>{if(!c.current||t.length===0||C.length===0)return;let w=t.findIndex(k=>k.value===x),S=w>=0?w:0,h=Math.floor(Vi/2),L=(i?S+t.length*h:S)*Ot;c.current.scrollTo({top:L,behavior:N}),i||m(S);},[C.length,i,t,m]);J__namespace.useLayoutEffect(()=>{r&&R(n);},[R,r,t,n]),J__namespace.useEffect(()=>{if(i||!r)return;let x=t.findIndex(N=>N.value===n);m(x>=0?x:0);},[i,r,t,n,m]),J__namespace.useEffect(()=>()=>{d.current!==null&&clearTimeout(d.current);},[]);let f=J__namespace.useCallback(x=>{C.length===0||t.length===0||(d.current!==null&&clearTimeout(d.current),d.current=setTimeout(()=>{var h,E;if(!c.current)return;let N=Math.round(c.current.scrollTop/Ot);i||(N=ji(N,C.length-1));let w=C[N];if(!w)return;if(!a(w.value)){R(n,"smooth");return}if(i){let L=t.length,k=C.length-t.length-1;if(N<=L||N>=k)R(w.value);else {let P=N*Ot;(h=c.current)==null||h.scrollTo({top:P});}}else {m(N);let L=N*Ot;(E=c.current)==null||E.scrollTo({top:L});}},80));},[R,C,i,a,t,t.length,n,m]);if(t.length===0)return o("div",{className:"flex-1",children:o("p",{className:"text-center text-sm text-muted-foreground",children:"No options"})});let b=(fn-1)/2*Ot,p=i?C:t.slice(l.start,l.end),v=l.start*Ot,y=t.length*Ot;return u("div",{className:"flex flex-1 flex-col items-center gap-2",children:[o("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:e}),u("div",{className:"relative h-56 w-full overflow-hidden",children:[o("div",{className:"pointer-events-none absolute inset-x-0 top-1/2 -translate-y-1/2 border-y border-primary/30"}),o("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?C.map((x,N)=>{let w=`${N}-${x.value}`,S=x.value===n;return o("div",{className:s("flex h-11 items-center justify-center text-base transition-colors",S?"font-medium text-foreground":"text-muted-foreground"),children:x.label},w)}):o("div",{style:{height:y},children:o("div",{style:{transform:`translateY(${v}px)`},children:p.map((x,N)=>{let S=`${l.start+N}-${x.value}`,h=x.value===n;return o("div",{className:s("flex h-11 items-center justify-center text-base transition-colors",h?"font-medium text-foreground":"text-muted-foreground"),children:x.label},S)})})})})]})]})},_u=(e,t)=>e&&e!=="time"?e:t==="month"?"month":t==="year"?"year":"date",Ou=e=>{switch(e){case "month":case "year":return e;case "decade":return "year";default:return "day"}},Au=(e,t,n,a="date")=>{let r=Ou(a);return !(t&&e.isBefore(t,r)||n&&e.isAfter(n,r))},zu=e=>{var t,n,a,r,i,c,d;return {placeholder:(t=e==null?void 0:e.placeholder)!=null?t:"Select date",today:(n=e==null?void 0:e.today)!=null?n:"Today",clear:(a=e==null?void 0:e.clear)!=null?a:"Clear",months:(r=e==null?void 0:e.months)!=null?r:Lu,weekDays:(i=e==null?void 0:e.weekDays)!=null?i:Du,yearFormat:(c=e==null?void 0:e.yearFormat)!=null?c:"YYYY",decadeFormat:(d=e==null?void 0:e.decadeFormat)!=null?d:((l,g)=>`${l.format("YYYY")}-${g.format("YYYY")}`)}},ba=e=>{let t=J__namespace.useRef(e);return J__namespace.useEffect(()=>{t.current=e;},[e]),t},Bu="hsl(var(--primary))",ha=J__namespace.forwardRef((e,t)=>{var Wa,$a,Ya,Ka,Ja,Xa,Qa;let{value:n,defaultValue:a=null,onChange:r,onOpenChange:i,allowClear:c=true,autoFocus:d=false,defaultOpen:l,disabled:g=false,disabledDate:m,format:C,preserveInvalidOnBlur:R=false,inputReadOnly:f=false,locale:b,minDate:p,maxDate:v,mode:y,needConfirm:x=false,open:N,panelRender:w,picker:S,placeholder:h,placement:E="bottomLeft",prefix:L,presets:k,size:P="middle",status:T,variant:_="outlined",className:O,style:W,inputClassName:D,inputStyle:F,onFocus:A,onBlur:M,name:U,id:V,...B}=e,{isNative:q}=vt(),j=Ye(),G=q||j,[H,te]=J__namespace.useState(null),K=J__namespace.useMemo(()=>zu(b),[b]),ce=ba(r),le=ba(i),re=ba(C),ge=n!==void 0,[fe,$]=J__namespace.useState(a),ie=(Wa=ge?n:fe)!=null?Wa:null,pe=J__namespace.useMemo(()=>_u(y,S),[y,S]),[he,Re]=J__namespace.useState(pe),ne=J__namespace.useCallback(I=>{var z;ge||$(I),(z=ce.current)==null||z.call(ce,I,pn(I,re.current));},[re,ge,ce]),[oe,ye]=J__namespace.useState(ie);J__namespace.useEffect(()=>{ye(ie);},[ie]);let[de,we]=J__namespace.useState(()=>{let I=ie!=null?ie:rt();return _t(I,p,v)}),Te=N!==void 0,[me,De]=J__namespace.useState(!!l),Pe=Te?!!N:me,Ne=J__namespace.useCallback(I=>{var z;Te||De(I),(z=le.current)==null||z.call(le,I);},[Te,le]),be=x?oe:ie;J__namespace.useEffect(()=>{Pe&&(Re(pe),we(I=>_t(be!=null?be:I,p,v)));},[be,pe,v,p,Pe]);let[dt,xe]=J__namespace.useState(()=>pn(be,re.current)),kt=J__namespace.useRef(false);J__namespace.useEffect(()=>{kt.current||xe(pn(be,re.current));},[be,re]);let Ve=J__namespace.useMemo(()=>({"--date-primary-color":Bu}),[]),xt=J__namespace.useRef(null),ot=J__namespace.useCallback(I=>{g||(Ne(I),I&&(Re(pe),we(z=>_t(be!=null?be:z,p,v))));},[be,g,pe,v,p,Ne]),wt=J__namespace.useCallback(I=>Fu(I,re.current),[re]),Ee=J__namespace.useCallback((I,z)=>Au(I,p,v,z)?m?m(I,{type:z}):false:true,[m,v,p]),Ce=J__namespace.useCallback(I=>pn(I,re.current),[re]),Mt=J__namespace.useCallback(I=>{Ee(I,"date")||(x?(ye(I),xe(Ce(I))):(ne(I),xe(Ce(I)),Ne(false)));},[ne,Ce,Ee,x,Ne]),Vt=I=>{let z=de.month(I);if(we(z),pe==="month"){let Y=z.startOf("month");if(Ee(Y,"month"))return;x?(ye(Y),xe(Ce(Y))):(ne(Y),xe(Ce(Y)),Ne(false));}else Re("date");},ae=I=>{let z=de.year(I);if(we(z),pe==="year"){let Y=z.startOf("year");if(Ee(Y,"year"))return;x?(ye(Y),xe(Ce(Y))):(ne(Y),xe(Ce(Y)),Ne(false));}else Re("month");},Ke=I=>{let z=de.year(I);we(z),Re("year");},je=I=>{we(z=>{let Y=I==="date"?z.subtract(1,"month"):I==="month"?z.subtract(1,"year"):z.subtract(10,"year");return _t(Y,p,v)});},ut=I=>{we(z=>{let Y=I==="date"?z.add(1,"month"):I==="month"?z.add(1,"year"):z.add(10,"year");return _t(Y,p,v)});},kn=()=>{let z=de.startOf("month").startOf("week"),Y=[];for(let Z=0;Z<6;Z+=1){let Fe=[];for(let $e=0;$e<7;$e+=1){let Se=z.add(Z*7+$e,"day"),pt=Se.month()===de.month()&&Se.year()===de.year(),bo=ma(Se,be,"date"),Cl=Se.isSame(rt(),"day"),_n=Ee(Se,"date");Fe.push(o("button",{type:"button",disabled:_n,onClick:()=>Mt(Se),className:s("flex h-8 w-8 items-center justify-center rounded-md text-sm transition",!pt&&"text-muted-foreground/70",bo&&"bg-[var(--date-primary-color)] text-white",Cl&&!bo&&"border border-[var(--date-primary-color)]",_n&&"cursor-not-allowed opacity-40",!_n&&!bo&&"hover:bg-muted"),style:Ve,children:Se.date()},Se.format("YYYY-MM-DD")));}Y.push(o("div",{className:"grid grid-cols-7 gap-1",children:Fe},`week-${Z}`));}return u("div",{className:"space-y-1",children:[o("div",{className:"grid grid-cols-7 gap-1 text-center text-xs text-muted-foreground",children:K.weekDays.map(Z=>o("div",{children:Z},Z))}),o("div",{className:"space-y-1",children:Y})]})},Oo=()=>o("div",{className:"grid grid-cols-3 gap-2",children:K.months.map((I,z)=>{let Y=de.month(z),Z=ma(Y,be,"month"),Fe=Ee(Y.startOf("month"),"month");return o("button",{type:"button",disabled:Fe,onClick:()=>Vt(z),className:s("flex h-12 flex-col items-center justify-center rounded-md text-sm transition",Z&&"bg-[var(--date-primary-color)] text-white",Fe&&"cursor-not-allowed opacity-40",!Fe&&!Z&&"hover:bg-muted"),style:Ve,children:I},I)})}),Mn=()=>{let{start:I}=mn(de),z=[];for(let Y=-1;Y<11;Y+=1)z.push(I.year()+Y);return o("div",{className:"grid grid-cols-4 gap-2",children:z.map(Y=>{let Z=de.year(Y),Fe=ma(Z,be,"year"),$e=Ee(Z.startOf("year"),"year"),Se=Y<I.year()||Y>I.year()+9;return o("button",{type:"button",disabled:$e,onClick:()=>ae(Y),className:s("flex h-12 flex-col items-center justify-center rounded-md text-sm transition",Fe&&"bg-[var(--date-primary-color)] text-white",$e&&"cursor-not-allowed opacity-40",!$e&&!Fe&&"hover:bg-muted",Se&&"text-muted-foreground/70"),style:Ve,children:Y},Y)})})},Ao=()=>{let{start:I}=mn(de),z=I.year()-10,Y=[];for(let Z=0;Z<12;Z+=1)Y.push(z+Z*10);return o("div",{className:"grid grid-cols-4 gap-2",children:Y.map(Z=>{let Fe=Z+9,$e=be==null?void 0:be.year(),Se=$e!==void 0&&$e>=Z&&$e<=Fe,pt=Ee(de.year(Z).startOf("year"),"year"),bo=Fe<I.year()||Z>I.year()+9;return u("button",{type:"button",disabled:pt,onClick:()=>Ke(Z),className:s("flex h-12 flex-col items-center justify-center rounded-md text-sm transition",Se&&"bg-[var(--date-primary-color)] text-white",pt&&"cursor-not-allowed opacity-40",!pt&&!Se&&"hover:bg-muted",bo&&"text-muted-foreground/70"),style:Ve,children:[Z,"-",Fe]},`${Z}-${Fe}`)})})},En=()=>{switch(he){case "month":return Oo();case "year":return Mn();case "decade":return Ao();default:return kn()}},Dn=I=>{kt.current=true,xe(I.target.value);},Ln=I=>{A==null||A(I),ot(true);},zo=I=>{M==null||M(I);let z=()=>{kt.current=false;let Y=wt(dt);Y&&!Ee(Y,"date")?x?(ye(Y),xe(Ce(Y))):(ne(Y),xe(Ce(Y))):R||xe(Ce(be));};typeof window!="undefined"?window.setTimeout(z,50):z();},jt=I=>{I==null||I.preventDefault(),I==null||I.stopPropagation(),!g&&(ye(null),we(()=>_t(rt(),p,v)),x?xe(""):(ne(null),xe(""),Ne(false)));},mo=()=>{let I=rt();Ee(I,"date")||(x?(ye(I),xe(Ce(I))):(ne(I),xe(Ce(I)),Ne(false)));},fo=()=>{x&&(ne(oe!=null?oe:null),Ne(false));},X=()=>{x&&(ye(ie),xe(Ce(ie)),Ne(false));},ue=typeof c=="object"&&c!==null&&!Array.isArray(c)?c:void 0,We=!!c&&!g&&!!dt,nt=($a=ue==null?void 0:ue.clearIcon)!=null?$a:o(lucideReact.X,{className:"h-4 w-4",strokeWidth:2}),{side:In,align:cl}=Iu(E),dl=(Ya={large:"lg",middle:"md",small:"sm"}[P])!=null?Ya:"md",ul={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)))"}},pl={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"},ml={...T?ul[T]:{},...F!=null?F:{}},fl={sm:"h-8 text-sm",md:`${at} text-sm`,lg:"h-11 text-base"},gl={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"},za=u("div",{className:"w-[280px] select-none",role:"dialog","aria-modal":"true",children:[u("div",{className:"flex items-center justify-between px-2 pt-2",children:[u("div",{className:"flex items-center gap-1",children:[o("button",{type:"button",className:"flex h-8 w-8 items-center justify-center rounded-md hover:bg-muted",onClick:()=>je(he==="date"?"month":he==="month"?"year":"decade"),children:o(lucideReact.ChevronsLeft,{className:"h-4 w-4"})}),he==="date"&&o("button",{type:"button",className:"flex h-8 w-8 items-center justify-center rounded-md hover:bg-muted",onClick:()=>je("date"),children:o(lucideReact.ChevronLeft,{className:"h-4 w-4"})})]}),o("div",{className:"flex flex-col items-center",children:u("button",{type:"button",className:"text-sm font-medium hover:text-[var(--date-primary-color)]",style:Ve,onClick:()=>{he==="date"?Re("month"):he==="month"?Re("year"):he==="year"&&Re("decade");},children:[he==="date"&&`${K.months[de.month()]} ${de.format(K.yearFormat)}`,he==="month"&&de.format(K.yearFormat),he==="year"&&(()=>{let{start:I,end:z}=mn(de);return K.decadeFormat(I,z)})(),he==="decade"&&(()=>{let{start:I,end:z}=mn(de);return `${I.subtract(10,"year").format(K.yearFormat)}-${z.add(10,"year").format(K.yearFormat)}`})()]})}),u("div",{className:"flex items-center gap-1",children:[he==="date"&&o("button",{type:"button",className:"flex h-8 w-8 items-center justify-center rounded-md hover:bg-muted",onClick:()=>ut("date"),children:o(lucideReact.ChevronRight,{className:"h-4 w-4"})}),o("button",{type:"button",className:"flex h-8 w-8 items-center justify-center rounded-md hover:bg-muted",onClick:()=>ut(he==="date"?"month":he==="month"?"year":"decade"),children:o(lucideReact.ChevronsRight,{className:"h-4 w-4"})})]})]}),o("div",{className:"px-2 pb-2 pt-3",children:En()}),u("div",{className:"flex items-center justify-between gap-2 border-t px-2 py-2",children:[o("div",{className:"flex flex-wrap items-center gap-2",children:k==null?void 0:k.map((I,z)=>{let Y=typeof I.value=="function"?I.value():I.value,Z=Y?Ee(Y,"date"):false;return o("button",{type:"button",disabled:Z,onClick:()=>{!Y||Z||(x?(ye(Y),xe(Ce(Y))):(ne(Y),xe(Ce(Y)),Ne(false)));},className:s("rounded-md px-2 py-1 text-xs transition",Z?"cursor-not-allowed bg-muted text-muted-foreground":"bg-muted hover:bg-muted/80"),children:I.label},z)})}),u("div",{className:"flex items-center gap-2",children:[o("button",{type:"button",onClick:mo,className:"text-xs font-medium text-[var(--date-primary-color)] hover:underline disabled:text-muted-foreground",disabled:Ee(rt(),"date"),style:Ve,children:K.today}),x?u("div",{className:"flex items-center gap-2",children:[o("button",{type:"button",className:"rounded-md px-2 py-1 text-xs hover:bg-muted",onClick:X,children:K.clear}),o("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:Ve,onClick:fo,children:"OK"})]}):o("button",{type:"button",className:"rounded-md px-2 py-1 text-xs hover:bg-muted",onClick:I=>jt(I),disabled:!ie,children:K.clear})]})]})]}),bl=w?w(za):za;J__namespace.useEffect(()=>{if(!d)return;let I=()=>{var z;(z=xt.current)==null||z.focus();};typeof window!="undefined"?window.setTimeout(I,0):I();},[d]),J__namespace.useImperativeHandle(t,()=>xt.current);let vl=!g&&(f||G),Ba=u("div",{role:"combobox","aria-expanded":Pe,"aria-haspopup":"dialog",className:s("relative w-full",O),style:W,children:[L&&o("div",{className:"pointer-events-none absolute inset-y-0 left-3 flex items-center text-muted-foreground",children:L}),o(qe,{...B,ref:xt,value:dt,onChange:Dn,onFocus:Ln,onBlur:zo,autoFocus:d,readOnly:f||G,disabled:g,placeholder:h!=null?h:K.placeholder,name:U,id:V,className:s("pr-10 text-sm",pl[_],L&&"pl-10",g&&"cursor-not-allowed opacity-60",vl&&"cursor-pointer",fl[dl],T?gl[T]:void 0,D),style:ml,onClick:I=>{var z;(z=B.onClick)==null||z.call(B,I),!g&&G&&ot(true);}}),We&&o("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=>jt(I),children:nt}),o("div",{className:"pointer-events-none absolute inset-y-0 right-3 flex items-center text-muted-foreground",children:o(lucideReact.Calendar,{className:"h-4 w-4"})})]}),go=J__namespace.useMemo(()=>{var z,Y;return ((Y=x?(z=oe!=null?oe:ie)!=null?z:de:be!=null?be:de)!=null?Y:rt()).clone()},[be,oe,x,ie,de]),hl=J__namespace.useMemo(()=>K.months.map((I,z)=>({label:I,value:z})),[K.months]),Va=go.daysInMonth(),yl=J__namespace.useMemo(()=>Array.from({length:Va},(I,z)=>({label:String(z+1).padStart(2,"0"),value:z+1})),[Va]),ja=go.year(),Ua=(Ka=p==null?void 0:p.year())!=null?Ka:ja-100,Ga=(Ja=v==null?void 0:v.year())!=null?Ja:ja+100,Fn=Math.min(Ua,Ga),qa=Math.max(Ua,Ga),xl=J__namespace.useMemo(()=>Array.from({length:qa-Fn+1},(I,z)=>{let Y=Fn+z;return {label:String(Y),value:Y}}),[qa,Fn]),Hn=J__namespace.useCallback((I,z)=>{var Fe,$e;let Z=($e=x?(Fe=oe!=null?oe:ie)!=null?Fe:de:ie!=null?ie:de)!=null?$e:rt();if(I==="month"){let Se=Z.month(z),pt=Math.min(Z.date(),Se.daysInMonth());Z=Se.date(pt);}else if(I==="date"){let Se=Math.min(z,Z.daysInMonth());Z=Z.date(Se);}else {let Se=Z.year(z),pt=Math.min(Z.date(),Se.daysInMonth());Z=Se.date(pt);}return Z=_t(Z,p,v),Ee(Z,"date")?false:(x?(ye(Z),xe(Ce(Z))):(ne(Z),xe(Ce(Z))),we(Z),true)},[ne,oe,Ce,Ee,v,p,x,ie,we,de]),wl=(Qa=(Xa=typeof B["aria-label"]=="string"?B["aria-label"]:void 0)!=null?Xa:h)!=null?Qa:K.placeholder,Rl=J__namespace.useCallback(I=>{ot(I);},[ot]);if(J__namespace.useEffect(()=>{var z,Y;if(!G||!Pe||!V||typeof document=="undefined")return;te(null);let I=document.querySelector(`label[for="${V}"]`);I&&te((Y=(z=I.textContent)==null?void 0:z.trim())!=null?Y:null);},[V,Pe,G]),G){let I=H!=null?H:wl;return u(eo,{open:Pe,onOpenChange:Rl,children:[o(dn,{asChild:true,children:Ba}),u(to,{className:"mt-10 max-h-[min(540px,calc(100dvh-6rem))] rounded-t-3xl bg-background",children:[o(oo,{className:"px-6 pb-2 pt-4",children:o(no,{className:"text-base font-medium text-foreground",children:I})}),u("div",{className:"flex flex-1 flex-col gap-6 px-6 pb-6",children:[u("div",{className:"flex gap-4",children:[o(ga,{open:Pe,label:"Month",options:hl,selectedValue:go.month(),onValueChange:z=>Hn("month",z)}),o(ga,{open:Pe,label:"Day",options:yl,selectedValue:go.date(),onValueChange:z=>Hn("date",z)}),o(ga,{open:Pe,label:"Year",options:xl,selectedValue:go.year(),onValueChange:z=>Hn("year",z),infinite:false})]}),u("div",{className:"mt-auto flex items-center justify-between",children:[o(Q,{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:Ve,onClick:mo,children:K.today}),u("div",{className:"flex items-center gap-3",children:[c?o(Q,{type:"button",variant:"outline",size:"sm",className:"text-muted-foreground hover:text-foreground",onClick:z=>jt(z),children:K.clear}):null,x?u(jsxRuntime.Fragment,{children:[o(Q,{type:"button",variant:"ghost",size:"sm",className:"hover:bg-muted",onClick:X,children:"Cancel"}),o(Q,{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:Ve,onClick:fo,children:"OK"})]}):o(un,{asChild:true,children:o(Q,{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:Ve,children:"Done"})})]})]})]})]})]})}return u(Qt,{open:Pe,onOpenChange:ot,children:[o(cn,{asChild:true,children:Ba}),o(Zt,{className:"w-auto border border-border bg-popover p-0",align:cl,side:In,children:bl})]})});ha.displayName="DatePicker";function Gi({...e}){return o(radixUi.DropdownMenu.Root,{"data-slot":"dropdown-menu",...e})}function $x({...e}){return o(radixUi.DropdownMenu.Portal,{"data-slot":"dropdown-menu-portal",...e})}var ya=J__namespace.forwardRef(({...e},t)=>o(radixUi.DropdownMenu.Trigger,{ref:t,"data-slot":"dropdown-menu-trigger",...e}));ya.displayName=radixUi.DropdownMenu.Trigger.displayName;var xa=J__namespace.forwardRef(({className:e,sideOffset:t=4,...n},a)=>o(radixUi.DropdownMenu.Portal,{children:o(radixUi.DropdownMenu.Content,{ref:a,"data-slot":"dropdown-menu-content",sideOffset:t,className:s("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),...n})}));xa.displayName=radixUi.DropdownMenu.Content.displayName;function Yx({...e}){return o(radixUi.DropdownMenu.Group,{"data-slot":"dropdown-menu-group",...e})}function Kx({className:e,inset:t,variant:n="default",...a}){return o(radixUi.DropdownMenu.Item,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:s("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 qi({className:e,children:t,checked:n,...a}){return u(radixUi.DropdownMenu.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:s("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:n,...a,children:[o("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:o(radixUi.DropdownMenu.ItemIndicator,{children:o(lucideReact.CheckIcon,{className:"size-4"})})}),t]})}function Jx({...e}){return o(radixUi.DropdownMenu.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...e})}function Xx({className:e,children:t,...n}){return u(radixUi.DropdownMenu.RadioItem,{"data-slot":"dropdown-menu-radio-item",className:s("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),...n,children:[o("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:o(radixUi.DropdownMenu.ItemIndicator,{children:o(lucideReact.CircleIcon,{className:"size-2 fill-current"})})}),t]})}function Wi({className:e,inset:t,...n}){return o(radixUi.DropdownMenu.Label,{"data-slot":"dropdown-menu-label","data-inset":t,className:s("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...n})}function $i({className:e,...t}){return o(radixUi.DropdownMenu.Separator,{"data-slot":"dropdown-menu-separator",className:s("bg-border -mx-1 my-1 h-px",e),...t})}function Qx({className:e,...t}){return o("span",{"data-slot":"dropdown-menu-shortcut",className:s("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}function Zx({...e}){return o(radixUi.DropdownMenu.Sub,{"data-slot":"dropdown-menu-sub",...e})}var Gu=J__namespace.forwardRef(({className:e,inset:t,children:n,...a},r)=>u(radixUi.DropdownMenu.SubTrigger,{ref:r,"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:s("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:[n,o(lucideReact.ChevronRightIcon,{className:"ml-auto size-4"})]}));Gu.displayName=radixUi.DropdownMenu.SubTrigger.displayName;var qu=J__namespace.forwardRef(({className:e,...t},n)=>o(radixUi.DropdownMenu.SubContent,{ref:n,"data-slot":"dropdown-menu-sub-content",className:s("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}));qu.displayName=radixUi.DropdownMenu.SubContent.displayName;var Wu=({children:e,...t})=>o("form",{...t,children:e});var ko=({className:e,...t})=>o("p",{"data-slot":"form-description",className:s("text-muted-foreground text-sm",e),...t});ko.displayName="FormDescription";var Mo=({className:e,...t})=>{let n=t.children;return n?o("p",{"data-slot":"form-message",className:s("text-destructive text-sm",e),...t,children:n}):null};Mo.displayName="FormMessage";var Eo=({className:e,...t})=>o(Me,{"data-slot":"form-label",className:e,...t});Eo.displayName="FormLabel";var $u=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange?e:(t=e.form)!=null?t:e},Yu=({name:e,label:t,description:n,className:a,checked:r,defaultChecked:i,onCheckedChange:c,checkboxProps:d,error:l,form:g,rules:m})=>{var k,P;let{onCheckedChange:C,...R}=d!=null?d:{},f=$u(g),b=f==null?void 0:f.values,p=f==null?void 0:f.errors,v=f==null?void 0:f.touched,y=b==null?void 0:b[e],x=p==null?void 0:p[e],N=v==null?void 0:v[e],w=(k=f==null?void 0:f.validationSequence)!=null?k:0,S=(P=N?x:void 0)!=null?P:l,h=y!==void 0?!!y:r!==void 0?r:void 0,E=T=>{var D,F,A;let _=T===true,W=!!m?Yi(_,m):void 0;if((D=f==null?void 0:f.setFieldError)==null||D.call(f,e,W),(F=f==null?void 0:f.setFieldValue)==null||F.call(f,e,_),(A=f==null?void 0:f.setFieldTouched)==null||A.call(f,e,true),f!=null&&f.handleChange){let M={target:{name:e,value:_,checked:_}};f.handleChange(M);}c==null||c(_),C==null||C(T);},L=J__namespace.useRef(w);return J__namespace.useEffect(()=>{let T=!!m,_=w!==L.current;if(!(f!=null&&f.setFieldError)||!T){L.current=w;return}if(!N&&!_){L.current=w;return}let W=Yi(y!==void 0?!!y:r!==void 0?r:!!i,m);W!==x&&f.setFieldError(e,W),L.current=w;},[r,i,x,N,y,e,f,m,w]),u("div",{className:s("items-start gap-2",a),children:[u("div",{className:"flex items-start gap-3",children:[o("div",{children:o(Ro,{name:e,...R,...h!==void 0?{checked:h}:{defaultChecked:i},"aria-invalid":!!S,onCheckedChange:E})}),u("div",{className:"grid gap-1.5 leading-none",children:[t?o(Eo,{className:"text-sm font-medium leading-none",children:t}):null,n?o(ko,{children:n}):null]})]}),o(Mo,{children:S})]})};Yu.displayName="FormCheckbox";function Yi(e,t){if(t){if(t.required&&!e)return typeof t.required=="string"?t.required:"This field is required";if(t.validate){let n=t.validate(e);if(typeof n=="string")return n;if(n===false)return "Invalid value"}}}var Ku={row:"flex-row","row-reverse":"flex-row-reverse",column:"flex-col","column-reverse":"flex-col-reverse"},Ju={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},Xu={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},bn={nowrap:"flex-nowrap",wrap:"flex-wrap","wrap-reverse":"flex-wrap-reverse"},vn={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"}},wa={...vn,small:vn.sm,middle:vn.md,large:vn.lg},Qu=J__namespace.forwardRef(({direction:e,vertical:t,align:n,justify:a,wrap:r=false,gap:i,gapX:c,gapY:d,inline:l=false,className:g,children:m,...C},R)=>{var p;let f=e!=null?e:t?"column":"row",b=typeof r=="boolean"?r?bn.wrap:bn.nowrap:(p=bn[r])!=null?p:bn.nowrap;return o("div",{ref:R,"data-slot":"flex",className:s(l?"inline-flex":"flex",Ku[f],n?Ju[n]:null,a?Xu[a]:null,b,i?wa[i].all:null,c?wa[c].x:null,d?wa[d].y:null,g),...C,children:m})});Qu.displayName="Flex";function Sw({...e}){return o(radixUi.HoverCard.Root,{"data-slot":"hover-card",...e})}function kw({...e}){return o(radixUi.HoverCard.Trigger,{"data-slot":"hover-card-trigger",...e})}function Mw({className:e,align:t="center",sideOffset:n=4,...a}){return o(radixUi.HoverCard.Portal,{"data-slot":"hover-card-portal",children:o(radixUi.HoverCard.Content,{"data-slot":"hover-card-content",align:t,sideOffset:n,className:s("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 Hw({className:e,containerClassName:t,...n}){return o(inputOtp.OTPInput,{"data-slot":"input-otp",containerClassName:s("flex items-center gap-2 has-disabled:opacity-50",t),className:s("disabled:cursor-not-allowed",e),...n})}function _w({className:e,...t}){return o("div",{"data-slot":"input-otp-group",className:s("flex items-center",e),...t})}function Ow({index:e,className:t,...n}){var d;let a=J__namespace.useContext(inputOtp.OTPInputContext),{char:r,hasFakeCaret:i,isActive:c}=(d=a==null?void 0:a.slots[e])!=null?d:{};return u("div",{"data-slot":"input-otp-slot","data-active":c,className:s("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),...n,children:[r,i&&o("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:o("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function Aw({...e}){return o("div",{"data-slot":"input-otp-separator",role:"separator",...e,children:o(lucideReact.MinusIcon,{})})}function Me({className:e,...t}){return o(radixUi.Label.Root,{"data-slot":"label",className:s("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 Yw({className:e,...t}){return o(radixUi.Menubar.Root,{"data-slot":"menubar",className:s("bg-background flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs",e),...t})}function Kw({...e}){return o(radixUi.Menubar.Menu,{"data-slot":"menubar-menu",...e})}function Jw({...e}){return o(radixUi.Menubar.Group,{"data-slot":"menubar-group",...e})}function ip({...e}){return o(radixUi.Menubar.Portal,{"data-slot":"menubar-portal",...e})}function Xw({...e}){return o(radixUi.Menubar.RadioGroup,{"data-slot":"menubar-radio-group",...e})}function Qw({className:e,...t}){return o(radixUi.Menubar.Trigger,{"data-slot":"menubar-trigger",className:s("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 Zw({className:e,align:t="start",alignOffset:n=-4,sideOffset:a=8,...r}){return o(ip,{children:o(radixUi.Menubar.Content,{"data-slot":"menubar-content",align:t,alignOffset:n,sideOffset:a,className:s("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 eR({className:e,inset:t,variant:n="default",...a}){return o(radixUi.Menubar.Item,{"data-slot":"menubar-item","data-inset":t,"data-variant":n,className:s("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 tR({className:e,children:t,checked:n,...a}){return u(radixUi.Menubar.CheckboxItem,{"data-slot":"menubar-checkbox-item",className:s("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:n,...a,children:[o("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:o(radixUi.Menubar.ItemIndicator,{children:o(lucideReact.CheckIcon,{className:"size-4"})})}),t]})}function oR({className:e,children:t,...n}){return u(radixUi.Menubar.RadioItem,{"data-slot":"menubar-radio-item",className:s("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),...n,children:[o("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:o(radixUi.Menubar.ItemIndicator,{children:o(lucideReact.CircleIcon,{className:"size-2 fill-current"})})}),t]})}function nR({className:e,inset:t,...n}){return o(radixUi.Menubar.Label,{"data-slot":"menubar-label","data-inset":t,className:s("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...n})}function aR({className:e,...t}){return o(radixUi.Menubar.Separator,{"data-slot":"menubar-separator",className:s("bg-border -mx-1 my-1 h-px",e),...t})}function rR({className:e,...t}){return o("span",{"data-slot":"menubar-shortcut",className:s("text-muted-foreground ml-auto text-xs tracking-widest",e),...t})}function iR({...e}){return o(radixUi.Menubar.Sub,{"data-slot":"menubar-sub",...e})}function sR({className:e,inset:t,children:n,...a}){return u(radixUi.Menubar.SubTrigger,{"data-slot":"menubar-sub-trigger","data-inset":t,className:s("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:[n,o(lucideReact.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]})}function lR({className:e,...t}){return o(radixUi.Menubar.SubContent,{"data-slot":"menubar-sub-content",className:s("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 sp="relative isolate overflow-hidden rounded-md bg-muted text-transparent",lp="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-['']",xn=J__namespace.forwardRef(({className:e,...t},n)=>o("div",{ref:n,"data-slot":"skeleton",className:s(sp,lp,e),...t}));xn.displayName="Skeleton";var Xi=J__namespace.forwardRef(({className:e,...t},n)=>o(xn,{ref:n,className:s("h-9 w-32 rounded-md",e),...t}));Xi.displayName="Skeleton.Button";var Qi=J__namespace.forwardRef(({className:e,...t},n)=>o(xn,{ref:n,className:s("h-9 w-full rounded-md",e),...t}));Qi.displayName="Skeleton.Input";var Pt=Object.assign(xn,{Button:Xi,Input:Qi});var dp={sm:"sm:max-w-sm",md:"sm:max-w-lg",lg:"sm:max-w-2xl",xl:"sm:max-w-3xl"},up=u("div",{className:"space-y-3","aria-hidden":true,children:[o(Pt,{className:"h-4 w-2/3"}),o(Pt,{className:"h-4 w-full"}),o(Pt,{className:"h-4 w-5/6"}),o(Pt,{className:"h-4 w-3/4"})]}),pp=e=>{switch(e){case "destructive":return "destructive";case "default":return "outline";case "primary":default:return "default"}},mp=({title:e,description:t,closable:n=true,className:a,classNames:r,loading:i=false,maskClosable:c=false,style:d,footer:l,onOk:g,onCancel:m,children:C,onOpenChange:R,size:f="md",...b})=>{var L,k,P,T,_,O,W;let p={show:(L=l==null?void 0:l.show)!=null?L:true,render:l==null?void 0:l.render,onOk:l==null?void 0:l.onOk,onCancel:l==null?void 0:l.onCancel,showOk:(k=l==null?void 0:l.showOk)!=null?k:true,showCancel:(P=l==null?void 0:l.showCancel)!=null?P:true,okText:(T=l==null?void 0:l.okText)!=null?T:"Save changes",cancelText:(_=l==null?void 0:l.cancelText)!=null?_:"Cancel",okLoading:l==null?void 0:l.okLoading,cancelLoading:l==null?void 0:l.cancelLoading,okDisabled:l==null?void 0:l.okDisabled,cancelDisabled:(O=l==null?void 0:l.cancelDisabled)!=null?O:l==null?void 0:l.cancelDisable,okType:l==null?void 0:l.okType,okButtonProps:l==null?void 0:l.okButtonProps,cancelButtonProps:l==null?void 0:l.cancelButtonProps,size:(W=l==null?void 0:l.size)!=null?W:"default"},v=J__namespace.useCallback(()=>{var D;(D=p.onCancel)==null||D.call(p),m==null||m();},[p.onCancel,m]),y=J__namespace.useCallback(()=>{var D;(D=p.onOk)==null||D.call(p),g==null||g();},[p.onOk,g]),x=J__namespace.useCallback(D=>{D||v(),R==null||R(D);},[v,R]),N=J__namespace.useCallback(D=>{c||D.preventDefault();},[c]),w=J__namespace.useCallback(D=>{n||D.preventDefault();},[n]),S=s(dp[f],a,r==null?void 0:r.content),h=o(framerMotion.AnimatePresence,{mode:"wait",children:i?o(framerMotion.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.18,ease:"easeInOut"},className:s("space-y-4",r==null?void 0:r.body),children:up},"modal-loading"):o(framerMotion.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{duration:.18,ease:"easeInOut"},className:s("space-y-3 text-sm text-muted-foreground",r==null?void 0:r.body),"aria-busy":i,children:C},"modal-content")}),E=()=>{var le,re,ge,fe,$,ie,pe,he,Re,ne;if(!p.show)return null;if(p.render)return o("div",{className:s("mt-2",r==null?void 0:r.footer),children:p.render});if(!p.showOk&&!p.showCancel)return null;let{onClick:D,variant:F,size:A,loading:M,disabled:U,...V}=(le=p.okButtonProps)!=null?le:{},{onClick:B,variant:q,size:j,loading:G,disabled:H,...te}=(re=p.cancelButtonProps)!=null?re:{},K=oe=>{D==null||D(oe),!oe.defaultPrevented&&y();},ce=oe=>{B==null||B(oe),!oe.defaultPrevented&&v();};return o("div",{className:s("mt-4",r==null?void 0:r.footer),children:u("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",children:[p.showCancel?o(Q,{variant:q!=null?q:"outline",size:j!=null?j:p.size,loading:(fe=(ge=p.cancelLoading)!=null?ge:G)!=null?fe:false,disabled:(ie=($=p.cancelDisabled)!=null?$:H)!=null?ie:false,...te,onClick:ce,children:p.cancelText}):null,p.showOk?o(Q,{variant:F!=null?F:pp(p.okType),size:A!=null?A:p.size,loading:(he=(pe=p.okLoading)!=null?pe:M)!=null?he:false,disabled:(ne=(Re=p.okDisabled)!=null?Re:U)!=null?ne:false,...V,onClick:K,children:p.okText}):null]})})};return o($o,{...b,onOpenChange:x,children:o(Yo,{showCloseButton:n,className:S,style:d,onInteractOutside:N,onEscapeKeyDown:w,children:u(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)&&u(Ko,{className:r==null?void 0:r.header,children:[e?o(Jo,{className:r==null?void 0:r.title,children:e}):null,t?o(Xo,{className:r==null?void 0:r.description,children:t}):null]}),h,E()]})})})};mp.displayName="Modal";function At({open:e,onOpenChange:t,title:n,children:a,footer:r,footerClassName:i,contentClassName:c,disableContentWrapper:d=false,options:l,selectedValues:g,onSelect:m,isMulti:C=false}){let R=v=>{m==null||m(v),C||t(false);},f=v=>C&&Array.isArray(g)?g.includes(v):g===v,b=()=>l?o("div",{className:"max-h-[75vh] overflow-y-auto",children:l.map(v=>u("button",{className:s("w-full flex items-center justify-between px-4 py-4 text-left transition-colors","min-h-[50px] h-auto",v.disabled?"opacity-50 cursor-not-allowed":"hover:bg-accent active:bg-accent/80",f(v.value)&&"bg-accent"),onClick:()=>!v.disabled&&R(v.value),disabled:v.disabled,children:[o("span",{className:"flex-1",children:v.label}),f(v.value)&&o(lucideReact.CheckIcon,{className:"h-4 w-4 text-primary flex-shrink-0 ml-2"})]},v.value))}):null,p=d?a:o("div",{className:s(c),children:a});return o(eo,{open:e,onOpenChange:t,direction:"bottom",children:u(to,{className:"p-0 pb-4 rounded-t-2xl border-t bg-background",children:[n?o(oo,{className:"px-4 pb-2 pt-4 text-left border-b",children:typeof n=="string"||typeof n=="number"?o(no,{children:n}):n}):null,l?b():p,r?o(Bi,{className:s("border-border/60 border-t px-4 pt-3",i),children:r}):null]})})}var gp={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."}},SR=Object.keys(gp),bp=()=>{},Ca=J__namespace.forwardRef(({items:e,value:t,defaultValue:n,onChange:a=bp,className:r,variant:i="floating",forceLabels:c=false,...d},l)=>{let[g,m]=J__namespace.useState(()=>{var P,T;return t!==void 0?t:n||((T=(P=e[0])==null?void 0:P.value)!=null?T:"")}),C=t!==void 0,R=C?t:g;J__namespace.useEffect(()=>{var T;if(!e.length)return;if(!e.some(_=>_.value===R)){let _=(T=e[0])==null?void 0:T.value;if(!_)return;C||m(_),a(_);}},[e,R,C,a]);let f=J__namespace.useCallback(P=>{P!==R&&(C||m(P),a(P));},[C,a,R]);if(!e.length)return null;let b=Math.max(e.findIndex(P=>P.value===R),0),p=100/e.length,v=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]),x=J__namespace.useMemo(()=>({width:`calc((100% / ${e.length}) * 0.6)`,left:`calc((100% / ${e.length}) * ${b} + (100% / ${e.length}) * 0.2)`}),[b,e.length]),N=J__namespace.useMemo(()=>{let T=p/2;return {width:64,height:64,left:`calc(${p}% * ${b} + ${T}%)`}},[b,p]),w=()=>{switch(i){case "floating":return o("span",{"aria-hidden":true,style:v,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 o("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 o("span",{"aria-hidden":true,style:x,className:"pointer-events-none absolute bottom-1 left-0 h-1 rounded-full bg-primary transition-[left] duration-500 ease-out"});case "curved":return o("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}},S=P=>{switch(i){case "floating":return s("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",P?"text-primary":"text-muted-foreground");case "pill":return s("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",P?"text-primary":"text-muted-foreground");case "minimal":return s("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",P?"text-primary":"text-muted-foreground/80");case "curved":return s("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",P?"text-primary":"text-muted-foreground/90");default:return ""}},h=P=>{switch(i){case "floating":return s("flex size-12 items-center justify-center rounded-full border border-border/50 bg-muted/60 text-base transition-all duration-300 ease-out",P?"scale-100 border-primary/40 bg-primary text-primary-foreground shadow-lg shadow-primary/30":"scale-95 text-muted-foreground");case "pill":return s("flex size-9 items-center justify-center rounded-full text-base transition-all duration-300 ease-out",P?"bg-primary text-primary-foreground shadow-lg shadow-primary/30":"bg-transparent text-muted-foreground");case "minimal":return s("flex size-10 items-center justify-center rounded-full text-base transition-all duration-300 ease-out",P?"scale-105 bg-primary/10 text-primary":"scale-95 text-muted-foreground/80");case "curved":return s("flex size-12 items-center justify-center rounded-full border border-border/60 bg-muted/70 text-base transition-all duration-300 ease-out",P?"-translate-y-3 border-primary/40 bg-primary text-primary-foreground shadow-xl shadow-primary/40":"translate-y-0 text-muted-foreground");default:return ""}},E=P=>{let T="transition-all duration-300 ease-out";switch(i){case "floating":return s(T,P?"translate-y-0 opacity-100":"translate-y-[2px] opacity-90",c?"block":"");case "pill":return s(T,"text-xs",P?"opacity-100":"opacity-90");case "minimal":return s(T,"text-xs",P||c?"opacity-100":"opacity-0");case "curved":return s(T,"text-xs",P||c?"opacity-100":"opacity-0 group-hover:opacity-80");default:return T}},L=(P,T)=>P?o("span",{className:s("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:P}):null,k=()=>{switch(i){case "floating":return u("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:[w(),e.map(P=>{let T=P.value===R;return u("button",{type:"button",className:S(T),onClick:()=>f(P.value),"data-active":T?"true":void 0,"aria-pressed":T,"aria-current":T?"page":void 0,"aria-label":P.label,children:[u("span",{className:"relative",children:[o("span",{className:h(T),children:P.icon}),L(P.badge,T)]}),(T||c)&&P.label?o("span",{className:E(T),children:P.label}):P.label&&!c?o("span",{className:s(E(T),"sr-only"),children:P.label}):null]},P.value)})]});case "pill":return u("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:[w(),e.map(P=>{let T=P.value===R;return u("button",{type:"button",className:S(T),onClick:()=>f(P.value),"data-active":T?"true":void 0,"aria-pressed":T,"aria-current":T?"page":void 0,"aria-label":P.label,children:[u("span",{className:"relative flex items-center gap-2",children:[o("span",{className:h(T),children:P.icon}),(T||c)&&P.label?o("span",{className:E(T),children:P.label}):null]}),L(P.badge,T)]},P.value)})]});case "minimal":return u("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:[w(),e.map(P=>{let T=P.value===R;return u("button",{type:"button",className:S(T),onClick:()=>f(P.value),"data-active":T?"true":void 0,"aria-pressed":T,"aria-current":T?"page":void 0,"aria-label":P.label,children:[u("span",{className:"relative",children:[o("span",{className:h(T),children:P.icon}),L(P.badge,T)]}),(T||c)&&P.label?o("span",{className:E(T),children:P.label}):null]},P.value)})]});case "curved":return u("div",{className:"relative isolate flex h-28 w-full items-end justify-center",children:[o("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)]"}),u("div",{className:"relative z-10 flex h-24 w-[92%] items-end justify-between px-5 pb-4 pt-6",children:[w(),e.map(P=>{let T=P.value===R;return u("button",{type:"button",className:S(T),onClick:()=>f(P.value),"data-active":T?"true":void 0,"aria-pressed":T,"aria-current":T?"page":void 0,"aria-label":P.label,children:[u("span",{className:"relative",children:[o("span",{className:h(T),children:P.icon}),L(P.badge,T)]}),(T||c)&&P.label?o("span",{className:E(T),children:P.label}):null]},P.value)})]})]});default:return null}};return o("nav",{ref:l,className:s("relative flex w-full justify-center",r),...d,children:k()})});Ca.displayName="MobileFooter";var vp={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."}},DR=Object.keys(vp),hp=()=>{},yp=()=>u("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:[o("circle",{cx:11,cy:11,r:7}),o("path",{d:"m20 20-3-3"})]}),Do=(e,t=false)=>e?o("span",{className:s("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,Pa=J__namespace.forwardRef(({title:e,subtitle:t,supportingText:n,heroBadge:a,heroMedia:r,heroImage:i,heroAlt:c,leadingAction:d,trailingActions:l,trailingContent:g,stories:m,searchPlaceholder:C,searchValue:R,defaultSearchValue:f,onSearchChange:b=hp,searchIcon:p,variant:v="hero",className:y,children:x,...N},w)=>{let[S,h]=J__namespace.useState(()=>f!=null?f:""),E=R!==void 0,L=E?R:S,k=J__namespace.useCallback(M=>{let U=M.target.value;E||h(U),b(U);},[E,b]),P=(M,U)=>{var V,B,q;return M?u("button",{type:"button",onClick:M.onClick,"aria-label":(B=(V=M.ariaLabel)!=null?V:M.label)!=null?B:M.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:[o("span",{className:"pointer-events-none text-lg",children:(q=M.icon)!=null?q:M.label}),Do(M.badge)]},M.value):U?o("span",{className:"size-10","aria-hidden":true},U):null},T=M=>{var U,V,B;return M?u("button",{type:"button",onClick:M.onClick,"aria-label":(V=(U=M.ariaLabel)!=null?U:M.label)!=null?V:M.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:[o("span",{className:"pointer-events-none text-lg",children:(B=M.icon)!=null?B:M.label}),Do(M.badge)]},M.value):null},_=M=>{var U,V,B;return M?u("button",{type:"button",onClick:M.onClick,"aria-label":(V=(U=M.ariaLabel)!=null?U:M.label)!=null?V:M.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:[o("span",{className:"pointer-events-none text-lg",children:(B=M.icon)!=null?B:M.label}),Do(M.badge)]},M.value):null},O=M=>{var U,V,B;return u("button",{type:"button",onClick:M.onClick,"aria-label":(V=(U=M.ariaLabel)!=null?U:M.label)!=null?V:M.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:[u("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=M.icon)!=null?B:M.label,Do(M.badge,true)]}),M.label?o("span",{className:"text-xs font-medium text-foreground transition-colors group-hover:text-primary",children:M.label}):null,M.description?o("span",{className:"text-[11px] text-muted-foreground transition-opacity group-hover:opacity-90",children:M.description}):null]},M.value)},W=()=>u("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:[o("div",{className:"pointer-events-none absolute inset-0 -z-10 bg-[radial-gradient(circle_at_top,_rgba(59,130,246,0.18),_transparent_55%)]"}),u("div",{className:"flex items-center justify-between",children:[P(d!=null?d:null,"hero-leading-placeholder"),o("div",{className:"flex items-center gap-2",children:l==null?void 0:l.map(M=>P(M))})]}),u("div",{className:"mt-7 flex items-end justify-between gap-6",children:[u("div",{className:"space-y-3",children:[a?o("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?o("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:e}):null,t?o("p",{className:"text-sm text-muted-foreground",children:t}):null,n?o("p",{className:"text-xs text-muted-foreground/90",children:n}):null]}),o("div",{className:"shrink-0",children:r?o("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?o("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:o("img",{src:i,alt:c!=null?c:"",className:"size-full object-cover"})}):null})]}),x?o("div",{className:"mt-6",children:x}):null]}),D=()=>{var M;return u("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:[u("div",{className:"flex items-center justify-between gap-3",children:[u("div",{className:"flex items-center gap-3",children:[d?u("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:[o("span",{className:"text-base",children:(M=d.icon)!=null?M:d.label}),d.label?o("span",{children:d.label}):null]}):null,e?o("h2",{className:"text-lg font-semibold text-foreground",children:e}):null]}),o("div",{className:"flex items-center gap-2",children:l==null?void 0:l.map(U=>_(U))})]}),t?o("p",{className:"mt-2 text-sm text-muted-foreground",children:t}):null,o("div",{className:"mt-4 flex gap-3 overflow-x-auto pb-1",children:m==null?void 0:m.map(U=>O(U))}),x?o("div",{className:"mt-4",children:x}):null]})},F=()=>u("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:[o("div",{className:"flex items-center",children:d?T(d):o("span",{className:"size-10","aria-hidden":true})}),u("div",{className:"flex flex-1 flex-col items-center justify-center text-center",children:[t?o("span",{className:"text-[11px] uppercase tracking-[0.18em] text-muted-foreground",children:t}):null,e?o("span",{className:"text-base font-semibold text-foreground",children:e}):null]}),o("div",{className:"flex items-center gap-2",children:g!=null?g:l==null?void 0:l.map(M=>T(M))})]}),A=()=>{var M,U,V;return u("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:[u("div",{className:"flex items-start justify-between gap-4",children:[u("div",{className:"space-y-1",children:[t?o("span",{className:"text-[11px] uppercase tracking-[0.18em] text-muted-foreground",children:t}):null,e?o("h2",{className:"text-lg font-semibold text-foreground",children:e}):null,n?o("p",{className:"text-xs text-muted-foreground/90",children:n}):null]}),o("div",{className:"flex items-center gap-2",children:l==null?void 0:l.map(B=>_(B))})]}),u("div",{className:"mt-4 flex items-center gap-3",children:[d?u("button",{type:"button",onClick:d.onClick,"aria-label":(U=(M=d.ariaLabel)!=null?M:d.label)!=null?U:d.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:[o("span",{className:"pointer-events-none text-lg",children:(V=d.icon)!=null?V:d.label}),Do(d.badge)]}):null,u("div",{className:"relative flex-1",children:[o("span",{className:"pointer-events-none absolute inset-y-0 left-3 flex items-center",children:p!=null?p:o(yp,{})}),o("input",{type:"search",value:L,onChange:k,placeholder:C,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"})]})]}),x?o("div",{className:"mt-4",children:x}):null]})};return o("header",{ref:w,className:s("relative flex w-full justify-center",y),...N,children:(()=>{switch(v){case "hero":return W();case "stories":return D();case "minimal":return F();case "search":return A();default:return null}})()})});Pa.displayName="MobileHeader";function Zi(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t);}function es(...e){return t=>{let n=false,a=e.map(r=>{let i=Zi(r,t);return !n&&typeof i=="function"&&(n=true),i});if(n)return ()=>{for(let r=0;r<a.length;r++){let i=a[r];typeof i=="function"?i():Zi(e[r],null);}}}}function wp(e){let t=Rp(e),n=J__namespace.forwardRef((a,r)=>{let{children:i,...c}=a,d=J__namespace.Children.toArray(i),l=d.find(Pp);if(l){let g=l.props.children,m=d.map(C=>C===l?J__namespace.Children.count(g)>1?J__namespace.Children.only(null):J__namespace.isValidElement(g)?g.props.children:null:C);return jsxRuntime.jsx(t,{...c,ref:r,children:J__namespace.isValidElement(g)?J__namespace.cloneElement(g,void 0,m):null})}return jsxRuntime.jsx(t,{...c,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}var os=wp("Slot");function Rp(e){let t=J__namespace.forwardRef((n,a)=>{let{children:r,...i}=n;if(J__namespace.isValidElement(r)){let c=Np(r),d=Tp(i,r.props);return r.type!==J__namespace.Fragment&&(d.ref=a?es(a,c):c),J__namespace.cloneElement(r,d)}return J__namespace.Children.count(r)>1?J__namespace.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Cp=Symbol("radix.slottable");function Pp(e){return J__namespace.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Cp}function Tp(e,t){let n={...t};for(let a in t){let r=e[a],i=t[a];/^on[A-Z]/.test(a)?r&&i?n[a]=(...d)=>{let l=i(...d);return r(...d),l}:r&&(n[a]=r):a==="style"?n[a]={...r,...i}:a==="className"&&(n[a]=[r,i].filter(Boolean).join(" "));}return {...e,...n}}function Np(e){var a,r;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Sp=["top","right","bottom","left"],wn=(e,t)=>e.includes(t)?`env(safe-area-inset-${t})`:void 0,Rn=J__namespace.forwardRef(({edges:e=Sp,asChild:t,className:n,style:a,...r},i)=>{var d,l,g,m;return o(t?os:"div",{ref:i,className:s("relative",n),style:{paddingTop:(d=a==null?void 0:a.paddingTop)!=null?d:wn(e,"top"),paddingRight:(l=a==null?void 0:a.paddingRight)!=null?l:wn(e,"right"),paddingBottom:(g=a==null?void 0:a.paddingBottom)!=null?g:wn(e,"bottom"),paddingLeft:(m=a==null?void 0:a.paddingLeft)!=null?m:wn(e,"left"),...a},...r})});Rn.displayName="SafeArea";var Mp=({header:e,footer:t,children:n,className:a,safeArea:r})=>{var L,k,P,T,_;let{header:i,navigateBack:c,canGoBack:d}=li(),l=J__namespace.useMemo(()=>{let O=[];return r.top&&O.push("top"),r.left&&O.push("left"),r.right&&O.push("right"),O},[r.top,r.left,r.right]),g=J__namespace.useMemo(()=>{let O=[];return r.bottom&&O.push("bottom"),r.left&&O.push("left"),r.right&&O.push("right"),O},[r.bottom,r.left,r.right]),m=J__namespace.useCallback(()=>{if(d){c();return}typeof window!="undefined"&&window.history.back();},[d,c]),C=(L=i.back)!=null?L:d,R=J__namespace.useMemo(()=>{if(C)return {value:"mobile-header-back",icon:o(lucideReact.ArrowLeft,{className:"size-5","aria-hidden":true}),ariaLabel:"Go back",onClick:m};if(i.icon)return {value:"mobile-header-icon",icon:i.icon}},[C,i.icon,m]),{show:f=true,className:b,variant:p,type:v}=e,y=(T=(P=(k=i.variant)!=null?k:p)!=null?P:v)!=null?T:"hero",{show:x=true,activeKey:N,onChange:w,...S}=t,h=(_=S.value)!=null?_:N,E=J__namespace.useCallback(O=>{w==null||w(O);},[w]);return u("div",{className:s("flex min-h-svh w-full flex-col bg-background",a),children:[f&&o("div",{className:"sticky top-0 z-20 bg-background",children:o(Rn,{edges:l,className:"bg-background",children:o(Pa,{variant:y,className:b,title:i.title,subtitle:i.subtitle,supportingText:i.supportingText,heroBadge:i.heroBadge,leadingAction:R,trailingContent:i.actions})})}),o("div",{className:"flex-1 overflow-y-auto bg-muted/10",children:n}),x&&o("div",{className:"sticky bottom-0 z-20 bg-background",children:o(Rn,{edges:g,className:"bg-background px-4 pb-4 pt-2",children:o(Ca,{...S,value:h,onChange:E})})})]})},Ep=({header:e={show:true},footer:t={show:true,items:[]},children:n,className:a,safeArea:r={top:true,bottom:true,left:true,right:true}})=>o(si,{children:o(Mp,{header:e,footer:t,className:a,safeArea:r,children:n})});function nC({className:e,children:t,viewport:n=true,...a}){return u(radixUi.NavigationMenu.Root,{"data-slot":"navigation-menu","data-viewport":n,className:s("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",e),...a,children:[t,n&&o(Fp,{})]})}function aC({className:e,...t}){return o(radixUi.NavigationMenu.List,{"data-slot":"navigation-menu-list",className:s("group flex flex-1 list-none items-center justify-center gap-1",e),...t})}function rC({className:e,...t}){return o(radixUi.NavigationMenu.Item,{"data-slot":"navigation-menu-item",className:s("relative",e),...t})}var Ip=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 iC({className:e,children:t,...n}){return u(radixUi.NavigationMenu.Trigger,{"data-slot":"navigation-menu-trigger",className:s(Ip(),"group",e),...n,children:[t," ",o(lucideReact.ChevronDownIcon,{className:"relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180","aria-hidden":"true"})]})}function sC({className:e,...t}){return o(radixUi.NavigationMenu.Content,{"data-slot":"navigation-menu-content",className:s("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 Fp({className:e,...t}){return o("div",{className:s("absolute top-full left-0 isolate z-50 flex justify-center"),children:o(radixUi.NavigationMenu.Viewport,{"data-slot":"navigation-menu-viewport",className:s("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 lC({className:e,...t}){return o(radixUi.NavigationMenu.Link,{"data-slot":"navigation-menu-link",className:s("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 cC({className:e,...t}){return o(radixUi.NavigationMenu.Indicator,{"data-slot":"navigation-menu-indicator",className:s("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:o("div",{className:"bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md"})})}function bC({className:e,...t}){return o("nav",{role:"navigation","aria-label":"pagination","data-slot":"pagination",className:s("mx-auto flex w-full justify-center",e),...t})}function vC({className:e,...t}){return o("ul",{"data-slot":"pagination-content",className:s("flex flex-row items-center gap-1",e),...t})}function hC({...e}){return o("li",{"data-slot":"pagination-item",...e})}function as({className:e,isActive:t,size:n="icon",...a}){return o("a",{"aria-current":t?"page":void 0,"data-slot":"pagination-link","data-active":t,className:s(mt({variant:t?"outline":"ghost",size:n}),e),...a})}function yC({className:e,...t}){return u(as,{"aria-label":"Go to previous page",size:"default",className:s("gap-1 px-2.5 sm:pl-2.5",e),...t,children:[o(lucideReact.ChevronLeftIcon,{}),o("span",{className:"hidden sm:block",children:"Previous"})]})}function xC({className:e,...t}){return u(as,{"aria-label":"Go to next page",size:"default",className:s("gap-1 px-2.5 sm:pr-2.5",e),...t,children:[o("span",{className:"hidden sm:block",children:"Next"}),o(lucideReact.ChevronRightIcon,{})]})}function wC({className:e,...t}){return u("span",{"aria-hidden":true,"data-slot":"pagination-ellipsis",className:s("flex size-9 items-center justify-center",e),...t,children:[o(lucideReact.MoreHorizontalIcon,{className:"size-4"}),o("span",{className:"sr-only",children:"More pages"})]})}function NC({className:e,value:t,...n}){return o(radixUi.Progress.Root,{"data-slot":"progress",className:s("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",e),...n,children:o(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 is({className:e,...t}){return o(radixUi.RadioGroup.Root,{"data-slot":"radio-group",className:s("grid gap-3",e),...t})}function ss({className:e,...t}){return o(radixUi.RadioGroup.Item,{"data-slot":"radio-group-item",className:s("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:o(radixUi.RadioGroup.Indicator,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:o(lucideReact.CircleIcon,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function _C({className:e,...t}){return o(io__namespace.PanelGroup,{"data-slot":"resizable-panel-group",className:s("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t})}function OC({...e}){return o(io__namespace.Panel,{"data-slot":"resizable-panel",...e})}function AC({withHandle:e,className:t,...n}){return o(io__namespace.PanelResizeHandle,{"data-slot":"resizable-handle",className:s("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),...n,children:e&&o("div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",children:o(lucideReact.GripVerticalIcon,{className:"size-2.5"})})})}function UC({className:e,children:t,...n}){return u(radixUi.ScrollArea.Root,{"data-slot":"scroll-area",className:s("relative",e),...n,children:[o(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}),o(Bp,{}),o(radixUi.ScrollArea.Corner,{})]})}function Bp({className:e,orientation:t="vertical",...n}){return o(radixUi.ScrollArea.ScrollAreaScrollbar,{"data-slot":"scroll-area-scrollbar",orientation:t,className:s("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),...n,children:o(radixUi.ScrollArea.ScrollAreaThumb,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}var cs=J__namespace.createContext(void 0);function Na(){let e=J__namespace.useContext(cs);if(!e)throw new Error("useNativeSelectContext must be used within a Select component");return e}function Up({open:e,defaultOpen:t,onOpenChange:n,children:a,...r}){let{isNative:i}=vt(),c=Ye(),d=i||c,[l,g]=J__namespace.useState(t!=null?t:false),m=e!=null?e:l,C=J__namespace.useCallback(f=>{e===void 0&&g(f),n==null||n(f);},[e,n]),R=J__namespace.useMemo(()=>({isNative:d,open:m,setOpen:C,closeOnSelect:true}),[d,m,C]);return o(cs.Provider,{value:R,children:o(radixUi.Select.Root,{"data-slot":"select",open:m,onOpenChange:C,...r,children:a})})}function Gp({className:e,size:t="default",children:n,...a}){let{isNative:r,open:i,setOpen:c}=Na();return u(radixUi.Select.Trigger,{"data-slot":"select-trigger","data-size":t,onClick:d=>{r&&(d.preventDefault(),d.stopPropagation(),c(!i));},className:s(at,"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:[o("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:n}),o(radixUi.Select.Icon,{className:"pointer-events-none shrink-0 text-muted-foreground",children:o(lucideReact.ChevronDownIcon,{className:"size-4"})})]})}function qp({className:e,children:t,position:n="popper",title:a,...r}){let i=Na();return o(radixUi.Select.Portal,{children:o(radixUi.Select.Content,{"data-slot":"select-content",className:s(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:n,...r,children:i.isNative?o(At,{open:i.open,onOpenChange:i.setOpen,title:a,disableContentWrapper:true,children:o(radixUi.Select.Viewport,{className:"max-h-[75vh] overflow-y-auto",children:t})}):u(jsxRuntime.Fragment,{children:[o($p,{}),o(radixUi.Select.Viewport,{className:"p-1",children:t}),o(Yp,{})]})})})}function Wp({className:e,children:t,onSelect:n,...a}){let r=Na(),i=J__namespace.useCallback(c=>{n==null||n(c),r.isNative&&r.closeOnSelect&&!c.defaultPrevented&&setTimeout(()=>{r.setOpen(false);});},[r,n]);return u(radixUi.Select.Item,{"data-slot":"select-item",onSelect:i,className:s("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:[o("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:o(radixUi.Select.ItemIndicator,{children:o(lucideReact.CheckIcon,{className:"size-4"})})}),o(radixUi.Select.ItemText,{children:t})]})}function $p({className:e,...t}){return o(radixUi.Select.ScrollUpButton,{className:s("flex items-center justify-center py-1",e),...t,children:o(lucideReact.ChevronUpIcon,{className:"size-4"})})}function Yp({className:e,...t}){return o(radixUi.Select.ScrollDownButton,{className:s("flex items-center justify-center py-1",e),...t,children:o(lucideReact.ChevronDownIcon,{className:"size-4"})})}function Kp({className:e,...t}){return o(radixUi.Select.Value,{"data-slot":"select-value",className:s("flex-1 min-w-0 truncate text-left data-[placeholder]:text-muted-foreground",e),...t})}function Cn({options:e,placeholder:t="Select an option",triggerProps:n,contentProps:a,...r}){let i=n!=null?n:{},c=a!=null?a:{};return u(Up,{...r,children:[o(Gp,{...i,children:o(Kp,{placeholder:t})}),o(qp,{...c,children:e.map(d=>{var l,g;return o(Wp,{value:d.value,disabled:d.disabled,className:d.className,children:(g=d.label)!=null?g:d.value},(l=d.key)!=null?l:d.value)})})]})}var Sa=()=>{},ds=J__namespace.createContext({isNative:false,selectedValues:[],setSelectedValues:Sa,toggleValue:Sa,isSelected:()=>false,open:false,setOpen:Sa});function Pn(){return J__namespace.useContext(ds)}function us({value:e,defaultValue:t=[],onValueChange:n,open:a,defaultOpen:r,onOpenChange:i,children:c}){let{isNative:d}=vt(),l=Ye(),g=d||l,[m,C]=J__namespace.useState(t),[R,f]=J__namespace.useState(r!=null?r:false);J__namespace.useEffect(()=>{e!==void 0&&C(e);},[e]),J__namespace.useEffect(()=>{a!==void 0&&f(a);},[a]);let b=e!=null?e:m,p=a!=null?a:R,v=J__namespace.useCallback(h=>{let E=typeof h=="function"?h(b):h;e===void 0&&C(E),n==null||n(E);},[n,b,e]),y=J__namespace.useCallback(h=>{v(E=>E.includes(h)?E.filter(L=>L!==h):[...E,h]);},[v]),x=J__namespace.useCallback(h=>b.includes(h),[b]),N=J__namespace.useCallback(h=>{a===void 0&&f(h),i==null||i(h);},[i,a]),w=J__namespace.useMemo(()=>({isNative:g,selectedValues:b,setSelectedValues:v,toggleValue:y,isSelected:x,open:p,setOpen:N}),[g,p,N,b,v,y,x]),S=g?c:o(Qt,{open:p,onOpenChange:N,children:c});return o(ds.Provider,{value:w,children:S})}function ps({className:e,children:t,disabled:n,onClick:a,...r}){let i=Pn(),c=J__namespace.useCallback(l=>{a==null||a(l),i.isNative&&!n&&i.setOpen(!i.open);},[i,n,a]),d=u("button",{type:"button","data-slot":"multi-select-trigger","data-state":i.open?"open":"closed",className:s(at,"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:n,onClick:c,...r,children:[o("span",{className:"flex-1 min-w-0 text-left",children:t}),o(lucideReact.ChevronDownIcon,{className:"pointer-events-none absolute right-3 top-1/2 size-4 -translate-y-1/2 opacity-50"})]});return i.isNative?d:o(zi,{asChild:true,children:d})}function ms({placeholder:e="Select options",className:t,separator:n=", ",formatValue:a}){let{selectedValues:r,isNative:i}=Pn(),c=J__namespace.useMemo(()=>a?a(r):r.length===0?e:i?r.map(d=>o(vr,{variant:"secondary",children:d},d)):r.join(n),[a,i,e,r,n]);return o("span",{"data-slot":"multi-select-value",className:s("flex min-h-4 flex-wrap items-center gap-1 text-sm",r.length===0&&"text-muted-foreground",t),children:c})}function fs({className:e,title:t,children:n,commandClassName:a,showSearch:r=false,searchPlaceholder:i="Search...",emptyMessage:c="No options found.",sideOffset:d=4,align:l="start",...g}){let m=Pn(),C=u(Xn,{className:s("w-full",a),children:[r?o(Yr,{placeholder:i}):null,u(Kr,{children:[c!==null?o(Jr,{children:c}):null,n]})]});return m.isNative?o(At,{open:m.open,onOpenChange:m.setOpen,title:t,contentClassName:s("px-2 pb-2",e),footer:o(Q,{type:"button",variant:"outline",onClick:()=>m.setOpen(false),children:"Close"}),children:C}):o(Zt,{"data-slot":"multi-select-content",className:s("w-64 p-0",e),sideOffset:d,align:l,...g,children:C})}function gs({value:e,children:t,className:n,disabled:a,...r}){let i=Pn(),c=i.isSelected(e);return u(Xr,{...r,value:e,onSelect:()=>{a||i.toggleValue(e);},"data-slot":"multi-select-item",disabled:a,className:s("gap-2",n),children:[o("span",{className:"flex size-4 items-center justify-center",children:o(lucideReact.CheckIcon,{className:s("size-4",c?"opacity-100":"opacity-0")})}),o("span",{children:t})]})}function bs({className:e,orientation:t="horizontal",decorative:n=true,...a}){return o(radixUi.Separator.Root,{"data-slot":"separator",decorative:n,orientation:t,className:s("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 vs({...e}){return o(radixUi.Dialog.Root,{"data-slot":"sheet",...e})}function hP({...e}){return o(radixUi.Dialog.Trigger,{"data-slot":"sheet-trigger",...e})}function yP({...e}){return o(radixUi.Dialog.Close,{"data-slot":"sheet-close",...e})}function em({...e}){return o(radixUi.Dialog.Portal,{"data-slot":"sheet-portal",...e})}function tm({className:e,...t}){return o(radixUi.Dialog.Overlay,{"data-slot":"sheet-overlay",className:s("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 hs({className:e,children:t,side:n="right",...a}){return u(em,{children:[o(tm,{}),u(radixUi.Dialog.Content,{"data-slot":"sheet-content",className:s("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",n==="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",n==="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",n==="top"&&"inset-x-0 top-0 h-auto border-b data-[state=closed]:-translate-y-full data-[state=open]:translate-y-0",n==="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,u(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:[o(lucideReact.XIcon,{className:"size-4"}),o("span",{className:"sr-only",children:"Close"})]})]})]})}function ys({className:e,...t}){return o("div",{"data-slot":"sheet-header",className:s("flex flex-col gap-1.5 p-4",e),...t})}function xP({className:e,...t}){return o("div",{"data-slot":"sheet-footer",className:s("mt-auto flex flex-col gap-2 p-4",e),...t})}function xs({className:e,...t}){return o(radixUi.Dialog.Title,{"data-slot":"sheet-title",className:s("text-foreground font-semibold",e),...t})}function ws({className:e,...t}){return o(radixUi.Dialog.Description,{"data-slot":"sheet-description",className:s("text-muted-foreground text-sm",e),...t})}function ra({delayDuration:e=0,...t}){return o(radixUi.Tooltip.Provider,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Rs({...e}){return o(ra,{children:o(radixUi.Tooltip.Root,{"data-slot":"tooltip",...e})})}function Cs({...e}){return o(radixUi.Tooltip.Trigger,{"data-slot":"tooltip-trigger",...e})}function Ps({className:e,sideOffset:t=0,children:n,...a}){return o(radixUi.Tooltip.Portal,{children:u(radixUi.Tooltip.Content,{"data-slot":"tooltip-content",sideOffset:t,className:s("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:[n,o(radixUi.Tooltip.Arrow,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}var am="sidebar_state",rm=3600*24*7,im="16rem",sm="18rem",lm="3rem",cm="b",Ts=J__namespace.createContext(null);function Fo(){let e=J__namespace.useContext(Ts);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function Si({defaultOpen:e=true,open:t,onOpenChange:n,className:a,style:r,children:i,...c}){let d=Ye(),[l,g]=J__namespace.useState(false),[m,C]=J__namespace.useState(e),R=t!=null?t:m,f=J__namespace.useCallback(y=>{let x=typeof y=="function"?y(R):y;n?n(x):C(x),document.cookie=`${am}=${x}; path=/; max-age=${rm}`;},[n,R]),b=J__namespace.useCallback(()=>d?g(y=>!y):f(y=>!y),[d,f,g]);J__namespace.useEffect(()=>{let y=x=>{x.key===cm&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),b());};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[b]);let p=R?"expanded":"collapsed",v=J__namespace.useMemo(()=>({state:p,open:R,setOpen:f,isMobile:d,openMobile:l,setOpenMobile:g,toggleSidebar:b}),[p,R,f,d,l,g,b]);return o(Ts.Provider,{value:v,children:o("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":im,"--sidebar-width-icon":lm,...r},className:s("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",a),...c,children:i})})}function ki({side:e="left",variant:t="sidebar",collapsible:n="icon",className:a,children:r,...i}){let{isMobile:c,state:d,openMobile:l,setOpenMobile:g}=Fo();return n==="none"?o("div",{"data-slot":"sidebar",className:s("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",a),...i,children:r}):c?o(vs,{open:l,onOpenChange:g,...i,children:u(hs,{"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":sm},side:e,children:[u(ys,{className:"sr-only",children:[o(xs,{children:"Sidebar"}),o(ws,{children:"Displays the mobile sidebar."})]}),o("div",{className:"flex h-full w-full flex-col",children:r})]})}):u("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":d,"data-collapsible":d==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[o("div",{"data-slot":"sidebar-gap",className:s("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)")}),o("div",{"data-slot":"sidebar-container",className:s("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:o("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 zP({className:e,onClick:t,...n}){let{toggleSidebar:a}=Fo();return u(Q,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:s("size-7",e),onClick:r=>{t==null||t(r),a();},...n,children:[o(lucideReact.PanelLeftIcon,{}),o("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function BP({className:e,...t}){let{toggleSidebar:n}=Fo();return o("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:s("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 Mi({className:e,...t}){return o("main",{"data-slot":"sidebar-inset",className:s("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 VP({className:e,...t}){return o(qe,{"data-slot":"sidebar-input","data-sidebar":"input",className:s("bg-background h-8 w-full shadow-none",e),...t})}function Ei({className:e,sticky:t=false,...n}){return o("div",{"data-slot":"sidebar-header","data-sidebar":"header","data-sticky":t?"true":void 0,className:s("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),...n})}function Di({className:e,...t}){return o("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:s("flex flex-col gap-2 p-2",e),...t})}function jP({className:e,...t}){return o(bs,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:s("bg-sidebar-border mx-2 w-auto",e),...t})}function Li({className:e,...t}){return o("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:s("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function UP({className:e,...t}){return o("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:s("relative flex w-full min-w-0 flex-col p-2",e),...t})}function GP({className:e,asChild:t=false,...n}){let a=t?radixUi.Slot.Slot:"div";return o(a,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:s("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),...n})}function qP({className:e,asChild:t=false,...n}){let a=t?radixUi.Slot.Slot:"button";return o(a,{"data-slot":"sidebar-group-action","data-sidebar":"group-action",className:s("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),...n})}function WP({className:e,...t}){return o("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:s("w-full text-sm",e),...t})}function Ii({className:e,...t}){return o("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:s("flex w-full min-w-0 flex-col gap-1",e),...t})}function Fi({className:e,...t}){return o("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:s("group/menu-item relative",e),...t})}var dm=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 Hi({asChild:e=false,isActive:t=false,variant:n="default",size:a="default",tooltip:r,className:i,onClick:c,...d}){let l=e?radixUi.Slot.Slot:"button",{isMobile:g,setOpenMobile:m,state:C}=Fo(),R=J__namespace.useCallback(b=>{c&&c(b),!b.defaultPrevented&&g&&m(false);},[g,c,m]),f=o(l,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":a,"data-active":t,className:s(dm({variant:n,size:a}),i),onClick:R,...d});return r?(typeof r=="string"&&(r={children:r}),u(Rs,{children:[o(Cs,{asChild:true,children:f}),o(Ps,{side:"right",align:"center",hidden:C!=="collapsed"||g,...r})]})):f}function $P({className:e,asChild:t=false,showOnHover:n=false,...a}){let r=t?radixUi.Slot.Slot:"button";return o(r,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:s("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",n&&"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 YP({className:e,...t}){return o("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:s("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 KP({className:e,showIcon:t=false,...n}){let a=J__namespace.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return u("div",{"data-slot":"sidebar-menu-skeleton","data-sidebar":"menu-skeleton",className:s("flex h-8 items-center gap-2 rounded-md px-2",e),...n,children:[t&&o(Pt,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),o(Pt,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":a}})]})}function JP({className:e,...t}){return o("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:s("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 XP({className:e,...t}){return o("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:s("group/menu-sub-item relative",e),...t})}function QP({asChild:e=false,size:t="md",isActive:n=false,className:a,onClick:r,...i}){let c=e?radixUi.Slot.Slot:"a",{isMobile:d,setOpenMobile:l}=Fo(),g=J__namespace.useCallback(m=>{r&&r(m),!m.defaultPrevented&&d&&l(false);},[d,r,l]);return o(c,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:s("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:g,...i})}function nT({className:e,defaultValue:t,value:n,min:a=0,max:r=100,...i}){let c=J__namespace.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[a,r],[n,t,a,r]);return u(radixUi.Slider.Root,{"data-slot":"slider",defaultValue:t,value:n,min:a,max:r,className:s("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:[o(radixUi.Slider.Track,{"data-slot":"slider-track",className:s("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:o(radixUi.Slider.Range,{"data-slot":"slider-range",className:s("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:c.length},(d,l)=>o(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"},l))]})}var sT=({...e})=>o(sonner.Toaster,{theme:"dark",className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},...e});function ks({className:e,...t}){return o(radixUi.Switch.Root,{"data-slot":"switch",className:s("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:o(radixUi.Switch.Thumb,{"data-slot":"switch-thumb",className:s("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 Ms({className:e,...t}){return o("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto overflow-y-visible",children:o("table",{"data-slot":"table",className:s("w-full caption-bottom text-sm",e),...t})})}function Es({className:e,...t}){return o("thead",{"data-slot":"table-header",className:s("[&_tr]:border-b",e),...t})}function Ds({className:e,...t}){return o("tbody",{"data-slot":"table-body",className:s("[&_tr:last-child]:border-0",e),...t})}function gT({className:e,...t}){return o("tfoot",{"data-slot":"table-footer",className:s("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t})}function Nt({className:e,...t}){return o("tr",{"data-slot":"table-row",className:s("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function Ls({className:e,...t}){return o("th",{"data-slot":"table-head",className:s("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 Bt({className:e,...t}){return o("td",{"data-slot":"table-cell",className:s("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function bT({className:e,...t}){return o("caption",{"data-slot":"table-caption",className:s("text-muted-foreground mt-4 text-sm",e),...t})}var Is=J__namespace.createContext(null),ka=e=>{let t=J__namespace.useContext(Is);if(!t)throw new Error(`${e} must be used within <Tabs>`);return t},Fs=J__namespace.createContext("default"),Ma=e=>{let t=J__namespace.useContext(Fs);return e!=null?e:t},pm={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"},mm="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",fm={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"},gm={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"},bm=new Set(["default","solid","segmented","boxed"]),vm={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"},hm="pointer-events-none absolute left-0 top-0 z-0 transition-all duration-300 ease-out will-change-transform",Hs=(...e)=>t=>{e.forEach(n=>{if(typeof n=="function")n(t);else if(n!=null){let a=n;a.current=t;}});},_s=J__namespace.forwardRef(({className:e,value:t,defaultValue:n,onValueChange:a,activationMode:r="automatic",variant:i="default",orientation:c="horizontal",items:d,listClassName:l,triggerClassName:g,contentClassName:m,renderList:C,...R},f)=>{var W;let b=J__namespace.useId(),p=t!==void 0,[v,y]=J__namespace.useState(()=>n!=null?n:null),x=(W=p?t:v)!=null?W:null,N=J__namespace.useRef(new Map),w=J__namespace.useCallback(D=>{p||y(D),a==null||a(D);},[p,a]),S=J__namespace.useCallback((D,F)=>{if(F){let A=N.current.size===0;N.current.set(D,F),!p&&x==null&&n==null&&A&&y(D);}else N.current.delete(D);},[n,p,y,x]),h=J__namespace.useCallback(D=>{var F;return D&&(F=N.current.get(D))!=null?F:null},[]),E=J__namespace.useCallback(D=>{let F=Array.from(N.current.keys());if(!F.length)return;let A=(D%F.length+F.length)%F.length,M=F[A],U=N.current.get(M);U==null||U.focus(),r!=="manual"&&w(M);},[r,w]),L=J__namespace.useCallback((D,F)=>{let M=Array.from(N.current.keys()).indexOf(D);M!==-1&&E(M+F);},[E]),k=J__namespace.useCallback(D=>{let F=Array.from(N.current.keys());F.length&&E(D==="first"?0:F.length-1);},[E]),[P,T]=J__namespace.useState(c),_=J__namespace.useCallback(D=>{T(D);},[]);J__namespace.useEffect(()=>{T(c);},[c]),J__namespace.useEffect(()=>{!p&&x==null&&n&&y(n);},[n,p,y,x]);let O=J__namespace.useMemo(()=>({id:b,value:x,setValue:w,activationMode:r,registerTrigger:S,getTriggerNode:h,focusNextTrigger:L,focusEdgeTrigger:k,orientation:P,setOrientation:_}),[b,x,w,r,S,L,k,P,_]);return o(Fs.Provider,{value:i,children:o(Is.Provider,{value:O,children:u("div",{ref:f,className:s("flex flex-col gap-2",e),...R,children:[(C!=null?C:(D=>D))(o(Os,{className:l,variant:i,orientation:c,children:d.map(D=>{let{triggerProps:F,contentProps:A,...M}=D,{className:U,...V}=F!=null?F:{};return o(As,{value:M.key,disabled:M.disabled,className:s(g,M.triggerClassName,U),variant:i,...V,children:M.label},M.key)})})),d.map(D=>{let{triggerProps:F,contentProps:A,...M}=D,{className:U,...V}=A!=null?A:{};return o(zs,{value:M.key,variant:i,className:s(m,M.contentClassName,U),...V,children:M.children},M.key)})]})})})});_s.displayName="Tabs";var Os=J__namespace.forwardRef(({className:e,variant:t,orientation:n="horizontal",...a},r)=>{let{value:i,setOrientation:c,getTriggerNode:d}=ka("TabsList"),l=Ma(t),g=vm[l],m=J__namespace.useRef(null),[C,R]=J__namespace.useState(null),f=bm.has(l),[b,p]=J__namespace.useState(false),[v,y]=J__namespace.useState(false),x=J__namespace.useCallback(S=>{if(n!=="horizontal")return;let h=m.current;if(!h||!S)return;let E=d(S);if(!E)return;let L=32,k=h.scrollLeft,P=k+h.clientWidth,T=E.offsetLeft,_=T+E.offsetWidth;if(T<k){let O=Math.max(0,T-L);typeof h.scrollTo=="function"?h.scrollTo({left:O,behavior:"smooth"}):h.scrollLeft=O;}else if(_>P){let O=Math.max(0,h.scrollWidth-h.clientWidth),W=Math.min(O,_-h.clientWidth+L);typeof h.scrollTo=="function"?h.scrollTo({left:W,behavior:"smooth"}):h.scrollLeft=W;}},[d,n]),N=J__namespace.useCallback(()=>{if(!f){R(null);return}let S=m.current,h=d(i);if(!S||!h){R(null);return}let E=h.offsetWidth,L=h.offsetHeight,k=h.offsetLeft,P=h.offsetTop,T=h.offsetParent;for(;T&&T!==S;)k+=T.offsetLeft-T.scrollLeft,P+=T.offsetTop-T.scrollTop,T=T.offsetParent;if(T!==S){let _=h.getBoundingClientRect(),O=S.getBoundingClientRect();k=_.left-O.left+S.scrollLeft,P=_.top-O.top+S.scrollTop;}R({width:E,height:L,transform:`translate3d(${k}px, ${P}px, 0)`});},[i,d,f]);J__namespace.useEffect(()=>{c(n);},[n,c]),J__namespace.useLayoutEffect(()=>{N();},[N]),J__namespace.useEffect(()=>{if(n!=="horizontal"){p(false),y(false);return}let S=m.current;if(!S)return;let h=()=>{let{scrollLeft:P,scrollWidth:T,clientWidth:_}=S;if(!(T-_>1)){p(false),y(false);return}p(P>1),y(P<T-_-1);};h(),x(i);let E=()=>h(),L=()=>{h(),x(i);},k=typeof ResizeObserver!="undefined"?new ResizeObserver(()=>L()):null;return S.addEventListener("scroll",E,{passive:true}),k==null||k.observe(S),window.addEventListener("resize",L),()=>{S.removeEventListener("scroll",E),k==null||k.disconnect(),window.removeEventListener("resize",L);}},[i,x,n]),J__namespace.useEffect(()=>{x(i);},[i,x]),J__namespace.useEffect(()=>{if(!f||typeof ResizeObserver=="undefined")return;let S=m.current;if(!S)return;let h=new ResizeObserver(()=>{N();});h.observe(S);let E=d(i);return E&&h.observe(E),()=>{h.disconnect();}},[i,d,f,N]),J__namespace.useEffect(()=>{if(!f||typeof MutationObserver=="undefined")return;let S=m.current;if(!S)return;let h=new MutationObserver(()=>{N();});return h.observe(S,{childList:true,subtree:true}),()=>{h.disconnect();}},[f,N]),J__namespace.useEffect(()=>{if(!f)return;let S=()=>{N();};return window.addEventListener("resize",S),()=>{window.removeEventListener("resize",S);}},[f,N]);let w=n==="horizontal";return u("div",{className:s("relative",w&&"max-w-full overflow-hidden"),children:[u("div",{ref:Hs(m,r),role:"tablist","aria-orientation":n,className:s("relative inline-flex items-center",w&&"w-full max-w-full overflow-x-auto overflow-y-hidden [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",pm[l],e),...a,children:[f&&C&&g?o("span",{"aria-hidden":"true",className:s(hm,g),style:C}):null,a.children]}),w&&b?o("div",{className:"pointer-events-none absolute inset-y-0 left-0 w-8 bg-gradient-to-r from-background to-transparent"}):null,w&&v?o("div",{className:"pointer-events-none absolute inset-y-0 right-0 w-8 bg-gradient-to-l from-background to-transparent"}):null]})});Os.displayName="TabsList";var As=J__namespace.forwardRef(({className:e,variant:t,value:n,disabled:a,onClick:r,onKeyDown:i,...c},d)=>{let{id:l,value:g,setValue:m,registerTrigger:C,focusNextTrigger:R,focusEdgeTrigger:f,orientation:b}=ka("TabsTrigger"),p=Ma(t),v=J__namespace.useRef(null),y=g===n,x=`${l}-trigger-${n}`,N=`${l}-content-${n}`;J__namespace.useEffect(()=>(C(n,v.current),()=>C(n,null)),[C,n]);let w=h=>{r==null||r(h),!(h.defaultPrevented||a)&&m(n);},S=h=>{if(i==null||i(h),!h.defaultPrevented){if(b==="horizontal"){if(h.key==="ArrowRight"){h.preventDefault(),R(n,1);return}if(h.key==="ArrowLeft"){h.preventDefault(),R(n,-1);return}}else {if(h.key==="ArrowDown"){h.preventDefault(),R(n,1);return}if(h.key==="ArrowUp"){h.preventDefault(),R(n,-1);return}}if(h.key==="Home"){h.preventDefault(),f("first");return}if(h.key==="End"){h.preventDefault(),f("last");return}(h.key===" "||h.key==="Enter")&&(h.preventDefault(),m(n));}};return o("button",{type:"button",role:"tab",id:x,"aria-selected":y,"aria-controls":N,tabIndex:y?0:-1,"data-state":y?"active":"inactive",disabled:a,ref:Hs(v,d),className:s(mm,fm[p],e),onClick:w,onKeyDown:S,...c})});As.displayName="TabsTrigger";var zs=J__namespace.forwardRef(({className:e,variant:t,value:n,...a},r)=>{let{id:i,value:c}=ka("TabsContent"),d=Ma(t),l=c===n,g=`${i}-trigger-${n}`,m=`${i}-content-${n}`;return o("div",{ref:r,role:"tabpanel",id:m,"aria-labelledby":g,hidden:!l,"data-state":l?"active":"inactive",className:s("focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",gm[d],e),...a})});zs.displayName="TabsContent";var Ea=J__namespace.forwardRef(({className:e,onFocus:t,...n},a)=>{let r=J__namespace.useCallback(c=>{typeof a=="function"?a(c):a&&(a.current=c);},[a]),i=J__namespace.useCallback(c=>{t==null||t(c),!c.defaultPrevented&&Go(c.currentTarget);},[t]);return o("textarea",{ref:r,"data-slot":"textarea",onFocus:i,className:s("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),...n})});Ea.displayName="Textarea";var Da=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 ET({className:e,variant:t,size:n,...a}){return o(radixUi.Toggle.Root,{"data-slot":"toggle",className:s(Da({variant:t,size:n,className:e})),...a})}var Vs=J__namespace.createContext({size:"default",variant:"default"});function _T({className:e,variant:t,size:n,children:a,...r}){return o(radixUi.ToggleGroup.Root,{"data-slot":"toggle-group","data-variant":t,"data-size":n,className:s("group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",e),...r,children:o(Vs.Provider,{value:{variant:t,size:n},children:a})})}function OT({className:e,children:t,variant:n,size:a,...r}){let i=J__namespace.useContext(Vs);return o(radixUi.ToggleGroup.Item,{"data-slot":"toggle-group-item","data-variant":i.variant||n,"data-size":i.size||a,className:s(Da({variant:i.variant||n,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 Cm="hsl(var(--primary))",La={bottomLeft:{side:"bottom",align:"start"},bottomRight:{side:"bottom",align:"end"},topLeft:{side:"top",align:"start"},topRight:{side:"top",align:"end"}},Pm=e=>{var t;return e&&(t=La[e])!=null?t:La.bottomLeft},Ze=e=>String(e).padStart(2,"0"),Tm=(e,t)=>{let n=e.hour>=12?"PM":"AM",a=(e.hour+11)%12+1,r={HH:Ze(e.hour),H:String(e.hour),hh:Ze(a),h:String(a),mm:Ze(e.minute),m:String(e.minute),ss:Ze(e.second),s:String(e.second),A:n,a:n.toLowerCase()};return t.replace(/HH|H|hh|h|mm|m|ss|s|A|a/g,i=>r[i])},Nm=(e,t)=>t?`${Ze(e.hour)}:${Ze(e.minute)}:${Ze(e.second)}`:`${Ze(e.hour)}:${Ze(e.minute)}`,Sm=e=>{let t=e.match(/\b(AM|PM)\b/i);return t?t[1].toUpperCase()==="AM"?"AM":"PM":null},js=e=>{if(!e)return null;let t=e.trim();if(!t)return null;let n=Sm(t),a=n?t.replace(/\s?(AM|PM)\b/i,"").trim():t,[r,i,c]=a.split(":");if(!r||!i)return null;let d=Number.parseInt(r,10),l=Number.parseInt(i,10),g=c?Number.parseInt(c,10):0;if([d,l,g].some(C=>Number.isNaN(C)))return null;let m=d;if(n){let C=Math.min(Math.max(m%12||12,1),12);m=n==="PM"?C%12+12:C%12,n==="AM"&&C===12&&(m=0),n==="PM"&&C===12&&(m=12);}return {hour:Math.min(Math.max(m,0),23),minute:Math.min(Math.max(l,0),59),second:Math.min(Math.max(g,0),59)}},km=e=>{let t=e%12;return t===0?12:t},Mm=(e,t)=>{let n=e%12;return t==="PM"?n+12:n===12?0:n},Ia=({label:e,options:t,selectedValue:n,onSelect:a})=>u("div",{className:"flex w-20 min-w-0 flex-col gap-2",children:[o("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:e}),o("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===n;return o("button",{type:"button",role:"option","aria-selected":i,className:s("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)})})]}),Sn=44,Em=5,Us=40;function Fa({label:e,options:t,selectedValue:n,onValueChange:a,open:r,infinite:i=true}){let c=J__namespace.useRef(null),d=J__namespace.useRef(null),l=J__namespace.useMemo(()=>{if(t.length===0)return [];if(!i)return t;let R=[];for(let f=0;f<Us;f+=1)for(let b of t)R.push(b);return R},[i,t]),g=J__namespace.useCallback((R,f="auto")=>{if(!c.current||t.length===0||l.length===0)return;let b=t.findIndex(N=>N.value===R),p=b>=0?b:0,v=Math.floor(Us/2),x=(i?p+t.length*v:p)*Sn;c.current.scrollTo({top:x,behavior:f});},[l.length,i,t]);J__namespace.useLayoutEffect(()=>{r&&g(n);},[g,r,t,n]),J__namespace.useEffect(()=>()=>{d.current!==null&&clearTimeout(d.current);},[]);let m=J__namespace.useCallback(R=>{if(l.length===0||t.length===0)return;let f=R.currentTarget,b=Math.round(f.scrollTop/Sn),p=l.length-1,v=Math.max(0,Math.min(b,p));d.current!==null&&clearTimeout(d.current),d.current=setTimeout(()=>{var N;let y=l[v];if(!y)return;if(!a(y.value)){g(n,"smooth");return}if(i){let w=t.length,S=l.length-t.length-1;if(b<=w||b>=S)g(y.value);else {let h=b*Sn;(N=c.current)==null||N.scrollTo({top:h});}return}g(y.value);},80);},[g,l,i,a,t,n]);if(t.length===0)return o("div",{className:"flex-1",children:o("p",{className:"text-center text-sm text-muted-foreground",children:"No options"})});let C=(Em-1)/2*Sn;return u("div",{className:"flex flex-1 flex-col items-center gap-2",children:[o("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:e}),u("div",{className:"relative h-56 w-full overflow-hidden",children:[o("div",{className:"pointer-events-none absolute inset-x-0 top-1/2 -translate-y-1/2 border-y border-primary/30"}),o("div",{ref:c,onScroll:m,className:"h-56 overflow-y-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",style:{paddingTop:C,paddingBottom:C,WebkitOverflowScrolling:"touch"},children:l.map((R,f)=>{let b=`${f}-${R.value}`,p=R.value===n;return o("div",{className:s("flex h-11 items-center justify-center text-base transition-colors",p?"font-medium text-foreground":"text-muted-foreground"),children:R.label},b)})})]})]})}var Dm=({value:e,onChange:t})=>u("div",{className:"flex w-20 min-w-0 flex-col gap-2",children:[o("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Period"}),o("div",{role:"radiogroup",className:"grid gap-2",children:["AM","PM"].map(n=>{let a=n===e;return o("button",{type:"button",role:"radio","aria-checked":a,className:s("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(n),children:n},n)})})]}),Ha=J__namespace.forwardRef((e,t)=>{var zo,jt,mo,fo;let{value:n,defaultValue:a=null,onChange:r,onOpenChange:i,hourStep:c=1,minuteStep:d=1,secondStep:l=1,showSeconds:g,use12Hours:m=false,allowClear:C=true,format:R,placeholder:f,placement:b="bottomLeft",size:p="middle",status:v,variant:y="outlined",inputClassName:x,inputStyle:N,prefix:w,open:S,defaultOpen:h,inputReadOnly:E=true,className:L,style:k,disabled:P=false,name:T,id:_,...O}=e,{onBlur:W,onFocus:D,onClick:F,...A}=O,{isNative:M}=vt(),U=Ye(),V=M||U,B=n!==void 0,[q,j]=J__namespace.useState(a),G=(zo=B?n:q)!=null?zo:null,H=J__namespace.useMemo(()=>js(G),[G]),te=J__namespace.useMemo(()=>{var X;return ((X=H==null?void 0:H.hour)!=null?X:0)>=12?"PM":"AM"},[H==null?void 0:H.hour]),[K,ce]=J__namespace.useState(te);J__namespace.useEffect(()=>{ce(te);},[te]);let le=J__namespace.useMemo(()=>typeof g=="boolean"?g:typeof R=="string"?/s/.test(R):!!(G&&G.split(":").length===3),[G,R,g]),re=J__namespace.useMemo(()=>m?le?"hh:mm:ss A":"hh:mm A":le?"HH:mm:ss":"HH:mm",[le,m]),ge=typeof R=="string"?R:re,fe=J__namespace.useCallback(X=>X?typeof R=="function"?R(X):Tm(X,ge):"",[R,ge]),[$,ie]=J__namespace.useState(()=>fe(H));J__namespace.useEffect(()=>{ie(fe(H));},[fe,H]);let pe=typeof C=="object"&&C!==null&&!Array.isArray(C)?C:void 0,he=(jt=pe==null?void 0:pe.clearIcon)!=null?jt:o(lucideReact.X,{className:"h-4 w-4",strokeWidth:2}),Re=!!C&&!P&&!!G,ne=J__namespace.useMemo(()=>({"--date-primary-color":Cm}),[]),oe=S!==void 0,[ye,de]=J__namespace.useState(!!h),we=oe?!!S:ye,Te=J__namespace.useCallback(X=>{P||(oe||de(X),i==null||i(X));},[P,oe,i]),me=J__namespace.useCallback(X=>{if(!X){B||j(null),ie(""),r==null||r(null,"");return}let ue=Nm(X,le);B||j(ue);let We=fe(X);ie(We),r==null||r(ue,We);},[fe,le,B,r]),De=H!=null?H:{hour:0,minute:0,second:0},Pe=Math.max(1,Math.floor(c)),Ne=Math.max(1,Math.floor(d)),be=Math.max(1,Math.floor(l)),dt=J__namespace.useMemo(()=>{if(m){let ue=[];for(let nt=1;nt<=12;nt+=Pe)ue.push(Math.min(nt,12));return ue.includes(12)||ue.push(12),Array.from(new Set(ue)).sort((nt,In)=>nt-In).map(nt=>({label:Ze(nt),value:nt}))}let X=[];for(let ue=0;ue<24;ue+=Pe)X.push({label:Ze(ue),value:ue});return X},[Pe,m]),xe=J__namespace.useMemo(()=>{let X=[];for(let ue=0;ue<60;ue+=Ne)X.push({label:Ze(ue),value:ue});return X},[Ne]),kt=J__namespace.useMemo(()=>{if(!le)return [];let X=[];for(let ue=0;ue<60;ue+=be)X.push({label:Ze(ue),value:ue});return X},[le,be]),Ve=J__namespace.useMemo(()=>H?m?km(H.hour):H.hour:m?12:0,[H,m]),xt=(mo=H==null?void 0:H.minute)!=null?mo:0,ot=(fo=H==null?void 0:H.second)!=null?fo:0,wt=J__namespace.useCallback(X=>{if(m){let ue=Mm(X,K);me({...De,hour:ue});}else me({...De,hour:X});},[De,me,K,m]),Ee=J__namespace.useCallback(X=>{me({...De,minute:X});},[De,me]),Ce=J__namespace.useCallback(X=>{me({...De,second:X});},[De,me]),Mt=J__namespace.useCallback(X=>{ce(X);let ue=H!=null?H:De,We=ue.hour;X==="AM"&&We>=12&&(We-=12),X==="PM"&&We<12&&(We+=12),me({...ue,hour:We});},[De,me,H]),Vt=J__namespace.useCallback(X=>{let ue=X.target.value;if(ie(ue),!ue.trim()){me(null);return}let We=js(ue);We&&me(We);},[me]),{side:ae,align:Ke}=Pm(b),je={small:"h-8 text-sm",middle:`${at} text-sm`,large:"h-11 text-base"},ut={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"},kn={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"},Oo=E||V,Mn=f!=null?f:"Select time",Ao=u("div",{role:"combobox","aria-expanded":we,"aria-haspopup":"dialog",className:s("relative w-full",L),style:k,children:[w&&o("div",{className:"pointer-events-none absolute inset-y-0 left-3 flex items-center text-muted-foreground",children:w}),o(qe,{...A,ref:t,value:$,onChange:Oo?void 0:Vt,onFocus:D,onBlur:W,readOnly:Oo,disabled:P,placeholder:Mn,name:T,id:_,className:s("pr-10 text-sm",kn[y],w&&"pl-10",P&&"cursor-not-allowed opacity-60",!P&&"cursor-pointer",je[p],v?ut[v]:void 0,x),style:{...v==="error"?{borderColor:"hsl(var(--destructive))",boxShadow:"0 0 0 3px hsl(var(--destructive) / 0.2)"}:{},...v==="warning"?{borderColor:"var(--warning, hsl(var(--primary)))",boxShadow:"0 0 0 3px hsl(var(--primary) / 0.2)"}:{},...N!=null?N:{}},onClick:X=>{F==null||F(X),!P&&Te(true);}}),Re&&o("button",{type:"button",className:"absolute inset-y-0 right-8 flex items-center text-muted-foreground transition hover:text-foreground",onMouseDown:X=>{X.preventDefault(),X.stopPropagation();},onClick:X=>{X.preventDefault(),X.stopPropagation(),me(null);},children:he}),o("div",{className:"pointer-events-none absolute inset-y-0 right-3 flex items-center text-muted-foreground",children:o(lucideReact.Clock,{className:"h-4 w-4"})})]}),En=J__namespace.useMemo(()=>[{label:"AM",value:"AM"},{label:"PM",value:"PM"}],[]),Dn=u("div",{className:"flex w-max gap-4 p-4",role:"dialog","aria-modal":"true",children:[o(Ia,{label:"Hour",options:dt,selectedValue:Ve,onSelect:wt}),o(Ia,{label:"Minute",options:xe,selectedValue:xt,onSelect:Ee}),le?o(Ia,{label:"Second",options:kt,selectedValue:ot,onSelect:Ce}):null,m?o(Dm,{value:K,onChange:Mt}):null]}),Ln=u("div",{className:"flex w-full gap-4",children:[o(Fa,{open:we,label:"Hour",options:dt,selectedValue:Ve,onValueChange:X=>(wt(X),true)}),o(Fa,{open:we,label:"Minute",options:xe,selectedValue:xt,onValueChange:X=>(Ee(X),true)}),m?o(Fa,{open:we,label:"Period",options:En,selectedValue:K,infinite:false,onValueChange:X=>(Mt(X),true)}):null]});return V?u(eo,{open:we,onOpenChange:Te,children:[o(dn,{asChild:true,children:Ao}),u(to,{className:"mt-10 max-h-[min(540px,calc(100dvh-6rem))] rounded-t-3xl bg-background",children:[o(oo,{className:"px-6 pb-2 pt-4",children:o(no,{className:"text-base font-medium text-foreground",children:"Select time"})}),u("div",{className:"flex flex-1 flex-col gap-6 px-6 pb-6",children:[o("div",{className:"flex w-full gap-4",children:Ln}),u("div",{className:"mt-auto flex items-center justify-between",children:[o("div",{className:"flex-1"}),u("div",{className:"flex items-center gap-3",children:[C?o(Q,{type:"button",variant:"outline",size:"sm",className:"text-muted-foreground hover:text-foreground",onClick:()=>me(null),children:"Clear"}):null,o(un,{asChild:true,children:o(Q,{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:ne,children:"Done"})})]})]})]})]})]}):u(Qt,{open:we,onOpenChange:Te,children:[o(cn,{asChild:true,children:Ao}),o(Zt,{className:"w-auto border border-border bg-popover p-0 shadow-lg",align:Ke,side:ae,children:Dn})]})});Ha.displayName="TimePicker";function Gs({row:e}){let{transform:t,transition:n,setNodeRef:a,isDragging:r}=sortable.useSortable({id:e.original.id});return o(Nt,{"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:n},children:e.getVisibleCells().map(i=>o(Bt,{children:reactTable.flexRender(i.column.columnDef.cell,i.getContext())},i.id))})}function qm({columns:e,dndEnabled:t,dataIds:n,rows:a}){return a.length?t?o(sortable.SortableContext,{items:n,strategy:sortable.verticalListSortingStrategy,children:a.map(r=>o(Gs,{row:r},r.id))}):a.map(r=>o(Nt,{"data-state":r.getIsSelected()&&"selected",children:r.getVisibleCells().map(i=>{let c=i.column.columnDef.meta;return o(Bt,{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)):o(Nt,{children:o(Bt,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})}function $s({table:e,columns:t,dndEnabled:n=false,onReorder:a,virtualizedRows:r}){var C;let i=(C=r==null?void 0:r.rows)!=null?C:e.getRowModel().rows,c=n?i.map(R=>Number(R.id)):[],d=J__namespace.useId(),l=core.useSensors(core.useSensor(core.MouseSensor,{}),core.useSensor(core.TouchSensor,{}),core.useSensor(core.KeyboardSensor,{}));function g(R){let{active:f,over:b}=R;if(f&&b&&f.id!==b.id&&a){let p=c.indexOf(f.id),v=c.indexOf(b.id),y=sortable.arrayMove(e.options.data,p,v);a(y);}}let m=u(Ms,{className:"table-fixed min-w-full",children:[o(Es,{className:"sticky top-0 z-20 bg-muted",children:e.getHeaderGroups().map(R=>o(Nt,{children:R.headers.map(f=>{let b=f.column.columnDef.meta;return o(Ls,{colSpan:f.colSpan,className:s("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)})},R.id))}),u(Ds,{className:"**:data-[slot=table-cell]:first:w-8",children:[r!=null&&r.paddingTop?o(Nt,{className:"pointer-events-none border-0",children:o(Bt,{colSpan:t.length,className:"p-0",style:{height:r.paddingTop}})}):null,qm({columns:t,dndEnabled:n,dataIds:c,rows:i}),r!=null&&r.paddingBottom?o(Nt,{className:"pointer-events-none border-0",children:o(Bt,{colSpan:t.length,className:"p-0",style:{height:r.paddingBottom}})}):null]})]});return n?o(core.DndContext,{collisionDetection:core.closestCenter,modifiers:[modifiers.restrictToVerticalAxis],onDragEnd:g,sensors:l,id:d,children:m}):m}function Km(e){switch(e){case "desc":return o(lucideReact.ArrowDown,{className:"ml-2 h-4 w-4"});case "asc":return o(lucideReact.ArrowUp,{className:"ml-2 h-4 w-4"});default:return o(lucideReact.ChevronsUpDown,{className:"ml-2 h-4 w-4"})}}function Ys({column:e,title:t,className:n}){if(!e.getCanSort())return o("div",{className:s(n),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 o("div",{className:s("flex items-center space-x-2",n),children:u(Q,{type:"button",variant:"ghost",size:"sm",className:"-ml-3 h-8 justify-start",onClick:a,children:[o("span",{children:t}),Km(e.getIsSorted())]})})}function Ks({table:e,showPageSize:t=true,pageSizeOptions:n=[10,20,30,40,50]}){return u("div",{className:"flex items-center justify-between px-4",children:[u("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."]}),u("div",{className:"flex w-full items-center gap-8 lg:w-fit",children:[t?u("div",{className:"hidden items-center gap-2 lg:flex",children:[o(Me,{htmlFor:"rows-per-page",className:"text-sm font-medium",children:"Rows per page"}),o(Cn,{value:`${e.getState().pagination.pageSize}`,onValueChange:a=>{e.setPageSize(Number(a));},options:n.map(a=>({value:`${a}`,label:a})),triggerProps:{size:"sm",className:"w-20",id:"rows-per-page"},contentProps:{side:"top"}})]}):null,u("div",{className:"flex w-fit items-center justify-center text-sm font-medium",children:["Page ",e.getState().pagination.pageIndex+1," of ",e.getPageCount()]}),u("div",{className:"ml-auto flex items-center gap-2 lg:ml-0",children:[u(Q,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),children:[o("span",{className:"sr-only",children:"Go to first page"}),o(lucideReact.ChevronsLeft,{})]}),u(Q,{variant:"outline",className:"size-8",size:"icon",onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),children:[o("span",{className:"sr-only",children:"Go to previous page"}),o(lucideReact.ChevronLeft,{})]}),u(Q,{variant:"outline",className:"size-8",size:"icon",onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),children:[o("span",{className:"sr-only",children:"Go to next page"}),o(lucideReact.ChevronRight,{})]}),u(Q,{variant:"outline",className:"hidden size-8 lg:flex",size:"icon",onClick:()=>e.setPageIndex(e.getPageCount()-1),disabled:!e.getCanNextPage(),children:[o("span",{className:"sr-only",children:"Go to last page"}),o(lucideReact.ChevronsRight,{})]})]})]})]})}function Js({table:e}){return u(Gi,{children:[o(ya,{asChild:true,children:u(Q,{variant:"outline",size:"sm",className:"ml-auto hidden h-8 lg:flex",children:[o(lucideReact.Settings2,{}),"View"]})}),u(xa,{align:"end",className:"w-[150px]",children:[o(Wi,{children:"Toggle columns"}),o($i,{}),e.getAllColumns().filter(t=>typeof t.accessorFn!="undefined"&&t.getCanHide()).map(t=>o(qi,{className:"capitalize",checked:t.getIsVisible(),onCheckedChange:n=>t.toggleVisibility(!!n),children:t.id},t.id))]})]})}function nf({id:e}){let{attributes:t,listeners:n}=sortable.useSortable({id:e});return u(Q,{...t,...n,variant:"ghost",size:"icon",className:"text-muted-foreground size-7 hover:bg-transparent",children:[o(lucideReact.GripVertical,{className:"text-muted-foreground size-3"}),o("span",{className:"sr-only",children:"Drag to reorder"})]})}var Xs={id:"drag",header:()=>null,cell:({row:e})=>o(nf,{id:e.original.id}),enableSorting:false,enableHiding:false};function _N(e){return [Xs,...e]}function Oa(e,t){return t?t.split(".").reduce((n,a)=>{if(!(n===null||typeof n!="object"))return n[a]},e):e}function sf(e){if(e)return typeof e=="number"?{width:e,minWidth:e}:{width:e,minWidth:e}}function lf(e){var l,g,m;if(!e)return null;let t=(l=e.body)!=null?l:e.payload,n=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:n,headers:a,resultKey:r,mapData:i,delay:c};if(typeof e.post=="string")return {method:"post",url:e.post,body:t,params:n,headers:a,resultKey:r,mapData:i,delay:c};let d=(g=e.url)!=null?g:e.reul;return typeof d=="string"?{method:(m=e.method)!=null?m:"get",url:d,body:t,params:n,headers:a,resultKey:r,mapData:i,delay:c}:null}function cf(e,t){return e.map(n=>{var l,g,m,C;let a=n.item?R=>Oa(R,n.item):R=>R,r=n.align==="right"?"text-right justify-end":n.align==="center"?"text-center justify-center":void 0,i=s(r,n.headerClassName),c=s(n.align==="right"?"text-right":n.align==="center"?"text-center":void 0,n.cellClassName),d=sf(n.width);return {id:n.key,accessorFn:a,header:({column:R})=>o(Ys,{column:R,title:n.title,className:r}),cell:({row:R})=>{let f=R.original,b=n.item?Oa(f,n.item):a(f);return n.func?n.func(f,{value:b,rowIndex:R.index}):b},enableSorting:t&&((l=n.sortable)!=null?l:true)&&!!n.item,enableHiding:(g=n.hiddeable)!=null?g:true,meta:{headerClassName:i,headerStyle:(m=n.headerStyle)!=null?m:d,cellClassName:c,cellStyle:(C=n.cellStyle)!=null?C:d}}})}function df(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 uf(e,t){if(!t||Object.keys(t).length===0)return e;try{let n=new URL(e,typeof window!="undefined"?window.location.origin:"http://localhost");return Object.entries(t).forEach(([a,r])=>{r!=null&&n.searchParams.set(a,String(r));}),n.toString()}catch{let a=new URLSearchParams(Object.entries(t).reduce((i,[c,d])=>(d==null||(i[c]=String(d)),i),{})),r=e.includes("?")?"&":"?";return `${e}${r}${a.toString()}`}}function pf({data:e,columns:t,pagination:n=true,sortable:a=true,reload:r=false,filterable:i=false,selectable:c=false,height:d=480,rowHeight:l=48,overscan:g=5,defaultPageSize:m=25,pageSize:C,className:R,emptyState:f,onDataChange:b,loading:p}){var pe,he,Re;let v=J__namespace.useMemo(()=>lf(e.read),[e.read]),y=J__namespace.useMemo(()=>{var ne;return (ne=e.bind)!=null?ne:[]},[e.bind]),x=(pe=C==null?void 0:C.count)!=null?pe:m,N=(he=C==null?void 0:C.options)!=null?he:[10,20,30,40,50],w=(Re=C==null?void 0:C.visible)!=null?Re:true,[S,h]=J__namespace.useState(()=>y),[E,L]=J__namespace.useState(false),[k,P]=J__namespace.useState(null),T=J__namespace.useRef(null),[_,O]=J__namespace.useState(0),[W,D]=J__namespace.useState(d),F=J__namespace.useRef(null),[A,M]=J__namespace.useState(""),U=J__namespace.useMemo(()=>cf(t,a),[t,a]),V=J__namespace.useMemo(()=>c?[{id:"__select",enableHiding:false,enableSorting:false,size:44,header:({table:oe})=>o("div",{className:"flex items-center justify-center",children:o(Ro,{"aria-label":"Select all rows",checked:oe.getIsAllPageRowsSelected()||oe.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:ye=>oe.toggleAllPageRowsSelected(ye===true)})}),cell:({row:oe})=>o("div",{className:"flex items-center justify-center",children:o(Ro,{"aria-label":"Select row",checked:oe.getIsSelected(),onCheckedChange:ye=>oe.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]),B=J__namespace.useMemo(()=>t.filter(ne=>!!ne.item),[t]),q=J__namespace.useMemo(()=>{if(!i||!A.trim())return S;let ne=A.trim().toLowerCase();return S.filter(oe=>B.some(ye=>{let de=Oa(oe,ye.item);return de==null?false:String(de).toLowerCase().includes(ne)}))},[S,i,A,B]),j=gr({data:q,columns:V,enableRowSelection:c,defaultPageSize:n?x:q.length||10,getRowId:(ne,oe)=>oe.toString()});J__namespace.useEffect(()=>{n||(j.setPageIndex(0),j.setPageSize(q.length||1));},[n,q.length,j]),J__namespace.useEffect(()=>{n&&j.setPageSize(x);},[n,x,j]),J__namespace.useEffect(()=>{h(y);},[y]),J__namespace.useEffect(()=>{i||M("");},[i]);let G=J__namespace.useCallback(async()=>{var oe,ye;if(!v)return;(oe=F.current)==null||oe.abort();let ne=new AbortController;F.current=ne,L(true),P(null);try{let de=uf(v.url,v.params),we=new Headers(v.headers),Te;v.method==="post"&&v.body!==void 0&&(Te=typeof v.body=="string"?v.body:JSON.stringify(v.body),we.has("Content-Type")||we.set("Content-Type","application/json"));let me=await fetch(de,{method:v.method.toUpperCase(),headers:we,body:Te,signal:ne.signal});if(!me.ok)throw new Error(`Request failed with status ${me.status}`);v.delay&&v.delay>0&&await new Promise(Ne=>setTimeout(Ne,v.delay));let De=await me.json(),Pe=v.mapData?v.mapData(De):df(De,v.resultKey);h(Pe),P(null),b==null||b(Pe);}catch(de){if(de.name==="AbortError")return;P((ye=de.message)!=null?ye:"Unable to fetch data");}finally{L(false);}},[v,b]);J__namespace.useEffect(()=>(v&&G().catch(()=>{}),()=>{var ne;(ne=F.current)==null||ne.abort();}),[v,G]),J__namespace.useEffect(()=>{if(!T.current)return;let ne=T.current;D(ne.clientHeight||d);let oe=()=>{D(ne.clientHeight||d);};return typeof window!="undefined"&&window.addEventListener("resize",oe),()=>{typeof window!="undefined"&&window.removeEventListener("resize",oe);}},[d]);let H=j.getRowModel().rows,te=H.length,K=j.getFilteredSelectedRowModel().rows.length,ce=j.getFilteredRowModel().rows.length;J__namespace.useEffect(()=>{T.current&&(T.current.scrollTop=0),O(0);},[te]);let le=te*l,re=Math.max(0,Math.floor(_/l)-g),ge=Math.min(H.length,Math.ceil((_+W)/l)+g),fe=J__namespace.useMemo(()=>{if(!H.length)return null;let ne=H.slice(re,ge),oe=re*l,ye=ne.length*l,de=Math.max(le-oe-ye,0);return {rows:ne,paddingTop:oe,paddingBottom:de}},[H,re,ge,l,le]),$=!!p||E,ie=!$&&S.length===0&&!!f;return u("div",{className:s("flex w-full flex-col gap-4",R),children:[u("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[i?u("div",{className:"relative flex w-full max-w-md items-center",children:[o(lucideReact.Search,{className:"pointer-events-none absolute left-3 h-4 w-4 text-muted-foreground"}),o(qe,{className:"pl-9",placeholder:"Search rows...",value:A,onChange:ne=>M(ne.target.value)})]}):o("div",{className:"h-9"}),u("div",{className:"flex items-center justify-end gap-2",children:[r&&v?u(Q,{variant:"outline",size:"sm",onClick:()=>{G().catch(()=>{});},disabled:E||!!p,children:[E||p?o(lucideReact.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):o(lucideReact.RotateCcw,{className:"mr-2 h-4 w-4"}),"Reload"]}):null,o(Js,{table:j})]})]}),u("div",{className:"relative overflow-hidden rounded-lg border",children:[ie?o("div",{className:"flex items-center justify-center p-6 text-sm text-muted-foreground",children:f}):o("div",{ref:T,className:"max-h-full overflow-auto",style:{maxHeight:d},onScroll:ne=>O(ne.currentTarget.scrollTop),children:o($s,{table:j,columns:V,virtualizedRows:fe!=null?fe:void 0})}),$?o("div",{className:"absolute inset-0 flex items-center justify-center bg-background/70 backdrop-blur-sm",children:u("div",{className:"flex flex-col items-center gap-2 text-sm text-muted-foreground",children:[o(lucideReact.Loader2,{className:"h-5 w-5 animate-spin"}),o("span",{children:"Loading data\u2026"})]})}):null]}),k?o("div",{className:"text-destructive text-sm",children:k}):null,n?o(Ks,{table:j,showPageSize:w,pageSizeOptions:N}):c?o("div",{className:"flex items-center justify-between px-4 text-sm text-muted-foreground",children:u("span",{children:[K," of ",ce," row(s) selected."]})}):null]})}pf.displayName="DataGrid";function ff({onReset:e}){return u("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-background px-6 py-16 text-center",children:[u("div",{className:"space-y-3",children:[o("h1",{className:"text-3xl font-semibold tracking-tight text-foreground",children:"Something went wrong"}),o("p",{className:"text-base text-muted-foreground",children:"We hit an unexpected error. You can try again or head back to the dashboard."})]}),u("div",{className:"flex flex-wrap items-center justify-center gap-3",children:[o(Q,{onClick:()=>{e(),dr("/dashboard/default");},children:"Back to home"}),o(Q,{variant:"outline",onClick:()=>{e();},children:"Try again"})]})]})}var Zs=class extends J.Component{constructor(){super(...arguments);this.state={hasError:false};this.resetBoundary=()=>{this.setState({hasError:false});};}static getDerivedStateFromError(){return {hasError:true}}componentDidCatch(n,a){var r,i;process.env.NODE_ENV!=="production"&&console.error("ErrorBoundary caught an error",n,a),(i=(r=this.props).onError)==null||i.call(r,n,a);}render(){if(this.state.hasError){let{fallback:n}=this.props;return n?typeof n=="function"?n(this.resetBoundary):n:o(ff,{onReset:this.resetBoundary})}return this.props.children}};var Ae=J__namespace.forwardRef(({className:e,...t},n)=>o("div",{ref:n,className:s("flex flex-col gap-2",e),...t}));Ae.displayName="FormBlock";var ze=J__namespace.forwardRef(({message:e,children:t,className:n,...a},r)=>!e&&!t?null:o("p",{ref:r,className:s("text-sm text-destructive",n),role:"alert",...a,children:e!=null?e:t}));ze.displayName="FormError";var gf=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange||e.handleBlur?e:(t=e.form)!=null?t:e},bf=J__namespace.forwardRef(({label:e,name:t,type:n="text",placeholder:a,required:r=false,error:i,value:c,onChange:d,onBlur:l,className:g,description:m,autoComplete:C,labelProps:R={},inputProps:f={},form:b,rules:p},v)=>{var ce,le;let y=gf(b),x=y==null?void 0:y.values,N=y==null?void 0:y.errors,w=y==null?void 0:y.touched,S=x==null?void 0:x[t],h=N==null?void 0:N[t],E=w==null?void 0:w[t],L=(ce=y==null?void 0:y.validationSequence)!=null?ce:0,k=y==null?void 0:y.handleChange,P=y==null?void 0:y.handleBlur,T=y==null?void 0:y.setFieldValue,_=y==null?void 0:y.setFieldError,O=y==null?void 0:y.setFieldTouched,{onChange:W,onBlur:D,className:F,type:A,autoComplete:M,...U}=f,{children:V,...B}=R,q=A!=null?A:n,j=re=>{let ge=re.target.value,$=!!p||r?ol(ge,p,r):void 0;_==null||_(t,$),T==null||T(t,ge),k==null||k(re),d==null||d(ge),W==null||W(re);},G=re=>{O==null||O(t,true),P==null||P(re),l==null||l(),D==null||D(re);},H=S!==void 0?S:c!==void 0?c:"",te=(le=E?h:void 0)!=null?le:i,K=J__namespace.useRef(L);return J__namespace.useEffect(()=>{let re=!!p||r,ge=L!==K.current;if(!_||!re){K.current=L;return}if(!E&&!ge){K.current=L;return}let fe=typeof H=="string"?H:H!=null?String(H):"",$=ol(fe,p,r);$!==h&&_(t,$),K.current=L;},[H,h,_,E,t,r,p,L]),u(Ae,{className:g,children:[e&&o(Me,{htmlFor:t,...B,children:V!=null?V:u("span",{className:"flex items-center gap-1",children:[o("span",{children:e}),r&&o("span",{className:"text-destructive",children:"*"})]})}),m&&o("p",{className:"text-sm text-muted-foreground",children:m}),o(qe,{ref:v,id:t,name:t,type:q,placeholder:a,value:H,onChange:j,onBlur:G,"aria-invalid":!!te,autoComplete:M!=null?M:C,className:F,...U}),o(ze,{message:te})]})});function ol(e,t,n){if(n&&!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"}}}bf.displayName="FormInput";var vf=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange||e.handleBlur?e:(t=e.form)!=null?t:e},hf=J__namespace.forwardRef(({label:e,name:t,mask:n,placeholderChar:a,placeholder:r,required:i=false,error:c,value:d,onChange:l,onBlur:g,className:m,description:C,labelProps:R={},inputProps:f={},form:b,rules:p},v)=>{var j,G;let y=vf(b),x=y==null?void 0:y.values,N=y==null?void 0:y.errors,w=y==null?void 0:y.touched,S=x==null?void 0:x[t],h=N==null?void 0:N[t],E=w==null?void 0:w[t],L=(j=y==null?void 0:y.validationSequence)!=null?j:0,k=y==null?void 0:y.setFieldValue,P=y==null?void 0:y.setFieldError,T=y==null?void 0:y.setFieldTouched,{className:_,onBlur:O,onChange:W,...D}=f,{children:F,...A}=R,M=H=>{let K=!!p||i?nl(H,p,i):void 0;P==null||P(t,K),k==null||k(t,H),l==null||l(H),W==null||W(H);},U=H=>{T==null||T(t,true),g==null||g(),O==null||O(H);},V=S!==void 0?S:d!==void 0?d:"",B=(G=E?h:void 0)!=null?G:c,q=J__namespace.useRef(L);return J__namespace.useEffect(()=>{let H=!!p||i,te=L!==q.current;if(!P||!H){q.current=L;return}if(!E&&!te){q.current=L;return}let K=nl(V,p,i);K!==h&&P(t,K),q.current=L;},[V,h,P,E,t,i,p,L]),u(Ae,{className:m,children:[e&&o(Me,{htmlFor:t,...A,children:F!=null?F:u("span",{className:"flex items-center gap-1",children:[o("span",{children:e}),i&&o("span",{className:"text-destructive",children:"*"})]})}),C&&o("p",{className:"text-sm text-muted-foreground",children:C}),o(ua,{ref:v,id:t,name:t,mask:n,placeholderChar:a,placeholder:r,value:V,onChange:M,onBlur:U,"aria-invalid":!!B,className:_,...D}),o(ze,{message:B})]})});hf.displayName="FormInputMask";function nl(e,t,n){if(n&&!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 yf=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange||e.handleBlur?e:(t=e.form)!=null?t:e},xf=J__namespace.forwardRef(({label:e,name:t,placeholder:n,required:a=false,error:r,value:i,onChange:c,onBlur:d,className:l,description:g,labelProps:m={},inputProps:C={},form:R,min:f,max:b,decimals:p,formatter:v,parser:y,rules:x},N)=>{var te,K;let w=yf(R),S=w==null?void 0:w.values,h=w==null?void 0:w.errors,E=w==null?void 0:w.touched,L=S==null?void 0:S[t],k=h==null?void 0:h[t],P=E==null?void 0:E[t],T=(te=w==null?void 0:w.validationSequence)!=null?te:0,_=w==null?void 0:w.setFieldValue,O=w==null?void 0:w.setFieldError,W=w==null?void 0:w.setFieldTouched,{className:D,onBlur:F,onChange:A,...M}=C,{children:U,...V}=m,B=ce=>{let re=!!x||a?al(ce,x,a):void 0;O==null||O(t,re),_==null||_(t,ce),c==null||c(ce),A==null||A(ce);},q=ce=>{W==null||W(t,true),d==null||d(),F==null||F(ce);},j=L!==void 0?L:i!==void 0?i:null,G=(K=P?k:void 0)!=null?K:r,H=J__namespace.useRef(T);return J__namespace.useEffect(()=>{let ce=!!x||a,le=T!==H.current;if(!O||!ce){H.current=T;return}if(!P&&!le){H.current=T;return}let re=al(j,x,a);re!==k&&O(t,re),H.current=T;},[j,k,O,P,t,a,x,T]),u(Ae,{className:l,children:[e&&o(Me,{htmlFor:t,...V,children:U!=null?U:u("span",{className:"flex items-center gap-1",children:[o("span",{children:e}),a&&o("span",{className:"text-destructive",children:"*"})]})}),g&&o("p",{className:"text-sm text-muted-foreground",children:g}),o(da,{ref:N,id:t,name:t,placeholder:n,value:j,onChange:B,onBlur:q,"aria-invalid":!!G,min:f,max:b,decimals:p,formatter:v,parser:y,className:D,...M}),o(ze,{message:G})]})});xf.displayName="FormInputNumeric";function al(e,t,n){if(n&&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 Rf=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange||e.handleBlur?e:(t=e.form)!=null?t:e};function L0({label:e,name:t,description:n,placeholder:a="Select an option",required:r=false,error:i,value:c,defaultValue:d,onChange:l,onBlur:g,className:m,disabled:C,labelProps:R={},selectProps:f={},triggerProps:b={},contentProps:p={},multiSelectProps:v={},multiSelectTriggerProps:y={},multiSelectValueProps:x={},multiSelectContentProps:N={},form:w,options:S,isMulti:h=false,rules:E}){var Ce,Mt,Vt;let L=Ye(),k=Rf(w),P=k==null?void 0:k.values,T=k==null?void 0:k.errors,_=k==null?void 0:k.touched,O=P==null?void 0:P[t],W=T==null?void 0:T[t],D=_==null?void 0:_[t],F=k==null?void 0:k.setFieldValue,A=k==null?void 0:k.setFieldError,M=k==null?void 0:k.setFieldTouched,U=k==null?void 0:k.handleChange,V=k==null?void 0:k.handleBlur,B=(Ce=k==null?void 0:k.validationSequence)!=null?Ce:0,{onValueChange:q,value:j,defaultValue:G,...H}=f,{onBlur:te,...K}=b,ce={...K,disabled:C!=null?C:K.disabled},{title:le,...re}=p,{onValueChange:ge,value:fe,defaultValue:$,...ie}=v,{onBlur:pe,...he}=y,{title:Re,...ne}=N,[oe,ye]=J__namespace.useState(typeof d=="string"?d:""),[de,we]=J__namespace.useState(Array.isArray(d)?d:[]);J__namespace.useEffect(()=>{typeof d=="string"&&j===void 0&&O===void 0&&c===void 0&&ye(d);},[d,O,j,c]),J__namespace.useEffect(()=>{Array.isArray(d)&&fe===void 0&&!Array.isArray(O)&&!Array.isArray(c)&&we(d);},[d,O,fe,c]);let Te=typeof j=="string"?j:typeof O=="string"?O:typeof c=="string"?c:oe,me=Array.isArray(fe)?fe:Array.isArray(O)?O:Array.isArray(c)?c:de,De=(Mt=D?W:void 0)!=null?Mt:i,Pe=J__namespace.useRef(B);J__namespace.useEffect(()=>{let ae=!!E||r,Ke=B!==Pe.current;if(!A||!ae){Pe.current=B;return}if(!D&&!Ke){Pe.current=B;return}let je=h?me:Te!=null?Te:"",ut=Aa(je,E,r);ut!==W&&A(t,ut),Pe.current=B;},[me,Te,W,A,D,h,t,r,E,B]);let Ne=J__namespace.useCallback(ae=>{Array.isArray(ae)?(F==null||F(t,ae),U&&U({target:{name:t,value:ae}})):(F==null||F(t,ae),U&&U({target:{name:t,value:ae}}));},[U,F,t]),be=J__namespace.useCallback(ae=>{j===void 0&&O===void 0&&c===void 0&&ye(ae);let je=!!E||r?Aa(ae,E,r):void 0;A==null||A(t,je),Ne(ae),l==null||l(ae),q==null||q(ae);},[O,Ne,l,q,j,c,E,r,A,t]),dt=J__namespace.useCallback(ae=>{fe===void 0&&!Array.isArray(O)&&!Array.isArray(c)&&we(ae);let je=!!E||r?Aa(ae,E,r):void 0;A==null||A(t,je),Ne(ae),l==null||l(ae),ge==null||ge(ae);},[O,Ne,ge,fe,l,c,E,r,A,t]),xe=J__namespace.useCallback(ae=>{M==null||M(t,true),V==null||V({target:{name:t}}),g==null||g(),te==null||te(ae);},[V,M,t,g,te]),kt=J__namespace.useCallback(ae=>{M==null||M(t,true),V==null||V({target:{name:t}}),g==null||g(),pe==null||pe(ae);},[V,M,t,pe,g]),Ve=G!=null?G:typeof d=="string"?d:void 0,xt=$!=null?$:Array.isArray(d)?d:void 0,[ot,wt]=J__namespace.useState(false),Ee=({isMulti:ae=false})=>{var je;let Ke=ae?me.length>0?`${me.length} selected`:a:((je=S.find(ut=>ut.value===Te))==null?void 0:je.label)||a;return u(Q,{variant:"outline",className:s("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",!!De&&"border-destructive",ce.className),onClick:()=>!ce.disabled&&wt(true),disabled:ce.disabled,type:"button",children:[o("span",{className:"flex-1 text-left truncate",children:Ke}),o(lucideReact.ChevronDownIcon,{className:"h-4 w-4 opacity-50 flex-shrink-0"})]})};return u(Ae,{className:m,children:[e&&o(Me,{htmlFor:t,...R,children:(Vt=R.children)!=null?Vt:u("span",{className:"flex items-center gap-1",children:[o("span",{children:e}),r&&o("span",{className:"text-destructive",children:"*"})]})}),h?u(jsxRuntime.Fragment,{children:[L?u(jsxRuntime.Fragment,{children:[o(Ee,{isMulti:true}),o(At,{open:ot,onOpenChange:wt,title:Re!=null?Re:e,options:S,selectedValues:me,onSelect:ae=>{let Ke=me.includes(ae)?me.filter(je=>je!==ae):[...me,ae];dt(Ke);},isMulti:true})]}):u(us,{...ie,value:me,defaultValue:xt,onValueChange:dt,children:[o(ps,{"data-name":t,"aria-invalid":!!De,...he,...ce,onBlur:kt,children:o(ms,{placeholder:a,...x})}),o(fs,{title:Re!=null?Re:e,...ne,children:S.map(ae=>o(gs,{value:ae.value,disabled:ae.disabled,children:ae.label},ae.value))})]}),o("input",{type:"hidden",name:t,value:me.join(",")})]}):u(jsxRuntime.Fragment,{children:[L?u(jsxRuntime.Fragment,{children:[o(Ee,{}),o(At,{open:ot,onOpenChange:wt,title:le!=null?le:e,options:S,selectedValues:Te,onSelect:be,isMulti:false})]}):o(Cn,{...H,value:Te,defaultValue:Ve,onValueChange:be,options:S.map(ae=>({value:ae.value,label:ae.label,disabled:ae.disabled})),placeholder:a,triggerProps:{...ce,id:t,"aria-invalid":!!De,onBlur:xe},contentProps:{...re,title:le!=null?le:e}}),o("input",{type:"hidden",name:t,value:Te!=null?Te:""})]}),o(ze,{message:De}),n&&o("p",{className:"text-sm text-muted-foreground",children:n})]})}function Aa(e,t,n){if(n){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 Cf=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange||e.handleBlur?e:(t=e.form)!=null?t:e},Pf=J__namespace.forwardRef(({label:e,name:t,placeholder:n,required:a=false,error:r,value:i,onChange:c,onBlur:d,className:l,labelProps:g={},textareaProps:m={},form:C,rules:R},f)=>{var q,j;let b=Cf(C),p=b==null?void 0:b.values,v=b==null?void 0:b.errors,y=b==null?void 0:b.touched,x=p==null?void 0:p[t],N=v==null?void 0:v[t],w=y==null?void 0:y[t],S=(q=b==null?void 0:b.validationSequence)!=null?q:0,h=b==null?void 0:b.handleChange,E=b==null?void 0:b.handleBlur,L=b==null?void 0:b.setFieldError,k=b==null?void 0:b.setFieldValue,P=b==null?void 0:b.setFieldTouched,{onChange:T,onBlur:_,className:O,...W}=m,{children:D,...F}=g,A=G=>{let H=G.target.value,K=!!R||a?rl(H,R,a):void 0;L==null||L(t,K),k==null||k(t,H),h==null||h(G),c==null||c(H),T==null||T(G);},M=G=>{P==null||P(t,true),E==null||E(G),d==null||d(),_==null||_(G);},U=x!==void 0?String(x):i!==void 0?i:"",V=(j=w?N:void 0)!=null?j:r,B=J__namespace.useRef(S);return J__namespace.useEffect(()=>{let G=!!R||a,H=S!==B.current;if(!L||!G){B.current=S;return}if(!w&&!H){B.current=S;return}let te=rl(U,R,a);te!==N&&L(t,te),B.current=S;},[U,N,L,w,t,a,R,S]),u(Ae,{className:l,children:[e&&o(Me,{htmlFor:t,...F,children:D!=null?D:u("span",{className:"flex items-center gap-1",children:[o("span",{children:e}),a&&o("span",{className:"text-destructive",children:"*"})]})}),o(Ea,{ref:f,id:t,name:t,placeholder:n,value:U,onChange:A,onBlur:M,"aria-invalid":!!V,className:O,...W}),o(ze,{message:V})]})});function rl(e,t,n){if(n&&!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"}}}Pf.displayName="FormTextarea";var Tf=e=>{var t;if(e)return e.setFieldValue||e.setFieldTouched||e.handleBlur?e:(t=e.form)!=null?t:e},Nf=J__namespace.forwardRef(({label:e,description:t,name:n,required:a=false,error:r,value:i,defaultValue:c,onChange:d,onBlur:l,form:g,options:m,className:C,labelProps:R={},radioGroupProps:f={},optionLabelProps:b={},optionWrapperClassName:p,...v},y)=>{var q,j;let x=Tf(g),N=x==null?void 0:x.values,w=x==null?void 0:x.errors,S=x==null?void 0:x.touched,h=N==null?void 0:N[n],E=w==null?void 0:w[n],k=(q=(S==null?void 0:S[n])?E:void 0)!=null?q:r,{className:P,onValueChange:T,onBlur:_,value:O,defaultValue:W,...D}=f,F=(j=i!=null?i:O!==void 0?O:void 0)!=null?j:h!=null?String(h):void 0,A=F===void 0?c!=null?c:W:void 0,M=J__namespace.useCallback(G=>{var H;(H=x==null?void 0:x.setFieldValue)==null||H.call(x,n,G),d==null||d(G),T==null||T(G);},[x,n,d,T]),U=J__namespace.useCallback(G=>{var H,te;(H=x==null?void 0:x.setFieldTouched)==null||H.call(x,n,true),(te=x==null?void 0:x.handleBlur)==null||te.call(x,{target:{name:n}}),l==null||l(),_==null||_(G);},[x,n,l,_]),{className:V,...B}=b;return u(Ae,{ref:y,className:s("gap-3",C),...v,children:[(e||t)&&u("div",{className:"space-y-1",children:[e&&o(Me,{...R,children:u("span",{className:"flex items-center gap-1",children:[o("span",{children:e}),a&&o("span",{className:"text-destructive",children:"*"})]})}),t?o("p",{className:"text-sm text-muted-foreground",children:t}):null]}),o(is,{"aria-invalid":!!k,...D,...F!==void 0?{value:F}:A!==void 0?{defaultValue:A}:{},onValueChange:M,onBlur:U,className:s("grid gap-3",P),children:m.map(G=>{let H=`${n}-${G.value}`;return u("div",{className:s("flex items-start gap-3 rounded-lg border border-input bg-background p-3 shadow-xs",p,G.className,G.disabled&&"opacity-60"),children:[o(ss,{id:H,value:G.value,disabled:G.disabled,"aria-invalid":!!k,className:"mt-1"}),u(Me,{htmlFor:H,className:s("flex-col items-start gap-1 font-normal sm:flex-row sm:items-center sm:gap-2",V),...B,children:[o("span",{className:"text-sm font-medium text-foreground",children:G.label}),G.description?o("span",{className:"block text-sm text-muted-foreground",children:G.description}):null]})]},G.value)})}),o(ze,{message:k})]})});Nf.displayName="FormRadioGroup";var Sf=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange||e.handleBlur?e:(t=e.form)!=null?t:e};function Q0({label:e,name:t,placeholder:n,required:a=false,error:r,value:i,defaultValue:c=null,onChange:d,onBlur:l,className:g,description:m,labelProps:C={},datePickerProps:R={},form:f,rules:b}){var re,ge,fe;let p=Sf(f),v=p==null?void 0:p.values,y=p==null?void 0:p.errors,x=p==null?void 0:p.touched,N=p==null?void 0:p.setFieldValue,w=p==null?void 0:p.setFieldError,S=p==null?void 0:p.setFieldTouched,h=p==null?void 0:p.handleChange,E=p==null?void 0:p.handleBlur,L=v==null?void 0:v[t],k=y==null?void 0:y[t],P=x==null?void 0:x[t],T=(re=p==null?void 0:p.validationSequence)!=null?re:0,{onChange:_,onBlur:O,value:W,defaultValue:D,placeholder:F,status:A,...M}=R,[U,V]=J__namespace.useState((ge=D!=null?D:c)!=null?ge:null);J__namespace.useEffect(()=>{var $;W===void 0&&i===void 0&&L===void 0&&V(($=D!=null?D:c)!=null?$:null);},[D,W,c,L,i]);let B=W!==void 0?W!=null?W:null:L!==void 0?L!=null?L:null:i!==void 0?i!=null?i:null:U,q=(fe=P?k:void 0)!=null?fe:r,j=A!=null?A:q?"error":void 0,G=F!=null?F:n,{children:H,...te}=C,K=J__namespace.useRef(T);J__namespace.useEffect(()=>{let $=!!b||a,ie=T!==K.current;if(!w||!$){K.current=T;return}if(!P&&!ie){K.current=T;return}let pe=il(B!=null?B:null,b,a);pe!==k&&w(t,pe),K.current=T;},[B,k,w,P,t,a,b,T]);let ce=J__namespace.useCallback(($,ie)=>{W===void 0&&i===void 0&&L===void 0&&V($!=null?$:null);let pe=il($,b,a);w==null||w(t,pe),N?N(t,$!=null?$:null):h&&h({target:{name:t,value:ie}}),d==null||d($!=null?$:null),_==null||_($!=null?$:null,ie);},[_,W,h,w,N,L,t,d,a,b,i]),le=J__namespace.useCallback($=>{S==null||S(t,true),E==null||E({target:{name:t}}),l==null||l(),O==null||O($);},[O,E,S,t,l]);return u(Ae,{className:g,children:[e&&o(Me,{htmlFor:t,...te,children:H!=null?H:u("span",{className:"flex items-center gap-1",children:[o("span",{children:e}),a&&o("span",{className:"text-destructive",children:"*"})]})}),m&&o("p",{className:"text-sm text-muted-foreground",children:m}),o(ha,{id:t,name:t,value:B!=null?B:null,onChange:ce,onBlur:le,placeholder:G,status:j,"aria-invalid":!!q,...M}),o(ze,{message:q})]})}function il(e,t,n){if(n&&!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 kf=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange||e.handleBlur?e:(t=e.form)!=null?t:e};function rS({label:e,name:t,placeholder:n,required:a=false,error:r,value:i,defaultValue:c=null,onChange:d,onBlur:l,className:g,description:m,labelProps:C={},timePickerProps:R={},form:f,rules:b}){var re,ge,fe;let p=kf(f),v=p==null?void 0:p.values,y=p==null?void 0:p.errors,x=p==null?void 0:p.touched,N=p==null?void 0:p.setFieldValue,w=p==null?void 0:p.setFieldError,S=p==null?void 0:p.setFieldTouched,h=p==null?void 0:p.handleChange,E=p==null?void 0:p.handleBlur,L=v==null?void 0:v[t],k=y==null?void 0:y[t],P=x==null?void 0:x[t],T=(re=p==null?void 0:p.validationSequence)!=null?re:0,{onChange:_,onBlur:O,value:W,defaultValue:D,placeholder:F,status:A,...M}=R,[U,V]=J__namespace.useState((ge=D!=null?D:c)!=null?ge:null);J__namespace.useEffect(()=>{var $;W===void 0&&i===void 0&&L===void 0&&V(($=D!=null?D:c)!=null?$:null);},[c,L,D,W,i]);let B=W!==void 0?W!=null?W:null:L!==void 0?L!=null?L:null:i!==void 0?i!=null?i:null:U,q=(fe=P?k:void 0)!=null?fe:r,j=A!=null?A:q?"error":void 0,G=F!=null?F:n,{children:H,...te}=C,K=J__namespace.useRef(T);J__namespace.useEffect(()=>{let $=!!b||a,ie=T!==K.current;if(!w||!$){K.current=T;return}if(!P&&!ie){K.current=T;return}let pe=sl(B!=null?B:null,b,a);pe!==k&&w(t,pe),K.current=T;},[B,k,w,P,t,a,b,T]);let ce=J__namespace.useCallback(($,ie)=>{W===void 0&&i===void 0&&L===void 0&&V($!=null?$:null);let pe=sl($,b,a);w==null||w(t,pe),N?N(t,$!=null?$:null):h&&h({target:{name:t,value:ie}}),d==null||d($!=null?$:null),_==null||_($!=null?$:null,ie);},[h,w,N,L,t,d,a,b,_,W,i]),le=J__namespace.useCallback($=>{S==null||S(t,true),E==null||E({target:{name:t}}),l==null||l(),O==null||O($);},[E,S,t,l,O]);return u(Ae,{className:g,children:[e&&o(Me,{htmlFor:t,...te,children:H!=null?H:u("span",{className:"flex items-center gap-1",children:[o("span",{children:e}),a&&o("span",{className:"text-destructive",children:"*"})]})}),m&&o("p",{className:"text-sm text-muted-foreground",children:m}),o(Ha,{id:t,name:t,value:B!=null?B:null,onChange:ce,onBlur:le,placeholder:G,status:j,"aria-invalid":!!q,...M}),o(ze,{message:q})]})}function sl(e,t,n){if(n&&!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 Mf=e=>{var t;if(e)return e.setFieldValue||e.setFieldError||e.setFieldTouched||e.handleChange?e:(t=e.form)!=null?t:e},Ef=({name:e,label:t,description:n,className:a,checked:r,defaultChecked:i,onCheckedChange:c,switchProps:d,error:l,form:g,rules:m})=>{var B,q;let C=J__namespace.useId(),{id:R,onCheckedChange:f,className:b,disabled:p,"aria-describedby":v,"aria-labelledby":y,...x}=d!=null?d:{},N=R!=null?R:C,w=Mf(g),S=w==null?void 0:w.values,h=w==null?void 0:w.errors,E=w==null?void 0:w.touched,L=S==null?void 0:S[e],k=h==null?void 0:h[e],P=E==null?void 0:E[e],T=(B=w==null?void 0:w.validationSequence)!=null?B:0,_=(q=P?k:void 0)!=null?q:l,O=L!==void 0?!!L:r!==void 0?r:void 0,W=n?`${N}-description`:void 0,D=_?`${N}-error`:void 0,F=[v,W,D].filter(Boolean).join(" ").trim()||void 0,A=t?[y,`${N}-label`].filter(Boolean).join(" ").trim()||void 0:y,M=J__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 H=!!m?ll(j,m):void 0;if((te=w==null?void 0:w.setFieldError)==null||te.call(w,e,H),(K=w==null?void 0:w.setFieldValue)==null||K.call(w,e,j),(ce=w==null?void 0:w.setFieldTouched)==null||ce.call(w,e,true),w!=null&&w.handleChange){let le={target:{name:e,value:j,checked:j}};w.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(!(w!=null&&w.setFieldError)||!j){V.current=T;return}if(!P&&!G){V.current=T;return}let te=ll(L!==void 0?!!L:r!==void 0?r:!!i,m);te!==k&&w.setFieldError(e,te),V.current=T;},[r,i,k,P,L,e,w,m,T]),u("div",{className:s("flex items-start justify-between gap-4",a),children:[u("div",{className:"flex-1 space-y-2",children:[t?o(Eo,{id:`${N}-label`,htmlFor:N,onClick:M,className:s("text-sm leading-none font-medium",p?"cursor-not-allowed":"cursor-pointer"),children:t}):null,n?o(ko,{id:W,children:n}):null,o(Mo,{id:D,children:_})]}),o(ks,{name:e,id:N,"aria-invalid":!!_,"aria-describedby":F,"aria-labelledby":A,className:s("cursor-pointer",b),disabled:p,...x,...O!==void 0?{checked:O}:{defaultChecked:i},onCheckedChange:U})]})};Ef.displayName="FormSwitch";function ll(e,t){if(t){if(t.required&&!e)return typeof t.required=="string"?t.required:"This field is required";if(t.validate){let n=t.validate(e);if(typeof n=="string")return n;if(n===false)return "Invalid value"}}}var gS=["sidebar","floating","inset"],bS=["offcanvas","icon","none"],vS=["centered","full-width"],hS=["sticky","scroll"];
|
|
9
|
+
Object.defineProperty(exports,"toast",{enumerable:true,get:function(){return sonner.toast}});exports.Accordion=wg;exports.AccordionContent=Pg;exports.AccordionItem=Rg;exports.AccordionTrigger=Cg;exports.Alert=Mg;exports.AlertDescription=Dg;exports.AlertDialog=Ug;exports.AlertDialogAction=Jg;exports.AlertDialogCancel=Xg;exports.AlertDialogContent=qg;exports.AlertDialogDescription=Kg;exports.AlertDialogFooter=$g;exports.AlertDialogHeader=Wg;exports.AlertDialogOverlay=oc;exports.AlertDialogPortal=tc;exports.AlertDialogTitle=Yg;exports.AlertDialogTrigger=Gg;exports.AlertTitle=Eg;exports.AspectRatio=tb;exports.Avatar=ib;exports.AvatarFallback=lb;exports.AvatarImage=sb;exports.Badge=vr;exports.Breadcrumb=yb;exports.BreadcrumbEllipsis=Tb;exports.BreadcrumbItem=wb;exports.BreadcrumbLink=Rb;exports.BreadcrumbList=xb;exports.BreadcrumbPage=Cb;exports.BreadcrumbSeparator=Pb;exports.Button=Q;exports.CONTENT_LAYOUT_VALUES=vS;exports.Calendar=Ib;exports.CalendarDayButton=fc;exports.Card=Ob;exports.CardAction=Vb;exports.CardContent=jb;exports.CardDescription=Bb;exports.CardFooter=Ub;exports.CardHeader=Ab;exports.CardTitle=zb;exports.Carousel=Jb;exports.CarouselContent=Xb;exports.CarouselItem=Qb;exports.CarouselNext=ev;exports.CarouselPrevious=Zb;exports.ChartContainer=bh;exports.ChartLegend=yh;exports.ChartLegendContent=xh;exports.ChartStyle=pd;exports.ChartTooltip=vh;exports.ChartTooltipContent=hh;exports.Chat=ld;exports.ChatContainer=jr;exports.ChatForm=Ur;exports.ChatMessage=_r;exports.ChatMessages=cd;exports.Checkbox=Ro;exports.Collapsible=Lr;exports.CollapsibleContent=Fr;exports.CollapsibleTrigger=Ir;exports.Command=Xn;exports.CommandDialog=Bh;exports.CommandEmpty=Jr;exports.CommandGroup=Vh;exports.CommandInput=Yr;exports.CommandItem=Xr;exports.CommandList=Kr;exports.CommandSeparator=jh;exports.CommandShortcut=Uh;exports.ContextMenu=Kh;exports.ContextMenuCheckboxItem=ry;exports.ContextMenuContent=ny;exports.ContextMenuGroup=Xh;exports.ContextMenuItem=ay;exports.ContextMenuLabel=sy;exports.ContextMenuPortal=Qh;exports.ContextMenuRadioGroup=ey;exports.ContextMenuRadioItem=iy;exports.ContextMenuSeparator=ly;exports.ContextMenuShortcut=cy;exports.ContextMenuSub=Zh;exports.ContextMenuSubContent=oy;exports.ContextMenuSubTrigger=ty;exports.ContextMenuTrigger=Jh;exports.CopyButton=Un;exports.DataGrid=pf;exports.DataTable=$s;exports.DataTableColumnHeader=Ys;exports.DataTablePagination=Ks;exports.DataTableViewOptions=Js;exports.DatePicker=ha;exports.Dialog=$o;exports.DialogClose=Lh;exports.DialogContent=Yo;exports.DialogDescription=Xo;exports.DialogFooter=Ih;exports.DialogHeader=Ko;exports.DialogOverlay=bd;exports.DialogPortal=gd;exports.DialogTitle=Jo;exports.DialogTrigger=Dh;exports.DraggableRow=Gs;exports.Drawer=eo;exports.DrawerClose=un;exports.DrawerContent=to;exports.DrawerDescription=Ex;exports.DrawerFooter=Bi;exports.DrawerHeader=oo;exports.DrawerOverlay=Pu;exports.DrawerPortal=Cu;exports.DrawerTitle=no;exports.DrawerTrigger=dn;exports.DropdownMenu=Gi;exports.DropdownMenuCheckboxItem=qi;exports.DropdownMenuContent=xa;exports.DropdownMenuGroup=Yx;exports.DropdownMenuItem=Kx;exports.DropdownMenuLabel=Wi;exports.DropdownMenuPortal=$x;exports.DropdownMenuRadioGroup=Jx;exports.DropdownMenuRadioItem=Xx;exports.DropdownMenuSeparator=$i;exports.DropdownMenuShortcut=Qx;exports.DropdownMenuSub=Zx;exports.DropdownMenuSubContent=qu;exports.DropdownMenuSubTrigger=Gu;exports.DropdownMenuTrigger=ya;exports.ErrorBoundary=Zs;exports.FIELD_HEIGHT_MOBILE_CLASS=at;exports.Flex=Qu;exports.Form=Wu;exports.FormBlock=Ae;exports.FormCheckbox=Yu;exports.FormDatePicker=Q0;exports.FormError=ze;exports.FormInput=bf;exports.FormInputMask=hf;exports.FormInputNumeric=xf;exports.FormRadioGroup=Nf;exports.FormSelect=L0;exports.FormSwitch=Ef;exports.FormTextarea=Pf;exports.FormTimePicker=rS;exports.HoverCard=Sw;exports.HoverCardContent=Mw;exports.HoverCardTrigger=kw;exports.HtmlRenderer=Kt;exports.Input=qe;exports.InputMask=ua;exports.InputNumeric=da;exports.InputOTP=Hw;exports.InputOTPGroup=_w;exports.InputOTPSeparator=Aw;exports.InputOTPSlot=Ow;exports.Label=Me;exports.MarkdownRenderer=Hv;exports.Menubar=Yw;exports.MenubarCheckboxItem=tR;exports.MenubarContent=Zw;exports.MenubarGroup=Jw;exports.MenubarItem=eR;exports.MenubarLabel=nR;exports.MenubarMenu=Kw;exports.MenubarPortal=ip;exports.MenubarRadioGroup=Xw;exports.MenubarRadioItem=oR;exports.MenubarSeparator=aR;exports.MenubarShortcut=rR;exports.MenubarSub=iR;exports.MenubarSubContent=lR;exports.MenubarSubTrigger=sR;exports.MenubarTrigger=Qw;exports.MessageInput=Wn;exports.MessageList=Ar;exports.MobileFooter=Ca;exports.MobileHeader=Pa;exports.MobileHeaderProvider=si;exports.MobileLayout=Ep;exports.MobileSelectDrawer=At;exports.Modal=mp;exports.MultiSelect=us;exports.MultiSelectContent=fs;exports.MultiSelectItem=gs;exports.MultiSelectTrigger=ps;exports.MultiSelectValue=ms;exports.NAVBAR_STYLE_VALUES=hS;exports.NavigationMenu=nC;exports.NavigationMenuContent=sC;exports.NavigationMenuIndicator=cC;exports.NavigationMenuItem=rC;exports.NavigationMenuLink=lC;exports.NavigationMenuList=aC;exports.NavigationMenuTrigger=iC;exports.NavigationMenuViewport=Fp;exports.Pagination=bC;exports.PaginationContent=vC;exports.PaginationEllipsis=wC;exports.PaginationItem=hC;exports.PaginationLink=as;exports.PaginationNext=xC;exports.PaginationPrevious=yC;exports.Popover=Qt;exports.PopoverAnchor=cn;exports.PopoverContent=Zt;exports.PopoverTrigger=zi;exports.Progress=NC;exports.PromptSuggestions=zr;exports.RadioGroup=is;exports.RadioGroupItem=ss;exports.ResizableHandle=AC;exports.ResizablePanel=OC;exports.ResizablePanelGroup=_C;exports.RouterProvider=cr;exports.SIDEBAR_COLLAPSIBLE_VALUES=bS;exports.SIDEBAR_VARIANT_VALUES=gS;exports.SafeArea=Rn;exports.ScrollArea=UC;exports.ScrollBar=Bp;exports.Select=Cn;exports.SelectContent=qp;exports.SelectItem=Wp;exports.SelectRoot=Up;exports.SelectScrollDownButton=Yp;exports.SelectScrollUpButton=$p;exports.SelectTrigger=Gp;exports.SelectValue=Kp;exports.Separator=bs;exports.Sheet=vs;exports.SheetClose=yP;exports.SheetContent=hs;exports.SheetDescription=ws;exports.SheetFooter=xP;exports.SheetHeader=ys;exports.SheetTitle=xs;exports.SheetTrigger=hP;exports.Sidebar=ki;exports.SidebarContent=Li;exports.SidebarFooter=Di;exports.SidebarGroup=UP;exports.SidebarGroupAction=qP;exports.SidebarGroupContent=WP;exports.SidebarGroupLabel=GP;exports.SidebarHeader=Ei;exports.SidebarInput=VP;exports.SidebarInset=Mi;exports.SidebarMenu=Ii;exports.SidebarMenuAction=$P;exports.SidebarMenuBadge=YP;exports.SidebarMenuButton=Hi;exports.SidebarMenuItem=Fi;exports.SidebarMenuSkeleton=KP;exports.SidebarMenuSub=JP;exports.SidebarMenuSubButton=QP;exports.SidebarMenuSubItem=XP;exports.SidebarProvider=Si;exports.SidebarRail=BP;exports.SidebarSeparator=jP;exports.SidebarTrigger=zP;exports.Skeleton=Pt;exports.Slider=nT;exports.Switch=ks;exports.THEME_MODE_CHANGE_EVENT=Vo;exports.THEME_MODE_STORAGE_KEY=qt;exports.THEME_MODE_VALUES=ur;exports.THEME_PRESET_OPTIONS=Ll;exports.THEME_PRESET_VALUES=Yf;exports.Table=Ms;exports.TableBody=Ds;exports.TableCaption=bT;exports.TableCell=Bt;exports.TableFooter=gT;exports.TableHead=Ls;exports.TableHeader=Es;exports.TableRow=Nt;exports.Tabs=_s;exports.Textarea=Ea;exports.ThemeProvider=ax;exports.TimePicker=Ha;exports.Toaster=sT;exports.Toggle=ET;exports.ToggleGroup=_T;exports.ToggleGroupItem=OT;exports.Tooltip=Rs;exports.TooltipContent=Ps;exports.TooltipProvider=ra;exports.TooltipTrigger=Cs;exports.TypingIndicator=Or;exports.__virtualKeyboardTesting=dg;exports.badgeVariants=ic;exports.buttonVariants=mt;exports.cn=s;exports.createStore=ig;exports.detectVirtualKeyboardDevice=Vl;exports.dragColumn=Xs;exports.formatCurrency=og;exports.getInitials=ng;exports.getMonitor=Ci;exports.getThemeMode=Xf;exports.initializeMonitoring=rn;exports.isNullOrEmpty=oa;exports.isThemeMode=Gt;exports.maybeScrollElementIntoView=Go;exports.mobileFooterVariantMeta=gp;exports.mobileFooterVariants=SR;exports.mobileHeaderVariantMeta=vp;exports.mobileHeaderVariants=DR;exports.navigationMenuTriggerStyle=Ip;exports.redirect=dr;exports.resolveThemeMode=ho;exports.setThemeMode=pr;exports.showError=iu;exports.showInfo=lu;exports.showSonner=To;exports.showSuccess=ru;exports.showWarning=su;exports.toBool=It;exports.toggleVariants=Da;exports.updateContentLayout=If;exports.updateNavbarStyle=Ff;exports.updateThemeMode=jo;exports.updateThemePreset=Qf;exports.useDataTableInstance=gr;exports.useForm=gy;exports.useIsMobile=Ye;exports.useMobileHeader=li;exports.useMonitor=au;exports.useNavigate=qf;exports.usePathname=Gf;exports.useSidebar=Fo;exports.useStore=sg;exports.useTheme=vt;exports.useThemeExtras=rx;exports.withDndColumn=_N;//# sourceMappingURL=index.cjs.map
|
|
10
10
|
//# sourceMappingURL=index.cjs.map
|