@alfadocs/ui-kit 0.33.11 → 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-Db4BQ9eH.js → booking-eM0y0NIR.js} +1247 -1042
- package/dist/agent-catalog.json +1 -1
- package/dist/components/booking/booking-types.d.ts +64 -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
|
|
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
12
|
import { F as Z } from "./form-field-BOm9hK35.js";
|
|
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 {
|
|
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";
|
|
29
31
|
import { c as V } from "./createLucideIcon-CrFbzy84.js";
|
|
30
|
-
import { M as
|
|
31
|
-
import { S as
|
|
32
|
-
import { H as
|
|
33
|
-
import { E as
|
|
34
|
-
import { S as
|
|
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 qt = [
|
|
|
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 Gt = [
|
|
|
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 Yt = [
|
|
|
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 Zt = [
|
|
|
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 Xt = [
|
|
|
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 ea = [
|
|
|
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 ga = [
|
|
|
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 ba = {
|
|
|
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 ka(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
344
|
service: p,
|
|
335
|
-
operator:
|
|
336
|
-
date:
|
|
337
|
-
slot:
|
|
338
|
-
details:
|
|
339
|
-
onboardingIncomplete:
|
|
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 Ia(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
379
|
const c = e.availableSlots[e.value.date];
|
|
369
|
-
c && (o = c.find((
|
|
380
|
+
c && (o = c.find((m) => m.key === e.value.slotKey));
|
|
370
381
|
}
|
|
371
|
-
const
|
|
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:
|
|
389
|
+
isReadyToSubmit: r,
|
|
379
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 st(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,
|
|
411
|
+
serviceId: void 0,
|
|
412
|
+
serviceIds: void 0,
|
|
413
|
+
operatorId: void 0,
|
|
414
|
+
operatorIds: void 0,
|
|
415
|
+
date: void 0,
|
|
416
|
+
slotKey: void 0,
|
|
417
|
+
details: void 0
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
function pt(e, t) {
|
|
421
|
+
return {
|
|
422
|
+
...e,
|
|
423
|
+
specialtyId: void 0,
|
|
424
|
+
specialtyIds: t,
|
|
399
425
|
serviceId: void 0,
|
|
426
|
+
serviceIds: void 0,
|
|
400
427
|
operatorId: void 0,
|
|
428
|
+
operatorIds: void 0,
|
|
401
429
|
date: void 0,
|
|
402
430
|
slotKey: void 0,
|
|
403
431
|
details: void 0
|
|
404
432
|
};
|
|
405
433
|
}
|
|
406
|
-
function
|
|
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,
|
|
423
467
|
date: void 0,
|
|
424
468
|
slotKey: void 0,
|
|
425
469
|
details: void 0
|
|
426
470
|
};
|
|
427
471
|
}
|
|
428
|
-
function
|
|
472
|
+
function ht(e, t) {
|
|
473
|
+
return {
|
|
474
|
+
...e,
|
|
475
|
+
operatorId: void 0,
|
|
476
|
+
operatorIds: t,
|
|
477
|
+
date: void 0,
|
|
478
|
+
slotKey: void 0,
|
|
479
|
+
details: void 0
|
|
480
|
+
};
|
|
481
|
+
}
|
|
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 Ae(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
|
|
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,
|
|
@@ -482,133 +544,133 @@ const We = 500, Aa = /^[A-Z0-9]{16}$/, _a = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xe = 3
|
|
|
482
544
|
requireCodiceFiscale: i = !1,
|
|
483
545
|
requireDateOfBirth: n = !1,
|
|
484
546
|
requireInsuranceNumber: o = !1,
|
|
485
|
-
insuranceType:
|
|
486
|
-
showNote:
|
|
487
|
-
showReturningPatientFlag:
|
|
488
|
-
privacyPolicyUrl:
|
|
489
|
-
termsUrl:
|
|
547
|
+
insuranceType: l,
|
|
548
|
+
showNote: u = !1,
|
|
549
|
+
showReturningPatientFlag: p = !1,
|
|
550
|
+
privacyPolicyUrl: r,
|
|
551
|
+
termsUrl: c,
|
|
490
552
|
validateCodiceFiscale: m,
|
|
491
|
-
validateInsuranceNumber:
|
|
492
|
-
submitting:
|
|
493
|
-
summarySlot:
|
|
494
|
-
defaultPhoneCountry:
|
|
495
|
-
confirmationChannels:
|
|
496
|
-
defaultConfirmationChannels:
|
|
497
|
-
submitError:
|
|
498
|
-
},
|
|
499
|
-
var
|
|
500
|
-
const { t:
|
|
501
|
-
(
|
|
553
|
+
validateInsuranceNumber: k,
|
|
554
|
+
submitting: I = !1,
|
|
555
|
+
summarySlot: v,
|
|
556
|
+
defaultPhoneCountry: N,
|
|
557
|
+
confirmationChannels: M,
|
|
558
|
+
defaultConfirmationChannels: D,
|
|
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 || !m || !
|
|
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
|
-
m(
|
|
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, m, e.codiceFiscale,
|
|
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, Aa = /^[A-Z0-9]{16}$/, _a = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xe = 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, Aa = /^[A-Z0-9]{16}$/, _a = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xe = 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, Aa = /^[A-Z0-9]{16}$/, _a = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xe = 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,32 +723,32 @@ const We = 500, Aa = /^[A-Z0-9]{16}$/, _a = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xe = 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:
|
|
670
|
-
id:
|
|
731
|
+
ref: b,
|
|
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
|
}
|
|
@@ -694,34 +756,34 @@ const We = 500, Aa = /^[A-Z0-9]{16}$/, _a = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xe = 3
|
|
|
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
|
}
|
|
@@ -729,39 +791,39 @@ const We = 500, Aa = /^[A-Z0-9]{16}$/, _a = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xe = 3
|
|
|
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
|
-
defaultCountry:
|
|
740
|
-
onChange: (
|
|
741
|
-
|
|
801
|
+
defaultCountry: N == null ? void 0 : N.toUpperCase(),
|
|
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
|
}
|
|
@@ -769,76 +831,76 @@ const We = 500, Aa = /^[A-Z0-9]{16}$/, _a = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xe = 3
|
|
|
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
|
-
|
|
851
|
+
Y ? /* @__PURE__ */ s(
|
|
790
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
|
-
|
|
868
|
+
u ? /* @__PURE__ */ s(
|
|
807
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, Aa = /^[A-Z0-9]{16}$/, _a = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xe = 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, Aa = /^[A-Z0-9]{16}$/, _a = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xe = 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, Aa = /^[A-Z0-9]{16}$/, _a = /^[^\s@]+@[^\s@]+\.[^\s@]+$/, Xe = 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 Ta = Me(
|
|
|
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 Ea = [
|
|
|
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 Ea = [
|
|
|
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
|
|
1035
|
-
|
|
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
|
-
return new Intl.DateTimeFormat(i, { weekday: "short" }).format(
|
|
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
|
-
[
|
|
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 Va({
|
|
|
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 Va({
|
|
|
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 Va({
|
|
|
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: m.slice(
|
|
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 Va({
|
|
|
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 La = Me(
|
|
|
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
|
-
}),
|
|
1300
|
+
}), u = se(/* @__PURE__ */ new Map()), p = j((c) => {
|
|
1239
1301
|
var m;
|
|
1240
|
-
(m =
|
|
1241
|
-
}, []),
|
|
1242
|
-
(
|
|
1243
|
-
const
|
|
1244
|
-
if (
|
|
1245
|
-
switch (
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 Fa({
|
|
|
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
|
-
}),
|
|
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: () =>
|
|
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(
|
|
@@ -1311,22 +1373,22 @@ function Fa({
|
|
|
1311
1373
|
{
|
|
1312
1374
|
"aria-hidden": "true",
|
|
1313
1375
|
className: "ds:flex ds:size-10 ds:shrink-0 ds:items-center ds:justify-center ds:rounded-[var(--radius-sm)] ds:bg-[var(--primary)]/10 ds:text-[var(--primary)]",
|
|
1314
|
-
children:
|
|
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 $a = Me(
|
|
|
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,86 +1431,86 @@ function ja({
|
|
|
1369
1431
|
loading: n,
|
|
1370
1432
|
locale: o
|
|
1371
1433
|
}) {
|
|
1372
|
-
const { t:
|
|
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]),
|
|
1444
|
+
}, [e, o]), p = w(() => {
|
|
1383
1445
|
const m = {
|
|
1384
1446
|
morning: [],
|
|
1385
1447
|
afternoon: [],
|
|
1386
1448
|
evening: []
|
|
1387
1449
|
};
|
|
1388
|
-
for (const
|
|
1389
|
-
m[
|
|
1450
|
+
for (const k of t)
|
|
1451
|
+
m[Wa(k.time)].push(k);
|
|
1390
1452
|
return m;
|
|
1391
|
-
}, [t]),
|
|
1392
|
-
return n ? /* @__PURE__ */
|
|
1393
|
-
/* @__PURE__ */ s(
|
|
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%" }),
|
|
1394
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:
|
|
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:
|
|
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":
|
|
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
|
|
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: !
|
|
1443
|
-
"aria-pressed":
|
|
1444
|
-
"aria-label":
|
|
1445
|
-
time:
|
|
1503
|
+
"data-slot-id": v.key,
|
|
1504
|
+
disabled: !v.available,
|
|
1505
|
+
"aria-pressed": N,
|
|
1506
|
+
"aria-label": l("booking.slotAvailableLabel", {
|
|
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
|
}
|
|
@@ -1460,108 +1522,108 @@ function ja({
|
|
|
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
1532
|
onWindowChange: o,
|
|
1471
|
-
loadingDates:
|
|
1472
|
-
loadingSlots:
|
|
1473
|
-
locale:
|
|
1533
|
+
loadingDates: l,
|
|
1534
|
+
loadingSlots: u,
|
|
1535
|
+
locale: p
|
|
1474
1536
|
}) {
|
|
1475
|
-
const
|
|
1537
|
+
const r = w(() => le(/* @__PURE__ */ new Date()), []), [c, m] = K(() => {
|
|
1476
1538
|
if (a.date) {
|
|
1477
|
-
const
|
|
1478
|
-
if (!
|
|
1539
|
+
const g = le(F(a.date));
|
|
1540
|
+
if (!ce(r, g)) return g;
|
|
1479
1541
|
}
|
|
1480
1542
|
if (e.length > 0) {
|
|
1481
|
-
const
|
|
1482
|
-
if (
|
|
1543
|
+
const g = le(F(e[0]));
|
|
1544
|
+
if (ce(g, r)) return g;
|
|
1483
1545
|
}
|
|
1484
|
-
return
|
|
1485
|
-
}),
|
|
1486
|
-
() =>
|
|
1487
|
-
[
|
|
1488
|
-
),
|
|
1489
|
-
const
|
|
1490
|
-
id:
|
|
1546
|
+
return r;
|
|
1547
|
+
}), k = w(
|
|
1548
|
+
() => je(c, Ae - 1),
|
|
1549
|
+
[c]
|
|
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,
|
|
1491
1553
|
// SlotGrid formats `start` as a time via Intl.DateTimeFormat —
|
|
1492
1554
|
// compose a full ISO from the column's date + the slot's HH:mm
|
|
1493
1555
|
// so the locale-formatter has a real timestamp to work with.
|
|
1494
|
-
start: `${
|
|
1495
|
-
available:
|
|
1556
|
+
start: `${A}T${E.time}:00`,
|
|
1557
|
+
available: E.available
|
|
1496
1558
|
}));
|
|
1497
|
-
return { date:
|
|
1498
|
-
}), [
|
|
1499
|
-
m((
|
|
1500
|
-
const
|
|
1501
|
-
return
|
|
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;
|
|
1502
1564
|
});
|
|
1503
|
-
}, [
|
|
1504
|
-
m((
|
|
1565
|
+
}, [r]), D = j(() => {
|
|
1566
|
+
m((g) => je(g, Ae));
|
|
1505
1567
|
}, []);
|
|
1506
|
-
|
|
1568
|
+
H(() => {
|
|
1507
1569
|
if (e.length === 0) return;
|
|
1508
|
-
const
|
|
1509
|
-
!
|
|
1510
|
-
const
|
|
1511
|
-
return !
|
|
1512
|
-
}) || m(
|
|
1513
|
-
}, [e]),
|
|
1514
|
-
o == null || o(
|
|
1515
|
-
}, [
|
|
1516
|
-
const
|
|
1517
|
-
(
|
|
1518
|
-
const
|
|
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);
|
|
1519
1581
|
i({
|
|
1520
|
-
...
|
|
1521
|
-
}), n == null || n(
|
|
1582
|
+
...vt(Ee(a, T), g.id)
|
|
1583
|
+
}), n == null || n(T);
|
|
1522
1584
|
},
|
|
1523
1585
|
[i, n, a]
|
|
1524
|
-
),
|
|
1525
|
-
return /* @__PURE__ */
|
|
1526
|
-
!
|
|
1527
|
-
|
|
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,
|
|
1528
1590
|
{
|
|
1529
|
-
nextAvailableDate:
|
|
1530
|
-
onJump: () => m(
|
|
1531
|
-
locale:
|
|
1591
|
+
nextAvailableDate: _,
|
|
1592
|
+
onJump: () => m(le(F(_))),
|
|
1593
|
+
locale: p
|
|
1532
1594
|
}
|
|
1533
1595
|
) : null,
|
|
1534
1596
|
/* @__PURE__ */ s(
|
|
1535
|
-
|
|
1597
|
+
Kt,
|
|
1536
1598
|
{
|
|
1537
|
-
days:
|
|
1538
|
-
state:
|
|
1599
|
+
days: I,
|
|
1600
|
+
state: b,
|
|
1539
1601
|
selectedSlotId: a.slotKey,
|
|
1540
1602
|
maxInitialSlotsPerDay: 6,
|
|
1541
|
-
locale:
|
|
1542
|
-
hasPrevious:
|
|
1543
|
-
hasNext:
|
|
1544
|
-
onSlotSelect:
|
|
1545
|
-
onPreviousDays:
|
|
1546
|
-
onNextDays:
|
|
1603
|
+
locale: p,
|
|
1604
|
+
hasPrevious: v,
|
|
1605
|
+
hasNext: N,
|
|
1606
|
+
onSlotSelect: y,
|
|
1607
|
+
onPreviousDays: M,
|
|
1608
|
+
onNextDays: D
|
|
1547
1609
|
}
|
|
1548
1610
|
)
|
|
1549
1611
|
] });
|
|
1550
1612
|
}
|
|
1551
|
-
function
|
|
1613
|
+
function yt(e) {
|
|
1552
1614
|
const {
|
|
1553
1615
|
inputs: t,
|
|
1554
1616
|
value: a,
|
|
1555
1617
|
onChange: i,
|
|
1556
1618
|
onDateSelect: n,
|
|
1557
1619
|
onWindowChange: o,
|
|
1558
|
-
loadingDates:
|
|
1559
|
-
loadingSlots:
|
|
1560
|
-
locale:
|
|
1561
|
-
datePickerStyle:
|
|
1620
|
+
loadingDates: l,
|
|
1621
|
+
loadingSlots: u,
|
|
1622
|
+
locale: p,
|
|
1623
|
+
datePickerStyle: r
|
|
1562
1624
|
} = e;
|
|
1563
|
-
return
|
|
1564
|
-
|
|
1625
|
+
return r === "four-day-grid" ? /* @__PURE__ */ s(
|
|
1626
|
+
es,
|
|
1565
1627
|
{
|
|
1566
1628
|
availableDates: t.availableDates,
|
|
1567
1629
|
availableSlots: t.availableSlots,
|
|
@@ -1569,46 +1631,46 @@ function lt(e) {
|
|
|
1569
1631
|
onChange: i,
|
|
1570
1632
|
onDateSelect: n,
|
|
1571
1633
|
onWindowChange: o,
|
|
1572
|
-
loadingDates:
|
|
1573
|
-
loadingSlots:
|
|
1574
|
-
locale:
|
|
1634
|
+
loadingDates: l,
|
|
1635
|
+
loadingSlots: u,
|
|
1636
|
+
locale: p
|
|
1575
1637
|
}
|
|
1576
1638
|
) : /* @__PURE__ */ s(
|
|
1577
|
-
|
|
1639
|
+
Ua,
|
|
1578
1640
|
{
|
|
1579
1641
|
availableDates: t.availableDates,
|
|
1580
1642
|
selectedDate: a.date,
|
|
1581
|
-
onSelectDate: (
|
|
1582
|
-
i(
|
|
1643
|
+
onSelectDate: (c) => {
|
|
1644
|
+
i(Ee(a, c)), n == null || n(c);
|
|
1583
1645
|
},
|
|
1584
|
-
locale:
|
|
1585
|
-
loading:
|
|
1646
|
+
locale: p,
|
|
1647
|
+
loading: l ?? u
|
|
1586
1648
|
}
|
|
1587
1649
|
);
|
|
1588
1650
|
}
|
|
1589
|
-
function
|
|
1590
|
-
const { inputs: t, value: a, onChange: i, loadingSlots: n, locale: o, datePickerStyle:
|
|
1591
|
-
return
|
|
1592
|
-
|
|
1651
|
+
function kt(e) {
|
|
1652
|
+
const { inputs: t, value: a, onChange: i, loadingSlots: n, locale: o, datePickerStyle: l } = e;
|
|
1653
|
+
return l === "four-day-grid" || !a.date ? null : /* @__PURE__ */ s(
|
|
1654
|
+
Qa,
|
|
1593
1655
|
{
|
|
1594
1656
|
date: a.date,
|
|
1595
1657
|
slots: t.availableSlots[a.date] ?? [],
|
|
1596
1658
|
selectedSlotKey: a.slotKey,
|
|
1597
|
-
onSelect: (
|
|
1659
|
+
onSelect: (u) => i(vt(a, u.key)),
|
|
1598
1660
|
loading: n,
|
|
1599
1661
|
locale: o
|
|
1600
1662
|
}
|
|
1601
1663
|
);
|
|
1602
1664
|
}
|
|
1603
|
-
function
|
|
1604
|
-
const { t: a } =
|
|
1665
|
+
function xt({ value: e, onChange: t }) {
|
|
1666
|
+
const { t: a } = O(), i = [
|
|
1605
1667
|
{ value: "private", label: a("booking.insurance.private") },
|
|
1606
1668
|
{ value: "public", label: a("booking.insurance.public") }
|
|
1607
1669
|
];
|
|
1608
|
-
return /* @__PURE__ */
|
|
1670
|
+
return /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
1609
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") }),
|
|
1610
1672
|
/* @__PURE__ */ s(
|
|
1611
|
-
|
|
1673
|
+
Oe,
|
|
1612
1674
|
{
|
|
1613
1675
|
options: i,
|
|
1614
1676
|
value: e ?? "",
|
|
@@ -1621,176 +1683,280 @@ function ut({ value: e, onChange: t }) {
|
|
|
1621
1683
|
)
|
|
1622
1684
|
] });
|
|
1623
1685
|
}
|
|
1624
|
-
function
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
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,
|
|
1713
|
+
/* @__PURE__ */ s(
|
|
1714
|
+
Ge,
|
|
1715
|
+
{
|
|
1716
|
+
options: u,
|
|
1717
|
+
value: t ?? "",
|
|
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")
|
|
1734
|
+
}
|
|
1735
|
+
)
|
|
1736
|
+
] });
|
|
1737
|
+
}
|
|
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,
|
|
1631
1781
|
/* @__PURE__ */ s(
|
|
1632
|
-
|
|
1782
|
+
Oe,
|
|
1633
1783
|
{
|
|
1634
|
-
options:
|
|
1784
|
+
options: r,
|
|
1635
1785
|
value: t ?? "",
|
|
1636
|
-
onValueChange: (
|
|
1637
|
-
placeholder:
|
|
1638
|
-
"aria-label":
|
|
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
|
|
1639
1799
|
}
|
|
1640
1800
|
)
|
|
1641
1801
|
] });
|
|
1642
1802
|
}
|
|
1643
|
-
function
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
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
|
|
1651
1816
|
}));
|
|
1652
|
-
return /* @__PURE__ */
|
|
1653
|
-
|
|
1817
|
+
return /* @__PURE__ */ f("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
1818
|
+
u,
|
|
1654
1819
|
/* @__PURE__ */ s(
|
|
1655
|
-
|
|
1820
|
+
Ue,
|
|
1656
1821
|
{
|
|
1657
|
-
options:
|
|
1658
|
-
value:
|
|
1659
|
-
|
|
1660
|
-
placeholder:
|
|
1661
|
-
"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
|
|
1662
1828
|
}
|
|
1663
1829
|
)
|
|
1664
1830
|
] });
|
|
1665
1831
|
}
|
|
1666
|
-
|
|
1667
|
-
|
|
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,
|
|
1668
1838
|
/* @__PURE__ */ s(
|
|
1669
|
-
|
|
1839
|
+
Ge,
|
|
1670
1840
|
{
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
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
|
|
1674
1847
|
}
|
|
1675
1848
|
)
|
|
1676
|
-
] })
|
|
1677
|
-
|
|
1678
|
-
function gt({ operators: e, value: t, onChange: a }) {
|
|
1679
|
-
const { t: i } = B(), n = [
|
|
1680
|
-
{ value: ve, label: i("booking.operator.all") },
|
|
1681
|
-
...e.map((o) => ({ value: o.id, label: o.name }))
|
|
1682
|
-
];
|
|
1683
|
-
return /* @__PURE__ */ b("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
1684
|
-
/* @__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,
|
|
1685
1851
|
/* @__PURE__ */ s(
|
|
1686
|
-
|
|
1852
|
+
Oe,
|
|
1687
1853
|
{
|
|
1688
|
-
options:
|
|
1689
|
-
value: t ??
|
|
1690
|
-
onValueChange: (
|
|
1691
|
-
placeholder:
|
|
1692
|
-
"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")
|
|
1693
1859
|
}
|
|
1694
1860
|
)
|
|
1695
1861
|
] });
|
|
1696
1862
|
}
|
|
1697
|
-
function
|
|
1863
|
+
function wt({
|
|
1698
1864
|
customSlot: e
|
|
1699
1865
|
}) {
|
|
1700
|
-
const { t } =
|
|
1701
|
-
return e ? /* @__PURE__ */ s(W, { children: e }) : /* @__PURE__ */
|
|
1702
|
-
/* @__PURE__ */ s(
|
|
1703
|
-
/* @__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") })
|
|
1704
1870
|
] });
|
|
1705
1871
|
}
|
|
1706
|
-
function
|
|
1872
|
+
function Je({
|
|
1707
1873
|
nextAvailableDate: e,
|
|
1708
1874
|
onJump: t,
|
|
1709
1875
|
locale: a
|
|
1710
1876
|
}) {
|
|
1711
|
-
const { t: i } =
|
|
1877
|
+
const { t: i } = O(), n = w(() => {
|
|
1712
1878
|
try {
|
|
1713
1879
|
return new Intl.DateTimeFormat(a, { dateStyle: "long" }).format(
|
|
1714
|
-
|
|
1880
|
+
F(e)
|
|
1715
1881
|
);
|
|
1716
1882
|
} catch {
|
|
1717
1883
|
return e;
|
|
1718
1884
|
}
|
|
1719
1885
|
}, [e, a]);
|
|
1720
|
-
return /* @__PURE__ */
|
|
1721
|
-
/* @__PURE__ */ s(
|
|
1722
|
-
/* @__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") }) })
|
|
1723
1889
|
] });
|
|
1724
1890
|
}
|
|
1725
|
-
function
|
|
1891
|
+
function ts({
|
|
1726
1892
|
snapshot: e,
|
|
1727
1893
|
operators: t,
|
|
1728
1894
|
specialties: a,
|
|
1729
1895
|
services: i,
|
|
1730
1896
|
locale: n,
|
|
1731
1897
|
mode: o,
|
|
1732
|
-
showModify:
|
|
1733
|
-
onReset:
|
|
1734
|
-
onModify:
|
|
1898
|
+
showModify: l,
|
|
1899
|
+
onReset: u,
|
|
1900
|
+
onModify: p
|
|
1735
1901
|
}) {
|
|
1736
|
-
const { t:
|
|
1737
|
-
(
|
|
1738
|
-
),
|
|
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", {
|
|
1739
1905
|
channels: m.join(" · ")
|
|
1740
|
-
}) :
|
|
1906
|
+
}) : r("booking.success.descriptionSingle", { channel: m[0] }), I = w(() => {
|
|
1741
1907
|
if (e.date)
|
|
1742
1908
|
try {
|
|
1743
1909
|
return new Intl.DateTimeFormat(n, {
|
|
1744
1910
|
weekday: "long",
|
|
1745
1911
|
day: "numeric",
|
|
1746
1912
|
month: "long"
|
|
1747
|
-
}).format(
|
|
1913
|
+
}).format(F(e.date));
|
|
1748
1914
|
} catch {
|
|
1749
1915
|
return e.date;
|
|
1750
1916
|
}
|
|
1751
|
-
}, [e.date, n]),
|
|
1752
|
-
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(
|
|
1753
1919
|
"div",
|
|
1754
1920
|
{
|
|
1755
1921
|
"data-component": "booking-success",
|
|
1756
1922
|
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]",
|
|
1757
1923
|
children: [
|
|
1758
|
-
/* @__PURE__ */
|
|
1759
|
-
/* @__PURE__ */ s(
|
|
1760
|
-
/* @__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 })
|
|
1761
1927
|
] }),
|
|
1762
|
-
/* @__PURE__ */ s("div", { className: "ds:rounded-[var(--radius-md)] ds:bg-[var(--secondary)] ds:p-[var(--spacing-md)]", children: /* @__PURE__ */
|
|
1763
|
-
|
|
1764
|
-
/* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children:
|
|
1765
|
-
/* @__PURE__ */ s("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: w.label })
|
|
1766
|
-
] }) : null,
|
|
1767
|
-
N ? /* @__PURE__ */ b(W, { children: [
|
|
1768
|
-
/* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children: l("booking.success.summaryService") }),
|
|
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") }),
|
|
1769
1931
|
/* @__PURE__ */ s("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: N.label })
|
|
1770
1932
|
] }) : null,
|
|
1771
|
-
|
|
1772
|
-
/* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children:
|
|
1773
|
-
/* @__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 })
|
|
1936
|
+
] }) : null,
|
|
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 })
|
|
1774
1940
|
] }) : null,
|
|
1775
|
-
/* @__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") }),
|
|
1776
1942
|
/* @__PURE__ */ s("dd", { className: "type-body ds:m-0 ds:text-[var(--foreground)]", children: e.slot.time }),
|
|
1777
|
-
|
|
1778
|
-
/* @__PURE__ */ s("dt", { className: "type-label ds:text-[var(--muted-foreground)]", children:
|
|
1779
|
-
/* @__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 })
|
|
1780
1946
|
] }) : null
|
|
1781
1947
|
] }) }),
|
|
1782
|
-
/* @__PURE__ */
|
|
1783
|
-
/* @__PURE__ */ s(
|
|
1784
|
-
|
|
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
|
|
1785
1951
|
] })
|
|
1786
1952
|
]
|
|
1787
1953
|
}
|
|
1788
1954
|
);
|
|
1789
1955
|
}
|
|
1790
|
-
function
|
|
1791
|
-
const { t } =
|
|
1956
|
+
function Ct({ customSlot: e }) {
|
|
1957
|
+
const { t } = O();
|
|
1792
1958
|
return e ? /* @__PURE__ */ s(W, { children: e }) : /* @__PURE__ */ s(
|
|
1793
|
-
|
|
1959
|
+
dt,
|
|
1794
1960
|
{
|
|
1795
1961
|
variant: "no-results",
|
|
1796
1962
|
title: t("booking.emptyServices.title"),
|
|
@@ -1798,196 +1964,220 @@ function ht({ customSlot: e }) {
|
|
|
1798
1964
|
}
|
|
1799
1965
|
);
|
|
1800
1966
|
}
|
|
1801
|
-
function
|
|
1967
|
+
function as(e) {
|
|
1802
1968
|
const {
|
|
1803
1969
|
cascade: t,
|
|
1804
1970
|
inputs: a,
|
|
1805
1971
|
value: i,
|
|
1806
1972
|
onChange: n,
|
|
1807
1973
|
onSubmit: o,
|
|
1808
|
-
emptyServicesSlot:
|
|
1809
|
-
onboardingIncompleteSlot:
|
|
1810
|
-
loadingDates:
|
|
1811
|
-
loadingSlots:
|
|
1812
|
-
onDateSelect:
|
|
1974
|
+
emptyServicesSlot: l,
|
|
1975
|
+
onboardingIncompleteSlot: u,
|
|
1976
|
+
loadingDates: p,
|
|
1977
|
+
loadingSlots: r,
|
|
1978
|
+
onDateSelect: c,
|
|
1813
1979
|
onWindowChange: m,
|
|
1814
|
-
datePickerStyle:
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
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: [
|
|
1820
1989
|
t.gates.insurance ? /* @__PURE__ */ s(
|
|
1821
|
-
|
|
1990
|
+
xt,
|
|
1822
1991
|
{
|
|
1823
1992
|
value: i.insuranceType,
|
|
1824
|
-
onChange: (
|
|
1993
|
+
onChange: (d) => n(ct(i, d))
|
|
1825
1994
|
}
|
|
1826
1995
|
) : null,
|
|
1827
1996
|
t.gates.specialty ? /* @__PURE__ */ s(
|
|
1828
|
-
|
|
1997
|
+
St,
|
|
1829
1998
|
{
|
|
1830
1999
|
specialties: t.filtered.specialties,
|
|
1831
2000
|
value: i.specialtyId,
|
|
1832
|
-
|
|
2001
|
+
valueIds: i.specialtyIds,
|
|
2002
|
+
onChange: (d) => n(ut(i, d)),
|
|
2003
|
+
onChangeIds: (d) => n(pt(i, d)),
|
|
2004
|
+
pickerStyle: I
|
|
1833
2005
|
}
|
|
1834
2006
|
) : null,
|
|
1835
|
-
t.gates.service ? t.filtered.services.length === 0 ? /* @__PURE__ */ s(
|
|
1836
|
-
|
|
2007
|
+
t.gates.service ? t.filtered.services.length === 0 ? /* @__PURE__ */ s(Ct, { customSlot: l }) : /* @__PURE__ */ s(
|
|
2008
|
+
It,
|
|
1837
2009
|
{
|
|
1838
2010
|
services: t.filtered.services,
|
|
1839
2011
|
value: i.serviceId,
|
|
1840
|
-
|
|
2012
|
+
valueIds: i.serviceIds,
|
|
2013
|
+
onChange: (d) => n(mt(i, d)),
|
|
2014
|
+
onChangeIds: (d) => n(gt(i, d)),
|
|
2015
|
+
pickerStyle: v
|
|
1841
2016
|
}
|
|
1842
2017
|
) : null,
|
|
1843
|
-
t.gates.onboardingIncomplete ? /* @__PURE__ */ s(
|
|
2018
|
+
t.gates.onboardingIncomplete ? /* @__PURE__ */ s(wt, { customSlot: u }) : null,
|
|
1844
2019
|
t.gates.operator ? /* @__PURE__ */ s(
|
|
1845
|
-
|
|
2020
|
+
Nt,
|
|
1846
2021
|
{
|
|
1847
2022
|
operators: t.filtered.operators,
|
|
1848
2023
|
value: i.operatorId,
|
|
1849
|
-
|
|
2024
|
+
valueIds: i.operatorIds,
|
|
2025
|
+
onChange: (d) => n(ft(i, d)),
|
|
2026
|
+
onChangeIds: (d) => n(ht(i, d)),
|
|
2027
|
+
pickerStyle: N
|
|
1850
2028
|
}
|
|
1851
2029
|
) : null,
|
|
1852
|
-
t.gates.date ? /* @__PURE__ */
|
|
1853
|
-
/* @__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") }),
|
|
1854
2032
|
a.availableDates.length === 0 && a.nextAvailableDate ? /* @__PURE__ */ s(
|
|
1855
|
-
|
|
2033
|
+
Je,
|
|
1856
2034
|
{
|
|
1857
2035
|
nextAvailableDate: a.nextAvailableDate,
|
|
1858
|
-
onJump: () => n(
|
|
1859
|
-
locale:
|
|
2036
|
+
onJump: () => n(Ee(i, a.nextAvailableDate)),
|
|
2037
|
+
locale: D
|
|
1860
2038
|
}
|
|
1861
|
-
) :
|
|
2039
|
+
) : yt({
|
|
1862
2040
|
inputs: a,
|
|
1863
2041
|
value: i,
|
|
1864
2042
|
onChange: n,
|
|
1865
|
-
onDateSelect:
|
|
2043
|
+
onDateSelect: c,
|
|
1866
2044
|
onWindowChange: m,
|
|
1867
|
-
loadingDates:
|
|
1868
|
-
loadingSlots:
|
|
1869
|
-
locale:
|
|
1870
|
-
datePickerStyle:
|
|
2045
|
+
loadingDates: p,
|
|
2046
|
+
loadingSlots: r,
|
|
2047
|
+
locale: D,
|
|
2048
|
+
datePickerStyle: k
|
|
1871
2049
|
})
|
|
1872
2050
|
] }) : null,
|
|
1873
|
-
t.gates.slot && i.date &&
|
|
1874
|
-
/* @__PURE__ */ s("h3", { className: "type-label ds:font-[var(--font-weight-semibold)] ds:text-[var(--foreground)] ds:m-0", children:
|
|
1875
|
-
|
|
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({
|
|
1876
2054
|
inputs: a,
|
|
1877
2055
|
value: i,
|
|
1878
2056
|
onChange: n,
|
|
1879
|
-
loadingSlots:
|
|
1880
|
-
locale:
|
|
1881
|
-
datePickerStyle:
|
|
2057
|
+
loadingSlots: r,
|
|
2058
|
+
locale: D,
|
|
2059
|
+
datePickerStyle: k
|
|
1882
2060
|
})
|
|
1883
2061
|
] }) : null,
|
|
1884
2062
|
t.gates.details && t.selectedSlot ? /* @__PURE__ */ s(
|
|
1885
|
-
|
|
2063
|
+
Ye,
|
|
1886
2064
|
{
|
|
1887
|
-
...
|
|
2065
|
+
...y,
|
|
1888
2066
|
value: i.details ?? {},
|
|
1889
|
-
onChange: (
|
|
2067
|
+
onChange: (d) => n({ ...i, details: d }),
|
|
1890
2068
|
onSubmit: o,
|
|
1891
|
-
submitting:
|
|
2069
|
+
submitting: M,
|
|
1892
2070
|
defaultPhoneCountry: e.policy.country
|
|
1893
2071
|
}
|
|
1894
2072
|
) : null
|
|
1895
2073
|
] });
|
|
1896
2074
|
}
|
|
1897
|
-
function
|
|
2075
|
+
function $(e, t, a = {}) {
|
|
1898
2076
|
const {
|
|
1899
2077
|
cascade: i,
|
|
1900
2078
|
inputs: n,
|
|
1901
2079
|
value: o,
|
|
1902
|
-
onChange:
|
|
1903
|
-
onSubmit:
|
|
1904
|
-
emptyServicesSlot:
|
|
1905
|
-
onboardingIncompleteSlot:
|
|
1906
|
-
loadingDates:
|
|
2080
|
+
onChange: l,
|
|
2081
|
+
onSubmit: u,
|
|
2082
|
+
emptyServicesSlot: p,
|
|
2083
|
+
onboardingIncompleteSlot: r,
|
|
2084
|
+
loadingDates: c,
|
|
1907
2085
|
loadingSlots: m,
|
|
1908
|
-
onDateSelect:
|
|
1909
|
-
onWindowChange:
|
|
1910
|
-
datePickerStyle:
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
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: _
|
|
1915
2096
|
} = t;
|
|
1916
2097
|
switch (e) {
|
|
1917
2098
|
case 1:
|
|
1918
2099
|
return /* @__PURE__ */ s(
|
|
1919
|
-
|
|
2100
|
+
xt,
|
|
1920
2101
|
{
|
|
1921
2102
|
value: o.insuranceType,
|
|
1922
|
-
onChange: (
|
|
2103
|
+
onChange: (x) => l(ct(o, x))
|
|
1923
2104
|
}
|
|
1924
2105
|
);
|
|
1925
2106
|
case 2:
|
|
1926
2107
|
return /* @__PURE__ */ s(
|
|
1927
|
-
|
|
2108
|
+
St,
|
|
1928
2109
|
{
|
|
1929
2110
|
specialties: i.filtered.specialties,
|
|
1930
2111
|
value: o.specialtyId,
|
|
1931
|
-
|
|
2112
|
+
valueIds: o.specialtyIds,
|
|
2113
|
+
onChange: (x) => l(ut(o, x)),
|
|
2114
|
+
onChangeIds: (x) => l(pt(o, x)),
|
|
2115
|
+
pickerStyle: N
|
|
1932
2116
|
}
|
|
1933
2117
|
);
|
|
1934
2118
|
case 3:
|
|
1935
|
-
return i.filtered.services.length === 0 ? /* @__PURE__ */ s(
|
|
1936
|
-
|
|
2119
|
+
return i.filtered.services.length === 0 ? /* @__PURE__ */ s(Ct, { customSlot: p }) : i.gates.onboardingIncomplete ? /* @__PURE__ */ s(wt, { customSlot: r }) : /* @__PURE__ */ s(
|
|
2120
|
+
It,
|
|
1937
2121
|
{
|
|
1938
2122
|
services: i.filtered.services,
|
|
1939
2123
|
value: o.serviceId,
|
|
1940
|
-
|
|
2124
|
+
valueIds: o.serviceIds,
|
|
2125
|
+
onChange: (x) => l(mt(o, x)),
|
|
2126
|
+
onChangeIds: (x) => l(gt(o, x)),
|
|
2127
|
+
pickerStyle: M,
|
|
1941
2128
|
compact: a.compactService
|
|
1942
2129
|
}
|
|
1943
2130
|
);
|
|
1944
2131
|
case 4:
|
|
1945
2132
|
return /* @__PURE__ */ s(
|
|
1946
|
-
|
|
2133
|
+
Nt,
|
|
1947
2134
|
{
|
|
1948
2135
|
operators: i.filtered.operators,
|
|
1949
2136
|
value: o.operatorId,
|
|
1950
|
-
|
|
2137
|
+
valueIds: o.operatorIds,
|
|
2138
|
+
onChange: (x) => l(ft(o, x)),
|
|
2139
|
+
onChangeIds: (x) => l(ht(o, x)),
|
|
2140
|
+
pickerStyle: D
|
|
1951
2141
|
}
|
|
1952
2142
|
);
|
|
1953
2143
|
case 5:
|
|
1954
2144
|
return n.availableDates.length === 0 && n.nextAvailableDate ? /* @__PURE__ */ s(
|
|
1955
|
-
|
|
2145
|
+
Je,
|
|
1956
2146
|
{
|
|
1957
2147
|
nextAvailableDate: n.nextAvailableDate,
|
|
1958
|
-
onJump: () =>
|
|
1959
|
-
locale:
|
|
2148
|
+
onJump: () => l(Ee(o, n.nextAvailableDate)),
|
|
2149
|
+
locale: b
|
|
1960
2150
|
}
|
|
1961
|
-
) :
|
|
2151
|
+
) : yt({
|
|
1962
2152
|
inputs: n,
|
|
1963
2153
|
value: o,
|
|
1964
|
-
onChange:
|
|
1965
|
-
onDateSelect:
|
|
1966
|
-
onWindowChange:
|
|
1967
|
-
loadingDates:
|
|
2154
|
+
onChange: l,
|
|
2155
|
+
onDateSelect: k,
|
|
2156
|
+
onWindowChange: I,
|
|
2157
|
+
loadingDates: c,
|
|
1968
2158
|
loadingSlots: m,
|
|
1969
|
-
locale:
|
|
1970
|
-
datePickerStyle:
|
|
2159
|
+
locale: b,
|
|
2160
|
+
datePickerStyle: v
|
|
1971
2161
|
});
|
|
1972
2162
|
case 6:
|
|
1973
|
-
return
|
|
2163
|
+
return kt({
|
|
1974
2164
|
inputs: n,
|
|
1975
2165
|
value: o,
|
|
1976
|
-
onChange:
|
|
2166
|
+
onChange: l,
|
|
1977
2167
|
loadingSlots: m,
|
|
1978
|
-
locale:
|
|
1979
|
-
datePickerStyle:
|
|
2168
|
+
locale: b,
|
|
2169
|
+
datePickerStyle: v
|
|
1980
2170
|
});
|
|
1981
2171
|
case 7:
|
|
1982
2172
|
return i.selectedSlot ? /* @__PURE__ */ s(
|
|
1983
|
-
|
|
2173
|
+
Ye,
|
|
1984
2174
|
{
|
|
1985
|
-
...
|
|
2175
|
+
...d,
|
|
1986
2176
|
value: o.details ?? {},
|
|
1987
|
-
onChange: (
|
|
1988
|
-
onSubmit:
|
|
1989
|
-
submitting:
|
|
1990
|
-
defaultPhoneCountry:
|
|
2177
|
+
onChange: (x) => l({ ...o, details: x }),
|
|
2178
|
+
onSubmit: u,
|
|
2179
|
+
submitting: y,
|
|
2180
|
+
defaultPhoneCountry: _.country
|
|
1991
2181
|
}
|
|
1992
2182
|
) : null;
|
|
1993
2183
|
/* c8 ignore next 2 */
|
|
@@ -1995,9 +2185,9 @@ function z(e, t, a = {}) {
|
|
|
1995
2185
|
return null;
|
|
1996
2186
|
}
|
|
1997
2187
|
}
|
|
1998
|
-
function
|
|
1999
|
-
const { t: e } =
|
|
2000
|
-
return
|
|
2188
|
+
function Ze() {
|
|
2189
|
+
const { t: e } = O();
|
|
2190
|
+
return w(
|
|
2001
2191
|
() => ({
|
|
2002
2192
|
1: e("booking.insurance.heading"),
|
|
2003
2193
|
2: e("booking.specialty.heading"),
|
|
@@ -2010,32 +2200,32 @@ function je() {
|
|
|
2010
2200
|
[e]
|
|
2011
2201
|
);
|
|
2012
2202
|
}
|
|
2013
|
-
function
|
|
2014
|
-
const { cascade: t, value: a, activeStep: i, setActiveStep: n, datePickerStyle: o } = e,
|
|
2015
|
-
() => 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,
|
|
2016
2206
|
[t.visibleSteps, o]
|
|
2017
|
-
),
|
|
2018
|
-
() =>
|
|
2019
|
-
label:
|
|
2020
|
-
summary:
|
|
2021
|
-
status:
|
|
2022
|
-
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 })
|
|
2023
2213
|
})),
|
|
2024
|
-
[
|
|
2025
|
-
),
|
|
2214
|
+
[u, a, l, t, e]
|
|
2215
|
+
), r = Math.max(0, t.visibleSteps.indexOf(i));
|
|
2026
2216
|
return /* @__PURE__ */ s(
|
|
2027
|
-
|
|
2217
|
+
$t,
|
|
2028
2218
|
{
|
|
2029
|
-
activeStep:
|
|
2030
|
-
steps:
|
|
2031
|
-
onStepChange: (
|
|
2032
|
-
const m = t.visibleSteps[
|
|
2219
|
+
activeStep: r,
|
|
2220
|
+
steps: p,
|
|
2221
|
+
onStepChange: (c) => {
|
|
2222
|
+
const m = t.visibleSteps[c];
|
|
2033
2223
|
m && n(m);
|
|
2034
2224
|
}
|
|
2035
2225
|
}
|
|
2036
2226
|
);
|
|
2037
2227
|
}
|
|
2038
|
-
function
|
|
2228
|
+
function ke(e, t) {
|
|
2039
2229
|
switch (e) {
|
|
2040
2230
|
case 1:
|
|
2041
2231
|
return t.insuranceType !== void 0;
|
|
@@ -2053,9 +2243,9 @@ function be(e, t) {
|
|
|
2053
2243
|
return !1;
|
|
2054
2244
|
}
|
|
2055
2245
|
}
|
|
2056
|
-
function
|
|
2246
|
+
function Mt(e, t, a) {
|
|
2057
2247
|
var i;
|
|
2058
|
-
if (
|
|
2248
|
+
if (ke(e, t))
|
|
2059
2249
|
switch (e) {
|
|
2060
2250
|
case 1:
|
|
2061
2251
|
return t.insuranceType;
|
|
@@ -2072,9 +2262,9 @@ function vt(e, t, a) {
|
|
|
2072
2262
|
return n == null ? void 0 : n.label;
|
|
2073
2263
|
}
|
|
2074
2264
|
case 4: {
|
|
2075
|
-
const n =
|
|
2265
|
+
const n = He(t);
|
|
2076
2266
|
if (!n) return;
|
|
2077
|
-
const o = a.filtered.operators.find((
|
|
2267
|
+
const o = a.filtered.operators.find((l) => l.id === n);
|
|
2078
2268
|
return o == null ? void 0 : o.name;
|
|
2079
2269
|
}
|
|
2080
2270
|
case 5:
|
|
@@ -2085,108 +2275,114 @@ function vt(e, t, a) {
|
|
|
2085
2275
|
return;
|
|
2086
2276
|
}
|
|
2087
2277
|
}
|
|
2088
|
-
function
|
|
2089
|
-
const { cascade: t, value: a, setActiveStep: i } = e, { t: n } =
|
|
2090
|
-
(
|
|
2091
|
-
),
|
|
2092
|
-
(
|
|
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)
|
|
2093
2283
|
);
|
|
2094
|
-
return /* @__PURE__ */
|
|
2095
|
-
|
|
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(
|
|
2096
2286
|
"div",
|
|
2097
2287
|
{
|
|
2098
2288
|
role: "group",
|
|
2099
2289
|
"aria-label": n("booking.regionLabel"),
|
|
2100
2290
|
className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
2101
|
-
children:
|
|
2102
|
-
const
|
|
2103
|
-
return
|
|
2104
|
-
|
|
2291
|
+
children: l.map((p) => {
|
|
2292
|
+
const r = Mt(p, a, t);
|
|
2293
|
+
return r ? /* @__PURE__ */ f(
|
|
2294
|
+
ie,
|
|
2105
2295
|
{
|
|
2106
2296
|
intent: "tonal",
|
|
2107
2297
|
size: "sm",
|
|
2108
|
-
onClick: () => i(
|
|
2298
|
+
onClick: () => i(p),
|
|
2109
2299
|
children: [
|
|
2110
|
-
o[
|
|
2300
|
+
o[p],
|
|
2111
2301
|
": ",
|
|
2112
|
-
|
|
2302
|
+
r
|
|
2113
2303
|
]
|
|
2114
2304
|
},
|
|
2115
|
-
`csc-${
|
|
2305
|
+
`csc-${p}`
|
|
2116
2306
|
) : null;
|
|
2117
2307
|
})
|
|
2118
2308
|
}
|
|
2119
2309
|
),
|
|
2120
|
-
!
|
|
2310
|
+
!u && t.gates.date ? (
|
|
2121
2311
|
// four-day-grid embeds slots inline with the day strip — the
|
|
2122
2312
|
// historic 2-col date|slot split collapses to a single column
|
|
2123
2313
|
// so the picker spans the full width instead of orphaning an
|
|
2124
2314
|
// empty right cell.
|
|
2125
|
-
e.datePickerStyle === "four-day-grid" ? /* @__PURE__ */ s("div", { children:
|
|
2126
|
-
/* @__PURE__ */ s("div", { className: "ds:min-w-0", children:
|
|
2127
|
-
/* @__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 })
|
|
2128
2318
|
] })
|
|
2129
2319
|
) : null,
|
|
2130
|
-
t.gates.details ? /* @__PURE__ */ s("div", { children:
|
|
2320
|
+
t.gates.details ? /* @__PURE__ */ s("div", { children: $(7, e) }) : null
|
|
2131
2321
|
] });
|
|
2132
2322
|
}
|
|
2133
|
-
function
|
|
2134
|
-
const { cascade: t } = e,
|
|
2135
|
-
(
|
|
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
|
|
2136
2326
|
);
|
|
2137
|
-
return /* @__PURE__ */
|
|
2138
|
-
/* @__PURE__ */
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
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
|
|
2146
2342
|
] });
|
|
2147
2343
|
}
|
|
2148
|
-
function
|
|
2149
|
-
const { cascade: t, value: a, activeStep: i, setActiveStep: n, datePickerStyle: o } = e, { t:
|
|
2150
|
-
() => 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,
|
|
2151
2347
|
[t.visibleSteps, o]
|
|
2152
|
-
),
|
|
2153
|
-
() =>
|
|
2154
|
-
[
|
|
2155
|
-
),
|
|
2156
|
-
return /* @__PURE__ */
|
|
2157
|
-
/* @__PURE__ */ s(
|
|
2158
|
-
/* @__PURE__ */ s("div", { children:
|
|
2159
|
-
/* @__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: [
|
|
2160
2356
|
/* @__PURE__ */ s(
|
|
2161
|
-
|
|
2357
|
+
ie,
|
|
2162
2358
|
{
|
|
2163
2359
|
intent: "ghost",
|
|
2164
2360
|
size: "md",
|
|
2165
|
-
disabled: !
|
|
2361
|
+
disabled: !k,
|
|
2166
2362
|
onClick: () => {
|
|
2167
|
-
const
|
|
2168
|
-
|
|
2363
|
+
const v = p[r - 1];
|
|
2364
|
+
v && n(v);
|
|
2169
2365
|
},
|
|
2170
|
-
children:
|
|
2366
|
+
children: l("booking.actions.back")
|
|
2171
2367
|
}
|
|
2172
2368
|
),
|
|
2173
2369
|
i < 7 ? /* @__PURE__ */ s(
|
|
2174
|
-
|
|
2370
|
+
ie,
|
|
2175
2371
|
{
|
|
2176
2372
|
intent: "primary",
|
|
2177
2373
|
size: "md",
|
|
2178
|
-
disabled: !
|
|
2374
|
+
disabled: !I,
|
|
2179
2375
|
onClick: () => {
|
|
2180
|
-
const
|
|
2181
|
-
|
|
2376
|
+
const v = p[r + 1];
|
|
2377
|
+
v && n(v);
|
|
2182
2378
|
},
|
|
2183
|
-
children:
|
|
2379
|
+
children: l("booking.actions.next")
|
|
2184
2380
|
}
|
|
2185
2381
|
) : null
|
|
2186
2382
|
] })
|
|
2187
2383
|
] });
|
|
2188
2384
|
}
|
|
2189
|
-
const
|
|
2385
|
+
const rs = [], ds = [], ls = ot(
|
|
2190
2386
|
({
|
|
2191
2387
|
variant: e = "inline-list",
|
|
2192
2388
|
country: t,
|
|
@@ -2197,72 +2393,75 @@ const Wa = [], Xa = [], Qa = Qe(
|
|
|
2197
2393
|
allowOperatorSelection: i = !1,
|
|
2198
2394
|
lockedOperatorId: n,
|
|
2199
2395
|
autoSelectSingleService: o = !1,
|
|
2200
|
-
specialties:
|
|
2201
|
-
services:
|
|
2202
|
-
operators:
|
|
2203
|
-
availableDates:
|
|
2204
|
-
availableSlots:
|
|
2396
|
+
specialties: l,
|
|
2397
|
+
services: u,
|
|
2398
|
+
operators: p,
|
|
2399
|
+
availableDates: r,
|
|
2400
|
+
availableSlots: c,
|
|
2205
2401
|
nextAvailableDate: m,
|
|
2206
|
-
requireCodiceFiscale:
|
|
2207
|
-
requireDateOfBirth:
|
|
2208
|
-
requireInsuranceNumber:
|
|
2209
|
-
showNote:
|
|
2210
|
-
showReturningPatientFlag:
|
|
2211
|
-
privacyPolicyUrl:
|
|
2212
|
-
termsUrl:
|
|
2213
|
-
validateCodiceFiscale:
|
|
2214
|
-
validateInsuranceNumber:
|
|
2215
|
-
confirmationChannels:
|
|
2216
|
-
defaultConfirmationChannels:
|
|
2217
|
-
value:
|
|
2218
|
-
onChange:
|
|
2219
|
-
onSubmit:
|
|
2220
|
-
onStepChange:
|
|
2221
|
-
onDateSelect:
|
|
2222
|
-
onWindowChange:
|
|
2223
|
-
datePickerStyle:
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
"
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2402
|
+
requireCodiceFiscale: k,
|
|
2403
|
+
requireDateOfBirth: I,
|
|
2404
|
+
requireInsuranceNumber: v,
|
|
2405
|
+
showNote: N,
|
|
2406
|
+
showReturningPatientFlag: M,
|
|
2407
|
+
privacyPolicyUrl: D,
|
|
2408
|
+
termsUrl: y,
|
|
2409
|
+
validateCodiceFiscale: b,
|
|
2410
|
+
validateInsuranceNumber: d,
|
|
2411
|
+
confirmationChannels: _,
|
|
2412
|
+
defaultConfirmationChannels: x,
|
|
2413
|
+
value: g,
|
|
2414
|
+
onChange: S,
|
|
2415
|
+
onSubmit: T,
|
|
2416
|
+
onStepChange: A,
|
|
2417
|
+
onDateSelect: G,
|
|
2418
|
+
onWindowChange: B,
|
|
2419
|
+
datePickerStyle: E = "month-calendar",
|
|
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",
|
|
2428
|
+
showModifyOnSuccess: ne = !0,
|
|
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, {
|
|
2241
2440
|
useSpecialties: a,
|
|
2242
2441
|
lockedOperatorId: n,
|
|
2243
2442
|
autoSelectSingleService: o,
|
|
2244
|
-
specialties:
|
|
2245
|
-
services:
|
|
2443
|
+
specialties: J,
|
|
2444
|
+
services: u
|
|
2246
2445
|
});
|
|
2247
|
-
(
|
|
2446
|
+
(R.specialtyId !== g.specialtyId || R.operatorId !== g.operatorId || R.serviceId !== g.serviceId) && S(R);
|
|
2248
2447
|
}, [
|
|
2249
2448
|
n,
|
|
2250
2449
|
a,
|
|
2251
2450
|
o,
|
|
2252
|
-
|
|
2253
|
-
|
|
2451
|
+
J,
|
|
2452
|
+
u
|
|
2254
2453
|
]);
|
|
2255
|
-
const
|
|
2256
|
-
() =>
|
|
2454
|
+
const L = w(
|
|
2455
|
+
() => Ea({
|
|
2257
2456
|
country: t,
|
|
2258
2457
|
useSpecialties: a,
|
|
2259
2458
|
allowOperatorSelection: i,
|
|
2260
2459
|
lockedOperatorId: n,
|
|
2261
|
-
specialties:
|
|
2262
|
-
services:
|
|
2263
|
-
operators:
|
|
2264
|
-
availableSlots:
|
|
2265
|
-
value:
|
|
2460
|
+
specialties: J,
|
|
2461
|
+
services: u,
|
|
2462
|
+
operators: de,
|
|
2463
|
+
availableSlots: c,
|
|
2464
|
+
value: g
|
|
2266
2465
|
}),
|
|
2267
2466
|
[
|
|
2268
2467
|
t,
|
|
@@ -2270,199 +2469,205 @@ const Wa = [], Xa = [], Qa = Qe(
|
|
|
2270
2469
|
i,
|
|
2271
2470
|
n,
|
|
2272
2471
|
o,
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2472
|
+
J,
|
|
2473
|
+
u,
|
|
2474
|
+
de,
|
|
2475
|
+
r,
|
|
2476
|
+
c,
|
|
2477
|
+
g
|
|
2279
2478
|
]
|
|
2280
|
-
), [
|
|
2281
|
-
|
|
2282
|
-
),
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
}, [
|
|
2286
|
-
const [
|
|
2287
|
-
async (
|
|
2288
|
-
if (!
|
|
2289
|
-
const
|
|
2290
|
-
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,
|
|
2291
2490
|
value: {
|
|
2292
|
-
...
|
|
2293
|
-
details:
|
|
2294
|
-
operatorId:
|
|
2491
|
+
...g,
|
|
2492
|
+
details: R,
|
|
2493
|
+
operatorId: He(g) ?? g.operatorId
|
|
2295
2494
|
},
|
|
2296
|
-
details:
|
|
2495
|
+
details: R
|
|
2297
2496
|
};
|
|
2298
|
-
|
|
2497
|
+
he("submitting");
|
|
2299
2498
|
try {
|
|
2300
|
-
await
|
|
2301
|
-
slot:
|
|
2302
|
-
details:
|
|
2303
|
-
specialtyId:
|
|
2304
|
-
serviceId:
|
|
2305
|
-
insuranceType:
|
|
2306
|
-
operatorId:
|
|
2307
|
-
date:
|
|
2308
|
-
}),
|
|
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");
|
|
2309
2508
|
} catch {
|
|
2310
|
-
throw
|
|
2509
|
+
throw he("error"), new Error("Booking submission failed");
|
|
2311
2510
|
}
|
|
2312
2511
|
},
|
|
2313
|
-
[
|
|
2314
|
-
),
|
|
2315
|
-
|
|
2316
|
-
const
|
|
2317
|
-
|
|
2318
|
-
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))
|
|
2319
2518
|
try {
|
|
2320
|
-
|
|
2519
|
+
ve.current.scrollIntoView({
|
|
2321
2520
|
behavior: "smooth",
|
|
2322
2521
|
block: "start"
|
|
2323
2522
|
});
|
|
2324
2523
|
} catch {
|
|
2325
|
-
|
|
2524
|
+
ve.current.scrollIntoView();
|
|
2326
2525
|
}
|
|
2327
|
-
}, [
|
|
2328
|
-
const
|
|
2526
|
+
}, [be, A]);
|
|
2527
|
+
const $e = w(
|
|
2329
2528
|
() => ({
|
|
2330
|
-
getVariant: () =>
|
|
2529
|
+
getVariant: () => C,
|
|
2331
2530
|
reset: () => {
|
|
2332
|
-
|
|
2531
|
+
S({}), Fe(null), he("idle"), ge(1);
|
|
2333
2532
|
},
|
|
2334
|
-
goToStep: (
|
|
2335
|
-
|
|
2533
|
+
goToStep: (R) => {
|
|
2534
|
+
ge(R);
|
|
2336
2535
|
}
|
|
2337
2536
|
}),
|
|
2338
|
-
[
|
|
2537
|
+
[C, S]
|
|
2339
2538
|
);
|
|
2340
|
-
|
|
2341
|
-
const
|
|
2342
|
-
|
|
2539
|
+
Ot(Da, $e, oe);
|
|
2540
|
+
const Dt = Ve ?? re("booking.regionLabel"), At = w(() => fe !== "success" || !Re ? null : /* @__PURE__ */ s(
|
|
2541
|
+
ts,
|
|
2343
2542
|
{
|
|
2344
|
-
snapshot:
|
|
2345
|
-
operators:
|
|
2346
|
-
specialties:
|
|
2347
|
-
services:
|
|
2348
|
-
locale:
|
|
2349
|
-
mode:
|
|
2350
|
-
showModify:
|
|
2351
|
-
onReset: () =>
|
|
2543
|
+
snapshot: Re,
|
|
2544
|
+
operators: de,
|
|
2545
|
+
specialties: J,
|
|
2546
|
+
services: u,
|
|
2547
|
+
locale: te,
|
|
2548
|
+
mode: Y,
|
|
2549
|
+
showModify: ne,
|
|
2550
|
+
onReset: () => $e.reset(),
|
|
2352
2551
|
onModify: () => {
|
|
2353
|
-
|
|
2552
|
+
Fe(null), he("idle"), ge(7);
|
|
2354
2553
|
}
|
|
2355
2554
|
}
|
|
2356
2555
|
), [
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
]),
|
|
2367
|
-
if (
|
|
2368
|
-
const
|
|
2369
|
-
cascade:
|
|
2556
|
+
fe,
|
|
2557
|
+
Re,
|
|
2558
|
+
de,
|
|
2559
|
+
J,
|
|
2560
|
+
u,
|
|
2561
|
+
te,
|
|
2562
|
+
Y,
|
|
2563
|
+
ne,
|
|
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,
|
|
2370
2569
|
inputs: {
|
|
2371
|
-
specialties:
|
|
2372
|
-
services:
|
|
2373
|
-
operators:
|
|
2374
|
-
availableDates:
|
|
2375
|
-
availableSlots:
|
|
2570
|
+
specialties: J,
|
|
2571
|
+
services: u,
|
|
2572
|
+
operators: de,
|
|
2573
|
+
availableDates: r,
|
|
2574
|
+
availableSlots: c,
|
|
2376
2575
|
nextAvailableDate: m
|
|
2377
2576
|
},
|
|
2378
|
-
value:
|
|
2379
|
-
onChange:
|
|
2380
|
-
onSubmit:
|
|
2577
|
+
value: g,
|
|
2578
|
+
onChange: S,
|
|
2579
|
+
onSubmit: Qe,
|
|
2381
2580
|
policy: { country: t, lockedOperatorId: n },
|
|
2382
2581
|
detailsProps: {
|
|
2383
|
-
requireCodiceFiscale:
|
|
2384
|
-
requireDateOfBirth:
|
|
2385
|
-
requireInsuranceNumber:
|
|
2386
|
-
insuranceType:
|
|
2387
|
-
showNote:
|
|
2388
|
-
showReturningPatientFlag:
|
|
2389
|
-
privacyPolicyUrl:
|
|
2390
|
-
termsUrl:
|
|
2391
|
-
validateCodiceFiscale:
|
|
2392
|
-
validateInsuranceNumber:
|
|
2393
|
-
confirmationChannels:
|
|
2394
|
-
defaultConfirmationChannels:
|
|
2395
|
-
submitError:
|
|
2582
|
+
requireCodiceFiscale: k,
|
|
2583
|
+
requireDateOfBirth: I,
|
|
2584
|
+
requireInsuranceNumber: v,
|
|
2585
|
+
insuranceType: g.insuranceType,
|
|
2586
|
+
showNote: N,
|
|
2587
|
+
showReturningPatientFlag: M,
|
|
2588
|
+
privacyPolicyUrl: D,
|
|
2589
|
+
termsUrl: y,
|
|
2590
|
+
validateCodiceFiscale: b,
|
|
2591
|
+
validateInsuranceNumber: d,
|
|
2592
|
+
confirmationChannels: _,
|
|
2593
|
+
defaultConfirmationChannels: x,
|
|
2594
|
+
submitError: xe
|
|
2396
2595
|
},
|
|
2397
|
-
emptyServicesSlot:
|
|
2398
|
-
onboardingIncompleteSlot:
|
|
2399
|
-
loadingDates:
|
|
2400
|
-
loadingSlots:
|
|
2401
|
-
onDateSelect:
|
|
2402
|
-
onWindowChange:
|
|
2403
|
-
datePickerStyle:
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2596
|
+
emptyServicesSlot: Se,
|
|
2597
|
+
onboardingIncompleteSlot: Ie,
|
|
2598
|
+
loadingDates: q,
|
|
2599
|
+
loadingSlots: pe,
|
|
2600
|
+
onDateSelect: G,
|
|
2601
|
+
onWindowChange: B,
|
|
2602
|
+
datePickerStyle: E,
|
|
2603
|
+
specialtyPickerStyle: U,
|
|
2604
|
+
servicePickerStyle: P,
|
|
2605
|
+
operatorPickerStyle: Q,
|
|
2606
|
+
submitting: ee,
|
|
2607
|
+
locale: te,
|
|
2608
|
+
activeStep: We,
|
|
2609
|
+
setActiveStep: ge
|
|
2408
2610
|
};
|
|
2409
|
-
return /* @__PURE__ */ s(
|
|
2611
|
+
return /* @__PURE__ */ s(R, { ...ze });
|
|
2410
2612
|
}, [
|
|
2411
|
-
|
|
2613
|
+
fe,
|
|
2614
|
+
C,
|
|
2412
2615
|
L,
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
d,
|
|
2616
|
+
J,
|
|
2617
|
+
u,
|
|
2618
|
+
de,
|
|
2619
|
+
r,
|
|
2620
|
+
c,
|
|
2419
2621
|
m,
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2622
|
+
g,
|
|
2623
|
+
S,
|
|
2624
|
+
Qe,
|
|
2423
2625
|
t,
|
|
2424
2626
|
n,
|
|
2425
|
-
y,
|
|
2426
|
-
S,
|
|
2427
|
-
h,
|
|
2428
|
-
H,
|
|
2429
|
-
w,
|
|
2430
|
-
N,
|
|
2431
|
-
I,
|
|
2432
2627
|
k,
|
|
2628
|
+
I,
|
|
2433
2629
|
v,
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2630
|
+
xe,
|
|
2631
|
+
N,
|
|
2632
|
+
M,
|
|
2633
|
+
D,
|
|
2634
|
+
y,
|
|
2635
|
+
b,
|
|
2636
|
+
d,
|
|
2637
|
+
_,
|
|
2638
|
+
x,
|
|
2639
|
+
Se,
|
|
2640
|
+
Ie,
|
|
2641
|
+
q,
|
|
2642
|
+
pe,
|
|
2643
|
+
G,
|
|
2644
|
+
B,
|
|
2442
2645
|
E,
|
|
2443
|
-
|
|
2444
|
-
|
|
2646
|
+
U,
|
|
2647
|
+
P,
|
|
2648
|
+
Q,
|
|
2445
2649
|
ee,
|
|
2446
|
-
|
|
2650
|
+
te,
|
|
2651
|
+
We
|
|
2447
2652
|
]);
|
|
2448
|
-
return /* @__PURE__ */
|
|
2653
|
+
return /* @__PURE__ */ f(
|
|
2449
2654
|
"div",
|
|
2450
2655
|
{
|
|
2451
|
-
ref:
|
|
2656
|
+
ref: ve,
|
|
2452
2657
|
role: "region",
|
|
2453
|
-
"aria-label":
|
|
2454
|
-
id:
|
|
2658
|
+
"aria-label": Dt,
|
|
2659
|
+
id: oe,
|
|
2455
2660
|
"data-component": "booking",
|
|
2456
|
-
"data-component-id":
|
|
2457
|
-
"data-variant":
|
|
2458
|
-
className:
|
|
2459
|
-
variant:
|
|
2460
|
-
surface:
|
|
2461
|
-
className:
|
|
2661
|
+
"data-component-id": oe,
|
|
2662
|
+
"data-variant": C,
|
|
2663
|
+
className: za({
|
|
2664
|
+
variant: C,
|
|
2665
|
+
surface: me,
|
|
2666
|
+
className: Le
|
|
2462
2667
|
}),
|
|
2463
|
-
...
|
|
2668
|
+
...Ne,
|
|
2464
2669
|
children: [
|
|
2465
|
-
/* @__PURE__ */
|
|
2670
|
+
/* @__PURE__ */ f(
|
|
2466
2671
|
"div",
|
|
2467
2672
|
{
|
|
2468
2673
|
className: [
|
|
@@ -2474,22 +2679,22 @@ const Wa = [], Xa = [], Qa = Qe(
|
|
|
2474
2679
|
"ds:pt-[var(--spacing-md)] ds:pb-[var(--spacing-md)]"
|
|
2475
2680
|
].join(" "),
|
|
2476
2681
|
children: [
|
|
2477
|
-
/* @__PURE__ */ s("h2", { className: "type-title-card ds:text-[var(--foreground)] ds:m-0", children:
|
|
2478
|
-
/* @__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") })
|
|
2479
2684
|
]
|
|
2480
2685
|
}
|
|
2481
2686
|
),
|
|
2482
|
-
|
|
2687
|
+
At ?? _t
|
|
2483
2688
|
]
|
|
2484
2689
|
}
|
|
2485
2690
|
);
|
|
2486
2691
|
}
|
|
2487
2692
|
);
|
|
2488
|
-
|
|
2693
|
+
ls.displayName = "Booking";
|
|
2489
2694
|
export {
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2695
|
+
ls as B,
|
|
2696
|
+
qe as C,
|
|
2697
|
+
X as O,
|
|
2698
|
+
Da as b
|
|
2494
2699
|
};
|
|
2495
|
-
//# sourceMappingURL=booking-
|
|
2700
|
+
//# sourceMappingURL=booking-eM0y0NIR.js.map
|