@alfadocs/ui-kit-debug 1.77.1 → 1.78.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{patient-search-DuBdxv1w.js → patient-search-CxqNcth4.js} +454 -438
- package/dist/_chunks/patient-search-CxqNcth4.js.map +1 -0
- package/dist/agent-catalog.json +1 -1
- package/dist/components/patient-search/index.js +1 -1
- package/dist/components/patient-search/patient-search.d.ts +9 -2
- package/dist/components/patient-search/patient-search.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/_chunks/patient-search-DuBdxv1w.js.map +0 -1
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { A as
|
|
6
|
-
import { B as
|
|
7
|
-
import { C as
|
|
8
|
-
import { S as
|
|
9
|
-
import { A as
|
|
10
|
-
import { D as
|
|
11
|
-
import { u as
|
|
12
|
-
import { S as
|
|
13
|
-
import { X as
|
|
14
|
-
import { c as
|
|
15
|
-
import { M as
|
|
16
|
-
import { S as
|
|
17
|
-
import { C as
|
|
1
|
+
import { jsx as a, jsxs as w } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as ce, useRef as j, useEffect as K, useMemo as Y, useImperativeHandle as le, useState as z, useCallback as M, 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 re } from "./autocomplete-DosDnGie.js";
|
|
6
|
+
import { B as fe } from "./button-DohK_Ak_.js";
|
|
7
|
+
import { C as H } from "./card-BA4Ig_kn.js";
|
|
8
|
+
import { S as pe } from "./slider-pZ95bEm7.js";
|
|
9
|
+
import { A as ee } from "./alert-9kEwDza3.js";
|
|
10
|
+
import { D as W } from "./dropdown-menu-D1we7oAY.js";
|
|
11
|
+
import { u as me } from "./registry-DvAUVLHh.js";
|
|
12
|
+
import { S as ne } from "./search-QbWPlY5f.js";
|
|
13
|
+
import { X as ie } 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
18
|
/**
|
|
19
19
|
* @license lucide-react v1.22.0 - ISC
|
|
20
20
|
*
|
|
21
21
|
* This source code is licensed under the ISC license.
|
|
22
22
|
* See the LICENSE file in the root directory of this source tree.
|
|
23
23
|
*/
|
|
24
|
-
const
|
|
24
|
+
const ye = [
|
|
25
25
|
["line", { x1: "2", x2: "5", y1: "12", y2: "12", key: "bvdh0s" }],
|
|
26
26
|
["line", { x1: "19", x2: "22", y1: "12", y2: "12", key: "1tbv5k" }],
|
|
27
27
|
["line", { x1: "12", x2: "12", y1: "2", y2: "5", key: "11lu5j" }],
|
|
28
28
|
["line", { x1: "12", x2: "12", y1: "19", y2: "22", key: "x3vr5v" }],
|
|
29
29
|
["circle", { cx: "12", cy: "12", r: "7", key: "fim9np" }],
|
|
30
30
|
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
31
|
-
], xe =
|
|
31
|
+
], xe = he("locate-fixed", ye), we = {
|
|
32
32
|
id: "patient-search",
|
|
33
33
|
// `filter` is the conceptual capability of this search widget. Building the
|
|
34
34
|
// actual query (WHO/WHERE/WHEN/facets/geo) is host-delegated: selection is
|
|
@@ -87,20 +87,20 @@ function _(e, s) {
|
|
|
87
87
|
} catch {
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
-
const
|
|
90
|
+
const T = [
|
|
91
91
|
"today",
|
|
92
92
|
"tomorrow",
|
|
93
93
|
"this_week",
|
|
94
94
|
"anytime"
|
|
95
|
-
],
|
|
96
|
-
function
|
|
95
|
+
], B = [1, 5, 10, 25, 50], J = 5, oe = 200;
|
|
96
|
+
function _e(e) {
|
|
97
97
|
let s = 0, t = Number.POSITIVE_INFINITY;
|
|
98
|
-
return
|
|
98
|
+
return B.forEach((i, p) => {
|
|
99
99
|
const v = Math.abs(i - e);
|
|
100
100
|
v < t && (t = v, s = p);
|
|
101
101
|
}), s;
|
|
102
102
|
}
|
|
103
|
-
const
|
|
103
|
+
const Se = L(
|
|
104
104
|
"ds:flex ds:w-full ds:flex-col ds:text-[var(--foreground)]",
|
|
105
105
|
{
|
|
106
106
|
variants: {
|
|
@@ -114,65 +114,65 @@ const _e = T(
|
|
|
114
114
|
defaultVariants: { variant: "who-where" }
|
|
115
115
|
}
|
|
116
116
|
);
|
|
117
|
-
function
|
|
117
|
+
function $({
|
|
118
118
|
value: e,
|
|
119
119
|
onChange: s,
|
|
120
120
|
loadObjects: t,
|
|
121
121
|
onObjectSelect: i,
|
|
122
122
|
inputRef: p
|
|
123
123
|
}) {
|
|
124
|
-
var
|
|
125
|
-
const { t: v } =
|
|
126
|
-
|
|
127
|
-
var
|
|
128
|
-
((
|
|
129
|
-
}, [(
|
|
130
|
-
const
|
|
131
|
-
async (
|
|
124
|
+
var l, u, c, g;
|
|
125
|
+
const { t: v } = C("ui"), [b, h] = z(((l = e.object) == null ? void 0 : l.label) ?? ""), d = j((u = e.object) == null ? void 0 : u.value);
|
|
126
|
+
K(() => {
|
|
127
|
+
var m, o, S;
|
|
128
|
+
((m = e.object) == null ? void 0 : m.value) !== d.current && (d.current = (o = e.object) == null ? void 0 : o.value, h(((S = e.object) == null ? void 0 : S.label) ?? ""));
|
|
129
|
+
}, [(c = e.object) == null ? void 0 : c.value, (g = e.object) == null ? void 0 : g.label]);
|
|
130
|
+
const n = M(
|
|
131
|
+
async (m, { signal: o }) => await t(m, { signal: o }),
|
|
132
132
|
[t]
|
|
133
|
-
),
|
|
133
|
+
), f = (m) => {
|
|
134
134
|
const o = {
|
|
135
|
-
value:
|
|
136
|
-
label:
|
|
137
|
-
description:
|
|
138
|
-
__payload:
|
|
135
|
+
value: m.value,
|
|
136
|
+
label: m.label,
|
|
137
|
+
description: m.description,
|
|
138
|
+
__payload: m.__payload
|
|
139
139
|
};
|
|
140
|
-
|
|
140
|
+
h(o.label), d.current = o.value, s({ ...e, object: o }), _("patient_search_object_selected", {
|
|
141
141
|
value: o.value,
|
|
142
142
|
type: o.__payload && typeof o.__payload == "object" ? o.__payload.type : void 0
|
|
143
143
|
}), i == null || i(o);
|
|
144
|
-
},
|
|
144
|
+
}, r = j(!1);
|
|
145
145
|
return /* @__PURE__ */ a(
|
|
146
146
|
"div",
|
|
147
147
|
{
|
|
148
148
|
"data-component": "patient-search-field",
|
|
149
149
|
"data-field": "who",
|
|
150
150
|
onFocus: () => {
|
|
151
|
-
|
|
151
|
+
r.current || (r.current = !0, _("patient_search_object_focused"));
|
|
152
152
|
},
|
|
153
|
-
onBlur: (
|
|
154
|
-
|
|
153
|
+
onBlur: (m) => {
|
|
154
|
+
m.currentTarget && !m.currentTarget.contains(m.relatedTarget) && (r.current = !1);
|
|
155
155
|
},
|
|
156
156
|
children: /* @__PURE__ */ a(
|
|
157
|
-
|
|
157
|
+
re,
|
|
158
158
|
{
|
|
159
159
|
ref: p,
|
|
160
|
-
value:
|
|
161
|
-
onChange: (
|
|
162
|
-
|
|
160
|
+
value: b,
|
|
161
|
+
onChange: (m) => {
|
|
162
|
+
h(m), e.object && m !== e.object.label && (d.current = void 0, s({ ...e, object: void 0 }));
|
|
163
163
|
},
|
|
164
|
-
onSelect:
|
|
165
|
-
loadOptions:
|
|
166
|
-
debounceMs:
|
|
164
|
+
onSelect: f,
|
|
165
|
+
loadOptions: n,
|
|
166
|
+
debounceMs: oe,
|
|
167
167
|
placeholder: v("patientSearch.who.placeholder"),
|
|
168
168
|
"aria-label": v("patientSearch.who.label"),
|
|
169
|
-
startAdornment: /* @__PURE__ */ a(
|
|
169
|
+
startAdornment: /* @__PURE__ */ a(ne, { "aria-hidden": "true" })
|
|
170
170
|
}
|
|
171
171
|
)
|
|
172
172
|
}
|
|
173
173
|
);
|
|
174
174
|
}
|
|
175
|
-
const
|
|
175
|
+
const ae = [
|
|
176
176
|
"ds:inline-flex ds:items-center ds:justify-center",
|
|
177
177
|
"ds:size-8 ds:rounded-[var(--radius-sm)]",
|
|
178
178
|
"ds:text-[color:var(--muted-foreground)] ds:hover:text-[color:var(--primary)]",
|
|
@@ -189,118 +189,124 @@ function q({
|
|
|
189
189
|
onChange: s,
|
|
190
190
|
loadPlaces: t,
|
|
191
191
|
onPlaceSelect: i,
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
192
|
+
allowTypedPlace: p,
|
|
193
|
+
inputRef: v,
|
|
194
|
+
defaultRadiusKm: b = J,
|
|
195
|
+
reverseGeocode: h
|
|
195
196
|
}) {
|
|
196
|
-
var
|
|
197
|
-
const { t:
|
|
198
|
-
|
|
199
|
-
var
|
|
200
|
-
((
|
|
201
|
-
}, [(
|
|
202
|
-
const
|
|
203
|
-
async (
|
|
197
|
+
var O, F, E, P;
|
|
198
|
+
const { t: d } = C("ui"), [n, f] = z(((O = e.place) == null ? void 0 : O.label) ?? ""), r = j((F = e.place) == null ? void 0 : F.value), l = e.geo ? "granted" : "pristine", [u, c] = z(l);
|
|
199
|
+
K(() => {
|
|
200
|
+
var y, x, N;
|
|
201
|
+
((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) ?? ""));
|
|
202
|
+
}, [(E = e.place) == null ? void 0 : E.value, (P = e.place) == null ? void 0 : P.label]);
|
|
203
|
+
const g = M(
|
|
204
|
+
async (y, { signal: x }) => await t(y, { signal: x }),
|
|
204
205
|
[t]
|
|
205
|
-
),
|
|
206
|
-
const
|
|
207
|
-
value:
|
|
208
|
-
label:
|
|
209
|
-
lat:
|
|
210
|
-
lng:
|
|
206
|
+
), m = (y) => {
|
|
207
|
+
const x = {
|
|
208
|
+
value: y.value,
|
|
209
|
+
label: y.label,
|
|
210
|
+
lat: y.lat,
|
|
211
|
+
lng: y.lng
|
|
211
212
|
};
|
|
212
|
-
|
|
213
|
-
},
|
|
213
|
+
f(x.label), r.current = x.value, s({ ...e, place: x, geo: void 0 }), u === "granted" && c("pristine"), _("patient_search_place_selected", { value: x.value }), i == null || i(x);
|
|
214
|
+
}, o = () => {
|
|
214
215
|
if (typeof window > "u" || !(navigator != null && navigator.geolocation)) {
|
|
215
|
-
|
|
216
|
+
c("denied"), _("patient_search_geo_denied", { reason: "unsupported" });
|
|
216
217
|
return;
|
|
217
218
|
}
|
|
218
|
-
|
|
219
|
-
async (
|
|
220
|
-
const { latitude:
|
|
221
|
-
let
|
|
219
|
+
c("requesting"), _("patient_search_place_focused"), navigator.geolocation.getCurrentPosition(
|
|
220
|
+
async (y) => {
|
|
221
|
+
const { latitude: x, longitude: N } = y.coords;
|
|
222
|
+
let k;
|
|
222
223
|
try {
|
|
223
|
-
|
|
224
|
+
k = await (h == null ? void 0 : h(x, N));
|
|
224
225
|
} catch {
|
|
225
|
-
|
|
226
|
+
k = void 0;
|
|
226
227
|
}
|
|
227
|
-
const
|
|
228
|
-
value: `geo:${
|
|
229
|
-
label:
|
|
230
|
-
lat:
|
|
231
|
-
lng:
|
|
228
|
+
const R = b, V = k ?? d("patientSearch.geo.fallbackLabel"), de = {
|
|
229
|
+
value: `geo:${x.toFixed(4)},${N.toFixed(4)}`,
|
|
230
|
+
label: V,
|
|
231
|
+
lat: x,
|
|
232
|
+
lng: N
|
|
232
233
|
};
|
|
233
234
|
s({
|
|
234
235
|
...e,
|
|
235
|
-
place:
|
|
236
|
+
place: de,
|
|
236
237
|
geo: {
|
|
237
|
-
lat:
|
|
238
|
-
lng:
|
|
239
|
-
radiusKm:
|
|
240
|
-
label:
|
|
238
|
+
lat: x,
|
|
239
|
+
lng: N,
|
|
240
|
+
radiusKm: R,
|
|
241
|
+
label: V
|
|
241
242
|
}
|
|
242
|
-
}),
|
|
243
|
+
}), c("granted"), _("patient_search_geo_granted", { radiusKm: R });
|
|
243
244
|
},
|
|
244
245
|
() => {
|
|
245
|
-
|
|
246
|
+
c("denied"), _("patient_search_geo_denied", { reason: "user" });
|
|
246
247
|
},
|
|
247
248
|
{ enableHighAccuracy: !1, maximumAge: 6e4, timeout: 1e4 }
|
|
248
249
|
);
|
|
249
|
-
},
|
|
250
|
-
s({ ...e, geo: void 0, place: void 0 }),
|
|
251
|
-
},
|
|
252
|
-
|
|
250
|
+
}, S = () => {
|
|
251
|
+
s({ ...e, geo: void 0, place: void 0 }), f(""), r.current = void 0, c("pristine");
|
|
252
|
+
}, A = u === "granted" && !!e.geo, Q = u === "requesting", D = u === "denied", I = j(!1), X = 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: [
|
|
253
|
+
A ? /* @__PURE__ */ a(
|
|
253
254
|
"button",
|
|
254
255
|
{
|
|
255
256
|
type: "button",
|
|
256
|
-
"aria-label":
|
|
257
|
-
onClick:
|
|
258
|
-
className:
|
|
259
|
-
children: /* @__PURE__ */ a(
|
|
257
|
+
"aria-label": d("patientSearch.geo.clear"),
|
|
258
|
+
onClick: S,
|
|
259
|
+
className: ae,
|
|
260
|
+
children: /* @__PURE__ */ a(ie, { "aria-hidden": "true", className: "ds:size-4" })
|
|
260
261
|
}
|
|
261
262
|
) : null,
|
|
262
263
|
/* @__PURE__ */ a(
|
|
263
264
|
"button",
|
|
264
265
|
{
|
|
265
266
|
type: "button",
|
|
266
|
-
"aria-label":
|
|
267
|
-
"aria-pressed":
|
|
268
|
-
disabled:
|
|
269
|
-
onClick:
|
|
270
|
-
className:
|
|
267
|
+
"aria-label": d("patientSearch.geo.cta"),
|
|
268
|
+
"aria-pressed": A || void 0,
|
|
269
|
+
disabled: Q,
|
|
270
|
+
onClick: A ? S : o,
|
|
271
|
+
className: ae,
|
|
271
272
|
children: /* @__PURE__ */ a(xe, { "aria-hidden": "true", className: "ds:size-4" })
|
|
272
273
|
}
|
|
273
274
|
)
|
|
274
275
|
] });
|
|
275
|
-
return /* @__PURE__ */
|
|
276
|
+
return /* @__PURE__ */ w(
|
|
276
277
|
"div",
|
|
277
278
|
{
|
|
278
279
|
"data-component": "patient-search-field",
|
|
279
280
|
"data-field": "where",
|
|
280
281
|
onFocus: () => {
|
|
281
|
-
|
|
282
|
+
I.current || (I.current = !0, _("patient_search_place_focused"));
|
|
282
283
|
},
|
|
283
|
-
onBlur: (
|
|
284
|
-
|
|
284
|
+
onBlur: (y) => {
|
|
285
|
+
y.currentTarget && !y.currentTarget.contains(y.relatedTarget) && (I.current = !1);
|
|
285
286
|
},
|
|
286
287
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
287
288
|
children: [
|
|
288
|
-
/* @__PURE__ */
|
|
289
|
+
/* @__PURE__ */ w("div", { className: "ds:relative", children: [
|
|
289
290
|
/* @__PURE__ */ a(
|
|
290
|
-
|
|
291
|
+
re,
|
|
291
292
|
{
|
|
292
|
-
ref:
|
|
293
|
-
value:
|
|
294
|
-
onChange: (
|
|
295
|
-
|
|
293
|
+
ref: v,
|
|
294
|
+
value: n,
|
|
295
|
+
onChange: (y) => {
|
|
296
|
+
var x, N;
|
|
297
|
+
if (f(y), (p || e.place) && y !== ((x = e.place) == null ? void 0 : x.label)) {
|
|
298
|
+
const k = y.trim(), R = p && k ? { value: `text:${k}`, label: k } : void 0;
|
|
299
|
+
if (r.current = R == null ? void 0 : R.value, (R == null ? void 0 : R.value) === ((N = e.place) == null ? void 0 : N.value) && !e.geo) return;
|
|
300
|
+
s({ ...e, place: R, geo: void 0 }), u === "granted" && c("pristine");
|
|
301
|
+
}
|
|
296
302
|
},
|
|
297
|
-
onSelect:
|
|
298
|
-
loadOptions:
|
|
299
|
-
debounceMs:
|
|
300
|
-
placeholder:
|
|
301
|
-
"aria-label":
|
|
302
|
-
startAdornment: /* @__PURE__ */ a(
|
|
303
|
-
endAdornment:
|
|
303
|
+
onSelect: m,
|
|
304
|
+
loadOptions: g,
|
|
305
|
+
debounceMs: oe,
|
|
306
|
+
placeholder: d("patientSearch.where.placeholder"),
|
|
307
|
+
"aria-label": d("patientSearch.where.label"),
|
|
308
|
+
startAdornment: /* @__PURE__ */ a(ve, { "aria-hidden": "true" }),
|
|
309
|
+
endAdornment: D ? void 0 : (
|
|
304
310
|
// Decorative spacer — reserves inline-end room so the typed
|
|
305
311
|
// text doesn't run under the absolutely-positioned overlay.
|
|
306
312
|
// Autocomplete wraps endAdornment in `aria-hidden`, which is
|
|
@@ -310,44 +316,44 @@ function q({
|
|
|
310
316
|
"span",
|
|
311
317
|
{
|
|
312
318
|
"aria-hidden": "true",
|
|
313
|
-
className:
|
|
319
|
+
className: A ? "ds:inline-block ds:size-[4.5rem]" : "ds:inline-block ds:size-8"
|
|
314
320
|
}
|
|
315
321
|
)
|
|
316
322
|
)
|
|
317
323
|
}
|
|
318
324
|
),
|
|
319
|
-
|
|
325
|
+
X
|
|
320
326
|
] }),
|
|
321
|
-
|
|
327
|
+
D ? (
|
|
322
328
|
// Alert defaults to `role="status"` + `aria-live="polite"` for the
|
|
323
329
|
// `info` variant — the user hears why the field reverted to plain
|
|
324
330
|
// text when their browser blocked the geolocation prompt.
|
|
325
|
-
/* @__PURE__ */ a(
|
|
331
|
+
/* @__PURE__ */ a(ee, { variant: "info", children: /* @__PURE__ */ a(ee.Description, { children: d("patientSearch.geo.denied") }) })
|
|
326
332
|
) : null
|
|
327
333
|
]
|
|
328
334
|
}
|
|
329
335
|
);
|
|
330
336
|
}
|
|
331
|
-
function
|
|
337
|
+
function U({
|
|
332
338
|
value: e,
|
|
333
339
|
onChange: s,
|
|
334
|
-
defaultRadiusKm: t =
|
|
340
|
+
defaultRadiusKm: t = J
|
|
335
341
|
}) {
|
|
336
|
-
const { t: i } =
|
|
342
|
+
const { t: i } = C("ui"), [p, v] = z(
|
|
337
343
|
() => {
|
|
338
|
-
var
|
|
339
|
-
return
|
|
344
|
+
var d;
|
|
345
|
+
return _e(((d = e.geo) == null ? void 0 : d.radiusKm) ?? t);
|
|
340
346
|
}
|
|
341
347
|
);
|
|
342
348
|
if (!e.geo) return null;
|
|
343
|
-
const
|
|
344
|
-
const
|
|
345
|
-
s({ ...e, geo: { ...e.geo, radiusKm:
|
|
346
|
-
},
|
|
347
|
-
const
|
|
348
|
-
return i("patientSearch.geo.radiusFormat", { km:
|
|
349
|
+
const b = (d) => {
|
|
350
|
+
const n = B[d] ?? t;
|
|
351
|
+
s({ ...e, geo: { ...e.geo, radiusKm: n } }), _("patient_search_radius_changed", { radiusKm: n });
|
|
352
|
+
}, h = (d) => {
|
|
353
|
+
const n = B[Math.round(d)] ?? t;
|
|
354
|
+
return i("patientSearch.geo.radiusFormat", { km: n });
|
|
349
355
|
};
|
|
350
|
-
return /* @__PURE__ */
|
|
356
|
+
return /* @__PURE__ */ w(
|
|
351
357
|
"div",
|
|
352
358
|
{
|
|
353
359
|
"data-component": "patient-search-geo-radius-bar",
|
|
@@ -362,28 +368,28 @@ function $({
|
|
|
362
368
|
}
|
|
363
369
|
),
|
|
364
370
|
/* @__PURE__ */ a(
|
|
365
|
-
|
|
371
|
+
pe,
|
|
366
372
|
{
|
|
367
373
|
value: [p],
|
|
368
374
|
min: 0,
|
|
369
|
-
max:
|
|
375
|
+
max: B.length - 1,
|
|
370
376
|
step: 1,
|
|
371
|
-
marks:
|
|
372
|
-
value:
|
|
373
|
-
label: `${
|
|
377
|
+
marks: B.map((d, n) => ({
|
|
378
|
+
value: n,
|
|
379
|
+
label: `${d}`
|
|
374
380
|
})),
|
|
375
|
-
formatValue:
|
|
381
|
+
formatValue: h,
|
|
376
382
|
alwaysShowValue: !0,
|
|
377
383
|
"aria-labelledby": "patient-search-radius-label",
|
|
378
|
-
onValueChange: (
|
|
379
|
-
onValueCommit: (
|
|
384
|
+
onValueChange: (d) => v(d[0] ?? 0),
|
|
385
|
+
onValueCommit: (d) => b(d[0] ?? 0)
|
|
380
386
|
}
|
|
381
387
|
)
|
|
382
388
|
]
|
|
383
389
|
}
|
|
384
390
|
);
|
|
385
391
|
}
|
|
386
|
-
const
|
|
392
|
+
const Ne = L(
|
|
387
393
|
[
|
|
388
394
|
"ds:inline-flex ds:items-center ds:justify-center",
|
|
389
395
|
"ds:min-h-[var(--min-target-size)]",
|
|
@@ -406,44 +412,44 @@ const Se = T(
|
|
|
406
412
|
defaultVariants: { state: "idle" }
|
|
407
413
|
}
|
|
408
414
|
);
|
|
409
|
-
function
|
|
410
|
-
const { t, i18n: i } =
|
|
411
|
-
var
|
|
412
|
-
(
|
|
413
|
-
}, []),
|
|
414
|
-
(
|
|
415
|
-
const
|
|
416
|
-
switch (
|
|
417
|
-
case
|
|
415
|
+
function ke({ value: e, onChange: s }) {
|
|
416
|
+
const { t, i18n: i } = C("ui"), p = ue(), v = i.dir() === "rtl", b = j(/* @__PURE__ */ new Map()), h = M((r) => {
|
|
417
|
+
var l;
|
|
418
|
+
(l = b.current.get(r)) == null || l.focus();
|
|
419
|
+
}, []), d = M(
|
|
420
|
+
(r, l) => {
|
|
421
|
+
const u = T.indexOf(l), c = T.length, g = v ? "ArrowLeft" : "ArrowRight", m = v ? "ArrowRight" : "ArrowLeft";
|
|
422
|
+
switch (r.key) {
|
|
423
|
+
case g:
|
|
418
424
|
case "ArrowDown": {
|
|
419
|
-
|
|
420
|
-
const o =
|
|
421
|
-
s(o), _("patient_search_when_selected", { when: o }),
|
|
425
|
+
r.preventDefault();
|
|
426
|
+
const o = T[(u + 1) % c];
|
|
427
|
+
s(o), _("patient_search_when_selected", { when: o }), h(o);
|
|
422
428
|
break;
|
|
423
429
|
}
|
|
424
|
-
case
|
|
430
|
+
case m:
|
|
425
431
|
case "ArrowUp": {
|
|
426
|
-
|
|
427
|
-
const o =
|
|
428
|
-
s(o), _("patient_search_when_selected", { when: o }),
|
|
432
|
+
r.preventDefault();
|
|
433
|
+
const o = T[(u - 1 + c) % c];
|
|
434
|
+
s(o), _("patient_search_when_selected", { when: o }), h(o);
|
|
429
435
|
break;
|
|
430
436
|
}
|
|
431
437
|
case "Home": {
|
|
432
|
-
|
|
433
|
-
const o =
|
|
434
|
-
s(o), _("patient_search_when_selected", { when: o }),
|
|
438
|
+
r.preventDefault();
|
|
439
|
+
const o = T[0];
|
|
440
|
+
s(o), _("patient_search_when_selected", { when: o }), h(o);
|
|
435
441
|
break;
|
|
436
442
|
}
|
|
437
443
|
case "End": {
|
|
438
|
-
|
|
439
|
-
const o =
|
|
440
|
-
s(o), _("patient_search_when_selected", { when: o }),
|
|
444
|
+
r.preventDefault();
|
|
445
|
+
const o = T[c - 1];
|
|
446
|
+
s(o), _("patient_search_when_selected", { when: o }), h(o);
|
|
441
447
|
break;
|
|
442
448
|
}
|
|
443
449
|
}
|
|
444
450
|
},
|
|
445
|
-
[
|
|
446
|
-
),
|
|
451
|
+
[h, v, s]
|
|
452
|
+
), n = e ?? "anytime", f = {
|
|
447
453
|
today: "patientSearch.when.today",
|
|
448
454
|
tomorrow: "patientSearch.when.tomorrow",
|
|
449
455
|
this_week: "patientSearch.when.thisWeek",
|
|
@@ -456,35 +462,35 @@ function Ne({ value: e, onChange: s }) {
|
|
|
456
462
|
"aria-label": t("patientSearch.when.label"),
|
|
457
463
|
id: p,
|
|
458
464
|
className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
459
|
-
children:
|
|
460
|
-
const
|
|
465
|
+
children: T.map((r) => {
|
|
466
|
+
const l = e === r, u = n === r, c = t(f[r]);
|
|
461
467
|
return /* @__PURE__ */ a(
|
|
462
468
|
"button",
|
|
463
469
|
{
|
|
464
470
|
type: "button",
|
|
465
471
|
role: "radio",
|
|
466
|
-
"aria-checked":
|
|
467
|
-
"aria-label":
|
|
468
|
-
tabIndex:
|
|
469
|
-
ref: (
|
|
470
|
-
|
|
472
|
+
"aria-checked": l,
|
|
473
|
+
"aria-label": c,
|
|
474
|
+
tabIndex: u ? 0 : -1,
|
|
475
|
+
ref: (g) => {
|
|
476
|
+
g ? b.current.set(r, g) : b.current.delete(r);
|
|
471
477
|
},
|
|
472
478
|
onClick: () => {
|
|
473
|
-
s(
|
|
479
|
+
s(r), _("patient_search_when_selected", { when: r });
|
|
474
480
|
},
|
|
475
|
-
onKeyDown: (
|
|
476
|
-
className:
|
|
477
|
-
state:
|
|
481
|
+
onKeyDown: (g) => d(g, r),
|
|
482
|
+
className: Ne({
|
|
483
|
+
state: l ? "selected" : "idle"
|
|
478
484
|
}),
|
|
479
|
-
children:
|
|
485
|
+
children: c
|
|
480
486
|
},
|
|
481
|
-
|
|
487
|
+
r
|
|
482
488
|
);
|
|
483
489
|
})
|
|
484
490
|
}
|
|
485
491
|
);
|
|
486
492
|
}
|
|
487
|
-
const
|
|
493
|
+
const te = L(
|
|
488
494
|
[
|
|
489
495
|
"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
490
496
|
"ds:min-h-[var(--min-target-size)]",
|
|
@@ -514,63 +520,63 @@ const ae = T(
|
|
|
514
520
|
defaultVariants: { state: "idle" }
|
|
515
521
|
}
|
|
516
522
|
);
|
|
517
|
-
function
|
|
518
|
-
const { t: i } =
|
|
519
|
-
() => Object.values(p).some((
|
|
523
|
+
function Re({ facets: e, value: s, onChange: t }) {
|
|
524
|
+
const { t: i } = C("ui"), p = Y(() => s ?? {}, [s]), v = Y(
|
|
525
|
+
() => Object.values(p).some((n) => n && n.length > 0),
|
|
520
526
|
[p]
|
|
521
|
-
),
|
|
522
|
-
const
|
|
523
|
-
|
|
524
|
-
},
|
|
525
|
-
var
|
|
526
|
-
const
|
|
527
|
-
|
|
528
|
-
},
|
|
529
|
-
const
|
|
530
|
-
let
|
|
531
|
-
|
|
527
|
+
), b = (n, f) => {
|
|
528
|
+
const r = { ...p };
|
|
529
|
+
f.length === 0 ? delete r[n] : r[n] = f, t(r), _("patient_search_facet_changed", { key: n, values: f });
|
|
530
|
+
}, h = (n) => {
|
|
531
|
+
var r;
|
|
532
|
+
const f = (((r = p[n]) == null ? void 0 : r.length) ?? 0) > 0;
|
|
533
|
+
b(n, f ? [] : ["true"]);
|
|
534
|
+
}, d = (n, f) => {
|
|
535
|
+
const r = p[n.key] ?? [], l = r.includes(f);
|
|
536
|
+
let u;
|
|
537
|
+
n.multi ? u = l ? r.filter((c) => c !== f) : [...r, f] : u = l ? [] : [f], b(n.key, u);
|
|
532
538
|
};
|
|
533
|
-
return /* @__PURE__ */
|
|
539
|
+
return /* @__PURE__ */ w(
|
|
534
540
|
"div",
|
|
535
541
|
{
|
|
536
542
|
role: "group",
|
|
537
543
|
"aria-label": i("patientSearch.facets.label"),
|
|
538
544
|
className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
539
545
|
children: [
|
|
540
|
-
e.map((
|
|
541
|
-
const
|
|
542
|
-
if (
|
|
546
|
+
e.map((n) => {
|
|
547
|
+
const f = n.options.length === 0, r = p[n.key] ?? [], l = r.length > 0;
|
|
548
|
+
if (f)
|
|
543
549
|
return /* @__PURE__ */ a(
|
|
544
550
|
"button",
|
|
545
551
|
{
|
|
546
552
|
type: "button",
|
|
547
|
-
"aria-pressed":
|
|
548
|
-
"aria-label":
|
|
549
|
-
onClick: () =>
|
|
550
|
-
className:
|
|
551
|
-
state:
|
|
553
|
+
"aria-pressed": l,
|
|
554
|
+
"aria-label": n.label,
|
|
555
|
+
onClick: () => h(n.key),
|
|
556
|
+
className: te({
|
|
557
|
+
state: l ? "active" : "idle"
|
|
552
558
|
}),
|
|
553
|
-
children: /* @__PURE__ */ a("span", { children:
|
|
559
|
+
children: /* @__PURE__ */ a("span", { children: n.label })
|
|
554
560
|
},
|
|
555
|
-
|
|
561
|
+
n.key
|
|
556
562
|
);
|
|
557
|
-
const
|
|
558
|
-
return /* @__PURE__ */
|
|
559
|
-
/* @__PURE__ */ a(
|
|
563
|
+
const u = l ? ` (${r.length})` : "";
|
|
564
|
+
return /* @__PURE__ */ w(W.Root, { children: [
|
|
565
|
+
/* @__PURE__ */ a(W.Trigger, { asChild: !0, children: /* @__PURE__ */ w(
|
|
560
566
|
"button",
|
|
561
567
|
{
|
|
562
568
|
type: "button",
|
|
563
|
-
"aria-label": `${
|
|
564
|
-
className:
|
|
565
|
-
state:
|
|
569
|
+
"aria-label": `${n.label}${u}`,
|
|
570
|
+
className: te({
|
|
571
|
+
state: l ? "active" : "idle"
|
|
566
572
|
}),
|
|
567
573
|
children: [
|
|
568
|
-
/* @__PURE__ */
|
|
569
|
-
|
|
570
|
-
|
|
574
|
+
/* @__PURE__ */ w("span", { children: [
|
|
575
|
+
n.label,
|
|
576
|
+
u
|
|
571
577
|
] }),
|
|
572
578
|
/* @__PURE__ */ a(
|
|
573
|
-
|
|
579
|
+
be,
|
|
574
580
|
{
|
|
575
581
|
"aria-hidden": "true",
|
|
576
582
|
className: "ds:size-3.5 ds:shrink-0"
|
|
@@ -579,20 +585,20 @@ function ke({ facets: e, value: s, onChange: t }) {
|
|
|
579
585
|
]
|
|
580
586
|
}
|
|
581
587
|
) }),
|
|
582
|
-
/* @__PURE__ */ a(
|
|
583
|
-
|
|
588
|
+
/* @__PURE__ */ a(W.Content, { sideOffset: 8, align: "start", children: n.options.map((c) => /* @__PURE__ */ a(
|
|
589
|
+
W.CheckboxItem,
|
|
584
590
|
{
|
|
585
|
-
checked:
|
|
586
|
-
onSelect: (
|
|
587
|
-
|
|
591
|
+
checked: r.includes(c.value),
|
|
592
|
+
onSelect: (g) => {
|
|
593
|
+
n.multi && g.preventDefault(), d(n, c.value);
|
|
588
594
|
},
|
|
589
|
-
children:
|
|
595
|
+
children: c.label
|
|
590
596
|
},
|
|
591
|
-
|
|
597
|
+
c.value
|
|
592
598
|
)) })
|
|
593
|
-
] },
|
|
599
|
+
] }, n.key);
|
|
594
600
|
}),
|
|
595
|
-
v ? /* @__PURE__ */
|
|
601
|
+
v ? /* @__PURE__ */ w(
|
|
596
602
|
"button",
|
|
597
603
|
{
|
|
598
604
|
type: "button",
|
|
@@ -609,7 +615,7 @@ function ke({ facets: e, value: s, onChange: t }) {
|
|
|
609
615
|
"ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]"
|
|
610
616
|
].join(" "),
|
|
611
617
|
children: [
|
|
612
|
-
/* @__PURE__ */ a(
|
|
618
|
+
/* @__PURE__ */ a(ie, { "aria-hidden": "true", className: "ds:size-3.5" }),
|
|
613
619
|
i("patientSearch.facets.clear")
|
|
614
620
|
]
|
|
615
621
|
}
|
|
@@ -618,7 +624,7 @@ function ke({ facets: e, value: s, onChange: t }) {
|
|
|
618
624
|
}
|
|
619
625
|
);
|
|
620
626
|
}
|
|
621
|
-
const
|
|
627
|
+
const se = ["violet", "purple", "magenta", "blue"], je = L(
|
|
622
628
|
[
|
|
623
629
|
"ds:relative ds:flex ds:h-full ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
624
630
|
"ds:rounded-[var(--radius-lg)] ds:overflow-hidden",
|
|
@@ -634,7 +640,7 @@ const te = ["violet", "purple", "magenta", "blue"], Re = T(
|
|
|
634
640
|
"ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
635
641
|
"ds:no-underline"
|
|
636
642
|
].join(" ")
|
|
637
|
-
),
|
|
643
|
+
), Ae = L(
|
|
638
644
|
// `inset-x-0` compiles to logical `inset-inline`; the `inset-inline-0`
|
|
639
645
|
// spelling is not a Tailwind utility and compiled to nothing.
|
|
640
646
|
"ds:absolute ds:inset-x-0 ds:top-0 ds:h-[3px] ds:pointer-events-none",
|
|
@@ -649,7 +655,7 @@ const te = ["violet", "purple", "magenta", "blue"], Re = T(
|
|
|
649
655
|
},
|
|
650
656
|
defaultVariants: { accent: "violet" }
|
|
651
657
|
}
|
|
652
|
-
),
|
|
658
|
+
), Ce = L(
|
|
653
659
|
"ds:inline-flex ds:size-9 ds:items-center ds:justify-center ds:rounded-[var(--radius-md)]",
|
|
654
660
|
{
|
|
655
661
|
variants: {
|
|
@@ -663,12 +669,12 @@ const te = ["violet", "purple", "magenta", "blue"], Re = T(
|
|
|
663
669
|
defaultVariants: { accent: "violet" }
|
|
664
670
|
}
|
|
665
671
|
);
|
|
666
|
-
function
|
|
667
|
-
return e && e !== "auto" ? e :
|
|
672
|
+
function Te(e, s) {
|
|
673
|
+
return e && e !== "auto" ? e : se[s % se.length];
|
|
668
674
|
}
|
|
669
675
|
function Ee({ cards: e }) {
|
|
670
|
-
const { t: s } =
|
|
671
|
-
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__ */
|
|
676
|
+
const { t: s } = C("ui");
|
|
677
|
+
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: [
|
|
672
678
|
/* @__PURE__ */ a("h3", { className: "type-title-card ds:text-[var(--foreground)] ds:m-0", children: s("patientSearch.discovery.heading") }),
|
|
673
679
|
/* @__PURE__ */ a(
|
|
674
680
|
"ul",
|
|
@@ -679,8 +685,8 @@ function Ee({ cards: e }) {
|
|
|
679
685
|
"ds:m-0 ds:p-0 ds:list-none"
|
|
680
686
|
].join(" "),
|
|
681
687
|
children: e.map((t, i) => {
|
|
682
|
-
const p =
|
|
683
|
-
return /* @__PURE__ */ a("li", { children: /* @__PURE__ */
|
|
688
|
+
const p = Te(t.accent, i);
|
|
689
|
+
return /* @__PURE__ */ a("li", { children: /* @__PURE__ */ w(
|
|
684
690
|
"a",
|
|
685
691
|
{
|
|
686
692
|
href: t.href,
|
|
@@ -690,22 +696,22 @@ function Ee({ cards: e }) {
|
|
|
690
696
|
onClick: () => _("patient_search_discovery_card_clicked", {
|
|
691
697
|
cardId: t.id
|
|
692
698
|
}),
|
|
693
|
-
className:
|
|
699
|
+
className: je(),
|
|
694
700
|
children: [
|
|
695
701
|
/* @__PURE__ */ a(
|
|
696
702
|
"span",
|
|
697
703
|
{
|
|
698
704
|
"aria-hidden": "true",
|
|
699
|
-
className:
|
|
705
|
+
className: Ae({ accent: p })
|
|
700
706
|
}
|
|
701
707
|
),
|
|
702
|
-
/* @__PURE__ */
|
|
708
|
+
/* @__PURE__ */ w("span", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
|
|
703
709
|
/* @__PURE__ */ a(
|
|
704
710
|
"span",
|
|
705
711
|
{
|
|
706
712
|
"aria-hidden": "true",
|
|
707
|
-
className:
|
|
708
|
-
children: t.icon ?? /* @__PURE__ */ a(
|
|
713
|
+
className: Ce({ accent: p }),
|
|
714
|
+
children: t.icon ?? /* @__PURE__ */ a(ge, { className: "ds:size-4", "aria-hidden": "true" })
|
|
709
715
|
}
|
|
710
716
|
),
|
|
711
717
|
t.badge ? (
|
|
@@ -729,7 +735,7 @@ function Ee({ cards: e }) {
|
|
|
729
735
|
)
|
|
730
736
|
] });
|
|
731
737
|
}
|
|
732
|
-
function
|
|
738
|
+
function Pe(e) {
|
|
733
739
|
if (e.object || e.place || e.geo || e.when && e.when !== "anytime") return !0;
|
|
734
740
|
if (e.facets) {
|
|
735
741
|
for (const s of Object.values(e.facets))
|
|
@@ -737,7 +743,7 @@ function Te(e) {
|
|
|
737
743
|
}
|
|
738
744
|
return !1;
|
|
739
745
|
}
|
|
740
|
-
function
|
|
746
|
+
function G({
|
|
741
747
|
value: e,
|
|
742
748
|
variant: s,
|
|
743
749
|
submitting: t,
|
|
@@ -745,16 +751,16 @@ function U({
|
|
|
745
751
|
allowEmptySubmit: p,
|
|
746
752
|
onSubmit: v
|
|
747
753
|
}) {
|
|
748
|
-
const { t:
|
|
754
|
+
const { t: b } = C("ui"), h = !t && !p && !Pe(e), d = i ?? b("patientSearch.submit.cta");
|
|
749
755
|
return /* @__PURE__ */ a(
|
|
750
|
-
|
|
756
|
+
fe,
|
|
751
757
|
{
|
|
752
758
|
type: "button",
|
|
753
759
|
intent: "primary",
|
|
754
760
|
size: "lg",
|
|
755
|
-
startIcon: /* @__PURE__ */ a(
|
|
761
|
+
startIcon: /* @__PURE__ */ a(ne, { "aria-hidden": "true" }),
|
|
756
762
|
loading: t,
|
|
757
|
-
disabled:
|
|
763
|
+
disabled: h,
|
|
758
764
|
onClick: () => {
|
|
759
765
|
_("patient_search_submitted", {
|
|
760
766
|
variant: s,
|
|
@@ -765,7 +771,7 @@ function U({
|
|
|
765
771
|
facetKeys: e.facets ? Object.keys(e.facets) : []
|
|
766
772
|
}), v(e);
|
|
767
773
|
},
|
|
768
|
-
children:
|
|
774
|
+
children: d
|
|
769
775
|
}
|
|
770
776
|
);
|
|
771
777
|
}
|
|
@@ -776,28 +782,29 @@ function Le(e) {
|
|
|
776
782
|
onChange: i,
|
|
777
783
|
onSubmit: p,
|
|
778
784
|
loadObjects: v,
|
|
779
|
-
loadPlaces:
|
|
780
|
-
onObjectSelect:
|
|
781
|
-
onPlaceSelect:
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
785
|
+
loadPlaces: b,
|
|
786
|
+
onObjectSelect: h,
|
|
787
|
+
onPlaceSelect: d,
|
|
788
|
+
allowTypedPlace: n,
|
|
789
|
+
submitting: f,
|
|
790
|
+
submitLabel: r,
|
|
791
|
+
allowEmptySubmit: l,
|
|
792
|
+
whoRef: u,
|
|
793
|
+
whereRef: c,
|
|
794
|
+
defaultRadiusKm: g,
|
|
795
|
+
reverseGeocode: m,
|
|
796
|
+
cardLabel: o
|
|
790
797
|
} = e;
|
|
791
|
-
return /* @__PURE__ */ a(
|
|
792
|
-
/* @__PURE__ */
|
|
798
|
+
return /* @__PURE__ */ a(H, { 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: [
|
|
799
|
+
/* @__PURE__ */ w("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:md:flex-row ds:md:items-start", children: [
|
|
793
800
|
/* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
|
|
794
|
-
|
|
801
|
+
$,
|
|
795
802
|
{
|
|
796
803
|
value: t,
|
|
797
804
|
onChange: i,
|
|
798
805
|
loadObjects: v,
|
|
799
|
-
onObjectSelect:
|
|
800
|
-
inputRef:
|
|
806
|
+
onObjectSelect: h,
|
|
807
|
+
inputRef: u
|
|
801
808
|
}
|
|
802
809
|
) }),
|
|
803
810
|
/* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
|
|
@@ -805,31 +812,32 @@ function Le(e) {
|
|
|
805
812
|
{
|
|
806
813
|
value: t,
|
|
807
814
|
onChange: i,
|
|
808
|
-
loadPlaces:
|
|
809
|
-
onPlaceSelect:
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
815
|
+
loadPlaces: b,
|
|
816
|
+
onPlaceSelect: d,
|
|
817
|
+
allowTypedPlace: n,
|
|
818
|
+
defaultRadiusKm: g,
|
|
819
|
+
reverseGeocode: m,
|
|
820
|
+
inputRef: c
|
|
813
821
|
}
|
|
814
822
|
) }),
|
|
815
823
|
/* @__PURE__ */ a(
|
|
816
|
-
|
|
824
|
+
G,
|
|
817
825
|
{
|
|
818
826
|
value: t,
|
|
819
827
|
variant: s,
|
|
820
|
-
submitting:
|
|
821
|
-
submitLabel:
|
|
822
|
-
allowEmptySubmit:
|
|
828
|
+
submitting: f,
|
|
829
|
+
submitLabel: r,
|
|
830
|
+
allowEmptySubmit: l,
|
|
823
831
|
onSubmit: p
|
|
824
832
|
}
|
|
825
833
|
)
|
|
826
834
|
] }),
|
|
827
835
|
/* @__PURE__ */ a(
|
|
828
|
-
|
|
836
|
+
U,
|
|
829
837
|
{
|
|
830
838
|
value: t,
|
|
831
839
|
onChange: i,
|
|
832
|
-
defaultRadiusKm:
|
|
840
|
+
defaultRadiusKm: g
|
|
833
841
|
}
|
|
834
842
|
)
|
|
835
843
|
] }) });
|
|
@@ -841,28 +849,29 @@ function De(e) {
|
|
|
841
849
|
onChange: i,
|
|
842
850
|
onSubmit: p,
|
|
843
851
|
loadObjects: v,
|
|
844
|
-
loadPlaces:
|
|
845
|
-
onObjectSelect:
|
|
846
|
-
onPlaceSelect:
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
852
|
+
loadPlaces: b,
|
|
853
|
+
onObjectSelect: h,
|
|
854
|
+
onPlaceSelect: d,
|
|
855
|
+
allowTypedPlace: n,
|
|
856
|
+
submitting: f,
|
|
857
|
+
submitLabel: r,
|
|
858
|
+
allowEmptySubmit: l,
|
|
859
|
+
whoRef: u,
|
|
860
|
+
whereRef: c,
|
|
861
|
+
defaultRadiusKm: g,
|
|
862
|
+
reverseGeocode: m,
|
|
863
|
+
cardLabel: o
|
|
855
864
|
} = e;
|
|
856
|
-
return /* @__PURE__ */ a(
|
|
857
|
-
/* @__PURE__ */
|
|
865
|
+
return /* @__PURE__ */ a(H, { 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: [
|
|
866
|
+
/* @__PURE__ */ w("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:md:flex-row ds:md:items-start", children: [
|
|
858
867
|
/* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
|
|
859
|
-
|
|
868
|
+
$,
|
|
860
869
|
{
|
|
861
870
|
value: t,
|
|
862
871
|
onChange: i,
|
|
863
872
|
loadObjects: v,
|
|
864
|
-
onObjectSelect:
|
|
865
|
-
inputRef:
|
|
873
|
+
onObjectSelect: h,
|
|
874
|
+
inputRef: u
|
|
866
875
|
}
|
|
867
876
|
) }),
|
|
868
877
|
/* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
|
|
@@ -870,72 +879,74 @@ function De(e) {
|
|
|
870
879
|
{
|
|
871
880
|
value: t,
|
|
872
881
|
onChange: i,
|
|
873
|
-
loadPlaces:
|
|
874
|
-
onPlaceSelect:
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
882
|
+
loadPlaces: b,
|
|
883
|
+
onPlaceSelect: d,
|
|
884
|
+
allowTypedPlace: n,
|
|
885
|
+
defaultRadiusKm: g,
|
|
886
|
+
reverseGeocode: m,
|
|
887
|
+
inputRef: c
|
|
878
888
|
}
|
|
879
889
|
) }),
|
|
880
890
|
/* @__PURE__ */ a(
|
|
881
|
-
|
|
891
|
+
G,
|
|
882
892
|
{
|
|
883
893
|
value: t,
|
|
884
894
|
variant: s,
|
|
885
|
-
submitting:
|
|
886
|
-
submitLabel:
|
|
887
|
-
allowEmptySubmit:
|
|
895
|
+
submitting: f,
|
|
896
|
+
submitLabel: r,
|
|
897
|
+
allowEmptySubmit: l,
|
|
888
898
|
onSubmit: p
|
|
889
899
|
}
|
|
890
900
|
)
|
|
891
901
|
] }),
|
|
892
902
|
/* @__PURE__ */ a(
|
|
893
|
-
|
|
903
|
+
U,
|
|
894
904
|
{
|
|
895
905
|
value: t,
|
|
896
906
|
onChange: i,
|
|
897
|
-
defaultRadiusKm:
|
|
907
|
+
defaultRadiusKm: g
|
|
898
908
|
}
|
|
899
909
|
),
|
|
900
910
|
/* @__PURE__ */ a(
|
|
901
|
-
|
|
911
|
+
ke,
|
|
902
912
|
{
|
|
903
913
|
value: t.when,
|
|
904
|
-
onChange: (
|
|
914
|
+
onChange: (S) => i({ ...t, when: S })
|
|
905
915
|
}
|
|
906
916
|
)
|
|
907
917
|
] }) });
|
|
908
918
|
}
|
|
909
|
-
function
|
|
919
|
+
function Ie(e) {
|
|
910
920
|
const {
|
|
911
921
|
variant: s,
|
|
912
922
|
value: t,
|
|
913
923
|
onChange: i,
|
|
914
924
|
onSubmit: p,
|
|
915
925
|
loadObjects: v,
|
|
916
|
-
loadPlaces:
|
|
917
|
-
onObjectSelect:
|
|
918
|
-
onPlaceSelect:
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
926
|
+
loadPlaces: b,
|
|
927
|
+
onObjectSelect: h,
|
|
928
|
+
onPlaceSelect: d,
|
|
929
|
+
allowTypedPlace: n,
|
|
930
|
+
facets: f,
|
|
931
|
+
submitting: r,
|
|
932
|
+
submitLabel: l,
|
|
933
|
+
allowEmptySubmit: u,
|
|
934
|
+
whoRef: c,
|
|
935
|
+
whereRef: g,
|
|
936
|
+
defaultRadiusKm: m,
|
|
937
|
+
reverseGeocode: o,
|
|
938
|
+
cardLabel: S
|
|
928
939
|
} = e;
|
|
929
|
-
return /* @__PURE__ */ a(
|
|
930
|
-
/* @__PURE__ */
|
|
940
|
+
return /* @__PURE__ */ a(H, { variant: "elevated", "aria-label": S, children: /* @__PURE__ */ w("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]", children: [
|
|
941
|
+
/* @__PURE__ */ w("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:md:flex-row ds:md:items-start", children: [
|
|
931
942
|
/* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
|
|
932
|
-
|
|
943
|
+
$,
|
|
933
944
|
{
|
|
934
945
|
value: t,
|
|
935
946
|
onChange: i,
|
|
936
947
|
loadObjects: v,
|
|
937
|
-
onObjectSelect:
|
|
938
|
-
inputRef:
|
|
948
|
+
onObjectSelect: h,
|
|
949
|
+
inputRef: c
|
|
939
950
|
}
|
|
940
951
|
) }),
|
|
941
952
|
/* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
|
|
@@ -943,74 +954,76 @@ function Pe(e) {
|
|
|
943
954
|
{
|
|
944
955
|
value: t,
|
|
945
956
|
onChange: i,
|
|
946
|
-
loadPlaces:
|
|
947
|
-
onPlaceSelect:
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
957
|
+
loadPlaces: b,
|
|
958
|
+
onPlaceSelect: d,
|
|
959
|
+
allowTypedPlace: n,
|
|
960
|
+
defaultRadiusKm: m,
|
|
961
|
+
reverseGeocode: o,
|
|
962
|
+
inputRef: g
|
|
951
963
|
}
|
|
952
964
|
) }),
|
|
953
965
|
/* @__PURE__ */ a(
|
|
954
|
-
|
|
966
|
+
G,
|
|
955
967
|
{
|
|
956
968
|
value: t,
|
|
957
969
|
variant: s,
|
|
958
|
-
submitting:
|
|
959
|
-
submitLabel:
|
|
960
|
-
allowEmptySubmit:
|
|
970
|
+
submitting: r,
|
|
971
|
+
submitLabel: l,
|
|
972
|
+
allowEmptySubmit: u,
|
|
961
973
|
onSubmit: p
|
|
962
974
|
}
|
|
963
975
|
)
|
|
964
976
|
] }),
|
|
965
977
|
/* @__PURE__ */ a(
|
|
966
|
-
|
|
978
|
+
U,
|
|
967
979
|
{
|
|
968
980
|
value: t,
|
|
969
981
|
onChange: i,
|
|
970
|
-
defaultRadiusKm:
|
|
982
|
+
defaultRadiusKm: m
|
|
971
983
|
}
|
|
972
984
|
),
|
|
973
|
-
|
|
974
|
-
|
|
985
|
+
f && f.length > 0 ? /* @__PURE__ */ a(
|
|
986
|
+
Re,
|
|
975
987
|
{
|
|
976
|
-
facets:
|
|
988
|
+
facets: f,
|
|
977
989
|
value: t.facets,
|
|
978
|
-
onChange: (
|
|
990
|
+
onChange: (A) => i({ ...t, facets: A })
|
|
979
991
|
}
|
|
980
992
|
) : null
|
|
981
993
|
] }) });
|
|
982
994
|
}
|
|
983
|
-
function
|
|
995
|
+
function Oe(e) {
|
|
984
996
|
const {
|
|
985
997
|
variant: s,
|
|
986
998
|
value: t,
|
|
987
999
|
onChange: i,
|
|
988
1000
|
onSubmit: p,
|
|
989
1001
|
loadObjects: v,
|
|
990
|
-
loadPlaces:
|
|
991
|
-
onObjectSelect:
|
|
992
|
-
onPlaceSelect:
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
+
loadPlaces: b,
|
|
1003
|
+
onObjectSelect: h,
|
|
1004
|
+
onPlaceSelect: d,
|
|
1005
|
+
allowTypedPlace: n,
|
|
1006
|
+
discoveryCards: f,
|
|
1007
|
+
submitting: r,
|
|
1008
|
+
submitLabel: l,
|
|
1009
|
+
allowEmptySubmit: u,
|
|
1010
|
+
whoRef: c,
|
|
1011
|
+
whereRef: g,
|
|
1012
|
+
defaultRadiusKm: m,
|
|
1013
|
+
reverseGeocode: o,
|
|
1014
|
+
cardLabel: S
|
|
1002
1015
|
} = e;
|
|
1003
|
-
return /* @__PURE__ */
|
|
1004
|
-
/* @__PURE__ */
|
|
1005
|
-
/* @__PURE__ */
|
|
1016
|
+
return /* @__PURE__ */ w("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]", children: [
|
|
1017
|
+
/* @__PURE__ */ w(H, { variant: "elevated", "aria-label": S, children: [
|
|
1018
|
+
/* @__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: [
|
|
1006
1019
|
/* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
|
|
1007
|
-
|
|
1020
|
+
$,
|
|
1008
1021
|
{
|
|
1009
1022
|
value: t,
|
|
1010
1023
|
onChange: i,
|
|
1011
1024
|
loadObjects: v,
|
|
1012
|
-
onObjectSelect:
|
|
1013
|
-
inputRef:
|
|
1025
|
+
onObjectSelect: h,
|
|
1026
|
+
inputRef: c
|
|
1014
1027
|
}
|
|
1015
1028
|
) }),
|
|
1016
1029
|
/* @__PURE__ */ a("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ a(
|
|
@@ -1018,128 +1031,131 @@ function Ie(e) {
|
|
|
1018
1031
|
{
|
|
1019
1032
|
value: t,
|
|
1020
1033
|
onChange: i,
|
|
1021
|
-
loadPlaces:
|
|
1022
|
-
onPlaceSelect:
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1034
|
+
loadPlaces: b,
|
|
1035
|
+
onPlaceSelect: d,
|
|
1036
|
+
allowTypedPlace: n,
|
|
1037
|
+
defaultRadiusKm: m,
|
|
1038
|
+
reverseGeocode: o,
|
|
1039
|
+
inputRef: g
|
|
1026
1040
|
}
|
|
1027
1041
|
) }),
|
|
1028
1042
|
/* @__PURE__ */ a(
|
|
1029
|
-
|
|
1043
|
+
G,
|
|
1030
1044
|
{
|
|
1031
1045
|
value: t,
|
|
1032
1046
|
variant: s,
|
|
1033
|
-
submitting:
|
|
1034
|
-
submitLabel:
|
|
1035
|
-
allowEmptySubmit:
|
|
1047
|
+
submitting: r,
|
|
1048
|
+
submitLabel: l,
|
|
1049
|
+
allowEmptySubmit: u,
|
|
1036
1050
|
onSubmit: p
|
|
1037
1051
|
}
|
|
1038
1052
|
)
|
|
1039
1053
|
] }),
|
|
1040
1054
|
/* @__PURE__ */ a(
|
|
1041
|
-
|
|
1055
|
+
U,
|
|
1042
1056
|
{
|
|
1043
1057
|
value: t,
|
|
1044
1058
|
onChange: i,
|
|
1045
|
-
defaultRadiusKm:
|
|
1059
|
+
defaultRadiusKm: m
|
|
1046
1060
|
}
|
|
1047
1061
|
)
|
|
1048
1062
|
] }),
|
|
1049
|
-
/* @__PURE__ */ a(Ee, { cards:
|
|
1063
|
+
/* @__PURE__ */ a(Ee, { cards: f })
|
|
1050
1064
|
] });
|
|
1051
1065
|
}
|
|
1052
|
-
const
|
|
1066
|
+
const Ve = ce(function({
|
|
1053
1067
|
variant: s,
|
|
1054
1068
|
loadObjects: t,
|
|
1055
1069
|
loadPlaces: i,
|
|
1056
1070
|
onObjectSelect: p,
|
|
1057
1071
|
onPlaceSelect: v,
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1072
|
+
allowTypedPlace: b = !1,
|
|
1073
|
+
facets: h,
|
|
1074
|
+
defaultRadiusKm: d = J,
|
|
1075
|
+
reverseGeocode: n,
|
|
1076
|
+
discoveryCards: f,
|
|
1077
|
+
countryCode: r,
|
|
1078
|
+
value: l,
|
|
1079
|
+
onChange: u,
|
|
1080
|
+
onSubmit: c,
|
|
1081
|
+
submitting: g,
|
|
1082
|
+
submitLabel: m,
|
|
1083
|
+
allowEmptySubmit: o,
|
|
1084
|
+
"aria-label": S,
|
|
1085
|
+
id: A,
|
|
1086
|
+
className: Q,
|
|
1087
|
+
...D
|
|
1088
|
+
}, I) {
|
|
1089
|
+
const { t: Z } = C("ui"), X = j(null), O = j(null), F = j(null), E = j(!1);
|
|
1090
|
+
K(() => {
|
|
1091
|
+
if (!E.current && s === "who-where-when") {
|
|
1092
|
+
if (l.when !== void 0) {
|
|
1093
|
+
E.current = !0;
|
|
1079
1094
|
return;
|
|
1080
1095
|
}
|
|
1081
|
-
|
|
1096
|
+
E.current = !0, u({ ...l, when: "anytime" });
|
|
1082
1097
|
}
|
|
1083
1098
|
}, [s]);
|
|
1084
|
-
const
|
|
1085
|
-
|
|
1086
|
-
if (!
|
|
1087
|
-
if (
|
|
1088
|
-
|
|
1099
|
+
const P = j(!1);
|
|
1100
|
+
K(() => {
|
|
1101
|
+
if (!P.current && s === "faceted") {
|
|
1102
|
+
if (l.facets !== void 0) {
|
|
1103
|
+
P.current = !0;
|
|
1089
1104
|
return;
|
|
1090
1105
|
}
|
|
1091
|
-
|
|
1106
|
+
P.current = !0, u({ ...l, facets: {} });
|
|
1092
1107
|
}
|
|
1093
1108
|
}, [s]);
|
|
1094
|
-
const
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
}, [s,
|
|
1098
|
-
const
|
|
1109
|
+
const y = j(null);
|
|
1110
|
+
K(() => {
|
|
1111
|
+
y.current !== s && (y.current = s, _("patient_search_variant_exposed", { variant: s, country: r }));
|
|
1112
|
+
}, [s, r]);
|
|
1113
|
+
const x = Y(
|
|
1099
1114
|
() => ({
|
|
1100
1115
|
getVariant: () => s,
|
|
1101
1116
|
reset: () => {
|
|
1102
|
-
|
|
1117
|
+
u({});
|
|
1103
1118
|
},
|
|
1104
1119
|
focusPrimary: () => {
|
|
1105
1120
|
requestAnimationFrame(() => {
|
|
1106
|
-
var
|
|
1107
|
-
(
|
|
1121
|
+
var V;
|
|
1122
|
+
(V = O.current) == null || V.focus();
|
|
1108
1123
|
});
|
|
1109
1124
|
}
|
|
1110
1125
|
}),
|
|
1111
|
-
[s,
|
|
1126
|
+
[s, u]
|
|
1112
1127
|
);
|
|
1113
|
-
|
|
1114
|
-
const
|
|
1128
|
+
le(I, () => x, [x]), me(we, x, A);
|
|
1129
|
+
const N = S ?? Z("patientSearch.regionLabel"), k = {
|
|
1115
1130
|
variant: s,
|
|
1116
|
-
value:
|
|
1117
|
-
onChange:
|
|
1118
|
-
onSubmit:
|
|
1131
|
+
value: l,
|
|
1132
|
+
onChange: u,
|
|
1133
|
+
onSubmit: c,
|
|
1119
1134
|
loadObjects: t,
|
|
1120
1135
|
loadPlaces: i,
|
|
1121
1136
|
onObjectSelect: p,
|
|
1122
1137
|
onPlaceSelect: v,
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1138
|
+
allowTypedPlace: b,
|
|
1139
|
+
facets: h,
|
|
1140
|
+
defaultRadiusKm: d,
|
|
1141
|
+
reverseGeocode: n,
|
|
1142
|
+
discoveryCards: f ?? [],
|
|
1143
|
+
submitting: g,
|
|
1144
|
+
submitLabel: m,
|
|
1145
|
+
allowEmptySubmit: o,
|
|
1146
|
+
whoRef: O,
|
|
1147
|
+
whereRef: F,
|
|
1148
|
+
cardLabel: N
|
|
1149
|
+
}, R = (() => {
|
|
1134
1150
|
switch (s) {
|
|
1135
1151
|
case "who-where":
|
|
1136
|
-
return /* @__PURE__ */ a(Le, { ...
|
|
1152
|
+
return /* @__PURE__ */ a(Le, { ...k });
|
|
1137
1153
|
case "who-where-when":
|
|
1138
|
-
return /* @__PURE__ */ a(De, { ...
|
|
1154
|
+
return /* @__PURE__ */ a(De, { ...k });
|
|
1139
1155
|
case "faceted":
|
|
1140
|
-
return /* @__PURE__ */ a(
|
|
1156
|
+
return /* @__PURE__ */ a(Ie, { ...k });
|
|
1141
1157
|
case "discovery":
|
|
1142
|
-
return /* @__PURE__ */ a(
|
|
1158
|
+
return /* @__PURE__ */ a(Oe, { ...k });
|
|
1143
1159
|
/* c8 ignore next 2 */
|
|
1144
1160
|
default:
|
|
1145
1161
|
return null;
|
|
@@ -1148,22 +1164,22 @@ const Oe = de(function({
|
|
|
1148
1164
|
return /* @__PURE__ */ a(
|
|
1149
1165
|
"div",
|
|
1150
1166
|
{
|
|
1151
|
-
ref:
|
|
1167
|
+
ref: X,
|
|
1152
1168
|
role: "region",
|
|
1153
|
-
"aria-label":
|
|
1154
|
-
id:
|
|
1169
|
+
"aria-label": N,
|
|
1170
|
+
id: A,
|
|
1155
1171
|
"data-component": "patient-search",
|
|
1156
|
-
"data-component-id":
|
|
1172
|
+
"data-component-id": A,
|
|
1157
1173
|
"data-variant": s,
|
|
1158
|
-
className:
|
|
1159
|
-
...
|
|
1160
|
-
children:
|
|
1174
|
+
className: Se({ variant: s, className: Q }),
|
|
1175
|
+
...D,
|
|
1176
|
+
children: R
|
|
1161
1177
|
}
|
|
1162
1178
|
);
|
|
1163
1179
|
});
|
|
1164
|
-
|
|
1180
|
+
Ve.displayName = "PatientSearch";
|
|
1165
1181
|
export {
|
|
1166
|
-
|
|
1167
|
-
|
|
1182
|
+
Ve as P,
|
|
1183
|
+
we as p
|
|
1168
1184
|
};
|
|
1169
|
-
//# sourceMappingURL=patient-search-
|
|
1185
|
+
//# sourceMappingURL=patient-search-CxqNcth4.js.map
|