// @ts-nocheck
// This file is autogenerated by scripts/build-registry.mts
// Do not edit this file directly.
import "server-only"

import * as React from "react"

const shards: Record<
  string,
  {
    load: () => Promise<{ Components: Record<string, any> }>
    names: Set<string>
  }
> = {
  base: {
    load: () => import("./base"),
    names: new Set([
      "accordion",
      "alert",
      "alert-dialog",
      "aspect-ratio",
      "avatar",
      "badge",
      "breadcrumb",
      "button",
      "button-group",
      "calendar",
      "card",
      "carousel",
      "chart",
      "checkbox",
      "collapsible",
      "combobox",
      "command",
      "context-menu",
      "dialog",
      "drawer",
      "dropdown-menu",
      "empty",
      "field",
      "hover-card",
      "input",
      "input-group",
      "input-otp",
      "item",
      "label",
      "menubar",
      "navigation-menu",
      "pagination",
      "popover",
      "progress",
      "radio-group",
      "resizable",
      "scroll-area",
      "select",
      "separator",
      "sheet",
      "sidebar",
      "skeleton",
      "slider",
      "sonner",
      "spinner",
      "switch",
      "table",
      "tabs",
      "textarea",
      "toast",
      "toggle",
      "toggle-group",
      "tooltip",
      "kbd",
      "native-select",
      "direction",
      "attachment",
      "bubble",
      "message-scroller",
      "questionnaire",
      "marker",
      "message",
      "accordion-example",
      "alert-example",
      "alert-dialog-example",
      "aspect-ratio-example",
      "avatar-example",
      "badge-example",
      "breadcrumb-example",
      "button-example",
      "button-group-example",
      "calendar-example",
      "card-example",
      "carousel-example",
      "chart-example",
      "checkbox-example",
      "collapsible-example",
      "combobox-example",
      "command-example",
      "context-menu-example",
      "dialog-example",
      "drawer-example",
      "dropdown-menu-example",
      "empty-example",
      "field-example",
      "hover-card-example",
      "input-example",
      "input-group-example",
      "input-otp-example",
      "item-example",
      "kbd-example",
      "label-example",
      "menubar-example",
      "native-select-example",
      "navigation-menu-example",
      "pagination-example",
      "popover-example",
      "progress-example",
      "radio-group-example",
      "resizable-example",
      "scroll-area-example",
      "select-example",
      "separator-example",
      "sheet-example",
      "sidebar-example",
      "sidebar-icon-example",
      "sidebar-inset-example",
      "sidebar-floating-example",
      "skeleton-example",
      "slider-example",
      "sonner-example",
      "spinner-example",
      "switch-example",
      "table-example",
      "tabs-example",
      "textarea-example",
      "toast-example",
      "toggle-example",
      "toggle-group-example",
      "tooltip-example",
      "demo",
      "component-example",
      "attachment-example",
      "bubble-example",
      "message-scroller-example",
      "questionnaire-example",
      "marker-example",
      "message-example",
      "utils",
      "example",
      "preview",
      "preview-02",
      "preview-03",
      "login-01",
      "login-02",
      "login-03",
      "login-04",
      "login-05",
      "signup-01",
      "signup-02",
      "signup-03",
      "signup-04",
      "signup-05",
      "dashboard-01",
      "sidebar-01",
      "sidebar-02",
      "sidebar-03",
      "sidebar-04",
      "sidebar-05",
      "sidebar-06",
      "sidebar-07",
      "sidebar-08",
      "sidebar-09",
      "sidebar-10",
      "sidebar-11",
      "sidebar-12",
      "sidebar-13",
      "sidebar-14",
      "sidebar-15",
      "sidebar-16",
      "use-mobile",
    ]),
  },
  aria: {
    load: () => import("./aria"),
    names: new Set([
      "accordion",
      "alert",
      "alert-dialog",
      "aspect-ratio",
      "avatar",
      "badge",
      "breadcrumb",
      "button",
      "button-group",
      "calendar",
      "card",
      "carousel",
      "chart",
      "checkbox",
      "collapsible",
      "combobox",
      "command",
      "context-menu",
      "dialog",
      "drawer",
      "dropdown-menu",
      "empty",
      "field",
      "input",
      "input-group",
      "input-otp",
      "item",
      "label",
      "pagination",
      "popover",
      "progress",
      "radio-group",
      "resizable",
      "scroll-area",
      "select",
      "separator",
      "sheet",
      "sidebar",
      "skeleton",
      "slider",
      "sonner",
      "spinner",
      "switch",
      "table",
      "tabs",
      "textarea",
      "toggle",
      "toggle-group",
      "tooltip",
      "kbd",
      "native-select",
      "direction",
      "attachment",
      "bubble",
      "message-scroller",
      "questionnaire",
      "marker",
      "message",
      "accordion-example",
      "alert-example",
      "alert-dialog-example",
      "aspect-ratio-example",
      "avatar-example",
      "badge-example",
      "breadcrumb-example",
      "button-example",
      "button-group-example",
      "calendar-example",
      "card-example",
      "carousel-example",
      "chart-example",
      "checkbox-example",
      "collapsible-example",
      "combobox-example",
      "command-example",
      "context-menu-example",
      "dialog-example",
      "drawer-example",
      "dropdown-menu-example",
      "empty-example",
      "field-example",
      "input-example",
      "input-group-example",
      "input-otp-example",
      "item-example",
      "kbd-example",
      "label-example",
      "native-select-example",
      "pagination-example",
      "popover-example",
      "progress-example",
      "radio-group-example",
      "resizable-example",
      "scroll-area-example",
      "select-example",
      "separator-example",
      "sheet-example",
      "sidebar-example",
      "sidebar-icon-example",
      "sidebar-inset-example",
      "sidebar-floating-example",
      "skeleton-example",
      "slider-example",
      "sonner-example",
      "spinner-example",
      "switch-example",
      "table-example",
      "tabs-example",
      "textarea-example",
      "toggle-example",
      "toggle-group-example",
      "tooltip-example",
      "demo",
      "component-example",
      "attachment-example",
      "bubble-example",
      "message-scroller-example",
      "questionnaire-example",
      "marker-example",
      "message-example",
      "utils",
      "example",
      "preview",
      "preview-02",
      "preview-03",
      "login-01",
      "login-02",
      "login-03",
      "login-04",
      "login-05",
      "signup-01",
      "signup-02",
      "signup-03",
      "signup-04",
      "signup-05",
      "dashboard-01",
      "sidebar-01",
      "sidebar-02",
      "sidebar-03",
      "sidebar-04",
      "sidebar-05",
      "sidebar-06",
      "sidebar-07",
      "sidebar-08",
      "sidebar-09",
      "sidebar-10",
      "sidebar-11",
      "sidebar-12",
      "sidebar-13",
      "sidebar-14",
      "sidebar-15",
      "sidebar-16",
      "use-mobile",
    ]),
  },
  radix: {
    load: () => import("./radix"),
    names: new Set([
      "accordion",
      "alert",
      "alert-dialog",
      "aspect-ratio",
      "avatar",
      "badge",
      "breadcrumb",
      "button",
      "button-group",
      "calendar",
      "card",
      "carousel",
      "chart",
      "checkbox",
      "collapsible",
      "combobox",
      "command",
      "context-menu",
      "dialog",
      "drawer",
      "dropdown-menu",
      "empty",
      "field",
      "hover-card",
      "input",
      "input-group",
      "input-otp",
      "item",
      "label",
      "menubar",
      "navigation-menu",
      "pagination",
      "popover",
      "progress",
      "radio-group",
      "resizable",
      "scroll-area",
      "select",
      "separator",
      "sheet",
      "sidebar",
      "skeleton",
      "slider",
      "sonner",
      "spinner",
      "switch",
      "table",
      "tabs",
      "textarea",
      "toggle",
      "toggle-group",
      "tooltip",
      "kbd",
      "native-select",
      "direction",
      "attachment",
      "bubble",
      "message-scroller",
      "questionnaire",
      "marker",
      "message",
      "accordion-example",
      "alert-example",
      "alert-dialog-example",
      "aspect-ratio-example",
      "avatar-example",
      "badge-example",
      "breadcrumb-example",
      "button-example",
      "button-group-example",
      "calendar-example",
      "card-example",
      "carousel-example",
      "chart-example",
      "checkbox-example",
      "collapsible-example",
      "combobox-example",
      "command-example",
      "context-menu-example",
      "dialog-example",
      "drawer-example",
      "dropdown-menu-example",
      "empty-example",
      "field-example",
      "hover-card-example",
      "input-example",
      "input-group-example",
      "input-otp-example",
      "item-example",
      "kbd-example",
      "label-example",
      "menubar-example",
      "native-select-example",
      "navigation-menu-example",
      "pagination-example",
      "popover-example",
      "progress-example",
      "radio-group-example",
      "resizable-example",
      "scroll-area-example",
      "select-example",
      "separator-example",
      "sheet-example",
      "sidebar-example",
      "sidebar-icon-example",
      "sidebar-inset-example",
      "sidebar-floating-example",
      "skeleton-example",
      "slider-example",
      "sonner-example",
      "spinner-example",
      "switch-example",
      "table-example",
      "tabs-example",
      "textarea-example",
      "toggle-example",
      "toggle-group-example",
      "tooltip-example",
      "demo",
      "component-example",
      "attachment-example",
      "bubble-example",
      "message-scroller-example",
      "questionnaire-example",
      "marker-example",
      "message-example",
      "utils",
      "example",
      "preview",
      "preview-02",
      "preview-03",
      "login-01",
      "login-02",
      "login-03",
      "login-04",
      "login-05",
      "signup-01",
      "signup-02",
      "signup-03",
      "signup-04",
      "signup-05",
      "dashboard-01",
      "sidebar-01",
      "sidebar-02",
      "sidebar-03",
      "sidebar-04",
      "sidebar-05",
      "sidebar-06",
      "sidebar-07",
      "sidebar-08",
      "sidebar-09",
      "sidebar-10",
      "sidebar-11",
      "sidebar-12",
      "sidebar-13",
      "sidebar-14",
      "sidebar-15",
      "sidebar-16",
      "use-mobile",
    ]),
  },
}

const cache = new Map<string, any>()

// Sync existence check via the names set; the shard module (and with it the
// component's dynamic-import subtree) only loads when the component renders.
export function getComponent(styleName: string, name: string) {
  const shard = shards[styleName]
  if (!shard?.names.has(name)) {
    return undefined
  }

  const cacheKey = `${styleName}:${name}`
  let component = cache.get(cacheKey)
  if (!component) {
    component = React.lazy(async () => {
      const { Components } = await shard.load()
      return { default: Components[name] }
    })
    cache.set(cacheKey, component)
  }

  return component
}
