@wello-dev/core 1.0.4 → 1.0.6

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.
Files changed (73) hide show
  1. package/dist/{chunk-FIAJMBSD.js → chunk-2TFJ4SMR.js} +3 -3
  2. package/dist/chunk-2TFJ4SMR.js.map +1 -0
  3. package/dist/{chunk-6U4Y3AUT.js → chunk-2WHZJI3S.js} +3 -3
  4. package/dist/{chunk-F2FJLMJF.js → chunk-652ZEQV7.js} +4 -4
  5. package/dist/{chunk-YQOS23WP.js → chunk-7EINGVGG.js} +2 -2
  6. package/dist/{chunk-YOL5PMHU.js → chunk-7S7RIVCI.js} +2 -2
  7. package/dist/{chunk-PPKKOBHB.js → chunk-A76QHCP5.js} +2 -2
  8. package/dist/{chunk-TJUOXXLK.js → chunk-BZPG4NZ6.js} +2 -2
  9. package/dist/chunk-DRSBB5T4.js +206 -0
  10. package/dist/chunk-DRSBB5T4.js.map +1 -0
  11. package/dist/{chunk-HGYIOR5F.js → chunk-ESMDK5GY.js} +2 -2
  12. package/dist/{chunk-GD5URO3H.js → chunk-FSR3OEUP.js} +4 -4
  13. package/dist/{chunk-52P4CIAK.js → chunk-HBBXBVK6.js} +2 -2
  14. package/dist/{chunk-63PSLIW5.js → chunk-K3B2RENY.js} +2 -2
  15. package/dist/{chunk-ZTOAB4HM.js → chunk-NGXT7GNE.js} +2 -2
  16. package/dist/{chunk-O4MQLZEH.js → chunk-NH26XE7T.js} +2 -2
  17. package/dist/{chunk-7GLDYLJ6.js → chunk-O6A7IBIW.js} +2 -2
  18. package/dist/{chunk-F4OMXH3E.js → chunk-QCMTAQSP.js} +17 -10
  19. package/dist/chunk-QCMTAQSP.js.map +1 -0
  20. package/dist/{chunk-2XGMU4QA.js → chunk-RVFCTNPD.js} +20 -4
  21. package/dist/chunk-RVFCTNPD.js.map +1 -0
  22. package/dist/{chunk-KEYIOWAG.js → chunk-TIVOXLDX.js} +3 -3
  23. package/dist/{chunk-KEYIOWAG.js.map → chunk-TIVOXLDX.js.map} +1 -1
  24. package/dist/{chunk-QZFPW75D.js → chunk-XBLREJCR.js} +30 -3
  25. package/dist/chunk-XBLREJCR.js.map +1 -0
  26. package/dist/{chunk-K2Q5Q6WQ.js → chunk-YRKCM3OL.js} +10 -6
  27. package/dist/chunk-YRKCM3OL.js.map +1 -0
  28. package/dist/components/ColorPicker/ColorInput.js +4 -4
  29. package/dist/components/Combobox/Combobox.js +4 -4
  30. package/dist/components/Combobox/Select.js +5 -5
  31. package/dist/components/Combobox/TagsInput.js +5 -5
  32. package/dist/components/Dialog/Dialog.js +2 -2
  33. package/dist/components/Dropzone/Dropzone.js +4 -4
  34. package/dist/components/Menu/Menu.js +4 -4
  35. package/dist/components/Modal/Drawer.js +3 -3
  36. package/dist/components/Modal/Modal.js +3 -3
  37. package/dist/components/Modal/ModalBase.js +2 -2
  38. package/dist/components/NumberFormatter/NumberFormatter.js +1 -1
  39. package/dist/components/PhoneInput/PhoneInput.js +6 -6
  40. package/dist/components/Popover/Popover.js +3 -3
  41. package/dist/components/Portal/Portal.js +1 -1
  42. package/dist/components/TextInput/TextInput.js +2 -2
  43. package/dist/components/Tooltip/Tooltip.js +3 -3
  44. package/dist/index.cjs +163 -95
  45. package/dist/index.cjs.map +1 -1
  46. package/dist/index.d.cts +7 -2
  47. package/dist/index.d.ts +7 -2
  48. package/dist/index.js +114 -114
  49. package/dist/shadcn/Command.js +6 -6
  50. package/dist/shadcn/Dialog.js +5 -5
  51. package/dist/shadcn/Floating.js +6 -6
  52. package/dist/styles.css +123 -15
  53. package/package.json +1 -1
  54. package/dist/chunk-2XGMU4QA.js.map +0 -1
  55. package/dist/chunk-F4OMXH3E.js.map +0 -1
  56. package/dist/chunk-FIAJMBSD.js.map +0 -1
  57. package/dist/chunk-K2Q5Q6WQ.js.map +0 -1
  58. package/dist/chunk-QZFPW75D.js.map +0 -1
  59. package/dist/chunk-YHPHWOAE.js +0 -192
  60. package/dist/chunk-YHPHWOAE.js.map +0 -1
  61. /package/dist/{chunk-6U4Y3AUT.js.map → chunk-2WHZJI3S.js.map} +0 -0
  62. /package/dist/{chunk-F2FJLMJF.js.map → chunk-652ZEQV7.js.map} +0 -0
  63. /package/dist/{chunk-YQOS23WP.js.map → chunk-7EINGVGG.js.map} +0 -0
  64. /package/dist/{chunk-YOL5PMHU.js.map → chunk-7S7RIVCI.js.map} +0 -0
  65. /package/dist/{chunk-PPKKOBHB.js.map → chunk-A76QHCP5.js.map} +0 -0
  66. /package/dist/{chunk-TJUOXXLK.js.map → chunk-BZPG4NZ6.js.map} +0 -0
  67. /package/dist/{chunk-HGYIOR5F.js.map → chunk-ESMDK5GY.js.map} +0 -0
  68. /package/dist/{chunk-GD5URO3H.js.map → chunk-FSR3OEUP.js.map} +0 -0
  69. /package/dist/{chunk-52P4CIAK.js.map → chunk-HBBXBVK6.js.map} +0 -0
  70. /package/dist/{chunk-63PSLIW5.js.map → chunk-K3B2RENY.js.map} +0 -0
  71. /package/dist/{chunk-ZTOAB4HM.js.map → chunk-NGXT7GNE.js.map} +0 -0
  72. /package/dist/{chunk-O4MQLZEH.js.map → chunk-NH26XE7T.js.map} +0 -0
  73. /package/dist/{chunk-7GLDYLJ6.js.map → chunk-O6A7IBIW.js.map} +0 -0
@@ -14,7 +14,7 @@ import {
14
14
  ComboboxSearch,
15
15
  ComboboxTarget,
16
16
  useCombobox
17
- } from "./chunk-TJUOXXLK.js";
17
+ } from "./chunk-BZPG4NZ6.js";
18
18
  import {
19
19
  Input,
20
20
  InputBase
@@ -45,12 +45,28 @@ function comparable(value) {
45
45
  if (typeof value === "object" && "id" in value) return String(value.id);
46
46
  return String(value);
47
47
  }
48
+ function pickPlainLabel(raw, fallback) {
49
+ if (typeof raw === "string" || typeof raw === "number") return raw;
50
+ if (isValidElement(raw)) return raw;
51
+ if (raw && typeof raw === "object" && !Array.isArray(raw)) {
52
+ const map = raw;
53
+ for (const key of ["ar", "en", "label", "name", "title"]) {
54
+ const hit = map[key];
55
+ if (typeof hit === "string" && hit.trim()) return hit.trim();
56
+ }
57
+ for (const hit of Object.values(map)) {
58
+ if (typeof hit === "string" && hit.trim()) return hit.trim();
59
+ }
60
+ }
61
+ return fallback;
62
+ }
48
63
  function toSelectItem(entry, keys) {
49
64
  const record = typeof entry === "object" ? entry : { value: entry, label: String(entry) };
50
65
  const value = comparable(record.value ?? record[keys.valueKey]);
51
66
  const raw = record.label ?? record[keys.labelKey];
52
- const plain = typeof raw === "string" || typeof raw === "number" || isValidElement(raw) ? raw : value;
53
- const node = keys.getOptionLabel ? keys.getOptionLabel(record) : plain;
67
+ const plain = pickPlainLabel(raw, value);
68
+ const fromGetter = keys.getOptionLabel ? keys.getOptionLabel(record) : void 0;
69
+ const node = fromGetter !== void 0 && fromGetter !== null && fromGetter !== "" ? fromGetter : plain;
54
70
  const text = typeof node === "string" || typeof node === "number" ? String(node) : typeof raw === "string" ? raw : value;
55
71
  const label = record.searchText ?? (typeof record.description === "string" ? `${text} ${record.description}` : text);
56
72
  return { value, label, node, display: record.displayLabel ?? node, disabled: record.disabled, option: entry, record };
@@ -602,4 +618,4 @@ var Select2 = SelectRoot;
602
618
  export {
603
619
  Select2 as Select
604
620
  };
605
- //# sourceMappingURL=chunk-2XGMU4QA.js.map
621
+ //# sourceMappingURL=chunk-RVFCTNPD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Combobox/Select.tsx"],"sourcesContent":["import { useWelloLabels } from \"../../core/provider/labels\";\nimport { forwardRef, isValidElement, type ReactElement, type Ref, useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from \"react\";\nimport { useEndpointLoaders } from \"../../core/api/api\";\nimport { useWelloTheme } from \"../../core/provider/WelloProvider\";\nimport { useProps, useStyles, type StylesApiProps } from \"../../core/styles-api/styles-api\";\nimport { cx } from \"../../core/utils\";\nimport { EmptyState } from \"../EmptyState/EmptyState\";\nimport type { ComboboxItem } from \"../Field/Field\";\nimport { Input, InputBase, type InputBaseProps } from \"../Input/Input\";\nimport { Loader } from \"../Loader/Loader\";\nimport {\n CheckIcon,\n Combobox,\n ComboboxChevron,\n ComboboxClearButton,\n ComboboxDropdown,\n ComboboxGroup,\n ComboboxOption,\n ComboboxOptions,\n ComboboxSearch,\n ComboboxTarget,\n useCombobox,\n type ComboboxProps,\n} from \"./Combobox\";\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────\n\n/** An option: `value` + `label`, or any record read through `valueKey` / `labelKey`. */\nexport interface SelectOption {\n value?: unknown;\n /** Text, an element, or anything `getOptionLabel` understands */\n label?: unknown;\n disabled?: boolean;\n /** Shown in the closed field instead of the label */\n displayLabel?: ReactNode;\n /** Text to search, when the label isn't text */\n searchText?: string;\n /** Second line, under the label */\n description?: ReactNode;\n /** Before the text: image, icon, avatar */\n leftSection?: ReactNode;\n /** After the text: price, badge, count */\n rightSection?: ReactNode;\n [key: string]: unknown;\n}\n\nexport type SelectEntry = string | number | SelectOption;\n/** Options: any record type works, read in `renderOption` with its own fields. */\nexport type SelectData<T = any> = Array<string | number | T | { group: string; items: Array<string | number | T> }>;\n\n/** Parts for `classNames`, `styles`, `vars` and `attributes`. */\nexport type SelectStylesNames =\n | \"root\" | \"label\" | \"description\" | \"error\" | \"wrapper\" | \"input\" | \"section\"\n | \"value\" | \"pills\" | \"pill\" | \"sections\" | \"clear\"\n | \"dropdown\" | \"dropdownHeader\" | \"dropdownFooter\"\n | \"searchWrap\" | \"searchBox\" | \"searchIcon\" | \"search\" | \"searchClear\" | \"spinner\"\n | \"options\" | \"option\" | \"optionBody\" | \"optionLabel\" | \"optionDescription\" | \"optionSection\" | \"check\" | \"box\"\n | \"group\" | \"groupLabel\"\n | \"state\" | \"empty\" | \"footer\" | \"count\" | \"allLoaded\";\n\n/** What `renderOption` and `renderValue` get. */\nexport interface SelectRenderInput<T = any> {\n /** The option as you passed it */\n option: T;\n /** The value as text */\n value: string;\n /** What would be shown by default */\n label: ReactNode;\n checked: boolean;\n disabled: boolean;\n /** Current search text */\n search: string;\n}\n\n/** What the dropdown slots and `renderFooter` get. */\nexport interface SelectDropdownState {\n close: () => void;\n search: string;\n shown: number;\n total?: number;\n hasMore: boolean;\n loading: boolean;\n}\n\nexport interface LoadOptionsInput {\n search: string;\n /** Starts at 1 */\n page: number;\n pageSize: number;\n /** Aborted when a newer request starts */\n signal: AbortSignal;\n}\n/** A page of options. `hasMore` wins over `total`; with neither, a full page means there may be more. */\nexport type LoadOptionsResult<T = any> = Array<string | number | T> | { items: Array<string | number | T>; total?: number; hasMore?: boolean };\n\n/** One entry after normalizing. `label` is the searchable text, as `filter` expects. */\nexport interface SelectItem extends ComboboxItem {\n node: ReactNode;\n display: ReactNode;\n option: SelectEntry;\n record: SelectOption;\n}\n\nexport type SelectFilter = (options: { items: ComboboxItem[]; search: string; limit?: number }) => ComboboxItem[];\n\ninterface SelectBaseProps<T = any> extends Omit<InputBaseProps, \"value\" | \"defaultValue\" | \"onChange\" | \"onBlur\" | keyof StylesApiProps<string>>, StylesApiProps<SelectStylesNames> {\n /** Options. Plain strings, `{ value, label }`, records or `{ group, items }` */\n data?: SelectData<T>;\n /** shared/ui name of `data` */\n options?: SelectData<T>;\n /** Key of the value in a record, when it has no `value`. Default: 'id' */\n valueKey?: string;\n /** Key of the label in a record, when it has no `label`. Default: 'name' */\n labelKey?: string;\n /** Turns an option into what's shown: translate it, pick the language… */\n getOptionLabel?: (option: T) => ReactNode;\n\n /**\n * Address of the list on your API (`\"users\"`, `\"cities?per_page=50\"`): the only thing needed to fetch options.\n * The base address, headers and error callback come from the theme's `api`. Pages on scroll, search with debounce.\n */\n endpoint?: string | null;\n /** With `endpoint`: more query parameters. Changing them restarts the list */\n params?: Record<string, unknown>;\n /** With `endpoint`: use `api.generalBaseURL` */\n general?: boolean;\n /** With `endpoint`: turn the whole answer into the list of options, when `{ data: [...] }`, `{ items: [...] }` or an array doesn't fit */\n select?: (data: any) => Array<string | number | T>;\n /** With `endpoint`: fetch the option of the current value from `endpoint/{value}` when it isn't in the loaded pages. Default: true */\n hasShow?: boolean;\n /** With `endpoint`: address of one option, or `null` to skip. Default: numeric values only, `endpoint/{value}` */\n showEndpoint?: (value: string, endpoint: string) => string | null;\n /** Fetch options: pages on scroll, search with debounce, late answers ignored */\n loadOptions?: (input: LoadOptionsInput) => Promise<LoadOptionsResult<T>> | LoadOptionsResult<T>;\n /** Fetch one option by value, when the current value isn't in the loaded pages */\n loadOption?: (value: string) => Promise<string | number | T | null | undefined> | string | number | T | null | undefined;\n /** Change it to refetch from page 1 and forget the options (dependent selects) */\n loadKey?: string | number | null;\n /** With `loadOptions`. Default: true */\n enabled?: boolean;\n /** With `loadOptions`: filter what's loaded instead of sending the search */\n localSearch?: boolean;\n /** With `loadOptions`, ms. Default: 300 */\n debounceMs?: number;\n /** Options per page, also for `data`. Default: 20 */\n pageSize?: number;\n onLoadError?: (error: unknown) => void;\n\n /** Own fetching: the first load is running */\n loading?: boolean;\n /** Own fetching: scrolling down calls `onLoadMore` */\n hasMore?: boolean;\n onLoadMore?: () => void;\n /** Own fetching: total shown in the footer */\n total?: number;\n\n /** Search box in the dropdown. Default: true */\n searchable?: boolean;\n /** shared/ui name of `searchable` */\n hasSearch?: boolean;\n searchValue?: string;\n defaultSearchValue?: string;\n /** Fires at every key. For server search, debounce it and pass `filter={({ items }) => items}` */\n onSearchChange?: (value: string) => void;\n /** Cleans the search text before it's used */\n transformSearch?: (search: string) => string;\n filter?: SelectFilter;\n /** Most options shown */\n limit?: number;\n\n /** Shows a × */\n clearable?: boolean;\n readOnly?: boolean;\n placeholder?: string;\n /** Hidden input name, for forms */\n name?: string;\n onBlur?: () => void;\n /** Dropdown height, including search and footer. Default: 400 */\n maxDropdownHeight?: number | string;\n /** Counter under the list. Default: true */\n withFooter?: boolean;\n withCheckIcon?: boolean;\n /** Default: 'left' */\n checkIconPosition?: \"left\" | \"right\";\n /** Own content of an option, instead of label, description and sections. The check mark stays; `withCheckIcon={false}` removes it */\n renderOption?: (input: SelectRenderInput<T>) => ReactNode;\n /** Own content of the closed field. With `multiple`: of each pill */\n renderValue?: (input: SelectRenderInput<T>) => ReactNode;\n /** Props per option: class, style, data attributes, by its state */\n getOptionProps?: (option: T, state: { checked: boolean; disabled: boolean }) => Record<string, unknown> | undefined;\n /** Own check mark of the chosen option */\n checkIcon?: ReactNode;\n /** Own search icon */\n searchIcon?: ReactNode;\n /** Above the list: tabs, filters, an action */\n dropdownHeader?: ReactNode | ((state: SelectDropdownState) => ReactNode);\n /** Under the list: \"Add new\", links… */\n dropdownFooter?: ReactNode | ((state: SelectDropdownState) => ReactNode);\n /** Own counter row, instead of the built-in one */\n renderFooter?: (state: SelectDropdownState) => ReactNode;\n /** Open or close from outside */\n dropdownOpened?: boolean;\n defaultDropdownOpened?: boolean;\n comboboxProps?: Partial<ComboboxProps>;\n onDropdownOpen?: () => void;\n onDropdownClose?: () => void;\n /** Gets the full option of the current value, also when it's first found after loading */\n onOptionSelect?: (option: string | number | T) => void;\n /** Change it to fire `onOptionSelect` again for the same value (e.g. after a form reset) */\n resyncToken?: string | number | null;\n\n nothingFoundMessage?: ReactNode;\n searchPlaceholder?: string;\n loadingMessage?: ReactNode;\n loadingMoreMessage?: ReactNode;\n allLoadedMessage?: ReactNode;\n errorMessage?: ReactNode;\n}\n\nexport interface SingleSelectProps<T = any> extends SelectBaseProps<T> {\n multiple?: false;\n value?: unknown;\n defaultValue?: string | number | null;\n /** Value and its option */\n onChange?: (value: any, option: string | number | T | null) => void;\n /** shadcn name: only when there is a value */\n onValueChange?: (value: string) => void;\n /** Clicking the chosen option again clears it. Default: true */\n allowDeselect?: boolean;\n /** Value after clearing. Use `\"\"` for string schemas. Default: null */\n emptyValue?: string | null;\n}\n\nexport interface MultiSelectProps<T = any> extends SelectBaseProps<T> {\n multiple?: true;\n value?: unknown;\n defaultValue?: Array<string | number>;\n onChange?: (value: any, options: Array<string | number | T>) => void;\n /** Most values that can be picked */\n maxValues?: number;\n /** Picked options leave the list */\n hidePickedOptions?: boolean;\n /** Pills in the closed field, the rest become +N. Default: 3 */\n maxDisplayedValues?: number;\n}\n\nexport type SelectProps<T = any> = SingleSelectProps<T> | MultiSelectProps<T>;\n\n// ── Options ──────────────────────────────────────────────────────────────────────────────\n\n/** Compares by text; `{ id }` objects count as their id. */\nfunction comparable(value: unknown): string {\n if (value === undefined || value === null) return \"\";\n if (typeof value === \"object\" && \"id\" in value) return String((value as { id: unknown }).id);\n return String(value);\n}\n\ninterface LabelOptions {\n valueKey: string;\n labelKey: string;\n getOptionLabel?: (option: any) => ReactNode;\n}\n\nfunction pickPlainLabel(raw: unknown, fallback: string): ReactNode {\n if (typeof raw === \"string\" || typeof raw === \"number\") return raw as ReactNode;\n if (isValidElement(raw)) return raw;\n // Locale bags `{ ar, en }` from APIs — prefer current-looking non-empty string values.\n if (raw && typeof raw === \"object\" && !Array.isArray(raw)) {\n const map = raw as Record<string, unknown>;\n for (const key of [\"ar\", \"en\", \"label\", \"name\", \"title\"]) {\n const hit = map[key];\n if (typeof hit === \"string\" && hit.trim()) return hit.trim();\n }\n for (const hit of Object.values(map)) {\n if (typeof hit === \"string\" && hit.trim()) return hit.trim();\n }\n }\n return fallback;\n}\n\nfunction toSelectItem(entry: SelectEntry, keys: LabelOptions): SelectItem {\n const record: SelectOption = typeof entry === \"object\" ? entry : { value: entry, label: String(entry) };\n const value = comparable(record.value ?? record[keys.valueKey]);\n const raw = record.label ?? record[keys.labelKey];\n const plain = pickPlainLabel(raw, value);\n const fromGetter = keys.getOptionLabel ? keys.getOptionLabel(record) : undefined;\n // Empty string from a host getter (e.g. reading `.label` on a raw API row) must not blank the row.\n const node =\n fromGetter !== undefined && fromGetter !== null && fromGetter !== \"\" ? fromGetter : plain;\n const text = typeof node === \"string\" || typeof node === \"number\" ? String(node) : typeof raw === \"string\" ? raw : value;\n const label = record.searchText ?? (typeof record.description === \"string\" ? `${text} ${record.description}` : text);\n return { value, label, node, display: record.displayLabel ?? node, disabled: record.disabled, option: entry, record };\n}\n\ninterface SelectGroupData {\n group: string;\n items: SelectItem[];\n}\n\nfunction toGroups(data: SelectData | undefined, keys: LabelOptions): SelectGroupData[] {\n const groups: SelectGroupData[] = [];\n let loose: SelectGroupData | null = null;\n for (const entry of data ?? []) {\n if (typeof entry === \"object\" && \"group\" in entry && Array.isArray(entry.items)) {\n loose = null;\n groups.push({ group: String(entry.group), items: (entry.items as SelectEntry[]).map((item) => toSelectItem(item, keys)) });\n } else {\n if (!loose) groups.push((loose = { group: \"\", items: [] }));\n loose.items.push(toSelectItem(entry as SelectEntry, keys));\n }\n }\n return groups;\n}\n\nconst matchLabelOrValue: SelectFilter = ({ items, search }) => {\n const query = search.trim().toLowerCase();\n return query ? items.filter((item) => item.label.toLowerCase().includes(query) || item.value.toLowerCase().includes(query)) : items;\n};\n\n// ── Remote options ───────────────────────────────────────────────────────────────────────\n\nfunction useDebouncedValue<T>(value: T, ms: number) {\n const [debounced, setDebounced] = useState(value);\n useEffect(() => {\n const timer = setTimeout(() => setDebounced(value), ms);\n return () => clearTimeout(timer);\n }, [value, ms]);\n return debounced;\n}\n\ninterface RemoteInput {\n loadOptions: SelectBaseProps[\"loadOptions\"];\n loadOption: SelectBaseProps[\"loadOption\"];\n onLoadError: SelectBaseProps[\"onLoadError\"];\n getValue: (entry: SelectEntry) => string;\n query: string;\n pageSize: number;\n enabled: boolean;\n loadKey: SelectBaseProps[\"loadKey\"];\n /** Values that should have an option */\n values: string[];\n isKnown: (value: string) => boolean;\n}\n\nconst NO_ENTRIES: SelectEntry[] = [];\n\nfunction useRemoteOptions(input: RemoteInput) {\n const { loadOptions, pageSize, enabled, loadKey, query, values } = input;\n const latest = useRef(input);\n latest.current = input;\n const [options, setOptions] = useState<SelectEntry[]>([]);\n const [pinned, setPinned] = useState<SelectEntry[]>([]);\n const [total, setTotal] = useState<number | undefined>();\n const [hasMore, setHasMore] = useState(false);\n const [loading, setLoading] = useState(false);\n const [failed, setFailed] = useState(false);\n const [settled, setSettled] = useState(false);\n const page = useRef(1);\n const loaded = useRef<SelectEntry[]>([]);\n const request =useRef<{ id: number; controller?: AbortController }>({ id: 0 });\n const requested = useRef(new Set<string>());\n const remote = !!loadOptions;\n\n const fetchPage = useCallback((target: number, search: string) => {\n const { loadOptions: load, pageSize: size } = latest.current;\n if (!load) return;\n request.current.controller?.abort();\n const controller = new AbortController();\n const id = request.current.id + 1;\n request.current = { id, controller };\n setLoading(true);\n setFailed(false);\n page.current = target;\n Promise.resolve()\n .then(() => load({ search, page: target, pageSize: size, signal: controller.signal }))\n .then((result) => {\n if (request.current.id !== id) return;\n const items = Array.isArray(result) ? result : result.items;\n const meta: { total?: number; hasMore?: boolean } = Array.isArray(result) ? {} : result;\n const getValue = latest.current.getValue;\n const previous = target === 1 ? [] : loaded.current;\n const seen = new Set(previous.map(getValue));\n const fresh = items.filter((item) => !seen.has(getValue(item)));\n const next = [...previous, ...fresh];\n loaded.current = next;\n setOptions(next);\n setTotal(meta.total);\n // A page with nothing new ends it, whatever the numbers say.\n setHasMore(target > 1 && !fresh.length ? false : (meta.hasMore ?? (meta.total !== undefined ? meta.total > next.length : items.length >= size)));\n setLoading(false);\n setSettled(true);\n })\n .catch((error) => {\n if (request.current.id !== id) return;\n setLoading(false);\n setFailed(true);\n setSettled(true);\n latest.current.onLoadError?.(error);\n });\n }, []);\n\n const scope = useRef(loadKey);\n useEffect(() => {\n if (scope.current !== loadKey) {\n scope.current = loadKey;\n loaded.current = [];\n setOptions([]);\n setPinned([]);\n setTotal(undefined);\n setHasMore(false);\n setSettled(false);\n requested.current.clear();\n }\n if (!remote || !enabled) {\n request.current.controller?.abort();\n request.current = { id: request.current.id + 1 };\n setLoading(false);\n return;\n }\n fetchPage(1, query);\n return () => {\n request.current.controller?.abort();\n request.current = { id: request.current.id + 1 };\n };\n }, [remote, enabled, loadKey, query, pageSize, fetchPage]);\n\n // The value may not be in the pages loaded so far: ask for it, once.\n const missing = values.join(\"\\u0000\");\n useEffect(() => {\n const { loadOption, isKnown } = latest.current;\n if (!loadOption || !settled || !enabled) return;\n const scopeAtStart = scope.current;\n for (const value of values) {\n if (!value || isKnown(value) || requested.current.has(value)) continue;\n requested.current.add(value);\n Promise.resolve()\n .then(() => loadOption(value))\n .then((option) => {\n if (option !== null && option !== undefined && scope.current === scopeAtStart) setPinned((list) => [...list, option]);\n })\n .catch(() => undefined);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [missing, settled, enabled, options.length]);\n\n // Until the effect above resets them, the options belong to the previous `loadKey`.\n const stale = scope.current !== loadKey;\n return {\n options: stale ? NO_ENTRIES : options,\n pinned: stale ? NO_ENTRIES : pinned,\n total,\n hasMore,\n loading,\n failed,\n loadMore: () => {\n if (hasMore && !loading) fetchPage(page.current + 1, query);\n },\n retry: () => fetchPage(1, query),\n };\n}\n\n// ── Icons ────────────────────────────────────────────────────────────────────────────────\n\nfunction SearchIcon(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg viewBox=\"0 0 24 24\" width=\"1rem\" height=\"1rem\" fill=\"none\" stroke=\"currentColor\" strokeWidth={2} strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\" {...props}>\n <path d=\"m21 21-4.3-4.3\" />\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n </svg>\n );\n}\n\n// ── Select ───────────────────────────────────────────────────────────────────────────────\n\n/**\n * Trigger + dropdown with search, check marks, pages on scroll and a counter. Single or\n * `multiple`, static or fetched. Accepts react-hook-form's `{...field}`.\n *\n * @example\n * <Select label=\"City\" data={cities} clearable value={city} onChange={setCity} />\n * <Select multiple {...field} data={categories} />\n * <Select\n * {...field}\n * loadOptions={({ search, page, pageSize, signal }) => api.users({ search, page, per_page: pageSize, signal }).then((r) => ({ items: r.data, total: r.meta.total }))}\n * loadOption={(id) => api.user(id)}\n * loadKey={cityId}\n * />\n */\nconst SelectRoot = forwardRef<HTMLButtonElement, SelectProps>(function Select(allProps, ref) {\n const labels = useWelloLabels();\n const merged = useProps(\"Select\", {}, allProps as SingleSelectProps & MultiSelectProps & { onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void; onKeyDown?: unknown });\n const {\n multiple,\n classNames,\n styles,\n vars,\n attributes,\n unstyled,\n renderValue,\n getOptionProps,\n checkIcon,\n searchIcon,\n dropdownHeader,\n dropdownFooter,\n renderFooter,\n dropdownOpened,\n defaultDropdownOpened,\n data,\n options: optionsProp,\n valueKey = \"id\",\n labelKey = \"name\",\n getOptionLabel,\n value: controlled,\n defaultValue,\n onChange,\n onBlur,\n endpoint,\n params,\n general,\n select,\n hasShow = true,\n showEndpoint,\n loadOptions: loadOptionsProp,\n loadOption: loadOptionProp,\n loadKey: loadKeyProp,\n enabled = true,\n localSearch,\n debounceMs = 300,\n pageSize = 20,\n onLoadError,\n loading: loadingProp,\n hasMore: hasMoreProp,\n onLoadMore,\n total: totalProp,\n searchable,\n hasSearch,\n searchValue,\n defaultSearchValue,\n onSearchChange,\n transformSearch,\n filter = matchLabelOrValue,\n limit,\n clearable,\n readOnly,\n disabled,\n placeholder,\n name,\n maxDropdownHeight = 400,\n withFooter = true,\n withCheckIcon = true,\n checkIconPosition = \"left\",\n renderOption,\n comboboxProps,\n onDropdownOpen,\n onDropdownClose,\n onOptionSelect,\n resyncToken,\n nothingFoundMessage = labels.noResults,\n searchPlaceholder = labels.search,\n loadingMessage = labels.loading,\n loadingMoreMessage = labels.loadingMore,\n allLoadedMessage = labels.allLoaded,\n errorMessage = labels.loadError,\n rightSection,\n radius = \"2rem\",\n className,\n required,\n withAsterisk,\n onClick,\n onKeyDown: _ignoredKeyDown,\n ...rest\n } = merged;\n const { allowDeselect = true, emptyValue = null, onValueChange, maxValues, hidePickedOptions, maxDisplayedValues = 3, ...props } = rest as typeof rest & SingleSelectProps & MultiSelectProps;\n const withSearch = searchable ?? hasSearch ?? true;\n // With only an `endpoint`: the requests are made here, from the theme's `api`.\n const fromEndpoint = useEndpointLoaders({ endpoint, params, general, select, hasShow: hasShow && !multiple, showEndpoint });\n const loadOptions = loadOptionsProp ?? fromEndpoint.loadOptions;\n const loadOption = loadOptionProp ?? fromEndpoint.loadOption;\n const loadKey = loadKeyProp ?? fromEndpoint.loadKey;\n\n // Every part, with the input's parts passed on to InputBase.\n const theme = useWelloTheme();\n const partClasses = typeof classNames === \"function\" ? classNames(theme, merged) : classNames;\n const partStyles = typeof styles === \"function\" ? styles(theme, merged) : styles;\n const getStyles = useStyles<SelectStylesNames, typeof merged>({ name: \"Select\", props: merged, classNames: partClasses, styles: partStyles, vars, attributes, unstyled });\n\n // Value\n const [internal, setInternal] = useState<unknown>(defaultValue ?? (multiple ? [] : null));\n const current = controlled !== undefined ? controlled : internal;\n const values = useMemo(() => {\n if (!multiple) return current === null || current === \"\" ? [] : [comparable(current)].filter(Boolean);\n const list = Array.isArray(current) ? current : current === null || current === undefined || current === \"\" ? [] : [current];\n return list.map(comparable);\n }, [current, multiple]);\n\n // Search\n const [searchInternal, setSearchInternal] = useState(defaultSearchValue ?? \"\");\n const search = searchValue ?? searchInternal;\n const setSearch = (next: string) => {\n if (searchValue === undefined) setSearchInternal(next);\n if (next !== search) onSearchChange?.(next);\n };\n const query = (transformSearch ? transformSearch(search) : search).trim();\n const debouncedQuery = useDebouncedValue(query, debounceMs);\n\n // Options\n const keys: LabelOptions = { valueKey, labelKey, getOptionLabel };\n const isRemote = !!loadOptions || !!onLoadMore;\n const known = useRef(new Map<string, SelectItem>());\n const scope = useRef(loadKey);\n if (scope.current !== loadKey) {\n scope.current = loadKey;\n known.current = new Map();\n }\n const remote = useRemoteOptions({\n loadOptions,\n loadOption,\n onLoadError,\n getValue: (entry) => toSelectItem(entry, keys).value,\n query: localSearch ? \"\" : debouncedQuery,\n pageSize,\n enabled,\n loadKey,\n values,\n isKnown: (value) => known.current.has(value),\n });\n\n const groups = useMemo(() => {\n if (!loadOptions) return toGroups(data ?? optionsProp, keys);\n const items = remote.options.map((entry) => toSelectItem(entry, keys));\n const inList = new Set(items.map((item) => item.value));\n const pinned = query ? [] : remote.pinned.map((entry) => toSelectItem(entry, keys)).filter((item) => !inList.has(item.value));\n return [{ group: \"\", items: [...pinned, ...items] }];\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [data, optionsProp, !!loadOptions, remote.options, remote.pinned, valueKey, labelKey, getOptionLabel, query]);\n\n // What the value shows. Fetched options are remembered, so searching doesn't blank it.\n const lookup = useMemo(() => {\n const map = isRemote ? known.current : new Map<string, SelectItem>();\n for (const group of groups) for (const item of group.items) map.set(item.value, item);\n for (const entry of remote.pinned) {\n const item = toSelectItem(entry, keys);\n map.set(item.value, item);\n }\n return map;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [groups, isRemote, remote.pinned]);\n const selected = values.map((value) => lookup.get(value)).filter((item): item is SelectItem => !!item);\n\n // Filter first, then page: searching must reach every option.\n const filterLocally = !loadOptions || !!localSearch;\n const filtered = useMemo(() => {\n const exclude = hidePickedOptions ? values : undefined;\n let left = limit ?? Infinity;\n const out: SelectGroupData[] = [];\n for (const group of groups) {\n const candidates = exclude ? group.items.filter((item) => !exclude.includes(item.value)) : group.items;\n const matches = (filterLocally ? filter({ items: candidates, search: query }) : candidates) as SelectItem[];\n const items = matches.slice(0, Math.max(0, left));\n left -= items.length;\n if (items.length) out.push({ group: group.group, items });\n }\n return out;\n }, [groups, filterLocally, filter, query, limit, hidePickedOptions, values]);\n const filteredCount = filtered.reduce((sum, group) => sum + group.items.length, 0);\n\n const [visibleCount, setVisibleCount] = useState(pageSize);\n useEffect(() => setVisibleCount(pageSize), [query, pageSize, loadKey]);\n const shown = useMemo(() => {\n if (isRemote) return filtered;\n let left = visibleCount;\n const out: SelectGroupData[] = [];\n for (const group of filtered) {\n if (left <= 0) break;\n out.push({ group: group.group, items: group.items.slice(0, left) });\n left -= group.items.length;\n }\n return out;\n }, [filtered, isRemote, visibleCount]);\n const shownCount = shown.reduce((sum, group) => sum + group.items.length, 0);\n\n const hasMore = loadOptions ? remote.hasMore : onLoadMore ? !!hasMoreProp : filteredCount > visibleCount;\n const fetching = !!loadingProp || remote.loading;\n const total = loadOptions ? remote.total : onLoadMore || totalProp !== undefined ? totalProp : filteredCount;\n const loadMore = () => {\n if (!hasMore || fetching) return;\n if (loadOptions) remote.loadMore();\n else if (onLoadMore) onLoadMore();\n else setVisibleCount((count) => count + pageSize);\n };\n\n // Dropdown\n const combobox = useCombobox({\n opened: dropdownOpened,\n defaultOpened: defaultDropdownOpened,\n onDropdownOpen: () => {\n onDropdownOpen?.();\n if (remote.failed) remote.retry();\n combobox.selectActiveOption();\n // The dropdown is hidden until it's measured, and hidden elements can't take focus.\n if (withSearch) {\n let tries = 0;\n const focus = () => {\n const input = combobox.searchRef.current;\n input?.focus();\n if (document.activeElement !== input && tries++ < 20) requestAnimationFrame(focus);\n };\n requestAnimationFrame(focus);\n }\n },\n onDropdownClose: () => {\n onDropdownClose?.();\n combobox.resetSelectedOption();\n setSearch(\"\");\n onBlur?.();\n },\n });\n const opened = combobox.dropdownOpened;\n\n // A short first page never scrolls, so it has to ask for the next one itself.\n useEffect(() => {\n if (!opened || !hasMore || fetching) return;\n const frame = requestAnimationFrame(() => {\n const list = combobox.listRef.current;\n if (list && list.scrollHeight <= list.clientHeight + 1) loadMore();\n });\n return () => cancelAnimationFrame(frame);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [opened, hasMore, fetching, shownCount]);\n\n // The list remounts per search, so highlight after the new one is on screen.\n const firstOption = shown[0]?.items[0]?.value;\n useEffect(() => {\n if (opened && query) combobox.selectFirstOption();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [opened, query, firstOption]);\n\n // Tell the parent about the option of the current value, once per value.\n const notified = useRef<string | null>(null);\n const latestSelect = useRef(onOptionSelect);\n latestSelect.current = onOptionSelect;\n useEffect(() => {\n notified.current = null;\n }, [resyncToken]);\n const singleSelected = !multiple ? selected[0] : undefined;\n useEffect(() => {\n if (multiple) return;\n if (!singleSelected) {\n if (!values.length) notified.current = null;\n return;\n }\n if (notified.current === singleSelected.value) return;\n notified.current = singleSelected.value;\n latestSelect.current?.(singleSelected.option);\n }, [multiple, singleSelected, values.length, resyncToken]);\n\n const setSingle = (next: string | null) => {\n if (controlled === undefined) setInternal(next);\n onChange?.(next ?? emptyValue, next === null ? null : (lookup.get(next)?.option ?? null));\n if (next !== null) onValueChange?.(next);\n };\n const setMany = (next: string[]) => {\n if (controlled === undefined) setInternal(next);\n onChange?.(next, next.map((value) => lookup.get(value)?.option).filter((option): option is SelectEntry => option !== undefined));\n };\n const clear = () => {\n if (multiple) setMany([]);\n else setSingle(null);\n onBlur?.();\n };\n\n const canClear = clearable && values.length > 0 && !disabled && !readOnly;\n const renderInput = (item: SelectItem, checked: boolean): SelectRenderInput => ({ option: typeof item.option === \"object\" ? item.option : item.record, value: item.value, label: item.node, checked, disabled: !!item.disabled, search });\n const option = (item: SelectItem) => {\n const checked = values.includes(item.value);\n const extra = getOptionProps?.(item.option, { checked, disabled: !!item.disabled });\n const { className: extraClass, style: extraStyle, ...extraProps } = (extra ?? {}) as { className?: string; style?: React.CSSProperties };\n const mark = !withCheckIcon ? null : multiple ? (\n <span {...getStyles(\"box\")} data-checked={checked || undefined} aria-hidden>\n {checked && (checkIcon ?? <CheckIcon size={12} />)}\n </span>\n ) : (\n <span {...getStyles(\"check\")} data-checked={checked || undefined} aria-hidden>\n {checkIcon ?? <CheckIcon />}\n </span>\n );\n return (\n <ComboboxOption key={item.value} value={item.value} active={checked} disabled={item.disabled} {...getStyles(\"option\", { className: extraClass, style: extraStyle })} {...extraProps}>\n {checkIconPosition === \"left\" && mark}\n {renderOption ? (\n <span {...getStyles(\"optionBody\")}>{renderOption(renderInput(item, checked))}</span>\n ) : (\n <>\n {!!item.record.leftSection && <span {...getStyles(\"optionSection\")} data-position=\"left\">{item.record.leftSection}</span>}\n <span {...getStyles(\"optionBody\")}>\n <span {...getStyles(\"optionLabel\")}>{item.node}</span>\n {!!item.record.description && <span {...getStyles(\"optionDescription\")}>{item.record.description}</span>}\n </span>\n {!!item.record.rightSection && <span {...getStyles(\"optionSection\")} data-position=\"right\">{item.record.rightSection}</span>}\n </>\n )}\n {checkIconPosition === \"right\" && mark}\n </ComboboxOption>\n );\n };\n\n const dropdownState: SelectDropdownState = {\n close: () => {\n combobox.closeDropdown();\n combobox.focusTarget();\n },\n search,\n shown: shownCount,\n total,\n hasMore,\n loading: fetching,\n };\n const slot = (content: SelectBaseProps[\"dropdownHeader\"]) => (typeof content === \"function\" ? content(dropdownState) : content);\n const firstLoad = fetching && !shownCount;\n return (\n <Combobox\n store={combobox}\n unstyled={unstyled}\n {...comboboxProps}\n onOptionSubmit={(next) => {\n if (multiple) {\n if (values.includes(next)) setMany(values.filter((value) => value !== next));\n else if (maxValues === undefined || values.length < maxValues) setMany([...values, next]);\n return;\n }\n if (next === values[0]) {\n if (allowDeselect) setSingle(null);\n } else setSingle(next);\n combobox.closeDropdown();\n combobox.focusTarget();\n }}\n >\n <ComboboxTarget targetType=\"button\">\n <InputBase\n __staticSelector=\"Select\"\n component=\"button\"\n type=\"button\"\n ref={ref}\n radius={radius}\n pointer\n disabled={disabled}\n withAsterisk={required || withAsterisk}\n unstyled={unstyled}\n classNames={partClasses}\n styles={partStyles}\n className={cx(!unstyled && \"wello-Select-trigger\", className)}\n rightSectionPointerEvents=\"none\"\n rightSectionWidth={canClear ? \"3.5rem\" : undefined}\n rightSection={\n rightSection ?? (\n <span {...getStyles(\"sections\")}>\n {canClear && <ComboboxClearButton {...getStyles(\"clear\")} onClear={clear} />}\n <ComboboxChevron />\n </span>\n )\n }\n onClick={(event: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n if (!event.defaultPrevented && !readOnly) combobox.toggleDropdown();\n }}\n onBlur={() => {\n if (!opened) onBlur?.();\n }}\n {...(props as object)}\n >\n {multiple && selected.length ? (\n <span {...getStyles(\"pills\")}>\n {selected.slice(0, maxDisplayedValues).map((item) => (\n <span key={item.value} {...getStyles(\"pill\")}>\n {renderValue ? renderValue(renderInput(item, true)) : item.node}\n </span>\n ))}\n {selected.length > maxDisplayedValues && <span {...getStyles(\"pill\")}>+{selected.length - maxDisplayedValues}</span>}\n </span>\n ) : !multiple && selected.length ? (\n <span {...getStyles(\"value\")}>{renderValue ? renderValue(renderInput(selected[0], true)) : selected[0].display}</span>\n ) : (\n <Input.Placeholder>{placeholder}</Input.Placeholder>\n )}\n </InputBase>\n </ComboboxTarget>\n\n <ComboboxDropdown {...getStyles(\"dropdown\", { style: { maxHeight: maxDropdownHeight } })}>\n {withSearch && (\n <div {...getStyles(\"searchWrap\")}>\n <label {...getStyles(\"searchBox\")}>\n {searchIcon ?? <SearchIcon {...getStyles(\"searchIcon\")} />}\n <ComboboxSearch\n {...getStyles(\"search\")}\n placeholder={searchPlaceholder}\n value={search}\n onChange={(event) => setSearch(event.currentTarget.value)}\n onKeyDown={(event) => {\n // Inside a form, Enter must not submit it.\n if (event.key === \"Enter\") event.preventDefault();\n if (event.key === \"Enter\" && combobox.listRef.current?.querySelector(\"[data-combobox-selected]\")) combobox.clickSelectedOption();\n if (event.key === \"Enter\") event.stopPropagation();\n if (event.key === \"Tab\" || event.key === \"Escape\") combobox.focusTarget();\n }}\n autoComplete=\"off\"\n autoCorrect=\"off\"\n spellCheck={false}\n />\n {fetching && <Loader color=\"currentColor\" size={14} {...getStyles(\"spinner\")} />}\n {search && (\n <button type=\"button\" {...getStyles(\"searchClear\")} aria-label={labels.clearSearch} onMouseDown={(event) => event.preventDefault()} onClick={() => setSearch(\"\")}>\n <svg viewBox=\"0 0 24 24\" width=\"0.875rem\" height=\"0.875rem\" fill=\"none\" stroke=\"currentColor\" strokeWidth={2.25} strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M18 6 6 18M6 6l12 12\" />\n </svg>\n </button>\n )}\n </label>\n </div>\n )}\n {dropdownHeader && <div {...getStyles(\"dropdownHeader\")}>{slot(dropdownHeader)}</div>}\n\n {firstLoad ? (\n <div {...getStyles(\"state\")}>\n <Loader color=\"currentColor\" size={16} />\n {loadingMessage}\n </div>\n ) : !shownCount ? (\n <div {...getStyles(\"empty\")}>\n <EmptyState withBorder={false}>{remote.failed ? errorMessage : nothingFoundMessage}</EmptyState>\n </div>\n ) : (\n <>\n <ComboboxOptions\n key={`${loadKey ?? \"\"}|${query}`}\n mah=\"none\"\n {...getStyles(\"options\")}\n aria-multiselectable={multiple || undefined}\n {...({\n onScroll: (event: React.UIEvent<HTMLDivElement>) => {\n const { scrollTop, clientHeight, scrollHeight } = event.currentTarget;\n if ((scrollTop + clientHeight) / scrollHeight > 0.8) loadMore();\n },\n onWheel: (event: React.WheelEvent) => event.stopPropagation(),\n } as object)}\n >\n {shown.map((group, index) =>\n group.group ? (\n <ComboboxGroup key={`${group.group}-${index}`} label={group.group} {...getStyles(\"group\")} labelProps={getStyles(\"groupLabel\")}>\n {group.items.map(option)}\n </ComboboxGroup>\n ) : (\n group.items.map(option)\n ),\n )}\n </ComboboxOptions>\n {renderFooter\n ? renderFooter(dropdownState)\n : withFooter &&\n (fetching ? (\n <div {...getStyles(\"footer\")} data-loading>\n <Loader color=\"currentColor\" size={14} />\n {loadingMoreMessage}\n </div>\n ) : (\n <div {...getStyles(\"footer\")}>\n <span {...getStyles(\"count\")}>\n {shownCount}\n {total ? ` / ${total}` : \"\"}\n </span>\n {!hasMore && <span {...getStyles(\"allLoaded\")}>{allLoadedMessage}</span>}\n </div>\n ))}\n </>\n )}\n {dropdownFooter && <div {...getStyles(\"dropdownFooter\")}>{slot(dropdownFooter)}</div>}\n </ComboboxDropdown>\n {name && <input type=\"hidden\" name={name} value={values.join(\",\")} />}\n </Combobox>\n );\n});\nSelectRoot.displayName = \"Select\";\n\n/**\n * One option can be any shape: `description`, `leftSection`, `rightSection`, or `renderOption`.\n * Every part takes `classNames` and `styles`.\n *\n * @example\n * <Select options={[{ value: 1, label: \"Pro\", description: \"Monthly\", rightSection: \"$29\" }]} />\n * <Select<Plan> options={plans} renderOption={({ option }) => <PlanRow plan={option} />} classNames={{ option: \"rounded-none\" }} />\n */\nexport const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AAM,IAAI,MAAM,KADL,GAAG,MAAM,KAAK,IAAI,KAAK,EAE3C,IAEA,MAAM,MAAM,IAAI,MAAM;AAAA,gBAE1B;AAAA;AAAA,cApBK,GAAG,WAAW,EAAE,IAAI,KAAK;AAAA,YAqBhC;AAAA,YACC,eACG,aAAa,aAAa,IAC1B,eACC,WACC,qBAAC,SAAK,GAAG,UAAU,QAAQ,GAAG,gBAAY,MACxC;AAAA,kCAAC,UAAO,OAAM,gBAAe,MAAM,IAAI;AAAA,cACtC;AAAA,eACH,IAEA,qBAAC,SAAK,GAAG,UAAU,QAAQ,GACzB;AAAA,mCAAC,UAAM,GAAG,UAAU,OAAO,GACxB;AAAA;AAAA,gBACA,QAAQ,MAAM,KAAK,KAAK;AAAA,iBAC3B;AAAA,cACC,CAAC,WAAW,oBAAC,UAAM,GAAG,UAAU,WAAW,GAAI,4BAAiB;AAAA,eACnE;AAAA,aAER;AAAA,UAED,kBAAkB,oBAAC,SAAK,GAAG,UAAU,gBAAgB,GAAI,eAAK,cAAc,GAAE;AAAA,WACjF;AAAA,QACC,QAAQ,oBAAC,WAAM,MAAK,UAAS,MAAY,OAAO,OAAO,KAAK,GAAG,GAAG;AAAA;AAAA;AAAA,EACrE;AAEJ,CAAC;AACD,WAAW,cAAc;AAUlB,IAAMC,UAAS;","names":["option","Select"]}
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-4QBFXTYH.js";
5
5
 
6
6
  // src/components/NumberFormatter/NumberFormatter.tsx
7
- import { Fragment, jsx } from "react/jsx-runtime";
7
+ import { jsx } from "react/jsx-runtime";
8
8
  function formatNumber(value, options = {}) {
9
9
  if (value === null || value === void 0 || value === "") return "";
10
10
  const {
@@ -32,11 +32,11 @@ function formatNumber(value, options = {}) {
32
32
  }
33
33
  function NumberFormatter(_props) {
34
34
  const { value, ...options } = useProps("NumberFormatter", {}, _props);
35
- return /* @__PURE__ */ jsx(Fragment, { children: formatNumber(value, options) });
35
+ return /* @__PURE__ */ jsx("span", { dir: "ltr", style: { unicodeBidi: "isolate" }, children: formatNumber(value, options) });
36
36
  }
37
37
 
38
38
  export {
39
39
  formatNumber,
40
40
  NumberFormatter
41
41
  };
42
- //# sourceMappingURL=chunk-KEYIOWAG.js.map
42
+ //# sourceMappingURL=chunk-TIVOXLDX.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/NumberFormatter/NumberFormatter.tsx"],"sourcesContent":["import { useProps } from \"../../core/styles-api/styles-api\";\n\nexport interface NumberFormatterProps {\n value?: number | string | null;\n /** Before the number, e.g. `'$ '` */\n prefix?: string;\n /** After the number, e.g. `' SAR'` */\n suffix?: string;\n /** `true` for `,`, or your own separator */\n thousandSeparator?: string | boolean;\n /** Default: '.' */\n decimalSeparator?: string;\n /** Digits after the decimal point (rounded) */\n decimalScale?: number;\n /** Always show `decimalScale` digits */\n fixedDecimalScale?: boolean;\n /** Allow negative numbers. Default: true */\n allowNegative?: boolean;\n /** Group size: `'thousand'` (1,000,000), `'lakh'` (10,00,000), `'wan'` (1,0000). Default: 'thousand' */\n thousandsGroupStyle?: \"thousand\" | \"lakh\" | \"wan\" | \"none\";\n}\n\n/** Formats a number as text, like the component (usable in non-React code). */\nexport function formatNumber(value: number | string | null | undefined, options: Omit<NumberFormatterProps, \"value\"> = {}): string {\n if (value === null || value === undefined || value === \"\") return \"\";\n const {\n prefix = \"\",\n suffix = \"\",\n thousandSeparator,\n decimalSeparator = \".\",\n decimalScale,\n fixedDecimalScale,\n allowNegative = true,\n thousandsGroupStyle = \"thousand\",\n } = options;\n let number = typeof value === \"number\" ? value : Number(String(value).replace(/[^\\d.-]/g, \"\"));\n if (Number.isNaN(number)) return String(value);\n if (!allowNegative) number = Math.abs(number);\n const negative = number < 0;\n let [integer, fraction = \"\"] = (decimalScale !== undefined ? Math.abs(number).toFixed(decimalScale) : String(Math.abs(number))).split(\".\");\n if (decimalScale !== undefined && !fixedDecimalScale) fraction = fraction.replace(/0+$/, \"\");\n const separator = thousandSeparator === true ? \",\" : thousandSeparator || \"\";\n if (separator && thousandsGroupStyle !== \"none\") {\n const pattern =\n thousandsGroupStyle === \"lakh\" ? /(\\d+?)(?=(\\d\\d)+(\\d)(?!\\d))/g : thousandsGroupStyle === \"wan\" ? /(\\d)(?=(\\d{4})+(?!\\d))/g : /(\\d)(?=(\\d{3})+(?!\\d))/g;\n integer = integer.replace(pattern, `$1${separator}`);\n }\n return `${negative ? \"-\" : \"\"}${prefix}${integer}${fraction ? `${decimalSeparator}${fraction}` : \"\"}${suffix}`;\n}\n\n/**\n * Prints a formatted number.\n *\n * @example\n * <NumberFormatter value={1234567.891} thousandSeparator decimalScale={2} suffix=\" SAR\" />\n */\nexport function NumberFormatter(_props: NumberFormatterProps) {\n const { value, ...options } = useProps(\"NumberFormatter\", {}, _props);\n return <>{formatNumber(value, options)}</>;\n}\n"],"mappings":";;;;;;AA0DS;AAnCF,SAAS,aAAa,OAA2C,UAA+C,CAAC,GAAW;AACjI,MAAI,UAAU,QAAQ,UAAU,UAAa,UAAU,GAAI,QAAO;AAClE,QAAM;AAAA,IACJ,SAAS;AAAA,IACT,SAAS;AAAA,IACT;AAAA,IACA,mBAAmB;AAAA,IACnB;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,IAChB,sBAAsB;AAAA,EACxB,IAAI;AACJ,MAAI,SAAS,OAAO,UAAU,WAAW,QAAQ,OAAO,OAAO,KAAK,EAAE,QAAQ,YAAY,EAAE,CAAC;AAC7F,MAAI,OAAO,MAAM,MAAM,EAAG,QAAO,OAAO,KAAK;AAC7C,MAAI,CAAC,cAAe,UAAS,KAAK,IAAI,MAAM;AAC5C,QAAM,WAAW,SAAS;AAC1B,MAAI,CAAC,SAAS,WAAW,EAAE,KAAK,iBAAiB,SAAY,KAAK,IAAI,MAAM,EAAE,QAAQ,YAAY,IAAI,OAAO,KAAK,IAAI,MAAM,CAAC,GAAG,MAAM,GAAG;AACzI,MAAI,iBAAiB,UAAa,CAAC,kBAAmB,YAAW,SAAS,QAAQ,OAAO,EAAE;AAC3F,QAAM,YAAY,sBAAsB,OAAO,MAAM,qBAAqB;AAC1E,MAAI,aAAa,wBAAwB,QAAQ;AAC/C,UAAM,UACJ,wBAAwB,SAAS,iCAAiC,wBAAwB,QAAQ,4BAA4B;AAChI,cAAU,QAAQ,QAAQ,SAAS,KAAK,SAAS,EAAE;AAAA,EACrD;AACA,SAAO,GAAG,WAAW,MAAM,EAAE,GAAG,MAAM,GAAG,OAAO,GAAG,WAAW,GAAG,gBAAgB,GAAG,QAAQ,KAAK,EAAE,GAAG,MAAM;AAC9G;AAQO,SAAS,gBAAgB,QAA8B;AAC5D,QAAM,EAAE,OAAO,GAAG,QAAQ,IAAI,SAAS,mBAAmB,CAAC,GAAG,MAAM;AACpE,SAAO,gCAAG,uBAAa,OAAO,OAAO,GAAE;AACzC;","names":[]}
1
+ {"version":3,"sources":["../src/components/NumberFormatter/NumberFormatter.tsx"],"sourcesContent":["import { useProps } from \"../../core/styles-api/styles-api\";\n\nexport interface NumberFormatterProps {\n value?: number | string | null;\n /** Before the number, e.g. `'$ '` */\n prefix?: string;\n /** After the number, e.g. `' SAR'` */\n suffix?: string;\n /** `true` for `,`, or your own separator */\n thousandSeparator?: string | boolean;\n /** Default: '.' */\n decimalSeparator?: string;\n /** Digits after the decimal point (rounded) */\n decimalScale?: number;\n /** Always show `decimalScale` digits */\n fixedDecimalScale?: boolean;\n /** Allow negative numbers. Default: true */\n allowNegative?: boolean;\n /** Group size: `'thousand'` (1,000,000), `'lakh'` (10,00,000), `'wan'` (1,0000). Default: 'thousand' */\n thousandsGroupStyle?: \"thousand\" | \"lakh\" | \"wan\" | \"none\";\n}\n\n/** Formats a number as text, like the component (usable in non-React code). */\nexport function formatNumber(value: number | string | null | undefined, options: Omit<NumberFormatterProps, \"value\"> = {}): string {\n if (value === null || value === undefined || value === \"\") return \"\";\n const {\n prefix = \"\",\n suffix = \"\",\n thousandSeparator,\n decimalSeparator = \".\",\n decimalScale,\n fixedDecimalScale,\n allowNegative = true,\n thousandsGroupStyle = \"thousand\",\n } = options;\n let number = typeof value === \"number\" ? value : Number(String(value).replace(/[^\\d.-]/g, \"\"));\n if (Number.isNaN(number)) return String(value);\n if (!allowNegative) number = Math.abs(number);\n const negative = number < 0;\n let [integer, fraction = \"\"] = (decimalScale !== undefined ? Math.abs(number).toFixed(decimalScale) : String(Math.abs(number))).split(\".\");\n if (decimalScale !== undefined && !fixedDecimalScale) fraction = fraction.replace(/0+$/, \"\");\n const separator = thousandSeparator === true ? \",\" : thousandSeparator || \"\";\n if (separator && thousandsGroupStyle !== \"none\") {\n const pattern =\n thousandsGroupStyle === \"lakh\" ? /(\\d+?)(?=(\\d\\d)+(\\d)(?!\\d))/g : thousandsGroupStyle === \"wan\" ? /(\\d)(?=(\\d{4})+(?!\\d))/g : /(\\d)(?=(\\d{3})+(?!\\d))/g;\n integer = integer.replace(pattern, `$1${separator}`);\n }\n return `${negative ? \"-\" : \"\"}${prefix}${integer}${fraction ? `${decimalSeparator}${fraction}` : \"\"}${suffix}`;\n}\n\n/**\n * Prints a formatted number.\n *\n * @example\n * <NumberFormatter value={1234567.891} thousandSeparator decimalScale={2} suffix=\" SAR\" />\n */\nexport function NumberFormatter(_props: NumberFormatterProps) {\n const { value, ...options } = useProps(\"NumberFormatter\", {}, _props);\n // Always LTR so separators / signs don't reverse on Arabic pages.\n return (\n <span dir=\"ltr\" style={{ unicodeBidi: \"isolate\" }}>\n {formatNumber(value, options)}\n </span>\n );\n}\n"],"mappings":";;;;;;AA4DI;AArCG,SAAS,aAAa,OAA2C,UAA+C,CAAC,GAAW;AACjI,MAAI,UAAU,QAAQ,UAAU,UAAa,UAAU,GAAI,QAAO;AAClE,QAAM;AAAA,IACJ,SAAS;AAAA,IACT,SAAS;AAAA,IACT;AAAA,IACA,mBAAmB;AAAA,IACnB;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,IAChB,sBAAsB;AAAA,EACxB,IAAI;AACJ,MAAI,SAAS,OAAO,UAAU,WAAW,QAAQ,OAAO,OAAO,KAAK,EAAE,QAAQ,YAAY,EAAE,CAAC;AAC7F,MAAI,OAAO,MAAM,MAAM,EAAG,QAAO,OAAO,KAAK;AAC7C,MAAI,CAAC,cAAe,UAAS,KAAK,IAAI,MAAM;AAC5C,QAAM,WAAW,SAAS;AAC1B,MAAI,CAAC,SAAS,WAAW,EAAE,KAAK,iBAAiB,SAAY,KAAK,IAAI,MAAM,EAAE,QAAQ,YAAY,IAAI,OAAO,KAAK,IAAI,MAAM,CAAC,GAAG,MAAM,GAAG;AACzI,MAAI,iBAAiB,UAAa,CAAC,kBAAmB,YAAW,SAAS,QAAQ,OAAO,EAAE;AAC3F,QAAM,YAAY,sBAAsB,OAAO,MAAM,qBAAqB;AAC1E,MAAI,aAAa,wBAAwB,QAAQ;AAC/C,UAAM,UACJ,wBAAwB,SAAS,iCAAiC,wBAAwB,QAAQ,4BAA4B;AAChI,cAAU,QAAQ,QAAQ,SAAS,KAAK,SAAS,EAAE;AAAA,EACrD;AACA,SAAO,GAAG,WAAW,MAAM,EAAE,GAAG,MAAM,GAAG,OAAO,GAAG,WAAW,GAAG,gBAAgB,GAAG,QAAQ,KAAK,EAAE,GAAG,MAAM;AAC9G;AAQO,SAAS,gBAAgB,QAA8B;AAC5D,QAAM,EAAE,OAAO,GAAG,QAAQ,IAAI,SAAS,mBAAmB,CAAC,GAAG,MAAM;AAEpE,SACE,oBAAC,UAAK,KAAI,OAAM,OAAO,EAAE,aAAa,UAAU,GAC7C,uBAAa,OAAO,OAAO,GAC9B;AAEJ;","names":[]}
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-TVOR2RGE.js";
5
5
  import {
6
6
  Select
7
- } from "./chunk-2XGMU4QA.js";
7
+ } from "./chunk-RVFCTNPD.js";
8
8
  import {
9
9
  InputError,
10
10
  InputWrapper
@@ -383,6 +383,7 @@ var PhoneInput = factory((_props, ref) => {
383
383
  const shownPlaceholder = typeof placeholder === "function" ? placeholder(limit) : placeholder ?? (limit ? labels.phoneDigits(limit) : void 0);
384
384
  const layout = { m, mt, mb, ml, mr, ms, me, mx, my, w, miw, maw, flex };
385
385
  if (loading) return /* @__PURE__ */ jsx(Skeleton, { height: 36, radius: 999, ...layout });
386
+ const selectPropClassNames = typeof selectProps?.classNames === "object" && selectProps.classNames ? selectProps.classNames : {};
386
387
  const select = {
387
388
  value: code,
388
389
  emptyValue: "",
@@ -391,10 +392,36 @@ var PhoneInput = factory((_props, ref) => {
391
392
  placeholder: codePlaceholder,
392
393
  withFooter: false,
393
394
  radius: 0,
394
- comboboxProps: { width: 240, position: "bottom-start", withinPortal: true },
395
395
  "aria-invalid": !!codeError || void 0,
396
396
  "aria-label": codePlaceholder,
397
397
  ...selectProps,
398
+ // PhoneInput wins these after selectProps — dial codes stay LTR and compact.
399
+ searchable: false,
400
+ checkIconPosition: "right",
401
+ classNames: {
402
+ ...selectPropClassNames,
403
+ dropdown: ["wello-PhoneInput-dropdown", selectPropClassNames.dropdown].filter(Boolean).join(" ")
404
+ },
405
+ attributes: {
406
+ ...typeof selectProps?.attributes === "object" ? selectProps.attributes : {},
407
+ // Physical LTR on the portaled node — portal root may still be dir=rtl from <html>.
408
+ dropdown: {
409
+ ...typeof selectProps?.attributes === "object" && selectProps.attributes?.dropdown || {},
410
+ dir: "ltr"
411
+ }
412
+ },
413
+ comboboxProps: {
414
+ middlewares: { flip: true, shift: true },
415
+ ...selectProps?.comboboxProps,
416
+ // Physical left — never mirrors in RTL (start/end would).
417
+ position: "bottom-left",
418
+ // Shrink-wrap to flag+code; `target` was the narrow trigger and fought min-width.
419
+ width: "auto",
420
+ withinPortal: true,
421
+ // overflow:hidden on the phone field must not hide the menu as "detached".
422
+ hideDetached: false,
423
+ dir: "ltr"
424
+ },
398
425
  onChange: (next, option) => {
399
426
  const resolved = option?.resolved ?? null;
400
427
  if (resolved) setFetched(resolved);
@@ -479,4 +506,4 @@ export {
479
506
  fitPhoneNumber,
480
507
  PhoneInput
481
508
  };
482
- //# sourceMappingURL=chunk-QZFPW75D.js.map
509
+ //# sourceMappingURL=chunk-XBLREJCR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/PhoneInput/PhoneInput.tsx","../src/components/PhoneInput/countries.ts"],"sourcesContent":["import { useEndpointLoaders } from \"../../core/api/api\";\r\nimport { useWelloLabels } from \"../../core/provider/labels\";\r\nimport { useEffect, useMemo, useRef, useState, type ReactNode } from \"react\";\r\nimport { Box, type BoxProps } from \"../../core/Box/Box\";\r\nimport { factory } from \"../../core/factory/factory\";\r\nimport { useComponentStyles, useProps, type StylesApiProps } from \"../../core/styles-api/styles-api\";\r\nimport { useId } from \"../../core/utils\";\r\nimport { Select, type LoadOptionsInput, type SingleSelectProps } from \"../Combobox/Select\";\r\nimport { InputError, InputWrapper } from \"../Input/Input\";\r\nimport { Skeleton } from \"../Skeleton/Skeleton\";\r\nimport { ALL_PHONE_COUNTRIES, DEFAULT_PHONE_CODE } from \"./countries\";\r\n\r\nexport type PhoneInputStylesNames = \"root\" | \"label\" | \"description\" | \"field\" | \"code\" | \"codeValue\" | \"flag\" | \"dialCode\" | \"input\" | \"errors\" | \"error\";\r\n\r\n/** A country. Your API's names work too: `phone_code`, `phone_limit`, `phone_number_limit`, `phone_starting_number`. */\r\nexport interface PhoneCountry {\r\n /** Dial code, without + */\r\n code?: string | number;\r\n phone_code?: string | number;\r\n value?: string | number;\r\n name?: string;\r\n /** Image URL or your own element */\r\n flag?: ReactNode;\r\n /** Digits allowed */\r\n limit?: number | string | null;\r\n phone_limit?: number | string | null;\r\n phone_number_limit?: number | string | null;\r\n /** First digit of the number; applied when the country changes */\r\n startingNumber?: number | string | null;\r\n phone_starting_number?: number | string | null;\r\n [key: string]: unknown;\r\n}\r\n\r\n/** A country with its fields resolved. */\r\nexport interface ResolvedPhoneCountry {\r\n code: string;\r\n name?: string;\r\n flag?: ReactNode;\r\n limit: number | null;\r\n startingNumber: string | null;\r\n /** What you passed */\r\n country: PhoneCountry;\r\n}\r\n\r\nexport interface PhoneInputProps extends BoxProps, StylesApiProps<PhoneInputStylesNames, PhoneInputProps> {\r\n label?: ReactNode;\r\n description?: ReactNode;\r\n /** Number error, under the field */\r\n error?: ReactNode;\r\n /** Dial code error, under the field */\r\n codeError?: ReactNode;\r\n required?: boolean;\r\n withAsterisk?: boolean;\r\n\r\n /** The number: digits only */\r\n value?: string | number | null;\r\n defaultValue?: string | number;\r\n onChange?: (value: string) => void;\r\n onBlur?: React.FocusEventHandler<HTMLInputElement>;\r\n name?: string;\r\n id?: string;\r\n /** Text, or a function of the limit. Default: \"10 digits\" */\r\n placeholder?: string | ((limit: number | null) => string);\r\n disabled?: boolean;\r\n readOnly?: boolean;\r\n /** Skeleton instead of the field */\r\n loading?: boolean;\r\n\r\n /** The dial code */\r\n code?: string | number | null;\r\n defaultCode?: string | number;\r\n /** `seed` is true when a fixed list picked its first country by itself, so a form shouldn't turn dirty */\r\n onCodeChange?: (code: string, country: ResolvedPhoneCountry | null, meta: { seed: boolean }) => void;\r\n /** Form name of the dial code (hidden input) */\r\n codeName?: string;\r\n /** Form name of the limit (hidden input) */\r\n limitName?: string;\r\n /** Form name of the country's required first digit(s) (hidden input) */\r\n startingNumberName?: string;\r\n\r\n /** Fixed list. Default: every country's dial code, starting on Egypt (+20) */\r\n countries?: PhoneCountry[];\r\n /**\r\n * Address of the countries on your API (`\"countries\"`): the only thing needed to fetch them. The base address and\r\n * headers come from the theme's `api`. With `params={{ paginate: false }}` everything is asked at once.\r\n */\r\n endpoint?: string | null;\r\n /** With `endpoint`: more query parameters */\r\n params?: Record<string, unknown>;\r\n /** With `endpoint`: use `api.generalBaseURL` */\r\n general?: boolean;\r\n /** With `endpoint`: turn the whole answer into the list of countries, when `{ data: [...] }` or an array doesn't fit */\r\n select?: (data: any) => PhoneCountry[];\r\n /** Fetch countries instead. Same input as Select's `loadOptions` */\r\n loadCountries?: (input: LoadOptionsInput) => Promise<PhoneCountry[] | { items: PhoneCountry[]; total?: number; hasMore?: boolean }> | PhoneCountry[] | { items: PhoneCountry[]; total?: number; hasMore?: boolean };\r\n /** Change it to fetch again */\r\n loadKey?: string | number | null;\r\n\r\n /** Digits allowed. Default: from the country */\r\n limit?: number | null;\r\n onLimitChange?: (limit: number | null) => void;\r\n onStartingNumberChange?: (startingNumber: string | null) => void;\r\n /** Change it to fire `onLimitChange` and `onStartingNumberChange` again (e.g. after a form reset) */\r\n resyncToken?: string | number | null;\r\n\r\n /** Own flag + code, in the field and the list */\r\n renderCountry?: (country: ResolvedPhoneCountry) => ReactNode;\r\n /** Shown when there is no dial code. Default: 'Code' */\r\n codePlaceholder?: string;\r\n /** Anything else for the dial code Select: search text, messages, classNames… */\r\n selectProps?: Partial<SingleSelectProps>;\r\n}\r\n\r\nconst DEFAULT_COUNTRIES = ALL_PHONE_COUNTRIES;\r\n\r\nconst digitsOnly = (value: unknown) => String(value ?? \"\").replace(/\\D/g, \"\");\r\n\r\nfunction parseLimit(value: unknown) {\r\n const limit = Number(value);\r\n return Number.isFinite(limit) && limit > 0 ? limit : null;\r\n}\r\n\r\n/** Country `startingNumber` / `phone_starting_number` as digits. */\r\nexport function normalizeStartingNumber(value: unknown): string | null {\r\n if (value == null || value === \"\") return null;\r\n const digits = digitsOnly(value);\r\n return digits || null;\r\n}\r\n\r\n/**\r\n * True when digits already match the required start, or are still a partial prefix of it\r\n * (so typing the first digit of a multi-digit start is allowed).\r\n */\r\nexport function matchesPhoneStartingNumber(digits: string, start: string | null): boolean {\r\n if (!start || !digits) return true;\r\n return digits.startsWith(start) || start.startsWith(digits);\r\n}\r\n\r\n/** Fills in a country's fields from any of their names. */\r\nexport function resolvePhoneCountry(country: PhoneCountry): ResolvedPhoneCountry {\r\n return {\r\n code: String(country.code ?? country.phone_code ?? country.value ?? \"\"),\r\n name: country.name,\r\n flag: country.flag,\r\n limit: parseLimit(country.limit ?? country.phone_limit ?? country.phone_number_limit),\r\n startingNumber: normalizeStartingNumber(country.startingNumber ?? country.phone_starting_number),\r\n country,\r\n };\r\n}\r\n\r\n/** Number after moving to a country: right first digit, not over its limit. */\r\nexport function fitPhoneNumber(value: unknown, country: Pick<ResolvedPhoneCountry, \"limit\" | \"startingNumber\">) {\r\n let phone = digitsOnly(value);\r\n if (phone && country.startingNumber && !phone.startsWith(country.startingNumber)) {\r\n phone = country.startingNumber + phone.slice(country.startingNumber.length);\r\n }\r\n return country.limit ? phone.slice(0, country.limit) : phone;\r\n}\r\n\r\n/**\r\n * Phone number with a dial code. Keeps digits only, limits them per country and fixes the\r\n * first digit when the country changes. Takes react-hook-form's `{...field}` for the number.\r\n *\r\n * @example\r\n * <PhoneInput label=\"Phone\" value={phone} onChange={setPhone} code={code} onCodeChange={setCode} countries={[\r\n * { code: \"966\", name: \"Saudi Arabia\", flag: \"https://flagcdn.com/sa.svg\", limit: 9, startingNumber: 5 },\r\n * { code: \"20\", name: \"Egypt\", flag: \"https://flagcdn.com/eg.svg\", limit: 10, startingNumber: 1 },\r\n * ]} />\r\n * <PhoneInput {...field} loadCountries={() => api.countries().then((r) => r.data)} onCodeChange={(c) => setValue(\"phone_code\", c)} onLimitChange={(l) => setValue(\"phone_limit\", l)} />\r\n */\r\nexport const PhoneInput = factory<{ props: PhoneInputProps; ref: HTMLInputElement; stylesNames: PhoneInputStylesNames }>((_props, ref) => {\r\n const labels = useWelloLabels();\r\n const props = useProps(\"PhoneInput\", {}, _props);\r\n const [getStyles, rest] = useComponentStyles(\"PhoneInput\", props);\r\n const {\r\n label,\r\n description,\r\n error,\r\n codeError,\r\n required,\r\n withAsterisk,\r\n value: controlled,\r\n defaultValue,\r\n onChange,\r\n onBlur,\r\n name,\r\n id,\r\n placeholder,\r\n disabled,\r\n readOnly,\r\n loading,\r\n code: codeProp,\r\n defaultCode,\r\n onCodeChange,\r\n codeName,\r\n limitName,\r\n startingNumberName,\r\n countries,\r\n endpoint,\r\n params,\r\n general,\r\n select: selectCountries,\r\n loadCountries: loadCountriesProp,\r\n loadKey: loadKeyProp,\r\n limit: limitProp,\r\n onLimitChange,\r\n onStartingNumberChange,\r\n resyncToken,\r\n renderCountry,\r\n codePlaceholder = labels.phoneCode,\r\n selectProps,\r\n // Layout goes on the root.\r\n m, mt, mb, ml, mr, ms, me, mx, my, w, miw, maw, flex,\r\n ...inputProps\r\n } = rest;\r\n const inputId = useId(id);\r\n const fromEndpoint = useEndpointLoaders({ endpoint, params, general, select: selectCountries, hasShow: false });\r\n const loadCountries = (loadCountriesProp ?? fromEndpoint.loadOptions) as PhoneInputProps[\"loadCountries\"];\r\n const loadKey = loadKeyProp ?? fromEndpoint.loadKey;\r\n const remote = !!loadCountries;\r\n\r\n // Number\r\n const [internal, setInternal] = useState(digitsOnly(defaultValue));\r\n const phone = controlled !== undefined ? digitsOnly(controlled) : internal;\r\n const setPhone = (next: string) => {\r\n if (controlled === undefined) setInternal(next);\r\n onChange?.(next);\r\n };\r\n\r\n // Dial code\r\n const [codeInternal, setCodeInternal] = useState(defaultCode === undefined ? \"\" : String(defaultCode));\r\n const code = codeProp !== undefined ? String(codeProp ?? \"\") : codeInternal;\r\n const list = useMemo(() => (countries?.length ? countries : DEFAULT_COUNTRIES).map(resolvePhoneCountry), [countries]);\r\n const [fetched, setFetched] = useState<ResolvedPhoneCountry | null>(null);\r\n const country = remote ? (fetched && fetched.code === code ? fetched : null) : (list.find((item) => item.code === code) ?? null);\r\n const limit = limitProp ?? country?.limit ?? null;\r\n const startingNumber = country?.startingNumber ?? null;\r\n\r\n const setCode = (next: string, resolved: ResolvedPhoneCountry | null, seed = false) => {\r\n if (codeProp === undefined) setCodeInternal(next);\r\n onCodeChange?.(next, resolved, { seed });\r\n };\r\n\r\n // A fixed list always has a code: start on the first country.\r\n // With no list of your own, the full list starts on Egypt, not on the first name alphabetically.\r\n const usesDefaults = !remote && !countries?.length;\r\n const first = remote ? undefined : usesDefaults ? (list.find((item) => item.code === DEFAULT_PHONE_CODE) ?? list[0]) : list[0];\r\n useEffect(() => {\r\n if (!code && first) setCode(first.code, first, true);\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [code, first?.code]);\r\n\r\n // Tell the form the limit and first digit of the current country.\r\n const callbacks = useRef({ onLimitChange, onStartingNumberChange });\r\n callbacks.current = { onLimitChange, onStartingNumberChange };\r\n const countryLimit = country?.limit ?? null;\r\n useEffect(() => callbacks.current.onLimitChange?.(countryLimit), [countryLimit, resyncToken]);\r\n useEffect(() => callbacks.current.onStartingNumberChange?.(startingNumber), [startingNumber, resyncToken]);\r\n\r\n // Changing country fits the number to it. The first country is left alone: that's saved data.\r\n const lastCode = useRef(\"\");\r\n const latest = useRef({ phone, setPhone });\r\n latest.current = { phone, setPhone };\r\n const countryCode = country?.code ?? \"\";\r\n useEffect(() => {\r\n const previous = lastCode.current;\r\n lastCode.current = countryCode;\r\n if (!previous || !country || previous === countryCode) return;\r\n const fitted = fitPhoneNumber(latest.current.phone, country);\r\n if (fitted !== latest.current.phone) latest.current.setPhone(fitted);\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [countryCode]);\r\n\r\n const showCountry = (item: ResolvedPhoneCountry) =>\r\n renderCountry ? (\r\n renderCountry(item)\r\n ) : (\r\n // Always LTR: flag then dial code (RTL pages were flipping to \"966 | flag\").\r\n <span {...getStyles(\"codeValue\")} dir=\"ltr\">\r\n {typeof item.flag === \"string\" ? <img {...getStyles(\"flag\")} src={item.flag} alt={item.name ?? \"\"} onError={(event) => (event.currentTarget.style.display = \"none\")} /> : item.flag}\r\n <span {...getStyles(\"dialCode\")}>{item.code}</span>\r\n </span>\r\n );\r\n const toOption = (item: ResolvedPhoneCountry) => ({ value: item.code, label: showCountry(item), searchText: `${item.name ?? \"\"} ${item.code}`, resolved: item });\r\n\r\n const hasMessage = (message: ReactNode) => message !== undefined && message !== null && message !== false && message !== true && message !== \"\";\r\n const startingMismatch =\r\n !!startingNumber && !!phone && !matchesPhoneStartingNumber(phone, startingNumber);\r\n const startingError = startingMismatch ? labels.phoneStartingNumber(startingNumber) : null;\r\n // External `error` wins; otherwise show the starting-digit message while typing.\r\n const numberError = hasMessage(error) ? error : startingError;\r\n const hasError = hasMessage(numberError) || hasMessage(codeError);\r\n const errorId = `${inputId}-phone-error`;\r\n const shownPlaceholder = typeof placeholder === \"function\" ? placeholder(limit) : (placeholder ?? (limit ? labels.phoneDigits(limit) : undefined));\r\n const layout = { m, mt, mb, ml, mr, ms, me, mx, my, w, miw, maw, flex };\r\n\r\n if (loading) return <Skeleton height={36} radius={999} {...layout} />;\r\n\r\n const selectPropClassNames =\r\n typeof selectProps?.classNames === \"object\" && selectProps.classNames\r\n ? (selectProps.classNames as Record<string, string | undefined>)\r\n : {};\r\n const select = {\r\n value: code,\r\n emptyValue: \"\",\r\n disabled,\r\n readOnly,\r\n placeholder: codePlaceholder,\r\n withFooter: false,\r\n radius: 0,\r\n \"aria-invalid\": !!codeError || undefined,\r\n \"aria-label\": codePlaceholder,\r\n ...selectProps,\r\n // PhoneInput wins these after selectProps — dial codes stay LTR and compact.\r\n searchable: false,\r\n checkIconPosition: \"right\" as const,\r\n classNames: {\r\n ...selectPropClassNames,\r\n dropdown: [\"wello-PhoneInput-dropdown\", selectPropClassNames.dropdown].filter(Boolean).join(\" \"),\r\n },\r\n attributes: {\r\n ...(typeof selectProps?.attributes === \"object\" ? selectProps.attributes : {}),\r\n // Physical LTR on the portaled node — portal root may still be dir=rtl from <html>.\r\n dropdown: {\r\n ...((typeof selectProps?.attributes === \"object\" && selectProps.attributes?.dropdown) || {}),\r\n dir: \"ltr\",\r\n },\r\n },\r\n comboboxProps: {\r\n middlewares: { flip: true, shift: true },\r\n ...selectProps?.comboboxProps,\r\n // Physical left — never mirrors in RTL (start/end would).\r\n position: \"bottom-left\" as const,\r\n // Shrink-wrap to flag+code; `target` was the narrow trigger and fought min-width.\r\n width: \"auto\" as const,\r\n withinPortal: true,\r\n // overflow:hidden on the phone field must not hide the menu as \"detached\".\r\n hideDetached: false,\r\n dir: \"ltr\" as const,\r\n },\r\n onChange: (next: unknown, option: unknown) => {\r\n const resolved = (option as { resolved?: ResolvedPhoneCountry } | null)?.resolved ?? null;\r\n if (resolved) setFetched(resolved);\r\n setCode(String(next ?? \"\"), resolved);\r\n selectProps?.onChange?.(next, option as never);\r\n },\r\n };\r\n\r\n return (\r\n <InputWrapper\r\n id={inputId}\r\n label={label}\r\n description={description}\r\n required={required || withAsterisk}\r\n labelProps={getStyles(\"label\")}\r\n descriptionProps={getStyles(\"description\")}\r\n {...getStyles(\"root\")}\r\n {...layout}\r\n >\r\n {/* The code stays on the left in both directions, like a written phone number. */}\r\n <Box {...getStyles(\"field\")} mod={{ error: hasError, disabled }}>\r\n <div {...getStyles(\"code\")} data-error={codeError ? true : undefined}>\r\n {remote ? (\r\n <Select\r\n {...select}\r\n allowDeselect\r\n onOptionSelect={(option) => {\r\n setFetched((option as { resolved: ResolvedPhoneCountry }).resolved);\r\n selectProps?.onOptionSelect?.(option);\r\n }}\r\n loadKey={loadKey}\r\n loadOptions={(input) =>\r\n Promise.resolve(loadCountries!(input)).then((result) =>\r\n Array.isArray(result) ? result.map((item) => toOption(resolvePhoneCountry(item))) : { ...result, items: result.items.map((item) => toOption(resolvePhoneCountry(item))) },\r\n )\r\n }\r\n />\r\n ) : list.length > 1 ? (\r\n <Select {...select} allowDeselect={false} options={list.map(toOption)} />\r\n ) : (\r\n <span className=\"wello-PhoneInput-single\">{list[0] && showCountry(list[0])}</span>\r\n )}\r\n </div>\r\n <input\r\n {...(inputProps as object)}\r\n {...getStyles(\"input\")}\r\n ref={ref}\r\n id={inputId}\r\n type=\"tel\"\r\n inputMode=\"numeric\"\r\n autoComplete=\"tel-national\"\r\n // Digits + placeholders stay LTR (avoids \"أرقام 9\" bidi flip on RTL pages).\r\n dir=\"ltr\"\r\n name={name}\r\n value={phone}\r\n disabled={disabled}\r\n readOnly={readOnly}\r\n required={required}\r\n maxLength={limit ?? undefined}\r\n placeholder={shownPlaceholder}\r\n aria-invalid={hasMessage(numberError) || undefined}\r\n aria-describedby={hasMessage(numberError) ? errorId : undefined}\r\n onBlur={onBlur}\r\n onChange={(event) => {\r\n const digits = digitsOnly(event.currentTarget.value);\r\n setPhone(limit ? digits.slice(0, limit) : digits);\r\n }}\r\n />\r\n </Box>\r\n {(hasMessage(numberError) || hasMessage(codeError)) && (\r\n <div {...getStyles(\"errors\")}>\r\n {hasMessage(numberError) && (\r\n <InputError {...getStyles(\"error\")} id={errorId}>\r\n {numberError}\r\n </InputError>\r\n )}\r\n {hasMessage(codeError) && <InputError {...getStyles(\"error\")} data-code>{codeError}</InputError>}\r\n </div>\r\n )}\r\n {codeName && <input type=\"hidden\" name={codeName} value={code} />}\r\n {limitName && <input type=\"hidden\" name={limitName} value={limit ?? \"\"} />}\r\n {startingNumberName && <input type=\"hidden\" name={startingNumberName} value={startingNumber ?? \"\"} />}\r\n </InputWrapper>\r\n );\r\n});\r\nPhoneInput.displayName = \"PhoneInput\";\r\n","import type { PhoneCountry } from \"./PhoneInput\";\n\n/**\n * [ISO code, name, dial code]. One entry for each dial code: where countries share one (+1, +7, +44) the main\n * country stands for it, and the name says so. Digit limits differ by number type, so only Egypt (the default)\n * has one; pass your own `countries` for the rest.\n */\nconst ROWS: [string, string, string][] = [\n [\"af\", \"Afghanistan\", \"93\"],\n [\"al\", \"Albania\", \"355\"],\n [\"dz\", \"Algeria\", \"213\"],\n [\"ad\", \"Andorra\", \"376\"],\n [\"ao\", \"Angola\", \"244\"],\n [\"ar\", \"Argentina\", \"54\"],\n [\"am\", \"Armenia\", \"374\"],\n [\"aw\", \"Aruba\", \"297\"],\n [\"au\", \"Australia\", \"61\"],\n [\"at\", \"Austria\", \"43\"],\n [\"az\", \"Azerbaijan\", \"994\"],\n [\"bh\", \"Bahrain\", \"973\"],\n [\"bd\", \"Bangladesh\", \"880\"],\n [\"by\", \"Belarus\", \"375\"],\n [\"be\", \"Belgium\", \"32\"],\n [\"bz\", \"Belize\", \"501\"],\n [\"bj\", \"Benin\", \"229\"],\n [\"bt\", \"Bhutan\", \"975\"],\n [\"bo\", \"Bolivia\", \"591\"],\n [\"ba\", \"Bosnia and Herzegovina\", \"387\"],\n [\"bw\", \"Botswana\", \"267\"],\n [\"br\", \"Brazil\", \"55\"],\n [\"bn\", \"Brunei\", \"673\"],\n [\"bg\", \"Bulgaria\", \"359\"],\n [\"bf\", \"Burkina Faso\", \"226\"],\n [\"bi\", \"Burundi\", \"257\"],\n [\"kh\", \"Cambodia\", \"855\"],\n [\"cm\", \"Cameroon\", \"237\"],\n [\"cv\", \"Cape Verde\", \"238\"],\n [\"cf\", \"Central African Republic\", \"236\"],\n [\"td\", \"Chad\", \"235\"],\n [\"cl\", \"Chile\", \"56\"],\n [\"cn\", \"China\", \"86\"],\n [\"co\", \"Colombia\", \"57\"],\n [\"km\", \"Comoros\", \"269\"],\n [\"cg\", \"Congo\", \"242\"],\n [\"cd\", \"DR Congo\", \"243\"],\n [\"cr\", \"Costa Rica\", \"506\"],\n [\"ci\", \"Côte d'Ivoire\", \"225\"],\n [\"hr\", \"Croatia\", \"385\"],\n [\"cu\", \"Cuba\", \"53\"],\n [\"cy\", \"Cyprus\", \"357\"],\n [\"cz\", \"Czechia\", \"420\"],\n [\"dk\", \"Denmark\", \"45\"],\n [\"dj\", \"Djibouti\", \"253\"],\n [\"ec\", \"Ecuador\", \"593\"],\n [\"eg\", \"Egypt\", \"20\"],\n [\"sv\", \"El Salvador\", \"503\"],\n [\"gq\", \"Equatorial Guinea\", \"240\"],\n [\"er\", \"Eritrea\", \"291\"],\n [\"ee\", \"Estonia\", \"372\"],\n [\"sz\", \"Eswatini\", \"268\"],\n [\"et\", \"Ethiopia\", \"251\"],\n [\"fj\", \"Fiji\", \"679\"],\n [\"fi\", \"Finland\", \"358\"],\n [\"fr\", \"France\", \"33\"],\n [\"gf\", \"French Guiana\", \"594\"],\n [\"pf\", \"French Polynesia\", \"689\"],\n [\"ga\", \"Gabon\", \"241\"],\n [\"gm\", \"Gambia\", \"220\"],\n [\"ge\", \"Georgia\", \"995\"],\n [\"de\", \"Germany\", \"49\"],\n [\"gh\", \"Ghana\", \"233\"],\n [\"gi\", \"Gibraltar\", \"350\"],\n [\"gr\", \"Greece\", \"30\"],\n [\"gl\", \"Greenland\", \"299\"],\n [\"gp\", \"Guadeloupe\", \"590\"],\n [\"gt\", \"Guatemala\", \"502\"],\n [\"gn\", \"Guinea\", \"224\"],\n [\"gw\", \"Guinea-Bissau\", \"245\"],\n [\"gy\", \"Guyana\", \"592\"],\n [\"ht\", \"Haiti\", \"509\"],\n [\"hn\", \"Honduras\", \"504\"],\n [\"hk\", \"Hong Kong\", \"852\"],\n [\"hu\", \"Hungary\", \"36\"],\n [\"is\", \"Iceland\", \"354\"],\n [\"in\", \"India\", \"91\"],\n [\"id\", \"Indonesia\", \"62\"],\n [\"ir\", \"Iran\", \"98\"],\n [\"iq\", \"Iraq\", \"964\"],\n [\"ie\", \"Ireland\", \"353\"],\n // [\"il\", \"Israel\", \"972\"],\n [\"it\", \"Italy\", \"39\"],\n [\"jp\", \"Japan\", \"81\"],\n [\"jo\", \"Jordan\", \"962\"],\n [\"ke\", \"Kenya\", \"254\"],\n [\"ki\", \"Kiribati\", \"686\"],\n [\"kw\", \"Kuwait\", \"965\"],\n [\"kg\", \"Kyrgyzstan\", \"996\"],\n [\"la\", \"Laos\", \"856\"],\n [\"lv\", \"Latvia\", \"371\"],\n [\"lb\", \"Lebanon\", \"961\"],\n [\"ls\", \"Lesotho\", \"266\"],\n [\"lr\", \"Liberia\", \"231\"],\n [\"ly\", \"Libya\", \"218\"],\n [\"li\", \"Liechtenstein\", \"423\"],\n [\"lt\", \"Lithuania\", \"370\"],\n [\"lu\", \"Luxembourg\", \"352\"],\n [\"mo\", \"Macao\", \"853\"],\n [\"mg\", \"Madagascar\", \"261\"],\n [\"mw\", \"Malawi\", \"265\"],\n [\"my\", \"Malaysia\", \"60\"],\n [\"mv\", \"Maldives\", \"960\"],\n [\"ml\", \"Mali\", \"223\"],\n [\"mt\", \"Malta\", \"356\"],\n [\"mq\", \"Martinique\", \"596\"],\n [\"mr\", \"Mauritania\", \"222\"],\n [\"mu\", \"Mauritius\", \"230\"],\n [\"mx\", \"Mexico\", \"52\"],\n [\"md\", \"Moldova\", \"373\"],\n [\"mc\", \"Monaco\", \"377\"],\n [\"mn\", \"Mongolia\", \"976\"],\n [\"me\", \"Montenegro\", \"382\"],\n [\"ma\", \"Morocco\", \"212\"],\n [\"mz\", \"Mozambique\", \"258\"],\n [\"mm\", \"Myanmar\", \"95\"],\n [\"na\", \"Namibia\", \"264\"],\n [\"np\", \"Nepal\", \"977\"],\n [\"nl\", \"Netherlands\", \"31\"],\n [\"nc\", \"New Caledonia\", \"687\"],\n [\"nz\", \"New Zealand\", \"64\"],\n [\"ni\", \"Nicaragua\", \"505\"],\n [\"ne\", \"Niger\", \"227\"],\n [\"ng\", \"Nigeria\", \"234\"],\n [\"kp\", \"North Korea\", \"850\"],\n [\"mk\", \"North Macedonia\", \"389\"],\n [\"no\", \"Norway\", \"47\"],\n [\"om\", \"Oman\", \"968\"],\n [\"pk\", \"Pakistan\", \"92\"],\n [\"ps\", \"Palestine\", \"970\"],\n [\"pa\", \"Panama\", \"507\"],\n [\"pg\", \"Papua New Guinea\", \"675\"],\n [\"py\", \"Paraguay\", \"595\"],\n [\"pe\", \"Peru\", \"51\"],\n [\"ph\", \"Philippines\", \"63\"],\n [\"pl\", \"Poland\", \"48\"],\n [\"pt\", \"Portugal\", \"351\"],\n [\"qa\", \"Qatar\", \"974\"],\n [\"re\", \"Réunion\", \"262\"],\n [\"ro\", \"Romania\", \"40\"],\n [\"ru\", \"Russia / Kazakhstan\", \"7\"],\n [\"rw\", \"Rwanda\", \"250\"],\n [\"ws\", \"Samoa\", \"685\"],\n [\"sm\", \"San Marino\", \"378\"],\n [\"st\", \"São Tomé and Príncipe\", \"239\"],\n [\"sa\", \"Saudi Arabia\", \"966\"],\n [\"sn\", \"Senegal\", \"221\"],\n [\"rs\", \"Serbia\", \"381\"],\n [\"sc\", \"Seychelles\", \"248\"],\n [\"sl\", \"Sierra Leone\", \"232\"],\n [\"sg\", \"Singapore\", \"65\"],\n [\"sk\", \"Slovakia\", \"421\"],\n [\"si\", \"Slovenia\", \"386\"],\n [\"sb\", \"Solomon Islands\", \"677\"],\n [\"so\", \"Somalia\", \"252\"],\n [\"za\", \"South Africa\", \"27\"],\n [\"kr\", \"South Korea\", \"82\"],\n [\"ss\", \"South Sudan\", \"211\"],\n [\"es\", \"Spain\", \"34\"],\n [\"lk\", \"Sri Lanka\", \"94\"],\n [\"sd\", \"Sudan\", \"249\"],\n [\"sr\", \"Suriname\", \"597\"],\n [\"se\", \"Sweden\", \"46\"],\n [\"ch\", \"Switzerland\", \"41\"],\n [\"sy\", \"Syria\", \"963\"],\n [\"tw\", \"Taiwan\", \"886\"],\n [\"tj\", \"Tajikistan\", \"992\"],\n [\"tz\", \"Tanzania\", \"255\"],\n [\"th\", \"Thailand\", \"66\"],\n [\"tl\", \"Timor-Leste\", \"670\"],\n [\"tg\", \"Togo\", \"228\"],\n [\"to\", \"Tonga\", \"676\"],\n [\"tn\", \"Tunisia\", \"216\"],\n [\"tr\", \"Türkiye\", \"90\"],\n [\"tm\", \"Turkmenistan\", \"993\"],\n [\"ug\", \"Uganda\", \"256\"],\n [\"ua\", \"Ukraine\", \"380\"],\n [\"ae\", \"United Arab Emirates\", \"971\"],\n [\"gb\", \"United Kingdom\", \"44\"],\n [\"us\", \"United States / Canada\", \"1\"],\n [\"uy\", \"Uruguay\", \"598\"],\n [\"uz\", \"Uzbekistan\", \"998\"],\n [\"vu\", \"Vanuatu\", \"678\"],\n [\"ve\", \"Venezuela\", \"58\"],\n [\"vn\", \"Vietnam\", \"84\"],\n [\"ye\", \"Yemen\", \"967\"],\n [\"zm\", \"Zambia\", \"260\"],\n [\"zw\", \"Zimbabwe\", \"263\"],\n];\n\n/** Egypt's own numbers: ten digits, starting with 1. */\nconst EGYPT_RULE = { limit: 10, startingNumber: 1 };\n\n/** Every dial code, by country name: what `PhoneInput` lists when no `countries`, `loadCountries` or `endpoint` is given. */\nexport const ALL_PHONE_COUNTRIES: PhoneCountry[] = ROWS.map(([iso, name, code]) => ({\n code,\n name,\n flag: `https://flagcdn.com/${iso}.svg`,\n ...(code === \"20\" ? EGYPT_RULE : {}),\n}));\n\n/** The country selected when nothing else is: Egypt (+20). */\nexport const DEFAULT_PHONE_CODE = \"20\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAS,WAAW,SAAS,QAAQ,gBAAgC;;;ACKrE,IAAM,OAAmC;AAAA,EACvC,CAAC,MAAM,eAAe,IAAI;AAAA,EAC1B,CAAC,MAAM,WAAW,KAAK;AAAA,EACvB,CAAC,MAAM,WAAW,KAAK;AAAA,EACvB,CAAC,MAAM,WAAW,KAAK;AAAA,EACvB,CAAC,MAAM,UAAU,KAAK;AAAA,EACtB,CAAC,MAAM,aAAa,IAAI;AAAA,EACxB,CAAC,MAAM,WAAW,KAAK;AAAA,EACvB,CAAC,MAAM,SAAS,KAAK;AAAA,EACrB,CAAC,MAAM,aAAa,IAAI;AAAA,EACxB,CAAC,MAAM,WAAW,IAAI;AAAA,EACtB,CAAC,MAAM,cAAc,KAAK;AAAA,EAC1B,CAAC,MAAM,WAAW,KAAK;AAAA,EACvB,CAAC,MAAM,cAAc,KAAK;AAAA,EAC1B,CAAC,MAAM,WAAW,KAAK;AAAA,EACvB,CAAC,MAAM,WAAW,IAAI;AAAA,EACtB,CAAC,MAAM,UAAU,KAAK;AAAA,EACtB,CAAC,MAAM,SAAS,KAAK;AAAA,EACrB,CAAC,MAAM,UAAU,KAAK;AAAA,EACtB,CAAC,MAAM,WAAW,KAAK;AAAA,EACvB,CAAC,MAAM,0BAA0B,KAAK;AAAA,EACtC,CAAC,MAAM,YAAY,KAAK;AAAA,EACxB,CAAC,MAAM,UAAU,IAAI;AAAA,EACrB,CAAC,MAAM,UAAU,KAAK;AAAA,EACtB,CAAC,MAAM,YAAY,KAAK;AAAA,EACxB,CAAC,MAAM,gBAAgB,KAAK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A,cAEb,KAAI;AAAA,cACJ;AAAA,cACA,OAAO;AAAA,cACP;AAAA,cACA;AAAA,cACA;AAAA,cACA,WAAW,SAAS;AAAA,cACpB,aAAa;AAAA,cACb,gBAAc,WAAW,WAAW,KAAK;AAAA,cACzC,oBAAkB,WAAW,WAAW,IAAI,UAAU;AAAA,cACtD;AAAA,cACA,UAAU,CAAC,UAAU;AACnB,sBAAM,SAAS,WAAW,MAAM,cAAc,KAAK;AACnD,yBAAS,QAAQ,OAAO,MAAM,GAAG,KAAK,IAAI,MAAM;AAAA,cAClD;AAAA;AAAA,UACF;AAAA,WACF;AAAA,SACE,WAAW,WAAW,KAAK,WAAW,SAAS,MAC/C,qBAAC,SAAK,GAAG,UAAU,QAAQ,GACxB;AAAA,qBAAW,WAAW,KACrB,oBAAC,cAAY,GAAG,UAAU,OAAO,GAAG,IAAI,SACrC,uBACH;AAAA,UAED,WAAW,SAAS,KAAK,oBAAC,cAAY,GAAG,UAAU,OAAO,GAAG,aAAS,MAAE,qBAAU;AAAA,WACrF;AAAA,QAED,YAAY,oBAAC,WAAM,MAAK,UAAS,MAAM,UAAU,OAAO,MAAM;AAAA,QAC9D,aAAa,oBAAC,WAAM,MAAK,UAAS,MAAM,WAAW,OAAO,SAAS,IAAI;AAAA,QACvE,sBAAsB,oBAAC,WAAM,MAAK,UAAS,MAAM,oBAAoB,OAAO,kBAAkB,IAAI;AAAA;AAAA;AAAA,EACrG;AAEJ,CAAC;AACD,WAAW,cAAc;","names":[]}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  useFloating
4
- } from "./chunk-F4OMXH3E.js";
4
+ } from "./chunk-QCMTAQSP.js";
5
5
  import {
6
6
  useClickOutside,
7
7
  useEscape,
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-AZ4WBNXD.js";
10
10
  import {
11
11
  OptionalPortal
12
- } from "./chunk-FIAJMBSD.js";
12
+ } from "./chunk-2TFJ4SMR.js";
13
13
  import {
14
14
  Transition
15
15
  } from "./chunk-H4D7LXZL.js";
@@ -92,14 +92,14 @@ function Popover(_props) {
92
92
  props.onChange?.(next);
93
93
  (next ? props.onOpen : props.onClose)?.();
94
94
  };
95
- const { dir } = useDirection();
95
+ const { dir: appDir } = useDirection();
96
96
  const floating = useFloating({
97
97
  opened,
98
98
  position: props.position,
99
99
  offset: props.offset + (props.withArrow ? props.arrowSize / 2 : 0),
100
100
  flip: props.middlewares?.flip ?? true,
101
101
  shift: props.middlewares?.shift ?? true,
102
- dir,
102
+ dir: props.dir ?? appDir,
103
103
  arrowSize: props.withArrow ? props.arrowSize : 0,
104
104
  arrowOffset: props.arrowOffset,
105
105
  arrowPosition: props.arrowPosition,
@@ -182,7 +182,7 @@ var PopoverDropdown = factory(({ children, className, style, ...others }, ref) =
182
182
  const { props, floating } = context;
183
183
  const dropdownRef = useRef(null);
184
184
  useFocusTrap(dropdownRef, context.opened && !!props.trapFocus, props.returnFocus);
185
- const width = props.width === "target" ? floating.referenceWidth : props.width === "auto" ? void 0 : rem(props.width);
185
+ const width = props.width === "target" ? floating.referenceWidth > 0 ? floating.referenceWidth : void 0 : props.width === "auto" ? void 0 : rem(props.width);
186
186
  return /* @__PURE__ */ jsx(OptionalPortal, { withinPortal: props.withinPortal, ...props.portalProps, children: /* @__PURE__ */ jsx(
187
187
  Transition,
188
188
  {
@@ -207,8 +207,12 @@ var PopoverDropdown = factory(({ children, className, style, ...others }, ref) =
207
207
  ...transitionStyles,
208
208
  ...dropdown.style,
209
209
  position: "fixed",
210
+ // Clear any inherited inset from host CSS so left/top win.
211
+ inset: "auto",
210
212
  top: floating.y,
211
213
  left: floating.x,
214
+ right: "auto",
215
+ bottom: "auto",
212
216
  width,
213
217
  zIndex: props.zIndex,
214
218
  // Invisible until measured, so it doesn't flash at 0,0.
@@ -252,4 +256,4 @@ export {
252
256
  PopoverTarget,
253
257
  PopoverDropdown
254
258
  };
255
- //# sourceMappingURL=chunk-K2Q5Q6WQ.js.map
259
+ //# sourceMappingURL=chunk-YRKCM3OL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Popover/Popover.tsx"],"sourcesContent":["import {\n cloneElement,\n createContext,\n isValidElement,\n useContext,\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport { Box, type BoxProps } from \"../../core/Box/Box\";\nimport { factory } from \"../../core/factory/factory\";\nimport { useClickOutside, useEscape, useFocusTrap } from \"../../core/overlay/focus\";\nimport { useFloating, type FloatingPosition } from \"../../core/overlay/use-floating\";\nimport { useDirection } from \"../../core/provider/WelloProvider\";\nimport {\n useComponentStyles,\n useProps,\n type GetStyles,\n type StylesApiProps,\n} from \"../../core/styles-api/styles-api\";\nimport type { WelloRadius, WelloShadow } from \"../../core/theme/types\";\nimport { getRadius, getShadow, rem } from \"../../core/theme/units\";\nimport { mergeRefs, useId } from \"../../core/utils\";\nimport { OptionalPortal, type PortalProps } from \"../Portal/Portal\";\nimport { Transition, type TransitionProps } from \"../Transition/Transition\";\n\nexport type PopoverStylesNames = \"dropdown\" | \"arrow\";\nexport type PopoverWidth = \"target\" | \"auto\" | number | (string & {});\n\nexport interface PopoverBaseProps {\n /** Default: 'bottom' */\n position?: FloatingPosition;\n /** Default: 8 */\n offset?: number;\n /** `'target'` = same width as the target. Default: 'max-content' */\n width?: PopoverWidth;\n withArrow?: boolean;\n /** Default: 7 */\n arrowSize?: number;\n /** Default: 5 */\n arrowOffset?: number;\n /** Default: 0 */\n arrowRadius?: number;\n /** Default: 'side' */\n arrowPosition?: \"side\" | \"center\";\n /** Default: true */\n withinPortal?: boolean;\n portalProps?: Omit<PortalProps, \"children\">;\n /** Default: 300 */\n zIndex?: number | string;\n radius?: WelloRadius;\n /** Default: 'md' */\n shadow?: WelloShadow;\n /** Default: { transition: 'fade', duration: 150 } */\n transitionProps?: Omit<TransitionProps, \"mounted\" | \"children\">;\n /** Keep the dropdown in the DOM while closed */\n keepMounted?: boolean;\n /** Flip / shift to stay on screen. Default: both true */\n middlewares?: { flip?: boolean; shift?: boolean };\n onPositionChange?: (position: FloatingPosition) => void;\n /** Hide the dropdown */\n disabled?: boolean;\n /** Hide it while the target is scrolled out of sight. Default: true */\n hideDetached?: boolean;\n /** Stay on the side it opened on, instead of flipping while scrolling. Default: true */\n preventPositionChangeWhenVisible?: boolean;\n /**\n * Floating alignment dir (`start` / `end`). Default: app direction.\n * Pass `\"ltr\"` for controls that stay left-anchored in RTL (e.g. PhoneInput dial code).\n */\n dir?: \"ltr\" | \"rtl\";\n}\n\nexport interface PopoverProps\n extends PopoverBaseProps, StylesApiProps<PopoverStylesNames, PopoverProps> {\n /** Controlled state */\n opened?: boolean;\n defaultOpened?: boolean;\n onChange?: (opened: boolean) => void;\n onOpen?: () => void;\n onClose?: () => void;\n /** Keep Tab inside the dropdown */\n trapFocus?: boolean;\n /** Focus the target back on close. Default: false */\n returnFocus?: boolean;\n /** Default: true */\n closeOnEscape?: boolean;\n /** Default: true */\n closeOnClickOutside?: boolean;\n /** Default: ['mousedown', 'touchstart'] */\n clickOutsideEvents?: string[];\n /** aria roles on target / dropdown. Default: true */\n withRoles?: boolean;\n /** Base id of the dropdown */\n id?: string;\n /** Close on Escape / click outside does nothing; you control it */\n children?: ReactNode;\n /** Set by Menu */\n __staticSelector?: string;\n __role?: string;\n}\n\ninterface PopoverContextValue {\n opened: boolean;\n open: () => void;\n close: () => void;\n toggle: () => void;\n floating: ReturnType<typeof useFloating>;\n targetRef: React.MutableRefObject<HTMLElement | null>;\n dropdownRef: React.MutableRefObject<HTMLElement | null>;\n getStyles: GetStyles<PopoverStylesNames>;\n props: PopoverProps;\n id: string;\n /** Nested popovers register their dropdown so clicks in them don't close this one */\n registerChild: (ref: React.MutableRefObject<HTMLElement | null>) => () => void;\n}\n\nconst PopoverContext = createContext<PopoverContextValue | null>(null);\n\nexport function usePopoverContext() {\n const context = useContext(PopoverContext);\n if (!context) throw new Error(\"Popover.Target / Popover.Dropdown must be inside <Popover>\");\n return context;\n}\n\n/** Root of a popover; use `Popover.Target` and `Popover.Dropdown` inside. */\nexport function Popover(_props: PopoverProps) {\n const props = useProps(\n \"Popover\",\n {\n position: \"bottom\",\n offset: 8,\n width: \"max-content\",\n hideDetached: true,\n preventPositionChangeWhenVisible: true,\n arrowSize: 7,\n arrowOffset: 5,\n arrowRadius: 0,\n arrowPosition: \"side\",\n withinPortal: true,\n zIndex: 300,\n shadow: \"md\",\n closeOnEscape: true,\n closeOnClickOutside: true,\n withRoles: true,\n returnFocus: false,\n },\n _props,\n );\n const name = props.__staticSelector ?? \"Popover\";\n const [getStyles] = useComponentStyles(name, props, {\n rootSelector: \"dropdown\",\n varsResolver: (_theme, p) => ({\n dropdown: {\n \"--popover-radius\": p.radius === undefined ? undefined : getRadius(p.radius),\n \"--popover-shadow\": getShadow(p.shadow),\n },\n }),\n });\n const [internal, setInternal] = useState(!!props.defaultOpened);\n const opened = !props.disabled && (props.opened ?? internal);\n const setOpened = (next: boolean) => {\n if (next === opened) return;\n if (props.opened === undefined) setInternal(next);\n props.onChange?.(next);\n (next ? props.onOpen : props.onClose)?.();\n };\n const { dir: appDir } = useDirection();\n const floating = useFloating({\n opened,\n position: props.position,\n offset: props.offset! + (props.withArrow ? props.arrowSize! / 2 : 0),\n flip: props.middlewares?.flip ?? true,\n shift: props.middlewares?.shift ?? true,\n dir: props.dir ?? appDir,\n arrowSize: props.withArrow ? props.arrowSize : 0,\n arrowOffset: props.arrowOffset,\n arrowPosition: props.arrowPosition,\n onPositionChange: props.onPositionChange,\n preventPositionChangeWhenVisible: props.preventPositionChangeWhenVisible,\n });\n const targetRef = useRef<HTMLElement | null>(null);\n const dropdownRef = useRef<HTMLElement | null>(null);\n const id = useId(props.id);\n const children = useRef(new Set<React.MutableRefObject<HTMLElement | null>>());\n const parent = useContext(PopoverContext);\n useEffect(() => parent?.registerChild(dropdownRef), [parent]);\n\n useClickOutside(\n () => props.closeOnClickOutside && setOpened(false),\n () => [targetRef, dropdownRef, ...children.current],\n opened,\n props.clickOutsideEvents,\n );\n useEscape(() => {\n if (props.closeOnEscape) {\n setOpened(false);\n targetRef.current?.focus();\n }\n }, opened);\n\n return (\n <PopoverContext.Provider\n value={{\n opened,\n open: () => setOpened(true),\n close: () => setOpened(false),\n toggle: () => setOpened(!opened),\n floating,\n targetRef,\n dropdownRef,\n getStyles,\n props,\n id,\n // Ancestors learn about nested dropdowns too, at any depth.\n registerChild: (ref) => {\n children.current.add(ref);\n const up = parent?.registerChild(ref);\n return () => {\n children.current.delete(ref);\n up?.();\n };\n },\n }}\n >\n {props.children}\n </PopoverContext.Provider>\n );\n}\n\nexport interface PopoverTargetProps {\n /** One element; receives ref, onClick and aria attributes */\n children: ReactElement;\n /** Prop the ref goes to. Default: 'ref' */\n refProp?: string;\n /** Set aria-haspopup, aria-expanded and aria-controls on the target. Default: the popover's `withRoles` */\n withRoles?: boolean;\n /** Extra props merged into the child */\n popupType?: string;\n}\n\nexport function PopoverTarget({\n children,\n refProp = \"ref\",\n popupType = \"dialog\",\n withRoles,\n}: PopoverTargetProps) {\n const context = usePopoverContext();\n if (!isValidElement(children)) throw new Error(\"Popover.Target needs one element child\");\n const child = children as ReactElement<Record<string, any>>;\n const roles = (withRoles ?? context.props.withRoles)\n ? {\n \"aria-haspopup\": popupType,\n \"aria-expanded\": context.opened,\n \"aria-controls\": context.opened ? `${context.id}-dropdown` : undefined,\n id: child.props.id ?? `${context.id}-target`,\n }\n : {};\n return cloneElement(child, {\n ...roles,\n \"data-expanded\": context.opened || undefined,\n [refProp]: mergeRefs(context.targetRef, context.floating.setReference, child.props.ref),\n onClick: (event: React.MouseEvent) => {\n child.props.onClick?.(event);\n if (!event.defaultPrevented && !context.props.__role) context.toggle();\n },\n });\n}\n\nexport interface PopoverDropdownProps extends BoxProps {\n children?: ReactNode;\n className?: string;\n}\n\nexport const PopoverDropdown = factory<{\n props: PopoverDropdownProps;\n ref: HTMLDivElement;\n stylesNames: \"dropdown\";\n}>(({ children, className, style, ...others }, ref) => {\n const context = usePopoverContext();\n const { props, floating } = context;\n const dropdownRef = useRef<HTMLDivElement | null>(null);\n useFocusTrap(dropdownRef, context.opened && !!props.trapFocus, props.returnFocus);\n // Avoid width:0 before the first measure — that collapses offsetWidth and skews place().\n const width =\n props.width === \"target\"\n ? floating.referenceWidth > 0\n ? floating.referenceWidth\n : undefined\n : props.width === \"auto\"\n ? undefined\n : rem(props.width as number | string);\n return (\n <OptionalPortal withinPortal={props.withinPortal} {...props.portalProps}>\n <Transition\n mounted={context.opened}\n keepMounted={props.keepMounted}\n transition=\"fade\"\n duration={150}\n {...props.transitionProps}\n >\n {(transitionStyles) => {\n const dropdown = context.getStyles(\"dropdown\", { className });\n return (\n <Box\n ref={mergeRefs(ref, dropdownRef, context.dropdownRef, floating.setFloating)}\n id={`${context.id}-dropdown`}\n role={props.withRoles ? (props.__role ?? \"dialog\") : undefined}\n aria-labelledby={props.withRoles ? `${context.id}-target` : undefined}\n tabIndex={-1}\n {...dropdown}\n data-position={floating.placement}\n style={{\n ...transitionStyles,\n ...dropdown.style,\n position: \"fixed\",\n // Clear any inherited inset from host CSS so left/top win.\n inset: \"auto\",\n top: floating.y,\n left: floating.x,\n right: \"auto\",\n bottom: \"auto\",\n width,\n zIndex: props.zIndex as CSSProperties[\"zIndex\"],\n // Invisible until measured, so it doesn't flash at 0,0.\n visibility: floating.ready && !(props.hideDetached && floating.referenceHidden)\n ? (transitionStyles.visibility as CSSProperties[\"visibility\"])\n : \"hidden\",\n ...(typeof style === \"object\" ? style : undefined),\n }}\n {...others}\n >\n {children}\n {props.withArrow && (\n <div\n {...context.getStyles(\"arrow\")}\n data-position={floating.placement}\n style={{\n ...context.getStyles(\"arrow\").style,\n [\"--_arrow\" as string]: `${props.arrowSize}px`,\n width: props.arrowSize,\n height: props.arrowSize,\n borderRadius: props.arrowRadius,\n left:\n floating.arrowX !== undefined\n ? floating.arrowX - props.arrowSize! / 2\n : undefined,\n top:\n floating.arrowY !== undefined\n ? floating.arrowY - props.arrowSize! / 2\n : undefined,\n }}\n />\n )}\n </Box>\n );\n }}\n </Transition>\n </OptionalPortal>\n );\n});\nPopoverDropdown.displayName = \"PopoverDropdown\";\n\nPopover.Target = PopoverTarget;\nPopover.Dropdown = PopoverDropdown;\nPopover.displayName = \"Popover\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAkMH,cAsGQ,YAtGR;AArFJ,IAAM,iBAAiB,cAA0C,IAAI;AAE9D,SAAS,oBAAoB;AAClC,QAAM,UAAU,WAAW,cAAc;AACzC,MAAI,CAAC,QAAS,OAAM,IAAI,MAAM,4DAA4D;AAC1F,SAAO;AACT;AAGO,SAAS,QAAQ,QAAsB;AAC5C,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA;AAAA,MACE,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,cAAc;AAAA,MACd,kCAAkC;AAAA,MAClC,WAAW;AAAA,MACX,aAAa;AAAA,MACb,aAAa;AAAA,MACb,eAAe;AAAA,MACf,cAAc;AAAA,MACd,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,eAAe;AAAA,MACf,qBAAqB;AAAA,MACrB,WAAW;AAAA,MACX,aAAa;AAAA,IACf;AAAA,IACA;AAAA,EACF;AACA,QAAM,OAAO,MAAM,oBAAoB;AACvC,QAAM,CAAC,SAAS,IAAI,mBAAmB,MAAM,OAAO;AAAA,IAClD,cAAc;AAAA,IACd,cAAc,CAAC,QAAQ,OAAO;AAAA,MAC5B,UAAU;AAAA,QACR,oBAAoB,EAAE,WAAW,SAAY,SAAY,UAAU,EAAE,MAAM;AAAA,QAC3E,oBAAoB,UAAU,EAAE,MAAM;AAAA,MACxC;AAAA,IACF;AAAA,EACF,CAAC;AACD,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,CAAC,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;AAAA,YAC1C;AAAA,YACC,GAAG;AAAA,YAEH;AAAA;AAAA,cACA,MAAM,aACL;AAAA,gBAAC;AAAA;AAAA,kBACE,GAAG,QAAQ,UAAU,OAAO;AAAA,kBAC7B,iBAAe,SAAS;AAAA,kBACxB,OAAO;AAAA,oBACL,GAAG,QAAQ,UAAU,OAAO,EAAE;AAAA,oBAC9B,CAAC,UAAoB,GAAG,GAAG,MAAM,SAAS;AAAA,oBAC1C,OAAO,MAAM;AAAA,oBACb,QAAQ,MAAM;AAAA,oBACd,cAAc,MAAM;AAAA,oBACpB,MACE,SAAS,WAAW,SAChB,SAAS,SAAS,MAAM,YAAa,IACrC;AAAA,oBACN,KACE,SAAS,WAAW,SAChB,SAAS,SAAS,MAAM,YAAa,IACrC;AAAA,kBACR;AAAA;AAAA,cACF;AAAA;AAAA;AAAA,QAEJ;AAAA,MAEJ;AAAA;AAAA,EACF,GACF;AAEJ,CAAC;AACD,gBAAgB,cAAc;AAE9B,QAAQ,SAAS;AACjB,QAAQ,WAAW;AACnB,QAAQ,cAAc;","names":[]}
@@ -1,17 +1,17 @@
1
1
  "use client";
2
2
  import {
3
3
  ColorInput
4
- } from "../../chunk-YHPHWOAE.js";
4
+ } from "../../chunk-DRSBB5T4.js";
5
5
  import "../../chunk-VIO22OUP.js";
6
6
  import "../../chunk-MWYGXAJQ.js";
7
7
  import "../../chunk-JJXJXOZ7.js";
8
8
  import "../../chunk-57ZKN6G3.js";
9
9
  import "../../chunk-YFBYWNYF.js";
10
10
  import "../../chunk-ZJZUNSCO.js";
11
- import "../../chunk-K2Q5Q6WQ.js";
12
- import "../../chunk-F4OMXH3E.js";
11
+ import "../../chunk-YRKCM3OL.js";
12
+ import "../../chunk-QCMTAQSP.js";
13
13
  import "../../chunk-AZ4WBNXD.js";
14
- import "../../chunk-FIAJMBSD.js";
14
+ import "../../chunk-2TFJ4SMR.js";
15
15
  import "../../chunk-H4D7LXZL.js";
16
16
  import "../../chunk-CTBTEAD6.js";
17
17
  import "../../chunk-5SQC5LKY.js";
@@ -15,14 +15,14 @@ import {
15
15
  ComboboxTarget,
16
16
  useCombobox,
17
17
  useComboboxContext
18
- } from "../../chunk-TJUOXXLK.js";
18
+ } from "../../chunk-BZPG4NZ6.js";
19
19
  import "../../chunk-57ZKN6G3.js";
20
20
  import "../../chunk-YFBYWNYF.js";
21
21
  import "../../chunk-ZJZUNSCO.js";
22
- import "../../chunk-K2Q5Q6WQ.js";
23
- import "../../chunk-F4OMXH3E.js";
22
+ import "../../chunk-YRKCM3OL.js";
23
+ import "../../chunk-QCMTAQSP.js";
24
24
  import "../../chunk-AZ4WBNXD.js";
25
- import "../../chunk-FIAJMBSD.js";
25
+ import "../../chunk-2TFJ4SMR.js";
26
26
  import "../../chunk-H4D7LXZL.js";
27
27
  import "../../chunk-CTBTEAD6.js";
28
28
  import "../../chunk-5SQC5LKY.js";
@@ -1,18 +1,18 @@
1
1
  "use client";
2
2
  import {
3
3
  Select
4
- } from "../../chunk-2XGMU4QA.js";
4
+ } from "../../chunk-RVFCTNPD.js";
5
5
  import "../../chunk-DHAMBKCR.js";
6
- import "../../chunk-TJUOXXLK.js";
6
+ import "../../chunk-BZPG4NZ6.js";
7
7
  import "../../chunk-JJXJXOZ7.js";
8
8
  import "../../chunk-DCC7EE67.js";
9
9
  import "../../chunk-57ZKN6G3.js";
10
10
  import "../../chunk-YFBYWNYF.js";
11
11
  import "../../chunk-ZJZUNSCO.js";
12
- import "../../chunk-K2Q5Q6WQ.js";
13
- import "../../chunk-F4OMXH3E.js";
12
+ import "../../chunk-YRKCM3OL.js";
13
+ import "../../chunk-QCMTAQSP.js";
14
14
  import "../../chunk-AZ4WBNXD.js";
15
- import "../../chunk-FIAJMBSD.js";
15
+ import "../../chunk-2TFJ4SMR.js";
16
16
  import "../../chunk-H4D7LXZL.js";
17
17
  import "../../chunk-CTBTEAD6.js";
18
18
  import "../../chunk-5SQC5LKY.js";