@alfadocs/ui-kit 0.33.8 → 0.33.10

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