{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "app-settings-page",
  "type": "registry:component",
  "title": "App Settings Page",
  "description": "An account settings screen with vertical tabs for profile, notifications, security and billing. A save bar slides up as soon as anything changes.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "app-ui",
    "settings",
    "account",
    "form",
    "tabs",
    "toggle",
    "save bar"
  ],
  "docs": "https://hyperblur.dev/effects/app-settings-page",
  "files": [
    {
      "path": "registry/hyperblur/app-settings-page.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/app-settings-page.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport type AppSettingsTab = \"profile\" | \"notifications\" | \"security\" | \"billing\";\n\nexport interface AppSettingsValues {\n  name: string;\n  email: string;\n  username: string;\n  bio: string;\n  timezone: string;\n  digest: boolean;\n  mentions: boolean;\n  productUpdates: boolean;\n  securityAlerts: boolean;\n  twoFactor: boolean;\n  loginAlerts: boolean;\n}\n\nexport interface AppSettingsPageProps\n  extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onSubmit\" | \"defaultValue\"> {\n  defaultValues?: Partial<AppSettingsValues>;\n  initialChanges?: Partial<AppSettingsValues>;\n  defaultTab?: AppSettingsTab;\n  workspace?: string;\n  plan?: string;\n  accent?: string;\n  onSave?: (values: AppSettingsValues) => void;\n  onTabChange?: (tab: AppSettingsTab) => void;\n}\n\nconst baseValues: AppSettingsValues = {\n  name: \"Maya Okafor\",\n  email: \"maya@northwind.studio\",\n  username: \"maya\",\n  bio: \"Product designer leading the analytics workspace. Based in Lisbon, usually online 9 to 6.\",\n  timezone: \"Europe/Lisbon\",\n  digest: true,\n  mentions: true,\n  productUpdates: false,\n  securityAlerts: true,\n  twoFactor: true,\n  loginAlerts: false,\n};\n\nconst tabs: { id: AppSettingsTab; label: string; hint: string; icon: string }[] = [\n  { id: \"profile\", label: \"Profile\", hint: \"Name, photo and bio\", icon: \"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm-7 8a7 7 0 0 1 14 0\" },\n  { id: \"notifications\", label: \"Notifications\", hint: \"Email and push\", icon: \"M6 16V11a6 6 0 1 1 12 0v5l1.5 2h-15L6 16Zm4 4h4\" },\n  { id: \"security\", label: \"Security\", hint: \"Password and sessions\", icon: \"M12 3l7 3v5c0 4.5-3 8-7 10-4-2-7-5.5-7-10V6l7-3Zm-3 9 2 2 4-4\" },\n  { id: \"billing\", label: \"Billing\", hint: \"Plan and invoices\", icon: \"M3 7h18v10H3V7Zm0 4h18M7 15h3\" },\n];\n\nconst timezones = [\"Europe/Lisbon\", \"Europe/Berlin\", \"America/New_York\", \"America/Los_Angeles\", \"Asia/Tokyo\", \"Australia/Sydney\"];\n\nconst sessions = [\n  { device: \"MacBook Pro\", place: \"Lisbon, Portugal\", when: \"Active now\", current: true },\n  { device: \"iPhone 16\", place: \"Lisbon, Portugal\", when: \"2 hours ago\", current: false },\n  { device: \"Chrome on Windows\", place: \"Porto, Portugal\", when: \"Oct 28\", current: false },\n];\n\nconst invoices = [\n  { id: \"INV-2041\", date: \"Nov 1, 2026\", amount: \"$48.00\" },\n  { id: \"INV-1987\", date: \"Oct 1, 2026\", amount: \"$48.00\" },\n  { id: \"INV-1932\", date: \"Sep 1, 2026\", amount: \"$36.00\" },\n];\n\nconst css = `\n.hb-ye1 {\n  --hb-ye1-accent: #2f7bff;\n  container-type: inline-size;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  min-height: 600px;\n  overflow: hidden;\n  border: 1px solid rgba(255,255,255,.08);\n  border-radius: 16px;\n  background: #0a0a0a;\n  color: #ededed;\n  font-family: inherit;\n  font-size: 14px;\n  line-height: 1.45;\n}\n.hb-ye1 *, .hb-ye1 *::before, .hb-ye1 *::after { box-sizing: border-box; }\n.hb-ye1-shell { display: grid; grid-template-columns: 1fr; min-height: 600px; }\n.hb-ye1-nav { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-bottom: 1px solid rgba(255,255,255,.08); background: #0d0d0d; }\n.hb-ye1-ws { display: flex; align-items: center; gap: 10px; padding: 4px 6px 14px; }\n.hb-ye1-ws-logo { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--hb-ye1-accent), #9b6bff); color: #fff; font-weight: 700; font-size: 13px; }\n.hb-ye1-ws-name { font-weight: 600; font-size: 13px; }\n.hb-ye1-ws-plan { color: #8f8f8f; font-size: 12px; }\n.hb-ye1-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }\n.hb-ye1-tab { display: flex; align-items: center; gap: 10px; flex: none; margin: 0; padding: 9px 10px; border: 0; border-radius: 9px; background: transparent; color: #a1a1a1; font: inherit; text-align: left; cursor: pointer; transition: background-color .15s ease, color .15s ease; }\n.hb-ye1-tab:hover { background: #151515; color: #ededed; }\n.hb-ye1-tab[aria-selected=\"true\"] { background: #171717; color: #ededed; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }\n.hb-ye1-tab:focus-visible { outline: 2px solid var(--hb-ye1-accent); outline-offset: 1px; }\n.hb-ye1-tab svg { width: 17px; height: 17px; flex: none; }\n.hb-ye1-tab[aria-selected=\"true\"] svg { color: var(--hb-ye1-accent); }\n.hb-ye1-tab-text { display: flex; flex-direction: column; }\n.hb-ye1-tab-hint { display: none; color: #737373; font-size: 11.5px; }\n.hb-ye1-main { position: relative; min-width: 0; padding: 24px 20px 96px; }\n.hb-ye1-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,.08); }\n.hb-ye1-title { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }\n.hb-ye1-sub { margin: 4px 0 0; color: #8f8f8f; font-size: 13px; }\n.hb-ye1-panel { animation: hb-ye1-in .32s cubic-bezier(.2,.8,.2,1) both; }\n.hb-ye1-row { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 18px 0; border-bottom: 1px solid rgba(255,255,255,.06); }\n.hb-ye1-label { font-weight: 500; font-size: 13.5px; }\n.hb-ye1-help { margin-top: 2px; color: #8f8f8f; font-size: 12.5px; }\n.hb-ye1-avatar-row { display: flex; align-items: center; gap: 14px; }\n.hb-ye1-avatar { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 999px; background: conic-gradient(from 200deg, var(--hb-ye1-accent), #9b6bff, #ff7a59, var(--hb-ye1-accent)); color: #fff; font-weight: 700; font-size: 18px; box-shadow: 0 0 0 3px #0a0a0a, 0 0 0 4px rgba(255,255,255,.12); }\n.hb-ye1-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; margin: 0; padding: 0 12px; border: 1px solid #262626; border-radius: 8px; background: #141414; color: #ededed; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }\n.hb-ye1-btn:hover { border-color: #3a3a3a; background: #1a1a1a; }\n.hb-ye1-btn:focus-visible, .hb-ye1-input:focus-visible { outline: 2px solid var(--hb-ye1-accent); outline-offset: 1px; }\n.hb-ye1-btn[data-tone=\"ghost\"] { border-color: transparent; background: transparent; color: #a1a1a1; }\n.hb-ye1-btn[data-tone=\"ghost\"]:hover { color: #ededed; background: #151515; }\n.hb-ye1-btn[data-tone=\"primary\"] { border-color: transparent; background: var(--hb-ye1-accent); color: #fff; }\n.hb-ye1-btn[data-tone=\"primary\"]:hover { filter: brightness(1.1); }\n.hb-ye1-btn[data-tone=\"danger\"] { color: #ff8a8a; }\n.hb-ye1-fields { display: grid; grid-template-columns: 1fr; gap: 12px; }\n.hb-ye1-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }\n.hb-ye1-field > span { color: #a1a1a1; font-size: 12.5px; }\n.hb-ye1-input { width: 100%; height: 36px; margin: 0; padding: 0 11px; border: 1px solid #262626; border-radius: 8px; background: #111; color: #ededed; font: inherit; font-size: 13.5px; transition: border-color .15s ease; }\n.hb-ye1-input:hover { border-color: #333; }\ntextarea.hb-ye1-input { height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.5; }\nselect.hb-ye1-input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #8f8f8f 50%), linear-gradient(135deg, #8f8f8f 50%, transparent 50%); background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }\n.hb-ye1-prefix { display: flex; align-items: stretch; border: 1px solid #262626; border-radius: 8px; background: #111; overflow: hidden; }\n.hb-ye1-prefix:focus-within { outline: 2px solid var(--hb-ye1-accent); outline-offset: 1px; }\n.hb-ye1-prefix > span { display: flex; align-items: center; padding: 0 10px; border-right: 1px solid #262626; color: #737373; font-size: 13px; background: #0d0d0d; }\n.hb-ye1-prefix .hb-ye1-input { border: 0; border-radius: 0; outline: none; }\n.hb-ye1-count { align-self: flex-end; color: #737373; font-size: 11.5px; font-variant-numeric: tabular-nums; }\n.hb-ye1-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.06); }\n.hb-ye1-switch { position: relative; flex: none; width: 36px; height: 20px; margin: 0; padding: 0; border: 0; border-radius: 999px; background: #2a2a2a; cursor: pointer; transition: background-color .2s ease; }\n.hb-ye1-switch::after { content: \"\"; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); transition: transform .22s cubic-bezier(.3,1.4,.5,1); }\n.hb-ye1-switch[aria-checked=\"true\"] { background: var(--hb-ye1-accent); }\n.hb-ye1-switch[aria-checked=\"true\"]::after { transform: translateX(16px); }\n.hb-ye1-switch:focus-visible { outline: 2px solid var(--hb-ye1-accent); outline-offset: 2px; }\n.hb-ye1-list { display: flex; flex-direction: column; margin-top: 8px; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; overflow: hidden; }\n.hb-ye1-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.06); background: #0f0f0f; }\n.hb-ye1-item:first-child { border-top: 0; }\n.hb-ye1-item-main { flex: 1; min-width: 0; }\n.hb-ye1-item-title { font-size: 13.5px; font-weight: 500; }\n.hb-ye1-item-meta { color: #8f8f8f; font-size: 12px; }\n.hb-ye1-chip { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; background: color-mix(in srgb, var(--hb-ye1-accent) 18%, transparent); color: color-mix(in srgb, var(--hb-ye1-accent) 70%, #fff); font-size: 11px; font-weight: 600; }\n.hb-ye1-device { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 9px; background: #171717; color: #a1a1a1; }\n.hb-ye1-device svg { width: 17px; height: 17px; }\n.hb-ye1-plan { position: relative; display: grid; gap: 14px; margin-top: 18px; padding: 18px; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--hb-ye1-accent) 22%, transparent), transparent 55%), #101010; overflow: hidden; }\n.hb-ye1-plan-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }\n.hb-ye1-plan-name { font-size: 16px; font-weight: 600; }\n.hb-ye1-price { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }\n.hb-ye1-price small { color: #8f8f8f; font-size: 12px; font-weight: 400; }\n.hb-ye1-meter { height: 6px; border-radius: 999px; background: #222; overflow: hidden; }\n.hb-ye1-meter > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--hb-ye1-accent), #9b6bff); transform-origin: left; animation: hb-ye1-grow .9s cubic-bezier(.2,.8,.2,1) both; }\n.hb-ye1-savebar { position: absolute; left: 50%; bottom: 18px; z-index: 3; display: flex; align-items: center; gap: 12px; width: min(560px, calc(100% - 32px)); padding: 8px 8px 8px 16px; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; background: rgba(23,23,23,.92); box-shadow: 0 18px 40px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.05); backdrop-filter: blur(10px); transform: translate(-50%, calc(100% + 30px)); opacity: 0; visibility: hidden; transition: transform .38s cubic-bezier(.2,.9,.2,1), opacity .25s ease, visibility 0s linear .38s; }\n.hb-ye1-savebar[data-open=\"true\"] { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition: transform .38s cubic-bezier(.2,.9,.2,1), opacity .25s ease, visibility 0s; }\n.hb-ye1-savebar-text { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; color: #d4d4d4; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.hb-ye1-savebar-text i { width: 7px; height: 7px; flex: none; border-radius: 999px; background: #f5a524; box-shadow: 0 0 0 3px rgba(245,165,36,.18); }\n.hb-ye1-toast { position: absolute; right: 18px; top: 18px; z-index: 3; display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; background: #171717; font-size: 13px; animation: hb-ye1-toast 2.4s ease both; }\n.hb-ye1-toast svg { width: 16px; height: 16px; color: #3ccf91; }\n@keyframes hb-ye1-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }\n@keyframes hb-ye1-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }\n@keyframes hb-ye1-toast { 0% { opacity: 0; transform: translateY(-6px); } 10%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }\n@container (min-width: 640px) {\n  .hb-ye1-shell { grid-template-columns: 236px 1fr; }\n  .hb-ye1-nav { border-bottom: 0; border-right: 1px solid rgba(255,255,255,.08); padding: 20px 14px; }\n  .hb-ye1-tabs { flex-direction: column; overflow: visible; }\n  .hb-ye1-tab { width: 100%; }\n  .hb-ye1-tab-hint { display: block; }\n  .hb-ye1-main { padding: 28px 36px 110px; }\n  .hb-ye1-row { grid-template-columns: 220px 1fr; gap: 28px; }\n  .hb-ye1-fields { grid-template-columns: 1fr 1fr; }\n  .hb-ye1-fields .hb-ye1-wide { grid-column: 1 / -1; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-ye1 *, .hb-ye1 *::before, .hb-ye1 *::after { animation: none !important; transition: none !important; }\n}\n`;\n\nfunction Icon({ d }: { d: string }) {\n  return (\n    <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.7\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n      <path d={d} />\n    </svg>\n  );\n}\n\nfunction Switch({ checked, onChange, label }: { checked: boolean; onChange: (v: boolean) => void; label: string }) {\n  return <button type=\"button\" role=\"switch\" aria-checked={checked} aria-label={label} className=\"hb-ye1-switch\" onClick={() => onChange(!checked)} />;\n}\n\nfunction initials(name: string) {\n  const parts = name.trim().split(/\\s+/).filter(Boolean);\n  if (!parts.length) return \"?\";\n  return (parts[0][0] + (parts.length > 1 ? parts[parts.length - 1][0] : \"\")).toUpperCase();\n}\n\nexport function AppSettingsPage({\n  defaultValues,\n  initialChanges,\n  defaultTab = \"profile\",\n  workspace = \"Northwind Studio\",\n  plan = \"Pro plan · 8 seats\",\n  accent = \"#2f7bff\",\n  onSave,\n  onTabChange,\n  className,\n  style,\n  ...rest\n}: AppSettingsPageProps) {\n  const id = React.useId();\n  const initial = React.useMemo(() => ({ ...baseValues, ...defaultValues }), [defaultValues]);\n  const [saved, setSaved] = React.useState<AppSettingsValues>(initial);\n  const [values, setValues] = React.useState<AppSettingsValues>(() => ({ ...initial, ...initialChanges }));\n  const [tab, setTab] = React.useState<AppSettingsTab>(defaultTab);\n  const [toast, setToast] = React.useState(0);\n  const tabRefs = React.useRef<(HTMLButtonElement | null)[]>([]);\n\n  const dirty = (Object.keys(values) as (keyof AppSettingsValues)[]).some((k) => values[k] !== saved[k]);\n\n  React.useEffect(() => {\n    if (!toast) return;\n    const t = window.setTimeout(() => setToast(0), 2400);\n    return () => window.clearTimeout(t);\n  }, [toast]);\n\n  const set = <K extends keyof AppSettingsValues>(key: K, value: AppSettingsValues[K]) => setValues((v) => ({ ...v, [key]: value }));\n\n  const selectTab = (next: AppSettingsTab) => {\n    setTab(next);\n    onTabChange?.(next);\n  };\n\n  const onTabKey = (e: React.KeyboardEvent, index: number) => {\n    let next = -1;\n    if (e.key === \"ArrowDown\" || e.key === \"ArrowRight\") next = (index + 1) % tabs.length;\n    else if (e.key === \"ArrowUp\" || e.key === \"ArrowLeft\") next = (index - 1 + tabs.length) % tabs.length;\n    else if (e.key === \"Home\") next = 0;\n    else if (e.key === \"End\") next = tabs.length - 1;\n    if (next < 0) return;\n    e.preventDefault();\n    selectTab(tabs[next].id);\n    tabRefs.current[next]?.focus();\n  };\n\n  const save = () => {\n    setSaved(values);\n    setToast((n) => n + 1);\n    onSave?.(values);\n  };\n\n  const discard = () => setValues(saved);\n\n  const onKeyDown = (e: React.KeyboardEvent) => {\n    if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === \"s\" && dirty) {\n      e.preventDefault();\n      save();\n    }\n    if (e.key === \"Escape\" && dirty) discard();\n  };\n\n  const current = tabs.find((t) => t.id === tab) ?? tabs[0];\n\n  return (\n    <div\n      className={[\"hb-ye1\", className].filter(Boolean).join(\" \")}\n      style={{ \"--hb-ye1-accent\": accent, ...style } as React.CSSProperties}\n      onKeyDown={onKeyDown}\n      {...rest}\n    >\n      <style href=\"hb-app-settings-page\" precedence=\"default\">{css}</style>\n      <div className=\"hb-ye1-shell\">\n        <nav className=\"hb-ye1-nav\" aria-label=\"Settings sections\">\n          <div className=\"hb-ye1-ws\">\n            <span className=\"hb-ye1-ws-logo\" aria-hidden=\"true\">{workspace.charAt(0)}</span>\n            <div>\n              <div className=\"hb-ye1-ws-name\">{workspace}</div>\n              <div className=\"hb-ye1-ws-plan\">{plan}</div>\n            </div>\n          </div>\n          <div className=\"hb-ye1-tabs\" role=\"tablist\" aria-orientation=\"vertical\">\n            {tabs.map((t, i) => (\n              <button\n                key={t.id}\n                ref={(el) => { tabRefs.current[i] = el; }}\n                type=\"button\"\n                role=\"tab\"\n                id={`${id}-tab-${t.id}`}\n                aria-controls={`${id}-panel`}\n                aria-selected={tab === t.id}\n                tabIndex={tab === t.id ? 0 : -1}\n                className=\"hb-ye1-tab\"\n                onClick={() => selectTab(t.id)}\n                onKeyDown={(e) => onTabKey(e, i)}\n              >\n                <Icon d={t.icon} />\n                <span className=\"hb-ye1-tab-text\">\n                  <span>{t.label}</span>\n                  <span className=\"hb-ye1-tab-hint\">{t.hint}</span>\n                </span>\n              </button>\n            ))}\n          </div>\n        </nav>\n        <main className=\"hb-ye1-main\">\n          <div className=\"hb-ye1-head\">\n            <div>\n              <h2 className=\"hb-ye1-title\">{current.label}</h2>\n              <p className=\"hb-ye1-sub\">\n                {tab === \"profile\" && \"This is how other people in the workspace see you.\"}\n                {tab === \"notifications\" && \"Choose what reaches your inbox and what waits in the app.\"}\n                {tab === \"security\" && \"Keep your account protected and review where you are signed in.\"}\n                {tab === \"billing\" && \"Manage your subscription, seats and payment history.\"}\n              </p>\n            </div>\n          </div>\n          <div className=\"hb-ye1-panel\" key={tab} role=\"tabpanel\" id={`${id}-panel`} aria-labelledby={`${id}-tab-${tab}`}>\n            {tab === \"profile\" && (\n              <>\n                <div className=\"hb-ye1-row\">\n                  <div>\n                    <div className=\"hb-ye1-label\">Photo</div>\n                    <div className=\"hb-ye1-help\">PNG or JPG, at least 256 px.</div>\n                  </div>\n                  <div className=\"hb-ye1-avatar-row\">\n                    <span className=\"hb-ye1-avatar\" aria-hidden=\"true\">{initials(values.name)}</span>\n                    <button type=\"button\" className=\"hb-ye1-btn\">Change photo</button>\n                    <button type=\"button\" className=\"hb-ye1-btn\" data-tone=\"ghost\">Remove</button>\n                  </div>\n                </div>\n                <div className=\"hb-ye1-row\">\n                  <div>\n                    <div className=\"hb-ye1-label\">Personal details</div>\n                    <div className=\"hb-ye1-help\">Your name appears on comments and invoices.</div>\n                  </div>\n                  <div className=\"hb-ye1-fields\">\n                    <label className=\"hb-ye1-field\">\n                      <span>Full name</span>\n                      <input className=\"hb-ye1-input\" value={values.name} onChange={(e) => set(\"name\", e.target.value)} autoComplete=\"name\" />\n                    </label>\n                    <label className=\"hb-ye1-field\">\n                      <span>Email</span>\n                      <input className=\"hb-ye1-input\" type=\"email\" value={values.email} onChange={(e) => set(\"email\", e.target.value)} autoComplete=\"email\" />\n                    </label>\n                    <label className=\"hb-ye1-field\">\n                      <span>Username</span>\n                      <span className=\"hb-ye1-prefix\">\n                        <span>northwind.studio/</span>\n                        <input className=\"hb-ye1-input\" value={values.username} onChange={(e) => set(\"username\", e.target.value.replace(/\\s/g, \"\").toLowerCase())} />\n                      </span>\n                    </label>\n                    <label className=\"hb-ye1-field\">\n                      <span>Time zone</span>\n                      <select className=\"hb-ye1-input\" value={values.timezone} onChange={(e) => set(\"timezone\", e.target.value)}>\n                        {timezones.map((z) => <option key={z} value={z}>{z.replace(\"_\", \" \")}</option>)}\n                      </select>\n                    </label>\n                    <label className=\"hb-ye1-field hb-ye1-wide\">\n                      <span>Bio</span>\n                      <textarea className=\"hb-ye1-input\" maxLength={160} value={values.bio} onChange={(e) => set(\"bio\", e.target.value)} />\n                      <span className=\"hb-ye1-count\">{values.bio.length}/160</span>\n                    </label>\n                  </div>\n                </div>\n              </>\n            )}\n            {tab === \"notifications\" && (\n              <div className=\"hb-ye1-row\">\n                <div>\n                  <div className=\"hb-ye1-label\">Email</div>\n                  <div className=\"hb-ye1-help\">Sent to {values.email || \"your address\"}.</div>\n                </div>\n                <div>\n                  {([\n                    [\"digest\", \"Daily digest\", \"A summary of activity at 8:00 every weekday.\"],\n                    [\"mentions\", \"Mentions and replies\", \"When someone mentions you or replies to your thread.\"],\n                    [\"productUpdates\", \"Product updates\", \"New features and changes, about twice a month.\"],\n                    [\"securityAlerts\", \"Security alerts\", \"Sign-ins from new devices and password changes.\"],\n                  ] as const).map(([key, title, text]) => (\n                    <div className=\"hb-ye1-toggle-row\" key={key}>\n                      <div>\n                        <div className=\"hb-ye1-label\">{title}</div>\n                        <div className=\"hb-ye1-help\">{text}</div>\n                      </div>\n                      <Switch checked={values[key]} onChange={(v) => set(key, v)} label={title} />\n                    </div>\n                  ))}\n                </div>\n              </div>\n            )}\n            {tab === \"security\" && (\n              <>\n                <div className=\"hb-ye1-row\">\n                  <div>\n                    <div className=\"hb-ye1-label\">Sign-in protection</div>\n                    <div className=\"hb-ye1-help\">Extra checks when you sign in.</div>\n                  </div>\n                  <div>\n                    <div className=\"hb-ye1-toggle-row\">\n                      <div>\n                        <div className=\"hb-ye1-label\">Two-factor authentication {values.twoFactor && <span className=\"hb-ye1-chip\">On</span>}</div>\n                        <div className=\"hb-ye1-help\">Use an authenticator app for a one-time code.</div>\n                      </div>\n                      <Switch checked={values.twoFactor} onChange={(v) => set(\"twoFactor\", v)} label=\"Two-factor authentication\" />\n                    </div>\n                    <div className=\"hb-ye1-toggle-row\">\n                      <div>\n                        <div className=\"hb-ye1-label\">New device alerts</div>\n                        <div className=\"hb-ye1-help\">Email me when a new browser signs in.</div>\n                      </div>\n                      <Switch checked={values.loginAlerts} onChange={(v) => set(\"loginAlerts\", v)} label=\"New device alerts\" />\n                    </div>\n                  </div>\n                </div>\n                <div className=\"hb-ye1-row\">\n                  <div>\n                    <div className=\"hb-ye1-label\">Active sessions</div>\n                    <div className=\"hb-ye1-help\">Sign out of devices you do not recognize.</div>\n                  </div>\n                  <div className=\"hb-ye1-list\">\n                    {sessions.map((s) => (\n                      <div className=\"hb-ye1-item\" key={s.device}>\n                        <span className=\"hb-ye1-device\"><Icon d={s.device.includes(\"iPhone\") ? \"M8 3h8v18H8V3Zm3 15h2\" : \"M4 5h16v10H4V5Zm-2 14h20\"} /></span>\n                        <div className=\"hb-ye1-item-main\">\n                          <div className=\"hb-ye1-item-title\">{s.device} {s.current && <span className=\"hb-ye1-chip\">This device</span>}</div>\n                          <div className=\"hb-ye1-item-meta\">{s.place} · {s.when}</div>\n                        </div>\n                        {!s.current && <button type=\"button\" className=\"hb-ye1-btn\" data-tone=\"danger\">Sign out</button>}\n                      </div>\n                    ))}\n                  </div>\n                </div>\n              </>\n            )}\n            {tab === \"billing\" && (\n              <>\n                <div className=\"hb-ye1-plan\">\n                  <div className=\"hb-ye1-plan-top\">\n                    <div>\n                      <div className=\"hb-ye1-plan-name\">Pro · Annual</div>\n                      <div className=\"hb-ye1-help\">Renews on Jan 14, 2027 · Visa ending 4242</div>\n                    </div>\n                    <div className=\"hb-ye1-price\">$48<small> / month</small></div>\n                  </div>\n                  <div>\n                    <div className=\"hb-ye1-help\" style={{ display: \"flex\", justifyContent: \"space-between\" }}><span>6 of 8 seats used</span><span>75%</span></div>\n                    <div className=\"hb-ye1-meter\" style={{ marginTop: 6 }}><i style={{ width: \"75%\" }} /></div>\n                  </div>\n                  <div style={{ display: \"flex\", gap: 8 }}>\n                    <button type=\"button\" className=\"hb-ye1-btn\" data-tone=\"primary\">Add seats</button>\n                    <button type=\"button\" className=\"hb-ye1-btn\">Change plan</button>\n                  </div>\n                </div>\n                <div className=\"hb-ye1-list\" style={{ marginTop: 18 }}>\n                  {invoices.map((inv) => (\n                    <div className=\"hb-ye1-item\" key={inv.id}>\n                      <div className=\"hb-ye1-item-main\">\n                        <div className=\"hb-ye1-item-title\">{inv.id}</div>\n                        <div className=\"hb-ye1-item-meta\">{inv.date}</div>\n                      </div>\n                      <span className=\"hb-ye1-chip\">Paid</span>\n                      <span style={{ width: 70, textAlign: \"right\", fontVariantNumeric: \"tabular-nums\" }}>{inv.amount}</span>\n                      <button type=\"button\" className=\"hb-ye1-btn\" data-tone=\"ghost\" aria-label={`Download ${inv.id}`}>PDF</button>\n                    </div>\n                  ))}\n                </div>\n              </>\n            )}\n          </div>\n          <div className=\"hb-ye1-savebar\" data-open={dirty} role=\"region\" aria-label=\"Unsaved changes\" aria-hidden={!dirty}>\n            <span className=\"hb-ye1-savebar-text\"><i aria-hidden=\"true\" />You have unsaved changes</span>\n            <button type=\"button\" className=\"hb-ye1-btn\" data-tone=\"ghost\" onClick={discard} tabIndex={dirty ? 0 : -1}>Discard</button>\n            <button type=\"button\" className=\"hb-ye1-btn\" data-tone=\"primary\" onClick={save} tabIndex={dirty ? 0 : -1}>Save changes</button>\n          </div>\n          {toast > 0 && (\n            <div className=\"hb-ye1-toast\" role=\"status\" key={toast}>\n              <Icon d=\"M5 12.5l4.5 4.5L19 7.5\" />\n              Settings saved\n            </div>\n          )}\n        </main>\n      </div>\n    </div>\n  );\n}\n\nexport default AppSettingsPage;\n"
    }
  ]
}