@alfadocs/ui-kit-debug 1.90.1 → 1.90.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/address-autocomplete-DR4Xn23Z.js +519 -0
- package/dist/_chunks/address-autocomplete-DR4Xn23Z.js.map +1 -0
- package/dist/_chunks/{address-fields-CfnXK8RT.js → address-fields-qxQkGwPf.js} +5 -5
- package/dist/_chunks/{address-fields-CfnXK8RT.js.map → address-fields-qxQkGwPf.js.map} +1 -1
- package/dist/_chunks/{ai-permission-notice-CoW22jx1.js → ai-permission-notice-VNh3W57L.js} +2 -2
- package/dist/_chunks/{ai-permission-notice-CoW22jx1.js.map → ai-permission-notice-VNh3W57L.js.map} +1 -1
- package/dist/_chunks/{anamnesis-summary-rows-fbEQwcuW.js → anamnesis-summary-rows-EKPfVCmh.js} +2 -2
- package/dist/_chunks/{anamnesis-summary-rows-fbEQwcuW.js.map → anamnesis-summary-rows-EKPfVCmh.js.map} +1 -1
- package/dist/_chunks/autocomplete-BXMcNoa3.js +562 -0
- package/dist/_chunks/autocomplete-BXMcNoa3.js.map +1 -0
- package/dist/_chunks/{balance-badge-cell-C4FYwmrZ.js → balance-badge-cell-D9VhFp0L.js} +3 -3
- package/dist/_chunks/{balance-badge-cell-C4FYwmrZ.js.map → balance-badge-cell-D9VhFp0L.js.map} +1 -1
- package/dist/_chunks/{booking-C0FoW8Yx.js → booking-CcE_oviI.js} +1896 -1859
- package/dist/_chunks/booking-CcE_oviI.js.map +1 -0
- package/dist/_chunks/{calendar-appointment-editor-dialog-C1v2MNE4.js → calendar-appointment-editor-dialog-CiAGAX2t.js} +7 -7
- package/dist/_chunks/{calendar-appointment-editor-dialog-C1v2MNE4.js.map → calendar-appointment-editor-dialog-CiAGAX2t.js.map} +1 -1
- package/dist/_chunks/{checkbox-BjDv-r3o.js → checkbox-a7Sh-dXb.js} +32 -31
- package/dist/_chunks/checkbox-a7Sh-dXb.js.map +1 -0
- package/dist/_chunks/{checkbox-group-Cw2H5qaq.js → checkbox-group-eGdv9fZc.js} +2 -2
- package/dist/_chunks/{checkbox-group-Cw2H5qaq.js.map → checkbox-group-eGdv9fZc.js.map} +1 -1
- package/dist/_chunks/{city-input-CJVGswxp.js → city-input-CA59CjnV.js} +2 -2
- package/dist/_chunks/{city-input-CJVGswxp.js.map → city-input-CA59CjnV.js.map} +1 -1
- package/dist/_chunks/{combobox-CDPm_n0p.js → combobox-D-gpgEDy.js} +314 -294
- package/dist/_chunks/combobox-D-gpgEDy.js.map +1 -0
- package/dist/_chunks/{country-select-DQ8q7ypA.js → country-select-BfmX9y5i.js} +2 -2
- package/dist/_chunks/{country-select-DQ8q7ypA.js.map → country-select-BfmX9y5i.js.map} +1 -1
- package/dist/_chunks/{data-table-B_IcS0Ke.js → data-table-CqQgoNsU.js} +2 -2
- package/dist/_chunks/{data-table-B_IcS0Ke.js.map → data-table-CqQgoNsU.js.map} +1 -1
- package/dist/_chunks/{face-scheme-BgJGFDTa.js → face-scheme-BKSE98bo.js} +2 -2
- package/dist/_chunks/{face-scheme-BgJGFDTa.js.map → face-scheme-BKSE98bo.js.map} +1 -1
- package/dist/_chunks/{file-manager-C9YOT-Dn.js → file-manager-BnI1ZWZu.js} +2 -2
- package/dist/_chunks/{file-manager-C9YOT-Dn.js.map → file-manager-BnI1ZWZu.js.map} +1 -1
- package/dist/_chunks/{header-settings-BVhjndtV.js → header-settings-BeA2fnol.js} +24 -23
- package/dist/_chunks/header-settings-BeA2fnol.js.map +1 -0
- package/dist/_chunks/{heatmap-HTz3Jvzy.js → heatmap-fCxwNz2o.js} +2 -2
- package/dist/_chunks/{heatmap-HTz3Jvzy.js.map → heatmap-fCxwNz2o.js.map} +1 -1
- package/dist/_chunks/{link-cell-renderer-C0ynDik7.js → link-cell-renderer-CnCgudvq.js} +3 -3
- package/dist/_chunks/{link-cell-renderer-C0ynDik7.js.map → link-cell-renderer-CnCgudvq.js.map} +1 -1
- package/dist/_chunks/{login-dev-card-DYwbL5sD.js → login-dev-card-BZBR58mu.js} +2 -2
- package/dist/_chunks/{login-dev-card-DYwbL5sD.js.map → login-dev-card-BZBR58mu.js.map} +1 -1
- package/dist/_chunks/{map-view-Bvi06RVh.js → map-view-UrNgxBy3.js} +260 -237
- package/dist/_chunks/map-view-UrNgxBy3.js.map +1 -0
- package/dist/_chunks/{index.modern-BeRXQVdc.js → maps-core-gate-DkNqGkm3.js} +360 -319
- package/dist/_chunks/maps-core-gate-DkNqGkm3.js.map +1 -0
- package/dist/_chunks/{marketplace-app-shell-x_abo_ye.js → marketplace-app-shell-CmZx0Oam.js} +2 -2
- package/dist/_chunks/{marketplace-app-shell-x_abo_ye.js.map → marketplace-app-shell-CmZx0Oam.js.map} +1 -1
- package/dist/_chunks/{notes-panel-CZO1qsD-.js → notes-panel-Dywo6R55.js} +2 -2
- package/dist/_chunks/{notes-panel-CZO1qsD-.js.map → notes-panel-Dywo6R55.js.map} +1 -1
- package/dist/_chunks/{patient-details-D0P5eog5.js → patient-details-BUr7Oemx.js} +2 -2
- package/dist/_chunks/{patient-details-D0P5eog5.js.map → patient-details-BUr7Oemx.js.map} +1 -1
- package/dist/_chunks/{patient-field-row-R73dZJY6.js → patient-field-row-bJk8Q_qr.js} +5 -5
- package/dist/_chunks/{patient-field-row-R73dZJY6.js.map → patient-field-row-bJk8Q_qr.js.map} +1 -1
- package/dist/_chunks/patient-search-Ca9j5cWb.js +1306 -0
- package/dist/_chunks/patient-search-Ca9j5cWb.js.map +1 -0
- package/dist/_chunks/{patient-summary-card-6U74-ivO.js → patient-summary-card-CCQZ8X37.js} +2 -2
- package/dist/_chunks/{patient-summary-card-6U74-ivO.js.map → patient-summary-card-CCQZ8X37.js.map} +1 -1
- package/dist/_chunks/{periodontal-diagnosis-B9YmmVmM.js → periodontal-diagnosis-DD3hrg9X.js} +2 -2
- package/dist/_chunks/{periodontal-diagnosis-B9YmmVmM.js.map → periodontal-diagnosis-DD3hrg9X.js.map} +1 -1
- package/dist/_chunks/{permission-matrix-BoQjENGV.js → permission-matrix-BJ6sg3Zp.js} +3 -3
- package/dist/_chunks/{permission-matrix-BoQjENGV.js.map → permission-matrix-BJ6sg3Zp.js.map} +1 -1
- package/dist/_chunks/{practice-results-B61krlwu.js → practice-results-DQuOfqej.js} +2 -2
- package/dist/_chunks/{practice-results-B61krlwu.js.map → practice-results-DQuOfqej.js.map} +1 -1
- package/dist/_chunks/{province-select-CPdTwEob.js → province-select-D64whw0m.js} +2 -2
- package/dist/_chunks/{province-select-CPdTwEob.js.map → province-select-D64whw0m.js.map} +1 -1
- package/dist/_chunks/{registration-form-DmP3YUfp.js → registration-form-CRm6DaB9.js} +2 -2
- package/dist/_chunks/{registration-form-DmP3YUfp.js.map → registration-form-CRm6DaB9.js.map} +1 -1
- package/dist/_chunks/{reviews-panel-UzQQLb-z.js → reviews-panel-B7InBORU.js} +42 -41
- package/dist/_chunks/reviews-panel-B7InBORU.js.map +1 -0
- package/dist/_chunks/{rich-text-editor-BZTyxQBd.js → rich-text-editor-BfEu57dk.js} +3 -3
- package/dist/_chunks/{rich-text-editor-BZTyxQBd.js.map → rich-text-editor-BfEu57dk.js.map} +1 -1
- package/dist/_chunks/{slot-grid-Bb13H9Rl.js → slot-grid-DrwynKeN.js} +91 -89
- package/dist/_chunks/{slot-grid-Bb13H9Rl.js.map → slot-grid-DrwynKeN.js.map} +1 -1
- package/dist/_chunks/{task-editor-BOETWbjU.js → task-editor-CI1SKUNc.js} +2 -2
- package/dist/_chunks/{task-editor-BOETWbjU.js.map → task-editor-CI1SKUNc.js.map} +1 -1
- package/dist/_chunks/{use-appointment-details-read-CWN-nJCZ.js → use-appointment-details-read-BytPq3Ux.js} +2 -2
- package/dist/_chunks/{use-appointment-details-read-CWN-nJCZ.js.map → use-appointment-details-read-BytPq3Ux.js.map} +1 -1
- package/dist/_chunks/{voice-control-panel-BziKE-KK.js → voice-control-panel-BP0otrID.js} +2 -2
- package/dist/_chunks/{voice-control-panel-BziKE-KK.js.map → voice-control-panel-BP0otrID.js.map} +1 -1
- package/dist/_chunks/{workflow-webhook-action-DulCpCRz.js → workflow-webhook-action-B_nBJ_ht.js} +2 -2
- package/dist/_chunks/{workflow-webhook-action-DulCpCRz.js.map → workflow-webhook-action-B_nBJ_ht.js.map} +1 -1
- package/dist/agent-catalog.json +2 -2
- package/dist/agent-i18n/en.json +1 -1
- package/dist/components/_shared/maps-core-gate.d.ts +18 -0
- package/dist/components/_shared/maps-core-gate.d.ts.map +1 -0
- package/dist/components/address-autocomplete/address-autocomplete.d.ts.map +1 -1
- package/dist/components/address-autocomplete/index.js +1 -1
- package/dist/components/address-fields/index.js +1 -1
- package/dist/components/ai-permission-notice/index.js +1 -1
- package/dist/components/appointment-details-panel/index.js +1 -1
- package/dist/components/autocomplete/autocomplete.agent.d.ts.map +1 -1
- package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/index.js +1 -1
- package/dist/components/booking/booking.d.ts.map +1 -1
- package/dist/components/booking/details-form.d.ts.map +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/checkbox-group/index.js +1 -1
- package/dist/components/city-input/index.js +1 -1
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/country-select/index.js +1 -1
- package/dist/components/data-table/index.js +2 -2
- package/dist/components/face-scheme/index.js +1 -1
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/header-settings/header-settings.d.ts +2 -1
- package/dist/components/header-settings/header-settings.d.ts.map +1 -1
- package/dist/components/header-settings/index.js +1 -1
- package/dist/components/heatmap/index.js +1 -1
- package/dist/components/map-view/index.js +1 -1
- package/dist/components/map-view/map-view.d.ts.map +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-search/index.js +1 -1
- package/dist/components/patient-search/patient-search.d.ts.map +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/periodontal-diagnosis/index.js +1 -1
- package/dist/components/permission-matrix/index.js +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/province-select/index.js +1 -1
- package/dist/components/reviews-panel/index.js +1 -1
- package/dist/components/reviews-panel/reviews-panel.d.ts.map +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/slot-grid/index.js +1 -1
- package/dist/components/slot-grid/slot-grid.d.ts.map +1 -1
- package/dist/components/task-editor/index.js +1 -1
- package/dist/components/voice-control-panel/index.js +1 -1
- package/dist/host-compat.css +1 -10
- package/dist/index.js +37 -37
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/login-form/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/registration-form/index.js +1 -1
- package/dist/patterns/workflow-webhook-action/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/address-autocomplete-bPR2mNBt.js +0 -498
- package/dist/_chunks/address-autocomplete-bPR2mNBt.js.map +0 -1
- package/dist/_chunks/autocomplete-CnB1mHGc.js +0 -539
- package/dist/_chunks/autocomplete-CnB1mHGc.js.map +0 -1
- package/dist/_chunks/booking-C0FoW8Yx.js.map +0 -1
- package/dist/_chunks/checkbox-BjDv-r3o.js.map +0 -1
- package/dist/_chunks/combobox-CDPm_n0p.js.map +0 -1
- package/dist/_chunks/header-settings-BVhjndtV.js.map +0 -1
- package/dist/_chunks/index.modern-BeRXQVdc.js.map +0 -1
- package/dist/_chunks/map-view-Bvi06RVh.js.map +0 -1
- package/dist/_chunks/patient-search-CCOUZABE.js +0 -1196
- package/dist/_chunks/patient-search-CCOUZABE.js.map +0 -1
- package/dist/_chunks/reviews-panel-UzQQLb-z.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox-BjDv-r3o.js","sources":["../../src/components/checkbox/checkbox-group-context.ts","../../src/components/checkbox/checkbox.agent.ts","../../src/components/checkbox/checkbox.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nexport interface CheckboxGroupContextShape {\n name?: string;\n value: Set<string>;\n toggle: (itemValue: string) => void;\n disabled: boolean;\n}\n\nexport const CheckboxGroupContext =\n createContext<CheckboxGroupContextShape | null>(null);\n\nexport function useCheckboxGroup(): CheckboxGroupContextShape | null {\n return useContext(CheckboxGroupContext);\n}\n","/* -------------------------------------------------------------------- */\n/* Agent adapter — Checkbox. */\n/* */\n/* See `src/docs/26-agent-readiness.mdx` for the contract. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { CheckboxHandle } from './checkbox';\n\nexport const checkboxAgent: AgentAdapter<CheckboxHandle> = {\n id: 'checkbox',\n // A checkbox is a boolean toggle, not a one-of-N picker — `set_value`,\n // not `select_single` (which is reserved for choosing one item among many).\n capabilities: ['set_value'],\n state: {\n checked: {\n type: 'boolean | \"indeterminate\"',\n descriptionKey: 'ui.agent.checkbox.state.checked',\n description: 'Current checked state.',\n read: (handle) => handle.getChecked(),\n },\n },\n actions: {\n set_checked: {\n safety: 'write',\n argsType: '{ checked: boolean | \"indeterminate\" }',\n argsSchema: {\n type: 'object',\n properties: {\n checked: {\n oneOf: [{ type: 'boolean' }, { const: 'indeterminate' }],\n description:\n 'Target state: true, false, or the tri-state \"indeterminate\".',\n },\n },\n required: ['checked'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.checkbox.actions.setChecked',\n description: 'Set the checked state to a specific value.',\n examples: [{ args: { checked: true }, note: 'Tick the box.' }],\n invoke: (handle, args: { checked: boolean | 'indeterminate' }) => {\n handle.setChecked(args.checked);\n },\n },\n toggle: {\n safety: 'write',\n descriptionKey: 'ui.agent.checkbox.actions.toggle',\n description: 'Flip the checked state between checked and unchecked.',\n invoke: (handle) => {\n handle.toggle();\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'checkbox',\n description: 'Marks the Checkbox wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n },\n};\n","import {\n forwardRef,\n useId,\n useMemo,\n useRef,\n type ComponentPropsWithoutRef,\n type ReactNode,\n} from 'react';\nimport * as RadixCheckbox from '@radix-ui/react-checkbox';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useControllableState } from '../../hooks/use-controllable-state';\nimport { useCheckboxGroup } from './checkbox-group-context';\nimport { Tooltip } from '../tooltip';\nimport { useAgentRegistration } from '../../agent';\nimport { checkboxAgent } from './checkbox.agent';\n\n/** Agent-readiness curated handle for Checkbox. */\nexport interface CheckboxHandle {\n getChecked: () => boolean | 'indeterminate';\n setChecked: (checked: boolean | 'indeterminate') => void;\n toggle: () => void;\n}\n\nconst drawClasses = [\n 'ds:[stroke-dasharray:1] ds:[stroke-dashoffset:1]',\n 'ds:animate-[checkbox-indicator-draw_var(--animation-duration)_ease-out_forwards]',\n].join(' ');\n\nfunction CheckIcon({ className }: { className?: string }) {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"3\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n data-slot=\"checkbox-check-icon\"\n className={className}\n >\n <path pathLength=\"1\" d=\"M5 12l5 5L20 7\" className={drawClasses} />\n </svg>\n );\n}\n\nfunction IndeterminateIcon({ className }: { className?: string }) {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"3\"\n strokeLinecap=\"round\"\n aria-hidden=\"true\"\n data-slot=\"checkbox-indeterminate-icon\"\n className={className}\n >\n <path pathLength=\"1\" d=\"M5 12h14\" className={drawClasses} />\n </svg>\n );\n}\n\nconst checkboxVariants = cva(\n [\n 'ds:inline-flex ds:items-center ds:justify-center ds:shrink-0',\n // The off-state edge is all that marks the box, so `--border` is\n // re-pointed at the 3:1 `--control-border` here. A host still on an\n // older token sheet lacks this class and keeps the soft edge.\n 'ds:[--border:var(--control-border)]',\n 'ds:border ds:border-border ds:rounded-[var(--radius-sm)] ds:bg-background',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:disabled:cursor-not-allowed ds:disabled:opacity-50',\n 'ds:data-[state=checked]:bg-primary ds:data-[state=checked]:border-primary',\n 'ds:data-[state=indeterminate]:bg-primary ds:data-[state=indeterminate]:border-primary',\n 'ds:relative ds:before:absolute ds:before:inset-[calc((var(--min-target-size)-100%)/-2)] ds:before:content-[\"\"]',\n ].join(' '),\n {\n variants: {\n // Per-size `mt` centers the box optically on the first line of the\n // label using the type-label line-box height — important when the\n // label wraps, because the wrapper uses `items-start` so children\n // align to the top edge rather than the multi-line block's centre.\n size: {\n sm: 'ds:size-3.5 ds:mt-[calc((var(--type-label-size)*var(--type-label-line-height)-0.875rem)/2)]',\n md: 'ds:size-4 ds:mt-[calc((var(--type-label-size)*var(--type-label-line-height)-1rem)/2)]',\n lg: 'ds:size-5 ds:mt-[calc((var(--type-label-size)*var(--type-label-line-height)-1.25rem)/2)]',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\ntype RadixRootProps = ComponentPropsWithoutRef<typeof RadixCheckbox.Root>;\n\nexport interface CheckboxProps\n extends\n Omit<RadixRootProps, 'checked' | 'onCheckedChange' | 'children'>,\n VariantProps<typeof checkboxVariants> {\n /**\n * Visible label rendered next to the box. Accepts a string or any React\n * node — useful for consent labels that embed a privacy / T&C link.\n */\n label: ReactNode;\n checked?: boolean | 'indeterminate';\n onCheckedChange?: (checked: boolean | 'indeterminate') => void;\n size?: 'sm' | 'md' | 'lg';\n disabledReason?: string;\n value?: string;\n}\n\nexport const Checkbox = forwardRef<HTMLButtonElement, CheckboxProps>(\n (\n {\n label,\n checked,\n onCheckedChange,\n size = 'md',\n disabled,\n disabledReason,\n name,\n value,\n id,\n className,\n ...props\n },\n ref,\n ) => {\n const generatedId = useId();\n const checkboxId = id ?? generatedId;\n const group = useCheckboxGroup();\n\n const inGroup = group !== null && value !== undefined;\n const [ownCheckedRaw, setOwnChecked] = useControllableState<\n boolean | 'indeterminate'\n >({\n value: checked,\n defaultValue: false,\n onChange: onCheckedChange,\n });\n const ownChecked = ownCheckedRaw ?? false;\n const effectiveChecked = inGroup ? group.value.has(value) : ownChecked;\n const effectiveOnChange = inGroup\n ? () => group.toggle(value)\n : (next: boolean | 'indeterminate') => {\n setOwnChecked(next);\n };\n const effectiveName = group?.name ?? name;\n const effectiveDisabled = group?.disabled || disabled;\n\n const checkedRef = useRef<boolean | 'indeterminate'>(\n effectiveChecked ?? false,\n );\n checkedRef.current = effectiveChecked ?? false;\n\n const agentHandle = useMemo<CheckboxHandle>(\n () => ({\n getChecked: () => checkedRef.current,\n setChecked: (next) => {\n if (inGroup) {\n // Inside a group: toggle implements set via the group context.\n const isOn =\n checkedRef.current === true ||\n checkedRef.current === 'indeterminate';\n const want = next === true || next === 'indeterminate';\n if (isOn !== want) group.toggle(value);\n return;\n }\n setOwnChecked(next);\n },\n toggle: () => {\n if (inGroup) {\n group.toggle(value);\n return;\n }\n const next =\n checkedRef.current === true ||\n checkedRef.current === 'indeterminate'\n ? false\n : true;\n setOwnChecked(next);\n },\n }),\n [inGroup, group, value, setOwnChecked],\n );\n useAgentRegistration(checkboxAgent, agentHandle, id);\n\n // `text-primary-foreground` lives on the SVG (not the <button> Root) so\n // a legacy consumer rule like `button, input, … { color: inherit }`\n // can't intercept it — the unlayered consumer rule would beat any\n // @layer utilities rule on the button itself, leaving the tick paint\n // (currentColor) inheriting the consumer's body text colour. See\n // styles.css for the matching form-element revert inside [data-component].\n const iconSizeClass = [\n 'ds:text-primary-foreground',\n size === 'sm' ? 'ds:size-3' : size === 'lg' ? 'ds:size-4' : 'ds:size-3.5',\n ].join(' ');\n\n const labelClasses = [\n 'type-label ds:text-foreground ds:select-none',\n effectiveDisabled\n ? 'ds:cursor-not-allowed ds:opacity-50'\n : 'ds:cursor-pointer',\n ].join(' ');\n\n const content = (\n <div\n data-component=\"checkbox\"\n data-component-id={id}\n data-option-id={value}\n className=\"ds:inline-flex ds:items-start ds:gap-[var(--spacing-sm)]\"\n >\n <RadixCheckbox.Root\n ref={ref}\n id={checkboxId}\n checked={effectiveChecked}\n onCheckedChange={effectiveOnChange}\n disabled={effectiveDisabled}\n aria-disabled={effectiveDisabled || undefined}\n name={effectiveName}\n value={value}\n className={checkboxVariants({ size, className })}\n {...props}\n >\n <RadixCheckbox.Indicator>\n {effectiveChecked === 'indeterminate' ? (\n <IndeterminateIcon className={iconSizeClass} />\n ) : (\n <CheckIcon className={iconSizeClass} />\n )}\n </RadixCheckbox.Indicator>\n </RadixCheckbox.Root>\n <label htmlFor={checkboxId} className={labelClasses}>\n {label}\n </label>\n </div>\n );\n\n if (effectiveDisabled && disabledReason) {\n return <Tooltip label={disabledReason}>{content}</Tooltip>;\n }\n\n return content;\n },\n);\n\nCheckbox.displayName = 'Checkbox';\n"],"names":["CheckboxGroupContext","createContext","useCheckboxGroup","useContext","checkboxAgent","handle","args","drawClasses","CheckIcon","className","jsx","IndeterminateIcon","checkboxVariants","cva","Checkbox","forwardRef","label","checked","onCheckedChange","size","disabled","disabledReason","name","value","id","props","ref","generatedId","useId","checkboxId","group","inGroup","ownCheckedRaw","setOwnChecked","useControllableState","effectiveChecked","effectiveOnChange","next","effectiveName","effectiveDisabled","checkedRef","useRef","agentHandle","useMemo","useAgentRegistration","iconSizeClass","labelClasses","content","jsxs","RadixCheckbox","Tooltip"],"mappings":";;;;;;;AASO,MAAMA,IACXC,EAAgD,IAAI;AAE/C,SAASC,IAAqD;AACnE,SAAOC,EAAWH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AAA,MACA1B,MAAS,OAAO,cAAcA,MAAS,OAAO,cAAc;AAAA,IAAA,EAC5D,KAAK,GAAG,GAEJ2B,IAAe;AAAA,MACnB;AAAA,MACAP,IACI,wCACA;AAAA,IAAA,EACJ,KAAK,GAAG,GAEJQ,IACJ,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,kBAAe;AAAA,QACf,qBAAmBxB;AAAA,QACnB,kBAAgBD;AAAA,QAChB,WAAU;AAAA,QAEV,UAAA;AAAA,UAAA,gBAAAb;AAAA,YAACuC,EAAc;AAAA,YAAd;AAAA,cACC,KAAAvB;AAAA,cACA,IAAIG;AAAA,cACJ,SAASM;AAAA,cACT,iBAAiBC;AAAA,cACjB,UAAUG;AAAA,cACV,iBAAeA,KAAqB;AAAA,cACpC,MAAMD;AAAA,cACN,OAAAf;AAAA,cACA,WAAWX,EAAiB,EAAE,MAAAO,GAAM,WAAAV,GAAW;AAAA,cAC9C,GAAGgB;AAAA,cAEJ,UAAA,gBAAAf,EAACuC,EAAc,WAAd,EACE,gBAAqB,kBACpB,gBAAAvC,EAACC,GAAA,EAAkB,WAAWkC,GAAe,IAE7C,gBAAAnC,EAACF,GAAA,EAAU,WAAWqC,GAAe,EAAA,CAEzC;AAAA,YAAA;AAAA,UAAA;AAAA,4BAED,SAAA,EAAM,SAAShB,GAAY,WAAWiB,GACpC,UAAA9B,EAAA,CACH;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAIJ,WAAIuB,KAAqBlB,IAChB,gBAAAX,EAACwC,GAAA,EAAQ,OAAO7B,GAAiB,UAAA0B,GAAQ,IAG3CA;AAAA,EACT;AACF;AAEAjC,EAAS,cAAc;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-CDPm_n0p.js","sources":["../../src/components/combobox/combobox.agent.ts","../../src/components/combobox/combobox.tsx"],"sourcesContent":["import type { AgentAdapter } from '../../agent/types';\nimport type { ComboboxHandle } from './combobox';\n\nexport const comboboxAgent: AgentAdapter<ComboboxHandle> = {\n id: 'combobox',\n // Persisted single choice (value state + set_value) → select_single + set_value,\n // plus type-to-filter and open/close of the option list.\n capabilities: ['select_single', 'set_value', 'filter', 'open', 'close'],\n state: {\n value: {\n type: 'string | null',\n descriptionKey: 'ui.agent.combobox.state.value',\n description:\n 'Currently-selected option value, or null when nothing is selected.',\n read: (handle) => handle.getValue(),\n },\n query: {\n type: 'string',\n descriptionKey: 'ui.agent.combobox.state.query',\n description: 'Current filter query in the combobox input.',\n read: (handle) => handle.getQuery(),\n },\n isOpen: {\n type: 'boolean',\n descriptionKey: 'ui.agent.combobox.state.isOpen',\n description: 'True when the option list is visible.',\n read: (handle) => handle.getIsOpen(),\n },\n },\n actions: {\n set_value: {\n // Persists the user's chosen option — reversible via the same UI.\n safety: 'write',\n argsType: '{ value: string | null }',\n argsSchema: {\n type: 'object',\n properties: {\n value: {\n type: ['string', 'null'],\n description: 'Option value to select, or null to clear.',\n },\n },\n required: ['value'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.combobox.actions.setValue',\n description: 'Set the selected value programmatically.',\n examples: [{ args: { value: 'it' }, note: 'Select the \"it\" option.' }],\n invoke: (handle, args: { value: string | null }) => {\n handle.setValue(args.value);\n },\n },\n apply_filter: {\n // Pure ephemeral filter of the visible options — no persisted change.\n safety: 'read',\n argsType: '{ query: string }',\n argsSchema: {\n type: 'object',\n properties: {\n query: { type: 'string', description: 'Filter text for the list.' },\n },\n required: ['query'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.combobox.actions.applyFilter',\n description: 'Set the filter query for the option list.',\n invoke: (handle, args: { query: string }) => {\n handle.setQuery(args.query);\n },\n },\n clear_selection: {\n // Discards the persisted choice — destructive (loses the selection).\n safety: 'destructive',\n idempotent: true,\n descriptionKey: 'ui.agent.combobox.actions.clearSelection',\n description: 'Clear the current selection.',\n invoke: (handle) => {\n handle.clear();\n },\n },\n open: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.combobox.actions.open',\n description: 'Open the option list.',\n invoke: (handle) => {\n handle.open();\n },\n },\n close: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.combobox.actions.close',\n description: 'Close the option list.',\n invoke: (handle) => {\n handle.close();\n },\n },\n },\n domHooks: {\n root: { attr: 'data-component', value: 'combobox' },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop.',\n },\n item: {\n attr: 'data-option-id',\n description: 'Each option emits its value as data-option-id.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type KeyboardEvent,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react';\nimport * as Popover from '@radix-ui/react-popover';\nimport { Command, defaultFilter, useCommandState } from 'cmdk';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Check, X } from 'lucide-react';\nimport {\n FormFieldContext,\n useFormField,\n useFormFieldControlRef,\n} from '../form-field/form-field-context';\nimport type { OptionShape } from '../_shared/option';\nimport { composeRefs } from '../_shared/compose-refs';\nimport { normalizeDiacritics } from '../_shared/normalize-diacritics';\nimport { groupOptions } from '../_shared/group-options';\nimport { MENU_ROW_HIGHLIGHT } from '../_shared/menu-row';\nimport {\n OPTION_BODY_CLASSES,\n OPTION_END_CLASSES,\n OPTION_LABEL_ROW_CLASSES,\n optionDescriptionVariants,\n optionLabelVariants,\n} from '../_shared/option-row';\nimport { useControllableState } from '../../hooks/use-controllable-state';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport {\n INPUT_SURFACE_CHROME,\n INPUT_SURFACE_HEIGHT,\n INPUT_SURFACE_PADDING_X,\n INPUT_SURFACE_TONE,\n} from '../_shared/input-surface';\nimport { useAgentRegistration } from '../../agent';\nimport { comboboxAgent } from './combobox.agent';\n\nexport type ComboboxOption<T extends string = string> = OptionShape<T>;\n\n// Curated agent-readiness handle — see combobox.agent.ts.\nexport interface ComboboxHandle {\n getValue: () => string | null;\n getQuery: () => string;\n getIsOpen: () => boolean;\n setValue: (value: string | null) => void;\n setQuery: (query: string) => void;\n clear: () => void;\n open: () => void;\n close: () => void;\n}\n\nexport interface ComboboxProps<T extends string = string> {\n options: ComboboxOption<T>[];\n value?: T | '';\n defaultValue?: T;\n onValueChange?: (value: T | '') => void;\n placeholder?: string;\n clearable?: boolean;\n disabled?: boolean;\n readOnly?: boolean;\n required?: boolean;\n name?: string;\n id?: string;\n size?: 'sm' | 'md' | 'lg';\n tone?: 'default' | 'error';\n /** Custom score. All three arguments are diacritics-stripped and\n * lower-cased. `label` is the option's label ('' for the create row).\n * The filter is not consulted while the query is still the chosen\n * option's own label: then every option shows. */\n filter?: (value: string, search: string, label: string) => number;\n allowCreate?: boolean;\n onCreate?: (value: string) => void;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n /** Query typed by the user (including IME commits and Clear), or set\n * through the agent handle. Selection and closing do not emit queries.\n * Pair with `filter` for host-provided results and `emptyMessage` for\n * their state. This callback also fires when there are no options. */\n onQueryChange?: (query: string) => void;\n emptyMessage?: ReactNode;\n 'aria-label'?: string;\n /**\n * Invalid-state fallback for use OUTSIDE a `<FormField>` (e.g. an inline\n * editor). Inside a FormField the context wins. Drives the error border and\n * the input's `aria-invalid`.\n */\n 'aria-invalid'?: boolean;\n /**\n * Error-message id fallback for use OUTSIDE a `<FormField>`. Inside a\n * FormField the context's `describedBy` wins.\n */\n 'aria-describedby'?: string;\n /**\n * The input's HTML `autocomplete` token (e.g. `country`,\n * `address-level1`, WCAG 2.1 §1.3.5). With a token, the browser can fill\n * the field from a saved address: text it fills in is matched to an\n * option (see `matchAutofill`) and that option is chosen.\n */\n autoComplete?: string;\n /**\n * Which option the browser's filled-in text means: return its `value`,\n * or `undefined` for none. Used only with `autoComplete`. The default\n * matches an option's value or label, ignoring case and accents.\n */\n matchAutofill?: (text: string) => string | undefined;\n /**\n * Let a long option label wrap onto a second line instead of ending in an\n * ellipsis. Longer still, it is clipped after two lines. Off by default.\n * An option's `description` always sits on its own line under the label.\n */\n wrapOptionLabels?: boolean;\n className?: string;\n}\n\nconst comboboxInputVariants = cva(\n [\n 'ds:peer ds:w-full ds:bg-transparent ds:text-foreground ds:placeholder:text-muted-foreground',\n 'ds:outline-none ds:border-0',\n 'ds:disabled:cursor-not-allowed',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:text-[length:var(--font-size-sm)]',\n md: 'ds:text-[length:var(--font-size-base)]',\n lg: 'ds:text-[length:var(--font-size-lg)]',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\nconst comboboxWrapperVariants = cva(\n [\n 'ds:group ds:relative ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)] ds:w-full',\n INPUT_SURFACE_CHROME,\n ].join(' '),\n {\n variants: {\n size: {\n sm: `${INPUT_SURFACE_HEIGHT.sm} ${INPUT_SURFACE_PADDING_X.sm}`,\n md: `${INPUT_SURFACE_HEIGHT.md} ${INPUT_SURFACE_PADDING_X.md}`,\n lg: `${INPUT_SURFACE_HEIGHT.lg} ${INPUT_SURFACE_PADDING_X.lg}`,\n },\n tone: INPUT_SURFACE_TONE,\n },\n defaultVariants: {\n size: 'md',\n tone: 'default',\n },\n },\n);\n\nconst comboboxContentVariants = cva(\n [\n 'ds:z-[var(--z-popover)] ds:overflow-hidden ds:w-[var(--radix-popover-trigger-width)]',\n // A guard: the list is as wide as the field, so only a field that is\n // itself wider than the screen could take it past the edge.\n 'ds:max-w-[var(--radix-popover-content-available-width)]',\n 'ds:rounded-[var(--radius-md)] ds:border ds:border-border ds:bg-background ds:text-foreground',\n 'ds:shadow-[var(--shadow-lg)]',\n 'ds:animate-in ds:fade-in ds:zoom-in-95',\n 'ds:data-[state=closed]:animate-out ds:data-[state=closed]:fade-out',\n 'ds:data-[state=closed]:zoom-out-95',\n 'ds:data-[side=bottom]:slide-in-from-top-2',\n 'ds:data-[side=top]:slide-in-from-bottom-2',\n 'ds:motion-reduce:animate-none',\n ].join(' '),\n);\n\nconst comboboxItemVariants = cva(\n [\n 'ds:relative ds:flex ds:cursor-pointer ds:items-center ds:gap-[var(--spacing-sm)]',\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:text-foreground ds:outline-none ds:select-none',\n MENU_ROW_HIGHLIGHT.selected,\n 'ds:aria-disabled:pointer-events-none ds:aria-disabled:opacity-50',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:min-h-8 ds:ps-3 ds:pe-3 ds:text-[length:var(--font-size-sm)]',\n md: 'ds:min-h-[var(--min-target-size)] ds:ps-3 ds:pe-3 ds:text-[length:var(--font-size-base)]',\n lg: 'ds:min-h-12 ds:ps-4 ds:pe-4 ds:text-[length:var(--font-size-lg)]',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\nconst comboboxGroupHeadingClasses = [\n 'ds:ps-3 ds:pe-3 ds:py-1.5',\n 'type-eyebrow ds:text-muted-foreground',\n].join(' ');\n\nconst comboboxListClasses =\n 'ds:max-h-[18rem] ds:overflow-y-auto ds:p-[var(--spacing-xs)]';\n\nconst comboboxEmptyClasses =\n 'ds:ps-3 ds:pe-3 ds:py-2 type-body-sm ds:text-muted-foreground';\n\nconst iconSizeBySize = {\n sm: 'ds:size-3.5',\n md: 'ds:size-4',\n lg: 'ds:size-5',\n} as const;\n\ninterface CreateRowProps {\n search: string;\n label: string;\n iconClass: string;\n size: 'sm' | 'md' | 'lg';\n onSelect: (value: string) => void;\n}\n\nfunction ComboboxCreateRow({\n search,\n label,\n iconClass,\n size,\n onSelect,\n}: CreateRowProps): ReactElement | null {\n // Only surface the create row when no existing item matches the query.\n const filteredCount = useCommandState((state) => state.filtered.count);\n if (filteredCount > 0) return null;\n return (\n <Command.Item\n value={`__combobox-create__${search}`}\n keywords={[]}\n forceMount\n onSelect={() => onSelect(search)}\n className={comboboxItemVariants({ size })}\n >\n <span\n aria-hidden=\"true\"\n className={`ds:inline-flex ds:items-center ds:justify-center ${iconClass}`}\n />\n <span className=\"ds:flex-1 ds:truncate\">{label}</span>\n </Command.Item>\n );\n}\n\nconst ComboboxImpl = forwardRef<HTMLInputElement, ComboboxProps>(\n function Combobox(\n {\n options,\n value,\n defaultValue,\n onValueChange,\n placeholder,\n clearable = false,\n disabled,\n readOnly,\n required,\n name,\n id,\n size = 'md',\n tone = 'default',\n filter: externalFilter,\n allowCreate = false,\n onCreate,\n open: openProp,\n onOpenChange,\n onQueryChange,\n emptyMessage,\n className,\n 'aria-label': ariaLabel,\n 'aria-invalid': ariaInvalid,\n 'aria-describedby': ariaDescribedBy,\n autoComplete,\n matchAutofill,\n wrapOptionLabels = false,\n },\n ref,\n ) {\n const { t } = useTranslation('ui');\n const ctx = useFormField();\n const inFormField = useContext(FormFieldContext) !== null;\n\n const [currentValueRaw, setComboboxValue] = useControllableState<string>({\n value,\n defaultValue: defaultValue ?? '',\n onChange: onValueChange as ((next: string) => void) | undefined,\n });\n const currentValue = currentValueRaw ?? '';\n\n const selectedOption = useMemo(\n () => options.find((o) => o.value === currentValue),\n [options, currentValue],\n );\n const selectedLabel = selectedOption?.label ?? '';\n\n const [search, setSearch] = useState<string>(selectedLabel);\n const [internalOpen, setInternalOpen] = useState(false);\n const isOpenControlled = openProp !== undefined;\n const open = isOpenControlled ? openProp : internalOpen;\n const composingRef = useRef(false);\n /* The query is still the chosen option's own label: nothing typed yet. */\n const untouched = selectedLabel !== '' && search === selectedLabel;\n\n const inputRef = useRef<HTMLInputElement>(null);\n const anchorRef = useRef<HTMLDivElement>(null);\n const listRef = useRef<HTMLDivElement>(null);\n\n /* cmdk writes its own id on the input and focuses it by that id, so\n the field's label follows that id. */\n useFormFieldControlRef(ctx, inputRef);\n\n /* cmdk's relevance sort moves DOM nodes. Remounting the list once the\n query is untouched again puts the options back in source order. */\n const [listEpoch, setListEpoch] = useState(0);\n const listMountedRef = useRef(false);\n useIsomorphicLayoutEffect(() => {\n /* The first render is already in source order. */\n if (!listMountedRef.current) {\n listMountedRef.current = true;\n return;\n }\n if (untouched) setListEpoch((n) => n + 1);\n }, [untouched]);\n\n /* Whether the user has reached a row since the list opened or the\n query changed: arrow keys, Home, End or the pointer. */\n const navigatedRef = useRef(false);\n useEffect(() => {\n navigatedRef.current = false;\n }, [search, open]);\n /* True while the kit itself makes the chosen option the active row. */\n const activatingRef = useRef(false);\n\n /* Opening on an untouched value shows the chosen option mid-list.\n Rect maths rather than scrollIntoView, which would scroll the page. */\n useIsomorphicLayoutEffect(() => {\n if (!open || !untouched || !currentValue) return;\n const list = listRef.current;\n const item = list?.querySelector<HTMLElement>(\n `[data-option-id=\"${CSS.escape(currentValue)}\"]`,\n );\n if (!list || !item) return;\n const listRect = list.getBoundingClientRect();\n const itemRect = item.getBoundingClientRect();\n /* The opening zoom scales both rects; scrollTop is unscaled. */\n const scale =\n list.offsetHeight > 0 ? listRect.height / list.offsetHeight : 1;\n const offset = (itemRect.top - listRect.top) / (scale || 1);\n const itemHeight = itemRect.height / (scale || 1);\n list.scrollTop += offset - (list.clientHeight - itemHeight) / 2;\n /* The chosen option becomes the active row, so the arrow keys move on\n from it. cmdk's pointer path sets the row and the input's\n aria-activedescendant without scrolling. */\n activatingRef.current = true;\n try {\n item.dispatchEvent(new PointerEvent('pointermove', { bubbles: true }));\n } finally {\n activatingRef.current = false;\n }\n /* Only on opening: reading the value later must not scroll. */\n }, [open]);\n\n const autofillToken =\n autoComplete && autoComplete !== 'off' ? autoComplete : undefined;\n useIsomorphicLayoutEffect(() => {\n const input = inputRef.current;\n if (!input) return;\n input.setAttribute('aria-expanded', String(open));\n /* cmdk writes autocomplete=\"off\" over the prop on every render. */\n if (autofillToken) input.setAttribute('autocomplete', autofillToken);\n });\n\n /* Text the browser fills in arrives as an input event that is not\n typing: no input type, or a replacement. The listener sits on the\n input itself, so it runs before React hands the change to cmdk. */\n const autofilledRef = useRef(false);\n useEffect(() => {\n const input = inputRef.current;\n if (!input || !autofillToken) return;\n const onInput = (event: Event) => {\n const inputType = (event as InputEvent).inputType;\n autofilledRef.current =\n !inputType || inputType === 'insertReplacementText';\n };\n input.addEventListener('input', onInput);\n return () => input.removeEventListener('input', onInput);\n }, [autofillToken]);\n\n useEffect(() => {\n if (!open) {\n setSearch(selectedLabel);\n }\n }, [selectedLabel, open]);\n\n const effectiveDisabled =\n (inFormField ? ctx.disabled : false) || Boolean(disabled);\n const effectiveReadOnly = Boolean(readOnly);\n const effectiveRequired =\n (inFormField ? ctx.required : false) || Boolean(required);\n const effectiveInvalid = inFormField ? ctx.invalid : Boolean(ariaInvalid);\n const effectiveTone = effectiveInvalid ? 'error' : tone;\n const describedBy =\n inFormField && ctx.describedBy ? ctx.describedBy : ariaDescribedBy;\n\n const resolvedPlaceholder =\n placeholder ?? t('inputs.combobox.placeholder', 'Search…');\n\n const filterFn = useMemo(\n () => (candidate: string, searchStr: string, keywords?: string[]) => {\n if (composingRef.current) return 1;\n /* Untouched query: every option shows, whatever the filter says. */\n if (selectedLabel !== '' && searchStr === selectedLabel) return 1;\n const normalizedCandidate = normalizeDiacritics(candidate);\n const normalizedSearch = normalizeDiacritics(searchStr);\n const normalizedKeywords = keywords?.map(normalizeDiacritics);\n if (externalFilter) {\n return externalFilter(\n normalizedCandidate,\n normalizedSearch,\n normalizedKeywords?.[0] ?? '',\n );\n }\n return defaultFilter(\n normalizedCandidate,\n normalizedSearch,\n normalizedKeywords,\n );\n },\n [externalFilter, selectedLabel],\n );\n\n const commit = (next: string) => {\n setComboboxValue(next);\n };\n\n const setOpen = (next: boolean) => {\n if (!isOpenControlled) setInternalOpen(next);\n onOpenChange?.(next);\n };\n\n const handleSelect = (optValue: string) => {\n const option = options.find((o) => o.value === optValue);\n commit(optValue);\n setSearch(option?.label ?? '');\n setOpen(false);\n };\n\n const handleCreate = (nextValue: string) => {\n onCreate?.(nextValue);\n setOpen(false);\n };\n\n const optionForAutofill = (text: string) => {\n const wanted = normalizeDiacritics(text.trim());\n if (!wanted) return undefined;\n const match = matchAutofill\n ? matchAutofill(text.trim())\n : options.find(\n (o) =>\n normalizeDiacritics(o.value) === wanted ||\n normalizeDiacritics(o.label) === wanted,\n )?.value;\n return options.find((o) => o.value === match && !o.disabled);\n };\n\n const handleSearchChange = (next: string) => {\n if (effectiveReadOnly) return;\n if (autofilledRef.current) {\n autofilledRef.current = false;\n const option = optionForAutofill(next);\n if (option) {\n commit(option.value);\n setSearch(option.label);\n if (open) setOpen(false);\n return;\n }\n /* Filled from another field and no option means it: the list\n must not open over a field the user is not in. */\n if (document.activeElement !== inputRef.current) {\n setSearch(selectedLabel);\n return;\n }\n }\n setSearch(next);\n if (!composingRef.current) onQueryChange?.(next);\n if (!open && next.length > 0 && !composingRef.current) {\n setOpen(true);\n }\n };\n\n const handleFocus = () => {\n if (!effectiveDisabled && !effectiveReadOnly) setOpen(true);\n };\n\n /* A pick keeps focus in the input, so no focus event follows. A\n click on the focused input reopens the list instead. */\n const handleClick = () => {\n if (!open && !effectiveDisabled && !effectiveReadOnly) setOpen(true);\n };\n\n const handleCompositionStart = () => {\n composingRef.current = true;\n };\n\n const handleCompositionEnd = () => {\n composingRef.current = false;\n if (effectiveReadOnly) return;\n const next = inputRef.current?.value ?? '';\n setSearch(next);\n onQueryChange?.(next);\n if (next.length > 0) setOpen(true);\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.nativeEvent.isComposing) return;\n if (\n (event.key === 'ArrowDown' || event.key === 'ArrowUp') &&\n !open &&\n !effectiveDisabled &&\n !effectiveReadOnly\n ) {\n /* The arrow that opens the list only opens it. The next arrow\n moves on from the chosen option, or from the top. */\n event.preventDefault();\n setOpen(true);\n return;\n }\n if (\n event.key === 'ArrowDown' ||\n event.key === 'ArrowUp' ||\n event.key === 'Home' ||\n event.key === 'End' ||\n /* cmdk's own Ctrl+N, J, P and K move the highlight too. */\n (event.ctrlKey && ['n', 'j', 'p', 'k'].includes(event.key))\n ) {\n navigatedRef.current = true;\n }\n /* Handled before cmdk sees it: Enter commits only a row the user\n reached, never from a closed list. On an untouched open the lit\n row is the chosen option, so keeping the value matches it. */\n if (\n event.key === 'Enter' &&\n (!open || (!navigatedRef.current && (untouched || search === '')))\n ) {\n event.preventDefault();\n if (open) setOpen(false);\n return;\n }\n if (event.key === 'Escape' && open) {\n event.preventDefault();\n setOpen(false);\n setSearch(selectedLabel);\n }\n };\n\n const handleClear = (event: MouseEvent<HTMLButtonElement>) => {\n event.preventDefault();\n event.stopPropagation();\n commit('');\n setSearch('');\n onQueryChange?.('');\n setOpen(true);\n inputRef.current?.focus();\n };\n\n const handleOpenChange = (next: boolean) => {\n if (effectiveReadOnly && next) return;\n setOpen(next);\n if (!next) setSearch(selectedLabel);\n };\n\n // Agent handle — refs mirror state for fresh reads.\n const valueRef = useRef<string>(currentValue);\n useEffect(() => {\n valueRef.current = currentValue;\n }, [currentValue]);\n const searchRef = useRef<string>(search);\n useEffect(() => {\n searchRef.current = search;\n }, [search]);\n const openRef = useRef<boolean>(open);\n useEffect(() => {\n openRef.current = open;\n }, [open]);\n\n const setOpenStable = useCallback(\n (next: boolean) => {\n if (!isOpenControlled) setInternalOpen(next);\n onOpenChange?.(next);\n },\n [isOpenControlled, onOpenChange],\n );\n\n const agentHandle = useMemo<ComboboxHandle>(\n () => ({\n getValue: () => valueRef.current || null,\n getQuery: () => searchRef.current,\n getIsOpen: () => openRef.current,\n setValue: (next) => {\n const v = next ?? '';\n setComboboxValue(v);\n const opt = options.find((o) => o.value === v);\n setSearch(opt?.label ?? '');\n },\n setQuery: (query) => {\n setSearch(query);\n onQueryChange?.(query);\n },\n clear: () => {\n setComboboxValue('');\n setSearch('');\n onQueryChange?.('');\n },\n open: () => setOpenStable(true),\n close: () => setOpenStable(false),\n }),\n [setComboboxValue, options, setOpenStable, onQueryChange],\n );\n useAgentRegistration(comboboxAgent, agentHandle, id);\n\n const showClear =\n clearable &&\n Boolean(currentValue) &&\n !effectiveDisabled &&\n !effectiveReadOnly;\n\n const groups = groupOptions(options);\n const iconClass = iconSizeBySize[size];\n\n return (\n <Popover.Root open={open} onOpenChange={handleOpenChange}>\n <Command\n filter={filterFn}\n shouldFilter\n loop\n // cmdk points the input's `aria-labelledby` at its own hidden\n // `<label cmdk-label>`, whose text is this `label`: it is the\n // input's accessible name. The caller's `aria-label` wins, then\n // the FormField's label. The placeholder is the last resort, so\n // the input is never unnamed.\n label={ariaLabel ?? (ctx.label || resolvedPlaceholder)}\n className=\"ds:w-full\"\n >\n <Popover.Anchor asChild>\n <div\n ref={anchorRef}\n className={comboboxWrapperVariants({\n size,\n tone: effectiveTone,\n className,\n })}\n data-component=\"combobox\"\n data-component-id={id}\n >\n <Command.Input\n ref={composeRefs(ref, inputRef)}\n value={search}\n onValueChange={handleSearchChange}\n // The picked label shows in the field: keep its direction.\n dir={selectedOption?.dir}\n name={name}\n placeholder={resolvedPlaceholder}\n disabled={effectiveDisabled}\n readOnly={effectiveReadOnly}\n required={effectiveRequired}\n autoComplete={autoComplete}\n // cmdk writes `id` and `aria-labelledby` after the props it\n // is given, so neither can be set here: the name goes through\n // the Command root's `label` above.\n aria-describedby={describedBy}\n aria-invalid={effectiveInvalid || undefined}\n onFocus={handleFocus}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n onCompositionStart={handleCompositionStart}\n onCompositionEnd={handleCompositionEnd}\n className={comboboxInputVariants({ size })}\n />\n {showClear ? (\n <button\n type=\"button\"\n aria-label={t('inputs.combobox.clear', 'Clear selection')}\n onClick={handleClear}\n onPointerDown={(event) => event.stopPropagation()}\n className={[\n 'ds:inline-flex ds:items-center ds:justify-center ds:rounded-[var(--radius-sm)]',\n 'ds:text-muted-foreground ds:hover:text-foreground',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:size-4 ds:shrink-0',\n /* A 24px hit area with no visual change. */\n \"ds:relative ds:before:absolute ds:before:inset-[calc(var(--spacing-xs)*-1)] ds:before:content-['']\",\n ].join(' ')}\n >\n <X aria-hidden=\"true\" className=\"ds:size-3.5\" />\n </button>\n ) : null}\n </div>\n </Popover.Anchor>\n <Popover.Portal forceMount>\n <Popover.Content\n // `forceMount` keeps the listbox in the DOM while the popover\n // is closed so the input's cmdk-set `aria-controls` always\n // points at a real id (axe's aria-valid-attr-value rule).\n // The CSS visibility / pointer-events is gated by data-state.\n forceMount\n hidden={!open}\n // Radix Popover.Content carries `role=\"dialog\"`; axe's\n // `aria-dialog-name` rule requires a name. Surface the\n // surrounding combobox label so the popover is named after\n // the field it serves (or fall back to the i18n default).\n aria-label={\n ariaLabel ?? t('inputs.combobox.popupLabel', 'Options')\n }\n onOpenAutoFocus={(event) => event.preventDefault()}\n onCloseAutoFocus={(event) => event.preventDefault()}\n onInteractOutside={(event) => {\n const target = event.target as Node | null;\n if (target && anchorRef.current?.contains(target)) {\n event.preventDefault();\n }\n }}\n sideOffset={4}\n align=\"start\"\n className={comboboxContentVariants()}\n >\n <Command.List\n key={listEpoch}\n ref={listRef}\n // cmdk names the listbox \"Suggestions\" in English otherwise.\n label={ariaLabel ?? (ctx.label || resolvedPlaceholder)}\n className={comboboxListClasses}\n onPointerMove={() => {\n if (!activatingRef.current) navigatedRef.current = true;\n }}\n /* The list is focusable: without this a pointer pick\n moves focus into it, then loses it to the page when\n the list hides. */\n onMouseDown={(event) => event.preventDefault()}\n >\n <Command.Empty className={comboboxEmptyClasses}>\n {/* cmdk owns the presentational wrapper. This unavailable\n option gives an empty list valid semantics without\n registering a selectable cmdk item. */}\n <div role=\"option\" aria-selected={false} aria-disabled=\"true\">\n {emptyMessage ??\n t('inputs.combobox.empty', 'No results found')}\n </div>\n </Command.Empty>\n {groups.map(({ group, items }, groupIndex) => {\n const body = items.map((option) => {\n const isSelected = option.value === currentValue;\n return (\n <Command.Item\n /* The label is in the key because cmdk only reads\n keywords when the value changes. */\n key={`${option.value}\\u0000${option.label}`}\n value={option.value}\n data-option-id={option.value}\n keywords={[option.label]}\n disabled={option.disabled}\n onSelect={handleSelect}\n className={comboboxItemVariants({ size })}\n >\n <span\n aria-hidden=\"true\"\n className={`ds:inline-flex ds:items-center ds:justify-center ${iconClass}`}\n >\n {isSelected ? <Check className={iconClass} /> : null}\n </span>\n {option.startAdornment ? (\n // Decorative by contract — the option's accessible\n // name comes from its label. Hide so a text-bearing\n // adornment can't leak into the computed name.\n <span\n aria-hidden=\"true\"\n className=\"ds:inline-flex ds:items-center ds:shrink-0\"\n >\n {option.startAdornment}\n </span>\n ) : null}\n {option.description || wrapOptionLabels ? (\n // Stacked: the label and its end content on one\n // row, the description on a line of its own\n // under them. In this DOM order the option's\n // name reads label, end content, description.\n <span\n className={`${OPTION_BODY_CLASSES} ds:py-[var(--spacing-xs)]`}\n >\n <span className={OPTION_LABEL_ROW_CLASSES}>\n <span\n dir={option.dir}\n className={optionLabelVariants({\n wrap: wrapOptionLabels,\n className: 'ds:flex-1',\n })}\n >\n {option.label}\n </span>\n {option.endContent ? (\n // Announced, as below.\n <span className={OPTION_END_CLASSES}>\n {option.endContent}\n </span>\n ) : null}\n </span>\n {option.description ? (\n <span\n className={optionDescriptionVariants({\n tone: option.descriptionTone,\n })}\n >\n {option.description}\n </span>\n ) : null}\n </span>\n ) : (\n <>\n <span\n dir={option.dir}\n className=\"ds:flex-1 ds:truncate\"\n >\n {option.label}\n </span>\n {option.endContent ? (\n // Deliberately NOT aria-hidden — unlike\n // `startAdornment`, this slot carries meaning\n // (a price, a count) and must reach the\n // option's accessible name. `ms-auto` pins it\n // to the inline-end and flips under RTL.\n <span className=\"ds:inline-flex ds:items-center ds:ms-auto ds:shrink-0\">\n {option.endContent}\n </span>\n ) : null}\n </>\n )}\n </Command.Item>\n );\n });\n if (!group) {\n return (\n <Command.Group key={`group-${groupIndex}`}>\n {body}\n </Command.Group>\n );\n }\n return (\n <Command.Group\n key={`group-${group}`}\n heading={\n <span className={comboboxGroupHeadingClasses}>\n {group}\n </span>\n }\n >\n {body}\n </Command.Group>\n );\n })}\n {allowCreate && search.length > 0 ? (\n <ComboboxCreateRow\n search={search}\n label={t('inputs.combobox.create', 'Create \"{{value}}\"', {\n value: search,\n })}\n iconClass={iconClass}\n size={size}\n onSelect={handleCreate}\n />\n ) : null}\n </Command.List>\n </Popover.Content>\n </Popover.Portal>\n </Command>\n </Popover.Root>\n );\n },\n);\nComboboxImpl.displayName = 'Combobox';\n\ninterface ComboboxComponent {\n <T extends string = string>(\n props: ComboboxProps<T> & { ref?: Ref<HTMLInputElement> },\n ): ReactElement | null;\n displayName?: string;\n}\n\n// forwardRef erases component-level generics, so we re-widen via a callable\n// interface to preserve the `<T extends string>` signature at the call site.\nexport const Combobox = ComboboxImpl as unknown as ComboboxComponent;\n\nexport {\n comboboxInputVariants,\n comboboxWrapperVariants,\n comboboxContentVariants,\n comboboxItemVariants,\n};\n"],"names":["comboboxAgent","handle","args","comboboxInputVariants","cva","comboboxWrapperVariants","INPUT_SURFACE_CHROME","INPUT_SURFACE_HEIGHT","INPUT_SURFACE_PADDING_X","INPUT_SURFACE_TONE","comboboxContentVariants","comboboxItemVariants","MENU_ROW_HIGHLIGHT","comboboxGroupHeadingClasses","comboboxListClasses","comboboxEmptyClasses","iconSizeBySize","ComboboxCreateRow","search","label","iconClass","size","onSelect","useCommandState","state","jsxs","Command","jsx","ComboboxImpl","forwardRef","options","value","defaultValue","onValueChange","placeholder","clearable","disabled","readOnly","required","name","id","tone","externalFilter","allowCreate","onCreate","openProp","onOpenChange","onQueryChange","emptyMessage","className","ariaLabel","ariaInvalid","ariaDescribedBy","autoComplete","matchAutofill","wrapOptionLabels","ref","t","useTranslation","ctx","useFormField","inFormField","useContext","FormFieldContext","currentValueRaw","setComboboxValue","useControllableState","currentValue","selectedOption","useMemo","o","selectedLabel","setSearch","useState","internalOpen","setInternalOpen","isOpenControlled","open","composingRef","useRef","untouched","inputRef","anchorRef","listRef","useFormFieldControlRef","listEpoch","setListEpoch","listMountedRef","useIsomorphicLayoutEffect","n","navigatedRef","useEffect","activatingRef","list","item","listRect","itemRect","scale","offset","itemHeight","autofillToken","input","autofilledRef","onInput","event","inputType","effectiveDisabled","effectiveReadOnly","effectiveRequired","effectiveInvalid","effectiveTone","describedBy","resolvedPlaceholder","filterFn","candidate","searchStr","keywords","normalizedCandidate","normalizeDiacritics","normalizedSearch","normalizedKeywords","defaultFilter","commit","next","setOpen","handleSelect","optValue","option","handleCreate","nextValue","optionForAutofill","text","wanted","match","_a","handleSearchChange","handleFocus","handleClick","handleCompositionStart","handleCompositionEnd","handleKeyDown","handleClear","handleOpenChange","valueRef","searchRef","openRef","setOpenStable","useCallback","agentHandle","v","opt","query","useAgentRegistration","showClear","groups","groupOptions","Popover","composeRefs","X","target","group","items","groupIndex","body","isSelected","Check","OPTION_BODY_CLASSES","OPTION_LABEL_ROW_CLASSES","optionLabelVariants","OPTION_END_CLASSES","optionDescriptionVariants","Fragment","Combobox"],"mappings":";;;;;;;;;;;;;;;;;;AAGO,MAAMA,KAA8C;AAAA,EACzD,IAAI;AAAA;AAAA;AAAA,EAGJ,cAAc,CAAC,iBAAiB,aAAa,UAAU,QAAQ,OAAO;AAAA,EACtE,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACA,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACA,MAAWA,EAAO,UAAA;AAAA,IAAU;AAAA,EACrC;AAAA,EAEF,SAAS;AAAA,IACP,WAAW;AAAA;AAAA,MAET,QAAQ;AAAA,MACR,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ndtV.js","sources":["../../src/components/header-settings/header-settings.agent.ts","../../src/components/header-settings/header-settings.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — HeaderSettings. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { HeaderSettingsHandle } from './header-settings';\n\nexport const headerSettingsAgent: AgentAdapter<HeaderSettingsHandle> = {\n id: 'header-settings',\n // Each setter persists a single preference value (locale / theme /\n // accessibility) — `set_value` semantics, not an ephemeral view switch.\n capabilities: ['set_value'],\n // Read-back for all three setters. None of these preferences is\n // recoverable from the DOM — `useTheme` resolves preference + OS into\n // a single applied class, so `theme: 'system'` and `theme: 'light'`\n // both paint `.theme-light` — and `set_locale` swallows unknown tags.\n // Without these slots an agent cannot distinguish \"switched to\n // Italian\" from \"the tag was dropped on the floor\". All four are UI\n // preferences: no PHI, no patient-identifiable data (§7).\n state: {\n locale: {\n type: 'string',\n descriptionKey: 'ui.agent.headerSettings.state.locale',\n description:\n 'Active IETF language tag (e.g. \"en\", \"it\", \"ar\"). Initially uses HTML lang first when followHtmlLang is enabled; otherwise storage, then HTML lang when initialLocaleFromHtmlLang is enabled, then the browser. Read after set_locale to confirm the switch; unknown tags leave it unchanged.',\n read: (handle) => handle.getLocale(),\n },\n theme: {\n type: \"'light' | 'dark' | 'system'\",\n descriptionKey: 'ui.agent.headerSettings.state.theme',\n description:\n \"Stored base-theme preference. `'system'` means no override is set and the OS decides — read `resolvedTheme` for what is actually painted.\",\n read: (handle) => handle.getTheme(),\n },\n accessibility: {\n type: \"'default' | 'accessible' | 'system'\",\n descriptionKey: 'ui.agent.headerSettings.state.accessibility',\n description:\n \"Stored AAA-contrast preference. `'system'` means no override is set and `prefers-contrast` decides.\",\n read: (handle) => handle.getAccessibility(),\n },\n resolvedTheme: {\n type: \"'light' | 'dark' | 'light-accessible' | 'dark-accessible'\",\n descriptionKey: 'ui.agent.headerSettings.state.resolvedTheme',\n description:\n 'The theme actually applied to the document once preference and OS signals resolve. This is what makes a `set_theme(\"system\")` or `set_accessibility(\"system\")` write verifiable.',\n read: (handle) => handle.getResolvedTheme(),\n },\n },\n actions: {\n set_locale: {\n safety: 'write',\n argsType: '{ locale: string }',\n argsSchema: {\n type: 'object',\n properties: {\n locale: {\n type: 'string',\n description:\n 'IETF language tag (e.g. \"en\", \"it\", \"ar\"). Unknown tags are silently dropped.',\n },\n },\n required: ['locale'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.headerSettings.actions.setLocale',\n description:\n \"Switch the active locale to the given IETF tag. Unknown tags are silently dropped — read the `locale` state slot afterwards to confirm. On a site with one address per language, the host may then load that language's address.\",\n errors: [\n 'Silently ignored when the tag names a locale the kit ships no bundle for — `locale` is unchanged.',\n ],\n examples: [{ args: { locale: 'it' }, note: 'Switch to Italian.' }],\n invoke: (handle, args: { locale: string }) => {\n // Validation happens inside the handle so the agent surface\n // accepts arbitrary tags and silently drops unknown ones.\n handle.setLocale(args.locale);\n },\n },\n set_theme: {\n safety: 'write',\n argsType: '{ theme: \"light\" | \"dark\" | \"system\" }',\n argsSchema: {\n type: 'object',\n properties: { theme: { enum: ['light', 'dark', 'system'] } },\n required: ['theme'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.headerSettings.actions.setTheme',\n description:\n 'Switch the theme preference. Verify with the `theme` slot (the stored preference) and `resolvedTheme` (what is actually painted).',\n examples: [\n { args: { theme: 'dark' }, note: 'Switch to the dark theme.' },\n ],\n invoke: (handle, args: { theme: 'light' | 'dark' | 'system' }) => {\n handle.setTheme(args.theme);\n },\n },\n set_accessibility: {\n safety: 'write',\n argsType: '{ accessibility: \"default\" | \"accessible\" | \"system\" }',\n argsSchema: {\n type: 'object',\n properties: {\n accessibility: {\n enum: ['default', 'accessible', 'system'],\n description:\n \"`'system'` clears the override and follows `prefers-contrast`.\",\n },\n },\n required: ['accessibility'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.headerSettings.actions.setAccessibility',\n description:\n 'Switch the accessibility preference. Verify with the `accessibility` slot (the stored preference) and `resolvedTheme` (what is actually painted).',\n examples: [\n {\n args: { accessibility: 'accessible' },\n note: 'Enable the AAA-accessible profile.',\n },\n ],\n invoke: (\n handle,\n args: { accessibility: 'default' | 'accessible' | 'system' },\n ) => {\n handle.setAccessibility(args.accessibility);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'header-settings',\n description: 'Marks the HeaderSettings wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description: 'Sourced from the id prop (forwarded via HTMLAttributes).',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type FocusEvent,\n type HTMLAttributes,\n type KeyboardEvent,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { ArrowLeft, ChevronRight, Settings } from 'lucide-react';\nimport { Button } from '../button/button';\nimport { IconButton } from '../button/icon-button';\nimport { DropdownMenu } from '../dropdown-menu/dropdown-menu';\nimport {\n LocalePicker,\n persistLocalePreference,\n reportLocaleChange,\n type LocaleChangeHandler,\n useInitialLocale,\n} from '../locale-picker/locale-picker';\nimport {\n useTheme,\n type AccessibilityPreference,\n type ResolvedTheme,\n type ThemePreference,\n} from '../../hooks';\nimport { useLocale } from '../../hooks/use-locale';\nimport { useMediaQuery } from '../../hooks/use-media-query';\nimport { useDocumentDirection } from '../../hooks/use-direction';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport { LOCALE_META, type Locale } from '../../i18n/locale-meta';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { headerSettingsAgent } from './header-settings.agent';\nimport { useLengthTokenPx } from '../_shared/length-token';\n\nfunction applyDocumentAttrs(locale: Locale): void {\n if (typeof document === 'undefined') return;\n const root = document.documentElement;\n root.lang = locale;\n root.dir = LOCALE_META[locale].dir;\n}\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst wrapperVariants = cva('ds:inline-flex ds:items-center', {\n variants: {\n align: {\n start: '',\n end: '',\n },\n },\n defaultVariants: { align: 'end' },\n});\n\n// The language flyout hosts the searchable locale list, so it takes a\n// popover width rather than the menu's minimum.\nconst languageFlyoutClasses = 'ds:w-[var(--popover-size-md)]';\n\nconst panelVariants = cva('', {\n variants: {\n language: {\n true: 'ds:[inline-size:var(--popover-size-md)] ds:[min-inline-size:0] ds:[max-inline-size:calc(100vw_-_2_*_var(--spacing-lg))] ds:[&_input]:min-w-0',\n false: '',\n },\n },\n});\n\ntype PhoneView = 'main' | 'language' | 'appearance';\n\nconst phoneRowClasses = cva(\n 'ds:flex ds:flex-1 ds:min-w-0 ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]',\n);\n\nfunction SettingRowLabel({\n label,\n value,\n lang,\n}: {\n label: string;\n value: string;\n lang?: string;\n}) {\n return (\n <span className={phoneRowClasses()}>\n <span className=\"ds:truncate\">{label}</span>\n <span\n lang={lang}\n className=\"ds:shrink-0 ds:text-muted-foreground ds:[[data-highlighted]_&]:text-current\"\n >\n {value}\n </span>\n </span>\n );\n}\n\nfunction isLocale(tag: string): tag is Locale {\n return Object.prototype.hasOwnProperty.call(LOCALE_META, tag);\n}\n\n/* ------------------------------------------------------------------ */\n/* LanguageSub */\n/* */\n/* One menu row naming the setting and showing the current language */\n/* (\"Language · English ›\"), laid out like DropdownMenu.ChoiceSub. It */\n/* opens a flyout beside the menu holding LocalePicker.SearchList, so */\n/* the 18 locales stay searchable. The flyout is a dialog, not a menu: */\n/* it holds a search combobox and a listbox, which a menu may not own. */\n/* ------------------------------------------------------------------ */\n\nfunction LanguageSub({\n locale,\n onLocaleChange,\n}: {\n locale: string;\n onLocaleChange?: LocaleChangeHandler;\n}) {\n const { t } = useTranslation('ui');\n const current = LOCALE_META[isLocale(locale) ? locale : 'en'];\n\n // Radix focuses the flyout itself when a keyboard user opens it. Hand\n // that focus on to the search field so typing filters at once.\n const handleFocus = (event: FocusEvent<HTMLDivElement>) => {\n if (event.target !== event.currentTarget) return;\n event.currentTarget\n .querySelector<HTMLInputElement>('input')\n ?.focus({ preventScroll: true });\n };\n\n // The flyout closes on the \"back\" arrow (ArrowLeft, or ArrowRight in\n // RTL). Inside the search field that key moves the caret instead,\n // unless the caret is already at the start of the field. Capture\n // phase, so Radix's own handler on the flyout never sees the key.\n const handleKeyDownCapture = (event: KeyboardEvent<HTMLDivElement>) => {\n const target = event.target;\n if (!(target instanceof HTMLInputElement)) return;\n // Keys pressed while an IME is composing (Japanese, Chinese) belong to\n // the composition, never to the menu.\n if (event.nativeEvent.isComposing) {\n event.stopPropagation();\n return;\n }\n if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') return;\n if (target.selectionStart !== 0 || target.selectionEnd !== 0) {\n event.stopPropagation();\n }\n };\n\n return (\n <DropdownMenu.Sub>\n <DropdownMenu.SubTrigger aria-haspopup=\"dialog\" data-value={current.code}>\n <span className=\"ds:flex ds:min-w-0 ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]\">\n <span className=\"ds:truncate\">\n {t('navigation.headerSettings.language.label')}\n </span>\n <span\n lang={current.code}\n className=\"ds:shrink-0 ds:text-[color:var(--muted-foreground)] ds:[[data-highlighted]_&]:text-current\"\n >\n {current.nativeName}\n </span>\n </span>\n </DropdownMenu.SubTrigger>\n {/* Radix renders a `menu`; override to `dialog` and drop the\n menu-only `aria-orientation`, which a dialog may not carry. */}\n <DropdownMenu.SubContent\n role=\"dialog\"\n aria-orientation={undefined}\n className={languageFlyoutClasses}\n onFocus={handleFocus}\n onKeyDownCapture={handleKeyDownCapture}\n // Escape that cancels an IME conversion must not close the menu.\n onEscapeKeyDown={(escapeEvent) => {\n if (escapeEvent.isComposing) escapeEvent.preventDefault();\n }}\n >\n <LocalePicker.SearchList onLocaleChange={onLocaleChange} />\n </DropdownMenu.SubContent>\n </DropdownMenu.Sub>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Public types */\n/* ------------------------------------------------------------------ */\n\nexport interface HeaderSettingsProps\n extends\n Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>,\n VariantProps<typeof wrapperVariants> {\n /** Anchor side for the dropdown. Defaults to `end` (matches LTR + RTL). */\n align?: 'start' | 'end';\n /**\n * Size of the cog trigger only. Forwards to the underlying\n * `IconButton`. Defaults to `md` to preserve the existing visual.\n * Use `sm` when composing alongside other `<Button size=\"sm\">`\n * actions in a header row — keeps the visual rhythm consistent.\n *\n * The menu itself (language, appearance and accessible-mode rows)\n * stays at kit defaults regardless — this prop only sizes the\n * trigger.\n */\n size?: 'sm' | 'md' | 'lg';\n /** Disable the trigger entirely. */\n disabled?: boolean;\n /**\n * With no saved choice, start from the page's HTML lang before falling back\n * to the browser. Defaults to false. The first locale surface's mount effect\n * decides for the app lifecycle; pass the same option to LocalePicker.\n */\n initialLocaleFromHtmlLang?: boolean;\n /**\n * The page's HTML lang decides the starting locale, ahead of a saved\n * choice. For sites with one address per language, where the address\n * decides. Defaults to false. Pass the same option to LocalePicker.\n */\n followHtmlLang?: boolean;\n /**\n * Called after a language picked in the menu (or set through the agent\n * handle) has been applied and changed the language. Not called for the\n * starting locale. A site with one address per language navigates to\n * `resolved` here.\n */\n onLocaleChange?: LocaleChangeHandler;\n}\n\nexport interface HeaderSettingsHandle {\n /**\n * Switch the active locale. Widened to `string` (vs. `Locale`) so\n * agent surfaces with untyped inputs can call through without\n * extra casting — invalid tags no-op silently.\n */\n setLocale: (next: string) => void;\n setTheme: (next: ThemePreference) => void;\n setAccessibility: (next: AccessibilityPreference) => void;\n /* ---- read-back for the three setters above -------------------- */\n /** Active IETF language tag, as i18next resolved it. */\n getLocale: () => string;\n /** Stored base-theme preference (`'system'` when no override is set). */\n getTheme: () => ThemePreference;\n /** Stored AAA-contrast preference (`'system'` when no override is set). */\n getAccessibility: () => AccessibilityPreference;\n /**\n * The theme actually painted once preference + OS signals resolve.\n * `theme: 'system'` and `theme: 'light'` both render `.theme-light`,\n * so this is what makes a `setTheme('system')` write verifiable.\n */\n getResolvedTheme: () => ResolvedTheme;\n}\n\n/* ------------------------------------------------------------------ */\n/* HeaderSettings */\n/* */\n/* Single button → single DropdownMenu surface, laid out as a View */\n/* menu: Language, Appearance (light / dark / system) and an Accessible */\n/* mode SwitchItem. On phones the lists replace the panel with a Back */\n/* row; on larger screens they open beside it. Every row uses the hooks */\n/* (`useLocale`, `useTheme`) as the standalone components, so there is */\n/* no state duplication. */\n/* ------------------------------------------------------------------ */\n\nexport const HeaderSettings = forwardRef<HTMLDivElement, HeaderSettingsProps>(\n (props, ref) => {\n const {\n align = 'end',\n size = 'md',\n disabled = false,\n initialLocaleFromHtmlLang = false,\n followHtmlLang = false,\n onLocaleChange,\n className,\n id,\n ...rest\n } = props as HeaderSettingsProps & { id?: string };\n\n const { t } = useTranslation('ui');\n const theme = useTheme();\n const { locale, setLocale: setLocaleI18n } = useLocale();\n // The language search only mounts with its flyout, so apply the saved\n // (or HTML/browser) language here, on mount.\n useInitialLocale(initialLocaleFromHtmlLang, followHtmlLang);\n const onLocaleChangeRef = useRef(onLocaleChange);\n onLocaleChangeRef.current = onLocaleChange;\n\n const forwardedRef = useRef<HTMLDivElement | null>(null);\n useImperativeHandle(ref, () => forwardedRef.current as HTMLDivElement, []);\n\n // PublicHeader uses ds:md:hidden / ds:hidden ds:md:flex for its phone\n // sheet and inline actions. Match that same Tailwind md boundary (768px).\n const isPhone = useMediaQuery('(width < 48rem)');\n const direction = useDocumentDirection();\n const [phoneView, setPhoneView] = useState<PhoneView>('main');\n const view = isPhone ? phoneView : 'main';\n const panelRef = useRef<HTMLDivElement>(null);\n const languageRowRef = useRef<HTMLDivElement>(null);\n const appearanceRowRef = useRef<HTMLDivElement>(null);\n const returnFocusRef = useRef<Exclude<PhoneView, 'main'> | null>(null);\n const activationRef = useRef('keyboard');\n\n useIsomorphicLayoutEffect(() => {\n if (!isPhone && phoneView !== 'main') {\n returnFocusRef.current = phoneView;\n setPhoneView('main');\n }\n if (view === 'language') {\n panelRef.current\n ?.querySelector<HTMLElement>(\n activationRef.current === 'keyboard' ? 'input' : 'button',\n )\n ?.focus({ preventScroll: true });\n } else if (view === 'appearance') {\n panelRef.current\n ?.querySelector<HTMLElement>('[role=\"menuitem\"]')\n ?.focus({ preventScroll: true });\n } else if (returnFocusRef.current) {\n const section = returnFocusRef.current;\n // Desktop renders SubTrigger/ChoiceSub in place of the phone rows.\n const row = isPhone\n ? (section === 'language' ? languageRowRef : appearanceRowRef).current\n : panelRef.current?.querySelector<HTMLElement>(\n `[role=\"menuitem\"][aria-haspopup=\"${section === 'language' ? 'dialog' : 'menu'}\"]`,\n );\n row?.focus({ preventScroll: true });\n returnFocusRef.current = null;\n }\n }, [isPhone, phoneView, view]);\n\n const handlePhoneRowKeyDown = (\n event: KeyboardEvent<HTMLDivElement>,\n section: Exclude<PhoneView, 'main'>,\n ) => {\n if (event.nativeEvent.isComposing) return;\n const forwardKey = direction === 'rtl' ? 'ArrowLeft' : 'ArrowRight';\n if (\n event.key === 'Enter' ||\n event.key === ' ' ||\n event.key === forwardKey\n )\n activationRef.current = 'keyboard';\n if (event.key === forwardKey) {\n event.preventDefault();\n setPhoneView(section);\n }\n };\n\n const goBack = () => {\n if (view === 'main') return;\n returnFocusRef.current = view;\n setPhoneView('main');\n };\n\n const handlePhoneKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (view === 'main') return;\n if (event.nativeEvent.isComposing) {\n event.stopPropagation();\n return;\n }\n if (event.key !== (direction === 'rtl' ? 'ArrowRight' : 'ArrowLeft'))\n return;\n const target = event.target;\n // As in LanguageSub, leave the caret alone until it reaches the start.\n if (\n target instanceof HTMLInputElement &&\n (target.selectionStart !== 0 || target.selectionEnd !== 0)\n )\n return;\n event.preventDefault();\n event.stopPropagation();\n goBack();\n };\n\n // Same side-effect chain as LocalePicker's internal helper:\n // i18next.changeLanguage → document.dir/lang → persist.\n // Share persistence and session preference with every locale picker.\n const setLocaleWithPersistence = useCallback(\n (next: Locale) => {\n void setLocaleI18n(next);\n applyDocumentAttrs(next);\n persistLocalePreference(next);\n },\n [setLocaleI18n],\n );\n const setLocaleRef = useRef(setLocaleWithPersistence);\n setLocaleRef.current = setLocaleWithPersistence;\n // Assigned during render (not in an effect) so an agent reading the\n // slot immediately after `set_locale` sees the settled value rather\n // than the pre-commit one.\n const localeRef = useRef(locale);\n localeRef.current = locale;\n\n const themeRef = useRef(theme);\n themeRef.current = theme;\n const agentHandle = useMemo<HeaderSettingsHandle>(\n () => ({\n setLocale: (next: string) => {\n // Mirrors LocalePicker's gating — silently drop unknown tags\n // rather than crash mid-cascade. `LOCALES_WITH_BUNDLES` is\n // re-imported via the LOCALE_META keys so this file doesn't\n // need the resources module on the build-agent-catalog path.\n if (Object.prototype.hasOwnProperty.call(LOCALE_META, next)) {\n const previous = localeRef.current;\n setLocaleRef.current(next as Locale);\n reportLocaleChange(\n onLocaleChangeRef.current,\n next as Locale,\n previous as Locale,\n );\n }\n },\n setTheme: (next) => themeRef.current.setTheme(next),\n setAccessibility: (next) => themeRef.current.setAccessibility(next),\n // Read-back. None of the three preferences is recoverable from\n // the DOM: `useTheme` resolves preference + OS into one applied\n // class, so `theme: 'system'` and `theme: 'light'` both paint\n // `.theme-light`. Without these an agent cannot tell a switch\n // that landed from one that was dropped.\n getLocale: () => localeRef.current,\n getTheme: () => themeRef.current.theme,\n getAccessibility: () => themeRef.current.accessibility,\n getResolvedTheme: () => themeRef.current.resolvedTheme,\n }),\n [],\n );\n useAgentRegistration(headerSettingsAgent, agentHandle, id);\n\n const accessibleChecked = theme.accessibility === 'accessible';\n // Keep the panel clear of the screen edge by the phone menu's own\n // side margin. In the PublicHeader sheet the gear is\n // 24px from the edge and an end-aligned 224px panel would otherwise be\n // pushed flush against it. On desktop it never reaches the edge.\n const edgeMargin = useLengthTokenPx('--spacing-lg', forwardedRef, 24);\n const languageLabel = t('navigation.headerSettings.language.label');\n const appearanceLabel = t('navigation.headerSettings.appearance.label');\n const currentLocale = LOCALE_META[isLocale(locale) ? locale : 'en'];\n const appearanceOptions = [\n {\n value: 'light',\n label: t('navigation.headerSettings.appearance.light'),\n },\n { value: 'dark', label: t('navigation.headerSettings.appearance.dark') },\n {\n value: 'system',\n label: t('navigation.headerSettings.appearance.system'),\n },\n ] as const;\n const backLabel = t('navigation.headerSettings.back');\n\n return (\n <div\n ref={forwardedRef}\n data-component=\"header-settings\"\n data-component-id={id}\n className={wrapperVariants({ align, className })}\n {...rest}\n >\n <DropdownMenu.Root\n onOpenChange={(open) => {\n if (!open) {\n returnFocusRef.current = null;\n setPhoneView('main');\n }\n }}\n >\n <DropdownMenu.Trigger asChild>\n <IconButton\n size={size}\n disabled={disabled}\n icon={<Settings aria-hidden />}\n aria-label={t('navigation.headerSettings.trigger')}\n />\n </DropdownMenu.Trigger>\n <DropdownMenu.Content\n ref={panelRef}\n align={align}\n collisionPadding={edgeMargin}\n className={panelVariants({ language: view === 'language' })}\n {...(view === 'language'\n ? {\n role: 'dialog',\n 'aria-orientation': undefined,\n 'aria-label': languageLabel,\n 'aria-labelledby': undefined,\n }\n : {})}\n onKeyDownCapture={handlePhoneKeyDown}\n onEscapeKeyDown={(event) => {\n if (event.isComposing) event.preventDefault();\n }}\n >\n {view === 'language' ? (\n <div\n role=\"presentation\"\n onKeyDown={(event) => {\n // The dialog owns typing and Tab, not Radix's menu\n // typeahead. Its two tab stops are Back and search.\n if (\n event.key === 'Tab' &&\n !event.altKey &&\n !event.ctrlKey &&\n !event.metaKey\n ) {\n event.preventDefault();\n event.currentTarget\n .querySelector<HTMLElement>(\n event.target instanceof HTMLInputElement\n ? 'button'\n : 'input',\n )\n ?.focus();\n }\n event.stopPropagation();\n }}\n >\n <Button\n intent=\"ghost\"\n size=\"sm\"\n className=\"ds:w-full ds:justify-start ds:text-start ds:font-normal ds:min-h-[var(--min-target-size)] ds:sm:min-h-[var(--min-target-size)] ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:gap-[var(--spacing-sm)] ds:[&>span:last-child]:flex-1\"\n startIcon={<ArrowLeft aria-hidden className=\"ds:size-4\" />}\n flipIconInRtl\n onClick={goBack}\n >\n <SettingRowLabel label={backLabel} value={languageLabel} />\n </Button>\n <DropdownMenu.Separator />\n <LocalePicker.SearchList onLocaleChange={onLocaleChange} />\n </div>\n ) : view === 'appearance' ? (\n <>\n <DropdownMenu.Item\n startIcon={\n <ArrowLeft\n aria-hidden\n className=\"ds:size-4 ds:rtl:-scale-x-100\"\n />\n }\n onSelect={(event) => {\n event.preventDefault();\n goBack();\n }}\n >\n <SettingRowLabel label={backLabel} value={appearanceLabel} />\n </DropdownMenu.Item>\n <DropdownMenu.Separator />\n <DropdownMenu.RadioGroup\n aria-label={appearanceLabel}\n value={theme.theme}\n onValueChange={(next) =>\n theme.setTheme(next as ThemePreference)\n }\n >\n {appearanceOptions.map((option) => (\n <DropdownMenu.RadioItem\n key={option.value}\n value={option.value}\n onSelect={(event) => event.preventDefault()}\n >\n {option.label}\n </DropdownMenu.RadioItem>\n ))}\n </DropdownMenu.RadioGroup>\n </>\n ) : (\n <>\n {isPhone ? (\n <DropdownMenu.Item\n ref={languageRowRef}\n aria-haspopup=\"dialog\"\n data-value={currentLocale.code}\n endIcon={\n <ChevronRight\n aria-hidden\n className=\"ds:size-4 ds:rtl:-scale-x-100\"\n />\n }\n onPointerDown={(event) => {\n activationRef.current = event.pointerType;\n }}\n onKeyDown={(event) =>\n handlePhoneRowKeyDown(event, 'language')\n }\n onSelect={(event) => {\n event.preventDefault();\n setPhoneView('language');\n }}\n >\n <SettingRowLabel\n label={languageLabel}\n value={currentLocale.nativeName}\n lang={currentLocale.code}\n />\n </DropdownMenu.Item>\n ) : (\n <LanguageSub\n locale={locale}\n onLocaleChange={onLocaleChange}\n />\n )}\n <DropdownMenu.Separator />\n {isPhone ? (\n <DropdownMenu.Item\n ref={appearanceRowRef}\n aria-haspopup=\"menu\"\n data-value={theme.theme}\n endIcon={\n <ChevronRight\n aria-hidden\n className=\"ds:size-4 ds:rtl:-scale-x-100\"\n />\n }\n onPointerDown={(event) => {\n activationRef.current = event.pointerType;\n }}\n onKeyDown={(event) =>\n handlePhoneRowKeyDown(event, 'appearance')\n }\n onSelect={(event) => {\n event.preventDefault();\n setPhoneView('appearance');\n }}\n >\n <SettingRowLabel\n label={appearanceLabel}\n value={\n appearanceOptions.find(\n (option) => option.value === theme.theme,\n )?.label ?? ''\n }\n />\n </DropdownMenu.Item>\n ) : (\n <DropdownMenu.ChoiceSub\n label={appearanceLabel}\n value={theme.theme}\n onValueChange={theme.setTheme}\n options={appearanceOptions}\n />\n )}\n {/* Writes through useTheme, so the document gets the\n `theme-accessible` class at once (including the Lexend\n swap for Latin scripts, see src/tokens/index.css). */}\n <DropdownMenu.SwitchItem\n checked={accessibleChecked}\n onCheckedChange={(next) =>\n theme.setAccessibility(next ? 'accessible' : 'default')\n }\n >\n {t('navigation.headerSettings.appearance.accessible')}\n </DropdownMenu.SwitchItem>\n </>\n )}\n </DropdownMenu.Content>\n </DropdownMenu.Root>\n </div>\n );\n },\n);\n\nHeaderSettings.displayName = 'HeaderSettings';\n"],"names":["headerSettingsAgent","handle","args","applyDocumentAttrs","locale","root","LOCALE_META","wrapperVariants","cva","languageFlyoutClasses","panelVariants","phoneRowClasses","SettingRowLabel","label","value","lang","jsxs","jsx","isLocale","tag","LanguageSub","onLocaleChange","t","useTranslation","current","handleFocus","event","_a","handleKeyDownCapture","target","DropdownMenu","escapeEvent","LocalePicker","HeaderSettings","forwardRef","props","ref","align","size","disabled","initialLocaleFromHtmlLang","followHtmlLang","className","id","rest","theme","useTheme","setLocaleI18n","useLocale","useInitialLocale","onLocaleChangeRef","useRef","forwardedRef","useImperativeHandle","isPhone","useMediaQuery","direction","useDocumentDirection","phoneView","setPhoneView","useState","view","panelRef","languageRowRef","appearanceRowRef","returnFocusRef","activationRef","useIsomorphicLayoutEffect","_b","_d","_c","section","row","_e","handlePhoneRowKeyDown","forwardKey","goBack","handlePhoneKeyDown","setLocaleWithPersistence","useCallback","next","persistLocalePreference","setLocaleRef","localeRef","themeRef","agentHandle","useMemo","previous","reportLocaleChange","useAgentRegistration","accessibleChecked","edgeMargin","useLengthTokenPx","languageLabel","appearanceLabel","currentLocale","appearanceOptions","backLabel","open","IconButton","Settings","Button","ArrowLeft","Fragment","option","ChevronRight"],"mappings":";;;;;;;;;;;;;;;;;;AAOO,MAAMA,KAA0D;AAAA,EACrE,IAAI;AAAA;AAAA;AAAA,EAGJ,cAAc,CAAC,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ1B,OAAO;AAAA,IACL,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,UAAA;AAAA,IAAU;AAAA,IAErC,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,eAAe;AAAA,MACb,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,iBAAA;AAAA,IAAiB;AAAA,IAE5C,eAAe;AAAA,MACb,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,iBAAA;AAAA,IAAiB;AAAA,EAC5C;AAAA,EAEF,SAAS;AAAA,IACP,YAAY;AAAA,MACV,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM;AAAA,QACN,YAAY;AAAA,UACV,QAAQ;AAAA,YACN,MAAM;AAAA,YACN,aACE;AAAA,UAAA;AAAA,QACJ;AAAA,QAEF,UAAU,CAAC,QAAQ;AAAA,MAAA;AAAA,MAErB,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,QAAQ;AAAA,QACN;AAAA,M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