@alfadocs/ui-kit 0.33.10 → 0.34.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.
@@ -1,44 +1,46 @@
1
- import { jsxs as v, jsx as s, Fragment as W } from "react/jsx-runtime";
2
- import { forwardRef as Je, useId as Xe, useState as j, useCallback as q, useRef as te, useEffect as ee, useMemo as w, useImperativeHandle as kt } from "react";
3
- import { c as we } from "./index-D2ZczOXr.js";
4
- import { useTranslation as A, Trans as xt } from "react-i18next";
5
- import { u as St } from "./registry-nPAVE19X.js";
6
- import { A as $ } from "./alert-ywPR59NE.js";
7
- import { B as ae } from "./button-DD_0Xdmr.js";
8
- import { C as Re } from "./checkbox-DRcOdmXv.js";
9
- import { C as Nt } from "./checkbox-group-CpUwlHug.js";
10
- import { D as It } from "./date-picker-B94HAV4A.js";
11
- import { E as wt } from "./email-input-lQivsFrw.js";
12
- import { F as Y } from "./form-field-BOm9hK35.js";
13
- import { P as Ct } from "./phone-input-DfZbPPvh.js";
14
- import { T as Mt } from "./text-area-BIx0tZ05.js";
15
- import { T as ye } from "./text-input-BaClJL8Y.js";
16
- import { S as Dt } from "./spinner-CCByyvcb.js";
17
- import { I as Ge } from "./icon-button-CKEOrN37.js";
18
- import { S as Ce } from "./select-hsCaJSX3.js";
19
- import { S as Ie } from "./skeleton-CZbwyJAA.js";
20
- import { E as Qe } from "./empty-state-BLy7tigq.js";
21
- import { S as _t } from "./stepper-accordion-BfS6lUB9.js";
22
- import { S as Tt } from "./stepper-progress-DDjq5nei.js";
23
- import { p as K, S as At } from "./slot-grid-BlHHP9Qy.js";
24
- import { s as Ve, i as Ue } from "./isSameDay-DUEiAT0G.js";
25
- import { w as et, n as pe, a as Le, f as ge, d as Bt, h as Ne, x as ke } from "./react-day-picker-DsjfS7uI.js";
26
- import { s as Ot } from "./subDays-CANHP9hz.js";
27
- import { C as Pt } from "./chevron-left-CX1jqD2M.js";
28
- import { C as Et } from "./chevron-right-BrpYejk0.js";
29
- import { c as P } from "./createLucideIcon-CrFbzy84.js";
30
- import { M as Rt, S as Vt } from "./sun-BuXE0xUS.js";
31
- import { S as Lt } from "./stethoscope-DT5qCW8Y.js";
32
- import { H as Ft } from "./heart-pulse-CvuyFKHB.js";
33
- import { E as $t } from "./eye-LHlSU38h.js";
34
- import { S as zt } from "./sparkles-CuYXqQLg.js";
1
+ import { jsxs as f, jsx as s, Fragment as W } from "react/jsx-runtime";
2
+ import { forwardRef as ot, useId as rt, useState as K, useCallback as j, useRef as se, useEffect as H, useMemo as w, useImperativeHandle as Tt } from "react";
3
+ import { c as Pe } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as O, Trans as Pt } from "react-i18next";
5
+ import { u as Ot } from "./registry-nPAVE19X.js";
6
+ import { A as z } from "./alert-ywPR59NE.js";
7
+ import { B as ie } from "./button-DD_0Xdmr.js";
8
+ import { C as Ke } from "./checkbox-DRcOdmXv.js";
9
+ import { C as Bt } from "./checkbox-group-CpUwlHug.js";
10
+ import { D as Et } from "./date-picker-B94HAV4A.js";
11
+ import { E as Vt } from "./email-input-lQivsFrw.js";
12
+ import { F as Z } from "./form-field-BOm9hK35.js";
13
+ import { P as Lt } from "./phone-input-DfZbPPvh.js";
14
+ import { T as Rt } from "./text-area-BIx0tZ05.js";
15
+ import { T as Ce } from "./text-input-BaClJL8Y.js";
16
+ import { S as Ft } from "./spinner-CCByyvcb.js";
17
+ import { I as tt } from "./icon-button-CKEOrN37.js";
18
+ import { S as Oe } from "./select-hsCaJSX3.js";
19
+ import { C as Ge } from "./combobox-BC-DFx8G.js";
20
+ import { M as Ue } from "./multi-select-DOLO3K_z.js";
21
+ import { S as Te } from "./skeleton-CZbwyJAA.js";
22
+ import { E as dt } from "./empty-state-BLy7tigq.js";
23
+ import { S as $t } from "./stepper-accordion-BfS6lUB9.js";
24
+ import { S as zt } from "./stepper-progress-DDjq5nei.js";
25
+ import { p as F, S as Kt } from "./slot-grid-BlHHP9Qy.js";
26
+ import { s as le, i as at } from "./isSameDay-DUEiAT0G.js";
27
+ import { w as lt, n as ce, a as je, m as jt, f as ye, d as qt, h as _e, x as Me } from "./react-day-picker-DsjfS7uI.js";
28
+ import { s as Ht } from "./subDays-CANHP9hz.js";
29
+ import { C as Gt } from "./chevron-left-CX1jqD2M.js";
30
+ import { C as Ut } from "./chevron-right-BrpYejk0.js";
31
+ import { c as V } from "./createLucideIcon-CrFbzy84.js";
32
+ import { M as Yt, S as Jt } from "./sun-BuXE0xUS.js";
33
+ import { S as Zt } from "./stethoscope-DT5qCW8Y.js";
34
+ import { H as Wt } from "./heart-pulse-CvuyFKHB.js";
35
+ import { E as Xt } from "./eye-LHlSU38h.js";
36
+ import { S as Qt } from "./sparkles-CuYXqQLg.js";
35
37
  /**
36
38
  * @license lucide-react v1.8.0 - ISC
37
39
  *
38
40
  * This source code is licensed under the ISC license.
39
41
  * See the LICENSE file in the root directory of this source tree.
40
42
  */
41
- const Kt = [
43
+ const ea = [
42
44
  [
43
45
  "path",
44
46
  {
@@ -46,14 +48,14 @@ const Kt = [
46
48
  key: "169zse"
47
49
  }
48
50
  ]
49
- ], jt = P("activity", Kt);
51
+ ], ta = V("activity", ea);
50
52
  /**
51
53
  * @license lucide-react v1.8.0 - ISC
52
54
  *
53
55
  * This source code is licensed under the ISC license.
54
56
  * See the LICENSE file in the root directory of this source tree.
55
57
  */
56
- const qt = [
58
+ const aa = [
57
59
  ["path", { d: "M10 16c.5.3 1.2.5 2 .5s1.5-.2 2-.5", key: "1u7htd" }],
58
60
  ["path", { d: "M15 12h.01", key: "1k8ypt" }],
59
61
  [
@@ -64,14 +66,14 @@ const qt = [
64
66
  }
65
67
  ],
66
68
  ["path", { d: "M9 12h.01", key: "157uk2" }]
67
- ], Ht = P("baby", qt);
69
+ ], sa = V("baby", aa);
68
70
  /**
69
71
  * @license lucide-react v1.8.0 - ISC
70
72
  *
71
73
  * This source code is licensed under the ISC license.
72
74
  * See the LICENSE file in the root directory of this source tree.
73
75
  */
74
- const Gt = [
76
+ const ia = [
75
77
  [
76
78
  "path",
77
79
  {
@@ -79,14 +81,14 @@ const Gt = [
79
81
  key: "w610uw"
80
82
  }
81
83
  ]
82
- ], Ut = P("bone", Gt);
84
+ ], na = V("bone", ia);
83
85
  /**
84
86
  * @license lucide-react v1.8.0 - ISC
85
87
  *
86
88
  * This source code is licensed under the ISC license.
87
89
  * See the LICENSE file in the root directory of this source tree.
88
90
  */
89
- const Yt = [
91
+ const oa = [
90
92
  ["path", { d: "M12 18V5", key: "adv99a" }],
91
93
  ["path", { d: "M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4", key: "1e3is1" }],
92
94
  ["path", { d: "M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5", key: "1gqd8o" }],
@@ -95,14 +97,14 @@ const Yt = [
95
97
  ["path", { d: "M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517", key: "1gq6am" }],
96
98
  ["path", { d: "M6 18a4 4 0 0 1-2-7.464", key: "k1g0md" }],
97
99
  ["path", { d: "M6.003 5.125a4 4 0 0 0-2.526 5.77", key: "q97ue3" }]
98
- ], Wt = P("brain", Yt);
100
+ ], ra = V("brain", oa);
99
101
  /**
100
102
  * @license lucide-react v1.8.0 - ISC
101
103
  *
102
104
  * This source code is licensed under the ISC license.
103
105
  * See the LICENSE file in the root directory of this source tree.
104
106
  */
105
- const Zt = [
107
+ const da = [
106
108
  ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
107
109
  ["path", { d: "M16 2v4", key: "4m81vk" }],
108
110
  ["path", { d: "M3 10h18", key: "8toen8" }],
@@ -111,14 +113,14 @@ const Zt = [
111
113
  ["path", { d: "M13 18H7", key: "bb0bb7" }],
112
114
  ["path", { d: "M7 14h.01", key: "1qa3f1" }],
113
115
  ["path", { d: "M17 18h.01", key: "1bdyru" }]
114
- ], Jt = P("calendar-range", Zt);
116
+ ], la = V("calendar-range", da);
115
117
  /**
116
118
  * @license lucide-react v1.8.0 - ISC
117
119
  *
118
120
  * This source code is licensed under the ISC license.
119
121
  * See the LICENSE file in the root directory of this source tree.
120
122
  */
121
- const Xt = [
123
+ const ca = [
122
124
  ["rect", { width: "8", height: "4", x: "8", y: "2", rx: "1", ry: "1", key: "tgr4d6" }],
123
125
  [
124
126
  "path",
@@ -128,89 +130,89 @@ const Xt = [
128
130
  }
129
131
  ],
130
132
  ["path", { d: "m9 14 2 2 4-4", key: "df797q" }]
131
- ], Qt = P("clipboard-check", Xt);
133
+ ], ua = V("clipboard-check", ca);
132
134
  /**
133
135
  * @license lucide-react v1.8.0 - ISC
134
136
  *
135
137
  * This source code is licensed under the ISC license.
136
138
  * See the LICENSE file in the root directory of this source tree.
137
139
  */
138
- const ea = [
140
+ const pa = [
139
141
  ["path", { d: "M6 8.5a6.5 6.5 0 1 1 13 0c0 6-6 6-6 10a3.5 3.5 0 1 1-7 0", key: "1dfaln" }],
140
142
  ["path", { d: "M15 8.5a2.5 2.5 0 0 0-5 0v1a2 2 0 1 1 0 4", key: "1qnva7" }]
141
- ], ta = P("ear", ea);
143
+ ], ma = V("ear", pa);
142
144
  /**
143
145
  * @license lucide-react v1.8.0 - ISC
144
146
  *
145
147
  * This source code is licensed under the ISC license.
146
148
  * See the LICENSE file in the root directory of this source tree.
147
149
  */
148
- const aa = [
150
+ const ga = [
149
151
  ["path", { d: "M6 18h8", key: "1borvv" }],
150
152
  ["path", { d: "M3 22h18", key: "8prr45" }],
151
153
  ["path", { d: "M14 22a7 7 0 1 0 0-14h-1", key: "1jwaiy" }],
152
154
  ["path", { d: "M9 14h2", key: "197e7h" }],
153
155
  ["path", { d: "M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z", key: "1bmzmy" }],
154
156
  ["path", { d: "M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3", key: "1drr47" }]
155
- ], sa = P("microscope", aa);
157
+ ], fa = V("microscope", ga);
156
158
  /**
157
159
  * @license lucide-react v1.8.0 - ISC
158
160
  *
159
161
  * This source code is licensed under the ISC license.
160
162
  * See the LICENSE file in the root directory of this source tree.
161
163
  */
162
- const ia = [
164
+ const ha = [
163
165
  [
164
166
  "path",
165
167
  { d: "m10.5 20.5 10-10a4.95 4.95 0 1 0-7-7l-10 10a4.95 4.95 0 1 0 7 7Z", key: "wa1lgi" }
166
168
  ],
167
169
  ["path", { d: "m8.5 8.5 7 7", key: "rvfmvr" }]
168
- ], na = P("pill", ia);
170
+ ], va = V("pill", ha);
169
171
  /**
170
172
  * @license lucide-react v1.8.0 - ISC
171
173
  *
172
174
  * This source code is licensed under the ISC license.
173
175
  * See the LICENSE file in the root directory of this source tree.
174
176
  */
175
- const oa = [
177
+ const ba = [
176
178
  ["path", { d: "M3 7V5a2 2 0 0 1 2-2h2", key: "aa7l1z" }],
177
179
  ["path", { d: "M17 3h2a2 2 0 0 1 2 2v2", key: "4qcy5o" }],
178
180
  ["path", { d: "M21 17v2a2 2 0 0 1-2 2h-2", key: "6vwrx8" }],
179
181
  ["path", { d: "M7 21H5a2 2 0 0 1-2-2v-2", key: "ioqczr" }],
180
182
  ["path", { d: "M7 12h10", key: "b7w52i" }]
181
- ], ra = P("scan-line", oa);
183
+ ], ya = V("scan-line", ba);
182
184
  /**
183
185
  * @license lucide-react v1.8.0 - ISC
184
186
  *
185
187
  * This source code is licensed under the ISC license.
186
188
  * See the LICENSE file in the root directory of this source tree.
187
189
  */
188
- const da = [
190
+ const ka = [
189
191
  ["circle", { cx: "6", cy: "6", r: "3", key: "1lh9wr" }],
190
192
  ["path", { d: "M8.12 8.12 12 12", key: "1alkpv" }],
191
193
  ["path", { d: "M20 4 8.12 15.88", key: "xgtan2" }],
192
194
  ["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
193
195
  ["path", { d: "M14.8 14.8 20 20", key: "ptml3r" }]
194
- ], la = P("scissors", da);
196
+ ], xa = V("scissors", ka);
195
197
  /**
196
198
  * @license lucide-react v1.8.0 - ISC
197
199
  *
198
200
  * This source code is licensed under the ISC license.
199
201
  * See the LICENSE file in the root directory of this source tree.
200
202
  */
201
- const ca = [
203
+ const Sa = [
202
204
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
203
205
  ["path", { d: "M8 14s1.5 2 4 2 4-2 4-2", key: "1y1vjs" }],
204
206
  ["line", { x1: "9", x2: "9.01", y1: "9", y2: "9", key: "yxxnd0" }],
205
207
  ["line", { x1: "15", x2: "15.01", y1: "9", y2: "9", key: "1p4y9e" }]
206
- ], ua = P("smile", ca);
208
+ ], Ia = V("smile", Sa);
207
209
  /**
208
210
  * @license lucide-react v1.8.0 - ISC
209
211
  *
210
212
  * This source code is licensed under the ISC license.
211
213
  * See the LICENSE file in the root directory of this source tree.
212
214
  */
213
- const ma = [
215
+ const Na = [
214
216
  ["path", { d: "M12 10V2", key: "16sf7g" }],
215
217
  ["path", { d: "m4.93 10.93 1.41 1.41", key: "2a7f42" }],
216
218
  ["path", { d: "M2 18h2", key: "j10viu" }],
@@ -219,25 +221,25 @@ const ma = [
219
221
  ["path", { d: "M22 22H2", key: "19qnx5" }],
220
222
  ["path", { d: "m16 6-4 4-4-4", key: "6wukr" }],
221
223
  ["path", { d: "M16 18a4 4 0 0 0-8 0", key: "1lzouq" }]
222
- ], pa = P("sunset", ma);
224
+ ], wa = V("sunset", Na);
223
225
  /**
224
226
  * @license lucide-react v1.8.0 - ISC
225
227
  *
226
228
  * This source code is licensed under the ISC license.
227
229
  * See the LICENSE file in the root directory of this source tree.
228
230
  */
229
- const ga = [
231
+ const Ca = [
230
232
  ["path", { d: "m18 2 4 4", key: "22kx64" }],
231
233
  ["path", { d: "m17 7 3-3", key: "1w1zoj" }],
232
234
  ["path", { d: "M19 9 8.7 19.3c-1 1-2.5 1-3.4 0l-.6-.6c-1-1-1-2.5 0-3.4L15 5", key: "1exhtz" }],
233
235
  ["path", { d: "m9 11 4 4", key: "rovt3i" }],
234
236
  ["path", { d: "m5 19-3 3", key: "59f2uf" }],
235
237
  ["path", { d: "m14 4 6 6", key: "yqp9t2" }]
236
- ], Ye = P("syringe", ga);
237
- function fa(e, t, a) {
238
- return et(e, -1, a);
238
+ ], st = V("syringe", Ca);
239
+ function Ma(e, t, a) {
240
+ return lt(e, -1, a);
239
241
  }
240
- const ha = {
242
+ const Da = {
241
243
  id: "booking",
242
244
  capabilities: ["navigate", "view_change"],
243
245
  state: {
@@ -279,12 +281,12 @@ const ha = {
279
281
  description: "Sourced from the id prop."
280
282
  }
281
283
  }
282
- }, Fe = [
284
+ }, qe = [
283
285
  "email",
284
286
  "whatsapp",
285
287
  "sms"
286
- ], he = "all", va = "de";
287
- function ba(e) {
288
+ ], X = "all", Aa = "de";
289
+ function _a(e) {
288
290
  return [...e.lockedOperatorId ? e.specialties.filter(
289
291
  (a) => {
290
292
  var i;
@@ -295,58 +297,67 @@ function ba(e) {
295
297
  return n - o;
296
298
  });
297
299
  }
298
- function ya(e) {
300
+ function Ta(e) {
299
301
  let t = e.services;
300
- return e.lockedOperatorId && (t = t.filter(
302
+ if (e.lockedOperatorId && (t = t.filter(
301
303
  (i) => {
302
304
  var n;
303
305
  return (n = i.operatorIds) == null ? void 0 : n.includes(e.lockedOperatorId);
304
306
  }
305
- )), (e.useSpecialties === void 0 ? e.specialties.length > 0 : e.useSpecialties) && e.value.specialtyId && (t = t.filter((i) => i.specialtyId === e.value.specialtyId)), t;
307
+ )), e.useSpecialties === void 0 ? e.specialties.length > 0 : e.useSpecialties) {
308
+ const i = ue(e.value);
309
+ i.length > 0 && (t = t.filter(
310
+ (n) => n.specialtyId !== void 0 && i.includes(n.specialtyId)
311
+ ));
312
+ }
313
+ return t;
306
314
  }
307
- function ka(e) {
315
+ function Pa(e) {
308
316
  const t = e.useSpecialties === void 0 ? e.specialties.length > 0 : e.useSpecialties;
309
- if (t && e.value.specialtyId) {
310
- const a = e.value.specialtyId;
311
- return e.operators.filter(
312
- (i) => {
313
- var n;
314
- return (n = i.specialtyIds) == null ? void 0 : n.includes(a);
315
- }
316
- );
317
+ if (t) {
318
+ const a = ue(e.value);
319
+ if (a.length > 0)
320
+ return e.operators.filter(
321
+ (i) => {
322
+ var n;
323
+ return (n = i.specialtyIds) == null ? void 0 : n.some((o) => a.includes(o));
324
+ }
325
+ );
317
326
  }
318
- if (!t && e.value.serviceId) {
319
- const a = e.value.serviceId;
320
- return e.operators.filter(
321
- (i) => {
322
- var n;
323
- return (n = i.appointmentBookingReasonIds) == null ? void 0 : n.includes(a);
324
- }
325
- );
327
+ if (!t) {
328
+ const a = Be(e.value);
329
+ if (a.length > 0)
330
+ return e.operators.filter(
331
+ (i) => {
332
+ var n;
333
+ return (n = i.appointmentBookingReasonIds) == null ? void 0 : n.some((o) => a.includes(o));
334
+ }
335
+ );
326
336
  }
327
337
  return [];
328
338
  }
329
- function xa(e, t) {
330
- const a = e.country === va, i = !a || e.value.insuranceType !== void 0, o = (e.useSpecialties === void 0 ? e.specialties.length > 0 : e.useSpecialties) && i, m = !o || e.value.specialtyId !== void 0, d = !m || e.value.serviceId !== void 0, c = t.operators, p = !!e.allowOperatorSelection && d && e.value.serviceId !== void 0 && !e.lockedOperatorId && c.length > 1, u = d && e.value.serviceId !== void 0, k = (!u || e.value.date !== void 0) && e.value.date !== void 0, N = (!k || e.value.slotKey !== void 0) && e.value.slotKey !== void 0, x = !!e.value.serviceId && c.length === 0;
339
+ function Oa(e, t) {
340
+ const a = e.country === Aa, i = !a || e.value.insuranceType !== void 0, o = (e.useSpecialties === void 0 ? e.specialties.length > 0 : e.useSpecialties) && i, l = ue(e.value).length > 0, p = !o || l, r = Be(e.value).length > 0, c = !p || r, m = t.operators, k = !!e.allowOperatorSelection && c && r && !e.lockedOperatorId && m.length > 1, I = c && r, N = (!I || e.value.date !== void 0) && e.value.date !== void 0, D = (!N || e.value.slotKey !== void 0) && e.value.slotKey !== void 0, y = r && m.length === 0;
331
341
  return {
332
342
  insurance: a,
333
343
  specialty: o,
334
- service: m,
335
- operator: p,
336
- date: u,
337
- slot: k,
338
- details: N,
339
- onboardingIncomplete: x
344
+ service: p,
345
+ operator: k,
346
+ date: I,
347
+ slot: N,
348
+ details: D,
349
+ onboardingIncomplete: y
340
350
  };
341
351
  }
342
- function Sa(e, t) {
352
+ function Ba(e, t) {
343
353
  const a = [];
344
354
  t.insurance && a.push(1), t.specialty && a.push(2), a.push(3), t.operator && a.push(4), a.push(5), a.push(6), a.push(7);
345
355
  const i = {
346
356
  1: e.value.insuranceType !== void 0,
347
- 2: e.value.specialtyId !== void 0,
348
- 3: e.value.serviceId !== void 0,
349
- 4: e.value.operatorId !== void 0,
357
+ // 0.34.0: array-or-single satisfied when EITHER form is present.
358
+ 2: ue(e.value).length > 0,
359
+ 3: Be(e.value).length > 0,
360
+ 4: e.value.operatorId !== void 0 || e.value.operatorIds !== void 0 && e.value.operatorIds.length > 0,
350
361
  5: e.value.date !== void 0,
351
362
  6: e.value.slotKey !== void 0,
352
363
  7: !1
@@ -357,30 +368,30 @@ function Sa(e, t) {
357
368
  visibleSteps: a
358
369
  };
359
370
  }
360
- function Na(e) {
371
+ function Ea(e) {
361
372
  const t = {
362
- specialties: ba(e),
363
- services: ya(e),
364
- operators: ka(e)
365
- }, a = xa(e, t), { currentStep: i, visibleSteps: n } = Sa(e, a);
373
+ specialties: _a(e),
374
+ services: Ta(e),
375
+ operators: Pa(e)
376
+ }, a = Oa(e, t), { currentStep: i, visibleSteps: n } = Ba(e, a);
366
377
  let o;
367
378
  if (e.value.date && e.value.slotKey) {
368
- const d = e.availableSlots[e.value.date];
369
- d && (o = d.find((c) => c.key === e.value.slotKey));
379
+ const c = e.availableSlots[e.value.date];
380
+ c && (o = c.find((m) => m.key === e.value.slotKey));
370
381
  }
371
- const l = e.value.serviceId ? e.services.find((d) => d.id === e.value.serviceId) : void 0, m = e.value.serviceId !== void 0 && e.value.date !== void 0 && e.value.slotKey !== void 0 && (!a.insurance || e.value.insuranceType !== void 0) && (!a.specialty || e.value.specialtyId !== void 0);
382
+ const l = Be(e.value), u = l.length > 0 ? e.services.find((c) => c.id === l[0]) : void 0, p = ue(e.value).length > 0, r = l.length > 0 && e.value.date !== void 0 && e.value.slotKey !== void 0 && (!a.insurance || e.value.insuranceType !== void 0) && (!a.specialty || p);
372
383
  return {
373
384
  gates: a,
374
385
  filtered: t,
375
386
  currentStep: i,
376
387
  totalSteps: n.length,
377
388
  visibleSteps: n,
378
- isReadyToSubmit: m,
379
- durationMin: l == null ? void 0 : l.durationMin,
389
+ isReadyToSubmit: r,
390
+ durationMin: u == null ? void 0 : u.durationMin,
380
391
  selectedSlot: o
381
392
  };
382
393
  }
383
- function tt(e, t) {
394
+ function ct(e, t) {
384
395
  return {
385
396
  ...e,
386
397
  insuranceType: t,
@@ -392,40 +403,89 @@ function tt(e, t) {
392
403
  details: void 0
393
404
  };
394
405
  }
395
- function at(e, t) {
406
+ function ut(e, t) {
396
407
  return {
397
408
  ...e,
398
409
  specialtyId: t,
410
+ specialtyIds: void 0,
399
411
  serviceId: void 0,
412
+ serviceIds: void 0,
400
413
  operatorId: void 0,
414
+ operatorIds: void 0,
401
415
  date: void 0,
402
416
  slotKey: void 0,
403
417
  details: void 0
404
418
  };
405
419
  }
406
- function st(e, t) {
420
+ function pt(e, t) {
421
+ return {
422
+ ...e,
423
+ specialtyId: void 0,
424
+ specialtyIds: t,
425
+ serviceId: void 0,
426
+ serviceIds: void 0,
427
+ operatorId: void 0,
428
+ operatorIds: void 0,
429
+ date: void 0,
430
+ slotKey: void 0,
431
+ details: void 0
432
+ };
433
+ }
434
+ function mt(e, t) {
407
435
  return {
408
436
  ...e,
409
437
  serviceId: t,
438
+ serviceIds: void 0,
410
439
  // Default the operator to the "All operators" sentinel so a patient
411
440
  // who doesn't care about picking lands on a satisfied step 4 without
412
441
  // any further input.
413
- operatorId: t ? he : void 0,
442
+ operatorId: t ? X : void 0,
443
+ operatorIds: void 0,
444
+ date: void 0,
445
+ slotKey: void 0,
446
+ details: void 0
447
+ };
448
+ }
449
+ function gt(e, t) {
450
+ const a = !!t && t.length > 0;
451
+ return {
452
+ ...e,
453
+ serviceId: void 0,
454
+ serviceIds: t,
455
+ operatorId: a ? X : void 0,
456
+ operatorIds: void 0,
414
457
  date: void 0,
415
458
  slotKey: void 0,
416
459
  details: void 0
417
460
  };
418
461
  }
419
- function it(e, t) {
462
+ function ft(e, t) {
420
463
  return {
421
464
  ...e,
422
465
  operatorId: t,
466
+ operatorIds: void 0,
467
+ date: void 0,
468
+ slotKey: void 0,
469
+ details: void 0
470
+ };
471
+ }
472
+ function ht(e, t) {
473
+ return {
474
+ ...e,
475
+ operatorId: void 0,
476
+ operatorIds: t,
423
477
  date: void 0,
424
478
  slotKey: void 0,
425
479
  details: void 0
426
480
  };
427
481
  }
428
- function Me(e, t) {
482
+ function ue(e) {
483
+ return e.specialtyIds && e.specialtyIds.length > 0 ? e.specialtyIds : e.specialtyId ? [e.specialtyId] : [];
484
+ }
485
+ function Be(e) {
486
+ return e.serviceIds && e.serviceIds.length > 0 ? e.serviceIds : e.serviceId ? [e.serviceId] : [];
487
+ }
488
+ function Ee(e, t) {
429
489
  return {
430
490
  ...e,
431
491
  date: t,
@@ -434,47 +494,49 @@ function Me(e, t) {
434
494
  // since the user has already filled some fields.
435
495
  };
436
496
  }
437
- function nt(e, t) {
497
+ function vt(e, t) {
438
498
  return {
439
499
  ...e,
440
500
  slotKey: t
441
501
  };
442
502
  }
443
- function Ia(e, t) {
503
+ function Va(e, t) {
444
504
  let a = e;
445
- if (t.lockedOperatorId && a.operatorId !== t.lockedOperatorId && (a = { ...a, operatorId: t.lockedOperatorId }), (t.useSpecialties === void 0 ? t.specialties.length > 0 : t.useSpecialties) && t.specialties.length === 1 && a.specialtyId === void 0 && (a = { ...a, specialtyId: t.specialties[0].id }), t.autoSelectSingleService) {
446
- const n = a.specialtyId ? t.services.filter((o) => o.specialtyId === a.specialtyId) : t.services;
447
- n.length === 1 && a.serviceId === void 0 && (a = { ...a, serviceId: n[0].id }, a.operatorId === void 0 && (a = { ...a, operatorId: he }));
505
+ if (t.lockedOperatorId && a.operatorId !== t.lockedOperatorId && (a = { ...a, operatorId: t.lockedOperatorId }), (t.useSpecialties === void 0 ? t.specialties.length > 0 : t.useSpecialties) && t.specialties.length === 1 && a.specialtyId === void 0 && a.specialtyIds === void 0 && (a = { ...a, specialtyId: t.specialties[0].id }), t.autoSelectSingleService) {
506
+ const n = ue(a), o = n.length > 0 ? t.services.filter(
507
+ (l) => l.specialtyId && n.includes(l.specialtyId)
508
+ ) : t.services;
509
+ o.length === 1 && a.serviceId === void 0 && a.serviceIds === void 0 && (a = { ...a, serviceId: o[0].id }, a.operatorId === void 0 && a.operatorIds === void 0 && (a = { ...a, operatorId: X }));
448
510
  }
449
511
  return a;
450
512
  }
451
- function $e(e) {
452
- if (e.operatorId && e.operatorId !== he)
513
+ function He(e) {
514
+ if (e.operatorId && e.operatorId !== X)
453
515
  return e.operatorId;
454
516
  }
455
- function wa(e) {
517
+ function La(e) {
456
518
  if (!e) return !1;
457
519
  const t = e.trim();
458
520
  return /^\+?\d[\d\s\-()]{6,}$/.test(t);
459
521
  }
460
- function ot(e) {
522
+ function bt(e) {
461
523
  const t = e && e.length > 0 ? e : ["email"], a = new Set(t);
462
- return Fe.filter((i) => a.has(i));
524
+ return qe.filter((i) => a.has(i));
463
525
  }
464
- function Ca(e, t, a) {
465
- const i = ot(e), n = new Set(i);
526
+ function Ra(e, t, a) {
527
+ const i = bt(e), n = new Set(i);
466
528
  if (a)
467
- return Fe.filter(
468
- (c) => a.includes(c) && n.has(c)
529
+ return qe.filter(
530
+ (r) => a.includes(r) && n.has(r)
469
531
  );
470
532
  const o = [];
471
533
  n.has("email") && o.push("email");
472
- const l = wa(t), m = n.has("whatsapp");
473
- m && l && o.push("whatsapp"), !m && n.has("sms") && o.push("sms");
474
- const d = new Set(o);
475
- return Fe.filter((c) => d.has(c));
534
+ const l = La(t), u = n.has("whatsapp");
535
+ u && l && o.push("whatsapp"), !u && n.has("sms") && o.push("sms");
536
+ const p = new Set(o);
537
+ return qe.filter((r) => p.has(r));
476
538
  }
477
- const We = 500, Ma = /^[A-Z0-9]{16}$/, Da = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Ze = 300, xe = { state: "idle" }, ze = Je(
539
+ const it = 500, Fa = /^[A-Z0-9]{16}$/, $a = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, nt = 300, De = { state: "idle" }, Ye = ot(
478
540
  ({
479
541
  value: e,
480
542
  onChange: t,
@@ -483,132 +545,132 @@ const We = 500, Ma = /^[A-Z0-9]{16}$/, Da = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Ze = 3
483
545
  requireDateOfBirth: n = !1,
484
546
  requireInsuranceNumber: o = !1,
485
547
  insuranceType: l,
486
- showNote: m = !1,
487
- showReturningPatientFlag: d = !1,
488
- privacyPolicyUrl: c,
489
- termsUrl: p,
490
- validateCodiceFiscale: u,
491
- validateInsuranceNumber: S,
492
- submitting: k = !1,
493
- summarySlot: h,
548
+ showNote: u = !1,
549
+ showReturningPatientFlag: p = !1,
550
+ privacyPolicyUrl: r,
551
+ termsUrl: c,
552
+ validateCodiceFiscale: m,
553
+ validateInsuranceNumber: k,
554
+ submitting: I = !1,
555
+ summarySlot: v,
494
556
  defaultPhoneCountry: N,
495
- confirmationChannels: x,
557
+ confirmationChannels: M,
496
558
  defaultConfirmationChannels: D,
497
- submitError: b
498
- }, f) => {
499
- var Q, L;
500
- const { t: r } = A(), _ = Xe(), [M, y] = j(xe), [C, B] = j(xe), [O, Z] = j({}), E = q(
501
- (g) => Z((I) => ({ ...I, [g]: !0 })),
559
+ submitError: y
560
+ }, b) => {
561
+ var we, re;
562
+ const { t: d } = O(), _ = rt(), [x, g] = K(De), [S, T] = K(De), [A, G] = K({}), B = j(
563
+ (h) => G((C) => ({ ...C, [h]: !0 })),
502
564
  []
503
- ), z = te(null), G = te(
565
+ ), E = se(null), U = se(
504
566
  null
505
567
  );
506
- ee(
568
+ H(
507
569
  () => () => {
508
- z.current && clearTimeout(z.current), G.current && clearTimeout(G.current);
570
+ E.current && clearTimeout(E.current), U.current && clearTimeout(U.current);
509
571
  },
510
572
  []
511
573
  );
512
- const T = q(
513
- (g) => t({ ...e, ...g }),
574
+ const P = j(
575
+ (h) => t({ ...e, ...h }),
514
576
  [e, t]
515
- ), J = w(
516
- () => ot(x),
517
- [x]
518
- ), H = J.length >= 2, ne = te(!1);
519
- ee(() => {
520
- if (!H) {
521
- e.confirmationChannels !== void 0 && T({ confirmationChannels: void 0 });
577
+ ), Q = w(
578
+ () => bt(M),
579
+ [M]
580
+ ), q = Q.length >= 2, pe = se(!1);
581
+ H(() => {
582
+ if (!q) {
583
+ e.confirmationChannels !== void 0 && P({ confirmationChannels: void 0 });
522
584
  return;
523
585
  }
524
586
  if (e.confirmationChannels !== void 0) {
525
- ne.current = !0;
587
+ pe.current = !0;
526
588
  return;
527
589
  }
528
- const g = Ca(
529
- J,
590
+ const h = Ra(
591
+ Q,
530
592
  e.mobilePhone,
531
593
  D
532
594
  );
533
- ne.current = !0, T({ confirmationChannels: g });
595
+ pe.current = !0, P({ confirmationChannels: h });
534
596
  }, [
535
- H,
536
- J,
597
+ q,
598
+ Q,
537
599
  e.mobilePhone,
538
600
  D
539
601
  ]);
540
- const se = w(
602
+ const ee = w(
541
603
  () => e.confirmationChannels ?? [],
542
604
  [e.confirmationChannels]
543
- ), be = H && se.length === 0;
544
- ee(() => {
545
- const g = e.codiceFiscale;
546
- if (!i || !u || !g) {
547
- y(xe);
605
+ ), xe = q && ee.length === 0;
606
+ H(() => {
607
+ const h = e.codiceFiscale;
608
+ if (!i || !m || !h) {
609
+ g(De);
548
610
  return;
549
611
  }
550
- if (!Ma.test(g)) {
551
- y({
612
+ if (!Fa.test(h)) {
613
+ g({
552
614
  state: "invalid",
553
- hint: r("booking.details.codiceFiscale.invalidFormat")
615
+ hint: d("booking.details.codiceFiscale.invalidFormat")
554
616
  });
555
617
  return;
556
618
  }
557
- y({ state: "pending" }), z.current && clearTimeout(z.current), z.current = setTimeout(() => {
558
- u(g).then(
559
- (I) => y(
560
- I.valid ? { state: "valid" } : { state: "invalid", hint: I.hint }
619
+ g({ state: "pending" }), E.current && clearTimeout(E.current), E.current = setTimeout(() => {
620
+ m(h).then(
621
+ (C) => g(
622
+ C.valid ? { state: "valid" } : { state: "invalid", hint: C.hint }
561
623
  )
562
624
  ).catch(
563
- () => y({
625
+ () => g({
564
626
  state: "invalid",
565
- hint: r("booking.details.codiceFiscale.unavailable")
627
+ hint: d("booking.details.codiceFiscale.unavailable")
566
628
  })
567
629
  );
568
- }, Ze);
569
- }, [i, u, e.codiceFiscale, r]);
570
- const U = o && l === "public";
571
- ee(() => {
572
- const g = e.insuranceNumber;
573
- if (!U || !S || !g) {
574
- B(xe);
630
+ }, nt);
631
+ }, [i, m, e.codiceFiscale, d]);
632
+ const Y = o && l === "public";
633
+ H(() => {
634
+ const h = e.insuranceNumber;
635
+ if (!Y || !k || !h) {
636
+ T(De);
575
637
  return;
576
638
  }
577
- B({ state: "pending" }), G.current && clearTimeout(G.current), G.current = setTimeout(() => {
578
- S(g).then(
579
- (I) => B(
580
- I.valid ? { state: "valid" } : { state: "invalid", hint: I.hint }
639
+ T({ state: "pending" }), U.current && clearTimeout(U.current), U.current = setTimeout(() => {
640
+ k(h).then(
641
+ (C) => T(
642
+ C.valid ? { state: "valid" } : { state: "invalid", hint: C.hint }
581
643
  )
582
644
  ).catch(
583
- () => B({
645
+ () => T({
584
646
  state: "invalid",
585
- hint: r("booking.details.insuranceNumber.unavailable")
647
+ hint: d("booking.details.insuranceNumber.unavailable")
586
648
  })
587
649
  );
588
- }, Ze);
589
- }, [U, S, e.insuranceNumber, r]);
590
- const oe = w(
591
- () => !!(e.email && Da.test(e.email)),
650
+ }, nt);
651
+ }, [Y, k, e.insuranceNumber, d]);
652
+ const ne = w(
653
+ () => !!(e.email && $a.test(e.email)),
592
654
  [e.email]
593
- ), X = w(
655
+ ), me = w(
594
656
  () => !!(e.mobilePhone && e.mobilePhone.length >= 6),
595
657
  [e.mobilePhone]
596
- ), De = w(() => {
597
- var g, I;
598
- return !(!((g = e.firstName) != null && g.trim()) || !((I = e.lastName) != null && I.trim()) || !oe || !X || i && M.state !== "valid" || n && !e.dateOfBirth || U && C.state !== "valid");
658
+ ), Se = w(() => {
659
+ var h, C;
660
+ return !(!((h = e.firstName) != null && h.trim()) || !((C = e.lastName) != null && C.trim()) || !ne || !me || i && x.state !== "valid" || n && !e.dateOfBirth || Y && S.state !== "valid");
599
661
  }, [
600
662
  e.firstName,
601
663
  e.lastName,
602
- oe,
603
- X,
664
+ ne,
665
+ me,
604
666
  i,
605
- M.state,
667
+ x.state,
606
668
  n,
607
669
  e.dateOfBirth,
608
- U,
609
- C.state
610
- ]), _e = !!(e.privacyConsent && e.termsConsent), Te = !H || se.length > 0, ie = De && _e && Te && !k, Ae = (g) => {
611
- if (g.preventDefault(), Z({
670
+ Y,
671
+ S.state
672
+ ]), Ie = !!(e.privacyConsent && e.termsConsent), Ve = !q || ee.length > 0, oe = Se && Ie && Ve && !I, Le = (h) => {
673
+ if (h.preventDefault(), G({
612
674
  firstName: !0,
613
675
  lastName: !0,
614
676
  email: !0,
@@ -616,8 +678,8 @@ const We = 500, Ma = /^[A-Z0-9]{16}$/, Da = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Ze = 3
616
678
  codiceFiscale: !0,
617
679
  dateOfBirth: !0,
618
680
  insuranceNumber: !0
619
- }), !ie) return;
620
- const I = {
681
+ }), !oe) return;
682
+ const C = {
621
683
  firstName: e.firstName.trim(),
622
684
  lastName: e.lastName.trim(),
623
685
  email: e.email.trim(),
@@ -632,15 +694,15 @@ const We = 500, Ma = /^[A-Z0-9]{16}$/, Da = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Ze = 3
632
694
  // Only include when the picker was visible; otherwise the single
633
695
  // implicit channel is inferred backend-side from the practice
634
696
  // config.
635
- confirmationChannels: H ? se : void 0
697
+ confirmationChannels: q ? ee : void 0
636
698
  };
637
- a(I);
638
- }, R = (g, I) => {
639
- const re = I && /^https?:\/\//i.test(I) ? I : void 0;
640
- return re ? /* @__PURE__ */ s(
641
- xt,
699
+ a(C);
700
+ }, Ne = (h, C) => {
701
+ const te = C && /^https?:\/\//i.test(C) ? C : void 0;
702
+ return te ? /* @__PURE__ */ s(
703
+ Pt,
642
704
  {
643
- i18nKey: g,
705
+ i18nKey: h,
644
706
  components: {
645
707
  // The `<Trans>` runtime injects link text from the i18n
646
708
  // string. The anchor renders empty at static-analysis time,
@@ -652,7 +714,7 @@ const We = 500, Ma = /^[A-Z0-9]{16}$/, Da = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Ze = 3
652
714
  /* @__PURE__ */ s(
653
715
  "a",
654
716
  {
655
- href: re,
717
+ href: te,
656
718
  target: "_blank",
657
719
  rel: "noopener noreferrer",
658
720
  className: "ds:underline ds:text-[var(--primary)]"
@@ -661,184 +723,184 @@ const We = 500, Ma = /^[A-Z0-9]{16}$/, Da = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Ze = 3
661
723
  )
662
724
  }
663
725
  }
664
- ) : r(g);
726
+ ) : d(h);
665
727
  };
666
- return /* @__PURE__ */ v(
728
+ return /* @__PURE__ */ f(
667
729
  "form",
668
730
  {
669
- ref: f,
731
+ ref: b,
670
732
  id: _,
671
733
  noValidate: !0,
672
- onSubmit: Ae,
734
+ onSubmit: Le,
673
735
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
674
736
  children: [
675
- h,
676
- /* @__PURE__ */ v("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-sm)] ds:sm:grid-cols-2", children: [
737
+ v,
738
+ /* @__PURE__ */ f("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-sm)] ds:sm:grid-cols-2", children: [
677
739
  /* @__PURE__ */ s(
678
- Y,
740
+ Z,
679
741
  {
680
- label: r("booking.details.firstName.label"),
742
+ label: d("booking.details.firstName.label"),
681
743
  required: !0,
682
- error: O.firstName && !((Q = e.firstName) != null && Q.trim()) ? r("booking.details.firstName.required") : void 0,
744
+ error: A.firstName && !((we = e.firstName) != null && we.trim()) ? d("booking.details.firstName.required") : void 0,
683
745
  children: /* @__PURE__ */ s(
684
- ye,
746
+ Ce,
685
747
  {
686
748
  autoComplete: "given-name",
687
749
  value: e.firstName ?? "",
688
- onChange: (g) => T({ firstName: g.target.value }),
689
- onBlur: () => E("firstName")
750
+ onChange: (h) => P({ firstName: h.target.value }),
751
+ onBlur: () => B("firstName")
690
752
  }
691
753
  )
692
754
  }
693
755
  ),
694
756
  /* @__PURE__ */ s(
695
- Y,
757
+ Z,
696
758
  {
697
- label: r("booking.details.lastName.label"),
759
+ label: d("booking.details.lastName.label"),
698
760
  required: !0,
699
- error: O.lastName && !((L = e.lastName) != null && L.trim()) ? r("booking.details.lastName.required") : void 0,
761
+ error: A.lastName && !((re = e.lastName) != null && re.trim()) ? d("booking.details.lastName.required") : void 0,
700
762
  children: /* @__PURE__ */ s(
701
- ye,
763
+ Ce,
702
764
  {
703
765
  autoComplete: "family-name",
704
766
  value: e.lastName ?? "",
705
- onChange: (g) => T({ lastName: g.target.value }),
706
- onBlur: () => E("lastName")
767
+ onChange: (h) => P({ lastName: h.target.value }),
768
+ onBlur: () => B("lastName")
707
769
  }
708
770
  )
709
771
  }
710
772
  )
711
773
  ] }),
712
- /* @__PURE__ */ v("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-sm)] ds:sm:grid-cols-2", children: [
774
+ /* @__PURE__ */ f("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-sm)] ds:sm:grid-cols-2", children: [
713
775
  /* @__PURE__ */ s(
714
- Y,
776
+ Z,
715
777
  {
716
- label: r("booking.details.email.label"),
778
+ label: d("booking.details.email.label"),
717
779
  required: !0,
718
- error: O.email && !oe ? r("booking.details.email.invalid") : void 0,
780
+ error: A.email && !ne ? d("booking.details.email.invalid") : void 0,
719
781
  children: /* @__PURE__ */ s(
720
- wt,
782
+ Vt,
721
783
  {
722
784
  value: e.email ?? "",
723
- onChange: (g) => T({ email: g.target.value }),
724
- onBlur: () => E("email")
785
+ onChange: (h) => P({ email: h.target.value }),
786
+ onBlur: () => B("email")
725
787
  }
726
788
  )
727
789
  }
728
790
  ),
729
791
  /* @__PURE__ */ s(
730
- Y,
792
+ Z,
731
793
  {
732
- label: r("booking.details.mobilePhone.label"),
794
+ label: d("booking.details.mobilePhone.label"),
733
795
  required: !0,
734
- error: O.mobilePhone && !X ? r("booking.details.mobilePhone.invalid") : void 0,
796
+ error: A.mobilePhone && !me ? d("booking.details.mobilePhone.invalid") : void 0,
735
797
  children: /* @__PURE__ */ s(
736
- Ct,
798
+ Lt,
737
799
  {
738
800
  value: e.mobilePhone ?? "",
739
801
  defaultCountry: N == null ? void 0 : N.toUpperCase(),
740
- onChange: (g) => {
741
- T({ mobilePhone: g }), E("mobilePhone");
802
+ onChange: (h) => {
803
+ P({ mobilePhone: h }), B("mobilePhone");
742
804
  }
743
805
  }
744
806
  )
745
807
  }
746
808
  )
747
809
  ] }),
748
- i || n ? /* @__PURE__ */ v("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-sm)] ds:sm:grid-cols-2", children: [
810
+ i || n ? /* @__PURE__ */ f("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-sm)] ds:sm:grid-cols-2", children: [
749
811
  i ? /* @__PURE__ */ s(
750
- Y,
812
+ Z,
751
813
  {
752
- label: r("booking.details.codiceFiscale.label"),
814
+ label: d("booking.details.codiceFiscale.label"),
753
815
  required: !0,
754
- description: M.state === "pending" ? r("booking.details.codiceFiscale.checking") : r("booking.details.codiceFiscale.helper"),
755
- error: O.codiceFiscale && M.state === "invalid" ? M.hint ?? r("booking.details.codiceFiscale.invalid") : void 0,
816
+ description: x.state === "pending" ? d("booking.details.codiceFiscale.checking") : d("booking.details.codiceFiscale.helper"),
817
+ error: A.codiceFiscale && x.state === "invalid" ? x.hint ?? d("booking.details.codiceFiscale.invalid") : void 0,
756
818
  children: /* @__PURE__ */ s(
757
- ye,
819
+ Ce,
758
820
  {
759
821
  value: e.codiceFiscale ?? "",
760
822
  maxLength: 16,
761
- onChange: (g) => T({
762
- codiceFiscale: g.target.value.slice(0, 16).toUpperCase()
823
+ onChange: (h) => P({
824
+ codiceFiscale: h.target.value.slice(0, 16).toUpperCase()
763
825
  }),
764
- onBlur: () => E("codiceFiscale")
826
+ onBlur: () => B("codiceFiscale")
765
827
  }
766
828
  )
767
829
  }
768
830
  ) : null,
769
831
  n ? /* @__PURE__ */ s(
770
- Y,
832
+ Z,
771
833
  {
772
- label: r("booking.details.dateOfBirth.label"),
834
+ label: d("booking.details.dateOfBirth.label"),
773
835
  required: !0,
774
- error: O.dateOfBirth && !e.dateOfBirth ? r("booking.details.dateOfBirth.required") : void 0,
836
+ error: A.dateOfBirth && !e.dateOfBirth ? d("booking.details.dateOfBirth.required") : void 0,
775
837
  children: /* @__PURE__ */ s(
776
- It,
838
+ Et,
777
839
  {
778
840
  value: e.dateOfBirth ? new Date(e.dateOfBirth) : void 0,
779
- onChange: (g) => {
780
- T({
781
- dateOfBirth: g ? g.toISOString().slice(0, 10) : void 0
782
- }), E("dateOfBirth");
841
+ onChange: (h) => {
842
+ P({
843
+ dateOfBirth: h ? h.toISOString().slice(0, 10) : void 0
844
+ }), B("dateOfBirth");
783
845
  }
784
846
  }
785
847
  )
786
848
  }
787
849
  ) : null
788
850
  ] }) : null,
789
- U ? /* @__PURE__ */ s(
790
- Y,
851
+ Y ? /* @__PURE__ */ s(
852
+ Z,
791
853
  {
792
- label: r("booking.details.insuranceNumber.label"),
854
+ label: d("booking.details.insuranceNumber.label"),
793
855
  required: !0,
794
- description: C.state === "pending" ? r("booking.details.insuranceNumber.checking") : void 0,
795
- error: O.insuranceNumber && C.state === "invalid" ? C.hint ?? r("booking.details.insuranceNumber.invalid") : void 0,
856
+ description: S.state === "pending" ? d("booking.details.insuranceNumber.checking") : void 0,
857
+ error: A.insuranceNumber && S.state === "invalid" ? S.hint ?? d("booking.details.insuranceNumber.invalid") : void 0,
796
858
  children: /* @__PURE__ */ s(
797
- ye,
859
+ Ce,
798
860
  {
799
861
  value: e.insuranceNumber ?? "",
800
- onChange: (g) => T({ insuranceNumber: g.target.value }),
801
- onBlur: () => E("insuranceNumber")
862
+ onChange: (h) => P({ insuranceNumber: h.target.value }),
863
+ onBlur: () => B("insuranceNumber")
802
864
  }
803
865
  )
804
866
  }
805
867
  ) : null,
806
- m ? /* @__PURE__ */ s(
807
- Y,
868
+ u ? /* @__PURE__ */ s(
869
+ Z,
808
870
  {
809
- label: r("booking.details.note.label"),
810
- description: r("booking.details.note.helper", {
811
- max: We
871
+ label: d("booking.details.note.label"),
872
+ description: d("booking.details.note.helper", {
873
+ max: it
812
874
  }),
813
875
  children: /* @__PURE__ */ s(
814
- Mt,
876
+ Rt,
815
877
  {
816
878
  value: e.note ?? "",
817
- maxLength: We,
879
+ maxLength: it,
818
880
  rows: 3,
819
- onChange: (g) => T({ note: g.target.value })
881
+ onChange: (h) => P({ note: h.target.value })
820
882
  }
821
883
  )
822
884
  }
823
885
  ) : null,
824
- d ? /* @__PURE__ */ s(
825
- Re,
886
+ p ? /* @__PURE__ */ s(
887
+ Ke,
826
888
  {
827
889
  checked: !!e.returningPatient,
828
- onCheckedChange: (g) => T({ returningPatient: g === !0 }),
829
- label: r("booking.details.returningPatient.label")
890
+ onCheckedChange: (h) => P({ returningPatient: h === !0 }),
891
+ label: d("booking.details.returningPatient.label")
830
892
  }
831
893
  ) : null,
832
- /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
894
+ /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
833
895
  /* @__PURE__ */ s(
834
- Re,
896
+ Ke,
835
897
  {
836
898
  checked: !!e.privacyConsent,
837
- onCheckedChange: (g) => T({ privacyConsent: g === !0 }),
838
- label: /* @__PURE__ */ v(W, { children: [
839
- R(
899
+ onCheckedChange: (h) => P({ privacyConsent: h === !0 }),
900
+ label: /* @__PURE__ */ f(W, { children: [
901
+ Ne(
840
902
  "booking.details.consent.privacy.label",
841
- c
903
+ r
842
904
  ),
843
905
  /* @__PURE__ */ s(
844
906
  "span",
@@ -852,14 +914,14 @@ const We = 500, Ma = /^[A-Z0-9]{16}$/, Da = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Ze = 3
852
914
  }
853
915
  ),
854
916
  /* @__PURE__ */ s(
855
- Re,
917
+ Ke,
856
918
  {
857
919
  checked: !!e.termsConsent,
858
- onCheckedChange: (g) => T({ termsConsent: g === !0 }),
859
- label: /* @__PURE__ */ v(W, { children: [
860
- R(
920
+ onCheckedChange: (h) => P({ termsConsent: h === !0 }),
921
+ label: /* @__PURE__ */ f(W, { children: [
922
+ Ne(
861
923
  "booking.details.consent.terms.label",
862
- p
924
+ c
863
925
  ),
864
926
  /* @__PURE__ */ s(
865
927
  "span",
@@ -873,40 +935,40 @@ const We = 500, Ma = /^[A-Z0-9]{16}$/, Da = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Ze = 3
873
935
  }
874
936
  )
875
937
  ] }),
876
- H ? /* @__PURE__ */ s(
938
+ q ? /* @__PURE__ */ s(
877
939
  "div",
878
940
  {
879
941
  "data-component": "booking-confirmation-channels",
880
942
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
881
943
  children: /* @__PURE__ */ s(
882
- Nt,
944
+ Bt,
883
945
  {
884
- label: r("booking.confirmation.heading"),
885
- helperText: r("booking.confirmation.helper"),
886
- value: se,
887
- onChange: (g) => T({
888
- confirmationChannels: g
946
+ label: d("booking.confirmation.heading"),
947
+ helperText: d("booking.confirmation.helper"),
948
+ value: ee,
949
+ onChange: (h) => P({
950
+ confirmationChannels: h
889
951
  }),
890
952
  orientation: "vertical",
891
- options: J.map((g) => ({
892
- value: g,
893
- label: r(`booking.confirmation.channel.${g}`)
953
+ options: Q.map((h) => ({
954
+ value: h,
955
+ label: d(`booking.confirmation.channel.${h}`)
894
956
  })),
895
- error: be ? r("booking.confirmation.atLeastOne") : void 0
957
+ error: xe ? d("booking.confirmation.atLeastOne") : void 0
896
958
  }
897
959
  )
898
960
  }
899
961
  ) : null,
900
- b ? /* @__PURE__ */ s($, { variant: "error", children: /* @__PURE__ */ s($.Description, { children: b }) }) : null,
962
+ y ? /* @__PURE__ */ s(z, { variant: "error", children: /* @__PURE__ */ s(z.Description, { children: y }) }) : null,
901
963
  /* @__PURE__ */ s(
902
- ae,
964
+ ie,
903
965
  {
904
966
  intent: "primary",
905
967
  size: "md",
906
968
  type: "submit",
907
- disabled: !ie,
908
- startIcon: k ? /* @__PURE__ */ s(Dt, { size: "sm" }) : void 0,
909
- children: r("booking.details.submit")
969
+ disabled: !oe,
970
+ startIcon: I ? /* @__PURE__ */ s(Ft, { size: "sm" }) : void 0,
971
+ children: d("booking.details.submit")
910
972
  }
911
973
  )
912
974
  ]
@@ -914,8 +976,8 @@ const We = 500, Ma = /^[A-Z0-9]{16}$/, Da = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Ze = 3
914
976
  );
915
977
  }
916
978
  );
917
- ze.displayName = "BookingDetailsForm";
918
- const _a = we(
979
+ Ye.displayName = "BookingDetailsForm";
980
+ const za = Pe(
919
981
  "ds:flex ds:w-full ds:flex-col ds:text-[var(--foreground)]",
920
982
  {
921
983
  variants: {
@@ -943,40 +1005,40 @@ const _a = we(
943
1005
  },
944
1006
  defaultVariants: { variant: "inline-list", surface: "flat" }
945
1007
  }
946
- ), Ta = [
1008
+ ), Ka = [
947
1009
  [
948
1010
  /\b(estetic|aesthetic|botox|filler|mesoterap|chirurgia\s*plastic)/i,
949
- Ye
1011
+ st
950
1012
  ],
951
- [/\b(cardio|ecg|elettrocardio|ecocardio|cuore|heart)/i, Ft],
952
- [/\b(dent|odonto|tooth|teeth|pulizia|igien|smile)/i, ua],
953
- [/\b(oftalmo|ocul|ophthal|vision|occhi|eye)/i, $t],
954
- [/\b(otorin|udito|orecchi|hearing|ear)/i, ta],
955
- [/\b(neuro|brain|cervello)/i, Wt],
956
- [/\b(pediatr|child|bambin)/i, Ht],
957
- [/\b(ortop|ortho|osteo|skeleton|ossa|bone)/i, Ut],
958
- [/\b(lab|analis|test|sang|esami)/i, sa],
959
- [/\b(farmaco|pharm|pillol|refill)/i, na],
960
- [/\b(chirurg|surg|intervent|operat)/i, la],
961
- [/\b(scan|rx|x-?ray|raggi|imag|radio|risonan|ecograf|ultras)/i, ra],
962
- [/\b(vacc|inject|inie|punto)/i, Ye],
963
- [/\b(derma|skin|pelle)/i, zt],
964
- [/\b(prima\s*visit|first\s*visit|consult|consulto|valutaz)/i, Qt],
965
- [/\b(general|medicin|family|control|check[-\s]?up)/i, jt]
1013
+ [/\b(cardio|ecg|elettrocardio|ecocardio|cuore|heart)/i, Wt],
1014
+ [/\b(dent|odonto|tooth|teeth|pulizia|igien|smile)/i, Ia],
1015
+ [/\b(oftalmo|ocul|ophthal|vision|occhi|eye)/i, Xt],
1016
+ [/\b(otorin|udito|orecchi|hearing|ear)/i, ma],
1017
+ [/\b(neuro|brain|cervello)/i, ra],
1018
+ [/\b(pediatr|child|bambin)/i, sa],
1019
+ [/\b(ortop|ortho|osteo|skeleton|ossa|bone)/i, na],
1020
+ [/\b(lab|analis|test|sang|esami)/i, fa],
1021
+ [/\b(farmaco|pharm|pillol|refill)/i, va],
1022
+ [/\b(chirurg|surg|intervent|operat)/i, xa],
1023
+ [/\b(scan|rx|x-?ray|raggi|imag|radio|risonan|ecograf|ultras)/i, ya],
1024
+ [/\b(vacc|inject|inie|punto)/i, st],
1025
+ [/\b(derma|skin|pelle)/i, Qt],
1026
+ [/\b(prima\s*visit|first\s*visit|consult|consulto|valutaz)/i, ua],
1027
+ [/\b(general|medicin|family|control|check[-\s]?up)/i, ta]
966
1028
  ];
967
- function Aa(e) {
968
- for (const [t, a] of Ta)
1029
+ function ja(e) {
1030
+ for (const [t, a] of Ka)
969
1031
  if (t.test(e)) return a;
970
1032
  return null;
971
1033
  }
972
- function Ba(e) {
973
- const t = Aa(e.label) ?? Lt;
1034
+ function qa(e) {
1035
+ const t = ja(e.label) ?? Zt;
974
1036
  return /* @__PURE__ */ s(t, { "aria-hidden": "true", className: "ds:size-5" });
975
1037
  }
976
- function fe(e) {
977
- return Ne(e, "yyyy-MM-dd");
1038
+ function ae(e) {
1039
+ return _e(e, "yyyy-MM-dd");
978
1040
  }
979
- const Oa = [
1041
+ const Ha = [
980
1042
  "ds:relative ds:flex ds:items-center ds:justify-center",
981
1043
  "ds:min-h-[var(--min-target-size)] ds:min-w-[var(--min-target-size)]",
982
1044
  "ds:rounded-[var(--radius-sm)]",
@@ -986,7 +1048,7 @@ const Oa = [
986
1048
  "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
987
1049
  "ds:focus-visible:outline-[var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
988
1050
  "ds:forced-colors:focus-visible:outline-[CanvasText]"
989
- ].join(" "), Pa = we(Oa, {
1051
+ ].join(" "), Ga = Pe(Ha, {
990
1052
  variants: {
991
1053
  state: {
992
1054
  available: "ds:cursor-pointer ds:text-[var(--foreground)] ds:hover:bg-[var(--muted)]/30",
@@ -997,93 +1059,93 @@ const Oa = [
997
1059
  },
998
1060
  defaultVariants: { state: "unavailable" }
999
1061
  });
1000
- function Ea({
1062
+ function Ua({
1001
1063
  availableDates: e,
1002
1064
  selectedDate: t,
1003
1065
  onSelectDate: a,
1004
1066
  locale: i,
1005
1067
  loading: n
1006
1068
  }) {
1007
- const { t: o } = A(), l = w(() => t ? ge(K(t)) : e.length > 0 ? ge(K(e[0])) : ge(/* @__PURE__ */ new Date()), [t, e]), [m, d] = j(l), [c, p] = j(null), u = w(() => {
1008
- const b = ge(m), f = Bt(m), r = b.getDay(), _ = f.getDate(), M = [];
1009
- for (let y = r; y > 0; y -= 1) {
1010
- const C = new Date(b);
1011
- C.setDate(b.getDate() - y), M.push(C);
1069
+ const { t: o } = O(), l = w(() => t ? ye(F(t)) : e.length > 0 ? ye(F(e[0])) : ye(/* @__PURE__ */ new Date()), [t, e]), [u, p] = K(l), [r, c] = K(null), m = w(() => {
1070
+ const y = ye(u), b = qt(u), d = y.getDay(), _ = b.getDate(), x = [];
1071
+ for (let g = d; g > 0; g -= 1) {
1072
+ const S = new Date(y);
1073
+ S.setDate(y.getDate() - g), x.push(S);
1012
1074
  }
1013
- for (let y = 0; y < _; y += 1) {
1014
- const C = new Date(b);
1015
- C.setDate(b.getDate() + y), M.push(C);
1075
+ for (let g = 0; g < _; g += 1) {
1076
+ const S = new Date(y);
1077
+ S.setDate(y.getDate() + g), x.push(S);
1016
1078
  }
1017
- for (; M.length < 42; ) {
1018
- const y = M[M.length - 1], C = new Date(y);
1019
- C.setDate(y.getDate() + 1), M.push(C);
1079
+ for (; x.length < 42; ) {
1080
+ const g = x[x.length - 1], S = new Date(g);
1081
+ S.setDate(g.getDate() + 1), x.push(S);
1020
1082
  }
1021
- return M;
1022
- }, [m]), S = w(() => {
1083
+ return x;
1084
+ }, [u]), k = w(() => {
1023
1085
  try {
1024
1086
  return new Intl.DateTimeFormat(i, {
1025
1087
  month: "long",
1026
1088
  year: "numeric"
1027
- }).format(m);
1089
+ }).format(u);
1028
1090
  } catch {
1029
- return Ne(m, "MMMM yyyy");
1091
+ return _e(u, "MMMM yyyy");
1030
1092
  }
1031
- }, [m, i]), k = w(() => {
1032
- const b = new Date(2024, 0, 7);
1033
- return Array.from({ length: 7 }, (f, r) => {
1034
- const _ = new Date(b);
1035
- _.setDate(b.getDate() + r);
1093
+ }, [u, i]), I = w(() => {
1094
+ const y = new Date(2024, 0, 7);
1095
+ return Array.from({ length: 7 }, (b, d) => {
1096
+ const _ = new Date(y);
1097
+ _.setDate(y.getDate() + d);
1036
1098
  try {
1037
1099
  return new Intl.DateTimeFormat(i, { weekday: "short" }).format(_);
1038
1100
  } catch {
1039
- return Ne(_, "EEE");
1101
+ return _e(_, "EEE");
1040
1102
  }
1041
1103
  });
1042
- }, [i]), h = w(() => new Set(e), [e]), N = q(
1043
- (b) => h.has(fe(b)),
1044
- [h]
1045
- ), x = w(() => {
1046
- if (c) return c;
1047
- if (t) return K(t);
1048
- const b = u.find(
1049
- (f) => ke(f, m) && N(f)
1104
+ }, [i]), v = w(() => new Set(e), [e]), N = j(
1105
+ (y) => v.has(ae(y)),
1106
+ [v]
1107
+ ), M = w(() => {
1108
+ if (r) return r;
1109
+ if (t) return F(t);
1110
+ const y = m.find(
1111
+ (b) => Me(b, u) && N(b)
1050
1112
  );
1051
- return b || (u.find((f) => ke(f, m)) ?? null);
1052
- }, [c, t, u, m, N]), D = q(
1053
- (b, f) => {
1054
- let r = null;
1055
- switch (b.key) {
1113
+ return y || (m.find((b) => Me(b, u)) ?? null);
1114
+ }, [r, t, m, u, N]), D = j(
1115
+ (y, b) => {
1116
+ let d = null;
1117
+ switch (y.key) {
1056
1118
  case "ArrowLeft":
1057
- r = new Date(f), r.setDate(f.getDate() - 1);
1119
+ d = new Date(b), d.setDate(b.getDate() - 1);
1058
1120
  break;
1059
1121
  case "ArrowRight":
1060
- r = new Date(f), r.setDate(f.getDate() + 1);
1122
+ d = new Date(b), d.setDate(b.getDate() + 1);
1061
1123
  break;
1062
1124
  case "ArrowUp":
1063
- r = new Date(f), r.setDate(f.getDate() - 7);
1125
+ d = new Date(b), d.setDate(b.getDate() - 7);
1064
1126
  break;
1065
1127
  case "ArrowDown":
1066
- r = new Date(f), r.setDate(f.getDate() + 7);
1128
+ d = new Date(b), d.setDate(b.getDate() + 7);
1067
1129
  break;
1068
1130
  case "Home":
1069
- r = new Date(f), r.setDate(f.getDate() - f.getDay());
1131
+ d = new Date(b), d.setDate(b.getDate() - b.getDay());
1070
1132
  break;
1071
1133
  case "End":
1072
- r = new Date(f), r.setDate(f.getDate() + (6 - f.getDay()));
1134
+ d = new Date(b), d.setDate(b.getDate() + (6 - b.getDay()));
1073
1135
  break;
1074
1136
  case "Enter":
1075
1137
  case " ": {
1076
- b.preventDefault(), N(f) && a(fe(f));
1138
+ y.preventDefault(), N(b) && a(ae(b));
1077
1139
  return;
1078
1140
  }
1079
1141
  default:
1080
1142
  return;
1081
1143
  }
1082
- r && (b.preventDefault(), ke(r, m) || d(ge(r)), p(r));
1144
+ d && (y.preventDefault(), Me(d, u) || p(ye(d)), c(d));
1083
1145
  },
1084
- [N, a, m]
1146
+ [N, a, u]
1085
1147
  );
1086
- return n ? /* @__PURE__ */ v(
1148
+ return n ? /* @__PURE__ */ f(
1087
1149
  "div",
1088
1150
  {
1089
1151
  role: "status",
@@ -1091,22 +1153,22 @@ function Ea({
1091
1153
  "aria-label": o("common.loading"),
1092
1154
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
1093
1155
  children: [
1094
- /* @__PURE__ */ s(Ie, { variant: "text", width: "40%" }),
1095
- /* @__PURE__ */ s("div", { className: "ds:grid ds:grid-cols-7 ds:gap-[var(--spacing-2xs)]", children: Array.from({ length: 42 }, (b, f) => /* @__PURE__ */ s(Ie, { variant: "rounded", height: "2.5rem" }, `mg-skel-${f}`)) })
1156
+ /* @__PURE__ */ s(Te, { variant: "text", width: "40%" }),
1157
+ /* @__PURE__ */ s("div", { className: "ds:grid ds:grid-cols-7 ds:gap-[var(--spacing-2xs)]", children: Array.from({ length: 42 }, (y, b) => /* @__PURE__ */ s(Te, { variant: "rounded", height: "2.5rem" }, `mg-skel-${b}`)) })
1096
1158
  ]
1097
1159
  }
1098
- ) : /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1099
- /* @__PURE__ */ v("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
1160
+ ) : /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1161
+ /* @__PURE__ */ f("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
1100
1162
  /* @__PURE__ */ s(
1101
- Ge,
1163
+ tt,
1102
1164
  {
1103
- icon: /* @__PURE__ */ s(Pt, {}),
1165
+ icon: /* @__PURE__ */ s(Gt, {}),
1104
1166
  "aria-label": o("booking.previousMonth"),
1105
1167
  size: "sm",
1106
1168
  intent: "ghost",
1107
1169
  flipIconInRtl: !0,
1108
1170
  onClick: () => {
1109
- d((b) => fa(b)), p(null);
1171
+ p((y) => Ma(y)), c(null);
1110
1172
  }
1111
1173
  }
1112
1174
  ),
@@ -1115,24 +1177,24 @@ function Ea({
1115
1177
  {
1116
1178
  className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)]",
1117
1179
  "aria-live": "polite",
1118
- children: S
1180
+ children: k
1119
1181
  }
1120
1182
  ),
1121
1183
  /* @__PURE__ */ s(
1122
- Ge,
1184
+ tt,
1123
1185
  {
1124
- icon: /* @__PURE__ */ s(Et, {}),
1186
+ icon: /* @__PURE__ */ s(Ut, {}),
1125
1187
  "aria-label": o("booking.nextMonth"),
1126
1188
  size: "sm",
1127
1189
  intent: "ghost",
1128
1190
  flipIconInRtl: !0,
1129
1191
  onClick: () => {
1130
- d((b) => et(b, 1)), p(null);
1192
+ p((y) => lt(y, 1)), c(null);
1131
1193
  }
1132
1194
  }
1133
1195
  )
1134
1196
  ] }),
1135
- /* @__PURE__ */ v(
1197
+ /* @__PURE__ */ f(
1136
1198
  "div",
1137
1199
  {
1138
1200
  role: "grid",
@@ -1144,30 +1206,30 @@ function Ea({
1144
1206
  {
1145
1207
  role: "row",
1146
1208
  className: "ds:grid ds:grid-cols-7 ds:gap-[var(--spacing-2xs)]",
1147
- children: k.map((b, f) => /* @__PURE__ */ s(
1209
+ children: I.map((y, b) => /* @__PURE__ */ s(
1148
1210
  "div",
1149
1211
  {
1150
1212
  role: "columnheader",
1151
1213
  className: "type-meta ds:text-center ds:text-[var(--muted-foreground)] ds:font-[var(--font-weight-medium)]",
1152
- children: b
1214
+ children: y
1153
1215
  },
1154
- `wd-${f}`
1216
+ `wd-${b}`
1155
1217
  ))
1156
1218
  }
1157
1219
  ),
1158
- Array.from({ length: 6 }, (b, f) => /* @__PURE__ */ s(
1220
+ Array.from({ length: 6 }, (y, b) => /* @__PURE__ */ s(
1159
1221
  "div",
1160
1222
  {
1161
1223
  role: "row",
1162
1224
  className: "ds:grid ds:grid-cols-7 ds:gap-[var(--spacing-2xs)]",
1163
- children: u.slice(f * 7, f * 7 + 7).map((r, _) => {
1164
- const M = f * 7 + _, y = ke(r, m), C = y && N(r), B = t ? Ue(r, K(t)) : !1, O = y ? B ? "selected" : C ? "available" : "unavailable" : "outside", Z = x ? Ue(x, r) : !1, E = (() => {
1225
+ children: m.slice(b * 7, b * 7 + 7).map((d, _) => {
1226
+ const x = b * 7 + _, g = Me(d, u), S = g && N(d), T = t ? at(d, F(t)) : !1, A = g ? T ? "selected" : S ? "available" : "unavailable" : "outside", G = M ? at(M, d) : !1, B = (() => {
1165
1227
  try {
1166
1228
  return new Intl.DateTimeFormat(i, {
1167
1229
  dateStyle: "full"
1168
- }).format(r);
1230
+ }).format(d);
1169
1231
  } catch {
1170
- return Ne(r, "PPP");
1232
+ return _e(d, "PPP");
1171
1233
  }
1172
1234
  })();
1173
1235
  return /* @__PURE__ */ s(
@@ -1175,30 +1237,30 @@ function Ea({
1175
1237
  {
1176
1238
  type: "button",
1177
1239
  role: "gridcell",
1178
- "aria-label": E,
1179
- "aria-selected": B || void 0,
1180
- "aria-disabled": !C || void 0,
1181
- tabIndex: Z ? 0 : -1,
1182
- disabled: !C,
1240
+ "aria-label": B,
1241
+ "aria-selected": T || void 0,
1242
+ "aria-disabled": !S || void 0,
1243
+ tabIndex: G ? 0 : -1,
1244
+ disabled: !S,
1183
1245
  onClick: () => {
1184
- C && a(fe(r));
1246
+ S && a(ae(d));
1185
1247
  },
1186
- onKeyDown: (z) => D(z, r),
1187
- className: Pa({ state: O }),
1188
- children: /* @__PURE__ */ s("span", { "aria-hidden": "true", children: r.getDate() })
1248
+ onKeyDown: (E) => D(E, d),
1249
+ className: Ga({ state: A }),
1250
+ children: /* @__PURE__ */ s("span", { "aria-hidden": "true", children: d.getDate() })
1189
1251
  },
1190
- `mg-cell-${M}`
1252
+ `mg-cell-${x}`
1191
1253
  );
1192
1254
  })
1193
1255
  },
1194
- `mg-row-${f}`
1256
+ `mg-row-${b}`
1195
1257
  ))
1196
1258
  ]
1197
1259
  }
1198
1260
  )
1199
1261
  ] });
1200
1262
  }
1201
- const Ra = we(
1263
+ const Ya = Pe(
1202
1264
  [
1203
1265
  "ds:relative ds:flex ds:w-full ds:items-center ds:gap-[var(--spacing-md)]",
1204
1266
  "ds:min-h-[var(--min-target-size)]",
@@ -1224,57 +1286,57 @@ const Ra = we(
1224
1286
  defaultVariants: { state: "idle" }
1225
1287
  }
1226
1288
  );
1227
- function Va({
1289
+ function Ja({
1228
1290
  services: e,
1229
1291
  selectedServiceId: t,
1230
1292
  onSelect: a
1231
1293
  }) {
1232
- const { t: i } = A(), n = Xe(), [o, l] = j(() => {
1294
+ const { t: i } = O(), n = rt(), [o, l] = K(() => {
1233
1295
  if (t) {
1234
- const p = e.findIndex((u) => u.id === t);
1235
- if (p >= 0) return p;
1296
+ const c = e.findIndex((m) => m.id === t);
1297
+ if (c >= 0) return c;
1236
1298
  }
1237
1299
  return 0;
1238
- }), m = te(/* @__PURE__ */ new Map()), d = q((p) => {
1239
- var u;
1240
- (u = m.current.get(p)) == null || u.focus();
1241
- }, []), c = q(
1242
- (p, u, S) => {
1243
- const k = e.length;
1244
- if (k !== 0)
1245
- switch (p.key) {
1300
+ }), u = se(/* @__PURE__ */ new Map()), p = j((c) => {
1301
+ var m;
1302
+ (m = u.current.get(c)) == null || m.focus();
1303
+ }, []), r = j(
1304
+ (c, m, k) => {
1305
+ const I = e.length;
1306
+ if (I !== 0)
1307
+ switch (c.key) {
1246
1308
  case "ArrowDown":
1247
1309
  case "ArrowRight": {
1248
- p.preventDefault();
1249
- const h = (u + 1) % k;
1250
- l(h), d(h);
1310
+ c.preventDefault();
1311
+ const v = (m + 1) % I;
1312
+ l(v), p(v);
1251
1313
  break;
1252
1314
  }
1253
1315
  case "ArrowUp":
1254
1316
  case "ArrowLeft": {
1255
- p.preventDefault();
1256
- const h = (u - 1 + k) % k;
1257
- l(h), d(h);
1317
+ c.preventDefault();
1318
+ const v = (m - 1 + I) % I;
1319
+ l(v), p(v);
1258
1320
  break;
1259
1321
  }
1260
1322
  case "Home": {
1261
- p.preventDefault(), l(0), d(0);
1323
+ c.preventDefault(), l(0), p(0);
1262
1324
  break;
1263
1325
  }
1264
1326
  case "End": {
1265
- p.preventDefault();
1266
- const h = k - 1;
1267
- l(h), d(h);
1327
+ c.preventDefault();
1328
+ const v = I - 1;
1329
+ l(v), p(v);
1268
1330
  break;
1269
1331
  }
1270
1332
  case "Enter":
1271
1333
  case " ": {
1272
- p.preventDefault(), a(S);
1334
+ c.preventDefault(), a(k);
1273
1335
  break;
1274
1336
  }
1275
1337
  }
1276
1338
  },
1277
- [e.length, d, a]
1339
+ [e.length, p, a]
1278
1340
  );
1279
1341
  return e.length === 0 ? null : /* @__PURE__ */ s(
1280
1342
  "div",
@@ -1283,27 +1345,27 @@ function Va({
1283
1345
  "aria-label": i("booking.serviceListLabel"),
1284
1346
  id: n,
1285
1347
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
1286
- children: e.map((p, u) => {
1287
- const S = t === p.id, k = o === u, h = i("booking.serviceCardLabel", {
1288
- label: p.label,
1289
- duration: p.durationMin
1290
- }), N = Ba(p);
1291
- return /* @__PURE__ */ v(
1348
+ children: e.map((c, m) => {
1349
+ const k = t === c.id, I = o === m, v = i("booking.serviceCardLabel", {
1350
+ label: c.label,
1351
+ duration: c.durationMin
1352
+ }), N = qa(c);
1353
+ return /* @__PURE__ */ f(
1292
1354
  "button",
1293
1355
  {
1294
- ref: (x) => {
1295
- x ? m.current.set(u, x) : m.current.delete(u);
1356
+ ref: (M) => {
1357
+ M ? u.current.set(m, M) : u.current.delete(m);
1296
1358
  },
1297
1359
  type: "button",
1298
1360
  role: "radio",
1299
- "aria-checked": S,
1300
- "aria-label": h,
1301
- tabIndex: k ? 0 : -1,
1302
- onClick: () => a(p.id),
1303
- onFocus: () => l(u),
1304
- onKeyDown: (x) => c(x, u, p.id),
1305
- className: Ra({
1306
- state: S ? "selected" : "idle"
1361
+ "aria-checked": k,
1362
+ "aria-label": v,
1363
+ tabIndex: I ? 0 : -1,
1364
+ onClick: () => a(c.id),
1365
+ onFocus: () => l(m),
1366
+ onKeyDown: (M) => r(M, m, c.id),
1367
+ className: Ya({
1368
+ state: k ? "selected" : "idle"
1307
1369
  }),
1308
1370
  children: [
1309
1371
  /* @__PURE__ */ s(
@@ -1314,19 +1376,19 @@ function Va({
1314
1376
  children: N
1315
1377
  }
1316
1378
  ),
1317
- /* @__PURE__ */ v("span", { className: "ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
1318
- /* @__PURE__ */ s("span", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)]", children: p.label }),
1319
- /* @__PURE__ */ s("span", { className: "type-meta ds:text-[var(--muted-foreground)]", children: i("booking.serviceSummary", { minutes: p.durationMin }) })
1379
+ /* @__PURE__ */ f("span", { className: "ds:flex ds:min-w-0 ds:flex-1 ds:flex-col ds:gap-[var(--spacing-2xs)]", children: [
1380
+ /* @__PURE__ */ s("span", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)]", children: c.label }),
1381
+ /* @__PURE__ */ s("span", { className: "type-meta ds:text-[var(--muted-foreground)]", children: i("booking.serviceSummary", { minutes: c.durationMin }) })
1320
1382
  ] })
1321
1383
  ]
1322
1384
  },
1323
- p.id
1385
+ c.id
1324
1386
  );
1325
1387
  })
1326
1388
  }
1327
1389
  );
1328
1390
  }
1329
- const La = we(
1391
+ const Za = Pe(
1330
1392
  [
1331
1393
  "ds:inline-flex ds:items-center ds:justify-center ds:gap-[var(--spacing-2xs)]",
1332
1394
  "ds:min-h-[var(--min-target-size)]",
@@ -1352,16 +1414,16 @@ const La = we(
1352
1414
  defaultVariants: { state: "idle" }
1353
1415
  }
1354
1416
  );
1355
- function Fa(e) {
1417
+ function Wa(e) {
1356
1418
  const [t] = e.split(":").map((i) => parseInt(i, 10)), a = Number.isFinite(t) ? t : 0;
1357
1419
  return a < 12 ? "morning" : a < 17 ? "afternoon" : "evening";
1358
1420
  }
1359
- const $a = {
1360
- morning: Vt,
1361
- afternoon: pa,
1362
- evening: Rt
1421
+ const Xa = {
1422
+ morning: Jt,
1423
+ afternoon: wa,
1424
+ evening: Yt
1363
1425
  };
1364
- function za({
1426
+ function Qa({
1365
1427
  date: e,
1366
1428
  slots: t,
1367
1429
  selectedSlotKey: a,
@@ -1369,225 +1431,246 @@ function za({
1369
1431
  loading: n,
1370
1432
  locale: o
1371
1433
  }) {
1372
- const { t: l } = A(), m = w(() => {
1434
+ const { t: l } = O(), u = w(() => {
1373
1435
  try {
1374
1436
  return new Intl.DateTimeFormat(o, {
1375
1437
  weekday: "long",
1376
1438
  day: "numeric",
1377
1439
  month: "long"
1378
- }).format(K(e));
1440
+ }).format(F(e));
1379
1441
  } catch {
1380
1442
  return e;
1381
1443
  }
1382
- }, [e, o]), d = w(() => {
1383
- const u = {
1444
+ }, [e, o]), p = w(() => {
1445
+ const m = {
1384
1446
  morning: [],
1385
1447
  afternoon: [],
1386
1448
  evening: []
1387
1449
  };
1388
- for (const S of t)
1389
- u[Fa(S.time)].push(S);
1390
- return u;
1391
- }, [t]), c = t.filter((u) => u.available).length, p = ["morning", "afternoon", "evening"];
1392
- return n ? /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1393
- /* @__PURE__ */ s(Ie, { variant: "text", width: "60%" }),
1394
- [0, 1].map((u) => /* @__PURE__ */ s(
1450
+ for (const k of t)
1451
+ m[Wa(k.time)].push(k);
1452
+ return m;
1453
+ }, [t]), r = t.filter((m) => m.available).length, c = ["morning", "afternoon", "evening"];
1454
+ return n ? /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1455
+ /* @__PURE__ */ s(Te, { variant: "text", width: "60%" }),
1456
+ [0, 1].map((m) => /* @__PURE__ */ s(
1395
1457
  "div",
1396
1458
  {
1397
1459
  className: "ds:grid ds:grid-cols-3 ds:gap-[var(--spacing-xs)]",
1398
- children: [0, 1, 2].map((S) => /* @__PURE__ */ s(Ie, { variant: "rounded", height: "44px" }, S))
1460
+ children: [0, 1, 2].map((k) => /* @__PURE__ */ s(Te, { variant: "rounded", height: "44px" }, k))
1399
1461
  },
1400
- u
1462
+ m
1401
1463
  ))
1402
- ] }) : c === 0 ? /* @__PURE__ */ s(Qe, { variant: "no-results", title: l("booking.noSlotsForDate") }) : /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
1403
- /* @__PURE__ */ v("div", { className: "ds:flex ds:items-baseline ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
1404
- /* @__PURE__ */ v("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
1464
+ ] }) : r === 0 ? /* @__PURE__ */ s(dt, { variant: "no-results", title: l("booking.noSlotsForDate") }) : /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
1465
+ /* @__PURE__ */ f("div", { className: "ds:flex ds:items-baseline ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
1466
+ /* @__PURE__ */ f("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
1405
1467
  /* @__PURE__ */ s(
1406
- Jt,
1468
+ la,
1407
1469
  {
1408
1470
  "aria-hidden": "true",
1409
1471
  className: "ds:size-4 ds:text-[color:var(--accent)]"
1410
1472
  }
1411
1473
  ),
1412
- /* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: m })
1474
+ /* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: u })
1413
1475
  ] }),
1414
- /* @__PURE__ */ s("span", { className: "type-meta ds:text-[var(--muted-foreground)]", children: l("booking.slotsAvailable", { count: c }) })
1476
+ /* @__PURE__ */ s("span", { className: "type-meta ds:text-[var(--muted-foreground)]", children: l("booking.slotsAvailable", { count: r }) })
1415
1477
  ] }),
1416
- p.map((u) => {
1417
- const S = d[u];
1418
- if (S.length === 0) return null;
1419
- const k = $a[u];
1420
- return /* @__PURE__ */ v(
1478
+ c.map((m) => {
1479
+ const k = p[m];
1480
+ if (k.length === 0) return null;
1481
+ const I = Xa[m];
1482
+ return /* @__PURE__ */ f(
1421
1483
  "div",
1422
1484
  {
1423
1485
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
1424
1486
  children: [
1425
- /* @__PURE__ */ v("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:text-[color:var(--muted-foreground)]", children: [
1426
- /* @__PURE__ */ s(k, { "aria-hidden": "true", className: "ds:size-3.5" }),
1427
- /* @__PURE__ */ s("span", { className: "type-meta ds:font-[var(--font-weight-semibold)] ds:uppercase", children: l(`booking.timeOfDay.${u}`) })
1487
+ /* @__PURE__ */ f("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)] ds:text-[color:var(--muted-foreground)]", children: [
1488
+ /* @__PURE__ */ s(I, { "aria-hidden": "true", className: "ds:size-3.5" }),
1489
+ /* @__PURE__ */ s("span", { className: "type-meta ds:font-[var(--font-weight-semibold)] ds:uppercase", children: l(`booking.timeOfDay.${m}`) })
1428
1490
  ] }),
1429
1491
  /* @__PURE__ */ s(
1430
1492
  "div",
1431
1493
  {
1432
1494
  role: "group",
1433
- "aria-label": l(`booking.timeOfDay.${u}`),
1495
+ "aria-label": l(`booking.timeOfDay.${m}`),
1434
1496
  className: "ds:grid ds:grid-cols-3 ds:gap-[var(--spacing-xs)] ds:sm:grid-cols-4",
1435
- children: S.map((h) => {
1436
- const N = h.key === a, x = h.available ? N ? "selected" : "idle" : "unavailable";
1497
+ children: k.map((v) => {
1498
+ const N = v.key === a, M = v.available ? N ? "selected" : "idle" : "unavailable";
1437
1499
  return /* @__PURE__ */ s(
1438
1500
  "button",
1439
1501
  {
1440
1502
  type: "button",
1441
- "data-slot-id": h.key,
1442
- disabled: !h.available,
1503
+ "data-slot-id": v.key,
1504
+ disabled: !v.available,
1443
1505
  "aria-pressed": N,
1444
1506
  "aria-label": l("booking.slotAvailableLabel", {
1445
- time: h.time
1507
+ time: v.time
1446
1508
  }),
1447
- onClick: () => h.available && i(h),
1448
- className: La({ state: x }),
1449
- children: h.time
1509
+ onClick: () => v.available && i(v),
1510
+ className: Za({ state: M }),
1511
+ children: v.time
1450
1512
  },
1451
- h.key
1513
+ v.key
1452
1514
  );
1453
1515
  })
1454
1516
  }
1455
1517
  )
1456
1518
  ]
1457
1519
  },
1458
- u
1520
+ m
1459
1521
  );
1460
1522
  })
1461
1523
  ] });
1462
1524
  }
1463
- const Se = 4;
1464
- function Ka({
1525
+ const Ae = 4;
1526
+ function es({
1465
1527
  availableDates: e,
1466
1528
  availableSlots: t,
1467
1529
  value: a,
1468
1530
  onChange: i,
1469
1531
  onDateSelect: n,
1470
- loadingDates: o,
1471
- loadingSlots: l,
1472
- locale: m
1532
+ onWindowChange: o,
1533
+ loadingDates: l,
1534
+ loadingSlots: u,
1535
+ locale: p
1473
1536
  }) {
1474
- const d = w(() => Ve(/* @__PURE__ */ new Date()), []), [c, p] = j(() => {
1537
+ const r = w(() => le(/* @__PURE__ */ new Date()), []), [c, m] = K(() => {
1475
1538
  if (a.date) {
1476
- const f = Ve(K(a.date));
1477
- if (!pe(d, f)) return f;
1539
+ const g = le(F(a.date));
1540
+ if (!ce(r, g)) return g;
1478
1541
  }
1479
1542
  if (e.length > 0) {
1480
- const f = Ve(K(e[0]));
1481
- if (pe(f, d)) return f;
1543
+ const g = le(F(e[0]));
1544
+ if (ce(g, r)) return g;
1482
1545
  }
1483
- return d;
1484
- }), u = w(
1485
- () => Le(c, Se - 1),
1546
+ return r;
1547
+ }), k = w(
1548
+ () => je(c, Ae - 1),
1486
1549
  [c]
1487
- ), S = w(() => Array.from({ length: Se }, (f, r) => {
1488
- const _ = Le(c, r), M = fe(_), C = (t[M] ?? []).map((B) => ({
1489
- id: B.key,
1550
+ ), I = w(() => Array.from({ length: Ae }, (g, S) => {
1551
+ const T = je(c, S), A = ae(T), B = (t[A] ?? []).map((E) => ({
1552
+ id: E.key,
1490
1553
  // SlotGrid formats `start` as a time via Intl.DateTimeFormat —
1491
1554
  // compose a full ISO from the column's date + the slot's HH:mm
1492
1555
  // so the locale-formatter has a real timestamp to work with.
1493
- start: `${M}T${B.time}:00`,
1494
- available: B.available
1556
+ start: `${A}T${E.time}:00`,
1557
+ available: E.available
1495
1558
  }));
1496
- return { date: M, slots: C };
1497
- }), [c, t]), k = pe(c, d), h = w(
1498
- () => e.some((f) => pe(K(f), u)),
1499
- [e, u]
1500
- ), N = q(() => {
1501
- p((f) => {
1502
- const r = Ot(f, Se);
1503
- return pe(d, r) ? d : r;
1559
+ return { date: A, slots: B };
1560
+ }), [c, t]), v = ce(c, r), N = !0, M = j(() => {
1561
+ m((g) => {
1562
+ const S = Ht(g, Ae);
1563
+ return ce(r, S) ? r : S;
1504
1564
  });
1505
- }, [d]), x = q(() => {
1506
- p((f) => Le(f, Se));
1507
- }, []), D = q(
1508
- (f, r) => {
1509
- const _ = typeof r.date == "string" ? r.date : fe(r.date);
1565
+ }, [r]), D = j(() => {
1566
+ m((g) => je(g, Ae));
1567
+ }, []);
1568
+ H(() => {
1569
+ if (e.length === 0) return;
1570
+ const g = le(F(e[0]));
1571
+ !ce(g, r) || e.some((T) => {
1572
+ const A = le(F(T));
1573
+ return !ce(A, k) && !jt(A, c);
1574
+ }) || m(g);
1575
+ }, [e]), H(() => {
1576
+ o == null || o(ae(c), ae(k));
1577
+ }, [c, k, o]);
1578
+ const y = j(
1579
+ (g, S) => {
1580
+ const T = typeof S.date == "string" ? S.date : ae(S.date);
1510
1581
  i({
1511
- ...nt(Me(a, _), f.id)
1512
- }), n == null || n(_);
1582
+ ...vt(Ee(a, T), g.id)
1583
+ }), n == null || n(T);
1513
1584
  },
1514
1585
  [i, n, a]
1515
- );
1516
- return /* @__PURE__ */ s(
1517
- At,
1518
- {
1519
- days: S,
1520
- state: o || l ? "loading" : "default",
1521
- selectedSlotId: a.slotKey,
1522
- maxInitialSlotsPerDay: 6,
1523
- locale: m,
1524
- hasPrevious: k,
1525
- hasNext: h,
1526
- onSlotSelect: D,
1527
- onPreviousDays: N,
1528
- onNextDays: x
1529
- }
1530
- );
1586
+ ), b = l || u ? "loading" : "default", d = I.some((g) => g.slots.length > 0), _ = e[0];
1587
+ return /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1588
+ !d && !!_ ? /* @__PURE__ */ s(
1589
+ Je,
1590
+ {
1591
+ nextAvailableDate: _,
1592
+ onJump: () => m(le(F(_))),
1593
+ locale: p
1594
+ }
1595
+ ) : null,
1596
+ /* @__PURE__ */ s(
1597
+ Kt,
1598
+ {
1599
+ days: I,
1600
+ state: b,
1601
+ selectedSlotId: a.slotKey,
1602
+ maxInitialSlotsPerDay: 6,
1603
+ locale: p,
1604
+ hasPrevious: v,
1605
+ hasNext: N,
1606
+ onSlotSelect: y,
1607
+ onPreviousDays: M,
1608
+ onNextDays: D
1609
+ }
1610
+ )
1611
+ ] });
1531
1612
  }
1532
- function rt(e) {
1613
+ function yt(e) {
1533
1614
  const {
1534
1615
  inputs: t,
1535
1616
  value: a,
1536
1617
  onChange: i,
1537
1618
  onDateSelect: n,
1538
- loadingDates: o,
1539
- loadingSlots: l,
1540
- locale: m,
1541
- datePickerStyle: d
1619
+ onWindowChange: o,
1620
+ loadingDates: l,
1621
+ loadingSlots: u,
1622
+ locale: p,
1623
+ datePickerStyle: r
1542
1624
  } = e;
1543
- return d === "four-day-grid" ? /* @__PURE__ */ s(
1544
- Ka,
1625
+ return r === "four-day-grid" ? /* @__PURE__ */ s(
1626
+ es,
1545
1627
  {
1546
1628
  availableDates: t.availableDates,
1547
1629
  availableSlots: t.availableSlots,
1548
1630
  value: a,
1549
1631
  onChange: i,
1550
1632
  onDateSelect: n,
1551
- loadingDates: o,
1552
- loadingSlots: l,
1553
- locale: m
1633
+ onWindowChange: o,
1634
+ loadingDates: l,
1635
+ loadingSlots: u,
1636
+ locale: p
1554
1637
  }
1555
1638
  ) : /* @__PURE__ */ s(
1556
- Ea,
1639
+ Ua,
1557
1640
  {
1558
1641
  availableDates: t.availableDates,
1559
1642
  selectedDate: a.date,
1560
1643
  onSelectDate: (c) => {
1561
- i(Me(a, c)), n == null || n(c);
1644
+ i(Ee(a, c)), n == null || n(c);
1562
1645
  },
1563
- locale: m,
1564
- loading: o ?? l
1646
+ locale: p,
1647
+ loading: l ?? u
1565
1648
  }
1566
1649
  );
1567
1650
  }
1568
- function dt(e) {
1651
+ function kt(e) {
1569
1652
  const { inputs: t, value: a, onChange: i, loadingSlots: n, locale: o, datePickerStyle: l } = e;
1570
1653
  return l === "four-day-grid" || !a.date ? null : /* @__PURE__ */ s(
1571
- za,
1654
+ Qa,
1572
1655
  {
1573
1656
  date: a.date,
1574
1657
  slots: t.availableSlots[a.date] ?? [],
1575
1658
  selectedSlotKey: a.slotKey,
1576
- onSelect: (m) => i(nt(a, m.key)),
1659
+ onSelect: (u) => i(vt(a, u.key)),
1577
1660
  loading: n,
1578
1661
  locale: o
1579
1662
  }
1580
1663
  );
1581
1664
  }
1582
- function lt({ value: e, onChange: t }) {
1583
- const { t: a } = A(), i = [
1665
+ function xt({ value: e, onChange: t }) {
1666
+ const { t: a } = O(), i = [
1584
1667
  { value: "private", label: a("booking.insurance.private") },
1585
1668
  { value: "public", label: a("booking.insurance.public") }
1586
1669
  ];
1587
- return /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1670
+ return /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1588
1671
  /* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: a("booking.insurance.heading") }),
1589
1672
  /* @__PURE__ */ s(
1590
- Ce,
1673
+ Oe,
1591
1674
  {
1592
1675
  options: i,
1593
1676
  value: e ?? "",
@@ -1600,108 +1683,212 @@ function lt({ value: e, onChange: t }) {
1600
1683
  )
1601
1684
  ] });
1602
1685
  }
1603
- function ct({ specialties: e, value: t, onChange: a }) {
1604
- const { t: i } = A(), n = e.map((o) => ({
1605
- value: o.id,
1606
- label: o.label
1607
- }));
1608
- return /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1609
- /* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: i("booking.specialty.heading") }),
1686
+ function St({
1687
+ specialties: e,
1688
+ value: t,
1689
+ valueIds: a,
1690
+ onChange: i,
1691
+ onChangeIds: n,
1692
+ pickerStyle: o = "select"
1693
+ }) {
1694
+ const { t: l } = O(), u = e.map((r) => ({
1695
+ value: r.id,
1696
+ label: r.label
1697
+ })), p = /* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: l("booking.specialty.heading") });
1698
+ return o === "multi-select" && n ? /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1699
+ p,
1700
+ /* @__PURE__ */ s(
1701
+ Ue,
1702
+ {
1703
+ options: u,
1704
+ value: a ?? [],
1705
+ onChange: n,
1706
+ placeholder: l("booking.specialty.placeholder"),
1707
+ "aria-label": l("booking.specialty.heading"),
1708
+ allowClear: !0
1709
+ }
1710
+ )
1711
+ ] }) : o === "combobox" ? /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1712
+ p,
1610
1713
  /* @__PURE__ */ s(
1611
- Ce,
1714
+ Ge,
1612
1715
  {
1613
- options: n,
1716
+ options: u,
1614
1717
  value: t ?? "",
1615
- onValueChange: (o) => a(o),
1616
- placeholder: i("booking.specialty.placeholder"),
1617
- "aria-label": i("booking.specialty.heading")
1718
+ onValueChange: (r) => i(r === "" ? "" : r),
1719
+ placeholder: l("booking.specialty.placeholder"),
1720
+ "aria-label": l("booking.specialty.heading"),
1721
+ clearable: !0
1722
+ }
1723
+ )
1724
+ ] }) : /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1725
+ p,
1726
+ /* @__PURE__ */ s(
1727
+ Oe,
1728
+ {
1729
+ options: u,
1730
+ value: t ?? "",
1731
+ onValueChange: (r) => i(r),
1732
+ placeholder: l("booking.specialty.placeholder"),
1733
+ "aria-label": l("booking.specialty.heading")
1618
1734
  }
1619
1735
  )
1620
1736
  ] });
1621
1737
  }
1622
- function ut({ services: e, value: t, onChange: a, compact: i }) {
1623
- const { t: n } = A();
1624
- if (i) {
1625
- const o = e.map((l) => ({
1626
- value: l.id,
1627
- label: `${l.label} · ${n("booking.serviceSummary", {
1628
- minutes: l.durationMin
1629
- })}`
1738
+ function It({
1739
+ services: e,
1740
+ value: t,
1741
+ valueIds: a,
1742
+ onChange: i,
1743
+ onChangeIds: n,
1744
+ pickerStyle: o,
1745
+ compact: l
1746
+ }) {
1747
+ const { t: u } = O(), p = o ?? (l ? "select" : "cards"), r = e.map((m) => ({
1748
+ value: m.id,
1749
+ label: `${m.label} · ${u("booking.serviceSummary", {
1750
+ minutes: m.durationMin
1751
+ })}`
1752
+ })), c = /* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: u("booking.service.heading") });
1753
+ return p === "multi-select" && n ? /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1754
+ c,
1755
+ /* @__PURE__ */ s(
1756
+ Ue,
1757
+ {
1758
+ options: r,
1759
+ value: a ?? [],
1760
+ onChange: n,
1761
+ placeholder: u("booking.service.placeholder"),
1762
+ "aria-label": u("booking.service.heading"),
1763
+ allowClear: !0
1764
+ }
1765
+ )
1766
+ ] }) : p === "combobox" ? /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1767
+ c,
1768
+ /* @__PURE__ */ s(
1769
+ Ge,
1770
+ {
1771
+ options: r,
1772
+ value: t ?? "",
1773
+ onValueChange: (m) => i(m === "" ? "" : m),
1774
+ placeholder: u("booking.service.placeholder"),
1775
+ "aria-label": u("booking.service.heading"),
1776
+ clearable: !0
1777
+ }
1778
+ )
1779
+ ] }) : p === "select" ? /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1780
+ c,
1781
+ /* @__PURE__ */ s(
1782
+ Oe,
1783
+ {
1784
+ options: r,
1785
+ value: t ?? "",
1786
+ onValueChange: (m) => i(m),
1787
+ placeholder: u("booking.service.placeholder"),
1788
+ "aria-label": u("booking.service.heading")
1789
+ }
1790
+ )
1791
+ ] }) : /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1792
+ c,
1793
+ /* @__PURE__ */ s(
1794
+ Ja,
1795
+ {
1796
+ services: e,
1797
+ selectedServiceId: t,
1798
+ onSelect: i
1799
+ }
1800
+ )
1801
+ ] });
1802
+ }
1803
+ function Nt({
1804
+ operators: e,
1805
+ value: t,
1806
+ valueIds: a,
1807
+ onChange: i,
1808
+ onChangeIds: n,
1809
+ pickerStyle: o = "select"
1810
+ }) {
1811
+ const { t: l } = O(), u = /* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: l("booking.operator.heading") });
1812
+ if (o === "multi-select" && n) {
1813
+ const r = e.map((c) => ({
1814
+ value: c.id,
1815
+ label: c.name
1630
1816
  }));
1631
- return /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1632
- /* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: n("booking.service.heading") }),
1817
+ return /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1818
+ u,
1633
1819
  /* @__PURE__ */ s(
1634
- Ce,
1820
+ Ue,
1635
1821
  {
1636
- options: o,
1637
- value: t ?? "",
1638
- onValueChange: (l) => a(l),
1639
- placeholder: n("booking.service.placeholder"),
1640
- "aria-label": n("booking.service.heading")
1822
+ options: r,
1823
+ value: a ?? [],
1824
+ onChange: n,
1825
+ placeholder: l("booking.operator.placeholder"),
1826
+ "aria-label": l("booking.operator.heading"),
1827
+ allowClear: !0
1641
1828
  }
1642
1829
  )
1643
1830
  ] });
1644
1831
  }
1645
- return /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1646
- /* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: n("booking.service.heading") }),
1832
+ const p = [
1833
+ { value: X, label: l("booking.operator.all") },
1834
+ ...e.map((r) => ({ value: r.id, label: r.name }))
1835
+ ];
1836
+ return o === "combobox" ? /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1837
+ u,
1647
1838
  /* @__PURE__ */ s(
1648
- Va,
1839
+ Ge,
1649
1840
  {
1650
- services: e,
1651
- selectedServiceId: t,
1652
- onSelect: a
1841
+ options: p,
1842
+ value: t ?? X,
1843
+ onValueChange: (r) => i(r === "" ? X : r),
1844
+ placeholder: l("booking.operator.placeholder"),
1845
+ "aria-label": l("booking.operator.heading"),
1846
+ clearable: !0
1653
1847
  }
1654
1848
  )
1655
- ] });
1656
- }
1657
- function mt({ operators: e, value: t, onChange: a }) {
1658
- const { t: i } = A(), n = [
1659
- { value: he, label: i("booking.operator.all") },
1660
- ...e.map((o) => ({ value: o.id, label: o.name }))
1661
- ];
1662
- return /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1663
- /* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: i("booking.operator.heading") }),
1849
+ ] }) : /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1850
+ u,
1664
1851
  /* @__PURE__ */ s(
1665
- Ce,
1852
+ Oe,
1666
1853
  {
1667
- options: n,
1668
- value: t ?? he,
1669
- onValueChange: (o) => a(o),
1670
- placeholder: i("booking.operator.placeholder"),
1671
- "aria-label": i("booking.operator.heading")
1854
+ options: p,
1855
+ value: t ?? X,
1856
+ onValueChange: (r) => i(r),
1857
+ placeholder: l("booking.operator.placeholder"),
1858
+ "aria-label": l("booking.operator.heading")
1672
1859
  }
1673
1860
  )
1674
1861
  ] });
1675
1862
  }
1676
- function pt({
1863
+ function wt({
1677
1864
  customSlot: e
1678
1865
  }) {
1679
- const { t } = A();
1680
- return e ? /* @__PURE__ */ s(W, { children: e }) : /* @__PURE__ */ v($, { variant: "warning", children: [
1681
- /* @__PURE__ */ s($.Title, { as: "h4", children: t("booking.onboardingIncomplete.title") }),
1682
- /* @__PURE__ */ s($.Description, { children: t("booking.onboardingIncomplete.description") })
1866
+ const { t } = O();
1867
+ return e ? /* @__PURE__ */ s(W, { children: e }) : /* @__PURE__ */ f(z, { variant: "warning", children: [
1868
+ /* @__PURE__ */ s(z.Title, { as: "h4", children: t("booking.onboardingIncomplete.title") }),
1869
+ /* @__PURE__ */ s(z.Description, { children: t("booking.onboardingIncomplete.description") })
1683
1870
  ] });
1684
1871
  }
1685
- function gt({
1872
+ function Je({
1686
1873
  nextAvailableDate: e,
1687
1874
  onJump: t,
1688
1875
  locale: a
1689
1876
  }) {
1690
- const { t: i } = A(), n = w(() => {
1877
+ const { t: i } = O(), n = w(() => {
1691
1878
  try {
1692
1879
  return new Intl.DateTimeFormat(a, { dateStyle: "long" }).format(
1693
- K(e)
1880
+ F(e)
1694
1881
  );
1695
1882
  } catch {
1696
1883
  return e;
1697
1884
  }
1698
1885
  }, [e, a]);
1699
- return /* @__PURE__ */ v($, { variant: "info", children: [
1700
- /* @__PURE__ */ s($.Description, { children: i("booking.nextAvailable.description", { date: n }) }),
1701
- /* @__PURE__ */ s($.Action, { children: /* @__PURE__ */ s(ae, { intent: "secondary", size: "sm", onClick: t, children: i("booking.nextAvailable.cta") }) })
1886
+ return /* @__PURE__ */ f(z, { variant: "info", children: [
1887
+ /* @__PURE__ */ s(z.Description, { children: i("booking.nextAvailable.description", { date: n }) }),
1888
+ /* @__PURE__ */ s(z.Action, { children: /* @__PURE__ */ s(ie, { intent: "secondary", size: "sm", onClick: t, children: i("booking.nextAvailable.cta") }) })
1702
1889
  ] });
1703
1890
  }
1704
- function ja({
1891
+ function ts({
1705
1892
  snapshot: e,
1706
1893
  operators: t,
1707
1894
  specialties: a,
@@ -1709,67 +1896,67 @@ function ja({
1709
1896
  locale: n,
1710
1897
  mode: o,
1711
1898
  showModify: l,
1712
- onReset: m,
1713
- onModify: d
1899
+ onReset: u,
1900
+ onModify: p
1714
1901
  }) {
1715
- const { t: c } = A(), u = (e.details.confirmationChannels ?? ["email"]).map(
1716
- (D) => c(`booking.confirmation.channel.${D}`)
1717
- ), S = o === "demo" ? c("booking.success.descriptionDemo") : u.length > 1 ? c("booking.success.descriptionMultiple", {
1718
- channels: u.join(" · ")
1719
- }) : c("booking.success.descriptionSingle", { channel: u[0] }), k = w(() => {
1902
+ const { t: r } = O(), m = (e.details.confirmationChannels ?? ["email"]).map(
1903
+ (D) => r(`booking.confirmation.channel.${D}`)
1904
+ ), k = o === "demo" ? r("booking.success.descriptionDemo") : m.length > 1 ? r("booking.success.descriptionMultiple", {
1905
+ channels: m.join(" · ")
1906
+ }) : r("booking.success.descriptionSingle", { channel: m[0] }), I = w(() => {
1720
1907
  if (e.date)
1721
1908
  try {
1722
1909
  return new Intl.DateTimeFormat(n, {
1723
1910
  weekday: "long",
1724
1911
  day: "numeric",
1725
1912
  month: "long"
1726
- }).format(K(e.date));
1913
+ }).format(F(e.date));
1727
1914
  } catch {
1728
1915
  return e.date;
1729
1916
  }
1730
- }, [e.date, n]), h = e.operatorId ? t.find((D) => D.id === e.operatorId) : void 0, N = e.specialtyId ? a.find((D) => D.id === e.specialtyId) : void 0, x = e.serviceId ? i.find((D) => D.id === e.serviceId) : void 0;
1731
- return /* @__PURE__ */ v(
1917
+ }, [e.date, n]), v = e.operatorId ? t.find((D) => D.id === e.operatorId) : void 0, N = e.specialtyId ? a.find((D) => D.id === e.specialtyId) : void 0, M = e.serviceId ? i.find((D) => D.id === e.serviceId) : void 0;
1918
+ return /* @__PURE__ */ f(
1732
1919
  "div",
1733
1920
  {
1734
1921
  "data-component": "booking-success",
1735
1922
  className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
1736
1923
  children: [
1737
- /* @__PURE__ */ v($, { variant: "success", children: [
1738
- /* @__PURE__ */ s($.Title, { as: "h3", children: c("booking.success.heading") }),
1739
- /* @__PURE__ */ s($.Description, { children: S })
1924
+ /* @__PURE__ */ f(z, { variant: "success", children: [
1925
+ /* @__PURE__ */ s(z.Title, { as: "h3", children: r("booking.success.heading") }),
1926
+ /* @__PURE__ */ s(z.Description, { children: k })
1740
1927
  ] }),
1741
- /* @__PURE__ */ s("div", { className: "ds:rounded-[var(--radius-md)] ds:bg-[var(--secondary)] ds:p-[var(--spacing-md)]", children: /* @__PURE__ */ v("dl", { className: "ds:grid ds:grid-cols-[auto_minmax(0,1fr)] ds:gap-x-[var(--spacing-md)] ds:gap-y-[var(--spacing-xs)] ds:m-0", children: [
1742
- N ? /* @__PURE__ */ v(W, { children: [
1743
- /* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: c("booking.success.summarySpecialty") }),
1928
+ /* @__PURE__ */ s("div", { className: "ds:rounded-[var(--radius-md)] ds:bg-[var(--secondary)] ds:p-[var(--spacing-md)]", children: /* @__PURE__ */ f("dl", { className: "ds:grid ds:grid-cols-[auto_minmax(0,1fr)] ds:gap-x-[var(--spacing-md)] ds:gap-y-[var(--spacing-xs)] ds:m-0", children: [
1929
+ N ? /* @__PURE__ */ f(W, { children: [
1930
+ /* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: r("booking.success.summarySpecialty") }),
1744
1931
  /* @__PURE__ */ s("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: N.label })
1745
1932
  ] }) : null,
1746
- x ? /* @__PURE__ */ v(W, { children: [
1747
- /* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: c("booking.success.summaryService") }),
1748
- /* @__PURE__ */ s("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: x.label })
1933
+ M ? /* @__PURE__ */ f(W, { children: [
1934
+ /* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: r("booking.success.summaryService") }),
1935
+ /* @__PURE__ */ s("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: M.label })
1749
1936
  ] }) : null,
1750
- k ? /* @__PURE__ */ v(W, { children: [
1751
- /* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: c("booking.success.summaryDate") }),
1752
- /* @__PURE__ */ s("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: k })
1937
+ I ? /* @__PURE__ */ f(W, { children: [
1938
+ /* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: r("booking.success.summaryDate") }),
1939
+ /* @__PURE__ */ s("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: I })
1753
1940
  ] }) : null,
1754
- /* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: c("booking.success.summaryTime") }),
1941
+ /* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: r("booking.success.summaryTime") }),
1755
1942
  /* @__PURE__ */ s("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: e.slot.time }),
1756
- h ? /* @__PURE__ */ v(W, { children: [
1757
- /* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: c("booking.success.summaryProvider") }),
1758
- /* @__PURE__ */ s("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: h.name })
1943
+ v ? /* @__PURE__ */ f(W, { children: [
1944
+ /* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: r("booking.success.summaryProvider") }),
1945
+ /* @__PURE__ */ s("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: v.name })
1759
1946
  ] }) : null
1760
1947
  ] }) }),
1761
- /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
1762
- /* @__PURE__ */ s(ae, { intent: "secondary", size: "md", onClick: m, children: c("booking.success.bookAnother") }),
1763
- l ? /* @__PURE__ */ s(ae, { intent: "ghost", size: "md", onClick: d, children: c("booking.success.modifyBooking") }) : null
1948
+ /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]", children: [
1949
+ /* @__PURE__ */ s(ie, { intent: "secondary", size: "md", onClick: u, children: r("booking.success.bookAnother") }),
1950
+ l ? /* @__PURE__ */ s(ie, { intent: "ghost", size: "md", onClick: p, children: r("booking.success.modifyBooking") }) : null
1764
1951
  ] })
1765
1952
  ]
1766
1953
  }
1767
1954
  );
1768
1955
  }
1769
- function ft({ customSlot: e }) {
1770
- const { t } = A();
1956
+ function Ct({ customSlot: e }) {
1957
+ const { t } = O();
1771
1958
  return e ? /* @__PURE__ */ s(W, { children: e }) : /* @__PURE__ */ s(
1772
- Qe,
1959
+ dt,
1773
1960
  {
1774
1961
  variant: "no-results",
1775
1962
  title: t("booking.emptyServices.title"),
@@ -1777,7 +1964,7 @@ function ft({ customSlot: e }) {
1777
1964
  }
1778
1965
  );
1779
1966
  }
1780
- function qa(e) {
1967
+ function as(e) {
1781
1968
  const {
1782
1969
  cascade: t,
1783
1970
  inputs: a,
@@ -1785,184 +1972,212 @@ function qa(e) {
1785
1972
  onChange: n,
1786
1973
  onSubmit: o,
1787
1974
  emptyServicesSlot: l,
1788
- onboardingIncompleteSlot: m,
1789
- loadingDates: d,
1790
- loadingSlots: c,
1791
- onDateSelect: p,
1792
- datePickerStyle: u,
1793
- submitting: S,
1794
- locale: k,
1795
- detailsProps: h
1796
- } = e, { t: N } = A();
1797
- return /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
1975
+ onboardingIncompleteSlot: u,
1976
+ loadingDates: p,
1977
+ loadingSlots: r,
1978
+ onDateSelect: c,
1979
+ onWindowChange: m,
1980
+ datePickerStyle: k,
1981
+ specialtyPickerStyle: I,
1982
+ servicePickerStyle: v,
1983
+ operatorPickerStyle: N,
1984
+ submitting: M,
1985
+ locale: D,
1986
+ detailsProps: y
1987
+ } = e, { t: b } = O();
1988
+ return /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
1798
1989
  t.gates.insurance ? /* @__PURE__ */ s(
1799
- lt,
1990
+ xt,
1800
1991
  {
1801
1992
  value: i.insuranceType,
1802
- onChange: (x) => n(tt(i, x))
1993
+ onChange: (d) => n(ct(i, d))
1803
1994
  }
1804
1995
  ) : null,
1805
1996
  t.gates.specialty ? /* @__PURE__ */ s(
1806
- ct,
1997
+ St,
1807
1998
  {
1808
1999
  specialties: t.filtered.specialties,
1809
2000
  value: i.specialtyId,
1810
- onChange: (x) => n(at(i, x))
2001
+ valueIds: i.specialtyIds,
2002
+ onChange: (d) => n(ut(i, d)),
2003
+ onChangeIds: (d) => n(pt(i, d)),
2004
+ pickerStyle: I
1811
2005
  }
1812
2006
  ) : null,
1813
- t.gates.service ? t.filtered.services.length === 0 ? /* @__PURE__ */ s(ft, { customSlot: l }) : /* @__PURE__ */ s(
1814
- ut,
2007
+ t.gates.service ? t.filtered.services.length === 0 ? /* @__PURE__ */ s(Ct, { customSlot: l }) : /* @__PURE__ */ s(
2008
+ It,
1815
2009
  {
1816
2010
  services: t.filtered.services,
1817
2011
  value: i.serviceId,
1818
- onChange: (x) => n(st(i, x))
2012
+ valueIds: i.serviceIds,
2013
+ onChange: (d) => n(mt(i, d)),
2014
+ onChangeIds: (d) => n(gt(i, d)),
2015
+ pickerStyle: v
1819
2016
  }
1820
2017
  ) : null,
1821
- t.gates.onboardingIncomplete ? /* @__PURE__ */ s(pt, { customSlot: m }) : null,
2018
+ t.gates.onboardingIncomplete ? /* @__PURE__ */ s(wt, { customSlot: u }) : null,
1822
2019
  t.gates.operator ? /* @__PURE__ */ s(
1823
- mt,
2020
+ Nt,
1824
2021
  {
1825
2022
  operators: t.filtered.operators,
1826
2023
  value: i.operatorId,
1827
- onChange: (x) => n(it(i, x))
2024
+ valueIds: i.operatorIds,
2025
+ onChange: (d) => n(ft(i, d)),
2026
+ onChangeIds: (d) => n(ht(i, d)),
2027
+ pickerStyle: N
1828
2028
  }
1829
2029
  ) : null,
1830
- t.gates.date ? /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1831
- /* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: N("booking.date.heading") }),
2030
+ t.gates.date ? /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
2031
+ /* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: b("booking.date.heading") }),
1832
2032
  a.availableDates.length === 0 && a.nextAvailableDate ? /* @__PURE__ */ s(
1833
- gt,
2033
+ Je,
1834
2034
  {
1835
2035
  nextAvailableDate: a.nextAvailableDate,
1836
- onJump: () => n(Me(i, a.nextAvailableDate)),
1837
- locale: k
2036
+ onJump: () => n(Ee(i, a.nextAvailableDate)),
2037
+ locale: D
1838
2038
  }
1839
- ) : rt({
2039
+ ) : yt({
1840
2040
  inputs: a,
1841
2041
  value: i,
1842
2042
  onChange: n,
1843
- onDateSelect: p,
1844
- loadingDates: d,
1845
- loadingSlots: c,
1846
- locale: k,
1847
- datePickerStyle: u
2043
+ onDateSelect: c,
2044
+ onWindowChange: m,
2045
+ loadingDates: p,
2046
+ loadingSlots: r,
2047
+ locale: D,
2048
+ datePickerStyle: k
1848
2049
  })
1849
2050
  ] }) : null,
1850
- t.gates.slot && i.date && u === "month-calendar" ? /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
1851
- /* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: N("booking.slot.heading") }),
1852
- dt({
2051
+ t.gates.slot && i.date && k === "month-calendar" ? /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
2052
+ /* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children: b("booking.slot.heading") }),
2053
+ kt({
1853
2054
  inputs: a,
1854
2055
  value: i,
1855
2056
  onChange: n,
1856
- loadingSlots: c,
1857
- locale: k,
1858
- datePickerStyle: u
2057
+ loadingSlots: r,
2058
+ locale: D,
2059
+ datePickerStyle: k
1859
2060
  })
1860
2061
  ] }) : null,
1861
2062
  t.gates.details && t.selectedSlot ? /* @__PURE__ */ s(
1862
- ze,
2063
+ Ye,
1863
2064
  {
1864
- ...h,
2065
+ ...y,
1865
2066
  value: i.details ?? {},
1866
- onChange: (x) => n({ ...i, details: x }),
2067
+ onChange: (d) => n({ ...i, details: d }),
1867
2068
  onSubmit: o,
1868
- submitting: S,
2069
+ submitting: M,
1869
2070
  defaultPhoneCountry: e.policy.country
1870
2071
  }
1871
2072
  ) : null
1872
2073
  ] });
1873
2074
  }
1874
- function F(e, t, a = {}) {
2075
+ function $(e, t, a = {}) {
1875
2076
  const {
1876
2077
  cascade: i,
1877
2078
  inputs: n,
1878
2079
  value: o,
1879
2080
  onChange: l,
1880
- onSubmit: m,
1881
- emptyServicesSlot: d,
1882
- onboardingIncompleteSlot: c,
1883
- loadingDates: p,
1884
- loadingSlots: u,
1885
- onDateSelect: S,
1886
- datePickerStyle: k,
1887
- submitting: h,
1888
- locale: N,
1889
- detailsProps: x,
1890
- policy: D
2081
+ onSubmit: u,
2082
+ emptyServicesSlot: p,
2083
+ onboardingIncompleteSlot: r,
2084
+ loadingDates: c,
2085
+ loadingSlots: m,
2086
+ onDateSelect: k,
2087
+ onWindowChange: I,
2088
+ datePickerStyle: v,
2089
+ specialtyPickerStyle: N,
2090
+ servicePickerStyle: M,
2091
+ operatorPickerStyle: D,
2092
+ submitting: y,
2093
+ locale: b,
2094
+ detailsProps: d,
2095
+ policy: _
1891
2096
  } = t;
1892
2097
  switch (e) {
1893
2098
  case 1:
1894
2099
  return /* @__PURE__ */ s(
1895
- lt,
2100
+ xt,
1896
2101
  {
1897
2102
  value: o.insuranceType,
1898
- onChange: (b) => l(tt(o, b))
2103
+ onChange: (x) => l(ct(o, x))
1899
2104
  }
1900
2105
  );
1901
2106
  case 2:
1902
2107
  return /* @__PURE__ */ s(
1903
- ct,
2108
+ St,
1904
2109
  {
1905
2110
  specialties: i.filtered.specialties,
1906
2111
  value: o.specialtyId,
1907
- onChange: (b) => l(at(o, b))
2112
+ valueIds: o.specialtyIds,
2113
+ onChange: (x) => l(ut(o, x)),
2114
+ onChangeIds: (x) => l(pt(o, x)),
2115
+ pickerStyle: N
1908
2116
  }
1909
2117
  );
1910
2118
  case 3:
1911
- return i.filtered.services.length === 0 ? /* @__PURE__ */ s(ft, { customSlot: d }) : i.gates.onboardingIncomplete ? /* @__PURE__ */ s(pt, { customSlot: c }) : /* @__PURE__ */ s(
1912
- ut,
2119
+ return i.filtered.services.length === 0 ? /* @__PURE__ */ s(Ct, { customSlot: p }) : i.gates.onboardingIncomplete ? /* @__PURE__ */ s(wt, { customSlot: r }) : /* @__PURE__ */ s(
2120
+ It,
1913
2121
  {
1914
2122
  services: i.filtered.services,
1915
2123
  value: o.serviceId,
1916
- onChange: (b) => l(st(o, b)),
2124
+ valueIds: o.serviceIds,
2125
+ onChange: (x) => l(mt(o, x)),
2126
+ onChangeIds: (x) => l(gt(o, x)),
2127
+ pickerStyle: M,
1917
2128
  compact: a.compactService
1918
2129
  }
1919
2130
  );
1920
2131
  case 4:
1921
2132
  return /* @__PURE__ */ s(
1922
- mt,
2133
+ Nt,
1923
2134
  {
1924
2135
  operators: i.filtered.operators,
1925
2136
  value: o.operatorId,
1926
- onChange: (b) => l(it(o, b))
2137
+ valueIds: o.operatorIds,
2138
+ onChange: (x) => l(ft(o, x)),
2139
+ onChangeIds: (x) => l(ht(o, x)),
2140
+ pickerStyle: D
1927
2141
  }
1928
2142
  );
1929
2143
  case 5:
1930
2144
  return n.availableDates.length === 0 && n.nextAvailableDate ? /* @__PURE__ */ s(
1931
- gt,
2145
+ Je,
1932
2146
  {
1933
2147
  nextAvailableDate: n.nextAvailableDate,
1934
- onJump: () => l(Me(o, n.nextAvailableDate)),
1935
- locale: N
2148
+ onJump: () => l(Ee(o, n.nextAvailableDate)),
2149
+ locale: b
1936
2150
  }
1937
- ) : rt({
2151
+ ) : yt({
1938
2152
  inputs: n,
1939
2153
  value: o,
1940
2154
  onChange: l,
1941
- onDateSelect: S,
1942
- loadingDates: p,
1943
- loadingSlots: u,
1944
- locale: N,
1945
- datePickerStyle: k
2155
+ onDateSelect: k,
2156
+ onWindowChange: I,
2157
+ loadingDates: c,
2158
+ loadingSlots: m,
2159
+ locale: b,
2160
+ datePickerStyle: v
1946
2161
  });
1947
2162
  case 6:
1948
- return dt({
2163
+ return kt({
1949
2164
  inputs: n,
1950
2165
  value: o,
1951
2166
  onChange: l,
1952
- loadingSlots: u,
1953
- locale: N,
1954
- datePickerStyle: k
2167
+ loadingSlots: m,
2168
+ locale: b,
2169
+ datePickerStyle: v
1955
2170
  });
1956
2171
  case 7:
1957
2172
  return i.selectedSlot ? /* @__PURE__ */ s(
1958
- ze,
2173
+ Ye,
1959
2174
  {
1960
- ...x,
2175
+ ...d,
1961
2176
  value: o.details ?? {},
1962
- onChange: (b) => l({ ...o, details: b }),
1963
- onSubmit: m,
1964
- submitting: h,
1965
- defaultPhoneCountry: D.country
2177
+ onChange: (x) => l({ ...o, details: x }),
2178
+ onSubmit: u,
2179
+ submitting: y,
2180
+ defaultPhoneCountry: _.country
1966
2181
  }
1967
2182
  ) : null;
1968
2183
  /* c8 ignore next 2 */
@@ -1970,8 +2185,8 @@ function F(e, t, a = {}) {
1970
2185
  return null;
1971
2186
  }
1972
2187
  }
1973
- function Ke() {
1974
- const { t: e } = A();
2188
+ function Ze() {
2189
+ const { t: e } = O();
1975
2190
  return w(
1976
2191
  () => ({
1977
2192
  1: e("booking.insurance.heading"),
@@ -1985,32 +2200,32 @@ function Ke() {
1985
2200
  [e]
1986
2201
  );
1987
2202
  }
1988
- function Ha(e) {
1989
- const { cascade: t, value: a, activeStep: i, setActiveStep: n, datePickerStyle: o } = e, l = Ke(), m = w(
1990
- () => o === "four-day-grid" ? t.visibleSteps.filter((p) => p !== 6) : t.visibleSteps,
2203
+ function ss(e) {
2204
+ const { cascade: t, value: a, activeStep: i, setActiveStep: n, datePickerStyle: o } = e, l = Ze(), u = w(
2205
+ () => o === "four-day-grid" ? t.visibleSteps.filter((c) => c !== 6) : t.visibleSteps,
1991
2206
  [t.visibleSteps, o]
1992
- ), d = w(
1993
- () => m.map((p) => ({
1994
- label: l[p],
1995
- summary: ht(p, a, t),
1996
- status: ve(p, a) && p < t.currentStep ? "completed" : void 0,
1997
- content: F(p, e, { compactService: !0 })
2207
+ ), p = w(
2208
+ () => u.map((c) => ({
2209
+ label: l[c],
2210
+ summary: Mt(c, a, t),
2211
+ status: ke(c, a) && c < t.currentStep ? "completed" : void 0,
2212
+ content: $(c, e, { compactService: !0 })
1998
2213
  })),
1999
- [m, a, l, t, e]
2000
- ), c = Math.max(0, t.visibleSteps.indexOf(i));
2214
+ [u, a, l, t, e]
2215
+ ), r = Math.max(0, t.visibleSteps.indexOf(i));
2001
2216
  return /* @__PURE__ */ s(
2002
- _t,
2217
+ $t,
2003
2218
  {
2004
- activeStep: c,
2005
- steps: d,
2006
- onStepChange: (p) => {
2007
- const u = t.visibleSteps[p];
2008
- u && n(u);
2219
+ activeStep: r,
2220
+ steps: p,
2221
+ onStepChange: (c) => {
2222
+ const m = t.visibleSteps[c];
2223
+ m && n(m);
2009
2224
  }
2010
2225
  }
2011
2226
  );
2012
2227
  }
2013
- function ve(e, t) {
2228
+ function ke(e, t) {
2014
2229
  switch (e) {
2015
2230
  case 1:
2016
2231
  return t.insuranceType !== void 0;
@@ -2028,9 +2243,9 @@ function ve(e, t) {
2028
2243
  return !1;
2029
2244
  }
2030
2245
  }
2031
- function ht(e, t, a) {
2246
+ function Mt(e, t, a) {
2032
2247
  var i;
2033
- if (ve(e, t))
2248
+ if (ke(e, t))
2034
2249
  switch (e) {
2035
2250
  case 1:
2036
2251
  return t.insuranceType;
@@ -2047,7 +2262,7 @@ function ht(e, t, a) {
2047
2262
  return n == null ? void 0 : n.label;
2048
2263
  }
2049
2264
  case 4: {
2050
- const n = $e(t);
2265
+ const n = He(t);
2051
2266
  if (!n) return;
2052
2267
  const o = a.filtered.operators.find((l) => l.id === n);
2053
2268
  return o == null ? void 0 : o.name;
@@ -2060,100 +2275,106 @@ function ht(e, t, a) {
2060
2275
  return;
2061
2276
  }
2062
2277
  }
2063
- function Ga(e) {
2064
- const { cascade: t, value: a, setActiveStep: i } = e, { t: n } = A(), o = Ke(), l = t.visibleSteps.filter(
2065
- (d) => d === 1 || d === 2 || d === 3 || d === 4
2066
- ), m = l.some(
2067
- (d) => !ve(d, a)
2278
+ function is(e) {
2279
+ const { cascade: t, value: a, setActiveStep: i } = e, { t: n } = O(), o = Ze(), l = t.visibleSteps.filter(
2280
+ (p) => p === 1 || p === 2 || p === 3 || p === 4
2281
+ ), u = l.some(
2282
+ (p) => !ke(p, a)
2068
2283
  );
2069
- return /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
2070
- m ? l.filter((d) => !ve(d, a)).slice(0, 1).map((d) => /* @__PURE__ */ s("div", { children: F(d, e, { compactService: !0 }) }, `csf-${d}`)) : /* @__PURE__ */ s(
2284
+ return /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
2285
+ u ? l.filter((p) => !ke(p, a)).slice(0, 1).map((p) => /* @__PURE__ */ s("div", { children: $(p, e, { compactService: !0 }) }, `csf-${p}`)) : /* @__PURE__ */ s(
2071
2286
  "div",
2072
2287
  {
2073
2288
  role: "group",
2074
2289
  "aria-label": n("booking.regionLabel"),
2075
2290
  className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
2076
- children: l.map((d) => {
2077
- const c = ht(d, a, t);
2078
- return c ? /* @__PURE__ */ v(
2079
- ae,
2291
+ children: l.map((p) => {
2292
+ const r = Mt(p, a, t);
2293
+ return r ? /* @__PURE__ */ f(
2294
+ ie,
2080
2295
  {
2081
2296
  intent: "tonal",
2082
2297
  size: "sm",
2083
- onClick: () => i(d),
2298
+ onClick: () => i(p),
2084
2299
  children: [
2085
- o[d],
2300
+ o[p],
2086
2301
  ": ",
2087
- c
2302
+ r
2088
2303
  ]
2089
2304
  },
2090
- `csc-${d}`
2305
+ `csc-${p}`
2091
2306
  ) : null;
2092
2307
  })
2093
2308
  }
2094
2309
  ),
2095
- !m && t.gates.date ? (
2310
+ !u && t.gates.date ? (
2096
2311
  // four-day-grid embeds slots inline with the day strip — the
2097
2312
  // historic 2-col date|slot split collapses to a single column
2098
2313
  // so the picker spans the full width instead of orphaning an
2099
2314
  // empty right cell.
2100
- e.datePickerStyle === "four-day-grid" ? /* @__PURE__ */ s("div", { children: F(5, e) }) : /* @__PURE__ */ v("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:md:grid-cols-2", children: [
2101
- /* @__PURE__ */ s("div", { className: "ds:min-w-0", children: F(5, e) }),
2102
- /* @__PURE__ */ s("div", { className: "ds:min-w-0", children: a.date ? F(6, e) : null })
2315
+ e.datePickerStyle === "four-day-grid" ? /* @__PURE__ */ s("div", { children: $(5, e) }) : /* @__PURE__ */ f("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:md:grid-cols-2", children: [
2316
+ /* @__PURE__ */ s("div", { className: "ds:min-w-0", children: $(5, e) }),
2317
+ /* @__PURE__ */ s("div", { className: "ds:min-w-0", children: a.date ? $(6, e) : null })
2103
2318
  ] })
2104
2319
  ) : null,
2105
- t.gates.details ? /* @__PURE__ */ s("div", { children: F(7, e) }) : null
2320
+ t.gates.details ? /* @__PURE__ */ s("div", { children: $(7, e) }) : null
2106
2321
  ] });
2107
2322
  }
2108
- function Ua(e) {
2109
- const { cascade: t } = e, a = t.visibleSteps.filter(
2110
- (i) => i === 1 || i === 2 || i === 3 || i === 4
2323
+ function ns(e) {
2324
+ const { cascade: t, datePickerStyle: a } = e, i = t.visibleSteps.filter(
2325
+ (o) => o === 1 || o === 2 || o === 3 || o === 4
2111
2326
  );
2112
- return /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
2113
- /* @__PURE__ */ v("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:md:grid-cols-2", children: [
2114
- /* @__PURE__ */ s("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: a.map((i) => /* @__PURE__ */ s("div", { children: F(i, e, { compactService: !0 }) }, `fbf-${i}`)) }),
2115
- /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
2116
- t.gates.date ? F(5, e) : null,
2117
- t.gates.slot && e.value.date ? F(6, e) : null
2118
- ] })
2119
- ] }),
2120
- t.gates.details ? F(7, e) : null
2327
+ return /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
2328
+ /* @__PURE__ */ f(
2329
+ "div",
2330
+ {
2331
+ className: a === "four-day-grid" ? "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]" : "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:md:grid-cols-2",
2332
+ children: [
2333
+ /* @__PURE__ */ s("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: i.map((o) => /* @__PURE__ */ s("div", { children: $(o, e, { compactService: !0 }) }, `fbf-${o}`)) }),
2334
+ /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
2335
+ t.gates.date ? $(5, e) : null,
2336
+ t.gates.slot && e.value.date ? $(6, e) : null
2337
+ ] })
2338
+ ]
2339
+ }
2340
+ ),
2341
+ t.gates.details ? $(7, e) : null
2121
2342
  ] });
2122
2343
  }
2123
- function Ya(e) {
2124
- const { cascade: t, value: a, activeStep: i, setActiveStep: n, datePickerStyle: o } = e, { t: l } = A(), m = Ke(), d = w(
2125
- () => o === "four-day-grid" ? t.visibleSteps.filter((h) => h !== 6) : t.visibleSteps,
2344
+ function os(e) {
2345
+ const { cascade: t, value: a, activeStep: i, setActiveStep: n, datePickerStyle: o } = e, { t: l } = O(), u = Ze(), p = w(
2346
+ () => o === "four-day-grid" ? t.visibleSteps.filter((v) => v !== 6) : t.visibleSteps,
2126
2347
  [t.visibleSteps, o]
2127
- ), c = Math.max(0, d.indexOf(i)), p = d.length, u = w(
2128
- () => d.map((h) => ({ label: m[h] })),
2129
- [d, m]
2130
- ), S = c > 0, k = c < p - 1 && ve(i, a);
2131
- return /* @__PURE__ */ v("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
2132
- /* @__PURE__ */ s(Tt, { activeStep: c, steps: u }),
2133
- /* @__PURE__ */ s("div", { children: F(i, e, { compactService: !0 }) }),
2134
- /* @__PURE__ */ v("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
2348
+ ), r = Math.max(0, p.indexOf(i)), c = p.length, m = w(
2349
+ () => p.map((v) => ({ label: u[v] })),
2350
+ [p, u]
2351
+ ), k = r > 0, I = r < c - 1 && ke(i, a);
2352
+ return /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", children: [
2353
+ /* @__PURE__ */ s(zt, { activeStep: r, steps: m }),
2354
+ /* @__PURE__ */ s("div", { children: $(i, e, { compactService: !0 }) }),
2355
+ /* @__PURE__ */ f("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
2135
2356
  /* @__PURE__ */ s(
2136
- ae,
2357
+ ie,
2137
2358
  {
2138
2359
  intent: "ghost",
2139
2360
  size: "md",
2140
- disabled: !S,
2361
+ disabled: !k,
2141
2362
  onClick: () => {
2142
- const h = d[c - 1];
2143
- h && n(h);
2363
+ const v = p[r - 1];
2364
+ v && n(v);
2144
2365
  },
2145
2366
  children: l("booking.actions.back")
2146
2367
  }
2147
2368
  ),
2148
2369
  i < 7 ? /* @__PURE__ */ s(
2149
- ae,
2370
+ ie,
2150
2371
  {
2151
2372
  intent: "primary",
2152
2373
  size: "md",
2153
- disabled: !k,
2374
+ disabled: !I,
2154
2375
  onClick: () => {
2155
- const h = d[c + 1];
2156
- h && n(h);
2376
+ const v = p[r + 1];
2377
+ v && n(v);
2157
2378
  },
2158
2379
  children: l("booking.actions.next")
2159
2380
  }
@@ -2161,7 +2382,7 @@ function Ya(e) {
2161
2382
  ] })
2162
2383
  ] });
2163
2384
  }
2164
- const Wa = [], Za = [], Ja = Je(
2385
+ const rs = [], ds = [], ls = ot(
2165
2386
  ({
2166
2387
  variant: e = "inline-list",
2167
2388
  country: t,
@@ -2173,70 +2394,74 @@ const Wa = [], Za = [], Ja = Je(
2173
2394
  lockedOperatorId: n,
2174
2395
  autoSelectSingleService: o = !1,
2175
2396
  specialties: l,
2176
- services: m,
2177
- operators: d,
2178
- availableDates: c,
2179
- availableSlots: p,
2180
- nextAvailableDate: u,
2181
- requireCodiceFiscale: S,
2182
- requireDateOfBirth: k,
2183
- requireInsuranceNumber: h,
2397
+ services: u,
2398
+ operators: p,
2399
+ availableDates: r,
2400
+ availableSlots: c,
2401
+ nextAvailableDate: m,
2402
+ requireCodiceFiscale: k,
2403
+ requireDateOfBirth: I,
2404
+ requireInsuranceNumber: v,
2184
2405
  showNote: N,
2185
- showReturningPatientFlag: x,
2406
+ showReturningPatientFlag: M,
2186
2407
  privacyPolicyUrl: D,
2187
- termsUrl: b,
2188
- validateCodiceFiscale: f,
2189
- validateInsuranceNumber: r,
2408
+ termsUrl: y,
2409
+ validateCodiceFiscale: b,
2410
+ validateInsuranceNumber: d,
2190
2411
  confirmationChannels: _,
2191
- defaultConfirmationChannels: M,
2192
- value: y,
2193
- onChange: C,
2194
- onSubmit: B,
2195
- onStepChange: O,
2196
- onDateSelect: Z,
2412
+ defaultConfirmationChannels: x,
2413
+ value: g,
2414
+ onChange: S,
2415
+ onSubmit: T,
2416
+ onStepChange: A,
2417
+ onDateSelect: G,
2418
+ onWindowChange: B,
2197
2419
  datePickerStyle: E = "month-calendar",
2198
- loadingDates: z,
2199
- loadingSlots: G,
2200
- submitting: T,
2201
- submitError: J,
2202
- mode: H = "live",
2420
+ specialtyPickerStyle: U,
2421
+ servicePickerStyle: P,
2422
+ operatorPickerStyle: Q,
2423
+ loadingDates: q,
2424
+ loadingSlots: pe,
2425
+ submitting: ee,
2426
+ submitError: xe,
2427
+ mode: Y = "live",
2203
2428
  showModifyOnSuccess: ne = !0,
2204
- surface: se = "flat",
2205
- emptyServicesSlot: be,
2206
- onboardingIncompleteSlot: U,
2207
- "aria-label": oe,
2208
- id: X,
2209
- className: De,
2210
- ..._e
2211
- }, Te) => {
2212
- const { t: ie, i18n: Ae } = A(), R = e ?? "inline-list", Q = Ae.language ?? "en", L = l ?? Wa, g = d ?? Za;
2213
- ee(() => {
2214
- const V = Ia(y, {
2429
+ surface: me = "flat",
2430
+ emptyServicesSlot: Se,
2431
+ onboardingIncompleteSlot: Ie,
2432
+ "aria-label": Ve,
2433
+ id: oe,
2434
+ className: Le,
2435
+ ...Ne
2436
+ }, we) => {
2437
+ const { t: re, i18n: h } = O(), C = e ?? "inline-list", te = h.language ?? "en", J = l ?? rs, de = p ?? ds;
2438
+ H(() => {
2439
+ const R = Va(g, {
2215
2440
  useSpecialties: a,
2216
2441
  lockedOperatorId: n,
2217
2442
  autoSelectSingleService: o,
2218
- specialties: L,
2219
- services: m
2443
+ specialties: J,
2444
+ services: u
2220
2445
  });
2221
- (V.specialtyId !== y.specialtyId || V.operatorId !== y.operatorId || V.serviceId !== y.serviceId) && C(V);
2446
+ (R.specialtyId !== g.specialtyId || R.operatorId !== g.operatorId || R.serviceId !== g.serviceId) && S(R);
2222
2447
  }, [
2223
2448
  n,
2224
2449
  a,
2225
2450
  o,
2226
- L,
2227
- m
2451
+ J,
2452
+ u
2228
2453
  ]);
2229
- const I = w(
2230
- () => Na({
2454
+ const L = w(
2455
+ () => Ea({
2231
2456
  country: t,
2232
2457
  useSpecialties: a,
2233
2458
  allowOperatorSelection: i,
2234
2459
  lockedOperatorId: n,
2235
- specialties: L,
2236
- services: m,
2237
- operators: g,
2238
- availableSlots: p,
2239
- value: y
2460
+ specialties: J,
2461
+ services: u,
2462
+ operators: de,
2463
+ availableSlots: c,
2464
+ value: g
2240
2465
  }),
2241
2466
  [
2242
2467
  t,
@@ -2244,197 +2469,205 @@ const Wa = [], Za = [], Ja = Je(
2244
2469
  i,
2245
2470
  n,
2246
2471
  o,
2247
- L,
2248
- m,
2249
- g,
2472
+ J,
2473
+ u,
2474
+ de,
2475
+ r,
2250
2476
  c,
2251
- p,
2252
- y
2477
+ g
2253
2478
  ]
2254
- ), [re, de] = j(
2255
- I.currentStep
2256
- ), je = te(I.currentStep);
2257
- ee(() => {
2258
- I.currentStep > je.current && de(I.currentStep), je.current = I.currentStep;
2259
- }, [I.currentStep]);
2260
- const [le, ce] = j("idle"), [Be, Oe] = j(null), qe = q(
2261
- async (V) => {
2262
- if (!I.selectedSlot) return;
2263
- const Ee = {
2264
- slot: I.selectedSlot,
2479
+ ), [We, ge] = K(
2480
+ L.currentStep
2481
+ ), Xe = se(L.currentStep);
2482
+ H(() => {
2483
+ L.currentStep > Xe.current && ge(L.currentStep), Xe.current = L.currentStep;
2484
+ }, [L.currentStep]);
2485
+ const [fe, he] = K("idle"), [Re, Fe] = K(null), Qe = j(
2486
+ async (R) => {
2487
+ if (!L.selectedSlot) return;
2488
+ const ze = {
2489
+ slot: L.selectedSlot,
2265
2490
  value: {
2266
- ...y,
2267
- details: V,
2268
- operatorId: $e(y) ?? y.operatorId
2491
+ ...g,
2492
+ details: R,
2493
+ operatorId: He(g) ?? g.operatorId
2269
2494
  },
2270
- details: V
2495
+ details: R
2271
2496
  };
2272
- ce("submitting");
2497
+ he("submitting");
2273
2498
  try {
2274
- await B(Ee), Oe({
2275
- slot: I.selectedSlot,
2276
- details: V,
2277
- specialtyId: y.specialtyId,
2278
- serviceId: y.serviceId,
2279
- insuranceType: y.insuranceType,
2280
- operatorId: $e(y),
2281
- date: y.date
2282
- }), ce("success");
2499
+ await T(ze), Fe({
2500
+ slot: L.selectedSlot,
2501
+ details: R,
2502
+ specialtyId: g.specialtyId,
2503
+ serviceId: g.serviceId,
2504
+ insuranceType: g.insuranceType,
2505
+ operatorId: He(g),
2506
+ date: g.date
2507
+ }), he("success");
2283
2508
  } catch {
2284
- throw ce("error"), new Error("Booking submission failed");
2509
+ throw he("error"), new Error("Booking submission failed");
2285
2510
  }
2286
2511
  },
2287
- [I.selectedSlot, B, y]
2288
- ), ue = te(null);
2289
- kt(Te, () => ue.current, []);
2290
- const me = le === "success" ? 8 : I.currentStep, He = te(null);
2291
- ee(() => {
2292
- if (me !== He.current && (He.current = me, O == null || O(me), me === 8 && ue.current))
2512
+ [L.selectedSlot, T, g]
2513
+ ), ve = se(null);
2514
+ Tt(we, () => ve.current, []);
2515
+ const be = fe === "success" ? 8 : L.currentStep, et = se(null);
2516
+ H(() => {
2517
+ if (be !== et.current && (et.current = be, A == null || A(be), be === 8 && ve.current))
2293
2518
  try {
2294
- ue.current.scrollIntoView({
2519
+ ve.current.scrollIntoView({
2295
2520
  behavior: "smooth",
2296
2521
  block: "start"
2297
2522
  });
2298
2523
  } catch {
2299
- ue.current.scrollIntoView();
2524
+ ve.current.scrollIntoView();
2300
2525
  }
2301
- }, [me, O]);
2302
- const Pe = w(
2526
+ }, [be, A]);
2527
+ const $e = w(
2303
2528
  () => ({
2304
- getVariant: () => R,
2529
+ getVariant: () => C,
2305
2530
  reset: () => {
2306
- C({}), Oe(null), ce("idle"), de(1);
2531
+ S({}), Fe(null), he("idle"), ge(1);
2307
2532
  },
2308
- goToStep: (V) => {
2309
- de(V);
2533
+ goToStep: (R) => {
2534
+ ge(R);
2310
2535
  }
2311
2536
  }),
2312
- [R, C]
2537
+ [C, S]
2313
2538
  );
2314
- St(ha, Pe, X);
2315
- const vt = oe ?? ie("booking.regionLabel"), bt = w(() => le !== "success" || !Be ? null : /* @__PURE__ */ s(
2316
- ja,
2539
+ Ot(Da, $e, oe);
2540
+ const Dt = Ve ?? re("booking.regionLabel"), At = w(() => fe !== "success" || !Re ? null : /* @__PURE__ */ s(
2541
+ ts,
2317
2542
  {
2318
- snapshot: Be,
2319
- operators: g,
2320
- specialties: L,
2321
- services: m,
2322
- locale: Q,
2323
- mode: H,
2543
+ snapshot: Re,
2544
+ operators: de,
2545
+ specialties: J,
2546
+ services: u,
2547
+ locale: te,
2548
+ mode: Y,
2324
2549
  showModify: ne,
2325
- onReset: () => Pe.reset(),
2550
+ onReset: () => $e.reset(),
2326
2551
  onModify: () => {
2327
- Oe(null), ce("idle"), de(7);
2552
+ Fe(null), he("idle"), ge(7);
2328
2553
  }
2329
2554
  }
2330
2555
  ), [
2331
- le,
2332
- Be,
2333
- g,
2334
- L,
2335
- m,
2336
- Q,
2337
- H,
2556
+ fe,
2557
+ Re,
2558
+ de,
2559
+ J,
2560
+ u,
2561
+ te,
2562
+ Y,
2338
2563
  ne,
2339
- Pe
2340
- ]), yt = w(() => {
2341
- if (le === "success") return null;
2342
- const V = R === "accordion" ? Ha : R === "calendar" ? Ga : R === "flexible" ? Ua : R === "progress" ? Ya : qa, Ee = {
2343
- cascade: I,
2564
+ $e
2565
+ ]), _t = w(() => {
2566
+ if (fe === "success") return null;
2567
+ const R = C === "accordion" ? ss : C === "calendar" ? is : C === "flexible" ? ns : C === "progress" ? os : as, ze = {
2568
+ cascade: L,
2344
2569
  inputs: {
2345
- specialties: L,
2346
- services: m,
2347
- operators: g,
2348
- availableDates: c,
2349
- availableSlots: p,
2350
- nextAvailableDate: u
2570
+ specialties: J,
2571
+ services: u,
2572
+ operators: de,
2573
+ availableDates: r,
2574
+ availableSlots: c,
2575
+ nextAvailableDate: m
2351
2576
  },
2352
- value: y,
2353
- onChange: C,
2354
- onSubmit: qe,
2577
+ value: g,
2578
+ onChange: S,
2579
+ onSubmit: Qe,
2355
2580
  policy: { country: t, lockedOperatorId: n },
2356
2581
  detailsProps: {
2357
- requireCodiceFiscale: S,
2358
- requireDateOfBirth: k,
2359
- requireInsuranceNumber: h,
2360
- insuranceType: y.insuranceType,
2582
+ requireCodiceFiscale: k,
2583
+ requireDateOfBirth: I,
2584
+ requireInsuranceNumber: v,
2585
+ insuranceType: g.insuranceType,
2361
2586
  showNote: N,
2362
- showReturningPatientFlag: x,
2587
+ showReturningPatientFlag: M,
2363
2588
  privacyPolicyUrl: D,
2364
- termsUrl: b,
2365
- validateCodiceFiscale: f,
2366
- validateInsuranceNumber: r,
2589
+ termsUrl: y,
2590
+ validateCodiceFiscale: b,
2591
+ validateInsuranceNumber: d,
2367
2592
  confirmationChannels: _,
2368
- defaultConfirmationChannels: M,
2369
- submitError: J
2593
+ defaultConfirmationChannels: x,
2594
+ submitError: xe
2370
2595
  },
2371
- emptyServicesSlot: be,
2372
- onboardingIncompleteSlot: U,
2373
- loadingDates: z,
2374
- loadingSlots: G,
2375
- onDateSelect: Z,
2596
+ emptyServicesSlot: Se,
2597
+ onboardingIncompleteSlot: Ie,
2598
+ loadingDates: q,
2599
+ loadingSlots: pe,
2600
+ onDateSelect: G,
2601
+ onWindowChange: B,
2376
2602
  datePickerStyle: E,
2377
- submitting: T,
2378
- locale: Q,
2379
- activeStep: re,
2380
- setActiveStep: de
2603
+ specialtyPickerStyle: U,
2604
+ servicePickerStyle: P,
2605
+ operatorPickerStyle: Q,
2606
+ submitting: ee,
2607
+ locale: te,
2608
+ activeStep: We,
2609
+ setActiveStep: ge
2381
2610
  };
2382
- return /* @__PURE__ */ s(V, { ...Ee });
2611
+ return /* @__PURE__ */ s(R, { ...ze });
2383
2612
  }, [
2384
- le,
2385
- R,
2386
- I,
2613
+ fe,
2614
+ C,
2387
2615
  L,
2616
+ J,
2617
+ u,
2618
+ de,
2619
+ r,
2620
+ c,
2388
2621
  m,
2389
2622
  g,
2390
- c,
2391
- p,
2392
- u,
2393
- y,
2394
- C,
2395
- qe,
2623
+ S,
2624
+ Qe,
2396
2625
  t,
2397
2626
  n,
2398
- S,
2399
2627
  k,
2400
- h,
2401
- J,
2628
+ I,
2629
+ v,
2630
+ xe,
2402
2631
  N,
2403
- x,
2632
+ M,
2404
2633
  D,
2634
+ y,
2405
2635
  b,
2406
- f,
2407
- r,
2636
+ d,
2408
2637
  _,
2409
- M,
2410
- be,
2411
- U,
2412
- z,
2638
+ x,
2639
+ Se,
2640
+ Ie,
2641
+ q,
2642
+ pe,
2413
2643
  G,
2414
- Z,
2644
+ B,
2415
2645
  E,
2416
- T,
2646
+ U,
2647
+ P,
2417
2648
  Q,
2418
- re
2649
+ ee,
2650
+ te,
2651
+ We
2419
2652
  ]);
2420
- return /* @__PURE__ */ v(
2653
+ return /* @__PURE__ */ f(
2421
2654
  "div",
2422
2655
  {
2423
- ref: ue,
2656
+ ref: ve,
2424
2657
  role: "region",
2425
- "aria-label": vt,
2426
- id: X,
2658
+ "aria-label": Dt,
2659
+ id: oe,
2427
2660
  "data-component": "booking",
2428
- "data-component-id": X,
2429
- "data-variant": R,
2430
- className: _a({
2431
- variant: R,
2432
- surface: se,
2433
- className: De
2661
+ "data-component-id": oe,
2662
+ "data-variant": C,
2663
+ className: za({
2664
+ variant: C,
2665
+ surface: me,
2666
+ className: Le
2434
2667
  }),
2435
- ..._e,
2668
+ ...Ne,
2436
2669
  children: [
2437
- /* @__PURE__ */ v(
2670
+ /* @__PURE__ */ f(
2438
2671
  "div",
2439
2672
  {
2440
2673
  className: [
@@ -2446,22 +2679,22 @@ const Wa = [], Za = [], Ja = Je(
2446
2679
  "ds:pt-[var(--spacing-md)] ds:pb-[var(--spacing-md)]"
2447
2680
  ].join(" "),
2448
2681
  children: [
2449
- /* @__PURE__ */ s("h2", { className: "type-title-card ds:text-[var(--foreground)] ds:m-0", children: ie("booking.regionLabel") }),
2450
- /* @__PURE__ */ s("p", { className: "type-body-sm ds:text-[var(--muted-foreground)] ds:m-0", children: ie("booking.headingSubtitle") })
2682
+ /* @__PURE__ */ s("h2", { className: "type-title-card ds:text-[var(--foreground)] ds:m-0", children: re("booking.regionLabel") }),
2683
+ /* @__PURE__ */ s("p", { className: "type-body-sm ds:text-[var(--muted-foreground)] ds:m-0", children: re("booking.headingSubtitle") })
2451
2684
  ]
2452
2685
  }
2453
2686
  ),
2454
- bt ?? yt
2687
+ At ?? _t
2455
2688
  ]
2456
2689
  }
2457
2690
  );
2458
2691
  }
2459
2692
  );
2460
- Ja.displayName = "Booking";
2693
+ ls.displayName = "Booking";
2461
2694
  export {
2462
- Ja as B,
2463
- Fe as C,
2464
- he as O,
2465
- ha as b
2695
+ ls as B,
2696
+ qe as C,
2697
+ X as O,
2698
+ Da as b
2466
2699
  };
2467
- //# sourceMappingURL=booking-x4GlW5cb.js.map
2700
+ //# sourceMappingURL=booking-eM0y0NIR.js.map