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