@alfadocs/ui-kit-debug 1.90.1 → 1.90.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/dist/_chunks/address-autocomplete-DR4Xn23Z.js +519 -0
  2. package/dist/_chunks/address-autocomplete-DR4Xn23Z.js.map +1 -0
  3. package/dist/_chunks/{address-fields-CfnXK8RT.js → address-fields-qxQkGwPf.js} +5 -5
  4. package/dist/_chunks/{address-fields-CfnXK8RT.js.map → address-fields-qxQkGwPf.js.map} +1 -1
  5. package/dist/_chunks/{ai-permission-notice-CoW22jx1.js → ai-permission-notice-VNh3W57L.js} +2 -2
  6. package/dist/_chunks/{ai-permission-notice-CoW22jx1.js.map → ai-permission-notice-VNh3W57L.js.map} +1 -1
  7. package/dist/_chunks/{anamnesis-summary-rows-fbEQwcuW.js → anamnesis-summary-rows-EKPfVCmh.js} +2 -2
  8. package/dist/_chunks/{anamnesis-summary-rows-fbEQwcuW.js.map → anamnesis-summary-rows-EKPfVCmh.js.map} +1 -1
  9. package/dist/_chunks/autocomplete-BXMcNoa3.js +562 -0
  10. package/dist/_chunks/autocomplete-BXMcNoa3.js.map +1 -0
  11. package/dist/_chunks/{balance-badge-cell-C4FYwmrZ.js → balance-badge-cell-D9VhFp0L.js} +3 -3
  12. package/dist/_chunks/{balance-badge-cell-C4FYwmrZ.js.map → balance-badge-cell-D9VhFp0L.js.map} +1 -1
  13. package/dist/_chunks/{booking-C0FoW8Yx.js → booking-CcE_oviI.js} +1896 -1859
  14. package/dist/_chunks/booking-CcE_oviI.js.map +1 -0
  15. package/dist/_chunks/{calendar-appointment-editor-dialog-C1v2MNE4.js → calendar-appointment-editor-dialog-CiAGAX2t.js} +7 -7
  16. package/dist/_chunks/{calendar-appointment-editor-dialog-C1v2MNE4.js.map → calendar-appointment-editor-dialog-CiAGAX2t.js.map} +1 -1
  17. package/dist/_chunks/{checkbox-BjDv-r3o.js → checkbox-a7Sh-dXb.js} +32 -31
  18. package/dist/_chunks/checkbox-a7Sh-dXb.js.map +1 -0
  19. package/dist/_chunks/{checkbox-group-Cw2H5qaq.js → checkbox-group-eGdv9fZc.js} +2 -2
  20. package/dist/_chunks/{checkbox-group-Cw2H5qaq.js.map → checkbox-group-eGdv9fZc.js.map} +1 -1
  21. package/dist/_chunks/{city-input-CJVGswxp.js → city-input-CA59CjnV.js} +2 -2
  22. package/dist/_chunks/{city-input-CJVGswxp.js.map → city-input-CA59CjnV.js.map} +1 -1
  23. package/dist/_chunks/{combobox-CDPm_n0p.js → combobox-D-gpgEDy.js} +314 -294
  24. package/dist/_chunks/combobox-D-gpgEDy.js.map +1 -0
  25. package/dist/_chunks/{country-select-DQ8q7ypA.js → country-select-BfmX9y5i.js} +2 -2
  26. package/dist/_chunks/{country-select-DQ8q7ypA.js.map → country-select-BfmX9y5i.js.map} +1 -1
  27. package/dist/_chunks/{data-table-B_IcS0Ke.js → data-table-CqQgoNsU.js} +2 -2
  28. package/dist/_chunks/{data-table-B_IcS0Ke.js.map → data-table-CqQgoNsU.js.map} +1 -1
  29. package/dist/_chunks/{face-scheme-BgJGFDTa.js → face-scheme-BKSE98bo.js} +2 -2
  30. package/dist/_chunks/{face-scheme-BgJGFDTa.js.map → face-scheme-BKSE98bo.js.map} +1 -1
  31. package/dist/_chunks/{file-manager-C9YOT-Dn.js → file-manager-BnI1ZWZu.js} +2 -2
  32. package/dist/_chunks/{file-manager-C9YOT-Dn.js.map → file-manager-BnI1ZWZu.js.map} +1 -1
  33. package/dist/_chunks/{header-settings-BVhjndtV.js → header-settings-BeA2fnol.js} +24 -23
  34. package/dist/_chunks/header-settings-BeA2fnol.js.map +1 -0
  35. package/dist/_chunks/{heatmap-HTz3Jvzy.js → heatmap-fCxwNz2o.js} +2 -2
  36. package/dist/_chunks/{heatmap-HTz3Jvzy.js.map → heatmap-fCxwNz2o.js.map} +1 -1
  37. package/dist/_chunks/{link-cell-renderer-C0ynDik7.js → link-cell-renderer-CnCgudvq.js} +3 -3
  38. package/dist/_chunks/{link-cell-renderer-C0ynDik7.js.map → link-cell-renderer-CnCgudvq.js.map} +1 -1
  39. package/dist/_chunks/{login-dev-card-DYwbL5sD.js → login-dev-card-BZBR58mu.js} +2 -2
  40. package/dist/_chunks/{login-dev-card-DYwbL5sD.js.map → login-dev-card-BZBR58mu.js.map} +1 -1
  41. package/dist/_chunks/{map-view-Bvi06RVh.js → map-view-UrNgxBy3.js} +260 -237
  42. package/dist/_chunks/map-view-UrNgxBy3.js.map +1 -0
  43. package/dist/_chunks/{index.modern-BeRXQVdc.js → maps-core-gate-DkNqGkm3.js} +360 -319
  44. package/dist/_chunks/maps-core-gate-DkNqGkm3.js.map +1 -0
  45. package/dist/_chunks/{marketplace-app-shell-x_abo_ye.js → marketplace-app-shell-CmZx0Oam.js} +2 -2
  46. package/dist/_chunks/{marketplace-app-shell-x_abo_ye.js.map → marketplace-app-shell-CmZx0Oam.js.map} +1 -1
  47. package/dist/_chunks/{notes-panel-CZO1qsD-.js → notes-panel-Dywo6R55.js} +2 -2
  48. package/dist/_chunks/{notes-panel-CZO1qsD-.js.map → notes-panel-Dywo6R55.js.map} +1 -1
  49. package/dist/_chunks/{patient-details-D0P5eog5.js → patient-details-BUr7Oemx.js} +2 -2
  50. package/dist/_chunks/{patient-details-D0P5eog5.js.map → patient-details-BUr7Oemx.js.map} +1 -1
  51. package/dist/_chunks/{patient-field-row-R73dZJY6.js → patient-field-row-bJk8Q_qr.js} +5 -5
  52. package/dist/_chunks/{patient-field-row-R73dZJY6.js.map → patient-field-row-bJk8Q_qr.js.map} +1 -1
  53. package/dist/_chunks/patient-search-Ca9j5cWb.js +1306 -0
  54. package/dist/_chunks/patient-search-Ca9j5cWb.js.map +1 -0
  55. package/dist/_chunks/{patient-summary-card-6U74-ivO.js → patient-summary-card-CCQZ8X37.js} +2 -2
  56. package/dist/_chunks/{patient-summary-card-6U74-ivO.js.map → patient-summary-card-CCQZ8X37.js.map} +1 -1
  57. package/dist/_chunks/{periodontal-diagnosis-B9YmmVmM.js → periodontal-diagnosis-DD3hrg9X.js} +2 -2
  58. package/dist/_chunks/{periodontal-diagnosis-B9YmmVmM.js.map → periodontal-diagnosis-DD3hrg9X.js.map} +1 -1
  59. package/dist/_chunks/{permission-matrix-BoQjENGV.js → permission-matrix-BJ6sg3Zp.js} +3 -3
  60. package/dist/_chunks/{permission-matrix-BoQjENGV.js.map → permission-matrix-BJ6sg3Zp.js.map} +1 -1
  61. package/dist/_chunks/{practice-results-B61krlwu.js → practice-results-DQuOfqej.js} +2 -2
  62. package/dist/_chunks/{practice-results-B61krlwu.js.map → practice-results-DQuOfqej.js.map} +1 -1
  63. package/dist/_chunks/{province-select-CPdTwEob.js → province-select-D64whw0m.js} +2 -2
  64. package/dist/_chunks/{province-select-CPdTwEob.js.map → province-select-D64whw0m.js.map} +1 -1
  65. package/dist/_chunks/{registration-form-DmP3YUfp.js → registration-form-CRm6DaB9.js} +2 -2
  66. package/dist/_chunks/{registration-form-DmP3YUfp.js.map → registration-form-CRm6DaB9.js.map} +1 -1
  67. package/dist/_chunks/{reviews-panel-UzQQLb-z.js → reviews-panel-B7InBORU.js} +42 -41
  68. package/dist/_chunks/reviews-panel-B7InBORU.js.map +1 -0
  69. package/dist/_chunks/{rich-text-editor-BZTyxQBd.js → rich-text-editor-BfEu57dk.js} +3 -3
  70. package/dist/_chunks/{rich-text-editor-BZTyxQBd.js.map → rich-text-editor-BfEu57dk.js.map} +1 -1
  71. package/dist/_chunks/{slot-grid-Bb13H9Rl.js → slot-grid-DrwynKeN.js} +91 -89
  72. package/dist/_chunks/{slot-grid-Bb13H9Rl.js.map → slot-grid-DrwynKeN.js.map} +1 -1
  73. package/dist/_chunks/{task-editor-BOETWbjU.js → task-editor-CI1SKUNc.js} +2 -2
  74. package/dist/_chunks/{task-editor-BOETWbjU.js.map → task-editor-CI1SKUNc.js.map} +1 -1
  75. package/dist/_chunks/{use-appointment-details-read-CWN-nJCZ.js → use-appointment-details-read-BytPq3Ux.js} +2 -2
  76. package/dist/_chunks/{use-appointment-details-read-CWN-nJCZ.js.map → use-appointment-details-read-BytPq3Ux.js.map} +1 -1
  77. package/dist/_chunks/{voice-control-panel-BziKE-KK.js → voice-control-panel-BP0otrID.js} +2 -2
  78. package/dist/_chunks/{voice-control-panel-BziKE-KK.js.map → voice-control-panel-BP0otrID.js.map} +1 -1
  79. package/dist/_chunks/{workflow-webhook-action-DulCpCRz.js → workflow-webhook-action-B_nBJ_ht.js} +2 -2
  80. package/dist/_chunks/{workflow-webhook-action-DulCpCRz.js.map → workflow-webhook-action-B_nBJ_ht.js.map} +1 -1
  81. package/dist/agent-catalog.json +2 -2
  82. package/dist/agent-i18n/en.json +1 -1
  83. package/dist/components/_shared/maps-core-gate.d.ts +18 -0
  84. package/dist/components/_shared/maps-core-gate.d.ts.map +1 -0
  85. package/dist/components/address-autocomplete/address-autocomplete.d.ts.map +1 -1
  86. package/dist/components/address-autocomplete/index.js +1 -1
  87. package/dist/components/address-fields/index.js +1 -1
  88. package/dist/components/ai-permission-notice/index.js +1 -1
  89. package/dist/components/appointment-details-panel/index.js +1 -1
  90. package/dist/components/autocomplete/autocomplete.agent.d.ts.map +1 -1
  91. package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
  92. package/dist/components/autocomplete/index.js +1 -1
  93. package/dist/components/booking/booking.d.ts.map +1 -1
  94. package/dist/components/booking/details-form.d.ts.map +1 -1
  95. package/dist/components/booking/index.js +1 -1
  96. package/dist/components/checkbox/checkbox.d.ts.map +1 -1
  97. package/dist/components/checkbox/index.js +1 -1
  98. package/dist/components/checkbox-group/index.js +1 -1
  99. package/dist/components/city-input/index.js +1 -1
  100. package/dist/components/combobox/combobox.d.ts.map +1 -1
  101. package/dist/components/combobox/index.js +1 -1
  102. package/dist/components/country-select/index.js +1 -1
  103. package/dist/components/data-table/index.js +2 -2
  104. package/dist/components/face-scheme/index.js +1 -1
  105. package/dist/components/file-manager/index.js +1 -1
  106. package/dist/components/header-settings/header-settings.d.ts +2 -1
  107. package/dist/components/header-settings/header-settings.d.ts.map +1 -1
  108. package/dist/components/header-settings/index.js +1 -1
  109. package/dist/components/heatmap/index.js +1 -1
  110. package/dist/components/map-view/index.js +1 -1
  111. package/dist/components/map-view/map-view.d.ts.map +1 -1
  112. package/dist/components/notes-panel/index.js +1 -1
  113. package/dist/components/patient-details/index.js +1 -1
  114. package/dist/components/patient-search/index.js +1 -1
  115. package/dist/components/patient-search/patient-search.d.ts.map +1 -1
  116. package/dist/components/patient-summary-card/index.js +1 -1
  117. package/dist/components/patient-table/index.js +1 -1
  118. package/dist/components/periodontal-diagnosis/index.js +1 -1
  119. package/dist/components/permission-matrix/index.js +1 -1
  120. package/dist/components/practice-results/index.js +1 -1
  121. package/dist/components/province-select/index.js +1 -1
  122. package/dist/components/reviews-panel/index.js +1 -1
  123. package/dist/components/reviews-panel/reviews-panel.d.ts.map +1 -1
  124. package/dist/components/rich-text-editor/index.js +1 -1
  125. package/dist/components/slot-grid/index.js +1 -1
  126. package/dist/components/slot-grid/slot-grid.d.ts.map +1 -1
  127. package/dist/components/task-editor/index.js +1 -1
  128. package/dist/components/voice-control-panel/index.js +1 -1
  129. package/dist/host-compat.css +1 -10
  130. package/dist/index.js +37 -37
  131. package/dist/patterns/anamnesis/index.js +1 -1
  132. package/dist/patterns/calendar/index.js +1 -1
  133. package/dist/patterns/login-form/index.js +1 -1
  134. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  135. package/dist/patterns/registration-form/index.js +1 -1
  136. package/dist/patterns/workflow-webhook-action/index.js +1 -1
  137. package/dist/tokens.css +1 -1
  138. package/package.json +1 -1
  139. package/dist/_chunks/address-autocomplete-bPR2mNBt.js +0 -498
  140. package/dist/_chunks/address-autocomplete-bPR2mNBt.js.map +0 -1
  141. package/dist/_chunks/autocomplete-CnB1mHGc.js +0 -539
  142. package/dist/_chunks/autocomplete-CnB1mHGc.js.map +0 -1
  143. package/dist/_chunks/booking-C0FoW8Yx.js.map +0 -1
  144. package/dist/_chunks/checkbox-BjDv-r3o.js.map +0 -1
  145. package/dist/_chunks/combobox-CDPm_n0p.js.map +0 -1
  146. package/dist/_chunks/header-settings-BVhjndtV.js.map +0 -1
  147. package/dist/_chunks/index.modern-BeRXQVdc.js.map +0 -1
  148. package/dist/_chunks/map-view-Bvi06RVh.js.map +0 -1
  149. package/dist/_chunks/patient-search-CCOUZABE.js +0 -1196
  150. package/dist/_chunks/patient-search-CCOUZABE.js.map +0 -1
  151. package/dist/_chunks/reviews-panel-UzQQLb-z.js.map +0 -1
@@ -1,1196 +0,0 @@
1
- import { jsx as a, jsxs as w } from "react/jsx-runtime";
2
- import { forwardRef as ce, useRef as R, useEffect as B, useMemo as J, useImperativeHandle as le, useState as H, useCallback as $, useId as ue } from "react";
3
- import { c as L } from "./index-D2ZczOXr.js";
4
- import { useTranslation as C } from "react-i18next";
5
- import { A as ne } from "./autocomplete-CnB1mHGc.js";
6
- import { B as fe } from "./button-DohK_Ak_.js";
7
- import { C as q } from "./card-BA4Ig_kn.js";
8
- import { S as pe } from "./slider-pZ95bEm7.js";
9
- import { A as ae } from "./alert-9kEwDza3.js";
10
- import { D as M } from "./dropdown-menu-D1we7oAY.js";
11
- import { u as me } from "./registry-DvAUVLHh.js";
12
- import { S as ie } from "./search-QbWPlY5f.js";
13
- import { X as oe } from "./x-B5YnXwCz.js";
14
- import { c as he } from "./createLucideIcon-DhHxpK9K.js";
15
- import { M as ve } from "./map-pin-BaY37-Km.js";
16
- import { S as ge } from "./stethoscope-sZXGC43m.js";
17
- import { C as be } from "./chevron-down-DWE7GSq9.js";
18
- /**
19
- * @license lucide-react v1.22.0 - ISC
20
- *
21
- * This source code is licensed under the ISC license.
22
- * See the LICENSE file in the root directory of this source tree.
23
- */
24
- const ye = [
25
- ["line", { x1: "2", x2: "5", y1: "12", y2: "12", key: "bvdh0s" }],
26
- ["line", { x1: "19", x2: "22", y1: "12", y2: "12", key: "1tbv5k" }],
27
- ["line", { x1: "12", x2: "12", y1: "2", y2: "5", key: "11lu5j" }],
28
- ["line", { x1: "12", x2: "12", y1: "19", y2: "22", key: "x3vr5v" }],
29
- ["circle", { cx: "12", cy: "12", r: "7", key: "fim9np" }],
30
- ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
31
- ], xe = he("locate-fixed", ye), we = {
32
- id: "patient-search",
33
- // `filter` is the conceptual capability of this search widget. Building the
34
- // actual query (WHO/WHERE/WHEN/facets/geo) is host-delegated: selection is
35
- // owned by the consumer via the `value` / `onChange` contract, so the agent
36
- // surface here is limited to clearing the query (`reset`) and focusing the
37
- // primary field. The previous `navigate` / `view_change` capabilities were
38
- // spurious — the variant is fixed by props (not agent-settable) and no
39
- // action navigates.
40
- capabilities: ["filter"],
41
- state: {
42
- variant: {
43
- type: "string",
44
- descriptionKey: "ui.agent.patientSearch.state.variant",
45
- description: "Active variant — one of `who-where`, `who-where-when`, `faceted`, `discovery`.",
46
- read: (e) => e.getVariant()
47
- }
48
- },
49
- actions: {
50
- reset: {
51
- safety: "write",
52
- idempotent: !0,
53
- descriptionKey: "ui.agent.patientSearch.actions.reset",
54
- description: "Clear the current search query (WHO, WHERE, WHEN, facets, geo) via the consumer-owned onChange.",
55
- invoke: (e) => {
56
- e.reset();
57
- }
58
- },
59
- focus_primary: {
60
- safety: "read",
61
- idempotent: !0,
62
- descriptionKey: "ui.agent.patientSearch.actions.focusPrimary",
63
- description: "Move keyboard focus to the most-relevant search field for the current variant.",
64
- invoke: (e) => {
65
- e.focusPrimary();
66
- }
67
- }
68
- },
69
- domHooks: {
70
- root: {
71
- attr: "data-component",
72
- value: "patient-search",
73
- description: "Marks the PatientSearch root region."
74
- },
75
- instanceId: {
76
- attr: "data-component-id",
77
- sourceProp: "id",
78
- description: "Sourced from the id prop."
79
- }
80
- }
81
- };
82
- function _(e, t) {
83
- if (typeof window > "u") return;
84
- const s = window.track;
85
- try {
86
- s == null || s(e, t);
87
- } catch {
88
- }
89
- }
90
- const T = [
91
- "today",
92
- "tomorrow",
93
- "this_week",
94
- "anytime"
95
- ], V = [1, 5, 10, 25, 50], Z = 5, de = 200;
96
- function _e(e) {
97
- let t = 0, s = Number.POSITIVE_INFINITY;
98
- return V.forEach((d, i) => {
99
- const v = Math.abs(d - e);
100
- v < s && (s = v, t = i);
101
- }), t;
102
- }
103
- const Se = L(
104
- "ds:flex ds:w-full ds:flex-col ds:text-[var(--foreground)]",
105
- {
106
- variants: {
107
- variant: {
108
- "who-where": "ds:gap-[var(--spacing-md)]",
109
- "who-where-when": "ds:gap-[var(--spacing-md)]",
110
- faceted: "ds:gap-[var(--spacing-md)]",
111
- discovery: "ds:gap-[var(--spacing-lg)]"
112
- }
113
- },
114
- defaultVariants: { variant: "who-where" }
115
- }
116
- );
117
- function U({
118
- value: e,
119
- onChange: t,
120
- loadObjects: s,
121
- onObjectSelect: d,
122
- inputRef: i
123
- }) {
124
- var p, u, l, b;
125
- const { t: v } = C("ui"), [g, h] = H(((p = e.object) == null ? void 0 : p.label) ?? ""), c = R((u = e.object) == null ? void 0 : u.value);
126
- B(() => {
127
- var m, o, k;
128
- ((m = e.object) == null ? void 0 : m.value) !== c.current && (c.current = (o = e.object) == null ? void 0 : o.value, h(((k = e.object) == null ? void 0 : k.label) ?? ""));
129
- }, [(l = e.object) == null ? void 0 : l.value, (b = e.object) == null ? void 0 : b.label]);
130
- const n = $(
131
- async (m, { signal: o }) => await s(m, { signal: o }),
132
- [s]
133
- ), f = (m) => {
134
- const o = {
135
- value: m.value,
136
- label: m.label,
137
- description: m.description,
138
- __payload: m.__payload
139
- };
140
- h(o.label), c.current = o.value, t({ ...e, object: o }), _("patient_search_object_selected", {
141
- value: o.value,
142
- type: o.__payload && typeof o.__payload == "object" ? o.__payload.type : void 0
143
- }), d == null || d(o);
144
- }, r = R(!1);
145
- return /* @__PURE__ */ a(
146
- "div",
147
- {
148
- "data-component": "patient-search-field",
149
- "data-field": "who",
150
- onFocus: () => {
151
- r.current || (r.current = !0, _("patient_search_object_focused"));
152
- },
153
- onBlur: (m) => {
154
- m.currentTarget && !m.currentTarget.contains(m.relatedTarget) && (r.current = !1);
155
- },
156
- children: /* @__PURE__ */ a(
157
- ne,
158
- {
159
- ref: i,
160
- size: "lg",
161
- value: g,
162
- onChange: (m) => {
163
- h(m), e.object && m !== e.object.label && (c.current = void 0, t({ ...e, object: void 0 }));
164
- },
165
- onSelect: f,
166
- loadOptions: n,
167
- debounceMs: de,
168
- placeholder: v("patientSearch.who.placeholder"),
169
- "aria-label": v("patientSearch.who.label"),
170
- startAdornment: /* @__PURE__ */ a(ie, { "aria-hidden": "true" })
171
- }
172
- )
173
- }
174
- );
175
- }
176
- const te = [
177
- "ds:inline-flex ds:items-center ds:justify-center",
178
- "ds:size-8 ds:rounded-[var(--radius-sm)]",
179
- "ds:text-[color:var(--muted-foreground)] ds:hover:text-[color:var(--primary)]",
180
- "ds:hover:bg-[color-mix(in_srgb,var(--primary)_8%,transparent)]",
181
- "ds:aria-pressed:text-[color:var(--primary)]",
182
- "ds:aria-pressed:bg-[color-mix(in_srgb,var(--primary)_12%,transparent)]",
183
- "ds:disabled:opacity-50 ds:disabled:cursor-not-allowed",
184
- "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
185
- "ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
186
- "ds:forced-colors:focus-visible:outline-[CanvasText]"
187
- ].join(" ");
188
- function G({
189
- value: e,
190
- onChange: t,
191
- loadPlaces: s,
192
- onPlaceSelect: d,
193
- allowTypedPlace: i,
194
- inputRef: v,
195
- defaultRadiusKm: g = Z,
196
- reverseGeocode: h
197
- }) {
198
- var K, O, z, E;
199
- const { t: c } = C("ui"), [n, f] = H(((K = e.place) == null ? void 0 : K.label) ?? ""), r = R((O = e.place) == null ? void 0 : O.value), p = e.geo ? "granted" : "pristine", [u, l] = H(p);
200
- B(() => {
201
- var y, x, N;
202
- ((y = e.place) == null ? void 0 : y.value) !== r.current && (r.current = (x = e.place) == null ? void 0 : x.value, f(((N = e.place) == null ? void 0 : N.label) ?? ""));
203
- }, [(z = e.place) == null ? void 0 : z.value, (E = e.place) == null ? void 0 : E.label]);
204
- const b = $(
205
- async (y, { signal: x }) => await s(y, { signal: x }),
206
- [s]
207
- ), m = (y) => {
208
- const x = {
209
- value: y.value,
210
- label: y.label,
211
- lat: y.lat,
212
- lng: y.lng
213
- };
214
- f(x.label), r.current = x.value, t({ ...e, place: x, geo: void 0 }), u === "granted" && l("pristine"), _("patient_search_place_selected", { value: x.value }), d == null || d(x);
215
- }, o = () => {
216
- if (typeof window > "u" || !(navigator != null && navigator.geolocation)) {
217
- l("denied"), _("patient_search_geo_denied", { reason: "unsupported" });
218
- return;
219
- }
220
- l("requesting"), _("patient_search_place_focused"), navigator.geolocation.getCurrentPosition(
221
- async (y) => {
222
- const { latitude: x, longitude: N } = y.coords;
223
- let A;
224
- try {
225
- A = await (h == null ? void 0 : h(x, N));
226
- } catch {
227
- A = void 0;
228
- }
229
- const S = g, F = A ?? c("patientSearch.geo.fallbackLabel"), W = {
230
- value: `geo:${x.toFixed(4)},${N.toFixed(4)}`,
231
- label: F,
232
- lat: x,
233
- lng: N
234
- };
235
- t({
236
- ...e,
237
- place: W,
238
- geo: {
239
- lat: x,
240
- lng: N,
241
- radiusKm: S,
242
- label: F
243
- }
244
- }), l("granted"), _("patient_search_geo_granted", { radiusKm: S });
245
- },
246
- () => {
247
- l("denied"), _("patient_search_geo_denied", { reason: "user" });
248
- },
249
- { enableHighAccuracy: !1, maximumAge: 6e4, timeout: 1e4 }
250
- );
251
- }, k = () => {
252
- t({ ...e, geo: void 0, place: void 0 }), f(""), r.current = void 0, l("pristine");
253
- }, j = u === "granted" && !!e.geo, P = u === "requesting", D = u === "denied", I = R(!1), Y = D || !!!h ? null : /* @__PURE__ */ w("span", { className: "ds:absolute ds:end-[var(--spacing-xs)] ds:top-1/2 ds:-translate-y-1/2 ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
254
- j ? /* @__PURE__ */ a(
255
- "button",
256
- {
257
- type: "button",
258
- "aria-label": c("patientSearch.geo.clear"),
259
- onClick: k,
260
- className: te,
261
- children: /* @__PURE__ */ a(oe, { "aria-hidden": "true", className: "ds:size-4" })
262
- }
263
- ) : null,
264
- /* @__PURE__ */ a(
265
- "button",
266
- {
267
- type: "button",
268
- "aria-label": c("patientSearch.geo.cta"),
269
- "aria-pressed": j || void 0,
270
- disabled: P,
271
- onClick: j ? k : o,
272
- className: te,
273
- children: /* @__PURE__ */ a(xe, { "aria-hidden": "true", className: "ds:size-4" })
274
- }
275
- )
276
- ] });
277
- return /* @__PURE__ */ w(
278
- "div",
279
- {
280
- "data-component": "patient-search-field",
281
- "data-field": "where",
282
- onFocus: () => {
283
- I.current || (I.current = !0, _("patient_search_place_focused"));
284
- },
285
- onBlur: (y) => {
286
- y.currentTarget && !y.currentTarget.contains(y.relatedTarget) && (I.current = !1);
287
- },
288
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
289
- children: [
290
- /* @__PURE__ */ w("div", { className: "ds:relative", children: [
291
- /* @__PURE__ */ a(
292
- ne,
293
- {
294
- ref: v,
295
- size: "lg",
296
- value: n,
297
- onChange: (y) => {
298
- var x, N;
299
- if (f(y), (i || e.place) && y !== ((x = e.place) == null ? void 0 : x.label)) {
300
- const A = y.trim(), S = i && A ? { value: `text:${A}`, label: A } : void 0;
301
- if (r.current = S == null ? void 0 : S.value, (S == null ? void 0 : S.value) === ((N = e.place) == null ? void 0 : N.value) && !e.geo) return;
302
- t({ ...e, place: S, geo: void 0 }), u === "granted" && l("pristine");
303
- }
304
- },
305
- onSelect: m,
306
- loadOptions: b,
307
- debounceMs: de,
308
- placeholder: c("patientSearch.where.placeholder"),
309
- "aria-label": c("patientSearch.where.label"),
310
- startAdornment: /* @__PURE__ */ a(ve, { "aria-hidden": "true" }),
311
- endAdornment: D ? void 0 : (
312
- // Decorative spacer — reserves inline-end room so the typed
313
- // text doesn't run under the absolutely-positioned overlay.
314
- // Autocomplete wraps endAdornment in `aria-hidden`, which is
315
- // correct for this empty span. Granted-state shows an extra
316
- // clear-X chip, so the spacer doubles in width when granted.
317
- /* @__PURE__ */ a(
318
- "span",
319
- {
320
- "aria-hidden": "true",
321
- className: j ? "ds:inline-block ds:size-[4.5rem]" : "ds:inline-block ds:size-8"
322
- }
323
- )
324
- )
325
- }
326
- ),
327
- Y
328
- ] }),
329
- D ? (
330
- // Alert defaults to `role="status"` + `aria-live="polite"` for the
331
- // `info` variant — the user hears why the field reverted to plain
332
- // text when their browser blocked the geolocation prompt.
333
- /* @__PURE__ */ a(ae, { variant: "info", children: /* @__PURE__ */ a(ae.Description, { children: c("patientSearch.geo.denied") }) })
334
- ) : null
335
- ]
336
- }
337
- );
338
- }
339
- function Q({
340
- value: e,
341
- onChange: t,
342
- defaultRadiusKm: s = Z
343
- }) {
344
- const { t: d } = C("ui"), [i, v] = H(
345
- () => {
346
- var c;
347
- return _e(((c = e.geo) == null ? void 0 : c.radiusKm) ?? s);
348
- }
349
- );
350
- if (!e.geo) return null;
351
- const g = (c) => {
352
- const n = V[c] ?? s;
353
- t({ ...e, geo: { ...e.geo, radiusKm: n } }), _("patient_search_radius_changed", { radiusKm: n });
354
- }, h = (c) => {
355
- const n = V[Math.round(c)] ?? s;
356
- return d("patientSearch.geo.radiusFormat", { km: n });
357
- };
358
- return /* @__PURE__ */ w(
359
- "div",
360
- {
361
- "data-component": "patient-search-geo-radius-bar",
362
- className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)] ds:pb-[var(--spacing-md)]",
363
- children: [
364
- /* @__PURE__ */ a(
365
- "span",
366
- {
367
- id: "patient-search-radius-label",
368
- className: "type-meta ds:text-[color:var(--muted-foreground)]",
369
- children: d("patientSearch.geo.radius")
370
- }
371
- ),
372
- /* @__PURE__ */ a(
373
- pe,
374
- {
375
- value: [i],
376
- min: 0,
377
- max: V.length - 1,
378
- step: 1,
379
- marks: V.map((c, n) => ({
380
- value: n,
381
- label: `${c}`
382
- })),
383
- formatValue: h,
384
- alwaysShowValue: !0,
385
- "aria-labelledby": "patient-search-radius-label",
386
- onValueChange: (c) => v(c[0] ?? 0),
387
- onValueCommit: (c) => g(c[0] ?? 0)
388
- }
389
- )
390
- ]
391
- }
392
- );
393
- }
394
- const Ne = L(
395
- [
396
- "ds:inline-flex ds:items-center ds:justify-center",
397
- "ds:min-h-[var(--min-target-size)]",
398
- "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
399
- "ds:pt-[var(--spacing-xs)] ds:pb-[var(--spacing-xs)]",
400
- "ds:rounded-[var(--radius-full)]",
401
- "type-label ds:font-[var(--font-weight-medium)]",
402
- "ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
403
- "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
404
- "ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
405
- "ds:forced-colors:focus-visible:outline-[CanvasText]"
406
- ].join(" "),
407
- {
408
- variants: {
409
- state: {
410
- idle: "ds:bg-[var(--secondary)] ds:text-[var(--foreground)] ds:border ds:border-[color:var(--border)] ds:hover:bg-[color-mix(in_srgb,var(--primary)_8%,var(--secondary))]",
411
- selected: "ds:bg-[var(--primary)] ds:text-[var(--primary-foreground)] ds:border ds:border-transparent ds:font-[var(--font-weight-semibold)]"
412
- }
413
- },
414
- defaultVariants: { state: "idle" }
415
- }
416
- );
417
- function ke({ value: e, onChange: t }) {
418
- const { t: s, i18n: d } = C("ui"), i = ue(), v = d.dir() === "rtl", g = R(/* @__PURE__ */ new Map()), h = $((r) => {
419
- var p;
420
- (p = g.current.get(r)) == null || p.focus();
421
- }, []), c = $(
422
- (r, p) => {
423
- const u = T.indexOf(p), l = T.length, b = v ? "ArrowLeft" : "ArrowRight", m = v ? "ArrowRight" : "ArrowLeft";
424
- switch (r.key) {
425
- case b:
426
- case "ArrowDown": {
427
- r.preventDefault();
428
- const o = T[(u + 1) % l];
429
- t(o), _("patient_search_when_selected", { when: o }), h(o);
430
- break;
431
- }
432
- case m:
433
- case "ArrowUp": {
434
- r.preventDefault();
435
- const o = T[(u - 1 + l) % l];
436
- t(o), _("patient_search_when_selected", { when: o }), h(o);
437
- break;
438
- }
439
- case "Home": {
440
- r.preventDefault();
441
- const o = T[0];
442
- t(o), _("patient_search_when_selected", { when: o }), h(o);
443
- break;
444
- }
445
- case "End": {
446
- r.preventDefault();
447
- const o = T[l - 1];
448
- t(o), _("patient_search_when_selected", { when: o }), h(o);
449
- break;
450
- }
451
- }
452
- },
453
- [h, v, t]
454
- ), n = e ?? "anytime", f = {
455
- today: "patientSearch.when.today",
456
- tomorrow: "patientSearch.when.tomorrow",
457
- this_week: "patientSearch.when.thisWeek",
458
- anytime: "patientSearch.when.anytime"
459
- };
460
- return /* @__PURE__ */ a(
461
- "div",
462
- {
463
- role: "radiogroup",
464
- "aria-label": s("patientSearch.when.label"),
465
- id: i,
466
- className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
467
- children: T.map((r) => {
468
- const p = e === r, u = n === r, l = s(f[r]);
469
- return /* @__PURE__ */ a(
470
- "button",
471
- {
472
- type: "button",
473
- role: "radio",
474
- "aria-checked": p,
475
- "aria-label": l,
476
- tabIndex: u ? 0 : -1,
477
- ref: (b) => {
478
- b ? g.current.set(r, b) : g.current.delete(r);
479
- },
480
- onClick: () => {
481
- t(r), _("patient_search_when_selected", { when: r });
482
- },
483
- onKeyDown: (b) => c(b, r),
484
- className: Ne({
485
- state: p ? "selected" : "idle"
486
- }),
487
- children: l
488
- },
489
- r
490
- );
491
- })
492
- }
493
- );
494
- }
495
- const se = L(
496
- [
497
- "ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
498
- "ds:min-h-[var(--min-target-size)]",
499
- "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
500
- "ds:pt-[var(--spacing-xs)] ds:pb-[var(--spacing-xs)]",
501
- "ds:rounded-[var(--radius-full)]",
502
- "type-label",
503
- "ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
504
- "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
505
- "ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
506
- "ds:forced-colors:focus-visible:outline-[CanvasText]"
507
- ].join(" "),
508
- {
509
- variants: {
510
- // Matches the WHEN chip strip's `selected` look — solid primary fill,
511
- // primary-foreground text, transparent border. The earlier
512
- // `color-mix(primary 12% / secondary)` tint read as a washed-out
513
- // colour over the grey input row and didn't visually signal "this
514
- // filter is active" with enough weight. Solid fill matches the kit's
515
- // toggle-button precedent (SuggestionChip's `suggestion` intent + the
516
- // ServiceGrid radio's selected state in Booking).
517
- state: {
518
- idle: "ds:bg-[var(--secondary)] ds:text-[var(--foreground)] ds:border ds:border-[color:var(--border)] ds:hover:bg-[color-mix(in_srgb,var(--primary)_8%,var(--secondary))]",
519
- active: "ds:bg-[var(--primary)] ds:text-[var(--primary-foreground)] ds:border ds:border-transparent ds:font-[var(--font-weight-semibold)]"
520
- }
521
- },
522
- defaultVariants: { state: "idle" }
523
- }
524
- );
525
- function Re({ facets: e, value: t, onChange: s }) {
526
- const { t: d } = C("ui"), i = J(() => t ?? {}, [t]), v = J(
527
- () => Object.values(i).some((n) => n && n.length > 0),
528
- [i]
529
- ), g = (n, f) => {
530
- const r = { ...i };
531
- f.length === 0 ? delete r[n] : r[n] = f, s(r), _("patient_search_facet_changed", { key: n, values: f });
532
- }, h = (n) => {
533
- var r;
534
- const f = (((r = i[n]) == null ? void 0 : r.length) ?? 0) > 0;
535
- g(n, f ? [] : ["true"]);
536
- }, c = (n, f) => {
537
- const r = i[n.key] ?? [], p = r.includes(f);
538
- let u;
539
- n.multi ? u = p ? r.filter((l) => l !== f) : [...r, f] : u = p ? [] : [f], g(n.key, u);
540
- };
541
- return /* @__PURE__ */ w(
542
- "div",
543
- {
544
- role: "group",
545
- "aria-label": d("patientSearch.facets.label"),
546
- className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
547
- children: [
548
- e.map((n) => {
549
- const f = n.options.length === 0, r = i[n.key] ?? [], p = r.length > 0;
550
- if (f)
551
- return /* @__PURE__ */ a(
552
- "button",
553
- {
554
- type: "button",
555
- "aria-pressed": p,
556
- "aria-label": n.label,
557
- onClick: () => h(n.key),
558
- className: se({
559
- state: p ? "active" : "idle"
560
- }),
561
- children: /* @__PURE__ */ a("span", { children: n.label })
562
- },
563
- n.key
564
- );
565
- const u = p ? ` (${r.length})` : "";
566
- return /* @__PURE__ */ w(M.Root, { children: [
567
- /* @__PURE__ */ a(M.Trigger, { asChild: !0, children: /* @__PURE__ */ w(
568
- "button",
569
- {
570
- type: "button",
571
- "aria-label": `${n.label}${u}`,
572
- className: se({
573
- state: p ? "active" : "idle"
574
- }),
575
- children: [
576
- /* @__PURE__ */ w("span", { children: [
577
- n.label,
578
- u
579
- ] }),
580
- /* @__PURE__ */ a(
581
- be,
582
- {
583
- "aria-hidden": "true",
584
- className: "ds:size-3.5 ds:shrink-0"
585
- }
586
- )
587
- ]
588
- }
589
- ) }),
590
- /* @__PURE__ */ a(M.Content, { sideOffset: 8, align: "start", children: n.options.map((l) => /* @__PURE__ */ a(
591
- M.CheckboxItem,
592
- {
593
- checked: r.includes(l.value),
594
- onSelect: (b) => {
595
- n.multi && b.preventDefault(), c(n, l.value);
596
- },
597
- children: l.label
598
- },
599
- l.value
600
- )) })
601
- ] }, n.key);
602
- }),
603
- v ? /* @__PURE__ */ w(
604
- "button",
605
- {
606
- type: "button",
607
- onClick: () => {
608
- s({}), _("patient_search_facet_changed", { key: "*", values: [] });
609
- },
610
- className: [
611
- "ds:ms-[var(--spacing-xs)] ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
612
- "ds:min-h-[var(--min-target-size)] ds:ps-[var(--spacing-xs)] ds:pe-[var(--spacing-xs)]",
613
- "type-label ds:text-[color:var(--muted-foreground)]",
614
- "ds:rounded-[var(--radius-sm)]",
615
- "ds:hover:text-[color:var(--foreground)]",
616
- "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
617
- "ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]"
618
- ].join(" "),
619
- children: [
620
- /* @__PURE__ */ a(oe, { "aria-hidden": "true", className: "ds:size-3.5" }),
621
- d("patientSearch.facets.clear")
622
- ]
623
- }
624
- ) : null
625
- ]
626
- }
627
- );
628
- }
629
- const re = ["violet", "purple", "magenta", "blue"], je = L(
630
- [
631
- "ds:relative ds:flex ds:h-full ds:flex-col ds:gap-[var(--spacing-sm)]",
632
- "ds:rounded-[var(--radius-lg)] ds:overflow-hidden",
633
- "ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
634
- "ds:pt-[var(--spacing-md)] ds:pb-[var(--spacing-md)]",
635
- "ds:bg-[var(--card)] ds:text-[var(--card-foreground)]",
636
- "ds:border ds:border-[color:var(--card-border)]",
637
- "ds:shadow-[var(--shadow-sm)]",
638
- "ds:transition-[transform,box-shadow] ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
639
- "ds:motion-safe:hover:-translate-y-0.5",
640
- "ds:hover:shadow-[var(--shadow-md)]",
641
- "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
642
- "ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
643
- "ds:no-underline"
644
- ].join(" ")
645
- ), Ae = L(
646
- // `inset-x-0` compiles to logical `inset-inline`; the `inset-inline-0`
647
- // spelling is not a Tailwind utility and compiled to nothing.
648
- "ds:absolute ds:inset-x-0 ds:top-0 ds:h-[3px] ds:pointer-events-none",
649
- {
650
- variants: {
651
- accent: {
652
- violet: "ds:bg-[var(--color-violet-500)]",
653
- purple: "ds:bg-[var(--color-purple-500)]",
654
- magenta: "ds:bg-[var(--color-magenta-500)]",
655
- blue: "ds:bg-[var(--color-blue-500)]"
656
- }
657
- },
658
- defaultVariants: { accent: "violet" }
659
- }
660
- ), Ce = L(
661
- "ds:inline-flex ds:size-9 ds:items-center ds:justify-center ds:rounded-[var(--radius-md)]",
662
- {
663
- variants: {
664
- accent: {
665
- violet: "ds:bg-[color-mix(in_srgb,var(--color-violet-500)_12%,var(--background))] ds:text-[var(--color-violet-700)]",
666
- purple: "ds:bg-[color-mix(in_srgb,var(--color-purple-500)_12%,var(--background))] ds:text-[var(--color-purple-700)]",
667
- magenta: "ds:bg-[color-mix(in_srgb,var(--color-magenta-500)_12%,var(--background))] ds:text-[var(--color-magenta-700)]",
668
- blue: "ds:bg-[color-mix(in_srgb,var(--color-blue-500)_12%,var(--background))] ds:text-[var(--color-blue-700)]"
669
- }
670
- },
671
- defaultVariants: { accent: "violet" }
672
- }
673
- );
674
- function Te(e, t) {
675
- return e && e !== "auto" ? e : re[t % re.length];
676
- }
677
- function Ee({ cards: e, headingLevel: t }) {
678
- const { t: s } = C("ui"), d = `h${t}`;
679
- return e.length === 0 ? /* @__PURE__ */ a("p", { className: "type-body-sm ds:text-[color:var(--muted-foreground)] ds:m-0", children: s("patientSearch.discovery.empty") }) : /* @__PURE__ */ w("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
680
- /* @__PURE__ */ a(d, { className: "type-title-card ds:text-[var(--foreground)] ds:m-0", children: s("patientSearch.discovery.heading") }),
681
- /* @__PURE__ */ a(
682
- "ul",
683
- {
684
- className: [
685
- "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)]",
686
- "ds:md:grid-cols-2 ds:lg:grid-cols-3",
687
- "ds:m-0 ds:p-0 ds:list-none"
688
- ].join(" "),
689
- children: e.map((i, v) => {
690
- const g = Te(i.accent, v);
691
- return /* @__PURE__ */ a("li", { children: /* @__PURE__ */ w(
692
- "a",
693
- {
694
- href: i.href,
695
- "data-component": "patient-search-card",
696
- "data-card-id": i.id,
697
- "aria-label": i.description ? `${i.label} — ${i.description}` : i.label,
698
- onClick: () => _("patient_search_discovery_card_clicked", {
699
- cardId: i.id
700
- }),
701
- className: je(),
702
- children: [
703
- /* @__PURE__ */ a(
704
- "span",
705
- {
706
- "aria-hidden": "true",
707
- className: Ae({ accent: g })
708
- }
709
- ),
710
- /* @__PURE__ */ w("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
711
- /* @__PURE__ */ a(
712
- "span",
713
- {
714
- "aria-hidden": "true",
715
- className: Ce({ accent: g }),
716
- children: i.icon ?? /* @__PURE__ */ a(ge, { className: "ds:size-4", "aria-hidden": "true" })
717
- }
718
- ),
719
- i.badge ? (
720
- // The badge sits inside a softly-tinted accent bubble
721
- // (15% accent + 85% background). The text colour must
722
- // contrast with that mix, not with the accent's canonical
723
- // foreground — `--accent-foreground` is calibrated against
724
- // the 100% accent surface and fails AA on the 15% tint.
725
- // Use `--foreground` which contrasts with the
726
- // mostly-background mix in both light and dark themes.
727
- /* @__PURE__ */ a("span", { className: "type-meta ds:ms-auto ds:inline-flex ds:items-center ds:rounded-[var(--radius-full)] ds:border ds:border-[color:var(--foreground)] ds:bg-[color-mix(in_srgb,var(--accent)_15%,var(--background))] ds:text-[color:var(--foreground)] ds:font-[var(--font-weight-semibold)] ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:pt-[var(--spacing-xs)] ds:pb-[var(--spacing-xs)]", children: i.badge })
728
- ) : null
729
- ] }),
730
- /* @__PURE__ */ a("span", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)]", children: i.label }),
731
- i.description ? /* @__PURE__ */ a("span", { className: "type-body-sm ds:text-[color:var(--muted-foreground)]", children: i.description }) : null
732
- ]
733
- }
734
- ) }, i.id);
735
- })
736
- }
737
- )
738
- ] });
739
- }
740
- function Le(e) {
741
- if (e.object || e.place || e.geo || e.when && e.when !== "anytime") return !0;
742
- if (e.facets) {
743
- for (const t of Object.values(e.facets))
744
- if (t && t.length > 0) return !0;
745
- }
746
- return !1;
747
- }
748
- function X({
749
- value: e,
750
- variant: t,
751
- submitting: s,
752
- submitLabel: d,
753
- allowEmptySubmit: i,
754
- onSubmit: v
755
- }) {
756
- const { t: g } = C("ui"), h = !s && !i && !Le(e), c = d ?? g("patientSearch.submit.cta");
757
- return /* @__PURE__ */ a(
758
- fe,
759
- {
760
- type: "button",
761
- intent: "primary",
762
- size: "lg",
763
- startIcon: /* @__PURE__ */ a(ie, { "aria-hidden": "true" }),
764
- loading: s,
765
- disabled: h,
766
- onClick: () => {
767
- _("patient_search_submitted", {
768
- variant: t,
769
- hasObject: !!e.object,
770
- hasPlace: !!e.place,
771
- hasGeo: !!e.geo,
772
- when: e.when,
773
- facetKeys: e.facets ? Object.keys(e.facets) : []
774
- }), v(e);
775
- },
776
- children: c
777
- }
778
- );
779
- }
780
- function Pe(e) {
781
- const {
782
- variant: t,
783
- value: s,
784
- onChange: d,
785
- onSubmit: i,
786
- loadObjects: v,
787
- loadPlaces: g,
788
- onObjectSelect: h,
789
- onPlaceSelect: c,
790
- allowTypedPlace: n,
791
- submitting: f,
792
- submitLabel: r,
793
- allowEmptySubmit: p,
794
- whoRef: u,
795
- whereRef: l,
796
- defaultRadiusKm: b,
797
- reverseGeocode: m,
798
- cardLabel: o
799
- } = e;
800
- return /* @__PURE__ */ a(q, { variant: "elevated", "aria-label": o, children: /* @__PURE__ */ w("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)]", children: [
801
- /* @__PURE__ */ w("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:md:flex-row ds:md:items-start", children: [
802
- /* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
803
- U,
804
- {
805
- value: s,
806
- onChange: d,
807
- loadObjects: v,
808
- onObjectSelect: h,
809
- inputRef: u
810
- }
811
- ) }),
812
- /* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
813
- G,
814
- {
815
- value: s,
816
- onChange: d,
817
- loadPlaces: g,
818
- onPlaceSelect: c,
819
- allowTypedPlace: n,
820
- defaultRadiusKm: b,
821
- reverseGeocode: m,
822
- inputRef: l
823
- }
824
- ) }),
825
- /* @__PURE__ */ a(
826
- X,
827
- {
828
- value: s,
829
- variant: t,
830
- submitting: f,
831
- submitLabel: r,
832
- allowEmptySubmit: p,
833
- onSubmit: i
834
- }
835
- )
836
- ] }),
837
- /* @__PURE__ */ a(
838
- Q,
839
- {
840
- value: s,
841
- onChange: d,
842
- defaultRadiusKm: b
843
- }
844
- )
845
- ] }) });
846
- }
847
- function De(e) {
848
- const {
849
- variant: t,
850
- value: s,
851
- onChange: d,
852
- onSubmit: i,
853
- loadObjects: v,
854
- loadPlaces: g,
855
- onObjectSelect: h,
856
- onPlaceSelect: c,
857
- allowTypedPlace: n,
858
- submitting: f,
859
- submitLabel: r,
860
- allowEmptySubmit: p,
861
- whoRef: u,
862
- whereRef: l,
863
- defaultRadiusKm: b,
864
- reverseGeocode: m,
865
- cardLabel: o
866
- } = e;
867
- return /* @__PURE__ */ a(q, { variant: "elevated", "aria-label": o, children: /* @__PURE__ */ w("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]", children: [
868
- /* @__PURE__ */ w("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:md:flex-row ds:md:items-start", children: [
869
- /* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
870
- U,
871
- {
872
- value: s,
873
- onChange: d,
874
- loadObjects: v,
875
- onObjectSelect: h,
876
- inputRef: u
877
- }
878
- ) }),
879
- /* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
880
- G,
881
- {
882
- value: s,
883
- onChange: d,
884
- loadPlaces: g,
885
- onPlaceSelect: c,
886
- allowTypedPlace: n,
887
- defaultRadiusKm: b,
888
- reverseGeocode: m,
889
- inputRef: l
890
- }
891
- ) }),
892
- /* @__PURE__ */ a(
893
- X,
894
- {
895
- value: s,
896
- variant: t,
897
- submitting: f,
898
- submitLabel: r,
899
- allowEmptySubmit: p,
900
- onSubmit: i
901
- }
902
- )
903
- ] }),
904
- /* @__PURE__ */ a(
905
- Q,
906
- {
907
- value: s,
908
- onChange: d,
909
- defaultRadiusKm: b
910
- }
911
- ),
912
- /* @__PURE__ */ a(
913
- ke,
914
- {
915
- value: s.when,
916
- onChange: (k) => d({ ...s, when: k })
917
- }
918
- )
919
- ] }) });
920
- }
921
- function Ie(e) {
922
- const {
923
- variant: t,
924
- value: s,
925
- onChange: d,
926
- onSubmit: i,
927
- loadObjects: v,
928
- loadPlaces: g,
929
- onObjectSelect: h,
930
- onPlaceSelect: c,
931
- allowTypedPlace: n,
932
- facets: f,
933
- submitting: r,
934
- submitLabel: p,
935
- allowEmptySubmit: u,
936
- whoRef: l,
937
- whereRef: b,
938
- defaultRadiusKm: m,
939
- reverseGeocode: o,
940
- cardLabel: k
941
- } = e;
942
- return /* @__PURE__ */ a(q, { variant: "elevated", "aria-label": k, children: /* @__PURE__ */ w("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]", children: [
943
- /* @__PURE__ */ w("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:md:flex-row ds:md:items-start", children: [
944
- /* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
945
- U,
946
- {
947
- value: s,
948
- onChange: d,
949
- loadObjects: v,
950
- onObjectSelect: h,
951
- inputRef: l
952
- }
953
- ) }),
954
- /* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
955
- G,
956
- {
957
- value: s,
958
- onChange: d,
959
- loadPlaces: g,
960
- onPlaceSelect: c,
961
- allowTypedPlace: n,
962
- defaultRadiusKm: m,
963
- reverseGeocode: o,
964
- inputRef: b
965
- }
966
- ) }),
967
- /* @__PURE__ */ a(
968
- X,
969
- {
970
- value: s,
971
- variant: t,
972
- submitting: r,
973
- submitLabel: p,
974
- allowEmptySubmit: u,
975
- onSubmit: i
976
- }
977
- )
978
- ] }),
979
- /* @__PURE__ */ a(
980
- Q,
981
- {
982
- value: s,
983
- onChange: d,
984
- defaultRadiusKm: m
985
- }
986
- ),
987
- f && f.length > 0 ? /* @__PURE__ */ a(
988
- Re,
989
- {
990
- facets: f,
991
- value: s.facets,
992
- onChange: (j) => d({ ...s, facets: j })
993
- }
994
- ) : null
995
- ] }) });
996
- }
997
- function Oe(e) {
998
- const {
999
- variant: t,
1000
- value: s,
1001
- onChange: d,
1002
- onSubmit: i,
1003
- loadObjects: v,
1004
- loadPlaces: g,
1005
- onObjectSelect: h,
1006
- onPlaceSelect: c,
1007
- allowTypedPlace: n,
1008
- discoveryCards: f,
1009
- discoveryHeadingLevel: r,
1010
- submitting: p,
1011
- submitLabel: u,
1012
- allowEmptySubmit: l,
1013
- whoRef: b,
1014
- whereRef: m,
1015
- defaultRadiusKm: o,
1016
- reverseGeocode: k,
1017
- cardLabel: j
1018
- } = e;
1019
- return /* @__PURE__ */ w("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", children: [
1020
- /* @__PURE__ */ w(q, { variant: "elevated", "aria-label": j, children: [
1021
- /* @__PURE__ */ w("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-md)] ds:md:flex-row ds:md:items-stretch", children: [
1022
- /* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
1023
- U,
1024
- {
1025
- value: s,
1026
- onChange: d,
1027
- loadObjects: v,
1028
- onObjectSelect: h,
1029
- inputRef: b
1030
- }
1031
- ) }),
1032
- /* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
1033
- G,
1034
- {
1035
- value: s,
1036
- onChange: d,
1037
- loadPlaces: g,
1038
- onPlaceSelect: c,
1039
- allowTypedPlace: n,
1040
- defaultRadiusKm: o,
1041
- reverseGeocode: k,
1042
- inputRef: m
1043
- }
1044
- ) }),
1045
- /* @__PURE__ */ a(
1046
- X,
1047
- {
1048
- value: s,
1049
- variant: t,
1050
- submitting: p,
1051
- submitLabel: u,
1052
- allowEmptySubmit: l,
1053
- onSubmit: i
1054
- }
1055
- )
1056
- ] }),
1057
- /* @__PURE__ */ a(
1058
- Q,
1059
- {
1060
- value: s,
1061
- onChange: d,
1062
- defaultRadiusKm: o
1063
- }
1064
- )
1065
- ] }),
1066
- /* @__PURE__ */ a(
1067
- Ee,
1068
- {
1069
- cards: f,
1070
- headingLevel: r
1071
- }
1072
- )
1073
- ] });
1074
- }
1075
- const Ve = ce(function({
1076
- variant: t,
1077
- loadObjects: s,
1078
- loadPlaces: d,
1079
- onObjectSelect: i,
1080
- onPlaceSelect: v,
1081
- allowTypedPlace: g = !1,
1082
- facets: h,
1083
- defaultRadiusKm: c = Z,
1084
- reverseGeocode: n,
1085
- discoveryCards: f,
1086
- discoveryHeadingLevel: r = 3,
1087
- countryCode: p,
1088
- value: u,
1089
- onChange: l,
1090
- onSubmit: b,
1091
- submitting: m,
1092
- submitLabel: o,
1093
- allowEmptySubmit: k,
1094
- "aria-label": j,
1095
- id: P,
1096
- className: D,
1097
- ...I
1098
- }, ee) {
1099
- const { t: Y } = C("ui"), K = R(null), O = R(null), z = R(null), E = R(!1);
1100
- B(() => {
1101
- if (!E.current && t === "who-where-when") {
1102
- if (u.when !== void 0) {
1103
- E.current = !0;
1104
- return;
1105
- }
1106
- E.current = !0, l({ ...u, when: "anytime" });
1107
- }
1108
- }, [t]);
1109
- const y = R(!1);
1110
- B(() => {
1111
- if (!y.current && t === "faceted") {
1112
- if (u.facets !== void 0) {
1113
- y.current = !0;
1114
- return;
1115
- }
1116
- y.current = !0, l({ ...u, facets: {} });
1117
- }
1118
- }, [t]);
1119
- const x = R(null);
1120
- B(() => {
1121
- x.current !== t && (x.current = t, _("patient_search_variant_exposed", { variant: t, country: p }));
1122
- }, [t, p]);
1123
- const N = J(
1124
- () => ({
1125
- getVariant: () => t,
1126
- reset: () => {
1127
- l({});
1128
- },
1129
- focusPrimary: () => {
1130
- requestAnimationFrame(() => {
1131
- var W;
1132
- (W = O.current) == null || W.focus();
1133
- });
1134
- }
1135
- }),
1136
- [t, l]
1137
- );
1138
- le(ee, () => N, [N]), me(we, N, P);
1139
- const A = j ?? Y("patientSearch.regionLabel"), S = {
1140
- variant: t,
1141
- value: u,
1142
- onChange: l,
1143
- onSubmit: b,
1144
- loadObjects: s,
1145
- loadPlaces: d,
1146
- onObjectSelect: i,
1147
- onPlaceSelect: v,
1148
- allowTypedPlace: g,
1149
- facets: h,
1150
- defaultRadiusKm: c,
1151
- reverseGeocode: n,
1152
- discoveryCards: f ?? [],
1153
- discoveryHeadingLevel: r,
1154
- submitting: m,
1155
- submitLabel: o,
1156
- allowEmptySubmit: k,
1157
- whoRef: O,
1158
- whereRef: z,
1159
- cardLabel: A
1160
- }, F = (() => {
1161
- switch (t) {
1162
- case "who-where":
1163
- return /* @__PURE__ */ a(Pe, { ...S });
1164
- case "who-where-when":
1165
- return /* @__PURE__ */ a(De, { ...S });
1166
- case "faceted":
1167
- return /* @__PURE__ */ a(Ie, { ...S });
1168
- case "discovery":
1169
- return /* @__PURE__ */ a(Oe, { ...S });
1170
- /* c8 ignore next 2 */
1171
- default:
1172
- return null;
1173
- }
1174
- })();
1175
- return /* @__PURE__ */ a(
1176
- "div",
1177
- {
1178
- ref: K,
1179
- role: "region",
1180
- "aria-label": A,
1181
- id: P,
1182
- "data-component": "patient-search",
1183
- "data-component-id": P,
1184
- "data-variant": t,
1185
- className: Se({ variant: t, className: D }),
1186
- ...I,
1187
- children: F
1188
- }
1189
- );
1190
- });
1191
- Ve.displayName = "PatientSearch";
1192
- export {
1193
- Ve as P,
1194
- we as p
1195
- };
1196
- //# sourceMappingURL=patient-search-CCOUZABE.js.map