@bison-lab/ui 3.1.0 → 3.3.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["SlotPrimitive","PasswordToggleField","LabelPrimitive","SelectPrimitive","PopoverPrimitive","CalendarIcon","useIsomorphicLayoutEffect","CalendarIcon","SeparatorPrimitive","TooltipPrimitive","UnderlineIcon","LinkIcon","Underline","Link","CheckboxPrimitive","RadioGroupPrimitive","SwitchPrimitives","SliderPrimitive","AvatarPrimitive","DialogPrimitive","AlertDialogPrimitive","SheetPrimitive","DropdownMenuPrimitive","SonnerToaster","TabsPrimitive","AccordionPrimitive","ProgressPrimitive","ScrollAreaPrimitive","ContextMenuPrimitive","NavigationMenuPrimitive","SlotPrimitive","CommandPrimitive","AspectRatioPrimitive","CollapsiblePrimitive","SlotPrimitive","ImageIcon","initials"],"sources":["../src/lib/semantic-action-tones.ts","../src/hooks/use-scroll-reveal.ts","../src/hooks/use-mobile.ts","../src/hooks/use-hide-on-scroll.ts","../src/providers/theme-provider.tsx","../src/providers/density-provider.tsx","../src/providers/bison-provider.tsx","../src/providers/theme-scope.tsx","../src/form/form.tsx","../src/form/field-context.tsx","../src/components/outlined-field.tsx","../src/form/form-field.tsx","../src/form/form-error.tsx","../src/components/button.tsx","../src/lib/surface-classes.ts","../src/components/input.tsx","../src/components/password-input.tsx","../src/components/code-input.tsx","../src/components/currency-input.tsx","../src/lib/us-phone.ts","../src/components/phone-input.tsx","../src/components/label.tsx","../src/components/input-group.tsx","../src/components/textarea.tsx","../src/components/select.tsx","../src/components/calendar.tsx","../src/components/carousel.tsx","../src/components/popover.tsx","../src/components/date-picker.tsx","../src/components/time-picker.tsx","../src/components/date-range-picker.tsx","../src/components/separator.tsx","../src/components/tooltip.tsx","../src/components/text-editor.tsx","../src/components/text-content.tsx","../src/components/checkbox.tsx","../src/components/radio-group.tsx","../src/components/switch.tsx","../src/components/slider.tsx","../src/components/card.tsx","../src/components/alert.tsx","../src/lib/semantic-tint-tones.ts","../src/components/badge.tsx","../src/components/rotating-badge.tsx","../src/components/avatar.tsx","../src/components/dialog.tsx","../src/components/alert-dialog.tsx","../src/components/sheet.tsx","../src/components/dropdown-menu.tsx","../src/components/toast.tsx","../src/components/tabs.tsx","../src/components/stepper.tsx","../src/components/accordion.tsx","../src/components/table.tsx","../src/components/data-table.tsx","../src/components/progress.tsx","../src/components/progress-bar.tsx","../src/components/scroll-area.tsx","../src/components/skeleton.tsx","../src/components/rating.tsx","../src/components/spinner.tsx","../src/components/saved-ping.tsx","../src/components/context-menu.tsx","../src/components/navigation-menu.tsx","../src/components/breadcrumb.tsx","../src/components/pagination.tsx","../src/components/command.tsx","../src/components/editable-title.tsx","../src/components/aspect-ratio.tsx","../src/components/collapsible.tsx","../src/components/sidebar.tsx","../src/blocks/auth/social-providers.tsx","../src/blocks/auth/sign-in-block.tsx","../src/blocks/auth/sign-up-block.tsx","../src/blocks/auth/forgot-password-block.tsx","../src/blocks/auth/reset-password-block.tsx","../src/blocks/auth/verify-block.tsx","../src/blocks/error/not-found-block.tsx","../src/blocks/error/server-error-block.tsx","../src/blocks/error/maintenance-block.tsx","../src/blocks/error/empty-state-block.tsx","../src/blocks/layout/page-shell.tsx","../src/blocks/layout/header-block.tsx","../src/blocks/layout/floating-nav-block.tsx","../src/blocks/layout/sidebar-block.tsx","../src/blocks/layout/footer-block.tsx","../src/blocks/layout/app-sidebar/team-switcher.tsx","../src/blocks/layout/app-sidebar/sidebar-nav.tsx","../src/blocks/layout/app-sidebar/sidebar-user.tsx","../src/blocks/layout/app-sidebar/app-sidebar-block.tsx","../src/blocks/data-display/media-card.tsx","../src/blocks/marketing/json-ld.tsx","../src/blocks/marketing/nap-block.tsx","../src/blocks/marketing/showcase-panels-block.tsx","../src/blocks/marketing/process-steps-block.tsx","../src/blocks/marketing/faq-columns-block.tsx","../src/blocks/marketing/reviews-block.tsx","../src/blocks/marketing/testimonial-types.ts","../src/blocks/marketing/testimonial-masonry-block.tsx","../src/blocks/marketing/testimonial-carousel-block.tsx","../src/blocks/marketing/resources-block.tsx","../src/blocks/marketing/social-feed-block.tsx","../src/blocks/settings/profile-settings-block.tsx","../src/blocks/settings/account-settings-block.tsx","../src/blocks/settings/notification-settings-block.tsx"],"sourcesContent":["/**\n * Reusable “soft” icon tiles: same border + shadow language, hue from semantic scales.\n * Pair with `Button` variants `actionNeutral` | `actionPositive` | `actionNegative` and `size=\"icon\"`.\n *\n * Requires `--success-*` and `--destructive-*` scales from BisonProvider / tailwind preset.\n */\nexport const actionNeutralToneClasses =\n 'border border-border bg-muted/80 text-muted-foreground shadow-sm hover:border-border-strong hover:bg-muted hover:text-foreground dark:border-border dark:bg-muted/50 dark:hover:bg-muted/80 dark:hover:text-foreground';\n\nexport const actionPositiveToneClasses =\n 'border border-success-200/90 bg-success-100 text-success-600 shadow-sm hover:border-success-300 hover:bg-success-200 hover:text-success-700 focus-visible:ring-success-500/40 dark:border-success-800/55 dark:bg-success-950/40 dark:text-success-400 dark:hover:border-success-700 dark:hover:bg-success-950/60 dark:hover:text-success-300';\n\nexport const actionNegativeToneClasses =\n 'border border-destructive-200/90 bg-destructive-100 text-destructive-600 shadow-sm hover:border-destructive-300 hover:bg-destructive-200 hover:text-destructive-700 focus-visible:ring-destructive-500/40 dark:border-destructive-800/55 dark:bg-destructive-950/45 dark:text-destructive-400 dark:hover:border-destructive-700 dark:hover:bg-destructive-950/65 dark:hover:text-destructive-300';\n\n/** @deprecated Use `actionNeutralToneClasses` + `variant=\"actionNeutral\"` on Button. */\nexport const actionNeutralIconChromeClasses = actionNeutralToneClasses;\n","\"use client\";\n\nimport * as React from \"react\";\n\nexport interface UseScrollRevealOptions {\n /** Trigger only once (default: true) */\n once?: boolean;\n /** Root margin for IntersectionObserver (default: \"-50px\") */\n margin?: string;\n /** Visibility threshold 0–1 (default: 0) */\n threshold?: number;\n}\n\n/**\n * Returns a ref and a boolean indicating whether the element is in view.\n * Uses IntersectionObserver internally — no Framer Motion dependency required.\n *\n * @example\n * ```tsx\n * const { ref, isInView } = useScrollReveal();\n * <div ref={ref} style={{ opacity: isInView ? 1 : 0 }}>Content</div>\n * ```\n */\nexport function useScrollReveal<T extends HTMLElement = HTMLDivElement>(\n options: UseScrollRevealOptions = {}\n): { ref: React.RefObject<T | null>; isInView: boolean } {\n const { once = true, margin = \"-50px\", threshold = 0 } = options;\n const ref = React.useRef<T | null>(null);\n const [isInView, setIsInView] = React.useState(false);\n\n React.useEffect(() => {\n const el = ref.current;\n if (!el) return;\n\n const observer = new IntersectionObserver(\n ([entry]) => {\n if (entry.isIntersecting) {\n setIsInView(true);\n if (once) observer.unobserve(el);\n } else if (!once) {\n setIsInView(false);\n }\n },\n { rootMargin: margin, threshold }\n );\n\n observer.observe(el);\n return () => observer.disconnect();\n }, [once, margin, threshold]);\n\n return { ref, isInView };\n}\n","\"use client\";\n\nimport * as React from \"react\";\n\nconst MOBILE_BREAKPOINT = 768;\n\nexport function useIsMobile() {\n const [isMobile, setIsMobile] = React.useState<boolean | undefined>(\n undefined\n );\n\n React.useEffect(() => {\n const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);\n const onChange = () => setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n mql.addEventListener(\"change\", onChange);\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n return () => mql.removeEventListener(\"change\", onChange);\n }, []);\n\n return !!isMobile;\n}\n","\"use client\";\n\nimport * as React from \"react\";\n\nexport interface UseHideOnScrollOptions {\n /** Pixels scrolled from the top before the element may hide (default: 80) */\n threshold?: number;\n /**\n * Minimum movement between samples before a direction change is believed,\n * in pixels (default: 6). Without it, the sub-pixel jitter of a trackpad or\n * a momentum scroll flickers the element in and out.\n */\n tolerance?: number;\n /**\n * Hold the element visible (default: `false`). Use it while a menu is\n * open — hiding the bar out from under an open panel strands the panel\n * mid-air. `scrolled` keeps updating either way; only hiding is\n * suppressed.\n */\n disabled?: boolean;\n}\n\n/**\n * Tracks scroll direction and reports whether a fixed element should hide.\n * `hidden` turns on while scrolling down past `threshold` and off again on\n * the first meaningful scroll up. Reads are rAF-throttled, so a fast scroll\n * costs one state update per frame at most.\n *\n * @example\n * ```tsx\n * const { hidden } = useHideOnScroll();\n * <header className={hidden ? \"-translate-y-full\" : \"translate-y-0\"} />\n * ```\n */\nexport function useHideOnScroll(options: UseHideOnScrollOptions = {}): {\n hidden: boolean;\n scrolled: boolean;\n} {\n const { threshold = 80, tolerance = 6, disabled = false } = options;\n const [hidden, setHidden] = React.useState(false);\n const [scrolled, setScrolled] = React.useState(false);\n const lastY = React.useRef(0);\n const frame = React.useRef<number | null>(null);\n\n React.useEffect(() => {\n const read = () => {\n frame.current = null;\n const y = Math.max(window.scrollY, 0);\n const delta = y - lastY.current;\n\n // Tracked even while disabled: `scrolled` describes where the page is,\n // not whether the element may hide, and a pinned element still wants\n // to style against it.\n setScrolled(y > threshold);\n\n if (disabled) {\n // Hold it open, but keep the baseline current so the first read\n // after re-enabling compares against where the page actually is\n // rather than against wherever it was when the menu opened.\n setHidden(false);\n lastY.current = y;\n return;\n }\n\n if (y <= threshold) {\n // Above the threshold the bar is always shown, whichever way the\n // page is moving — otherwise it stays hidden at the top of the page.\n setHidden(false);\n lastY.current = y;\n } else if (Math.abs(delta) >= tolerance) {\n setHidden(delta > 0);\n lastY.current = y;\n }\n // Below `tolerance`, `lastY` deliberately stays put so that slow\n // scrolling accumulates instead of being discarded frame by frame.\n };\n\n const onScroll = () => {\n if (frame.current === null) {\n frame.current = requestAnimationFrame(read);\n }\n };\n\n lastY.current = Math.max(window.scrollY, 0);\n read();\n\n window.addEventListener(\"scroll\", onScroll, { passive: true });\n return () => {\n window.removeEventListener(\"scroll\", onScroll);\n if (frame.current !== null) cancelAnimationFrame(frame.current);\n frame.current = null;\n };\n }, [threshold, tolerance, disabled]);\n\n return { hidden, scrolled };\n}\n","'use client';\n\nimport * as React from 'react';\n\ntype Theme = 'light' | 'dark' | 'system';\ntype ResolvedTheme = 'light' | 'dark';\n\ninterface ThemeProviderProps {\n children: React.ReactNode;\n defaultTheme?: Theme;\n storageKey?: string;\n attribute?: string;\n}\n\ninterface ThemeProviderState {\n /** The user's selected theme — can be `\"system\"`. Use `resolvedTheme` for the value actually applied to the DOM. */\n theme: Theme;\n /** The theme actually applied to the DOM (`\"light\"` or `\"dark\"`). `undefined` until the client mounts (avoids SSR/hydration mismatches). */\n resolvedTheme: ResolvedTheme | undefined;\n /** The user's OS-level color scheme preference. `undefined` until the client mounts. */\n systemTheme: ResolvedTheme | undefined;\n setTheme: (theme: Theme) => void;\n}\n\nconst ThemeProviderContext = React.createContext<\n ThemeProviderState | undefined\n>(undefined);\n\nexport function ThemeProvider({\n children,\n defaultTheme = 'system',\n storageKey = 'bison-theme',\n attribute = 'data-theme',\n ...props\n}: ThemeProviderProps) {\n const [theme, setTheme] = React.useState<Theme>(defaultTheme);\n const [systemTheme, setSystemTheme] = React.useState<\n ResolvedTheme | undefined\n >(undefined);\n\n React.useEffect(() => {\n const stored = localStorage.getItem(storageKey) as Theme | null;\n if (stored) setTheme(stored);\n }, [storageKey]);\n\n React.useEffect(() => {\n const media = window.matchMedia('(prefers-color-scheme: dark)');\n setSystemTheme(media.matches ? 'dark' : 'light');\n\n const handleChange = (event: MediaQueryListEvent) => {\n setSystemTheme(event.matches ? 'dark' : 'light');\n };\n media.addEventListener('change', handleChange);\n return () => media.removeEventListener('change', handleChange);\n }, []);\n\n const resolvedTheme: ResolvedTheme | undefined =\n theme === 'light' || theme === 'dark' ? theme : systemTheme;\n\n React.useEffect(() => {\n if (!resolvedTheme) return;\n const root = window.document.documentElement;\n\n if (attribute === 'class') {\n root.classList.remove('light', 'dark');\n root.classList.add(resolvedTheme);\n } else {\n root.setAttribute(attribute, resolvedTheme);\n }\n }, [resolvedTheme, attribute]);\n\n const value = React.useMemo(\n () => ({\n theme,\n resolvedTheme,\n systemTheme,\n setTheme: (newTheme: Theme) => {\n localStorage.setItem(storageKey, newTheme);\n setTheme(newTheme);\n },\n }),\n [theme, resolvedTheme, systemTheme, storageKey],\n );\n\n return (\n <ThemeProviderContext.Provider {...props} value={value}>\n {children}\n </ThemeProviderContext.Provider>\n );\n}\n\nexport function useTheme() {\n const context = React.useContext(ThemeProviderContext);\n if (!context) throw new Error('useTheme must be used within a ThemeProvider');\n return context;\n}\n","\"use client\";\n\nimport * as React from \"react\";\n\ntype Density = \"compact\" | \"default\" | \"spacious\";\n\ninterface DensityProviderProps {\n children: React.ReactNode;\n density?: Density;\n}\n\nconst DensityContext = React.createContext<Density>(\"default\");\n\nconst densityClasses: Record<Density, string> = {\n compact: \"bison-density-compact\",\n default: \"bison-density-default\",\n spacious: \"bison-density-spacious\",\n};\n\nexport function DensityProvider({ children, density = \"default\" }: DensityProviderProps) {\n return (\n <DensityContext.Provider value={density}>\n <div className={densityClasses[density]}>{children}</div>\n </DensityContext.Provider>\n );\n}\n\nexport function useDensity() {\n return React.useContext(DensityContext);\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport {\n deriveLightPalette,\n deriveDarkPalette,\n generateBrandScales,\n generateScaleCSS,\n generateDestructiveScaleCSS,\n radiusPresets,\n shadowPresets,\n motionPresets,\n densityPresets,\n defaultFontWeights,\n zIndexTokens,\n} from \"@bison-lab/tokens\";\nimport type {\n BrandColors,\n RadiusPreset,\n ShadowPreset,\n MotionPreset,\n DensityPreset,\n FontWeightMap,\n} from \"@bison-lab/tokens\";\nimport { ThemeProvider } from \"./theme-provider\";\nimport { DensityProvider } from \"./density-provider\";\n\ntype Theme = \"light\" | \"dark\" | \"system\";\n\ninterface GoogleFontConfig {\n /** Google Font family name, e.g. \"Inter\", \"Roboto\", \"Playfair Display\" */\n family: string;\n /** Font weights to load. Defaults to [400, 500, 600, 700] */\n weights?: number[];\n /** Whether to load italic variants. Defaults to false */\n italic?: boolean;\n}\n\nexport interface BisonProviderProps {\n children: React.ReactNode;\n\n /** Brand colors used to derive the full semantic palette */\n brandColors: BrandColors;\n\n /** Border radius preset. Defaults to \"rounded\" */\n radius?: RadiusPreset;\n /** Shadow preset. Defaults to \"subtle\" */\n shadow?: ShadowPreset;\n /** Motion preset. Defaults to \"smooth\" */\n motion?: MotionPreset;\n /** Density preset. Defaults to \"default\" */\n density?: DensityPreset;\n\n /**\n * HTML attribute used to toggle dark mode on the root element.\n * Use \"class\" for the common `.dark` class convention (Tailwind default),\n * or \"data-theme\" for `[data-theme=\"dark\"]` attribute convention.\n * Defaults to \"class\".\n */\n attribute?: \"class\" | \"data-theme\";\n\n /** Default theme mode. Defaults to \"system\" */\n defaultTheme?: Theme;\n /** localStorage key for theme persistence. Defaults to \"bison-theme\" */\n storageKey?: string;\n\n /** Google Font for body/UI text. Defaults to Inter */\n bodyFont?: GoogleFontConfig;\n /** Google Font for headings. Falls back to bodyFont if not provided */\n headingFont?: GoogleFontConfig;\n /** Google Font for monospace/code. Defaults to JetBrains Mono */\n monoFont?: GoogleFontConfig;\n\n /** Custom font weight map. Defaults to 400/500/600/700 */\n fontWeights?: FontWeightMap;\n}\n\nfunction buildGoogleFontsUrl(fonts: GoogleFontConfig[]): string {\n const families = fonts.map((font) => {\n const weights = font.weights ?? [400, 500, 600, 700];\n const sortedWeights = [...weights].sort((a, b) => a - b);\n\n if (font.italic) {\n const ital = sortedWeights\n .flatMap((w) => [`0,${w}`, `1,${w}`])\n .join(\";\");\n return `family=${font.family.replace(/ /g, \"+\")}:ital,wght@${ital}`;\n }\n\n return `family=${font.family.replace(/ /g, \"+\")}:wght@${sortedWeights.join(\";\")}`;\n });\n\n return `https://fonts.googleapis.com/css2?${families.join(\"&\")}&display=swap`;\n}\n\nfunction fontFamilyValue(font: GoogleFontConfig, fallback: string): string {\n return `\"${font.family}\", ${fallback}`;\n}\n\nexport function BisonProvider({\n children,\n brandColors,\n radius = \"rounded\",\n shadow = \"subtle\",\n motion = \"smooth\",\n density = \"default\",\n attribute = \"class\",\n defaultTheme = \"system\",\n storageKey = \"bison-theme\",\n bodyFont = { family: \"Inter\", weights: [400, 500, 600, 700] },\n headingFont,\n monoFont = { family: \"JetBrains Mono\", weights: [400, 500, 600, 700] },\n fontWeights = defaultFontWeights,\n}: BisonProviderProps) {\n const resolvedHeadingFont = headingFont ?? bodyFont;\n\n // Derive color palettes + brand scales\n const lightPalette = React.useMemo(() => deriveLightPalette(brandColors), [brandColors]);\n const darkPalette = React.useMemo(() => deriveDarkPalette(brandColors), [brandColors]);\n const scaleCSS = React.useMemo(() => {\n const scales = generateBrandScales(brandColors);\n return `${generateScaleCSS(scales)}\\n${generateDestructiveScaleCSS()}`;\n }, [brandColors]);\n\n // Build Google Fonts URL\n const fontsUrl = React.useMemo(() => {\n const fonts: GoogleFontConfig[] = [bodyFont];\n if (headingFont && headingFont.family !== bodyFont.family) {\n fonts.push(headingFont);\n }\n if (monoFont.family !== bodyFont.family) {\n fonts.push(monoFont);\n }\n return buildGoogleFontsUrl(fonts);\n }, [bodyFont, headingFont, monoFont]);\n\n // Build CSS custom properties style string\n const styleContent = React.useMemo(() => {\n const radiusVars = radiusPresets[radius];\n const shadowVars = shadowPresets[shadow];\n const motionVars = motionPresets[motion];\n const densityVars = densityPresets[density];\n\n const fontVars = {\n \"--font-body\": fontFamilyValue(bodyFont, \"ui-sans-serif, system-ui, sans-serif\"),\n \"--font-heading\": fontFamilyValue(resolvedHeadingFont, \"ui-sans-serif, system-ui, sans-serif\"),\n \"--font-mono\": fontFamilyValue(monoFont, \"ui-monospace, monospace\"),\n \"--font-weight-normal\": String(fontWeights.normal),\n \"--font-weight-medium\": String(fontWeights.medium),\n \"--font-weight-semibold\": String(fontWeights.semibold),\n \"--font-weight-bold\": String(fontWeights.bold),\n ...(fontWeights.extrabold != null && {\n \"--font-weight-extrabold\": String(fontWeights.extrabold),\n }),\n };\n\n const lightColorVars = Object.entries(lightPalette)\n .map(([key, value]) => ` --${key}: ${value};`)\n .join(\"\\n\");\n\n const darkColorVars = Object.entries(darkPalette)\n .map(([key, value]) => ` --${key}: ${value};`)\n .join(\"\\n\");\n\n const zIndexVars = Object.entries(zIndexTokens)\n .map(([key, value]) => ` ${key}: ${value};`)\n .join(\"\\n\");\n\n const presetVars = [\n ...Object.entries(radiusVars),\n ...Object.entries(shadowVars),\n ...Object.entries(motionVars),\n ...Object.entries(densityVars),\n ...Object.entries(fontVars),\n ]\n .map(([key, value]) => ` ${key}: ${value};`)\n .join(\"\\n\");\n\n const darkSelector = attribute === \"class\" ? \".dark\" : '[data-theme=\"dark\"]';\n\n return `:root {\\n${lightColorVars}\\n\\n${scaleCSS}\\n${presetVars}\\n${zIndexVars}\\n font-family: var(--font-body);\\n}\\n\\n${darkSelector} {\\n${darkColorVars}\\n}`;\n }, [\n radius,\n shadow,\n motion,\n density,\n attribute,\n bodyFont,\n resolvedHeadingFont,\n monoFont,\n fontWeights,\n lightPalette,\n darkPalette,\n scaleCSS,\n ]);\n\n return (\n <>\n <link rel=\"preconnect\" href=\"https://fonts.googleapis.com\" />\n <link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossOrigin=\"anonymous\" />\n <link rel=\"stylesheet\" href={fontsUrl} />\n <style dangerouslySetInnerHTML={{ __html: styleContent }} />\n <ThemeProvider defaultTheme={defaultTheme} storageKey={storageKey} attribute={attribute}>\n <DensityProvider density={density}>\n {children}\n </DensityProvider>\n </ThemeProvider>\n </>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../lib/utils\";\n\nexport interface ThemeScopeProps extends React.HTMLAttributes<HTMLDivElement> {\n /** CSS custom property overrides applied to the scoped subtree */\n overrides: Record<string, string>;\n}\n\nconst ThemeScope = React.forwardRef<HTMLDivElement, ThemeScopeProps>(\n ({ overrides, className, style, children, ...props }, ref) => {\n const scopeStyle = React.useMemo(\n () => ({ ...overrides, ...style }),\n [overrides, style]\n );\n\n return (\n <div\n ref={ref}\n className={cn(\"contents\", className)}\n style={scopeStyle}\n {...props}\n >\n {children}\n </div>\n );\n }\n);\nThemeScope.displayName = \"ThemeScope\";\n\nexport { ThemeScope };\n","'use client';\n\nimport * as React from 'react';\nimport type { ZodSchema, ZodError } from 'zod';\n\nexport type FormMode = 'native' | 'rhf';\n\n/**\n * The payload handed to `onSubmit`.\n *\n * A name that appears once yields a scalar; a name that repeats — a checkbox\n * group, a multi-select — yields an array. It used to always be a scalar,\n * because the payload was built with `Object.fromEntries(formData.entries())`,\n * which keeps only the LAST entry under a repeated key. Three checked boxes\n * submitted as one, silently, with nothing in the DOM to suggest the other two\n * had been dropped.\n */\nexport type FormData_ = Record<string, FormDataEntryValue | FormDataEntryValue[]>;\n\ninterface FormContextValue {\n errors: Record<string, string>;\n touched: Record<string, boolean>;\n setFieldError: (name: string, error: string) => void;\n clearFieldError: (name: string) => void;\n setFieldTouched: (name: string) => void;\n isSubmitting: boolean;\n formMode: FormMode;\n /**\n * Bumped on every submit that yields validation errors. Fields read this to\n * replay the error shake on each failed submit — error strings alone don't\n * change between identical resubmits, so the animation wouldn't otherwise\n * re-trigger.\n */\n errorVersion: number;\n}\n\nconst FormContext = React.createContext<FormContextValue | undefined>(undefined);\n\nexport function useFormContext() {\n return React.useContext(FormContext);\n}\n\n/**\n * Anything that can take focus. Hidden and disabled controls are excluded —\n * focusing either is a no-op that would strand the user mid-form.\n */\nconst FOCUSABLE_SELECTOR = [\n 'input:not([type=\"hidden\"]):not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'button:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n].join(', ');\n\n/**\n * Move focus to the first control the schema rejected (WCAG technique G139).\n *\n * Dives inside the invalid element when the element itself cannot hold focus:\n * a checkbox group marks the `<fieldset>` invalid, and a fieldset is not\n * focusable, so the first checkbox inside it is the right landing point.\n */\nfunction focusFirstInvalid(form: HTMLFormElement): void {\n const invalids = form.querySelectorAll<HTMLElement>('[aria-invalid=\"true\"]');\n for (const el of Array.from(invalids)) {\n const target = el.matches(FOCUSABLE_SELECTOR)\n ? el\n : el.querySelector<HTMLElement>(FOCUSABLE_SELECTOR);\n if (target) {\n target.focus();\n return;\n }\n }\n}\n\nexport interface FormProps\n extends Omit<React.FormHTMLAttributes<HTMLFormElement>, 'onSubmit'> {\n onSubmit?: (data: FormData_) => void | Promise<void>;\n schema?: ZodSchema;\n formMode?: FormMode;\n /**\n * Field errors supplied from outside — typically what a Server Action just\n * returned, keyed by field name.\n *\n * Needed because errors produced on the server have to appear during RENDER,\n * not from an effect: with JavaScript disabled the action runs, the page\n * re-renders on the server, and an effect that would have pushed the errors\n * into context never executes. Passing them here is what lets `FormField`\n * wire them to `aria-describedby` on that path too, instead of degrading to\n * an unassociated summary.\n *\n * Merged with the schema's own results, which win — the most recent\n * validation is the client one.\n */\n errors?: Record<string, string>;\n /**\n * Move focus to the first invalid control after a failed submit.\n * @default true\n */\n focusOnError?: boolean;\n /**\n * Wording for the screen-reader announcement made after a failed submit.\n * Override for i18n or for a more specific summary.\n */\n errorSummary?: (count: number) => string;\n children: React.ReactNode;\n}\n\nfunction defaultErrorSummary(count: number) {\n return count === 1\n ? '1 field needs attention.'\n : `${count} fields need attention.`;\n}\n\nexport const Form = React.forwardRef<HTMLFormElement, FormProps>(\n (\n {\n onSubmit,\n schema,\n formMode = 'native',\n errors: externalErrors,\n focusOnError = true,\n errorSummary = defaultErrorSummary,\n children,\n className,\n noValidate,\n ...props\n },\n ref,\n ) => {\n const [errors, setErrors] = React.useState<Record<string, string>>({});\n const [touched, setTouched] = React.useState<Record<string, boolean>>({});\n const [isSubmitting, setIsSubmitting] = React.useState(false);\n const [errorVersion, setErrorVersion] = React.useState(0);\n const [announcement, setAnnouncement] = React.useState('');\n\n const innerRef = React.useRef<HTMLFormElement>(null);\n React.useImperativeHandle(ref, () => innerRef.current as HTMLFormElement);\n\n const setFieldError = React.useCallback((name: string, error: string) => {\n setErrors((prev) => ({ ...prev, [name]: error }));\n }, []);\n\n const clearFieldError = React.useCallback((name: string) => {\n setErrors((prev) => {\n const next = { ...prev };\n delete next[name];\n return next;\n });\n }, []);\n\n const setFieldTouched = React.useCallback((name: string) => {\n setTouched((prev) => ({ ...prev, [name]: true }));\n }, []);\n\n const handleSubmit = React.useCallback(\n async (e: React.SyntheticEvent<HTMLFormElement>) => {\n e.preventDefault();\n setIsSubmitting(true);\n setErrors({});\n\n const formData = new FormData(e.currentTarget);\n\n // Repeated names collapse into an array rather than overwriting each\n // other. See {@link FormData_}.\n const data: FormData_ = {};\n for (const key of Array.from(new Set(formData.keys()))) {\n const values = formData.getAll(key);\n data[key] = values.length > 1 ? values : values[0];\n }\n\n if (schema) {\n try {\n schema.parse(data);\n } catch (err) {\n const zodError = err as ZodError;\n const fieldErrors: Record<string, string> = {};\n for (const issue of zodError.issues) {\n const path = issue.path.join('.');\n if (!fieldErrors[path]) {\n fieldErrors[path] = issue.message;\n }\n }\n setErrors(fieldErrors);\n setErrorVersion((v) => v + 1);\n setAnnouncement(errorSummary(Object.keys(fieldErrors).length));\n setIsSubmitting(false);\n return;\n }\n }\n\n setAnnouncement('');\n\n try {\n await onSubmit?.(data);\n } finally {\n setIsSubmitting(false);\n }\n },\n [onSubmit, schema, errorSummary],\n );\n\n // Runs after the errors have been committed to the DOM, which is what makes\n // the `[aria-invalid=\"true\"]` query find anything.\n React.useEffect(() => {\n if (!focusOnError || errorVersion === 0) return;\n const form = innerRef.current;\n if (form) focusFirstInvalid(form);\n }, [errorVersion, focusOnError]);\n\n const mergedErrors = React.useMemo(\n () => ({ ...externalErrors, ...errors }),\n [externalErrors, errors],\n );\n\n const contextValue = React.useMemo(\n () => ({\n errors: mergedErrors,\n touched,\n setFieldError,\n clearFieldError,\n setFieldTouched,\n isSubmitting,\n formMode,\n errorVersion,\n }),\n [\n mergedErrors,\n touched,\n setFieldError,\n clearFieldError,\n setFieldTouched,\n isSubmitting,\n formMode,\n errorVersion,\n ],\n );\n\n return (\n <FormContext.Provider value={contextValue}>\n <form\n ref={innerRef}\n onSubmit={handleSubmit}\n className={className}\n // With a schema in play the browser's own bubbles would fire first and\n // pre-empt it, giving two validation systems with different wording and\n // only one of them wired to the field's `aria-describedby`.\n noValidate={noValidate ?? Boolean(schema)}\n {...props}\n >\n {children}\n {/*\n The live region is mounted unconditionally and stays mounted —\n a region inserted at the same moment as its content is routinely\n missed. Only the inner node is replaced, keyed on errorVersion so\n an identical resubmit still reads out.\n\n Polite rather than assertive: focus is already moving to the first\n invalid control, and an assertive region would talk over the field\n announcement that focus triggers.\n */}\n <div\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className=\"sr-only\"\n data-slot=\"form-status\"\n >\n {announcement ? <span key={errorVersion}>{announcement}</span> : null}\n </div>\n </form>\n </FormContext.Provider>\n );\n },\n);\nForm.displayName = 'Form';\n","'use client';\n\nimport * as React from 'react';\n\n/**\n * The channel between a field wrapper and the control nested inside it.\n *\n * `FormField`, `InputGroup` and `OutlinedField` all render a label, an optional\n * hint and an optional error around an arbitrary child. Before this context\n * they had no way to reach that child, so the error text was rendered as a bare\n * `<p>` that nothing pointed at: no `aria-describedby`, no `aria-invalid`, no\n * `aria-required`. The label leaned on `htmlFor={name}` and simply hoped the\n * consumer had set a matching `id` — when they hadn't, the label resolved to\n * nothing at all (WCAG 1.3.1 and 4.1.2, and axe's `label` rule fires).\n *\n * A wrapper now publishes this context and every control calls\n * {@link useFieldControl} to wire itself. The important property is that the\n * context is OPTIONAL: outside a wrapper the hook returns the control's own\n * props untouched, so a bare `<Input />` behaves exactly as it always has.\n */\nexport interface FieldContextValue {\n /**\n * `id` the control should adopt. Derived from the wrapper's `name` /\n * `htmlFor` rather than `useId()` so it stays the value the wrapper's own\n * `htmlFor` already points at, and so consumers who set `id={name}` by hand\n * land on the same string instead of fighting it.\n */\n controlId: string;\n /** `id` of the hint paragraph, when one is rendered. */\n descriptionId?: string;\n /** `id` of the error paragraph, when one is rendered. */\n errorId?: string;\n /**\n * `id` of the label element. Composite controls need it: a `<label for>`\n * cannot name a `<div>`, so `TimePicker` and `CodeInput` point at it with\n * `aria-labelledby` instead. See {@link useFieldGroup}.\n */\n labelId?: string;\n /** Whether the field is currently in an error state. */\n invalid: boolean;\n /** Whether the field is required. */\n required: boolean;\n /**\n * True when the wrapper labels a SET of controls (a checkbox or radio group)\n * rather than a single one. Controls must not adopt the field's ids in this\n * mode — five checkboxes sharing one `id` is worse than none — so\n * {@link useFieldControl} becomes a no-op and the group element itself\n * carries the labelling.\n */\n group: boolean;\n}\n\nconst FieldContext = React.createContext<FieldContextValue | undefined>(\n undefined,\n);\n\nexport const FieldProvider = FieldContext.Provider;\n\n/** Read the surrounding field, if there is one. */\nexport function useField(): FieldContextValue | undefined {\n return React.useContext(FieldContext);\n}\n\n/** The ARIA surface a control exposes to its field wrapper. */\nexport interface FieldControlProps {\n id?: string;\n 'aria-describedby'?: string;\n 'aria-invalid'?: React.AriaAttributes['aria-invalid'];\n 'aria-required'?: React.AriaAttributes['aria-required'];\n}\n\n/**\n * Merge the surrounding field's ARIA wiring into a control's own props.\n *\n * Call it in every control that accepts user input and spread the result onto\n * the DOM node.\n *\n * Inside a field the wrapper OWNS the control's `id`, and a consumer-supplied\n * one is deliberately overridden. The wrapper has already rendered its\n * `<label for>` pointing at the id it published, and it cannot see the child's\n * props to follow it anywhere else — so honouring an override here would leave\n * the label resolving to nothing, which is precisely the defect this context\n * exists to remove. Set the id through the wrapper's `name` / `htmlFor`\n * instead. `aria-invalid` and `aria-required` do defer to an explicit prop,\n * and the field's description ids are APPENDED to any `aria-describedby` the\n * consumer set rather than replacing it.\n *\n * Returns `props` unchanged when there is no field, or when the field is a\n * group.\n */\nexport function useFieldControl<T extends FieldControlProps>(props: T): T {\n const field = useField();\n\n if (!field || field.group) return props;\n\n const describedBy = [\n field.descriptionId,\n field.errorId,\n props['aria-describedby'],\n ]\n .filter(Boolean)\n .join(' ');\n\n return {\n ...props,\n id: field.controlId,\n // Omitted rather than set to \"false\" when the field is valid: an explicit\n // `aria-invalid=\"false\"` is noise on every untouched control on the page.\n 'aria-invalid': props['aria-invalid'] ?? (field.invalid || undefined),\n 'aria-required': props['aria-required'] ?? (field.required || undefined),\n 'aria-describedby': describedBy || undefined,\n };\n}\n\n/** The ARIA surface a COMPOSITE control exposes to its field wrapper. */\nexport interface FieldGroupProps {\n role?: 'group';\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n 'aria-invalid'?: React.AriaAttributes['aria-invalid'];\n 'aria-required'?: React.AriaAttributes['aria-required'];\n}\n\n/**\n * The composite-control counterpart to {@link useFieldControl}.\n *\n * `TimePicker` is three selects and `CodeInput` is six inputs; neither has a\n * single element for the field's label to point at, and a `<label for>` naming\n * a `<div>` names nothing at all. These wrap their children in a labelled\n * `role=\"group\"` instead, so the whole composite is announced once with its\n * error and hint attached.\n *\n * Returns `{}` outside a field wrapper, leaving standalone usage untouched.\n */\nexport function useFieldGroup(): FieldGroupProps {\n const field = useField();\n if (!field) return {};\n\n const describedBy = [field.descriptionId, field.errorId]\n .filter(Boolean)\n .join(' ');\n\n return {\n role: 'group',\n 'aria-labelledby': field.labelId,\n 'aria-describedby': describedBy || undefined,\n 'aria-invalid': field.invalid || undefined,\n 'aria-required': field.required || undefined,\n };\n}\n\n/**\n * Seals a composite control against the field it sits in.\n *\n * `CodeInput` renders six `<Input>`s and `TimePicker` renders three\n * `<SelectTrigger>`s. Each of those calls {@link useFieldControl}, so without\n * this they would every one of them adopt the SAME field id — six elements\n * sharing `id=\"code\"`, which is worse than the missing wiring this whole\n * mechanism set out to fix. Re-providing the field in group mode turns the\n * hook into a no-op for everything below, leaving the composite's own wrapper\n * ({@link useFieldGroup}) as the single labelled thing.\n */\nexport function FieldGroupScope({ children }: { children: React.ReactNode }) {\n const field = useField();\n const scoped = React.useMemo(\n () => (field ? { ...field, group: true } : undefined),\n [field],\n );\n return <FieldProvider value={scoped}>{children}</FieldProvider>;\n}\n\n/**\n * Build the ids a wrapper publishes.\n *\n * `useId()` supplies the hint/error ids because nothing outside the wrapper\n * references them, so uniqueness costs nothing. The control id stays\n * caller-derived — see {@link FieldContextValue.controlId}.\n */\nexport function useFieldIds({\n controlId,\n hasDescription,\n hasError,\n}: {\n controlId: string;\n hasDescription: boolean;\n hasError: boolean;\n}) {\n const reactId = React.useId();\n return {\n controlId,\n descriptionId: hasDescription ? `${reactId}-description` : undefined,\n errorId: hasError ? `${reactId}-error` : undefined,\n labelId: `${reactId}-label`,\n };\n}\n","'use client';\n\nimport { motion } from 'motion/react';\nimport * as React from 'react';\nimport { cn } from '../lib/utils';\nimport { FieldProvider, useFieldIds } from '../form/field-context';\n\n/**\n * Strips border / ring from nested form controls so the outer outlined shell\n * owns the chrome. Targets inputs, textareas, and select triggers (buttons).\n */\nexport const outlinedFieldNestResetClasses = cn(\n '[&_input]:!h-full [&_input]:min-h-0 [&_input]:border-0 [&_input]:bg-transparent [&_input]:shadow-none',\n '[&_input]:focus-visible:ring-0 [&_input]:focus-visible:ring-offset-0',\n '[&_textarea]:box-border [&_textarea]:min-h-[72px] [&_textarea]:h-auto [&_textarea]:!h-auto [&_textarea]:flex-1 [&_textarea]:resize-y',\n '[&_textarea]:border-0 [&_textarea]:bg-transparent [&_textarea]:shadow-none',\n '[&_textarea]:focus-visible:ring-0 [&_textarea]:focus-visible:ring-offset-0',\n '[&_button]:h-full [&_button]:min-h-0 [&_button]:border-0 [&_button]:bg-transparent [&_button]:shadow-none',\n '[&_button]:focus-visible:ring-0 [&_button]:focus-visible:ring-offset-0',\n);\n\nexport interface OutlinedFieldProps {\n /** Field label; shown on the top border (Material-style notch). */\n label: React.ReactNode;\n /** Associates the label with the control (`htmlFor` on the notch label). */\n htmlFor?: string;\n /** Validation error shown below the field. */\n error?: string;\n /**\n * Bumped by the parent `Form` on each failed submit so the error shake\n * replays even when the error text is unchanged. Optional for standalone use.\n */\n errorVersion?: number;\n /** Helper text below the field (hidden when `error` is set). */\n hint?: string;\n /** Renders a required indicator next to the label. */\n required?: boolean;\n className?: string;\n /** The control (Input, PhoneInput, Textarea, SelectTrigger, PasswordInput, etc.). */\n children: React.ReactNode;\n}\n\ntype ControlKind = 'input' | 'textarea' | 'other';\n\nfunction readValueFromShell(shell: HTMLElement): boolean {\n const input = shell.querySelector('input');\n const textarea = shell.querySelector('textarea');\n const el = textarea ?? input;\n if (el) return Boolean((el as HTMLInputElement).value);\n return true;\n}\n\nfunction detectControlKind(shell: HTMLElement): ControlKind {\n if (shell.querySelector('textarea')) return 'textarea';\n if (shell.querySelector('input')) return 'input';\n return 'other';\n}\n\nconst OutlinedField = React.forwardRef<HTMLDivElement, OutlinedFieldProps>(\n ({ label, htmlFor, error, errorVersion = 0, hint, required, className, children }, ref) => {\n const fallbackId = React.useId();\n const controlId = htmlFor ?? `${fallbackId}-control`;\n\n const { descriptionId, errorId, labelId } = useFieldIds({\n controlId,\n hasDescription: Boolean(hint) && !error,\n hasError: Boolean(error),\n });\n\n const field = React.useMemo(\n () => ({\n controlId,\n descriptionId,\n errorId,\n labelId,\n invalid: Boolean(error),\n required: Boolean(required),\n group: false,\n }),\n [controlId, descriptionId, errorId, labelId, error, required],\n );\n\n const shellRef = React.useRef<HTMLDivElement>(null);\n const [focused, setFocused] = React.useState(false);\n const [hasValue, setHasValue] = React.useState(false);\n const [controlKind, setControlKind] = React.useState<ControlKind>('input');\n\n const syncFromDom = React.useCallback(() => {\n const shell = shellRef.current;\n if (!shell) return;\n setControlKind(detectControlKind(shell));\n setHasValue(readValueFromShell(shell));\n }, []);\n\n React.useLayoutEffect(() => {\n syncFromDom();\n }, [children, syncFromDom]);\n\n React.useEffect(() => {\n const shell = shellRef.current;\n if (!shell) return;\n\n const onFocusIn = () => setFocused(true);\n const onFocusOut = (ev: FocusEvent) => {\n if (!shell.contains(ev.relatedTarget as Node)) {\n setFocused(false);\n syncFromDom();\n }\n };\n\n shell.addEventListener('focusin', onFocusIn);\n shell.addEventListener('focusout', onFocusOut);\n return () => {\n shell.removeEventListener('focusin', onFocusIn);\n shell.removeEventListener('focusout', onFocusOut);\n };\n }, [syncFromDom]);\n\n // Replay the error shake on each failed submit (errorVersion bumps even\n // when the error text is unchanged).\n React.useEffect(() => {\n const el = shellRef.current;\n if (!el || !error) return;\n el.style.animation = 'none';\n void el.offsetWidth;\n el.style.animation = '';\n }, [errorVersion, error]);\n\n const isFloated = controlKind === 'other' ? true : focused || hasValue;\n\n const handleInputCapture = React.useCallback(\n (e: React.FormEvent<HTMLDivElement>) => {\n const t = e.target;\n if (t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement) {\n setHasValue(Boolean(t.value));\n }\n },\n [],\n );\n\n const isTextarea = controlKind === 'textarea';\n\n const labelAnimate =\n isTextarea && !isFloated\n ? { top: 20, left: 12, x: 0, y: 0 }\n : isFloated\n ? { top: 0, left: 10, x: 0, y: '-50%' }\n : { top: '50%', left: 12, x: 0, y: '-50%' };\n\n return (\n <FieldProvider value={field}>\n <div ref={ref} className={cn('flex flex-col gap-1.5', className)}>\n <div\n ref={shellRef}\n className={cn(\n 'group/outlined relative w-full min-w-0 rounded-md border border-input bg-background',\n 'ring-offset-background',\n 'focus-within:border-primary focus-within:ring-2 focus-within:ring-primary/30 focus-within:ring-offset-0',\n error && 'border-destructive bison-shake',\n outlinedFieldNestResetClasses,\n isTextarea\n ? 'flex min-h-[80px] flex-col py-2'\n : 'flex h-[var(--density-height-md)] items-stretch pointer-coarse:min-h-11',\n !isFloated &&\n !focused &&\n '[&_input]:placeholder:text-transparent [&_textarea]:placeholder:text-transparent',\n )}\n onInputCapture={handleInputCapture}\n >\n <motion.label\n id={labelId}\n htmlFor={controlId}\n className={cn(\n 'pointer-events-none absolute z-10 bg-background px-1 font-medium leading-none text-muted-foreground',\n isFloated ? 'text-xs' : 'text-base',\n focused && 'text-primary',\n )}\n style={{ transformOrigin: 'left center' }}\n initial={false}\n animate={labelAnimate}\n transition={{ type: 'spring', stiffness: 520, damping: 34 }}\n >\n {label}\n {/* Decoration only — `aria-required` on the control carries the\n meaning. See FormField for the reasoning. */}\n {required ? (\n <span aria-hidden=\"true\" className=\"ml-0.5 text-destructive\">\n *\n </span>\n ) : null}\n </motion.label>\n <div\n className={cn(\n 'box-border flex min-h-0 min-w-0 flex-1',\n isTextarea\n ? 'items-stretch pt-4 [&>*]:flex [&>*]:min-h-0 [&>*]:min-w-0 [&>*]:flex-1'\n : 'items-stretch [&>*]:min-h-0 [&>*]:min-w-0 [&>*]:flex-1',\n )}\n >\n {children}\n </div>\n </div>\n {error ? (\n <p id={errorId} className=\"text-sm leading-none text-destructive\">\n {error}\n </p>\n ) : null}\n {!error && hint ? (\n <p id={descriptionId} className=\"text-sm leading-none text-muted-foreground\">\n {hint}\n </p>\n ) : null}\n </div>\n </FieldProvider>\n );\n },\n);\nOutlinedField.displayName = 'OutlinedField';\n\nexport { OutlinedField };\n","'use client';\n\nimport * as React from 'react';\nimport { cn } from '../lib/utils';\nimport { OutlinedField } from '../components/outlined-field';\nimport { useFormContext } from './form';\nimport { FieldProvider, useFieldIds } from './field-context';\n\nexport interface FormFieldProps {\n name: string;\n label?: string;\n description?: string;\n required?: boolean;\n /**\n * `stack`: label above the control (default).\n * `outlined`: Material-style label on the top border (requires `label`).\n */\n labelLayout?: 'stack' | 'outlined';\n /**\n * `field`: the wrapper labels ONE control (default).\n * `group`: it labels a SET of them — a checkbox or radio group.\n *\n * A `<label for>` can only point at a single form control, so a stack of\n * checkboxes under a plain label has no programmatic name at all\n * (WCAG 1.3.1). Group mode renders a real `<fieldset>` / `<legend>` instead\n * and moves the ARIA wiring onto it, leaving the individual controls to keep\n * their own ids and labels.\n *\n * Group mode always renders stacked; `labelLayout=\"outlined\"` is ignored,\n * because a floating notch label over a set of checkboxes describes nothing.\n */\n as?: 'field' | 'group';\n className?: string;\n children: React.ReactNode;\n}\n\nexport function FormField({\n name,\n label,\n description,\n required,\n labelLayout = 'stack',\n as = 'field',\n className,\n children,\n}: FormFieldProps) {\n const formCtx = useFormContext();\n const errorMessage = formCtx?.errors[name];\n const errorVersion = formCtx?.errorVersion ?? 0;\n const wrapRef = React.useRef<HTMLDivElement>(null);\n\n const { controlId, descriptionId, errorId, labelId } = useFieldIds({\n controlId: name,\n hasDescription: Boolean(description) && !errorMessage,\n hasError: Boolean(errorMessage),\n });\n\n const isGroup = as === 'group';\n\n const field = React.useMemo(\n () => ({\n controlId,\n descriptionId,\n errorId,\n labelId: label ? labelId : undefined,\n invalid: Boolean(errorMessage),\n required: Boolean(required),\n group: isGroup,\n }),\n [\n controlId,\n descriptionId,\n errorId,\n labelId,\n label,\n errorMessage,\n required,\n isGroup,\n ],\n );\n\n // Replay the error shake on every failed submit. Error strings don't change\n // between identical resubmits, so toggling the CSS class alone wouldn't\n // re-trigger the animation — restart it imperatively when errorVersion bumps.\n React.useEffect(() => {\n const el = wrapRef.current;\n if (!el || !errorMessage) return;\n el.style.animation = 'none';\n void el.offsetWidth;\n el.style.animation = '';\n }, [errorVersion, errorMessage]);\n\n if (!isGroup && label && labelLayout === 'outlined') {\n return (\n <OutlinedField\n label={label}\n htmlFor={name}\n required={required}\n error={errorMessage}\n errorVersion={errorVersion}\n hint={description}\n className={className}\n >\n {children}\n </OutlinedField>\n );\n }\n\n const describedBy =\n [descriptionId, errorId].filter(Boolean).join(' ') || undefined;\n\n const messages = (\n <>\n {description && !errorMessage && (\n <p\n id={descriptionId}\n className=\"mt-1.5 text-sm leading-none text-muted-foreground\"\n >\n {description}\n </p>\n )}\n {errorMessage && (\n <p id={errorId} className=\"mt-1.5 text-sm leading-none text-destructive\">\n {errorMessage}\n </p>\n )}\n </>\n );\n\n // The asterisk is decoration. `aria-required` on the control (or the group)\n // is what actually conveys the requirement — before this, a screen reader\n // either read \"star\" or skipped it entirely (WCAG 3.3.2).\n const requiredMark = required ? (\n <span aria-hidden=\"true\" className=\"text-destructive ml-1\">\n *\n </span>\n ) : null;\n\n if (isGroup) {\n return (\n <FieldProvider value={field}>\n <fieldset\n ref={wrapRef as unknown as React.Ref<HTMLFieldSetElement>}\n className={cn(\n 'flex flex-col',\n errorMessage && 'bison-shake',\n className,\n )}\n aria-describedby={describedBy}\n aria-invalid={errorMessage ? true : undefined}\n aria-required={required || undefined}\n >\n {label && (\n <legend id={labelId} className=\"mb-1.5 text-sm font-medium leading-none\">\n {label}\n {requiredMark}\n </legend>\n )}\n {children}\n {messages}\n </fieldset>\n </FieldProvider>\n );\n }\n\n return (\n <FieldProvider value={field}>\n <div\n ref={wrapRef}\n className={cn('flex flex-col', errorMessage && 'bison-shake', className)}\n >\n {label && (\n <label\n id={labelId}\n htmlFor={controlId}\n className=\"mb-1.5 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n >\n {label}\n {requiredMark}\n </label>\n )}\n {children}\n {messages}\n </div>\n </FieldProvider>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../lib/utils\";\n\nexport interface FormErrorProps {\n message?: string;\n className?: string;\n}\n\nexport function FormError({ message, className }: FormErrorProps) {\n if (!message) return null;\n\n return (\n <div\n className={cn(\n \"rounded-md border border-destructive/50 bg-destructive/10 px-4 py-3 text-sm text-destructive\",\n className\n )}\n role=\"alert\"\n >\n {message}\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Slot as SlotPrimitive } from \"radix-ui\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { LoaderCircle } from \"lucide-react\";\nimport {\n actionNegativeToneClasses,\n actionNeutralToneClasses,\n actionPositiveToneClasses,\n} from \"../lib/semantic-action-tones\";\nimport { cn } from \"../lib/utils\";\n\nconst buttonVariants = cva(\n // pointer-coarse:min-h-11/min-w-11 enforce a 44px minimum tap target on touch\n // devices (WCAG 2.5.5) without altering the visual density-driven height on\n // fine (mouse) pointers, so desktop sizing and form-control alignment are\n // unchanged. Applies across every size and the icon button.\n \"relative inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-[color,background-color,border-color,box-shadow] duration-fast ease-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 cursor-pointer pointer-coarse:min-h-11 pointer-coarse:min-w-11\",\n {\n variants: {\n variant: {\n default:\n \"bg-primary text-primary-foreground hover:bg-primary-700 hover:shadow-md\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary-700 hover:shadow-md\",\n accent:\n \"bg-brand-accent text-brand-accent-foreground hover:bg-brand-accent-600 hover:shadow-md\",\n highlight:\n \"bg-highlight text-highlight-foreground hover:bg-highlight-600 hover:shadow-md\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive-700 hover:shadow-md\",\n outline:\n \"border border-border-strong bg-background text-foreground hover:bg-accent hover:text-accent-foreground hover:shadow-sm\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n /** Soft neutral tile (edit / secondary icon actions). */\n actionNeutral: actionNeutralToneClasses,\n /** Soft success tint + strong success icon (inline confirm, row actions). */\n actionPositive: actionPositiveToneClasses,\n /** Soft danger tint + strong destructive icon (inline cancel, row delete). */\n actionNegative: actionNegativeToneClasses,\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n sm: \"h-[var(--density-height-sm)] px-3 text-xs\",\n md: \"h-[var(--density-height-md)] px-4 py-2\",\n lg: \"h-[var(--density-height-lg)] px-8 text-base rounded-lg\",\n icon: \"h-[var(--density-height-md)] w-[var(--density-height-md)]\",\n },\n fullWidth: {\n true: \"w-full\",\n false: \"\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n fullWidth: false,\n },\n },\n);\n\nexport interface ButtonProps\n extends\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n /**\n * When true, replaces the button's content with a centered spinner while\n * preserving the button's original width. The button is also disabled and\n * marked `aria-busy` for assistive tech. Ignored when `asChild` is set,\n * since Slot requires a single child.\n */\n loading?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n fullWidth,\n asChild = false,\n loading = false,\n disabled,\n children,\n ...props\n },\n ref,\n ) => {\n const Comp = asChild ? SlotPrimitive.Slot : \"button\";\n\n if (asChild) {\n return (\n <Comp\n className={cn(\n buttonVariants({ variant, size, fullWidth, className }),\n )}\n ref={ref}\n aria-busy={loading || undefined}\n {...props}\n >\n {children}\n </Comp>\n );\n }\n\n const spinnerSizeClass =\n size === \"sm\" ? \"h-3 w-3\" : size === \"lg\" ? \"h-5 w-5\" : \"h-4 w-4\";\n\n return (\n <button\n className={cn(buttonVariants({ variant, size, fullWidth, className }))}\n ref={ref}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n data-loading={loading || undefined}\n {...props}\n >\n {loading ? (\n <>\n <span className=\"invisible inline-flex items-center justify-center\">\n {children}\n </span>\n <span\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-0 flex items-center justify-center\"\n >\n <LoaderCircle\n className={cn(\"animate-spin\", spinnerSizeClass)}\n />\n </span>\n </>\n ) : (\n children\n )}\n </button>\n );\n },\n);\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\n","/**\n * Shared surface class strings extracted to a single source of truth.\n *\n * These patterns appear in multiple components that must stay in lockstep\n * visually (same border, same focus ring, same scrim, etc.). When any of\n * these visuals change, update here once — every consumer tracks.\n *\n * See components: input, textarea, password-input, currency-input,\n * select, dropdown-menu, context-menu, command, dialog, alert-dialog,\n * sheet, popover, tooltip.\n */\n\n// ─── Input family ──────────────────────────────────────────────────────────\n\n/**\n * Common chrome for form input surfaces: border, background, ring-offset,\n * placeholder color, disabled state. Does NOT include sizing or focus —\n * consumers add `inputSizingClasses` (or their own) + `inputFocusClasses`.\n *\n * Used by: Input, Textarea, PasswordInput, CurrencyInput, Select Trigger,\n * DatePicker trigger, DateRangePicker trigger.\n */\nexport const inputSurfaceClasses =\n 'flex w-full rounded-md border border-input bg-background text-base sm:text-sm ring-offset-background placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50';\n\n/**\n * Focus-visible ring for input surfaces. Keyboard focus only (`focus-visible`)\n * so mouse clicks don't show the ring — matches WAI-ARIA expectations.\n */\nexport const inputFocusClasses =\n 'focus-visible:outline-none focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/30 focus-visible:ring-offset-0';\n\nexport type InputSize = 'sm' | 'md' | 'lg';\n\n/**\n * Standard single-line input sizing per size: density height + horizontal\n * padding + vertical padding, scaled per size. Textarea uses `min-h-[80px]`\n * instead of any of these.\n *\n * `pointer-coarse:min-h-11` floors the height at 44px on touch pointers on\n * every size, matching the Button primitive (and Button-based DatePicker /\n * DateRangePicker triggers) so inputs, selects, and buttons stay the same\n * height when combined in a form. Fine (mouse) pointers keep the exact\n * density height for the chosen size.\n *\n * `'md'` (the default) is byte-identical to the original fixed sizing this\n * function replaced — every existing caller passes `'md'` explicitly and\n * renders unchanged.\n */\nconst inputSizingClassesBySize: Record<InputSize, string> = {\n sm: 'h-[var(--density-height-sm)] px-3 py-1 text-sm pointer-coarse:min-h-11',\n md: 'h-[var(--density-height-md)] px-3 py-2 pointer-coarse:min-h-11',\n lg: 'h-[var(--density-height-lg)] px-3 py-2.5 text-base pointer-coarse:min-h-11',\n};\n\nexport function inputSizingClasses(size: InputSize = 'md'): string {\n return inputSizingClassesBySize[size];\n}\n\n// ─── Touch targets ─────────────────────────────────────────────────────────\n\n/**\n * Minimum 44px tap target on touch (coarse) pointers, applied to the element\n * itself. For standalone icon buttons that can safely grow their box on touch\n * without crowding neighbors (e.g. Dialog / Sheet close). Pair with\n * `inline-flex items-center justify-center` to keep the glyph centered. Fine\n * (mouse) pointers are unchanged, so desktop chrome is pixel-identical. Mirrors\n * the Button primitive's own coarse-pointer floor (WCAG 2.5.5).\n *\n * Used by: Dialog Close, Sheet Close.\n */\nexport const touchTargetClasses = 'pointer-coarse:min-h-11 pointer-coarse:min-w-11';\n\n/**\n * Expanded 44px tap target for small controls whose *visual* size must stay\n * fixed (a 44px checkbox would look broken). Renders a centered, transparent\n * 44px pseudo-element that captures pointer events on touch (coarse) pointers\n * only, so the drawn control is unchanged on every pointer and desktop layouts\n * (dense tables, tight forms) stay pixel-identical. Includes `relative`; the\n * host element must not be `overflow-hidden` or the pseudo is clipped.\n *\n * Used by: Checkbox, Radio, Switch, Slider thumb.\n */\nexport const coarseHitAreaClasses =\n \"relative before:absolute before:left-1/2 before:top-1/2 before:hidden before:size-11 before:-translate-x-1/2 before:-translate-y-1/2 before:content-[''] pointer-coarse:before:block\";\n\n// ─── Menu / popover surfaces ───────────────────────────────────────────────\n\n/**\n * Menu surface chrome shared by floating menus and popovers:\n * Select Content, DropdownMenu Content, ContextMenu Content, Command.\n *\n * Uses `--z-dropdown` (500 after z-index refactor) so menus open *above*\n * modals they're triggered from — critical for Select inside a Dialog, etc.\n */\nexport const menuSurfaceClasses =\n 'z-[var(--z-dropdown)] min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md';\n\n/**\n * Base menu item: focus styling, disabled state, selection-ready.\n * Used by: Select Item, DropdownMenu Item, ContextMenu Item, Command Item.\n */\nexport const menuItemClasses =\n 'relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:cursor-default';\n\n/**\n * Menu item variant with indicator gutter on the left (for checkbox/radio\n * indicators on Select, DropdownMenu, ContextMenu).\n */\nexport const menuItemWithIndicatorClasses =\n 'relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:cursor-default';\n\n/**\n * Menu separator: horizontal rule sitting between menu groups.\n */\nexport const menuSeparatorClasses = '-mx-1 my-1 h-px bg-muted';\n\n// ─── Floating animations ───────────────────────────────────────────────────\n\n/**\n * transitions.dev \"menu dropdown\" (05): scale-pop + fade from the Radix\n * popper transform-origin, with distinct open/close timing. Driven by the\n * --dropdown-* tokens. Used by Select Content, DropdownMenu Content,\n * ContextMenu Content, Popover Content, Command popovers. Tooltip has its\n * own faster, subtler timing — see `tooltipAnimationClasses`.\n */\nexport const floatingAnimationClasses =\n 'origin-[var(--radix-popper-transform-origin)] data-[state=open]:bison-pop-in data-[state=closed]:bison-pop-out';\n\n/**\n * transitions.dev \"tooltip\" (17): faster scale-pop driven by the --tt-*\n * tokens. Used by Tooltip Content. NB: Radix Tooltip's open state is\n * `delayed-open` / `instant-open` (not `open` like other overlays), so the\n * enter animation keys off both.\n */\nexport const tooltipAnimationClasses =\n 'origin-[var(--radix-popper-transform-origin)] data-[state=delayed-open]:bison-tooltip-in data-[state=instant-open]:bison-tooltip-in data-[state=closed]:bison-tooltip-out';\n\n// ─── Modal / overlay ───────────────────────────────────────────────────────\n\n/**\n * Scrim (backdrop) shared by Dialog, AlertDialog, Sheet.\n */\nexport const overlayScrimClasses =\n 'fixed inset-0 z-[var(--z-modal-backdrop)] bg-black/80 data-[state=open]:bison-scrim-in data-[state=closed]:bison-scrim-out';\n\n/**\n * Centered modal content positioning + chrome (Dialog, AlertDialog).\n * Sheet has its own side-anchored variants in `sheet.tsx`.\n */\nexport const centeredModalContentClasses =\n 'fixed left-[50%] top-[50%] z-[var(--z-modal)] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg rounded-lg data-[state=open]:bison-modal-in data-[state=closed]:bison-modal-out';\n","'use client';\n\nimport * as React from 'react';\nimport { cn } from '../lib/utils';\nimport {\n inputFocusClasses,\n inputSizingClasses,\n inputSurfaceClasses,\n} from '../lib/surface-classes';\nimport { useFieldControl } from '../form/field-context';\n\nexport interface InputProps\n extends React.InputHTMLAttributes<HTMLInputElement> {}\n\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, type, ...props }, ref) => {\n // Adopts the surrounding field's id and ARIA wiring; a no-op outside one.\n // PhoneInput and CurrencyInput inherit this by rendering through Input.\n const fieldProps = useFieldControl(props);\n\n return (\n <input\n type={type}\n className={cn(\n inputSurfaceClasses,\n inputSizingClasses('md'),\n inputFocusClasses,\n 'file:border-0 file:bg-transparent file:text-base file:font-medium sm:file:text-sm',\n className,\n )}\n ref={ref}\n {...fieldProps}\n />\n );\n },\n);\nInput.displayName = 'Input';\n\nexport { Input };\n","'use client';\n\nimport * as React from 'react';\nimport { unstable_PasswordToggleField as PasswordToggleField } from 'radix-ui';\nimport { Eye, EyeOff } from 'lucide-react';\nimport { cn } from '../lib/utils';\nimport {\n inputFocusClasses,\n inputSizingClasses,\n inputSurfaceClasses,\n} from '../lib/surface-classes';\nimport { useFieldControl } from '../form/field-context';\n\nexport interface PasswordInputProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof PasswordToggleField.Input>,\n 'type'\n > {\n /**\n * Accessible name for the show/hide control.\n *\n * The toggle is icon-only, and Radix supplies no name of its own, so without\n * this it reaches a screen reader as an unlabelled button (WCAG 4.1.2). The\n * wording covers both states deliberately: the button's own pressed state is\n * what conveys which way it is currently set.\n */\n toggleLabel?: string;\n}\n\nconst PasswordInput = React.forwardRef<HTMLInputElement, PasswordInputProps>(\n ({ className, toggleLabel = 'Show or hide password', ...props }, ref) => {\n // Adopts the surrounding field's id and ARIA wiring; a no-op outside one.\n const fieldProps = useFieldControl(props);\n\n return (\n <PasswordToggleField.Root>\n <div className=\"relative\">\n <PasswordToggleField.Input\n className={cn(\n inputSurfaceClasses,\n inputSizingClasses('md'),\n inputFocusClasses,\n 'pr-10 file:border-0 file:bg-transparent file:text-base file:font-medium sm:file:text-sm',\n className,\n )}\n ref={ref}\n {...fieldProps}\n />\n <PasswordToggleField.Toggle\n className=\"absolute right-0 top-0 flex h-full w-10 items-center justify-center text-muted-foreground hover:text-foreground transition-colors disabled:pointer-events-none disabled:opacity-50\"\n disabled={props.disabled}\n aria-label={toggleLabel}\n >\n <PasswordToggleField.Icon\n visible={<EyeOff className=\"h-4 w-4\" />}\n hidden={<Eye className=\"h-4 w-4\" />}\n />\n </PasswordToggleField.Toggle>\n </div>\n </PasswordToggleField.Root>\n );\n },\n);\nPasswordInput.displayName = 'PasswordInput';\n\nexport { PasswordInput };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../lib/utils\";\nimport { Input } from \"./input\";\nimport { FieldGroupScope, useFieldGroup } from \"../form/field-context\";\n\nexport interface CodeInputProps {\n /** Number of digits. @default 6 */\n length?: number;\n /**\n * Accessible name for each box, given its 1-based position and the total.\n *\n * The boxes are unlabelled digits — without a name each one reaches a screen\n * reader as a bare \"edit text\" and there is no way to tell which of the six\n * you are in (WCAG 4.1.2, and 2.4.6 once you are lost in the middle).\n */\n digitLabel?: (position: number, total: number) => string;\n /** Called with the full code string when all digits are filled. */\n onComplete?: (code: string) => void;\n /** Called on every change with the current partial/full code string. */\n onChange?: (code: string) => void;\n loading?: boolean;\n disabled?: boolean;\n className?: string;\n}\n\nconst CodeInput = React.forwardRef<HTMLDivElement, CodeInputProps>(\n (\n {\n length = 6,\n onComplete,\n onChange,\n loading = false,\n disabled = false,\n className,\n digitLabel = (position, total) => `Digit ${position} of ${total}`,\n },\n ref,\n ) => {\n const groupProps = useFieldGroup();\n const [code, setCode] = React.useState<string[]>(Array(length).fill(\"\"));\n const inputRefs = React.useRef<(HTMLInputElement | null)[]>([]);\n\n const updateCode = React.useCallback(\n (newCode: string[]) => {\n setCode(newCode);\n const joined = newCode.join(\"\");\n onChange?.(joined);\n if (joined.length === length && newCode.every(Boolean)) {\n onComplete?.(joined);\n }\n },\n [length, onChange, onComplete],\n );\n\n const handleChange = React.useCallback(\n (index: number, value: string) => {\n if (!/^\\d*$/.test(value)) return;\n const newCode = [...code];\n newCode[index] = value.slice(-1);\n updateCode(newCode);\n\n if (value && index < length - 1) {\n inputRefs.current[index + 1]?.focus();\n }\n },\n [code, length, updateCode],\n );\n\n const handleKeyDown = React.useCallback(\n (index: number, e: React.KeyboardEvent) => {\n if (e.key === \"Backspace\" && !code[index] && index > 0) {\n inputRefs.current[index - 1]?.focus();\n }\n },\n [code],\n );\n\n const handlePaste = React.useCallback(\n (e: React.ClipboardEvent) => {\n e.preventDefault();\n const pasted = e.clipboardData\n .getData(\"text\")\n .replace(/\\D/g, \"\")\n .slice(0, length);\n const newCode = Array(length).fill(\"\") as string[];\n for (let i = 0; i < pasted.length; i++) {\n newCode[i] = pasted[i];\n }\n updateCode(newCode);\n if (pasted.length < length) {\n inputRefs.current[pasted.length]?.focus();\n }\n },\n [length, updateCode],\n );\n\n return (\n <div\n ref={ref}\n className={cn(\"flex justify-center gap-2\", className)}\n onPaste={handlePaste}\n {...groupProps}\n >\n <FieldGroupScope>\n {code.map((digit, index) => (\n <Input\n key={index}\n ref={(el) => {\n inputRefs.current[index] = el;\n }}\n type=\"text\"\n inputMode=\"numeric\"\n maxLength={1}\n value={digit}\n onChange={(e) => handleChange(index, e.target.value)}\n onKeyDown={(e) => handleKeyDown(index, e)}\n disabled={loading || disabled}\n className=\"h-12 w-12 text-center text-lg font-semibold\"\n autoFocus={index === 0}\n aria-label={digitLabel(index + 1, length)}\n />\n ))}\n </FieldGroupScope>\n </div>\n );\n },\n);\nCodeInput.displayName = \"CodeInput\";\n\nexport { CodeInput };\n","'use client';\n\nimport * as React from 'react';\nimport { cn } from '../lib/utils';\nimport {\n inputFocusClasses,\n inputSizingClasses,\n inputSurfaceClasses,\n} from '../lib/surface-classes';\nimport { useFieldControl } from '../form/field-context';\n\nexport interface CurrencyInputProps\n extends Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'type' | 'inputMode' | 'onChange' | 'value'\n > {\n /** Current value in cents (integer). */\n value: number;\n /** Called with the new value in cents */\n onChange: (cents: number) => void;\n /** Currency symbol displayed as a prefix. Defaults to \"$\" */\n symbol?: string;\n}\n\n/** Strips everything except digits and a single decimal point, limits to 2 decimal places. */\nfunction sanitize(raw: string): string {\n let cleaned = raw.replace(/[^\\d.]/g, '');\n const parts = cleaned.split('.');\n if (parts.length > 2) {\n cleaned = parts[0] + '.' + parts.slice(1).join('');\n }\n if (parts.length === 2 && parts[1].length > 2) {\n cleaned = parts[0] + '.' + parts[1].slice(0, 2);\n }\n return cleaned;\n}\n\n/** Converts a dollar string to cents: \"25\" → 2500, \"25.50\" → 2550 */\nfunction toCents(raw: string): number {\n if (!raw) return 0;\n const num = parseFloat(raw);\n if (isNaN(num) || num <= 0) return 0;\n return Math.round(num * 100);\n}\n\n/** Formats cents to a display string: 2500 → \"25.00\", 0 → \"\" */\nfunction fromCents(cents: number): string {\n if (cents <= 0) return '';\n return (cents / 100).toFixed(2);\n}\n\nconst CurrencyInput = React.forwardRef<HTMLInputElement, CurrencyInputProps>(\n ({ className, value, onChange, symbol = '$', ...props }, ref) => {\n // Adopts the surrounding field's id and ARIA wiring; a no-op outside one.\n const fieldProps = useFieldControl(props);\n const [display, setDisplay] = React.useState(() => fromCents(value));\n\n // Sync display when value changes externally (e.g. reset to 0)\n const prevValue = React.useRef(value);\n if (value !== prevValue.current) {\n prevValue.current = value;\n const expected = fromCents(value);\n // Only overwrite display if the external value actually changed meaning\n // (avoids fighting with the user's in-progress typing)\n if (toCents(display) !== value) {\n setDisplay(expected);\n }\n }\n\n function handleChange(e: React.ChangeEvent<HTMLInputElement>) {\n const cleaned = sanitize(e.target.value);\n setDisplay(cleaned);\n onChange(toCents(cleaned));\n }\n\n function handleBlur() {\n // Format to XX.00 on blur\n const cents = toCents(display);\n setDisplay(fromCents(cents));\n }\n\n return (\n <div className=\"relative\">\n <span\n className=\"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 select-none text-muted-foreground\"\n aria-hidden=\"true\"\n >\n {symbol}\n </span>\n <input\n ref={ref}\n type=\"text\"\n inputMode=\"decimal\"\n autoComplete=\"off\"\n value={display}\n onChange={handleChange}\n onBlur={handleBlur}\n className={cn(\n inputSurfaceClasses,\n inputSizingClasses('md'),\n inputFocusClasses,\n 'pl-7 pr-3 text-sm',\n className,\n )}\n {...fieldProps}\n />\n </div>\n );\n },\n);\nCurrencyInput.displayName = 'CurrencyInput';\n\nexport { CurrencyInput };\n","const PHONE_MAX_DIGITS = 10;\n\n/** Strips non-digits and caps at 10 (US NANP). */\nexport function parseUsPhoneDigits(value: string): string {\n return value.replace(/\\D/g, '').slice(0, PHONE_MAX_DIGITS);\n}\n\n/** Formats a phone value (digits, E.164, or any mixed string) as `(XXX) XXX-XXXX`. */\nexport function formatUsPhone(value: string): string {\n const d = parseUsPhoneDigits(value);\n if (d.length <= 3) return d;\n if (d.length <= 6) return `(${d.slice(0, 3)}) ${d.slice(3)}`;\n return `(${d.slice(0, 3)}) ${d.slice(3, 6)}-${d.slice(6)}`;\n}\n\n/**\n * Deliberately NOT a `'use client'` module, and deliberately not living in\n * `phone-input.tsx` any more.\n *\n * `validators.ts` needs `parseUsPhoneDigits`, and it is consumed from Server\n * Actions. Importing it from the component file dragged the whole client\n * component in behind it, and every output of the main entry carries a\n * `\"use client\"` banner — so calling the validator on the server failed with\n * \"Attempted to call … from the server but … is on the client\".\n *\n * Keep this file free of React, and free of imports from anything holding a\n * `'use client'` directive.\n */\n","'use client';\n\nimport * as React from 'react';\n\nimport { Input } from './input';\nimport { formatUsPhone, parseUsPhoneDigits } from '../lib/us-phone';\n\nconst PHONE_MAX_LENGTH = 14;\n\n// Re-exported so the public API is unchanged. The implementations moved to a\n// module with no `'use client'` directive so `validators.ts` can use them from\n// a Server Action — see lib/us-phone.ts.\nexport { formatUsPhone, parseUsPhoneDigits };\n\n/**\n * US phone field: shows `(555) 123-4567` while `value` / `onChange` use digits\n * only (`5551234567`), matching {@link CurrencyInput} (display vs semantic value).\n */\nexport interface PhoneInputProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof Input>,\n 'type' | 'inputMode' | 'maxLength' | 'value' | 'defaultValue' | 'onChange'\n > {\n /** Digits only, up to 10 characters. Use with `onChange` for controlled usage. */\n value?: string;\n /** Initial digits when uncontrolled. */\n defaultValue?: string;\n /** Called with digits-only value on each edit (empty string when cleared). */\n onChange?: (digits: string) => void;\n}\n\nconst PhoneInput = React.forwardRef<HTMLInputElement, PhoneInputProps>(\n function PhoneInput(\n {\n value: valueProp,\n defaultValue = '',\n onChange,\n autoComplete = 'tel',\n ...props\n },\n ref,\n ) {\n const isControlled = valueProp !== undefined;\n const [uncontrolledDigits, setUncontrolledDigits] = React.useState(() =>\n parseUsPhoneDigits(defaultValue),\n );\n\n const digits = isControlled\n ? parseUsPhoneDigits(valueProp ?? '')\n : uncontrolledDigits;\n\n const display = formatUsPhone(digits);\n\n function handleChange(event: React.ChangeEvent<HTMLInputElement>) {\n const next = parseUsPhoneDigits(event.target.value);\n if (!isControlled) {\n setUncontrolledDigits(next);\n }\n onChange?.(next);\n }\n\n return (\n <Input\n ref={ref}\n {...props}\n type=\"text\"\n inputMode=\"tel\"\n autoComplete={autoComplete}\n maxLength={PHONE_MAX_LENGTH}\n value={display}\n onChange={handleChange}\n />\n );\n },\n);\n\nPhoneInput.displayName = 'PhoneInput';\n\nexport { PhoneInput };\n","'use client';\n\nimport * as React from 'react';\nimport { Label as LabelPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../lib/utils';\n\nconst labelVariants = cva(\n 'inline-block text-sm font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70',\n {\n variants: {\n /** `stack`: label above a field (default). `inline`: beside checkbox, radio, switch. */\n layout: {\n stack: 'mb-2 leading-none',\n inline: 'mb-0 leading-snug',\n },\n },\n defaultVariants: {\n layout: 'stack',\n },\n },\n);\n\nconst Label = React.forwardRef<\n React.ComponentRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\n VariantProps<typeof labelVariants>\n>(({ className, layout, ...props }, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(labelVariants({ layout }), className)}\n {...props}\n />\n));\nLabel.displayName = LabelPrimitive.Root.displayName;\n\nexport { Label };\n","'use client';\n\nimport * as React from 'react';\nimport { cn } from '../lib/utils';\nimport { Label } from './label';\nimport { OutlinedField } from './outlined-field';\nimport { FieldProvider, useFieldIds } from '../form/field-context';\n\nexport interface InputGroupProps {\n /** Field label text. */\n label: string;\n /**\n * Associates the label with the input via `htmlFor`.\n *\n * Optional now: when omitted, the group generates an id and the control\n * adopts it through the field context. It used to be the only way the label\n * could reach the control, and a caller who forgot it shipped a label\n * pointing at nothing.\n */\n htmlFor?: string;\n /** Validation error message displayed below the input. */\n error?: string;\n /** Helper text displayed below the input (hidden when error is present). */\n hint?: string;\n /** Marks the field as required with a visual indicator. */\n required?: boolean;\n /**\n * `stack`: label above the control (default).\n * `outlined`: Material-style label notch on the top border; nested controls lose their own border.\n */\n labelLayout?: 'stack' | 'outlined';\n className?: string;\n children: React.ReactNode;\n}\n\nconst InputGroup = React.forwardRef<HTMLDivElement, InputGroupProps>(\n (\n {\n label,\n htmlFor,\n error,\n hint,\n required,\n labelLayout = 'stack',\n className,\n children,\n },\n ref,\n ) => {\n const fallbackId = React.useId();\n const controlId = htmlFor ?? `${fallbackId}-control`;\n\n const { descriptionId, errorId, labelId } = useFieldIds({\n controlId,\n hasDescription: Boolean(hint) && !error,\n hasError: Boolean(error),\n });\n\n const field = React.useMemo(\n () => ({\n controlId,\n descriptionId,\n errorId,\n labelId,\n invalid: Boolean(error),\n required: Boolean(required),\n group: false,\n }),\n [controlId, descriptionId, errorId, labelId, error, required],\n );\n\n if (labelLayout === 'outlined') {\n return (\n <OutlinedField\n ref={ref}\n label={label}\n htmlFor={controlId}\n error={error}\n hint={hint}\n required={required}\n className={className}\n >\n {children}\n </OutlinedField>\n );\n }\n\n return (\n <FieldProvider value={field}>\n <div ref={ref} className={cn('flex flex-col gap-2', className)}>\n <Label id={labelId} htmlFor={controlId}>\n {label}\n {/* Decoration only — `aria-required` on the control carries the\n meaning. See FormField for the reasoning. */}\n {required && (\n <span aria-hidden=\"true\" className=\"ml-0.5 text-destructive\">\n *\n </span>\n )}\n </Label>\n {children}\n {error && (\n <p id={errorId} className=\"text-sm text-destructive\">\n {error}\n </p>\n )}\n {!error && hint && (\n <p id={descriptionId} className=\"text-sm text-muted-foreground\">\n {hint}\n </p>\n )}\n </div>\n </FieldProvider>\n );\n },\n);\nInputGroup.displayName = 'InputGroup';\n\nexport { InputGroup };\n","'use client';\n\nimport * as React from 'react';\nimport { cn } from '../lib/utils';\nimport { inputFocusClasses, inputSurfaceClasses } from '../lib/surface-classes';\nimport { useFieldControl } from '../form/field-context';\n\nexport interface TextareaProps\n extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n ({ className, ...props }, ref) => {\n // Adopts the surrounding field's id and ARIA wiring; a no-op outside one.\n const fieldProps = useFieldControl(props);\n\n return (\n <textarea\n className={cn(\n inputSurfaceClasses,\n 'min-h-[80px] px-3 py-2',\n inputFocusClasses,\n className,\n )}\n ref={ref}\n {...fieldProps}\n />\n );\n },\n);\nTextarea.displayName = 'Textarea';\n\nexport { Textarea };\n","'use client';\n\nimport * as React from 'react';\nimport { Select as SelectPrimitive } from 'radix-ui';\nimport { Check, ChevronDown, ChevronUp } from 'lucide-react';\nimport { cn } from '../lib/utils';\nimport {\n floatingAnimationClasses,\n inputFocusClasses,\n inputSizingClasses,\n inputSurfaceClasses,\n menuItemWithIndicatorClasses,\n menuSeparatorClasses,\n menuSurfaceClasses,\n} from '../lib/surface-classes';\nimport { useFieldControl } from '../form/field-context';\n\nconst Select = SelectPrimitive.Root;\nconst SelectGroup = SelectPrimitive.Group;\nconst SelectValue = SelectPrimitive.Value;\n\nconst SelectTrigger = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => {\n // Adopts the surrounding field's id and ARIA wiring; a no-op outside one.\n const fieldProps = useFieldControl(props);\n\n return (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n inputSurfaceClasses,\n inputSizingClasses('md'),\n inputFocusClasses,\n 'items-center justify-between [&>span]:line-clamp-1',\n className,\n )}\n {...fieldProps}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDown className=\"h-4 w-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n );\n});\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\nconst SelectScrollUpButton = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.ScrollUpButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn(\n 'flex cursor-default items-center justify-center py-1',\n className,\n )}\n {...props}\n >\n <ChevronUp className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollUpButton>\n));\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\nconst SelectScrollDownButton = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.ScrollDownButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn(\n 'flex cursor-default items-center justify-center py-1',\n className,\n )}\n {...props}\n >\n <ChevronDown className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollDownButton>\n));\nSelectScrollDownButton.displayName =\n SelectPrimitive.ScrollDownButton.displayName;\n\nconst SelectContent = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(({ className, children, position = 'popper', ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n menuSurfaceClasses,\n floatingAnimationClasses,\n 'relative max-h-96 p-0',\n position === 'popper' &&\n 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',\n className,\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n 'p-1',\n position === 'popper' &&\n 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]',\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n));\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\nconst SelectLabel = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn('py-1.5 pl-8 pr-2 text-sm font-semibold', className)}\n {...props}\n />\n));\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\nconst SelectItem = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(menuItemWithIndicatorClasses, 'w-full', className)}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\nconst SelectSeparator = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn(menuSeparatorClasses, className)}\n {...props}\n />\n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport { DayPicker } from \"react-day-picker\";\nimport { ChevronLeft, ChevronRight } from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker>;\n\nconst Calendar = ({\n className,\n classNames,\n showOutsideDays = true,\n ...props\n}: CalendarProps) => {\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\"p-3\", className)}\n classNames={{\n months: \"flex flex-col sm:flex-row gap-2\",\n month: \"flex flex-col gap-4\",\n month_caption: \"flex justify-center pt-1 relative items-center w-full\",\n caption_label: \"text-sm font-medium\",\n nav: \"flex items-center gap-1\",\n button_previous:\n \"absolute left-1 inline-flex items-center justify-center h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 border border-input rounded-md z-10\",\n button_next:\n \"absolute right-1 inline-flex items-center justify-center h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 border border-input rounded-md z-10\",\n month_grid: \"w-full border-collapse space-x-1\",\n weekdays: \"flex\",\n weekday:\n \"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]\",\n week: \"flex w-full mt-2\",\n day: cn(\n \"relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50\",\n props.mode === \"range\"\n ? \"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md\"\n : \"[&:has([aria-selected])]:rounded-md\",\n ),\n day_button: cn(\n \"inline-flex items-center justify-center h-9 w-9 p-0 font-normal aria-selected:opacity-100 rounded-md\",\n \"hover:bg-accent hover:text-accent-foreground\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2\",\n ),\n range_start: \"day-range-start rounded-l-md\",\n range_end: \"day-range-end rounded-r-md\",\n selected:\n \"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground\",\n today: \"bg-accent text-accent-foreground\",\n outside:\n \"day-outside text-muted-foreground aria-selected:text-muted-foreground opacity-50 aria-selected:opacity-30\",\n disabled: \"text-muted-foreground opacity-50\",\n range_middle:\n \"aria-selected:bg-accent aria-selected:text-accent-foreground\",\n hidden: \"invisible\",\n ...classNames,\n }}\n components={{\n Chevron: ({ orientation }) =>\n orientation === \"left\" ? (\n <ChevronLeft className=\"h-4 w-4\" />\n ) : (\n <ChevronRight className=\"h-4 w-4\" />\n ),\n }}\n {...props}\n />\n );\n};\nCalendar.displayName = \"Calendar\";\n\nexport { Calendar };\n","\"use client\";\n\nimport * as React from \"react\";\nimport useEmblaCarousel, {\n type UseEmblaCarouselType,\n} from \"embla-carousel-react\";\nimport { ArrowLeft, ArrowRight } from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\nimport { Button, type ButtonProps } from \"./button\";\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\nexport interface CarouselProps {\n /** Embla options — `loop`, `align`, `slidesToScroll`, `startIndex`, etc. */\n opts?: CarouselOptions;\n /** Embla plugins, e.g. autoplay. */\n plugins?: CarouselPlugin;\n /** Scroll axis. Defaults to `\"horizontal\"`. */\n orientation?: \"horizontal\" | \"vertical\";\n /** Receives the Embla API once initialized, for external control. */\n setApi?: (api: CarouselApi) => void;\n}\n\ninterface CarouselContextValue extends CarouselProps {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: CarouselApi;\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n orientation: \"horizontal\" | \"vertical\";\n}\n\nconst CarouselContext = React.createContext<CarouselContextValue | null>(null);\n\nfunction useCarousel(): CarouselContextValue {\n const context = React.useContext(CarouselContext);\n if (!context) {\n throw new Error(\"useCarousel must be used within a <Carousel />\");\n }\n return context;\n}\n\nconst Carousel = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & CarouselProps\n>(\n (\n {\n orientation = \"horizontal\",\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n },\n ref,\n ) => {\n const [carouselRef, api] = useEmblaCarousel(\n { ...opts, axis: orientation === \"horizontal\" ? \"x\" : \"y\" },\n plugins,\n );\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\n const [canScrollNext, setCanScrollNext] = React.useState(false);\n\n const onSelect = React.useCallback((emblaApi: CarouselApi) => {\n if (!emblaApi) return;\n setCanScrollPrev(emblaApi.canScrollPrev());\n setCanScrollNext(emblaApi.canScrollNext());\n }, []);\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext();\n }, [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === \"ArrowRight\") {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext],\n );\n\n React.useEffect(() => {\n if (api && setApi) setApi(api);\n }, [api, setApi]);\n\n React.useEffect(() => {\n if (!api) return;\n\n onSelect(api);\n api.on(\"reInit\", onSelect);\n api.on(\"select\", onSelect);\n\n return () => {\n api.off(\"reInit\", onSelect);\n api.off(\"select\", onSelect);\n };\n }, [api, onSelect]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api,\n opts,\n orientation,\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <div\n ref={ref}\n onKeyDownCapture={handleKeyDown}\n className={cn(\"relative\", className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n },\n);\nCarousel.displayName = \"Carousel\";\n\nconst CarouselContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n const { carouselRef, orientation } = useCarousel();\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\">\n <div\n ref={ref}\n className={cn(\n \"flex\",\n orientation === \"horizontal\" ? \"-ml-4\" : \"-mt-4 flex-col\",\n className,\n )}\n {...props}\n />\n </div>\n );\n});\nCarouselContent.displayName = \"CarouselContent\";\n\nconst CarouselItem = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n const { orientation } = useCarousel();\n\n return (\n <div\n ref={ref}\n role=\"group\"\n aria-roledescription=\"slide\"\n className={cn(\n \"min-w-0 shrink-0 grow-0 basis-full\",\n orientation === \"horizontal\" ? \"pl-4\" : \"pt-4\",\n className,\n )}\n {...props}\n />\n );\n});\nCarouselItem.displayName = \"CarouselItem\";\n\nexport interface CarouselNavProps extends Omit<ButtonProps, \"children\"> {\n /** Icon rendered inside the button. Defaults to a directional arrow. */\n icon?: React.ReactNode;\n /** Accessible name for the button. Defaults to \"Previous slide\" / \"Next slide\". */\n label?: string;\n}\n\nconst CarouselPrevious = React.forwardRef<HTMLButtonElement, CarouselNavProps>(\n (\n { className, variant = \"outline\", size = \"icon\", icon, label, ...props },\n ref,\n ) => {\n const { scrollPrev, canScrollPrev } = useCarousel();\n\n return (\n <Button\n ref={ref}\n variant={variant}\n size={size}\n className={cn(\"shrink-0 rounded-full\", className)}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n aria-label={label ?? \"Previous slide\"}\n {...props}\n >\n {icon ?? <ArrowLeft className=\"size-4\" />}\n </Button>\n );\n },\n);\nCarouselPrevious.displayName = \"CarouselPrevious\";\n\nconst CarouselNext = React.forwardRef<HTMLButtonElement, CarouselNavProps>(\n (\n { className, variant = \"outline\", size = \"icon\", icon, label, ...props },\n ref,\n ) => {\n const { scrollNext, canScrollNext } = useCarousel();\n\n return (\n <Button\n ref={ref}\n variant={variant}\n size={size}\n className={cn(\"shrink-0 rounded-full\", className)}\n disabled={!canScrollNext}\n onClick={scrollNext}\n aria-label={label ?? \"Next slide\"}\n {...props}\n >\n {icon ?? <ArrowRight className=\"size-4\" />}\n </Button>\n );\n },\n);\nCarouselNext.displayName = \"CarouselNext\";\n\nexport {\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselPrevious,\n CarouselNext,\n useCarousel,\n type CarouselApi,\n};\n","'use client';\n\nimport * as React from 'react';\nimport { Popover as PopoverPrimitive } from 'radix-ui';\nimport { cn } from '../lib/utils';\nimport { floatingAnimationClasses } from '../lib/surface-classes';\n\nconst Popover = PopoverPrimitive.Root;\nconst PopoverTrigger = PopoverPrimitive.Trigger;\n\nconst PopoverContent = React.forwardRef<\n React.ComponentRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'z-[var(--z-popover)] w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none',\n floatingAnimationClasses,\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n));\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n\nexport { Popover, PopoverTrigger, PopoverContent };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { format } from \"date-fns\";\nimport { Calendar as CalendarIcon } from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\nimport { Button } from \"./button\";\nimport { Calendar } from \"./calendar\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\";\nimport { useFieldControl } from \"../form/field-context\";\n\nexport interface DatePickerProps {\n /** The selected date */\n value?: Date;\n /** Callback when the date changes */\n onChange?: (date: Date | undefined) => void;\n /** Placeholder text when no date is selected */\n placeholder?: string;\n /** Date format string (date-fns format) */\n dateFormat?: string;\n /** Disable the date picker */\n disabled?: boolean;\n /** Additional class names for the trigger button */\n className?: string;\n /** Minimum selectable date */\n fromDate?: Date;\n /** Maximum selectable date */\n toDate?: Date;\n /** Dates that should be disabled */\n disabledDates?: Date[];\n}\n\nconst DatePicker = React.forwardRef<HTMLButtonElement, DatePickerProps>(\n (\n {\n value,\n onChange,\n placeholder = \"Pick a date\",\n dateFormat = \"PPP\",\n disabled = false,\n className,\n fromDate,\n toDate,\n disabledDates,\n },\n ref\n ) => {\n // The popover trigger is the only focusable element the field can attach\n // to, so it carries the id and the error description.\n const fieldProps = useFieldControl({});\n const [open, setOpen] = React.useState(false);\n\n const handleSelect = (date: Date | undefined) => {\n onChange?.(date);\n setOpen(false);\n };\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n ref={ref}\n variant=\"outline\"\n disabled={disabled}\n className={cn(\n \"w-full justify-start text-left font-normal\",\n !value && \"text-muted-foreground\",\n className\n )}\n {...fieldProps}\n >\n <CalendarIcon className=\"mr-2 h-4 w-4\" />\n {value ? format(value, dateFormat) : <span>{placeholder}</span>}\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0\" align=\"start\">\n <Calendar\n mode=\"single\"\n selected={value}\n onSelect={handleSelect}\n disabled={disabledDates ? disabledDates : undefined}\n startMonth={fromDate}\n endMonth={toDate}\n autoFocus\n />\n </PopoverContent>\n </Popover>\n );\n }\n);\nDatePicker.displayName = \"DatePicker\";\n\nexport { DatePicker };\n","'use client';\n\nimport * as React from 'react';\nimport { cn } from '../lib/utils';\nimport { inputSizingClasses, type InputSize } from '../lib/surface-classes';\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from './select';\nimport { FieldGroupScope, useFieldGroup } from '../form/field-context';\n\n// useLayoutEffect warns on the server; this library targets Next.js\n// consumers, so fall back to useEffect there. Matches tabs.tsx's helper.\nconst useIsomorphicLayoutEffect =\n typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\n\nexport type TimePeriod = 'AM' | 'PM';\n\n/** Curated minute-increment presets, matching this library's finite-preset philosophy. */\nexport type MinuteStep = 1 | 5 | 10 | 15 | 30;\n\nexport interface TimeParts {\n /** 1-12 */\n hour12: number;\n /** 0-59 */\n minute: number;\n period: TimePeriod;\n}\n\n/** Zero-pads a number to a 2-digit string (\"5\" → \"05\"). */\nfunction pad2(n: number): string {\n return String(n).padStart(2, '0');\n}\n\n/**\n * A segment's controlled Select value: zero-padded, or `''` when unset.\n *\n * Radix's Select.Root treats `''` as \"clear the selection and show the\n * placeholder\" (see @radix-ui/react-select's own SelectItem invariant: a\n * SelectItem's value may never be `''` for exactly this reason) while still\n * remaining fully controlled by us. Passing `undefined` instead would leave\n * Select.Root uncontrolled whenever a segment is unset, and Radix's internal\n * uncontrolled fallback state -- populated only by the user's own picks via\n * onValueChange -- does not reset just because our `value` prop returns to\n * `undefined`, so a cleared, previously-picked trigger would keep showing\n * its last value. Always passing a defined string avoids that entirely.\n */\nfunction toSegmentValue(n: number | undefined): string {\n return n === undefined ? '' : pad2(n);\n}\n\nconst HOUR_OPTIONS = Array.from({ length: 12 }, (_, i) => pad2(i + 1));\n\n/** Generates zero-padded minute option strings (\"00\", \"05\", ...) stepped by `step`. */\nexport function getMinuteOptions(step: MinuteStep): string[] {\n const options: string[] = [];\n for (let minute = 0; minute < 60; minute += step) {\n options.push(pad2(minute));\n }\n return options;\n}\n\n/** Parses a 24-hour \"HH:mm\" string into 12-hour parts. Returns {} for undefined/malformed input. */\nexport function parseTimeValue(value: string | undefined): Partial<TimeParts> {\n if (!value) return {};\n const match = /^([01]\\d|2[0-3]):([0-5]\\d)$/.exec(value);\n if (!match) return {};\n const hour24 = Number(match[1]);\n const minute = Number(match[2]);\n const period: TimePeriod = hour24 >= 12 ? 'PM' : 'AM';\n const hour12 = hour24 % 12 === 0 ? 12 : hour24 % 12;\n return { hour12, minute, period };\n}\n\n/** Formats 12-hour parts back into a 24-hour \"HH:mm\" string. */\nexport function formatTimeValue(parts: TimeParts): string {\n let hour24 = parts.hour12 % 12;\n if (parts.period === 'PM') hour24 += 12;\n return `${pad2(hour24)}:${pad2(parts.minute)}`;\n}\n\nexport interface TimePickerProps {\n /** Current time, 24-hour \"HH:mm\" format, e.g. \"14:30\" */\n value?: string;\n /** Fires only once hour, minute, and period are all selected */\n onChange?: (value: string) => void;\n /** Minute increment, restricted to a curated preset. Default: 5 */\n minuteStep?: MinuteStep;\n /** Field size. Default: \"md\" */\n size?: InputSize;\n disabled?: boolean;\n /** Placeholder text per segment. Defaults: \"HH\" / \"MM\" / \"AM\" */\n placeholder?: { hour?: string; minute?: string; period?: string };\n /** Applied to the wrapping row element */\n className?: string;\n}\n\nconst TimePicker = React.forwardRef<HTMLDivElement, TimePickerProps>(\n (\n {\n value,\n onChange,\n minuteStep = 5,\n size = 'md',\n disabled = false,\n placeholder,\n className,\n },\n ref,\n ) => {\n const groupProps = useFieldGroup();\n const [partial, setPartial] = React.useState<Partial<TimeParts>>({});\n // A `value` only counts as \"controlled\" once it fully parses — an\n // unparseable non-empty string (or \"\") is treated the same as\n // `undefined`, so segment picks still accumulate in local state instead\n // of being silently discarded just because `value` happened to be\n // truthy. `parseTimeValue` never returns a partial result (its regex\n // match sets all three fields together or none), so checking `hour12`\n // alone is a reliable proxy for \"did this value actually parse.\"\n const parsedValue = parseTimeValue(value);\n const isControlled = parsedValue.hour12 !== undefined;\n const parts = isControlled ? parsedValue : partial;\n\n // If a controlled value is cleared (or becomes unparseable) after having\n // been set, drop any stale local selection so the picker falls back to\n // placeholders instead of showing the last value it had before it\n // became controlled. useIsomorphicLayoutEffect (not useEffect) so this\n // correction lands before paint -- the transition render below already\n // computes `parts` from the stale `partial`, and running the reset after\n // paint would let that stale value flash on screen for a frame first.\n const wasControlledRef = React.useRef(isControlled);\n useIsomorphicLayoutEffect(() => {\n if (wasControlledRef.current && !isControlled) {\n setPartial({});\n }\n wasControlledRef.current = isControlled;\n }, [isControlled]);\n\n const minuteOptions = React.useMemo(() => {\n const options = getMinuteOptions(minuteStep);\n // A `value` supplied directly (not picked via this UI) may carry a\n // minute that isn't a multiple of `minuteStep` — include it so the\n // trigger reflects the true value instead of falling back to the\n // placeholder as if nothing were selected.\n if (parts.minute !== undefined) {\n const minuteStr = pad2(parts.minute);\n if (!options.includes(minuteStr)) {\n return [...options, minuteStr].sort();\n }\n }\n return options;\n }, [minuteStep, parts.minute]);\n\n function commit(next: Partial<TimeParts>) {\n if (!isControlled) {\n setPartial(next);\n }\n if (\n next.hour12 !== undefined &&\n next.minute !== undefined &&\n next.period !== undefined\n ) {\n onChange?.(\n formatTimeValue({\n hour12: next.hour12,\n minute: next.minute,\n period: next.period,\n }),\n );\n }\n }\n\n const triggerClassName = cn(inputSizingClasses(size), 'w-auto min-w-0');\n\n return (\n <div ref={ref} className={cn('flex gap-2', className)} {...groupProps}>\n {/* Three selects, each already self-labelled. FieldGroupScope stops all\n three adopting the surrounding field's single id. */}\n <FieldGroupScope>\n <Select\n disabled={disabled}\n value={toSegmentValue(parts.hour12)}\n onValueChange={(hour) => commit({ ...parts, hour12: Number(hour) })}\n >\n <SelectTrigger aria-label=\"Hour\" className={triggerClassName}>\n <SelectValue placeholder={placeholder?.hour ?? 'HH'} />\n </SelectTrigger>\n <SelectContent>\n {HOUR_OPTIONS.map((hour) => (\n <SelectItem key={hour} value={hour}>\n {hour}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n\n <Select\n disabled={disabled}\n value={toSegmentValue(parts.minute)}\n onValueChange={(minute) =>\n commit({ ...parts, minute: Number(minute) })\n }\n >\n <SelectTrigger aria-label=\"Minute\" className={triggerClassName}>\n <SelectValue placeholder={placeholder?.minute ?? 'MM'} />\n </SelectTrigger>\n <SelectContent>\n {minuteOptions.map((minute) => (\n <SelectItem key={minute} value={minute}>\n {minute}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n\n <Select\n disabled={disabled}\n value={parts.period ?? ''}\n onValueChange={(period) =>\n commit({ ...parts, period: period as TimePeriod })\n }\n >\n <SelectTrigger aria-label=\"AM or PM\" className={triggerClassName}>\n <SelectValue placeholder={placeholder?.period ?? 'AM'} />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"AM\">AM</SelectItem>\n <SelectItem value=\"PM\">PM</SelectItem>\n </SelectContent>\n </Select>\n </FieldGroupScope>\n </div>\n );\n },\n);\nTimePicker.displayName = 'TimePicker';\n\nexport { TimePicker };\n","\"use client\";\n\nimport * as React from \"react\";\nimport {\n format,\n subDays,\n startOfWeek,\n startOfMonth,\n startOfYear,\n endOfWeek,\n endOfMonth,\n subMonths,\n subYears,\n} from \"date-fns\";\nimport { Calendar as CalendarIcon, CircleX } from \"lucide-react\";\nimport type { DateRange } from \"react-day-picker\";\nimport { cn } from \"../lib/utils\";\nimport { Button } from \"./button\";\nimport { Calendar } from \"./calendar\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\";\nimport { useFieldControl } from \"../form/field-context\";\n\nexport interface DateRangePreset {\n /** Display label for the preset */\n label: string;\n /** Function that returns the date range for this preset */\n range: () => DateRange;\n}\n\n/** Built-in preset range generators */\nexport const dateRangePresets = {\n today: (): DateRangePreset => ({\n label: \"Today\",\n range: () => {\n const today = new Date();\n return { from: today, to: today };\n },\n }),\n yesterday: (): DateRangePreset => ({\n label: \"Yesterday\",\n range: () => {\n const yesterday = subDays(new Date(), 1);\n return { from: yesterday, to: yesterday };\n },\n }),\n last7Days: (): DateRangePreset => ({\n label: \"Last 7 days\",\n range: () => ({ from: subDays(new Date(), 6), to: new Date() }),\n }),\n last14Days: (): DateRangePreset => ({\n label: \"Last 14 days\",\n range: () => ({ from: subDays(new Date(), 13), to: new Date() }),\n }),\n last30Days: (): DateRangePreset => ({\n label: \"Last 30 days\",\n range: () => ({ from: subDays(new Date(), 29), to: new Date() }),\n }),\n last90Days: (): DateRangePreset => ({\n label: \"Last 90 days\",\n range: () => ({ from: subDays(new Date(), 89), to: new Date() }),\n }),\n thisWeek: (): DateRangePreset => ({\n label: \"This week\",\n range: () => ({ from: startOfWeek(new Date()), to: endOfWeek(new Date()) }),\n }),\n lastWeek: (): DateRangePreset => ({\n label: \"Last week\",\n range: () => {\n const lastWeek = subDays(new Date(), 7);\n return { from: startOfWeek(lastWeek), to: endOfWeek(lastWeek) };\n },\n }),\n thisMonth: (): DateRangePreset => ({\n label: \"This month\",\n range: () => ({\n from: startOfMonth(new Date()),\n to: endOfMonth(new Date()),\n }),\n }),\n lastMonth: (): DateRangePreset => ({\n label: \"Last month\",\n range: () => {\n const lastMonth = subMonths(new Date(), 1);\n return { from: startOfMonth(lastMonth), to: endOfMonth(lastMonth) };\n },\n }),\n thisYear: (): DateRangePreset => ({\n label: \"This year\",\n range: () => ({ from: startOfYear(new Date()), to: new Date() }),\n }),\n lastYear: (): DateRangePreset => ({\n label: \"Last year\",\n range: () => {\n const lastYear = subYears(new Date(), 1);\n return { from: startOfYear(lastYear), to: new Date() };\n },\n }),\n} as const;\n\nexport interface DateRangePickerProps {\n /** The selected date range */\n value?: DateRange;\n /** Callback when the date range changes */\n onChange?: (range: DateRange | undefined) => void;\n /** Placeholder text when no range is selected */\n placeholder?: string;\n /** Date format string (date-fns format) */\n dateFormat?: string;\n /** Disable the date range picker */\n disabled?: boolean;\n /** Additional class names for the trigger button */\n className?: string;\n /** Preset ranges to display in the sidebar */\n presets?: DateRangePreset[];\n /** Number of months to display */\n numberOfMonths?: number;\n /** Minimum selectable date */\n fromDate?: Date;\n /** Maximum selectable date */\n toDate?: Date;\n /** When true, shows an X-in-circle clear button on the right when a value is selected. Defaults to true. */\n clearable?: boolean;\n /** Accessible label for the clear button. Defaults to \"Clear date range\". */\n clearLabel?: string;\n}\n\nconst DateRangePicker = React.forwardRef<\n HTMLButtonElement,\n DateRangePickerProps\n>(\n (\n {\n value,\n onChange,\n placeholder = \"Pick a date range\",\n dateFormat = \"LLL dd, y\",\n disabled = false,\n className,\n presets,\n numberOfMonths = 2,\n fromDate,\n toDate,\n clearable = true,\n clearLabel = \"Clear date range\",\n },\n ref,\n ) => {\n // The popover trigger is the only focusable element the field can attach\n // to, so it carries the id and the error description. The clear button\n // beside it keeps its own label.\n const fieldProps = useFieldControl({});\n const [open, setOpen] = React.useState(false);\n\n const handlePresetClick = (preset: DateRangePreset) => {\n const range = preset.range();\n onChange?.(range);\n };\n\n const showClear = clearable && !disabled && Boolean(value?.from);\n\n const handleClear = (e: React.MouseEvent | React.KeyboardEvent) => {\n e.stopPropagation();\n e.preventDefault();\n onChange?.(undefined);\n };\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <div className=\"relative w-full\">\n <PopoverTrigger asChild>\n <Button\n ref={ref}\n variant=\"outline\"\n disabled={disabled}\n className={cn(\n \"w-full justify-start text-left font-normal\",\n !value && \"text-muted-foreground\",\n showClear && \"pr-9\",\n className,\n )}\n {...fieldProps}\n >\n <CalendarIcon className=\"mr-2 h-4 w-4\" />\n {value?.from ? (\n value.to ? (\n <>\n {format(value.from, dateFormat)} –{\" \"}\n {format(value.to, dateFormat)}\n </>\n ) : (\n format(value.from, dateFormat)\n )\n ) : (\n <span>{placeholder}</span>\n )}\n </Button>\n </PopoverTrigger>\n {showClear && (\n <button\n type=\"button\"\n aria-label={clearLabel}\n onClick={handleClear}\n onPointerDown={(e) => e.stopPropagation()}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n handleClear(e);\n }\n }}\n className=\"absolute right-2 top-1/2 -translate-y-1/2 rounded-full text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1\"\n >\n <CircleX className=\"h-4 w-4\" />\n </button>\n )}\n </div>\n <PopoverContent className=\"w-auto p-0\" align=\"start\">\n <div\n className={cn(\"flex\", presets && presets.length > 0 && \"flex-row\")}\n >\n {presets && presets.length > 0 && (\n <div className=\"flex flex-col gap-1 border-r p-3 min-w-[160px]\">\n <p className=\"mb-1 text-xs font-medium text-muted-foreground\">\n Quick select\n </p>\n {presets.map((preset) => (\n <Button\n key={preset.label}\n variant=\"ghost\"\n size=\"sm\"\n className=\"justify-start text-left text-sm font-normal\"\n onClick={() => handlePresetClick(preset)}\n >\n {preset.label}\n </Button>\n ))}\n </div>\n )}\n <div>\n <Calendar\n mode=\"range\"\n defaultMonth={value?.from}\n selected={value}\n onSelect={onChange}\n numberOfMonths={numberOfMonths}\n startMonth={fromDate}\n endMonth={toDate}\n autoFocus\n />\n </div>\n </div>\n </PopoverContent>\n </Popover>\n );\n },\n);\nDateRangePicker.displayName = \"DateRangePicker\";\n\nexport { DateRangePicker };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Separator as SeparatorPrimitive } from \"radix-ui\";\nimport { cn } from \"../lib/utils\";\n\nconst Separator = React.forwardRef<\n React.ComponentRef<typeof SeparatorPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(({ className, orientation = \"horizontal\", decorative = true, ...props }, ref) => (\n <SeparatorPrimitive.Root\n ref={ref}\n decorative={decorative}\n orientation={orientation}\n className={cn(\n \"shrink-0 bg-border\",\n orientation === \"horizontal\" ? \"h-[1px] w-full\" : \"h-full w-[1px]\",\n className\n )}\n {...props}\n />\n));\nSeparator.displayName = SeparatorPrimitive.Root.displayName;\n\nexport { Separator };\n","'use client';\n\nimport * as React from 'react';\nimport { Tooltip as TooltipPrimitive } from 'radix-ui';\nimport { cn } from '../lib/utils';\nimport { tooltipAnimationClasses } from '../lib/surface-classes';\n\nconst TooltipProvider = TooltipPrimitive.Provider;\nconst Tooltip = TooltipPrimitive.Root;\nconst TooltipTrigger = TooltipPrimitive.Trigger;\n\nconst TooltipContent = React.forwardRef<\n React.ComponentRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'z-[var(--z-tooltip)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md',\n tooltipAnimationClasses,\n className,\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { useEditor, EditorContent, type Editor } from \"@tiptap/react\";\nimport StarterKit from \"@tiptap/starter-kit\";\nimport Placeholder from \"@tiptap/extension-placeholder\";\nimport Link from \"@tiptap/extension-link\";\nimport Underline from \"@tiptap/extension-underline\";\nimport TextAlign from \"@tiptap/extension-text-align\";\nimport {\n AlignCenter,\n AlignLeft,\n AlignRight,\n Bold,\n Code,\n Heading1,\n Heading2,\n Heading3,\n Italic,\n Link as LinkIcon,\n List,\n ListOrdered,\n Minus,\n Quote,\n Redo,\n Strikethrough,\n Underline as UnderlineIcon,\n Undo,\n Unlink,\n} from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\nimport { Button } from \"./button\";\nimport { Separator } from \"./separator\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from \"./tooltip\";\n\nexport interface TextEditorProps {\n /** The HTML content of the editor */\n value?: string;\n /** Callback when content changes (returns HTML) */\n onChange?: (html: string) => void;\n /** Placeholder text */\n placeholder?: string;\n /** Disable the editor */\n disabled?: boolean;\n /** Additional class names for the outer wrapper */\n className?: string;\n /** Additional class names for the editor content area */\n contentClassName?: string;\n /** Minimum height of the editor content area */\n minHeight?: string;\n /** Hide the toolbar */\n hideToolbar?: boolean;\n /** Toolbar features to show. Defaults to all. */\n toolbar?: Array<\n | \"bold\"\n | \"italic\"\n | \"underline\"\n | \"strike\"\n | \"code\"\n | \"heading\"\n | \"bulletList\"\n | \"orderedList\"\n | \"blockquote\"\n | \"horizontalRule\"\n | \"link\"\n | \"align\"\n | \"undo\"\n | \"redo\"\n >;\n /** Called when the editor is created */\n onEditorReady?: (editor: Editor) => void;\n}\n\ninterface ToolbarButtonProps {\n onClick: () => void;\n isActive?: boolean;\n disabled?: boolean;\n tooltip: string;\n children: React.ReactNode;\n}\n\nconst ToolbarButton = ({\n onClick,\n isActive,\n disabled,\n tooltip,\n children,\n}: ToolbarButtonProps) => (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n disabled={disabled}\n className={cn(\n \"h-8 w-8 p-0\",\n isActive && \"bg-accent text-accent-foreground\",\n )}\n onClick={onClick}\n >\n {children}\n </Button>\n </TooltipTrigger>\n <TooltipContent side=\"bottom\">\n <p className=\"text-xs\">{tooltip}</p>\n </TooltipContent>\n </Tooltip>\n);\n\nconst defaultToolbar: TextEditorProps[\"toolbar\"] = [\n \"bold\",\n \"italic\",\n \"underline\",\n \"strike\",\n \"code\",\n \"heading\",\n \"bulletList\",\n \"orderedList\",\n \"blockquote\",\n \"horizontalRule\",\n \"link\",\n \"align\",\n \"undo\",\n \"redo\",\n];\n\nconst EditorToolbar = ({\n editor,\n toolbar = defaultToolbar,\n}: {\n editor: Editor;\n toolbar?: TextEditorProps[\"toolbar\"];\n}) => {\n const has = (feature: string) => toolbar?.includes(feature as never) ?? false;\n\n const handleLink = () => {\n if (editor.isActive(\"link\")) {\n editor.chain().focus().unsetLink().run();\n return;\n }\n const url = window.prompt(\"Enter URL:\");\n if (url) {\n editor\n .chain()\n .focus()\n .extendMarkRange(\"link\")\n .setLink({ href: url })\n .run();\n }\n };\n\n return (\n <TooltipProvider delayDuration={300}>\n <div className=\"flex flex-wrap items-center gap-0.5 border-b px-2 py-1\">\n {has(\"bold\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleBold().run()}\n isActive={editor.isActive(\"bold\")}\n tooltip=\"Bold\"\n >\n <Bold className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"italic\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleItalic().run()}\n isActive={editor.isActive(\"italic\")}\n tooltip=\"Italic\"\n >\n <Italic className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"underline\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleUnderline().run()}\n isActive={editor.isActive(\"underline\")}\n tooltip=\"Underline\"\n >\n <UnderlineIcon className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"strike\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleStrike().run()}\n isActive={editor.isActive(\"strike\")}\n tooltip=\"Strikethrough\"\n >\n <Strikethrough className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"code\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleCode().run()}\n isActive={editor.isActive(\"code\")}\n tooltip=\"Code\"\n >\n <Code className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n\n {(has(\"bold\") ||\n has(\"italic\") ||\n has(\"underline\") ||\n has(\"strike\") ||\n has(\"code\")) &&\n (has(\"heading\") ||\n has(\"bulletList\") ||\n has(\"orderedList\") ||\n has(\"blockquote\")) && (\n <Separator orientation=\"vertical\" className=\"mx-1 h-6\" />\n )}\n\n {has(\"heading\") && (\n <>\n <ToolbarButton\n onClick={() =>\n editor.chain().focus().toggleHeading({ level: 1 }).run()\n }\n isActive={editor.isActive(\"heading\", { level: 1 })}\n tooltip=\"Heading 1\"\n >\n <Heading1 className=\"h-4 w-4\" />\n </ToolbarButton>\n <ToolbarButton\n onClick={() =>\n editor.chain().focus().toggleHeading({ level: 2 }).run()\n }\n isActive={editor.isActive(\"heading\", { level: 2 })}\n tooltip=\"Heading 2\"\n >\n <Heading2 className=\"h-4 w-4\" />\n </ToolbarButton>\n <ToolbarButton\n onClick={() =>\n editor.chain().focus().toggleHeading({ level: 3 }).run()\n }\n isActive={editor.isActive(\"heading\", { level: 3 })}\n tooltip=\"Heading 3\"\n >\n <Heading3 className=\"h-4 w-4\" />\n </ToolbarButton>\n </>\n )}\n\n {has(\"bulletList\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleBulletList().run()}\n isActive={editor.isActive(\"bulletList\")}\n tooltip=\"Bullet list\"\n >\n <List className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"orderedList\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleOrderedList().run()}\n isActive={editor.isActive(\"orderedList\")}\n tooltip=\"Ordered list\"\n >\n <ListOrdered className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"blockquote\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleBlockquote().run()}\n isActive={editor.isActive(\"blockquote\")}\n tooltip=\"Blockquote\"\n >\n <Quote className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"horizontalRule\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().setHorizontalRule().run()}\n tooltip=\"Horizontal rule\"\n >\n <Minus className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n\n {(has(\"heading\") ||\n has(\"bulletList\") ||\n has(\"orderedList\") ||\n has(\"blockquote\")) &&\n (has(\"link\") || has(\"align\")) && (\n <Separator orientation=\"vertical\" className=\"mx-1 h-6\" />\n )}\n\n {has(\"link\") && (\n <ToolbarButton\n onClick={handleLink}\n isActive={editor.isActive(\"link\")}\n tooltip={editor.isActive(\"link\") ? \"Remove link\" : \"Add link\"}\n >\n {editor.isActive(\"link\") ? (\n <Unlink className=\"h-4 w-4\" />\n ) : (\n <LinkIcon className=\"h-4 w-4\" />\n )}\n </ToolbarButton>\n )}\n\n {has(\"align\") && (\n <>\n <ToolbarButton\n onClick={() => editor.chain().focus().setTextAlign(\"left\").run()}\n isActive={editor.isActive({ textAlign: \"left\" })}\n tooltip=\"Align left\"\n >\n <AlignLeft className=\"h-4 w-4\" />\n </ToolbarButton>\n <ToolbarButton\n onClick={() =>\n editor.chain().focus().setTextAlign(\"center\").run()\n }\n isActive={editor.isActive({ textAlign: \"center\" })}\n tooltip=\"Align center\"\n >\n <AlignCenter className=\"h-4 w-4\" />\n </ToolbarButton>\n <ToolbarButton\n onClick={() => editor.chain().focus().setTextAlign(\"right\").run()}\n isActive={editor.isActive({ textAlign: \"right\" })}\n tooltip=\"Align right\"\n >\n <AlignRight className=\"h-4 w-4\" />\n </ToolbarButton>\n </>\n )}\n\n {(has(\"link\") || has(\"align\")) && (has(\"undo\") || has(\"redo\")) && (\n <Separator orientation=\"vertical\" className=\"mx-1 h-6\" />\n )}\n\n {has(\"undo\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().undo().run()}\n disabled={!editor.can().undo()}\n tooltip=\"Undo\"\n >\n <Undo className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"redo\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().redo().run()}\n disabled={!editor.can().redo()}\n tooltip=\"Redo\"\n >\n <Redo className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n </div>\n </TooltipProvider>\n );\n};\n\nconst TextEditor = React.forwardRef<HTMLDivElement, TextEditorProps>(\n (\n {\n value,\n onChange,\n placeholder = \"Start writing...\",\n disabled = false,\n className,\n contentClassName,\n minHeight = \"150px\",\n hideToolbar = false,\n toolbar = defaultToolbar,\n onEditorReady,\n },\n ref,\n ) => {\n const editor = useEditor({\n immediatelyRender: false,\n extensions: [\n StarterKit.configure({\n heading: { levels: [1, 2, 3] },\n }),\n Placeholder.configure({ placeholder }),\n Underline,\n Link.configure({\n openOnClick: false,\n HTMLAttributes: {\n class: \"text-primary underline underline-offset-4 cursor-pointer\",\n },\n }),\n TextAlign.configure({\n types: [\"heading\", \"paragraph\"],\n }),\n ],\n content: value,\n editable: !disabled,\n onUpdate: ({ editor: e }) => {\n onChange?.(e.getHTML());\n },\n onCreate: ({ editor: e }) => {\n onEditorReady?.(e);\n },\n });\n\n React.useEffect(() => {\n if (editor && disabled !== undefined) {\n editor.setEditable(!disabled);\n }\n }, [editor, disabled]);\n\n React.useEffect(() => {\n if (editor && value !== undefined && editor.getHTML() !== value) {\n editor.commands.setContent(value);\n }\n }, [editor, value]);\n\n if (!editor) {\n return null;\n }\n\n return (\n <div\n ref={ref}\n className={cn(\n \"rounded-md border border-input bg-background ring-offset-background focus-within:border-primary focus-within:ring-2 focus-within:ring-primary/30 focus-within:ring-offset-0\",\n disabled && \"cursor-not-allowed opacity-50\",\n className,\n )}\n >\n {!hideToolbar && <EditorToolbar editor={editor} toolbar={toolbar} />}\n <EditorContent\n editor={editor}\n className={cn(\n \"prose prose-base sm:prose-sm dark:prose-invert max-w-none px-3 py-2 focus:outline-none [&_.tiptap]:outline-none [&_.tiptap.ProseMirror]:outline-none\",\n `[&_.tiptap]:min-h-[${minHeight}]`,\n \"[&_.tiptap_p.is-editor-empty:first-child::before]:text-muted-foreground [&_.tiptap_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)] [&_.tiptap_p.is-editor-empty:first-child::before]:float-left [&_.tiptap_p.is-editor-empty:first-child::before]:h-0 [&_.tiptap_p.is-editor-empty:first-child::before]:pointer-events-none\",\n contentClassName,\n )}\n style={{ minHeight }}\n />\n </div>\n );\n },\n);\nTextEditor.displayName = \"TextEditor\";\n\nexport { TextEditor };\nexport type { Editor };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../lib/utils\";\n\nexport interface TextContentProps extends React.HTMLAttributes<HTMLDivElement> {\n /** The HTML content to render (from TextEditor output) */\n content: string;\n}\n\nconst TextContent = React.forwardRef<HTMLDivElement, TextContentProps>(\n ({ content, className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"prose prose-sm dark:prose-invert max-w-none\",\n \"prose-headings:font-heading prose-headings:tracking-tight\",\n \"prose-a:text-primary prose-a:underline prose-a:underline-offset-4\",\n \"prose-blockquote:border-l-primary\",\n \"prose-code:rounded prose-code:bg-muted prose-code:px-1.5 prose-code:py-0.5 prose-code:text-sm prose-code:font-mono\",\n \"prose-pre:bg-muted prose-pre:rounded-md\",\n \"prose-hr:border-border\",\n className\n )}\n dangerouslySetInnerHTML={{ __html: content }}\n {...props}\n />\n );\n }\n);\nTextContent.displayName = \"TextContent\";\n\nexport { TextContent };\n","'use client';\n\nimport * as React from 'react';\nimport { Checkbox as CheckboxPrimitive } from 'radix-ui';\nimport { coarseHitAreaClasses } from '../lib/surface-classes';\nimport { cn } from '../lib/utils';\nimport { useFieldControl } from '../form/field-context';\n\nfunction CheckIcon({ className }: { className?: string }) {\n return (\n <svg\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={cn('shrink-0', className)}\n aria-hidden\n >\n <path\n d=\"M2.5 6.25 5 8.75 9.5 3.25\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction IndeterminateIcon({ className }: { className?: string }) {\n return (\n <svg\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={cn('shrink-0', className)}\n aria-hidden\n >\n <path\n d=\"M2.5 6h7\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n />\n </svg>\n );\n}\n\nconst Checkbox = React.forwardRef<\n React.ComponentRef<typeof CheckboxPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>\n>(({ className, checked, ...props }, ref) => {\n // Adopts the surrounding field's wiring when it labels this ONE checkbox.\n // Inside `FormField as=\"group\"` it returns props untouched, so five boxes in\n // a set keep their own ids and the fieldset does the labelling.\n const fieldProps = useFieldControl(props);\n\n return (\n <CheckboxPrimitive.Root\n ref={ref}\n checked={checked}\n className={cn(\n 'peer h-4 w-4 shrink-0 cursor-pointer rounded-[2px] border border-primary bg-background ring-offset-background transition-[color,background-color,border-color] duration-fast ease-default focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary/35 focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground',\n coarseHitAreaClasses,\n className,\n )}\n {...fieldProps}\n >\n <CheckboxPrimitive.Indicator\n className={cn(\n 'flex h-full w-full items-center justify-center text-current',\n )}\n >\n {checked === 'indeterminate' ? (\n <IndeterminateIcon className=\"h-[10px] w-[10px]\" />\n ) : (\n <CheckIcon className=\"h-[10px] w-[10px]\" />\n )}\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n});\nCheckbox.displayName = CheckboxPrimitive.Root.displayName;\n\nexport { Checkbox };\n","'use client';\n\nimport * as React from 'react';\nimport { RadioGroup as RadioGroupPrimitive } from 'radix-ui';\nimport { coarseHitAreaClasses } from '../lib/surface-classes';\nimport { cn } from '../lib/utils';\nimport { useFieldControl } from '../form/field-context';\n\nconst RadioGroup = React.forwardRef<\n React.ComponentRef<typeof RadioGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>\n>(({ className, ...props }, ref) => {\n // The Root already carries role=\"radiogroup\", so a plain `FormField` can\n // describe it directly. Wrapping it in `FormField as=\"group\"` instead gives a\n // real fieldset/legend and makes this a no-op — both are correct, and which\n // one to reach for is a labelling question, not an ARIA one.\n const fieldProps = useFieldControl(props);\n\n return (\n <RadioGroupPrimitive.Root\n className={cn('grid gap-2', className)}\n {...fieldProps}\n ref={ref}\n />\n );\n});\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName;\n\nconst RadioGroupItem = React.forwardRef<\n React.ComponentRef<typeof RadioGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(\n 'inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full border border-primary bg-background text-primary ring-offset-background focus:outline-none focus-visible:ring-1 focus-visible:ring-primary/35 focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary',\n coarseHitAreaClasses,\n className,\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"flex h-full w-full items-center justify-center\">\n <span\n aria-hidden\n className=\"block h-2 w-2 rounded-full bg-current\"\n />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n));\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;\n\nexport { RadioGroup, RadioGroupItem };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Switch as SwitchPrimitives } from \"radix-ui\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { coarseHitAreaClasses } from \"../lib/surface-classes\";\nimport { cn } from \"../lib/utils\";\nimport { useFieldControl } from \"../form/field-context\";\n\nconst switchVariants = cva(\n \"peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors duration-fast ease-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input\",\n {\n variants: {\n size: {\n sm: \"h-5 w-9\",\n md: \"h-6 w-11\",\n lg: \"h-7 w-14\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n);\n\n// Thumb size + checked translate are paired to each track so the thumb slides\n// exactly to the far edge (translate = track inner width − thumb width).\nconst switchThumbVariants = cva(\n \"pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform duration-fast ease-default data-[state=unchecked]:translate-x-0\",\n {\n variants: {\n size: {\n sm: \"h-4 w-4 data-[state=checked]:translate-x-4\",\n md: \"h-5 w-5 data-[state=checked]:translate-x-5\",\n lg: \"h-6 w-6 data-[state=checked]:translate-x-7\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n);\n\nexport interface SwitchProps\n extends React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>,\n VariantProps<typeof switchVariants> {}\n\nconst Switch = React.forwardRef<React.ComponentRef<typeof SwitchPrimitives.Root>, SwitchProps>(\n ({ className, size, ...props }, ref) => {\n // Adopts the surrounding field's id and ARIA wiring; a no-op outside one.\n const fieldProps = useFieldControl(props);\n\n return (\n <SwitchPrimitives.Root\n className={cn(switchVariants({ size }), coarseHitAreaClasses, className)}\n {...fieldProps}\n ref={ref}\n >\n <SwitchPrimitives.Thumb className={cn(switchThumbVariants({ size }))} />\n </SwitchPrimitives.Root>\n );\n },\n);\nSwitch.displayName = SwitchPrimitives.Root.displayName;\n\nexport { Switch, switchVariants };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Slider as SliderPrimitive } from \"radix-ui\";\nimport { coarseHitAreaClasses } from \"../lib/surface-classes\";\nimport { cn } from \"../lib/utils\";\nimport { useFieldControl } from \"../form/field-context\";\n\nconst Slider = React.forwardRef<\n React.ComponentRef<typeof SliderPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>\n>(({ className, ...props }, ref) => {\n // The Thumb is the element carrying role=\"slider\" and taking focus, so the\n // field's id and description belong on it — on the Root they would name a\n // wrapper the user can never land on.\n const {\n id,\n \"aria-describedby\": describedBy,\n \"aria-invalid\": invalid,\n \"aria-required\": ariaRequired,\n ...rootProps\n } = useFieldControl(props);\n\n return (\n <SliderPrimitive.Root\n ref={ref}\n className={cn(\n \"relative flex w-full touch-none select-none items-center\",\n className,\n )}\n {...rootProps}\n >\n <SliderPrimitive.Track className=\"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary\">\n <SliderPrimitive.Range className=\"absolute h-full bg-primary\" />\n </SliderPrimitive.Track>\n <SliderPrimitive.Thumb\n id={id}\n aria-describedby={describedBy}\n aria-invalid={invalid}\n aria-required={ariaRequired}\n className={cn(\n \"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n coarseHitAreaClasses,\n )}\n />\n </SliderPrimitive.Root>\n );\n});\nSlider.displayName = SliderPrimitive.Root.displayName;\n\nexport { Slider };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../lib/utils\";\n\nconst Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"rounded-lg border bg-card text-card-foreground shadow-sm\", className)}\n {...props}\n />\n )\n);\nCard.displayName = \"Card\";\n\nconst CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex flex-col space-y-1.5 p-[var(--density-padding-xl)]\", className)}\n {...props}\n />\n )\n);\nCardHeader.displayName = \"CardHeader\";\n\nconst CardTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(\n ({ className, ...props }, ref) => (\n <h3\n ref={ref}\n className={cn(\"text-2xl font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n )\n);\nCardTitle.displayName = \"CardTitle\";\n\nconst CardDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(\n ({ className, ...props }, ref) => (\n <p ref={ref} className={cn(\"text-sm text-muted-foreground\", className)} {...props} />\n )\n);\nCardDescription.displayName = \"CardDescription\";\n\nconst CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"p-[var(--density-padding-xl)] pt-0\", className)} {...props} />\n )\n);\nCardContent.displayName = \"CardContent\";\n\nconst CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex items-center p-[var(--density-padding-xl)] pt-0\", className)}\n {...props}\n />\n )\n);\nCardFooter.displayName = \"CardFooter\";\n\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };\n","'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n CircleAlert,\n CircleCheck,\n Info,\n ShieldAlert,\n TriangleAlert,\n X,\n} from 'lucide-react';\nimport { cn } from '../lib/utils';\n\nconst alertVariants = cva(\n 'flex w-full items-start gap-3 rounded-[var(--radius-md)] border p-4 text-sm',\n {\n variants: {\n variant: {\n default:\n 'bg-muted/50 text-foreground border-border [&_[data-alert-icon]]:text-muted-foreground dark:bg-muted/30 dark:border-border-strong',\n destructive:\n 'border-destructive-300 bg-destructive-50 text-destructive-900 [&_[data-alert-icon]]:text-destructive-600 dark:border-destructive-700 dark:bg-destructive-900/60 dark:text-destructive-100 dark:[&_[data-alert-icon]]:text-destructive-300',\n success:\n 'border-success-300 bg-success-50 text-success-900 [&_[data-alert-icon]]:text-success-600 dark:border-success-700 dark:bg-success-900/60 dark:text-success-100 dark:[&_[data-alert-icon]]:text-success-300',\n warning:\n 'border-warning-300 bg-warning-50 text-warning-900 [&_[data-alert-icon]]:text-warning-600 dark:border-warning-700 dark:bg-warning-900/60 dark:text-warning-100 dark:[&_[data-alert-icon]]:text-warning-300',\n /**\n * @deprecated Use `variant=\"destructive\"` instead — `danger` is a\n * visual duplicate and will be removed in a future major release.\n */\n danger:\n 'border-destructive-300 bg-destructive-50 text-destructive-900 [&_[data-alert-icon]]:text-destructive-600 dark:border-destructive-700 dark:bg-destructive-900/60 dark:text-destructive-100 dark:[&_[data-alert-icon]]:text-destructive-300',\n info: 'border-primary-300 bg-primary-50 text-primary-900 [&_[data-alert-icon]]:text-primary-600 dark:border-primary-700 dark:bg-primary-900/60 dark:text-primary-100 dark:[&_[data-alert-icon]]:text-primary-300',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n },\n);\n\nconst defaultIcons: Record<string, React.ReactNode> = {\n default: <Info className=\"size-4\" />,\n destructive: <ShieldAlert className=\"size-4\" />,\n success: <CircleCheck className=\"size-4\" />,\n warning: <TriangleAlert className=\"size-4\" />,\n danger: <CircleAlert className=\"size-4\" />,\n info: <Info className=\"size-4\" />,\n};\n\nexport interface AlertProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof alertVariants> {\n /**\n * Whether to render a leading icon. When `true` and no `icon` is provided,\n * the variant's built-in default icon is rendered. Defaults to `false`.\n */\n showIcon?: boolean;\n /**\n * Renders any React node as the leading icon (e.g. `<FontAwesomeIcon … />`,\n * a Lucide icon, or an inline SVG). When set, this takes precedence over\n * `showIcon` and replaces the default icon entirely.\n */\n icon?: React.ReactNode;\n /** Whether the alert can be dismissed. Defaults to `false`. */\n dismissable?: boolean;\n /** Callback fired when the dismiss button is clicked. */\n onDismiss?: () => void;\n}\n\nconst Alert = React.forwardRef<HTMLDivElement, AlertProps>(\n (\n {\n className,\n variant = 'default',\n showIcon = false,\n icon,\n dismissable = false,\n onDismiss,\n children,\n ...props\n },\n ref,\n ) => {\n const [dismissed, setDismissed] = React.useState(false);\n\n if (dismissed) return null;\n\n const resolvedIcon =\n icon ?? (showIcon ? defaultIcons[variant ?? 'default'] : null);\n\n const leading = resolvedIcon ? (\n <span\n className=\"mt-0.5 inline-flex shrink-0 [&_svg]:shrink-0\"\n data-alert-icon=\"\"\n aria-hidden\n >\n {resolvedIcon}\n </span>\n ) : null;\n\n const handleDismiss = () => {\n setDismissed(true);\n onDismiss?.();\n };\n\n return (\n <div\n ref={ref}\n role=\"alert\"\n className={cn(alertVariants({ variant }), 'min-w-0', className)}\n {...props}\n >\n {leading}\n <div className=\"min-w-0 flex-1\">{children}</div>\n {dismissable ? (\n <button\n type=\"button\"\n onClick={handleDismiss}\n className=\"shrink-0 self-start rounded-[var(--radius-sm)] p-1.5 opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:ring-offset-2\"\n aria-label=\"Dismiss\"\n >\n <X className=\"size-4\" />\n </button>\n ) : null}\n </div>\n );\n },\n);\nAlert.displayName = 'Alert';\n\nconst AlertTitle = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h5\n ref={ref}\n className={cn('mb-1 font-medium leading-none tracking-tight', className)}\n {...props}\n />\n));\nAlertTitle.displayName = 'AlertTitle';\n\nconst AlertDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('text-sm [&_p]:leading-relaxed', className)}\n {...props}\n />\n));\nAlertDescription.displayName = 'AlertDescription';\n\nexport { Alert, AlertTitle, AlertDescription, alertVariants };\n","/**\n * Soft semantic tints — used for status indicators (badges, callouts) where\n * the element is informational/passive (not an interactive tile or button).\n *\n * Pattern: `border-{color}-500/30 bg-{color}-500/10 text-{color}-700`\n * with dark-mode shifts to `*-400` shades. Yields a subtle, non-clickable\n * \"I am a {success|warning|error|info} indicator\" look.\n *\n * Distinct from `semantic-action-tones.ts`:\n * - Action tones (positive/negative): brighter, clickable tile look\n * (`bg-X-100 + border-X-200/0.9 + text-X-600 + shadow-sm`). Used by Button.\n * - Tint tones (here): subtler, indicator look. Used by Badge.\n *\n * If you find yourself reaching for \"soft semantic background\" — interactive\n * → use action tones; passive → use these.\n */\n\nexport const tintToneSuccess =\n 'border-success-500/30 bg-success-500/10 text-success-700 dark:border-success-400/30 dark:bg-success-400/10 dark:text-success-400';\n\nexport const tintToneWarning =\n 'border-warning-500/30 bg-warning-500/10 text-warning-700 dark:border-warning-400/30 dark:bg-warning-400/10 dark:text-warning-400';\n\nexport const tintToneDestructive =\n 'border-destructive-500/30 bg-destructive-500/10 text-destructive-700 dark:border-destructive-400/30 dark:bg-destructive-400/10 dark:text-destructive-400';\n\nexport const tintToneInfo =\n 'border-primary-500/30 bg-primary-500/10 text-primary-700 dark:border-primary-400/30 dark:bg-primary-400/10 dark:text-primary-400';\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../lib/utils\";\nimport {\n tintToneDestructive,\n tintToneInfo,\n tintToneSuccess,\n tintToneWarning,\n} from \"../lib/semantic-tint-tones\";\n\nconst badgeVariants = cva(\n \"inline-flex h-6 items-center justify-center rounded-md border px-2.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-primary/40 focus:ring-offset-2\",\n {\n variants: {\n variant: {\n default:\n \"border-border bg-muted text-muted-foreground hover:bg-muted/80\",\n secondary:\n \"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary-700\",\n accent:\n \"border-transparent bg-brand-accent text-brand-accent-foreground hover:bg-brand-accent-600\",\n highlight:\n \"border-transparent bg-highlight text-highlight-foreground hover:bg-highlight-600\",\n destructive:\n \"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive-700\",\n outline: \"text-foreground\",\n success: tintToneSuccess,\n warning: tintToneWarning,\n error: tintToneDestructive,\n info: tintToneInfo,\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nexport interface BadgeProps\n extends\n React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof badgeVariants> {}\n\nfunction Badge({ className, variant, ...props }: BadgeProps) {\n return (\n <div className={cn(badgeVariants({ variant }), className)} {...props} />\n );\n}\n\nexport { Badge, badgeVariants };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../lib/utils\";\n\nconst DEFAULT_SIZE = 160;\nconst DEFAULT_DURATION = 26;\nconst REPEAT_COUNT = 4;\nconst DEFAULT_DIVIDER = \"•\";\nconst VIEWBOX = 200;\n\nexport interface RotatingBadgeProps\n extends React.HTMLAttributes<HTMLDivElement> {\n /** Rim copy. Do not include the divider; it is inserted between repeats. */\n text: string;\n /** Center mark. Pass an `img`, Next.js `Image`, or inline SVG. */\n image: React.ReactNode;\n /**\n * Character or short string placed between repeats. Spaces are added on\n * both sides; do not pad this value. Defaults to `\"•\"`.\n */\n divider?: string;\n /** Diameter in pixels. Defaults to 160; scale with this, not a wrapper transform. */\n size?: number;\n /** Seconds for one full rotation. Defaults to 26. */\n duration?: number;\n /** Extra classes on the center-mark wrapper. */\n imageClassName?: string;\n /** Draw a full-bleed hairline through the vertical center, masked around the seal. */\n rule?: boolean;\n /** Extra classes on the hairline (color, opacity). Defaults to `bg-border`. */\n ruleClassName?: string;\n}\n\nfunction ringChars(text: string, divider: string): string[] {\n return Array.from(`${text} ${divider} `.repeat(REPEAT_COUNT));\n}\n\nfunction renderChar(char: string): string {\n // SVG collapses a plain space when it is the entire text content of an element.\n return char === \" \" ? \"\\u00a0\" : char;\n}\n\n/**\n * A circular seal: a consumer-supplied center mark with rim copy on a slow\n * continuous spin (paused for `prefers-reduced-motion`). Purely presentational.\n */\nconst RotatingBadge = React.forwardRef<HTMLDivElement, RotatingBadgeProps>(\n (\n {\n text,\n image,\n divider = DEFAULT_DIVIDER,\n size = DEFAULT_SIZE,\n duration = DEFAULT_DURATION,\n className,\n imageClassName,\n rule = false,\n ruleClassName,\n style,\n ...props\n },\n ref,\n ) => {\n const chars = React.useMemo(() => ringChars(text, divider), [text, divider]);\n const step = 360 / chars.length;\n const clearRadius = size / 2 + 60;\n const fadeWidth = 20;\n const maskImage = `linear-gradient(to right, black 0, black calc(50% - ${clearRadius}px), transparent calc(50% - ${clearRadius - fadeWidth}px), transparent calc(50% + ${clearRadius - fadeWidth}px), black calc(50% + ${clearRadius}px), black 100%)`;\n\n return (\n <div\n ref={ref}\n className={cn(\n \"relative flex shrink-0 items-center justify-center rounded-full font-bold\",\n className,\n )}\n style={{ width: size, height: size, ...style }}\n {...props}\n >\n {rule ? (\n <div\n aria-hidden\n className={cn(\n \"pointer-events-none absolute top-1/2 left-1/2 h-px w-screen -translate-x-1/2 -translate-y-1/2 bg-border opacity-80\",\n ruleClassName,\n )}\n style={{ maskImage, WebkitMaskImage: maskImage }}\n />\n ) : null}\n\n <svg\n viewBox={`0 0 ${VIEWBOX} ${VIEWBOX}`}\n aria-hidden\n className=\"absolute inset-0 size-full origin-center animate-spin fill-current motion-reduce:animate-none [font-family:inherit] [font-weight:inherit]\"\n style={{\n animationDuration: `${duration}s`,\n animationTimingFunction: \"linear\",\n }}\n >\n {chars.map((char, i) => (\n <text\n key={i}\n x={VIEWBOX / 2}\n y={18}\n textAnchor=\"middle\"\n fontSize={14}\n fill=\"currentColor\"\n transform={`rotate(${-90 + i * step} ${VIEWBOX / 2} ${VIEWBOX / 2})`}\n >\n {renderChar(char)}\n </text>\n ))}\n </svg>\n\n <div\n className={cn(\n \"relative z-10 flex items-center justify-center [&_img]:block [&_img]:h-auto [&_img]:w-full [&_svg]:h-auto [&_svg]:w-full\",\n imageClassName,\n )}\n style={{ width: size * 0.34 }}\n >\n {image}\n </div>\n </div>\n );\n },\n);\nRotatingBadge.displayName = \"RotatingBadge\";\n\nexport { RotatingBadge };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Avatar as AvatarPrimitive } from \"radix-ui\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../lib/utils\";\n\nconst avatarVariants = cva(\n \"relative flex h-10 w-10 shrink-0\",\n {\n variants: {\n shape: {\n circle: \"rounded-full\",\n rounded: \"rounded-2xl\",\n square: \"rounded-lg\",\n },\n },\n defaultVariants: {\n shape: \"circle\",\n },\n }\n);\n\ninterface AvatarProps\n extends React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>,\n VariantProps<typeof avatarVariants> {\n /**\n * Clip content to the avatar shape. Defaults to `true`. Set `false` to let an\n * overlay that a source bakes into the image extend past the shape — e.g. a\n * Google \"Local Guide\" star badge composited into the corner of a profile\n * photo, which a circular clip would otherwise cut off.\n */\n clip?: boolean;\n}\n\nconst Avatar = React.forwardRef<\n React.ComponentRef<typeof AvatarPrimitive.Root>,\n AvatarProps\n>(({ className, shape, clip = true, ...props }, ref) => (\n <AvatarPrimitive.Root\n ref={ref}\n className={cn(\n avatarVariants({ shape }),\n clip ? \"overflow-hidden\" : \"overflow-visible\",\n className,\n )}\n {...props}\n />\n));\nAvatar.displayName = AvatarPrimitive.Root.displayName;\n\nconst AvatarImage = React.forwardRef<\n React.ComponentRef<typeof AvatarPrimitive.Image>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Image ref={ref} className={cn(\"aspect-square h-full w-full\", className)} {...props} />\n));\nAvatarImage.displayName = AvatarPrimitive.Image.displayName;\n\nconst AvatarFallback = React.forwardRef<\n React.ComponentRef<typeof AvatarPrimitive.Fallback>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Fallback\n ref={ref}\n className={cn(\"flex h-full w-full items-center justify-center rounded-full bg-muted\", className)}\n {...props}\n />\n));\nAvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;\n\nexport { Avatar, AvatarImage, AvatarFallback, avatarVariants };\nexport type { AvatarProps };\n","'use client';\n\nimport * as React from 'react';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\nimport { X } from 'lucide-react';\nimport { cn } from '../lib/utils';\nimport {\n centeredModalContentClasses,\n overlayScrimClasses,\n touchTargetClasses,\n} from '../lib/surface-classes';\n\nconst Dialog = DialogPrimitive.Root;\nconst DialogTrigger = DialogPrimitive.Trigger;\nconst DialogPortal = DialogPrimitive.Portal;\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(overlayScrimClasses, className)}\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DialogContent = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(centeredModalContentClasses, className)}\n {...props}\n >\n {children}\n <DialogPrimitive.Close\n className={cn(\n 'absolute right-4 top-4 inline-flex items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground',\n touchTargetClasses,\n )}\n >\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col space-y-1.5 text-center sm:text-left',\n className,\n )}\n {...props}\n />\n);\nDialogHeader.displayName = 'DialogHeader';\n\nconst DialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',\n className,\n )}\n {...props}\n />\n);\nDialogFooter.displayName = 'DialogFooter';\n\nconst DialogTitle = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n 'text-lg font-semibold leading-none tracking-tight',\n className,\n )}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n};\n","'use client';\n\nimport * as React from 'react';\nimport { AlertDialog as AlertDialogPrimitive } from 'radix-ui';\nimport { cn } from '../lib/utils';\nimport {\n centeredModalContentClasses,\n overlayScrimClasses,\n} from '../lib/surface-classes';\nimport { buttonVariants } from './button';\n\nconst AlertDialog = AlertDialogPrimitive.Root;\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger;\nconst AlertDialogPortal = AlertDialogPrimitive.Portal;\n\nconst AlertDialogOverlay = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Overlay\n className={cn(overlayScrimClasses, className)}\n {...props}\n ref={ref}\n />\n));\nAlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;\n\nconst AlertDialogContent = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <AlertDialogPortal>\n <AlertDialogOverlay />\n <AlertDialogPrimitive.Content\n ref={ref}\n className={cn(centeredModalContentClasses, className)}\n {...props}\n />\n </AlertDialogPortal>\n));\nAlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;\n\nconst AlertDialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col space-y-2 text-center sm:text-left',\n className,\n )}\n {...props}\n />\n);\n\nconst AlertDialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',\n className,\n )}\n {...props}\n />\n);\n\nconst AlertDialogTitle = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold', className)}\n {...props}\n />\n));\nAlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;\n\nconst AlertDialogDescription = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Description\n ref={ref}\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nAlertDialogDescription.displayName =\n AlertDialogPrimitive.Description.displayName;\n\nconst AlertDialogAction = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Action>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Action\n ref={ref}\n className={cn(buttonVariants(), className)}\n {...props}\n />\n));\nAlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;\n\nconst AlertDialogCancel = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Cancel>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Cancel\n ref={ref}\n className={cn(\n buttonVariants({ variant: 'outline' }),\n 'mt-2 sm:mt-0',\n className,\n )}\n {...props}\n />\n));\nAlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;\n\nexport {\n AlertDialog,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogTrigger,\n AlertDialogContent,\n AlertDialogHeader,\n AlertDialogFooter,\n AlertDialogTitle,\n AlertDialogDescription,\n AlertDialogAction,\n AlertDialogCancel,\n};\n","'use client';\n\nimport * as React from 'react';\nimport { Dialog as SheetPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { X } from 'lucide-react';\nimport { cn } from '../lib/utils';\nimport { overlayScrimClasses, touchTargetClasses } from '../lib/surface-classes';\n\nconst Sheet = SheetPrimitive.Root;\nconst SheetTrigger = SheetPrimitive.Trigger;\nconst SheetClose = SheetPrimitive.Close;\nconst SheetPortal = SheetPrimitive.Portal;\n\nconst SheetOverlay = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Overlay\n className={cn(overlayScrimClasses, className)}\n {...props}\n ref={ref}\n />\n));\nSheetOverlay.displayName = SheetPrimitive.Overlay.displayName;\n\nconst sheetVariants = cva(\n 'fixed z-[var(--z-modal)] gap-4 bg-background p-6 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:[animation-duration:var(--panel-open-dur)] data-[state=closed]:[animation-duration:var(--panel-close-dur)] data-[state=open]:[animation-timing-function:var(--panel-ease)] data-[state=closed]:[animation-timing-function:var(--panel-ease)]',\n {\n variants: {\n side: {\n top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',\n bottom:\n 'inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',\n left: 'inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left',\n right:\n 'inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right',\n },\n size: {\n sm: '',\n md: '',\n lg: '',\n xl: '',\n full: '',\n },\n },\n defaultVariants: {\n side: 'right',\n size: 'sm',\n },\n compoundVariants: [\n { side: 'left', size: 'sm', className: 'sm:max-w-sm' },\n { side: 'left', size: 'md', className: 'sm:max-w-md' },\n { side: 'left', size: 'lg', className: 'sm:max-w-lg' },\n { side: 'left', size: 'xl', className: 'sm:max-w-xl' },\n { side: 'left', size: 'full', className: 'sm:max-w-full' },\n { side: 'right', size: 'sm', className: 'sm:max-w-sm' },\n { side: 'right', size: 'md', className: 'sm:max-w-md' },\n { side: 'right', size: 'lg', className: 'sm:max-w-lg' },\n { side: 'right', size: 'xl', className: 'sm:max-w-xl' },\n { side: 'right', size: 'full', className: 'sm:max-w-full' },\n ],\n },\n);\n\ninterface SheetContentProps\n extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,\n VariantProps<typeof sheetVariants> {}\n\nconst SheetContent = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Content>,\n SheetContentProps\n>(({ side = 'right', size = 'sm', className, children, ...props }, ref) => (\n <SheetPortal>\n <SheetOverlay />\n <SheetPrimitive.Content\n ref={ref}\n className={cn(sheetVariants({ side, size }), className)}\n {...props}\n >\n {children}\n <SheetPrimitive.Close\n className={cn(\n 'absolute right-4 top-4 inline-flex items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary',\n touchTargetClasses,\n )}\n >\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n </SheetPrimitive.Content>\n </SheetPortal>\n));\nSheetContent.displayName = SheetPrimitive.Content.displayName;\n\nconst SheetHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col space-y-2 text-center sm:text-left',\n className,\n )}\n {...props}\n />\n);\n\nconst SheetFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',\n className,\n )}\n {...props}\n />\n);\n\nconst SheetTitle = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold text-foreground', className)}\n {...props}\n />\n));\nSheetTitle.displayName = SheetPrimitive.Title.displayName;\n\nconst SheetDescription = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Description\n ref={ref}\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nSheetDescription.displayName = SheetPrimitive.Description.displayName;\n\nexport {\n Sheet,\n SheetPortal,\n SheetOverlay,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n};\n","'use client';\n\n/**\n * DropdownMenu — visually mirrored by `context-menu.tsx`. Both pull chrome\n * from `lib/surface-classes.ts` (menuSurfaceClasses, menuItemClasses, etc.)\n * so they stay in lockstep. Edit the shared classes file, not this one or\n * context-menu.tsx, when tweaking menu visuals.\n */\n\nimport * as React from 'react';\nimport { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';\nimport { Check, ChevronRight, Circle } from 'lucide-react';\nimport { cn } from '../lib/utils';\nimport {\n floatingAnimationClasses,\n menuItemClasses,\n menuItemWithIndicatorClasses,\n menuSeparatorClasses,\n menuSurfaceClasses,\n} from '../lib/surface-classes';\n\nconst DropdownMenu = DropdownMenuPrimitive.Root;\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n menuItemClasses,\n 'data-[state=open]:bg-accent',\n inset && 'pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto h-4 w-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n menuSurfaceClasses,\n floatingAnimationClasses,\n 'shadow-lg',\n className,\n )}\n {...props}\n />\n));\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\nconst DropdownMenuContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(menuSurfaceClasses, floatingAnimationClasses, className)}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(menuItemClasses, inset && 'pl-8', className)}\n {...props}\n />\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(menuItemWithIndicatorClasses, className)}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(menuItemWithIndicatorClasses, className)}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Circle className=\"h-2 w-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n 'px-2 py-1.5 text-sm font-semibold',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn(menuSeparatorClasses, className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => (\n <span\n className={cn('ml-auto text-xs tracking-widest opacity-60', className)}\n {...props}\n />\n);\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n};\n","\"use client\";\n\nimport { Toaster as SonnerToaster, toast } from \"sonner\";\n\nexport interface ToasterProps {\n position?: \"top-left\" | \"top-right\" | \"bottom-left\" | \"bottom-right\" | \"top-center\" | \"bottom-center\";\n richColors?: boolean;\n closeButton?: boolean;\n className?: string;\n}\n\nfunction Toaster({ position = \"bottom-right\", richColors = true, closeButton = true, ...props }: ToasterProps) {\n return (\n <SonnerToaster\n position={position}\n richColors={richColors}\n closeButton={closeButton}\n toastOptions={{\n classNames: {\n toast: \"group border-border bg-background text-foreground shadow-lg\",\n description: \"text-muted-foreground\",\n actionButton: \"bg-primary text-primary-foreground\",\n cancelButton: \"bg-muted text-muted-foreground\",\n },\n }}\n {...props}\n />\n );\n}\n\nexport { Toaster, toast };\n","'use client';\n\nimport * as React from 'react';\nimport { Tabs as TabsPrimitive } from 'radix-ui';\nimport { cn } from '../lib/utils';\n\nconst Tabs = TabsPrimitive.Root;\n\n// useLayoutEffect warns on the server; fall back to useEffect there.\nconst useIsomorphicLayoutEffect =\n typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\n\nconst TabsList = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, children, ...props }, forwardedRef) => {\n const innerRef = React.useRef<HTMLDivElement | null>(null);\n const pillRef = React.useRef<HTMLSpanElement | null>(null);\n\n // Merge the forwarded ref with our internal one.\n const setRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n innerRef.current = node;\n if (typeof forwardedRef === 'function') forwardedRef(node);\n else if (forwardedRef) forwardedRef.current = node;\n },\n [forwardedRef],\n );\n\n // Slide the pill behind whichever trigger Radix has marked active. The pill\n // shares the list as its offset parent, so a trigger's offsetLeft/offsetWidth\n // map directly to the pill's translateX/width.\n const move = React.useCallback((animate: boolean) => {\n const list = innerRef.current;\n const pill = pillRef.current;\n if (!list || !pill) return;\n\n const active = list.querySelector<HTMLElement>(\n '[role=\"tab\"][data-state=\"active\"]',\n );\n if (!active) {\n pill.style.opacity = '0';\n return;\n }\n\n // Suspend via transition-property (not the `transition` shorthand) so the\n // inline duration/easing from the --tabs-* tokens survive the snap.\n if (!animate) pill.style.transitionProperty = 'none';\n pill.style.opacity = '1';\n pill.style.transform = `translateX(${active.offsetLeft}px)`;\n pill.style.width = `${active.offsetWidth}px`;\n if (!animate) {\n // Force a reflow so the snap applies before transitions are restored.\n void pill.offsetWidth;\n pill.style.transitionProperty = '';\n }\n }, []);\n\n useIsomorphicLayoutEffect(() => {\n move(false);\n\n const list = innerRef.current;\n if (!list) return;\n\n // Radix flips data-state on triggers for both pointer and keyboard nav.\n const observer = new MutationObserver(() => move(true));\n observer.observe(list, {\n subtree: true,\n attributes: true,\n attributeFilter: ['data-state'],\n childList: true,\n });\n\n const resize = new ResizeObserver(() => move(false));\n resize.observe(list);\n\n return () => {\n observer.disconnect();\n resize.disconnect();\n };\n }, [move]);\n\n return (\n <TabsPrimitive.List\n ref={setRef}\n className={cn(\n 'relative isolate inline-flex h-[var(--density-height-md)] items-center justify-center rounded-md bg-muted p-1 text-muted-foreground',\n className,\n )}\n {...props}\n >\n <span\n ref={pillRef}\n aria-hidden=\"true\"\n className={cn(\n 'pointer-events-none absolute bottom-1 left-0 top-1 z-0 rounded-sm opacity-0 shadow-sm',\n 'bg-[var(--bison-tab-active-bg,hsl(var(--primary)))]',\n 'transition-[transform,width] motion-reduce:transition-none',\n )}\n style={{\n transitionDuration: 'var(--tabs-dur)',\n transitionTimingFunction: 'var(--tabs-ease)',\n }}\n />\n {children}\n </TabsPrimitive.List>\n );\n});\nTabsList.displayName = TabsPrimitive.List.displayName;\n\nconst TabsTrigger = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n 'relative z-[1] inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:text-[var(--bison-tab-active-fg,hsl(var(--primary-foreground)))]',\n className,\n )}\n {...props}\n />\n));\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName;\n\nconst TabsContent = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Content\n ref={ref}\n className={cn(\n 'mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2',\n className,\n )}\n {...props}\n />\n));\nTabsContent.displayName = TabsPrimitive.Content.displayName;\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { Check, FastForward } from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\nimport { tintToneSuccess, tintToneWarning } from \"../lib/semantic-tint-tones\";\n\nexport type StepperState = \"completed\" | \"active\" | \"skipped\" | \"upcoming\";\nexport type StepperOrientation = \"horizontal\" | \"vertical\";\n\n// Indicator size — kept as a constant so connector positioning math is exact.\nconst INDICATOR_SIZE_PX = 36; // matches h-9/w-9\nconst INDICATOR_CENTER_PX = INDICATOR_SIZE_PX / 2; // 18\nconst CONNECTOR_THICKNESS_PX = 2; // h-0.5 / w-0.5\n// Minimum connector length when there's no surrounding content to push items\n// apart. Keeps the visual rhythm consistent.\nconst MIN_CONNECTOR_LENGTH_PX = 24;\n\ntype StepperContextValue = {\n orientation: StepperOrientation;\n interactive: boolean;\n allowSkipAhead: boolean;\n onStepClick?: (index: number) => void;\n};\n\nconst StepperContext = React.createContext<StepperContextValue | null>(null);\n\nfunction useStepperContext(component: string) {\n const ctx = React.useContext(StepperContext);\n if (!ctx) {\n throw new Error(`<${component}> must be used inside <Stepper>`);\n }\n return ctx;\n}\n\ntype StepperItemContextValue = {\n state: StepperState;\n index: number;\n isLast: boolean;\n disabled: boolean;\n};\n\nconst StepperItemContext = React.createContext<StepperItemContextValue | null>(\n null,\n);\n\nfunction useStepperItemContext(component: string) {\n const ctx = React.useContext(StepperItemContext);\n if (!ctx) {\n throw new Error(`<${component}> must be used inside <StepperItem>`);\n }\n return ctx;\n}\n\nexport interface StepperProps extends React.HTMLAttributes<HTMLDivElement> {\n orientation?: StepperOrientation;\n interactive?: boolean;\n allowSkipAhead?: boolean;\n onStepClick?: (index: number) => void;\n}\n\nconst Stepper = React.forwardRef<HTMLDivElement, StepperProps>(\n (\n {\n className,\n orientation = \"horizontal\",\n interactive = false,\n allowSkipAhead = false,\n onStepClick,\n children,\n ...props\n },\n ref,\n ) => {\n const value = React.useMemo<StepperContextValue>(\n () => ({\n orientation,\n interactive,\n allowSkipAhead,\n onStepClick,\n }),\n [orientation, interactive, allowSkipAhead, onStepClick],\n );\n\n // Derive each item's index and `isLast` flag from its JSX position rather\n // than from a shared mutable counter. The counter approach was unsound:\n // it relied on every `<StepperItem>` re-rendering exactly once per\n // `<Stepper>` render, in order. React 19 strict-mode double renders,\n // concurrent renders, and out-of-band item re-renders can all break that\n // contract, causing indices (and therefore `isLast`) to drift — which\n // shows up as wrong step numbers and a stray trailing connector.\n //\n // Instead we walk the children once here, count `<StepperItem>` matches\n // up-front, then `cloneElement` each item with `_index` and `_isLast`\n // injected as internal props. Non-item children pass through untouched.\n const childArray = React.Children.toArray(children);\n const totalItems = childArray.reduce<number>(\n (acc, child) =>\n React.isValidElement(child) &&\n (child.type as { displayName?: string })?.displayName === \"StepperItem\"\n ? acc + 1\n : acc,\n 0,\n );\n\n let itemIndex = 0;\n const decoratedChildren = childArray.map((child) => {\n if (\n !React.isValidElement(child) ||\n (child.type as { displayName?: string })?.displayName !== \"StepperItem\"\n ) {\n return child;\n }\n const index = itemIndex;\n itemIndex += 1;\n return React.cloneElement(child as React.ReactElement<StepperItemProps>, {\n _index: index,\n _isLast: index === totalItems - 1,\n });\n });\n\n return (\n <StepperContext.Provider value={value}>\n <div\n ref={ref}\n role={interactive ? \"tablist\" : undefined}\n aria-orientation={orientation}\n className={cn(\n \"flex w-full\",\n orientation === \"horizontal\"\n ? \"flex-row items-start\"\n : \"flex-col items-stretch\",\n className,\n )}\n {...props}\n >\n {decoratedChildren}\n </div>\n </StepperContext.Provider>\n );\n },\n);\nStepper.displayName = \"Stepper\";\n\nconst stepperItemVariants = cva(\n \"group/stepper-item relative flex transition-colors\",\n {\n variants: {\n orientation: {\n // Horizontal items grow to share the row equally. Indicator at top,\n // label/description block below. Trailing connector is absolutely\n // positioned at the indicator's vertical center.\n horizontal: \"min-w-0 flex-1 flex-col items-center text-center\",\n // Vertical items have indicator on the left, label/description block\n // on the right. Trailing connector is absolutely positioned at the\n // indicator's horizontal center.\n vertical: \"flex-row items-start gap-3 text-left\",\n },\n interactive: {\n true: \"cursor-pointer rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60\",\n false: \"\",\n },\n },\n defaultVariants: {\n orientation: \"horizontal\",\n interactive: false,\n },\n },\n);\n\nexport interface StepperItemProps extends Omit<\n React.HTMLAttributes<HTMLDivElement | HTMLButtonElement>,\n \"onClick\"\n> {\n state?: StepperState;\n /**\n * Color of the connector that follows this item. Defaults to the item's own\n * `state`, which yields a \"fills in\" effect as the user progresses.\n */\n connectorState?: StepperState;\n /**\n * Hide the trailing connector for this item. Useful if you need a custom\n * separator. The last item never renders a connector regardless of this prop.\n */\n hideConnector?: boolean;\n disabled?: boolean;\n onClick?: (event: React.MouseEvent<HTMLElement>) => void;\n /**\n * @internal Injected by the parent `<Stepper>` based on JSX position. Do\n * not pass directly — `<Stepper>` clones each `<StepperItem>` to set this.\n */\n _index?: number;\n /**\n * @internal Injected by the parent `<Stepper>` based on JSX position. Do\n * not pass directly — `<Stepper>` clones each `<StepperItem>` to set this.\n */\n _isLast?: boolean;\n}\n\nconst StepperItem = React.forwardRef<HTMLElement, StepperItemProps>(\n (\n {\n state = \"upcoming\",\n connectorState,\n hideConnector = false,\n disabled: disabledProp,\n className,\n onClick,\n children,\n _index,\n _isLast,\n ...props\n },\n ref,\n ) => {\n const { orientation, interactive, allowSkipAhead, onStepClick } =\n useStepperContext(\"StepperItem\");\n\n // `_index` and `_isLast` are injected by the parent `<Stepper>` based on\n // JSX position. We default them defensively so a `<StepperItem>` rendered\n // in isolation (e.g. a snapshot test) still produces sensible output —\n // it's treated as the only/last step.\n const index = _index ?? 0;\n const isLast = _isLast ?? true;\n\n const disabled =\n disabledProp ?? (interactive && state === \"upcoming\" && !allowSkipAhead);\n\n const itemValue = React.useMemo<StepperItemContextValue>(\n () => ({ state, index, isLast, disabled }),\n [state, index, isLast, disabled],\n );\n\n const handleClick = (event: React.MouseEvent<HTMLElement>) => {\n if (disabled) return;\n onClick?.(event);\n onStepClick?.(index);\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLElement>) => {\n if (!interactive) return;\n const target = event.currentTarget;\n const items = Array.from(\n target.parentElement?.querySelectorAll<HTMLElement>(\n '[data-stepper-item=\"true\"]:not([disabled])',\n ) ?? [],\n );\n const currentIdx = items.indexOf(target);\n if (currentIdx < 0) return;\n\n const nextKey = orientation === \"horizontal\" ? \"ArrowRight\" : \"ArrowDown\";\n const prevKey = orientation === \"horizontal\" ? \"ArrowLeft\" : \"ArrowUp\";\n\n if (event.key === nextKey) {\n event.preventDefault();\n items[(currentIdx + 1) % items.length]?.focus();\n } else if (event.key === prevKey) {\n event.preventDefault();\n items[(currentIdx - 1 + items.length) % items.length]?.focus();\n } else if (event.key === \"Home\") {\n event.preventDefault();\n items[0]?.focus();\n } else if (event.key === \"End\") {\n event.preventDefault();\n items[items.length - 1]?.focus();\n }\n };\n\n const showConnector = !isLast && !hideConnector;\n const resolvedConnectorState = connectorState ?? state;\n\n // Ensure each item has enough length for the connector to be visible even\n // when the content is short. Padding stays inside the item so the next\n // item's indicator sits flush against the end of the connector.\n const itemSpacing = !showConnector\n ? \"\"\n : orientation === \"vertical\"\n ? \"pb-8\"\n : \"\";\n\n const sharedProps = {\n \"data-stepper-item\": \"true\" as const,\n \"data-state\": state,\n \"aria-current\": state === \"active\" ? (\"step\" as const) : undefined,\n className: cn(\n stepperItemVariants({ orientation, interactive }),\n itemSpacing,\n className,\n ),\n };\n\n // Split children into the indicator and everything else, then wrap the\n // \"rest\" in a labelled content block. This lets users write:\n //\n // <StepperItem>\n // <StepperIndicator />\n // <StepperLabel>...</StepperLabel>\n // <StepperDescription>...</StepperDescription>\n // </StepperItem>\n //\n // …without manually grouping label + description in a wrapper div.\n const { indicator, rest } = splitIndicator(children);\n\n const content = (\n <StepperItemContext.Provider value={itemValue}>\n {indicator}\n {rest.length > 0 ? (\n <div\n className={cn(\n \"relative z-10 flex min-w-0 flex-col gap-1\",\n orientation === \"horizontal\"\n ? \"mt-2 items-center\"\n : \"flex-1 items-start\",\n )}\n >\n {rest}\n </div>\n ) : null}\n {showConnector ? (\n <Connector orientation={orientation} state={resolvedConnectorState} />\n ) : null}\n </StepperItemContext.Provider>\n );\n\n if (interactive) {\n return (\n <button\n ref={ref as React.Ref<HTMLButtonElement>}\n type=\"button\"\n role=\"tab\"\n aria-selected={state === \"active\"}\n disabled={disabled}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n {...sharedProps}\n {...(props as React.ButtonHTMLAttributes<HTMLButtonElement>)}\n >\n {content}\n </button>\n );\n }\n\n return (\n <div\n ref={ref as React.Ref<HTMLDivElement>}\n {...sharedProps}\n {...(props as React.HTMLAttributes<HTMLDivElement>)}\n >\n {content}\n </div>\n );\n },\n);\nStepperItem.displayName = \"StepperItem\";\n\n/**\n * Trailing connector line, absolutely positioned along the indicator's\n * center axis. By anchoring to the item box (not to a flex sibling) the\n * line is guaranteed to align with the indicator regardless of how much\n * content sits below or beside it.\n *\n * - Horizontal: line runs from the right edge of this item's indicator to\n * the left edge of the next item's indicator. Top = indicator center.\n * - Vertical: line runs from the bottom edge of this item's indicator to\n * the top edge of the next item's indicator. Left = indicator center.\n */\nfunction Connector({\n orientation,\n state,\n}: {\n orientation: StepperOrientation;\n state: StepperState;\n}) {\n if (orientation === \"horizontal\") {\n return (\n <div\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none absolute z-0 h-0.5 transition-colors\",\n connectorColor(state),\n )}\n style={{\n top: INDICATOR_CENTER_PX - CONNECTOR_THICKNESS_PX / 2,\n left: `calc(50% + ${INDICATOR_CENTER_PX}px)`,\n right: `calc(-50% + ${INDICATOR_CENTER_PX}px)`,\n }}\n />\n );\n }\n\n return (\n <div\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none absolute z-0 w-0.5 transition-colors\",\n connectorColor(state),\n )}\n style={{\n left: INDICATOR_CENTER_PX - CONNECTOR_THICKNESS_PX / 2,\n top: INDICATOR_SIZE_PX,\n bottom: 0,\n }}\n />\n );\n}\n\n/**\n * Pulls the first <StepperIndicator> out of a children list. Returns the\n * indicator (or null) and the remaining children. Identity-checked so it\n * works with forwardRef wrappers regardless of displayName quirks.\n */\nfunction splitIndicator(children: React.ReactNode): {\n indicator: React.ReactNode | null;\n rest: React.ReactNode[];\n} {\n let indicator: React.ReactNode | null = null;\n const rest: React.ReactNode[] = [];\n\n React.Children.forEach(children, (child) => {\n if (\n indicator === null &&\n React.isValidElement(child) &&\n child.type === StepperIndicator\n ) {\n indicator = child;\n } else {\n rest.push(child);\n }\n });\n\n return { indicator, rest };\n}\n\nfunction connectorColor(state: StepperState): string {\n switch (state) {\n case \"completed\":\n return \"bg-success-500 dark:bg-success-400\";\n case \"active\":\n return \"bg-primary\";\n case \"skipped\":\n return \"bg-warning-500 dark:bg-warning-400\";\n case \"upcoming\":\n default:\n return \"bg-border\";\n }\n}\n\nconst stepperIndicatorVariants = cva(\n \"relative z-10 inline-flex shrink-0 items-center justify-center rounded-full border-2 text-sm font-semibold transition-colors\",\n {\n variants: {\n state: {\n completed: tintToneSuccess,\n active:\n \"border-primary bg-primary text-primary-foreground ring-2 ring-primary/30 ring-offset-2 ring-offset-background\",\n skipped: tintToneWarning,\n upcoming: \"border-border bg-muted text-muted-foreground\",\n },\n },\n defaultVariants: { state: \"upcoming\" },\n },\n);\n\nexport interface StepperIndicatorProps\n extends\n Omit<React.HTMLAttributes<HTMLSpanElement>, \"children\">,\n VariantProps<typeof stepperIndicatorVariants> {\n /**\n * Optional icon to render when the step is `active` or `upcoming`. Pass any\n * React node (`<FontAwesomeIcon … />`, a Lucide icon, an inline SVG, etc.).\n * Ignored for `completed` (always check) and `skipped` (always forward) states.\n */\n icon?: React.ReactNode;\n /**\n * Override the auto-generated step number. Pass a string/number to display\n * custom content for `active` / `upcoming` states.\n */\n children?: React.ReactNode;\n}\n\nconst StepperIndicator = React.forwardRef<\n HTMLSpanElement,\n StepperIndicatorProps\n>(({ className, icon, children, style, ...props }, ref) => {\n const { state, index } = useStepperItemContext(\"StepperIndicator\");\n\n let inner: React.ReactNode;\n if (state === \"completed\") {\n inner = <Check className=\"h-4 w-4\" aria-hidden=\"true\" />;\n } else if (state === \"skipped\") {\n inner = <FastForward className=\"h-4 w-4\" aria-hidden=\"true\" />;\n } else if (icon !== undefined && icon !== null) {\n inner = (\n <span className=\"inline-flex h-4 w-4 items-center justify-center [&_svg]:h-4 [&_svg]:w-4\">\n {icon}\n </span>\n );\n } else if (children !== undefined) {\n inner = children;\n } else {\n inner = index + 1;\n }\n\n return (\n <span\n ref={ref}\n aria-hidden={state !== \"active\"}\n className={cn(stepperIndicatorVariants({ state }), className)}\n style={{\n height: INDICATOR_SIZE_PX,\n width: INDICATOR_SIZE_PX,\n ...style,\n }}\n {...props}\n >\n {inner}\n </span>\n );\n});\nStepperIndicator.displayName = \"StepperIndicator\";\n\nconst stepperLabelVariants = cva(\"text-sm font-medium transition-colors\", {\n variants: {\n state: {\n completed: \"text-foreground\",\n active: \"text-foreground\",\n skipped: \"text-muted-foreground line-through\",\n upcoming: \"text-muted-foreground\",\n },\n },\n defaultVariants: { state: \"upcoming\" },\n});\n\nconst StepperLabel = React.forwardRef<\n HTMLSpanElement,\n React.HTMLAttributes<HTMLSpanElement>\n>(({ className, ...props }, ref) => {\n const { state } = useStepperItemContext(\"StepperLabel\");\n return (\n <span\n ref={ref}\n className={cn(stepperLabelVariants({ state }), className)}\n {...props}\n />\n );\n});\nStepperLabel.displayName = \"StepperLabel\";\n\nconst StepperDescription = React.forwardRef<\n HTMLSpanElement,\n React.HTMLAttributes<HTMLSpanElement>\n>(({ className, ...props }, ref) => (\n <span\n ref={ref}\n className={cn(\"text-xs text-muted-foreground\", className)}\n {...props}\n />\n));\nStepperDescription.displayName = \"StepperDescription\";\n\n/**\n * Backwards-compatible no-op separator.\n *\n * The connector line between steps is now rendered automatically by each\n * `<StepperItem>`. Continue using `<StepperSeparator>` between items if you\n * prefer the explicit syntax — it renders nothing and the auto-connector\n * handles the visual.\n *\n * @deprecated Connectors are rendered automatically by `<StepperItem>`.\n * This component is now a no-op kept for source compatibility.\n */\nconst StepperSeparator: React.FC<{\n state?: StepperState;\n className?: string;\n}> = () => null;\nStepperSeparator.displayName = \"StepperSeparator\";\n\nexport {\n Stepper,\n StepperItem,\n StepperIndicator,\n StepperLabel,\n StepperDescription,\n StepperSeparator,\n stepperItemVariants,\n stepperIndicatorVariants,\n stepperLabelVariants,\n};\n\nexport { INDICATOR_SIZE_PX, INDICATOR_CENTER_PX };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Accordion as AccordionPrimitive } from \"radix-ui\";\nimport { ChevronDown } from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\n\nconst Accordion = AccordionPrimitive.Root;\n\nconst AccordionItem = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <AccordionPrimitive.Item ref={ref} className={cn(\"border-b\", className)} {...props} />\n));\nAccordionItem.displayName = \"AccordionItem\";\n\nconst AccordionTrigger = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex flex-1 cursor-pointer items-center justify-between py-4 font-medium transition-all hover:underline disabled:cursor-not-allowed [&[data-state=open]>svg]:rotate-180\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronDown className=\"h-4 w-4 shrink-0 transition-transform duration-normal\" />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n));\nAccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;\n\nconst AccordionContent = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Content\n ref={ref}\n className=\"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down\"\n {...props}\n >\n <div className={cn(\"pb-4 pt-0\", className)}>{children}</div>\n </AccordionPrimitive.Content>\n));\nAccordionContent.displayName = AccordionPrimitive.Content.displayName;\n\nexport { Accordion, AccordionItem, AccordionTrigger, AccordionContent };\n","import * as React from \"react\";\nimport { cn } from \"../lib/utils\";\n\nconst Table = React.forwardRef<HTMLTableElement, React.HTMLAttributes<HTMLTableElement>>(\n ({ className, ...props }, ref) => (\n <div className=\"relative w-full overflow-auto\">\n <table ref={ref} className={cn(\"w-full caption-bottom text-sm\", className)} {...props} />\n </div>\n )\n);\nTable.displayName = \"Table\";\n\nconst TableHeader = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(\n ({ className, ...props }, ref) => <thead ref={ref} className={cn(\"[&_tr]:border-b\", className)} {...props} />\n);\nTableHeader.displayName = \"TableHeader\";\n\nconst TableBody = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(\n ({ className, ...props }, ref) => <tbody ref={ref} className={cn(\"[&_tr:last-child]:border-0\", className)} {...props} />\n);\nTableBody.displayName = \"TableBody\";\n\nconst TableFooter = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(\n ({ className, ...props }, ref) => <tfoot ref={ref} className={cn(\"border-t bg-muted/50 font-medium [&>tr]:last:border-b-0\", className)} {...props} />\n);\nTableFooter.displayName = \"TableFooter\";\n\nconst TableRow = React.forwardRef<HTMLTableRowElement, React.HTMLAttributes<HTMLTableRowElement>>(\n ({ className, ...props }, ref) => (\n <tr ref={ref} className={cn(\"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted\", className)} {...props} />\n )\n);\nTableRow.displayName = \"TableRow\";\n\nconst TableHead = React.forwardRef<HTMLTableCellElement, React.ThHTMLAttributes<HTMLTableCellElement>>(\n ({ className, ...props }, ref) => (\n <th ref={ref} className={cn(\"h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0\", className)} {...props} />\n )\n);\nTableHead.displayName = \"TableHead\";\n\nconst TableCell = React.forwardRef<HTMLTableCellElement, React.TdHTMLAttributes<HTMLTableCellElement>>(\n ({ className, ...props }, ref) => (\n <td ref={ref} className={cn(\"p-4 align-middle [&:has([role=checkbox])]:pr-0\", className)} {...props} />\n )\n);\nTableCell.displayName = \"TableCell\";\n\nconst TableCaption = React.forwardRef<HTMLTableCaptionElement, React.HTMLAttributes<HTMLTableCaptionElement>>(\n ({ className, ...props }, ref) => <caption ref={ref} className={cn(\"mt-4 text-sm text-muted-foreground\", className)} {...props} />\n);\nTableCaption.displayName = \"TableCaption\";\n\nexport { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption };\n","\"use client\";\n\nimport * as React from \"react\";\nimport {\n useReactTable,\n getCoreRowModel,\n getSortedRowModel,\n getFilteredRowModel,\n getPaginationRowModel,\n flexRender,\n type ColumnDef,\n type SortingState,\n type ColumnFiltersState,\n type VisibilityState,\n type RowSelectionState,\n type PaginationState,\n type Table as TanstackTable,\n type OnChangeFn,\n} from \"@tanstack/react-table\";\nimport {\n ArrowDown,\n ArrowUp,\n ArrowUpDown,\n ChevronLeft,\n ChevronRight,\n ChevronsLeft,\n ChevronsRight,\n Settings2,\n} from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\nimport { Table, TableHeader, TableBody, TableHead, TableRow, TableCell } from \"./table\";\nimport { Button } from \"./button\";\nimport { Input } from \"./input\";\nimport { Checkbox } from \"./checkbox\";\nimport {\n Select,\n SelectTrigger,\n SelectValue,\n SelectContent,\n SelectItem,\n} from \"./select\";\nimport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuCheckboxItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n} from \"./dropdown-menu\";\n\n// ---------------------------------------------------------------------------\n// Re-exports\n// ---------------------------------------------------------------------------\n\nexport type { ColumnDef } from \"@tanstack/react-table\";\n\n// ---------------------------------------------------------------------------\n// Size / Density\n// ---------------------------------------------------------------------------\n\ntype DataTableSize = \"sm\" | \"md\" | \"lg\";\n\nconst sizeClasses: Record<DataTableSize, { cell: string; header: string }> = {\n sm: { cell: \"px-3 py-1.5 text-xs\", header: \"h-9 px-3 text-xs\" },\n md: { cell: \"px-4 py-2 text-sm\", header: \"h-10 px-4 text-sm\" },\n lg: { cell: \"px-4 py-3 text-sm\", header: \"h-12 px-4 text-sm\" },\n};\n\nconst densitySizeMap: Record<string, DataTableSize> = {\n compact: \"sm\",\n default: \"md\",\n spacious: \"lg\",\n};\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport interface DataTableProps<TData> {\n /** Column definitions (TanStack Table ColumnDef). */\n columns: ColumnDef<TData, unknown>[];\n /** Data array to render. */\n data: TData[];\n\n // --- Filtering ---\n /** Column id used for the filter input. Omit to disable the built-in filter. */\n filterColumn?: string;\n /** Placeholder text for the filter input. @default \"Filter...\" */\n filterPlaceholder?: string;\n\n // --- Pagination ---\n /** Enable pagination. @default true */\n pagination?: boolean;\n /** Number of rows per page. @default 10 */\n pageSize?: number;\n /** Page size options in the dropdown. @default [10, 20, 30, 50] */\n pageSizeOptions?: number[];\n\n // --- Row selection ---\n /** Show a checkbox column for row selection. @default false */\n enableRowSelection?: boolean;\n /** Callback when selection changes. Receives a record of row-id to boolean. */\n onRowSelectionChange?: (selection: RowSelectionState) => void;\n\n // --- Server-side / manual mode ---\n /** Total row count for server-side pagination. Enables manual mode when set. */\n totalRows?: number;\n /** Controlled pagination state for server-side mode. */\n paginationState?: PaginationState;\n /** Callback when pagination changes (server-side). */\n onPaginationChange?: OnChangeFn<PaginationState>;\n /** Controlled sorting state for server-side mode. */\n sortingState?: SortingState;\n /** Callback when sorting changes (server-side). */\n onSortingChange?: OnChangeFn<SortingState>;\n /** Controlled column filter state for server-side mode. */\n filterState?: ColumnFiltersState;\n /** Callback when column filters change (server-side). */\n onFilterChange?: OnChangeFn<ColumnFiltersState>;\n\n // --- Toolbar ---\n /** Show the column visibility toggle in the toolbar. @default true */\n showColumnToggle?: boolean;\n /** Additional actions rendered at the end of the toolbar. */\n toolbarActions?: React.ReactNode;\n\n // --- Sizing ---\n /** Override density-derived size. When omitted, reads from the nearest DensityProvider. */\n size?: DataTableSize;\n\n // --- Display ---\n /** Message shown when there are no rows. @default \"No results.\" */\n emptyMessage?: string;\n /** Additional class name on the root wrapper. */\n className?: string;\n}\n\n// ---------------------------------------------------------------------------\n// DataTableColumnHeader\n// ---------------------------------------------------------------------------\n\nexport interface DataTableColumnHeaderProps {\n column: {\n getCanSort: () => boolean;\n getIsSorted: () => false | \"asc\" | \"desc\";\n toggleSorting: (desc?: boolean, multi?: boolean) => void;\n };\n title: string;\n className?: string;\n}\n\nfunction DataTableColumnHeader({ column, title, className }: DataTableColumnHeaderProps) {\n if (!column.getCanSort()) {\n return <div className={cn(className)}>{title}</div>;\n }\n\n const sorted = column.getIsSorted();\n\n return (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className={cn(\"-ml-3 h-8 data-[state=open]:bg-accent\", className)}\n onClick={() => column.toggleSorting(sorted === \"asc\")}\n >\n {title}\n {sorted === \"asc\" ? (\n <ArrowUp className=\"ml-2 h-3.5 w-3.5\" />\n ) : sorted === \"desc\" ? (\n <ArrowDown className=\"ml-2 h-3.5 w-3.5\" />\n ) : (\n <ArrowUpDown className=\"ml-2 h-3.5 w-3.5 text-muted-foreground/50\" />\n )}\n </Button>\n );\n}\nDataTableColumnHeader.displayName = \"DataTableColumnHeader\";\n\n// ---------------------------------------------------------------------------\n// Internal: selection column factory\n// ---------------------------------------------------------------------------\n\nfunction createSelectionColumn<TData>(): ColumnDef<TData, unknown> {\n return {\n id: \"_select\",\n header: ({ table }) => (\n <Checkbox\n checked={table.getIsAllPageRowsSelected() || (table.getIsSomePageRowsSelected() && \"indeterminate\")}\n onCheckedChange={(value) => table.toggleAllPageRowsSelected(!!value)}\n aria-label=\"Select all\"\n className=\"translate-y-[2px]\"\n />\n ),\n cell: ({ row }) => (\n <Checkbox\n checked={row.getIsSelected()}\n onCheckedChange={(value) => row.toggleSelected(!!value)}\n aria-label=\"Select row\"\n className=\"translate-y-[2px]\"\n />\n ),\n enableSorting: false,\n enableHiding: false,\n size: 40,\n };\n}\n\n// ---------------------------------------------------------------------------\n// Internal: detect density from DOM\n// ---------------------------------------------------------------------------\n\nfunction useDensitySize(): DataTableSize {\n const ref = React.useRef<HTMLDivElement>(null);\n const [size, setSize] = React.useState<DataTableSize>(\"md\");\n\n React.useEffect(() => {\n const el = ref.current;\n if (!el) return;\n const container = el.closest(\".bison-density-compact, .bison-density-default, .bison-density-spacious\");\n if (!container) return;\n for (const [cls, sz] of Object.entries(densitySizeMap)) {\n if (container.classList.contains(`bison-density-${cls}`)) {\n setSize(sz);\n return;\n }\n }\n }, []);\n\n return size;\n}\n\n// ---------------------------------------------------------------------------\n// DataTable\n// ---------------------------------------------------------------------------\n\nfunction DataTableInner<TData>(\n {\n columns,\n data,\n filterColumn,\n filterPlaceholder = \"Filter...\",\n pagination = true,\n pageSize = 10,\n pageSizeOptions = [10, 20, 30, 50],\n enableRowSelection = false,\n onRowSelectionChange,\n totalRows,\n paginationState: controlledPagination,\n onPaginationChange,\n sortingState: controlledSorting,\n onSortingChange: onSortingChangeProp,\n filterState: controlledFilters,\n onFilterChange,\n showColumnToggle = true,\n toolbarActions,\n size: sizeProp,\n emptyMessage = \"No results.\",\n className,\n }: DataTableProps<TData>,\n ref: React.ForwardedRef<HTMLDivElement>\n) {\n const isServerSide = totalRows !== undefined;\n\n // --- Internal state (client-side) ---\n const [internalSorting, setInternalSorting] = React.useState<SortingState>([]);\n const [internalFilters, setInternalFilters] = React.useState<ColumnFiltersState>([]);\n const [internalPagination, setInternalPagination] = React.useState<PaginationState>({\n pageIndex: 0,\n pageSize,\n });\n const [columnVisibility, setColumnVisibility] = React.useState<VisibilityState>({});\n const [rowSelection, setRowSelection] = React.useState<RowSelectionState>({});\n\n // Resolve controlled vs uncontrolled state\n const sorting = controlledSorting ?? internalSorting;\n const setSorting = onSortingChangeProp ?? setInternalSorting;\n const columnFilters = controlledFilters ?? internalFilters;\n const setColumnFilters = onFilterChange ?? setInternalFilters;\n const paginationVal = controlledPagination ?? internalPagination;\n const setPaginationVal = onPaginationChange ?? setInternalPagination;\n\n // Notify consumer of selection changes\n const handleRowSelectionChange: OnChangeFn<RowSelectionState> = React.useCallback(\n (updater) => {\n setRowSelection((prev) => {\n const next = typeof updater === \"function\" ? updater(prev) : updater;\n onRowSelectionChange?.(next);\n return next;\n });\n },\n [onRowSelectionChange]\n );\n\n // Prepend selection column\n const finalColumns = React.useMemo(() => {\n if (!enableRowSelection) return columns;\n return [createSelectionColumn<TData>(), ...columns];\n }, [columns, enableRowSelection]);\n\n const table = useReactTable({\n data,\n columns: finalColumns,\n state: {\n sorting,\n columnFilters,\n columnVisibility,\n rowSelection,\n pagination: paginationVal,\n },\n onSortingChange: setSorting,\n onColumnFiltersChange: setColumnFilters,\n onColumnVisibilityChange: setColumnVisibility,\n onRowSelectionChange: handleRowSelectionChange,\n onPaginationChange: setPaginationVal,\n getCoreRowModel: getCoreRowModel(),\n ...(isServerSide\n ? {\n manualPagination: true,\n manualSorting: true,\n manualFiltering: true,\n pageCount: Math.ceil(totalRows / paginationVal.pageSize),\n }\n : {\n getSortedRowModel: getSortedRowModel(),\n getFilteredRowModel: getFilteredRowModel(),\n ...(pagination && { getPaginationRowModel: getPaginationRowModel() }),\n }),\n enableRowSelection,\n });\n\n // --- Density / size ---\n const densitySize = useDensitySize();\n const resolvedSize = sizeProp ?? densitySize;\n const sc = sizeClasses[resolvedSize];\n\n // --- Toolbar visibility ---\n const hasToolbar = filterColumn || showColumnToggle || toolbarActions;\n\n const selectedCount = Object.keys(rowSelection).length;\n const totalFilteredRows = isServerSide ? totalRows : table.getFilteredRowModel().rows.length;\n\n return (\n <div ref={ref} className={cn(\"space-y-4\", className)}>\n {/* Toolbar */}\n {hasToolbar && (\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"flex flex-1 items-center gap-2\">\n {filterColumn && (\n <Input\n placeholder={filterPlaceholder}\n value={(table.getColumn(filterColumn)?.getFilterValue() as string) ?? \"\"}\n onChange={(event) => table.getColumn(filterColumn)?.setFilterValue(event.target.value)}\n className=\"max-w-sm\"\n />\n )}\n </div>\n <div className=\"flex items-center gap-2\">\n {toolbarActions}\n {showColumnToggle && (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"outline\" size=\"sm\" className=\"ml-auto h-8\">\n <Settings2 className=\"mr-2 h-4 w-4\" />\n Columns\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-40\">\n <DropdownMenuLabel>Toggle columns</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {table\n .getAllColumns()\n .filter((col) => col.getCanHide())\n .map((col) => (\n <DropdownMenuCheckboxItem\n key={col.id}\n className=\"capitalize\"\n checked={col.getIsVisible()}\n onCheckedChange={(value) => col.toggleVisibility(!!value)}\n >\n {col.id}\n </DropdownMenuCheckboxItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n </div>\n </div>\n )}\n\n {/* Table */}\n <div className=\"rounded-md border\">\n <Table>\n <TableHeader>\n {table.getHeaderGroups().map((headerGroup) => (\n <TableRow key={headerGroup.id}>\n {headerGroup.headers.map((header) => (\n <TableHead\n key={header.id}\n className={sc.header}\n style={{ width: header.column.id === \"_select\" ? 40 : (header.getSize() !== 150 ? header.getSize() : undefined) }}\n >\n {header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext())}\n </TableHead>\n ))}\n </TableRow>\n ))}\n </TableHeader>\n <TableBody>\n {table.getRowModel().rows?.length ? (\n table.getRowModel().rows.map((row) => (\n <TableRow key={row.id} data-state={row.getIsSelected() && \"selected\"}>\n {row.getVisibleCells().map((cell) => (\n <TableCell key={cell.id} className={sc.cell}>\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n </TableCell>\n ))}\n </TableRow>\n ))\n ) : (\n <TableRow>\n <TableCell colSpan={finalColumns.length} className=\"h-24 text-center\">\n {emptyMessage}\n </TableCell>\n </TableRow>\n )}\n </TableBody>\n </Table>\n </div>\n\n {/* Footer: selection info + pagination */}\n {(pagination || enableRowSelection) && (\n <div className=\"flex items-center justify-between px-2\">\n <div className=\"flex-1 text-sm text-muted-foreground\">\n {enableRowSelection\n ? `${selectedCount} of ${totalFilteredRows} row(s) selected`\n : `${totalFilteredRows} row(s) total`}\n </div>\n {pagination && (\n <div className=\"flex items-center space-x-6 lg:space-x-8\">\n <div className=\"flex items-center space-x-2\">\n <p className=\"text-sm font-medium\">Rows per page</p>\n <Select\n value={`${paginationVal.pageSize}`}\n onValueChange={(value) => {\n setPaginationVal((old: PaginationState) => ({\n ...old,\n pageIndex: 0,\n pageSize: Number(value),\n }));\n }}\n >\n <SelectTrigger className=\"h-8 w-[70px]\">\n <SelectValue placeholder={`${paginationVal.pageSize}`} />\n </SelectTrigger>\n <SelectContent side=\"top\">\n {pageSizeOptions.map((s) => (\n <SelectItem key={s} value={`${s}`}>\n {s}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"flex w-[100px] items-center justify-center text-sm font-medium\">\n Page {paginationVal.pageIndex + 1} of {table.getPageCount()}\n </div>\n <div className=\"flex items-center space-x-2\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"hidden h-8 w-8 p-0 lg:flex\"\n onClick={() => table.setPageIndex(0)}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to first page</span>\n <ChevronsLeft className=\"h-4 w-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"h-8 w-8 p-0\"\n onClick={() => table.previousPage()}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to previous page</span>\n <ChevronLeft className=\"h-4 w-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"h-8 w-8 p-0\"\n onClick={() => table.nextPage()}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to next page</span>\n <ChevronRight className=\"h-4 w-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"hidden h-8 w-8 p-0 lg:flex\"\n onClick={() => table.setPageIndex(table.getPageCount() - 1)}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to last page</span>\n <ChevronsRight className=\"h-4 w-4\" />\n </Button>\n </div>\n </div>\n )}\n </div>\n )}\n </div>\n );\n}\n\nconst DataTable = React.forwardRef(DataTableInner) as <TData>(\n props: DataTableProps<TData> & { ref?: React.ForwardedRef<HTMLDivElement> }\n) => React.ReactElement;\n\n(DataTable as { displayName?: string }).displayName = \"DataTable\";\n\nexport { DataTable, DataTableColumnHeader };\n","'use client';\n\nimport * as React from 'react';\nimport { Progress as ProgressPrimitive } from 'radix-ui';\nimport { cn } from '../lib/utils';\n\nconst Progress = React.forwardRef<\n React.ComponentRef<typeof ProgressPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>\n>(({ className, value, ...props }, ref) => (\n <ProgressPrimitive.Root\n ref={ref}\n className={cn(\n 'relative h-4 w-full overflow-hidden rounded-full bg-muted',\n className,\n )}\n {...props}\n >\n <ProgressPrimitive.Indicator\n className=\"h-full w-full flex-1 bg-primary transition-all duration-normal ease-default\"\n style={{ transform: `translateX(-${100 - (value || 0)}%)` }}\n />\n </ProgressPrimitive.Root>\n));\nProgress.displayName = ProgressPrimitive.Root.displayName;\n\nexport { Progress };\n","'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../lib/utils';\n\nconst progressBarVariants = cva(\n 'h-full rounded-full transition-all duration-normal ease-default',\n {\n variants: {\n color: {\n primary: 'bg-primary',\n secondary: 'bg-secondary',\n highlight: 'bg-highlight',\n destructive: 'bg-destructive',\n brand: 'bg-brand-accent',\n },\n },\n defaultVariants: {\n color: 'primary',\n },\n },\n);\n\nconst progressBarTrackVariants = cva(\n 'relative w-full overflow-hidden rounded-full bg-muted',\n {\n variants: {\n size: {\n sm: 'h-1.5',\n md: 'h-2.5',\n lg: 'h-4',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\nexport type ProgressBarFormat = 'percent' | 'currency';\n\nexport interface ProgressBarProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color'>,\n VariantProps<typeof progressBarVariants>,\n VariantProps<typeof progressBarTrackVariants> {\n /** Current value. When format is \"percent\", this is 0–100. When format is \"currency\", this is the raw amount (e.g. cents). */\n value?: number;\n /** Maximum value. Default: 100. When format is \"currency\", this is the goal amount in the same unit as value. */\n max?: number;\n /** Label rendered above the bar */\n label?: React.ReactNode;\n /** Whether to show the formatted value text */\n showValue?: boolean;\n /**\n * Display format for the value text.\n * - \"percent\" (default): shows percentage (e.g. \"65%\")\n * - \"currency\": formats value and max as currency (e.g. \"$2,500 of $5,000\")\n */\n format?: ProgressBarFormat;\n /** Intl.NumberFormat locale for currency formatting. Defaults to \"en-US\". */\n locale?: string;\n /** ISO 4217 currency code. Defaults to \"USD\". */\n currency?: string;\n /** Divisor to convert raw value to display value (e.g. 100 for cents → dollars). Defaults to 1. */\n currencyDivisor?: number;\n}\n\nfunction formatCurrency(\n amount: number,\n divisor: number,\n locale: string,\n currency: string,\n): string {\n return new Intl.NumberFormat(locale, {\n style: 'currency',\n currency,\n minimumFractionDigits: 0,\n maximumFractionDigits: 0,\n }).format(amount / divisor);\n}\n\nconst ProgressBar = React.forwardRef<HTMLDivElement, ProgressBarProps>(\n (\n {\n className,\n value = 0,\n max = 100,\n color,\n size,\n label,\n showValue,\n format = 'percent',\n locale = 'en-US',\n currency = 'USD',\n currencyDivisor = 1,\n ...props\n },\n ref,\n ) => {\n const pct = Math.min(100, Math.max(0, (value / max) * 100));\n\n const formattedValue = React.useMemo(() => {\n if (format === 'currency') {\n const current = formatCurrency(\n value,\n currencyDivisor,\n locale,\n currency,\n );\n const goal = formatCurrency(max, currencyDivisor, locale, currency);\n return `${current} of ${goal}`;\n }\n return `${Math.round(pct)}%`;\n }, [format, value, max, pct, currencyDivisor, locale, currency]);\n\n return (\n <div ref={ref} className={cn('w-full', className)} {...props}>\n {(label || showValue) && (\n <div className=\"mb-1.5 flex items-center justify-between text-sm\">\n {label && (\n <span className=\"font-medium text-foreground\">{label}</span>\n )}\n {showValue && (\n <span className=\"text-content-secondary tabular-nums\">\n {formattedValue}\n </span>\n )}\n </div>\n )}\n <div\n className={cn(progressBarTrackVariants({ size }))}\n role=\"progressbar\"\n aria-valuenow={value}\n aria-valuemin={0}\n aria-valuemax={max}\n >\n <div\n className={cn(progressBarVariants({ color }))}\n style={{ width: `${pct}%` }}\n />\n </div>\n </div>\n );\n },\n);\nProgressBar.displayName = 'ProgressBar';\n\nexport { ProgressBar, progressBarVariants };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { ScrollArea as ScrollAreaPrimitive } from \"radix-ui\";\nimport { cn } from \"../lib/utils\";\n\nconst ScrollArea = React.forwardRef<\n React.ComponentRef<typeof ScrollAreaPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>\n>(({ className, children, ...props }, ref) => (\n <ScrollAreaPrimitive.Root ref={ref} className={cn(\"relative overflow-hidden\", className)} {...props}>\n <ScrollAreaPrimitive.Viewport className=\"h-full w-full rounded-[inherit]\">\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n));\nScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;\n\nconst ScrollBar = React.forwardRef<\n React.ComponentRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>\n>(({ className, orientation = \"vertical\", ...props }, ref) => (\n <ScrollAreaPrimitive.ScrollAreaScrollbar\n ref={ref}\n orientation={orientation}\n className={cn(\n \"flex touch-none select-none transition-colors\",\n orientation === \"vertical\" && \"h-full w-2.5 border-l border-l-transparent p-[1px]\",\n orientation === \"horizontal\" && \"h-2.5 flex-col border-t border-t-transparent p-[1px]\",\n className\n )}\n {...props}\n >\n <ScrollAreaPrimitive.ScrollAreaThumb className=\"relative flex-1 rounded-full bg-border\" />\n </ScrollAreaPrimitive.ScrollAreaScrollbar>\n));\nScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;\n\nexport { ScrollArea, ScrollBar };\n","import { cn } from \"../lib/utils\";\n\nfunction Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n return <div className={cn(\"animate-pulse rounded-md bg-muted\", className)} {...props} />;\n}\n\nexport { Skeleton };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Star } from \"lucide-react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../lib/utils\";\n\n// Filled stars use `fill-current`/`stroke-current`, so the star color follows\n// the element's text color. The default `text-highlight` keeps ratings on brand,\n// and consumers can override per-use with any text-color utility (e.g.\n// `text-primary`) via `className` — tailwind-merge lets the override win.\nconst ratingVariants = cva(\"inline-flex items-center text-highlight\", {\n variants: {\n size: {\n sm: \"gap-0.5 [&_svg]:size-3.5\",\n md: \"gap-0.5 [&_svg]:size-4\",\n lg: \"gap-1 [&_svg]:size-5\",\n },\n },\n defaultVariants: {\n size: \"md\",\n },\n});\n\ninterface RatingProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"role\" | \"aria-label\">,\n VariantProps<typeof ratingVariants> {\n /** The rating to display, e.g. 4.3. Clamped to the range [0, count]. */\n rate: number;\n /** Number of stars to render. Defaults to 5. */\n count?: number;\n /** Accessible label. Defaults to \"Rated {rate} out of {count}\". */\n label?: string;\n}\n\n/**\n * Read-only star rating display with fractional fill. A single filled-star layer\n * is clipped to the fractional width over an empty-star track, so a rating like\n * 4.3 shows four full stars and a partial fifth. Presentation only — for input,\n * compose a separate control.\n */\nconst Rating = React.forwardRef<HTMLDivElement, RatingProps>(\n ({ rate, count = 5, size, label, className, ...props }, ref) => {\n const clamped = Math.max(0, Math.min(rate, count));\n const stars = Array.from({ length: count });\n\n return (\n <div\n ref={ref}\n role=\"img\"\n aria-label={label ?? `Rated ${clamped} out of ${count}`}\n className={cn(ratingVariants({ size }), className)}\n {...props}\n >\n {stars.map((_, i) => {\n // Fraction of THIS star that should be filled: 1 fully below the rating,\n // 0 fully above, fractional for the single straddling star.\n const fill = Math.max(0, Math.min(1, clamped - i));\n return (\n <span key={i} className=\"relative inline-flex shrink-0\">\n <Star className=\"fill-muted stroke-muted-foreground/40\" />\n {fill > 0 && (\n <span\n className=\"absolute inset-0 overflow-hidden\"\n style={{ width: `${fill * 100}%` }}\n >\n <Star className=\"fill-current stroke-current\" />\n </span>\n )}\n </span>\n );\n })}\n </div>\n );\n },\n);\nRating.displayName = \"Rating\";\n\nexport { Rating, ratingVariants };\nexport type { RatingProps };\n","import * as React from \"react\";\nimport { LoaderCircle } from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nconst spinnerVariants = cva(\"text-muted-foreground\", {\n variants: {\n size: {\n sm: \"h-4 w-4\",\n md: \"h-6 w-6\",\n lg: \"h-8 w-8\",\n },\n },\n defaultVariants: {\n size: \"md\",\n },\n});\n\nexport interface SpinnerProps\n extends React.HTMLAttributes<HTMLSpanElement>,\n VariantProps<typeof spinnerVariants> {}\n\nfunction Spinner({ className, size, ...props }: SpinnerProps) {\n return (\n <span className={cn(spinnerVariants({ size }), className)} {...props}>\n <LoaderCircle className=\"h-full w-full animate-spin\" />\n </span>\n );\n}\n\nexport { Spinner, spinnerVariants };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { motion } from \"motion/react\";\nimport { cn } from \"../lib/utils\";\n\nexport interface SavedPingProps {\n /**\n * Increments on every successful save. Parents should key this component on\n * `pingCount` (e.g. `<SavedPing key={pingCount} pingCount={pingCount} />`)\n * so each increment remounts the component and replays the animation.\n * Renders nothing while `pingCount === 0`.\n */\n pingCount: number;\n /** Label shown next to the checkmark. Defaults to `\"Saved\"`. */\n label?: string;\n /** Extra classes appended to the pill container. */\n className?: string;\n /** Passed through to the container for test queries. */\n \"data-testid\"?: string;\n}\n\n/**\n * A bespoke \"saved!\" confirmation pill — quieter than a standard toast.\n * Intended for background autosave flows where success needs acknowledgment\n * without interrupting the user. Uses the `success-*` semantic color scale so\n * it inherits the theme's success hue.\n *\n * Visual: small circle with light success fill, darker success border, and an\n * animated SVG checkmark that draws in. The whole pill fades in, drifts up,\n * holds briefly, then fades out.\n */\nconst SavedPing = React.forwardRef<HTMLDivElement, SavedPingProps>(\n (\n { pingCount, label = \"Saved\", className, \"data-testid\": dataTestId },\n ref,\n ) => {\n if (pingCount === 0) return null;\n\n return (\n <motion.div\n ref={ref}\n role=\"status\"\n aria-live=\"polite\"\n aria-label={label}\n data-testid={dataTestId}\n initial={{ opacity: 0, y: 14, scale: 0.92 }}\n animate={{\n opacity: [0, 1, 1, 0],\n y: [14, 0, -6, -16],\n scale: [0.92, 1, 1, 0.96],\n }}\n transition={{\n duration: 1.4,\n times: [0, 0.15, 0.75, 1],\n ease: [0.22, 1, 0.36, 1],\n }}\n className={cn(\n \"pointer-events-none flex h-9 items-center gap-2 rounded-full border border-success-500 bg-success-50 pr-3.5 pl-2 text-sm font-medium text-success-700 shadow-sm shadow-success-500/10 dark:border-success-400 dark:bg-success-950/60 dark:text-success-200 dark:shadow-success-500/20\",\n className,\n )}\n >\n <span\n aria-hidden\n className=\"flex h-6 w-6 items-center justify-center rounded-full border border-success-500 bg-success-100/80 dark:border-success-400 dark:bg-success-900/60\"\n >\n <svg\n viewBox=\"0 0 20 20\"\n className=\"h-3.5 w-3.5\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2.5}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <motion.path\n d=\"M4 10.5 L8.5 15 L16 6\"\n initial={{ pathLength: 0, opacity: 0 }}\n animate={{ pathLength: 1, opacity: 1 }}\n transition={{\n pathLength: { delay: 0.18, duration: 0.32, ease: \"easeOut\" },\n opacity: { delay: 0.18, duration: 0.05 },\n }}\n />\n </svg>\n </span>\n <span>{label}</span>\n </motion.div>\n );\n },\n);\nSavedPing.displayName = \"SavedPing\";\n\nexport { SavedPing };\n","'use client';\n\n/**\n * ContextMenu mirrors `dropdown-menu.tsx` visually — Radix UI ships them as\n * separate primitives because the trigger semantics differ (right-click vs\n * click), but the rendered chrome is identical. Both import from\n * `lib/surface-classes.ts` so any visual tweak updates both automatically.\n *\n * If you need to change the look of menus, edit `surface-classes.ts`\n * (the `menuSurfaceClasses` / `menuItemClasses` exports). Do NOT edit one\n * of these files without the other.\n */\n\nimport * as React from 'react';\nimport { ContextMenu as ContextMenuPrimitive } from 'radix-ui';\nimport { Check, ChevronRight, Circle } from 'lucide-react';\nimport { cn } from '../lib/utils';\nimport {\n floatingAnimationClasses,\n menuItemClasses,\n menuItemWithIndicatorClasses,\n menuSeparatorClasses,\n menuSurfaceClasses,\n} from '../lib/surface-classes';\n\nconst ContextMenu = ContextMenuPrimitive.Root;\nconst ContextMenuTrigger = ContextMenuPrimitive.Trigger;\nconst ContextMenuGroup = ContextMenuPrimitive.Group;\nconst ContextMenuPortal = ContextMenuPrimitive.Portal;\nconst ContextMenuSub = ContextMenuPrimitive.Sub;\nconst ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;\n\nconst ContextMenuSubTrigger = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <ContextMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n menuItemClasses,\n 'data-[state=open]:bg-accent data-[state=open]:text-accent-foreground',\n inset && 'pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto h-4 w-4\" />\n </ContextMenuPrimitive.SubTrigger>\n));\nContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;\n\nconst ContextMenuSubContent = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.SubContent\n ref={ref}\n className={cn(menuSurfaceClasses, floatingAnimationClasses, className)}\n {...props}\n />\n));\nContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;\n\nconst ContextMenuContent = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n ref={ref}\n className={cn(menuSurfaceClasses, floatingAnimationClasses, className)}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n));\nContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;\n\nconst ContextMenuItem = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Item\n ref={ref}\n className={cn(menuItemClasses, inset && 'pl-8', className)}\n {...props}\n />\n));\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\n\nconst ContextMenuCheckboxItem = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <ContextMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(menuItemWithIndicatorClasses, className)}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n));\nContextMenuCheckboxItem.displayName =\n ContextMenuPrimitive.CheckboxItem.displayName;\n\nconst ContextMenuRadioItem = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <ContextMenuPrimitive.RadioItem\n ref={ref}\n className={cn(menuItemWithIndicatorClasses, className)}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <Circle className=\"h-2 w-2 fill-current\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n));\nContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;\n\nconst ContextMenuLabel = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Label\n ref={ref}\n className={cn(\n 'px-2 py-1.5 text-sm font-semibold text-foreground',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n));\nContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;\n\nconst ContextMenuSeparator = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Separator\n ref={ref}\n className={cn(menuSeparatorClasses, className)}\n {...props}\n />\n));\nContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;\n\nconst ContextMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => (\n <span\n className={cn(\n 'ml-auto text-xs tracking-widest text-muted-foreground',\n className,\n )}\n {...props}\n />\n);\n\nexport {\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuContent,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioItem,\n ContextMenuLabel,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuGroup,\n ContextMenuPortal,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuRadioGroup,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport { NavigationMenu as NavigationMenuPrimitive } from \"radix-ui\";\nimport { ChevronDown } from \"lucide-react\";\nimport { cva } from \"class-variance-authority\";\nimport { cn } from \"../lib/utils\";\n\nconst NavigationMenu = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root> & {\n /**\n * When `true` (default) all panels render into a single shared, animated\n * viewport centered under the menu. When `false`, each panel renders in\n * place and anchors directly under its own trigger — the right choice for\n * hover mega-menu headers where panels should drop beneath their item.\n */\n viewport?: boolean;\n }\n>(({ className, children, viewport = true, ...props }, ref) => (\n <NavigationMenuPrimitive.Root\n ref={ref}\n data-viewport={viewport}\n className={cn(\n \"group/navigation-menu relative z-10 flex max-w-max flex-1 items-center justify-center\",\n className,\n )}\n {...props}\n >\n {children}\n {viewport ? <NavigationMenuViewport /> : null}\n </NavigationMenuPrimitive.Root>\n));\nNavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;\n\nconst NavigationMenuList = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.List\n ref={ref}\n className={cn(\"group flex flex-1 list-none items-center justify-center space-x-1\", className)}\n {...props}\n />\n));\nNavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;\n\n// `relative` so that, in `viewport={false}` mode, each `NavigationMenuContent`\n// anchors to its own item instead of the menu root.\nconst NavigationMenuItem = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Item ref={ref} className={cn(\"relative\", className)} {...props} />\n));\nNavigationMenuItem.displayName = NavigationMenuPrimitive.Item.displayName;\n\nconst navigationMenuTriggerStyle = cva(\n \"group inline-flex h-[var(--density-height-md)] w-max items-center justify-center rounded-md bg-transparent px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50\"\n);\n\nconst NavigationMenuTrigger = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Trigger\n ref={ref}\n className={cn(navigationMenuTriggerStyle(), \"group\", className)}\n {...props}\n >\n {children}{\" \"}\n <ChevronDown\n className=\"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180\"\n aria-hidden=\"true\"\n />\n </NavigationMenuPrimitive.Trigger>\n));\nNavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;\n\nconst NavigationMenuContent = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"left-0 top-0 w-full 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 md:absolute md:w-auto\",\n // viewport={false}: become a standalone popover surface anchored under the trigger\n \"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:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:shadow-lg group-data-[viewport=false]/navigation-menu:duration-200 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=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0\",\n className\n )}\n {...props}\n />\n));\nNavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;\n\nconst NavigationMenuLink = NavigationMenuPrimitive.Link;\n\nconst NavigationMenuViewport = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Viewport>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>\n>(({ className, ...props }, ref) => (\n <div className={cn(\"absolute left-0 top-full flex justify-center\")}>\n <NavigationMenuPrimitive.Viewport\n className={cn(\n \"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]\",\n className\n )}\n ref={ref}\n {...props}\n />\n </div>\n));\nNavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;\n\nconst NavigationMenuIndicator = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Indicator>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Indicator\n ref={ref}\n className={cn(\n \"top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in\",\n className\n )}\n {...props}\n >\n <div className=\"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md\" />\n </NavigationMenuPrimitive.Indicator>\n));\nNavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;\n\nexport {\n navigationMenuTriggerStyle,\n NavigationMenu,\n NavigationMenuList,\n NavigationMenuItem,\n NavigationMenuContent,\n NavigationMenuTrigger,\n NavigationMenuLink,\n NavigationMenuIndicator,\n NavigationMenuViewport,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Slot as SlotPrimitive } from \"radix-ui\";\nimport { ChevronRight, MoreHorizontal } from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\n\nconst Breadcrumb = React.forwardRef<\n HTMLElement,\n React.ComponentPropsWithoutRef<\"nav\"> & { separator?: React.ReactNode }\n>(({ ...props }, ref) => <nav ref={ref} aria-label=\"breadcrumb\" {...props} />);\nBreadcrumb.displayName = \"Breadcrumb\";\n\nconst BreadcrumbList = React.forwardRef<HTMLOListElement, React.ComponentPropsWithoutRef<\"ol\">>(\n ({ className, ...props }, ref) => (\n <ol\n ref={ref}\n className={cn(\n \"flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5\",\n className\n )}\n {...props}\n />\n )\n);\nBreadcrumbList.displayName = \"BreadcrumbList\";\n\nconst BreadcrumbItem = React.forwardRef<HTMLLIElement, React.ComponentPropsWithoutRef<\"li\">>(\n ({ className, ...props }, ref) => (\n <li ref={ref} className={cn(\"inline-flex items-center gap-1.5\", className)} {...props} />\n )\n);\nBreadcrumbItem.displayName = \"BreadcrumbItem\";\n\nconst BreadcrumbLink = React.forwardRef<\n HTMLAnchorElement,\n React.ComponentPropsWithoutRef<\"a\"> & { asChild?: boolean }\n>(({ asChild, className, ...props }, ref) => {\n const Comp = asChild ? SlotPrimitive.Slot : \"a\";\n return (\n <Comp\n ref={ref}\n className={cn(\"transition-colors hover:text-foreground\", className)}\n {...props}\n />\n );\n});\nBreadcrumbLink.displayName = \"BreadcrumbLink\";\n\nconst BreadcrumbPage = React.forwardRef<HTMLSpanElement, React.ComponentPropsWithoutRef<\"span\">>(\n ({ className, ...props }, ref) => (\n <span\n ref={ref}\n role=\"link\"\n aria-disabled=\"true\"\n aria-current=\"page\"\n className={cn(\"font-normal text-foreground\", className)}\n {...props}\n />\n )\n);\nBreadcrumbPage.displayName = \"BreadcrumbPage\";\n\nconst BreadcrumbSeparator = ({ children, className, ...props }: React.ComponentProps<\"li\">) => (\n <li role=\"presentation\" aria-hidden=\"true\" className={cn(\"[&>svg]:h-3.5 [&>svg]:w-3.5\", className)} {...props}>\n {children ?? <ChevronRight />}\n </li>\n);\nBreadcrumbSeparator.displayName = \"BreadcrumbSeparator\";\n\nconst BreadcrumbEllipsis = ({ className, ...props }: React.ComponentProps<\"span\">) => (\n <span\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"flex h-9 w-9 items-center justify-center\", className)}\n {...props}\n >\n <MoreHorizontal className=\"h-4 w-4\" />\n <span className=\"sr-only\">More</span>\n </span>\n);\nBreadcrumbEllipsis.displayName = \"BreadcrumbEllipsis\";\n\nexport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbPage,\n BreadcrumbSeparator,\n BreadcrumbEllipsis,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport { ChevronLeft, ChevronRight, MoreHorizontal } from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\nimport { type ButtonProps, buttonVariants } from \"./button\";\n\nconst Pagination = ({ className, ...props }: React.ComponentProps<\"nav\">) => (\n <nav\n role=\"navigation\"\n aria-label=\"pagination\"\n className={cn(\"mx-auto flex w-full justify-center\", className)}\n {...props}\n />\n);\nPagination.displayName = \"Pagination\";\n\nconst PaginationContent = React.forwardRef<HTMLUListElement, React.ComponentPropsWithoutRef<\"ul\">>(\n ({ className, ...props }, ref) => (\n <ul ref={ref} className={cn(\"flex flex-row items-center gap-1\", className)} {...props} />\n )\n);\nPaginationContent.displayName = \"PaginationContent\";\n\nconst PaginationItem = React.forwardRef<HTMLLIElement, React.ComponentPropsWithoutRef<\"li\">>(\n ({ className, ...props }, ref) => <li ref={ref} className={cn(\"\", className)} {...props} />\n);\nPaginationItem.displayName = \"PaginationItem\";\n\ntype PaginationLinkProps = {\n isActive?: boolean;\n} & Pick<ButtonProps, \"size\"> &\n React.ComponentProps<\"a\">;\n\nconst PaginationLink = ({ className, isActive, size = \"icon\", ...props }: PaginationLinkProps) => (\n <a\n aria-current={isActive ? \"page\" : undefined}\n className={cn(\n buttonVariants({\n variant: isActive ? \"outline\" : \"ghost\",\n size,\n }),\n className\n )}\n {...props}\n />\n);\nPaginationLink.displayName = \"PaginationLink\";\n\nconst PaginationPrevious = ({ className, ...props }: React.ComponentProps<typeof PaginationLink>) => (\n <PaginationLink aria-label=\"Go to previous page\" size=\"md\" className={cn(\"gap-1 pl-2.5\", className)} {...props}>\n <ChevronLeft className=\"h-4 w-4\" />\n <span>Previous</span>\n </PaginationLink>\n);\nPaginationPrevious.displayName = \"PaginationPrevious\";\n\nconst PaginationNext = ({ className, ...props }: React.ComponentProps<typeof PaginationLink>) => (\n <PaginationLink aria-label=\"Go to next page\" size=\"md\" className={cn(\"gap-1 pr-2.5\", className)} {...props}>\n <span>Next</span>\n <ChevronRight className=\"h-4 w-4\" />\n </PaginationLink>\n);\nPaginationNext.displayName = \"PaginationNext\";\n\nconst PaginationEllipsis = ({ className, ...props }: React.ComponentProps<\"span\">) => (\n <span aria-hidden className={cn(\"flex h-9 w-9 items-center justify-center\", className)} {...props}>\n <MoreHorizontal className=\"h-4 w-4\" />\n <span className=\"sr-only\">More pages</span>\n </span>\n);\nPaginationEllipsis.displayName = \"PaginationEllipsis\";\n\nexport {\n Pagination,\n PaginationContent,\n PaginationEllipsis,\n PaginationItem,\n PaginationLink,\n PaginationNext,\n PaginationPrevious,\n};\n","'use client';\n\nimport * as React from 'react';\nimport { Command as CommandPrimitive } from 'cmdk';\nimport { Search } from 'lucide-react';\nimport { cn } from '../lib/utils';\nimport { menuItemClasses } from '../lib/surface-classes';\nimport { Dialog, DialogContent } from './dialog';\n\nconst Command = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n 'flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground',\n className,\n )}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\ninterface CommandDialogProps\n extends React.ComponentPropsWithoutRef<typeof Dialog> {}\n\nconst CommandDialog = ({ children, ...props }: CommandDialogProps) => (\n <Dialog {...props}>\n <DialogContent className=\"overflow-hidden p-0 shadow-lg\">\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[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\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n);\n\nconst CommandInput = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Input>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>\n>(({ className, ...props }, ref) => (\n <div className=\"flex items-center border-b px-3\" cmdk-input-wrapper=\"\">\n <Search className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n 'flex h-11 w-full rounded-md bg-transparent py-3 text-base sm:text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n />\n </div>\n));\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\nconst CommandList = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn('max-h-[300px] overflow-y-auto overflow-x-hidden', className)}\n {...props}\n />\n));\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nconst CommandEmpty = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => (\n <CommandPrimitive.Empty\n ref={ref}\n className=\"py-6 text-center text-sm\"\n {...props}\n />\n));\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nconst CommandGroup = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n 'overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground',\n className,\n )}\n {...props}\n />\n));\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nconst CommandSeparator = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 h-px bg-border', className)}\n {...props}\n />\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\nconst CommandItem = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n menuItemClasses,\n 'data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground',\n className,\n )}\n {...props}\n />\n));\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nconst CommandShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => (\n <span\n className={cn(\n 'ml-auto text-xs tracking-widest text-muted-foreground',\n className,\n )}\n {...props}\n />\n);\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n","'use client';\n\nimport * as React from 'react';\nimport { Check, Pencil, X } from 'lucide-react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../lib/utils';\nimport { Button } from './button';\n\nconst editableTitleVariants = cva(\n 'inline-flex items-center gap-2 font-semibold text-foreground',\n {\n variants: {\n size: {\n sm: 'text-lg',\n md: 'text-2xl',\n lg: 'text-4xl',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\nconst editableTitleInputVariants = cva(\n 'bg-transparent border-b-2 border-primary outline-none font-semibold text-foreground w-full min-w-0',\n {\n variants: {\n size: {\n sm: 'text-lg pb-0.5',\n md: 'text-2xl pb-1',\n lg: 'text-4xl pb-1.5',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\n/**\n * Fixed square chrome for edit / confirm / cancel: outer box is identical regardless of glyph.\n * Overrides `Button` `size=\"icon\"` density vars so all three match exactly.\n */\nfunction titleActionButtonClass(size: 'sm' | 'md' | 'lg' | null | undefined) {\n switch (size) {\n case 'sm':\n return 'box-border aspect-square size-6 min-h-6 min-w-6 max-h-6 max-w-6 shrink-0 p-0 leading-none overflow-hidden inline-flex items-center justify-center [&_svg]:block [&_svg]:size-3 [&_svg]:shrink-0';\n case 'lg':\n return 'box-border aspect-square size-10 min-h-10 min-w-10 max-h-10 max-w-10 shrink-0 p-0 leading-none overflow-hidden inline-flex items-center justify-center [&_svg]:block [&_svg]:size-5 [&_svg]:shrink-0';\n default:\n return 'box-border aspect-square size-8 min-h-8 min-w-8 max-h-8 max-w-8 shrink-0 p-0 leading-none overflow-hidden inline-flex items-center justify-center [&_svg]:block [&_svg]:size-4 [&_svg]:shrink-0';\n }\n}\n\n/** Loading affordance: same outer square as action buttons. */\nfunction loadingSpinnerWrapClass(size: 'sm' | 'md' | 'lg' | null | undefined) {\n switch (size) {\n case 'sm':\n return 'box-border size-6 min-h-6 min-w-6 max-h-6 max-w-6 [&_svg]:size-3';\n case 'lg':\n return 'box-border size-10 min-h-10 min-w-10 max-h-10 max-w-10 [&_svg]:size-5';\n default:\n return 'box-border size-8 min-h-8 min-w-8 max-h-8 max-w-8 [&_svg]:size-4';\n }\n}\n\nexport interface EditableTitleProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'>,\n VariantProps<typeof editableTitleVariants> {\n /** The current title value */\n value: string;\n /** Callback when the title is saved */\n onSave?: (value: string) => void;\n /** Callback on every keystroke while editing */\n onChange?: (value: string) => void;\n /** Placeholder text when the title is empty */\n placeholder?: string;\n /** Whether the title is editable */\n disabled?: boolean;\n /** Whether a save operation is in progress */\n loading?: boolean;\n /** Maximum character length */\n maxLength?: number;\n}\n\nconst EditableTitle = React.forwardRef<HTMLDivElement, EditableTitleProps>(\n (\n {\n className,\n size,\n value,\n onSave,\n onChange,\n placeholder = 'Untitled',\n disabled = false,\n loading = false,\n maxLength,\n ...props\n },\n ref,\n ) => {\n const [isEditing, setIsEditing] = React.useState(false);\n const [draft, setDraft] = React.useState(value);\n /** Avoids a flash: after save/cancel the pointer often sits where the pen mounts, so hover would show it immediately. */\n const [suppressPenReveal, setSuppressPenReveal] = React.useState(false);\n const inputRef = React.useRef<HTMLInputElement>(null);\n\n React.useEffect(() => {\n if (!suppressPenReveal) return;\n const t = window.setTimeout(() => setSuppressPenReveal(false), 200);\n return () => clearTimeout(t);\n }, [suppressPenReveal]);\n\n React.useEffect(() => {\n if (!isEditing) {\n setDraft(value);\n }\n }, [value, isEditing]);\n\n React.useEffect(() => {\n if (isEditing && inputRef.current) {\n inputRef.current.focus();\n inputRef.current.select();\n }\n }, [isEditing]);\n\n const startEditing = () => {\n if (disabled || loading) return;\n setSuppressPenReveal(false);\n setDraft(value);\n setIsEditing(true);\n };\n\n const endEditing = () => {\n setSuppressPenReveal(true);\n setIsEditing(false);\n };\n\n const save = () => {\n const trimmed = draft.trim();\n if (trimmed && trimmed !== value) {\n onSave?.(trimmed);\n }\n endEditing();\n };\n\n const cancel = () => {\n setDraft(value);\n endEditing();\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n save();\n } else if (e.key === 'Escape') {\n e.preventDefault();\n cancel();\n }\n };\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n if (maxLength && newValue.length > maxLength) return;\n setDraft(newValue);\n onChange?.(newValue);\n };\n\n if (isEditing) {\n return (\n <div\n ref={ref}\n className={cn(editableTitleVariants({ size }), className)}\n {...props}\n >\n <input\n ref={inputRef}\n type=\"text\"\n value={draft}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n onBlur={save}\n placeholder={placeholder}\n maxLength={maxLength}\n className={cn(\n editableTitleInputVariants({ size }),\n 'min-w-0 flex-1',\n )}\n aria-label=\"Edit title\"\n />\n <Button\n type=\"button\"\n variant=\"actionPositive\"\n size=\"icon\"\n className={titleActionButtonClass(size)}\n onMouseDown={(e) => e.preventDefault()}\n onClick={save}\n aria-label=\"Save title\"\n >\n <Check />\n </Button>\n <Button\n type=\"button\"\n variant=\"actionNegative\"\n size=\"icon\"\n className={titleActionButtonClass(size)}\n onMouseDown={(e) => e.preventDefault()}\n onClick={cancel}\n aria-label=\"Cancel editing\"\n >\n <X />\n </Button>\n </div>\n );\n }\n\n return (\n <div\n ref={ref}\n className={cn(editableTitleVariants({ size }), 'group', className)}\n {...props}\n >\n <span\n className={cn(\n 'cursor-pointer hover:text-primary transition-colors duration-fast ease-default',\n disabled && 'cursor-default hover:text-foreground',\n loading && 'cursor-wait hover:text-foreground opacity-70',\n )}\n onClick={startEditing}\n role=\"button\"\n tabIndex={disabled ? -1 : 0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n startEditing();\n }\n }}\n aria-label={disabled ? value : `Edit title: ${value}`}\n >\n {value || placeholder}\n </span>\n {!disabled && !loading && (\n <Button\n type=\"button\"\n variant=\"actionNeutral\"\n size=\"icon\"\n className={cn(\n 'transition-opacity duration-fast ease-default',\n titleActionButtonClass(size),\n suppressPenReveal\n ? 'pointer-events-none opacity-0'\n : 'opacity-0 group-hover:opacity-100 group-focus-within:opacity-100',\n )}\n onClick={startEditing}\n tabIndex={-1}\n aria-hidden=\"true\"\n >\n <Pencil />\n </Button>\n )}\n {loading && (\n <span\n className={cn(\n 'inline-flex items-center justify-center shrink-0 rounded-md text-muted-foreground',\n loadingSpinnerWrapClass(size),\n 'animate-spin pointer-events-none',\n )}\n aria-label=\"Saving\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n className=\"opacity-25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n />\n <path\n className=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z\"\n />\n </svg>\n </span>\n )}\n </div>\n );\n },\n);\nEditableTitle.displayName = 'EditableTitle';\n\nexport { EditableTitle, editableTitleVariants };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { AspectRatio as AspectRatioPrimitive } from \"radix-ui\";\n\nconst AspectRatio = AspectRatioPrimitive.Root;\n\nexport { AspectRatio };\n","\"use client\";\n\nimport { Collapsible as CollapsiblePrimitive } from \"radix-ui\";\n\nfunction Collapsible({\n ...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} />;\n}\n\nfunction CollapsibleTrigger({\n ...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {\n return (\n <CollapsiblePrimitive.CollapsibleTrigger\n data-slot=\"collapsible-trigger\"\n {...props}\n />\n );\n}\n\nfunction CollapsibleContent({\n ...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {\n return (\n <CollapsiblePrimitive.CollapsibleContent\n data-slot=\"collapsible-content\"\n {...props}\n />\n );\n}\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { PanelLeft } from \"lucide-react\";\nimport { Slot as SlotPrimitive } from \"radix-ui\";\n\nimport { useIsMobile } from \"../hooks/use-mobile\";\nimport { cn } from \"../lib/utils\";\nimport { Button } from \"./button\";\nimport { Input } from \"./input\";\nimport { Separator } from \"./separator\";\nimport {\n Sheet,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n} from \"./sheet\";\nimport { Skeleton } from \"./skeleton\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from \"./tooltip\";\n\nconst SIDEBAR_COOKIE_NAME = \"sidebar_state\";\nconst SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;\nconst SIDEBAR_WIDTH = \"16rem\";\nconst SIDEBAR_WIDTH_MOBILE = \"18rem\";\nconst SIDEBAR_WIDTH_ICON = \"3rem\";\nconst SIDEBAR_KEYBOARD_SHORTCUT = \"b\";\n\ntype SidebarContextProps = {\n state: \"expanded\" | \"collapsed\";\n open: boolean;\n setOpen: (open: boolean) => void;\n openMobile: boolean;\n setOpenMobile: (open: boolean) => void;\n isMobile: boolean;\n toggleSidebar: () => void;\n};\n\nconst SidebarContext = React.createContext<SidebarContextProps | null>(null);\n\nfunction useSidebar() {\n const context = React.useContext(SidebarContext);\n if (!context) {\n throw new Error(\"useSidebar must be used within a SidebarProvider.\");\n }\n return context;\n}\n\nfunction SidebarProvider({\n defaultOpen = true,\n open: openProp,\n onOpenChange: setOpenProp,\n className,\n style,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & {\n defaultOpen?: boolean;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n}) {\n const isMobile = useIsMobile();\n const [openMobile, setOpenMobile] = React.useState(false);\n\n const [_open, _setOpen] = React.useState(defaultOpen);\n const open = openProp ?? _open;\n const setOpen = React.useCallback(\n (value: boolean | ((value: boolean) => boolean)) => {\n const openState = typeof value === \"function\" ? value(open) : value;\n if (setOpenProp) {\n setOpenProp(openState);\n } else {\n _setOpen(openState);\n }\n document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;\n },\n [setOpenProp, open]\n );\n\n const toggleSidebar = React.useCallback(() => {\n return isMobile\n ? setOpenMobile((open) => !open)\n : setOpen((open) => !open);\n }, [isMobile, setOpen, setOpenMobile]);\n\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (\n event.key === SIDEBAR_KEYBOARD_SHORTCUT &&\n (event.metaKey || event.ctrlKey)\n ) {\n event.preventDefault();\n toggleSidebar();\n }\n };\n window.addEventListener(\"keydown\", handleKeyDown);\n return () => window.removeEventListener(\"keydown\", handleKeyDown);\n }, [toggleSidebar]);\n\n const state = open ? \"expanded\" : \"collapsed\";\n\n const contextValue = React.useMemo<SidebarContextProps>(\n () => ({\n state,\n open,\n setOpen,\n isMobile,\n openMobile,\n setOpenMobile,\n toggleSidebar,\n }),\n [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]\n );\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <TooltipProvider delayDuration={0}>\n <div\n data-slot=\"sidebar-wrapper\"\n style={\n {\n \"--sidebar-width\": SIDEBAR_WIDTH,\n \"--sidebar-width-icon\": SIDEBAR_WIDTH_ICON,\n ...style,\n } as React.CSSProperties\n }\n className={cn(\n \"group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n </TooltipProvider>\n </SidebarContext.Provider>\n );\n}\n\nfunction Sidebar({\n side = \"left\",\n variant = \"sidebar\",\n collapsible = \"offcanvas\",\n className,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & {\n side?: \"left\" | \"right\";\n variant?: \"sidebar\" | \"floating\" | \"inset\";\n collapsible?: \"offcanvas\" | \"icon\" | \"none\";\n}) {\n const { isMobile, state, openMobile, setOpenMobile } = useSidebar();\n\n if (collapsible === \"none\") {\n return (\n <div\n data-slot=\"sidebar\"\n className={cn(\n \"flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n );\n }\n\n if (isMobile) {\n return (\n <Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>\n <SheetContent\n data-sidebar=\"sidebar\"\n data-slot=\"sidebar\"\n data-mobile=\"true\"\n className=\"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden\"\n style={\n {\n \"--sidebar-width\": SIDEBAR_WIDTH_MOBILE,\n } as React.CSSProperties\n }\n side={side}\n >\n <SheetHeader className=\"sr-only\">\n <SheetTitle>Sidebar</SheetTitle>\n <SheetDescription>Displays the mobile sidebar.</SheetDescription>\n </SheetHeader>\n <div className=\"flex h-full w-full flex-col\">{children}</div>\n </SheetContent>\n </Sheet>\n );\n }\n\n return (\n <div\n className=\"group peer hidden text-sidebar-foreground md:block\"\n data-state={state}\n data-collapsible={state === \"collapsed\" ? collapsible : \"\"}\n data-variant={variant}\n data-side={side}\n data-slot=\"sidebar\"\n >\n <div\n data-slot=\"sidebar-gap\"\n className={cn(\n \"relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear\",\n \"group-data-[collapsible=offcanvas]:w-0\",\n \"group-data-[side=right]:rotate-180\",\n variant === \"floating\" || variant === \"inset\"\n ? \"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]\"\n : \"group-data-[collapsible=icon]:w-(--sidebar-width-icon)\"\n )}\n />\n <div\n data-slot=\"sidebar-container\"\n className={cn(\n \"fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex\",\n side === \"left\"\n ? \"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]\"\n : \"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]\",\n variant === \"floating\" || variant === \"inset\"\n ? \"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]\"\n : \"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l\",\n className\n )}\n {...props}\n >\n <div\n data-sidebar=\"sidebar\"\n data-slot=\"sidebar-inner\"\n className=\"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm\"\n >\n {children}\n </div>\n </div>\n </div>\n );\n}\n\nfunction SidebarTrigger({\n className,\n onClick,\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { toggleSidebar } = useSidebar();\n\n return (\n <Button\n data-sidebar=\"trigger\"\n data-slot=\"sidebar-trigger\"\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\"size-7\", className)}\n onClick={(event) => {\n onClick?.(event);\n toggleSidebar();\n }}\n {...props}\n >\n <PanelLeft />\n <span className=\"sr-only\">Toggle Sidebar</span>\n </Button>\n );\n}\n\nfunction SidebarRail({ className, ...props }: React.ComponentProps<\"button\">) {\n const { toggleSidebar } = useSidebar();\n\n return (\n <button\n data-sidebar=\"rail\"\n data-slot=\"sidebar-rail\"\n aria-label=\"Toggle Sidebar\"\n tabIndex={-1}\n onClick={toggleSidebar}\n title=\"Toggle Sidebar\"\n className={cn(\n \"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] hover:after:bg-sidebar-border sm:flex\",\n \"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize\",\n \"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize\",\n \"group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar\",\n \"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2\",\n \"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarInset({ className, ...props }: React.ComponentProps<\"main\">) {\n return (\n <main\n data-slot=\"sidebar-inset\"\n className={cn(\n \"relative flex w-full flex-1 flex-col bg-background\",\n \"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\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarInput({\n className,\n ...props\n}: React.ComponentProps<typeof Input>) {\n return (\n <Input\n data-slot=\"sidebar-input\"\n data-sidebar=\"input\"\n className={cn(\"h-8 w-full bg-background shadow-none\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-header\"\n data-sidebar=\"header\"\n className={cn(\"flex flex-col gap-2 p-2\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-footer\"\n data-sidebar=\"footer\"\n className={cn(\"flex flex-col gap-2 p-2\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof Separator>) {\n return (\n <Separator\n data-slot=\"sidebar-separator\"\n data-sidebar=\"separator\"\n className={cn(\"mx-2 w-auto bg-sidebar-border\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-content\"\n data-sidebar=\"content\"\n className={cn(\n \"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-group\"\n data-sidebar=\"group\"\n className={cn(\"relative flex w-full min-w-0 flex-col p-2\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarGroupLabel({\n className,\n asChild = false,\n ...props\n}: React.ComponentProps<\"div\"> & { asChild?: boolean }) {\n const Comp = asChild ? SlotPrimitive.Slot : \"div\";\n\n return (\n <Comp\n data-slot=\"sidebar-group-label\"\n data-sidebar=\"group-label\"\n className={cn(\n \"flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n \"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarGroupAction({\n className,\n asChild = false,\n ...props\n}: React.ComponentProps<\"button\"> & { asChild?: boolean }) {\n const Comp = asChild ? SlotPrimitive.Slot : \"button\";\n\n return (\n <Comp\n data-slot=\"sidebar-group-action\"\n data-sidebar=\"group-action\"\n className={cn(\n \"absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n \"after:absolute after:-inset-2 md:after:hidden\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarGroupContent({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-group-content\"\n data-sidebar=\"group-content\"\n className={cn(\"w-full text-sm\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarMenu({ className, ...props }: React.ComponentProps<\"ul\">) {\n return (\n <ul\n data-slot=\"sidebar-menu\"\n data-sidebar=\"menu\"\n className={cn(\"flex w-full min-w-0 flex-col gap-1\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuItem({ className, ...props }: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"sidebar-menu-item\"\n data-sidebar=\"menu-item\"\n className={cn(\"group/menu-item relative\", className)}\n {...props}\n />\n );\n}\n\nconst sidebarMenuButtonVariants = cva(\n \"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! 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 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 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0\",\n {\n variants: {\n variant: {\n default:\n \"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground\",\n outline:\n \"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))]\",\n },\n size: {\n default: \"h-8 text-sm\",\n sm: \"h-7 text-xs\",\n lg: \"h-12 text-sm group-data-[collapsible=icon]:p-0!\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\nfunction SidebarMenuButton({\n asChild = false,\n isActive = false,\n variant = \"default\",\n size = \"default\",\n tooltip,\n className,\n ...props\n}: React.ComponentProps<\"button\"> & {\n asChild?: boolean;\n isActive?: boolean;\n tooltip?: string | React.ComponentProps<typeof TooltipContent>;\n} & VariantProps<typeof sidebarMenuButtonVariants>) {\n const Comp = asChild ? SlotPrimitive.Slot : \"button\";\n const { isMobile, state } = useSidebar();\n\n const button = (\n <Comp\n data-slot=\"sidebar-menu-button\"\n data-sidebar=\"menu-button\"\n data-size={size}\n data-active={isActive}\n className={cn(sidebarMenuButtonVariants({ variant, size }), className)}\n {...props}\n />\n );\n\n if (!tooltip) {\n return button;\n }\n\n if (typeof tooltip === \"string\") {\n tooltip = {\n children: tooltip,\n };\n }\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n <TooltipContent\n side=\"right\"\n align=\"center\"\n hidden={state !== \"collapsed\" || isMobile}\n {...tooltip}\n />\n </Tooltip>\n );\n}\n\nfunction SidebarMenuAction({\n className,\n asChild = false,\n showOnHover = false,\n ...props\n}: React.ComponentProps<\"button\"> & {\n asChild?: boolean;\n showOnHover?: boolean;\n}) {\n const Comp = asChild ? SlotPrimitive.Slot : \"button\";\n\n return (\n <Comp\n data-slot=\"sidebar-menu-action\"\n data-sidebar=\"menu-action\"\n className={cn(\n \"absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n \"after:absolute after:-inset-2 md:after:hidden\",\n \"peer-data-[size=sm]/menu-button:top-1\",\n \"peer-data-[size=default]/menu-button:top-1.5\",\n \"peer-data-[size=lg]/menu-button:top-2.5\",\n \"group-data-[collapsible=icon]:hidden\",\n showOnHover &&\n \"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground data-[state=open]:opacity-100 md:opacity-0\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuBadge({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-menu-badge\"\n data-sidebar=\"menu-badge\"\n className={cn(\n \"pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none\",\n \"peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground\",\n \"peer-data-[size=sm]/menu-button:top-1\",\n \"peer-data-[size=default]/menu-button:top-1.5\",\n \"peer-data-[size=lg]/menu-button:top-2.5\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuSkeleton({\n className,\n showIcon = false,\n ...props\n}: React.ComponentProps<\"div\"> & {\n showIcon?: boolean;\n}) {\n const width = React.useMemo(() => {\n return `${Math.floor(Math.random() * 40) + 50}%`;\n }, []);\n\n return (\n <div\n data-slot=\"sidebar-menu-skeleton\"\n data-sidebar=\"menu-skeleton\"\n className={cn(\"flex h-8 items-center gap-2 rounded-md px-2\", className)}\n {...props}\n >\n {showIcon && (\n <Skeleton\n className=\"size-4 rounded-md\"\n data-sidebar=\"menu-skeleton-icon\"\n />\n )}\n <Skeleton\n className=\"h-4 max-w-(--skeleton-width) flex-1\"\n data-sidebar=\"menu-skeleton-text\"\n style={\n {\n \"--skeleton-width\": width,\n } as React.CSSProperties\n }\n />\n </div>\n );\n}\n\nfunction SidebarMenuSub({ className, ...props }: React.ComponentProps<\"ul\">) {\n return (\n <ul\n data-slot=\"sidebar-menu-sub\"\n data-sidebar=\"menu-sub\"\n className={cn(\n \"mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuSubItem({\n className,\n ...props\n}: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"sidebar-menu-sub-item\"\n data-sidebar=\"menu-sub-item\"\n className={cn(\"group/menu-sub-item relative\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuSubButton({\n asChild = false,\n size = \"md\",\n isActive = false,\n className,\n ...props\n}: React.ComponentProps<\"a\"> & {\n asChild?: boolean;\n size?: \"sm\" | \"md\";\n isActive?: boolean;\n}) {\n const Comp = asChild ? SlotPrimitive.Slot : \"a\";\n\n return (\n <Comp\n data-slot=\"sidebar-menu-sub-button\"\n data-sidebar=\"menu-sub-button\"\n data-size={size}\n data-active={isActive}\n className={cn(\n \"flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden 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 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground\",\n \"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground\",\n size === \"sm\" && \"text-xs\",\n size === \"md\" && \"text-sm\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n );\n}\n\nexport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupAction,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInput,\n SidebarInset,\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSkeleton,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n SidebarProvider,\n SidebarRail,\n SidebarSeparator,\n SidebarTrigger,\n useSidebar,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\n\nexport type SocialProvider = \"google\" | \"facebook\" | \"github\" | \"apple\";\n\ninterface SocialProvidersProps {\n providers: SocialProvider[];\n onSocialLogin: (provider: SocialProvider) => void;\n loading?: boolean;\n disabled?: boolean;\n className?: string;\n}\n\nconst providerConfig: Record<\n SocialProvider,\n { label: string; icon: React.ReactNode }\n> = {\n google: {\n label: \"Google\",\n icon: (\n <svg className=\"h-4 w-4\" viewBox=\"0 0 24 24\" fill=\"none\">\n <path\n d=\"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z\"\n fill=\"#4285F4\"\n />\n <path\n d=\"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z\"\n fill=\"#34A853\"\n />\n <path\n d=\"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z\"\n fill=\"#FBBC05\"\n />\n <path\n d=\"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z\"\n fill=\"#EA4335\"\n />\n </svg>\n ),\n },\n facebook: {\n label: \"Facebook\",\n icon: (\n <svg className=\"h-4 w-4\" viewBox=\"0 0 24 24\" fill=\"#1877F2\">\n <path d=\"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z\" />\n </svg>\n ),\n },\n github: {\n label: \"GitHub\",\n icon: (\n <svg className=\"h-4 w-4\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z\" />\n </svg>\n ),\n },\n apple: {\n label: \"Apple\",\n icon: (\n <svg className=\"h-4 w-4\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.8-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z\" />\n </svg>\n ),\n },\n};\n\nexport function SocialProviders({\n providers,\n onSocialLogin,\n loading,\n disabled,\n className,\n}: SocialProvidersProps) {\n return (\n <div className={cn(\"grid gap-2\", className)}>\n {providers.map((provider) => {\n const config = providerConfig[provider];\n return (\n <Button\n key={provider}\n variant=\"outline\"\n type=\"button\"\n disabled={loading || disabled}\n onClick={() => onSocialLogin(provider)}\n className=\"w-full\"\n >\n {config.icon}\n <span className=\"ml-2\">Continue with {config.label}</span>\n </Button>\n );\n })}\n </div>\n );\n}\n","'use client';\n\nimport * as React from 'react';\nimport { motion, AnimatePresence } from 'motion/react';\nimport { cn } from '../../lib/utils';\nimport { Button } from '../../components/button';\nimport { CodeInput } from '../../components/code-input';\nimport { Input } from '../../components/input';\nimport { InputGroup } from '../../components/input-group';\nimport { PasswordInput } from '../../components/password-input';\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from '../../components/card';\nimport { Spinner } from '../../components/spinner';\nimport { FormError } from '../../form/form-error';\nimport { SocialProviders, type SocialProvider } from './social-providers';\nimport { Separator } from '../../components/separator';\n\nexport interface SignInBlockProps {\n onSubmit: (data: { email: string; password: string }) => void | Promise<void>;\n onForgotPassword?: () => void;\n onSocialLogin?: (provider: SocialProvider) => void;\n socialProviders?: SocialProvider[];\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n title?: string;\n description?: string;\n signUpHref?: string;\n onSignUp?: () => void;\n className?: string;\n /** When provided, replaces the built-in form content. The Card wrapper, header, and footer links are preserved. */\n children?: React.ReactNode;\n /** Callback to request a one-time code. When provided, enables the tabbed Password / OTP layout. */\n onOtpRequest?: (email: string) => Promise<{ session: string }>;\n /** Callback to verify a one-time code and complete login. */\n onOtpVerify?: (data: {\n email: string;\n code: string;\n session: string;\n }) => Promise<void>;\n /** Label for the OTP tab trigger. @default \"Email me a code\" */\n otpLabel?: string;\n /** Fires when the user switches between the password and OTP tabs. Useful for clearing parent-owned error state so stale errors do not persist across tabs. */\n onTabChange?: (tab: 'password' | 'otp') => void;\n}\n\ntype OtpStep = 'email' | 'code';\n\nconst AUTH_TABS = { PASSWORD: 'password', OTP: 'otp' } as const;\ntype AuthTab = (typeof AUTH_TABS)[keyof typeof AUTH_TABS];\n\nfunction PillTabs({\n activeTab,\n onTabChange,\n otpLabel,\n}: {\n activeTab: AuthTab;\n onTabChange: (tab: AuthTab) => void;\n otpLabel: string;\n}) {\n const tabs = [\n { value: AUTH_TABS.PASSWORD, label: 'Password' },\n { value: AUTH_TABS.OTP, label: otpLabel },\n ];\n\n return (\n <div className=\"relative flex rounded-md bg-muted p-1\">\n {tabs.map((tab) => (\n <button\n key={tab.value}\n type=\"button\"\n onClick={() => onTabChange(tab.value)}\n className={cn(\n 'relative z-10 flex-1 rounded-sm px-3 py-1.5 text-sm font-medium transition-colors',\n activeTab === tab.value\n ? 'text-primary-foreground'\n : 'text-muted-foreground hover:text-foreground',\n )}\n >\n {activeTab === tab.value && (\n <motion.div\n layoutId=\"sign-in-tab-pill\"\n className=\"absolute inset-0 rounded-sm bg-primary shadow-sm\"\n transition={{ type: 'spring', bounce: 0.15, duration: 0.4 }}\n />\n )}\n <span className=\"relative z-10\">{tab.label}</span>\n </button>\n ))}\n </div>\n );\n}\n\nfunction OtpForm({\n onOtpRequest,\n onOtpVerify,\n loading = false,\n disabled = false,\n}: {\n onOtpRequest: (email: string) => Promise<{ session: string }>;\n onOtpVerify: (data: {\n email: string;\n code: string;\n session: string;\n }) => Promise<void>;\n loading?: boolean;\n disabled?: boolean;\n}) {\n const [step, setStep] = React.useState<OtpStep>('email');\n const [email, setEmail] = React.useState('');\n const [session, setSession] = React.useState('');\n const [otpLoading, setOtpLoading] = React.useState(false);\n const [otpError, setOtpError] = React.useState<string | undefined>();\n\n const isLoading = loading || otpLoading;\n const displayError = otpError;\n\n const handleEmailSubmit = async (\n e: React.SyntheticEvent<HTMLFormElement>,\n ) => {\n e.preventDefault();\n const formData = new FormData(e.currentTarget);\n const emailValue = formData.get('otp-email') as string;\n setOtpError(undefined);\n setOtpLoading(true);\n\n try {\n const result = await onOtpRequest(emailValue);\n setEmail(emailValue);\n setSession(result.session);\n setStep('code');\n } catch (err) {\n setOtpError(\n err instanceof Error\n ? err.message\n : 'Failed to send code. Please try again.',\n );\n } finally {\n setOtpLoading(false);\n }\n };\n\n if (step === 'code') {\n return (\n <>\n <FormError message={displayError} />\n <div className=\"space-y-4\">\n <div className=\"text-center text-sm text-muted-foreground\">\n We sent a 6-digit code to <strong>{email}</strong>\n </div>\n <CodeInput\n length={6}\n loading={isLoading}\n disabled={disabled}\n onComplete={(fullCode) => {\n setOtpLoading(true);\n setOtpError(undefined);\n onOtpVerify({ email, code: fullCode, session })\n .catch((err) =>\n setOtpError(\n err instanceof Error\n ? err.message\n : 'Invalid or expired code. Please try again.',\n ),\n )\n .finally(() => setOtpLoading(false));\n }}\n />\n {isLoading && (\n <div className=\"flex justify-center\">\n <Spinner size=\"sm\" />\n </div>\n )}\n <button\n type=\"button\"\n className=\"w-full text-center text-sm text-muted-foreground hover:text-foreground\"\n onClick={() => {\n setStep('email');\n setOtpError(undefined);\n }}\n >\n Use a different email\n </button>\n </div>\n </>\n );\n }\n\n return (\n <>\n <FormError message={displayError} />\n <form onSubmit={handleEmailSubmit} className=\"space-y-4\">\n <InputGroup label=\"Email\" htmlFor=\"otp-email\">\n <Input\n id=\"otp-email\"\n name=\"otp-email\"\n type=\"email\"\n placeholder=\"name@example.com\"\n required\n disabled={isLoading || disabled}\n autoComplete=\"email\"\n />\n </InputGroup>\n <Button\n type=\"submit\"\n variant=\"default\"\n className=\"w-full\"\n loading={isLoading}\n disabled={disabled}\n >\n Send Login Code\n </Button>\n </form>\n </>\n );\n}\n\nexport function SignInBlock({\n onSubmit,\n onForgotPassword,\n onSocialLogin,\n socialProviders = [],\n loading = false,\n error,\n disabled = false,\n title = 'Sign in',\n description = 'Enter your credentials to access your account',\n signUpHref,\n onSignUp,\n className,\n children,\n onOtpRequest,\n onOtpVerify,\n otpLabel = 'Email me a code',\n onTabChange,\n}: SignInBlockProps) {\n const [activeTab, setActiveTab] = React.useState<AuthTab>(AUTH_TABS.PASSWORD);\n const otpEnabled = Boolean(onOtpRequest && onOtpVerify);\n\n const handleTabChange = React.useCallback(\n (tab: AuthTab) => {\n setActiveTab(tab);\n onTabChange?.(tab);\n },\n [onTabChange],\n );\n\n // Stale parent-owned errors should not bleed across tab switches\n // (for example, a failed password attempt's \"Invalid email or password\"\n // alert must not appear under the OTP tab). We track which tab the\n // current `error` was set on and only render it when that tab is active.\n const [errorTab, setErrorTab] = React.useState<AuthTab | null>(\n error ? AUTH_TABS.PASSWORD : null,\n );\n const previousErrorRef = React.useRef<string | undefined>(error);\n React.useEffect(() => {\n if (error !== previousErrorRef.current) {\n previousErrorRef.current = error;\n setErrorTab(error ? activeTab : null);\n }\n }, [error, activeTab]);\n const visibleError = errorTab === activeTab ? error : undefined;\n\n const handleSubmit = async (e: React.SyntheticEvent<HTMLFormElement>) => {\n e.preventDefault();\n const formData = new FormData(e.currentTarget);\n await onSubmit({\n email: formData.get('email') as string,\n password: formData.get('password') as string,\n });\n };\n\n const passwordForm = (\n <>\n <FormError message={visibleError} />\n\n <form onSubmit={handleSubmit} className=\"space-y-4\">\n <InputGroup label=\"Email\" htmlFor=\"email\">\n <Input\n id=\"email\"\n name=\"email\"\n type=\"email\"\n placeholder=\"name@example.com\"\n required\n disabled={loading || disabled}\n autoComplete=\"email\"\n />\n </InputGroup>\n <InputGroup label=\"Password\" htmlFor=\"password\">\n <PasswordInput\n id=\"password\"\n name=\"password\"\n required\n disabled={loading || disabled}\n autoComplete=\"current-password\"\n />\n {onForgotPassword && (\n <div className=\"flex justify-end\">\n <button\n type=\"button\"\n onClick={onForgotPassword}\n className=\"text-sm text-primary hover:underline\"\n tabIndex={-1}\n >\n Forgot password?\n </button>\n </div>\n )}\n </InputGroup>\n\n <Button\n type=\"submit\"\n variant=\"default\"\n className=\"w-full\"\n loading={loading}\n disabled={disabled}\n >\n Sign in\n </Button>\n </form>\n </>\n );\n\n const socialSection = socialProviders.length > 0 && onSocialLogin && (\n <>\n <div className=\"relative\">\n <div className=\"absolute inset-0 flex items-center\">\n <Separator className=\"w-full\" />\n </div>\n <div className=\"relative flex justify-center text-xs uppercase\">\n <span className=\"bg-card px-2 text-muted-foreground\">or</span>\n </div>\n </div>\n <SocialProviders\n providers={socialProviders}\n onSocialLogin={onSocialLogin}\n loading={loading}\n disabled={disabled}\n />\n </>\n );\n\n const footerLinks = (\n <>\n {(signUpHref || onSignUp) && (\n <p className=\"text-center text-sm text-muted-foreground\">\n Don&apos;t have an account?{' '}\n {onSignUp ? (\n <button\n type=\"button\"\n onClick={onSignUp}\n className=\"text-primary hover:underline font-medium\"\n >\n Sign up\n </button>\n ) : (\n <a\n href={signUpHref}\n className=\"text-primary hover:underline font-medium\"\n >\n Sign up\n </a>\n )}\n </p>\n )}\n </>\n );\n\n return (\n <Card className={cn('w-full max-w-md mx-auto', className)}>\n <CardHeader className=\"text-center\">\n <CardTitle>{title}</CardTitle>\n <CardDescription>{description}</CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"space-y-4\">\n {children ? (\n children\n ) : otpEnabled ? (\n <>\n <PillTabs\n activeTab={activeTab}\n onTabChange={handleTabChange}\n otpLabel={otpLabel}\n />\n <motion.div\n layout\n transition={{ type: 'spring', bounce: 0, duration: 0.4 }}\n className=\"\"\n >\n <AnimatePresence mode=\"wait\" initial={false}>\n {activeTab === AUTH_TABS.PASSWORD ? (\n <motion.div\n key=\"password\"\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.15 }}\n className=\"space-y-4\"\n >\n {passwordForm}\n </motion.div>\n ) : (\n <motion.div\n key=\"otp\"\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.15 }}\n className=\"space-y-4\"\n >\n <OtpForm\n onOtpRequest={onOtpRequest!}\n onOtpVerify={onOtpVerify!}\n loading={loading}\n disabled={disabled}\n />\n </motion.div>\n )}\n </AnimatePresence>\n </motion.div>\n </>\n ) : (\n passwordForm\n )}\n\n {socialSection}\n {footerLinks}\n </div>\n </CardContent>\n </Card>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { Input } from \"../../components/input\";\nimport { InputGroup } from \"../../components/input-group\";\nimport { PasswordInput } from \"../../components/password-input\";\nimport { Checkbox } from \"../../components/checkbox\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from \"../../components/card\";\nimport { FormError } from \"../../form/form-error\";\nimport { SocialProviders, type SocialProvider } from \"./social-providers\";\nimport { Separator } from \"../../components/separator\";\n\nexport interface SignUpBlockProps {\n onSubmit: (data: {\n firstName: string;\n lastName: string;\n email: string;\n password: string;\n confirmPassword: string;\n termsAccepted: boolean;\n }) => void | Promise<void>;\n onSocialLogin?: (provider: SocialProvider) => void;\n socialProviders?: SocialProvider[];\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n title?: string;\n description?: string;\n signInHref?: string;\n onSignIn?: () => void;\n termsHref?: string;\n privacyHref?: string;\n className?: string;\n}\n\nexport function SignUpBlock({\n onSubmit,\n onSocialLogin,\n socialProviders = [],\n loading = false,\n error,\n disabled = false,\n title = \"Create an account\",\n description = \"Enter your details to get started\",\n signInHref,\n onSignIn,\n termsHref = \"#\",\n privacyHref = \"#\",\n className,\n}: SignUpBlockProps) {\n const [termsAccepted, setTermsAccepted] = React.useState(false);\n\n const handleSubmit = async (e: React.SyntheticEvent<HTMLFormElement>) => {\n e.preventDefault();\n const formData = new FormData(e.currentTarget);\n await onSubmit({\n firstName: (formData.get(\"firstName\") as string) ?? \"\",\n lastName: (formData.get(\"lastName\") as string) ?? \"\",\n email: formData.get(\"email\") as string,\n password: formData.get(\"password\") as string,\n confirmPassword: formData.get(\"confirmPassword\") as string,\n termsAccepted,\n });\n };\n\n return (\n <Card className={cn(\"w-full max-w-md mx-auto\", className)}>\n <CardHeader className=\"text-center\">\n <CardTitle>{title}</CardTitle>\n <CardDescription>{description}</CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"space-y-4\">\n {socialProviders.length > 0 && onSocialLogin && (\n <>\n <SocialProviders\n providers={socialProviders}\n onSocialLogin={onSocialLogin}\n loading={loading}\n disabled={disabled}\n />\n <div className=\"relative\">\n <div className=\"absolute inset-0 flex items-center\">\n <Separator className=\"w-full\" />\n </div>\n <div className=\"relative flex justify-center text-xs uppercase\">\n <span className=\"bg-card px-2 text-muted-foreground\">\n Or continue with\n </span>\n </div>\n </div>\n </>\n )}\n\n <FormError message={error} />\n\n <form onSubmit={handleSubmit} className=\"space-y-4\">\n <InputGroup label=\"First name\" htmlFor=\"firstName\">\n <Input\n id=\"firstName\"\n name=\"firstName\"\n placeholder=\"Jane\"\n required\n disabled={loading || disabled}\n autoComplete=\"given-name\"\n />\n </InputGroup>\n <InputGroup label=\"Last name\" htmlFor=\"lastName\">\n <Input\n id=\"lastName\"\n name=\"lastName\"\n placeholder=\"Doe\"\n required\n disabled={loading || disabled}\n autoComplete=\"family-name\"\n />\n </InputGroup>\n <InputGroup label=\"Email\" htmlFor=\"email\">\n <Input\n id=\"email\"\n name=\"email\"\n type=\"email\"\n placeholder=\"name@example.com\"\n required\n disabled={loading || disabled}\n autoComplete=\"email\"\n />\n </InputGroup>\n <InputGroup label=\"Password\" htmlFor=\"password\">\n <PasswordInput\n id=\"password\"\n name=\"password\"\n required\n disabled={loading || disabled}\n autoComplete=\"new-password\"\n />\n </InputGroup>\n <InputGroup label=\"Confirm password\" htmlFor=\"confirmPassword\">\n <PasswordInput\n id=\"confirmPassword\"\n name=\"confirmPassword\"\n required\n disabled={loading || disabled}\n autoComplete=\"new-password\"\n />\n </InputGroup>\n\n <div className=\"flex items-start space-x-2\">\n <Checkbox\n id=\"terms\"\n checked={termsAccepted}\n onCheckedChange={(checked) =>\n setTermsAccepted(checked === true)\n }\n disabled={loading || disabled}\n className=\"mt-0.5\"\n />\n <label\n htmlFor=\"terms\"\n className=\"text-sm text-muted-foreground cursor-pointer\"\n >\n I agree to the{\" \"}\n <a href={termsHref} className=\"text-primary hover:underline\">\n terms of service\n </a>{\" \"}\n and{\" \"}\n <a href={privacyHref} className=\"text-primary hover:underline\">\n privacy policy\n </a>\n </label>\n </div>\n\n <Button\n type=\"submit\"\n className=\"w-full\"\n loading={loading}\n disabled={disabled || !termsAccepted}\n >\n Create account\n </Button>\n </form>\n\n {(signInHref || onSignIn) && (\n <p className=\"text-center text-sm text-muted-foreground\">\n Already have an account?{\" \"}\n {onSignIn ? (\n <button\n type=\"button\"\n onClick={onSignIn}\n className=\"text-primary hover:underline font-medium\"\n >\n Sign in\n </button>\n ) : (\n <a\n href={signInHref}\n className=\"text-primary hover:underline font-medium\"\n >\n Sign in\n </a>\n )}\n </p>\n )}\n </div>\n </CardContent>\n </Card>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { ArrowLeft, Mail } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { Input } from \"../../components/input\";\nimport { InputGroup } from \"../../components/input-group\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from \"../../components/card\";\nimport { FormError } from \"../../form/form-error\";\n\nexport interface ForgotPasswordBlockProps {\n onSubmit: (data: { email: string }) => void | Promise<void>;\n onBack?: () => void;\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n success?: boolean;\n title?: string;\n description?: string;\n className?: string;\n}\n\nexport function ForgotPasswordBlock({\n onSubmit,\n onBack,\n loading = false,\n error,\n disabled = false,\n success = false,\n title = \"Forgot password\",\n description = \"Enter your email and we'll send you a reset link\",\n className,\n}: ForgotPasswordBlockProps) {\n const handleSubmit = async (e: React.SyntheticEvent<HTMLFormElement>) => {\n e.preventDefault();\n const formData = new FormData(e.currentTarget);\n await onSubmit({ email: formData.get(\"email\") as string });\n };\n\n return (\n <Card className={cn(\"w-full max-w-md mx-auto\", className)}>\n <CardHeader className=\"text-center\">\n {success ? (\n <>\n <div className=\"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-primary/10\">\n <Mail className=\"h-6 w-6 text-primary\" />\n </div>\n <CardTitle>Check your email</CardTitle>\n <CardDescription>\n We&apos;ve sent a password reset link to your email address.\n </CardDescription>\n </>\n ) : (\n <>\n <CardTitle>{title}</CardTitle>\n <CardDescription>{description}</CardDescription>\n </>\n )}\n </CardHeader>\n {!success && (\n <CardContent>\n <div className=\"space-y-4\">\n <FormError message={error} />\n <form onSubmit={handleSubmit} className=\"space-y-4\">\n <InputGroup label=\"Email\" htmlFor=\"email\">\n <Input\n id=\"email\"\n name=\"email\"\n type=\"email\"\n placeholder=\"name@example.com\"\n required\n disabled={loading || disabled}\n autoComplete=\"email\"\n />\n </InputGroup>\n <Button\n type=\"submit\"\n className=\"w-full\"\n loading={loading}\n disabled={disabled}\n >\n Send reset link\n </Button>\n </form>\n {onBack && (\n <button\n type=\"button\"\n onClick={onBack}\n className=\"flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground mx-auto\"\n >\n <ArrowLeft className=\"h-4 w-4\" /> Back to sign in\n </button>\n )}\n </div>\n </CardContent>\n )}\n </Card>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { InputGroup } from \"../../components/input-group\";\nimport { PasswordInput } from \"../../components/password-input\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from \"../../components/card\";\nimport { FormError } from \"../../form/form-error\";\n\nexport interface ResetPasswordBlockProps {\n onSubmit: (data: {\n password: string;\n confirmPassword: string;\n }) => void | Promise<void>;\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n title?: string;\n description?: string;\n className?: string;\n}\n\nexport function ResetPasswordBlock({\n onSubmit,\n loading = false,\n error,\n disabled = false,\n title = \"Reset password\",\n description = \"Enter your new password below\",\n className,\n}: ResetPasswordBlockProps) {\n const handleSubmit = async (e: React.SyntheticEvent<HTMLFormElement>) => {\n e.preventDefault();\n const formData = new FormData(e.currentTarget);\n await onSubmit({\n password: formData.get(\"password\") as string,\n confirmPassword: formData.get(\"confirmPassword\") as string,\n });\n };\n\n return (\n <Card className={cn(\"w-full max-w-md mx-auto\", className)}>\n <CardHeader className=\"text-center\">\n <CardTitle>{title}</CardTitle>\n <CardDescription>{description}</CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"space-y-4\">\n <FormError message={error} />\n <form onSubmit={handleSubmit} className=\"space-y-4\">\n <InputGroup label=\"New password\" htmlFor=\"password\">\n <PasswordInput\n id=\"password\"\n name=\"password\"\n required\n disabled={loading || disabled}\n autoComplete=\"new-password\"\n />\n </InputGroup>\n <InputGroup label=\"Confirm new password\" htmlFor=\"confirmPassword\">\n <PasswordInput\n id=\"confirmPassword\"\n name=\"confirmPassword\"\n required\n disabled={loading || disabled}\n autoComplete=\"new-password\"\n />\n </InputGroup>\n <Button\n type=\"submit\"\n className=\"w-full\"\n loading={loading}\n disabled={disabled}\n >\n Reset password\n </Button>\n </form>\n </div>\n </CardContent>\n </Card>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { Input } from \"../../components/input\";\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from \"../../components/card\";\nimport { Spinner } from \"../../components/spinner\";\nimport { FormError } from \"../../form/form-error\";\n\nexport interface VerifyBlockProps {\n onVerify: (code: string) => void | Promise<void>;\n onResend?: () => void | Promise<void>;\n codeLength?: number;\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n title?: string;\n description?: string;\n resendCooldown?: number;\n className?: string;\n}\n\nexport function VerifyBlock({\n onVerify,\n onResend,\n codeLength = 6,\n loading = false,\n error,\n disabled = false,\n title = \"Verify your account\",\n description = \"Enter the verification code sent to your email\",\n resendCooldown = 60,\n className,\n}: VerifyBlockProps) {\n const [code, setCode] = React.useState<string[]>(Array(codeLength).fill(\"\"));\n const [countdown, setCountdown] = React.useState(0);\n const inputRefs = React.useRef<(HTMLInputElement | null)[]>([]);\n\n React.useEffect(() => {\n if (countdown > 0) {\n const timer = setTimeout(() => setCountdown(countdown - 1), 1000);\n return () => clearTimeout(timer);\n }\n }, [countdown]);\n\n const handleChange = (index: number, value: string) => {\n if (!/^\\d*$/.test(value)) return;\n const newCode = [...code];\n newCode[index] = value.slice(-1);\n setCode(newCode);\n\n if (value && index < codeLength - 1) {\n inputRefs.current[index + 1]?.focus();\n }\n\n const fullCode = newCode.join(\"\");\n if (fullCode.length === codeLength && newCode.every(Boolean)) {\n onVerify(fullCode);\n }\n };\n\n const handleKeyDown = (index: number, e: React.KeyboardEvent) => {\n if (e.key === \"Backspace\" && !code[index] && index > 0) {\n inputRefs.current[index - 1]?.focus();\n }\n };\n\n const handlePaste = (e: React.ClipboardEvent) => {\n e.preventDefault();\n const pasted = e.clipboardData.getData(\"text\").replace(/\\D/g, \"\").slice(0, codeLength);\n const newCode = [...code];\n for (let i = 0; i < pasted.length; i++) {\n newCode[i] = pasted[i];\n }\n setCode(newCode);\n if (pasted.length === codeLength) {\n onVerify(pasted);\n } else {\n inputRefs.current[pasted.length]?.focus();\n }\n };\n\n const handleResend = async () => {\n setCountdown(resendCooldown);\n await onResend?.();\n };\n\n return (\n <Card className={cn(\"w-full max-w-md mx-auto\", className)}>\n <CardHeader className=\"text-center\">\n <CardTitle>{title}</CardTitle>\n <CardDescription>{description}</CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"space-y-4\">\n <FormError message={error} />\n <div className=\"flex justify-center gap-2\" onPaste={handlePaste}>\n {code.map((digit, index) => (\n <Input\n key={index}\n ref={(el) => { inputRefs.current[index] = el; }}\n type=\"text\"\n inputMode=\"numeric\"\n maxLength={1}\n value={digit}\n onChange={(e) => handleChange(index, e.target.value)}\n onKeyDown={(e) => handleKeyDown(index, e)}\n disabled={loading || disabled}\n className=\"h-12 w-12 text-center text-lg font-semibold\"\n autoFocus={index === 0}\n />\n ))}\n </div>\n\n {loading && (\n <div className=\"flex justify-center\">\n <Spinner size=\"sm\" />\n </div>\n )}\n\n {onResend && (\n <div className=\"text-center\">\n {countdown > 0 ? (\n <p className=\"text-sm text-muted-foreground\">\n Resend code in {countdown}s\n </p>\n ) : (\n <Button variant=\"ghost\" size=\"sm\" onClick={handleResend} disabled={loading || disabled}>\n Resend code\n </Button>\n )}\n </div>\n )}\n </div>\n </CardContent>\n </Card>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { FileQuestion } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\n\nexport interface NotFoundBlockProps {\n title?: string;\n message?: string;\n homeHref?: string;\n onGoHome?: () => void;\n className?: string;\n}\n\nexport function NotFoundBlock({\n title = \"Page not found\",\n message = \"Sorry, we couldn't find the page you're looking for. It may have been moved or deleted.\",\n homeHref = \"/\",\n onGoHome,\n className,\n}: NotFoundBlockProps) {\n return (\n <div className={cn(\"flex min-h-[60vh] flex-col items-center justify-center text-center px-4\", className)}>\n <div className=\"mb-8 flex h-24 w-24 items-center justify-center rounded-full bg-muted\">\n <FileQuestion className=\"h-12 w-12 text-muted-foreground\" />\n </div>\n <h1 className=\"text-4xl font-bold tracking-tight mb-2\">404</h1>\n <h2 className=\"text-xl font-semibold mb-2\">{title}</h2>\n <p className=\"text-muted-foreground max-w-md mb-8\">{message}</p>\n {onGoHome ? (\n <Button onClick={onGoHome}>Go back home</Button>\n ) : (\n <Button asChild>\n <a href={homeHref}>Go back home</a>\n </Button>\n )}\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Server } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\n\nexport interface ServerErrorBlockProps {\n title?: string;\n message?: string;\n onRetry?: () => void;\n homeHref?: string;\n onGoHome?: () => void;\n className?: string;\n}\n\nexport function ServerErrorBlock({\n title = \"Something went wrong\",\n message = \"An unexpected error occurred. Our team has been notified and is working on a fix.\",\n onRetry,\n homeHref = \"/\",\n onGoHome,\n className,\n}: ServerErrorBlockProps) {\n return (\n <div className={cn(\"flex min-h-[60vh] flex-col items-center justify-center text-center px-4\", className)}>\n <div className=\"mb-8 flex h-24 w-24 items-center justify-center rounded-full bg-destructive/10\">\n <Server className=\"h-12 w-12 text-destructive\" />\n </div>\n <h1 className=\"text-4xl font-bold tracking-tight mb-2\">500</h1>\n <h2 className=\"text-xl font-semibold mb-2\">{title}</h2>\n <p className=\"text-muted-foreground max-w-md mb-8\">{message}</p>\n <div className=\"flex gap-3\">\n {onRetry && (\n <Button onClick={onRetry}>Try again</Button>\n )}\n {onGoHome ? (\n <Button variant=\"outline\" onClick={onGoHome}>Go home</Button>\n ) : (\n <Button variant=\"outline\" asChild>\n <a href={homeHref}>Go home</a>\n </Button>\n )}\n </div>\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Wrench } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface MaintenanceBlockProps {\n title?: string;\n message?: string;\n estimatedReturn?: string;\n className?: string;\n}\n\nexport function MaintenanceBlock({\n title = \"Under maintenance\",\n message = \"We're performing scheduled maintenance to improve your experience. We'll be back shortly.\",\n estimatedReturn,\n className,\n}: MaintenanceBlockProps) {\n return (\n <div className={cn(\"flex min-h-[60vh] flex-col items-center justify-center text-center px-4\", className)}>\n <div className=\"mb-8 flex h-24 w-24 items-center justify-center rounded-full bg-muted\">\n <Wrench className=\"h-12 w-12 text-muted-foreground\" />\n </div>\n <h2 className=\"text-xl font-semibold mb-2\">{title}</h2>\n <p className=\"text-muted-foreground max-w-md mb-4\">{message}</p>\n {estimatedReturn && (\n <p className=\"text-sm text-muted-foreground\">\n Estimated return: <span className=\"font-medium text-foreground\">{estimatedReturn}</span>\n </p>\n )}\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Inbox } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\n\nexport interface EmptyStateBlockProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Icon to render inside the centered circle. Pass any React node\n * (`<FontAwesomeIcon … />`, a Lucide icon, an inline SVG, etc.). Defaults to\n * a Lucide `Inbox` glyph.\n */\n icon?: React.ReactNode;\n title?: string;\n description?: string;\n actionLabel?: string;\n onAction?: () => void;\n}\n\nconst EmptyStateBlock = React.forwardRef<HTMLDivElement, EmptyStateBlockProps>(\n (\n {\n icon,\n title = \"No results found\",\n description = \"There's nothing here yet. Get started by creating your first item.\",\n actionLabel,\n onAction,\n className,\n ...props\n },\n ref\n ) => {\n return (\n <div ref={ref} className={cn(\"flex flex-col items-center justify-center text-center py-16 px-4\", className)} {...props}>\n <div className=\"mb-6 flex h-16 w-16 items-center justify-center rounded-full bg-muted text-muted-foreground [&_svg]:h-8 [&_svg]:w-8\">\n {icon ?? <Inbox />}\n </div>\n <h3 className=\"text-lg font-semibold mb-1\">{title}</h3>\n <p className=\"text-sm text-muted-foreground max-w-sm mb-6\">{description}</p>\n {actionLabel && onAction && (\n <Button onClick={onAction}>{actionLabel}</Button>\n )}\n </div>\n );\n }\n);\nEmptyStateBlock.displayName = \"EmptyStateBlock\";\n\nexport { EmptyStateBlock };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface PageShellProps {\n children: React.ReactNode;\n sidebar?: React.ReactNode;\n header?: React.ReactNode;\n footer?: React.ReactNode;\n sidebarWidth?: string;\n sidebarCollapsed?: boolean;\n className?: string;\n}\n\nexport function PageShell({\n children,\n sidebar,\n header,\n footer,\n sidebarWidth = \"16rem\",\n sidebarCollapsed = false,\n className,\n}: PageShellProps) {\n return (\n <div className={cn(\"flex min-h-screen flex-col\", className)}>\n {header}\n <div className=\"flex flex-1\">\n {sidebar && (\n <aside\n className={cn(\n \"hidden border-r bg-card transition-all duration-normal ease-default md:block\",\n sidebarCollapsed && \"w-16\"\n )}\n style={sidebarCollapsed ? undefined : { width: sidebarWidth }}\n >\n {sidebar}\n </aside>\n )}\n <main className=\"flex-1 overflow-auto\">{children}</main>\n </div>\n {footer}\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Menu } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\n\nexport interface HeaderBlockProps {\n logo?: React.ReactNode;\n nav?: React.ReactNode;\n actions?: React.ReactNode;\n onMenuToggle?: () => void;\n sticky?: boolean;\n className?: string;\n}\n\nexport function HeaderBlock({\n logo,\n nav,\n actions,\n onMenuToggle,\n sticky = true,\n className,\n}: HeaderBlockProps) {\n return (\n <header\n className={cn(\n \"flex h-16 items-center gap-4 border-b bg-background px-4 md:px-6\",\n sticky && \"sticky top-0 z-[var(--z-sticky)]\",\n className\n )}\n >\n {onMenuToggle && (\n <Button variant=\"ghost\" size=\"icon\" className=\"md:hidden\" onClick={onMenuToggle}>\n <Menu className=\"h-5 w-5\" />\n <span className=\"sr-only\">Toggle menu</span>\n </Button>\n )}\n {logo && <div className=\"flex items-center gap-2 font-semibold\">{logo}</div>}\n {nav && <nav className=\"hidden md:flex items-center gap-6 text-sm font-medium flex-1\">{nav}</nav>}\n {actions && <div className=\"ml-auto flex items-center gap-2\">{actions}</div>}\n </header>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Menu } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { useHideOnScroll } from \"../../hooks/use-hide-on-scroll\";\nimport {\n Accordion,\n AccordionContent,\n AccordionItem,\n AccordionTrigger,\n} from \"../../components/accordion\";\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"../../components/navigation-menu\";\nimport {\n Sheet,\n SheetContent,\n SheetTitle,\n SheetTrigger,\n} from \"../../components/sheet\";\n\nexport interface FloatingNavLinkProps\n extends React.AnchorHTMLAttributes<HTMLAnchorElement> {\n href: string;\n children: React.ReactNode;\n}\n\n/**\n * Renders one link. Supply it to hand every destination to a router — Next's\n * `<Link>`, a TanStack `<Link>` — instead of the plain `<a>` used by default.\n */\nexport type FloatingNavRenderLink = (\n props: FloatingNavLinkProps\n) => React.ReactNode;\n\nexport interface FloatingNavSubItem {\n /** Link label shown in the panel. */\n label: React.ReactNode;\n /** Destination. Doubles as the React key, so keep it unique per panel. */\n href: string;\n /** Supporting line under the label. */\n description?: React.ReactNode;\n /** Leading glyph. Any node — the library never picks an icon for you here. */\n icon?: React.ReactNode;\n}\n\nexport interface FloatingNavItem {\n /** Label on the bar. Doubles as the React key, so keep it unique. */\n label: string;\n /** Destination for a plain link. Ignored when the item opens a panel. */\n href?: string;\n /** Sub-items. Their presence turns the item into a mega-menu trigger. */\n items?: FloatingNavSubItem[];\n /** A whole custom panel. Takes precedence over `items`. */\n content?: React.ReactNode;\n /** Columns in the default `items` panel (default: 2). */\n columns?: 1 | 2 | 3;\n /** Marks the current page — sets `aria-current` on a link. */\n active?: boolean;\n}\n\nexport interface FloatingNavBlockProps\n extends Omit<React.HTMLAttributes<HTMLElement>, \"content\"> {\n /** Brand mark, rendered verbatim at the start of the bar. */\n logo?: React.ReactNode;\n /** The bar's navigation items. */\n items?: FloatingNavItem[];\n /** Trailing slot for calls to action, a theme toggle, an avatar. */\n actions?: React.ReactNode;\n /** Render every link through a router component instead of a plain `<a>`. */\n renderLink?: FloatingNavRenderLink;\n /** Slide the bar away when the page scrolls down (default: `true`). */\n hideOnScroll?: boolean;\n /** Pixels scrolled before hiding may start (default: 80). */\n scrollThreshold?: number;\n /**\n * `false` (default) anchors each mega-menu panel under its own trigger.\n * `true` uses the shared, animated viewport centered under the bar.\n */\n viewport?: boolean;\n /** Accessible name for the `<nav>` (default: `\"Main\"`). */\n navLabel?: string;\n /** Accessible name for the mobile menu button (default: `\"Toggle menu\"`). */\n mobileMenuLabel?: string;\n /** Classes for the width-constraining container. */\n containerClassName?: string;\n /** Classes for the bar surface — background, border, radius, blur. */\n navClassName?: string;\n}\n\nconst PANEL_COLUMNS = {\n 1: \"w-[min(92vw,20rem)] grid-cols-1\",\n 2: \"w-[min(92vw,36rem)] grid-cols-1 sm:grid-cols-2\",\n 3: \"w-[min(92vw,48rem)] grid-cols-1 sm:grid-cols-3\",\n} as const;\n\nconst FloatingNavBlock = React.forwardRef<HTMLElement, FloatingNavBlockProps>(\n (\n {\n logo,\n items = [],\n actions,\n renderLink,\n hideOnScroll = true,\n scrollThreshold = 80,\n viewport = false,\n navLabel = \"Main\",\n mobileMenuLabel = \"Toggle menu\",\n containerClassName,\n navClassName,\n className,\n ...props\n },\n ref\n ) => {\n const [openPanel, setOpenPanel] = React.useState(\"\");\n const [mobileOpen, setMobileOpen] = React.useState(false);\n\n // Sliding the bar away from under an open panel or drawer would strand it\n // mid-air, so any open menu freezes the bar in view.\n const { hidden, scrolled } = useHideOnScroll({\n threshold: scrollThreshold,\n disabled: !hideOnScroll || openPanel !== \"\" || mobileOpen,\n });\n\n // The logo and any custom `content` panel are consumer nodes we cannot\n // attach props to, so the drawer dismisses itself by delegation: a click\n // landing on a link anywhere inside closes the sheet. Without it a\n // client-side route change leaves the drawer open over the next page.\n // Anchors fire click on Enter, so this covers the keyboard too.\n const closeDrawerOnLink = React.useCallback(\n (event: React.MouseEvent<HTMLElement>) => {\n if ((event.target as HTMLElement).closest(\"a\")) setMobileOpen(false);\n },\n []\n );\n\n const link = React.useCallback(\n (linkProps: FloatingNavLinkProps) => {\n if (renderLink) return renderLink(linkProps);\n const { children, ...rest } = linkProps;\n return <a {...rest}>{children}</a>;\n },\n [renderLink]\n );\n\n return (\n <header\n ref={ref}\n data-hidden={hidden}\n data-scrolled={scrolled}\n className={cn(\n // `pointer-events-none` because the bar spans the viewport while\n // the pill inside it does not — without it the transparent gutters\n // swallow clicks on the page underneath.\n \"pointer-events-none fixed inset-x-0 top-0 z-[var(--z-sticky)] pt-4 transition-transform duration-slow ease-out\",\n hidden && \"-translate-y-full\",\n className\n )}\n {...props}\n >\n <div\n className={cn(\n \"mx-auto w-full max-w-6xl px-4 sm:px-6\",\n containerClassName\n )}\n >\n {/* A plain element, not a <nav>: Radix's NavigationMenu root is\n itself a <nav>, and nesting one landmark inside another leaves a\n screen reader with two identical \"Main\" navigations. */}\n <div\n className={cn(\n \"pointer-events-auto flex items-center gap-6 rounded-xl border bg-background/85 px-3 py-3 shadow-lg backdrop-blur-2xl sm:px-5\",\n navClassName\n )}\n >\n <div className=\"flex flex-1 items-center\">{logo}</div>\n\n {items.length > 0 ? (\n <NavigationMenu\n aria-label={navLabel}\n viewport={viewport}\n value={openPanel}\n onValueChange={setOpenPanel}\n className=\"hidden md:flex\"\n >\n <NavigationMenuList className=\"gap-1\">\n {items.map((item) => {\n const panel =\n item.content ??\n (item.items?.length ? (\n <div\n className={cn(\n \"grid gap-1 p-2\",\n PANEL_COLUMNS[item.columns ?? 2]\n )}\n >\n {item.items.map((sub) => (\n <NavigationMenuLink key={sub.href} asChild>\n {link({\n href: sub.href,\n className:\n \"flex select-none items-start gap-3 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground\",\n children: (\n <>\n {sub.icon ? (\n <span className=\"mt-0.5 shrink-0 text-muted-foreground\">\n {sub.icon}\n </span>\n ) : null}\n <span className=\"min-w-0\">\n <span className=\"block text-sm font-medium\">\n {sub.label}\n </span>\n {sub.description ? (\n <span className=\"mt-1.5 block text-sm leading-snug text-muted-foreground\">\n {sub.description}\n </span>\n ) : null}\n </span>\n </>\n ),\n })}\n </NavigationMenuLink>\n ))}\n </div>\n ) : null);\n\n return (\n <NavigationMenuItem key={item.label} value={item.label}>\n {panel ? (\n <>\n <NavigationMenuTrigger data-active={item.active}>\n {item.label}\n </NavigationMenuTrigger>\n <NavigationMenuContent>\n {panel}\n </NavigationMenuContent>\n </>\n ) : (\n <NavigationMenuLink asChild active={item.active}>\n {link({\n href: item.href ?? \"#\",\n className: navigationMenuTriggerStyle(),\n \"aria-current\": item.active ? \"page\" : undefined,\n children: item.label,\n })}\n </NavigationMenuLink>\n )}\n </NavigationMenuItem>\n );\n })}\n </NavigationMenuList>\n </NavigationMenu>\n ) : null}\n\n <div className=\"flex flex-1 items-center justify-end gap-2\">\n {actions}\n\n {items.length > 0 ? (\n <Sheet open={mobileOpen} onOpenChange={setMobileOpen}>\n <SheetTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"md:hidden\"\n aria-label={mobileMenuLabel}\n >\n <Menu className=\"size-5\" aria-hidden />\n </Button>\n </SheetTrigger>\n {/* A list of links needs no describing beyond its title —\n the explicit `undefined` is how Radix is told that, and\n silences its missing-description warning. */}\n <SheetContent\n side=\"right\"\n size=\"sm\"\n aria-describedby={undefined}\n >\n {/* The drawer's nav is deliberately unnamed: the sheet\n title already names it, and a second landmark called\n \"Main\" is only ambiguity for a screen reader. */}\n <SheetTitle className=\"sr-only\">{navLabel}</SheetTitle>\n\n <div onClick={closeDrawerOnLink}>\n {logo ? (\n // `pr-12` keeps the mark clear of the sheet's own\n // absolutely positioned close button.\n <div className=\"flex items-center pr-12\">{logo}</div>\n ) : null}\n\n <nav className={cn(logo ? \"mt-8\" : \"mt-6\")}>\n <Accordion type=\"single\" collapsible className=\"w-full\">\n {items.map((item) => {\n const subs = item.items ?? [];\n\n if (!subs.length && !item.content) {\n return (\n <div key={item.label} className=\"border-b\">\n {link({\n href: item.href ?? \"#\",\n className:\n \"flex py-4 text-base font-medium hover:underline\",\n \"aria-current\": item.active\n ? \"page\"\n : undefined,\n onClick: () => setMobileOpen(false),\n children: item.label,\n })}\n </div>\n );\n }\n\n return (\n <AccordionItem\n key={item.label}\n value={item.label}\n >\n <AccordionTrigger className=\"text-base\">\n {item.label}\n </AccordionTrigger>\n <AccordionContent className=\"flex flex-col gap-1 pl-1\">\n {item.content ??\n subs.map((sub) => (\n <React.Fragment key={sub.href}>\n {link({\n href: sub.href,\n className:\n \"block rounded-md px-2 py-2 text-sm text-muted-foreground hover:bg-accent hover:text-accent-foreground\",\n onClick: () => setMobileOpen(false),\n children: sub.label,\n })}\n </React.Fragment>\n ))}\n </AccordionContent>\n </AccordionItem>\n );\n })}\n </Accordion>\n </nav>\n </div>\n </SheetContent>\n </Sheet>\n ) : null}\n </div>\n </div>\n </div>\n </header>\n );\n }\n);\nFloatingNavBlock.displayName = \"FloatingNavBlock\";\n\nexport { FloatingNavBlock };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface SidebarItem {\n label: string;\n href?: string;\n icon?: React.ReactNode;\n active?: boolean;\n onClick?: () => void;\n children?: SidebarItem[];\n}\n\nexport interface SidebarSection {\n title?: string;\n items: SidebarItem[];\n}\n\nexport interface SidebarBlockProps {\n sections: SidebarSection[];\n header?: React.ReactNode;\n footer?: React.ReactNode;\n collapsed?: boolean;\n className?: string;\n}\n\nfunction SidebarItemComponent({ item, collapsed }: { item: SidebarItem; collapsed?: boolean }) {\n const Comp = item.href ? \"a\" : \"button\";\n return (\n <Comp\n href={item.href}\n onClick={item.onClick}\n className={cn(\n \"flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground\",\n item.active && \"bg-accent text-accent-foreground\",\n collapsed && \"justify-center px-2\"\n )}\n >\n {item.icon && <span className=\"flex h-5 w-5 shrink-0 items-center justify-center\">{item.icon}</span>}\n {!collapsed && <span>{item.label}</span>}\n </Comp>\n );\n}\n\nexport function SidebarBlock({\n sections,\n header,\n footer,\n collapsed = false,\n className,\n}: SidebarBlockProps) {\n return (\n <div className={cn(\"flex h-full flex-col\", className)}>\n {header && (\n <div className={cn(\"border-b p-4\", collapsed && \"p-2\")}>{header}</div>\n )}\n <nav className=\"flex-1 space-y-4 overflow-y-auto p-4\">\n {sections.map((section, sIdx) => (\n <div key={sIdx} className=\"space-y-1\">\n {section.title && !collapsed && (\n <p className=\"px-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground\">\n {section.title}\n </p>\n )}\n {section.items.map((item, iIdx) => (\n <SidebarItemComponent key={iIdx} item={item} collapsed={collapsed} />\n ))}\n </div>\n ))}\n </nav>\n {footer && (\n <div className={cn(\"border-t p-4\", collapsed && \"p-2\")}>{footer}</div>\n )}\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface FooterLink {\n label: string;\n href: string;\n}\n\nexport interface FooterBlockProps {\n copyright?: string;\n links?: FooterLink[];\n logo?: React.ReactNode;\n className?: string;\n}\n\nexport function FooterBlock({\n copyright,\n links = [],\n logo,\n className,\n}: FooterBlockProps) {\n return (\n <footer className={cn(\"border-t bg-background\", className)}>\n <div className=\"flex flex-col items-center gap-4 px-4 py-6 md:flex-row md:justify-between md:px-6\">\n <div className=\"flex items-center gap-2\">\n {logo}\n {copyright && (\n <p className=\"text-sm text-muted-foreground\">{copyright}</p>\n )}\n </div>\n {links.length > 0 && (\n <nav className=\"flex gap-4\">\n {links.map((link) => (\n <a\n key={link.href}\n href={link.href}\n className=\"text-sm text-muted-foreground hover:text-foreground transition-colors\"\n >\n {link.label}\n </a>\n ))}\n </nav>\n )}\n </div>\n </footer>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { ChevronsUpDown, Plus } from \"lucide-react\";\n\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuTrigger,\n} from \"../../../components/dropdown-menu\";\nimport {\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n useSidebar,\n} from \"../../../components/sidebar\";\nimport type { SidebarTeam } from \"./types\";\n\nexport interface TeamSwitcherProps {\n teams: SidebarTeam[];\n activeTeam?: SidebarTeam;\n onTeamChange?: (team: SidebarTeam) => void;\n onAddTeam?: () => void;\n}\n\nexport function TeamSwitcher({\n teams,\n activeTeam: activeTeamProp,\n onTeamChange,\n onAddTeam,\n}: TeamSwitcherProps) {\n const { isMobile } = useSidebar();\n const [internalActive, setInternalActive] = React.useState(teams[0]);\n const activeTeam = activeTeamProp ?? internalActive;\n\n if (!activeTeam) {\n return null;\n }\n\n return (\n <SidebarMenu>\n <SidebarMenuItem>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <SidebarMenuButton\n size=\"lg\"\n className=\"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground\"\n >\n <div className=\"flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground\">\n <activeTeam.logo className=\"size-4\" />\n </div>\n <div className=\"grid flex-1 text-left text-sm leading-tight\">\n <span className=\"truncate font-medium\">\n {activeTeam.name}\n </span>\n <span className=\"truncate text-xs\">{activeTeam.plan}</span>\n </div>\n <ChevronsUpDown className=\"ml-auto\" />\n </SidebarMenuButton>\n </DropdownMenuTrigger>\n <DropdownMenuContent\n className=\"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg\"\n align=\"start\"\n side={isMobile ? \"bottom\" : \"right\"}\n sideOffset={4}\n >\n <DropdownMenuLabel className=\"text-xs text-muted-foreground\">\n Teams\n </DropdownMenuLabel>\n {teams.map((team, index) => (\n <DropdownMenuItem\n key={team.name}\n onClick={() => {\n setInternalActive(team);\n onTeamChange?.(team);\n }}\n className=\"gap-2 p-2\"\n >\n <div className=\"flex size-6 items-center justify-center rounded-md border\">\n <team.logo className=\"size-3.5 shrink-0\" />\n </div>\n {team.name}\n <DropdownMenuShortcut>\n {\"⌘\"}\n {index + 1}\n </DropdownMenuShortcut>\n </DropdownMenuItem>\n ))}\n {onAddTeam && (\n <>\n <DropdownMenuSeparator />\n <DropdownMenuItem className=\"gap-2 p-2\" onClick={onAddTeam}>\n <div className=\"flex size-6 items-center justify-center rounded-md border bg-transparent\">\n <Plus className=\"size-4\" />\n </div>\n <div className=\"font-medium text-muted-foreground\">\n Add team\n </div>\n </DropdownMenuItem>\n </>\n )}\n </DropdownMenuContent>\n </DropdownMenu>\n </SidebarMenuItem>\n </SidebarMenu>\n );\n}\n","\"use client\";\n\nimport { ChevronRight } from \"lucide-react\";\n\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"../../../components/collapsible\";\nimport {\n SidebarGroup,\n SidebarGroupLabel,\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n} from \"../../../components/sidebar\";\nimport type { SidebarNavGroup } from \"./types\";\n\nexport interface SidebarNavProps {\n groups: SidebarNavGroup[];\n}\n\nexport function SidebarNav({ groups }: SidebarNavProps) {\n return (\n <>\n {groups.map((group, groupIdx) => (\n <SidebarGroup key={group.label ?? groupIdx}>\n {group.label && <SidebarGroupLabel>{group.label}</SidebarGroupLabel>}\n <SidebarMenu>\n {group.items.map((item) => {\n if (item.items && item.items.length > 0) {\n return (\n <Collapsible\n key={item.title}\n asChild\n defaultOpen={item.isActive}\n className=\"group/collapsible\"\n >\n <SidebarMenuItem>\n <CollapsibleTrigger asChild>\n <SidebarMenuButton tooltip={item.title}>\n {item.icon}\n <span>{item.title}</span>\n <ChevronRight className=\"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90\" />\n </SidebarMenuButton>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <SidebarMenuSub>\n {item.items.map((subItem) => (\n <SidebarMenuSubItem key={subItem.title}>\n <SidebarMenuSubButton\n asChild\n isActive={subItem.isActive}\n >\n <a\n href={subItem.url}\n onClick={(e) => {\n if (subItem.onClick) {\n e.preventDefault();\n subItem.onClick();\n }\n }}\n >\n <span>{subItem.title}</span>\n </a>\n </SidebarMenuSubButton>\n </SidebarMenuSubItem>\n ))}\n </SidebarMenuSub>\n </CollapsibleContent>\n </SidebarMenuItem>\n </Collapsible>\n );\n }\n\n return (\n <SidebarMenuItem key={item.title}>\n <SidebarMenuButton\n asChild\n tooltip={item.title}\n isActive={item.isActive}\n >\n <a\n href={item.url}\n onClick={(e) => {\n if (item.onClick) {\n e.preventDefault();\n item.onClick();\n }\n }}\n >\n {item.icon}\n <span>{item.title}</span>\n </a>\n </SidebarMenuButton>\n </SidebarMenuItem>\n );\n })}\n </SidebarMenu>\n </SidebarGroup>\n ))}\n </>\n );\n}\n","\"use client\";\n\nimport { ChevronsUpDown, LogOut } from \"lucide-react\";\n\nimport {\n Avatar,\n AvatarFallback,\n AvatarImage,\n} from \"../../../components/avatar\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from \"../../../components/dropdown-menu\";\nimport {\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n useSidebar,\n} from \"../../../components/sidebar\";\nimport type { SidebarUser, SidebarUserMenuItem } from \"./types\";\n\nexport interface SidebarUserNavProps {\n user: SidebarUser;\n menuGroups?: SidebarUserMenuItem[][];\n onLogout: () => void;\n}\n\nfunction getInitials(name: string): string {\n return name\n .split(\" \")\n .map((part) => part[0])\n .join(\"\")\n .toUpperCase()\n .slice(0, 2);\n}\n\nexport function SidebarUserNav({\n user,\n menuGroups,\n onLogout,\n}: SidebarUserNavProps) {\n const { isMobile } = useSidebar();\n\n return (\n <SidebarMenu>\n <SidebarMenuItem>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <SidebarMenuButton\n size=\"lg\"\n className=\"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground\"\n >\n <Avatar className=\"h-8 w-8 rounded-lg\">\n {user.avatar && (\n <AvatarImage src={user.avatar} alt={user.name} />\n )}\n <AvatarFallback className=\"rounded-lg\">\n {getInitials(user.name)}\n </AvatarFallback>\n </Avatar>\n <div className=\"grid flex-1 text-left text-sm leading-tight\">\n <span className=\"truncate font-medium\">{user.name}</span>\n <span className=\"truncate text-xs\">{user.email}</span>\n </div>\n <ChevronsUpDown className=\"ml-auto size-4\" />\n </SidebarMenuButton>\n </DropdownMenuTrigger>\n <DropdownMenuContent\n className=\"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg\"\n side={isMobile ? \"bottom\" : \"right\"}\n align=\"end\"\n sideOffset={4}\n >\n <DropdownMenuLabel className=\"p-0 font-normal\">\n <div className=\"flex items-center gap-2 px-1 py-1.5 text-left text-sm\">\n <Avatar className=\"h-8 w-8 rounded-lg\">\n {user.avatar && (\n <AvatarImage src={user.avatar} alt={user.name} />\n )}\n <AvatarFallback className=\"rounded-lg\">\n {getInitials(user.name)}\n </AvatarFallback>\n </Avatar>\n <div className=\"grid flex-1 text-left text-sm leading-tight\">\n <span className=\"truncate font-medium\">{user.name}</span>\n <span className=\"truncate text-xs\">{user.email}</span>\n </div>\n </div>\n </DropdownMenuLabel>\n {menuGroups?.map((group, groupIdx) => (\n <span key={groupIdx}>\n <DropdownMenuSeparator />\n <DropdownMenuGroup>\n {group.map((item) => (\n <DropdownMenuItem key={item.label} onClick={item.onClick}>\n {item.icon}\n {item.label}\n </DropdownMenuItem>\n ))}\n </DropdownMenuGroup>\n </span>\n ))}\n <DropdownMenuSeparator />\n <DropdownMenuItem onClick={onLogout}>\n <LogOut />\n Log out\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </SidebarMenuItem>\n </SidebarMenu>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\n\nimport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarHeader,\n SidebarRail,\n} from \"../../../components/sidebar\";\nimport { TeamSwitcher } from \"./team-switcher\";\nimport { SidebarNav } from \"./sidebar-nav\";\nimport { SidebarUserNav } from \"./sidebar-user\";\nimport type {\n SidebarTeam,\n SidebarNavGroup,\n SidebarUser,\n SidebarUserMenuItem,\n} from \"./types\";\n\nexport interface AppSidebarBlockProps\n extends React.ComponentProps<typeof Sidebar> {\n /** One or more teams displayed in the header switcher */\n teams: SidebarTeam[];\n /** Currently active team (defaults to first team) */\n activeTeam?: SidebarTeam;\n /** Called when user switches teams */\n onTeamChange?: (team: SidebarTeam) => void;\n /** Called when \"Add team\" is clicked — omit to hide the button */\n onAddTeam?: () => void;\n\n /** Flexible navigation groups rendered in the sidebar body */\n navGroups?: SidebarNavGroup[];\n\n /** User info displayed in the footer */\n user: SidebarUser;\n /** Optional grouped menu items in the user dropdown (e.g. Account, Billing) */\n userMenuGroups?: SidebarUserMenuItem[][];\n /** Called on logout — always rendered */\n onLogout: () => void;\n}\n\nexport function AppSidebarBlock({\n teams,\n activeTeam,\n onTeamChange,\n onAddTeam,\n navGroups,\n user,\n userMenuGroups,\n onLogout,\n ...sidebarProps\n}: AppSidebarBlockProps) {\n return (\n <Sidebar collapsible=\"icon\" {...sidebarProps}>\n <SidebarHeader>\n <TeamSwitcher\n teams={teams}\n activeTeam={activeTeam}\n onTeamChange={onTeamChange}\n onAddTeam={onAddTeam}\n />\n </SidebarHeader>\n <SidebarContent>\n {navGroups && navGroups.length > 0 && (\n <SidebarNav groups={navGroups} />\n )}\n </SidebarContent>\n <SidebarFooter>\n <SidebarUserNav\n user={user}\n menuGroups={userMenuGroups}\n onLogout={onLogout}\n />\n </SidebarFooter>\n <SidebarRail />\n </Sidebar>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { ArrowRight, Image as ImageIcon } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport {\n Card,\n CardContent,\n CardFooter,\n CardHeader,\n CardTitle,\n CardDescription,\n} from \"../../components/card\";\nimport { Badge } from \"../../components/badge\";\nimport { Button } from \"../../components/button\";\nimport { AspectRatio } from \"../../components/aspect-ratio\";\n\nexport interface MediaCardMeta {\n /**\n * Optional icon for the meta row. Pass any React node (`<FontAwesomeIcon … />`,\n * a Lucide icon, an inline SVG, etc.).\n */\n icon?: React.ReactNode;\n label: string;\n}\n\nexport interface MediaCardProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Cover image source and alt text */\n image?: { src: string; alt: string };\n /**\n * Icon displayed when no image is provided. Pass any React node. Defaults to\n * a Lucide `Image` glyph.\n */\n fallbackIcon?: React.ReactNode;\n /** Optional badge shown over the image area */\n badge?: string;\n /** Card title */\n title: string;\n /** Card description */\n description?: string;\n /** Metadata items rendered below the description */\n meta?: MediaCardMeta[];\n /** Footer text rendered as a CTA link/button */\n footer?: string;\n /** URL for the card link / CTA */\n href?: string;\n /** Click handler for the CTA (used when no href is provided) */\n onAction?: () => void;\n /** Loading state */\n loading?: boolean;\n /** Disabled state */\n disabled?: boolean;\n}\n\nconst MediaCard = React.forwardRef<HTMLDivElement, MediaCardProps>(\n (\n {\n image,\n fallbackIcon,\n badge,\n title,\n description,\n meta,\n footer,\n href,\n onAction,\n loading,\n disabled,\n className,\n ...props\n },\n ref,\n ) => {\n const Wrapper = href ? \"a\" : \"div\";\n const wrapperProps = href\n ? {\n href,\n className:\n \"block focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 rounded-lg\",\n }\n : {};\n\n return (\n <Wrapper {...wrapperProps}>\n <Card\n ref={ref}\n className={cn(\n \"overflow-hidden transition-shadow duration-normal ease-default\",\n href && \"hover:shadow-md\",\n disabled && \"pointer-events-none opacity-50\",\n className,\n )}\n {...props}\n >\n {/* Image / Fallback area */}\n <div className=\"relative\">\n <AspectRatio ratio={16 / 9}>\n {image ? (\n <img\n src={image.src}\n alt={image.alt}\n className=\"h-full w-full object-cover\"\n />\n ) : (\n <div className=\"flex h-full w-full items-center justify-center bg-muted text-muted-foreground [&_svg]:h-10 [&_svg]:w-10\">\n {fallbackIcon ?? <ImageIcon />}\n </div>\n )}\n </AspectRatio>\n {badge && (\n <div className=\"absolute top-2 right-2\">\n <Badge variant=\"secondary\">{badge}</Badge>\n </div>\n )}\n </div>\n\n {/* Content */}\n <CardHeader>\n <CardTitle className=\"text-lg\">{title}</CardTitle>\n {description && <CardDescription>{description}</CardDescription>}\n </CardHeader>\n\n {/* Meta items */}\n {meta && meta.length > 0 && (\n <CardContent>\n <div className=\"flex flex-wrap gap-x-4 gap-y-1 text-sm text-muted-foreground\">\n {meta.map((item, i) => (\n <span\n key={i}\n className=\"inline-flex items-center gap-1.5 [&_svg]:h-3.5 [&_svg]:w-3.5\"\n >\n {item.icon}\n {item.label}\n </span>\n ))}\n </div>\n </CardContent>\n )}\n\n {/* Footer CTA */}\n {footer && (\n <CardFooter>\n {href ? (\n <span className=\"inline-flex items-center gap-1.5 text-sm font-medium text-primary\">\n {footer}\n <ArrowRight className=\"h-3.5 w-3.5\" />\n </span>\n ) : (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={onAction}\n disabled={disabled || loading}\n className=\"gap-1.5 px-0 text-primary hover:text-primary/80\"\n >\n {footer}\n <ArrowRight className=\"h-3.5 w-3.5\" />\n </Button>\n )}\n </CardFooter>\n )}\n </Card>\n </Wrapper>\n );\n },\n);\nMediaCard.displayName = \"MediaCard\";\n\nexport { MediaCard };\n","\"use client\";\n\nimport * as React from \"react\";\nimport type { NapRecord } from \"./nap-block\";\n\n/** schema.org `PostalAddress` node, as emitted by `napRecordToJsonLd`. */\nexport interface PostalAddressJsonLd {\n \"@type\": \"PostalAddress\";\n streetAddress: string;\n addressLocality: string;\n addressRegion: string;\n postalCode: string;\n addressCountry: string;\n}\n\n/**\n * One entry of a LocalBusiness `department` array — itself a\n * LocalBusiness-family node, inheriting the parent's address rather than\n * repeating it. See https://schema.org/department.\n */\nexport interface LocalBusinessDepartmentJsonLd {\n \"@type\": string;\n name: string;\n telephone: string;\n}\n\n/**\n * The shape `napRecordToJsonLd` produces: a single top-level\n * LocalBusiness-family node. With exactly one department its phone is\n * promoted to the top-level `telephone`; with two or more, each becomes its\n * own `department` entry and no top-level `telephone` is set.\n */\nexport interface LocalBusinessJsonLd {\n \"@context\": \"https://schema.org\";\n \"@type\": string;\n name: string;\n address: PostalAddressJsonLd;\n telephone?: string;\n department?: LocalBusinessDepartmentJsonLd[];\n url?: string;\n}\n\n/**\n * Maps a `NapRecord` — the same object rendered by `NapBlock` — onto\n * schema.org's actual pattern for one business, one address, and multiple\n * named departments: a single LocalBusiness-family node with a `department`\n * array, where each department is its own LocalBusiness-family node\n * carrying its own `name` and `telephone` and inheriting the parent\n * `address` (https://schema.org/department). This is the real schema.org\n * shape for this case — deliberately not a bespoke \"locations\" array — so\n * the output validates and matches what Google expects for multi-department\n * local businesses.\n *\n * - Exactly one department: its phone is promoted to the top-level\n * `telephone` and no `department` array is emitted. The common\n * single-phone business shouldn't produce a spurious nested node.\n * - Two or more departments: every one becomes its own `department` entry\n * and the top-level `telephone` is omitted, so multiple phone numbers are\n * never flattened into one generic number.\n */\nexport function napRecordToJsonLd(record: NapRecord): LocalBusinessJsonLd {\n const { name, type, address, departments, url } = record;\n\n const shaped: LocalBusinessJsonLd = {\n \"@context\": \"https://schema.org\",\n \"@type\": type,\n name,\n address: {\n \"@type\": \"PostalAddress\",\n streetAddress: address.streetAddress,\n addressLocality: address.addressLocality,\n addressRegion: address.addressRegion,\n postalCode: address.postalCode,\n addressCountry: address.addressCountry ?? \"US\",\n },\n };\n\n if (url) shaped.url = url;\n\n if (departments.length <= 1) {\n if (departments[0]) shaped.telephone = departments[0].phone.e164;\n return shaped;\n }\n\n shaped.department = departments.map((dept) => ({\n \"@type\": dept.type ?? type,\n name: dept.name,\n telephone: dept.phone.e164,\n }));\n return shaped;\n}\n\nfunction isNapRecord(\n data: NapRecord | Record<string, unknown>,\n): data is NapRecord {\n return (\n typeof data === \"object\" &&\n data !== null &&\n Array.isArray((data as Partial<NapRecord>).departments) &&\n typeof (data as Partial<NapRecord>).address === \"object\"\n );\n}\n\n/**\n * Escapes `<` so a string value (e.g. a name containing `</script>`) can't\n * terminate the tag early. Standard hardening for inline JSON in HTML; see\n * https://v8.dev/features/subsume-json.\n */\nfunction safeJsonStringify(value: unknown): string {\n return JSON.stringify(value).replace(/</g, \"\\\\u003c\");\n}\n\nexport interface JsonLdProps {\n /**\n * Either a fully-formed schema.org object — any type, this component\n * neither knows nor cares what shape it is — or a `NapRecord`, which is\n * mapped to the LocalBusiness `department` shape via `napRecordToJsonLd`\n * before serializing. Passing the *same* `NapRecord` here and to\n * `NapBlock` is what keeps the visible NAP and the structured data from\n * drifting apart.\n */\n data: NapRecord | Record<string, unknown>;\n /** Optional CSP nonce forwarded to the `<script>` tag. */\n nonce?: string;\n}\n\n/**\n * Dumb serializer: renders a `<script type=\"application/ld+json\">` tag from\n * whatever schema.org-shaped object it's given. Contains no business logic\n * about what a business \"should\" look like — the only transformation it\n * ever performs is the structural `NapRecord` → LocalBusiness mapping in\n * `napRecordToJsonLd`, and only when handed a `NapRecord` instead of an\n * already-shaped object.\n */\nconst JsonLd = React.forwardRef<HTMLScriptElement, JsonLdProps>(\n ({ data, nonce }, ref) => {\n const shaped = isNapRecord(data) ? napRecordToJsonLd(data) : data;\n return (\n <script\n ref={ref}\n type=\"application/ld+json\"\n nonce={nonce}\n // eslint-disable-next-line react/no-danger -- JSON.stringify output, `<` escaped above\n dangerouslySetInnerHTML={{ __html: safeJsonStringify(shaped) }}\n />\n );\n },\n);\nJsonLd.displayName = \"JsonLd\";\n\nexport { JsonLd };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { MapPin, Phone } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { formatUsPhone } from \"../../lib/us-phone\";\n\n/**\n * A single physical mailing address — schema.org `PostalAddress` shape,\n * minus the `@type` key that `JsonLd` adds when serializing.\n */\nexport interface NapAddress {\n streetAddress: string;\n addressLocality: string;\n addressRegion: string;\n postalCode: string;\n /**\n * ISO 3166-1 alpha-2 country code (e.g. \"US\", \"CA\"). Defaults to \"US\" in\n * both the rendered address and the JSON-LD output.\n */\n addressCountry?: string;\n}\n\nexport interface NapPhone {\n /**\n * E.164 format, e.g. \"+15551234567\". This is the *only* value used for\n * the `tel:` href and the JSON-LD `telephone` field — `display` never\n * feeds either of those, so a prettified string can't silently become an\n * unreachable link.\n */\n e164: string;\n /**\n * Human-readable text shown on the page, e.g. \"(555) 123-4567\". Defaults\n * to `formatUsPhone(e164)` when omitted, which assumes a US/NANP number —\n * pass this explicitly for non-US numbers.\n */\n display?: string;\n}\n\nexport interface NapDepartment {\n /** Stable key for React lists and for matching entries in tests. */\n id: string;\n /**\n * Department or Google Business Profile name, e.g.\n * \"Chiropractic & Wellness\". When there is exactly one department this is\n * typically identical to the business `name`.\n */\n name: string;\n /**\n * schema.org `@type` for this department's own node (e.g. \"Chiropractor\",\n * \"MedicalSpa\"). Falls back to the parent `NapRecord.type` when omitted —\n * most single-department businesses can leave this out entirely.\n */\n type?: string;\n phone: NapPhone;\n}\n\nexport interface NapRecord {\n /** Public/legal business name. */\n name: string;\n /**\n * schema.org `@type` for the business, e.g. \"Chiropractor\", \"Restaurant\",\n * \"ProfessionalService\". A plain string rather than a closed union on\n * purpose — schema.org's LocalBusiness hierarchy is large, and each\n * consuming site needs a different leaf type.\n */\n type: string;\n /** The one physical address shared by the business and every department. */\n address: NapAddress;\n /**\n * One or more named departments, each with its own phone number, all at\n * the shared `address`. This is NOT a list of separate locations — every\n * entry sits at the same building. A single-phone business is just one\n * department (commonly named the same as the business). Multiple entries\n * model distinct Google Business Profiles at one address, e.g. a\n * chiropractic practice and its medspa: two names, two numbers, one\n * building. `NapBlock` and `JsonLd` both read this same array, which is\n * what keeps the visible phone numbers and the structured data from\n * drifting apart.\n */\n departments: NapDepartment[];\n /**\n * Canonical business URL. Used as the JSON-LD `url` and, when provided,\n * as the link target for the business name in `NapBlock`.\n */\n url?: string;\n}\n\nexport interface NapBlockProps\n extends Omit<React.HTMLAttributes<HTMLElement>, \"children\"> {\n /** The shared NAP source of truth — also pass this same object to `JsonLd`. */\n record: NapRecord;\n /** Render the business name as a heading. Defaults to `true`. */\n showName?: boolean;\n /**\n * Heading element for the business name. Defaults to `\"h3\"`, suited to a\n * footer contact block or a card embedded in a larger page; pass `\"h2\"`\n * when this is the primary heading of a standalone contact section.\n */\n headingLevel?: \"h2\" | \"h3\" | \"h4\";\n /** Icon shown beside the address. Defaults to a Lucide `MapPin` glyph. */\n addressIcon?: React.ReactNode;\n /** Icon shown beside each phone number. Defaults to a Lucide `Phone` glyph. */\n phoneIcon?: React.ReactNode;\n}\n\nconst NapBlock = React.forwardRef<HTMLElement, NapBlockProps>(\n (\n {\n record,\n showName = true,\n headingLevel = \"h3\",\n addressIcon,\n phoneIcon,\n className,\n ...props\n },\n ref,\n ) => {\n const { name, address, departments, url } = record;\n const country = address.addressCountry ?? \"US\";\n const Heading = headingLevel;\n const multiDepartment = departments.length > 1;\n\n return (\n // <address> is the semantically correct element for a block of contact\n // info; browsers italicize it by default, hence `not-italic`.\n <address\n ref={ref}\n className={cn(\"not-italic space-y-4\", className)}\n {...props}\n >\n {showName && (\n <Heading className=\"text-base font-semibold tracking-tight\">\n {url ? (\n <a href={url} className=\"hover:underline\">\n {name}\n </a>\n ) : (\n name\n )}\n </Heading>\n )}\n\n <div className=\"flex items-start gap-2 text-sm text-muted-foreground\">\n <span aria-hidden className=\"mt-0.5 shrink-0 text-foreground/60\">\n {addressIcon ?? <MapPin className=\"size-4\" strokeWidth={1.5} />}\n </span>\n <span>\n {address.streetAddress}\n <br />\n {address.addressLocality}, {address.addressRegion}{\" \"}\n {address.postalCode}\n {country !== \"US\" && <>, {country}</>}\n </span>\n </div>\n\n <ul className=\"space-y-2\">\n {departments.map((dept) => (\n <li key={dept.id} className=\"flex items-center gap-2 text-sm\">\n <span aria-hidden className=\"shrink-0 text-foreground/60\">\n {phoneIcon ?? <Phone className=\"size-4\" strokeWidth={1.5} />}\n </span>\n <span>\n {multiDepartment && (\n <span className=\"mr-1.5 font-medium text-foreground\">\n {dept.name}:\n </span>\n )}\n <a\n href={`tel:${dept.phone.e164}`}\n className=\"hover:underline\"\n >\n {dept.phone.display ?? formatUsPhone(dept.phone.e164)}\n </a>\n </span>\n </li>\n ))}\n </ul>\n </address>\n );\n },\n);\nNapBlock.displayName = \"NapBlock\";\n\nexport { NapBlock };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { MoveUpRight } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport {\n Accordion,\n AccordionContent,\n AccordionItem,\n AccordionTrigger,\n} from \"../../components/accordion\";\n\nexport interface ShowcasePanelItem {\n /** Stable identifier for the item */\n id: string;\n /** Panel title */\n title: string;\n /** Short description revealed on the expanded panel */\n summary: string;\n /** Panel background image */\n image: { src: string; alt?: string };\n /** URL for the corner \"read more\" action; renders an anchor */\n href?: string;\n /**\n * Label shown on the collapsed spine and expanded caption. Defaults per\n * `spineVariant`: `\"numbered\"` → 01, 02, …; `\"volume\"` → I, II, ….\n */\n numeral?: string;\n}\n\n/**\n * Curated looks for the collapsed spines.\n *\n * - `\"numbered\"` — neutral default: 01 / 02 / 03 figures, no ornament\n * - `\"volume\"` — book-spine treatment: roman numerals and binding rules\n * - `\"minimal\"` — vertical title only, no numbering\n */\nexport type ShowcaseSpineVariant = \"numbered\" | \"volume\" | \"minimal\";\n\nexport interface ShowcasePanelsLabels {\n /** Caption prefix on the active panel. Defaults to \"Selected\". */\n selected?: string;\n /** Caption prefix on a hover-previewed panel. Defaults to \"Preview\". */\n preview?: string;\n}\n\nexport interface ShowcasePanelsBlockProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onChange\"> {\n /** Panels to render. Designed for 3–6 items. */\n items: ShowcasePanelItem[];\n /** Index of the initially selected panel (uncontrolled) */\n defaultActiveIndex?: number;\n /** Selected panel index (controlled) */\n activeIndex?: number;\n /** Called when the user selects a panel */\n onActiveIndexChange?: (index: number) => void;\n /**\n * Called when the corner action of a panel without an `href` is activated.\n * The action button is omitted for items with neither `href` nor this\n * handler.\n */\n onItemAction?: (item: ShowcasePanelItem, index: number) => void;\n /**\n * Small monospace watermark on collapsed spines, e.g. a brand name. Rendered\n * as \"BRAND · 01\". Omitted when not provided.\n */\n watermark?: string;\n /** Accessible label for the panel list */\n ariaLabel?: string;\n /**\n * Builds the accessible label for each panel's corner action.\n * Defaults to `Read more about {title}`.\n */\n actionLabel?: (item: ShowcasePanelItem) => string;\n /** Icon for the corner action. Defaults to a Lucide `MoveUpRight` glyph. */\n actionIcon?: React.ReactNode;\n /**\n * Custom image renderer (e.g. `next/image`). The returned node is absolutely\n * positioned to fill the panel; it should render the image with\n * `object-cover`. Defaults to a plain `<img>`.\n */\n renderImage?: (item: ShowcasePanelItem, index: number) => React.ReactNode;\n /**\n * Curated collapsed-spine look. Defaults to `\"numbered\"`, a neutral style\n * suited to most content. Use `\"volume\"` for the book-spine / law-library\n * treatment, or `\"minimal\"` for just the vertical title.\n */\n spineVariant?: ShowcaseSpineVariant;\n /**\n * Fully custom collapsed-spine renderer, for brand marks, icons, or any\n * layout `spineVariant` doesn't cover. Overrides `spineVariant` when\n * provided. The returned node fills the spine.\n */\n renderSpine?: (\n item: ShowcasePanelItem,\n index: number,\n state: { isActive: boolean; numeral: string },\n ) => React.ReactNode;\n /** Caption word overrides. Defaults to English (\"Selected\" / \"Preview\"). */\n labels?: ShowcasePanelsLabels;\n}\n\n/** 1 → \"I\", 2 → \"II\", … Enough for any sane panel count. */\nfunction toRoman(n: number): string {\n const table: [number, string][] = [\n [10, \"X\"],\n [9, \"IX\"],\n [5, \"V\"],\n [4, \"IV\"],\n [1, \"I\"],\n ];\n let out = \"\";\n for (const [value, glyph] of table) {\n while (n >= value) {\n out += glyph;\n n -= value;\n }\n }\n return out;\n}\n\nconst EASE_LAYOUT = \"cubic-bezier(0, 0, 0.2, 1)\";\n\nconst ShowcasePanelsBlock = React.forwardRef<\n HTMLDivElement,\n ShowcasePanelsBlockProps\n>(\n (\n {\n items,\n defaultActiveIndex = 0,\n activeIndex: activeIndexProp,\n onActiveIndexChange,\n onItemAction,\n watermark,\n ariaLabel = \"Showcase panels\",\n actionLabel = (item) => `Read more about ${item.title}`,\n actionIcon,\n renderImage,\n spineVariant = \"numbered\",\n renderSpine,\n labels,\n className,\n ...props\n },\n ref,\n ) => {\n const [activeIndexState, setActiveIndexState] =\n React.useState(defaultActiveIndex);\n const activeIndex = activeIndexProp ?? activeIndexState;\n const [hoverIndex, setHoverIndex] = React.useState<number | null>(null);\n const uid = React.useId();\n const tabRefs = React.useRef<(HTMLButtonElement | null)[]>([]);\n const tabId = (i: number) => `${uid}-tab-${i}`;\n const panelId = (i: number) => `${uid}-panel-${i}`;\n\n const setActiveIndex = (i: number) => {\n setActiveIndexState(i);\n onActiveIndexChange?.(i);\n };\n\n const focusTab = (i: number) => {\n setActiveIndex(i);\n tabRefs.current[i]?.focus();\n };\n\n const handleTablistKeyDown = (event: React.KeyboardEvent) => {\n const count = items.length;\n if (event.key === \"ArrowRight\") {\n event.preventDefault();\n focusTab((activeIndex + 1) % count);\n } else if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n focusTab((activeIndex - 1 + count) % count);\n } else if (event.key === \"Home\") {\n event.preventDefault();\n focusTab(0);\n } else if (event.key === \"End\") {\n event.preventDefault();\n focusTab(count - 1);\n }\n };\n\n const shownIndex = hoverIndex ?? activeIndex;\n const gridTemplate = items\n .map((_, i) => (i === shownIndex ? \"3fr\" : \"1fr\"))\n .join(\" \");\n\n const selectedLabel = labels?.selected ?? \"Selected\";\n const previewLabel = labels?.preview ?? \"Preview\";\n\n const numeralFor = (item: ShowcasePanelItem, i: number) =>\n item.numeral ??\n (spineVariant === \"volume\"\n ? toRoman(i + 1)\n : String(i + 1).padStart(2, \"0\"));\n\n const defaultImage = (item: ShowcasePanelItem) => (\n <img\n src={item.image.src}\n alt={item.image.alt ?? \"\"}\n className=\"absolute inset-0 h-full w-full object-cover\"\n />\n );\n\n const defaultSpine = (\n item: ShowcasePanelItem,\n i: number,\n { numeral }: { isActive: boolean; numeral: string },\n ) => {\n if (spineVariant === \"minimal\") {\n return (\n <span className=\"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rotate-180 text-sm font-light tracking-[0.25em] whitespace-nowrap text-foreground/90 uppercase [writing-mode:vertical-rl] md:text-base\">\n {item.title}\n </span>\n );\n }\n\n return (\n <>\n <span\n aria-hidden\n className=\"absolute inset-y-0 left-0 w-px bg-foreground/15\"\n />\n <span\n aria-hidden\n className=\"absolute inset-y-0 right-0 w-px bg-background/40\"\n />\n {spineVariant === \"volume\" && (\n <>\n <span\n aria-hidden\n className=\"absolute inset-x-2 top-10 h-px bg-foreground/15\"\n />\n <span\n aria-hidden\n className=\"absolute inset-x-2 top-12 h-px bg-foreground/15\"\n />\n <span\n aria-hidden\n className=\"absolute inset-x-2 bottom-10 h-px bg-foreground/15\"\n />\n <span\n aria-hidden\n className=\"absolute inset-x-2 bottom-12 h-px bg-foreground/15\"\n />\n </>\n )}\n\n <span className=\"absolute top-16 left-1/2 -translate-x-1/2 text-xl font-light tracking-widest text-foreground/70 md:text-2xl\">\n {numeral}\n </span>\n\n <span className=\"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rotate-180 text-sm font-light tracking-[0.25em] whitespace-nowrap text-foreground/90 uppercase [writing-mode:vertical-rl] md:text-base\">\n {item.title}\n </span>\n\n {watermark && (\n <span className=\"absolute bottom-16 left-1/2 -translate-x-1/2 font-mono text-[0.625rem] tracking-widest text-foreground/40 uppercase\">\n {watermark} &middot; {String(i + 1).padStart(2, \"0\")}\n </span>\n )}\n </>\n );\n };\n\n const cornerAction = (item: ShowcasePanelItem, i: number) => {\n const icon = actionIcon ?? (\n <MoveUpRight\n className=\"size-4 transition-transform group-hover/cta:translate-x-0.5 group-hover/cta:-translate-y-0.5\"\n strokeWidth={1.5}\n />\n );\n const actionClass =\n \"group/cta absolute top-5 right-5 z-10 grid size-10 place-items-center rounded-full bg-foreground/10 text-foreground backdrop-blur-sm transition-colors hover:bg-foreground/20 focus-visible:ring-2 focus-visible:ring-foreground/40 focus-visible:outline-none\";\n if (item.href) {\n return (\n <a href={item.href} aria-label={actionLabel(item)} className={actionClass}>\n {icon}\n </a>\n );\n }\n if (onItemAction) {\n return (\n <button\n type=\"button\"\n aria-label={actionLabel(item)}\n onClick={() => onItemAction(item, i)}\n className={actionClass}\n >\n {icon}\n </button>\n );\n }\n return null;\n };\n\n return (\n <div\n ref={ref}\n // The panel inset is designed dark regardless of page theme. Dark\n // tokens are consumer-configured under either `.dark` or\n // `[data-theme=\"dark\"]`, so set both.\n data-theme=\"dark\"\n className={cn(\n \"dark overflow-hidden rounded-xl bg-background text-foreground\",\n className,\n )}\n {...props}\n >\n {/* Desktop: expanding column grid */}\n <div className=\"hidden md:block\">\n <ul\n role=\"tablist\"\n aria-label={ariaLabel}\n className=\"relative grid h-[28rem] gap-[3px] motion-safe:transition-[grid-template-columns] motion-safe:duration-500 md:h-[36rem]\"\n style={{\n gridTemplateColumns: gridTemplate,\n transitionTimingFunction: EASE_LAYOUT,\n }}\n onMouseLeave={() => setHoverIndex(null)}\n onKeyDown={handleTablistKeyDown}\n >\n {items.map((item, i) => {\n const isActive = i === activeIndex;\n const isShown = i === shownIndex;\n const numeral = numeralFor(item, i);\n return (\n <li\n key={item.id}\n className=\"relative h-full min-w-0 overflow-hidden\"\n >\n <button\n ref={(el) => {\n tabRefs.current[i] = el;\n }}\n type=\"button\"\n role=\"tab\"\n id={tabId(i)}\n aria-controls={panelId(i)}\n aria-selected={isActive}\n aria-label={`${numeral}: ${item.title}`}\n tabIndex={isActive ? 0 : -1}\n onClick={() => setActiveIndex(i)}\n onMouseEnter={() => setHoverIndex(i)}\n onFocus={() => setHoverIndex(i)}\n onBlur={() => setHoverIndex(null)}\n className=\"relative block size-full text-left focus-visible:ring-2 focus-visible:ring-foreground/40 focus-visible:outline-none focus-visible:ring-inset\"\n >\n {/* Collapsed spine */}\n <span\n aria-hidden\n className={cn(\n \"absolute inset-0 z-10 bg-linear-to-b from-card via-card to-background transition-opacity duration-300 ease-out\",\n isShown\n ? \"pointer-events-none opacity-0\"\n : \"opacity-100\",\n )}\n >\n {(renderSpine ?? defaultSpine)(item, i, {\n isActive,\n numeral,\n })}\n </span>\n </button>\n\n {/* Expanded panel. A sibling of the tab, not a descendant\n of it — a <button> may not contain focusable content,\n and the panel's own tabIndex needs to track visibility\n independently for keyboard users. pointer-events-none\n lets clicks and hover fall through to the tab button\n beneath, which still spans the full tile. */}\n <div\n role=\"tabpanel\"\n id={panelId(i)}\n aria-labelledby={tabId(i)}\n aria-hidden={!isShown}\n tabIndex={isShown ? 0 : -1}\n className=\"pointer-events-none absolute inset-0 outline-none\"\n >\n {(renderImage ?? defaultImage)(item, i)}\n <span\n aria-hidden\n className=\"absolute inset-0 [mask-image:linear-gradient(to_top,black,transparent_85%)] backdrop-blur-md\"\n />\n <span\n aria-hidden\n className=\"absolute inset-0 bg-linear-to-t from-background/85 via-background/40 to-transparent\"\n />\n <span className=\"absolute inset-x-0 bottom-0 overflow-hidden\">\n <span\n className={cn(\n \"block space-y-2 p-5 transition-transform duration-500 ease-out\",\n isShown\n ? \"translate-y-0\"\n : \"motion-safe:translate-y-full\",\n )}\n >\n <span\n className={cn(\n \"block font-mono text-[0.625rem] tracking-widest text-foreground/60 uppercase transition-[opacity,transform] duration-500 ease-out\",\n isShown\n ? \"translate-y-0 opacity-100 delay-100\"\n : \"opacity-0 motion-safe:translate-y-6\",\n )}\n >\n {isActive ? selectedLabel : previewLabel} {numeral}\n </span>\n <span\n className={cn(\n \"block text-xl leading-tight font-medium tracking-tight transition-[opacity,transform] duration-500 ease-out md:text-2xl\",\n isShown\n ? \"translate-y-0 opacity-100\"\n : \"opacity-0 motion-safe:translate-y-8\",\n )}\n >\n {item.title}\n </span>\n <span\n className={cn(\n \"block max-w-md text-xs leading-snug text-foreground/75 transition-[opacity,transform] duration-500 ease-out md:text-sm\",\n isShown\n ? \"translate-y-0 opacity-100 delay-200\"\n : \"opacity-0 motion-safe:translate-y-8\",\n )}\n >\n {item.summary}\n </span>\n </span>\n </span>\n </div>\n\n {isShown && cornerAction(item, i)}\n </li>\n );\n })}\n </ul>\n\n <div\n aria-hidden\n className=\"relative mt-1 h-2 bg-linear-to-b from-foreground/30 via-foreground/10 to-transparent\"\n />\n </div>\n\n {/* Mobile: accordion */}\n <div className=\"md:hidden\">\n <Accordion\n type=\"single\"\n value={items[activeIndex]?.id ?? items[0]?.id}\n onValueChange={(v: string) => {\n if (!v) return;\n const i = items.findIndex((item) => item.id === v);\n if (i >= 0) setActiveIndex(i);\n }}\n >\n {items.map((item, i) => {\n const numeral = numeralFor(item, i);\n return (\n <AccordionItem\n key={item.id}\n value={item.id}\n className=\"border-foreground/10\"\n >\n <AccordionTrigger className=\"items-center gap-4 px-5 py-5 text-base font-medium tracking-tight hover:no-underline\">\n <span className=\"inline-block min-w-[1.75rem] shrink-0 font-mono text-xs tracking-widest text-foreground/55\">\n {numeral}\n </span>\n <span className=\"flex-1 text-left text-foreground/80\">\n {item.title}\n </span>\n </AccordionTrigger>\n <AccordionContent className=\"p-0\">\n <div className=\"relative aspect-[16/10] w-full overflow-hidden\">\n {(renderImage ?? defaultImage)(item, i)}\n {cornerAction(item, i)}\n </div>\n <div className=\"space-y-3 p-5\">\n <span className=\"block font-mono text-[0.625rem] tracking-widest text-foreground/55 uppercase\">\n {selectedLabel} &middot; {numeral}\n </span>\n <p className=\"text-sm leading-relaxed text-foreground/80\">\n {item.summary}\n </p>\n </div>\n </AccordionContent>\n </AccordionItem>\n );\n })}\n </Accordion>\n </div>\n </div>\n );\n },\n);\nShowcasePanelsBlock.displayName = \"ShowcasePanelsBlock\";\n\nexport { ShowcasePanelsBlock };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Pause, Play } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface ProcessStepItem {\n /** Stable identifier for the item */\n id: string;\n /** Step title, e.g. \"First call\" */\n title: string;\n /** Description shown under the title on the active step */\n description: string;\n /** Step background image */\n image: { src: string; alt?: string };\n /**\n * Extra classes for the `<img>`, e.g. `object-position` or a horizontal\n * flip to frame a specific step's photo (`-scale-x-100`).\n */\n imageClassName?: string;\n /**\n * Label shown as \"Step {step}\". Defaults to the item's 1-based position.\n */\n step?: number;\n}\n\nexport interface ProcessStepsBlockProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onChange\"> {\n /** Steps to render, in order. Designed for 3–6 items. */\n items: ProcessStepItem[];\n /** Index of the initially active step (uncontrolled) */\n defaultActiveIndex?: number;\n /** Active step index (controlled) */\n activeIndex?: number;\n /** Called when the active step changes, from auto-advance or a click */\n onActiveIndexChange?: (index: number) => void;\n /**\n * Automatically advance through steps on a timer. Disabled when the user\n * prefers reduced motion. Defaults to `true`.\n */\n autoAdvance?: boolean;\n /** Milliseconds each step stays active before auto-advancing. Defaults to 6000. */\n autoAdvanceDuration?: number;\n /** Pause auto-advance while hovered or focused within. Defaults to `true`. */\n pauseOnHover?: boolean;\n /**\n * Custom image renderer (e.g. `next/image`). The returned node is\n * absolutely positioned to fill the frame; it should render the image with\n * `object-cover`. Defaults to a plain `<img>`.\n */\n renderImage?: (item: ProcessStepItem, index: number) => React.ReactNode;\n /** Accessible label for the step tablist */\n ariaLabel?: string;\n /** Builds the \"Step N\" label. Defaults to `Step {step}`. */\n stepLabel?: (item: ProcessStepItem, index: number) => string;\n /**\n * Accessible labels for the pause/resume control. The control is only\n * rendered while auto-advance is active (WCAG 2.2.2 Pause, Stop, Hide) —\n * hover and focus alone don't reach touch input.\n */\n labels?: { pause?: string; resume?: string };\n}\n\nconst TICK_MS = 100;\n\n/**\n * React 19 recognizes `inert` as a real boolean DOM property (`true` →\n * `setAttribute(\"inert\", \"\")`, `false` → removed) — confirmed against this\n * package's installed React version. On React 18, where `inert` isn't in\n * React's known-properties table, this is a no-op rather than a hazard:\n * an unrecognized boolean prop is simply dropped, so inactive panels fall\n * back to `aria-hidden` + `pointer-events-none` alone (already sufficient\n * for screen readers; `inert` is the extra guard against a stray focusable\n * node from a consumer's `renderImage`).\n */\nfunction inertWhen(hidden: boolean): { inert?: boolean } {\n return { inert: hidden };\n}\n\nconst ProcessStepsBlock = React.forwardRef<\n HTMLDivElement,\n ProcessStepsBlockProps\n>(\n (\n {\n items,\n defaultActiveIndex = 0,\n activeIndex: activeIndexProp,\n onActiveIndexChange,\n autoAdvance = true,\n autoAdvanceDuration = 6000,\n pauseOnHover = true,\n renderImage,\n ariaLabel = \"Process steps\",\n stepLabel = (item) => `Step ${item.step ?? 1}`,\n labels,\n className,\n ...props\n },\n ref,\n ) => {\n const [activeIndexState, setActiveIndexState] =\n React.useState(defaultActiveIndex);\n const activeIndex = activeIndexProp ?? activeIndexState;\n const [progress, setProgress] = React.useState(0);\n const hoverPausedRef = React.useRef(false);\n const manuallyPausedRef = React.useRef(false);\n const [manuallyPaused, setManuallyPaused] = React.useState(false);\n const [reducedMotion, setReducedMotion] = React.useState(false);\n const uid = React.useId();\n const tabRefs = React.useRef<(HTMLButtonElement | null)[]>([]);\n const tabId = (i: number) => `${uid}-tab-${i}`;\n const panelId = (i: number) => `${uid}-panel-${i}`;\n\n const setActiveIndex = (i: number) => {\n setActiveIndexState(i);\n onActiveIndexChange?.(i);\n };\n\n const focusTab = (i: number) => {\n setActiveIndex(i);\n tabRefs.current[i]?.focus();\n };\n\n const handleTablistKeyDown = (event: React.KeyboardEvent) => {\n const count = items.length;\n if (event.key === \"ArrowRight\") {\n event.preventDefault();\n focusTab((activeIndex + 1) % count);\n } else if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n focusTab((activeIndex - 1 + count) % count);\n } else if (event.key === \"Home\") {\n event.preventDefault();\n focusTab(0);\n } else if (event.key === \"End\") {\n event.preventDefault();\n focusTab(count - 1);\n }\n };\n\n React.useEffect(() => {\n const query = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n setReducedMotion(query.matches);\n const onChange = () => setReducedMotion(query.matches);\n query.addEventListener(\"change\", onChange);\n return () => query.removeEventListener(\"change\", onChange);\n }, []);\n\n const isAutoAdvancing = autoAdvance && !reducedMotion && items.length > 1;\n\n React.useEffect(() => {\n if (!isAutoAdvancing) return;\n hoverPausedRef.current = false;\n setProgress(0);\n let elapsed = 0;\n const id = setInterval(() => {\n if (hoverPausedRef.current || manuallyPausedRef.current) return;\n elapsed += TICK_MS;\n const pct = Math.min(elapsed / autoAdvanceDuration, 1);\n setProgress(pct);\n if (pct >= 1) {\n clearInterval(id);\n setActiveIndex((activeIndex + 1) % items.length);\n }\n }, TICK_MS);\n return () => clearInterval(id);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [activeIndex, isAutoAdvancing, autoAdvanceDuration, items.length]);\n\n const pause = () => {\n if (pauseOnHover) hoverPausedRef.current = true;\n };\n const resume = () => {\n if (pauseOnHover) hoverPausedRef.current = false;\n };\n const toggleManuallyPaused = () => {\n setManuallyPaused((prev) => {\n manuallyPausedRef.current = !prev;\n return !prev;\n });\n };\n\n const total = items.length;\n\n const defaultImage = (item: ProcessStepItem) => (\n <img\n src={item.image.src}\n alt={item.image.alt ?? \"\"}\n className={cn(\"size-full object-cover\", item.imageClassName)}\n />\n );\n\n return (\n <div\n ref={ref}\n // The stage is designed dark regardless of page theme. Dark tokens\n // are consumer-configured under either `.dark` or\n // `[data-theme=\"dark\"]`, so set both.\n data-theme=\"dark\"\n className={cn(\n \"dark overflow-hidden rounded-xl bg-background text-foreground ring-1 ring-foreground/10\",\n className,\n )}\n onMouseEnter={pause}\n onMouseLeave={resume}\n onFocus={pause}\n onBlur={resume}\n {...props}\n >\n <div className=\"relative aspect-[4/5] md:aspect-[16/9]\">\n {items.map((item, i) => {\n const isActive = i === activeIndex;\n return (\n <div\n key={item.id}\n aria-hidden={!isActive}\n className=\"absolute inset-0 motion-safe:transition-[clip-path] motion-safe:duration-700 motion-safe:ease-out\"\n style={{\n clipPath: isActive\n ? \"inset(0% 0% 0% 0%)\"\n : \"inset(0% 0% 0% 100%)\",\n }}\n {...inertWhen(!isActive)}\n >\n {(renderImage ?? defaultImage)(item, i)}\n </div>\n );\n })}\n\n <div\n aria-hidden\n className=\"absolute inset-0 bg-linear-to-t from-black/75 via-black/20 to-transparent\"\n />\n <div\n aria-hidden\n className=\"absolute inset-y-0 left-0 w-2/3 bg-linear-to-r from-black/35 to-transparent\"\n />\n\n {isAutoAdvancing && (\n <button\n type=\"button\"\n onClick={toggleManuallyPaused}\n aria-pressed={manuallyPaused}\n aria-label={\n manuallyPaused\n ? (labels?.resume ?? \"Resume auto-advance\")\n : (labels?.pause ?? \"Pause auto-advance\")\n }\n className=\"group/cta absolute top-5 right-5 z-10 grid size-10 place-items-center rounded-full bg-foreground/10 text-white backdrop-blur-sm transition-colors hover:bg-foreground/20 focus-visible:ring-2 focus-visible:ring-foreground/40 focus-visible:outline-none\"\n >\n {manuallyPaused ? (\n <Play className=\"size-4\" strokeWidth={1.5} />\n ) : (\n <Pause className=\"size-4\" strokeWidth={1.5} />\n )}\n </button>\n )}\n\n {items.map((item, i) => {\n const isActive = i === activeIndex;\n return (\n <div\n key={item.id}\n role=\"tabpanel\"\n id={panelId(i)}\n aria-labelledby={tabId(i)}\n aria-hidden={!isActive}\n // Not just 0: on React 18, where `inert` is a silent no-op\n // (see inertWhen's comment), an inactive panel would\n // otherwise stay focusable while aria-hidden — axe's\n // aria-hidden-focus violation. Demotes `inert` to\n // defence-in-depth instead of load-bearing.\n tabIndex={isActive ? 0 : -1}\n {...inertWhen(!isActive)}\n className={cn(\n \"absolute right-5 bottom-6 left-5 text-white transition-[opacity,transform] duration-500 ease-out outline-none md:right-16 md:bottom-14 md:left-16\",\n isActive\n ? \"opacity-100\"\n : \"pointer-events-none opacity-0 motion-safe:translate-y-4\",\n )}\n >\n <div className=\"flex items-center gap-3 text-white/60\">\n <span\n aria-hidden\n className=\"h-px w-8 bg-current md:w-10\"\n />\n <span className=\"text-xs tracking-widest md:text-sm\">\n {stepLabel(item, i)} of {total}\n </span>\n </div>\n <h3 className=\"mt-3 text-5xl leading-[0.95] font-medium tracking-tight md:mt-6 md:text-7xl lg:text-8xl\">\n {item.title}\n </h3>\n <p className=\"mt-4 max-w-lg text-sm leading-snug font-medium text-white/85 md:mt-8 md:text-base md:leading-relaxed lg:text-lg\">\n {item.description}\n </p>\n </div>\n );\n })}\n </div>\n\n <ol\n role=\"tablist\"\n aria-label={ariaLabel}\n onKeyDown={handleTablistKeyDown}\n className=\"grid border-t border-foreground/10 bg-card text-foreground\"\n style={{ gridTemplateColumns: `repeat(${total}, minmax(0, 1fr))` }}\n >\n {items.map((item, i) => {\n const isActive = i === activeIndex;\n return (\n <li key={item.id} className=\"relative\">\n <button\n ref={(el) => {\n tabRefs.current[i] = el;\n }}\n type=\"button\"\n role=\"tab\"\n id={tabId(i)}\n aria-controls={panelId(i)}\n aria-selected={isActive}\n aria-current={isActive ? \"step\" : undefined}\n tabIndex={isActive ? 0 : -1}\n onClick={() => setActiveIndex(i)}\n className={cn(\n \"group relative flex h-16 w-full flex-col items-center justify-center gap-1 px-3 text-center transition-colors outline-none md:h-20 md:gap-1.5\",\n isActive\n ? \"text-foreground\"\n : \"text-muted-foreground hover:text-foreground/85\",\n )}\n >\n <span className=\"font-mono text-[0.5625rem] tracking-[0.2em] text-foreground/45 uppercase md:text-[0.625rem]\">\n {stepLabel(item, i)}\n </span>\n <span className=\"hidden text-sm font-medium tracking-tight md:inline md:text-base\">\n {item.title}\n </span>\n <span\n aria-hidden\n className=\"pointer-events-none absolute inset-x-0 top-0 h-px overflow-hidden bg-foreground/10\"\n >\n {isActive && (\n <span\n className=\"block h-full origin-left bg-brand-accent\"\n style={{\n transform: `scaleX(${isAutoAdvancing ? progress : 1})`,\n transition: isAutoAdvancing\n ? `transform ${TICK_MS}ms linear`\n : \"none\",\n }}\n />\n )}\n </span>\n </button>\n </li>\n );\n })}\n </ol>\n </div>\n );\n },\n);\nProcessStepsBlock.displayName = \"ProcessStepsBlock\";\n\nexport { ProcessStepsBlock };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { CircleHelp, MoveUpRight } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Badge } from \"../../components/badge\";\nimport {\n Accordion,\n AccordionContent,\n AccordionItem,\n AccordionTrigger,\n} from \"../../components/accordion\";\n\nexport interface FAQItem {\n /** Stable identifier; doubles as the accordion item value. */\n id: string;\n /** The question shown on the accordion trigger. */\n question: React.ReactNode;\n /** The answer revealed when the item opens. */\n answer: React.ReactNode;\n}\n\nexport interface FAQCallToAction {\n /** Lead-in line above the link, e.g. \"Don't see your question?\". */\n title: React.ReactNode;\n /** The link label, e.g. \"Talk to a lawyer directly\". */\n linkText: React.ReactNode;\n /** Destination for the link. */\n href: string;\n /**\n * Open the link in a new tab (`target=\"_blank\"`, with `rel` set for\n * security) instead of navigating the current page. Defaults to `false`.\n */\n newTab?: boolean;\n /**\n * Trailing icon for the link. Defaults to a Lucide `MoveUpRight` glyph.\n * Pass `null` to omit it.\n */\n icon?: React.ReactNode;\n}\n\nexport interface FAQColumnsBlockProps\n extends Omit<\n React.HTMLAttributes<HTMLElement>,\n \"title\" | \"defaultValue\" | \"onChange\"\n > {\n /** Questions and answers rendered in the scrolling column. */\n items: FAQItem[];\n /** Section heading. */\n title: React.ReactNode;\n /** Supporting copy under the heading. */\n description?: React.ReactNode;\n /**\n * Small label above the heading. A string renders inside an outline\n * `Badge`; any other node renders as-is, so a brand eyebrow component can\n * be dropped in unchanged. Omit it to hide the row.\n */\n eyebrow?: React.ReactNode;\n /**\n * Icon opposite the eyebrow. Defaults to a Lucide `CircleHelp` glyph.\n * Pass `null` to omit it.\n */\n icon?: React.ReactNode;\n /** Optional call to action beneath the description. */\n cta?: FAQCallToAction;\n /**\n * Keep the left column pinned while the questions scroll past on `lg` and\n * up. Defaults to `true`.\n */\n sticky?: boolean;\n /** `\"single\"` (default) opens one question at a time; `\"multiple\"` allows many. */\n type?: \"single\" | \"multiple\";\n /** Allow the open item to be closed again. Only used with `type=\"single\"`. */\n collapsible?: boolean;\n /** Initially open item id(s) — a string for `\"single\"`, an array for `\"multiple\"`. */\n defaultValue?: string | string[];\n /** Open item id(s), for controlled usage. */\n value?: string | string[];\n /** Called when the open item(s) change. */\n onValueChange?: (value: string & string[]) => void;\n /** Classes for the inner container that constrains width and gutters. */\n containerClassName?: string;\n /** Classes for the two-column grid. */\n gridClassName?: string;\n /** Classes for the sticky left column. Overrides the `lg:top-28` offset. */\n asideClassName?: string;\n /** Classes for the eyebrow, applied to the default `Badge` or a custom node's wrapper. */\n eyebrowClassName?: string;\n /** Classes for the heading. */\n titleClassName?: string;\n /** Classes for the description. */\n descriptionClassName?: string;\n /** Classes for the call-to-action wrapper. */\n ctaClassName?: string;\n /** Classes for the accordion wrapper. */\n listClassName?: string;\n /** Classes for each accordion item. */\n itemClassName?: string;\n /** Classes for each question trigger. */\n questionClassName?: string;\n /** Classes for each answer panel. */\n answerClassName?: string;\n}\n\nconst FAQColumnsBlock = React.forwardRef<HTMLElement, FAQColumnsBlockProps>(\n (\n {\n items,\n title,\n description,\n eyebrow,\n icon,\n cta,\n sticky = true,\n type = \"single\",\n collapsible = true,\n defaultValue,\n value,\n onValueChange,\n containerClassName,\n gridClassName,\n asideClassName,\n eyebrowClassName,\n titleClassName,\n descriptionClassName,\n ctaClassName,\n listClassName,\n itemClassName,\n questionClassName,\n answerClassName,\n className,\n ...props\n },\n ref,\n ) => {\n const headingId = React.useId();\n\n // The eyebrow/icon row is what the heading's top margin clears. With\n // neither (`icon={null}` and no eyebrow) the heading must sit flush, or\n // the intro column starts lower than the accordion beside it.\n const hasHeaderRow = eyebrow != null || icon !== null;\n\n // Radix types `value`/`defaultValue`/`onValueChange` differently per\n // `type`; the props above accept both shapes so consumers don't have to\n // reach for a discriminated union.\n const accordionProps = {\n type,\n ...(type === \"single\" ? { collapsible } : {}),\n defaultValue,\n value,\n onValueChange,\n } as React.ComponentProps<typeof Accordion>;\n\n return (\n <section\n ref={ref}\n aria-labelledby={props[\"aria-label\"] ? undefined : headingId}\n className={cn(\"py-16 md:py-24\", className)}\n {...props}\n >\n <div\n className={cn(\"mx-auto max-w-6xl px-4 sm:px-6\", containerClassName)}\n >\n <div\n className={cn(\n \"grid grid-cols-1 gap-12 lg:grid-cols-[1fr_1.4fr] lg:gap-16\",\n gridClassName,\n )}\n >\n <div\n className={cn(\n \"relative\",\n // `self-start` is what lets the column stop growing to the\n // grid row's height — without it the sticky offset never\n // engages, because the element already spans the whole row.\n sticky && \"lg:sticky lg:top-28 lg:self-start\",\n asideClassName,\n )}\n >\n {hasHeaderRow && (\n <div className=\"flex items-start justify-between gap-4\">\n {typeof eyebrow === \"string\" ? (\n <Badge\n variant=\"outline\"\n className={cn(\n \"h-7 shrink-0 rounded-full px-3 font-medium\",\n eyebrowClassName,\n )}\n >\n {eyebrow}\n </Badge>\n ) : eyebrow != null ? (\n <div className={cn(\"shrink-0\", eyebrowClassName)}>\n {eyebrow}\n </div>\n ) : (\n <span aria-hidden />\n )}\n\n {icon === undefined ? (\n <CircleHelp\n aria-hidden\n strokeWidth={1}\n className=\"size-6 shrink-0 text-muted-foreground\"\n />\n ) : (\n icon\n )}\n </div>\n )}\n\n <h2\n id={headingId}\n className={cn(\n \"text-3xl font-light leading-[1.05] tracking-tight md:text-4xl lg:text-5xl\",\n hasHeaderRow && \"mt-8\",\n titleClassName,\n )}\n >\n {title}\n </h2>\n\n {description ? (\n <p\n className={cn(\n \"mt-6 max-w-md text-base text-muted-foreground\",\n descriptionClassName,\n )}\n >\n {description}\n </p>\n ) : null}\n\n {cta ? (\n <div className={cn(\"mt-10 border-t pt-6\", ctaClassName)}>\n <p className=\"text-sm text-muted-foreground\">{cta.title}</p>\n <a\n href={cta.href}\n {...(cta.newTab\n ? { target: \"_blank\", rel: \"noopener noreferrer\" }\n : {})}\n className=\"group/faq-cta mt-1.5 inline-flex items-center gap-2 text-sm tracking-tight text-foreground transition-colors\"\n >\n <span className=\"border-b border-transparent transition-colors group-hover/faq-cta:border-current\">\n {cta.linkText}\n </span>\n {cta.icon === undefined ? (\n <MoveUpRight\n aria-hidden\n className=\"size-3.5 transition-transform group-hover/faq-cta:-translate-y-0.5 group-hover/faq-cta:translate-x-0.5\"\n />\n ) : (\n cta.icon\n )}\n </a>\n </div>\n ) : null}\n </div>\n\n <Accordion\n {...accordionProps}\n className={cn(\"w-full\", listClassName)}\n >\n {items.map((item) => (\n <AccordionItem\n key={item.id}\n value={item.id}\n className={itemClassName}\n >\n <AccordionTrigger\n className={cn(\n \"items-start gap-6 py-5 text-start text-base font-normal tracking-tight md:text-lg\",\n questionClassName,\n )}\n >\n {item.question}\n </AccordionTrigger>\n <AccordionContent\n className={cn(\n \"pb-5 text-base leading-relaxed text-muted-foreground\",\n answerClassName,\n )}\n >\n {item.answer}\n </AccordionContent>\n </AccordionItem>\n ))}\n </Accordion>\n </div>\n </div>\n </section>\n );\n },\n);\nFAQColumnsBlock.displayName = \"FAQColumnsBlock\";\n\nexport { FAQColumnsBlock };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Card, CardContent } from \"../../components/card\";\nimport {\n Avatar,\n AvatarImage,\n AvatarFallback,\n} from \"../../components/avatar\";\nimport { Badge, type BadgeProps } from \"../../components/badge\";\nimport { Progress } from \"../../components/progress\";\nimport { Rating } from \"../../components/rating\";\nimport { Skeleton } from \"../../components/skeleton\";\n\nexport interface ReviewItem {\n /** Stable key for the review. */\n id: string;\n /** Star rating for this review, 0–5. */\n rating: number;\n /** Review body text. */\n content: string;\n author: {\n name: string;\n /** Optional avatar image URL; falls back to initials. */\n avatarUrl?: string;\n };\n /** Preformatted, human-readable date, e.g. \"2 weeks ago\" or \"Dec 10, 2024\". */\n date: string;\n /** Optional badge shown beside the author name, e.g. \"Google\". */\n badgeLabel?: string;\n}\n\n/** A single `{ star, count }` bucket of the rating distribution. */\nexport interface RatingDistributionItem {\n /** Star level, 1–5. */\n star: number;\n /** Number of reviews at this star level. */\n count: number;\n}\n\nexport interface ReviewsBlockProps\n extends React.HTMLAttributes<HTMLElement> {\n /** Reviews to display as cards. */\n reviews: ReviewItem[];\n /** Aggregate average rating shown in the summary. */\n averageRating: number;\n /** Total number of reviews behind the aggregate. */\n totalReviews: number;\n /** Section heading. Defaults to \"Customer Reviews\". */\n title?: string;\n /**\n * Optional per-star distribution. When provided, the summary renders the\n * bar chart; when omitted, only the average + total are shown. Omit it when\n * the data source (e.g. Google Places) does not expose a full histogram.\n */\n distribution?: RatingDistributionItem[];\n /**\n * Brand variant for the per-review badge (`badgeLabel`). Defaults to\n * `secondary`. Use it to align the badge with the surrounding brand color.\n */\n badgeVariant?: BadgeProps[\"variant\"];\n /**\n * Text-color utility applied to the star ratings, e.g. `text-primary`.\n * Defaults to the `Rating` component's own default (`text-highlight`).\n */\n ratingClassName?: string;\n /** Render skeleton placeholders instead of content. */\n loading?: boolean;\n /** Render an error message instead of content. */\n error?: string;\n}\n\nfunction initials(name: string): string {\n return name\n .split(\" \")\n .map((n) => n[0])\n .filter(Boolean)\n .slice(0, 2)\n .join(\"\")\n .toUpperCase();\n}\n\nconst SKELETON_CARDS = 4;\n\nconst ReviewsBlock = React.forwardRef<HTMLElement, ReviewsBlockProps>(\n (\n {\n reviews,\n averageRating,\n totalReviews,\n title = \"Customer Reviews\",\n distribution,\n badgeVariant = \"secondary\",\n ratingClassName,\n loading,\n error,\n className,\n ...props\n },\n ref,\n ) => {\n // Round once so the numeric label and the star fill never disagree (e.g.\n // 4.95 must not read \"5.0\" beside a partially filled fifth star).\n const displayRating = Math.round(averageRating * 10) / 10;\n\n return (\n <section\n ref={ref}\n className={cn(\"py-16 md:py-24\", className)}\n {...props}\n >\n <div className=\"mx-auto max-w-5xl px-4 sm:px-6\">\n <h2 className=\"mb-8 text-2xl font-semibold tracking-tight md:text-3xl\">\n {title}\n </h2>\n\n {error ? (\n <p className=\"text-sm text-muted-foreground\">{error}</p>\n ) : (\n <div className=\"grid gap-8 lg:grid-cols-[280px_1fr] lg:gap-12\">\n {/* Summary */}\n <div className=\"space-y-6\">\n <div className=\"text-center lg:text-left\">\n {loading ? (\n <>\n <Skeleton className=\"mx-auto h-12 w-20 lg:mx-0\" />\n <Skeleton className=\"mx-auto mt-2 h-5 w-28 lg:mx-0\" />\n <Skeleton className=\"mx-auto mt-1 h-4 w-36 lg:mx-0\" />\n </>\n ) : (\n <>\n <div className=\"text-5xl font-bold\">\n {displayRating.toFixed(1)}\n </div>\n <Rating\n rate={displayRating}\n size=\"lg\"\n className={cn(\n \"mt-2 justify-center lg:justify-start\",\n ratingClassName,\n )}\n />\n <p className=\"mt-1 text-sm text-muted-foreground\">\n Based on {totalReviews.toLocaleString()} reviews\n </p>\n </>\n )}\n </div>\n\n {/* Distribution bars — only when the data source provides them */}\n {!loading && distribution && distribution.length > 0 && (\n <div className=\"space-y-2\">\n {[...distribution]\n .sort((a, b) => b.star - a.star)\n .map(({ star, count }) => (\n <div key={star} className=\"flex items-center gap-3\">\n <span className=\"w-8 text-sm text-muted-foreground\">\n {star} ★\n </span>\n <Progress\n value={\n totalReviews > 0\n ? (count / totalReviews) * 100\n : 0\n }\n className=\"h-2 flex-1\"\n />\n <span className=\"w-8 text-right text-sm text-muted-foreground\">\n {count}\n </span>\n </div>\n ))}\n </div>\n )}\n </div>\n\n {/* Reviews grid */}\n <div className=\"grid gap-4 sm:grid-cols-2\">\n {loading\n ? Array.from({ length: SKELETON_CARDS }).map((_, i) => (\n <Card key={i} className=\"gap-0 p-0 shadow-none\">\n <CardContent className=\"space-y-3 p-5\">\n <div className=\"flex items-center gap-2.5\">\n <Skeleton className=\"size-9 rounded-full\" />\n <div className=\"space-y-1.5\">\n <Skeleton className=\"h-4 w-24\" />\n <Skeleton className=\"h-3 w-16\" />\n </div>\n </div>\n <Skeleton className=\"h-4 w-full\" />\n <Skeleton className=\"h-4 w-4/5\" />\n </CardContent>\n </Card>\n ))\n : reviews.map((review) => (\n <Card\n key={review.id}\n className=\"gap-0 p-0 shadow-none\"\n >\n <CardContent className=\"space-y-3 p-5\">\n <div className=\"flex items-start justify-between gap-2\">\n <div className=\"flex items-center gap-2.5\">\n <Avatar className=\"size-9\">\n {review.author.avatarUrl && (\n <AvatarImage\n src={review.author.avatarUrl}\n alt={review.author.name}\n />\n )}\n <AvatarFallback className=\"text-xs\">\n {initials(review.author.name)}\n </AvatarFallback>\n </Avatar>\n <div>\n <div className=\"flex items-center gap-1.5\">\n <span className=\"text-sm font-medium\">\n {review.author.name}\n </span>\n {review.badgeLabel && (\n <Badge\n variant={badgeVariant}\n className=\"h-5 px-1.5 text-[0.625rem]\"\n >\n {review.badgeLabel}\n </Badge>\n )}\n </div>\n <p className=\"text-xs text-muted-foreground\">\n {review.date}\n </p>\n </div>\n </div>\n <Rating\n rate={review.rating}\n size=\"sm\"\n className={ratingClassName}\n />\n </div>\n\n <p className=\"line-clamp-4 text-sm leading-relaxed text-muted-foreground\">\n {review.content}\n </p>\n </CardContent>\n </Card>\n ))}\n </div>\n </div>\n )}\n </div>\n </section>\n );\n },\n);\nReviewsBlock.displayName = \"ReviewsBlock\";\n\nexport { ReviewsBlock };\n","import type * as React from \"react\";\n\n/**\n * The library's canonical testimonial payload, shared by every testimonial\n * layout (`TestimonialMasonry`, `TestimonialCarousel`). Consumers hold one\n * array of these and feed it to whichever block a page calls for; only the\n * presentation props differ per block.\n */\nexport interface TestimonialItem {\n /** Stable key for the testimonial card. */\n id: string;\n /** Quote body text. */\n content: React.ReactNode;\n author: {\n name: string;\n /** Role or company line under the name, e.g. \"Co-Founder, Heroes Digital\". */\n title?: React.ReactNode;\n /**\n * Custom avatar content — SVG, Lucide icon, Font Awesome glyph, etc.\n * Renders inside the shaped avatar shell. When omitted, `avatarUrl` or\n * initials from `name` are used instead.\n */\n avatar?: React.ReactNode;\n /** Profile photo URL. Ignored when `avatar` is set. */\n avatarUrl?: string;\n };\n}\n\n/** Two-letter initials fallback used when a testimonial has no avatar image. */\nexport function testimonialInitials(name: string): string {\n return name\n .split(\" \")\n .map((part) => part[0])\n .filter(Boolean)\n .slice(0, 2)\n .join(\"\")\n .toUpperCase();\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport {\n Avatar,\n AvatarFallback,\n AvatarImage,\n} from \"../../components/avatar\";\nimport { Button, type ButtonProps } from \"../../components/button\";\nimport {\n testimonialInitials,\n type TestimonialItem,\n} from \"./testimonial-types\";\n\nexport interface TestimonialMasonryLink {\n /** Link label, e.g. \"See All Customer Stories\". */\n label: React.ReactNode;\n /** Destination for the link. */\n href: string;\n /**\n * Open the link in a new tab (`target=\"_blank\"`, with `rel` set for\n * security) instead of navigating the current page. Defaults to `false`.\n */\n newTab?: boolean;\n /** Button variant for the call to action. Defaults to `\"default\"`. */\n variant?: ButtonProps[\"variant\"];\n /** Button size for the call to action. Defaults to `\"lg\"`. */\n size?: ButtonProps[\"size\"];\n}\n\nexport interface TestimonialMasonryProps\n extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n /** Testimonials rendered as cards in a responsive grid. */\n items: TestimonialItem[];\n /** Section heading. */\n title: React.ReactNode;\n /** Supporting copy under the heading. */\n description?: React.ReactNode;\n /**\n * Small label above the heading. A string renders as centered tagline text;\n * any other node renders as-is. Omit to hide the row.\n */\n eyebrow?: React.ReactNode;\n /**\n * Navigation target shown only when `items.length` reaches\n * `minItemsForFade` and the bottom fade is applied.\n */\n link?: TestimonialMasonryLink;\n /**\n * Number of items at which the grid clips and the bottom fade appears.\n * Defaults to `7` (two full desktop rows of three, plus a partial third).\n */\n minItemsForFade?: number;\n /**\n * Number of items at which the grid height is clipped to `maxVisibleRows`\n * in addition to the fade. Defaults to `10` (four desktop rows). Between\n * `minItemsForFade` and this threshold the full grid stays visible so a\n * lone seventh card or a pair in the third row can center on desktop.\n */\n minItemsForClamp?: number;\n /**\n * Maximum number of rows to keep visible when the fade is active.\n * Defaults to `2`.\n */\n maxVisibleRows?: number;\n /** Classes for the inner container that constrains width and gutters. */\n containerClassName?: string;\n /** Classes for the eyebrow row. */\n eyebrowClassName?: string;\n /** Classes for the heading. */\n titleClassName?: string;\n /** Classes for the description. */\n descriptionClassName?: string;\n /** Classes for the grid wrapper (fade + overflow clip). */\n gridWrapperClassName?: string;\n /** Classes for the testimonial grid. */\n gridClassName?: string;\n /** Classes for each testimonial card. */\n cardClassName?: string;\n /** Classes for the quote body. */\n contentClassName?: string;\n /** Classes for the author name. */\n authorNameClassName?: string;\n /** Classes for the author title line. */\n authorTitleClassName?: string;\n /** Classes for the avatar shell on each card. */\n avatarClassName?: string;\n /**\n * Classes for the bottom fade overlay. Defaults to a gradient that matches\n * a section using `bg-accent`.\n */\n fadeClassName?: string;\n /** Classes for the link wrapper beneath the grid. */\n linkClassName?: string;\n}\n\nfunction groupCardsByRow(cards: Element[]): Map<number, Element[]> {\n const rows = new Map<number, Element[]>();\n for (const card of cards) {\n const top = Math.round(card.getBoundingClientRect().top);\n const row = rows.get(top) ?? [];\n row.push(card);\n rows.set(top, row);\n }\n return rows;\n}\n\nfunction measureClampHeight(\n cards: Element[],\n gridTop: number,\n maxVisibleRows: number,\n): number {\n const rows = groupCardsByRow(cards);\n const sortedTops = [...rows.keys()].sort((a, b) => a - b);\n const visibleTops = sortedTops.slice(0, maxVisibleRows);\n\n let bottom = gridTop;\n for (const top of visibleTops) {\n for (const card of rows.get(top) ?? []) {\n bottom = Math.max(bottom, card.getBoundingClientRect().bottom);\n }\n }\n\n return bottom - gridTop;\n}\n\nconst TestimonialMasonry = React.forwardRef<\n HTMLElement,\n TestimonialMasonryProps\n>(\n (\n {\n items,\n title,\n description,\n eyebrow,\n link,\n minItemsForFade = 7,\n minItemsForClamp = 10,\n maxVisibleRows = 2,\n containerClassName,\n eyebrowClassName,\n titleClassName,\n descriptionClassName,\n gridWrapperClassName,\n gridClassName,\n cardClassName,\n contentClassName,\n authorNameClassName,\n authorTitleClassName,\n avatarClassName,\n fadeClassName,\n linkClassName,\n className,\n ...props\n },\n ref,\n ) => {\n const headingId = React.useId();\n const gridRef = React.useRef<HTMLUListElement>(null);\n const [clampHeight, setClampHeight] = React.useState<number>();\n const showFade = items.length >= minItemsForFade;\n\n React.useLayoutEffect(() => {\n const grid = gridRef.current;\n if (!grid) return;\n\n const measure = () => {\n if (items.length < minItemsForClamp) {\n setClampHeight(undefined);\n return;\n }\n\n const cards = Array.from(\n grid.querySelectorAll<HTMLElement>(\"[data-testimonial-card]\"),\n );\n if (cards.length === 0) {\n setClampHeight(undefined);\n return;\n }\n\n const gridTop = grid.getBoundingClientRect().top;\n setClampHeight(\n measureClampHeight(cards, gridTop, maxVisibleRows),\n );\n };\n\n measure();\n\n const observer = new ResizeObserver(measure);\n observer.observe(grid);\n window.addEventListener(\"resize\", measure);\n\n return () => {\n observer.disconnect();\n window.removeEventListener(\"resize\", measure);\n };\n }, [items, maxVisibleRows, minItemsForClamp]);\n\n return (\n <section\n ref={ref}\n aria-labelledby={props[\"aria-label\"] ? undefined : headingId}\n className={cn(\"bg-accent px-6 lg:px-0\", className)}\n {...props}\n >\n <div\n className={cn(\n \"mx-auto max-w-6xl px-0 py-16 sm:py-20 md:px-6 md:py-28\",\n containerClassName,\n )}\n >\n {eyebrow != null ? (\n typeof eyebrow === \"string\" ? (\n <p\n className={cn(\n \"mb-4 text-center text-sm font-normal leading-tight text-muted-foreground sm:text-base\",\n eyebrowClassName,\n )}\n >\n {eyebrow}\n </p>\n ) : (\n <div className={cn(\"mb-4 text-center\", eyebrowClassName)}>\n {eyebrow}\n </div>\n )\n ) : null}\n\n <h2\n id={headingId}\n className={cn(\n \"mx-auto max-w-4xl text-balance text-center text-3xl font-medium leading-tight tracking-tight sm:text-4xl md:text-5xl\",\n titleClassName,\n )}\n >\n {title}\n </h2>\n\n {description ? (\n <p\n className={cn(\n \"mx-auto mt-4 max-w-2xl text-center text-base font-normal text-muted-foreground sm:text-lg\",\n descriptionClassName,\n )}\n >\n {description}\n </p>\n ) : null}\n\n <div\n className={cn(\"relative mt-10 md:mt-14\", gridWrapperClassName)}\n style={\n clampHeight != null\n ? { maxHeight: clampHeight, overflow: \"hidden\" }\n : undefined\n }\n >\n {showFade ? (\n <div\n aria-hidden\n className={cn(\n \"pointer-events-none absolute inset-x-0 bottom-0 z-10 h-24 bg-gradient-to-t from-accent to-accent/0\",\n fadeClassName,\n )}\n />\n ) : null}\n\n <ul\n ref={gridRef}\n className={cn(\"flex flex-wrap justify-center gap-4\", gridClassName)}\n >\n {items.map((item) => (\n <li\n key={item.id}\n data-testimonial-card\n className={cn(\n \"flex w-full flex-col justify-between rounded-2xl bg-card p-6\",\n \"sm:w-[calc((100%-1rem)/2)]\",\n \"lg:w-[calc((100%-2rem)/3)]\",\n cardClassName,\n )}\n >\n <p\n className={cn(\n \"text-base font-normal leading-relaxed\",\n contentClassName,\n )}\n >\n {item.content}\n </p>\n\n <div className=\"mt-6 flex items-center gap-3\">\n <Avatar className={cn(\"size-9\", avatarClassName)}>\n {item.author.avatar ? (\n <AvatarFallback className=\"text-xs\">\n {item.author.avatar}\n </AvatarFallback>\n ) : (\n <>\n {item.author.avatarUrl ? (\n <AvatarImage\n src={item.author.avatarUrl}\n alt={item.author.name}\n />\n ) : null}\n <AvatarFallback className=\"text-xs\">\n {testimonialInitials(item.author.name)}\n </AvatarFallback>\n </>\n )}\n </Avatar>\n\n <div>\n <div\n className={cn(\n \"mb-0.5 text-base font-medium leading-tight\",\n authorNameClassName,\n )}\n >\n {item.author.name}\n </div>\n {item.author.title ? (\n <div\n className={cn(\n \"text-sm font-normal text-muted-foreground\",\n authorTitleClassName,\n )}\n >\n {item.author.title}\n </div>\n ) : null}\n </div>\n </div>\n </li>\n ))}\n </ul>\n </div>\n\n {showFade && link ? (\n <div\n className={cn(\n \"relative z-20 -mt-6 flex justify-center transition-all duration-300\",\n linkClassName,\n )}\n >\n <Button\n asChild\n variant={link.variant ?? \"default\"}\n size={link.size ?? \"lg\"}\n >\n <a\n href={link.href}\n {...(link.newTab\n ? { target: \"_blank\", rel: \"noopener noreferrer\" }\n : {})}\n >\n {link.label}\n </a>\n </Button>\n </div>\n ) : null}\n </div>\n </section>\n );\n },\n);\nTestimonialMasonry.displayName = \"TestimonialMasonry\";\n\nexport { TestimonialMasonry };\nexport type { TestimonialItem };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport type { ButtonProps } from \"../../components/button\";\nimport {\n Avatar,\n AvatarFallback,\n AvatarImage,\n} from \"../../components/avatar\";\nimport {\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselNext,\n CarouselPrevious,\n} from \"../../components/carousel\";\nimport {\n testimonialInitials,\n type TestimonialItem,\n} from \"./testimonial-types\";\n\n/**\n * Styling and content for one of the two carousel arrows. Every field is\n * optional — omit the whole object and the arrow renders with the block's\n * defaults (outline variant, icon size, a directional arrow, and a sensible\n * accessible name).\n */\nexport interface TestimonialCarouselNav {\n /**\n * Accessible name for the icon-only button. Defaults to \"Previous\n * testimonial\" / \"Next testimonial\".\n */\n label?: string;\n /** Icon rendered inside the button. Defaults to a directional arrow. */\n icon?: React.ReactNode;\n /** Button variant. Defaults to `\"outline\"`. */\n variant?: ButtonProps[\"variant\"];\n /** Button size. Defaults to `\"icon\"`. */\n size?: ButtonProps[\"size\"];\n /** Classes merged onto the button, overriding the defaults. */\n className?: string;\n}\n\nexport interface TestimonialCarouselProps\n extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n /** Testimonials rendered as slides in the carousel. */\n items: TestimonialItem[];\n /** Section heading, shown on the left of the header row. */\n title: React.ReactNode;\n /** Supporting copy under the heading. */\n description?: React.ReactNode;\n /**\n * Small label above the heading. A string renders as tagline text; any\n * other node renders as-is. Omit to hide the row.\n */\n eyebrow?: React.ReactNode;\n /**\n * Wrap from the last slide back to the first. Defaults to `false`, which\n * disables the arrows at each end.\n */\n loop?: boolean;\n /**\n * Slides advanced per arrow press. Defaults to `1`; pass `\"auto\"` to\n * advance by a full viewport of cards.\n */\n slidesToScroll?: number | \"auto\";\n /** Label, icon, and styling for the previous arrow. */\n previousButton?: TestimonialCarouselNav;\n /** Label, icon, and styling for the next arrow. */\n nextButton?: TestimonialCarouselNav;\n /** Hide the prev/next arrows. Dragging and keyboard still work. */\n hideControls?: boolean;\n /** Classes for the inner container that constrains width and gutters. */\n containerClassName?: string;\n /** Classes for the header row holding the copy and the arrows. */\n headerClassName?: string;\n /**\n * Classes for the header copy column (eyebrow, heading, description).\n * Defaults to `max-w-2xl`, which keeps the heading to a comfortable\n * measure. Pass `max-w-none` to let it run the full width up to the\n * arrows, or any other `max-w-*` to pick a different cap.\n */\n headerCopyClassName?: string;\n /** Classes for the eyebrow row. */\n eyebrowClassName?: string;\n /** Classes for the heading. */\n titleClassName?: string;\n /** Classes for the description. */\n descriptionClassName?: string;\n /** Classes for the arrow group. */\n controlsClassName?: string;\n /** Classes for the carousel root. */\n carouselClassName?: string;\n /** Classes for each slide wrapper (controls the per-breakpoint basis). */\n slideClassName?: string;\n /** Classes for each testimonial card. */\n cardClassName?: string;\n /** Classes for the quote body. */\n contentClassName?: string;\n /** Classes for the author name. */\n authorNameClassName?: string;\n /** Classes for the author title line. */\n authorTitleClassName?: string;\n /** Classes for the avatar shell on each card. */\n avatarClassName?: string;\n}\n\nconst TestimonialCarousel = React.forwardRef<\n HTMLElement,\n TestimonialCarouselProps\n>(\n (\n {\n items,\n title,\n description,\n eyebrow,\n loop = false,\n slidesToScroll = 1,\n previousButton,\n nextButton,\n hideControls = false,\n containerClassName,\n headerClassName,\n headerCopyClassName,\n eyebrowClassName,\n titleClassName,\n descriptionClassName,\n controlsClassName,\n carouselClassName,\n slideClassName,\n cardClassName,\n contentClassName,\n authorNameClassName,\n authorTitleClassName,\n avatarClassName,\n className,\n ...props\n },\n ref,\n ) => {\n const headingId = React.useId();\n\n return (\n <section\n ref={ref}\n aria-labelledby={props[\"aria-label\"] ? undefined : headingId}\n className={cn(\"px-6 lg:px-0\", className)}\n {...props}\n >\n <div\n className={cn(\n \"mx-auto max-w-6xl px-0 py-16 sm:py-20 md:px-6 md:py-28\",\n containerClassName,\n )}\n >\n <Carousel\n opts={{ loop, slidesToScroll, align: \"start\" }}\n className={cn(\"w-full\", carouselClassName)}\n >\n <div\n className={cn(\n \"mb-8 flex flex-col gap-6 md:mb-12 md:flex-row md:items-end md:justify-between\",\n headerClassName,\n )}\n >\n <div\n className={cn(\n \"min-w-0 flex-1 max-w-2xl\",\n headerCopyClassName,\n )}\n >\n {eyebrow != null ? (\n typeof eyebrow === \"string\" ? (\n <p\n className={cn(\n \"mb-4 text-sm font-normal leading-tight text-muted-foreground sm:text-base\",\n eyebrowClassName,\n )}\n >\n {eyebrow}\n </p>\n ) : (\n <div className={cn(\"mb-4\", eyebrowClassName)}>{eyebrow}</div>\n )\n ) : null}\n\n <h2\n id={headingId}\n className={cn(\n \"text-balance text-3xl font-medium leading-tight tracking-tight sm:text-4xl md:text-5xl\",\n titleClassName,\n )}\n >\n {title}\n </h2>\n\n {description ? (\n <p\n className={cn(\n \"mt-4 text-base font-normal text-muted-foreground sm:text-lg\",\n descriptionClassName,\n )}\n >\n {description}\n </p>\n ) : null}\n </div>\n\n {hideControls ? null : (\n <div\n className={cn(\n \"flex shrink-0 items-center gap-2\",\n controlsClassName,\n )}\n >\n <CarouselPrevious\n label={previousButton?.label ?? \"Previous testimonial\"}\n icon={previousButton?.icon}\n variant={previousButton?.variant}\n size={previousButton?.size}\n className={previousButton?.className}\n />\n <CarouselNext\n label={nextButton?.label ?? \"Next testimonial\"}\n icon={nextButton?.icon}\n variant={nextButton?.variant}\n size={nextButton?.size}\n className={nextButton?.className}\n />\n </div>\n )}\n </div>\n\n <CarouselContent className=\"-ml-4\">\n {items.map((item) => (\n <CarouselItem\n key={item.id}\n className={cn(\n \"basis-full pl-4 md:basis-1/2 lg:basis-1/3\",\n slideClassName,\n )}\n >\n <figure\n className={cn(\n \"flex h-full flex-col justify-between rounded-2xl border bg-card p-6\",\n cardClassName,\n )}\n >\n <blockquote\n className={cn(\n \"text-base font-normal leading-relaxed text-muted-foreground\",\n contentClassName,\n )}\n >\n {item.content}\n </blockquote>\n\n <figcaption className=\"mt-6 flex items-center gap-3\">\n <Avatar\n className={cn(\n \"size-9 ring-1 ring-border\",\n avatarClassName,\n )}\n >\n {item.author.avatar ? (\n <AvatarFallback className=\"text-xs\">\n {item.author.avatar}\n </AvatarFallback>\n ) : (\n <>\n {item.author.avatarUrl ? (\n <AvatarImage\n src={item.author.avatarUrl}\n alt={item.author.name}\n />\n ) : null}\n <AvatarFallback className=\"text-xs\">\n {testimonialInitials(item.author.name)}\n </AvatarFallback>\n </>\n )}\n </Avatar>\n\n <div>\n <div\n className={cn(\n \"mb-0.5 text-base font-medium leading-tight\",\n authorNameClassName,\n )}\n >\n {item.author.name}\n </div>\n {item.author.title ? (\n <div\n className={cn(\n \"text-sm font-normal text-muted-foreground\",\n authorTitleClassName,\n )}\n >\n {item.author.title}\n </div>\n ) : null}\n </div>\n </figcaption>\n </figure>\n </CarouselItem>\n ))}\n </CarouselContent>\n </Carousel>\n </div>\n </section>\n );\n },\n);\nTestimonialCarousel.displayName = \"TestimonialCarousel\";\n\nexport { TestimonialCarousel };\nexport type { TestimonialItem };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Badge, type BadgeProps } from \"../../components/badge\";\nimport { Avatar, AvatarImage, AvatarFallback } from \"../../components/avatar\";\n\nexport interface ResourceCategoryStyle {\n /** One of the library's curated Badge tones. */\n variant?: BadgeProps[\"variant\"];\n /** Escape hatch for a category color outside the curated tones. */\n className?: string;\n}\n\nexport interface ResourceAuthor {\n name: string;\n /** Avatar image URL; falls back to initials when omitted. */\n avatarUrl?: string;\n /** Custom avatar node, overrides avatarUrl when provided. */\n avatar?: React.ReactNode;\n}\n\nexport interface ResourceItem {\n /** Stable key for the item. */\n id: string;\n /** Card heading. */\n header: string;\n /** Optional supporting copy. */\n subtext?: string;\n /** Image URL or a custom node (e.g. `next/image`). */\n image?: string | React.ReactNode;\n /** Alt text used when `image` is a URL string. */\n imageAlt?: string;\n /**\n * Background styling (solid color/gradient) for the image area when no\n * image is set. When `cardVariant=\"overlay\"` and an image *is* set, this\n * doubles as a custom scrim/tint layer rendered on top of the image\n * (e.g. a gradient for text legibility) — see also `scrim`.\n */\n backgroundClass?: string;\n /**\n * When `cardVariant=\"overlay\"` and an image is set, applies a built-in\n * dark gradient scrim automatically. Ignored if `backgroundClass` is also\n * set (`backgroundClass` wins). Defaults to `false` — never forced.\n */\n scrim?: boolean;\n /** Preformatted, human-readable date. */\n date: string;\n author: ResourceAuthor;\n /** Category/tag labels, looked up against `categoryStyles`. */\n categories?: string[];\n /** URL for the card link. Renders the card as an anchor when set. */\n href?: string;\n /**\n * Anchor `target` for `href`. Defaults to `\"_self\"` (same tab). Setting\n * `\"_blank\"` also adds `rel=\"noopener noreferrer\"`.\n */\n target?: \"_self\" | \"_blank\";\n /** Click handler used when no `href` is provided; renders the card as a button. */\n onClick?: () => void;\n}\n\nexport interface ResourcesBlockProps\n extends React.HTMLAttributes<HTMLElement> {\n /** Section heading. Defaults to \"Resources & Whitepapers\". */\n title?: string;\n subtitle?: string;\n /** The highlighted resource, rendered above the grid. */\n featured: ResourceItem;\n /** The remaining resources, rendered as a grid. */\n resources: ResourceItem[];\n /** Maps category labels to a consistent Badge tone or custom class. */\n categoryStyles?: Record<string, ResourceCategoryStyle>;\n /**\n * Curated card look. `\"default\"` (the initial look): image on top,\n * content below. `\"overlay\"`: the image fills the whole card and the\n * same content (categories, header, subtext, meta) floats on top of it —\n * see `ResourceItem.backgroundClass` and `ResourceItem.scrim` for scrim\n * control. Defaults to `\"default\"`.\n */\n cardVariant?: \"default\" | \"overlay\";\n}\n\ntype CardVariant = \"default\" | \"overlay\";\n\nfunction initials(name: string): string {\n return name\n .split(\" \")\n .map((n) => n[0])\n .filter(Boolean)\n .slice(0, 2)\n .join(\"\")\n .toUpperCase();\n}\n\nfunction ResourceImage({\n item,\n className,\n}: {\n item: ResourceItem;\n className?: string;\n}) {\n if (typeof item.image === \"string\") {\n return (\n <img\n src={item.image}\n alt={item.imageAlt ?? \"\"}\n className={cn(\"h-full w-full object-cover\", className)}\n />\n );\n }\n if (item.image) {\n return <>{item.image}</>;\n }\n return (\n <div\n className={cn(\n \"h-full w-full\",\n item.backgroundClass ?? \"bg-muted\",\n className,\n )}\n />\n );\n}\n\nfunction ResourceCategories({\n item,\n categoryStyles,\n}: {\n item: ResourceItem;\n categoryStyles?: Record<string, ResourceCategoryStyle>;\n}) {\n if (!item.categories || item.categories.length === 0) return null;\n return (\n <div className=\"flex flex-wrap gap-1.5\">\n {item.categories.map((category) => {\n const style = categoryStyles?.[category];\n return (\n <Badge\n key={category}\n variant={style?.variant ?? \"secondary\"}\n className={style?.className}\n >\n {category}\n </Badge>\n );\n })}\n </div>\n );\n}\n\nfunction ResourceMeta({\n item,\n tone = \"default\",\n}: {\n item: ResourceItem;\n tone?: \"default\" | \"light\";\n}) {\n const mutedClass = tone === \"light\" ? \"text-white/75\" : \"text-muted-foreground\";\n return (\n <div className=\"flex items-center gap-2.5\">\n <Avatar className=\"size-8\">\n {item.author.avatar ? (\n item.author.avatar\n ) : (\n <>\n {item.author.avatarUrl && (\n <AvatarImage src={item.author.avatarUrl} alt={item.author.name} />\n )}\n <AvatarFallback className=\"text-xs\">\n {initials(item.author.name)}\n </AvatarFallback>\n </>\n )}\n </Avatar>\n <div className=\"text-sm\">\n <span className={cn(\"font-medium\", tone === \"light\" && \"text-white\")}>\n {item.author.name}\n </span>\n <span className={mutedClass} aria-hidden>\n {\" \"}\n &middot;{\" \"}\n </span>\n <span className={mutedClass}>{item.date}</span>\n </div>\n </div>\n );\n}\n\n/**\n * The scrim/tint layer for `cardVariant=\"overlay\"` cards: an explicit\n * `backgroundClass` always wins, otherwise `scrim: true` opts into a\n * built-in default — applied whether or not there's an image, so a\n * consumer who wants every card in the block to read the same \"dark card\"\n * way (not just the ones with photos) can just set `scrim: true`\n * everywhere. The one exception is `backgroundClass` with no image: there,\n * `ResourceImage` already renders it as the card's own background, so a\n * second copy here would just duplicate it.\n */\nfunction ResourceScrim({\n item,\n cardVariant,\n}: {\n item: ResourceItem;\n cardVariant: CardVariant;\n}) {\n if (cardVariant !== \"overlay\") return null;\n if (item.backgroundClass) {\n if (!item.image) return null;\n return (\n <div\n aria-hidden\n data-resource-scrim=\"true\"\n className={cn(\"absolute inset-0\", item.backgroundClass)}\n />\n );\n }\n if (item.scrim) {\n return (\n <div\n aria-hidden\n data-resource-scrim=\"true\"\n className=\"absolute inset-0 bg-gradient-to-t from-black/85 to-black/55\"\n />\n );\n }\n return null;\n}\n\n/** Renders the card wrapper as an anchor, a button, or a plain div, depending on which action props are set. */\nfunction ResourceCardWrapper({\n item,\n className,\n cardVariant,\n children,\n}: {\n item: ResourceItem;\n className?: string;\n cardVariant: CardVariant;\n children: React.ReactNode;\n}) {\n const dataAttrs = {\n \"data-resource-id\": item.id,\n ...(cardVariant === \"overlay\" && { \"data-card-variant\": \"overlay\" as const }),\n };\n if (item.href) {\n return (\n <a\n href={item.href}\n target={item.target === \"_blank\" ? \"_blank\" : undefined}\n rel={item.target === \"_blank\" ? \"noopener noreferrer\" : undefined}\n aria-label={item.header}\n {...dataAttrs}\n className={cn(\n \"block focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2\",\n className,\n )}\n >\n {children}\n </a>\n );\n }\n if (item.onClick) {\n return (\n <button\n type=\"button\"\n aria-label={item.header}\n onClick={item.onClick}\n {...dataAttrs}\n className={cn(\n \"block w-full text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2\",\n className,\n )}\n >\n {children}\n </button>\n );\n }\n return (\n <div className={className} {...dataAttrs}>\n {children}\n </div>\n );\n}\n\nfunction OverlayCardBody({\n item,\n categoryStyles,\n headingClassName,\n}: {\n item: ResourceItem;\n categoryStyles?: Record<string, ResourceCategoryStyle>;\n headingClassName?: string;\n}) {\n // Light text is only legible when something dark is actually behind it —\n // a photo, a consumer-supplied background, or the scrim itself (which\n // now renders even without an image). With none of those, the card is\n // just the light `bg-muted` fill, where forced white text would be\n // unreadable.\n const tone =\n item.image || item.backgroundClass || item.scrim ? \"light\" : \"default\";\n return (\n <>\n <div className=\"absolute inset-0\">\n <ResourceImage item={item} />\n </div>\n <ResourceScrim item={item} cardVariant=\"overlay\" />\n <div className=\"relative flex h-full min-w-0 flex-col justify-between gap-4 p-6\">\n <ResourceCategories item={item} categoryStyles={categoryStyles} />\n <div className=\"min-w-0 space-y-2\">\n <h3\n className={cn(\n \"line-clamp-2 font-semibold tracking-tight\",\n tone === \"light\" ? \"text-white\" : \"text-foreground\",\n headingClassName,\n )}\n >\n {item.header}\n </h3>\n {item.subtext && (\n <p\n className={cn(\n \"line-clamp-2 text-sm\",\n tone === \"light\" ? \"text-white/80\" : \"text-muted-foreground\",\n )}\n >\n {item.subtext}\n </p>\n )}\n <ResourceMeta item={item} tone={tone} />\n </div>\n </div>\n </>\n );\n}\n\nfunction FeaturedResourceCard({\n item,\n categoryStyles,\n cardVariant = \"default\",\n}: {\n item: ResourceItem;\n categoryStyles?: Record<string, ResourceCategoryStyle>;\n cardVariant?: CardVariant;\n}) {\n if (cardVariant === \"overlay\") {\n return (\n <ResourceCardWrapper\n item={item}\n cardVariant={cardVariant}\n className=\"group relative min-h-[24rem] overflow-hidden rounded-lg shadow-sm transition-shadow hover:shadow-md\"\n >\n <OverlayCardBody\n item={item}\n categoryStyles={categoryStyles}\n headingClassName=\"text-xl md:text-2xl\"\n />\n </ResourceCardWrapper>\n );\n }\n\n return (\n <ResourceCardWrapper\n item={item}\n cardVariant={cardVariant}\n className=\"group overflow-hidden rounded-lg border bg-card text-card-foreground shadow-sm transition-shadow hover:shadow-md\"\n >\n <div className=\"aspect-[16/9] w-full overflow-hidden\">\n <ResourceImage item={item} />\n </div>\n <div className=\"space-y-4 p-6\">\n <ResourceCategories item={item} categoryStyles={categoryStyles} />\n <div className=\"space-y-2\">\n <h3 className=\"text-xl font-semibold tracking-tight md:text-2xl\">\n {item.header}\n </h3>\n {item.subtext && (\n <p className=\"text-muted-foreground\">{item.subtext}</p>\n )}\n </div>\n <ResourceMeta item={item} />\n </div>\n </ResourceCardWrapper>\n );\n}\n\nfunction ResourceListCard({\n item,\n categoryStyles,\n cardVariant = \"default\",\n}: {\n item: ResourceItem;\n categoryStyles?: Record<string, ResourceCategoryStyle>;\n cardVariant?: CardVariant;\n}) {\n if (cardVariant === \"overlay\") {\n return (\n <ResourceCardWrapper\n item={item}\n cardVariant={cardVariant}\n className=\"group relative aspect-[2/1] min-h-[14rem] overflow-hidden rounded-lg shadow-sm transition-shadow hover:shadow-md\"\n >\n <OverlayCardBody item={item} categoryStyles={categoryStyles} />\n </ResourceCardWrapper>\n );\n }\n\n return (\n <ResourceCardWrapper\n item={item}\n cardVariant={cardVariant}\n className=\"group flex flex-1 gap-4 rounded-lg border bg-card p-4 text-card-foreground shadow-sm transition-shadow hover:shadow-md\"\n >\n <div className=\"aspect-square w-24 shrink-0 overflow-hidden rounded-md\">\n <ResourceImage item={item} />\n </div>\n <div\n data-resource-content\n className=\"flex min-w-0 flex-1 flex-col justify-between gap-2\"\n >\n <div className=\"space-y-1.5\">\n <ResourceCategories item={item} categoryStyles={categoryStyles} />\n <div>\n <h3 className=\"font-semibold tracking-tight\">{item.header}</h3>\n {item.subtext && (\n <p className=\"line-clamp-2 text-sm text-muted-foreground\">\n {item.subtext}\n </p>\n )}\n </div>\n </div>\n <ResourceMeta item={item} />\n </div>\n </ResourceCardWrapper>\n );\n}\n\nconst ResourcesBlock = React.forwardRef<HTMLElement, ResourcesBlockProps>(\n (\n {\n title = \"Resources & Whitepapers\",\n subtitle,\n featured,\n resources,\n categoryStyles,\n cardVariant = \"default\",\n className,\n ...props\n },\n ref,\n ) => {\n return (\n <section\n ref={ref}\n className={cn(\"py-16 md:py-24\", className)}\n {...props}\n >\n <div className=\"mx-auto max-w-6xl px-4 sm:px-6\">\n <div className=\"mb-8 max-w-2xl md:mb-12\">\n <h2 className=\"text-2xl font-semibold tracking-tight md:text-3xl\">\n {title}\n </h2>\n {subtitle && (\n <p className=\"mt-2 text-muted-foreground\">{subtitle}</p>\n )}\n </div>\n\n <div className=\"grid gap-8 lg:grid-cols-2 lg:items-stretch\">\n <FeaturedResourceCard\n item={featured}\n categoryStyles={categoryStyles}\n cardVariant={cardVariant}\n />\n <div className=\"flex flex-col gap-6\">\n {resources.map((resource) => (\n <ResourceListCard\n key={resource.id}\n item={resource}\n categoryStyles={categoryStyles}\n cardVariant={cardVariant}\n />\n ))}\n </div>\n </div>\n </div>\n </section>\n );\n },\n);\nResourcesBlock.displayName = \"ResourcesBlock\";\n\nexport { ResourcesBlock };\n","\"use client\";\n\nimport * as React from \"react\";\nimport {\n Facebook,\n Instagram,\n Linkedin,\n Twitter,\n Youtube,\n} from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\n/** Platforms with a built-in icon and label. */\nexport type SocialPlatform =\n | \"instagram\"\n | \"tiktok\"\n | \"facebook\"\n | \"x\"\n | \"youtube\"\n | \"linkedin\";\n\n/** Footprint a cell occupies in the square grid. */\nexport type SocialFeedTileSize = \"square\" | \"wide\" | \"tall\" | \"large\";\n\nexport interface SocialPostItem {\n /** Stable key for the item. */\n id: string;\n /** Image URL or a custom node (e.g. `next/image`). */\n image?: string | React.ReactNode;\n /**\n * Alt text used when `image` is a URL string. This is also the tile's\n * accessible name when it links out, so prefer describing the post over\n * leaving it empty.\n */\n imageAlt?: string;\n /** URL for the tile. Renders the tile as an anchor when set. */\n href?: string;\n /**\n * Anchor `target` for `href`. Defaults to `\"_blank\"`, since social posts\n * live off-site. `\"_blank\"` also adds `rel=\"noopener noreferrer\"`.\n */\n target?: \"_self\" | \"_blank\";\n /** Click handler used when no `href` is provided; renders the tile as a button. */\n onClick?: () => void;\n /**\n * Platform badge. A known key renders the built-in icon + label; any other\n * node renders as-is. Omit to hide the badge.\n */\n platform?: SocialPlatform | React.ReactNode;\n /** Overrides the badge label for a known platform. */\n platformLabel?: React.ReactNode;\n /**\n * Replaces the entire tile body — the escape hatch for a video embed, a\n * text-only post, or anything else that isn't a photo.\n */\n content?: React.ReactNode;\n /** Background styling for the tile when no `image` is set. */\n backgroundClass?: string;\n /** Per-tile class override. */\n className?: string;\n}\n\nexport interface SocialFeedBlockProps\n extends React.HTMLAttributes<HTMLElement> {\n /** Posts rendered as square tiles. */\n items: SocialPostItem[];\n /**\n * The intro cell. Renders **nothing** when omitted — no wrapper, no\n * placeholder; the posts pack forward into the space via dense flow. The\n * cell carries no appearance of its own, so style it entirely through\n * `introClassName`.\n */\n intro?: React.ReactNode;\n /** Intro footprint. Defaults to `\"large\"` (2×2 from `sm` up, full width below). */\n introSize?: SocialFeedTileSize;\n /** Curated column ladder. `6` → 2/4/6, `4` → 2/3/4. Defaults to `6`. */\n columns?: 4 | 6;\n /** Gap preset. Defaults to `\"sm\"`. */\n gap?: \"sm\" | \"md\" | \"lg\";\n /** Hover/focus treatment on image tiles. Defaults to `\"zoom\"`. */\n hoverEffect?: \"zoom\" | \"none\";\n /** Truncates a feed of unknown length, e.g. one coming from a CMS. */\n maxItems?: number;\n /** Classes for the inner container that constrains width and gutters. */\n containerClassName?: string;\n /** Classes for the grid itself. */\n gridClassName?: string;\n /** Classes for the intro cell — this is where the intro's whole look comes from. */\n introClassName?: string;\n /** Classes applied to every post tile. */\n tileClassName?: string;\n /** Classes for the tile image. */\n imageClassName?: string;\n /** Classes for the hover scrim. */\n overlayClassName?: string;\n /** Classes for the platform badge. */\n badgeClassName?: string;\n}\n\n/** TikTok has no lucide icon, so it ships as a path of its own. */\nfunction TikTokIcon({ className }: { className?: string }) {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n aria-hidden\n className={className}\n >\n <path d=\"M16.6 5.82A4.28 4.28 0 0 1 15.54 3h-3.09v12.4a2.59 2.59 0 0 1-2.59 2.5 2.59 2.59 0 1 1 .77-5.06V9.69a5.67 5.67 0 0 0-.77-.05A5.68 5.68 0 1 0 15.54 15.4V9.01a7.35 7.35 0 0 0 4.3 1.38V7.3a4.29 4.29 0 0 1-3.24-1.48Z\" />\n </svg>\n );\n}\n\nconst PLATFORM_META: Record<\n SocialPlatform,\n { label: string; Icon: React.ComponentType<{ className?: string }> }\n> = {\n instagram: { label: \"Instagram\", Icon: Instagram },\n tiktok: { label: \"TikTok\", Icon: TikTokIcon },\n facebook: { label: \"Facebook\", Icon: Facebook },\n x: { label: \"X\", Icon: Twitter },\n youtube: { label: \"YouTube\", Icon: Youtube },\n linkedin: { label: \"LinkedIn\", Icon: Linkedin },\n};\n\nfunction isKnownPlatform(value: unknown): value is SocialPlatform {\n return typeof value === \"string\" && value in PLATFORM_META;\n}\n\n/**\n * Span classes per footprint. Below `sm` the grid is only two columns wide,\n * so `wide` and `large` fill the row rather than trying to span more columns\n * than exist, and `large` holds off on its second row until there is room for\n * the square it is meant to be.\n */\nconst TILE_SPAN: Record<SocialFeedTileSize, string> = {\n square: \"\",\n wide: \"col-span-2\",\n tall: \"row-span-2\",\n large: \"col-span-2 sm:row-span-2\",\n};\n\nconst COLUMN_CLASS: Record<4 | 6, string> = {\n 4: \"grid-cols-2 sm:grid-cols-3 lg:grid-cols-4\",\n 6: \"grid-cols-2 sm:grid-cols-4 lg:grid-cols-6\",\n};\n\nconst GAP_CLASS = {\n sm: \"gap-2\",\n md: \"gap-3\",\n lg: \"gap-4\",\n} as const;\n\nfunction SocialPostBadge({\n item,\n className,\n}: {\n item: SocialPostItem;\n className?: string;\n}) {\n if (item.platform == null) return null;\n\n const badgeClass = cn(\n \"absolute right-2 top-2 z-10 inline-flex items-center gap-1 rounded-full bg-background/85 px-2.5 py-1.5 text-xs font-medium text-foreground backdrop-blur-sm\",\n className,\n );\n\n if (!isKnownPlatform(item.platform)) {\n return <span className={badgeClass}>{item.platform}</span>;\n }\n\n const { label, Icon } = PLATFORM_META[item.platform];\n return (\n <span className={badgeClass}>\n <Icon className=\"size-3.5\" />\n {/*\n * The label is the tile's fallback accessible name when `imageAlt` is\n * empty, so it stays in the accessibility tree at every width and only\n * its visual presentation changes.\n */}\n <span className=\"sr-only sm:not-sr-only\">\n {item.platformLabel ?? label}\n </span>\n </span>\n );\n}\n\nfunction SocialPostBody({\n item,\n hoverEffect,\n imageClassName,\n overlayClassName,\n badgeClassName,\n}: {\n item: SocialPostItem;\n hoverEffect: \"zoom\" | \"none\";\n imageClassName?: string;\n overlayClassName?: string;\n badgeClassName?: string;\n}) {\n return (\n <>\n {/*\n * The square comes from a spacer in normal flow rather than an\n * `aspect-square` on the tile itself. An aspect ratio would pin the\n * tile's height and stop it stretching, so a row made taller by an\n * intro whose content outgrows its footprint would leave dead space\n * under every square beside it. As a spacer the square is a floor: the\n * tile still stretches to whatever height its row settles on, and the\n * body below fills it.\n */}\n <span aria-hidden className=\"block aspect-square\" />\n\n <div className=\"absolute inset-0\">\n {item.content ?? (\n <>\n {typeof item.image === \"string\" ? (\n <img\n src={item.image}\n alt={item.imageAlt ?? \"\"}\n loading=\"lazy\"\n decoding=\"async\"\n className={cn(\n \"h-full w-full object-cover transition-transform duration-300\",\n hoverEffect === \"zoom\" &&\n \"group-hover:scale-[1.045] group-focus-visible:scale-[1.045]\",\n imageClassName,\n )}\n />\n ) : item.image ? (\n item.image\n ) : (\n <div\n className={cn(\n \"h-full w-full\",\n item.backgroundClass ?? \"bg-muted\",\n imageClassName,\n )}\n />\n )}\n\n <ScrimOverlay className={overlayClassName} />\n </>\n )}\n </div>\n\n <SocialPostBadge item={item} className={badgeClassName} />\n </>\n );\n}\n\nfunction ScrimOverlay({ className }: { className?: string }) {\n return (\n <div\n aria-hidden\n className={cn(\n \"pointer-events-none absolute inset-0 bg-gradient-to-t from-foreground/35 to-transparent opacity-0 transition-opacity duration-200\",\n \"group-hover:opacity-100 group-focus-visible:opacity-100\",\n className,\n )}\n />\n );\n}\n\nconst SocialFeedBlock = React.forwardRef<HTMLElement, SocialFeedBlockProps>(\n (\n {\n items,\n intro,\n introSize = \"large\",\n columns = 6,\n gap = \"sm\",\n hoverEffect = \"zoom\",\n maxItems,\n className,\n containerClassName,\n gridClassName,\n introClassName,\n tileClassName,\n imageClassName,\n overlayClassName,\n badgeClassName,\n ...props\n },\n ref,\n ) => {\n const visible = maxItems != null ? items.slice(0, maxItems) : items;\n\n // A feed that a CMS has not filled yet renders nothing at all, rather\n // than an empty grid holding open the space of a section with no content.\n if (visible.length === 0 && intro == null) return null;\n\n return (\n <section\n ref={ref}\n aria-label={\n props[\"aria-labelledby\"] ? undefined : (props[\"aria-label\"] ?? \"Social feed\")\n }\n className={cn(\"py-12 lg:py-16\", className)}\n {...props}\n >\n <div\n className={cn(\"mx-auto max-w-7xl px-4 sm:px-10\", containerClassName)}\n >\n <div\n className={cn(\n \"grid grid-flow-row-dense\",\n COLUMN_CLASS[columns],\n GAP_CLASS[gap],\n gridClassName,\n )}\n >\n {intro != null ? (\n <div className={cn(TILE_SPAN[introSize], introClassName)}>\n {intro}\n </div>\n ) : null}\n\n {visible.map((item) => {\n const body = (\n <SocialPostBody\n item={item}\n hoverEffect={hoverEffect}\n imageClassName={imageClassName}\n overlayClassName={overlayClassName}\n badgeClassName={badgeClassName}\n />\n );\n\n const tileClass = cn(\n \"group relative block overflow-hidden rounded-2xl bg-card\",\n tileClassName,\n item.className,\n );\n const interactiveClass =\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2\";\n\n if (item.href) {\n const target = item.target ?? \"_blank\";\n return (\n <a\n key={item.id}\n href={item.href}\n target={target}\n rel={target === \"_blank\" ? \"noopener noreferrer\" : undefined}\n className={cn(tileClass, interactiveClass)}\n >\n {body}\n </a>\n );\n }\n\n if (item.onClick) {\n return (\n <button\n key={item.id}\n type=\"button\"\n onClick={item.onClick}\n className={cn(tileClass, interactiveClass, \"text-left\")}\n >\n {body}\n </button>\n );\n }\n\n return (\n <div key={item.id} className={tileClass}>\n {body}\n </div>\n );\n })}\n </div>\n </div>\n </section>\n );\n },\n);\nSocialFeedBlock.displayName = \"SocialFeedBlock\";\n\nexport { SocialFeedBlock };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Camera } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { Input } from \"../../components/input\";\nimport { Label } from \"../../components/label\";\nimport { Textarea } from \"../../components/textarea\";\nimport { Avatar, AvatarImage, AvatarFallback } from \"../../components/avatar\";\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from \"../../components/card\";\nimport { FormError } from \"../../form/form-error\";\n\nexport interface ProfileSettingsData {\n name: string;\n email: string;\n bio?: string;\n avatarUrl?: string;\n}\n\nexport interface ProfileSettingsBlockProps {\n initialData: ProfileSettingsData;\n onSave: (data: ProfileSettingsData) => void | Promise<void>;\n onAvatarChange?: (file: File) => void | Promise<void>;\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n className?: string;\n}\n\nexport function ProfileSettingsBlock({\n initialData,\n onSave,\n onAvatarChange,\n loading = false,\n error,\n disabled = false,\n className,\n}: ProfileSettingsBlockProps) {\n const fileInputRef = React.useRef<HTMLInputElement>(null);\n\n const handleSubmit = async (e: React.SyntheticEvent<HTMLFormElement>) => {\n e.preventDefault();\n const formData = new FormData(e.currentTarget);\n await onSave({\n name: formData.get(\"name\") as string,\n email: formData.get(\"email\") as string,\n bio: formData.get(\"bio\") as string,\n avatarUrl: initialData.avatarUrl,\n });\n };\n\n const handleAvatarClick = () => {\n fileInputRef.current?.click();\n };\n\n const handleFileChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const file = e.target.files?.[0];\n if (file && onAvatarChange) {\n onAvatarChange(file);\n }\n };\n\n const initials = initialData.name\n .split(\" \")\n .map((n) => n[0])\n .join(\"\")\n .toUpperCase()\n .slice(0, 2);\n\n return (\n <Card className={cn(\"w-full max-w-2xl\", className)}>\n <CardHeader>\n <CardTitle>Profile</CardTitle>\n <CardDescription>Manage your personal information</CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"space-y-6\">\n <FormError message={error} />\n\n <div className=\"flex items-center gap-4\">\n <div className=\"relative group\">\n <Avatar className=\"h-20 w-20\">\n {initialData.avatarUrl && <AvatarImage src={initialData.avatarUrl} alt={initialData.name} />}\n <AvatarFallback className=\"text-lg\">{initials}</AvatarFallback>\n </Avatar>\n {onAvatarChange && (\n <button\n type=\"button\"\n onClick={handleAvatarClick}\n disabled={loading || disabled}\n className=\"absolute inset-0 flex items-center justify-center rounded-full bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity\"\n >\n <Camera className=\"h-5 w-5 text-white\" />\n </button>\n )}\n <input ref={fileInputRef} type=\"file\" accept=\"image/*\" className=\"hidden\" onChange={handleFileChange} />\n </div>\n <div>\n <p className=\"font-medium\">{initialData.name}</p>\n <p className=\"text-sm text-muted-foreground\">{initialData.email}</p>\n </div>\n </div>\n\n <form onSubmit={handleSubmit} className=\"space-y-4\">\n <div className=\"grid gap-4 sm:grid-cols-2\">\n <div className=\"space-y-2\">\n <Label htmlFor=\"name\">Name</Label>\n <Input id=\"name\" name=\"name\" defaultValue={initialData.name} required disabled={loading || disabled} />\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"email\">Email</Label>\n <Input id=\"email\" name=\"email\" type=\"email\" defaultValue={initialData.email} required disabled={loading || disabled} />\n </div>\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"bio\">Bio</Label>\n <Textarea id=\"bio\" name=\"bio\" defaultValue={initialData.bio} placeholder=\"Tell us about yourself...\" disabled={loading || disabled} rows={3} />\n </div>\n <div className=\"flex justify-end\">\n <Button type=\"submit\" loading={loading} disabled={disabled}>\n Save changes\n </Button>\n </div>\n </form>\n </div>\n </CardContent>\n </Card>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { Input } from \"../../components/input\";\nimport { Label } from \"../../components/label\";\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from \"../../components/card\";\nimport { Separator } from \"../../components/separator\";\nimport { FormError } from \"../../form/form-error\";\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n} from \"../../components/alert-dialog\";\n\nexport interface AccountSettingsBlockProps {\n onChangePassword: (data: { currentPassword: string; newPassword: string; confirmPassword: string }) => void | Promise<void>;\n onDeleteAccount?: () => void | Promise<void>;\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n className?: string;\n}\n\nexport function AccountSettingsBlock({\n onChangePassword,\n onDeleteAccount,\n loading = false,\n error,\n disabled = false,\n className,\n}: AccountSettingsBlockProps) {\n const handlePasswordSubmit = async (e: React.SyntheticEvent<HTMLFormElement>) => {\n e.preventDefault();\n const formData = new FormData(e.currentTarget);\n await onChangePassword({\n currentPassword: formData.get(\"currentPassword\") as string,\n newPassword: formData.get(\"newPassword\") as string,\n confirmPassword: formData.get(\"confirmPassword\") as string,\n });\n e.currentTarget.reset();\n };\n\n return (\n <div className={cn(\"w-full max-w-2xl space-y-6\", className)}>\n <Card>\n <CardHeader>\n <CardTitle>Change password</CardTitle>\n <CardDescription>Update your password to keep your account secure</CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"space-y-4\">\n <FormError message={error} />\n <form onSubmit={handlePasswordSubmit} className=\"space-y-4\">\n <div className=\"space-y-2\">\n <Label htmlFor=\"currentPassword\">Current password</Label>\n <Input id=\"currentPassword\" name=\"currentPassword\" type=\"password\" required disabled={loading || disabled} autoComplete=\"current-password\" />\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"newPassword\">New password</Label>\n <Input id=\"newPassword\" name=\"newPassword\" type=\"password\" required disabled={loading || disabled} autoComplete=\"new-password\" />\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"confirmPassword\">Confirm new password</Label>\n <Input id=\"confirmPassword\" name=\"confirmPassword\" type=\"password\" required disabled={loading || disabled} autoComplete=\"new-password\" />\n </div>\n <div className=\"flex justify-end\">\n <Button type=\"submit\" loading={loading} disabled={disabled}>\n Update password\n </Button>\n </div>\n </form>\n </div>\n </CardContent>\n </Card>\n\n {onDeleteAccount && (\n <Card className=\"border-destructive/50\">\n <CardHeader>\n <CardTitle className=\"text-destructive\">Danger zone</CardTitle>\n <CardDescription>Permanently delete your account and all associated data</CardDescription>\n </CardHeader>\n <CardContent>\n <AlertDialog>\n <AlertDialogTrigger asChild>\n <Button variant=\"destructive\" disabled={loading || disabled}>\n Delete account\n </Button>\n </AlertDialogTrigger>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>\n <AlertDialogDescription>\n This action cannot be undone. This will permanently delete your account and remove all your data from our servers.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Cancel</AlertDialogCancel>\n <AlertDialogAction onClick={onDeleteAccount} className=\"bg-destructive text-destructive-foreground hover:bg-destructive/90\">\n Delete account\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </CardContent>\n </Card>\n )}\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { Switch } from \"../../components/switch\";\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from \"../../components/card\";\nimport { FormError } from \"../../form/form-error\";\n\nexport interface NotificationSetting {\n id: string;\n label: string;\n description: string;\n enabled: boolean;\n}\n\nexport interface NotificationGroup {\n title: string;\n description?: string;\n settings: NotificationSetting[];\n}\n\nexport interface NotificationSettingsBlockProps {\n groups: NotificationGroup[];\n onSave: (settings: Record<string, boolean>) => void | Promise<void>;\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n className?: string;\n}\n\nexport function NotificationSettingsBlock({\n groups,\n onSave,\n loading = false,\n error,\n disabled = false,\n className,\n}: NotificationSettingsBlockProps) {\n const [values, setValues] = React.useState<Record<string, boolean>>(() => {\n const initial: Record<string, boolean> = {};\n for (const group of groups) {\n for (const setting of group.settings) {\n initial[setting.id] = setting.enabled;\n }\n }\n return initial;\n });\n\n const handleToggle = (id: string, checked: boolean) => {\n setValues((prev) => ({ ...prev, [id]: checked }));\n };\n\n const handleSave = async () => {\n await onSave(values);\n };\n\n return (\n <div className={cn(\"w-full max-w-2xl space-y-6\", className)}>\n <FormError message={error} />\n\n {groups.map((group, gIdx) => (\n <Card key={gIdx}>\n <CardHeader>\n <CardTitle className=\"text-lg\">{group.title}</CardTitle>\n {group.description && <CardDescription>{group.description}</CardDescription>}\n </CardHeader>\n <CardContent>\n <div className=\"space-y-4\">\n {group.settings.map((setting) => (\n <div key={setting.id} className=\"flex items-center justify-between gap-4\">\n <div className=\"space-y-0.5\">\n <p className=\"text-sm font-medium\">{setting.label}</p>\n <p className=\"text-sm text-muted-foreground\">{setting.description}</p>\n </div>\n <Switch\n checked={values[setting.id]}\n onCheckedChange={(checked) => handleToggle(setting.id, checked)}\n disabled={loading || disabled}\n />\n </div>\n ))}\n </div>\n </CardContent>\n </Card>\n ))}\n\n <div className=\"flex justify-end\">\n <Button onClick={handleSave} loading={loading} disabled={disabled}>\n Save preferences\n </Button>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;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,CAAA,EACtD,oBAAC,KAAD;OAAG,WAAU;iBAAiC,QAAQ;OAAgB,CAAA,CAClE;SACN,oBAAC,QAAD;MACE,SAAS,OAAO,QAAQ;MACxB,kBAAkB,YAAY,aAAa,QAAQ,IAAI,QAAQ;MAC/D,UAAU,WAAW;MACrB,CAAA,CACE;OAVI,QAAQ,GAUZ,CACN;IACE,CAAA,EACM,CAAA,CACT,EAAA,EAtBI,KAsBJ,CACP;GAEF,oBAAC,OAAD;IAAK,WAAU;cACb,oBAAC,QAAD;KAAQ,SAAS;KAAqB;KAAmB;eAAU;KAE1D,CAAA;IACL,CAAA;GACF"}
1
+ {"version":3,"file":"index.mjs","names":["SlotPrimitive","PasswordToggleField","LabelPrimitive","SelectPrimitive","PopoverPrimitive","CalendarIcon","useIsomorphicLayoutEffect","CalendarIcon","SeparatorPrimitive","TooltipPrimitive","UnderlineIcon","LinkIcon","Underline","Link","CheckboxPrimitive","RadioGroupPrimitive","SwitchPrimitives","SliderPrimitive","AvatarPrimitive","DialogPrimitive","AlertDialogPrimitive","SheetPrimitive","DropdownMenuPrimitive","SonnerToaster","TabsPrimitive","AccordionPrimitive","ProgressPrimitive","ScrollAreaPrimitive","ContextMenuPrimitive","NavigationMenuPrimitive","SlotPrimitive","CommandPrimitive","AspectRatioPrimitive","CollapsiblePrimitive","SlotPrimitive","ImageIcon","initials"],"sources":["../src/lib/semantic-action-tones.ts","../src/hooks/use-scroll-reveal.ts","../src/hooks/use-mobile.ts","../src/hooks/use-hide-on-scroll.ts","../src/providers/theme-provider.tsx","../src/providers/density-provider.tsx","../src/providers/bison-provider.tsx","../src/providers/theme-scope.tsx","../src/form/form.tsx","../src/form/field-context.tsx","../src/components/outlined-field.tsx","../src/form/form-field.tsx","../src/form/form-error.tsx","../src/components/button.tsx","../src/lib/surface-classes.ts","../src/components/input.tsx","../src/components/password-input.tsx","../src/components/code-input.tsx","../src/components/currency-input.tsx","../src/lib/us-phone.ts","../src/components/phone-input.tsx","../src/components/label.tsx","../src/components/input-group.tsx","../src/components/textarea.tsx","../src/components/select.tsx","../src/components/calendar.tsx","../src/components/carousel.tsx","../src/components/popover.tsx","../src/components/date-picker.tsx","../src/components/time-picker.tsx","../src/components/date-range-picker.tsx","../src/components/separator.tsx","../src/components/tooltip.tsx","../src/components/text-editor.tsx","../src/components/text-content.tsx","../src/components/checkbox.tsx","../src/components/radio-group.tsx","../src/components/switch.tsx","../src/components/slider.tsx","../src/components/card.tsx","../src/components/alert.tsx","../src/lib/semantic-tint-tones.ts","../src/components/badge.tsx","../src/components/rotating-badge.tsx","../src/components/avatar.tsx","../src/components/dialog.tsx","../src/components/alert-dialog.tsx","../src/components/sheet.tsx","../src/components/dropdown-menu.tsx","../src/components/toast.tsx","../src/components/tabs.tsx","../src/components/stepper.tsx","../src/components/accordion.tsx","../src/components/table.tsx","../src/components/data-table.tsx","../src/components/progress.tsx","../src/components/progress-bar.tsx","../src/components/scroll-area.tsx","../src/components/skeleton.tsx","../src/components/rating.tsx","../src/components/spinner.tsx","../src/components/saved-ping.tsx","../src/components/context-menu.tsx","../src/components/navigation-menu.tsx","../src/components/breadcrumb.tsx","../src/components/pagination.tsx","../src/components/command.tsx","../src/components/editable-title.tsx","../src/components/aspect-ratio.tsx","../src/components/collapsible.tsx","../src/components/sidebar.tsx","../src/blocks/auth/social-providers.tsx","../src/blocks/auth/sign-in-block.tsx","../src/blocks/auth/sign-up-block.tsx","../src/blocks/auth/forgot-password-block.tsx","../src/blocks/auth/reset-password-block.tsx","../src/blocks/auth/verify-block.tsx","../src/blocks/error/not-found-block.tsx","../src/blocks/error/server-error-block.tsx","../src/blocks/error/maintenance-block.tsx","../src/blocks/error/empty-state-block.tsx","../src/blocks/layout/page-shell.tsx","../src/blocks/layout/header-block.tsx","../src/lib/render-link.tsx","../src/blocks/layout/floating-nav-block.tsx","../src/blocks/layout/mega-menu-panel.tsx","../src/blocks/layout/sidebar-block.tsx","../src/blocks/layout/footer-block.tsx","../src/blocks/layout/app-sidebar/team-switcher.tsx","../src/blocks/layout/app-sidebar/sidebar-nav.tsx","../src/blocks/layout/app-sidebar/sidebar-user.tsx","../src/blocks/layout/app-sidebar/app-sidebar-block.tsx","../src/blocks/data-display/media-card.tsx","../src/blocks/marketing/json-ld.tsx","../src/blocks/marketing/nap-block.tsx","../src/blocks/marketing/showcase-panels-block.tsx","../src/blocks/marketing/process-steps-block.tsx","../src/blocks/marketing/stats-band-block.tsx","../src/blocks/marketing/faq-columns-block.tsx","../src/blocks/marketing/reviews-block.tsx","../src/blocks/marketing/testimonial-types.ts","../src/blocks/marketing/testimonial-masonry-block.tsx","../src/blocks/marketing/testimonial-carousel-block.tsx","../src/blocks/marketing/resources-block.tsx","../src/blocks/marketing/social-feed-block.tsx","../src/blocks/settings/profile-settings-block.tsx","../src/blocks/settings/account-settings-block.tsx","../src/blocks/settings/notification-settings-block.tsx"],"sourcesContent":["/**\n * Reusable “soft” icon tiles: same border + shadow language, hue from semantic scales.\n * Pair with `Button` variants `actionNeutral` | `actionPositive` | `actionNegative` and `size=\"icon\"`.\n *\n * Requires `--success-*` and `--destructive-*` scales from BisonProvider / tailwind preset.\n */\nexport const actionNeutralToneClasses =\n 'border border-border bg-muted/80 text-muted-foreground shadow-sm hover:border-border-strong hover:bg-muted hover:text-foreground dark:border-border dark:bg-muted/50 dark:hover:bg-muted/80 dark:hover:text-foreground';\n\nexport const actionPositiveToneClasses =\n 'border border-success-200/90 bg-success-100 text-success-600 shadow-sm hover:border-success-300 hover:bg-success-200 hover:text-success-700 focus-visible:ring-success-500/40 dark:border-success-800/55 dark:bg-success-950/40 dark:text-success-400 dark:hover:border-success-700 dark:hover:bg-success-950/60 dark:hover:text-success-300';\n\nexport const actionNegativeToneClasses =\n 'border border-destructive-200/90 bg-destructive-100 text-destructive-600 shadow-sm hover:border-destructive-300 hover:bg-destructive-200 hover:text-destructive-700 focus-visible:ring-destructive-500/40 dark:border-destructive-800/55 dark:bg-destructive-950/45 dark:text-destructive-400 dark:hover:border-destructive-700 dark:hover:bg-destructive-950/65 dark:hover:text-destructive-300';\n\n/** @deprecated Use `actionNeutralToneClasses` + `variant=\"actionNeutral\"` on Button. */\nexport const actionNeutralIconChromeClasses = actionNeutralToneClasses;\n","\"use client\";\n\nimport * as React from \"react\";\n\nexport interface UseScrollRevealOptions {\n /** Trigger only once (default: true) */\n once?: boolean;\n /** Root margin for IntersectionObserver (default: \"-50px\") */\n margin?: string;\n /** Visibility threshold 0–1 (default: 0) */\n threshold?: number;\n}\n\n/**\n * Returns a ref and a boolean indicating whether the element is in view.\n * Uses IntersectionObserver internally — no Framer Motion dependency required.\n *\n * @example\n * ```tsx\n * const { ref, isInView } = useScrollReveal();\n * <div ref={ref} style={{ opacity: isInView ? 1 : 0 }}>Content</div>\n * ```\n */\nexport function useScrollReveal<T extends HTMLElement = HTMLDivElement>(\n options: UseScrollRevealOptions = {}\n): { ref: React.RefObject<T | null>; isInView: boolean } {\n const { once = true, margin = \"-50px\", threshold = 0 } = options;\n const ref = React.useRef<T | null>(null);\n const [isInView, setIsInView] = React.useState(false);\n\n React.useEffect(() => {\n const el = ref.current;\n if (!el) return;\n\n const observer = new IntersectionObserver(\n ([entry]) => {\n if (entry.isIntersecting) {\n setIsInView(true);\n if (once) observer.unobserve(el);\n } else if (!once) {\n setIsInView(false);\n }\n },\n { rootMargin: margin, threshold }\n );\n\n observer.observe(el);\n return () => observer.disconnect();\n }, [once, margin, threshold]);\n\n return { ref, isInView };\n}\n","\"use client\";\n\nimport * as React from \"react\";\n\nconst MOBILE_BREAKPOINT = 768;\n\nexport function useIsMobile() {\n const [isMobile, setIsMobile] = React.useState<boolean | undefined>(\n undefined\n );\n\n React.useEffect(() => {\n const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);\n const onChange = () => setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n mql.addEventListener(\"change\", onChange);\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n return () => mql.removeEventListener(\"change\", onChange);\n }, []);\n\n return !!isMobile;\n}\n","\"use client\";\n\nimport * as React from \"react\";\n\nexport interface UseHideOnScrollOptions {\n /** Pixels scrolled from the top before the element may hide (default: 80) */\n threshold?: number;\n /**\n * Minimum movement between samples before a direction change is believed,\n * in pixels (default: 6). Without it, the sub-pixel jitter of a trackpad or\n * a momentum scroll flickers the element in and out.\n */\n tolerance?: number;\n /**\n * Hold the element visible (default: `false`). Use it while a menu is\n * open — hiding the bar out from under an open panel strands the panel\n * mid-air. `scrolled` keeps updating either way; only hiding is\n * suppressed.\n */\n disabled?: boolean;\n}\n\n/**\n * Tracks scroll direction and reports whether a fixed element should hide.\n * `hidden` turns on while scrolling down past `threshold` and off again on\n * the first meaningful scroll up. Reads are rAF-throttled, so a fast scroll\n * costs one state update per frame at most.\n *\n * @example\n * ```tsx\n * const { hidden } = useHideOnScroll();\n * <header className={hidden ? \"-translate-y-full\" : \"translate-y-0\"} />\n * ```\n */\nexport function useHideOnScroll(options: UseHideOnScrollOptions = {}): {\n hidden: boolean;\n scrolled: boolean;\n} {\n const { threshold = 80, tolerance = 6, disabled = false } = options;\n const [hidden, setHidden] = React.useState(false);\n const [scrolled, setScrolled] = React.useState(false);\n const lastY = React.useRef(0);\n const frame = React.useRef<number | null>(null);\n\n React.useEffect(() => {\n const read = () => {\n frame.current = null;\n const y = Math.max(window.scrollY, 0);\n const delta = y - lastY.current;\n\n // Tracked even while disabled: `scrolled` describes where the page is,\n // not whether the element may hide, and a pinned element still wants\n // to style against it.\n setScrolled(y > threshold);\n\n if (disabled) {\n // Hold it open, but keep the baseline current so the first read\n // after re-enabling compares against where the page actually is\n // rather than against wherever it was when the menu opened.\n setHidden(false);\n lastY.current = y;\n return;\n }\n\n if (y <= threshold) {\n // Above the threshold the bar is always shown, whichever way the\n // page is moving — otherwise it stays hidden at the top of the page.\n setHidden(false);\n lastY.current = y;\n } else if (Math.abs(delta) >= tolerance) {\n setHidden(delta > 0);\n lastY.current = y;\n }\n // Below `tolerance`, `lastY` deliberately stays put so that slow\n // scrolling accumulates instead of being discarded frame by frame.\n };\n\n const onScroll = () => {\n if (frame.current === null) {\n frame.current = requestAnimationFrame(read);\n }\n };\n\n lastY.current = Math.max(window.scrollY, 0);\n read();\n\n window.addEventListener(\"scroll\", onScroll, { passive: true });\n return () => {\n window.removeEventListener(\"scroll\", onScroll);\n if (frame.current !== null) cancelAnimationFrame(frame.current);\n frame.current = null;\n };\n }, [threshold, tolerance, disabled]);\n\n return { hidden, scrolled };\n}\n","'use client';\n\nimport * as React from 'react';\n\ntype Theme = 'light' | 'dark' | 'system';\ntype ResolvedTheme = 'light' | 'dark';\n\ninterface ThemeProviderProps {\n children: React.ReactNode;\n defaultTheme?: Theme;\n storageKey?: string;\n attribute?: string;\n}\n\ninterface ThemeProviderState {\n /** The user's selected theme — can be `\"system\"`. Use `resolvedTheme` for the value actually applied to the DOM. */\n theme: Theme;\n /** The theme actually applied to the DOM (`\"light\"` or `\"dark\"`). `undefined` until the client mounts (avoids SSR/hydration mismatches). */\n resolvedTheme: ResolvedTheme | undefined;\n /** The user's OS-level color scheme preference. `undefined` until the client mounts. */\n systemTheme: ResolvedTheme | undefined;\n setTheme: (theme: Theme) => void;\n}\n\nconst ThemeProviderContext = React.createContext<\n ThemeProviderState | undefined\n>(undefined);\n\nexport function ThemeProvider({\n children,\n defaultTheme = 'system',\n storageKey = 'bison-theme',\n attribute = 'data-theme',\n ...props\n}: ThemeProviderProps) {\n const [theme, setTheme] = React.useState<Theme>(defaultTheme);\n const [systemTheme, setSystemTheme] = React.useState<\n ResolvedTheme | undefined\n >(undefined);\n\n React.useEffect(() => {\n const stored = localStorage.getItem(storageKey) as Theme | null;\n if (stored) setTheme(stored);\n }, [storageKey]);\n\n React.useEffect(() => {\n const media = window.matchMedia('(prefers-color-scheme: dark)');\n setSystemTheme(media.matches ? 'dark' : 'light');\n\n const handleChange = (event: MediaQueryListEvent) => {\n setSystemTheme(event.matches ? 'dark' : 'light');\n };\n media.addEventListener('change', handleChange);\n return () => media.removeEventListener('change', handleChange);\n }, []);\n\n const resolvedTheme: ResolvedTheme | undefined =\n theme === 'light' || theme === 'dark' ? theme : systemTheme;\n\n React.useEffect(() => {\n if (!resolvedTheme) return;\n const root = window.document.documentElement;\n\n if (attribute === 'class') {\n root.classList.remove('light', 'dark');\n root.classList.add(resolvedTheme);\n } else {\n root.setAttribute(attribute, resolvedTheme);\n }\n }, [resolvedTheme, attribute]);\n\n const value = React.useMemo(\n () => ({\n theme,\n resolvedTheme,\n systemTheme,\n setTheme: (newTheme: Theme) => {\n localStorage.setItem(storageKey, newTheme);\n setTheme(newTheme);\n },\n }),\n [theme, resolvedTheme, systemTheme, storageKey],\n );\n\n return (\n <ThemeProviderContext.Provider {...props} value={value}>\n {children}\n </ThemeProviderContext.Provider>\n );\n}\n\nexport function useTheme() {\n const context = React.useContext(ThemeProviderContext);\n if (!context) throw new Error('useTheme must be used within a ThemeProvider');\n return context;\n}\n","\"use client\";\n\nimport * as React from \"react\";\n\ntype Density = \"compact\" | \"default\" | \"spacious\";\n\ninterface DensityProviderProps {\n children: React.ReactNode;\n density?: Density;\n}\n\nconst DensityContext = React.createContext<Density>(\"default\");\n\nconst densityClasses: Record<Density, string> = {\n compact: \"bison-density-compact\",\n default: \"bison-density-default\",\n spacious: \"bison-density-spacious\",\n};\n\nexport function DensityProvider({ children, density = \"default\" }: DensityProviderProps) {\n return (\n <DensityContext.Provider value={density}>\n <div className={densityClasses[density]}>{children}</div>\n </DensityContext.Provider>\n );\n}\n\nexport function useDensity() {\n return React.useContext(DensityContext);\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport {\n deriveLightPalette,\n deriveDarkPalette,\n generateBrandScales,\n generateScaleCSS,\n generateDestructiveScaleCSS,\n radiusPresets,\n shadowPresets,\n motionPresets,\n densityPresets,\n defaultFontWeights,\n zIndexTokens,\n} from \"@bison-lab/tokens\";\nimport type {\n BrandColors,\n RadiusPreset,\n ShadowPreset,\n MotionPreset,\n DensityPreset,\n FontWeightMap,\n} from \"@bison-lab/tokens\";\nimport { ThemeProvider } from \"./theme-provider\";\nimport { DensityProvider } from \"./density-provider\";\n\ntype Theme = \"light\" | \"dark\" | \"system\";\n\ninterface GoogleFontConfig {\n /** Google Font family name, e.g. \"Inter\", \"Roboto\", \"Playfair Display\" */\n family: string;\n /** Font weights to load. Defaults to [400, 500, 600, 700] */\n weights?: number[];\n /** Whether to load italic variants. Defaults to false */\n italic?: boolean;\n}\n\nexport interface BisonProviderProps {\n children: React.ReactNode;\n\n /** Brand colors used to derive the full semantic palette */\n brandColors: BrandColors;\n\n /** Border radius preset. Defaults to \"rounded\" */\n radius?: RadiusPreset;\n /** Shadow preset. Defaults to \"subtle\" */\n shadow?: ShadowPreset;\n /** Motion preset. Defaults to \"smooth\" */\n motion?: MotionPreset;\n /** Density preset. Defaults to \"default\" */\n density?: DensityPreset;\n\n /**\n * How dark mode is toggled on the root element. `\"data-theme\"` writes the\n * dark palette under `[data-theme=\"dark\"]`, which is what `ThemeProvider`\n * sets, the Tailwind preset's `dark:` variant reads, and the CLI's\n * `bison-theme.css` uses. `\"class\"` writes it under `.dark` instead.\n * Defaults to `\"data-theme\"`. It defaulted to `\"class\"` before BIS-57,\n * when the preset's `dark:` utilities and the provider's palette flipped\n * on different signals.\n */\n attribute?: \"class\" | \"data-theme\";\n\n /** Default theme mode. Defaults to \"system\" */\n defaultTheme?: Theme;\n /** localStorage key for theme persistence. Defaults to \"bison-theme\" */\n storageKey?: string;\n\n /** Google Font for body/UI text. Defaults to Inter */\n bodyFont?: GoogleFontConfig;\n /** Google Font for headings. Falls back to bodyFont if not provided */\n headingFont?: GoogleFontConfig;\n /** Google Font for monospace/code. Defaults to JetBrains Mono */\n monoFont?: GoogleFontConfig;\n\n /** Custom font weight map. Defaults to 400/500/600/700 */\n fontWeights?: FontWeightMap;\n}\n\nfunction buildGoogleFontsUrl(fonts: GoogleFontConfig[]): string {\n const families = fonts.map((font) => {\n const weights = font.weights ?? [400, 500, 600, 700];\n const sortedWeights = [...weights].sort((a, b) => a - b);\n\n if (font.italic) {\n const ital = sortedWeights\n .flatMap((w) => [`0,${w}`, `1,${w}`])\n .join(\";\");\n return `family=${font.family.replace(/ /g, \"+\")}:ital,wght@${ital}`;\n }\n\n return `family=${font.family.replace(/ /g, \"+\")}:wght@${sortedWeights.join(\";\")}`;\n });\n\n return `https://fonts.googleapis.com/css2?${families.join(\"&\")}&display=swap`;\n}\n\nfunction fontFamilyValue(font: GoogleFontConfig, fallback: string): string {\n return `\"${font.family}\", ${fallback}`;\n}\n\nexport function BisonProvider({\n children,\n brandColors,\n radius = \"rounded\",\n shadow = \"subtle\",\n motion = \"smooth\",\n density = \"default\",\n attribute = \"data-theme\",\n defaultTheme = \"system\",\n storageKey = \"bison-theme\",\n bodyFont = { family: \"Inter\", weights: [400, 500, 600, 700] },\n headingFont,\n monoFont = { family: \"JetBrains Mono\", weights: [400, 500, 600, 700] },\n fontWeights = defaultFontWeights,\n}: BisonProviderProps) {\n const resolvedHeadingFont = headingFont ?? bodyFont;\n\n // Derive color palettes + brand scales\n const lightPalette = React.useMemo(() => deriveLightPalette(brandColors), [brandColors]);\n const darkPalette = React.useMemo(() => deriveDarkPalette(brandColors), [brandColors]);\n const scaleCSS = React.useMemo(() => {\n const scales = generateBrandScales(brandColors);\n return `${generateScaleCSS(scales)}\\n${generateDestructiveScaleCSS()}`;\n }, [brandColors]);\n\n // Build Google Fonts URL\n const fontsUrl = React.useMemo(() => {\n const fonts: GoogleFontConfig[] = [bodyFont];\n if (headingFont && headingFont.family !== bodyFont.family) {\n fonts.push(headingFont);\n }\n if (monoFont.family !== bodyFont.family) {\n fonts.push(monoFont);\n }\n return buildGoogleFontsUrl(fonts);\n }, [bodyFont, headingFont, monoFont]);\n\n // Build CSS custom properties style string\n const styleContent = React.useMemo(() => {\n const radiusVars = radiusPresets[radius];\n const shadowVars = shadowPresets[shadow];\n const motionVars = motionPresets[motion];\n const densityVars = densityPresets[density];\n\n const fontVars = {\n \"--font-body\": fontFamilyValue(bodyFont, \"ui-sans-serif, system-ui, sans-serif\"),\n \"--font-heading\": fontFamilyValue(resolvedHeadingFont, \"ui-sans-serif, system-ui, sans-serif\"),\n \"--font-mono\": fontFamilyValue(monoFont, \"ui-monospace, monospace\"),\n \"--font-weight-normal\": String(fontWeights.normal),\n \"--font-weight-medium\": String(fontWeights.medium),\n \"--font-weight-semibold\": String(fontWeights.semibold),\n \"--font-weight-bold\": String(fontWeights.bold),\n ...(fontWeights.extrabold != null && {\n \"--font-weight-extrabold\": String(fontWeights.extrabold),\n }),\n };\n\n const lightColorVars = Object.entries(lightPalette)\n .map(([key, value]) => ` --${key}: ${value};`)\n .join(\"\\n\");\n\n const darkColorVars = Object.entries(darkPalette)\n .map(([key, value]) => ` --${key}: ${value};`)\n .join(\"\\n\");\n\n const zIndexVars = Object.entries(zIndexTokens)\n .map(([key, value]) => ` ${key}: ${value};`)\n .join(\"\\n\");\n\n const presetVars = [\n ...Object.entries(radiusVars),\n ...Object.entries(shadowVars),\n ...Object.entries(motionVars),\n ...Object.entries(densityVars),\n ...Object.entries(fontVars),\n ]\n .map(([key, value]) => ` ${key}: ${value};`)\n .join(\"\\n\");\n\n const darkSelector = attribute === \"class\" ? \".dark\" : '[data-theme=\"dark\"]';\n\n return `:root {\\n${lightColorVars}\\n\\n${scaleCSS}\\n${presetVars}\\n${zIndexVars}\\n font-family: var(--font-body);\\n}\\n\\n${darkSelector} {\\n${darkColorVars}\\n}`;\n }, [\n radius,\n shadow,\n motion,\n density,\n attribute,\n bodyFont,\n resolvedHeadingFont,\n monoFont,\n fontWeights,\n lightPalette,\n darkPalette,\n scaleCSS,\n ]);\n\n return (\n <>\n <link rel=\"preconnect\" href=\"https://fonts.googleapis.com\" />\n <link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossOrigin=\"anonymous\" />\n <link rel=\"stylesheet\" href={fontsUrl} />\n <style dangerouslySetInnerHTML={{ __html: styleContent }} />\n <ThemeProvider defaultTheme={defaultTheme} storageKey={storageKey} attribute={attribute}>\n <DensityProvider density={density}>\n {children}\n </DensityProvider>\n </ThemeProvider>\n </>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../lib/utils\";\n\nexport interface ThemeScopeProps extends React.HTMLAttributes<HTMLDivElement> {\n /** CSS custom property overrides applied to the scoped subtree */\n overrides: Record<string, string>;\n}\n\nconst ThemeScope = React.forwardRef<HTMLDivElement, ThemeScopeProps>(\n ({ overrides, className, style, children, ...props }, ref) => {\n const scopeStyle = React.useMemo(\n () => ({ ...overrides, ...style }),\n [overrides, style]\n );\n\n return (\n <div\n ref={ref}\n className={cn(\"contents\", className)}\n style={scopeStyle}\n {...props}\n >\n {children}\n </div>\n );\n }\n);\nThemeScope.displayName = \"ThemeScope\";\n\nexport { ThemeScope };\n","'use client';\n\nimport * as React from 'react';\nimport type { ZodSchema, ZodError } from 'zod';\n\nexport type FormMode = 'native' | 'rhf';\n\n/**\n * The payload handed to `onSubmit`.\n *\n * A name that appears once yields a scalar; a name that repeats — a checkbox\n * group, a multi-select — yields an array. It used to always be a scalar,\n * because the payload was built with `Object.fromEntries(formData.entries())`,\n * which keeps only the LAST entry under a repeated key. Three checked boxes\n * submitted as one, silently, with nothing in the DOM to suggest the other two\n * had been dropped.\n */\nexport type FormData_ = Record<string, FormDataEntryValue | FormDataEntryValue[]>;\n\ninterface FormContextValue {\n errors: Record<string, string>;\n touched: Record<string, boolean>;\n setFieldError: (name: string, error: string) => void;\n clearFieldError: (name: string) => void;\n setFieldTouched: (name: string) => void;\n isSubmitting: boolean;\n formMode: FormMode;\n /**\n * Bumped on every submit that yields validation errors. Fields read this to\n * replay the error shake on each failed submit — error strings alone don't\n * change between identical resubmits, so the animation wouldn't otherwise\n * re-trigger.\n */\n errorVersion: number;\n}\n\nconst FormContext = React.createContext<FormContextValue | undefined>(undefined);\n\nexport function useFormContext() {\n return React.useContext(FormContext);\n}\n\n/**\n * Anything that can take focus. Hidden and disabled controls are excluded —\n * focusing either is a no-op that would strand the user mid-form.\n */\nconst FOCUSABLE_SELECTOR = [\n 'input:not([type=\"hidden\"]):not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'button:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n].join(', ');\n\n/**\n * Move focus to the first control the schema rejected (WCAG technique G139).\n *\n * Dives inside the invalid element when the element itself cannot hold focus:\n * a checkbox group marks the `<fieldset>` invalid, and a fieldset is not\n * focusable, so the first checkbox inside it is the right landing point.\n */\nfunction focusFirstInvalid(form: HTMLFormElement): void {\n const invalids = form.querySelectorAll<HTMLElement>('[aria-invalid=\"true\"]');\n for (const el of Array.from(invalids)) {\n const target = el.matches(FOCUSABLE_SELECTOR)\n ? el\n : el.querySelector<HTMLElement>(FOCUSABLE_SELECTOR);\n if (target) {\n target.focus();\n return;\n }\n }\n}\n\nexport interface FormProps\n extends Omit<React.FormHTMLAttributes<HTMLFormElement>, 'onSubmit'> {\n onSubmit?: (data: FormData_) => void | Promise<void>;\n schema?: ZodSchema;\n formMode?: FormMode;\n /**\n * Field errors supplied from outside — typically what a Server Action just\n * returned, keyed by field name.\n *\n * Needed because errors produced on the server have to appear during RENDER,\n * not from an effect: with JavaScript disabled the action runs, the page\n * re-renders on the server, and an effect that would have pushed the errors\n * into context never executes. Passing them here is what lets `FormField`\n * wire them to `aria-describedby` on that path too, instead of degrading to\n * an unassociated summary.\n *\n * Merged with the schema's own results, which win — the most recent\n * validation is the client one.\n */\n errors?: Record<string, string>;\n /**\n * Move focus to the first invalid control after a failed submit.\n * @default true\n */\n focusOnError?: boolean;\n /**\n * Wording for the screen-reader announcement made after a failed submit.\n * Override for i18n or for a more specific summary.\n */\n errorSummary?: (count: number) => string;\n children: React.ReactNode;\n}\n\nfunction defaultErrorSummary(count: number) {\n return count === 1\n ? '1 field needs attention.'\n : `${count} fields need attention.`;\n}\n\nexport const Form = React.forwardRef<HTMLFormElement, FormProps>(\n (\n {\n onSubmit,\n schema,\n formMode = 'native',\n errors: externalErrors,\n focusOnError = true,\n errorSummary = defaultErrorSummary,\n children,\n className,\n noValidate,\n ...props\n },\n ref,\n ) => {\n const [errors, setErrors] = React.useState<Record<string, string>>({});\n const [touched, setTouched] = React.useState<Record<string, boolean>>({});\n const [isSubmitting, setIsSubmitting] = React.useState(false);\n const [errorVersion, setErrorVersion] = React.useState(0);\n const [announcement, setAnnouncement] = React.useState('');\n\n const innerRef = React.useRef<HTMLFormElement>(null);\n React.useImperativeHandle(ref, () => innerRef.current as HTMLFormElement);\n\n const setFieldError = React.useCallback((name: string, error: string) => {\n setErrors((prev) => ({ ...prev, [name]: error }));\n }, []);\n\n const clearFieldError = React.useCallback((name: string) => {\n setErrors((prev) => {\n const next = { ...prev };\n delete next[name];\n return next;\n });\n }, []);\n\n const setFieldTouched = React.useCallback((name: string) => {\n setTouched((prev) => ({ ...prev, [name]: true }));\n }, []);\n\n const handleSubmit = React.useCallback(\n async (e: React.SyntheticEvent<HTMLFormElement>) => {\n e.preventDefault();\n setIsSubmitting(true);\n setErrors({});\n\n const formData = new FormData(e.currentTarget);\n\n // Repeated names collapse into an array rather than overwriting each\n // other. See {@link FormData_}.\n const data: FormData_ = {};\n for (const key of Array.from(new Set(formData.keys()))) {\n const values = formData.getAll(key);\n data[key] = values.length > 1 ? values : values[0];\n }\n\n if (schema) {\n try {\n schema.parse(data);\n } catch (err) {\n const zodError = err as ZodError;\n const fieldErrors: Record<string, string> = {};\n for (const issue of zodError.issues) {\n const path = issue.path.join('.');\n if (!fieldErrors[path]) {\n fieldErrors[path] = issue.message;\n }\n }\n setErrors(fieldErrors);\n setErrorVersion((v) => v + 1);\n setAnnouncement(errorSummary(Object.keys(fieldErrors).length));\n setIsSubmitting(false);\n return;\n }\n }\n\n setAnnouncement('');\n\n try {\n await onSubmit?.(data);\n } finally {\n setIsSubmitting(false);\n }\n },\n [onSubmit, schema, errorSummary],\n );\n\n // Runs after the errors have been committed to the DOM, which is what makes\n // the `[aria-invalid=\"true\"]` query find anything.\n React.useEffect(() => {\n if (!focusOnError || errorVersion === 0) return;\n const form = innerRef.current;\n if (form) focusFirstInvalid(form);\n }, [errorVersion, focusOnError]);\n\n const mergedErrors = React.useMemo(\n () => ({ ...externalErrors, ...errors }),\n [externalErrors, errors],\n );\n\n const contextValue = React.useMemo(\n () => ({\n errors: mergedErrors,\n touched,\n setFieldError,\n clearFieldError,\n setFieldTouched,\n isSubmitting,\n formMode,\n errorVersion,\n }),\n [\n mergedErrors,\n touched,\n setFieldError,\n clearFieldError,\n setFieldTouched,\n isSubmitting,\n formMode,\n errorVersion,\n ],\n );\n\n return (\n <FormContext.Provider value={contextValue}>\n <form\n ref={innerRef}\n onSubmit={handleSubmit}\n className={className}\n // With a schema in play the browser's own bubbles would fire first and\n // pre-empt it, giving two validation systems with different wording and\n // only one of them wired to the field's `aria-describedby`.\n noValidate={noValidate ?? Boolean(schema)}\n {...props}\n >\n {children}\n {/*\n The live region is mounted unconditionally and stays mounted —\n a region inserted at the same moment as its content is routinely\n missed. Only the inner node is replaced, keyed on errorVersion so\n an identical resubmit still reads out.\n\n Polite rather than assertive: focus is already moving to the first\n invalid control, and an assertive region would talk over the field\n announcement that focus triggers.\n */}\n <div\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className=\"sr-only\"\n data-slot=\"form-status\"\n >\n {announcement ? <span key={errorVersion}>{announcement}</span> : null}\n </div>\n </form>\n </FormContext.Provider>\n );\n },\n);\nForm.displayName = 'Form';\n","'use client';\n\nimport * as React from 'react';\n\n/**\n * The channel between a field wrapper and the control nested inside it.\n *\n * `FormField`, `InputGroup` and `OutlinedField` all render a label, an optional\n * hint and an optional error around an arbitrary child. Before this context\n * they had no way to reach that child, so the error text was rendered as a bare\n * `<p>` that nothing pointed at: no `aria-describedby`, no `aria-invalid`, no\n * `aria-required`. The label leaned on `htmlFor={name}` and simply hoped the\n * consumer had set a matching `id` — when they hadn't, the label resolved to\n * nothing at all (WCAG 1.3.1 and 4.1.2, and axe's `label` rule fires).\n *\n * A wrapper now publishes this context and every control calls\n * {@link useFieldControl} to wire itself. The important property is that the\n * context is OPTIONAL: outside a wrapper the hook returns the control's own\n * props untouched, so a bare `<Input />` behaves exactly as it always has.\n */\nexport interface FieldContextValue {\n /**\n * `id` the control should adopt. Derived from the wrapper's `name` /\n * `htmlFor` rather than `useId()` so it stays the value the wrapper's own\n * `htmlFor` already points at, and so consumers who set `id={name}` by hand\n * land on the same string instead of fighting it.\n */\n controlId: string;\n /** `id` of the hint paragraph, when one is rendered. */\n descriptionId?: string;\n /** `id` of the error paragraph, when one is rendered. */\n errorId?: string;\n /**\n * `id` of the label element. Composite controls need it: a `<label for>`\n * cannot name a `<div>`, so `TimePicker` and `CodeInput` point at it with\n * `aria-labelledby` instead. See {@link useFieldGroup}.\n */\n labelId?: string;\n /** Whether the field is currently in an error state. */\n invalid: boolean;\n /** Whether the field is required. */\n required: boolean;\n /**\n * True when the wrapper labels a SET of controls (a checkbox or radio group)\n * rather than a single one. Controls must not adopt the field's ids in this\n * mode — five checkboxes sharing one `id` is worse than none — so\n * {@link useFieldControl} becomes a no-op and the group element itself\n * carries the labelling.\n */\n group: boolean;\n}\n\nconst FieldContext = React.createContext<FieldContextValue | undefined>(\n undefined,\n);\n\nexport const FieldProvider = FieldContext.Provider;\n\n/** Read the surrounding field, if there is one. */\nexport function useField(): FieldContextValue | undefined {\n return React.useContext(FieldContext);\n}\n\n/** The ARIA surface a control exposes to its field wrapper. */\nexport interface FieldControlProps {\n id?: string;\n 'aria-describedby'?: string;\n 'aria-invalid'?: React.AriaAttributes['aria-invalid'];\n 'aria-required'?: React.AriaAttributes['aria-required'];\n}\n\n/**\n * Merge the surrounding field's ARIA wiring into a control's own props.\n *\n * Call it in every control that accepts user input and spread the result onto\n * the DOM node.\n *\n * Inside a field the wrapper OWNS the control's `id`, and a consumer-supplied\n * one is deliberately overridden. The wrapper has already rendered its\n * `<label for>` pointing at the id it published, and it cannot see the child's\n * props to follow it anywhere else — so honouring an override here would leave\n * the label resolving to nothing, which is precisely the defect this context\n * exists to remove. Set the id through the wrapper's `name` / `htmlFor`\n * instead. `aria-invalid` and `aria-required` do defer to an explicit prop,\n * and the field's description ids are APPENDED to any `aria-describedby` the\n * consumer set rather than replacing it.\n *\n * Returns `props` unchanged when there is no field, or when the field is a\n * group.\n */\nexport function useFieldControl<T extends FieldControlProps>(props: T): T {\n const field = useField();\n\n if (!field || field.group) return props;\n\n const describedBy = [\n field.descriptionId,\n field.errorId,\n props['aria-describedby'],\n ]\n .filter(Boolean)\n .join(' ');\n\n return {\n ...props,\n id: field.controlId,\n // Omitted rather than set to \"false\" when the field is valid: an explicit\n // `aria-invalid=\"false\"` is noise on every untouched control on the page.\n 'aria-invalid': props['aria-invalid'] ?? (field.invalid || undefined),\n 'aria-required': props['aria-required'] ?? (field.required || undefined),\n 'aria-describedby': describedBy || undefined,\n };\n}\n\n/** The ARIA surface a COMPOSITE control exposes to its field wrapper. */\nexport interface FieldGroupProps {\n role?: 'group';\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n 'aria-invalid'?: React.AriaAttributes['aria-invalid'];\n 'aria-required'?: React.AriaAttributes['aria-required'];\n}\n\n/**\n * The composite-control counterpart to {@link useFieldControl}.\n *\n * `TimePicker` is three selects and `CodeInput` is six inputs; neither has a\n * single element for the field's label to point at, and a `<label for>` naming\n * a `<div>` names nothing at all. These wrap their children in a labelled\n * `role=\"group\"` instead, so the whole composite is announced once with its\n * error and hint attached.\n *\n * Returns `{}` outside a field wrapper, leaving standalone usage untouched.\n */\nexport function useFieldGroup(): FieldGroupProps {\n const field = useField();\n if (!field) return {};\n\n const describedBy = [field.descriptionId, field.errorId]\n .filter(Boolean)\n .join(' ');\n\n return {\n role: 'group',\n 'aria-labelledby': field.labelId,\n 'aria-describedby': describedBy || undefined,\n 'aria-invalid': field.invalid || undefined,\n 'aria-required': field.required || undefined,\n };\n}\n\n/**\n * Seals a composite control against the field it sits in.\n *\n * `CodeInput` renders six `<Input>`s and `TimePicker` renders three\n * `<SelectTrigger>`s. Each of those calls {@link useFieldControl}, so without\n * this they would every one of them adopt the SAME field id — six elements\n * sharing `id=\"code\"`, which is worse than the missing wiring this whole\n * mechanism set out to fix. Re-providing the field in group mode turns the\n * hook into a no-op for everything below, leaving the composite's own wrapper\n * ({@link useFieldGroup}) as the single labelled thing.\n */\nexport function FieldGroupScope({ children }: { children: React.ReactNode }) {\n const field = useField();\n const scoped = React.useMemo(\n () => (field ? { ...field, group: true } : undefined),\n [field],\n );\n return <FieldProvider value={scoped}>{children}</FieldProvider>;\n}\n\n/**\n * Build the ids a wrapper publishes.\n *\n * `useId()` supplies the hint/error ids because nothing outside the wrapper\n * references them, so uniqueness costs nothing. The control id stays\n * caller-derived — see {@link FieldContextValue.controlId}.\n */\nexport function useFieldIds({\n controlId,\n hasDescription,\n hasError,\n}: {\n controlId: string;\n hasDescription: boolean;\n hasError: boolean;\n}) {\n const reactId = React.useId();\n return {\n controlId,\n descriptionId: hasDescription ? `${reactId}-description` : undefined,\n errorId: hasError ? `${reactId}-error` : undefined,\n labelId: `${reactId}-label`,\n };\n}\n","'use client';\n\nimport { motion } from 'motion/react';\nimport * as React from 'react';\nimport { cn } from '../lib/utils';\nimport { FieldProvider, useFieldIds } from '../form/field-context';\n\n/**\n * Strips border / ring from nested form controls so the outer outlined shell\n * owns the chrome. Targets inputs, textareas, and select triggers (buttons).\n */\nexport const outlinedFieldNestResetClasses = cn(\n '[&_input]:!h-full [&_input]:min-h-0 [&_input]:border-0 [&_input]:bg-transparent [&_input]:shadow-none',\n '[&_input]:focus-visible:ring-0 [&_input]:focus-visible:ring-offset-0',\n '[&_textarea]:box-border [&_textarea]:min-h-[72px] [&_textarea]:h-auto [&_textarea]:!h-auto [&_textarea]:flex-1 [&_textarea]:resize-y',\n '[&_textarea]:border-0 [&_textarea]:bg-transparent [&_textarea]:shadow-none',\n '[&_textarea]:focus-visible:ring-0 [&_textarea]:focus-visible:ring-offset-0',\n '[&_button]:h-full [&_button]:min-h-0 [&_button]:border-0 [&_button]:bg-transparent [&_button]:shadow-none',\n '[&_button]:focus-visible:ring-0 [&_button]:focus-visible:ring-offset-0',\n);\n\nexport interface OutlinedFieldProps {\n /** Field label; shown on the top border (Material-style notch). */\n label: React.ReactNode;\n /** Associates the label with the control (`htmlFor` on the notch label). */\n htmlFor?: string;\n /** Validation error shown below the field. */\n error?: string;\n /**\n * Bumped by the parent `Form` on each failed submit so the error shake\n * replays even when the error text is unchanged. Optional for standalone use.\n */\n errorVersion?: number;\n /** Helper text below the field (hidden when `error` is set). */\n hint?: string;\n /** Renders a required indicator next to the label. */\n required?: boolean;\n className?: string;\n /** The control (Input, PhoneInput, Textarea, SelectTrigger, PasswordInput, etc.). */\n children: React.ReactNode;\n}\n\ntype ControlKind = 'input' | 'textarea' | 'other';\n\nfunction readValueFromShell(shell: HTMLElement): boolean {\n const input = shell.querySelector('input');\n const textarea = shell.querySelector('textarea');\n const el = textarea ?? input;\n if (el) return Boolean((el as HTMLInputElement).value);\n return true;\n}\n\nfunction detectControlKind(shell: HTMLElement): ControlKind {\n if (shell.querySelector('textarea')) return 'textarea';\n if (shell.querySelector('input')) return 'input';\n return 'other';\n}\n\nconst OutlinedField = React.forwardRef<HTMLDivElement, OutlinedFieldProps>(\n ({ label, htmlFor, error, errorVersion = 0, hint, required, className, children }, ref) => {\n const fallbackId = React.useId();\n const controlId = htmlFor ?? `${fallbackId}-control`;\n\n const { descriptionId, errorId, labelId } = useFieldIds({\n controlId,\n hasDescription: Boolean(hint) && !error,\n hasError: Boolean(error),\n });\n\n const field = React.useMemo(\n () => ({\n controlId,\n descriptionId,\n errorId,\n labelId,\n invalid: Boolean(error),\n required: Boolean(required),\n group: false,\n }),\n [controlId, descriptionId, errorId, labelId, error, required],\n );\n\n const shellRef = React.useRef<HTMLDivElement>(null);\n const [focused, setFocused] = React.useState(false);\n const [hasValue, setHasValue] = React.useState(false);\n const [controlKind, setControlKind] = React.useState<ControlKind>('input');\n\n const syncFromDom = React.useCallback(() => {\n const shell = shellRef.current;\n if (!shell) return;\n setControlKind(detectControlKind(shell));\n setHasValue(readValueFromShell(shell));\n }, []);\n\n React.useLayoutEffect(() => {\n syncFromDom();\n }, [children, syncFromDom]);\n\n React.useEffect(() => {\n const shell = shellRef.current;\n if (!shell) return;\n\n const onFocusIn = () => setFocused(true);\n const onFocusOut = (ev: FocusEvent) => {\n if (!shell.contains(ev.relatedTarget as Node)) {\n setFocused(false);\n syncFromDom();\n }\n };\n\n shell.addEventListener('focusin', onFocusIn);\n shell.addEventListener('focusout', onFocusOut);\n return () => {\n shell.removeEventListener('focusin', onFocusIn);\n shell.removeEventListener('focusout', onFocusOut);\n };\n }, [syncFromDom]);\n\n // Replay the error shake on each failed submit (errorVersion bumps even\n // when the error text is unchanged).\n React.useEffect(() => {\n const el = shellRef.current;\n if (!el || !error) return;\n el.style.animation = 'none';\n void el.offsetWidth;\n el.style.animation = '';\n }, [errorVersion, error]);\n\n const isFloated = controlKind === 'other' ? true : focused || hasValue;\n\n const handleInputCapture = React.useCallback(\n (e: React.FormEvent<HTMLDivElement>) => {\n const t = e.target;\n if (t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement) {\n setHasValue(Boolean(t.value));\n }\n },\n [],\n );\n\n const isTextarea = controlKind === 'textarea';\n\n const labelAnimate =\n isTextarea && !isFloated\n ? { top: 20, left: 12, x: 0, y: 0 }\n : isFloated\n ? { top: 0, left: 10, x: 0, y: '-50%' }\n : { top: '50%', left: 12, x: 0, y: '-50%' };\n\n return (\n <FieldProvider value={field}>\n <div ref={ref} className={cn('flex flex-col gap-1.5', className)}>\n <div\n ref={shellRef}\n className={cn(\n 'group/outlined relative w-full min-w-0 rounded-md border border-input bg-background',\n 'ring-offset-background',\n 'focus-within:border-primary focus-within:ring-2 focus-within:ring-primary/30 focus-within:ring-offset-0',\n error && 'border-destructive bison-shake',\n outlinedFieldNestResetClasses,\n isTextarea\n ? 'flex min-h-[80px] flex-col py-2'\n : 'flex h-[var(--density-height-md)] items-stretch pointer-coarse:min-h-11',\n !isFloated &&\n !focused &&\n '[&_input]:placeholder:text-transparent [&_textarea]:placeholder:text-transparent',\n )}\n onInputCapture={handleInputCapture}\n >\n <motion.label\n id={labelId}\n htmlFor={controlId}\n className={cn(\n 'pointer-events-none absolute z-10 bg-background px-1 font-medium leading-none text-muted-foreground',\n isFloated ? 'text-xs' : 'text-base',\n focused && 'text-primary',\n )}\n style={{ transformOrigin: 'left center' }}\n initial={false}\n animate={labelAnimate}\n transition={{ type: 'spring', stiffness: 520, damping: 34 }}\n >\n {label}\n {/* Decoration only — `aria-required` on the control carries the\n meaning. See FormField for the reasoning. */}\n {required ? (\n <span aria-hidden=\"true\" className=\"ml-0.5 text-destructive\">\n *\n </span>\n ) : null}\n </motion.label>\n <div\n className={cn(\n 'box-border flex min-h-0 min-w-0 flex-1',\n isTextarea\n ? 'items-stretch pt-4 [&>*]:flex [&>*]:min-h-0 [&>*]:min-w-0 [&>*]:flex-1'\n : 'items-stretch [&>*]:min-h-0 [&>*]:min-w-0 [&>*]:flex-1',\n )}\n >\n {children}\n </div>\n </div>\n {error ? (\n <p id={errorId} className=\"text-sm leading-none text-destructive\">\n {error}\n </p>\n ) : null}\n {!error && hint ? (\n <p id={descriptionId} className=\"text-sm leading-none text-muted-foreground\">\n {hint}\n </p>\n ) : null}\n </div>\n </FieldProvider>\n );\n },\n);\nOutlinedField.displayName = 'OutlinedField';\n\nexport { OutlinedField };\n","'use client';\n\nimport * as React from 'react';\nimport { cn } from '../lib/utils';\nimport { OutlinedField } from '../components/outlined-field';\nimport { useFormContext } from './form';\nimport { FieldProvider, useFieldIds } from './field-context';\n\nexport interface FormFieldProps {\n name: string;\n label?: string;\n description?: string;\n required?: boolean;\n /**\n * `stack`: label above the control (default).\n * `outlined`: Material-style label on the top border (requires `label`).\n */\n labelLayout?: 'stack' | 'outlined';\n /**\n * `field`: the wrapper labels ONE control (default).\n * `group`: it labels a SET of them — a checkbox or radio group.\n *\n * A `<label for>` can only point at a single form control, so a stack of\n * checkboxes under a plain label has no programmatic name at all\n * (WCAG 1.3.1). Group mode renders a real `<fieldset>` / `<legend>` instead\n * and moves the ARIA wiring onto it, leaving the individual controls to keep\n * their own ids and labels.\n *\n * Group mode always renders stacked; `labelLayout=\"outlined\"` is ignored,\n * because a floating notch label over a set of checkboxes describes nothing.\n */\n as?: 'field' | 'group';\n className?: string;\n children: React.ReactNode;\n}\n\nexport function FormField({\n name,\n label,\n description,\n required,\n labelLayout = 'stack',\n as = 'field',\n className,\n children,\n}: FormFieldProps) {\n const formCtx = useFormContext();\n const errorMessage = formCtx?.errors[name];\n const errorVersion = formCtx?.errorVersion ?? 0;\n const wrapRef = React.useRef<HTMLDivElement>(null);\n\n const { controlId, descriptionId, errorId, labelId } = useFieldIds({\n controlId: name,\n hasDescription: Boolean(description) && !errorMessage,\n hasError: Boolean(errorMessage),\n });\n\n const isGroup = as === 'group';\n\n const field = React.useMemo(\n () => ({\n controlId,\n descriptionId,\n errorId,\n labelId: label ? labelId : undefined,\n invalid: Boolean(errorMessage),\n required: Boolean(required),\n group: isGroup,\n }),\n [\n controlId,\n descriptionId,\n errorId,\n labelId,\n label,\n errorMessage,\n required,\n isGroup,\n ],\n );\n\n // Replay the error shake on every failed submit. Error strings don't change\n // between identical resubmits, so toggling the CSS class alone wouldn't\n // re-trigger the animation — restart it imperatively when errorVersion bumps.\n React.useEffect(() => {\n const el = wrapRef.current;\n if (!el || !errorMessage) return;\n el.style.animation = 'none';\n void el.offsetWidth;\n el.style.animation = '';\n }, [errorVersion, errorMessage]);\n\n if (!isGroup && label && labelLayout === 'outlined') {\n return (\n <OutlinedField\n label={label}\n htmlFor={name}\n required={required}\n error={errorMessage}\n errorVersion={errorVersion}\n hint={description}\n className={className}\n >\n {children}\n </OutlinedField>\n );\n }\n\n const describedBy =\n [descriptionId, errorId].filter(Boolean).join(' ') || undefined;\n\n const messages = (\n <>\n {description && !errorMessage && (\n <p\n id={descriptionId}\n className=\"mt-1.5 text-sm leading-none text-muted-foreground\"\n >\n {description}\n </p>\n )}\n {errorMessage && (\n <p id={errorId} className=\"mt-1.5 text-sm leading-none text-destructive\">\n {errorMessage}\n </p>\n )}\n </>\n );\n\n // The asterisk is decoration. `aria-required` on the control (or the group)\n // is what actually conveys the requirement — before this, a screen reader\n // either read \"star\" or skipped it entirely (WCAG 3.3.2).\n const requiredMark = required ? (\n <span aria-hidden=\"true\" className=\"text-destructive ml-1\">\n *\n </span>\n ) : null;\n\n if (isGroup) {\n return (\n <FieldProvider value={field}>\n <fieldset\n ref={wrapRef as unknown as React.Ref<HTMLFieldSetElement>}\n className={cn(\n 'flex flex-col',\n errorMessage && 'bison-shake',\n className,\n )}\n aria-describedby={describedBy}\n aria-invalid={errorMessage ? true : undefined}\n aria-required={required || undefined}\n >\n {label && (\n <legend id={labelId} className=\"mb-1.5 text-sm font-medium leading-none\">\n {label}\n {requiredMark}\n </legend>\n )}\n {children}\n {messages}\n </fieldset>\n </FieldProvider>\n );\n }\n\n return (\n <FieldProvider value={field}>\n <div\n ref={wrapRef}\n className={cn('flex flex-col', errorMessage && 'bison-shake', className)}\n >\n {label && (\n <label\n id={labelId}\n htmlFor={controlId}\n className=\"mb-1.5 text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n >\n {label}\n {requiredMark}\n </label>\n )}\n {children}\n {messages}\n </div>\n </FieldProvider>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../lib/utils\";\n\nexport interface FormErrorProps {\n message?: string;\n className?: string;\n}\n\nexport function FormError({ message, className }: FormErrorProps) {\n if (!message) return null;\n\n return (\n <div\n className={cn(\n \"rounded-md border border-destructive/50 bg-destructive/10 px-4 py-3 text-sm text-destructive\",\n className\n )}\n role=\"alert\"\n >\n {message}\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Slot as SlotPrimitive } from \"radix-ui\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { LoaderCircle } from \"lucide-react\";\nimport {\n actionNegativeToneClasses,\n actionNeutralToneClasses,\n actionPositiveToneClasses,\n} from \"../lib/semantic-action-tones\";\nimport { cn } from \"../lib/utils\";\n\nconst buttonVariants = cva(\n // pointer-coarse:min-h-11/min-w-11 enforce a 44px minimum tap target on touch\n // devices (WCAG 2.5.5) without altering the visual density-driven height on\n // fine (mouse) pointers, so desktop sizing and form-control alignment are\n // unchanged. Applies across every size and the icon button.\n \"relative inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-[color,background-color,border-color,box-shadow] duration-fast ease-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 cursor-pointer pointer-coarse:min-h-11 pointer-coarse:min-w-11\",\n {\n variants: {\n variant: {\n default:\n \"bg-primary text-primary-foreground hover:bg-primary-700 hover:shadow-md\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary-700 hover:shadow-md\",\n accent:\n \"bg-brand-accent text-brand-accent-foreground hover:bg-brand-accent-600 hover:shadow-md\",\n highlight:\n \"bg-highlight text-highlight-foreground hover:bg-highlight-600 hover:shadow-md\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive-700 hover:shadow-md\",\n outline:\n \"border border-border-strong bg-background text-foreground hover:bg-accent hover:text-accent-foreground hover:shadow-sm\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n /** Soft neutral tile (edit / secondary icon actions). */\n actionNeutral: actionNeutralToneClasses,\n /** Soft success tint + strong success icon (inline confirm, row actions). */\n actionPositive: actionPositiveToneClasses,\n /** Soft danger tint + strong destructive icon (inline cancel, row delete). */\n actionNegative: actionNegativeToneClasses,\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n sm: \"h-[var(--density-height-sm)] px-3 text-xs\",\n md: \"h-[var(--density-height-md)] px-4 py-2\",\n lg: \"h-[var(--density-height-lg)] px-8 text-base rounded-lg\",\n icon: \"h-[var(--density-height-md)] w-[var(--density-height-md)]\",\n },\n fullWidth: {\n true: \"w-full\",\n false: \"\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n fullWidth: false,\n },\n },\n);\n\nexport interface ButtonProps\n extends\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n /**\n * When true, replaces the button's content with a centered spinner while\n * preserving the button's original width. The button is also disabled and\n * marked `aria-busy` for assistive tech. Ignored when `asChild` is set,\n * since Slot requires a single child.\n */\n loading?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n fullWidth,\n asChild = false,\n loading = false,\n disabled,\n children,\n ...props\n },\n ref,\n ) => {\n const Comp = asChild ? SlotPrimitive.Slot : \"button\";\n\n if (asChild) {\n return (\n <Comp\n className={cn(\n buttonVariants({ variant, size, fullWidth, className }),\n )}\n ref={ref}\n aria-busy={loading || undefined}\n {...props}\n >\n {children}\n </Comp>\n );\n }\n\n const spinnerSizeClass =\n size === \"sm\" ? \"h-3 w-3\" : size === \"lg\" ? \"h-5 w-5\" : \"h-4 w-4\";\n\n return (\n <button\n className={cn(buttonVariants({ variant, size, fullWidth, className }))}\n ref={ref}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n data-loading={loading || undefined}\n {...props}\n >\n {loading ? (\n <>\n <span className=\"invisible inline-flex items-center justify-center\">\n {children}\n </span>\n <span\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-0 flex items-center justify-center\"\n >\n <LoaderCircle\n className={cn(\"animate-spin\", spinnerSizeClass)}\n />\n </span>\n </>\n ) : (\n children\n )}\n </button>\n );\n },\n);\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\n","/**\n * Shared surface class strings extracted to a single source of truth.\n *\n * These patterns appear in multiple components that must stay in lockstep\n * visually (same border, same focus ring, same scrim, etc.). When any of\n * these visuals change, update here once — every consumer tracks.\n *\n * See components: input, textarea, password-input, currency-input,\n * select, dropdown-menu, context-menu, command, dialog, alert-dialog,\n * sheet, popover, tooltip.\n */\n\n// ─── Input family ──────────────────────────────────────────────────────────\n\n/**\n * Common chrome for form input surfaces: border, background, ring-offset,\n * placeholder color, disabled state. Does NOT include sizing or focus —\n * consumers add `inputSizingClasses` (or their own) + `inputFocusClasses`.\n *\n * Used by: Input, Textarea, PasswordInput, CurrencyInput, Select Trigger,\n * DatePicker trigger, DateRangePicker trigger.\n */\nexport const inputSurfaceClasses =\n 'flex w-full rounded-md border border-input bg-background text-base sm:text-sm ring-offset-background placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50';\n\n/**\n * Focus-visible ring for input surfaces. Keyboard focus only (`focus-visible`)\n * so mouse clicks don't show the ring — matches WAI-ARIA expectations.\n */\nexport const inputFocusClasses =\n 'focus-visible:outline-none focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/30 focus-visible:ring-offset-0';\n\nexport type InputSize = 'sm' | 'md' | 'lg';\n\n/**\n * Standard single-line input sizing per size: density height + horizontal\n * padding + vertical padding, scaled per size. Textarea uses `min-h-[80px]`\n * instead of any of these.\n *\n * `pointer-coarse:min-h-11` floors the height at 44px on touch pointers on\n * every size, matching the Button primitive (and Button-based DatePicker /\n * DateRangePicker triggers) so inputs, selects, and buttons stay the same\n * height when combined in a form. Fine (mouse) pointers keep the exact\n * density height for the chosen size.\n *\n * `'md'` (the default) is byte-identical to the original fixed sizing this\n * function replaced — every existing caller passes `'md'` explicitly and\n * renders unchanged.\n */\nconst inputSizingClassesBySize: Record<InputSize, string> = {\n sm: 'h-[var(--density-height-sm)] px-3 py-1 text-sm pointer-coarse:min-h-11',\n md: 'h-[var(--density-height-md)] px-3 py-2 pointer-coarse:min-h-11',\n lg: 'h-[var(--density-height-lg)] px-3 py-2.5 text-base pointer-coarse:min-h-11',\n};\n\nexport function inputSizingClasses(size: InputSize = 'md'): string {\n return inputSizingClassesBySize[size];\n}\n\n// ─── Touch targets ─────────────────────────────────────────────────────────\n\n/**\n * Minimum 44px tap target on touch (coarse) pointers, applied to the element\n * itself. For standalone icon buttons that can safely grow their box on touch\n * without crowding neighbors (e.g. Dialog / Sheet close). Pair with\n * `inline-flex items-center justify-center` to keep the glyph centered. Fine\n * (mouse) pointers are unchanged, so desktop chrome is pixel-identical. Mirrors\n * the Button primitive's own coarse-pointer floor (WCAG 2.5.5).\n *\n * Used by: Dialog Close, Sheet Close.\n */\nexport const touchTargetClasses = 'pointer-coarse:min-h-11 pointer-coarse:min-w-11';\n\n/**\n * Expanded 44px tap target for small controls whose *visual* size must stay\n * fixed (a 44px checkbox would look broken). Renders a centered, transparent\n * 44px pseudo-element that captures pointer events on touch (coarse) pointers\n * only, so the drawn control is unchanged on every pointer and desktop layouts\n * (dense tables, tight forms) stay pixel-identical. Includes `relative`; the\n * host element must not be `overflow-hidden` or the pseudo is clipped.\n *\n * Used by: Checkbox, Radio, Switch, Slider thumb.\n */\nexport const coarseHitAreaClasses =\n \"relative before:absolute before:left-1/2 before:top-1/2 before:hidden before:size-11 before:-translate-x-1/2 before:-translate-y-1/2 before:content-[''] pointer-coarse:before:block\";\n\n// ─── Menu / popover surfaces ───────────────────────────────────────────────\n\n/**\n * Menu surface chrome shared by floating menus and popovers:\n * Select Content, DropdownMenu Content, ContextMenu Content, Command.\n *\n * Uses `--z-dropdown` (500 after z-index refactor) so menus open *above*\n * modals they're triggered from — critical for Select inside a Dialog, etc.\n */\nexport const menuSurfaceClasses =\n 'z-[var(--z-dropdown)] min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md';\n\n/**\n * Base menu item: focus styling, disabled state, selection-ready.\n * Used by: Select Item, DropdownMenu Item, ContextMenu Item, Command Item.\n */\nexport const menuItemClasses =\n 'relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:cursor-default';\n\n/**\n * Menu item variant with indicator gutter on the left (for checkbox/radio\n * indicators on Select, DropdownMenu, ContextMenu).\n */\nexport const menuItemWithIndicatorClasses =\n 'relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:cursor-default';\n\n/**\n * Menu separator: horizontal rule sitting between menu groups.\n */\nexport const menuSeparatorClasses = '-mx-1 my-1 h-px bg-muted';\n\n// ─── Floating animations ───────────────────────────────────────────────────\n\n/**\n * transitions.dev \"menu dropdown\" (05): scale-pop + fade from the Radix\n * popper transform-origin, with distinct open/close timing. Driven by the\n * --dropdown-* tokens. Used by Select Content, DropdownMenu Content,\n * ContextMenu Content, Popover Content, Command popovers. Tooltip has its\n * own faster, subtler timing — see `tooltipAnimationClasses`.\n */\nexport const floatingAnimationClasses =\n 'origin-[var(--radix-popper-transform-origin)] data-[state=open]:bison-pop-in data-[state=closed]:bison-pop-out';\n\n/**\n * transitions.dev \"tooltip\" (17): faster scale-pop driven by the --tt-*\n * tokens. Used by Tooltip Content. NB: Radix Tooltip's open state is\n * `delayed-open` / `instant-open` (not `open` like other overlays), so the\n * enter animation keys off both.\n */\nexport const tooltipAnimationClasses =\n 'origin-[var(--radix-popper-transform-origin)] data-[state=delayed-open]:bison-tooltip-in data-[state=instant-open]:bison-tooltip-in data-[state=closed]:bison-tooltip-out';\n\n// ─── Modal / overlay ───────────────────────────────────────────────────────\n\n/**\n * Scrim (backdrop) shared by Dialog, AlertDialog, Sheet.\n */\nexport const overlayScrimClasses =\n 'fixed inset-0 z-[var(--z-modal-backdrop)] bg-black/80 data-[state=open]:bison-scrim-in data-[state=closed]:bison-scrim-out';\n\n/**\n * Centered modal content positioning + chrome (Dialog, AlertDialog).\n * Sheet has its own side-anchored variants in `sheet.tsx`.\n */\nexport const centeredModalContentClasses =\n 'fixed left-[50%] top-[50%] z-[var(--z-modal)] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg rounded-lg data-[state=open]:bison-modal-in data-[state=closed]:bison-modal-out';\n","'use client';\n\nimport * as React from 'react';\nimport { cn } from '../lib/utils';\nimport {\n inputFocusClasses,\n inputSizingClasses,\n inputSurfaceClasses,\n} from '../lib/surface-classes';\nimport { useFieldControl } from '../form/field-context';\n\nexport interface InputProps\n extends React.InputHTMLAttributes<HTMLInputElement> {}\n\nconst Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ className, type, ...props }, ref) => {\n // Adopts the surrounding field's id and ARIA wiring; a no-op outside one.\n // PhoneInput and CurrencyInput inherit this by rendering through Input.\n const fieldProps = useFieldControl(props);\n\n return (\n <input\n type={type}\n className={cn(\n inputSurfaceClasses,\n inputSizingClasses('md'),\n inputFocusClasses,\n 'file:border-0 file:bg-transparent file:text-base file:font-medium sm:file:text-sm',\n className,\n )}\n ref={ref}\n {...fieldProps}\n />\n );\n },\n);\nInput.displayName = 'Input';\n\nexport { Input };\n","'use client';\n\nimport * as React from 'react';\nimport { unstable_PasswordToggleField as PasswordToggleField } from 'radix-ui';\nimport { Eye, EyeOff } from 'lucide-react';\nimport { cn } from '../lib/utils';\nimport {\n inputFocusClasses,\n inputSizingClasses,\n inputSurfaceClasses,\n} from '../lib/surface-classes';\nimport { useFieldControl } from '../form/field-context';\n\nexport interface PasswordInputProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof PasswordToggleField.Input>,\n 'type'\n > {\n /**\n * Accessible name for the show/hide control.\n *\n * The toggle is icon-only, and Radix supplies no name of its own, so without\n * this it reaches a screen reader as an unlabelled button (WCAG 4.1.2). The\n * wording covers both states deliberately: the button's own pressed state is\n * what conveys which way it is currently set.\n */\n toggleLabel?: string;\n}\n\nconst PasswordInput = React.forwardRef<HTMLInputElement, PasswordInputProps>(\n ({ className, toggleLabel = 'Show or hide password', ...props }, ref) => {\n // Adopts the surrounding field's id and ARIA wiring; a no-op outside one.\n const fieldProps = useFieldControl(props);\n\n return (\n <PasswordToggleField.Root>\n <div className=\"relative\">\n <PasswordToggleField.Input\n className={cn(\n inputSurfaceClasses,\n inputSizingClasses('md'),\n inputFocusClasses,\n 'pr-10 file:border-0 file:bg-transparent file:text-base file:font-medium sm:file:text-sm',\n className,\n )}\n ref={ref}\n {...fieldProps}\n />\n <PasswordToggleField.Toggle\n className=\"absolute right-0 top-0 flex h-full w-10 items-center justify-center text-muted-foreground hover:text-foreground transition-colors disabled:pointer-events-none disabled:opacity-50\"\n disabled={props.disabled}\n aria-label={toggleLabel}\n >\n <PasswordToggleField.Icon\n visible={<EyeOff className=\"h-4 w-4\" />}\n hidden={<Eye className=\"h-4 w-4\" />}\n />\n </PasswordToggleField.Toggle>\n </div>\n </PasswordToggleField.Root>\n );\n },\n);\nPasswordInput.displayName = 'PasswordInput';\n\nexport { PasswordInput };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../lib/utils\";\nimport { Input } from \"./input\";\nimport { FieldGroupScope, useFieldGroup } from \"../form/field-context\";\n\nexport interface CodeInputProps {\n /** Number of digits. @default 6 */\n length?: number;\n /**\n * Accessible name for each box, given its 1-based position and the total.\n *\n * The boxes are unlabelled digits — without a name each one reaches a screen\n * reader as a bare \"edit text\" and there is no way to tell which of the six\n * you are in (WCAG 4.1.2, and 2.4.6 once you are lost in the middle).\n */\n digitLabel?: (position: number, total: number) => string;\n /** Called with the full code string when all digits are filled. */\n onComplete?: (code: string) => void;\n /** Called on every change with the current partial/full code string. */\n onChange?: (code: string) => void;\n loading?: boolean;\n disabled?: boolean;\n className?: string;\n}\n\nconst CodeInput = React.forwardRef<HTMLDivElement, CodeInputProps>(\n (\n {\n length = 6,\n onComplete,\n onChange,\n loading = false,\n disabled = false,\n className,\n digitLabel = (position, total) => `Digit ${position} of ${total}`,\n },\n ref,\n ) => {\n const groupProps = useFieldGroup();\n const [code, setCode] = React.useState<string[]>(Array(length).fill(\"\"));\n const inputRefs = React.useRef<(HTMLInputElement | null)[]>([]);\n\n const updateCode = React.useCallback(\n (newCode: string[]) => {\n setCode(newCode);\n const joined = newCode.join(\"\");\n onChange?.(joined);\n if (joined.length === length && newCode.every(Boolean)) {\n onComplete?.(joined);\n }\n },\n [length, onChange, onComplete],\n );\n\n const handleChange = React.useCallback(\n (index: number, value: string) => {\n if (!/^\\d*$/.test(value)) return;\n const newCode = [...code];\n newCode[index] = value.slice(-1);\n updateCode(newCode);\n\n if (value && index < length - 1) {\n inputRefs.current[index + 1]?.focus();\n }\n },\n [code, length, updateCode],\n );\n\n const handleKeyDown = React.useCallback(\n (index: number, e: React.KeyboardEvent) => {\n if (e.key === \"Backspace\" && !code[index] && index > 0) {\n inputRefs.current[index - 1]?.focus();\n }\n },\n [code],\n );\n\n const handlePaste = React.useCallback(\n (e: React.ClipboardEvent) => {\n e.preventDefault();\n const pasted = e.clipboardData\n .getData(\"text\")\n .replace(/\\D/g, \"\")\n .slice(0, length);\n const newCode = Array(length).fill(\"\") as string[];\n for (let i = 0; i < pasted.length; i++) {\n newCode[i] = pasted[i];\n }\n updateCode(newCode);\n if (pasted.length < length) {\n inputRefs.current[pasted.length]?.focus();\n }\n },\n [length, updateCode],\n );\n\n return (\n <div\n ref={ref}\n className={cn(\"flex justify-center gap-2\", className)}\n onPaste={handlePaste}\n {...groupProps}\n >\n <FieldGroupScope>\n {code.map((digit, index) => (\n <Input\n key={index}\n ref={(el) => {\n inputRefs.current[index] = el;\n }}\n type=\"text\"\n inputMode=\"numeric\"\n maxLength={1}\n value={digit}\n onChange={(e) => handleChange(index, e.target.value)}\n onKeyDown={(e) => handleKeyDown(index, e)}\n disabled={loading || disabled}\n className=\"h-12 w-12 text-center text-lg font-semibold\"\n autoFocus={index === 0}\n aria-label={digitLabel(index + 1, length)}\n />\n ))}\n </FieldGroupScope>\n </div>\n );\n },\n);\nCodeInput.displayName = \"CodeInput\";\n\nexport { CodeInput };\n","'use client';\n\nimport * as React from 'react';\nimport { cn } from '../lib/utils';\nimport {\n inputFocusClasses,\n inputSizingClasses,\n inputSurfaceClasses,\n} from '../lib/surface-classes';\nimport { useFieldControl } from '../form/field-context';\n\nexport interface CurrencyInputProps\n extends Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'type' | 'inputMode' | 'onChange' | 'value'\n > {\n /** Current value in cents (integer). */\n value: number;\n /** Called with the new value in cents */\n onChange: (cents: number) => void;\n /** Currency symbol displayed as a prefix. Defaults to \"$\" */\n symbol?: string;\n}\n\n/** Strips everything except digits and a single decimal point, limits to 2 decimal places. */\nfunction sanitize(raw: string): string {\n let cleaned = raw.replace(/[^\\d.]/g, '');\n const parts = cleaned.split('.');\n if (parts.length > 2) {\n cleaned = parts[0] + '.' + parts.slice(1).join('');\n }\n if (parts.length === 2 && parts[1].length > 2) {\n cleaned = parts[0] + '.' + parts[1].slice(0, 2);\n }\n return cleaned;\n}\n\n/** Converts a dollar string to cents: \"25\" → 2500, \"25.50\" → 2550 */\nfunction toCents(raw: string): number {\n if (!raw) return 0;\n const num = parseFloat(raw);\n if (isNaN(num) || num <= 0) return 0;\n return Math.round(num * 100);\n}\n\n/** Formats cents to a display string: 2500 → \"25.00\", 0 → \"\" */\nfunction fromCents(cents: number): string {\n if (cents <= 0) return '';\n return (cents / 100).toFixed(2);\n}\n\nconst CurrencyInput = React.forwardRef<HTMLInputElement, CurrencyInputProps>(\n ({ className, value, onChange, symbol = '$', ...props }, ref) => {\n // Adopts the surrounding field's id and ARIA wiring; a no-op outside one.\n const fieldProps = useFieldControl(props);\n const [display, setDisplay] = React.useState(() => fromCents(value));\n\n // Sync display when value changes externally (e.g. reset to 0)\n const prevValue = React.useRef(value);\n if (value !== prevValue.current) {\n prevValue.current = value;\n const expected = fromCents(value);\n // Only overwrite display if the external value actually changed meaning\n // (avoids fighting with the user's in-progress typing)\n if (toCents(display) !== value) {\n setDisplay(expected);\n }\n }\n\n function handleChange(e: React.ChangeEvent<HTMLInputElement>) {\n const cleaned = sanitize(e.target.value);\n setDisplay(cleaned);\n onChange(toCents(cleaned));\n }\n\n function handleBlur() {\n // Format to XX.00 on blur\n const cents = toCents(display);\n setDisplay(fromCents(cents));\n }\n\n return (\n <div className=\"relative\">\n <span\n className=\"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 select-none text-muted-foreground\"\n aria-hidden=\"true\"\n >\n {symbol}\n </span>\n <input\n ref={ref}\n type=\"text\"\n inputMode=\"decimal\"\n autoComplete=\"off\"\n value={display}\n onChange={handleChange}\n onBlur={handleBlur}\n className={cn(\n inputSurfaceClasses,\n inputSizingClasses('md'),\n inputFocusClasses,\n 'pl-7 pr-3 text-sm',\n className,\n )}\n {...fieldProps}\n />\n </div>\n );\n },\n);\nCurrencyInput.displayName = 'CurrencyInput';\n\nexport { CurrencyInput };\n","const PHONE_MAX_DIGITS = 10;\n\n/** Strips non-digits and caps at 10 (US NANP). */\nexport function parseUsPhoneDigits(value: string): string {\n return value.replace(/\\D/g, '').slice(0, PHONE_MAX_DIGITS);\n}\n\n/** Formats a phone value (digits, E.164, or any mixed string) as `(XXX) XXX-XXXX`. */\nexport function formatUsPhone(value: string): string {\n const d = parseUsPhoneDigits(value);\n if (d.length <= 3) return d;\n if (d.length <= 6) return `(${d.slice(0, 3)}) ${d.slice(3)}`;\n return `(${d.slice(0, 3)}) ${d.slice(3, 6)}-${d.slice(6)}`;\n}\n\n/**\n * Deliberately NOT a `'use client'` module, and deliberately not living in\n * `phone-input.tsx` any more.\n *\n * `validators.ts` needs `parseUsPhoneDigits`, and it is consumed from Server\n * Actions. Importing it from the component file dragged the whole client\n * component in behind it, and every output of the main entry carries a\n * `\"use client\"` banner — so calling the validator on the server failed with\n * \"Attempted to call … from the server but … is on the client\".\n *\n * Keep this file free of React, and free of imports from anything holding a\n * `'use client'` directive.\n */\n","'use client';\n\nimport * as React from 'react';\n\nimport { Input } from './input';\nimport { formatUsPhone, parseUsPhoneDigits } from '../lib/us-phone';\n\nconst PHONE_MAX_LENGTH = 14;\n\n// Re-exported so the public API is unchanged. The implementations moved to a\n// module with no `'use client'` directive so `validators.ts` can use them from\n// a Server Action — see lib/us-phone.ts.\nexport { formatUsPhone, parseUsPhoneDigits };\n\n/**\n * US phone field: shows `(555) 123-4567` while `value` / `onChange` use digits\n * only (`5551234567`), matching {@link CurrencyInput} (display vs semantic value).\n */\nexport interface PhoneInputProps\n extends Omit<\n React.ComponentPropsWithoutRef<typeof Input>,\n 'type' | 'inputMode' | 'maxLength' | 'value' | 'defaultValue' | 'onChange'\n > {\n /** Digits only, up to 10 characters. Use with `onChange` for controlled usage. */\n value?: string;\n /** Initial digits when uncontrolled. */\n defaultValue?: string;\n /** Called with digits-only value on each edit (empty string when cleared). */\n onChange?: (digits: string) => void;\n}\n\nconst PhoneInput = React.forwardRef<HTMLInputElement, PhoneInputProps>(\n function PhoneInput(\n {\n value: valueProp,\n defaultValue = '',\n onChange,\n autoComplete = 'tel',\n ...props\n },\n ref,\n ) {\n const isControlled = valueProp !== undefined;\n const [uncontrolledDigits, setUncontrolledDigits] = React.useState(() =>\n parseUsPhoneDigits(defaultValue),\n );\n\n const digits = isControlled\n ? parseUsPhoneDigits(valueProp ?? '')\n : uncontrolledDigits;\n\n const display = formatUsPhone(digits);\n\n function handleChange(event: React.ChangeEvent<HTMLInputElement>) {\n const next = parseUsPhoneDigits(event.target.value);\n if (!isControlled) {\n setUncontrolledDigits(next);\n }\n onChange?.(next);\n }\n\n return (\n <Input\n ref={ref}\n {...props}\n type=\"text\"\n inputMode=\"tel\"\n autoComplete={autoComplete}\n maxLength={PHONE_MAX_LENGTH}\n value={display}\n onChange={handleChange}\n />\n );\n },\n);\n\nPhoneInput.displayName = 'PhoneInput';\n\nexport { PhoneInput };\n","'use client';\n\nimport * as React from 'react';\nimport { Label as LabelPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../lib/utils';\n\nconst labelVariants = cva(\n 'inline-block text-sm font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70',\n {\n variants: {\n /** `stack`: label above a field (default). `inline`: beside checkbox, radio, switch. */\n layout: {\n stack: 'mb-2 leading-none',\n inline: 'mb-0 leading-snug',\n },\n },\n defaultVariants: {\n layout: 'stack',\n },\n },\n);\n\nconst Label = React.forwardRef<\n React.ComponentRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\n VariantProps<typeof labelVariants>\n>(({ className, layout, ...props }, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(labelVariants({ layout }), className)}\n {...props}\n />\n));\nLabel.displayName = LabelPrimitive.Root.displayName;\n\nexport { Label };\n","'use client';\n\nimport * as React from 'react';\nimport { cn } from '../lib/utils';\nimport { Label } from './label';\nimport { OutlinedField } from './outlined-field';\nimport { FieldProvider, useFieldIds } from '../form/field-context';\n\nexport interface InputGroupProps {\n /** Field label text. */\n label: string;\n /**\n * Associates the label with the input via `htmlFor`.\n *\n * Optional now: when omitted, the group generates an id and the control\n * adopts it through the field context. It used to be the only way the label\n * could reach the control, and a caller who forgot it shipped a label\n * pointing at nothing.\n */\n htmlFor?: string;\n /** Validation error message displayed below the input. */\n error?: string;\n /** Helper text displayed below the input (hidden when error is present). */\n hint?: string;\n /** Marks the field as required with a visual indicator. */\n required?: boolean;\n /**\n * `stack`: label above the control (default).\n * `outlined`: Material-style label notch on the top border; nested controls lose their own border.\n */\n labelLayout?: 'stack' | 'outlined';\n className?: string;\n children: React.ReactNode;\n}\n\nconst InputGroup = React.forwardRef<HTMLDivElement, InputGroupProps>(\n (\n {\n label,\n htmlFor,\n error,\n hint,\n required,\n labelLayout = 'stack',\n className,\n children,\n },\n ref,\n ) => {\n const fallbackId = React.useId();\n const controlId = htmlFor ?? `${fallbackId}-control`;\n\n const { descriptionId, errorId, labelId } = useFieldIds({\n controlId,\n hasDescription: Boolean(hint) && !error,\n hasError: Boolean(error),\n });\n\n const field = React.useMemo(\n () => ({\n controlId,\n descriptionId,\n errorId,\n labelId,\n invalid: Boolean(error),\n required: Boolean(required),\n group: false,\n }),\n [controlId, descriptionId, errorId, labelId, error, required],\n );\n\n if (labelLayout === 'outlined') {\n return (\n <OutlinedField\n ref={ref}\n label={label}\n htmlFor={controlId}\n error={error}\n hint={hint}\n required={required}\n className={className}\n >\n {children}\n </OutlinedField>\n );\n }\n\n return (\n <FieldProvider value={field}>\n <div ref={ref} className={cn('flex flex-col gap-2', className)}>\n <Label id={labelId} htmlFor={controlId}>\n {label}\n {/* Decoration only — `aria-required` on the control carries the\n meaning. See FormField for the reasoning. */}\n {required && (\n <span aria-hidden=\"true\" className=\"ml-0.5 text-destructive\">\n *\n </span>\n )}\n </Label>\n {children}\n {error && (\n <p id={errorId} className=\"text-sm text-destructive\">\n {error}\n </p>\n )}\n {!error && hint && (\n <p id={descriptionId} className=\"text-sm text-muted-foreground\">\n {hint}\n </p>\n )}\n </div>\n </FieldProvider>\n );\n },\n);\nInputGroup.displayName = 'InputGroup';\n\nexport { InputGroup };\n","'use client';\n\nimport * as React from 'react';\nimport { cn } from '../lib/utils';\nimport { inputFocusClasses, inputSurfaceClasses } from '../lib/surface-classes';\nimport { useFieldControl } from '../form/field-context';\n\nexport interface TextareaProps\n extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}\n\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n ({ className, ...props }, ref) => {\n // Adopts the surrounding field's id and ARIA wiring; a no-op outside one.\n const fieldProps = useFieldControl(props);\n\n return (\n <textarea\n className={cn(\n inputSurfaceClasses,\n 'min-h-[80px] px-3 py-2',\n inputFocusClasses,\n className,\n )}\n ref={ref}\n {...fieldProps}\n />\n );\n },\n);\nTextarea.displayName = 'Textarea';\n\nexport { Textarea };\n","'use client';\n\nimport * as React from 'react';\nimport { Select as SelectPrimitive } from 'radix-ui';\nimport { Check, ChevronDown, ChevronUp } from 'lucide-react';\nimport { cn } from '../lib/utils';\nimport {\n floatingAnimationClasses,\n inputFocusClasses,\n inputSizingClasses,\n inputSurfaceClasses,\n menuItemWithIndicatorClasses,\n menuSeparatorClasses,\n menuSurfaceClasses,\n} from '../lib/surface-classes';\nimport { useFieldControl } from '../form/field-context';\n\nconst Select = SelectPrimitive.Root;\nconst SelectGroup = SelectPrimitive.Group;\nconst SelectValue = SelectPrimitive.Value;\n\nconst SelectTrigger = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => {\n // Adopts the surrounding field's id and ARIA wiring; a no-op outside one.\n const fieldProps = useFieldControl(props);\n\n return (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n inputSurfaceClasses,\n inputSizingClasses('md'),\n inputFocusClasses,\n 'items-center justify-between [&>span]:line-clamp-1',\n className,\n )}\n {...fieldProps}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDown className=\"h-4 w-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n );\n});\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\nconst SelectScrollUpButton = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.ScrollUpButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn(\n 'flex cursor-default items-center justify-center py-1',\n className,\n )}\n {...props}\n >\n <ChevronUp className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollUpButton>\n));\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;\n\nconst SelectScrollDownButton = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.ScrollDownButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn(\n 'flex cursor-default items-center justify-center py-1',\n className,\n )}\n {...props}\n >\n <ChevronDown className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollDownButton>\n));\nSelectScrollDownButton.displayName =\n SelectPrimitive.ScrollDownButton.displayName;\n\nconst SelectContent = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(({ className, children, position = 'popper', ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={cn(\n menuSurfaceClasses,\n floatingAnimationClasses,\n 'relative max-h-96 p-0',\n position === 'popper' &&\n 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',\n className,\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n 'p-1',\n position === 'popper' &&\n 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]',\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n));\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\nconst SelectLabel = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn('py-1.5 pl-8 pr-2 text-sm font-semibold', className)}\n {...props}\n />\n));\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\nconst SelectItem = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(menuItemWithIndicatorClasses, 'w-full', className)}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\nconst SelectSeparator = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn(menuSeparatorClasses, className)}\n {...props}\n />\n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\nexport {\n Select,\n SelectGroup,\n SelectValue,\n SelectTrigger,\n SelectContent,\n SelectLabel,\n SelectItem,\n SelectSeparator,\n SelectScrollUpButton,\n SelectScrollDownButton,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport { DayPicker } from \"react-day-picker\";\nimport { ChevronLeft, ChevronRight } from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker>;\n\nconst Calendar = ({\n className,\n classNames,\n showOutsideDays = true,\n ...props\n}: CalendarProps) => {\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\"p-3\", className)}\n classNames={{\n months: \"flex flex-col sm:flex-row gap-2\",\n month: \"flex flex-col gap-4\",\n month_caption: \"flex justify-center pt-1 relative items-center w-full\",\n caption_label: \"text-sm font-medium\",\n nav: \"flex items-center gap-1\",\n button_previous:\n \"absolute left-1 inline-flex items-center justify-center h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 border border-input rounded-md z-10\",\n button_next:\n \"absolute right-1 inline-flex items-center justify-center h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100 border border-input rounded-md z-10\",\n month_grid: \"w-full border-collapse space-x-1\",\n weekdays: \"flex\",\n weekday:\n \"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]\",\n week: \"flex w-full mt-2\",\n day: cn(\n \"relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50\",\n props.mode === \"range\"\n ? \"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md\"\n : \"[&:has([aria-selected])]:rounded-md\",\n ),\n day_button: cn(\n \"inline-flex items-center justify-center h-9 w-9 p-0 font-normal aria-selected:opacity-100 rounded-md\",\n \"hover:bg-accent hover:text-accent-foreground\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2\",\n ),\n range_start: \"day-range-start rounded-l-md\",\n range_end: \"day-range-end rounded-r-md\",\n selected:\n \"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground\",\n today: \"bg-accent text-accent-foreground\",\n outside:\n \"day-outside text-muted-foreground aria-selected:text-muted-foreground opacity-50 aria-selected:opacity-30\",\n disabled: \"text-muted-foreground opacity-50\",\n range_middle:\n \"aria-selected:bg-accent aria-selected:text-accent-foreground\",\n hidden: \"invisible\",\n ...classNames,\n }}\n components={{\n Chevron: ({ orientation }) =>\n orientation === \"left\" ? (\n <ChevronLeft className=\"h-4 w-4\" />\n ) : (\n <ChevronRight className=\"h-4 w-4\" />\n ),\n }}\n {...props}\n />\n );\n};\nCalendar.displayName = \"Calendar\";\n\nexport { Calendar };\n","\"use client\";\n\nimport * as React from \"react\";\nimport useEmblaCarousel, {\n type UseEmblaCarouselType,\n} from \"embla-carousel-react\";\nimport { ArrowLeft, ArrowRight } from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\nimport { Button, type ButtonProps } from \"./button\";\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\nexport interface CarouselProps {\n /** Embla options — `loop`, `align`, `slidesToScroll`, `startIndex`, etc. */\n opts?: CarouselOptions;\n /** Embla plugins, e.g. autoplay. */\n plugins?: CarouselPlugin;\n /** Scroll axis. Defaults to `\"horizontal\"`. */\n orientation?: \"horizontal\" | \"vertical\";\n /** Receives the Embla API once initialized, for external control. */\n setApi?: (api: CarouselApi) => void;\n}\n\ninterface CarouselContextValue extends CarouselProps {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: CarouselApi;\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n orientation: \"horizontal\" | \"vertical\";\n}\n\nconst CarouselContext = React.createContext<CarouselContextValue | null>(null);\n\nfunction useCarousel(): CarouselContextValue {\n const context = React.useContext(CarouselContext);\n if (!context) {\n throw new Error(\"useCarousel must be used within a <Carousel />\");\n }\n return context;\n}\n\nconst Carousel = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & CarouselProps\n>(\n (\n {\n orientation = \"horizontal\",\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n },\n ref,\n ) => {\n const [carouselRef, api] = useEmblaCarousel(\n { ...opts, axis: orientation === \"horizontal\" ? \"x\" : \"y\" },\n plugins,\n );\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\n const [canScrollNext, setCanScrollNext] = React.useState(false);\n\n const onSelect = React.useCallback((emblaApi: CarouselApi) => {\n if (!emblaApi) return;\n setCanScrollPrev(emblaApi.canScrollPrev());\n setCanScrollNext(emblaApi.canScrollNext());\n }, []);\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext();\n }, [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === \"ArrowRight\") {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext],\n );\n\n React.useEffect(() => {\n if (api && setApi) setApi(api);\n }, [api, setApi]);\n\n React.useEffect(() => {\n if (!api) return;\n\n onSelect(api);\n api.on(\"reInit\", onSelect);\n api.on(\"select\", onSelect);\n\n return () => {\n api.off(\"reInit\", onSelect);\n api.off(\"select\", onSelect);\n };\n }, [api, onSelect]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api,\n opts,\n orientation,\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <div\n ref={ref}\n onKeyDownCapture={handleKeyDown}\n className={cn(\"relative\", className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n },\n);\nCarousel.displayName = \"Carousel\";\n\nconst CarouselContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n const { carouselRef, orientation } = useCarousel();\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\">\n <div\n ref={ref}\n className={cn(\n \"flex\",\n orientation === \"horizontal\" ? \"-ml-4\" : \"-mt-4 flex-col\",\n className,\n )}\n {...props}\n />\n </div>\n );\n});\nCarouselContent.displayName = \"CarouselContent\";\n\nconst CarouselItem = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n const { orientation } = useCarousel();\n\n return (\n <div\n ref={ref}\n role=\"group\"\n aria-roledescription=\"slide\"\n className={cn(\n \"min-w-0 shrink-0 grow-0 basis-full\",\n orientation === \"horizontal\" ? \"pl-4\" : \"pt-4\",\n className,\n )}\n {...props}\n />\n );\n});\nCarouselItem.displayName = \"CarouselItem\";\n\nexport interface CarouselNavProps extends Omit<ButtonProps, \"children\"> {\n /** Icon rendered inside the button. Defaults to a directional arrow. */\n icon?: React.ReactNode;\n /** Accessible name for the button. Defaults to \"Previous slide\" / \"Next slide\". */\n label?: string;\n}\n\nconst CarouselPrevious = React.forwardRef<HTMLButtonElement, CarouselNavProps>(\n (\n { className, variant = \"outline\", size = \"icon\", icon, label, ...props },\n ref,\n ) => {\n const { scrollPrev, canScrollPrev } = useCarousel();\n\n return (\n <Button\n ref={ref}\n variant={variant}\n size={size}\n className={cn(\"shrink-0 rounded-full\", className)}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n aria-label={label ?? \"Previous slide\"}\n {...props}\n >\n {icon ?? <ArrowLeft className=\"size-4\" />}\n </Button>\n );\n },\n);\nCarouselPrevious.displayName = \"CarouselPrevious\";\n\nconst CarouselNext = React.forwardRef<HTMLButtonElement, CarouselNavProps>(\n (\n { className, variant = \"outline\", size = \"icon\", icon, label, ...props },\n ref,\n ) => {\n const { scrollNext, canScrollNext } = useCarousel();\n\n return (\n <Button\n ref={ref}\n variant={variant}\n size={size}\n className={cn(\"shrink-0 rounded-full\", className)}\n disabled={!canScrollNext}\n onClick={scrollNext}\n aria-label={label ?? \"Next slide\"}\n {...props}\n >\n {icon ?? <ArrowRight className=\"size-4\" />}\n </Button>\n );\n },\n);\nCarouselNext.displayName = \"CarouselNext\";\n\nexport {\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselPrevious,\n CarouselNext,\n useCarousel,\n type CarouselApi,\n};\n","'use client';\n\nimport * as React from 'react';\nimport { Popover as PopoverPrimitive } from 'radix-ui';\nimport { cn } from '../lib/utils';\nimport { floatingAnimationClasses } from '../lib/surface-classes';\n\nconst Popover = PopoverPrimitive.Root;\nconst PopoverTrigger = PopoverPrimitive.Trigger;\n\nconst PopoverContent = React.forwardRef<\n React.ComponentRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'z-[var(--z-popover)] w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none',\n floatingAnimationClasses,\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n));\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n\nexport { Popover, PopoverTrigger, PopoverContent };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { format } from \"date-fns\";\nimport { Calendar as CalendarIcon } from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\nimport { Button } from \"./button\";\nimport { Calendar } from \"./calendar\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\";\nimport { useFieldControl } from \"../form/field-context\";\n\nexport interface DatePickerProps {\n /** The selected date */\n value?: Date;\n /** Callback when the date changes */\n onChange?: (date: Date | undefined) => void;\n /** Placeholder text when no date is selected */\n placeholder?: string;\n /** Date format string (date-fns format) */\n dateFormat?: string;\n /** Disable the date picker */\n disabled?: boolean;\n /** Additional class names for the trigger button */\n className?: string;\n /** Minimum selectable date */\n fromDate?: Date;\n /** Maximum selectable date */\n toDate?: Date;\n /** Dates that should be disabled */\n disabledDates?: Date[];\n}\n\nconst DatePicker = React.forwardRef<HTMLButtonElement, DatePickerProps>(\n (\n {\n value,\n onChange,\n placeholder = \"Pick a date\",\n dateFormat = \"PPP\",\n disabled = false,\n className,\n fromDate,\n toDate,\n disabledDates,\n },\n ref\n ) => {\n // The popover trigger is the only focusable element the field can attach\n // to, so it carries the id and the error description.\n const fieldProps = useFieldControl({});\n const [open, setOpen] = React.useState(false);\n\n const handleSelect = (date: Date | undefined) => {\n onChange?.(date);\n setOpen(false);\n };\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n ref={ref}\n variant=\"outline\"\n disabled={disabled}\n className={cn(\n \"w-full justify-start text-left font-normal\",\n !value && \"text-muted-foreground\",\n className\n )}\n {...fieldProps}\n >\n <CalendarIcon className=\"mr-2 h-4 w-4\" />\n {value ? format(value, dateFormat) : <span>{placeholder}</span>}\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0\" align=\"start\">\n <Calendar\n mode=\"single\"\n selected={value}\n onSelect={handleSelect}\n disabled={disabledDates ? disabledDates : undefined}\n startMonth={fromDate}\n endMonth={toDate}\n autoFocus\n />\n </PopoverContent>\n </Popover>\n );\n }\n);\nDatePicker.displayName = \"DatePicker\";\n\nexport { DatePicker };\n","'use client';\n\nimport * as React from 'react';\nimport { cn } from '../lib/utils';\nimport { inputSizingClasses, type InputSize } from '../lib/surface-classes';\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from './select';\nimport { FieldGroupScope, useFieldGroup } from '../form/field-context';\n\n// useLayoutEffect warns on the server; this library targets Next.js\n// consumers, so fall back to useEffect there. Matches tabs.tsx's helper.\nconst useIsomorphicLayoutEffect =\n typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\n\nexport type TimePeriod = 'AM' | 'PM';\n\n/** Curated minute-increment presets, matching this library's finite-preset philosophy. */\nexport type MinuteStep = 1 | 5 | 10 | 15 | 30;\n\nexport interface TimeParts {\n /** 1-12 */\n hour12: number;\n /** 0-59 */\n minute: number;\n period: TimePeriod;\n}\n\n/** Zero-pads a number to a 2-digit string (\"5\" → \"05\"). */\nfunction pad2(n: number): string {\n return String(n).padStart(2, '0');\n}\n\n/**\n * A segment's controlled Select value: zero-padded, or `''` when unset.\n *\n * Radix's Select.Root treats `''` as \"clear the selection and show the\n * placeholder\" (see @radix-ui/react-select's own SelectItem invariant: a\n * SelectItem's value may never be `''` for exactly this reason) while still\n * remaining fully controlled by us. Passing `undefined` instead would leave\n * Select.Root uncontrolled whenever a segment is unset, and Radix's internal\n * uncontrolled fallback state -- populated only by the user's own picks via\n * onValueChange -- does not reset just because our `value` prop returns to\n * `undefined`, so a cleared, previously-picked trigger would keep showing\n * its last value. Always passing a defined string avoids that entirely.\n */\nfunction toSegmentValue(n: number | undefined): string {\n return n === undefined ? '' : pad2(n);\n}\n\nconst HOUR_OPTIONS = Array.from({ length: 12 }, (_, i) => pad2(i + 1));\n\n/** Generates zero-padded minute option strings (\"00\", \"05\", ...) stepped by `step`. */\nexport function getMinuteOptions(step: MinuteStep): string[] {\n const options: string[] = [];\n for (let minute = 0; minute < 60; minute += step) {\n options.push(pad2(minute));\n }\n return options;\n}\n\n/** Parses a 24-hour \"HH:mm\" string into 12-hour parts. Returns {} for undefined/malformed input. */\nexport function parseTimeValue(value: string | undefined): Partial<TimeParts> {\n if (!value) return {};\n const match = /^([01]\\d|2[0-3]):([0-5]\\d)$/.exec(value);\n if (!match) return {};\n const hour24 = Number(match[1]);\n const minute = Number(match[2]);\n const period: TimePeriod = hour24 >= 12 ? 'PM' : 'AM';\n const hour12 = hour24 % 12 === 0 ? 12 : hour24 % 12;\n return { hour12, minute, period };\n}\n\n/** Formats 12-hour parts back into a 24-hour \"HH:mm\" string. */\nexport function formatTimeValue(parts: TimeParts): string {\n let hour24 = parts.hour12 % 12;\n if (parts.period === 'PM') hour24 += 12;\n return `${pad2(hour24)}:${pad2(parts.minute)}`;\n}\n\nexport interface TimePickerProps {\n /** Current time, 24-hour \"HH:mm\" format, e.g. \"14:30\" */\n value?: string;\n /** Fires only once hour, minute, and period are all selected */\n onChange?: (value: string) => void;\n /** Minute increment, restricted to a curated preset. Default: 5 */\n minuteStep?: MinuteStep;\n /** Field size. Default: \"md\" */\n size?: InputSize;\n disabled?: boolean;\n /** Placeholder text per segment. Defaults: \"HH\" / \"MM\" / \"AM\" */\n placeholder?: { hour?: string; minute?: string; period?: string };\n /** Applied to the wrapping row element */\n className?: string;\n}\n\nconst TimePicker = React.forwardRef<HTMLDivElement, TimePickerProps>(\n (\n {\n value,\n onChange,\n minuteStep = 5,\n size = 'md',\n disabled = false,\n placeholder,\n className,\n },\n ref,\n ) => {\n const groupProps = useFieldGroup();\n const [partial, setPartial] = React.useState<Partial<TimeParts>>({});\n // A `value` only counts as \"controlled\" once it fully parses — an\n // unparseable non-empty string (or \"\") is treated the same as\n // `undefined`, so segment picks still accumulate in local state instead\n // of being silently discarded just because `value` happened to be\n // truthy. `parseTimeValue` never returns a partial result (its regex\n // match sets all three fields together or none), so checking `hour12`\n // alone is a reliable proxy for \"did this value actually parse.\"\n const parsedValue = parseTimeValue(value);\n const isControlled = parsedValue.hour12 !== undefined;\n const parts = isControlled ? parsedValue : partial;\n\n // If a controlled value is cleared (or becomes unparseable) after having\n // been set, drop any stale local selection so the picker falls back to\n // placeholders instead of showing the last value it had before it\n // became controlled. useIsomorphicLayoutEffect (not useEffect) so this\n // correction lands before paint -- the transition render below already\n // computes `parts` from the stale `partial`, and running the reset after\n // paint would let that stale value flash on screen for a frame first.\n const wasControlledRef = React.useRef(isControlled);\n useIsomorphicLayoutEffect(() => {\n if (wasControlledRef.current && !isControlled) {\n setPartial({});\n }\n wasControlledRef.current = isControlled;\n }, [isControlled]);\n\n const minuteOptions = React.useMemo(() => {\n const options = getMinuteOptions(minuteStep);\n // A `value` supplied directly (not picked via this UI) may carry a\n // minute that isn't a multiple of `minuteStep` — include it so the\n // trigger reflects the true value instead of falling back to the\n // placeholder as if nothing were selected.\n if (parts.minute !== undefined) {\n const minuteStr = pad2(parts.minute);\n if (!options.includes(minuteStr)) {\n return [...options, minuteStr].sort();\n }\n }\n return options;\n }, [minuteStep, parts.minute]);\n\n function commit(next: Partial<TimeParts>) {\n if (!isControlled) {\n setPartial(next);\n }\n if (\n next.hour12 !== undefined &&\n next.minute !== undefined &&\n next.period !== undefined\n ) {\n onChange?.(\n formatTimeValue({\n hour12: next.hour12,\n minute: next.minute,\n period: next.period,\n }),\n );\n }\n }\n\n const triggerClassName = cn(inputSizingClasses(size), 'w-auto min-w-0');\n\n return (\n <div ref={ref} className={cn('flex gap-2', className)} {...groupProps}>\n {/* Three selects, each already self-labelled. FieldGroupScope stops all\n three adopting the surrounding field's single id. */}\n <FieldGroupScope>\n <Select\n disabled={disabled}\n value={toSegmentValue(parts.hour12)}\n onValueChange={(hour) => commit({ ...parts, hour12: Number(hour) })}\n >\n <SelectTrigger aria-label=\"Hour\" className={triggerClassName}>\n <SelectValue placeholder={placeholder?.hour ?? 'HH'} />\n </SelectTrigger>\n <SelectContent>\n {HOUR_OPTIONS.map((hour) => (\n <SelectItem key={hour} value={hour}>\n {hour}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n\n <Select\n disabled={disabled}\n value={toSegmentValue(parts.minute)}\n onValueChange={(minute) =>\n commit({ ...parts, minute: Number(minute) })\n }\n >\n <SelectTrigger aria-label=\"Minute\" className={triggerClassName}>\n <SelectValue placeholder={placeholder?.minute ?? 'MM'} />\n </SelectTrigger>\n <SelectContent>\n {minuteOptions.map((minute) => (\n <SelectItem key={minute} value={minute}>\n {minute}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n\n <Select\n disabled={disabled}\n value={parts.period ?? ''}\n onValueChange={(period) =>\n commit({ ...parts, period: period as TimePeriod })\n }\n >\n <SelectTrigger aria-label=\"AM or PM\" className={triggerClassName}>\n <SelectValue placeholder={placeholder?.period ?? 'AM'} />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"AM\">AM</SelectItem>\n <SelectItem value=\"PM\">PM</SelectItem>\n </SelectContent>\n </Select>\n </FieldGroupScope>\n </div>\n );\n },\n);\nTimePicker.displayName = 'TimePicker';\n\nexport { TimePicker };\n","\"use client\";\n\nimport * as React from \"react\";\nimport {\n format,\n subDays,\n startOfWeek,\n startOfMonth,\n startOfYear,\n endOfWeek,\n endOfMonth,\n subMonths,\n subYears,\n} from \"date-fns\";\nimport { Calendar as CalendarIcon, CircleX } from \"lucide-react\";\nimport type { DateRange } from \"react-day-picker\";\nimport { cn } from \"../lib/utils\";\nimport { Button } from \"./button\";\nimport { Calendar } from \"./calendar\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\";\nimport { useFieldControl } from \"../form/field-context\";\n\nexport interface DateRangePreset {\n /** Display label for the preset */\n label: string;\n /** Function that returns the date range for this preset */\n range: () => DateRange;\n}\n\n/** Built-in preset range generators */\nexport const dateRangePresets = {\n today: (): DateRangePreset => ({\n label: \"Today\",\n range: () => {\n const today = new Date();\n return { from: today, to: today };\n },\n }),\n yesterday: (): DateRangePreset => ({\n label: \"Yesterday\",\n range: () => {\n const yesterday = subDays(new Date(), 1);\n return { from: yesterday, to: yesterday };\n },\n }),\n last7Days: (): DateRangePreset => ({\n label: \"Last 7 days\",\n range: () => ({ from: subDays(new Date(), 6), to: new Date() }),\n }),\n last14Days: (): DateRangePreset => ({\n label: \"Last 14 days\",\n range: () => ({ from: subDays(new Date(), 13), to: new Date() }),\n }),\n last30Days: (): DateRangePreset => ({\n label: \"Last 30 days\",\n range: () => ({ from: subDays(new Date(), 29), to: new Date() }),\n }),\n last90Days: (): DateRangePreset => ({\n label: \"Last 90 days\",\n range: () => ({ from: subDays(new Date(), 89), to: new Date() }),\n }),\n thisWeek: (): DateRangePreset => ({\n label: \"This week\",\n range: () => ({ from: startOfWeek(new Date()), to: endOfWeek(new Date()) }),\n }),\n lastWeek: (): DateRangePreset => ({\n label: \"Last week\",\n range: () => {\n const lastWeek = subDays(new Date(), 7);\n return { from: startOfWeek(lastWeek), to: endOfWeek(lastWeek) };\n },\n }),\n thisMonth: (): DateRangePreset => ({\n label: \"This month\",\n range: () => ({\n from: startOfMonth(new Date()),\n to: endOfMonth(new Date()),\n }),\n }),\n lastMonth: (): DateRangePreset => ({\n label: \"Last month\",\n range: () => {\n const lastMonth = subMonths(new Date(), 1);\n return { from: startOfMonth(lastMonth), to: endOfMonth(lastMonth) };\n },\n }),\n thisYear: (): DateRangePreset => ({\n label: \"This year\",\n range: () => ({ from: startOfYear(new Date()), to: new Date() }),\n }),\n lastYear: (): DateRangePreset => ({\n label: \"Last year\",\n range: () => {\n const lastYear = subYears(new Date(), 1);\n return { from: startOfYear(lastYear), to: new Date() };\n },\n }),\n} as const;\n\nexport interface DateRangePickerProps {\n /** The selected date range */\n value?: DateRange;\n /** Callback when the date range changes */\n onChange?: (range: DateRange | undefined) => void;\n /** Placeholder text when no range is selected */\n placeholder?: string;\n /** Date format string (date-fns format) */\n dateFormat?: string;\n /** Disable the date range picker */\n disabled?: boolean;\n /** Additional class names for the trigger button */\n className?: string;\n /** Preset ranges to display in the sidebar */\n presets?: DateRangePreset[];\n /** Number of months to display */\n numberOfMonths?: number;\n /** Minimum selectable date */\n fromDate?: Date;\n /** Maximum selectable date */\n toDate?: Date;\n /** When true, shows an X-in-circle clear button on the right when a value is selected. Defaults to true. */\n clearable?: boolean;\n /** Accessible label for the clear button. Defaults to \"Clear date range\". */\n clearLabel?: string;\n}\n\nconst DateRangePicker = React.forwardRef<\n HTMLButtonElement,\n DateRangePickerProps\n>(\n (\n {\n value,\n onChange,\n placeholder = \"Pick a date range\",\n dateFormat = \"LLL dd, y\",\n disabled = false,\n className,\n presets,\n numberOfMonths = 2,\n fromDate,\n toDate,\n clearable = true,\n clearLabel = \"Clear date range\",\n },\n ref,\n ) => {\n // The popover trigger is the only focusable element the field can attach\n // to, so it carries the id and the error description. The clear button\n // beside it keeps its own label.\n const fieldProps = useFieldControl({});\n const [open, setOpen] = React.useState(false);\n\n const handlePresetClick = (preset: DateRangePreset) => {\n const range = preset.range();\n onChange?.(range);\n };\n\n const showClear = clearable && !disabled && Boolean(value?.from);\n\n const handleClear = (e: React.MouseEvent | React.KeyboardEvent) => {\n e.stopPropagation();\n e.preventDefault();\n onChange?.(undefined);\n };\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <div className=\"relative w-full\">\n <PopoverTrigger asChild>\n <Button\n ref={ref}\n variant=\"outline\"\n disabled={disabled}\n className={cn(\n \"w-full justify-start text-left font-normal\",\n !value && \"text-muted-foreground\",\n showClear && \"pr-9\",\n className,\n )}\n {...fieldProps}\n >\n <CalendarIcon className=\"mr-2 h-4 w-4\" />\n {value?.from ? (\n value.to ? (\n <>\n {format(value.from, dateFormat)} –{\" \"}\n {format(value.to, dateFormat)}\n </>\n ) : (\n format(value.from, dateFormat)\n )\n ) : (\n <span>{placeholder}</span>\n )}\n </Button>\n </PopoverTrigger>\n {showClear && (\n <button\n type=\"button\"\n aria-label={clearLabel}\n onClick={handleClear}\n onPointerDown={(e) => e.stopPropagation()}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n handleClear(e);\n }\n }}\n className=\"absolute right-2 top-1/2 -translate-y-1/2 rounded-full text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1\"\n >\n <CircleX className=\"h-4 w-4\" />\n </button>\n )}\n </div>\n <PopoverContent className=\"w-auto p-0\" align=\"start\">\n <div\n className={cn(\"flex\", presets && presets.length > 0 && \"flex-row\")}\n >\n {presets && presets.length > 0 && (\n <div className=\"flex flex-col gap-1 border-r p-3 min-w-[160px]\">\n <p className=\"mb-1 text-xs font-medium text-muted-foreground\">\n Quick select\n </p>\n {presets.map((preset) => (\n <Button\n key={preset.label}\n variant=\"ghost\"\n size=\"sm\"\n className=\"justify-start text-left text-sm font-normal\"\n onClick={() => handlePresetClick(preset)}\n >\n {preset.label}\n </Button>\n ))}\n </div>\n )}\n <div>\n <Calendar\n mode=\"range\"\n defaultMonth={value?.from}\n selected={value}\n onSelect={onChange}\n numberOfMonths={numberOfMonths}\n startMonth={fromDate}\n endMonth={toDate}\n autoFocus\n />\n </div>\n </div>\n </PopoverContent>\n </Popover>\n );\n },\n);\nDateRangePicker.displayName = \"DateRangePicker\";\n\nexport { DateRangePicker };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Separator as SeparatorPrimitive } from \"radix-ui\";\nimport { cn } from \"../lib/utils\";\n\nconst Separator = React.forwardRef<\n React.ComponentRef<typeof SeparatorPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(({ className, orientation = \"horizontal\", decorative = true, ...props }, ref) => (\n <SeparatorPrimitive.Root\n ref={ref}\n decorative={decorative}\n orientation={orientation}\n className={cn(\n \"shrink-0 bg-border\",\n orientation === \"horizontal\" ? \"h-[1px] w-full\" : \"h-full w-[1px]\",\n className\n )}\n {...props}\n />\n));\nSeparator.displayName = SeparatorPrimitive.Root.displayName;\n\nexport { Separator };\n","'use client';\n\nimport * as React from 'react';\nimport { Tooltip as TooltipPrimitive } from 'radix-ui';\nimport { cn } from '../lib/utils';\nimport { tooltipAnimationClasses } from '../lib/surface-classes';\n\nconst TooltipProvider = TooltipPrimitive.Provider;\nconst Tooltip = TooltipPrimitive.Root;\nconst TooltipTrigger = TooltipPrimitive.Trigger;\n\nconst TooltipContent = React.forwardRef<\n React.ComponentRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'z-[var(--z-tooltip)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md',\n tooltipAnimationClasses,\n className,\n )}\n {...props}\n />\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { useEditor, EditorContent, type Editor } from \"@tiptap/react\";\nimport StarterKit from \"@tiptap/starter-kit\";\nimport Placeholder from \"@tiptap/extension-placeholder\";\nimport Link from \"@tiptap/extension-link\";\nimport Underline from \"@tiptap/extension-underline\";\nimport TextAlign from \"@tiptap/extension-text-align\";\nimport {\n AlignCenter,\n AlignLeft,\n AlignRight,\n Bold,\n Code,\n Heading1,\n Heading2,\n Heading3,\n Italic,\n Link as LinkIcon,\n List,\n ListOrdered,\n Minus,\n Quote,\n Redo,\n Strikethrough,\n Underline as UnderlineIcon,\n Undo,\n Unlink,\n} from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\nimport { Button } from \"./button\";\nimport { Separator } from \"./separator\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from \"./tooltip\";\n\nexport interface TextEditorProps {\n /** The HTML content of the editor */\n value?: string;\n /** Callback when content changes (returns HTML) */\n onChange?: (html: string) => void;\n /** Placeholder text */\n placeholder?: string;\n /** Disable the editor */\n disabled?: boolean;\n /** Additional class names for the outer wrapper */\n className?: string;\n /** Additional class names for the editor content area */\n contentClassName?: string;\n /** Minimum height of the editor content area */\n minHeight?: string;\n /** Hide the toolbar */\n hideToolbar?: boolean;\n /** Toolbar features to show. Defaults to all. */\n toolbar?: Array<\n | \"bold\"\n | \"italic\"\n | \"underline\"\n | \"strike\"\n | \"code\"\n | \"heading\"\n | \"bulletList\"\n | \"orderedList\"\n | \"blockquote\"\n | \"horizontalRule\"\n | \"link\"\n | \"align\"\n | \"undo\"\n | \"redo\"\n >;\n /** Called when the editor is created */\n onEditorReady?: (editor: Editor) => void;\n}\n\ninterface ToolbarButtonProps {\n onClick: () => void;\n isActive?: boolean;\n disabled?: boolean;\n tooltip: string;\n children: React.ReactNode;\n}\n\nconst ToolbarButton = ({\n onClick,\n isActive,\n disabled,\n tooltip,\n children,\n}: ToolbarButtonProps) => (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n disabled={disabled}\n className={cn(\n \"h-8 w-8 p-0\",\n isActive && \"bg-accent text-accent-foreground\",\n )}\n onClick={onClick}\n >\n {children}\n </Button>\n </TooltipTrigger>\n <TooltipContent side=\"bottom\">\n <p className=\"text-xs\">{tooltip}</p>\n </TooltipContent>\n </Tooltip>\n);\n\nconst defaultToolbar: TextEditorProps[\"toolbar\"] = [\n \"bold\",\n \"italic\",\n \"underline\",\n \"strike\",\n \"code\",\n \"heading\",\n \"bulletList\",\n \"orderedList\",\n \"blockquote\",\n \"horizontalRule\",\n \"link\",\n \"align\",\n \"undo\",\n \"redo\",\n];\n\nconst EditorToolbar = ({\n editor,\n toolbar = defaultToolbar,\n}: {\n editor: Editor;\n toolbar?: TextEditorProps[\"toolbar\"];\n}) => {\n const has = (feature: string) => toolbar?.includes(feature as never) ?? false;\n\n const handleLink = () => {\n if (editor.isActive(\"link\")) {\n editor.chain().focus().unsetLink().run();\n return;\n }\n const url = window.prompt(\"Enter URL:\");\n if (url) {\n editor\n .chain()\n .focus()\n .extendMarkRange(\"link\")\n .setLink({ href: url })\n .run();\n }\n };\n\n return (\n <TooltipProvider delayDuration={300}>\n <div className=\"flex flex-wrap items-center gap-0.5 border-b px-2 py-1\">\n {has(\"bold\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleBold().run()}\n isActive={editor.isActive(\"bold\")}\n tooltip=\"Bold\"\n >\n <Bold className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"italic\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleItalic().run()}\n isActive={editor.isActive(\"italic\")}\n tooltip=\"Italic\"\n >\n <Italic className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"underline\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleUnderline().run()}\n isActive={editor.isActive(\"underline\")}\n tooltip=\"Underline\"\n >\n <UnderlineIcon className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"strike\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleStrike().run()}\n isActive={editor.isActive(\"strike\")}\n tooltip=\"Strikethrough\"\n >\n <Strikethrough className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"code\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleCode().run()}\n isActive={editor.isActive(\"code\")}\n tooltip=\"Code\"\n >\n <Code className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n\n {(has(\"bold\") ||\n has(\"italic\") ||\n has(\"underline\") ||\n has(\"strike\") ||\n has(\"code\")) &&\n (has(\"heading\") ||\n has(\"bulletList\") ||\n has(\"orderedList\") ||\n has(\"blockquote\")) && (\n <Separator orientation=\"vertical\" className=\"mx-1 h-6\" />\n )}\n\n {has(\"heading\") && (\n <>\n <ToolbarButton\n onClick={() =>\n editor.chain().focus().toggleHeading({ level: 1 }).run()\n }\n isActive={editor.isActive(\"heading\", { level: 1 })}\n tooltip=\"Heading 1\"\n >\n <Heading1 className=\"h-4 w-4\" />\n </ToolbarButton>\n <ToolbarButton\n onClick={() =>\n editor.chain().focus().toggleHeading({ level: 2 }).run()\n }\n isActive={editor.isActive(\"heading\", { level: 2 })}\n tooltip=\"Heading 2\"\n >\n <Heading2 className=\"h-4 w-4\" />\n </ToolbarButton>\n <ToolbarButton\n onClick={() =>\n editor.chain().focus().toggleHeading({ level: 3 }).run()\n }\n isActive={editor.isActive(\"heading\", { level: 3 })}\n tooltip=\"Heading 3\"\n >\n <Heading3 className=\"h-4 w-4\" />\n </ToolbarButton>\n </>\n )}\n\n {has(\"bulletList\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleBulletList().run()}\n isActive={editor.isActive(\"bulletList\")}\n tooltip=\"Bullet list\"\n >\n <List className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"orderedList\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleOrderedList().run()}\n isActive={editor.isActive(\"orderedList\")}\n tooltip=\"Ordered list\"\n >\n <ListOrdered className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"blockquote\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().toggleBlockquote().run()}\n isActive={editor.isActive(\"blockquote\")}\n tooltip=\"Blockquote\"\n >\n <Quote className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"horizontalRule\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().setHorizontalRule().run()}\n tooltip=\"Horizontal rule\"\n >\n <Minus className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n\n {(has(\"heading\") ||\n has(\"bulletList\") ||\n has(\"orderedList\") ||\n has(\"blockquote\")) &&\n (has(\"link\") || has(\"align\")) && (\n <Separator orientation=\"vertical\" className=\"mx-1 h-6\" />\n )}\n\n {has(\"link\") && (\n <ToolbarButton\n onClick={handleLink}\n isActive={editor.isActive(\"link\")}\n tooltip={editor.isActive(\"link\") ? \"Remove link\" : \"Add link\"}\n >\n {editor.isActive(\"link\") ? (\n <Unlink className=\"h-4 w-4\" />\n ) : (\n <LinkIcon className=\"h-4 w-4\" />\n )}\n </ToolbarButton>\n )}\n\n {has(\"align\") && (\n <>\n <ToolbarButton\n onClick={() => editor.chain().focus().setTextAlign(\"left\").run()}\n isActive={editor.isActive({ textAlign: \"left\" })}\n tooltip=\"Align left\"\n >\n <AlignLeft className=\"h-4 w-4\" />\n </ToolbarButton>\n <ToolbarButton\n onClick={() =>\n editor.chain().focus().setTextAlign(\"center\").run()\n }\n isActive={editor.isActive({ textAlign: \"center\" })}\n tooltip=\"Align center\"\n >\n <AlignCenter className=\"h-4 w-4\" />\n </ToolbarButton>\n <ToolbarButton\n onClick={() => editor.chain().focus().setTextAlign(\"right\").run()}\n isActive={editor.isActive({ textAlign: \"right\" })}\n tooltip=\"Align right\"\n >\n <AlignRight className=\"h-4 w-4\" />\n </ToolbarButton>\n </>\n )}\n\n {(has(\"link\") || has(\"align\")) && (has(\"undo\") || has(\"redo\")) && (\n <Separator orientation=\"vertical\" className=\"mx-1 h-6\" />\n )}\n\n {has(\"undo\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().undo().run()}\n disabled={!editor.can().undo()}\n tooltip=\"Undo\"\n >\n <Undo className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n {has(\"redo\") && (\n <ToolbarButton\n onClick={() => editor.chain().focus().redo().run()}\n disabled={!editor.can().redo()}\n tooltip=\"Redo\"\n >\n <Redo className=\"h-4 w-4\" />\n </ToolbarButton>\n )}\n </div>\n </TooltipProvider>\n );\n};\n\nconst TextEditor = React.forwardRef<HTMLDivElement, TextEditorProps>(\n (\n {\n value,\n onChange,\n placeholder = \"Start writing...\",\n disabled = false,\n className,\n contentClassName,\n minHeight = \"150px\",\n hideToolbar = false,\n toolbar = defaultToolbar,\n onEditorReady,\n },\n ref,\n ) => {\n const editor = useEditor({\n immediatelyRender: false,\n extensions: [\n StarterKit.configure({\n heading: { levels: [1, 2, 3] },\n }),\n Placeholder.configure({ placeholder }),\n Underline,\n Link.configure({\n openOnClick: false,\n HTMLAttributes: {\n class: \"text-primary underline underline-offset-4 cursor-pointer\",\n },\n }),\n TextAlign.configure({\n types: [\"heading\", \"paragraph\"],\n }),\n ],\n content: value,\n editable: !disabled,\n onUpdate: ({ editor: e }) => {\n onChange?.(e.getHTML());\n },\n onCreate: ({ editor: e }) => {\n onEditorReady?.(e);\n },\n });\n\n React.useEffect(() => {\n if (editor && disabled !== undefined) {\n editor.setEditable(!disabled);\n }\n }, [editor, disabled]);\n\n React.useEffect(() => {\n if (editor && value !== undefined && editor.getHTML() !== value) {\n editor.commands.setContent(value);\n }\n }, [editor, value]);\n\n if (!editor) {\n return null;\n }\n\n return (\n <div\n ref={ref}\n className={cn(\n \"rounded-md border border-input bg-background ring-offset-background focus-within:border-primary focus-within:ring-2 focus-within:ring-primary/30 focus-within:ring-offset-0\",\n disabled && \"cursor-not-allowed opacity-50\",\n className,\n )}\n >\n {!hideToolbar && <EditorToolbar editor={editor} toolbar={toolbar} />}\n <EditorContent\n editor={editor}\n className={cn(\n \"prose prose-base sm:prose-sm dark:prose-invert max-w-none px-3 py-2 focus:outline-none [&_.tiptap]:outline-none [&_.tiptap.ProseMirror]:outline-none\",\n `[&_.tiptap]:min-h-[${minHeight}]`,\n \"[&_.tiptap_p.is-editor-empty:first-child::before]:text-muted-foreground [&_.tiptap_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)] [&_.tiptap_p.is-editor-empty:first-child::before]:float-left [&_.tiptap_p.is-editor-empty:first-child::before]:h-0 [&_.tiptap_p.is-editor-empty:first-child::before]:pointer-events-none\",\n contentClassName,\n )}\n style={{ minHeight }}\n />\n </div>\n );\n },\n);\nTextEditor.displayName = \"TextEditor\";\n\nexport { TextEditor };\nexport type { Editor };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../lib/utils\";\n\nexport interface TextContentProps extends React.HTMLAttributes<HTMLDivElement> {\n /** The HTML content to render (from TextEditor output) */\n content: string;\n}\n\nconst TextContent = React.forwardRef<HTMLDivElement, TextContentProps>(\n ({ content, className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"prose prose-sm dark:prose-invert max-w-none\",\n \"prose-headings:font-heading prose-headings:tracking-tight\",\n \"prose-a:text-primary prose-a:underline prose-a:underline-offset-4\",\n \"prose-blockquote:border-l-primary\",\n \"prose-code:rounded prose-code:bg-muted prose-code:px-1.5 prose-code:py-0.5 prose-code:text-sm prose-code:font-mono\",\n \"prose-pre:bg-muted prose-pre:rounded-md\",\n \"prose-hr:border-border\",\n className\n )}\n dangerouslySetInnerHTML={{ __html: content }}\n {...props}\n />\n );\n }\n);\nTextContent.displayName = \"TextContent\";\n\nexport { TextContent };\n","'use client';\n\nimport * as React from 'react';\nimport { Checkbox as CheckboxPrimitive } from 'radix-ui';\nimport { coarseHitAreaClasses } from '../lib/surface-classes';\nimport { cn } from '../lib/utils';\nimport { useFieldControl } from '../form/field-context';\n\nfunction CheckIcon({ className }: { className?: string }) {\n return (\n <svg\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={cn('shrink-0', className)}\n aria-hidden\n >\n <path\n d=\"M2.5 6.25 5 8.75 9.5 3.25\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction IndeterminateIcon({ className }: { className?: string }) {\n return (\n <svg\n viewBox=\"0 0 12 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={cn('shrink-0', className)}\n aria-hidden\n >\n <path\n d=\"M2.5 6h7\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n />\n </svg>\n );\n}\n\nconst Checkbox = React.forwardRef<\n React.ComponentRef<typeof CheckboxPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>\n>(({ className, checked, ...props }, ref) => {\n // Adopts the surrounding field's wiring when it labels this ONE checkbox.\n // Inside `FormField as=\"group\"` it returns props untouched, so five boxes in\n // a set keep their own ids and the fieldset does the labelling.\n const fieldProps = useFieldControl(props);\n\n return (\n <CheckboxPrimitive.Root\n ref={ref}\n checked={checked}\n className={cn(\n 'peer h-4 w-4 shrink-0 cursor-pointer rounded-[2px] border border-primary bg-background ring-offset-background transition-[color,background-color,border-color] duration-fast ease-default focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary/35 focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground',\n coarseHitAreaClasses,\n className,\n )}\n {...fieldProps}\n >\n <CheckboxPrimitive.Indicator\n className={cn(\n 'flex h-full w-full items-center justify-center text-current',\n )}\n >\n {checked === 'indeterminate' ? (\n <IndeterminateIcon className=\"h-[10px] w-[10px]\" />\n ) : (\n <CheckIcon className=\"h-[10px] w-[10px]\" />\n )}\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n});\nCheckbox.displayName = CheckboxPrimitive.Root.displayName;\n\nexport { Checkbox };\n","'use client';\n\nimport * as React from 'react';\nimport { RadioGroup as RadioGroupPrimitive } from 'radix-ui';\nimport { coarseHitAreaClasses } from '../lib/surface-classes';\nimport { cn } from '../lib/utils';\nimport { useFieldControl } from '../form/field-context';\n\nconst RadioGroup = React.forwardRef<\n React.ComponentRef<typeof RadioGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>\n>(({ className, ...props }, ref) => {\n // The Root already carries role=\"radiogroup\", so a plain `FormField` can\n // describe it directly. Wrapping it in `FormField as=\"group\"` instead gives a\n // real fieldset/legend and makes this a no-op — both are correct, and which\n // one to reach for is a labelling question, not an ARIA one.\n const fieldProps = useFieldControl(props);\n\n return (\n <RadioGroupPrimitive.Root\n className={cn('grid gap-2', className)}\n {...fieldProps}\n ref={ref}\n />\n );\n});\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName;\n\nconst RadioGroupItem = React.forwardRef<\n React.ComponentRef<typeof RadioGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(\n 'inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full border border-primary bg-background text-primary ring-offset-background focus:outline-none focus-visible:ring-1 focus-visible:ring-primary/35 focus-visible:ring-offset-1 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary',\n coarseHitAreaClasses,\n className,\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"flex h-full w-full items-center justify-center\">\n <span\n aria-hidden\n className=\"block h-2 w-2 rounded-full bg-current\"\n />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n));\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;\n\nexport { RadioGroup, RadioGroupItem };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Switch as SwitchPrimitives } from \"radix-ui\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { coarseHitAreaClasses } from \"../lib/surface-classes\";\nimport { cn } from \"../lib/utils\";\nimport { useFieldControl } from \"../form/field-context\";\n\nconst switchVariants = cva(\n \"peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors duration-fast ease-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input\",\n {\n variants: {\n size: {\n sm: \"h-5 w-9\",\n md: \"h-6 w-11\",\n lg: \"h-7 w-14\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n);\n\n// Thumb size + checked translate are paired to each track so the thumb slides\n// exactly to the far edge (translate = track inner width − thumb width).\nconst switchThumbVariants = cva(\n \"pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform duration-fast ease-default data-[state=unchecked]:translate-x-0\",\n {\n variants: {\n size: {\n sm: \"h-4 w-4 data-[state=checked]:translate-x-4\",\n md: \"h-5 w-5 data-[state=checked]:translate-x-5\",\n lg: \"h-6 w-6 data-[state=checked]:translate-x-7\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n);\n\nexport interface SwitchProps\n extends React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>,\n VariantProps<typeof switchVariants> {}\n\nconst Switch = React.forwardRef<React.ComponentRef<typeof SwitchPrimitives.Root>, SwitchProps>(\n ({ className, size, ...props }, ref) => {\n // Adopts the surrounding field's id and ARIA wiring; a no-op outside one.\n const fieldProps = useFieldControl(props);\n\n return (\n <SwitchPrimitives.Root\n className={cn(switchVariants({ size }), coarseHitAreaClasses, className)}\n {...fieldProps}\n ref={ref}\n >\n <SwitchPrimitives.Thumb className={cn(switchThumbVariants({ size }))} />\n </SwitchPrimitives.Root>\n );\n },\n);\nSwitch.displayName = SwitchPrimitives.Root.displayName;\n\nexport { Switch, switchVariants };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Slider as SliderPrimitive } from \"radix-ui\";\nimport { coarseHitAreaClasses } from \"../lib/surface-classes\";\nimport { cn } from \"../lib/utils\";\nimport { useFieldControl } from \"../form/field-context\";\n\nconst Slider = React.forwardRef<\n React.ComponentRef<typeof SliderPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>\n>(({ className, ...props }, ref) => {\n // The Thumb is the element carrying role=\"slider\" and taking focus, so the\n // field's id and description belong on it — on the Root they would name a\n // wrapper the user can never land on.\n const {\n id,\n \"aria-describedby\": describedBy,\n \"aria-invalid\": invalid,\n \"aria-required\": ariaRequired,\n ...rootProps\n } = useFieldControl(props);\n\n return (\n <SliderPrimitive.Root\n ref={ref}\n className={cn(\n \"relative flex w-full touch-none select-none items-center\",\n className,\n )}\n {...rootProps}\n >\n <SliderPrimitive.Track className=\"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary\">\n <SliderPrimitive.Range className=\"absolute h-full bg-primary\" />\n </SliderPrimitive.Track>\n <SliderPrimitive.Thumb\n id={id}\n aria-describedby={describedBy}\n aria-invalid={invalid}\n aria-required={ariaRequired}\n className={cn(\n \"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n coarseHitAreaClasses,\n )}\n />\n </SliderPrimitive.Root>\n );\n});\nSlider.displayName = SliderPrimitive.Root.displayName;\n\nexport { Slider };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../lib/utils\";\n\nconst Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"rounded-lg border bg-card text-card-foreground shadow-sm\", className)}\n {...props}\n />\n )\n);\nCard.displayName = \"Card\";\n\nconst CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex flex-col space-y-1.5 p-[var(--density-padding-xl)]\", className)}\n {...props}\n />\n )\n);\nCardHeader.displayName = \"CardHeader\";\n\nconst CardTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(\n ({ className, ...props }, ref) => (\n <h3\n ref={ref}\n className={cn(\"text-2xl font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n )\n);\nCardTitle.displayName = \"CardTitle\";\n\nconst CardDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>(\n ({ className, ...props }, ref) => (\n <p ref={ref} className={cn(\"text-sm text-muted-foreground\", className)} {...props} />\n )\n);\nCardDescription.displayName = \"CardDescription\";\n\nconst CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"p-[var(--density-padding-xl)] pt-0\", className)} {...props} />\n )\n);\nCardContent.displayName = \"CardContent\";\n\nconst CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex items-center p-[var(--density-padding-xl)] pt-0\", className)}\n {...props}\n />\n )\n);\nCardFooter.displayName = \"CardFooter\";\n\nexport { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };\n","'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n CircleAlert,\n CircleCheck,\n Info,\n ShieldAlert,\n TriangleAlert,\n X,\n} from 'lucide-react';\nimport { cn } from '../lib/utils';\n\nconst alertVariants = cva(\n 'flex w-full items-start gap-3 rounded-[var(--radius-md)] border p-4 text-sm',\n {\n variants: {\n variant: {\n default:\n 'bg-muted/50 text-foreground border-border [&_[data-alert-icon]]:text-muted-foreground dark:bg-muted/30 dark:border-border-strong',\n destructive:\n 'border-destructive-300 bg-destructive-50 text-destructive-900 [&_[data-alert-icon]]:text-destructive-600 dark:border-destructive-700 dark:bg-destructive-900/60 dark:text-destructive-100 dark:[&_[data-alert-icon]]:text-destructive-300',\n success:\n 'border-success-300 bg-success-50 text-success-900 [&_[data-alert-icon]]:text-success-600 dark:border-success-700 dark:bg-success-900/60 dark:text-success-100 dark:[&_[data-alert-icon]]:text-success-300',\n warning:\n 'border-warning-300 bg-warning-50 text-warning-900 [&_[data-alert-icon]]:text-warning-600 dark:border-warning-700 dark:bg-warning-900/60 dark:text-warning-100 dark:[&_[data-alert-icon]]:text-warning-300',\n /**\n * @deprecated Use `variant=\"destructive\"` instead — `danger` is a\n * visual duplicate and will be removed in a future major release.\n */\n danger:\n 'border-destructive-300 bg-destructive-50 text-destructive-900 [&_[data-alert-icon]]:text-destructive-600 dark:border-destructive-700 dark:bg-destructive-900/60 dark:text-destructive-100 dark:[&_[data-alert-icon]]:text-destructive-300',\n info: 'border-primary-300 bg-primary-50 text-primary-900 [&_[data-alert-icon]]:text-primary-600 dark:border-primary-700 dark:bg-primary-900/60 dark:text-primary-100 dark:[&_[data-alert-icon]]:text-primary-300',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n },\n);\n\nconst defaultIcons: Record<string, React.ReactNode> = {\n default: <Info className=\"size-4\" />,\n destructive: <ShieldAlert className=\"size-4\" />,\n success: <CircleCheck className=\"size-4\" />,\n warning: <TriangleAlert className=\"size-4\" />,\n danger: <CircleAlert className=\"size-4\" />,\n info: <Info className=\"size-4\" />,\n};\n\nexport interface AlertProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof alertVariants> {\n /**\n * Whether to render a leading icon. When `true` and no `icon` is provided,\n * the variant's built-in default icon is rendered. Defaults to `false`.\n */\n showIcon?: boolean;\n /**\n * Renders any React node as the leading icon (e.g. `<FontAwesomeIcon … />`,\n * a Lucide icon, or an inline SVG). When set, this takes precedence over\n * `showIcon` and replaces the default icon entirely.\n */\n icon?: React.ReactNode;\n /** Whether the alert can be dismissed. Defaults to `false`. */\n dismissable?: boolean;\n /** Callback fired when the dismiss button is clicked. */\n onDismiss?: () => void;\n}\n\nconst Alert = React.forwardRef<HTMLDivElement, AlertProps>(\n (\n {\n className,\n variant = 'default',\n showIcon = false,\n icon,\n dismissable = false,\n onDismiss,\n children,\n ...props\n },\n ref,\n ) => {\n const [dismissed, setDismissed] = React.useState(false);\n\n if (dismissed) return null;\n\n const resolvedIcon =\n icon ?? (showIcon ? defaultIcons[variant ?? 'default'] : null);\n\n const leading = resolvedIcon ? (\n <span\n className=\"mt-0.5 inline-flex shrink-0 [&_svg]:shrink-0\"\n data-alert-icon=\"\"\n aria-hidden\n >\n {resolvedIcon}\n </span>\n ) : null;\n\n const handleDismiss = () => {\n setDismissed(true);\n onDismiss?.();\n };\n\n return (\n <div\n ref={ref}\n role=\"alert\"\n className={cn(alertVariants({ variant }), 'min-w-0', className)}\n {...props}\n >\n {leading}\n <div className=\"min-w-0 flex-1\">{children}</div>\n {dismissable ? (\n <button\n type=\"button\"\n onClick={handleDismiss}\n className=\"shrink-0 self-start rounded-[var(--radius-sm)] p-1.5 opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:ring-offset-2\"\n aria-label=\"Dismiss\"\n >\n <X className=\"size-4\" />\n </button>\n ) : null}\n </div>\n );\n },\n);\nAlert.displayName = 'Alert';\n\nconst AlertTitle = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h5\n ref={ref}\n className={cn('mb-1 font-medium leading-none tracking-tight', className)}\n {...props}\n />\n));\nAlertTitle.displayName = 'AlertTitle';\n\nconst AlertDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('text-sm [&_p]:leading-relaxed', className)}\n {...props}\n />\n));\nAlertDescription.displayName = 'AlertDescription';\n\nexport { Alert, AlertTitle, AlertDescription, alertVariants };\n","/**\n * Soft semantic tints — used for status indicators (badges, callouts) where\n * the element is informational/passive (not an interactive tile or button).\n *\n * Pattern: `border-{color}-500/30 bg-{color}-500/10 text-{color}-700`\n * with dark-mode shifts to `*-400` shades. Yields a subtle, non-clickable\n * \"I am a {success|warning|error|info} indicator\" look.\n *\n * Distinct from `semantic-action-tones.ts`:\n * - Action tones (positive/negative): brighter, clickable tile look\n * (`bg-X-100 + border-X-200/0.9 + text-X-600 + shadow-sm`). Used by Button.\n * - Tint tones (here): subtler, indicator look. Used by Badge.\n *\n * If you find yourself reaching for \"soft semantic background\" — interactive\n * → use action tones; passive → use these.\n */\n\nexport const tintToneSuccess =\n 'border-success-500/30 bg-success-500/10 text-success-700 dark:border-success-400/30 dark:bg-success-400/10 dark:text-success-400';\n\nexport const tintToneWarning =\n 'border-warning-500/30 bg-warning-500/10 text-warning-700 dark:border-warning-400/30 dark:bg-warning-400/10 dark:text-warning-400';\n\nexport const tintToneDestructive =\n 'border-destructive-500/30 bg-destructive-500/10 text-destructive-700 dark:border-destructive-400/30 dark:bg-destructive-400/10 dark:text-destructive-400';\n\nexport const tintToneInfo =\n 'border-primary-500/30 bg-primary-500/10 text-primary-700 dark:border-primary-400/30 dark:bg-primary-400/10 dark:text-primary-400';\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../lib/utils\";\nimport {\n tintToneDestructive,\n tintToneInfo,\n tintToneSuccess,\n tintToneWarning,\n} from \"../lib/semantic-tint-tones\";\n\nconst badgeVariants = cva(\n \"inline-flex h-6 items-center justify-center rounded-md border px-2.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-primary/40 focus:ring-offset-2\",\n {\n variants: {\n variant: {\n default:\n \"border-border bg-muted text-muted-foreground hover:bg-muted/80\",\n secondary:\n \"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary-700\",\n accent:\n \"border-transparent bg-brand-accent text-brand-accent-foreground hover:bg-brand-accent-600\",\n highlight:\n \"border-transparent bg-highlight text-highlight-foreground hover:bg-highlight-600\",\n destructive:\n \"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive-700\",\n outline: \"text-foreground\",\n success: tintToneSuccess,\n warning: tintToneWarning,\n error: tintToneDestructive,\n info: tintToneInfo,\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nexport interface BadgeProps\n extends\n React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof badgeVariants> {}\n\nfunction Badge({ className, variant, ...props }: BadgeProps) {\n return (\n <div className={cn(badgeVariants({ variant }), className)} {...props} />\n );\n}\n\nexport { Badge, badgeVariants };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../lib/utils\";\n\nconst DEFAULT_SIZE = 160;\nconst DEFAULT_DURATION = 26;\nconst REPEAT_COUNT = 4;\nconst DEFAULT_DIVIDER = \"•\";\nconst VIEWBOX = 200;\n\nexport interface RotatingBadgeProps\n extends React.HTMLAttributes<HTMLDivElement> {\n /** Rim copy. Do not include the divider; it is inserted between repeats. */\n text: string;\n /** Center mark. Pass an `img`, Next.js `Image`, or inline SVG. */\n image: React.ReactNode;\n /**\n * Character or short string placed between repeats. Spaces are added on\n * both sides; do not pad this value. Defaults to `\"•\"`.\n */\n divider?: string;\n /** Diameter in pixels. Defaults to 160; scale with this, not a wrapper transform. */\n size?: number;\n /** Seconds for one full rotation. Defaults to 26. */\n duration?: number;\n /** Extra classes on the center-mark wrapper. */\n imageClassName?: string;\n /** Draw a full-bleed hairline through the vertical center, masked around the seal. */\n rule?: boolean;\n /** Extra classes on the hairline (color, opacity). Defaults to `bg-border`. */\n ruleClassName?: string;\n}\n\nfunction ringChars(text: string, divider: string): string[] {\n return Array.from(`${text} ${divider} `.repeat(REPEAT_COUNT));\n}\n\nfunction renderChar(char: string): string {\n // SVG collapses a plain space when it is the entire text content of an element.\n return char === \" \" ? \"\\u00a0\" : char;\n}\n\n/**\n * A circular seal: a consumer-supplied center mark with rim copy on a slow\n * continuous spin (paused for `prefers-reduced-motion`). Purely presentational.\n */\nconst RotatingBadge = React.forwardRef<HTMLDivElement, RotatingBadgeProps>(\n (\n {\n text,\n image,\n divider = DEFAULT_DIVIDER,\n size = DEFAULT_SIZE,\n duration = DEFAULT_DURATION,\n className,\n imageClassName,\n rule = false,\n ruleClassName,\n style,\n ...props\n },\n ref,\n ) => {\n const chars = React.useMemo(() => ringChars(text, divider), [text, divider]);\n const step = 360 / chars.length;\n const clearRadius = size / 2 + 60;\n const fadeWidth = 20;\n const maskImage = `linear-gradient(to right, black 0, black calc(50% - ${clearRadius}px), transparent calc(50% - ${clearRadius - fadeWidth}px), transparent calc(50% + ${clearRadius - fadeWidth}px), black calc(50% + ${clearRadius}px), black 100%)`;\n\n return (\n <div\n ref={ref}\n className={cn(\n \"relative flex shrink-0 items-center justify-center rounded-full font-bold\",\n className,\n )}\n style={{ width: size, height: size, ...style }}\n {...props}\n >\n {rule ? (\n <div\n aria-hidden\n className={cn(\n \"pointer-events-none absolute top-1/2 left-1/2 h-px w-screen -translate-x-1/2 -translate-y-1/2 bg-border opacity-80\",\n ruleClassName,\n )}\n style={{ maskImage, WebkitMaskImage: maskImage }}\n />\n ) : null}\n\n <svg\n viewBox={`0 0 ${VIEWBOX} ${VIEWBOX}`}\n aria-hidden\n className=\"absolute inset-0 size-full origin-center animate-spin fill-current motion-reduce:animate-none [font-family:inherit] [font-weight:inherit]\"\n style={{\n animationDuration: `${duration}s`,\n animationTimingFunction: \"linear\",\n }}\n >\n {chars.map((char, i) => (\n <text\n key={i}\n x={VIEWBOX / 2}\n y={18}\n textAnchor=\"middle\"\n fontSize={14}\n fill=\"currentColor\"\n transform={`rotate(${-90 + i * step} ${VIEWBOX / 2} ${VIEWBOX / 2})`}\n >\n {renderChar(char)}\n </text>\n ))}\n </svg>\n\n <div\n className={cn(\n \"relative z-10 flex items-center justify-center [&_img]:block [&_img]:h-auto [&_img]:w-full [&_svg]:h-auto [&_svg]:w-full\",\n imageClassName,\n )}\n style={{ width: size * 0.34 }}\n >\n {image}\n </div>\n </div>\n );\n },\n);\nRotatingBadge.displayName = \"RotatingBadge\";\n\nexport { RotatingBadge };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Avatar as AvatarPrimitive } from \"radix-ui\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../lib/utils\";\n\nconst avatarVariants = cva(\n \"relative flex h-10 w-10 shrink-0\",\n {\n variants: {\n shape: {\n circle: \"rounded-full\",\n rounded: \"rounded-2xl\",\n square: \"rounded-lg\",\n },\n },\n defaultVariants: {\n shape: \"circle\",\n },\n }\n);\n\ninterface AvatarProps\n extends React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>,\n VariantProps<typeof avatarVariants> {\n /**\n * Clip content to the avatar shape. Defaults to `true`. Set `false` to let an\n * overlay that a source bakes into the image extend past the shape — e.g. a\n * Google \"Local Guide\" star badge composited into the corner of a profile\n * photo, which a circular clip would otherwise cut off.\n */\n clip?: boolean;\n}\n\nconst Avatar = React.forwardRef<\n React.ComponentRef<typeof AvatarPrimitive.Root>,\n AvatarProps\n>(({ className, shape, clip = true, ...props }, ref) => (\n <AvatarPrimitive.Root\n ref={ref}\n className={cn(\n avatarVariants({ shape }),\n clip ? \"overflow-hidden\" : \"overflow-visible\",\n className,\n )}\n {...props}\n />\n));\nAvatar.displayName = AvatarPrimitive.Root.displayName;\n\nconst AvatarImage = React.forwardRef<\n React.ComponentRef<typeof AvatarPrimitive.Image>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Image ref={ref} className={cn(\"aspect-square h-full w-full\", className)} {...props} />\n));\nAvatarImage.displayName = AvatarPrimitive.Image.displayName;\n\nconst AvatarFallback = React.forwardRef<\n React.ComponentRef<typeof AvatarPrimitive.Fallback>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Fallback\n ref={ref}\n className={cn(\"flex h-full w-full items-center justify-center rounded-full bg-muted\", className)}\n {...props}\n />\n));\nAvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;\n\nexport { Avatar, AvatarImage, AvatarFallback, avatarVariants };\nexport type { AvatarProps };\n","'use client';\n\nimport * as React from 'react';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\nimport { X } from 'lucide-react';\nimport { cn } from '../lib/utils';\nimport {\n centeredModalContentClasses,\n overlayScrimClasses,\n touchTargetClasses,\n} from '../lib/surface-classes';\n\nconst Dialog = DialogPrimitive.Root;\nconst DialogTrigger = DialogPrimitive.Trigger;\nconst DialogPortal = DialogPrimitive.Portal;\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(overlayScrimClasses, className)}\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DialogContent = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(centeredModalContentClasses, className)}\n {...props}\n >\n {children}\n <DialogPrimitive.Close\n className={cn(\n 'absolute right-4 top-4 inline-flex items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground',\n touchTargetClasses,\n )}\n >\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col space-y-1.5 text-center sm:text-left',\n className,\n )}\n {...props}\n />\n);\nDialogHeader.displayName = 'DialogHeader';\n\nconst DialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',\n className,\n )}\n {...props}\n />\n);\nDialogFooter.displayName = 'DialogFooter';\n\nconst DialogTitle = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n 'text-lg font-semibold leading-none tracking-tight',\n className,\n )}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ComponentRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n};\n","'use client';\n\nimport * as React from 'react';\nimport { AlertDialog as AlertDialogPrimitive } from 'radix-ui';\nimport { cn } from '../lib/utils';\nimport {\n centeredModalContentClasses,\n overlayScrimClasses,\n} from '../lib/surface-classes';\nimport { buttonVariants } from './button';\n\nconst AlertDialog = AlertDialogPrimitive.Root;\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger;\nconst AlertDialogPortal = AlertDialogPrimitive.Portal;\n\nconst AlertDialogOverlay = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Overlay\n className={cn(overlayScrimClasses, className)}\n {...props}\n ref={ref}\n />\n));\nAlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;\n\nconst AlertDialogContent = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <AlertDialogPortal>\n <AlertDialogOverlay />\n <AlertDialogPrimitive.Content\n ref={ref}\n className={cn(centeredModalContentClasses, className)}\n {...props}\n />\n </AlertDialogPortal>\n));\nAlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;\n\nconst AlertDialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col space-y-2 text-center sm:text-left',\n className,\n )}\n {...props}\n />\n);\n\nconst AlertDialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',\n className,\n )}\n {...props}\n />\n);\n\nconst AlertDialogTitle = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold', className)}\n {...props}\n />\n));\nAlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;\n\nconst AlertDialogDescription = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Description\n ref={ref}\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nAlertDialogDescription.displayName =\n AlertDialogPrimitive.Description.displayName;\n\nconst AlertDialogAction = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Action>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Action\n ref={ref}\n className={cn(buttonVariants(), className)}\n {...props}\n />\n));\nAlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;\n\nconst AlertDialogCancel = React.forwardRef<\n React.ComponentRef<typeof AlertDialogPrimitive.Cancel>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Cancel\n ref={ref}\n className={cn(\n buttonVariants({ variant: 'outline' }),\n 'mt-2 sm:mt-0',\n className,\n )}\n {...props}\n />\n));\nAlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;\n\nexport {\n AlertDialog,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogTrigger,\n AlertDialogContent,\n AlertDialogHeader,\n AlertDialogFooter,\n AlertDialogTitle,\n AlertDialogDescription,\n AlertDialogAction,\n AlertDialogCancel,\n};\n","'use client';\n\nimport * as React from 'react';\nimport { Dialog as SheetPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { X } from 'lucide-react';\nimport { cn } from '../lib/utils';\nimport { overlayScrimClasses, touchTargetClasses } from '../lib/surface-classes';\n\nconst Sheet = SheetPrimitive.Root;\nconst SheetTrigger = SheetPrimitive.Trigger;\nconst SheetClose = SheetPrimitive.Close;\nconst SheetPortal = SheetPrimitive.Portal;\n\nconst SheetOverlay = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Overlay\n className={cn(overlayScrimClasses, className)}\n {...props}\n ref={ref}\n />\n));\nSheetOverlay.displayName = SheetPrimitive.Overlay.displayName;\n\nconst sheetVariants = cva(\n 'fixed z-[var(--z-modal)] gap-4 bg-background p-6 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:[animation-duration:var(--panel-open-dur)] data-[state=closed]:[animation-duration:var(--panel-close-dur)] data-[state=open]:[animation-timing-function:var(--panel-ease)] data-[state=closed]:[animation-timing-function:var(--panel-ease)]',\n {\n variants: {\n side: {\n top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',\n bottom:\n 'inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',\n left: 'inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left',\n right:\n 'inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right',\n },\n size: {\n sm: '',\n md: '',\n lg: '',\n xl: '',\n full: '',\n },\n },\n defaultVariants: {\n side: 'right',\n size: 'sm',\n },\n compoundVariants: [\n { side: 'left', size: 'sm', className: 'sm:max-w-sm' },\n { side: 'left', size: 'md', className: 'sm:max-w-md' },\n { side: 'left', size: 'lg', className: 'sm:max-w-lg' },\n { side: 'left', size: 'xl', className: 'sm:max-w-xl' },\n { side: 'left', size: 'full', className: 'sm:max-w-full' },\n { side: 'right', size: 'sm', className: 'sm:max-w-sm' },\n { side: 'right', size: 'md', className: 'sm:max-w-md' },\n { side: 'right', size: 'lg', className: 'sm:max-w-lg' },\n { side: 'right', size: 'xl', className: 'sm:max-w-xl' },\n { side: 'right', size: 'full', className: 'sm:max-w-full' },\n ],\n },\n);\n\ninterface SheetContentProps\n extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,\n VariantProps<typeof sheetVariants> {}\n\nconst SheetContent = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Content>,\n SheetContentProps\n>(({ side = 'right', size = 'sm', className, children, ...props }, ref) => (\n <SheetPortal>\n <SheetOverlay />\n <SheetPrimitive.Content\n ref={ref}\n className={cn(sheetVariants({ side, size }), className)}\n {...props}\n >\n {children}\n <SheetPrimitive.Close\n className={cn(\n 'absolute right-4 top-4 inline-flex items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary',\n touchTargetClasses,\n )}\n >\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n </SheetPrimitive.Content>\n </SheetPortal>\n));\nSheetContent.displayName = SheetPrimitive.Content.displayName;\n\nconst SheetHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col space-y-2 text-center sm:text-left',\n className,\n )}\n {...props}\n />\n);\n\nconst SheetFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',\n className,\n )}\n {...props}\n />\n);\n\nconst SheetTitle = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold text-foreground', className)}\n {...props}\n />\n));\nSheetTitle.displayName = SheetPrimitive.Title.displayName;\n\nconst SheetDescription = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Description\n ref={ref}\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nSheetDescription.displayName = SheetPrimitive.Description.displayName;\n\nexport {\n Sheet,\n SheetPortal,\n SheetOverlay,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n};\n","'use client';\n\n/**\n * DropdownMenu — visually mirrored by `context-menu.tsx`. Both pull chrome\n * from `lib/surface-classes.ts` (menuSurfaceClasses, menuItemClasses, etc.)\n * so they stay in lockstep. Edit the shared classes file, not this one or\n * context-menu.tsx, when tweaking menu visuals.\n */\n\nimport * as React from 'react';\nimport { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';\nimport { Check, ChevronRight, Circle } from 'lucide-react';\nimport { cn } from '../lib/utils';\nimport {\n floatingAnimationClasses,\n menuItemClasses,\n menuItemWithIndicatorClasses,\n menuSeparatorClasses,\n menuSurfaceClasses,\n} from '../lib/surface-classes';\n\nconst DropdownMenu = DropdownMenuPrimitive.Root;\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n menuItemClasses,\n 'data-[state=open]:bg-accent',\n inset && 'pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto h-4 w-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n menuSurfaceClasses,\n floatingAnimationClasses,\n 'shadow-lg',\n className,\n )}\n {...props}\n />\n));\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\nconst DropdownMenuContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(menuSurfaceClasses, floatingAnimationClasses, className)}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(menuItemClasses, inset && 'pl-8', className)}\n {...props}\n />\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(menuItemWithIndicatorClasses, className)}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(menuItemWithIndicatorClasses, className)}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Circle className=\"h-2 w-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n 'px-2 py-1.5 text-sm font-semibold',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn(menuSeparatorClasses, className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => (\n <span\n className={cn('ml-auto text-xs tracking-widest opacity-60', className)}\n {...props}\n />\n);\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n};\n","\"use client\";\n\nimport { Toaster as SonnerToaster, toast } from \"sonner\";\n\nexport interface ToasterProps {\n position?: \"top-left\" | \"top-right\" | \"bottom-left\" | \"bottom-right\" | \"top-center\" | \"bottom-center\";\n richColors?: boolean;\n closeButton?: boolean;\n className?: string;\n}\n\nfunction Toaster({ position = \"bottom-right\", richColors = true, closeButton = true, ...props }: ToasterProps) {\n return (\n <SonnerToaster\n position={position}\n richColors={richColors}\n closeButton={closeButton}\n toastOptions={{\n classNames: {\n toast: \"group border-border bg-background text-foreground shadow-lg\",\n description: \"text-muted-foreground\",\n actionButton: \"bg-primary text-primary-foreground\",\n cancelButton: \"bg-muted text-muted-foreground\",\n },\n }}\n {...props}\n />\n );\n}\n\nexport { Toaster, toast };\n","'use client';\n\nimport * as React from 'react';\nimport { Tabs as TabsPrimitive } from 'radix-ui';\nimport { cn } from '../lib/utils';\n\nconst Tabs = TabsPrimitive.Root;\n\n// useLayoutEffect warns on the server; fall back to useEffect there.\nconst useIsomorphicLayoutEffect =\n typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\n\nconst TabsList = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, children, ...props }, forwardedRef) => {\n const innerRef = React.useRef<HTMLDivElement | null>(null);\n const pillRef = React.useRef<HTMLSpanElement | null>(null);\n\n // Merge the forwarded ref with our internal one.\n const setRef = React.useCallback(\n (node: HTMLDivElement | null) => {\n innerRef.current = node;\n if (typeof forwardedRef === 'function') forwardedRef(node);\n else if (forwardedRef) forwardedRef.current = node;\n },\n [forwardedRef],\n );\n\n // Slide the pill behind whichever trigger Radix has marked active. The pill\n // shares the list as its offset parent, so a trigger's offsetLeft/offsetWidth\n // map directly to the pill's translateX/width.\n const move = React.useCallback((animate: boolean) => {\n const list = innerRef.current;\n const pill = pillRef.current;\n if (!list || !pill) return;\n\n const active = list.querySelector<HTMLElement>(\n '[role=\"tab\"][data-state=\"active\"]',\n );\n if (!active) {\n pill.style.opacity = '0';\n return;\n }\n\n // Suspend via transition-property (not the `transition` shorthand) so the\n // inline duration/easing from the --tabs-* tokens survive the snap.\n if (!animate) pill.style.transitionProperty = 'none';\n pill.style.opacity = '1';\n pill.style.transform = `translateX(${active.offsetLeft}px)`;\n pill.style.width = `${active.offsetWidth}px`;\n if (!animate) {\n // Force a reflow so the snap applies before transitions are restored.\n void pill.offsetWidth;\n pill.style.transitionProperty = '';\n }\n }, []);\n\n useIsomorphicLayoutEffect(() => {\n move(false);\n\n const list = innerRef.current;\n if (!list) return;\n\n // Radix flips data-state on triggers for both pointer and keyboard nav.\n const observer = new MutationObserver(() => move(true));\n observer.observe(list, {\n subtree: true,\n attributes: true,\n attributeFilter: ['data-state'],\n childList: true,\n });\n\n const resize = new ResizeObserver(() => move(false));\n resize.observe(list);\n\n return () => {\n observer.disconnect();\n resize.disconnect();\n };\n }, [move]);\n\n return (\n <TabsPrimitive.List\n ref={setRef}\n className={cn(\n 'relative isolate inline-flex h-[var(--density-height-md)] items-center justify-center rounded-md bg-muted p-1 text-muted-foreground',\n className,\n )}\n {...props}\n >\n <span\n ref={pillRef}\n aria-hidden=\"true\"\n className={cn(\n 'pointer-events-none absolute bottom-1 left-0 top-1 z-0 rounded-sm opacity-0 shadow-sm',\n 'bg-[var(--bison-tab-active-bg,hsl(var(--primary)))]',\n 'transition-[transform,width] motion-reduce:transition-none',\n )}\n style={{\n transitionDuration: 'var(--tabs-dur)',\n transitionTimingFunction: 'var(--tabs-ease)',\n }}\n />\n {children}\n </TabsPrimitive.List>\n );\n});\nTabsList.displayName = TabsPrimitive.List.displayName;\n\nconst TabsTrigger = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n 'relative z-[1] inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:text-[var(--bison-tab-active-fg,hsl(var(--primary-foreground)))]',\n className,\n )}\n {...props}\n />\n));\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName;\n\nconst TabsContent = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Content\n ref={ref}\n className={cn(\n 'mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2',\n className,\n )}\n {...props}\n />\n));\nTabsContent.displayName = TabsPrimitive.Content.displayName;\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { Check, FastForward } from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\nimport { tintToneSuccess, tintToneWarning } from \"../lib/semantic-tint-tones\";\n\nexport type StepperState = \"completed\" | \"active\" | \"skipped\" | \"upcoming\";\nexport type StepperOrientation = \"horizontal\" | \"vertical\";\n\n// Indicator size — kept as a constant so connector positioning math is exact.\nconst INDICATOR_SIZE_PX = 36; // matches h-9/w-9\nconst INDICATOR_CENTER_PX = INDICATOR_SIZE_PX / 2; // 18\nconst CONNECTOR_THICKNESS_PX = 2; // h-0.5 / w-0.5\n// Minimum connector length when there's no surrounding content to push items\n// apart. Keeps the visual rhythm consistent.\nconst MIN_CONNECTOR_LENGTH_PX = 24;\n\ntype StepperContextValue = {\n orientation: StepperOrientation;\n interactive: boolean;\n allowSkipAhead: boolean;\n onStepClick?: (index: number) => void;\n};\n\nconst StepperContext = React.createContext<StepperContextValue | null>(null);\n\nfunction useStepperContext(component: string) {\n const ctx = React.useContext(StepperContext);\n if (!ctx) {\n throw new Error(`<${component}> must be used inside <Stepper>`);\n }\n return ctx;\n}\n\ntype StepperItemContextValue = {\n state: StepperState;\n index: number;\n isLast: boolean;\n disabled: boolean;\n};\n\nconst StepperItemContext = React.createContext<StepperItemContextValue | null>(\n null,\n);\n\nfunction useStepperItemContext(component: string) {\n const ctx = React.useContext(StepperItemContext);\n if (!ctx) {\n throw new Error(`<${component}> must be used inside <StepperItem>`);\n }\n return ctx;\n}\n\nexport interface StepperProps extends React.HTMLAttributes<HTMLDivElement> {\n orientation?: StepperOrientation;\n interactive?: boolean;\n allowSkipAhead?: boolean;\n onStepClick?: (index: number) => void;\n}\n\nconst Stepper = React.forwardRef<HTMLDivElement, StepperProps>(\n (\n {\n className,\n orientation = \"horizontal\",\n interactive = false,\n allowSkipAhead = false,\n onStepClick,\n children,\n ...props\n },\n ref,\n ) => {\n const value = React.useMemo<StepperContextValue>(\n () => ({\n orientation,\n interactive,\n allowSkipAhead,\n onStepClick,\n }),\n [orientation, interactive, allowSkipAhead, onStepClick],\n );\n\n // Derive each item's index and `isLast` flag from its JSX position rather\n // than from a shared mutable counter. The counter approach was unsound:\n // it relied on every `<StepperItem>` re-rendering exactly once per\n // `<Stepper>` render, in order. React 19 strict-mode double renders,\n // concurrent renders, and out-of-band item re-renders can all break that\n // contract, causing indices (and therefore `isLast`) to drift — which\n // shows up as wrong step numbers and a stray trailing connector.\n //\n // Instead we walk the children once here, count `<StepperItem>` matches\n // up-front, then `cloneElement` each item with `_index` and `_isLast`\n // injected as internal props. Non-item children pass through untouched.\n const childArray = React.Children.toArray(children);\n const totalItems = childArray.reduce<number>(\n (acc, child) =>\n React.isValidElement(child) &&\n (child.type as { displayName?: string })?.displayName === \"StepperItem\"\n ? acc + 1\n : acc,\n 0,\n );\n\n let itemIndex = 0;\n const decoratedChildren = childArray.map((child) => {\n if (\n !React.isValidElement(child) ||\n (child.type as { displayName?: string })?.displayName !== \"StepperItem\"\n ) {\n return child;\n }\n const index = itemIndex;\n itemIndex += 1;\n return React.cloneElement(child as React.ReactElement<StepperItemProps>, {\n _index: index,\n _isLast: index === totalItems - 1,\n });\n });\n\n return (\n <StepperContext.Provider value={value}>\n <div\n ref={ref}\n role={interactive ? \"tablist\" : undefined}\n aria-orientation={orientation}\n className={cn(\n \"flex w-full\",\n orientation === \"horizontal\"\n ? \"flex-row items-start\"\n : \"flex-col items-stretch\",\n className,\n )}\n {...props}\n >\n {decoratedChildren}\n </div>\n </StepperContext.Provider>\n );\n },\n);\nStepper.displayName = \"Stepper\";\n\nconst stepperItemVariants = cva(\n \"group/stepper-item relative flex transition-colors\",\n {\n variants: {\n orientation: {\n // Horizontal items grow to share the row equally. Indicator at top,\n // label/description block below. Trailing connector is absolutely\n // positioned at the indicator's vertical center.\n horizontal: \"min-w-0 flex-1 flex-col items-center text-center\",\n // Vertical items have indicator on the left, label/description block\n // on the right. Trailing connector is absolutely positioned at the\n // indicator's horizontal center.\n vertical: \"flex-row items-start gap-3 text-left\",\n },\n interactive: {\n true: \"cursor-pointer rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-60\",\n false: \"\",\n },\n },\n defaultVariants: {\n orientation: \"horizontal\",\n interactive: false,\n },\n },\n);\n\nexport interface StepperItemProps extends Omit<\n React.HTMLAttributes<HTMLDivElement | HTMLButtonElement>,\n \"onClick\"\n> {\n state?: StepperState;\n /**\n * Color of the connector that follows this item. Defaults to the item's own\n * `state`, which yields a \"fills in\" effect as the user progresses.\n */\n connectorState?: StepperState;\n /**\n * Hide the trailing connector for this item. Useful if you need a custom\n * separator. The last item never renders a connector regardless of this prop.\n */\n hideConnector?: boolean;\n disabled?: boolean;\n onClick?: (event: React.MouseEvent<HTMLElement>) => void;\n /**\n * @internal Injected by the parent `<Stepper>` based on JSX position. Do\n * not pass directly — `<Stepper>` clones each `<StepperItem>` to set this.\n */\n _index?: number;\n /**\n * @internal Injected by the parent `<Stepper>` based on JSX position. Do\n * not pass directly — `<Stepper>` clones each `<StepperItem>` to set this.\n */\n _isLast?: boolean;\n}\n\nconst StepperItem = React.forwardRef<HTMLElement, StepperItemProps>(\n (\n {\n state = \"upcoming\",\n connectorState,\n hideConnector = false,\n disabled: disabledProp,\n className,\n onClick,\n children,\n _index,\n _isLast,\n ...props\n },\n ref,\n ) => {\n const { orientation, interactive, allowSkipAhead, onStepClick } =\n useStepperContext(\"StepperItem\");\n\n // `_index` and `_isLast` are injected by the parent `<Stepper>` based on\n // JSX position. We default them defensively so a `<StepperItem>` rendered\n // in isolation (e.g. a snapshot test) still produces sensible output —\n // it's treated as the only/last step.\n const index = _index ?? 0;\n const isLast = _isLast ?? true;\n\n const disabled =\n disabledProp ?? (interactive && state === \"upcoming\" && !allowSkipAhead);\n\n const itemValue = React.useMemo<StepperItemContextValue>(\n () => ({ state, index, isLast, disabled }),\n [state, index, isLast, disabled],\n );\n\n const handleClick = (event: React.MouseEvent<HTMLElement>) => {\n if (disabled) return;\n onClick?.(event);\n onStepClick?.(index);\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLElement>) => {\n if (!interactive) return;\n const target = event.currentTarget;\n const items = Array.from(\n target.parentElement?.querySelectorAll<HTMLElement>(\n '[data-stepper-item=\"true\"]:not([disabled])',\n ) ?? [],\n );\n const currentIdx = items.indexOf(target);\n if (currentIdx < 0) return;\n\n const nextKey = orientation === \"horizontal\" ? \"ArrowRight\" : \"ArrowDown\";\n const prevKey = orientation === \"horizontal\" ? \"ArrowLeft\" : \"ArrowUp\";\n\n if (event.key === nextKey) {\n event.preventDefault();\n items[(currentIdx + 1) % items.length]?.focus();\n } else if (event.key === prevKey) {\n event.preventDefault();\n items[(currentIdx - 1 + items.length) % items.length]?.focus();\n } else if (event.key === \"Home\") {\n event.preventDefault();\n items[0]?.focus();\n } else if (event.key === \"End\") {\n event.preventDefault();\n items[items.length - 1]?.focus();\n }\n };\n\n const showConnector = !isLast && !hideConnector;\n const resolvedConnectorState = connectorState ?? state;\n\n // Ensure each item has enough length for the connector to be visible even\n // when the content is short. Padding stays inside the item so the next\n // item's indicator sits flush against the end of the connector.\n const itemSpacing = !showConnector\n ? \"\"\n : orientation === \"vertical\"\n ? \"pb-8\"\n : \"\";\n\n const sharedProps = {\n \"data-stepper-item\": \"true\" as const,\n \"data-state\": state,\n \"aria-current\": state === \"active\" ? (\"step\" as const) : undefined,\n className: cn(\n stepperItemVariants({ orientation, interactive }),\n itemSpacing,\n className,\n ),\n };\n\n // Split children into the indicator and everything else, then wrap the\n // \"rest\" in a labelled content block. This lets users write:\n //\n // <StepperItem>\n // <StepperIndicator />\n // <StepperLabel>...</StepperLabel>\n // <StepperDescription>...</StepperDescription>\n // </StepperItem>\n //\n // …without manually grouping label + description in a wrapper div.\n const { indicator, rest } = splitIndicator(children);\n\n const content = (\n <StepperItemContext.Provider value={itemValue}>\n {indicator}\n {rest.length > 0 ? (\n <div\n className={cn(\n \"relative z-10 flex min-w-0 flex-col gap-1\",\n orientation === \"horizontal\"\n ? \"mt-2 items-center\"\n : \"flex-1 items-start\",\n )}\n >\n {rest}\n </div>\n ) : null}\n {showConnector ? (\n <Connector orientation={orientation} state={resolvedConnectorState} />\n ) : null}\n </StepperItemContext.Provider>\n );\n\n if (interactive) {\n return (\n <button\n ref={ref as React.Ref<HTMLButtonElement>}\n type=\"button\"\n role=\"tab\"\n aria-selected={state === \"active\"}\n disabled={disabled}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n {...sharedProps}\n {...(props as React.ButtonHTMLAttributes<HTMLButtonElement>)}\n >\n {content}\n </button>\n );\n }\n\n return (\n <div\n ref={ref as React.Ref<HTMLDivElement>}\n {...sharedProps}\n {...(props as React.HTMLAttributes<HTMLDivElement>)}\n >\n {content}\n </div>\n );\n },\n);\nStepperItem.displayName = \"StepperItem\";\n\n/**\n * Trailing connector line, absolutely positioned along the indicator's\n * center axis. By anchoring to the item box (not to a flex sibling) the\n * line is guaranteed to align with the indicator regardless of how much\n * content sits below or beside it.\n *\n * - Horizontal: line runs from the right edge of this item's indicator to\n * the left edge of the next item's indicator. Top = indicator center.\n * - Vertical: line runs from the bottom edge of this item's indicator to\n * the top edge of the next item's indicator. Left = indicator center.\n */\nfunction Connector({\n orientation,\n state,\n}: {\n orientation: StepperOrientation;\n state: StepperState;\n}) {\n if (orientation === \"horizontal\") {\n return (\n <div\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none absolute z-0 h-0.5 transition-colors\",\n connectorColor(state),\n )}\n style={{\n top: INDICATOR_CENTER_PX - CONNECTOR_THICKNESS_PX / 2,\n left: `calc(50% + ${INDICATOR_CENTER_PX}px)`,\n right: `calc(-50% + ${INDICATOR_CENTER_PX}px)`,\n }}\n />\n );\n }\n\n return (\n <div\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none absolute z-0 w-0.5 transition-colors\",\n connectorColor(state),\n )}\n style={{\n left: INDICATOR_CENTER_PX - CONNECTOR_THICKNESS_PX / 2,\n top: INDICATOR_SIZE_PX,\n bottom: 0,\n }}\n />\n );\n}\n\n/**\n * Pulls the first <StepperIndicator> out of a children list. Returns the\n * indicator (or null) and the remaining children. Identity-checked so it\n * works with forwardRef wrappers regardless of displayName quirks.\n */\nfunction splitIndicator(children: React.ReactNode): {\n indicator: React.ReactNode | null;\n rest: React.ReactNode[];\n} {\n let indicator: React.ReactNode | null = null;\n const rest: React.ReactNode[] = [];\n\n React.Children.forEach(children, (child) => {\n if (\n indicator === null &&\n React.isValidElement(child) &&\n child.type === StepperIndicator\n ) {\n indicator = child;\n } else {\n rest.push(child);\n }\n });\n\n return { indicator, rest };\n}\n\nfunction connectorColor(state: StepperState): string {\n switch (state) {\n case \"completed\":\n return \"bg-success-500 dark:bg-success-400\";\n case \"active\":\n return \"bg-primary\";\n case \"skipped\":\n return \"bg-warning-500 dark:bg-warning-400\";\n case \"upcoming\":\n default:\n return \"bg-border\";\n }\n}\n\nconst stepperIndicatorVariants = cva(\n \"relative z-10 inline-flex shrink-0 items-center justify-center rounded-full border-2 text-sm font-semibold transition-colors\",\n {\n variants: {\n state: {\n completed: tintToneSuccess,\n active:\n \"border-primary bg-primary text-primary-foreground ring-2 ring-primary/30 ring-offset-2 ring-offset-background\",\n skipped: tintToneWarning,\n upcoming: \"border-border bg-muted text-muted-foreground\",\n },\n },\n defaultVariants: { state: \"upcoming\" },\n },\n);\n\nexport interface StepperIndicatorProps\n extends\n Omit<React.HTMLAttributes<HTMLSpanElement>, \"children\">,\n VariantProps<typeof stepperIndicatorVariants> {\n /**\n * Optional icon to render when the step is `active` or `upcoming`. Pass any\n * React node (`<FontAwesomeIcon … />`, a Lucide icon, an inline SVG, etc.).\n * Ignored for `completed` (always check) and `skipped` (always forward) states.\n */\n icon?: React.ReactNode;\n /**\n * Override the auto-generated step number. Pass a string/number to display\n * custom content for `active` / `upcoming` states.\n */\n children?: React.ReactNode;\n}\n\nconst StepperIndicator = React.forwardRef<\n HTMLSpanElement,\n StepperIndicatorProps\n>(({ className, icon, children, style, ...props }, ref) => {\n const { state, index } = useStepperItemContext(\"StepperIndicator\");\n\n let inner: React.ReactNode;\n if (state === \"completed\") {\n inner = <Check className=\"h-4 w-4\" aria-hidden=\"true\" />;\n } else if (state === \"skipped\") {\n inner = <FastForward className=\"h-4 w-4\" aria-hidden=\"true\" />;\n } else if (icon !== undefined && icon !== null) {\n inner = (\n <span className=\"inline-flex h-4 w-4 items-center justify-center [&_svg]:h-4 [&_svg]:w-4\">\n {icon}\n </span>\n );\n } else if (children !== undefined) {\n inner = children;\n } else {\n inner = index + 1;\n }\n\n return (\n <span\n ref={ref}\n aria-hidden={state !== \"active\"}\n className={cn(stepperIndicatorVariants({ state }), className)}\n style={{\n height: INDICATOR_SIZE_PX,\n width: INDICATOR_SIZE_PX,\n ...style,\n }}\n {...props}\n >\n {inner}\n </span>\n );\n});\nStepperIndicator.displayName = \"StepperIndicator\";\n\nconst stepperLabelVariants = cva(\"text-sm font-medium transition-colors\", {\n variants: {\n state: {\n completed: \"text-foreground\",\n active: \"text-foreground\",\n skipped: \"text-muted-foreground line-through\",\n upcoming: \"text-muted-foreground\",\n },\n },\n defaultVariants: { state: \"upcoming\" },\n});\n\nconst StepperLabel = React.forwardRef<\n HTMLSpanElement,\n React.HTMLAttributes<HTMLSpanElement>\n>(({ className, ...props }, ref) => {\n const { state } = useStepperItemContext(\"StepperLabel\");\n return (\n <span\n ref={ref}\n className={cn(stepperLabelVariants({ state }), className)}\n {...props}\n />\n );\n});\nStepperLabel.displayName = \"StepperLabel\";\n\nconst StepperDescription = React.forwardRef<\n HTMLSpanElement,\n React.HTMLAttributes<HTMLSpanElement>\n>(({ className, ...props }, ref) => (\n <span\n ref={ref}\n className={cn(\"text-xs text-muted-foreground\", className)}\n {...props}\n />\n));\nStepperDescription.displayName = \"StepperDescription\";\n\n/**\n * Backwards-compatible no-op separator.\n *\n * The connector line between steps is now rendered automatically by each\n * `<StepperItem>`. Continue using `<StepperSeparator>` between items if you\n * prefer the explicit syntax — it renders nothing and the auto-connector\n * handles the visual.\n *\n * @deprecated Connectors are rendered automatically by `<StepperItem>`.\n * This component is now a no-op kept for source compatibility.\n */\nconst StepperSeparator: React.FC<{\n state?: StepperState;\n className?: string;\n}> = () => null;\nStepperSeparator.displayName = \"StepperSeparator\";\n\nexport {\n Stepper,\n StepperItem,\n StepperIndicator,\n StepperLabel,\n StepperDescription,\n StepperSeparator,\n stepperItemVariants,\n stepperIndicatorVariants,\n stepperLabelVariants,\n};\n\nexport { INDICATOR_SIZE_PX, INDICATOR_CENTER_PX };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Accordion as AccordionPrimitive } from \"radix-ui\";\nimport { ChevronDown } from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\n\nconst Accordion = AccordionPrimitive.Root;\n\nconst AccordionItem = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <AccordionPrimitive.Item ref={ref} className={cn(\"border-b\", className)} {...props} />\n));\nAccordionItem.displayName = \"AccordionItem\";\n\nconst AccordionTrigger = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex flex-1 cursor-pointer items-center justify-between py-4 font-medium transition-all hover:underline disabled:cursor-not-allowed [&[data-state=open]>svg]:rotate-180\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronDown className=\"h-4 w-4 shrink-0 transition-transform duration-normal\" />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n));\nAccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;\n\nconst AccordionContent = React.forwardRef<\n React.ComponentRef<typeof AccordionPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Content\n ref={ref}\n className=\"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down\"\n {...props}\n >\n <div className={cn(\"pb-4 pt-0\", className)}>{children}</div>\n </AccordionPrimitive.Content>\n));\nAccordionContent.displayName = AccordionPrimitive.Content.displayName;\n\nexport { Accordion, AccordionItem, AccordionTrigger, AccordionContent };\n","import * as React from \"react\";\nimport { cn } from \"../lib/utils\";\n\nconst Table = React.forwardRef<HTMLTableElement, React.HTMLAttributes<HTMLTableElement>>(\n ({ className, ...props }, ref) => (\n <div className=\"relative w-full overflow-auto\">\n <table ref={ref} className={cn(\"w-full caption-bottom text-sm\", className)} {...props} />\n </div>\n )\n);\nTable.displayName = \"Table\";\n\nconst TableHeader = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(\n ({ className, ...props }, ref) => <thead ref={ref} className={cn(\"[&_tr]:border-b\", className)} {...props} />\n);\nTableHeader.displayName = \"TableHeader\";\n\nconst TableBody = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(\n ({ className, ...props }, ref) => <tbody ref={ref} className={cn(\"[&_tr:last-child]:border-0\", className)} {...props} />\n);\nTableBody.displayName = \"TableBody\";\n\nconst TableFooter = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(\n ({ className, ...props }, ref) => <tfoot ref={ref} className={cn(\"border-t bg-muted/50 font-medium [&>tr]:last:border-b-0\", className)} {...props} />\n);\nTableFooter.displayName = \"TableFooter\";\n\nconst TableRow = React.forwardRef<HTMLTableRowElement, React.HTMLAttributes<HTMLTableRowElement>>(\n ({ className, ...props }, ref) => (\n <tr ref={ref} className={cn(\"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted\", className)} {...props} />\n )\n);\nTableRow.displayName = \"TableRow\";\n\nconst TableHead = React.forwardRef<HTMLTableCellElement, React.ThHTMLAttributes<HTMLTableCellElement>>(\n ({ className, ...props }, ref) => (\n <th ref={ref} className={cn(\"h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0\", className)} {...props} />\n )\n);\nTableHead.displayName = \"TableHead\";\n\nconst TableCell = React.forwardRef<HTMLTableCellElement, React.TdHTMLAttributes<HTMLTableCellElement>>(\n ({ className, ...props }, ref) => (\n <td ref={ref} className={cn(\"p-4 align-middle [&:has([role=checkbox])]:pr-0\", className)} {...props} />\n )\n);\nTableCell.displayName = \"TableCell\";\n\nconst TableCaption = React.forwardRef<HTMLTableCaptionElement, React.HTMLAttributes<HTMLTableCaptionElement>>(\n ({ className, ...props }, ref) => <caption ref={ref} className={cn(\"mt-4 text-sm text-muted-foreground\", className)} {...props} />\n);\nTableCaption.displayName = \"TableCaption\";\n\nexport { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption };\n","\"use client\";\n\nimport * as React from \"react\";\nimport {\n useReactTable,\n getCoreRowModel,\n getSortedRowModel,\n getFilteredRowModel,\n getPaginationRowModel,\n flexRender,\n type ColumnDef,\n type SortingState,\n type ColumnFiltersState,\n type VisibilityState,\n type RowSelectionState,\n type PaginationState,\n type Table as TanstackTable,\n type OnChangeFn,\n} from \"@tanstack/react-table\";\nimport {\n ArrowDown,\n ArrowUp,\n ArrowUpDown,\n ChevronLeft,\n ChevronRight,\n ChevronsLeft,\n ChevronsRight,\n Settings2,\n} from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\nimport { Table, TableHeader, TableBody, TableHead, TableRow, TableCell } from \"./table\";\nimport { Button } from \"./button\";\nimport { Input } from \"./input\";\nimport { Checkbox } from \"./checkbox\";\nimport {\n Select,\n SelectTrigger,\n SelectValue,\n SelectContent,\n SelectItem,\n} from \"./select\";\nimport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuCheckboxItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n} from \"./dropdown-menu\";\n\n// ---------------------------------------------------------------------------\n// Re-exports\n// ---------------------------------------------------------------------------\n\nexport type { ColumnDef } from \"@tanstack/react-table\";\n\n// ---------------------------------------------------------------------------\n// Size / Density\n// ---------------------------------------------------------------------------\n\ntype DataTableSize = \"sm\" | \"md\" | \"lg\";\n\nconst sizeClasses: Record<DataTableSize, { cell: string; header: string }> = {\n sm: { cell: \"px-3 py-1.5 text-xs\", header: \"h-9 px-3 text-xs\" },\n md: { cell: \"px-4 py-2 text-sm\", header: \"h-10 px-4 text-sm\" },\n lg: { cell: \"px-4 py-3 text-sm\", header: \"h-12 px-4 text-sm\" },\n};\n\nconst densitySizeMap: Record<string, DataTableSize> = {\n compact: \"sm\",\n default: \"md\",\n spacious: \"lg\",\n};\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport interface DataTableProps<TData> {\n /** Column definitions (TanStack Table ColumnDef). */\n columns: ColumnDef<TData, unknown>[];\n /** Data array to render. */\n data: TData[];\n\n // --- Filtering ---\n /** Column id used for the filter input. Omit to disable the built-in filter. */\n filterColumn?: string;\n /** Placeholder text for the filter input. @default \"Filter...\" */\n filterPlaceholder?: string;\n\n // --- Pagination ---\n /** Enable pagination. @default true */\n pagination?: boolean;\n /** Number of rows per page. @default 10 */\n pageSize?: number;\n /** Page size options in the dropdown. @default [10, 20, 30, 50] */\n pageSizeOptions?: number[];\n\n // --- Row selection ---\n /** Show a checkbox column for row selection. @default false */\n enableRowSelection?: boolean;\n /** Callback when selection changes. Receives a record of row-id to boolean. */\n onRowSelectionChange?: (selection: RowSelectionState) => void;\n\n // --- Server-side / manual mode ---\n /** Total row count for server-side pagination. Enables manual mode when set. */\n totalRows?: number;\n /** Controlled pagination state for server-side mode. */\n paginationState?: PaginationState;\n /** Callback when pagination changes (server-side). */\n onPaginationChange?: OnChangeFn<PaginationState>;\n /** Controlled sorting state for server-side mode. */\n sortingState?: SortingState;\n /** Callback when sorting changes (server-side). */\n onSortingChange?: OnChangeFn<SortingState>;\n /** Controlled column filter state for server-side mode. */\n filterState?: ColumnFiltersState;\n /** Callback when column filters change (server-side). */\n onFilterChange?: OnChangeFn<ColumnFiltersState>;\n\n // --- Toolbar ---\n /** Show the column visibility toggle in the toolbar. @default true */\n showColumnToggle?: boolean;\n /** Additional actions rendered at the end of the toolbar. */\n toolbarActions?: React.ReactNode;\n\n // --- Sizing ---\n /** Override density-derived size. When omitted, reads from the nearest DensityProvider. */\n size?: DataTableSize;\n\n // --- Display ---\n /** Message shown when there are no rows. @default \"No results.\" */\n emptyMessage?: string;\n /** Additional class name on the root wrapper. */\n className?: string;\n}\n\n// ---------------------------------------------------------------------------\n// DataTableColumnHeader\n// ---------------------------------------------------------------------------\n\nexport interface DataTableColumnHeaderProps {\n column: {\n getCanSort: () => boolean;\n getIsSorted: () => false | \"asc\" | \"desc\";\n toggleSorting: (desc?: boolean, multi?: boolean) => void;\n };\n title: string;\n className?: string;\n}\n\nfunction DataTableColumnHeader({ column, title, className }: DataTableColumnHeaderProps) {\n if (!column.getCanSort()) {\n return <div className={cn(className)}>{title}</div>;\n }\n\n const sorted = column.getIsSorted();\n\n return (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n className={cn(\"-ml-3 h-8 data-[state=open]:bg-accent\", className)}\n onClick={() => column.toggleSorting(sorted === \"asc\")}\n >\n {title}\n {sorted === \"asc\" ? (\n <ArrowUp className=\"ml-2 h-3.5 w-3.5\" />\n ) : sorted === \"desc\" ? (\n <ArrowDown className=\"ml-2 h-3.5 w-3.5\" />\n ) : (\n <ArrowUpDown className=\"ml-2 h-3.5 w-3.5 text-muted-foreground/50\" />\n )}\n </Button>\n );\n}\nDataTableColumnHeader.displayName = \"DataTableColumnHeader\";\n\n// ---------------------------------------------------------------------------\n// Internal: selection column factory\n// ---------------------------------------------------------------------------\n\nfunction createSelectionColumn<TData>(): ColumnDef<TData, unknown> {\n return {\n id: \"_select\",\n header: ({ table }) => (\n <Checkbox\n checked={table.getIsAllPageRowsSelected() || (table.getIsSomePageRowsSelected() && \"indeterminate\")}\n onCheckedChange={(value) => table.toggleAllPageRowsSelected(!!value)}\n aria-label=\"Select all\"\n className=\"translate-y-[2px]\"\n />\n ),\n cell: ({ row }) => (\n <Checkbox\n checked={row.getIsSelected()}\n onCheckedChange={(value) => row.toggleSelected(!!value)}\n aria-label=\"Select row\"\n className=\"translate-y-[2px]\"\n />\n ),\n enableSorting: false,\n enableHiding: false,\n size: 40,\n };\n}\n\n// ---------------------------------------------------------------------------\n// Internal: detect density from DOM\n// ---------------------------------------------------------------------------\n\nfunction useDensitySize(): DataTableSize {\n const ref = React.useRef<HTMLDivElement>(null);\n const [size, setSize] = React.useState<DataTableSize>(\"md\");\n\n React.useEffect(() => {\n const el = ref.current;\n if (!el) return;\n const container = el.closest(\".bison-density-compact, .bison-density-default, .bison-density-spacious\");\n if (!container) return;\n for (const [cls, sz] of Object.entries(densitySizeMap)) {\n if (container.classList.contains(`bison-density-${cls}`)) {\n setSize(sz);\n return;\n }\n }\n }, []);\n\n return size;\n}\n\n// ---------------------------------------------------------------------------\n// DataTable\n// ---------------------------------------------------------------------------\n\nfunction DataTableInner<TData>(\n {\n columns,\n data,\n filterColumn,\n filterPlaceholder = \"Filter...\",\n pagination = true,\n pageSize = 10,\n pageSizeOptions = [10, 20, 30, 50],\n enableRowSelection = false,\n onRowSelectionChange,\n totalRows,\n paginationState: controlledPagination,\n onPaginationChange,\n sortingState: controlledSorting,\n onSortingChange: onSortingChangeProp,\n filterState: controlledFilters,\n onFilterChange,\n showColumnToggle = true,\n toolbarActions,\n size: sizeProp,\n emptyMessage = \"No results.\",\n className,\n }: DataTableProps<TData>,\n ref: React.ForwardedRef<HTMLDivElement>\n) {\n const isServerSide = totalRows !== undefined;\n\n // --- Internal state (client-side) ---\n const [internalSorting, setInternalSorting] = React.useState<SortingState>([]);\n const [internalFilters, setInternalFilters] = React.useState<ColumnFiltersState>([]);\n const [internalPagination, setInternalPagination] = React.useState<PaginationState>({\n pageIndex: 0,\n pageSize,\n });\n const [columnVisibility, setColumnVisibility] = React.useState<VisibilityState>({});\n const [rowSelection, setRowSelection] = React.useState<RowSelectionState>({});\n\n // Resolve controlled vs uncontrolled state\n const sorting = controlledSorting ?? internalSorting;\n const setSorting = onSortingChangeProp ?? setInternalSorting;\n const columnFilters = controlledFilters ?? internalFilters;\n const setColumnFilters = onFilterChange ?? setInternalFilters;\n const paginationVal = controlledPagination ?? internalPagination;\n const setPaginationVal = onPaginationChange ?? setInternalPagination;\n\n // Notify consumer of selection changes\n const handleRowSelectionChange: OnChangeFn<RowSelectionState> = React.useCallback(\n (updater) => {\n setRowSelection((prev) => {\n const next = typeof updater === \"function\" ? updater(prev) : updater;\n onRowSelectionChange?.(next);\n return next;\n });\n },\n [onRowSelectionChange]\n );\n\n // Prepend selection column\n const finalColumns = React.useMemo(() => {\n if (!enableRowSelection) return columns;\n return [createSelectionColumn<TData>(), ...columns];\n }, [columns, enableRowSelection]);\n\n const table = useReactTable({\n data,\n columns: finalColumns,\n state: {\n sorting,\n columnFilters,\n columnVisibility,\n rowSelection,\n pagination: paginationVal,\n },\n onSortingChange: setSorting,\n onColumnFiltersChange: setColumnFilters,\n onColumnVisibilityChange: setColumnVisibility,\n onRowSelectionChange: handleRowSelectionChange,\n onPaginationChange: setPaginationVal,\n getCoreRowModel: getCoreRowModel(),\n ...(isServerSide\n ? {\n manualPagination: true,\n manualSorting: true,\n manualFiltering: true,\n pageCount: Math.ceil(totalRows / paginationVal.pageSize),\n }\n : {\n getSortedRowModel: getSortedRowModel(),\n getFilteredRowModel: getFilteredRowModel(),\n ...(pagination && { getPaginationRowModel: getPaginationRowModel() }),\n }),\n enableRowSelection,\n });\n\n // --- Density / size ---\n const densitySize = useDensitySize();\n const resolvedSize = sizeProp ?? densitySize;\n const sc = sizeClasses[resolvedSize];\n\n // --- Toolbar visibility ---\n const hasToolbar = filterColumn || showColumnToggle || toolbarActions;\n\n const selectedCount = Object.keys(rowSelection).length;\n const totalFilteredRows = isServerSide ? totalRows : table.getFilteredRowModel().rows.length;\n\n return (\n <div ref={ref} className={cn(\"space-y-4\", className)}>\n {/* Toolbar */}\n {hasToolbar && (\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"flex flex-1 items-center gap-2\">\n {filterColumn && (\n <Input\n placeholder={filterPlaceholder}\n value={(table.getColumn(filterColumn)?.getFilterValue() as string) ?? \"\"}\n onChange={(event) => table.getColumn(filterColumn)?.setFilterValue(event.target.value)}\n className=\"max-w-sm\"\n />\n )}\n </div>\n <div className=\"flex items-center gap-2\">\n {toolbarActions}\n {showColumnToggle && (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button variant=\"outline\" size=\"sm\" className=\"ml-auto h-8\">\n <Settings2 className=\"mr-2 h-4 w-4\" />\n Columns\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-40\">\n <DropdownMenuLabel>Toggle columns</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {table\n .getAllColumns()\n .filter((col) => col.getCanHide())\n .map((col) => (\n <DropdownMenuCheckboxItem\n key={col.id}\n className=\"capitalize\"\n checked={col.getIsVisible()}\n onCheckedChange={(value) => col.toggleVisibility(!!value)}\n >\n {col.id}\n </DropdownMenuCheckboxItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n </div>\n </div>\n )}\n\n {/* Table */}\n <div className=\"rounded-md border\">\n <Table>\n <TableHeader>\n {table.getHeaderGroups().map((headerGroup) => (\n <TableRow key={headerGroup.id}>\n {headerGroup.headers.map((header) => (\n <TableHead\n key={header.id}\n className={sc.header}\n style={{ width: header.column.id === \"_select\" ? 40 : (header.getSize() !== 150 ? header.getSize() : undefined) }}\n >\n {header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext())}\n </TableHead>\n ))}\n </TableRow>\n ))}\n </TableHeader>\n <TableBody>\n {table.getRowModel().rows?.length ? (\n table.getRowModel().rows.map((row) => (\n <TableRow key={row.id} data-state={row.getIsSelected() && \"selected\"}>\n {row.getVisibleCells().map((cell) => (\n <TableCell key={cell.id} className={sc.cell}>\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n </TableCell>\n ))}\n </TableRow>\n ))\n ) : (\n <TableRow>\n <TableCell colSpan={finalColumns.length} className=\"h-24 text-center\">\n {emptyMessage}\n </TableCell>\n </TableRow>\n )}\n </TableBody>\n </Table>\n </div>\n\n {/* Footer: selection info + pagination */}\n {(pagination || enableRowSelection) && (\n <div className=\"flex items-center justify-between px-2\">\n <div className=\"flex-1 text-sm text-muted-foreground\">\n {enableRowSelection\n ? `${selectedCount} of ${totalFilteredRows} row(s) selected`\n : `${totalFilteredRows} row(s) total`}\n </div>\n {pagination && (\n <div className=\"flex items-center space-x-6 lg:space-x-8\">\n <div className=\"flex items-center space-x-2\">\n <p className=\"text-sm font-medium\">Rows per page</p>\n <Select\n value={`${paginationVal.pageSize}`}\n onValueChange={(value) => {\n setPaginationVal((old: PaginationState) => ({\n ...old,\n pageIndex: 0,\n pageSize: Number(value),\n }));\n }}\n >\n <SelectTrigger className=\"h-8 w-[70px]\">\n <SelectValue placeholder={`${paginationVal.pageSize}`} />\n </SelectTrigger>\n <SelectContent side=\"top\">\n {pageSizeOptions.map((s) => (\n <SelectItem key={s} value={`${s}`}>\n {s}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"flex w-[100px] items-center justify-center text-sm font-medium\">\n Page {paginationVal.pageIndex + 1} of {table.getPageCount()}\n </div>\n <div className=\"flex items-center space-x-2\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"hidden h-8 w-8 p-0 lg:flex\"\n onClick={() => table.setPageIndex(0)}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to first page</span>\n <ChevronsLeft className=\"h-4 w-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"h-8 w-8 p-0\"\n onClick={() => table.previousPage()}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to previous page</span>\n <ChevronLeft className=\"h-4 w-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"h-8 w-8 p-0\"\n onClick={() => table.nextPage()}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to next page</span>\n <ChevronRight className=\"h-4 w-4\" />\n </Button>\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"hidden h-8 w-8 p-0 lg:flex\"\n onClick={() => table.setPageIndex(table.getPageCount() - 1)}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to last page</span>\n <ChevronsRight className=\"h-4 w-4\" />\n </Button>\n </div>\n </div>\n )}\n </div>\n )}\n </div>\n );\n}\n\nconst DataTable = React.forwardRef(DataTableInner) as <TData>(\n props: DataTableProps<TData> & { ref?: React.ForwardedRef<HTMLDivElement> }\n) => React.ReactElement;\n\n(DataTable as { displayName?: string }).displayName = \"DataTable\";\n\nexport { DataTable, DataTableColumnHeader };\n","'use client';\n\nimport * as React from 'react';\nimport { Progress as ProgressPrimitive } from 'radix-ui';\nimport { cn } from '../lib/utils';\n\nconst Progress = React.forwardRef<\n React.ComponentRef<typeof ProgressPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>\n>(({ className, value, ...props }, ref) => (\n <ProgressPrimitive.Root\n ref={ref}\n className={cn(\n 'relative h-4 w-full overflow-hidden rounded-full bg-muted',\n className,\n )}\n {...props}\n >\n <ProgressPrimitive.Indicator\n className=\"h-full w-full flex-1 bg-primary transition-all duration-normal ease-default\"\n style={{ transform: `translateX(-${100 - (value || 0)}%)` }}\n />\n </ProgressPrimitive.Root>\n));\nProgress.displayName = ProgressPrimitive.Root.displayName;\n\nexport { Progress };\n","'use client';\n\nimport * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../lib/utils';\n\nconst progressBarVariants = cva(\n 'h-full rounded-full transition-all duration-normal ease-default',\n {\n variants: {\n color: {\n primary: 'bg-primary',\n secondary: 'bg-secondary',\n highlight: 'bg-highlight',\n destructive: 'bg-destructive',\n brand: 'bg-brand-accent',\n },\n },\n defaultVariants: {\n color: 'primary',\n },\n },\n);\n\nconst progressBarTrackVariants = cva(\n 'relative w-full overflow-hidden rounded-full bg-muted',\n {\n variants: {\n size: {\n sm: 'h-1.5',\n md: 'h-2.5',\n lg: 'h-4',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\nexport type ProgressBarFormat = 'percent' | 'currency';\n\nexport interface ProgressBarProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color'>,\n VariantProps<typeof progressBarVariants>,\n VariantProps<typeof progressBarTrackVariants> {\n /** Current value. When format is \"percent\", this is 0–100. When format is \"currency\", this is the raw amount (e.g. cents). */\n value?: number;\n /** Maximum value. Default: 100. When format is \"currency\", this is the goal amount in the same unit as value. */\n max?: number;\n /** Label rendered above the bar */\n label?: React.ReactNode;\n /** Whether to show the formatted value text */\n showValue?: boolean;\n /**\n * Display format for the value text.\n * - \"percent\" (default): shows percentage (e.g. \"65%\")\n * - \"currency\": formats value and max as currency (e.g. \"$2,500 of $5,000\")\n */\n format?: ProgressBarFormat;\n /** Intl.NumberFormat locale for currency formatting. Defaults to \"en-US\". */\n locale?: string;\n /** ISO 4217 currency code. Defaults to \"USD\". */\n currency?: string;\n /** Divisor to convert raw value to display value (e.g. 100 for cents → dollars). Defaults to 1. */\n currencyDivisor?: number;\n}\n\nfunction formatCurrency(\n amount: number,\n divisor: number,\n locale: string,\n currency: string,\n): string {\n return new Intl.NumberFormat(locale, {\n style: 'currency',\n currency,\n minimumFractionDigits: 0,\n maximumFractionDigits: 0,\n }).format(amount / divisor);\n}\n\nconst ProgressBar = React.forwardRef<HTMLDivElement, ProgressBarProps>(\n (\n {\n className,\n value = 0,\n max = 100,\n color,\n size,\n label,\n showValue,\n format = 'percent',\n locale = 'en-US',\n currency = 'USD',\n currencyDivisor = 1,\n ...props\n },\n ref,\n ) => {\n const pct = Math.min(100, Math.max(0, (value / max) * 100));\n\n const formattedValue = React.useMemo(() => {\n if (format === 'currency') {\n const current = formatCurrency(\n value,\n currencyDivisor,\n locale,\n currency,\n );\n const goal = formatCurrency(max, currencyDivisor, locale, currency);\n return `${current} of ${goal}`;\n }\n return `${Math.round(pct)}%`;\n }, [format, value, max, pct, currencyDivisor, locale, currency]);\n\n return (\n <div ref={ref} className={cn('w-full', className)} {...props}>\n {(label || showValue) && (\n <div className=\"mb-1.5 flex items-center justify-between text-sm\">\n {label && (\n <span className=\"font-medium text-foreground\">{label}</span>\n )}\n {showValue && (\n <span className=\"text-content-secondary tabular-nums\">\n {formattedValue}\n </span>\n )}\n </div>\n )}\n <div\n className={cn(progressBarTrackVariants({ size }))}\n role=\"progressbar\"\n aria-valuenow={value}\n aria-valuemin={0}\n aria-valuemax={max}\n >\n <div\n className={cn(progressBarVariants({ color }))}\n style={{ width: `${pct}%` }}\n />\n </div>\n </div>\n );\n },\n);\nProgressBar.displayName = 'ProgressBar';\n\nexport { ProgressBar, progressBarVariants };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { ScrollArea as ScrollAreaPrimitive } from \"radix-ui\";\nimport { cn } from \"../lib/utils\";\n\nconst ScrollArea = React.forwardRef<\n React.ComponentRef<typeof ScrollAreaPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>\n>(({ className, children, ...props }, ref) => (\n <ScrollAreaPrimitive.Root ref={ref} className={cn(\"relative overflow-hidden\", className)} {...props}>\n <ScrollAreaPrimitive.Viewport className=\"h-full w-full rounded-[inherit]\">\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n));\nScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;\n\nconst ScrollBar = React.forwardRef<\n React.ComponentRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,\n React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>\n>(({ className, orientation = \"vertical\", ...props }, ref) => (\n <ScrollAreaPrimitive.ScrollAreaScrollbar\n ref={ref}\n orientation={orientation}\n className={cn(\n \"flex touch-none select-none transition-colors\",\n orientation === \"vertical\" && \"h-full w-2.5 border-l border-l-transparent p-[1px]\",\n orientation === \"horizontal\" && \"h-2.5 flex-col border-t border-t-transparent p-[1px]\",\n className\n )}\n {...props}\n >\n <ScrollAreaPrimitive.ScrollAreaThumb className=\"relative flex-1 rounded-full bg-border\" />\n </ScrollAreaPrimitive.ScrollAreaScrollbar>\n));\nScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;\n\nexport { ScrollArea, ScrollBar };\n","import { cn } from \"../lib/utils\";\n\nfunction Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n return <div className={cn(\"animate-pulse rounded-md bg-muted\", className)} {...props} />;\n}\n\nexport { Skeleton };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Star } from \"lucide-react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../lib/utils\";\n\n// Filled stars use `fill-current`/`stroke-current`, so the star color follows\n// the element's text color. The default `text-highlight` keeps ratings on brand,\n// and consumers can override per-use with any text-color utility (e.g.\n// `text-primary`) via `className` — tailwind-merge lets the override win.\nconst ratingVariants = cva(\"inline-flex items-center text-highlight\", {\n variants: {\n size: {\n sm: \"gap-0.5 [&_svg]:size-3.5\",\n md: \"gap-0.5 [&_svg]:size-4\",\n lg: \"gap-1 [&_svg]:size-5\",\n },\n },\n defaultVariants: {\n size: \"md\",\n },\n});\n\ninterface RatingProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"role\" | \"aria-label\">,\n VariantProps<typeof ratingVariants> {\n /** The rating to display, e.g. 4.3. Clamped to the range [0, count]. */\n rate: number;\n /** Number of stars to render. Defaults to 5. */\n count?: number;\n /** Accessible label. Defaults to \"Rated {rate} out of {count}\". */\n label?: string;\n}\n\n/**\n * Read-only star rating display with fractional fill. A single filled-star layer\n * is clipped to the fractional width over an empty-star track, so a rating like\n * 4.3 shows four full stars and a partial fifth. Presentation only — for input,\n * compose a separate control.\n */\nconst Rating = React.forwardRef<HTMLDivElement, RatingProps>(\n ({ rate, count = 5, size, label, className, ...props }, ref) => {\n const clamped = Math.max(0, Math.min(rate, count));\n const stars = Array.from({ length: count });\n\n return (\n <div\n ref={ref}\n role=\"img\"\n aria-label={label ?? `Rated ${clamped} out of ${count}`}\n className={cn(ratingVariants({ size }), className)}\n {...props}\n >\n {stars.map((_, i) => {\n // Fraction of THIS star that should be filled: 1 fully below the rating,\n // 0 fully above, fractional for the single straddling star.\n const fill = Math.max(0, Math.min(1, clamped - i));\n return (\n <span key={i} className=\"relative inline-flex shrink-0\">\n <Star className=\"fill-muted stroke-muted-foreground/40\" />\n {fill > 0 && (\n <span\n className=\"absolute inset-0 overflow-hidden\"\n style={{ width: `${fill * 100}%` }}\n >\n <Star className=\"fill-current stroke-current\" />\n </span>\n )}\n </span>\n );\n })}\n </div>\n );\n },\n);\nRating.displayName = \"Rating\";\n\nexport { Rating, ratingVariants };\nexport type { RatingProps };\n","import * as React from \"react\";\nimport { LoaderCircle } from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nconst spinnerVariants = cva(\"text-muted-foreground\", {\n variants: {\n size: {\n sm: \"h-4 w-4\",\n md: \"h-6 w-6\",\n lg: \"h-8 w-8\",\n },\n },\n defaultVariants: {\n size: \"md\",\n },\n});\n\nexport interface SpinnerProps\n extends React.HTMLAttributes<HTMLSpanElement>,\n VariantProps<typeof spinnerVariants> {}\n\nfunction Spinner({ className, size, ...props }: SpinnerProps) {\n return (\n <span className={cn(spinnerVariants({ size }), className)} {...props}>\n <LoaderCircle className=\"h-full w-full animate-spin\" />\n </span>\n );\n}\n\nexport { Spinner, spinnerVariants };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { motion } from \"motion/react\";\nimport { cn } from \"../lib/utils\";\n\nexport interface SavedPingProps {\n /**\n * Increments on every successful save. Parents should key this component on\n * `pingCount` (e.g. `<SavedPing key={pingCount} pingCount={pingCount} />`)\n * so each increment remounts the component and replays the animation.\n * Renders nothing while `pingCount === 0`.\n */\n pingCount: number;\n /** Label shown next to the checkmark. Defaults to `\"Saved\"`. */\n label?: string;\n /** Extra classes appended to the pill container. */\n className?: string;\n /** Passed through to the container for test queries. */\n \"data-testid\"?: string;\n}\n\n/**\n * A bespoke \"saved!\" confirmation pill — quieter than a standard toast.\n * Intended for background autosave flows where success needs acknowledgment\n * without interrupting the user. Uses the `success-*` semantic color scale so\n * it inherits the theme's success hue.\n *\n * Visual: small circle with light success fill, darker success border, and an\n * animated SVG checkmark that draws in. The whole pill fades in, drifts up,\n * holds briefly, then fades out.\n */\nconst SavedPing = React.forwardRef<HTMLDivElement, SavedPingProps>(\n (\n { pingCount, label = \"Saved\", className, \"data-testid\": dataTestId },\n ref,\n ) => {\n if (pingCount === 0) return null;\n\n return (\n <motion.div\n ref={ref}\n role=\"status\"\n aria-live=\"polite\"\n aria-label={label}\n data-testid={dataTestId}\n initial={{ opacity: 0, y: 14, scale: 0.92 }}\n animate={{\n opacity: [0, 1, 1, 0],\n y: [14, 0, -6, -16],\n scale: [0.92, 1, 1, 0.96],\n }}\n transition={{\n duration: 1.4,\n times: [0, 0.15, 0.75, 1],\n ease: [0.22, 1, 0.36, 1],\n }}\n className={cn(\n \"pointer-events-none flex h-9 items-center gap-2 rounded-full border border-success-500 bg-success-50 pr-3.5 pl-2 text-sm font-medium text-success-700 shadow-sm shadow-success-500/10 dark:border-success-400 dark:bg-success-950/60 dark:text-success-200 dark:shadow-success-500/20\",\n className,\n )}\n >\n <span\n aria-hidden\n className=\"flex h-6 w-6 items-center justify-center rounded-full border border-success-500 bg-success-100/80 dark:border-success-400 dark:bg-success-900/60\"\n >\n <svg\n viewBox=\"0 0 20 20\"\n className=\"h-3.5 w-3.5\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2.5}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <motion.path\n d=\"M4 10.5 L8.5 15 L16 6\"\n initial={{ pathLength: 0, opacity: 0 }}\n animate={{ pathLength: 1, opacity: 1 }}\n transition={{\n pathLength: { delay: 0.18, duration: 0.32, ease: \"easeOut\" },\n opacity: { delay: 0.18, duration: 0.05 },\n }}\n />\n </svg>\n </span>\n <span>{label}</span>\n </motion.div>\n );\n },\n);\nSavedPing.displayName = \"SavedPing\";\n\nexport { SavedPing };\n","'use client';\n\n/**\n * ContextMenu mirrors `dropdown-menu.tsx` visually — Radix UI ships them as\n * separate primitives because the trigger semantics differ (right-click vs\n * click), but the rendered chrome is identical. Both import from\n * `lib/surface-classes.ts` so any visual tweak updates both automatically.\n *\n * If you need to change the look of menus, edit `surface-classes.ts`\n * (the `menuSurfaceClasses` / `menuItemClasses` exports). Do NOT edit one\n * of these files without the other.\n */\n\nimport * as React from 'react';\nimport { ContextMenu as ContextMenuPrimitive } from 'radix-ui';\nimport { Check, ChevronRight, Circle } from 'lucide-react';\nimport { cn } from '../lib/utils';\nimport {\n floatingAnimationClasses,\n menuItemClasses,\n menuItemWithIndicatorClasses,\n menuSeparatorClasses,\n menuSurfaceClasses,\n} from '../lib/surface-classes';\n\nconst ContextMenu = ContextMenuPrimitive.Root;\nconst ContextMenuTrigger = ContextMenuPrimitive.Trigger;\nconst ContextMenuGroup = ContextMenuPrimitive.Group;\nconst ContextMenuPortal = ContextMenuPrimitive.Portal;\nconst ContextMenuSub = ContextMenuPrimitive.Sub;\nconst ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;\n\nconst ContextMenuSubTrigger = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <ContextMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n menuItemClasses,\n 'data-[state=open]:bg-accent data-[state=open]:text-accent-foreground',\n inset && 'pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRight className=\"ml-auto h-4 w-4\" />\n </ContextMenuPrimitive.SubTrigger>\n));\nContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;\n\nconst ContextMenuSubContent = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.SubContent\n ref={ref}\n className={cn(menuSurfaceClasses, floatingAnimationClasses, className)}\n {...props}\n />\n));\nContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;\n\nconst ContextMenuContent = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n ref={ref}\n className={cn(menuSurfaceClasses, floatingAnimationClasses, className)}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n));\nContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;\n\nconst ContextMenuItem = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Item\n ref={ref}\n className={cn(menuItemClasses, inset && 'pl-8', className)}\n {...props}\n />\n));\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\n\nconst ContextMenuCheckboxItem = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <ContextMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(menuItemWithIndicatorClasses, className)}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n));\nContextMenuCheckboxItem.displayName =\n ContextMenuPrimitive.CheckboxItem.displayName;\n\nconst ContextMenuRadioItem = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <ContextMenuPrimitive.RadioItem\n ref={ref}\n className={cn(menuItemWithIndicatorClasses, className)}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <Circle className=\"h-2 w-2 fill-current\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n));\nContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;\n\nconst ContextMenuLabel = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Label\n ref={ref}\n className={cn(\n 'px-2 py-1.5 text-sm font-semibold text-foreground',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n));\nContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;\n\nconst ContextMenuSeparator = React.forwardRef<\n React.ComponentRef<typeof ContextMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Separator\n ref={ref}\n className={cn(menuSeparatorClasses, className)}\n {...props}\n />\n));\nContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;\n\nconst ContextMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => (\n <span\n className={cn(\n 'ml-auto text-xs tracking-widest text-muted-foreground',\n className,\n )}\n {...props}\n />\n);\n\nexport {\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuContent,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioItem,\n ContextMenuLabel,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuGroup,\n ContextMenuPortal,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuRadioGroup,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport { NavigationMenu as NavigationMenuPrimitive } from \"radix-ui\";\nimport { ChevronDown } from \"lucide-react\";\nimport { cva } from \"class-variance-authority\";\nimport { cn } from \"../lib/utils\";\n\nconst NavigationMenu = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root> & {\n /**\n * When `true` (default) all panels render into a single shared, animated\n * viewport centered under the menu. When `false`, each panel renders in\n * place and anchors directly under its own trigger — the right choice for\n * hover mega-menu headers where panels should drop beneath their item.\n */\n viewport?: boolean;\n }\n>(({ className, children, viewport = true, ...props }, ref) => (\n <NavigationMenuPrimitive.Root\n ref={ref}\n data-viewport={viewport}\n className={cn(\n \"group/navigation-menu relative z-10 flex max-w-max flex-1 items-center justify-center\",\n className,\n )}\n {...props}\n >\n {children}\n {viewport ? <NavigationMenuViewport /> : null}\n </NavigationMenuPrimitive.Root>\n));\nNavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;\n\nconst NavigationMenuList = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.List\n ref={ref}\n className={cn(\"group flex flex-1 list-none items-center justify-center space-x-1\", className)}\n {...props}\n />\n));\nNavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;\n\n// `relative` so that, in `viewport={false}` mode, each `NavigationMenuContent`\n// anchors to its own item instead of the menu root.\nconst NavigationMenuItem = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Item ref={ref} className={cn(\"relative\", className)} {...props} />\n));\nNavigationMenuItem.displayName = NavigationMenuPrimitive.Item.displayName;\n\nconst navigationMenuTriggerStyle = cva(\n \"group inline-flex h-[var(--density-height-md)] w-max items-center justify-center rounded-md bg-transparent px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50\"\n);\n\nconst NavigationMenuTrigger = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Trigger\n ref={ref}\n className={cn(navigationMenuTriggerStyle(), \"group\", className)}\n {...props}\n >\n {children}{\" \"}\n <ChevronDown\n className=\"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180\"\n aria-hidden=\"true\"\n />\n </NavigationMenuPrimitive.Trigger>\n));\nNavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;\n\nconst NavigationMenuContent = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"left-0 top-0 w-full 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 md:absolute md:w-auto\",\n // viewport={false}: become a standalone popover surface anchored under the trigger\n \"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:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:shadow-lg group-data-[viewport=false]/navigation-menu:duration-200 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=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0\",\n className\n )}\n {...props}\n />\n));\nNavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;\n\nconst NavigationMenuLink = NavigationMenuPrimitive.Link;\n\nconst NavigationMenuViewport = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Viewport>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>\n>(({ className, ...props }, ref) => (\n <div className={cn(\"absolute left-0 top-full flex justify-center\")}>\n <NavigationMenuPrimitive.Viewport\n className={cn(\n \"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]\",\n className\n )}\n ref={ref}\n {...props}\n />\n </div>\n));\nNavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName;\n\nconst NavigationMenuIndicator = React.forwardRef<\n React.ComponentRef<typeof NavigationMenuPrimitive.Indicator>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Indicator\n ref={ref}\n className={cn(\n \"top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in\",\n className\n )}\n {...props}\n >\n <div className=\"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md\" />\n </NavigationMenuPrimitive.Indicator>\n));\nNavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;\n\nexport {\n navigationMenuTriggerStyle,\n NavigationMenu,\n NavigationMenuList,\n NavigationMenuItem,\n NavigationMenuContent,\n NavigationMenuTrigger,\n NavigationMenuLink,\n NavigationMenuIndicator,\n NavigationMenuViewport,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Slot as SlotPrimitive } from \"radix-ui\";\nimport { ChevronRight, MoreHorizontal } from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\n\nconst Breadcrumb = React.forwardRef<\n HTMLElement,\n React.ComponentPropsWithoutRef<\"nav\"> & { separator?: React.ReactNode }\n>(({ ...props }, ref) => <nav ref={ref} aria-label=\"breadcrumb\" {...props} />);\nBreadcrumb.displayName = \"Breadcrumb\";\n\nconst BreadcrumbList = React.forwardRef<HTMLOListElement, React.ComponentPropsWithoutRef<\"ol\">>(\n ({ className, ...props }, ref) => (\n <ol\n ref={ref}\n className={cn(\n \"flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5\",\n className\n )}\n {...props}\n />\n )\n);\nBreadcrumbList.displayName = \"BreadcrumbList\";\n\nconst BreadcrumbItem = React.forwardRef<HTMLLIElement, React.ComponentPropsWithoutRef<\"li\">>(\n ({ className, ...props }, ref) => (\n <li ref={ref} className={cn(\"inline-flex items-center gap-1.5\", className)} {...props} />\n )\n);\nBreadcrumbItem.displayName = \"BreadcrumbItem\";\n\nconst BreadcrumbLink = React.forwardRef<\n HTMLAnchorElement,\n React.ComponentPropsWithoutRef<\"a\"> & { asChild?: boolean }\n>(({ asChild, className, ...props }, ref) => {\n const Comp = asChild ? SlotPrimitive.Slot : \"a\";\n return (\n <Comp\n ref={ref}\n className={cn(\"transition-colors hover:text-foreground\", className)}\n {...props}\n />\n );\n});\nBreadcrumbLink.displayName = \"BreadcrumbLink\";\n\nconst BreadcrumbPage = React.forwardRef<HTMLSpanElement, React.ComponentPropsWithoutRef<\"span\">>(\n ({ className, ...props }, ref) => (\n <span\n ref={ref}\n role=\"link\"\n aria-disabled=\"true\"\n aria-current=\"page\"\n className={cn(\"font-normal text-foreground\", className)}\n {...props}\n />\n )\n);\nBreadcrumbPage.displayName = \"BreadcrumbPage\";\n\nconst BreadcrumbSeparator = ({ children, className, ...props }: React.ComponentProps<\"li\">) => (\n <li role=\"presentation\" aria-hidden=\"true\" className={cn(\"[&>svg]:h-3.5 [&>svg]:w-3.5\", className)} {...props}>\n {children ?? <ChevronRight />}\n </li>\n);\nBreadcrumbSeparator.displayName = \"BreadcrumbSeparator\";\n\nconst BreadcrumbEllipsis = ({ className, ...props }: React.ComponentProps<\"span\">) => (\n <span\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"flex h-9 w-9 items-center justify-center\", className)}\n {...props}\n >\n <MoreHorizontal className=\"h-4 w-4\" />\n <span className=\"sr-only\">More</span>\n </span>\n);\nBreadcrumbEllipsis.displayName = \"BreadcrumbEllipsis\";\n\nexport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbPage,\n BreadcrumbSeparator,\n BreadcrumbEllipsis,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport { ChevronLeft, ChevronRight, MoreHorizontal } from \"lucide-react\";\nimport { cn } from \"../lib/utils\";\nimport { type ButtonProps, buttonVariants } from \"./button\";\n\nconst Pagination = ({ className, ...props }: React.ComponentProps<\"nav\">) => (\n <nav\n role=\"navigation\"\n aria-label=\"pagination\"\n className={cn(\"mx-auto flex w-full justify-center\", className)}\n {...props}\n />\n);\nPagination.displayName = \"Pagination\";\n\nconst PaginationContent = React.forwardRef<HTMLUListElement, React.ComponentPropsWithoutRef<\"ul\">>(\n ({ className, ...props }, ref) => (\n <ul ref={ref} className={cn(\"flex flex-row items-center gap-1\", className)} {...props} />\n )\n);\nPaginationContent.displayName = \"PaginationContent\";\n\nconst PaginationItem = React.forwardRef<HTMLLIElement, React.ComponentPropsWithoutRef<\"li\">>(\n ({ className, ...props }, ref) => <li ref={ref} className={cn(\"\", className)} {...props} />\n);\nPaginationItem.displayName = \"PaginationItem\";\n\ntype PaginationLinkProps = {\n isActive?: boolean;\n} & Pick<ButtonProps, \"size\"> &\n React.ComponentProps<\"a\">;\n\nconst PaginationLink = ({ className, isActive, size = \"icon\", ...props }: PaginationLinkProps) => (\n <a\n aria-current={isActive ? \"page\" : undefined}\n className={cn(\n buttonVariants({\n variant: isActive ? \"outline\" : \"ghost\",\n size,\n }),\n className\n )}\n {...props}\n />\n);\nPaginationLink.displayName = \"PaginationLink\";\n\nconst PaginationPrevious = ({ className, ...props }: React.ComponentProps<typeof PaginationLink>) => (\n <PaginationLink aria-label=\"Go to previous page\" size=\"md\" className={cn(\"gap-1 pl-2.5\", className)} {...props}>\n <ChevronLeft className=\"h-4 w-4\" />\n <span>Previous</span>\n </PaginationLink>\n);\nPaginationPrevious.displayName = \"PaginationPrevious\";\n\nconst PaginationNext = ({ className, ...props }: React.ComponentProps<typeof PaginationLink>) => (\n <PaginationLink aria-label=\"Go to next page\" size=\"md\" className={cn(\"gap-1 pr-2.5\", className)} {...props}>\n <span>Next</span>\n <ChevronRight className=\"h-4 w-4\" />\n </PaginationLink>\n);\nPaginationNext.displayName = \"PaginationNext\";\n\nconst PaginationEllipsis = ({ className, ...props }: React.ComponentProps<\"span\">) => (\n <span aria-hidden className={cn(\"flex h-9 w-9 items-center justify-center\", className)} {...props}>\n <MoreHorizontal className=\"h-4 w-4\" />\n <span className=\"sr-only\">More pages</span>\n </span>\n);\nPaginationEllipsis.displayName = \"PaginationEllipsis\";\n\nexport {\n Pagination,\n PaginationContent,\n PaginationEllipsis,\n PaginationItem,\n PaginationLink,\n PaginationNext,\n PaginationPrevious,\n};\n","'use client';\n\nimport * as React from 'react';\nimport { Command as CommandPrimitive } from 'cmdk';\nimport { Search } from 'lucide-react';\nimport { cn } from '../lib/utils';\nimport { menuItemClasses } from '../lib/surface-classes';\nimport { Dialog, DialogContent } from './dialog';\n\nconst Command = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n 'flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground',\n className,\n )}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\ninterface CommandDialogProps\n extends React.ComponentPropsWithoutRef<typeof Dialog> {}\n\nconst CommandDialog = ({ children, ...props }: CommandDialogProps) => (\n <Dialog {...props}>\n <DialogContent className=\"overflow-hidden p-0 shadow-lg\">\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[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\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n);\n\nconst CommandInput = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Input>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>\n>(({ className, ...props }, ref) => (\n <div className=\"flex items-center border-b px-3\" cmdk-input-wrapper=\"\">\n <Search className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n 'flex h-11 w-full rounded-md bg-transparent py-3 text-base sm:text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n />\n </div>\n));\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\nconst CommandList = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn('max-h-[300px] overflow-y-auto overflow-x-hidden', className)}\n {...props}\n />\n));\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nconst CommandEmpty = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => (\n <CommandPrimitive.Empty\n ref={ref}\n className=\"py-6 text-center text-sm\"\n {...props}\n />\n));\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nconst CommandGroup = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n 'overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground',\n className,\n )}\n {...props}\n />\n));\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nconst CommandSeparator = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn('-mx-1 h-px bg-border', className)}\n {...props}\n />\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\nconst CommandItem = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n menuItemClasses,\n 'data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground',\n className,\n )}\n {...props}\n />\n));\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nconst CommandShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => (\n <span\n className={cn(\n 'ml-auto text-xs tracking-widest text-muted-foreground',\n className,\n )}\n {...props}\n />\n);\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n","'use client';\n\nimport * as React from 'react';\nimport { Check, Pencil, X } from 'lucide-react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../lib/utils';\nimport { Button } from './button';\n\nconst editableTitleVariants = cva(\n 'inline-flex items-center gap-2 font-semibold text-foreground',\n {\n variants: {\n size: {\n sm: 'text-lg',\n md: 'text-2xl',\n lg: 'text-4xl',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\nconst editableTitleInputVariants = cva(\n 'bg-transparent border-b-2 border-primary outline-none font-semibold text-foreground w-full min-w-0',\n {\n variants: {\n size: {\n sm: 'text-lg pb-0.5',\n md: 'text-2xl pb-1',\n lg: 'text-4xl pb-1.5',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\n/**\n * Fixed square chrome for edit / confirm / cancel: outer box is identical regardless of glyph.\n * Overrides `Button` `size=\"icon\"` density vars so all three match exactly.\n */\nfunction titleActionButtonClass(size: 'sm' | 'md' | 'lg' | null | undefined) {\n switch (size) {\n case 'sm':\n return 'box-border aspect-square size-6 min-h-6 min-w-6 max-h-6 max-w-6 shrink-0 p-0 leading-none overflow-hidden inline-flex items-center justify-center [&_svg]:block [&_svg]:size-3 [&_svg]:shrink-0';\n case 'lg':\n return 'box-border aspect-square size-10 min-h-10 min-w-10 max-h-10 max-w-10 shrink-0 p-0 leading-none overflow-hidden inline-flex items-center justify-center [&_svg]:block [&_svg]:size-5 [&_svg]:shrink-0';\n default:\n return 'box-border aspect-square size-8 min-h-8 min-w-8 max-h-8 max-w-8 shrink-0 p-0 leading-none overflow-hidden inline-flex items-center justify-center [&_svg]:block [&_svg]:size-4 [&_svg]:shrink-0';\n }\n}\n\n/** Loading affordance: same outer square as action buttons. */\nfunction loadingSpinnerWrapClass(size: 'sm' | 'md' | 'lg' | null | undefined) {\n switch (size) {\n case 'sm':\n return 'box-border size-6 min-h-6 min-w-6 max-h-6 max-w-6 [&_svg]:size-3';\n case 'lg':\n return 'box-border size-10 min-h-10 min-w-10 max-h-10 max-w-10 [&_svg]:size-5';\n default:\n return 'box-border size-8 min-h-8 min-w-8 max-h-8 max-w-8 [&_svg]:size-4';\n }\n}\n\nexport interface EditableTitleProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'>,\n VariantProps<typeof editableTitleVariants> {\n /** The current title value */\n value: string;\n /** Callback when the title is saved */\n onSave?: (value: string) => void;\n /** Callback on every keystroke while editing */\n onChange?: (value: string) => void;\n /** Placeholder text when the title is empty */\n placeholder?: string;\n /** Whether the title is editable */\n disabled?: boolean;\n /** Whether a save operation is in progress */\n loading?: boolean;\n /** Maximum character length */\n maxLength?: number;\n}\n\nconst EditableTitle = React.forwardRef<HTMLDivElement, EditableTitleProps>(\n (\n {\n className,\n size,\n value,\n onSave,\n onChange,\n placeholder = 'Untitled',\n disabled = false,\n loading = false,\n maxLength,\n ...props\n },\n ref,\n ) => {\n const [isEditing, setIsEditing] = React.useState(false);\n const [draft, setDraft] = React.useState(value);\n /** Avoids a flash: after save/cancel the pointer often sits where the pen mounts, so hover would show it immediately. */\n const [suppressPenReveal, setSuppressPenReveal] = React.useState(false);\n const inputRef = React.useRef<HTMLInputElement>(null);\n\n React.useEffect(() => {\n if (!suppressPenReveal) return;\n const t = window.setTimeout(() => setSuppressPenReveal(false), 200);\n return () => clearTimeout(t);\n }, [suppressPenReveal]);\n\n React.useEffect(() => {\n if (!isEditing) {\n setDraft(value);\n }\n }, [value, isEditing]);\n\n React.useEffect(() => {\n if (isEditing && inputRef.current) {\n inputRef.current.focus();\n inputRef.current.select();\n }\n }, [isEditing]);\n\n const startEditing = () => {\n if (disabled || loading) return;\n setSuppressPenReveal(false);\n setDraft(value);\n setIsEditing(true);\n };\n\n const endEditing = () => {\n setSuppressPenReveal(true);\n setIsEditing(false);\n };\n\n const save = () => {\n const trimmed = draft.trim();\n if (trimmed && trimmed !== value) {\n onSave?.(trimmed);\n }\n endEditing();\n };\n\n const cancel = () => {\n setDraft(value);\n endEditing();\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n save();\n } else if (e.key === 'Escape') {\n e.preventDefault();\n cancel();\n }\n };\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n if (maxLength && newValue.length > maxLength) return;\n setDraft(newValue);\n onChange?.(newValue);\n };\n\n if (isEditing) {\n return (\n <div\n ref={ref}\n className={cn(editableTitleVariants({ size }), className)}\n {...props}\n >\n <input\n ref={inputRef}\n type=\"text\"\n value={draft}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n onBlur={save}\n placeholder={placeholder}\n maxLength={maxLength}\n className={cn(\n editableTitleInputVariants({ size }),\n 'min-w-0 flex-1',\n )}\n aria-label=\"Edit title\"\n />\n <Button\n type=\"button\"\n variant=\"actionPositive\"\n size=\"icon\"\n className={titleActionButtonClass(size)}\n onMouseDown={(e) => e.preventDefault()}\n onClick={save}\n aria-label=\"Save title\"\n >\n <Check />\n </Button>\n <Button\n type=\"button\"\n variant=\"actionNegative\"\n size=\"icon\"\n className={titleActionButtonClass(size)}\n onMouseDown={(e) => e.preventDefault()}\n onClick={cancel}\n aria-label=\"Cancel editing\"\n >\n <X />\n </Button>\n </div>\n );\n }\n\n return (\n <div\n ref={ref}\n className={cn(editableTitleVariants({ size }), 'group', className)}\n {...props}\n >\n <span\n className={cn(\n 'cursor-pointer hover:text-primary transition-colors duration-fast ease-default',\n disabled && 'cursor-default hover:text-foreground',\n loading && 'cursor-wait hover:text-foreground opacity-70',\n )}\n onClick={startEditing}\n role=\"button\"\n tabIndex={disabled ? -1 : 0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n startEditing();\n }\n }}\n aria-label={disabled ? value : `Edit title: ${value}`}\n >\n {value || placeholder}\n </span>\n {!disabled && !loading && (\n <Button\n type=\"button\"\n variant=\"actionNeutral\"\n size=\"icon\"\n className={cn(\n 'transition-opacity duration-fast ease-default',\n titleActionButtonClass(size),\n suppressPenReveal\n ? 'pointer-events-none opacity-0'\n : 'opacity-0 group-hover:opacity-100 group-focus-within:opacity-100',\n )}\n onClick={startEditing}\n tabIndex={-1}\n aria-hidden=\"true\"\n >\n <Pencil />\n </Button>\n )}\n {loading && (\n <span\n className={cn(\n 'inline-flex items-center justify-center shrink-0 rounded-md text-muted-foreground',\n loadingSpinnerWrapClass(size),\n 'animate-spin pointer-events-none',\n )}\n aria-label=\"Saving\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n >\n <circle\n className=\"opacity-25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n />\n <path\n className=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z\"\n />\n </svg>\n </span>\n )}\n </div>\n );\n },\n);\nEditableTitle.displayName = 'EditableTitle';\n\nexport { EditableTitle, editableTitleVariants };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { AspectRatio as AspectRatioPrimitive } from \"radix-ui\";\n\nconst AspectRatio = AspectRatioPrimitive.Root;\n\nexport { AspectRatio };\n","\"use client\";\n\nimport { Collapsible as CollapsiblePrimitive } from \"radix-ui\";\n\nfunction Collapsible({\n ...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" {...props} />;\n}\n\nfunction CollapsibleTrigger({\n ...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {\n return (\n <CollapsiblePrimitive.CollapsibleTrigger\n data-slot=\"collapsible-trigger\"\n {...props}\n />\n );\n}\n\nfunction CollapsibleContent({\n ...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {\n return (\n <CollapsiblePrimitive.CollapsibleContent\n data-slot=\"collapsible-content\"\n {...props}\n />\n );\n}\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { PanelLeft } from \"lucide-react\";\nimport { Slot as SlotPrimitive } from \"radix-ui\";\n\nimport { useIsMobile } from \"../hooks/use-mobile\";\nimport { cn } from \"../lib/utils\";\nimport { Button } from \"./button\";\nimport { Input } from \"./input\";\nimport { Separator } from \"./separator\";\nimport {\n Sheet,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n} from \"./sheet\";\nimport { Skeleton } from \"./skeleton\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from \"./tooltip\";\n\nconst SIDEBAR_COOKIE_NAME = \"sidebar_state\";\nconst SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;\nconst SIDEBAR_WIDTH = \"16rem\";\nconst SIDEBAR_WIDTH_MOBILE = \"18rem\";\nconst SIDEBAR_WIDTH_ICON = \"3rem\";\nconst SIDEBAR_KEYBOARD_SHORTCUT = \"b\";\n\ntype SidebarContextProps = {\n state: \"expanded\" | \"collapsed\";\n open: boolean;\n setOpen: (open: boolean) => void;\n openMobile: boolean;\n setOpenMobile: (open: boolean) => void;\n isMobile: boolean;\n toggleSidebar: () => void;\n};\n\nconst SidebarContext = React.createContext<SidebarContextProps | null>(null);\n\nfunction useSidebar() {\n const context = React.useContext(SidebarContext);\n if (!context) {\n throw new Error(\"useSidebar must be used within a SidebarProvider.\");\n }\n return context;\n}\n\nfunction SidebarProvider({\n defaultOpen = true,\n open: openProp,\n onOpenChange: setOpenProp,\n className,\n style,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & {\n defaultOpen?: boolean;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n}) {\n const isMobile = useIsMobile();\n const [openMobile, setOpenMobile] = React.useState(false);\n\n const [_open, _setOpen] = React.useState(defaultOpen);\n const open = openProp ?? _open;\n const setOpen = React.useCallback(\n (value: boolean | ((value: boolean) => boolean)) => {\n const openState = typeof value === \"function\" ? value(open) : value;\n if (setOpenProp) {\n setOpenProp(openState);\n } else {\n _setOpen(openState);\n }\n document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;\n },\n [setOpenProp, open]\n );\n\n const toggleSidebar = React.useCallback(() => {\n return isMobile\n ? setOpenMobile((open) => !open)\n : setOpen((open) => !open);\n }, [isMobile, setOpen, setOpenMobile]);\n\n React.useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (\n event.key === SIDEBAR_KEYBOARD_SHORTCUT &&\n (event.metaKey || event.ctrlKey)\n ) {\n event.preventDefault();\n toggleSidebar();\n }\n };\n window.addEventListener(\"keydown\", handleKeyDown);\n return () => window.removeEventListener(\"keydown\", handleKeyDown);\n }, [toggleSidebar]);\n\n const state = open ? \"expanded\" : \"collapsed\";\n\n const contextValue = React.useMemo<SidebarContextProps>(\n () => ({\n state,\n open,\n setOpen,\n isMobile,\n openMobile,\n setOpenMobile,\n toggleSidebar,\n }),\n [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]\n );\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <TooltipProvider delayDuration={0}>\n <div\n data-slot=\"sidebar-wrapper\"\n style={\n {\n \"--sidebar-width\": SIDEBAR_WIDTH,\n \"--sidebar-width-icon\": SIDEBAR_WIDTH_ICON,\n ...style,\n } as React.CSSProperties\n }\n className={cn(\n \"group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n </TooltipProvider>\n </SidebarContext.Provider>\n );\n}\n\nfunction Sidebar({\n side = \"left\",\n variant = \"sidebar\",\n collapsible = \"offcanvas\",\n className,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & {\n side?: \"left\" | \"right\";\n variant?: \"sidebar\" | \"floating\" | \"inset\";\n collapsible?: \"offcanvas\" | \"icon\" | \"none\";\n}) {\n const { isMobile, state, openMobile, setOpenMobile } = useSidebar();\n\n if (collapsible === \"none\") {\n return (\n <div\n data-slot=\"sidebar\"\n className={cn(\n \"flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n );\n }\n\n if (isMobile) {\n return (\n <Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>\n <SheetContent\n data-sidebar=\"sidebar\"\n data-slot=\"sidebar\"\n data-mobile=\"true\"\n className=\"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden\"\n style={\n {\n \"--sidebar-width\": SIDEBAR_WIDTH_MOBILE,\n } as React.CSSProperties\n }\n side={side}\n >\n <SheetHeader className=\"sr-only\">\n <SheetTitle>Sidebar</SheetTitle>\n <SheetDescription>Displays the mobile sidebar.</SheetDescription>\n </SheetHeader>\n <div className=\"flex h-full w-full flex-col\">{children}</div>\n </SheetContent>\n </Sheet>\n );\n }\n\n return (\n <div\n className=\"group peer hidden text-sidebar-foreground md:block\"\n data-state={state}\n data-collapsible={state === \"collapsed\" ? collapsible : \"\"}\n data-variant={variant}\n data-side={side}\n data-slot=\"sidebar\"\n >\n <div\n data-slot=\"sidebar-gap\"\n className={cn(\n \"relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear\",\n \"group-data-[collapsible=offcanvas]:w-0\",\n \"group-data-[side=right]:rotate-180\",\n variant === \"floating\" || variant === \"inset\"\n ? \"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]\"\n : \"group-data-[collapsible=icon]:w-(--sidebar-width-icon)\"\n )}\n />\n <div\n data-slot=\"sidebar-container\"\n className={cn(\n \"fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex\",\n side === \"left\"\n ? \"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]\"\n : \"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]\",\n variant === \"floating\" || variant === \"inset\"\n ? \"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]\"\n : \"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l\",\n className\n )}\n {...props}\n >\n <div\n data-sidebar=\"sidebar\"\n data-slot=\"sidebar-inner\"\n className=\"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm\"\n >\n {children}\n </div>\n </div>\n </div>\n );\n}\n\nfunction SidebarTrigger({\n className,\n onClick,\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { toggleSidebar } = useSidebar();\n\n return (\n <Button\n data-sidebar=\"trigger\"\n data-slot=\"sidebar-trigger\"\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\"size-7\", className)}\n onClick={(event) => {\n onClick?.(event);\n toggleSidebar();\n }}\n {...props}\n >\n <PanelLeft />\n <span className=\"sr-only\">Toggle Sidebar</span>\n </Button>\n );\n}\n\nfunction SidebarRail({ className, ...props }: React.ComponentProps<\"button\">) {\n const { toggleSidebar } = useSidebar();\n\n return (\n <button\n data-sidebar=\"rail\"\n data-slot=\"sidebar-rail\"\n aria-label=\"Toggle Sidebar\"\n tabIndex={-1}\n onClick={toggleSidebar}\n title=\"Toggle Sidebar\"\n className={cn(\n \"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] hover:after:bg-sidebar-border sm:flex\",\n \"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize\",\n \"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize\",\n \"group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar\",\n \"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2\",\n \"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarInset({ className, ...props }: React.ComponentProps<\"main\">) {\n return (\n <main\n data-slot=\"sidebar-inset\"\n className={cn(\n \"relative flex w-full flex-1 flex-col bg-background\",\n \"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\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarInput({\n className,\n ...props\n}: React.ComponentProps<typeof Input>) {\n return (\n <Input\n data-slot=\"sidebar-input\"\n data-sidebar=\"input\"\n className={cn(\"h-8 w-full bg-background shadow-none\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-header\"\n data-sidebar=\"header\"\n className={cn(\"flex flex-col gap-2 p-2\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-footer\"\n data-sidebar=\"footer\"\n className={cn(\"flex flex-col gap-2 p-2\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof Separator>) {\n return (\n <Separator\n data-slot=\"sidebar-separator\"\n data-sidebar=\"separator\"\n className={cn(\"mx-2 w-auto bg-sidebar-border\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-content\"\n data-sidebar=\"content\"\n className={cn(\n \"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-group\"\n data-sidebar=\"group\"\n className={cn(\"relative flex w-full min-w-0 flex-col p-2\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarGroupLabel({\n className,\n asChild = false,\n ...props\n}: React.ComponentProps<\"div\"> & { asChild?: boolean }) {\n const Comp = asChild ? SlotPrimitive.Slot : \"div\";\n\n return (\n <Comp\n data-slot=\"sidebar-group-label\"\n data-sidebar=\"group-label\"\n className={cn(\n \"flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n \"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarGroupAction({\n className,\n asChild = false,\n ...props\n}: React.ComponentProps<\"button\"> & { asChild?: boolean }) {\n const Comp = asChild ? SlotPrimitive.Slot : \"button\";\n\n return (\n <Comp\n data-slot=\"sidebar-group-action\"\n data-sidebar=\"group-action\"\n className={cn(\n \"absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n \"after:absolute after:-inset-2 md:after:hidden\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarGroupContent({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-group-content\"\n data-sidebar=\"group-content\"\n className={cn(\"w-full text-sm\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarMenu({ className, ...props }: React.ComponentProps<\"ul\">) {\n return (\n <ul\n data-slot=\"sidebar-menu\"\n data-sidebar=\"menu\"\n className={cn(\"flex w-full min-w-0 flex-col gap-1\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuItem({ className, ...props }: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"sidebar-menu-item\"\n data-sidebar=\"menu-item\"\n className={cn(\"group/menu-item relative\", className)}\n {...props}\n />\n );\n}\n\nconst sidebarMenuButtonVariants = cva(\n \"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! 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 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 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0\",\n {\n variants: {\n variant: {\n default:\n \"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground\",\n outline:\n \"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))]\",\n },\n size: {\n default: \"h-8 text-sm\",\n sm: \"h-7 text-xs\",\n lg: \"h-12 text-sm group-data-[collapsible=icon]:p-0!\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\nfunction SidebarMenuButton({\n asChild = false,\n isActive = false,\n variant = \"default\",\n size = \"default\",\n tooltip,\n className,\n ...props\n}: React.ComponentProps<\"button\"> & {\n asChild?: boolean;\n isActive?: boolean;\n tooltip?: string | React.ComponentProps<typeof TooltipContent>;\n} & VariantProps<typeof sidebarMenuButtonVariants>) {\n const Comp = asChild ? SlotPrimitive.Slot : \"button\";\n const { isMobile, state } = useSidebar();\n\n const button = (\n <Comp\n data-slot=\"sidebar-menu-button\"\n data-sidebar=\"menu-button\"\n data-size={size}\n data-active={isActive}\n className={cn(sidebarMenuButtonVariants({ variant, size }), className)}\n {...props}\n />\n );\n\n if (!tooltip) {\n return button;\n }\n\n if (typeof tooltip === \"string\") {\n tooltip = {\n children: tooltip,\n };\n }\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n <TooltipContent\n side=\"right\"\n align=\"center\"\n hidden={state !== \"collapsed\" || isMobile}\n {...tooltip}\n />\n </Tooltip>\n );\n}\n\nfunction SidebarMenuAction({\n className,\n asChild = false,\n showOnHover = false,\n ...props\n}: React.ComponentProps<\"button\"> & {\n asChild?: boolean;\n showOnHover?: boolean;\n}) {\n const Comp = asChild ? SlotPrimitive.Slot : \"button\";\n\n return (\n <Comp\n data-slot=\"sidebar-menu-action\"\n data-sidebar=\"menu-action\"\n className={cn(\n \"absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0\",\n \"after:absolute after:-inset-2 md:after:hidden\",\n \"peer-data-[size=sm]/menu-button:top-1\",\n \"peer-data-[size=default]/menu-button:top-1.5\",\n \"peer-data-[size=lg]/menu-button:top-2.5\",\n \"group-data-[collapsible=icon]:hidden\",\n showOnHover &&\n \"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground data-[state=open]:opacity-100 md:opacity-0\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuBadge({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sidebar-menu-badge\"\n data-sidebar=\"menu-badge\"\n className={cn(\n \"pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none\",\n \"peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground\",\n \"peer-data-[size=sm]/menu-button:top-1\",\n \"peer-data-[size=default]/menu-button:top-1.5\",\n \"peer-data-[size=lg]/menu-button:top-2.5\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuSkeleton({\n className,\n showIcon = false,\n ...props\n}: React.ComponentProps<\"div\"> & {\n showIcon?: boolean;\n}) {\n const width = React.useMemo(() => {\n return `${Math.floor(Math.random() * 40) + 50}%`;\n }, []);\n\n return (\n <div\n data-slot=\"sidebar-menu-skeleton\"\n data-sidebar=\"menu-skeleton\"\n className={cn(\"flex h-8 items-center gap-2 rounded-md px-2\", className)}\n {...props}\n >\n {showIcon && (\n <Skeleton\n className=\"size-4 rounded-md\"\n data-sidebar=\"menu-skeleton-icon\"\n />\n )}\n <Skeleton\n className=\"h-4 max-w-(--skeleton-width) flex-1\"\n data-sidebar=\"menu-skeleton-text\"\n style={\n {\n \"--skeleton-width\": width,\n } as React.CSSProperties\n }\n />\n </div>\n );\n}\n\nfunction SidebarMenuSub({ className, ...props }: React.ComponentProps<\"ul\">) {\n return (\n <ul\n data-slot=\"sidebar-menu-sub\"\n data-sidebar=\"menu-sub\"\n className={cn(\n \"mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuSubItem({\n className,\n ...props\n}: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"sidebar-menu-sub-item\"\n data-sidebar=\"menu-sub-item\"\n className={cn(\"group/menu-sub-item relative\", className)}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuSubButton({\n asChild = false,\n size = \"md\",\n isActive = false,\n className,\n ...props\n}: React.ComponentProps<\"a\"> & {\n asChild?: boolean;\n size?: \"sm\" | \"md\";\n isActive?: boolean;\n}) {\n const Comp = asChild ? SlotPrimitive.Slot : \"a\";\n\n return (\n <Comp\n data-slot=\"sidebar-menu-sub-button\"\n data-sidebar=\"menu-sub-button\"\n data-size={size}\n data-active={isActive}\n className={cn(\n \"flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden 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 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground\",\n \"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground\",\n size === \"sm\" && \"text-xs\",\n size === \"md\" && \"text-sm\",\n \"group-data-[collapsible=icon]:hidden\",\n className\n )}\n {...props}\n />\n );\n}\n\nexport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupAction,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInput,\n SidebarInset,\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSkeleton,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n SidebarProvider,\n SidebarRail,\n SidebarSeparator,\n SidebarTrigger,\n useSidebar,\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\n\nexport type SocialProvider = \"google\" | \"facebook\" | \"github\" | \"apple\";\n\ninterface SocialProvidersProps {\n providers: SocialProvider[];\n onSocialLogin: (provider: SocialProvider) => void;\n loading?: boolean;\n disabled?: boolean;\n className?: string;\n}\n\nconst providerConfig: Record<\n SocialProvider,\n { label: string; icon: React.ReactNode }\n> = {\n google: {\n label: \"Google\",\n icon: (\n <svg className=\"h-4 w-4\" viewBox=\"0 0 24 24\" fill=\"none\">\n <path\n d=\"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z\"\n fill=\"#4285F4\"\n />\n <path\n d=\"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z\"\n fill=\"#34A853\"\n />\n <path\n d=\"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z\"\n fill=\"#FBBC05\"\n />\n <path\n d=\"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z\"\n fill=\"#EA4335\"\n />\n </svg>\n ),\n },\n facebook: {\n label: \"Facebook\",\n icon: (\n <svg className=\"h-4 w-4\" viewBox=\"0 0 24 24\" fill=\"#1877F2\">\n <path d=\"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z\" />\n </svg>\n ),\n },\n github: {\n label: \"GitHub\",\n icon: (\n <svg className=\"h-4 w-4\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z\" />\n </svg>\n ),\n },\n apple: {\n label: \"Apple\",\n icon: (\n <svg className=\"h-4 w-4\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.8-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z\" />\n </svg>\n ),\n },\n};\n\nexport function SocialProviders({\n providers,\n onSocialLogin,\n loading,\n disabled,\n className,\n}: SocialProvidersProps) {\n return (\n <div className={cn(\"grid gap-2\", className)}>\n {providers.map((provider) => {\n const config = providerConfig[provider];\n return (\n <Button\n key={provider}\n variant=\"outline\"\n type=\"button\"\n disabled={loading || disabled}\n onClick={() => onSocialLogin(provider)}\n className=\"w-full\"\n >\n {config.icon}\n <span className=\"ml-2\">Continue with {config.label}</span>\n </Button>\n );\n })}\n </div>\n );\n}\n","'use client';\n\nimport * as React from 'react';\nimport { motion, AnimatePresence } from 'motion/react';\nimport { cn } from '../../lib/utils';\nimport { Button } from '../../components/button';\nimport { CodeInput } from '../../components/code-input';\nimport { Input } from '../../components/input';\nimport { InputGroup } from '../../components/input-group';\nimport { PasswordInput } from '../../components/password-input';\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from '../../components/card';\nimport { Spinner } from '../../components/spinner';\nimport { FormError } from '../../form/form-error';\nimport { SocialProviders, type SocialProvider } from './social-providers';\nimport { Separator } from '../../components/separator';\n\nexport interface SignInBlockProps {\n onSubmit: (data: { email: string; password: string }) => void | Promise<void>;\n onForgotPassword?: () => void;\n onSocialLogin?: (provider: SocialProvider) => void;\n socialProviders?: SocialProvider[];\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n title?: string;\n description?: string;\n signUpHref?: string;\n onSignUp?: () => void;\n className?: string;\n /** When provided, replaces the built-in form content. The Card wrapper, header, and footer links are preserved. */\n children?: React.ReactNode;\n /** Callback to request a one-time code. When provided, enables the tabbed Password / OTP layout. */\n onOtpRequest?: (email: string) => Promise<{ session: string }>;\n /** Callback to verify a one-time code and complete login. */\n onOtpVerify?: (data: {\n email: string;\n code: string;\n session: string;\n }) => Promise<void>;\n /** Label for the OTP tab trigger. @default \"Email me a code\" */\n otpLabel?: string;\n /** Fires when the user switches between the password and OTP tabs. Useful for clearing parent-owned error state so stale errors do not persist across tabs. */\n onTabChange?: (tab: 'password' | 'otp') => void;\n}\n\ntype OtpStep = 'email' | 'code';\n\nconst AUTH_TABS = { PASSWORD: 'password', OTP: 'otp' } as const;\ntype AuthTab = (typeof AUTH_TABS)[keyof typeof AUTH_TABS];\n\nfunction PillTabs({\n activeTab,\n onTabChange,\n otpLabel,\n}: {\n activeTab: AuthTab;\n onTabChange: (tab: AuthTab) => void;\n otpLabel: string;\n}) {\n const tabs = [\n { value: AUTH_TABS.PASSWORD, label: 'Password' },\n { value: AUTH_TABS.OTP, label: otpLabel },\n ];\n\n return (\n <div className=\"relative flex rounded-md bg-muted p-1\">\n {tabs.map((tab) => (\n <button\n key={tab.value}\n type=\"button\"\n onClick={() => onTabChange(tab.value)}\n className={cn(\n 'relative z-10 flex-1 rounded-sm px-3 py-1.5 text-sm font-medium transition-colors',\n activeTab === tab.value\n ? 'text-primary-foreground'\n : 'text-muted-foreground hover:text-foreground',\n )}\n >\n {activeTab === tab.value && (\n <motion.div\n layoutId=\"sign-in-tab-pill\"\n className=\"absolute inset-0 rounded-sm bg-primary shadow-sm\"\n transition={{ type: 'spring', bounce: 0.15, duration: 0.4 }}\n />\n )}\n <span className=\"relative z-10\">{tab.label}</span>\n </button>\n ))}\n </div>\n );\n}\n\nfunction OtpForm({\n onOtpRequest,\n onOtpVerify,\n loading = false,\n disabled = false,\n}: {\n onOtpRequest: (email: string) => Promise<{ session: string }>;\n onOtpVerify: (data: {\n email: string;\n code: string;\n session: string;\n }) => Promise<void>;\n loading?: boolean;\n disabled?: boolean;\n}) {\n const [step, setStep] = React.useState<OtpStep>('email');\n const [email, setEmail] = React.useState('');\n const [session, setSession] = React.useState('');\n const [otpLoading, setOtpLoading] = React.useState(false);\n const [otpError, setOtpError] = React.useState<string | undefined>();\n\n const isLoading = loading || otpLoading;\n const displayError = otpError;\n\n const handleEmailSubmit = async (\n e: React.SyntheticEvent<HTMLFormElement>,\n ) => {\n e.preventDefault();\n const formData = new FormData(e.currentTarget);\n const emailValue = formData.get('otp-email') as string;\n setOtpError(undefined);\n setOtpLoading(true);\n\n try {\n const result = await onOtpRequest(emailValue);\n setEmail(emailValue);\n setSession(result.session);\n setStep('code');\n } catch (err) {\n setOtpError(\n err instanceof Error\n ? err.message\n : 'Failed to send code. Please try again.',\n );\n } finally {\n setOtpLoading(false);\n }\n };\n\n if (step === 'code') {\n return (\n <>\n <FormError message={displayError} />\n <div className=\"space-y-4\">\n <div className=\"text-center text-sm text-muted-foreground\">\n We sent a 6-digit code to <strong>{email}</strong>\n </div>\n <CodeInput\n length={6}\n loading={isLoading}\n disabled={disabled}\n onComplete={(fullCode) => {\n setOtpLoading(true);\n setOtpError(undefined);\n onOtpVerify({ email, code: fullCode, session })\n .catch((err) =>\n setOtpError(\n err instanceof Error\n ? err.message\n : 'Invalid or expired code. Please try again.',\n ),\n )\n .finally(() => setOtpLoading(false));\n }}\n />\n {isLoading && (\n <div className=\"flex justify-center\">\n <Spinner size=\"sm\" />\n </div>\n )}\n <button\n type=\"button\"\n className=\"w-full text-center text-sm text-muted-foreground hover:text-foreground\"\n onClick={() => {\n setStep('email');\n setOtpError(undefined);\n }}\n >\n Use a different email\n </button>\n </div>\n </>\n );\n }\n\n return (\n <>\n <FormError message={displayError} />\n <form onSubmit={handleEmailSubmit} className=\"space-y-4\">\n <InputGroup label=\"Email\" htmlFor=\"otp-email\">\n <Input\n id=\"otp-email\"\n name=\"otp-email\"\n type=\"email\"\n placeholder=\"name@example.com\"\n required\n disabled={isLoading || disabled}\n autoComplete=\"email\"\n />\n </InputGroup>\n <Button\n type=\"submit\"\n variant=\"default\"\n className=\"w-full\"\n loading={isLoading}\n disabled={disabled}\n >\n Send Login Code\n </Button>\n </form>\n </>\n );\n}\n\nexport function SignInBlock({\n onSubmit,\n onForgotPassword,\n onSocialLogin,\n socialProviders = [],\n loading = false,\n error,\n disabled = false,\n title = 'Sign in',\n description = 'Enter your credentials to access your account',\n signUpHref,\n onSignUp,\n className,\n children,\n onOtpRequest,\n onOtpVerify,\n otpLabel = 'Email me a code',\n onTabChange,\n}: SignInBlockProps) {\n const [activeTab, setActiveTab] = React.useState<AuthTab>(AUTH_TABS.PASSWORD);\n const otpEnabled = Boolean(onOtpRequest && onOtpVerify);\n\n const handleTabChange = React.useCallback(\n (tab: AuthTab) => {\n setActiveTab(tab);\n onTabChange?.(tab);\n },\n [onTabChange],\n );\n\n // Stale parent-owned errors should not bleed across tab switches\n // (for example, a failed password attempt's \"Invalid email or password\"\n // alert must not appear under the OTP tab). We track which tab the\n // current `error` was set on and only render it when that tab is active.\n const [errorTab, setErrorTab] = React.useState<AuthTab | null>(\n error ? AUTH_TABS.PASSWORD : null,\n );\n const previousErrorRef = React.useRef<string | undefined>(error);\n React.useEffect(() => {\n if (error !== previousErrorRef.current) {\n previousErrorRef.current = error;\n setErrorTab(error ? activeTab : null);\n }\n }, [error, activeTab]);\n const visibleError = errorTab === activeTab ? error : undefined;\n\n const handleSubmit = async (e: React.SyntheticEvent<HTMLFormElement>) => {\n e.preventDefault();\n const formData = new FormData(e.currentTarget);\n await onSubmit({\n email: formData.get('email') as string,\n password: formData.get('password') as string,\n });\n };\n\n const passwordForm = (\n <>\n <FormError message={visibleError} />\n\n <form onSubmit={handleSubmit} className=\"space-y-4\">\n <InputGroup label=\"Email\" htmlFor=\"email\">\n <Input\n id=\"email\"\n name=\"email\"\n type=\"email\"\n placeholder=\"name@example.com\"\n required\n disabled={loading || disabled}\n autoComplete=\"email\"\n />\n </InputGroup>\n <InputGroup label=\"Password\" htmlFor=\"password\">\n <PasswordInput\n id=\"password\"\n name=\"password\"\n required\n disabled={loading || disabled}\n autoComplete=\"current-password\"\n />\n {onForgotPassword && (\n <div className=\"flex justify-end\">\n <button\n type=\"button\"\n onClick={onForgotPassword}\n className=\"text-sm text-primary hover:underline\"\n tabIndex={-1}\n >\n Forgot password?\n </button>\n </div>\n )}\n </InputGroup>\n\n <Button\n type=\"submit\"\n variant=\"default\"\n className=\"w-full\"\n loading={loading}\n disabled={disabled}\n >\n Sign in\n </Button>\n </form>\n </>\n );\n\n const socialSection = socialProviders.length > 0 && onSocialLogin && (\n <>\n <div className=\"relative\">\n <div className=\"absolute inset-0 flex items-center\">\n <Separator className=\"w-full\" />\n </div>\n <div className=\"relative flex justify-center text-xs uppercase\">\n <span className=\"bg-card px-2 text-muted-foreground\">or</span>\n </div>\n </div>\n <SocialProviders\n providers={socialProviders}\n onSocialLogin={onSocialLogin}\n loading={loading}\n disabled={disabled}\n />\n </>\n );\n\n const footerLinks = (\n <>\n {(signUpHref || onSignUp) && (\n <p className=\"text-center text-sm text-muted-foreground\">\n Don&apos;t have an account?{' '}\n {onSignUp ? (\n <button\n type=\"button\"\n onClick={onSignUp}\n className=\"text-primary hover:underline font-medium\"\n >\n Sign up\n </button>\n ) : (\n <a\n href={signUpHref}\n className=\"text-primary hover:underline font-medium\"\n >\n Sign up\n </a>\n )}\n </p>\n )}\n </>\n );\n\n return (\n <Card className={cn('w-full max-w-md mx-auto', className)}>\n <CardHeader className=\"text-center\">\n <CardTitle>{title}</CardTitle>\n <CardDescription>{description}</CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"space-y-4\">\n {children ? (\n children\n ) : otpEnabled ? (\n <>\n <PillTabs\n activeTab={activeTab}\n onTabChange={handleTabChange}\n otpLabel={otpLabel}\n />\n <motion.div\n layout\n transition={{ type: 'spring', bounce: 0, duration: 0.4 }}\n className=\"\"\n >\n <AnimatePresence mode=\"wait\" initial={false}>\n {activeTab === AUTH_TABS.PASSWORD ? (\n <motion.div\n key=\"password\"\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.15 }}\n className=\"space-y-4\"\n >\n {passwordForm}\n </motion.div>\n ) : (\n <motion.div\n key=\"otp\"\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.15 }}\n className=\"space-y-4\"\n >\n <OtpForm\n onOtpRequest={onOtpRequest!}\n onOtpVerify={onOtpVerify!}\n loading={loading}\n disabled={disabled}\n />\n </motion.div>\n )}\n </AnimatePresence>\n </motion.div>\n </>\n ) : (\n passwordForm\n )}\n\n {socialSection}\n {footerLinks}\n </div>\n </CardContent>\n </Card>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { Input } from \"../../components/input\";\nimport { InputGroup } from \"../../components/input-group\";\nimport { PasswordInput } from \"../../components/password-input\";\nimport { Checkbox } from \"../../components/checkbox\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from \"../../components/card\";\nimport { FormError } from \"../../form/form-error\";\nimport { SocialProviders, type SocialProvider } from \"./social-providers\";\nimport { Separator } from \"../../components/separator\";\n\nexport interface SignUpBlockProps {\n onSubmit: (data: {\n firstName: string;\n lastName: string;\n email: string;\n password: string;\n confirmPassword: string;\n termsAccepted: boolean;\n }) => void | Promise<void>;\n onSocialLogin?: (provider: SocialProvider) => void;\n socialProviders?: SocialProvider[];\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n title?: string;\n description?: string;\n signInHref?: string;\n onSignIn?: () => void;\n termsHref?: string;\n privacyHref?: string;\n className?: string;\n}\n\nexport function SignUpBlock({\n onSubmit,\n onSocialLogin,\n socialProviders = [],\n loading = false,\n error,\n disabled = false,\n title = \"Create an account\",\n description = \"Enter your details to get started\",\n signInHref,\n onSignIn,\n termsHref = \"#\",\n privacyHref = \"#\",\n className,\n}: SignUpBlockProps) {\n const [termsAccepted, setTermsAccepted] = React.useState(false);\n\n const handleSubmit = async (e: React.SyntheticEvent<HTMLFormElement>) => {\n e.preventDefault();\n const formData = new FormData(e.currentTarget);\n await onSubmit({\n firstName: (formData.get(\"firstName\") as string) ?? \"\",\n lastName: (formData.get(\"lastName\") as string) ?? \"\",\n email: formData.get(\"email\") as string,\n password: formData.get(\"password\") as string,\n confirmPassword: formData.get(\"confirmPassword\") as string,\n termsAccepted,\n });\n };\n\n return (\n <Card className={cn(\"w-full max-w-md mx-auto\", className)}>\n <CardHeader className=\"text-center\">\n <CardTitle>{title}</CardTitle>\n <CardDescription>{description}</CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"space-y-4\">\n {socialProviders.length > 0 && onSocialLogin && (\n <>\n <SocialProviders\n providers={socialProviders}\n onSocialLogin={onSocialLogin}\n loading={loading}\n disabled={disabled}\n />\n <div className=\"relative\">\n <div className=\"absolute inset-0 flex items-center\">\n <Separator className=\"w-full\" />\n </div>\n <div className=\"relative flex justify-center text-xs uppercase\">\n <span className=\"bg-card px-2 text-muted-foreground\">\n Or continue with\n </span>\n </div>\n </div>\n </>\n )}\n\n <FormError message={error} />\n\n <form onSubmit={handleSubmit} className=\"space-y-4\">\n <InputGroup label=\"First name\" htmlFor=\"firstName\">\n <Input\n id=\"firstName\"\n name=\"firstName\"\n placeholder=\"Jane\"\n required\n disabled={loading || disabled}\n autoComplete=\"given-name\"\n />\n </InputGroup>\n <InputGroup label=\"Last name\" htmlFor=\"lastName\">\n <Input\n id=\"lastName\"\n name=\"lastName\"\n placeholder=\"Doe\"\n required\n disabled={loading || disabled}\n autoComplete=\"family-name\"\n />\n </InputGroup>\n <InputGroup label=\"Email\" htmlFor=\"email\">\n <Input\n id=\"email\"\n name=\"email\"\n type=\"email\"\n placeholder=\"name@example.com\"\n required\n disabled={loading || disabled}\n autoComplete=\"email\"\n />\n </InputGroup>\n <InputGroup label=\"Password\" htmlFor=\"password\">\n <PasswordInput\n id=\"password\"\n name=\"password\"\n required\n disabled={loading || disabled}\n autoComplete=\"new-password\"\n />\n </InputGroup>\n <InputGroup label=\"Confirm password\" htmlFor=\"confirmPassword\">\n <PasswordInput\n id=\"confirmPassword\"\n name=\"confirmPassword\"\n required\n disabled={loading || disabled}\n autoComplete=\"new-password\"\n />\n </InputGroup>\n\n <div className=\"flex items-start space-x-2\">\n <Checkbox\n id=\"terms\"\n checked={termsAccepted}\n onCheckedChange={(checked) =>\n setTermsAccepted(checked === true)\n }\n disabled={loading || disabled}\n className=\"mt-0.5\"\n />\n <label\n htmlFor=\"terms\"\n className=\"text-sm text-muted-foreground cursor-pointer\"\n >\n I agree to the{\" \"}\n <a href={termsHref} className=\"text-primary hover:underline\">\n terms of service\n </a>{\" \"}\n and{\" \"}\n <a href={privacyHref} className=\"text-primary hover:underline\">\n privacy policy\n </a>\n </label>\n </div>\n\n <Button\n type=\"submit\"\n className=\"w-full\"\n loading={loading}\n disabled={disabled || !termsAccepted}\n >\n Create account\n </Button>\n </form>\n\n {(signInHref || onSignIn) && (\n <p className=\"text-center text-sm text-muted-foreground\">\n Already have an account?{\" \"}\n {onSignIn ? (\n <button\n type=\"button\"\n onClick={onSignIn}\n className=\"text-primary hover:underline font-medium\"\n >\n Sign in\n </button>\n ) : (\n <a\n href={signInHref}\n className=\"text-primary hover:underline font-medium\"\n >\n Sign in\n </a>\n )}\n </p>\n )}\n </div>\n </CardContent>\n </Card>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { ArrowLeft, Mail } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { Input } from \"../../components/input\";\nimport { InputGroup } from \"../../components/input-group\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from \"../../components/card\";\nimport { FormError } from \"../../form/form-error\";\n\nexport interface ForgotPasswordBlockProps {\n onSubmit: (data: { email: string }) => void | Promise<void>;\n onBack?: () => void;\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n success?: boolean;\n title?: string;\n description?: string;\n className?: string;\n}\n\nexport function ForgotPasswordBlock({\n onSubmit,\n onBack,\n loading = false,\n error,\n disabled = false,\n success = false,\n title = \"Forgot password\",\n description = \"Enter your email and we'll send you a reset link\",\n className,\n}: ForgotPasswordBlockProps) {\n const handleSubmit = async (e: React.SyntheticEvent<HTMLFormElement>) => {\n e.preventDefault();\n const formData = new FormData(e.currentTarget);\n await onSubmit({ email: formData.get(\"email\") as string });\n };\n\n return (\n <Card className={cn(\"w-full max-w-md mx-auto\", className)}>\n <CardHeader className=\"text-center\">\n {success ? (\n <>\n <div className=\"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-primary/10\">\n <Mail className=\"h-6 w-6 text-primary\" />\n </div>\n <CardTitle>Check your email</CardTitle>\n <CardDescription>\n We&apos;ve sent a password reset link to your email address.\n </CardDescription>\n </>\n ) : (\n <>\n <CardTitle>{title}</CardTitle>\n <CardDescription>{description}</CardDescription>\n </>\n )}\n </CardHeader>\n {!success && (\n <CardContent>\n <div className=\"space-y-4\">\n <FormError message={error} />\n <form onSubmit={handleSubmit} className=\"space-y-4\">\n <InputGroup label=\"Email\" htmlFor=\"email\">\n <Input\n id=\"email\"\n name=\"email\"\n type=\"email\"\n placeholder=\"name@example.com\"\n required\n disabled={loading || disabled}\n autoComplete=\"email\"\n />\n </InputGroup>\n <Button\n type=\"submit\"\n className=\"w-full\"\n loading={loading}\n disabled={disabled}\n >\n Send reset link\n </Button>\n </form>\n {onBack && (\n <button\n type=\"button\"\n onClick={onBack}\n className=\"flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground mx-auto\"\n >\n <ArrowLeft className=\"h-4 w-4\" /> Back to sign in\n </button>\n )}\n </div>\n </CardContent>\n )}\n </Card>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { InputGroup } from \"../../components/input-group\";\nimport { PasswordInput } from \"../../components/password-input\";\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from \"../../components/card\";\nimport { FormError } from \"../../form/form-error\";\n\nexport interface ResetPasswordBlockProps {\n onSubmit: (data: {\n password: string;\n confirmPassword: string;\n }) => void | Promise<void>;\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n title?: string;\n description?: string;\n className?: string;\n}\n\nexport function ResetPasswordBlock({\n onSubmit,\n loading = false,\n error,\n disabled = false,\n title = \"Reset password\",\n description = \"Enter your new password below\",\n className,\n}: ResetPasswordBlockProps) {\n const handleSubmit = async (e: React.SyntheticEvent<HTMLFormElement>) => {\n e.preventDefault();\n const formData = new FormData(e.currentTarget);\n await onSubmit({\n password: formData.get(\"password\") as string,\n confirmPassword: formData.get(\"confirmPassword\") as string,\n });\n };\n\n return (\n <Card className={cn(\"w-full max-w-md mx-auto\", className)}>\n <CardHeader className=\"text-center\">\n <CardTitle>{title}</CardTitle>\n <CardDescription>{description}</CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"space-y-4\">\n <FormError message={error} />\n <form onSubmit={handleSubmit} className=\"space-y-4\">\n <InputGroup label=\"New password\" htmlFor=\"password\">\n <PasswordInput\n id=\"password\"\n name=\"password\"\n required\n disabled={loading || disabled}\n autoComplete=\"new-password\"\n />\n </InputGroup>\n <InputGroup label=\"Confirm new password\" htmlFor=\"confirmPassword\">\n <PasswordInput\n id=\"confirmPassword\"\n name=\"confirmPassword\"\n required\n disabled={loading || disabled}\n autoComplete=\"new-password\"\n />\n </InputGroup>\n <Button\n type=\"submit\"\n className=\"w-full\"\n loading={loading}\n disabled={disabled}\n >\n Reset password\n </Button>\n </form>\n </div>\n </CardContent>\n </Card>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { Input } from \"../../components/input\";\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from \"../../components/card\";\nimport { Spinner } from \"../../components/spinner\";\nimport { FormError } from \"../../form/form-error\";\n\nexport interface VerifyBlockProps {\n onVerify: (code: string) => void | Promise<void>;\n onResend?: () => void | Promise<void>;\n codeLength?: number;\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n title?: string;\n description?: string;\n resendCooldown?: number;\n className?: string;\n}\n\nexport function VerifyBlock({\n onVerify,\n onResend,\n codeLength = 6,\n loading = false,\n error,\n disabled = false,\n title = \"Verify your account\",\n description = \"Enter the verification code sent to your email\",\n resendCooldown = 60,\n className,\n}: VerifyBlockProps) {\n const [code, setCode] = React.useState<string[]>(Array(codeLength).fill(\"\"));\n const [countdown, setCountdown] = React.useState(0);\n const inputRefs = React.useRef<(HTMLInputElement | null)[]>([]);\n\n React.useEffect(() => {\n if (countdown > 0) {\n const timer = setTimeout(() => setCountdown(countdown - 1), 1000);\n return () => clearTimeout(timer);\n }\n }, [countdown]);\n\n const handleChange = (index: number, value: string) => {\n if (!/^\\d*$/.test(value)) return;\n const newCode = [...code];\n newCode[index] = value.slice(-1);\n setCode(newCode);\n\n if (value && index < codeLength - 1) {\n inputRefs.current[index + 1]?.focus();\n }\n\n const fullCode = newCode.join(\"\");\n if (fullCode.length === codeLength && newCode.every(Boolean)) {\n onVerify(fullCode);\n }\n };\n\n const handleKeyDown = (index: number, e: React.KeyboardEvent) => {\n if (e.key === \"Backspace\" && !code[index] && index > 0) {\n inputRefs.current[index - 1]?.focus();\n }\n };\n\n const handlePaste = (e: React.ClipboardEvent) => {\n e.preventDefault();\n const pasted = e.clipboardData.getData(\"text\").replace(/\\D/g, \"\").slice(0, codeLength);\n const newCode = [...code];\n for (let i = 0; i < pasted.length; i++) {\n newCode[i] = pasted[i];\n }\n setCode(newCode);\n if (pasted.length === codeLength) {\n onVerify(pasted);\n } else {\n inputRefs.current[pasted.length]?.focus();\n }\n };\n\n const handleResend = async () => {\n setCountdown(resendCooldown);\n await onResend?.();\n };\n\n return (\n <Card className={cn(\"w-full max-w-md mx-auto\", className)}>\n <CardHeader className=\"text-center\">\n <CardTitle>{title}</CardTitle>\n <CardDescription>{description}</CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"space-y-4\">\n <FormError message={error} />\n <div className=\"flex justify-center gap-2\" onPaste={handlePaste}>\n {code.map((digit, index) => (\n <Input\n key={index}\n ref={(el) => { inputRefs.current[index] = el; }}\n type=\"text\"\n inputMode=\"numeric\"\n maxLength={1}\n value={digit}\n onChange={(e) => handleChange(index, e.target.value)}\n onKeyDown={(e) => handleKeyDown(index, e)}\n disabled={loading || disabled}\n className=\"h-12 w-12 text-center text-lg font-semibold\"\n autoFocus={index === 0}\n />\n ))}\n </div>\n\n {loading && (\n <div className=\"flex justify-center\">\n <Spinner size=\"sm\" />\n </div>\n )}\n\n {onResend && (\n <div className=\"text-center\">\n {countdown > 0 ? (\n <p className=\"text-sm text-muted-foreground\">\n Resend code in {countdown}s\n </p>\n ) : (\n <Button variant=\"ghost\" size=\"sm\" onClick={handleResend} disabled={loading || disabled}>\n Resend code\n </Button>\n )}\n </div>\n )}\n </div>\n </CardContent>\n </Card>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { FileQuestion } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\n\nexport interface NotFoundBlockProps {\n title?: string;\n message?: string;\n homeHref?: string;\n onGoHome?: () => void;\n className?: string;\n}\n\nexport function NotFoundBlock({\n title = \"Page not found\",\n message = \"Sorry, we couldn't find the page you're looking for. It may have been moved or deleted.\",\n homeHref = \"/\",\n onGoHome,\n className,\n}: NotFoundBlockProps) {\n return (\n <div className={cn(\"flex min-h-[60vh] flex-col items-center justify-center text-center px-4\", className)}>\n <div className=\"mb-8 flex h-24 w-24 items-center justify-center rounded-full bg-muted\">\n <FileQuestion className=\"h-12 w-12 text-muted-foreground\" />\n </div>\n <h1 className=\"text-4xl font-bold tracking-tight mb-2\">404</h1>\n <h2 className=\"text-xl font-semibold mb-2\">{title}</h2>\n <p className=\"text-muted-foreground max-w-md mb-8\">{message}</p>\n {onGoHome ? (\n <Button onClick={onGoHome}>Go back home</Button>\n ) : (\n <Button asChild>\n <a href={homeHref}>Go back home</a>\n </Button>\n )}\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Server } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\n\nexport interface ServerErrorBlockProps {\n title?: string;\n message?: string;\n onRetry?: () => void;\n homeHref?: string;\n onGoHome?: () => void;\n className?: string;\n}\n\nexport function ServerErrorBlock({\n title = \"Something went wrong\",\n message = \"An unexpected error occurred. Our team has been notified and is working on a fix.\",\n onRetry,\n homeHref = \"/\",\n onGoHome,\n className,\n}: ServerErrorBlockProps) {\n return (\n <div className={cn(\"flex min-h-[60vh] flex-col items-center justify-center text-center px-4\", className)}>\n <div className=\"mb-8 flex h-24 w-24 items-center justify-center rounded-full bg-destructive/10\">\n <Server className=\"h-12 w-12 text-destructive\" />\n </div>\n <h1 className=\"text-4xl font-bold tracking-tight mb-2\">500</h1>\n <h2 className=\"text-xl font-semibold mb-2\">{title}</h2>\n <p className=\"text-muted-foreground max-w-md mb-8\">{message}</p>\n <div className=\"flex gap-3\">\n {onRetry && (\n <Button onClick={onRetry}>Try again</Button>\n )}\n {onGoHome ? (\n <Button variant=\"outline\" onClick={onGoHome}>Go home</Button>\n ) : (\n <Button variant=\"outline\" asChild>\n <a href={homeHref}>Go home</a>\n </Button>\n )}\n </div>\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Wrench } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface MaintenanceBlockProps {\n title?: string;\n message?: string;\n estimatedReturn?: string;\n className?: string;\n}\n\nexport function MaintenanceBlock({\n title = \"Under maintenance\",\n message = \"We're performing scheduled maintenance to improve your experience. We'll be back shortly.\",\n estimatedReturn,\n className,\n}: MaintenanceBlockProps) {\n return (\n <div className={cn(\"flex min-h-[60vh] flex-col items-center justify-center text-center px-4\", className)}>\n <div className=\"mb-8 flex h-24 w-24 items-center justify-center rounded-full bg-muted\">\n <Wrench className=\"h-12 w-12 text-muted-foreground\" />\n </div>\n <h2 className=\"text-xl font-semibold mb-2\">{title}</h2>\n <p className=\"text-muted-foreground max-w-md mb-4\">{message}</p>\n {estimatedReturn && (\n <p className=\"text-sm text-muted-foreground\">\n Estimated return: <span className=\"font-medium text-foreground\">{estimatedReturn}</span>\n </p>\n )}\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Inbox } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\n\nexport interface EmptyStateBlockProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Icon to render inside the centered circle. Pass any React node\n * (`<FontAwesomeIcon … />`, a Lucide icon, an inline SVG, etc.). Defaults to\n * a Lucide `Inbox` glyph.\n */\n icon?: React.ReactNode;\n title?: string;\n description?: string;\n actionLabel?: string;\n onAction?: () => void;\n}\n\nconst EmptyStateBlock = React.forwardRef<HTMLDivElement, EmptyStateBlockProps>(\n (\n {\n icon,\n title = \"No results found\",\n description = \"There's nothing here yet. Get started by creating your first item.\",\n actionLabel,\n onAction,\n className,\n ...props\n },\n ref\n ) => {\n return (\n <div ref={ref} className={cn(\"flex flex-col items-center justify-center text-center py-16 px-4\", className)} {...props}>\n <div className=\"mb-6 flex h-16 w-16 items-center justify-center rounded-full bg-muted text-muted-foreground [&_svg]:h-8 [&_svg]:w-8\">\n {icon ?? <Inbox />}\n </div>\n <h3 className=\"text-lg font-semibold mb-1\">{title}</h3>\n <p className=\"text-sm text-muted-foreground max-w-sm mb-6\">{description}</p>\n {actionLabel && onAction && (\n <Button onClick={onAction}>{actionLabel}</Button>\n )}\n </div>\n );\n }\n);\nEmptyStateBlock.displayName = \"EmptyStateBlock\";\n\nexport { EmptyStateBlock };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface PageShellProps {\n children: React.ReactNode;\n sidebar?: React.ReactNode;\n header?: React.ReactNode;\n footer?: React.ReactNode;\n sidebarWidth?: string;\n sidebarCollapsed?: boolean;\n className?: string;\n}\n\nexport function PageShell({\n children,\n sidebar,\n header,\n footer,\n sidebarWidth = \"16rem\",\n sidebarCollapsed = false,\n className,\n}: PageShellProps) {\n return (\n <div className={cn(\"flex min-h-screen flex-col\", className)}>\n {header}\n <div className=\"flex flex-1\">\n {sidebar && (\n <aside\n className={cn(\n \"hidden border-r bg-card transition-all duration-normal ease-default md:block\",\n sidebarCollapsed && \"w-16\"\n )}\n style={sidebarCollapsed ? undefined : { width: sidebarWidth }}\n >\n {sidebar}\n </aside>\n )}\n <main className=\"flex-1 overflow-auto\">{children}</main>\n </div>\n {footer}\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Menu } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\n\nexport interface HeaderBlockProps {\n logo?: React.ReactNode;\n nav?: React.ReactNode;\n actions?: React.ReactNode;\n onMenuToggle?: () => void;\n sticky?: boolean;\n className?: string;\n}\n\nexport function HeaderBlock({\n logo,\n nav,\n actions,\n onMenuToggle,\n sticky = true,\n className,\n}: HeaderBlockProps) {\n return (\n <header\n className={cn(\n \"flex h-16 items-center gap-4 border-b bg-background px-4 md:px-6\",\n sticky && \"sticky top-0 z-[var(--z-sticky)]\",\n className\n )}\n >\n {onMenuToggle && (\n <Button variant=\"ghost\" size=\"icon\" className=\"md:hidden\" onClick={onMenuToggle}>\n <Menu className=\"h-5 w-5\" />\n <span className=\"sr-only\">Toggle menu</span>\n </Button>\n )}\n {logo && <div className=\"flex items-center gap-2 font-semibold\">{logo}</div>}\n {nav && <nav className=\"hidden md:flex items-center gap-6 text-sm font-medium flex-1\">{nav}</nav>}\n {actions && <div className=\"ml-auto flex items-center gap-2\">{actions}</div>}\n </header>\n );\n}\n","import type * as React from \"react\";\n\nexport interface RenderLinkProps\n extends React.AnchorHTMLAttributes<HTMLAnchorElement> {\n href: string;\n children: React.ReactNode;\n}\n\n/**\n * Renders one link. A block that emits anchors takes this so a consumer can\n * hand every destination to a router — Next's `<Link>`, a TanStack `<Link>` —\n * instead of the plain `<a>` used by default. `target` and `rel` arrive\n * already set for a new-tab link; the renderer only has to spread them.\n */\nexport type RenderLink = (props: RenderLinkProps) => React.ReactNode;\n\n/** The default: a plain anchor. */\nexport const renderPlainLink: RenderLink = ({ children, ...rest }) => (\n <a {...rest}>{children}</a>\n);\n\n/** `target` and `rel` together, or neither: a bare `target` is a tabnabbing hole. */\nexport function newTabAttributes(\n newTab: boolean | undefined,\n): Pick<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"target\" | \"rel\"> {\n return newTab ? { target: \"_blank\", rel: \"noopener noreferrer\" } : {};\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Menu } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { useHideOnScroll } from \"../../hooks/use-hide-on-scroll\";\nimport {\n Accordion,\n AccordionContent,\n AccordionItem,\n AccordionTrigger,\n} from \"../../components/accordion\";\nimport {\n NavigationMenu,\n NavigationMenuContent,\n NavigationMenuItem,\n NavigationMenuLink,\n NavigationMenuList,\n NavigationMenuTrigger,\n navigationMenuTriggerStyle,\n} from \"../../components/navigation-menu\";\nimport {\n Sheet,\n SheetContent,\n SheetTitle,\n SheetTrigger,\n} from \"../../components/sheet\";\n\nimport {\n renderPlainLink,\n type RenderLink,\n type RenderLinkProps,\n} from \"../../lib/render-link\";\n\n/** The props `renderLink` receives. The same shape every block uses. */\nexport type FloatingNavLinkProps = RenderLinkProps;\n\n/**\n * Renders one link. Supply it to hand every destination to a router — Next's\n * `<Link>`, a TanStack `<Link>` — instead of the plain `<a>` used by default.\n */\nexport type FloatingNavRenderLink = RenderLink;\n\nexport interface FloatingNavSubItem {\n /** Link label shown in the panel. */\n label: React.ReactNode;\n /** Destination. Doubles as the React key, so keep it unique per panel. */\n href: string;\n /** Supporting line under the label. */\n description?: React.ReactNode;\n /** Leading glyph. Any node — the library never picks an icon for you here. */\n icon?: React.ReactNode;\n}\n\nexport interface FloatingNavItem {\n /** Label on the bar. Doubles as the React key, so keep it unique. */\n label: string;\n /** Destination for a plain link. Ignored when the item opens a panel. */\n href?: string;\n /** Sub-items. Their presence turns the item into a mega-menu trigger. */\n items?: FloatingNavSubItem[];\n /** A whole custom panel. Takes precedence over `items`. */\n content?: React.ReactNode;\n /** Columns in the default `items` panel (default: 2). */\n columns?: 1 | 2 | 3;\n /** Marks the current page — sets `aria-current` on a link. */\n active?: boolean;\n}\n\nexport interface FloatingNavBlockProps\n extends Omit<React.HTMLAttributes<HTMLElement>, \"content\"> {\n /** Brand mark, rendered verbatim at the start of the bar. */\n logo?: React.ReactNode;\n /** The bar's navigation items. */\n items?: FloatingNavItem[];\n /** Trailing slot for calls to action, a theme toggle, an avatar. */\n actions?: React.ReactNode;\n /** Render every link through a router component instead of a plain `<a>`. */\n renderLink?: FloatingNavRenderLink;\n /**\n * Holds the named item's panel open, by its `label`, with no hover or click.\n * A CMS live preview uses it to show the panel being edited; nothing else\n * should, because a panel that will not close is a broken menu.\n */\n openItem?: string;\n /** Slide the bar away when the page scrolls down (default: `true`). */\n hideOnScroll?: boolean;\n /** Pixels scrolled before hiding may start (default: 80). */\n scrollThreshold?: number;\n /**\n * `false` (default) anchors each mega-menu panel under its own trigger.\n * `true` uses the shared, animated viewport centered under the bar.\n */\n viewport?: boolean;\n /**\n * Where the bar swaps its desktop links for the drawer button (default:\n * `\"md\"`). A bar carrying `MegaMenuPanel` content must say `\"lg\"`: the\n * panel flattens below `lg`, and between the two breakpoints a desktop\n * dropdown would open onto the flat mobile list.\n */\n breakpoint?: \"md\" | \"lg\";\n /** Accessible name for the `<nav>` (default: `\"Main\"`). */\n navLabel?: string;\n /** Accessible name for the mobile menu button (default: `\"Toggle menu\"`). */\n mobileMenuLabel?: string;\n /** Classes for the width-constraining container. */\n containerClassName?: string;\n /** Classes for the bar surface — background, border, radius, blur. */\n navClassName?: string;\n}\n\n/** Static so Tailwind sees both pairs. */\nconst BREAKPOINTS = {\n md: { nav: \"hidden md:flex\", trigger: \"md:hidden\" },\n lg: { nav: \"hidden lg:flex\", trigger: \"lg:hidden\" },\n} as const;\n\nconst PANEL_COLUMNS = {\n 1: \"w-[min(92vw,20rem)] grid-cols-1\",\n 2: \"w-[min(92vw,36rem)] grid-cols-1 sm:grid-cols-2\",\n 3: \"w-[min(92vw,48rem)] grid-cols-1 sm:grid-cols-3\",\n} as const;\n\nconst FloatingNavBlock = React.forwardRef<HTMLElement, FloatingNavBlockProps>(\n (\n {\n logo,\n items = [],\n actions,\n renderLink,\n openItem,\n hideOnScroll = true,\n scrollThreshold = 80,\n viewport = false,\n breakpoint = \"md\",\n navLabel = \"Main\",\n mobileMenuLabel = \"Toggle menu\",\n containerClassName,\n navClassName,\n className,\n ...props\n },\n ref\n ) => {\n const [hoveredPanel, setHoveredPanel] = React.useState(\"\");\n const openPanel = openItem ?? hoveredPanel;\n const [mobileOpen, setMobileOpen] = React.useState(false);\n\n // Sliding the bar away from under an open panel or drawer would strand it\n // mid-air, so any open menu freezes the bar in view.\n const { hidden, scrolled } = useHideOnScroll({\n threshold: scrollThreshold,\n disabled: !hideOnScroll || openPanel !== \"\" || mobileOpen,\n });\n\n // The logo and any custom `content` panel are consumer nodes we cannot\n // attach props to, so the drawer dismisses itself by delegation: a click\n // landing on a link anywhere inside closes the sheet. Without it a\n // client-side route change leaves the drawer open over the next page.\n // Anchors fire click on Enter, so this covers the keyboard too.\n const closeDrawerOnLink = React.useCallback(\n (event: React.MouseEvent<HTMLElement>) => {\n if ((event.target as HTMLElement).closest(\"a\")) setMobileOpen(false);\n },\n []\n );\n\n const link = renderLink ?? renderPlainLink;\n\n return (\n <header\n ref={ref}\n data-hidden={hidden}\n data-scrolled={scrolled}\n className={cn(\n // `pointer-events-none` because the bar spans the viewport while\n // the pill inside it does not — without it the transparent gutters\n // swallow clicks on the page underneath.\n \"pointer-events-none fixed inset-x-0 top-0 z-[var(--z-sticky)] pt-4 transition-transform duration-slow ease-out\",\n hidden && \"-translate-y-full\",\n className\n )}\n {...props}\n >\n <div\n className={cn(\n \"mx-auto w-full max-w-6xl px-4 sm:px-6\",\n containerClassName\n )}\n >\n {/* A plain element, not a <nav>: Radix's NavigationMenu root is\n itself a <nav>, and nesting one landmark inside another leaves a\n screen reader with two identical \"Main\" navigations. */}\n <div\n className={cn(\n \"pointer-events-auto flex items-center gap-6 rounded-xl border bg-background/85 px-3 py-3 shadow-lg backdrop-blur-2xl sm:px-5\",\n navClassName\n )}\n >\n <div className=\"flex flex-1 items-center\">{logo}</div>\n\n {items.length > 0 ? (\n <NavigationMenu\n aria-label={navLabel}\n viewport={viewport}\n value={openPanel}\n onValueChange={setHoveredPanel}\n className={BREAKPOINTS[breakpoint].nav}\n >\n <NavigationMenuList className=\"gap-1\">\n {items.map((item) => {\n const panel =\n item.content ??\n (item.items?.length ? (\n <div\n className={cn(\n \"grid gap-1 p-2\",\n PANEL_COLUMNS[item.columns ?? 2]\n )}\n >\n {item.items.map((sub) => (\n <NavigationMenuLink key={sub.href} asChild>\n {link({\n href: sub.href,\n className:\n \"flex select-none items-start gap-3 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground\",\n children: (\n <>\n {sub.icon ? (\n <span className=\"mt-0.5 shrink-0 text-muted-foreground\">\n {sub.icon}\n </span>\n ) : null}\n <span className=\"min-w-0\">\n <span className=\"block text-sm font-medium\">\n {sub.label}\n </span>\n {sub.description ? (\n <span className=\"mt-1.5 block text-sm leading-snug text-muted-foreground\">\n {sub.description}\n </span>\n ) : null}\n </span>\n </>\n ),\n })}\n </NavigationMenuLink>\n ))}\n </div>\n ) : null);\n\n return (\n <NavigationMenuItem key={item.label} value={item.label}>\n {panel ? (\n <>\n <NavigationMenuTrigger data-active={item.active}>\n {item.label}\n </NavigationMenuTrigger>\n <NavigationMenuContent>\n {panel}\n </NavigationMenuContent>\n </>\n ) : (\n <NavigationMenuLink asChild active={item.active}>\n {link({\n href: item.href ?? \"#\",\n className: navigationMenuTriggerStyle(),\n \"aria-current\": item.active ? \"page\" : undefined,\n children: item.label,\n })}\n </NavigationMenuLink>\n )}\n </NavigationMenuItem>\n );\n })}\n </NavigationMenuList>\n </NavigationMenu>\n ) : null}\n\n <div className=\"flex flex-1 items-center justify-end gap-2\">\n {actions}\n\n {items.length > 0 ? (\n <Sheet open={mobileOpen} onOpenChange={setMobileOpen}>\n <SheetTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={BREAKPOINTS[breakpoint].trigger}\n aria-label={mobileMenuLabel}\n >\n <Menu className=\"size-5\" aria-hidden />\n </Button>\n </SheetTrigger>\n {/* A list of links needs no describing beyond its title —\n the explicit `undefined` is how Radix is told that, and\n silences its missing-description warning. */}\n <SheetContent\n side=\"right\"\n size=\"sm\"\n aria-describedby={undefined}\n >\n {/* The drawer's nav is deliberately unnamed: the sheet\n title already names it, and a second landmark called\n \"Main\" is only ambiguity for a screen reader. */}\n <SheetTitle className=\"sr-only\">{navLabel}</SheetTitle>\n\n <div onClick={closeDrawerOnLink}>\n {logo ? (\n // `pr-12` keeps the mark clear of the sheet's own\n // absolutely positioned close button.\n <div className=\"flex items-center pr-12\">{logo}</div>\n ) : null}\n\n <nav className={cn(logo ? \"mt-8\" : \"mt-6\")}>\n <Accordion type=\"single\" collapsible className=\"w-full\">\n {items.map((item) => {\n const subs = item.items ?? [];\n\n if (!subs.length && !item.content) {\n return (\n <div key={item.label} className=\"border-b\">\n {link({\n href: item.href ?? \"#\",\n className:\n \"flex py-4 text-base font-medium hover:underline\",\n \"aria-current\": item.active\n ? \"page\"\n : undefined,\n onClick: () => setMobileOpen(false),\n children: item.label,\n })}\n </div>\n );\n }\n\n return (\n <AccordionItem\n key={item.label}\n value={item.label}\n >\n <AccordionTrigger className=\"text-base\">\n {item.label}\n </AccordionTrigger>\n <AccordionContent className=\"flex flex-col gap-1 pl-1\">\n {item.content ??\n subs.map((sub) => (\n <React.Fragment key={sub.href}>\n {link({\n href: sub.href,\n className:\n \"block rounded-md px-2 py-2 text-sm text-muted-foreground hover:bg-accent hover:text-accent-foreground\",\n onClick: () => setMobileOpen(false),\n children: sub.label,\n })}\n </React.Fragment>\n ))}\n </AccordionContent>\n </AccordionItem>\n );\n })}\n </Accordion>\n </nav>\n </div>\n </SheetContent>\n </Sheet>\n ) : null}\n </div>\n </div>\n </div>\n </header>\n );\n }\n);\nFloatingNavBlock.displayName = \"FloatingNavBlock\";\n\nexport { FloatingNavBlock };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { ArrowRight } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport {\n newTabAttributes,\n renderPlainLink,\n type RenderLink,\n} from \"../../lib/render-link\";\nimport { Button } from \"../../components/button\";\nimport type { FloatingNavItem } from \"./floating-nav-block\";\n\n/* ------------------------------------------------------------------------- *\n * The menu data model\n *\n * A mega menu is items; an item with a panel opens columns of sections of\n * links. Everything a site or a CMS needs to describe one is here, and\n * nothing that decides how it looks: colours for featured links and glyphs\n * for plain ones come in through `variants` and `icons` at render time, so\n * the data stays serialisable and the library ships no icons and no brand.\n *\n * Until BIS-50 lands, a panel has no banner row and a link carries no badge.\n * ------------------------------------------------------------------------- */\n\n/** A column's share of the row. 33 and 66 are real thirds, so 33+33+33 fills it. */\nexport type MegaMenuWidth = 25 | 33 | 50 | 66 | 75 | 100;\n\n/**\n * The caps a panel can take: 22rem, 42rem, 48rem. There is no \"full\": a panel\n * anchors under its own trigger, so it cannot span the bar, and capped at the\n * room a trigger has it would only equal `wide`.\n */\nexport type MegaMenuMaxWidth = \"narrow\" | \"standard\" | \"wide\";\n\nexport interface MegaMenuLink {\n label: string;\n href: string;\n /** Supporting line under the label. */\n description?: string;\n /** Key into `variants`; only a featured link reads it. */\n variant?: string;\n /** Key into `icons`; only a list link reads it. */\n icon?: string;\n newTab?: boolean;\n}\n\nexport interface MegaMenuSection {\n /** Small heading above the group. The eyebrow belongs to the section, never to a link. */\n eyebrow?: string;\n /** `featured` gives each link a chip and a larger title; `list` (default) is a plain rail. */\n display?: \"featured\" | \"list\";\n /** Below `lg` the panel flattens; descriptions are dropped unless this is `false`. */\n hideDescriptionsOnMobile?: boolean;\n links: MegaMenuLink[];\n}\n\nexport interface MegaMenuColumn {\n /** Percent token. Ignored when `customWidth` is set. Defaults to 100. */\n width?: MegaMenuWidth;\n /** A CSS track size used verbatim: `13rem`, `1fr`, `minmax(0, 1fr)`. */\n customWidth?: string;\n /** Draw a line on the left of this column. */\n divider?: boolean;\n sections: MegaMenuSection[];\n}\n\nexport interface MegaMenuFooterLink {\n label: string;\n href: string;\n newTab?: boolean;\n}\n\nexport interface MegaMenuFooter {\n /** The section's own landing page. A trigger is a button, so without this it is unreachable from the bar. */\n overview?: MegaMenuFooterLink;\n /** The call to action, on the `Button` primitive. */\n cta?: MegaMenuFooterLink;\n}\n\nexport interface MegaMenuPanelData {\n /** A token, or a custom rem width such as `\"30rem\"`. Defaults to `standard`. */\n maxWidth?: MegaMenuMaxWidth | `${number}rem`;\n columns: MegaMenuColumn[];\n /** No strip renders when both links are absent. */\n footer?: MegaMenuFooter;\n}\n\nexport interface MegaMenuItem {\n /** Label on the bar. Doubles as the React key, so keep it unique. */\n label: string;\n /** The landing page. Optional: a trigger with no landing page is allowed. */\n href?: string;\n /** Its presence turns the item into a mega-menu trigger. */\n panel?: MegaMenuPanelData;\n}\n\nexport interface MegaMenu {\n items: MegaMenuItem[];\n}\n\n/** How a featured link is dressed. The consuming site decides what \"featured\" looks like. */\nexport interface MegaMenuVariant {\n /** Classes for the box around the icon. */\n chip?: string;\n /** Classes added to the title, typically a `group-hover:` colour. */\n title?: string;\n icon?: React.ReactNode;\n}\n\nexport type MegaMenuVariants = Record<string, MegaMenuVariant>;\nexport type MegaMenuIcons = Record<string, React.ReactNode>;\n\nexport interface MegaMenuPanelProps\n extends MegaMenuPanelData,\n Omit<React.HTMLAttributes<HTMLDivElement>, \"children\"> {\n variants?: MegaMenuVariants;\n icons?: MegaMenuIcons;\n /** Render every link through a router component instead of a plain `<a>`. */\n renderLink?: RenderLink;\n}\n\n/**\n * Twelfths, so every token is a whole number of tracks and 33 + 66 = 12 like\n * 50 + 50 does. `minmax(0, …)` keeps a long label from widening its column\n * past its share.\n */\nconst TWELFTHS: Record<MegaMenuWidth, number> = {\n 25: 3,\n 33: 4,\n 50: 6,\n 66: 8,\n 75: 9,\n 100: 12,\n};\n\n/**\n * A panel anchors under its own trigger (`NavigationMenuContent` is absolute\n * at the item's left edge), so the room it has is the distance from that\n * trigger to the bar's right edge, not the viewport. That is tightest at the\n * rightmost dropdown on the narrowest desktop layout: about 58vw, measured\n * on the site this reproduces at 1024px. Every cap is `min(58vw, …)`, with a\n * rem ceiling so a wide display does not grow the panel past the bar. Static\n * strings, so Tailwind can see them. All `lg:`-prefixed, because below `lg`\n * the panel is the drawer's flat list and takes the drawer's width; the bar\n * that carries a panel therefore has to switch at `lg` too\n * (`FloatingNavBlock` `breakpoint=\"lg\"`).\n */\nconst MAX_WIDTHS: Record<MegaMenuMaxWidth, string> = {\n narrow: \"lg:w-[min(58vw,22rem)]\",\n standard: \"lg:w-[min(58vw,42rem)]\",\n wide: \"lg:w-[min(58vw,48rem)]\",\n};\n\n/**\n * A custom cap rides a variable rather than an inline `width`, so it is\n * read by the same `lg:` rule as the tokens and cannot widen the panel\n * inside the mobile drawer.\n */\nconst CUSTOM_MAX_WIDTH = \"lg:w-[min(58vw,var(--mega-menu-cap))]\";\n\nfunction isMaxWidthToken(value: string): value is MegaMenuMaxWidth {\n return value in MAX_WIDTHS;\n}\n\nexport function megaMenuGridColumns(columns: MegaMenuColumn[]): string {\n return columns\n .map(\n (column) =>\n column.customWidth ?? `minmax(0, ${TWELFTHS[column.width ?? 100]}fr)`,\n )\n .join(\" \");\n}\n\n/**\n * `gap-5` between sections against `gap-0.5` (`gap-1` when featured) between\n * rows inside one: the eyebrows only read as headings if the space above one\n * beats the space between its own rows by an obvious margin.\n */\nconst SECTION_GAP = \"flex flex-col gap-5\";\nconst EYEBROW =\n \"text-xs font-semibold uppercase tracking-wide text-muted-foreground\";\n/** Lighter in the drawer, the way the live header sets its section labels below `lg`. */\nconst MOBILE_EYEBROW =\n \"mb-2 text-xs font-normal uppercase tracking-wider text-muted-foreground\";\nconst MOBILE_ROW =\n \"block rounded-md py-2 text-sm text-foreground transition-colors hover:bg-accent hover:text-accent-foreground\";\n\nconst MegaMenuPanel = React.forwardRef<HTMLDivElement, MegaMenuPanelProps>(\n (\n {\n maxWidth = \"standard\",\n columns,\n footer,\n variants = {},\n icons = {},\n renderLink = renderPlainLink,\n className,\n style,\n ...props\n },\n ref,\n ) => {\n const id = React.useId();\n const overview = footer?.overview;\n const cta = footer?.cta;\n const hasFooter = Boolean(overview || cta);\n const capClass = isMaxWidthToken(maxWidth)\n ? MAX_WIDTHS[maxWidth]\n : CUSTOM_MAX_WIDTH;\n const capStyle = isMaxWidthToken(maxWidth)\n ? undefined\n : ({ \"--mega-menu-cap\": maxWidth } as React.CSSProperties);\n\n const link = (\n target: MegaMenuFooterLink | MegaMenuLink,\n linkProps: Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"href\">,\n children: React.ReactNode,\n ) =>\n renderLink({\n href: target.href,\n ...newTabAttributes(target.newTab),\n ...linkProps,\n children,\n });\n\n const featuredLink = (item: MegaMenuLink) => {\n const variant = item.variant ? variants[item.variant] : undefined;\n return link(\n item,\n {\n className:\n \"group flex gap-4 rounded-lg p-3 transition-colors hover:bg-accent focus-visible:bg-accent\",\n },\n <>\n {variant?.icon ? (\n <span\n data-slot=\"chip\"\n className={cn(\n \"flex size-10 shrink-0 items-center justify-center rounded-md\",\n variant.chip,\n )}\n >\n {variant.icon}\n </span>\n ) : null}\n <span className=\"min-w-0\">\n <span\n className={cn(\n \"block text-base font-semibold text-foreground\",\n variant?.title,\n )}\n >\n {item.label}\n </span>\n {item.description ? (\n <span className=\"mt-1.5 block text-sm leading-snug text-muted-foreground\">\n {item.description}\n </span>\n ) : null}\n </span>\n </>,\n );\n };\n\n const listLink = (item: MegaMenuLink) => {\n const icon = item.icon ? icons[item.icon] : undefined;\n return link(\n item,\n {\n className:\n \"group flex items-start gap-3 rounded-md px-2 py-2 text-sm transition-colors hover:bg-accent hover:text-accent-foreground\",\n },\n <>\n {icon ? (\n <span className=\"mt-0.5 shrink-0 text-muted-foreground\">{icon}</span>\n ) : null}\n <span className=\"min-w-0\">\n <span className=\"block font-medium text-foreground\">{item.label}</span>\n {item.description ? (\n <span className=\"mt-1 block text-sm leading-snug text-muted-foreground\">\n {item.description}\n </span>\n ) : null}\n </span>\n </>,\n );\n };\n\n // A featured link keeps its chip and its taller row in the drawer, as the\n // live header does; only the description is dropped unless the section\n // keeps it.\n const mobileLink = (\n item: MegaMenuLink,\n featured: boolean,\n showDescription: boolean,\n ) => {\n const variant = featured && item.variant ? variants[item.variant] : undefined;\n const text =\n showDescription && item.description ? (\n <>\n <span className=\"block\">{item.label}</span>\n <span className=\"mt-0.5 block text-sm text-muted-foreground\">\n {item.description}\n </span>\n </>\n ) : (\n item.label\n );\n return link(\n item,\n {\n className: cn(\n MOBILE_ROW,\n variant?.icon && \"flex items-center gap-4 rounded-lg py-3\",\n ),\n },\n variant?.icon ? (\n <>\n <span\n data-slot=\"chip\"\n className={cn(\n \"flex size-10 shrink-0 items-center justify-center rounded-md\",\n variant.chip,\n )}\n >\n {variant.icon}\n </span>\n <span className=\"min-w-0\">{text}</span>\n </>\n ) : (\n text\n ),\n );\n };\n\n return (\n <div\n ref={ref}\n data-slot=\"panel\"\n className={cn(\"group/mega-menu\", capClass, className)}\n style={{ ...capStyle, ...style }}\n {...props}\n >\n {/* Desktop: the columns, on their own tracks. */}\n <div\n data-slot=\"desktop\"\n className=\"hidden gap-6 p-4 lg:grid\"\n style={{ gridTemplateColumns: megaMenuGridColumns(columns) }}\n >\n {columns.map((column, c) => (\n <div\n key={c}\n data-slot=\"column\"\n className={cn(\n \"min-w-0\",\n SECTION_GAP,\n column.divider && \"border-l border-border pl-6\",\n )}\n >\n {column.sections.map((section, s) => {\n const eyebrowId = section.eyebrow\n ? `${id}-${c}-${s}`\n : undefined;\n const featured = section.display === \"featured\";\n return (\n <div key={s} data-slot=\"section\">\n {section.eyebrow ? (\n // Indented to the links' own padding (`p-3` featured,\n // `px-2` rail) so the label sits flush over their text.\n <p\n id={eyebrowId}\n className={cn(EYEBROW, featured ? \"px-3\" : \"px-2\")}\n >\n {section.eyebrow}\n </p>\n ) : null}\n <ul\n aria-labelledby={eyebrowId}\n className={cn(\n \"flex flex-col\",\n featured ? \"gap-1\" : \"gap-0.5\",\n section.eyebrow && \"mt-2\",\n )}\n >\n {section.links.map((item, l) => (\n <li key={`${item.href}-${l}`}>\n {featured ? featuredLink(item) : listLink(item)}\n </li>\n ))}\n </ul>\n </div>\n );\n })}\n </div>\n ))}\n </div>\n\n {/* Mobile: one flat list, the way a drawer reads: no columns, but the\n section eyebrows and featured chips stay, as the live header's do.\n The overview link leads because the trigger above it is a button,\n not a link. */}\n <div data-slot=\"mobile\" className=\"flex flex-col gap-5 lg:hidden\">\n {overview\n ? link(overview, { className: MOBILE_ROW }, overview.label)\n : null}\n {columns.flatMap((column, c) =>\n column.sections.map((section, s) => (\n <div key={`${c}-${s}`} data-slot=\"section\">\n {section.eyebrow ? (\n <p className={MOBILE_EYEBROW}>{section.eyebrow}</p>\n ) : null}\n <div className=\"flex flex-col gap-0.5\">\n {section.links.map((item, l) => (\n <React.Fragment key={l}>\n {mobileLink(\n item,\n section.display === \"featured\",\n section.hideDescriptionsOnMobile === false,\n )}\n </React.Fragment>\n ))}\n </div>\n </div>\n )),\n )}\n </div>\n\n {hasFooter ? (\n // Flush to the panel's bottom edge: the viewport around this content\n // clips with a radius, so a detached strip would read as a second\n // surface. On mobile only the CTA shows here — the overview link\n // already led the flat list — so without a CTA the strip hides\n // below `lg` rather than leaving an empty bordered band.\n <div\n data-slot=\"footer\"\n className={cn(\n \"mt-4 flex flex-col border-t border-border bg-muted px-4 py-4 lg:mt-0 lg:flex-row lg:items-center lg:justify-between lg:gap-3 lg:py-3\",\n !cta && \"max-lg:hidden\",\n )}\n >\n {overview\n ? link(\n overview,\n {\n className:\n \"hidden h-10 items-center gap-1.5 text-sm font-medium text-primary underline underline-offset-2 lg:inline-flex\",\n },\n <>\n {overview.label}\n <ArrowRight className=\"size-4\" aria-hidden />\n </>,\n )\n : null}\n {cta ? (\n <Button asChild size=\"sm\" className=\"w-full lg:w-auto\">\n {link(cta, {}, cta.label)}\n </Button>\n ) : null}\n </div>\n ) : null}\n </div>\n );\n },\n);\nMegaMenuPanel.displayName = \"MegaMenuPanel\";\n\nexport interface MegaMenuToFloatingNavOptions {\n /** Marks the current section; receives each item's `href`. */\n isActive?: (href: string) => boolean;\n variants?: MegaMenuVariants;\n icons?: MegaMenuIcons;\n /**\n * The bar's own `renderLink` does not reach into a `content` node, so the\n * same function is passed here and the panel applies it to its links.\n */\n renderLink?: RenderLink;\n}\n\n/**\n * A whole menu as `FloatingNavBlock` items, so a site with a code-owned menu\n * passes one config and nothing else — plus `breakpoint=\"lg\"` on the bar,\n * because the panels flatten below `lg` and the bar must switch there too.\n */\nexport function megaMenuToFloatingNavItems(\n menu: MegaMenu,\n { isActive, variants, icons, renderLink }: MegaMenuToFloatingNavOptions = {},\n): FloatingNavItem[] {\n return menu.items.map((item) => ({\n label: item.label,\n ...(item.href ? { href: item.href } : {}),\n // `undefined`, never `false`: the bar spreads this onto the trigger as\n // `data-active`, and the trigger style matches on `[data-active]`\n // regardless of value. A literal `false` would paint every dropdown\n // trigger with the active pill.\n active: (item.href && isActive?.(item.href)) || undefined,\n ...(item.panel\n ? {\n content: (\n <MegaMenuPanel\n {...item.panel}\n variants={variants}\n icons={icons}\n renderLink={renderLink}\n />\n ),\n }\n : {}),\n }));\n}\n\nexport { MegaMenuPanel };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface SidebarItem {\n label: string;\n href?: string;\n icon?: React.ReactNode;\n active?: boolean;\n onClick?: () => void;\n children?: SidebarItem[];\n}\n\nexport interface SidebarSection {\n title?: string;\n items: SidebarItem[];\n}\n\nexport interface SidebarBlockProps {\n sections: SidebarSection[];\n header?: React.ReactNode;\n footer?: React.ReactNode;\n collapsed?: boolean;\n className?: string;\n}\n\nfunction SidebarItemComponent({ item, collapsed }: { item: SidebarItem; collapsed?: boolean }) {\n const Comp = item.href ? \"a\" : \"button\";\n return (\n <Comp\n href={item.href}\n onClick={item.onClick}\n className={cn(\n \"flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground\",\n item.active && \"bg-accent text-accent-foreground\",\n collapsed && \"justify-center px-2\"\n )}\n >\n {item.icon && <span className=\"flex h-5 w-5 shrink-0 items-center justify-center\">{item.icon}</span>}\n {!collapsed && <span>{item.label}</span>}\n </Comp>\n );\n}\n\nexport function SidebarBlock({\n sections,\n header,\n footer,\n collapsed = false,\n className,\n}: SidebarBlockProps) {\n return (\n <div className={cn(\"flex h-full flex-col\", className)}>\n {header && (\n <div className={cn(\"border-b p-4\", collapsed && \"p-2\")}>{header}</div>\n )}\n <nav className=\"flex-1 space-y-4 overflow-y-auto p-4\">\n {sections.map((section, sIdx) => (\n <div key={sIdx} className=\"space-y-1\">\n {section.title && !collapsed && (\n <p className=\"px-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground\">\n {section.title}\n </p>\n )}\n {section.items.map((item, iIdx) => (\n <SidebarItemComponent key={iIdx} item={item} collapsed={collapsed} />\n ))}\n </div>\n ))}\n </nav>\n {footer && (\n <div className={cn(\"border-t p-4\", collapsed && \"p-2\")}>{footer}</div>\n )}\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface FooterLink {\n label: string;\n href: string;\n}\n\nexport interface FooterBlockProps {\n copyright?: string;\n links?: FooterLink[];\n logo?: React.ReactNode;\n className?: string;\n}\n\nexport function FooterBlock({\n copyright,\n links = [],\n logo,\n className,\n}: FooterBlockProps) {\n return (\n <footer className={cn(\"border-t bg-background\", className)}>\n <div className=\"flex flex-col items-center gap-4 px-4 py-6 md:flex-row md:justify-between md:px-6\">\n <div className=\"flex items-center gap-2\">\n {logo}\n {copyright && (\n <p className=\"text-sm text-muted-foreground\">{copyright}</p>\n )}\n </div>\n {links.length > 0 && (\n <nav className=\"flex gap-4\">\n {links.map((link) => (\n <a\n key={link.href}\n href={link.href}\n className=\"text-sm text-muted-foreground hover:text-foreground transition-colors\"\n >\n {link.label}\n </a>\n ))}\n </nav>\n )}\n </div>\n </footer>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { ChevronsUpDown, Plus } from \"lucide-react\";\n\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuTrigger,\n} from \"../../../components/dropdown-menu\";\nimport {\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n useSidebar,\n} from \"../../../components/sidebar\";\nimport type { SidebarTeam } from \"./types\";\n\nexport interface TeamSwitcherProps {\n teams: SidebarTeam[];\n activeTeam?: SidebarTeam;\n onTeamChange?: (team: SidebarTeam) => void;\n onAddTeam?: () => void;\n}\n\nexport function TeamSwitcher({\n teams,\n activeTeam: activeTeamProp,\n onTeamChange,\n onAddTeam,\n}: TeamSwitcherProps) {\n const { isMobile } = useSidebar();\n const [internalActive, setInternalActive] = React.useState(teams[0]);\n const activeTeam = activeTeamProp ?? internalActive;\n\n if (!activeTeam) {\n return null;\n }\n\n return (\n <SidebarMenu>\n <SidebarMenuItem>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <SidebarMenuButton\n size=\"lg\"\n className=\"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground\"\n >\n <div className=\"flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground\">\n <activeTeam.logo className=\"size-4\" />\n </div>\n <div className=\"grid flex-1 text-left text-sm leading-tight\">\n <span className=\"truncate font-medium\">\n {activeTeam.name}\n </span>\n <span className=\"truncate text-xs\">{activeTeam.plan}</span>\n </div>\n <ChevronsUpDown className=\"ml-auto\" />\n </SidebarMenuButton>\n </DropdownMenuTrigger>\n <DropdownMenuContent\n className=\"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg\"\n align=\"start\"\n side={isMobile ? \"bottom\" : \"right\"}\n sideOffset={4}\n >\n <DropdownMenuLabel className=\"text-xs text-muted-foreground\">\n Teams\n </DropdownMenuLabel>\n {teams.map((team, index) => (\n <DropdownMenuItem\n key={team.name}\n onClick={() => {\n setInternalActive(team);\n onTeamChange?.(team);\n }}\n className=\"gap-2 p-2\"\n >\n <div className=\"flex size-6 items-center justify-center rounded-md border\">\n <team.logo className=\"size-3.5 shrink-0\" />\n </div>\n {team.name}\n <DropdownMenuShortcut>\n {\"⌘\"}\n {index + 1}\n </DropdownMenuShortcut>\n </DropdownMenuItem>\n ))}\n {onAddTeam && (\n <>\n <DropdownMenuSeparator />\n <DropdownMenuItem className=\"gap-2 p-2\" onClick={onAddTeam}>\n <div className=\"flex size-6 items-center justify-center rounded-md border bg-transparent\">\n <Plus className=\"size-4\" />\n </div>\n <div className=\"font-medium text-muted-foreground\">\n Add team\n </div>\n </DropdownMenuItem>\n </>\n )}\n </DropdownMenuContent>\n </DropdownMenu>\n </SidebarMenuItem>\n </SidebarMenu>\n );\n}\n","\"use client\";\n\nimport { ChevronRight } from \"lucide-react\";\n\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"../../../components/collapsible\";\nimport {\n SidebarGroup,\n SidebarGroupLabel,\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n} from \"../../../components/sidebar\";\nimport type { SidebarNavGroup } from \"./types\";\n\nexport interface SidebarNavProps {\n groups: SidebarNavGroup[];\n}\n\nexport function SidebarNav({ groups }: SidebarNavProps) {\n return (\n <>\n {groups.map((group, groupIdx) => (\n <SidebarGroup key={group.label ?? groupIdx}>\n {group.label && <SidebarGroupLabel>{group.label}</SidebarGroupLabel>}\n <SidebarMenu>\n {group.items.map((item) => {\n if (item.items && item.items.length > 0) {\n return (\n <Collapsible\n key={item.title}\n asChild\n defaultOpen={item.isActive}\n className=\"group/collapsible\"\n >\n <SidebarMenuItem>\n <CollapsibleTrigger asChild>\n <SidebarMenuButton tooltip={item.title}>\n {item.icon}\n <span>{item.title}</span>\n <ChevronRight className=\"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90\" />\n </SidebarMenuButton>\n </CollapsibleTrigger>\n <CollapsibleContent>\n <SidebarMenuSub>\n {item.items.map((subItem) => (\n <SidebarMenuSubItem key={subItem.title}>\n <SidebarMenuSubButton\n asChild\n isActive={subItem.isActive}\n >\n <a\n href={subItem.url}\n onClick={(e) => {\n if (subItem.onClick) {\n e.preventDefault();\n subItem.onClick();\n }\n }}\n >\n <span>{subItem.title}</span>\n </a>\n </SidebarMenuSubButton>\n </SidebarMenuSubItem>\n ))}\n </SidebarMenuSub>\n </CollapsibleContent>\n </SidebarMenuItem>\n </Collapsible>\n );\n }\n\n return (\n <SidebarMenuItem key={item.title}>\n <SidebarMenuButton\n asChild\n tooltip={item.title}\n isActive={item.isActive}\n >\n <a\n href={item.url}\n onClick={(e) => {\n if (item.onClick) {\n e.preventDefault();\n item.onClick();\n }\n }}\n >\n {item.icon}\n <span>{item.title}</span>\n </a>\n </SidebarMenuButton>\n </SidebarMenuItem>\n );\n })}\n </SidebarMenu>\n </SidebarGroup>\n ))}\n </>\n );\n}\n","\"use client\";\n\nimport { ChevronsUpDown, LogOut } from \"lucide-react\";\n\nimport {\n Avatar,\n AvatarFallback,\n AvatarImage,\n} from \"../../../components/avatar\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from \"../../../components/dropdown-menu\";\nimport {\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n useSidebar,\n} from \"../../../components/sidebar\";\nimport type { SidebarUser, SidebarUserMenuItem } from \"./types\";\n\nexport interface SidebarUserNavProps {\n user: SidebarUser;\n menuGroups?: SidebarUserMenuItem[][];\n onLogout: () => void;\n}\n\nfunction getInitials(name: string): string {\n return name\n .split(\" \")\n .map((part) => part[0])\n .join(\"\")\n .toUpperCase()\n .slice(0, 2);\n}\n\nexport function SidebarUserNav({\n user,\n menuGroups,\n onLogout,\n}: SidebarUserNavProps) {\n const { isMobile } = useSidebar();\n\n return (\n <SidebarMenu>\n <SidebarMenuItem>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <SidebarMenuButton\n size=\"lg\"\n className=\"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground\"\n >\n <Avatar className=\"h-8 w-8 rounded-lg\">\n {user.avatar && (\n <AvatarImage src={user.avatar} alt={user.name} />\n )}\n <AvatarFallback className=\"rounded-lg\">\n {getInitials(user.name)}\n </AvatarFallback>\n </Avatar>\n <div className=\"grid flex-1 text-left text-sm leading-tight\">\n <span className=\"truncate font-medium\">{user.name}</span>\n <span className=\"truncate text-xs\">{user.email}</span>\n </div>\n <ChevronsUpDown className=\"ml-auto size-4\" />\n </SidebarMenuButton>\n </DropdownMenuTrigger>\n <DropdownMenuContent\n className=\"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg\"\n side={isMobile ? \"bottom\" : \"right\"}\n align=\"end\"\n sideOffset={4}\n >\n <DropdownMenuLabel className=\"p-0 font-normal\">\n <div className=\"flex items-center gap-2 px-1 py-1.5 text-left text-sm\">\n <Avatar className=\"h-8 w-8 rounded-lg\">\n {user.avatar && (\n <AvatarImage src={user.avatar} alt={user.name} />\n )}\n <AvatarFallback className=\"rounded-lg\">\n {getInitials(user.name)}\n </AvatarFallback>\n </Avatar>\n <div className=\"grid flex-1 text-left text-sm leading-tight\">\n <span className=\"truncate font-medium\">{user.name}</span>\n <span className=\"truncate text-xs\">{user.email}</span>\n </div>\n </div>\n </DropdownMenuLabel>\n {menuGroups?.map((group, groupIdx) => (\n <span key={groupIdx}>\n <DropdownMenuSeparator />\n <DropdownMenuGroup>\n {group.map((item) => (\n <DropdownMenuItem key={item.label} onClick={item.onClick}>\n {item.icon}\n {item.label}\n </DropdownMenuItem>\n ))}\n </DropdownMenuGroup>\n </span>\n ))}\n <DropdownMenuSeparator />\n <DropdownMenuItem onClick={onLogout}>\n <LogOut />\n Log out\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </SidebarMenuItem>\n </SidebarMenu>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\n\nimport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarHeader,\n SidebarRail,\n} from \"../../../components/sidebar\";\nimport { TeamSwitcher } from \"./team-switcher\";\nimport { SidebarNav } from \"./sidebar-nav\";\nimport { SidebarUserNav } from \"./sidebar-user\";\nimport type {\n SidebarTeam,\n SidebarNavGroup,\n SidebarUser,\n SidebarUserMenuItem,\n} from \"./types\";\n\nexport interface AppSidebarBlockProps\n extends React.ComponentProps<typeof Sidebar> {\n /** One or more teams displayed in the header switcher */\n teams: SidebarTeam[];\n /** Currently active team (defaults to first team) */\n activeTeam?: SidebarTeam;\n /** Called when user switches teams */\n onTeamChange?: (team: SidebarTeam) => void;\n /** Called when \"Add team\" is clicked — omit to hide the button */\n onAddTeam?: () => void;\n\n /** Flexible navigation groups rendered in the sidebar body */\n navGroups?: SidebarNavGroup[];\n\n /** User info displayed in the footer */\n user: SidebarUser;\n /** Optional grouped menu items in the user dropdown (e.g. Account, Billing) */\n userMenuGroups?: SidebarUserMenuItem[][];\n /** Called on logout — always rendered */\n onLogout: () => void;\n}\n\nexport function AppSidebarBlock({\n teams,\n activeTeam,\n onTeamChange,\n onAddTeam,\n navGroups,\n user,\n userMenuGroups,\n onLogout,\n ...sidebarProps\n}: AppSidebarBlockProps) {\n return (\n <Sidebar collapsible=\"icon\" {...sidebarProps}>\n <SidebarHeader>\n <TeamSwitcher\n teams={teams}\n activeTeam={activeTeam}\n onTeamChange={onTeamChange}\n onAddTeam={onAddTeam}\n />\n </SidebarHeader>\n <SidebarContent>\n {navGroups && navGroups.length > 0 && (\n <SidebarNav groups={navGroups} />\n )}\n </SidebarContent>\n <SidebarFooter>\n <SidebarUserNav\n user={user}\n menuGroups={userMenuGroups}\n onLogout={onLogout}\n />\n </SidebarFooter>\n <SidebarRail />\n </Sidebar>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { ArrowRight, Image as ImageIcon } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport {\n Card,\n CardContent,\n CardFooter,\n CardHeader,\n CardTitle,\n CardDescription,\n} from \"../../components/card\";\nimport { Badge } from \"../../components/badge\";\nimport { Button } from \"../../components/button\";\nimport { AspectRatio } from \"../../components/aspect-ratio\";\n\nexport interface MediaCardMeta {\n /**\n * Optional icon for the meta row. Pass any React node (`<FontAwesomeIcon … />`,\n * a Lucide icon, an inline SVG, etc.).\n */\n icon?: React.ReactNode;\n label: string;\n}\n\nexport interface MediaCardProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Cover image source and alt text */\n image?: { src: string; alt: string };\n /**\n * Icon displayed when no image is provided. Pass any React node. Defaults to\n * a Lucide `Image` glyph.\n */\n fallbackIcon?: React.ReactNode;\n /** Optional badge shown over the image area */\n badge?: string;\n /** Card title */\n title: string;\n /** Card description */\n description?: string;\n /** Metadata items rendered below the description */\n meta?: MediaCardMeta[];\n /** Footer text rendered as a CTA link/button */\n footer?: string;\n /** URL for the card link / CTA */\n href?: string;\n /** Click handler for the CTA (used when no href is provided) */\n onAction?: () => void;\n /** Loading state */\n loading?: boolean;\n /** Disabled state */\n disabled?: boolean;\n}\n\nconst MediaCard = React.forwardRef<HTMLDivElement, MediaCardProps>(\n (\n {\n image,\n fallbackIcon,\n badge,\n title,\n description,\n meta,\n footer,\n href,\n onAction,\n loading,\n disabled,\n className,\n ...props\n },\n ref,\n ) => {\n const Wrapper = href ? \"a\" : \"div\";\n const wrapperProps = href\n ? {\n href,\n className:\n \"block focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 rounded-lg\",\n }\n : {};\n\n return (\n <Wrapper {...wrapperProps}>\n <Card\n ref={ref}\n className={cn(\n \"overflow-hidden transition-shadow duration-normal ease-default\",\n href && \"hover:shadow-md\",\n disabled && \"pointer-events-none opacity-50\",\n className,\n )}\n {...props}\n >\n {/* Image / Fallback area */}\n <div className=\"relative\">\n <AspectRatio ratio={16 / 9}>\n {image ? (\n <img\n src={image.src}\n alt={image.alt}\n className=\"h-full w-full object-cover\"\n />\n ) : (\n <div className=\"flex h-full w-full items-center justify-center bg-muted text-muted-foreground [&_svg]:h-10 [&_svg]:w-10\">\n {fallbackIcon ?? <ImageIcon />}\n </div>\n )}\n </AspectRatio>\n {badge && (\n <div className=\"absolute top-2 right-2\">\n <Badge variant=\"secondary\">{badge}</Badge>\n </div>\n )}\n </div>\n\n {/* Content */}\n <CardHeader>\n <CardTitle className=\"text-lg\">{title}</CardTitle>\n {description && <CardDescription>{description}</CardDescription>}\n </CardHeader>\n\n {/* Meta items */}\n {meta && meta.length > 0 && (\n <CardContent>\n <div className=\"flex flex-wrap gap-x-4 gap-y-1 text-sm text-muted-foreground\">\n {meta.map((item, i) => (\n <span\n key={i}\n className=\"inline-flex items-center gap-1.5 [&_svg]:h-3.5 [&_svg]:w-3.5\"\n >\n {item.icon}\n {item.label}\n </span>\n ))}\n </div>\n </CardContent>\n )}\n\n {/* Footer CTA */}\n {footer && (\n <CardFooter>\n {href ? (\n <span className=\"inline-flex items-center gap-1.5 text-sm font-medium text-primary\">\n {footer}\n <ArrowRight className=\"h-3.5 w-3.5\" />\n </span>\n ) : (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={onAction}\n disabled={disabled || loading}\n className=\"gap-1.5 px-0 text-primary hover:text-primary/80\"\n >\n {footer}\n <ArrowRight className=\"h-3.5 w-3.5\" />\n </Button>\n )}\n </CardFooter>\n )}\n </Card>\n </Wrapper>\n );\n },\n);\nMediaCard.displayName = \"MediaCard\";\n\nexport { MediaCard };\n","\"use client\";\n\nimport * as React from \"react\";\nimport type { NapRecord } from \"./nap-block\";\n\n/** schema.org `PostalAddress` node, as emitted by `napRecordToJsonLd`. */\nexport interface PostalAddressJsonLd {\n \"@type\": \"PostalAddress\";\n streetAddress: string;\n addressLocality: string;\n addressRegion: string;\n postalCode: string;\n addressCountry: string;\n}\n\n/**\n * One entry of a LocalBusiness `department` array — itself a\n * LocalBusiness-family node, inheriting the parent's address rather than\n * repeating it. See https://schema.org/department.\n */\nexport interface LocalBusinessDepartmentJsonLd {\n \"@type\": string;\n name: string;\n telephone: string;\n}\n\n/**\n * The shape `napRecordToJsonLd` produces: a single top-level\n * LocalBusiness-family node. With exactly one department its phone is\n * promoted to the top-level `telephone`; with two or more, each becomes its\n * own `department` entry and no top-level `telephone` is set.\n */\nexport interface LocalBusinessJsonLd {\n \"@context\": \"https://schema.org\";\n \"@type\": string;\n name: string;\n address: PostalAddressJsonLd;\n telephone?: string;\n department?: LocalBusinessDepartmentJsonLd[];\n url?: string;\n}\n\n/**\n * Maps a `NapRecord` — the same object rendered by `NapBlock` — onto\n * schema.org's actual pattern for one business, one address, and multiple\n * named departments: a single LocalBusiness-family node with a `department`\n * array, where each department is its own LocalBusiness-family node\n * carrying its own `name` and `telephone` and inheriting the parent\n * `address` (https://schema.org/department). This is the real schema.org\n * shape for this case — deliberately not a bespoke \"locations\" array — so\n * the output validates and matches what Google expects for multi-department\n * local businesses.\n *\n * - Exactly one department: its phone is promoted to the top-level\n * `telephone` and no `department` array is emitted. The common\n * single-phone business shouldn't produce a spurious nested node.\n * - Two or more departments: every one becomes its own `department` entry\n * and the top-level `telephone` is omitted, so multiple phone numbers are\n * never flattened into one generic number.\n */\nexport function napRecordToJsonLd(record: NapRecord): LocalBusinessJsonLd {\n const { name, type, address, departments, url } = record;\n\n const shaped: LocalBusinessJsonLd = {\n \"@context\": \"https://schema.org\",\n \"@type\": type,\n name,\n address: {\n \"@type\": \"PostalAddress\",\n streetAddress: address.streetAddress,\n addressLocality: address.addressLocality,\n addressRegion: address.addressRegion,\n postalCode: address.postalCode,\n addressCountry: address.addressCountry ?? \"US\",\n },\n };\n\n if (url) shaped.url = url;\n\n if (departments.length <= 1) {\n if (departments[0]) shaped.telephone = departments[0].phone.e164;\n return shaped;\n }\n\n shaped.department = departments.map((dept) => ({\n \"@type\": dept.type ?? type,\n name: dept.name,\n telephone: dept.phone.e164,\n }));\n return shaped;\n}\n\nfunction isNapRecord(\n data: NapRecord | Record<string, unknown>,\n): data is NapRecord {\n return (\n typeof data === \"object\" &&\n data !== null &&\n Array.isArray((data as Partial<NapRecord>).departments) &&\n typeof (data as Partial<NapRecord>).address === \"object\"\n );\n}\n\n/**\n * Escapes `<` so a string value (e.g. a name containing `</script>`) can't\n * terminate the tag early. Standard hardening for inline JSON in HTML; see\n * https://v8.dev/features/subsume-json.\n */\nfunction safeJsonStringify(value: unknown): string {\n return JSON.stringify(value).replace(/</g, \"\\\\u003c\");\n}\n\nexport interface JsonLdProps {\n /**\n * Either a fully-formed schema.org object — any type, this component\n * neither knows nor cares what shape it is — or a `NapRecord`, which is\n * mapped to the LocalBusiness `department` shape via `napRecordToJsonLd`\n * before serializing. Passing the *same* `NapRecord` here and to\n * `NapBlock` is what keeps the visible NAP and the structured data from\n * drifting apart.\n */\n data: NapRecord | Record<string, unknown>;\n /** Optional CSP nonce forwarded to the `<script>` tag. */\n nonce?: string;\n}\n\n/**\n * Dumb serializer: renders a `<script type=\"application/ld+json\">` tag from\n * whatever schema.org-shaped object it's given. Contains no business logic\n * about what a business \"should\" look like — the only transformation it\n * ever performs is the structural `NapRecord` → LocalBusiness mapping in\n * `napRecordToJsonLd`, and only when handed a `NapRecord` instead of an\n * already-shaped object.\n */\nconst JsonLd = React.forwardRef<HTMLScriptElement, JsonLdProps>(\n ({ data, nonce }, ref) => {\n const shaped = isNapRecord(data) ? napRecordToJsonLd(data) : data;\n return (\n <script\n ref={ref}\n type=\"application/ld+json\"\n nonce={nonce}\n // eslint-disable-next-line react/no-danger -- JSON.stringify output, `<` escaped above\n dangerouslySetInnerHTML={{ __html: safeJsonStringify(shaped) }}\n />\n );\n },\n);\nJsonLd.displayName = \"JsonLd\";\n\nexport { JsonLd };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { MapPin, Phone } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { formatUsPhone } from \"../../lib/us-phone\";\nimport { renderPlainLink, type RenderLink } from \"../../lib/render-link\";\n\n/**\n * A single physical mailing address — schema.org `PostalAddress` shape,\n * minus the `@type` key that `JsonLd` adds when serializing.\n */\nexport interface NapAddress {\n streetAddress: string;\n addressLocality: string;\n addressRegion: string;\n postalCode: string;\n /**\n * ISO 3166-1 alpha-2 country code (e.g. \"US\", \"CA\"). Defaults to \"US\" in\n * both the rendered address and the JSON-LD output.\n */\n addressCountry?: string;\n}\n\nexport interface NapPhone {\n /**\n * E.164 format, e.g. \"+15551234567\". This is the *only* value used for\n * the `tel:` href and the JSON-LD `telephone` field — `display` never\n * feeds either of those, so a prettified string can't silently become an\n * unreachable link.\n */\n e164: string;\n /**\n * Human-readable text shown on the page, e.g. \"(555) 123-4567\". Defaults\n * to `formatUsPhone(e164)` when omitted, which assumes a US/NANP number —\n * pass this explicitly for non-US numbers.\n */\n display?: string;\n}\n\nexport interface NapDepartment {\n /** Stable key for React lists and for matching entries in tests. */\n id: string;\n /**\n * Department or Google Business Profile name, e.g.\n * \"Chiropractic & Wellness\". When there is exactly one department this is\n * typically identical to the business `name`.\n */\n name: string;\n /**\n * schema.org `@type` for this department's own node (e.g. \"Chiropractor\",\n * \"MedicalSpa\"). Falls back to the parent `NapRecord.type` when omitted —\n * most single-department businesses can leave this out entirely.\n */\n type?: string;\n phone: NapPhone;\n}\n\nexport interface NapRecord {\n /** Public/legal business name. */\n name: string;\n /**\n * schema.org `@type` for the business, e.g. \"Chiropractor\", \"Restaurant\",\n * \"ProfessionalService\". A plain string rather than a closed union on\n * purpose — schema.org's LocalBusiness hierarchy is large, and each\n * consuming site needs a different leaf type.\n */\n type: string;\n /** The one physical address shared by the business and every department. */\n address: NapAddress;\n /**\n * One or more named departments, each with its own phone number, all at\n * the shared `address`. This is NOT a list of separate locations — every\n * entry sits at the same building. A single-phone business is just one\n * department (commonly named the same as the business). Multiple entries\n * model distinct Google Business Profiles at one address, e.g. a\n * chiropractic practice and its medspa: two names, two numbers, one\n * building. `NapBlock` and `JsonLd` both read this same array, which is\n * what keeps the visible phone numbers and the structured data from\n * drifting apart.\n */\n departments: NapDepartment[];\n /**\n * Canonical business URL. Used as the JSON-LD `url` and, when provided,\n * as the link target for the business name in `NapBlock`.\n */\n url?: string;\n}\n\nexport interface NapBlockProps\n extends Omit<React.HTMLAttributes<HTMLElement>, \"children\"> {\n /** The shared NAP source of truth — also pass this same object to `JsonLd`. */\n record: NapRecord;\n /** Render the business name as a heading. Defaults to `true`. */\n showName?: boolean;\n /**\n * Heading element for the business name. Defaults to `\"h3\"`, suited to a\n * footer contact block or a card embedded in a larger page; pass `\"h2\"`\n * when this is the primary heading of a standalone contact section.\n */\n headingLevel?: \"h2\" | \"h3\" | \"h4\";\n /** Icon shown beside the address. Defaults to a Lucide `MapPin` glyph. */\n addressIcon?: React.ReactNode;\n /** Icon shown beside each phone number. Defaults to a Lucide `Phone` glyph. */\n phoneIcon?: React.ReactNode;\n /** Render the business and `tel:` links through a router component instead of a plain `<a>`. */\n renderLink?: RenderLink;\n}\n\nconst NapBlock = React.forwardRef<HTMLElement, NapBlockProps>(\n (\n {\n record,\n showName = true,\n headingLevel = \"h3\",\n addressIcon,\n phoneIcon,\n renderLink = renderPlainLink,\n className,\n ...props\n },\n ref,\n ) => {\n const { name, address, departments, url } = record;\n const country = address.addressCountry ?? \"US\";\n const Heading = headingLevel;\n const multiDepartment = departments.length > 1;\n\n return (\n // <address> is the semantically correct element for a block of contact\n // info; browsers italicize it by default, hence `not-italic`.\n <address\n ref={ref}\n className={cn(\"not-italic space-y-4\", className)}\n {...props}\n >\n {showName && (\n <Heading className=\"text-base font-semibold tracking-tight\">\n {url\n ? renderLink({ href: url, className: \"hover:underline\", children: name })\n : name}\n </Heading>\n )}\n\n <div className=\"flex items-start gap-2 text-sm text-muted-foreground\">\n <span aria-hidden className=\"mt-0.5 shrink-0 text-foreground/60\">\n {addressIcon ?? <MapPin className=\"size-4\" strokeWidth={1.5} />}\n </span>\n <span>\n {address.streetAddress}\n <br />\n {address.addressLocality}, {address.addressRegion}{\" \"}\n {address.postalCode}\n {country !== \"US\" && <>, {country}</>}\n </span>\n </div>\n\n <ul className=\"space-y-2\">\n {departments.map((dept) => (\n <li key={dept.id} className=\"flex items-center gap-2 text-sm\">\n <span aria-hidden className=\"shrink-0 text-foreground/60\">\n {phoneIcon ?? <Phone className=\"size-4\" strokeWidth={1.5} />}\n </span>\n <span>\n {multiDepartment && (\n <span className=\"mr-1.5 font-medium text-foreground\">\n {dept.name}:\n </span>\n )}\n {renderLink({\n href: `tel:${dept.phone.e164}`,\n className: \"hover:underline\",\n children: dept.phone.display ?? formatUsPhone(dept.phone.e164),\n })}\n </span>\n </li>\n ))}\n </ul>\n </address>\n );\n },\n);\nNapBlock.displayName = \"NapBlock\";\n\nexport { NapBlock };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { MoveUpRight } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { renderPlainLink, type RenderLink } from \"../../lib/render-link\";\nimport {\n Accordion,\n AccordionContent,\n AccordionItem,\n AccordionTrigger,\n} from \"../../components/accordion\";\n\nexport interface ShowcasePanelItem {\n /** Stable identifier for the item */\n id: string;\n /** Panel title */\n title: string;\n /** Short description revealed on the expanded panel */\n summary: string;\n /** Panel background image */\n image: { src: string; alt?: string };\n /** URL for the corner \"read more\" action; renders an anchor */\n href?: string;\n /**\n * Label shown on the collapsed spine and expanded caption. Defaults per\n * `spineVariant`: `\"numbered\"` → 01, 02, …; `\"volume\"` → I, II, ….\n */\n numeral?: string;\n}\n\n/**\n * Curated looks for the collapsed spines.\n *\n * - `\"numbered\"` — neutral default: 01 / 02 / 03 figures, no ornament\n * - `\"volume\"` — book-spine treatment: roman numerals and binding rules\n * - `\"minimal\"` — vertical title only, no numbering\n */\nexport type ShowcaseSpineVariant = \"numbered\" | \"volume\" | \"minimal\";\n\nexport interface ShowcasePanelsLabels {\n /** Caption prefix on the active panel. Defaults to \"Selected\". */\n selected?: string;\n /** Caption prefix on a hover-previewed panel. Defaults to \"Preview\". */\n preview?: string;\n}\n\nexport interface ShowcasePanelsBlockProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onChange\"> {\n /** Panels to render. Designed for 3–6 items. */\n items: ShowcasePanelItem[];\n /** Index of the initially selected panel (uncontrolled) */\n defaultActiveIndex?: number;\n /** Selected panel index (controlled) */\n activeIndex?: number;\n /** Called when the user selects a panel */\n onActiveIndexChange?: (index: number) => void;\n /**\n * Called when the corner action of a panel without an `href` is activated.\n * The action button is omitted for items with neither `href` nor this\n * handler.\n */\n onItemAction?: (item: ShowcasePanelItem, index: number) => void;\n /**\n * Small monospace watermark on collapsed spines, e.g. a brand name. Rendered\n * as \"BRAND · 01\". Omitted when not provided.\n */\n watermark?: string;\n /** Accessible label for the panel list */\n ariaLabel?: string;\n /**\n * Builds the accessible label for each panel's corner action.\n * Defaults to `Read more about {title}`.\n */\n actionLabel?: (item: ShowcasePanelItem) => string;\n /** Icon for the corner action. Defaults to a Lucide `MoveUpRight` glyph. */\n actionIcon?: React.ReactNode;\n /** Render the corner action's link through a router component instead of a plain `<a>`. */\n renderLink?: RenderLink;\n /**\n * Custom image renderer (e.g. `next/image`). The returned node is absolutely\n * positioned to fill the panel; it should render the image with\n * `object-cover`. Defaults to a plain `<img>`.\n */\n renderImage?: (item: ShowcasePanelItem, index: number) => React.ReactNode;\n /**\n * Curated collapsed-spine look. Defaults to `\"numbered\"`, a neutral style\n * suited to most content. Use `\"volume\"` for the book-spine / law-library\n * treatment, or `\"minimal\"` for just the vertical title.\n */\n spineVariant?: ShowcaseSpineVariant;\n /**\n * Fully custom collapsed-spine renderer, for brand marks, icons, or any\n * layout `spineVariant` doesn't cover. Overrides `spineVariant` when\n * provided. The returned node fills the spine.\n */\n renderSpine?: (\n item: ShowcasePanelItem,\n index: number,\n state: { isActive: boolean; numeral: string },\n ) => React.ReactNode;\n /** Caption word overrides. Defaults to English (\"Selected\" / \"Preview\"). */\n labels?: ShowcasePanelsLabels;\n}\n\n/** 1 → \"I\", 2 → \"II\", … Enough for any sane panel count. */\nfunction toRoman(n: number): string {\n const table: [number, string][] = [\n [10, \"X\"],\n [9, \"IX\"],\n [5, \"V\"],\n [4, \"IV\"],\n [1, \"I\"],\n ];\n let out = \"\";\n for (const [value, glyph] of table) {\n while (n >= value) {\n out += glyph;\n n -= value;\n }\n }\n return out;\n}\n\nconst EASE_LAYOUT = \"cubic-bezier(0, 0, 0.2, 1)\";\n\nconst ShowcasePanelsBlock = React.forwardRef<\n HTMLDivElement,\n ShowcasePanelsBlockProps\n>(\n (\n {\n items,\n defaultActiveIndex = 0,\n activeIndex: activeIndexProp,\n onActiveIndexChange,\n onItemAction,\n watermark,\n ariaLabel = \"Showcase panels\",\n actionLabel = (item) => `Read more about ${item.title}`,\n actionIcon,\n renderLink = renderPlainLink,\n renderImage,\n spineVariant = \"numbered\",\n renderSpine,\n labels,\n className,\n ...props\n },\n ref,\n ) => {\n const [activeIndexState, setActiveIndexState] =\n React.useState(defaultActiveIndex);\n const activeIndex = activeIndexProp ?? activeIndexState;\n const [hoverIndex, setHoverIndex] = React.useState<number | null>(null);\n const uid = React.useId();\n const tabRefs = React.useRef<(HTMLButtonElement | null)[]>([]);\n const tabId = (i: number) => `${uid}-tab-${i}`;\n const panelId = (i: number) => `${uid}-panel-${i}`;\n\n const setActiveIndex = (i: number) => {\n setActiveIndexState(i);\n onActiveIndexChange?.(i);\n };\n\n const focusTab = (i: number) => {\n setActiveIndex(i);\n tabRefs.current[i]?.focus();\n };\n\n const handleTablistKeyDown = (event: React.KeyboardEvent) => {\n const count = items.length;\n if (event.key === \"ArrowRight\") {\n event.preventDefault();\n focusTab((activeIndex + 1) % count);\n } else if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n focusTab((activeIndex - 1 + count) % count);\n } else if (event.key === \"Home\") {\n event.preventDefault();\n focusTab(0);\n } else if (event.key === \"End\") {\n event.preventDefault();\n focusTab(count - 1);\n }\n };\n\n const shownIndex = hoverIndex ?? activeIndex;\n const gridTemplate = items\n .map((_, i) => (i === shownIndex ? \"3fr\" : \"1fr\"))\n .join(\" \");\n\n const selectedLabel = labels?.selected ?? \"Selected\";\n const previewLabel = labels?.preview ?? \"Preview\";\n\n const numeralFor = (item: ShowcasePanelItem, i: number) =>\n item.numeral ??\n (spineVariant === \"volume\"\n ? toRoman(i + 1)\n : String(i + 1).padStart(2, \"0\"));\n\n const defaultImage = (item: ShowcasePanelItem) => (\n <img\n src={item.image.src}\n alt={item.image.alt ?? \"\"}\n className=\"absolute inset-0 h-full w-full object-cover\"\n />\n );\n\n const defaultSpine = (\n item: ShowcasePanelItem,\n i: number,\n { numeral }: { isActive: boolean; numeral: string },\n ) => {\n if (spineVariant === \"minimal\") {\n return (\n <span className=\"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rotate-180 text-sm font-light tracking-[0.25em] whitespace-nowrap text-foreground/90 uppercase [writing-mode:vertical-rl] md:text-base\">\n {item.title}\n </span>\n );\n }\n\n return (\n <>\n <span\n aria-hidden\n className=\"absolute inset-y-0 left-0 w-px bg-foreground/15\"\n />\n <span\n aria-hidden\n className=\"absolute inset-y-0 right-0 w-px bg-background/40\"\n />\n {spineVariant === \"volume\" && (\n <>\n <span\n aria-hidden\n className=\"absolute inset-x-2 top-10 h-px bg-foreground/15\"\n />\n <span\n aria-hidden\n className=\"absolute inset-x-2 top-12 h-px bg-foreground/15\"\n />\n <span\n aria-hidden\n className=\"absolute inset-x-2 bottom-10 h-px bg-foreground/15\"\n />\n <span\n aria-hidden\n className=\"absolute inset-x-2 bottom-12 h-px bg-foreground/15\"\n />\n </>\n )}\n\n <span className=\"absolute top-16 left-1/2 -translate-x-1/2 text-xl font-light tracking-widest text-foreground/70 md:text-2xl\">\n {numeral}\n </span>\n\n <span className=\"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rotate-180 text-sm font-light tracking-[0.25em] whitespace-nowrap text-foreground/90 uppercase [writing-mode:vertical-rl] md:text-base\">\n {item.title}\n </span>\n\n {watermark && (\n <span className=\"absolute bottom-16 left-1/2 -translate-x-1/2 font-mono text-[0.625rem] tracking-widest text-foreground/40 uppercase\">\n {watermark} &middot; {String(i + 1).padStart(2, \"0\")}\n </span>\n )}\n </>\n );\n };\n\n const cornerAction = (item: ShowcasePanelItem, i: number) => {\n const icon = actionIcon ?? (\n <MoveUpRight\n className=\"size-4 transition-transform group-hover/cta:translate-x-0.5 group-hover/cta:-translate-y-0.5\"\n strokeWidth={1.5}\n />\n );\n const actionClass =\n \"group/cta absolute top-5 right-5 z-10 grid size-10 place-items-center rounded-full bg-foreground/10 text-foreground backdrop-blur-sm transition-colors hover:bg-foreground/20 focus-visible:ring-2 focus-visible:ring-foreground/40 focus-visible:outline-none\";\n if (item.href) {\n return renderLink({\n href: item.href,\n \"aria-label\": actionLabel(item),\n className: actionClass,\n children: icon,\n });\n }\n if (onItemAction) {\n return (\n <button\n type=\"button\"\n aria-label={actionLabel(item)}\n onClick={() => onItemAction(item, i)}\n className={actionClass}\n >\n {icon}\n </button>\n );\n }\n return null;\n };\n\n return (\n <div\n ref={ref}\n // The panel inset is designed dark regardless of page theme. Dark\n // tokens are consumer-configured under either `.dark` or\n // `[data-theme=\"dark\"]`, so set both.\n data-theme=\"dark\"\n className={cn(\n \"dark overflow-hidden rounded-xl bg-background text-foreground\",\n className,\n )}\n {...props}\n >\n {/* Desktop: expanding column grid */}\n <div className=\"hidden md:block\">\n <ul\n role=\"tablist\"\n aria-label={ariaLabel}\n className=\"relative grid h-[28rem] gap-[3px] motion-safe:transition-[grid-template-columns] motion-safe:duration-500 md:h-[36rem]\"\n style={{\n gridTemplateColumns: gridTemplate,\n transitionTimingFunction: EASE_LAYOUT,\n }}\n onMouseLeave={() => setHoverIndex(null)}\n onKeyDown={handleTablistKeyDown}\n >\n {items.map((item, i) => {\n const isActive = i === activeIndex;\n const isShown = i === shownIndex;\n const numeral = numeralFor(item, i);\n return (\n <li\n key={item.id}\n className=\"relative h-full min-w-0 overflow-hidden\"\n >\n <button\n ref={(el) => {\n tabRefs.current[i] = el;\n }}\n type=\"button\"\n role=\"tab\"\n id={tabId(i)}\n aria-controls={panelId(i)}\n aria-selected={isActive}\n aria-label={`${numeral}: ${item.title}`}\n tabIndex={isActive ? 0 : -1}\n onClick={() => setActiveIndex(i)}\n onMouseEnter={() => setHoverIndex(i)}\n onFocus={() => setHoverIndex(i)}\n onBlur={() => setHoverIndex(null)}\n className=\"relative block size-full text-left focus-visible:ring-2 focus-visible:ring-foreground/40 focus-visible:outline-none focus-visible:ring-inset\"\n >\n {/* Collapsed spine */}\n <span\n aria-hidden\n className={cn(\n \"absolute inset-0 z-10 bg-linear-to-b from-card via-card to-background transition-opacity duration-300 ease-out\",\n isShown\n ? \"pointer-events-none opacity-0\"\n : \"opacity-100\",\n )}\n >\n {(renderSpine ?? defaultSpine)(item, i, {\n isActive,\n numeral,\n })}\n </span>\n </button>\n\n {/* Expanded panel. A sibling of the tab, not a descendant\n of it — a <button> may not contain focusable content,\n and the panel's own tabIndex needs to track visibility\n independently for keyboard users. pointer-events-none\n lets clicks and hover fall through to the tab button\n beneath, which still spans the full tile. */}\n <div\n role=\"tabpanel\"\n id={panelId(i)}\n aria-labelledby={tabId(i)}\n aria-hidden={!isShown}\n tabIndex={isShown ? 0 : -1}\n className=\"pointer-events-none absolute inset-0 outline-none\"\n >\n {(renderImage ?? defaultImage)(item, i)}\n <span\n aria-hidden\n className=\"absolute inset-0 [mask-image:linear-gradient(to_top,black,transparent_85%)] backdrop-blur-md\"\n />\n <span\n aria-hidden\n className=\"absolute inset-0 bg-linear-to-t from-background/85 via-background/40 to-transparent\"\n />\n <span className=\"absolute inset-x-0 bottom-0 overflow-hidden\">\n <span\n className={cn(\n \"block space-y-2 p-5 transition-transform duration-500 ease-out\",\n isShown\n ? \"translate-y-0\"\n : \"motion-safe:translate-y-full\",\n )}\n >\n <span\n className={cn(\n \"block font-mono text-[0.625rem] tracking-widest text-foreground/60 uppercase transition-[opacity,transform] duration-500 ease-out\",\n isShown\n ? \"translate-y-0 opacity-100 delay-100\"\n : \"opacity-0 motion-safe:translate-y-6\",\n )}\n >\n {isActive ? selectedLabel : previewLabel} {numeral}\n </span>\n <span\n className={cn(\n \"block text-xl leading-tight font-medium tracking-tight transition-[opacity,transform] duration-500 ease-out md:text-2xl\",\n isShown\n ? \"translate-y-0 opacity-100\"\n : \"opacity-0 motion-safe:translate-y-8\",\n )}\n >\n {item.title}\n </span>\n <span\n className={cn(\n \"block max-w-md text-xs leading-snug text-foreground/75 transition-[opacity,transform] duration-500 ease-out md:text-sm\",\n isShown\n ? \"translate-y-0 opacity-100 delay-200\"\n : \"opacity-0 motion-safe:translate-y-8\",\n )}\n >\n {item.summary}\n </span>\n </span>\n </span>\n </div>\n\n {isShown && cornerAction(item, i)}\n </li>\n );\n })}\n </ul>\n\n <div\n aria-hidden\n className=\"relative mt-1 h-2 bg-linear-to-b from-foreground/30 via-foreground/10 to-transparent\"\n />\n </div>\n\n {/* Mobile: accordion */}\n <div className=\"md:hidden\">\n <Accordion\n type=\"single\"\n value={items[activeIndex]?.id ?? items[0]?.id}\n onValueChange={(v: string) => {\n if (!v) return;\n const i = items.findIndex((item) => item.id === v);\n if (i >= 0) setActiveIndex(i);\n }}\n >\n {items.map((item, i) => {\n const numeral = numeralFor(item, i);\n return (\n <AccordionItem\n key={item.id}\n value={item.id}\n className=\"border-foreground/10\"\n >\n <AccordionTrigger className=\"items-center gap-4 px-5 py-5 text-base font-medium tracking-tight hover:no-underline\">\n <span className=\"inline-block min-w-[1.75rem] shrink-0 font-mono text-xs tracking-widest text-foreground/55\">\n {numeral}\n </span>\n <span className=\"flex-1 text-left text-foreground/80\">\n {item.title}\n </span>\n </AccordionTrigger>\n <AccordionContent className=\"p-0\">\n <div className=\"relative aspect-[16/10] w-full overflow-hidden\">\n {(renderImage ?? defaultImage)(item, i)}\n {cornerAction(item, i)}\n </div>\n <div className=\"space-y-3 p-5\">\n <span className=\"block font-mono text-[0.625rem] tracking-widest text-foreground/55 uppercase\">\n {selectedLabel} &middot; {numeral}\n </span>\n <p className=\"text-sm leading-relaxed text-foreground/80\">\n {item.summary}\n </p>\n </div>\n </AccordionContent>\n </AccordionItem>\n );\n })}\n </Accordion>\n </div>\n </div>\n );\n },\n);\nShowcasePanelsBlock.displayName = \"ShowcasePanelsBlock\";\n\nexport { ShowcasePanelsBlock };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Pause, Play } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport interface ProcessStepItem {\n /** Stable identifier for the item */\n id: string;\n /** Step title, e.g. \"First call\" */\n title: string;\n /** Description shown under the title on the active step */\n description: string;\n /** Step background image */\n image: { src: string; alt?: string };\n /**\n * Extra classes for the `<img>`, e.g. `object-position` or a horizontal\n * flip to frame a specific step's photo (`-scale-x-100`).\n */\n imageClassName?: string;\n /**\n * Label shown as \"Step {step}\". Defaults to the item's 1-based position.\n */\n step?: number;\n}\n\nexport interface ProcessStepsBlockProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onChange\"> {\n /** Steps to render, in order. Designed for 3–6 items. */\n items: ProcessStepItem[];\n /** Index of the initially active step (uncontrolled) */\n defaultActiveIndex?: number;\n /** Active step index (controlled) */\n activeIndex?: number;\n /** Called when the active step changes, from auto-advance or a click */\n onActiveIndexChange?: (index: number) => void;\n /**\n * Automatically advance through steps on a timer. Disabled when the user\n * prefers reduced motion. Defaults to `true`.\n */\n autoAdvance?: boolean;\n /** Milliseconds each step stays active before auto-advancing. Defaults to 6000. */\n autoAdvanceDuration?: number;\n /** Pause auto-advance while hovered or focused within. Defaults to `true`. */\n pauseOnHover?: boolean;\n /**\n * Custom image renderer (e.g. `next/image`). The returned node is\n * absolutely positioned to fill the frame; it should render the image with\n * `object-cover`. Defaults to a plain `<img>`.\n */\n renderImage?: (item: ProcessStepItem, index: number) => React.ReactNode;\n /** Accessible label for the step tablist */\n ariaLabel?: string;\n /** Builds the \"Step N\" label. Defaults to `Step {step}`. */\n stepLabel?: (item: ProcessStepItem, index: number) => string;\n /**\n * Accessible labels for the pause/resume control. The control is only\n * rendered while auto-advance is active (WCAG 2.2.2 Pause, Stop, Hide) —\n * hover and focus alone don't reach touch input.\n */\n labels?: { pause?: string; resume?: string };\n}\n\nconst TICK_MS = 100;\n\n/**\n * React 19 recognizes `inert` as a real boolean DOM property (`true` →\n * `setAttribute(\"inert\", \"\")`, `false` → removed) — confirmed against this\n * package's installed React version. On React 18, where `inert` isn't in\n * React's known-properties table, this is a no-op rather than a hazard:\n * an unrecognized boolean prop is simply dropped, so inactive panels fall\n * back to `aria-hidden` + `pointer-events-none` alone (already sufficient\n * for screen readers; `inert` is the extra guard against a stray focusable\n * node from a consumer's `renderImage`).\n */\nfunction inertWhen(hidden: boolean): { inert?: boolean } {\n return { inert: hidden };\n}\n\nconst ProcessStepsBlock = React.forwardRef<\n HTMLDivElement,\n ProcessStepsBlockProps\n>(\n (\n {\n items,\n defaultActiveIndex = 0,\n activeIndex: activeIndexProp,\n onActiveIndexChange,\n autoAdvance = true,\n autoAdvanceDuration = 6000,\n pauseOnHover = true,\n renderImage,\n ariaLabel = \"Process steps\",\n stepLabel = (item) => `Step ${item.step ?? 1}`,\n labels,\n className,\n ...props\n },\n ref,\n ) => {\n const [activeIndexState, setActiveIndexState] =\n React.useState(defaultActiveIndex);\n const activeIndex = activeIndexProp ?? activeIndexState;\n const [progress, setProgress] = React.useState(0);\n const hoverPausedRef = React.useRef(false);\n const manuallyPausedRef = React.useRef(false);\n const [manuallyPaused, setManuallyPaused] = React.useState(false);\n const [reducedMotion, setReducedMotion] = React.useState(false);\n const uid = React.useId();\n const tabRefs = React.useRef<(HTMLButtonElement | null)[]>([]);\n const tabId = (i: number) => `${uid}-tab-${i}`;\n const panelId = (i: number) => `${uid}-panel-${i}`;\n\n const setActiveIndex = (i: number) => {\n setActiveIndexState(i);\n onActiveIndexChange?.(i);\n };\n\n const focusTab = (i: number) => {\n setActiveIndex(i);\n tabRefs.current[i]?.focus();\n };\n\n const handleTablistKeyDown = (event: React.KeyboardEvent) => {\n const count = items.length;\n if (event.key === \"ArrowRight\") {\n event.preventDefault();\n focusTab((activeIndex + 1) % count);\n } else if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n focusTab((activeIndex - 1 + count) % count);\n } else if (event.key === \"Home\") {\n event.preventDefault();\n focusTab(0);\n } else if (event.key === \"End\") {\n event.preventDefault();\n focusTab(count - 1);\n }\n };\n\n React.useEffect(() => {\n const query = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n setReducedMotion(query.matches);\n const onChange = () => setReducedMotion(query.matches);\n query.addEventListener(\"change\", onChange);\n return () => query.removeEventListener(\"change\", onChange);\n }, []);\n\n const isAutoAdvancing = autoAdvance && !reducedMotion && items.length > 1;\n\n React.useEffect(() => {\n if (!isAutoAdvancing) return;\n hoverPausedRef.current = false;\n setProgress(0);\n let elapsed = 0;\n const id = setInterval(() => {\n if (hoverPausedRef.current || manuallyPausedRef.current) return;\n elapsed += TICK_MS;\n const pct = Math.min(elapsed / autoAdvanceDuration, 1);\n setProgress(pct);\n if (pct >= 1) {\n clearInterval(id);\n setActiveIndex((activeIndex + 1) % items.length);\n }\n }, TICK_MS);\n return () => clearInterval(id);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [activeIndex, isAutoAdvancing, autoAdvanceDuration, items.length]);\n\n const pause = () => {\n if (pauseOnHover) hoverPausedRef.current = true;\n };\n const resume = () => {\n if (pauseOnHover) hoverPausedRef.current = false;\n };\n const toggleManuallyPaused = () => {\n setManuallyPaused((prev) => {\n manuallyPausedRef.current = !prev;\n return !prev;\n });\n };\n\n const total = items.length;\n\n const defaultImage = (item: ProcessStepItem) => (\n <img\n src={item.image.src}\n alt={item.image.alt ?? \"\"}\n className={cn(\"size-full object-cover\", item.imageClassName)}\n />\n );\n\n return (\n <div\n ref={ref}\n // The stage is designed dark regardless of page theme. Dark tokens\n // are consumer-configured under either `.dark` or\n // `[data-theme=\"dark\"]`, so set both.\n data-theme=\"dark\"\n className={cn(\n \"dark overflow-hidden rounded-xl bg-background text-foreground ring-1 ring-foreground/10\",\n className,\n )}\n onMouseEnter={pause}\n onMouseLeave={resume}\n onFocus={pause}\n onBlur={resume}\n {...props}\n >\n <div className=\"relative aspect-[4/5] md:aspect-[16/9]\">\n {items.map((item, i) => {\n const isActive = i === activeIndex;\n return (\n <div\n key={item.id}\n aria-hidden={!isActive}\n className=\"absolute inset-0 motion-safe:transition-[clip-path] motion-safe:duration-700 motion-safe:ease-out\"\n style={{\n clipPath: isActive\n ? \"inset(0% 0% 0% 0%)\"\n : \"inset(0% 0% 0% 100%)\",\n }}\n {...inertWhen(!isActive)}\n >\n {(renderImage ?? defaultImage)(item, i)}\n </div>\n );\n })}\n\n <div\n aria-hidden\n className=\"absolute inset-0 bg-linear-to-t from-black/75 via-black/20 to-transparent\"\n />\n <div\n aria-hidden\n className=\"absolute inset-y-0 left-0 w-2/3 bg-linear-to-r from-black/35 to-transparent\"\n />\n\n {isAutoAdvancing && (\n <button\n type=\"button\"\n onClick={toggleManuallyPaused}\n aria-pressed={manuallyPaused}\n aria-label={\n manuallyPaused\n ? (labels?.resume ?? \"Resume auto-advance\")\n : (labels?.pause ?? \"Pause auto-advance\")\n }\n className=\"group/cta absolute top-5 right-5 z-10 grid size-10 place-items-center rounded-full bg-foreground/10 text-white backdrop-blur-sm transition-colors hover:bg-foreground/20 focus-visible:ring-2 focus-visible:ring-foreground/40 focus-visible:outline-none\"\n >\n {manuallyPaused ? (\n <Play className=\"size-4\" strokeWidth={1.5} />\n ) : (\n <Pause className=\"size-4\" strokeWidth={1.5} />\n )}\n </button>\n )}\n\n {items.map((item, i) => {\n const isActive = i === activeIndex;\n return (\n <div\n key={item.id}\n role=\"tabpanel\"\n id={panelId(i)}\n aria-labelledby={tabId(i)}\n aria-hidden={!isActive}\n // Not just 0: on React 18, where `inert` is a silent no-op\n // (see inertWhen's comment), an inactive panel would\n // otherwise stay focusable while aria-hidden — axe's\n // aria-hidden-focus violation. Demotes `inert` to\n // defence-in-depth instead of load-bearing.\n tabIndex={isActive ? 0 : -1}\n {...inertWhen(!isActive)}\n className={cn(\n \"absolute right-5 bottom-6 left-5 text-white transition-[opacity,transform] duration-500 ease-out outline-none md:right-16 md:bottom-14 md:left-16\",\n isActive\n ? \"opacity-100\"\n : \"pointer-events-none opacity-0 motion-safe:translate-y-4\",\n )}\n >\n <div className=\"flex items-center gap-3 text-white/60\">\n <span\n aria-hidden\n className=\"h-px w-8 bg-current md:w-10\"\n />\n <span className=\"text-xs tracking-widest md:text-sm\">\n {stepLabel(item, i)} of {total}\n </span>\n </div>\n <h3 className=\"mt-3 text-5xl leading-[0.95] font-medium tracking-tight md:mt-6 md:text-7xl lg:text-8xl\">\n {item.title}\n </h3>\n <p className=\"mt-4 max-w-lg text-sm leading-snug font-medium text-white/85 md:mt-8 md:text-base md:leading-relaxed lg:text-lg\">\n {item.description}\n </p>\n </div>\n );\n })}\n </div>\n\n <ol\n role=\"tablist\"\n aria-label={ariaLabel}\n onKeyDown={handleTablistKeyDown}\n className=\"grid border-t border-foreground/10 bg-card text-foreground\"\n style={{ gridTemplateColumns: `repeat(${total}, minmax(0, 1fr))` }}\n >\n {items.map((item, i) => {\n const isActive = i === activeIndex;\n return (\n <li key={item.id} className=\"relative\">\n <button\n ref={(el) => {\n tabRefs.current[i] = el;\n }}\n type=\"button\"\n role=\"tab\"\n id={tabId(i)}\n aria-controls={panelId(i)}\n aria-selected={isActive}\n aria-current={isActive ? \"step\" : undefined}\n tabIndex={isActive ? 0 : -1}\n onClick={() => setActiveIndex(i)}\n className={cn(\n \"group relative flex h-16 w-full flex-col items-center justify-center gap-1 px-3 text-center transition-colors outline-none md:h-20 md:gap-1.5\",\n isActive\n ? \"text-foreground\"\n : \"text-muted-foreground hover:text-foreground/85\",\n )}\n >\n <span className=\"font-mono text-[0.5625rem] tracking-[0.2em] text-foreground/45 uppercase md:text-[0.625rem]\">\n {stepLabel(item, i)}\n </span>\n <span className=\"hidden text-sm font-medium tracking-tight md:inline md:text-base\">\n {item.title}\n </span>\n <span\n aria-hidden\n className=\"pointer-events-none absolute inset-x-0 top-0 h-px overflow-hidden bg-foreground/10\"\n >\n {isActive && (\n <span\n className=\"block h-full origin-left bg-brand-accent\"\n style={{\n transform: `scaleX(${isAutoAdvancing ? progress : 1})`,\n transition: isAutoAdvancing\n ? `transform ${TICK_MS}ms linear`\n : \"none\",\n }}\n />\n )}\n </span>\n </button>\n </li>\n );\n })}\n </ol>\n </div>\n );\n },\n);\nProcessStepsBlock.displayName = \"ProcessStepsBlock\";\n\nexport { ProcessStepsBlock };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Badge } from \"../../components/badge\";\nimport { renderPlainLink, type RenderLink } from \"../../lib/render-link\";\n\nexport interface StatItem {\n /** Stable identifier for the item */\n id: string;\n /**\n * The figure, e.g. `\"98%\"`, `\"12,000+\"`, `\"L1–S1\"`. Rendered as given and\n * never parsed: ranges, units and suffixes are the editor's to write.\n */\n value: React.ReactNode;\n /** The sentence under the figure, e.g. \"of patients home the same day\". */\n label: React.ReactNode;\n /** Makes the whole cell a link to this destination. */\n href?: string;\n /**\n * On phones the band is two per row, so an odd count leaves one stat on a\n * row of its own. This flag says which one takes the full row. A full row\n * has to start a row, so the flag counts only on the 1st, 3rd or 5th stat\n * (an even index); a flag anywhere else, or on an even count, is ignored,\n * and with an odd count and no usable flag the first stat takes the row.\n */\n wide?: boolean;\n}\n\n/** Column count from `lg` up. Below that the layout is the band's own. */\nexport type StatsBandColumns = 2 | 3 | 4 | 5 | 6;\n\nexport interface StatsBandBlockProps extends Omit<\n React.HTMLAttributes<HTMLElement>,\n \"title\"\n> {\n /** Stats to render, in order. Designed for 2–6 items. */\n items: StatItem[];\n /**\n * Columns from `lg` up. Defaults to one per stat, and never exceeds the\n * stat count. Phones always show two per row and tablets three (see\n * `StatItem.wide` for the odd one out).\n */\n columns?: StatsBandColumns;\n /**\n * `\"card\"` (default) is a bordered, shadowed, rounded card — the strip that\n * floats over a hero seam. `\"plain\"` keeps only the hairline dividers.\n */\n tone?: \"card\" | \"plain\";\n /** Text alignment inside each cell. Defaults to `\"start\"`. */\n align?: \"start\" | \"center\";\n /**\n * Small label above the heading. A string renders inside an outline\n * `Badge`; any other node renders as-is. Omit it to hide the row.\n */\n eyebrow?: React.ReactNode;\n /** Optional section heading above the band. */\n title?: React.ReactNode;\n /** Supporting copy under the heading. */\n description?: React.ReactNode;\n /** Heading element for `title`. Defaults to `\"h2\"`. */\n headingLevel?: \"h2\" | \"h3\";\n /**\n * Accessible name for the section when there is no `title`. Defaults to\n * \"At a glance\".\n */\n ariaLabel?: string;\n /** Render a linked stat through a router component instead of a plain `<a>`. */\n renderLink?: RenderLink;\n /**\n * Replace the contents of a cell. The grid, the spans and the cell chrome\n * stay; only what is inside the cell is yours. For icons, count-ups, or a\n * site-specific figure treatment.\n */\n renderItem?: (item: StatItem, index: number) => React.ReactNode;\n /** Classes for the inner container that constrains width and gutters. */\n containerClassName?: string;\n}\n\n/*\n * Tailwind cannot build class names at runtime, so every column count and\n * span the band can produce is spelled out here.\n */\nconst DESKTOP_COLUMNS: Record<StatsBandColumns, string> = {\n 2: \"lg:grid-cols-2\",\n 3: \"lg:grid-cols-3\",\n 4: \"lg:grid-cols-4\",\n 5: \"lg:grid-cols-5\",\n 6: \"lg:grid-cols-6\",\n};\n\nconst TABLET_SPAN = {\n 2: \"md:col-span-2\",\n 3: \"md:col-span-3\",\n 6: \"md:col-span-6\",\n} as const;\n\n/**\n * Phones: two per row. An odd count puts one stat on a row of its own, and\n * that stat spans the row — the first usable flag, else the first stat. An\n * even count has no such stat, whatever is flagged.\n *\n * Usable means the stat starts a row (an even index). A span-2 cell at an\n * odd index cannot fit beside the cell before it, so the grid would push it\n * down and leave a bordered hole in the row above; the flag is ignored there\n * rather than reordering the stats to fill the hole.\n */\nfunction wideIndex(items: StatItem[]): number {\n if (items.length % 2 === 0) return -1;\n const flagged = items.findIndex((item, i) => item.wide && i % 2 === 0);\n return Math.max(flagged, 0);\n}\n\n/**\n * Tablets: three per row on a six-track grid, so a short last row can\n * stretch to fill — two leftovers take half each, one takes the row. Four\n * is the exception and goes two by two: three and a lonely one reads as a\n * mistake, and two by two is what the strip does on a phone anyway.\n */\nfunction tabletSpans(count: number): (2 | 3 | 6)[] {\n if (count === 4) return [3, 3, 3, 3];\n const remainder = count % 3;\n return Array.from({ length: count }, (_, i) => {\n if (i < count - remainder) return 2;\n return remainder === 2 ? 3 : 6;\n });\n}\n\nconst StatsBandBlock = React.forwardRef<HTMLElement, StatsBandBlockProps>(\n (\n {\n items,\n columns,\n tone = \"card\",\n align = \"start\",\n eyebrow,\n title,\n description,\n headingLevel: Heading = \"h2\",\n ariaLabel = \"At a glance\",\n renderLink = renderPlainLink,\n renderItem,\n containerClassName,\n className,\n ...props\n },\n ref,\n ) => {\n const uid = React.useId();\n const headingId = `${uid}-heading`;\n\n if (items.length < 2) return null;\n\n const desktopColumns = Math.min(\n columns ?? items.length,\n items.length,\n 6,\n ) as StatsBandColumns;\n const wide = wideIndex(items);\n const tablet = tabletSpans(items.length);\n const centered = align === \"center\";\n const hasHeader = title != null;\n\n return (\n <section\n ref={ref}\n aria-labelledby={hasHeader ? headingId : undefined}\n aria-label={hasHeader ? undefined : ariaLabel}\n className={cn(\"relative\", className)}\n {...props}\n >\n <div\n className={cn(\"mx-auto max-w-6xl px-4 sm:px-6\", containerClassName)}\n >\n {(hasHeader || eyebrow != null || description != null) && (\n <div className={cn(\"mb-10\", centered && \"text-center\")}>\n {typeof eyebrow === \"string\" ? (\n <Badge\n variant=\"outline\"\n className=\"h-7 rounded-full px-3 font-medium\"\n >\n {eyebrow}\n </Badge>\n ) : (\n eyebrow\n )}\n {hasHeader && (\n <Heading\n id={headingId}\n className={cn(\n \"text-3xl leading-[1.05] font-light tracking-tight md:text-4xl\",\n eyebrow != null && \"mt-6\",\n )}\n >\n {title}\n </Heading>\n )}\n {description != null && (\n <p\n className={cn(\n \"mt-4 max-w-2xl text-base leading-relaxed text-muted-foreground\",\n centered && \"mx-auto\",\n )}\n >\n {description}\n </p>\n )}\n </div>\n )}\n\n <div\n className={cn(\n \"overflow-hidden\",\n tone === \"card\" &&\n \"rounded-xl border border-border bg-card shadow-md\",\n )}\n >\n {/*\n The hairline grid is each cell's right and bottom border. The\n list is a pixel wider and taller than its wrapper, so the\n outer edges' rules fall outside it and are clipped — which is\n what keeps an odd count from leaving a blank, border-coloured\n tile the way a gap-plus-background grid would.\n */}\n <dl\n className={cn(\n \"-mr-px -mb-px grid grid-cols-2 md:grid-cols-6\",\n DESKTOP_COLUMNS[desktopColumns],\n )}\n >\n {items.map((item, i) => {\n const labelId = `${uid}-label-${i}`;\n const linked = Boolean(item.href);\n return (\n <div\n key={item.id}\n className={cn(\n // Only the last row can be short, so only the last cell\n // can end a row early; trimming its rule keeps a short\n // desktop row from ending in a dangling hairline.\n \"relative flex flex-col-reverse justify-end gap-2 border-r border-b border-border px-6 py-8 last:border-r-0 sm:px-8\",\n centered && \"items-center text-center\",\n linked && \"transition-colors hover:bg-muted/40\",\n i === wide && \"col-span-2\",\n TABLET_SPAN[tablet[i]],\n \"lg:col-span-1\",\n )}\n >\n {renderItem ? (\n renderItem(item, i)\n ) : (\n <>\n <dt\n id={labelId}\n className=\"max-w-[24ch] text-sm leading-relaxed text-muted-foreground\"\n >\n {item.label}\n </dt>\n <dd className=\"font-heading text-3xl font-bold tracking-tight text-primary sm:text-4xl\">\n {linked\n ? renderLink({\n href: item.href as string,\n \"aria-describedby\": labelId,\n className:\n \"outline-none after:absolute after:inset-0 focus-visible:after:ring-2 focus-visible:after:ring-ring focus-visible:after:ring-inset\",\n children: item.value,\n })\n : item.value}\n </dd>\n </>\n )}\n </div>\n );\n })}\n </dl>\n </div>\n </div>\n </section>\n );\n },\n);\nStatsBandBlock.displayName = \"StatsBandBlock\";\n\nexport { StatsBandBlock };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { CircleHelp, MoveUpRight } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport {\n newTabAttributes,\n renderPlainLink,\n type RenderLink,\n} from \"../../lib/render-link\";\nimport { Badge } from \"../../components/badge\";\nimport {\n Accordion,\n AccordionContent,\n AccordionItem,\n AccordionTrigger,\n} from \"../../components/accordion\";\n\nexport interface FAQItem {\n /** Stable identifier; doubles as the accordion item value. */\n id: string;\n /** The question shown on the accordion trigger. */\n question: React.ReactNode;\n /** The answer revealed when the item opens. */\n answer: React.ReactNode;\n}\n\nexport interface FAQCallToAction {\n /** Lead-in line above the link, e.g. \"Don't see your question?\". */\n title: React.ReactNode;\n /** The link label, e.g. \"Talk to a lawyer directly\". */\n linkText: React.ReactNode;\n /** Destination for the link. */\n href: string;\n /**\n * Open the link in a new tab (`target=\"_blank\"`, with `rel` set for\n * security) instead of navigating the current page. Defaults to `false`.\n */\n newTab?: boolean;\n /**\n * Trailing icon for the link. Defaults to a Lucide `MoveUpRight` glyph.\n * Pass `null` to omit it.\n */\n icon?: React.ReactNode;\n}\n\nexport interface FAQColumnsBlockProps\n extends Omit<\n React.HTMLAttributes<HTMLElement>,\n \"title\" | \"defaultValue\" | \"onChange\"\n > {\n /** Questions and answers rendered in the scrolling column. */\n items: FAQItem[];\n /** Section heading. */\n title: React.ReactNode;\n /** Supporting copy under the heading. */\n description?: React.ReactNode;\n /**\n * Small label above the heading. A string renders inside an outline\n * `Badge`; any other node renders as-is, so a brand eyebrow component can\n * be dropped in unchanged. Omit it to hide the row.\n */\n eyebrow?: React.ReactNode;\n /**\n * Icon opposite the eyebrow. Defaults to a Lucide `CircleHelp` glyph.\n * Pass `null` to omit it.\n */\n icon?: React.ReactNode;\n /** Optional call to action beneath the description. */\n cta?: FAQCallToAction;\n /** Render the call to action's link through a router component instead of a plain `<a>`. */\n renderLink?: RenderLink;\n /**\n * Keep the left column pinned while the questions scroll past on `lg` and\n * up. Defaults to `true`.\n */\n sticky?: boolean;\n /** `\"single\"` (default) opens one question at a time; `\"multiple\"` allows many. */\n type?: \"single\" | \"multiple\";\n /** Allow the open item to be closed again. Only used with `type=\"single\"`. */\n collapsible?: boolean;\n /** Initially open item id(s) — a string for `\"single\"`, an array for `\"multiple\"`. */\n defaultValue?: string | string[];\n /** Open item id(s), for controlled usage. */\n value?: string | string[];\n /** Called when the open item(s) change. */\n onValueChange?: (value: string & string[]) => void;\n /** Classes for the inner container that constrains width and gutters. */\n containerClassName?: string;\n /** Classes for the two-column grid. */\n gridClassName?: string;\n /** Classes for the sticky left column. Overrides the `lg:top-28` offset. */\n asideClassName?: string;\n /** Classes for the eyebrow, applied to the default `Badge` or a custom node's wrapper. */\n eyebrowClassName?: string;\n /** Classes for the heading. */\n titleClassName?: string;\n /** Classes for the description. */\n descriptionClassName?: string;\n /** Classes for the call-to-action wrapper. */\n ctaClassName?: string;\n /** Classes for the accordion wrapper. */\n listClassName?: string;\n /** Classes for each accordion item. */\n itemClassName?: string;\n /** Classes for each question trigger. */\n questionClassName?: string;\n /** Classes for each answer panel. */\n answerClassName?: string;\n}\n\nconst FAQColumnsBlock = React.forwardRef<HTMLElement, FAQColumnsBlockProps>(\n (\n {\n items,\n title,\n description,\n eyebrow,\n icon,\n cta,\n renderLink = renderPlainLink,\n sticky = true,\n type = \"single\",\n collapsible = true,\n defaultValue,\n value,\n onValueChange,\n containerClassName,\n gridClassName,\n asideClassName,\n eyebrowClassName,\n titleClassName,\n descriptionClassName,\n ctaClassName,\n listClassName,\n itemClassName,\n questionClassName,\n answerClassName,\n className,\n ...props\n },\n ref,\n ) => {\n const headingId = React.useId();\n\n // The eyebrow/icon row is what the heading's top margin clears. With\n // neither (`icon={null}` and no eyebrow) the heading must sit flush, or\n // the intro column starts lower than the accordion beside it.\n const hasHeaderRow = eyebrow != null || icon !== null;\n\n // Radix types `value`/`defaultValue`/`onValueChange` differently per\n // `type`; the props above accept both shapes so consumers don't have to\n // reach for a discriminated union.\n const accordionProps = {\n type,\n ...(type === \"single\" ? { collapsible } : {}),\n defaultValue,\n value,\n onValueChange,\n } as React.ComponentProps<typeof Accordion>;\n\n return (\n <section\n ref={ref}\n aria-labelledby={props[\"aria-label\"] ? undefined : headingId}\n className={cn(\"py-16 md:py-24\", className)}\n {...props}\n >\n <div\n className={cn(\"mx-auto max-w-6xl px-4 sm:px-6\", containerClassName)}\n >\n <div\n className={cn(\n \"grid grid-cols-1 gap-12 lg:grid-cols-[1fr_1.4fr] lg:gap-16\",\n gridClassName,\n )}\n >\n <div\n className={cn(\n \"relative\",\n // `self-start` is what lets the column stop growing to the\n // grid row's height — without it the sticky offset never\n // engages, because the element already spans the whole row.\n sticky && \"lg:sticky lg:top-28 lg:self-start\",\n asideClassName,\n )}\n >\n {hasHeaderRow && (\n <div className=\"flex items-start justify-between gap-4\">\n {typeof eyebrow === \"string\" ? (\n <Badge\n variant=\"outline\"\n className={cn(\n \"h-7 shrink-0 rounded-full px-3 font-medium\",\n eyebrowClassName,\n )}\n >\n {eyebrow}\n </Badge>\n ) : eyebrow != null ? (\n <div className={cn(\"shrink-0\", eyebrowClassName)}>\n {eyebrow}\n </div>\n ) : (\n <span aria-hidden />\n )}\n\n {icon === undefined ? (\n <CircleHelp\n aria-hidden\n strokeWidth={1}\n className=\"size-6 shrink-0 text-muted-foreground\"\n />\n ) : (\n icon\n )}\n </div>\n )}\n\n <h2\n id={headingId}\n className={cn(\n \"text-3xl font-light leading-[1.05] tracking-tight md:text-4xl lg:text-5xl\",\n hasHeaderRow && \"mt-8\",\n titleClassName,\n )}\n >\n {title}\n </h2>\n\n {description ? (\n <p\n className={cn(\n \"mt-6 max-w-md text-base text-muted-foreground\",\n descriptionClassName,\n )}\n >\n {description}\n </p>\n ) : null}\n\n {cta ? (\n <div className={cn(\"mt-10 border-t pt-6\", ctaClassName)}>\n <p className=\"text-sm text-muted-foreground\">{cta.title}</p>\n {renderLink({\n href: cta.href,\n ...newTabAttributes(cta.newTab),\n className:\n \"group/faq-cta mt-1.5 inline-flex items-center gap-2 text-sm tracking-tight text-foreground transition-colors\",\n children: (\n <>\n <span className=\"border-b border-transparent transition-colors group-hover/faq-cta:border-current\">\n {cta.linkText}\n </span>\n {cta.icon === undefined ? (\n <MoveUpRight\n aria-hidden\n className=\"size-3.5 transition-transform group-hover/faq-cta:-translate-y-0.5 group-hover/faq-cta:translate-x-0.5\"\n />\n ) : (\n cta.icon\n )}\n </>\n ),\n })}\n </div>\n ) : null}\n </div>\n\n <Accordion\n {...accordionProps}\n className={cn(\"w-full\", listClassName)}\n >\n {items.map((item) => (\n <AccordionItem\n key={item.id}\n value={item.id}\n className={itemClassName}\n >\n <AccordionTrigger\n className={cn(\n \"items-start gap-6 py-5 text-start text-base font-normal tracking-tight md:text-lg\",\n questionClassName,\n )}\n >\n {item.question}\n </AccordionTrigger>\n <AccordionContent\n className={cn(\n \"pb-5 text-base leading-relaxed text-muted-foreground\",\n answerClassName,\n )}\n >\n {item.answer}\n </AccordionContent>\n </AccordionItem>\n ))}\n </Accordion>\n </div>\n </div>\n </section>\n );\n },\n);\nFAQColumnsBlock.displayName = \"FAQColumnsBlock\";\n\nexport { FAQColumnsBlock };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Card, CardContent } from \"../../components/card\";\nimport {\n Avatar,\n AvatarImage,\n AvatarFallback,\n} from \"../../components/avatar\";\nimport { Badge, type BadgeProps } from \"../../components/badge\";\nimport { Progress } from \"../../components/progress\";\nimport { Rating } from \"../../components/rating\";\nimport { Skeleton } from \"../../components/skeleton\";\n\nexport interface ReviewItem {\n /** Stable key for the review. */\n id: string;\n /** Star rating for this review, 0–5. */\n rating: number;\n /** Review body text. */\n content: string;\n author: {\n name: string;\n /** Optional avatar image URL; falls back to initials. */\n avatarUrl?: string;\n };\n /** Preformatted, human-readable date, e.g. \"2 weeks ago\" or \"Dec 10, 2024\". */\n date: string;\n /** Optional badge shown beside the author name, e.g. \"Google\". */\n badgeLabel?: string;\n}\n\n/** A single `{ star, count }` bucket of the rating distribution. */\nexport interface RatingDistributionItem {\n /** Star level, 1–5. */\n star: number;\n /** Number of reviews at this star level. */\n count: number;\n}\n\nexport interface ReviewsBlockProps\n extends React.HTMLAttributes<HTMLElement> {\n /** Reviews to display as cards. */\n reviews: ReviewItem[];\n /** Aggregate average rating shown in the summary. */\n averageRating: number;\n /** Total number of reviews behind the aggregate. */\n totalReviews: number;\n /** Section heading. Defaults to \"Customer Reviews\". */\n title?: string;\n /**\n * Optional per-star distribution. When provided, the summary renders the\n * bar chart; when omitted, only the average + total are shown. Omit it when\n * the data source (e.g. Google Places) does not expose a full histogram.\n */\n distribution?: RatingDistributionItem[];\n /**\n * Brand variant for the per-review badge (`badgeLabel`). Defaults to\n * `secondary`. Use it to align the badge with the surrounding brand color.\n */\n badgeVariant?: BadgeProps[\"variant\"];\n /**\n * Text-color utility applied to the star ratings, e.g. `text-primary`.\n * Defaults to the `Rating` component's own default (`text-highlight`).\n */\n ratingClassName?: string;\n /** Render skeleton placeholders instead of content. */\n loading?: boolean;\n /** Render an error message instead of content. */\n error?: string;\n}\n\nfunction initials(name: string): string {\n return name\n .split(\" \")\n .map((n) => n[0])\n .filter(Boolean)\n .slice(0, 2)\n .join(\"\")\n .toUpperCase();\n}\n\nconst SKELETON_CARDS = 4;\n\nconst ReviewsBlock = React.forwardRef<HTMLElement, ReviewsBlockProps>(\n (\n {\n reviews,\n averageRating,\n totalReviews,\n title = \"Customer Reviews\",\n distribution,\n badgeVariant = \"secondary\",\n ratingClassName,\n loading,\n error,\n className,\n ...props\n },\n ref,\n ) => {\n // Round once so the numeric label and the star fill never disagree (e.g.\n // 4.95 must not read \"5.0\" beside a partially filled fifth star).\n const displayRating = Math.round(averageRating * 10) / 10;\n\n return (\n <section\n ref={ref}\n className={cn(\"py-16 md:py-24\", className)}\n {...props}\n >\n <div className=\"mx-auto max-w-5xl px-4 sm:px-6\">\n <h2 className=\"mb-8 text-2xl font-semibold tracking-tight md:text-3xl\">\n {title}\n </h2>\n\n {error ? (\n <p className=\"text-sm text-muted-foreground\">{error}</p>\n ) : (\n <div className=\"grid gap-8 lg:grid-cols-[280px_1fr] lg:gap-12\">\n {/* Summary */}\n <div className=\"space-y-6\">\n <div className=\"text-center lg:text-left\">\n {loading ? (\n <>\n <Skeleton className=\"mx-auto h-12 w-20 lg:mx-0\" />\n <Skeleton className=\"mx-auto mt-2 h-5 w-28 lg:mx-0\" />\n <Skeleton className=\"mx-auto mt-1 h-4 w-36 lg:mx-0\" />\n </>\n ) : (\n <>\n <div className=\"text-5xl font-bold\">\n {displayRating.toFixed(1)}\n </div>\n <Rating\n rate={displayRating}\n size=\"lg\"\n className={cn(\n \"mt-2 justify-center lg:justify-start\",\n ratingClassName,\n )}\n />\n <p className=\"mt-1 text-sm text-muted-foreground\">\n Based on {totalReviews.toLocaleString()} reviews\n </p>\n </>\n )}\n </div>\n\n {/* Distribution bars — only when the data source provides them */}\n {!loading && distribution && distribution.length > 0 && (\n <div className=\"space-y-2\">\n {[...distribution]\n .sort((a, b) => b.star - a.star)\n .map(({ star, count }) => (\n <div key={star} className=\"flex items-center gap-3\">\n <span className=\"w-8 text-sm text-muted-foreground\">\n {star} ★\n </span>\n <Progress\n value={\n totalReviews > 0\n ? (count / totalReviews) * 100\n : 0\n }\n className=\"h-2 flex-1\"\n />\n <span className=\"w-8 text-right text-sm text-muted-foreground\">\n {count}\n </span>\n </div>\n ))}\n </div>\n )}\n </div>\n\n {/* Reviews grid */}\n <div className=\"grid gap-4 sm:grid-cols-2\">\n {loading\n ? Array.from({ length: SKELETON_CARDS }).map((_, i) => (\n <Card key={i} className=\"gap-0 p-0 shadow-none\">\n <CardContent className=\"space-y-3 p-5\">\n <div className=\"flex items-center gap-2.5\">\n <Skeleton className=\"size-9 rounded-full\" />\n <div className=\"space-y-1.5\">\n <Skeleton className=\"h-4 w-24\" />\n <Skeleton className=\"h-3 w-16\" />\n </div>\n </div>\n <Skeleton className=\"h-4 w-full\" />\n <Skeleton className=\"h-4 w-4/5\" />\n </CardContent>\n </Card>\n ))\n : reviews.map((review) => (\n <Card\n key={review.id}\n className=\"gap-0 p-0 shadow-none\"\n >\n <CardContent className=\"space-y-3 p-5\">\n <div className=\"flex items-start justify-between gap-2\">\n <div className=\"flex items-center gap-2.5\">\n <Avatar className=\"size-9\">\n {review.author.avatarUrl && (\n <AvatarImage\n src={review.author.avatarUrl}\n alt={review.author.name}\n />\n )}\n <AvatarFallback className=\"text-xs\">\n {initials(review.author.name)}\n </AvatarFallback>\n </Avatar>\n <div>\n <div className=\"flex items-center gap-1.5\">\n <span className=\"text-sm font-medium\">\n {review.author.name}\n </span>\n {review.badgeLabel && (\n <Badge\n variant={badgeVariant}\n className=\"h-5 px-1.5 text-[0.625rem]\"\n >\n {review.badgeLabel}\n </Badge>\n )}\n </div>\n <p className=\"text-xs text-muted-foreground\">\n {review.date}\n </p>\n </div>\n </div>\n <Rating\n rate={review.rating}\n size=\"sm\"\n className={ratingClassName}\n />\n </div>\n\n <p className=\"line-clamp-4 text-sm leading-relaxed text-muted-foreground\">\n {review.content}\n </p>\n </CardContent>\n </Card>\n ))}\n </div>\n </div>\n )}\n </div>\n </section>\n );\n },\n);\nReviewsBlock.displayName = \"ReviewsBlock\";\n\nexport { ReviewsBlock };\n","import type * as React from \"react\";\n\n/**\n * The library's canonical testimonial payload, shared by every testimonial\n * layout (`TestimonialMasonry`, `TestimonialCarousel`). Consumers hold one\n * array of these and feed it to whichever block a page calls for; only the\n * presentation props differ per block.\n */\nexport interface TestimonialItem {\n /** Stable key for the testimonial card. */\n id: string;\n /** Quote body text. */\n content: React.ReactNode;\n author: {\n name: string;\n /** Role or company line under the name, e.g. \"Co-Founder, Heroes Digital\". */\n title?: React.ReactNode;\n /**\n * Custom avatar content — SVG, Lucide icon, Font Awesome glyph, etc.\n * Renders inside the shaped avatar shell. When omitted, `avatarUrl` or\n * initials from `name` are used instead.\n */\n avatar?: React.ReactNode;\n /** Profile photo URL. Ignored when `avatar` is set. */\n avatarUrl?: string;\n };\n}\n\n/** Two-letter initials fallback used when a testimonial has no avatar image. */\nexport function testimonialInitials(name: string): string {\n return name\n .split(\" \")\n .map((part) => part[0])\n .filter(Boolean)\n .slice(0, 2)\n .join(\"\")\n .toUpperCase();\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport {\n Avatar,\n AvatarFallback,\n AvatarImage,\n} from \"../../components/avatar\";\nimport { Button, type ButtonProps } from \"../../components/button\";\nimport {\n newTabAttributes,\n renderPlainLink,\n type RenderLink,\n} from \"../../lib/render-link\";\nimport {\n testimonialInitials,\n type TestimonialItem,\n} from \"./testimonial-types\";\n\nexport interface TestimonialMasonryLink {\n /** Link label, e.g. \"See All Customer Stories\". */\n label: React.ReactNode;\n /** Destination for the link. */\n href: string;\n /**\n * Open the link in a new tab (`target=\"_blank\"`, with `rel` set for\n * security) instead of navigating the current page. Defaults to `false`.\n */\n newTab?: boolean;\n /** Button variant for the call to action. Defaults to `\"default\"`. */\n variant?: ButtonProps[\"variant\"];\n /** Button size for the call to action. Defaults to `\"lg\"`. */\n size?: ButtonProps[\"size\"];\n}\n\nexport interface TestimonialMasonryProps\n extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n /** Testimonials rendered as cards in a responsive grid. */\n items: TestimonialItem[];\n /** Section heading. */\n title: React.ReactNode;\n /** Supporting copy under the heading. */\n description?: React.ReactNode;\n /**\n * Small label above the heading. A string renders as centered tagline text;\n * any other node renders as-is. Omit to hide the row.\n */\n eyebrow?: React.ReactNode;\n /**\n * Navigation target shown only when `items.length` reaches\n * `minItemsForFade` and the bottom fade is applied.\n */\n link?: TestimonialMasonryLink;\n /** Render the link through a router component instead of a plain `<a>`. */\n renderLink?: RenderLink;\n /**\n * Number of items at which the grid clips and the bottom fade appears.\n * Defaults to `7` (two full desktop rows of three, plus a partial third).\n */\n minItemsForFade?: number;\n /**\n * Number of items at which the grid height is clipped to `maxVisibleRows`\n * in addition to the fade. Defaults to `10` (four desktop rows). Between\n * `minItemsForFade` and this threshold the full grid stays visible so a\n * lone seventh card or a pair in the third row can center on desktop.\n */\n minItemsForClamp?: number;\n /**\n * Maximum number of rows to keep visible when the fade is active.\n * Defaults to `2`.\n */\n maxVisibleRows?: number;\n /** Classes for the inner container that constrains width and gutters. */\n containerClassName?: string;\n /** Classes for the eyebrow row. */\n eyebrowClassName?: string;\n /** Classes for the heading. */\n titleClassName?: string;\n /** Classes for the description. */\n descriptionClassName?: string;\n /** Classes for the grid wrapper (fade + overflow clip). */\n gridWrapperClassName?: string;\n /** Classes for the testimonial grid. */\n gridClassName?: string;\n /** Classes for each testimonial card. */\n cardClassName?: string;\n /** Classes for the quote body. */\n contentClassName?: string;\n /** Classes for the author name. */\n authorNameClassName?: string;\n /** Classes for the author title line. */\n authorTitleClassName?: string;\n /** Classes for the avatar shell on each card. */\n avatarClassName?: string;\n /**\n * Classes for the bottom fade overlay. Defaults to a gradient that matches\n * a section using `bg-accent`.\n */\n fadeClassName?: string;\n /** Classes for the link wrapper beneath the grid. */\n linkClassName?: string;\n}\n\nfunction groupCardsByRow(cards: Element[]): Map<number, Element[]> {\n const rows = new Map<number, Element[]>();\n for (const card of cards) {\n const top = Math.round(card.getBoundingClientRect().top);\n const row = rows.get(top) ?? [];\n row.push(card);\n rows.set(top, row);\n }\n return rows;\n}\n\nfunction measureClampHeight(\n cards: Element[],\n gridTop: number,\n maxVisibleRows: number,\n): number {\n const rows = groupCardsByRow(cards);\n const sortedTops = [...rows.keys()].sort((a, b) => a - b);\n const visibleTops = sortedTops.slice(0, maxVisibleRows);\n\n let bottom = gridTop;\n for (const top of visibleTops) {\n for (const card of rows.get(top) ?? []) {\n bottom = Math.max(bottom, card.getBoundingClientRect().bottom);\n }\n }\n\n return bottom - gridTop;\n}\n\nconst TestimonialMasonry = React.forwardRef<\n HTMLElement,\n TestimonialMasonryProps\n>(\n (\n {\n items,\n title,\n description,\n eyebrow,\n link,\n renderLink = renderPlainLink,\n minItemsForFade = 7,\n minItemsForClamp = 10,\n maxVisibleRows = 2,\n containerClassName,\n eyebrowClassName,\n titleClassName,\n descriptionClassName,\n gridWrapperClassName,\n gridClassName,\n cardClassName,\n contentClassName,\n authorNameClassName,\n authorTitleClassName,\n avatarClassName,\n fadeClassName,\n linkClassName,\n className,\n ...props\n },\n ref,\n ) => {\n const headingId = React.useId();\n const gridRef = React.useRef<HTMLUListElement>(null);\n const [clampHeight, setClampHeight] = React.useState<number>();\n const showFade = items.length >= minItemsForFade;\n\n React.useLayoutEffect(() => {\n const grid = gridRef.current;\n if (!grid) return;\n\n const measure = () => {\n if (items.length < minItemsForClamp) {\n setClampHeight(undefined);\n return;\n }\n\n const cards = Array.from(\n grid.querySelectorAll<HTMLElement>(\"[data-testimonial-card]\"),\n );\n if (cards.length === 0) {\n setClampHeight(undefined);\n return;\n }\n\n const gridTop = grid.getBoundingClientRect().top;\n setClampHeight(\n measureClampHeight(cards, gridTop, maxVisibleRows),\n );\n };\n\n measure();\n\n const observer = new ResizeObserver(measure);\n observer.observe(grid);\n window.addEventListener(\"resize\", measure);\n\n return () => {\n observer.disconnect();\n window.removeEventListener(\"resize\", measure);\n };\n }, [items, maxVisibleRows, minItemsForClamp]);\n\n return (\n <section\n ref={ref}\n aria-labelledby={props[\"aria-label\"] ? undefined : headingId}\n className={cn(\"bg-accent px-6 lg:px-0\", className)}\n {...props}\n >\n <div\n className={cn(\n \"mx-auto max-w-6xl px-0 py-16 sm:py-20 md:px-6 md:py-28\",\n containerClassName,\n )}\n >\n {eyebrow != null ? (\n typeof eyebrow === \"string\" ? (\n <p\n className={cn(\n \"mb-4 text-center text-sm font-normal leading-tight text-muted-foreground sm:text-base\",\n eyebrowClassName,\n )}\n >\n {eyebrow}\n </p>\n ) : (\n <div className={cn(\"mb-4 text-center\", eyebrowClassName)}>\n {eyebrow}\n </div>\n )\n ) : null}\n\n <h2\n id={headingId}\n className={cn(\n \"mx-auto max-w-4xl text-balance text-center text-3xl font-medium leading-tight tracking-tight sm:text-4xl md:text-5xl\",\n titleClassName,\n )}\n >\n {title}\n </h2>\n\n {description ? (\n <p\n className={cn(\n \"mx-auto mt-4 max-w-2xl text-center text-base font-normal text-muted-foreground sm:text-lg\",\n descriptionClassName,\n )}\n >\n {description}\n </p>\n ) : null}\n\n <div\n className={cn(\"relative mt-10 md:mt-14\", gridWrapperClassName)}\n style={\n clampHeight != null\n ? { maxHeight: clampHeight, overflow: \"hidden\" }\n : undefined\n }\n >\n {showFade ? (\n <div\n aria-hidden\n className={cn(\n \"pointer-events-none absolute inset-x-0 bottom-0 z-10 h-24 bg-gradient-to-t from-accent to-accent/0\",\n fadeClassName,\n )}\n />\n ) : null}\n\n <ul\n ref={gridRef}\n className={cn(\"flex flex-wrap justify-center gap-4\", gridClassName)}\n >\n {items.map((item) => (\n <li\n key={item.id}\n data-testimonial-card\n className={cn(\n \"flex w-full flex-col justify-between rounded-2xl bg-card p-6\",\n \"sm:w-[calc((100%-1rem)/2)]\",\n \"lg:w-[calc((100%-2rem)/3)]\",\n cardClassName,\n )}\n >\n <p\n className={cn(\n \"text-base font-normal leading-relaxed\",\n contentClassName,\n )}\n >\n {item.content}\n </p>\n\n <div className=\"mt-6 flex items-center gap-3\">\n <Avatar className={cn(\"size-9\", avatarClassName)}>\n {item.author.avatar ? (\n <AvatarFallback className=\"text-xs\">\n {item.author.avatar}\n </AvatarFallback>\n ) : (\n <>\n {item.author.avatarUrl ? (\n <AvatarImage\n src={item.author.avatarUrl}\n alt={item.author.name}\n />\n ) : null}\n <AvatarFallback className=\"text-xs\">\n {testimonialInitials(item.author.name)}\n </AvatarFallback>\n </>\n )}\n </Avatar>\n\n <div>\n <div\n className={cn(\n \"mb-0.5 text-base font-medium leading-tight\",\n authorNameClassName,\n )}\n >\n {item.author.name}\n </div>\n {item.author.title ? (\n <div\n className={cn(\n \"text-sm font-normal text-muted-foreground\",\n authorTitleClassName,\n )}\n >\n {item.author.title}\n </div>\n ) : null}\n </div>\n </div>\n </li>\n ))}\n </ul>\n </div>\n\n {showFade && link ? (\n <div\n className={cn(\n \"relative z-20 -mt-6 flex justify-center transition-all duration-300\",\n linkClassName,\n )}\n >\n <Button\n asChild\n variant={link.variant ?? \"default\"}\n size={link.size ?? \"lg\"}\n >\n {renderLink({\n href: link.href,\n ...newTabAttributes(link.newTab),\n children: link.label,\n })}\n </Button>\n </div>\n ) : null}\n </div>\n </section>\n );\n },\n);\nTestimonialMasonry.displayName = \"TestimonialMasonry\";\n\nexport { TestimonialMasonry };\nexport type { TestimonialItem };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport type { ButtonProps } from \"../../components/button\";\nimport {\n Avatar,\n AvatarFallback,\n AvatarImage,\n} from \"../../components/avatar\";\nimport {\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselNext,\n CarouselPrevious,\n} from \"../../components/carousel\";\nimport {\n testimonialInitials,\n type TestimonialItem,\n} from \"./testimonial-types\";\n\n/**\n * Styling and content for one of the two carousel arrows. Every field is\n * optional — omit the whole object and the arrow renders with the block's\n * defaults (outline variant, icon size, a directional arrow, and a sensible\n * accessible name).\n */\nexport interface TestimonialCarouselNav {\n /**\n * Accessible name for the icon-only button. Defaults to \"Previous\n * testimonial\" / \"Next testimonial\".\n */\n label?: string;\n /** Icon rendered inside the button. Defaults to a directional arrow. */\n icon?: React.ReactNode;\n /** Button variant. Defaults to `\"outline\"`. */\n variant?: ButtonProps[\"variant\"];\n /** Button size. Defaults to `\"icon\"`. */\n size?: ButtonProps[\"size\"];\n /** Classes merged onto the button, overriding the defaults. */\n className?: string;\n}\n\nexport interface TestimonialCarouselProps\n extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n /** Testimonials rendered as slides in the carousel. */\n items: TestimonialItem[];\n /** Section heading, shown on the left of the header row. */\n title: React.ReactNode;\n /** Supporting copy under the heading. */\n description?: React.ReactNode;\n /**\n * Small label above the heading. A string renders as tagline text; any\n * other node renders as-is. Omit to hide the row.\n */\n eyebrow?: React.ReactNode;\n /**\n * Wrap from the last slide back to the first. Defaults to `false`, which\n * disables the arrows at each end.\n */\n loop?: boolean;\n /**\n * Slides advanced per arrow press. Defaults to `1`; pass `\"auto\"` to\n * advance by a full viewport of cards.\n */\n slidesToScroll?: number | \"auto\";\n /** Label, icon, and styling for the previous arrow. */\n previousButton?: TestimonialCarouselNav;\n /** Label, icon, and styling for the next arrow. */\n nextButton?: TestimonialCarouselNav;\n /** Hide the prev/next arrows. Dragging and keyboard still work. */\n hideControls?: boolean;\n /** Classes for the inner container that constrains width and gutters. */\n containerClassName?: string;\n /** Classes for the header row holding the copy and the arrows. */\n headerClassName?: string;\n /**\n * Classes for the header copy column (eyebrow, heading, description).\n * Defaults to `max-w-2xl`, which keeps the heading to a comfortable\n * measure. Pass `max-w-none` to let it run the full width up to the\n * arrows, or any other `max-w-*` to pick a different cap.\n */\n headerCopyClassName?: string;\n /** Classes for the eyebrow row. */\n eyebrowClassName?: string;\n /** Classes for the heading. */\n titleClassName?: string;\n /** Classes for the description. */\n descriptionClassName?: string;\n /** Classes for the arrow group. */\n controlsClassName?: string;\n /** Classes for the carousel root. */\n carouselClassName?: string;\n /** Classes for each slide wrapper (controls the per-breakpoint basis). */\n slideClassName?: string;\n /** Classes for each testimonial card. */\n cardClassName?: string;\n /** Classes for the quote body. */\n contentClassName?: string;\n /** Classes for the author name. */\n authorNameClassName?: string;\n /** Classes for the author title line. */\n authorTitleClassName?: string;\n /** Classes for the avatar shell on each card. */\n avatarClassName?: string;\n}\n\nconst TestimonialCarousel = React.forwardRef<\n HTMLElement,\n TestimonialCarouselProps\n>(\n (\n {\n items,\n title,\n description,\n eyebrow,\n loop = false,\n slidesToScroll = 1,\n previousButton,\n nextButton,\n hideControls = false,\n containerClassName,\n headerClassName,\n headerCopyClassName,\n eyebrowClassName,\n titleClassName,\n descriptionClassName,\n controlsClassName,\n carouselClassName,\n slideClassName,\n cardClassName,\n contentClassName,\n authorNameClassName,\n authorTitleClassName,\n avatarClassName,\n className,\n ...props\n },\n ref,\n ) => {\n const headingId = React.useId();\n\n return (\n <section\n ref={ref}\n aria-labelledby={props[\"aria-label\"] ? undefined : headingId}\n className={cn(\"px-6 lg:px-0\", className)}\n {...props}\n >\n <div\n className={cn(\n \"mx-auto max-w-6xl px-0 py-16 sm:py-20 md:px-6 md:py-28\",\n containerClassName,\n )}\n >\n <Carousel\n opts={{ loop, slidesToScroll, align: \"start\" }}\n className={cn(\"w-full\", carouselClassName)}\n >\n <div\n className={cn(\n \"mb-8 flex flex-col gap-6 md:mb-12 md:flex-row md:items-end md:justify-between\",\n headerClassName,\n )}\n >\n <div\n className={cn(\n \"min-w-0 flex-1 max-w-2xl\",\n headerCopyClassName,\n )}\n >\n {eyebrow != null ? (\n typeof eyebrow === \"string\" ? (\n <p\n className={cn(\n \"mb-4 text-sm font-normal leading-tight text-muted-foreground sm:text-base\",\n eyebrowClassName,\n )}\n >\n {eyebrow}\n </p>\n ) : (\n <div className={cn(\"mb-4\", eyebrowClassName)}>{eyebrow}</div>\n )\n ) : null}\n\n <h2\n id={headingId}\n className={cn(\n \"text-balance text-3xl font-medium leading-tight tracking-tight sm:text-4xl md:text-5xl\",\n titleClassName,\n )}\n >\n {title}\n </h2>\n\n {description ? (\n <p\n className={cn(\n \"mt-4 text-base font-normal text-muted-foreground sm:text-lg\",\n descriptionClassName,\n )}\n >\n {description}\n </p>\n ) : null}\n </div>\n\n {hideControls ? null : (\n <div\n className={cn(\n \"flex shrink-0 items-center gap-2\",\n controlsClassName,\n )}\n >\n <CarouselPrevious\n label={previousButton?.label ?? \"Previous testimonial\"}\n icon={previousButton?.icon}\n variant={previousButton?.variant}\n size={previousButton?.size}\n className={previousButton?.className}\n />\n <CarouselNext\n label={nextButton?.label ?? \"Next testimonial\"}\n icon={nextButton?.icon}\n variant={nextButton?.variant}\n size={nextButton?.size}\n className={nextButton?.className}\n />\n </div>\n )}\n </div>\n\n <CarouselContent className=\"-ml-4\">\n {items.map((item) => (\n <CarouselItem\n key={item.id}\n className={cn(\n \"basis-full pl-4 md:basis-1/2 lg:basis-1/3\",\n slideClassName,\n )}\n >\n <figure\n className={cn(\n \"flex h-full flex-col justify-between rounded-2xl border bg-card p-6\",\n cardClassName,\n )}\n >\n <blockquote\n className={cn(\n \"text-base font-normal leading-relaxed text-muted-foreground\",\n contentClassName,\n )}\n >\n {item.content}\n </blockquote>\n\n <figcaption className=\"mt-6 flex items-center gap-3\">\n <Avatar\n className={cn(\n \"size-9 ring-1 ring-border\",\n avatarClassName,\n )}\n >\n {item.author.avatar ? (\n <AvatarFallback className=\"text-xs\">\n {item.author.avatar}\n </AvatarFallback>\n ) : (\n <>\n {item.author.avatarUrl ? (\n <AvatarImage\n src={item.author.avatarUrl}\n alt={item.author.name}\n />\n ) : null}\n <AvatarFallback className=\"text-xs\">\n {testimonialInitials(item.author.name)}\n </AvatarFallback>\n </>\n )}\n </Avatar>\n\n <div>\n <div\n className={cn(\n \"mb-0.5 text-base font-medium leading-tight\",\n authorNameClassName,\n )}\n >\n {item.author.name}\n </div>\n {item.author.title ? (\n <div\n className={cn(\n \"text-sm font-normal text-muted-foreground\",\n authorTitleClassName,\n )}\n >\n {item.author.title}\n </div>\n ) : null}\n </div>\n </figcaption>\n </figure>\n </CarouselItem>\n ))}\n </CarouselContent>\n </Carousel>\n </div>\n </section>\n );\n },\n);\nTestimonialCarousel.displayName = \"TestimonialCarousel\";\n\nexport { TestimonialCarousel };\nexport type { TestimonialItem };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Badge, type BadgeProps } from \"../../components/badge\";\nimport { Avatar, AvatarImage, AvatarFallback } from \"../../components/avatar\";\n\nexport interface ResourceCategoryStyle {\n /** One of the library's curated Badge tones. */\n variant?: BadgeProps[\"variant\"];\n /** Escape hatch for a category color outside the curated tones. */\n className?: string;\n}\n\nexport interface ResourceAuthor {\n name: string;\n /** Avatar image URL; falls back to initials when omitted. */\n avatarUrl?: string;\n /** Custom avatar node, overrides avatarUrl when provided. */\n avatar?: React.ReactNode;\n}\n\nexport interface ResourceItem {\n /** Stable key for the item. */\n id: string;\n /** Card heading. */\n header: string;\n /** Optional supporting copy. */\n subtext?: string;\n /** Image URL or a custom node (e.g. `next/image`). */\n image?: string | React.ReactNode;\n /** Alt text used when `image` is a URL string. */\n imageAlt?: string;\n /**\n * Background styling (solid color/gradient) for the image area when no\n * image is set. When `cardVariant=\"overlay\"` and an image *is* set, this\n * doubles as a custom scrim/tint layer rendered on top of the image\n * (e.g. a gradient for text legibility) — see also `scrim`.\n */\n backgroundClass?: string;\n /**\n * When `cardVariant=\"overlay\"` and an image is set, applies a built-in\n * dark gradient scrim automatically. Ignored if `backgroundClass` is also\n * set (`backgroundClass` wins). Defaults to `false` — never forced.\n */\n scrim?: boolean;\n /** Preformatted, human-readable date. */\n date: string;\n author: ResourceAuthor;\n /** Category/tag labels, looked up against `categoryStyles`. */\n categories?: string[];\n /** URL for the card link. Renders the card as an anchor when set. */\n href?: string;\n /**\n * Anchor `target` for `href`. Defaults to `\"_self\"` (same tab). Setting\n * `\"_blank\"` also adds `rel=\"noopener noreferrer\"`.\n */\n target?: \"_self\" | \"_blank\";\n /** Click handler used when no `href` is provided; renders the card as a button. */\n onClick?: () => void;\n}\n\nexport interface ResourcesBlockProps\n extends React.HTMLAttributes<HTMLElement> {\n /** Section heading. Defaults to \"Resources & Whitepapers\". */\n title?: string;\n subtitle?: string;\n /** The highlighted resource, rendered above the grid. */\n featured: ResourceItem;\n /** The remaining resources, rendered as a grid. */\n resources: ResourceItem[];\n /** Maps category labels to a consistent Badge tone or custom class. */\n categoryStyles?: Record<string, ResourceCategoryStyle>;\n /**\n * Curated card look. `\"default\"` (the initial look): image on top,\n * content below. `\"overlay\"`: the image fills the whole card and the\n * same content (categories, header, subtext, meta) floats on top of it —\n * see `ResourceItem.backgroundClass` and `ResourceItem.scrim` for scrim\n * control. Defaults to `\"default\"`.\n */\n cardVariant?: \"default\" | \"overlay\";\n}\n\ntype CardVariant = \"default\" | \"overlay\";\n\nfunction initials(name: string): string {\n return name\n .split(\" \")\n .map((n) => n[0])\n .filter(Boolean)\n .slice(0, 2)\n .join(\"\")\n .toUpperCase();\n}\n\nfunction ResourceImage({\n item,\n className,\n}: {\n item: ResourceItem;\n className?: string;\n}) {\n if (typeof item.image === \"string\") {\n return (\n <img\n src={item.image}\n alt={item.imageAlt ?? \"\"}\n className={cn(\"h-full w-full object-cover\", className)}\n />\n );\n }\n if (item.image) {\n return <>{item.image}</>;\n }\n return (\n <div\n className={cn(\n \"h-full w-full\",\n item.backgroundClass ?? \"bg-muted\",\n className,\n )}\n />\n );\n}\n\nfunction ResourceCategories({\n item,\n categoryStyles,\n}: {\n item: ResourceItem;\n categoryStyles?: Record<string, ResourceCategoryStyle>;\n}) {\n if (!item.categories || item.categories.length === 0) return null;\n return (\n <div className=\"flex flex-wrap gap-1.5\">\n {item.categories.map((category) => {\n const style = categoryStyles?.[category];\n return (\n <Badge\n key={category}\n variant={style?.variant ?? \"secondary\"}\n className={style?.className}\n >\n {category}\n </Badge>\n );\n })}\n </div>\n );\n}\n\nfunction ResourceMeta({\n item,\n tone = \"default\",\n}: {\n item: ResourceItem;\n tone?: \"default\" | \"light\";\n}) {\n const mutedClass = tone === \"light\" ? \"text-white/75\" : \"text-muted-foreground\";\n return (\n <div className=\"flex items-center gap-2.5\">\n <Avatar className=\"size-8\">\n {item.author.avatar ? (\n item.author.avatar\n ) : (\n <>\n {item.author.avatarUrl && (\n <AvatarImage src={item.author.avatarUrl} alt={item.author.name} />\n )}\n <AvatarFallback className=\"text-xs\">\n {initials(item.author.name)}\n </AvatarFallback>\n </>\n )}\n </Avatar>\n <div className=\"text-sm\">\n <span className={cn(\"font-medium\", tone === \"light\" && \"text-white\")}>\n {item.author.name}\n </span>\n <span className={mutedClass} aria-hidden>\n {\" \"}\n &middot;{\" \"}\n </span>\n <span className={mutedClass}>{item.date}</span>\n </div>\n </div>\n );\n}\n\n/**\n * The scrim/tint layer for `cardVariant=\"overlay\"` cards: an explicit\n * `backgroundClass` always wins, otherwise `scrim: true` opts into a\n * built-in default — applied whether or not there's an image, so a\n * consumer who wants every card in the block to read the same \"dark card\"\n * way (not just the ones with photos) can just set `scrim: true`\n * everywhere. The one exception is `backgroundClass` with no image: there,\n * `ResourceImage` already renders it as the card's own background, so a\n * second copy here would just duplicate it.\n */\nfunction ResourceScrim({\n item,\n cardVariant,\n}: {\n item: ResourceItem;\n cardVariant: CardVariant;\n}) {\n if (cardVariant !== \"overlay\") return null;\n if (item.backgroundClass) {\n if (!item.image) return null;\n return (\n <div\n aria-hidden\n data-resource-scrim=\"true\"\n className={cn(\"absolute inset-0\", item.backgroundClass)}\n />\n );\n }\n if (item.scrim) {\n return (\n <div\n aria-hidden\n data-resource-scrim=\"true\"\n className=\"absolute inset-0 bg-gradient-to-t from-black/85 to-black/55\"\n />\n );\n }\n return null;\n}\n\n/** Renders the card wrapper as an anchor, a button, or a plain div, depending on which action props are set. */\nfunction ResourceCardWrapper({\n item,\n className,\n cardVariant,\n children,\n}: {\n item: ResourceItem;\n className?: string;\n cardVariant: CardVariant;\n children: React.ReactNode;\n}) {\n const dataAttrs = {\n \"data-resource-id\": item.id,\n ...(cardVariant === \"overlay\" && { \"data-card-variant\": \"overlay\" as const }),\n };\n if (item.href) {\n return (\n <a\n href={item.href}\n target={item.target === \"_blank\" ? \"_blank\" : undefined}\n rel={item.target === \"_blank\" ? \"noopener noreferrer\" : undefined}\n aria-label={item.header}\n {...dataAttrs}\n className={cn(\n \"block focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2\",\n className,\n )}\n >\n {children}\n </a>\n );\n }\n if (item.onClick) {\n return (\n <button\n type=\"button\"\n aria-label={item.header}\n onClick={item.onClick}\n {...dataAttrs}\n className={cn(\n \"block w-full text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2\",\n className,\n )}\n >\n {children}\n </button>\n );\n }\n return (\n <div className={className} {...dataAttrs}>\n {children}\n </div>\n );\n}\n\nfunction OverlayCardBody({\n item,\n categoryStyles,\n headingClassName,\n}: {\n item: ResourceItem;\n categoryStyles?: Record<string, ResourceCategoryStyle>;\n headingClassName?: string;\n}) {\n // Light text is only legible when something dark is actually behind it —\n // a photo, a consumer-supplied background, or the scrim itself (which\n // now renders even without an image). With none of those, the card is\n // just the light `bg-muted` fill, where forced white text would be\n // unreadable.\n const tone =\n item.image || item.backgroundClass || item.scrim ? \"light\" : \"default\";\n return (\n <>\n <div className=\"absolute inset-0\">\n <ResourceImage item={item} />\n </div>\n <ResourceScrim item={item} cardVariant=\"overlay\" />\n <div className=\"relative flex h-full min-w-0 flex-col justify-between gap-4 p-6\">\n <ResourceCategories item={item} categoryStyles={categoryStyles} />\n <div className=\"min-w-0 space-y-2\">\n <h3\n className={cn(\n \"line-clamp-2 font-semibold tracking-tight\",\n tone === \"light\" ? \"text-white\" : \"text-foreground\",\n headingClassName,\n )}\n >\n {item.header}\n </h3>\n {item.subtext && (\n <p\n className={cn(\n \"line-clamp-2 text-sm\",\n tone === \"light\" ? \"text-white/80\" : \"text-muted-foreground\",\n )}\n >\n {item.subtext}\n </p>\n )}\n <ResourceMeta item={item} tone={tone} />\n </div>\n </div>\n </>\n );\n}\n\nfunction FeaturedResourceCard({\n item,\n categoryStyles,\n cardVariant = \"default\",\n}: {\n item: ResourceItem;\n categoryStyles?: Record<string, ResourceCategoryStyle>;\n cardVariant?: CardVariant;\n}) {\n if (cardVariant === \"overlay\") {\n return (\n <ResourceCardWrapper\n item={item}\n cardVariant={cardVariant}\n className=\"group relative min-h-[24rem] overflow-hidden rounded-lg shadow-sm transition-shadow hover:shadow-md\"\n >\n <OverlayCardBody\n item={item}\n categoryStyles={categoryStyles}\n headingClassName=\"text-xl md:text-2xl\"\n />\n </ResourceCardWrapper>\n );\n }\n\n return (\n <ResourceCardWrapper\n item={item}\n cardVariant={cardVariant}\n className=\"group overflow-hidden rounded-lg border bg-card text-card-foreground shadow-sm transition-shadow hover:shadow-md\"\n >\n <div className=\"aspect-[16/9] w-full overflow-hidden\">\n <ResourceImage item={item} />\n </div>\n <div className=\"space-y-4 p-6\">\n <ResourceCategories item={item} categoryStyles={categoryStyles} />\n <div className=\"space-y-2\">\n <h3 className=\"text-xl font-semibold tracking-tight md:text-2xl\">\n {item.header}\n </h3>\n {item.subtext && (\n <p className=\"text-muted-foreground\">{item.subtext}</p>\n )}\n </div>\n <ResourceMeta item={item} />\n </div>\n </ResourceCardWrapper>\n );\n}\n\nfunction ResourceListCard({\n item,\n categoryStyles,\n cardVariant = \"default\",\n}: {\n item: ResourceItem;\n categoryStyles?: Record<string, ResourceCategoryStyle>;\n cardVariant?: CardVariant;\n}) {\n if (cardVariant === \"overlay\") {\n return (\n <ResourceCardWrapper\n item={item}\n cardVariant={cardVariant}\n className=\"group relative aspect-[2/1] min-h-[14rem] overflow-hidden rounded-lg shadow-sm transition-shadow hover:shadow-md\"\n >\n <OverlayCardBody item={item} categoryStyles={categoryStyles} />\n </ResourceCardWrapper>\n );\n }\n\n return (\n <ResourceCardWrapper\n item={item}\n cardVariant={cardVariant}\n className=\"group flex flex-1 gap-4 rounded-lg border bg-card p-4 text-card-foreground shadow-sm transition-shadow hover:shadow-md\"\n >\n <div className=\"aspect-square w-24 shrink-0 overflow-hidden rounded-md\">\n <ResourceImage item={item} />\n </div>\n <div\n data-resource-content\n className=\"flex min-w-0 flex-1 flex-col justify-between gap-2\"\n >\n <div className=\"space-y-1.5\">\n <ResourceCategories item={item} categoryStyles={categoryStyles} />\n <div>\n <h3 className=\"font-semibold tracking-tight\">{item.header}</h3>\n {item.subtext && (\n <p className=\"line-clamp-2 text-sm text-muted-foreground\">\n {item.subtext}\n </p>\n )}\n </div>\n </div>\n <ResourceMeta item={item} />\n </div>\n </ResourceCardWrapper>\n );\n}\n\nconst ResourcesBlock = React.forwardRef<HTMLElement, ResourcesBlockProps>(\n (\n {\n title = \"Resources & Whitepapers\",\n subtitle,\n featured,\n resources,\n categoryStyles,\n cardVariant = \"default\",\n className,\n ...props\n },\n ref,\n ) => {\n return (\n <section\n ref={ref}\n className={cn(\"py-16 md:py-24\", className)}\n {...props}\n >\n <div className=\"mx-auto max-w-6xl px-4 sm:px-6\">\n <div className=\"mb-8 max-w-2xl md:mb-12\">\n <h2 className=\"text-2xl font-semibold tracking-tight md:text-3xl\">\n {title}\n </h2>\n {subtitle && (\n <p className=\"mt-2 text-muted-foreground\">{subtitle}</p>\n )}\n </div>\n\n <div className=\"grid gap-8 lg:grid-cols-2 lg:items-stretch\">\n <FeaturedResourceCard\n item={featured}\n categoryStyles={categoryStyles}\n cardVariant={cardVariant}\n />\n <div className=\"flex flex-col gap-6\">\n {resources.map((resource) => (\n <ResourceListCard\n key={resource.id}\n item={resource}\n categoryStyles={categoryStyles}\n cardVariant={cardVariant}\n />\n ))}\n </div>\n </div>\n </div>\n </section>\n );\n },\n);\nResourcesBlock.displayName = \"ResourcesBlock\";\n\nexport { ResourcesBlock };\n","\"use client\";\n\nimport * as React from \"react\";\nimport {\n Facebook,\n Instagram,\n Linkedin,\n Twitter,\n Youtube,\n} from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\n/** Platforms with a built-in icon and label. */\nexport type SocialPlatform =\n | \"instagram\"\n | \"tiktok\"\n | \"facebook\"\n | \"x\"\n | \"youtube\"\n | \"linkedin\";\n\n/** Footprint a cell occupies in the square grid. */\nexport type SocialFeedTileSize = \"square\" | \"wide\" | \"tall\" | \"large\";\n\nexport interface SocialPostItem {\n /** Stable key for the item. */\n id: string;\n /** Image URL or a custom node (e.g. `next/image`). */\n image?: string | React.ReactNode;\n /**\n * Alt text used when `image` is a URL string. This is also the tile's\n * accessible name when it links out, so prefer describing the post over\n * leaving it empty.\n */\n imageAlt?: string;\n /** URL for the tile. Renders the tile as an anchor when set. */\n href?: string;\n /**\n * Anchor `target` for `href`. Defaults to `\"_blank\"`, since social posts\n * live off-site. `\"_blank\"` also adds `rel=\"noopener noreferrer\"`.\n */\n target?: \"_self\" | \"_blank\";\n /** Click handler used when no `href` is provided; renders the tile as a button. */\n onClick?: () => void;\n /**\n * Platform badge. A known key renders the built-in icon + label; any other\n * node renders as-is. Omit to hide the badge.\n */\n platform?: SocialPlatform | React.ReactNode;\n /** Overrides the badge label for a known platform. */\n platformLabel?: React.ReactNode;\n /**\n * Replaces the entire tile body — the escape hatch for a video embed, a\n * text-only post, or anything else that isn't a photo.\n */\n content?: React.ReactNode;\n /** Background styling for the tile when no `image` is set. */\n backgroundClass?: string;\n /** Per-tile class override. */\n className?: string;\n}\n\nexport interface SocialFeedBlockProps\n extends React.HTMLAttributes<HTMLElement> {\n /** Posts rendered as square tiles. */\n items: SocialPostItem[];\n /**\n * The intro cell. Renders **nothing** when omitted — no wrapper, no\n * placeholder; the posts pack forward into the space via dense flow. The\n * cell carries no appearance of its own, so style it entirely through\n * `introClassName`.\n */\n intro?: React.ReactNode;\n /** Intro footprint. Defaults to `\"large\"` (2×2 from `sm` up, full width below). */\n introSize?: SocialFeedTileSize;\n /** Curated column ladder. `6` → 2/4/6, `4` → 2/3/4. Defaults to `6`. */\n columns?: 4 | 6;\n /** Gap preset. Defaults to `\"sm\"`. */\n gap?: \"sm\" | \"md\" | \"lg\";\n /** Hover/focus treatment on image tiles. Defaults to `\"zoom\"`. */\n hoverEffect?: \"zoom\" | \"none\";\n /** Truncates a feed of unknown length, e.g. one coming from a CMS. */\n maxItems?: number;\n /** Classes for the inner container that constrains width and gutters. */\n containerClassName?: string;\n /** Classes for the grid itself. */\n gridClassName?: string;\n /** Classes for the intro cell — this is where the intro's whole look comes from. */\n introClassName?: string;\n /** Classes applied to every post tile. */\n tileClassName?: string;\n /** Classes for the tile image. */\n imageClassName?: string;\n /** Classes for the hover scrim. */\n overlayClassName?: string;\n /** Classes for the platform badge. */\n badgeClassName?: string;\n}\n\n/** TikTok has no lucide icon, so it ships as a path of its own. */\nfunction TikTokIcon({ className }: { className?: string }) {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n aria-hidden\n className={className}\n >\n <path d=\"M16.6 5.82A4.28 4.28 0 0 1 15.54 3h-3.09v12.4a2.59 2.59 0 0 1-2.59 2.5 2.59 2.59 0 1 1 .77-5.06V9.69a5.67 5.67 0 0 0-.77-.05A5.68 5.68 0 1 0 15.54 15.4V9.01a7.35 7.35 0 0 0 4.3 1.38V7.3a4.29 4.29 0 0 1-3.24-1.48Z\" />\n </svg>\n );\n}\n\nconst PLATFORM_META: Record<\n SocialPlatform,\n { label: string; Icon: React.ComponentType<{ className?: string }> }\n> = {\n instagram: { label: \"Instagram\", Icon: Instagram },\n tiktok: { label: \"TikTok\", Icon: TikTokIcon },\n facebook: { label: \"Facebook\", Icon: Facebook },\n x: { label: \"X\", Icon: Twitter },\n youtube: { label: \"YouTube\", Icon: Youtube },\n linkedin: { label: \"LinkedIn\", Icon: Linkedin },\n};\n\nfunction isKnownPlatform(value: unknown): value is SocialPlatform {\n return typeof value === \"string\" && value in PLATFORM_META;\n}\n\n/**\n * Span classes per footprint. Below `sm` the grid is only two columns wide,\n * so `wide` and `large` fill the row rather than trying to span more columns\n * than exist, and `large` holds off on its second row until there is room for\n * the square it is meant to be.\n */\nconst TILE_SPAN: Record<SocialFeedTileSize, string> = {\n square: \"\",\n wide: \"col-span-2\",\n tall: \"row-span-2\",\n large: \"col-span-2 sm:row-span-2\",\n};\n\nconst COLUMN_CLASS: Record<4 | 6, string> = {\n 4: \"grid-cols-2 sm:grid-cols-3 lg:grid-cols-4\",\n 6: \"grid-cols-2 sm:grid-cols-4 lg:grid-cols-6\",\n};\n\nconst GAP_CLASS = {\n sm: \"gap-2\",\n md: \"gap-3\",\n lg: \"gap-4\",\n} as const;\n\nfunction SocialPostBadge({\n item,\n className,\n}: {\n item: SocialPostItem;\n className?: string;\n}) {\n if (item.platform == null) return null;\n\n const badgeClass = cn(\n \"absolute right-2 top-2 z-10 inline-flex items-center gap-1 rounded-full bg-background/85 px-2.5 py-1.5 text-xs font-medium text-foreground backdrop-blur-sm\",\n className,\n );\n\n if (!isKnownPlatform(item.platform)) {\n return <span className={badgeClass}>{item.platform}</span>;\n }\n\n const { label, Icon } = PLATFORM_META[item.platform];\n return (\n <span className={badgeClass}>\n <Icon className=\"size-3.5\" />\n {/*\n * The label is the tile's fallback accessible name when `imageAlt` is\n * empty, so it stays in the accessibility tree at every width and only\n * its visual presentation changes.\n */}\n <span className=\"sr-only sm:not-sr-only\">\n {item.platformLabel ?? label}\n </span>\n </span>\n );\n}\n\nfunction SocialPostBody({\n item,\n hoverEffect,\n imageClassName,\n overlayClassName,\n badgeClassName,\n}: {\n item: SocialPostItem;\n hoverEffect: \"zoom\" | \"none\";\n imageClassName?: string;\n overlayClassName?: string;\n badgeClassName?: string;\n}) {\n return (\n <>\n {/*\n * The square comes from a spacer in normal flow rather than an\n * `aspect-square` on the tile itself. An aspect ratio would pin the\n * tile's height and stop it stretching, so a row made taller by an\n * intro whose content outgrows its footprint would leave dead space\n * under every square beside it. As a spacer the square is a floor: the\n * tile still stretches to whatever height its row settles on, and the\n * body below fills it.\n */}\n <span aria-hidden className=\"block aspect-square\" />\n\n <div className=\"absolute inset-0\">\n {item.content ?? (\n <>\n {typeof item.image === \"string\" ? (\n <img\n src={item.image}\n alt={item.imageAlt ?? \"\"}\n loading=\"lazy\"\n decoding=\"async\"\n className={cn(\n \"h-full w-full object-cover transition-transform duration-300\",\n hoverEffect === \"zoom\" &&\n \"group-hover:scale-[1.045] group-focus-visible:scale-[1.045]\",\n imageClassName,\n )}\n />\n ) : item.image ? (\n item.image\n ) : (\n <div\n className={cn(\n \"h-full w-full\",\n item.backgroundClass ?? \"bg-muted\",\n imageClassName,\n )}\n />\n )}\n\n <ScrimOverlay className={overlayClassName} />\n </>\n )}\n </div>\n\n <SocialPostBadge item={item} className={badgeClassName} />\n </>\n );\n}\n\nfunction ScrimOverlay({ className }: { className?: string }) {\n return (\n <div\n aria-hidden\n className={cn(\n \"pointer-events-none absolute inset-0 bg-gradient-to-t from-foreground/35 to-transparent opacity-0 transition-opacity duration-200\",\n \"group-hover:opacity-100 group-focus-visible:opacity-100\",\n className,\n )}\n />\n );\n}\n\nconst SocialFeedBlock = React.forwardRef<HTMLElement, SocialFeedBlockProps>(\n (\n {\n items,\n intro,\n introSize = \"large\",\n columns = 6,\n gap = \"sm\",\n hoverEffect = \"zoom\",\n maxItems,\n className,\n containerClassName,\n gridClassName,\n introClassName,\n tileClassName,\n imageClassName,\n overlayClassName,\n badgeClassName,\n ...props\n },\n ref,\n ) => {\n const visible = maxItems != null ? items.slice(0, maxItems) : items;\n\n // A feed that a CMS has not filled yet renders nothing at all, rather\n // than an empty grid holding open the space of a section with no content.\n if (visible.length === 0 && intro == null) return null;\n\n return (\n <section\n ref={ref}\n aria-label={\n props[\"aria-labelledby\"] ? undefined : (props[\"aria-label\"] ?? \"Social feed\")\n }\n className={cn(\"py-12 lg:py-16\", className)}\n {...props}\n >\n <div\n className={cn(\"mx-auto max-w-7xl px-4 sm:px-10\", containerClassName)}\n >\n <div\n className={cn(\n \"grid grid-flow-row-dense\",\n COLUMN_CLASS[columns],\n GAP_CLASS[gap],\n gridClassName,\n )}\n >\n {intro != null ? (\n <div className={cn(TILE_SPAN[introSize], introClassName)}>\n {intro}\n </div>\n ) : null}\n\n {visible.map((item) => {\n const body = (\n <SocialPostBody\n item={item}\n hoverEffect={hoverEffect}\n imageClassName={imageClassName}\n overlayClassName={overlayClassName}\n badgeClassName={badgeClassName}\n />\n );\n\n const tileClass = cn(\n \"group relative block overflow-hidden rounded-2xl bg-card\",\n tileClassName,\n item.className,\n );\n const interactiveClass =\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2\";\n\n if (item.href) {\n const target = item.target ?? \"_blank\";\n return (\n <a\n key={item.id}\n href={item.href}\n target={target}\n rel={target === \"_blank\" ? \"noopener noreferrer\" : undefined}\n className={cn(tileClass, interactiveClass)}\n >\n {body}\n </a>\n );\n }\n\n if (item.onClick) {\n return (\n <button\n key={item.id}\n type=\"button\"\n onClick={item.onClick}\n className={cn(tileClass, interactiveClass, \"text-left\")}\n >\n {body}\n </button>\n );\n }\n\n return (\n <div key={item.id} className={tileClass}>\n {body}\n </div>\n );\n })}\n </div>\n </div>\n </section>\n );\n },\n);\nSocialFeedBlock.displayName = \"SocialFeedBlock\";\n\nexport { SocialFeedBlock };\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Camera } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { Input } from \"../../components/input\";\nimport { Label } from \"../../components/label\";\nimport { Textarea } from \"../../components/textarea\";\nimport { Avatar, AvatarImage, AvatarFallback } from \"../../components/avatar\";\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from \"../../components/card\";\nimport { FormError } from \"../../form/form-error\";\n\nexport interface ProfileSettingsData {\n name: string;\n email: string;\n bio?: string;\n avatarUrl?: string;\n}\n\nexport interface ProfileSettingsBlockProps {\n initialData: ProfileSettingsData;\n onSave: (data: ProfileSettingsData) => void | Promise<void>;\n onAvatarChange?: (file: File) => void | Promise<void>;\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n className?: string;\n}\n\nexport function ProfileSettingsBlock({\n initialData,\n onSave,\n onAvatarChange,\n loading = false,\n error,\n disabled = false,\n className,\n}: ProfileSettingsBlockProps) {\n const fileInputRef = React.useRef<HTMLInputElement>(null);\n\n const handleSubmit = async (e: React.SyntheticEvent<HTMLFormElement>) => {\n e.preventDefault();\n const formData = new FormData(e.currentTarget);\n await onSave({\n name: formData.get(\"name\") as string,\n email: formData.get(\"email\") as string,\n bio: formData.get(\"bio\") as string,\n avatarUrl: initialData.avatarUrl,\n });\n };\n\n const handleAvatarClick = () => {\n fileInputRef.current?.click();\n };\n\n const handleFileChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const file = e.target.files?.[0];\n if (file && onAvatarChange) {\n onAvatarChange(file);\n }\n };\n\n const initials = initialData.name\n .split(\" \")\n .map((n) => n[0])\n .join(\"\")\n .toUpperCase()\n .slice(0, 2);\n\n return (\n <Card className={cn(\"w-full max-w-2xl\", className)}>\n <CardHeader>\n <CardTitle>Profile</CardTitle>\n <CardDescription>Manage your personal information</CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"space-y-6\">\n <FormError message={error} />\n\n <div className=\"flex items-center gap-4\">\n <div className=\"relative group\">\n <Avatar className=\"h-20 w-20\">\n {initialData.avatarUrl && <AvatarImage src={initialData.avatarUrl} alt={initialData.name} />}\n <AvatarFallback className=\"text-lg\">{initials}</AvatarFallback>\n </Avatar>\n {onAvatarChange && (\n <button\n type=\"button\"\n onClick={handleAvatarClick}\n disabled={loading || disabled}\n className=\"absolute inset-0 flex items-center justify-center rounded-full bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity\"\n >\n <Camera className=\"h-5 w-5 text-white\" />\n </button>\n )}\n <input ref={fileInputRef} type=\"file\" accept=\"image/*\" className=\"hidden\" onChange={handleFileChange} />\n </div>\n <div>\n <p className=\"font-medium\">{initialData.name}</p>\n <p className=\"text-sm text-muted-foreground\">{initialData.email}</p>\n </div>\n </div>\n\n <form onSubmit={handleSubmit} className=\"space-y-4\">\n <div className=\"grid gap-4 sm:grid-cols-2\">\n <div className=\"space-y-2\">\n <Label htmlFor=\"name\">Name</Label>\n <Input id=\"name\" name=\"name\" defaultValue={initialData.name} required disabled={loading || disabled} />\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"email\">Email</Label>\n <Input id=\"email\" name=\"email\" type=\"email\" defaultValue={initialData.email} required disabled={loading || disabled} />\n </div>\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"bio\">Bio</Label>\n <Textarea id=\"bio\" name=\"bio\" defaultValue={initialData.bio} placeholder=\"Tell us about yourself...\" disabled={loading || disabled} rows={3} />\n </div>\n <div className=\"flex justify-end\">\n <Button type=\"submit\" loading={loading} disabled={disabled}>\n Save changes\n </Button>\n </div>\n </form>\n </div>\n </CardContent>\n </Card>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { Input } from \"../../components/input\";\nimport { Label } from \"../../components/label\";\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from \"../../components/card\";\nimport { Separator } from \"../../components/separator\";\nimport { FormError } from \"../../form/form-error\";\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n AlertDialogTrigger,\n} from \"../../components/alert-dialog\";\n\nexport interface AccountSettingsBlockProps {\n onChangePassword: (data: { currentPassword: string; newPassword: string; confirmPassword: string }) => void | Promise<void>;\n onDeleteAccount?: () => void | Promise<void>;\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n className?: string;\n}\n\nexport function AccountSettingsBlock({\n onChangePassword,\n onDeleteAccount,\n loading = false,\n error,\n disabled = false,\n className,\n}: AccountSettingsBlockProps) {\n const handlePasswordSubmit = async (e: React.SyntheticEvent<HTMLFormElement>) => {\n e.preventDefault();\n const formData = new FormData(e.currentTarget);\n await onChangePassword({\n currentPassword: formData.get(\"currentPassword\") as string,\n newPassword: formData.get(\"newPassword\") as string,\n confirmPassword: formData.get(\"confirmPassword\") as string,\n });\n e.currentTarget.reset();\n };\n\n return (\n <div className={cn(\"w-full max-w-2xl space-y-6\", className)}>\n <Card>\n <CardHeader>\n <CardTitle>Change password</CardTitle>\n <CardDescription>Update your password to keep your account secure</CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"space-y-4\">\n <FormError message={error} />\n <form onSubmit={handlePasswordSubmit} className=\"space-y-4\">\n <div className=\"space-y-2\">\n <Label htmlFor=\"currentPassword\">Current password</Label>\n <Input id=\"currentPassword\" name=\"currentPassword\" type=\"password\" required disabled={loading || disabled} autoComplete=\"current-password\" />\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"newPassword\">New password</Label>\n <Input id=\"newPassword\" name=\"newPassword\" type=\"password\" required disabled={loading || disabled} autoComplete=\"new-password\" />\n </div>\n <div className=\"space-y-2\">\n <Label htmlFor=\"confirmPassword\">Confirm new password</Label>\n <Input id=\"confirmPassword\" name=\"confirmPassword\" type=\"password\" required disabled={loading || disabled} autoComplete=\"new-password\" />\n </div>\n <div className=\"flex justify-end\">\n <Button type=\"submit\" loading={loading} disabled={disabled}>\n Update password\n </Button>\n </div>\n </form>\n </div>\n </CardContent>\n </Card>\n\n {onDeleteAccount && (\n <Card className=\"border-destructive/50\">\n <CardHeader>\n <CardTitle className=\"text-destructive\">Danger zone</CardTitle>\n <CardDescription>Permanently delete your account and all associated data</CardDescription>\n </CardHeader>\n <CardContent>\n <AlertDialog>\n <AlertDialogTrigger asChild>\n <Button variant=\"destructive\" disabled={loading || disabled}>\n Delete account\n </Button>\n </AlertDialogTrigger>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>\n <AlertDialogDescription>\n This action cannot be undone. This will permanently delete your account and remove all your data from our servers.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Cancel</AlertDialogCancel>\n <AlertDialogAction onClick={onDeleteAccount} className=\"bg-destructive text-destructive-foreground hover:bg-destructive/90\">\n Delete account\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </CardContent>\n </Card>\n )}\n </div>\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"../../components/button\";\nimport { Switch } from \"../../components/switch\";\nimport { Card, CardContent, CardDescription, CardHeader, CardTitle } from \"../../components/card\";\nimport { FormError } from \"../../form/form-error\";\n\nexport interface NotificationSetting {\n id: string;\n label: string;\n description: string;\n enabled: boolean;\n}\n\nexport interface NotificationGroup {\n title: string;\n description?: string;\n settings: NotificationSetting[];\n}\n\nexport interface NotificationSettingsBlockProps {\n groups: NotificationGroup[];\n onSave: (settings: Record<string, boolean>) => void | Promise<void>;\n loading?: boolean;\n error?: string;\n disabled?: boolean;\n className?: string;\n}\n\nexport function NotificationSettingsBlock({\n groups,\n onSave,\n loading = false,\n error,\n disabled = false,\n className,\n}: NotificationSettingsBlockProps) {\n const [values, setValues] = React.useState<Record<string, boolean>>(() => {\n const initial: Record<string, boolean> = {};\n for (const group of groups) {\n for (const setting of group.settings) {\n initial[setting.id] = setting.enabled;\n }\n }\n return initial;\n });\n\n const handleToggle = (id: string, checked: boolean) => {\n setValues((prev) => ({ ...prev, [id]: checked }));\n };\n\n const handleSave = async () => {\n await onSave(values);\n };\n\n return (\n <div className={cn(\"w-full max-w-2xl space-y-6\", className)}>\n <FormError message={error} />\n\n {groups.map((group, gIdx) => (\n <Card key={gIdx}>\n <CardHeader>\n <CardTitle className=\"text-lg\">{group.title}</CardTitle>\n {group.description && <CardDescription>{group.description}</CardDescription>}\n </CardHeader>\n <CardContent>\n <div className=\"space-y-4\">\n {group.settings.map((setting) => (\n <div key={setting.id} className=\"flex items-center justify-between gap-4\">\n <div className=\"space-y-0.5\">\n <p className=\"text-sm font-medium\">{setting.label}</p>\n <p className=\"text-sm text-muted-foreground\">{setting.description}</p>\n </div>\n <Switch\n checked={values[setting.id]}\n onCheckedChange={(checked) => handleToggle(setting.id, checked)}\n disabled={loading || disabled}\n />\n </div>\n ))}\n </div>\n </CardContent>\n </Card>\n ))}\n\n <div className=\"flex justify-end\">\n <Button onClick={handleSave} loading={loading} disabled={disabled}>\n Save preferences\n </Button>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAa,2BACX;AAEF,MAAa,4BACX;AAEF,MAAa,4BACX;;AAGF,MAAa,iCAAiC;;;;;;;;;;;;;ACO9C,SAAgB,gBACd,UAAkC,EAAE,EACmB;CACvD,MAAM,EAAE,OAAO,MAAM,SAAS,SAAS,YAAY,MAAM;CACzD,MAAM,MAAM,MAAM,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