@anker-in/ui 0.1.4 → 0.1.5
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/demo-room.css +3 -0
- package/dist/demo-room.css.map +1 -1
- package/dist/demo-room.d.mts +11 -64
- package/dist/demo-room.d.ts +11 -64
- package/dist/demo-room.js +415 -553
- package/dist/demo-room.js.map +1 -1
- package/dist/demo-room.mjs +417 -553
- package/dist/demo-room.mjs.map +1 -1
- package/dist/index.css +3 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +3 -41
- package/dist/index.d.ts +3 -41
- package/dist/index.js +1103 -1238
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1105 -1239
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import React2, { createContext, useContext, useState, useEffect, useCallback, useMemo, useRef } from 'react';
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
3
|
import { twMerge } from 'tailwind-merge';
|
|
4
|
-
import { jsxs,
|
|
5
|
-
import { Text, Link } from '@anker-in/headless-ui';
|
|
4
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
5
|
import IndexBar from 'antd-mobile/es/components/index-bar';
|
|
7
6
|
import List from 'antd-mobile/es/components/list';
|
|
8
7
|
import 'antd-mobile/es/components/index-bar/index-bar.css';
|
|
9
8
|
import 'antd-mobile/es/components/list/list.css';
|
|
10
|
-
import { Swiper, SwiperSlide } from 'swiper/react';
|
|
11
9
|
import dayjs from 'dayjs';
|
|
12
10
|
import 'dayjs/locale/zh-cn';
|
|
13
11
|
import { theme, ConfigProvider, Calendar, Select } from 'antd';
|
|
14
12
|
import dayLocaleData from 'dayjs/plugin/localeData';
|
|
15
13
|
import weekday from 'dayjs/plugin/weekday';
|
|
16
14
|
import weekOfYear from 'dayjs/plugin/weekOfYear';
|
|
15
|
+
import { Swiper, SwiperSlide } from 'swiper/react';
|
|
17
16
|
|
|
18
17
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
19
18
|
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
@@ -24,158 +23,6 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
24
23
|
function cn(...inputs) {
|
|
25
24
|
return twMerge(clsx(inputs));
|
|
26
25
|
}
|
|
27
|
-
var defaultTabs = [
|
|
28
|
-
{ id: "upcoming-events", label: "Upcoming Events" },
|
|
29
|
-
{ id: "find-demoroom", label: "Find Demoroom" },
|
|
30
|
-
{ id: "4-easy-steps", label: "4 Easy Steps" },
|
|
31
|
-
{ id: "faq", label: "FAQ" }
|
|
32
|
-
];
|
|
33
|
-
var HelpNav = ({
|
|
34
|
-
tabs = defaultTabs,
|
|
35
|
-
activeTabId: controlledActiveTabId,
|
|
36
|
-
onTabChange,
|
|
37
|
-
activeBorderColor = "#3ADB67",
|
|
38
|
-
className,
|
|
39
|
-
...props
|
|
40
|
-
}) => {
|
|
41
|
-
const [internalActiveTabId, setInternalActiveTabId] = useState(
|
|
42
|
-
tabs[1]?.id || tabs[0]?.id
|
|
43
|
-
);
|
|
44
|
-
const activeTabId = controlledActiveTabId ?? internalActiveTabId;
|
|
45
|
-
const handleTabClick = (tabId) => {
|
|
46
|
-
if (!controlledActiveTabId) {
|
|
47
|
-
setInternalActiveTabId(tabId);
|
|
48
|
-
}
|
|
49
|
-
onTabChange?.(tabId);
|
|
50
|
-
};
|
|
51
|
-
return /* @__PURE__ */ jsx(
|
|
52
|
-
"div",
|
|
53
|
-
{
|
|
54
|
-
className: cn(
|
|
55
|
-
"w-full pt-5 flex items-center justify-center gap-8 pb-8",
|
|
56
|
-
className
|
|
57
|
-
),
|
|
58
|
-
...props,
|
|
59
|
-
children: tabs.map((tab) => {
|
|
60
|
-
const isActive = tab.id === activeTabId;
|
|
61
|
-
return /* @__PURE__ */ jsxs(
|
|
62
|
-
"button",
|
|
63
|
-
{
|
|
64
|
-
onClick: () => handleTabClick(tab.id),
|
|
65
|
-
className: cn(
|
|
66
|
-
"relative text-[#080A0F]",
|
|
67
|
-
"pb-4",
|
|
68
|
-
"flex items-center gap-2",
|
|
69
|
-
"transition-all duration-200",
|
|
70
|
-
"outline-none focus:outline-none"
|
|
71
|
-
),
|
|
72
|
-
style: {
|
|
73
|
-
fontSize: "18px",
|
|
74
|
-
fontWeight: 600,
|
|
75
|
-
letterSpacing: "-0.36px",
|
|
76
|
-
lineHeight: "25.2px"
|
|
77
|
-
},
|
|
78
|
-
children: [
|
|
79
|
-
tab.label,
|
|
80
|
-
isActive && /* @__PURE__ */ jsx(
|
|
81
|
-
"span",
|
|
82
|
-
{
|
|
83
|
-
className: "absolute bottom-0 left-0 right-0 h-1 rounded-t",
|
|
84
|
-
style: {
|
|
85
|
-
backgroundColor: activeBorderColor,
|
|
86
|
-
height: "4px"
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
)
|
|
90
|
-
]
|
|
91
|
-
},
|
|
92
|
-
tab.id
|
|
93
|
-
);
|
|
94
|
-
})
|
|
95
|
-
}
|
|
96
|
-
);
|
|
97
|
-
};
|
|
98
|
-
HelpNav.displayName = "HelpNav";
|
|
99
|
-
var EventCard = ({
|
|
100
|
-
title,
|
|
101
|
-
description,
|
|
102
|
-
backgroundImage,
|
|
103
|
-
aspectRatio,
|
|
104
|
-
variant = "medium",
|
|
105
|
-
buttons = [],
|
|
106
|
-
subtitle,
|
|
107
|
-
className,
|
|
108
|
-
...props
|
|
109
|
-
}) => {
|
|
110
|
-
const isLarge = variant === "large";
|
|
111
|
-
const isMedium = variant === "medium";
|
|
112
|
-
const isProduct = variant === "product";
|
|
113
|
-
return /* @__PURE__ */ jsx(
|
|
114
|
-
"div",
|
|
115
|
-
{
|
|
116
|
-
className: cn("rounded-3xl overflow-hidden relative", className),
|
|
117
|
-
style: {
|
|
118
|
-
backgroundImage: backgroundImage ? `url(${backgroundImage})` : void 0,
|
|
119
|
-
backgroundSize: "cover",
|
|
120
|
-
backgroundPosition: "center",
|
|
121
|
-
aspectRatio
|
|
122
|
-
},
|
|
123
|
-
...props,
|
|
124
|
-
children: /* @__PURE__ */ jsxs(
|
|
125
|
-
"div",
|
|
126
|
-
{
|
|
127
|
-
className: cn(
|
|
128
|
-
"relative h-full flex flex-col",
|
|
129
|
-
isLarge && "justify-center pl-8",
|
|
130
|
-
!isLarge && "justify-end pl-8 pb-8"
|
|
131
|
-
),
|
|
132
|
-
children: [
|
|
133
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
134
|
-
/* @__PURE__ */ jsx(
|
|
135
|
-
"h3",
|
|
136
|
-
{
|
|
137
|
-
className: cn(
|
|
138
|
-
"font-semibold mb-3",
|
|
139
|
-
isLarge && "text-3xl text-gray-900",
|
|
140
|
-
isMedium && "text-2xl text-white",
|
|
141
|
-
isProduct && "text-2xl text-gray-900"
|
|
142
|
-
),
|
|
143
|
-
children: title
|
|
144
|
-
}
|
|
145
|
-
),
|
|
146
|
-
subtitle && isProduct && /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-600 mb-4", children: subtitle }),
|
|
147
|
-
description && /* @__PURE__ */ jsx(
|
|
148
|
-
"p",
|
|
149
|
-
{
|
|
150
|
-
className: cn(
|
|
151
|
-
"text-sm leading-relaxed",
|
|
152
|
-
isMedium && "text-white/90",
|
|
153
|
-
(isLarge || isProduct) && "text-gray-600"
|
|
154
|
-
),
|
|
155
|
-
children: description
|
|
156
|
-
}
|
|
157
|
-
)
|
|
158
|
-
] }),
|
|
159
|
-
buttons.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex gap-3 mt-6", children: buttons.map((button, index) => /* @__PURE__ */ jsx(
|
|
160
|
-
"button",
|
|
161
|
-
{
|
|
162
|
-
onClick: button.onClick,
|
|
163
|
-
className: cn(
|
|
164
|
-
"px-6 py-3 rounded-full font-medium text-sm transition-all duration-200",
|
|
165
|
-
button.variant === "primary" && "bg-gray-900 text-white hover:bg-gray-800",
|
|
166
|
-
button.variant === "secondary" && "bg-white text-gray-900 border border-gray-300 hover:bg-gray-50"
|
|
167
|
-
),
|
|
168
|
-
children: button.label
|
|
169
|
-
},
|
|
170
|
-
index
|
|
171
|
-
)) })
|
|
172
|
-
]
|
|
173
|
-
}
|
|
174
|
-
)
|
|
175
|
-
}
|
|
176
|
-
);
|
|
177
|
-
};
|
|
178
|
-
EventCard.displayName = "EventCard";
|
|
179
26
|
var Title = ({
|
|
180
27
|
title = "",
|
|
181
28
|
...props
|
|
@@ -183,275 +30,6 @@ var Title = ({
|
|
|
183
30
|
return /* @__PURE__ */ jsx("div", { className: cn("w-full"), ...props, children: /* @__PURE__ */ jsx("h2", { className: "text-[48px] font-semibold mb-12 text-[#080A0F]", children: title }) });
|
|
184
31
|
};
|
|
185
32
|
Title.displayName = "Title";
|
|
186
|
-
var defaultEvents = [
|
|
187
|
-
{
|
|
188
|
-
variant: "large",
|
|
189
|
-
title: "IFA 2025 Event Name Event Name",
|
|
190
|
-
description: "Corem ipsum dolor sit amet, consectetur adipiscing elit.",
|
|
191
|
-
backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
|
|
192
|
-
buttons: [
|
|
193
|
-
{
|
|
194
|
-
label: "Schedule Now",
|
|
195
|
-
variant: "primary"
|
|
196
|
-
}
|
|
197
|
-
],
|
|
198
|
-
aspectRatio: "1664 / 640"
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
variant: "medium",
|
|
202
|
-
title: "Local Event Name Local Event Name Local Event Name",
|
|
203
|
-
description: "Norem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis.",
|
|
204
|
-
backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
|
|
205
|
-
buttons: [
|
|
206
|
-
{
|
|
207
|
-
label: "Schedule Now",
|
|
208
|
-
variant: "primary"
|
|
209
|
-
}
|
|
210
|
-
],
|
|
211
|
-
aspectRatio: "824 / 640"
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
variant: "product",
|
|
215
|
-
title: "Anker Prime",
|
|
216
|
-
subtitle: "Anker Prime 240W GaN Desktop Charger (4 Ports) Feb. 5th - 16th",
|
|
217
|
-
backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
|
|
218
|
-
buttons: [
|
|
219
|
-
{
|
|
220
|
-
label: "Learn More",
|
|
221
|
-
variant: "secondary"
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
label: "Shop Now",
|
|
225
|
-
variant: "primary"
|
|
226
|
-
}
|
|
227
|
-
],
|
|
228
|
-
aspectRatio: "824 / 640"
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
variant: "medium",
|
|
232
|
-
title: "Local Event Name Local Event Name Local Event Name",
|
|
233
|
-
description: "Norem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis.",
|
|
234
|
-
backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
|
|
235
|
-
buttons: [
|
|
236
|
-
{
|
|
237
|
-
label: "Schedule Now",
|
|
238
|
-
variant: "primary"
|
|
239
|
-
}
|
|
240
|
-
],
|
|
241
|
-
aspectRatio: "824 / 640"
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
variant: "product",
|
|
245
|
-
title: "Anker Prime",
|
|
246
|
-
subtitle: "Anker Prime 240W GaN Desktop Charger (4 Ports) Feb. 5th - 16th",
|
|
247
|
-
backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
|
|
248
|
-
buttons: [
|
|
249
|
-
{
|
|
250
|
-
label: "Learn More",
|
|
251
|
-
variant: "secondary"
|
|
252
|
-
},
|
|
253
|
-
{
|
|
254
|
-
label: "Shop Now",
|
|
255
|
-
variant: "primary"
|
|
256
|
-
}
|
|
257
|
-
],
|
|
258
|
-
aspectRatio: "824 / 640"
|
|
259
|
-
}
|
|
260
|
-
];
|
|
261
|
-
var UpcomingEvents = ({
|
|
262
|
-
title = "Upcoming Events",
|
|
263
|
-
events = defaultEvents,
|
|
264
|
-
showViewMore = true,
|
|
265
|
-
onViewMore,
|
|
266
|
-
className,
|
|
267
|
-
...props
|
|
268
|
-
}) => {
|
|
269
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("w-full", className), ...props, children: [
|
|
270
|
-
/* @__PURE__ */ jsx(Title, { title }),
|
|
271
|
-
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-6 mb-[64px]", children: events.map((event, index) => /* @__PURE__ */ jsx("div", { className: cn(index === 0 ? "col-span-2" : ""), children: /* @__PURE__ */ jsx(EventCard, { ...event }) }, index)) }),
|
|
272
|
-
showViewMore && /* @__PURE__ */ jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsxs(
|
|
273
|
-
"button",
|
|
274
|
-
{
|
|
275
|
-
onClick: onViewMore,
|
|
276
|
-
className: "inline-flex items-center gap-2 text-gray-700 hover:text-gray-900 transition-colors duration-200",
|
|
277
|
-
children: [
|
|
278
|
-
/* @__PURE__ */ jsx("span", { className: "text-base font-bold", children: "View More" }),
|
|
279
|
-
/* @__PURE__ */ jsx(
|
|
280
|
-
"svg",
|
|
281
|
-
{
|
|
282
|
-
width: "16",
|
|
283
|
-
height: "16",
|
|
284
|
-
viewBox: "0 0 16 16",
|
|
285
|
-
fill: "none",
|
|
286
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
287
|
-
className: "transition-transform duration-200 group-hover:translate-y-0.5",
|
|
288
|
-
children: /* @__PURE__ */ jsx(
|
|
289
|
-
"path",
|
|
290
|
-
{
|
|
291
|
-
d: "M8 3L8 13M8 13L12 9M8 13L4 9",
|
|
292
|
-
stroke: "currentColor",
|
|
293
|
-
strokeWidth: "2",
|
|
294
|
-
strokeLinecap: "round",
|
|
295
|
-
strokeLinejoin: "round"
|
|
296
|
-
}
|
|
297
|
-
)
|
|
298
|
-
}
|
|
299
|
-
)
|
|
300
|
-
]
|
|
301
|
-
}
|
|
302
|
-
) })
|
|
303
|
-
] });
|
|
304
|
-
};
|
|
305
|
-
UpcomingEvents.displayName = "UpcomingEvents";
|
|
306
|
-
var defaultBannerData = {
|
|
307
|
-
title: "See it. Touch it. Make it Locally.",
|
|
308
|
-
subTitle: "Visit your local studio right around the corner.",
|
|
309
|
-
backgroundImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
|
|
310
|
-
backgroundImageMobile: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638"
|
|
311
|
-
};
|
|
312
|
-
var Banner = ({
|
|
313
|
-
data = defaultBannerData,
|
|
314
|
-
className,
|
|
315
|
-
style,
|
|
316
|
-
...props
|
|
317
|
-
}) => {
|
|
318
|
-
return /* @__PURE__ */ jsxs(
|
|
319
|
-
"div",
|
|
320
|
-
{
|
|
321
|
-
className: cn("relative"),
|
|
322
|
-
style: { aspectRatio: "1920/480", ...style },
|
|
323
|
-
...props,
|
|
324
|
-
children: [
|
|
325
|
-
data?.backgroundImage && /* @__PURE__ */ jsx(
|
|
326
|
-
"img",
|
|
327
|
-
{
|
|
328
|
-
src: data.backgroundImage,
|
|
329
|
-
alt: "",
|
|
330
|
-
className: "inset-0 h-full w-full object-cover"
|
|
331
|
-
}
|
|
332
|
-
),
|
|
333
|
-
/* @__PURE__ */ jsxs(
|
|
334
|
-
"div",
|
|
335
|
-
{
|
|
336
|
-
className: cn(
|
|
337
|
-
"absolute flex flex-col gap-4 justify-center m-auto top-0 bottom-0 left-0 right-0 z-10",
|
|
338
|
-
className
|
|
339
|
-
),
|
|
340
|
-
children: [
|
|
341
|
-
/* @__PURE__ */ jsx(
|
|
342
|
-
Text,
|
|
343
|
-
{
|
|
344
|
-
className: "text-[48px] font-bold text-white leading-[1]",
|
|
345
|
-
html: data?.title
|
|
346
|
-
}
|
|
347
|
-
),
|
|
348
|
-
/* @__PURE__ */ jsx(
|
|
349
|
-
Text,
|
|
350
|
-
{
|
|
351
|
-
className: "text-[18px] font-bold text-white leading-[1.4]",
|
|
352
|
-
html: data?.subTitle
|
|
353
|
-
}
|
|
354
|
-
)
|
|
355
|
-
]
|
|
356
|
-
}
|
|
357
|
-
)
|
|
358
|
-
]
|
|
359
|
-
}
|
|
360
|
-
);
|
|
361
|
-
};
|
|
362
|
-
Banner.displayName = "Banner";
|
|
363
|
-
var BreadCrumbs = ({
|
|
364
|
-
items,
|
|
365
|
-
className,
|
|
366
|
-
...props
|
|
367
|
-
}) => {
|
|
368
|
-
return /* @__PURE__ */ jsx("div", { className: cn("flex items-center py-6 gap-1 text-[18px]", className), ...props, children: items?.map((item, i) => {
|
|
369
|
-
const isLast = i === items?.length - 1;
|
|
370
|
-
return /* @__PURE__ */ jsxs(
|
|
371
|
-
Link,
|
|
372
|
-
{
|
|
373
|
-
className: cn(
|
|
374
|
-
"flex items-center gap-1 text-[#6D6D6F] no-underline",
|
|
375
|
-
isLast && "text-[#080A0F]",
|
|
376
|
-
item?.link ? "cursor-pointer" : "cursor-default hover:text-[#080A0F]"
|
|
377
|
-
),
|
|
378
|
-
href: item?.link,
|
|
379
|
-
children: [
|
|
380
|
-
item?.label,
|
|
381
|
-
!isLast && /* @__PURE__ */ jsx("span", { children: "/" })
|
|
382
|
-
]
|
|
383
|
-
},
|
|
384
|
-
i
|
|
385
|
-
);
|
|
386
|
-
}) });
|
|
387
|
-
};
|
|
388
|
-
BreadCrumbs.displayName = "BreadCrumbs";
|
|
389
|
-
var defaultSteps = [
|
|
390
|
-
{
|
|
391
|
-
stepNumber: 1,
|
|
392
|
-
title: 'Find a demo room you would like to visit, and click "Schedule Now"',
|
|
393
|
-
description: 'Find a demo room you would like to visit, and click "Schedule Now"',
|
|
394
|
-
mapImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638"
|
|
395
|
-
},
|
|
396
|
-
{
|
|
397
|
-
stepNumber: 2,
|
|
398
|
-
title: "Fill out the form and confirm your time of visit",
|
|
399
|
-
description: "Fill out the form and confirm your time of visit",
|
|
400
|
-
mapImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638"
|
|
401
|
-
},
|
|
402
|
-
{
|
|
403
|
-
stepNumber: 3,
|
|
404
|
-
title: "Once you arrive at the demo room, scan the QR code to check in",
|
|
405
|
-
description: "Once you arrive at the demo room, scan the QR code to check in",
|
|
406
|
-
mapImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638"
|
|
407
|
-
},
|
|
408
|
-
{
|
|
409
|
-
stepNumber: 4,
|
|
410
|
-
title: "Have fun!",
|
|
411
|
-
description: "Have fun!",
|
|
412
|
-
mapImage: "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638"
|
|
413
|
-
}
|
|
414
|
-
];
|
|
415
|
-
var EasySteps = ({
|
|
416
|
-
title = "Schedule in 4 Easy Steps",
|
|
417
|
-
steps = defaultSteps,
|
|
418
|
-
className,
|
|
419
|
-
...props
|
|
420
|
-
}) => {
|
|
421
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("w-full", className), ...props, children: [
|
|
422
|
-
/* @__PURE__ */ jsx(Title, { title }),
|
|
423
|
-
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 md:grid-cols-2 gap-6", children: steps.map((step) => /* @__PURE__ */ jsxs(
|
|
424
|
-
"div",
|
|
425
|
-
{
|
|
426
|
-
className: cn(
|
|
427
|
-
"bg-white rounded-2xl overflow-hidden",
|
|
428
|
-
"border border-gray-200",
|
|
429
|
-
"hover:shadow-lg transition-shadow duration-200"
|
|
430
|
-
),
|
|
431
|
-
children: [
|
|
432
|
-
/* @__PURE__ */ jsx("div", { className: "p-6 pb-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3 mb-3", children: [
|
|
433
|
-
/* @__PURE__ */ jsxs("span", { className: "text-sm font-semibold text-gray-900", children: [
|
|
434
|
-
"Step ",
|
|
435
|
-
step.stepNumber,
|
|
436
|
-
":"
|
|
437
|
-
] }),
|
|
438
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-gray-900 font-medium flex-1", children: step.title })
|
|
439
|
-
] }) }),
|
|
440
|
-
/* @__PURE__ */ jsx("div", { className: "relative w-full aspect-[356/220] bg-gray-100", children: /* @__PURE__ */ jsx(
|
|
441
|
-
"img",
|
|
442
|
-
{
|
|
443
|
-
src: step.mapImage,
|
|
444
|
-
alt: `Step ${step.stepNumber} - ${step.title}`,
|
|
445
|
-
className: "w-full h-full object-cover"
|
|
446
|
-
}
|
|
447
|
-
) })
|
|
448
|
-
]
|
|
449
|
-
},
|
|
450
|
-
step.stepNumber
|
|
451
|
-
)) })
|
|
452
|
-
] });
|
|
453
|
-
};
|
|
454
|
-
EasySteps.displayName = "EasySteps";
|
|
455
33
|
var StudioCard = ({
|
|
456
34
|
code,
|
|
457
35
|
name,
|
|
@@ -462,25 +40,48 @@ var StudioCard = ({
|
|
|
462
40
|
zipCode,
|
|
463
41
|
country = "United States",
|
|
464
42
|
euifyMakeModel,
|
|
43
|
+
distance,
|
|
465
44
|
onSchedule,
|
|
466
45
|
className,
|
|
46
|
+
style,
|
|
467
47
|
...props
|
|
468
48
|
}) => {
|
|
469
49
|
const fullAddress = `${address}, ${city}, ${state} ${country} ${zipCode}`;
|
|
50
|
+
const [isHovered, setIsHovered] = React2.useState(false);
|
|
470
51
|
const handleScheduleClick = () => {
|
|
471
52
|
onSchedule?.(code);
|
|
472
53
|
};
|
|
54
|
+
const formatDistance = (dist) => {
|
|
55
|
+
if (dist < 1) {
|
|
56
|
+
return `${Math.round(dist * 1e3)} m`;
|
|
57
|
+
}
|
|
58
|
+
return `${dist.toFixed(1)} km`;
|
|
59
|
+
};
|
|
473
60
|
return /* @__PURE__ */ jsxs(
|
|
474
61
|
"div",
|
|
475
62
|
{
|
|
476
|
-
className: cn(
|
|
477
|
-
"p-6",
|
|
478
|
-
"hover:shadow-lg transition-shadow duration-200",
|
|
479
|
-
className
|
|
480
|
-
),
|
|
481
63
|
...props,
|
|
64
|
+
className: cn("p-6 cursor-pointer transition-colors duration-200", className),
|
|
65
|
+
style: {
|
|
66
|
+
backgroundColor: isHovered ? "#f3f4f6" : "transparent",
|
|
67
|
+
...style
|
|
68
|
+
},
|
|
69
|
+
onMouseEnter: (e) => {
|
|
70
|
+
setIsHovered(true);
|
|
71
|
+
props.onMouseEnter?.(e);
|
|
72
|
+
},
|
|
73
|
+
onMouseLeave: (e) => {
|
|
74
|
+
setIsHovered(false);
|
|
75
|
+
props.onMouseLeave?.(e);
|
|
76
|
+
},
|
|
482
77
|
children: [
|
|
483
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between mb-4", children: [
|
|
79
|
+
/* @__PURE__ */ jsx("h3", { className: "text-xl font-semibold text-gray-900", children: name }),
|
|
80
|
+
distance !== void 0 && /* @__PURE__ */ jsxs("span", { className: "text-sm font-medium text-[#2E8B57] bg-[#E8F5E9] px-3 py-1 rounded-full whitespace-nowrap ml-2", children: [
|
|
81
|
+
formatDistance(distance),
|
|
82
|
+
" away"
|
|
83
|
+
] })
|
|
84
|
+
] }),
|
|
484
85
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3 mb-3", children: [
|
|
485
86
|
/* @__PURE__ */ jsxs(
|
|
486
87
|
"svg",
|
|
@@ -626,7 +227,7 @@ var StudioCard = ({
|
|
|
626
227
|
"w-full px-6 py-3 rounded-full",
|
|
627
228
|
"bg-white text-gray-900 border border-gray-900",
|
|
628
229
|
"font-medium text-sm",
|
|
629
|
-
"hover:bg-gray-900
|
|
230
|
+
"hover:bg-gray-900",
|
|
630
231
|
"transition-all duration-200"
|
|
631
232
|
),
|
|
632
233
|
children: "Schedule Now"
|
|
@@ -655,6 +256,7 @@ var defaultLocations = [
|
|
|
655
256
|
var StudioMap = ({
|
|
656
257
|
googleMapsApiKey,
|
|
657
258
|
locations = defaultLocations,
|
|
259
|
+
hoveredLocationId,
|
|
658
260
|
defaultCenter = { lat: 39.8283, lng: -98.5795 },
|
|
659
261
|
// US center
|
|
660
262
|
defaultZoom = 4,
|
|
@@ -803,7 +405,7 @@ var StudioMap = ({
|
|
|
803
405
|
if (btn) {
|
|
804
406
|
btn.addEventListener("click", () => {
|
|
805
407
|
if (onSchedule) {
|
|
806
|
-
onSchedule(location);
|
|
408
|
+
onSchedule(location.id);
|
|
807
409
|
}
|
|
808
410
|
});
|
|
809
411
|
}
|
|
@@ -824,6 +426,82 @@ var StudioMap = ({
|
|
|
824
426
|
googleMapRef.current.fitBounds(bounds);
|
|
825
427
|
}
|
|
826
428
|
}, [isLoaded, locations, onSchedule]);
|
|
429
|
+
React2.useEffect(() => {
|
|
430
|
+
if (!isLoaded || !googleMapRef.current || !hoveredLocationId) {
|
|
431
|
+
if (!hoveredLocationId && infoWindowRef.current) {
|
|
432
|
+
infoWindowRef.current.close();
|
|
433
|
+
}
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
const location = locations.find((loc) => loc.id === hoveredLocationId);
|
|
437
|
+
const markerIndex = locations.findIndex(
|
|
438
|
+
(loc) => loc.id === hoveredLocationId
|
|
439
|
+
);
|
|
440
|
+
const marker = markersRef.current[markerIndex];
|
|
441
|
+
if (location && marker) {
|
|
442
|
+
const content = `
|
|
443
|
+
<div style="padding: 16px; max-width: 300px; font-family: system-ui, sans-serif;">
|
|
444
|
+
<h3 style="margin: 0 0 12px 0; font-size: 18px; font-weight: 600;">${location.name}</h3>
|
|
445
|
+
${location.availableTime ? `<div style="margin-bottom: 8px; color: #666;">
|
|
446
|
+
<svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
|
|
447
|
+
<path d="M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z"/>
|
|
448
|
+
</svg>
|
|
449
|
+
<span style="vertical-align: middle;">Available ${location.availableTime}</span>
|
|
450
|
+
</div>` : ""}
|
|
451
|
+
<div style="margin-bottom: 8px; color: #666;">
|
|
452
|
+
<svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
|
|
453
|
+
<path fill-rule="evenodd" d="M5.05 4.05a7 7 0 119.9 9.9L10 18.9l-4.95-4.95a7 7 0 010-9.9zM10 11a2 2 0 100-4 2 2 0 000 4z" clip-rule="evenodd"/>
|
|
454
|
+
</svg>
|
|
455
|
+
<span style="vertical-align: middle;">${location.address}, ${location.city}, ${location.state} ${location.country} ${location.zipCode}</span>
|
|
456
|
+
</div>
|
|
457
|
+
${location.euifyMakeModel ? `<div style="margin-bottom: 12px; color: #666;">
|
|
458
|
+
<svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
|
|
459
|
+
<path d="M3 4a1 1 0 011-1h12a1 1 0 011 1v2a1 1 0 01-1 1H4a1 1 0 01-1-1V4zM3 10a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H4a1 1 0 01-1-1v-6zM14 9a1 1 0 00-1 1v6a1 1 0 001 1h2a1 1 0 001-1v-6a1 1 0 00-1-1h-2z"/>
|
|
460
|
+
</svg>
|
|
461
|
+
<span style="vertical-align: middle;">${location.euifyMakeModel}</span>
|
|
462
|
+
</div>` : ""}
|
|
463
|
+
<button
|
|
464
|
+
id="schedule-btn-hover-${location.id}"
|
|
465
|
+
style="
|
|
466
|
+
width: 100%;
|
|
467
|
+
padding: 10px 16px;
|
|
468
|
+
background: #000;
|
|
469
|
+
color: #fff;
|
|
470
|
+
border: none;
|
|
471
|
+
border-radius: 6px;
|
|
472
|
+
font-weight: 500;
|
|
473
|
+
cursor: pointer;
|
|
474
|
+
font-size: 14px;
|
|
475
|
+
"
|
|
476
|
+
onmouseover="this.style.background='#333'"
|
|
477
|
+
onmouseout="this.style.background='#000'"
|
|
478
|
+
>
|
|
479
|
+
Schedule Now
|
|
480
|
+
</button>
|
|
481
|
+
</div>
|
|
482
|
+
`;
|
|
483
|
+
if (infoWindowRef.current) {
|
|
484
|
+
infoWindowRef.current.setContent(content);
|
|
485
|
+
infoWindowRef.current.open(googleMapRef.current, marker);
|
|
486
|
+
google.maps.event.addListenerOnce(
|
|
487
|
+
infoWindowRef.current,
|
|
488
|
+
"domready",
|
|
489
|
+
() => {
|
|
490
|
+
const btn = document.getElementById(
|
|
491
|
+
`schedule-btn-hover-${location.id}`
|
|
492
|
+
);
|
|
493
|
+
if (btn) {
|
|
494
|
+
btn.addEventListener("click", () => {
|
|
495
|
+
if (onSchedule) {
|
|
496
|
+
onSchedule(location.id);
|
|
497
|
+
}
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
}, [hoveredLocationId, isLoaded, locations, onSchedule]);
|
|
827
505
|
if (!googleMapsApiKey) {
|
|
828
506
|
return /* @__PURE__ */ jsx(
|
|
829
507
|
"div",
|
|
@@ -1132,20 +810,58 @@ var AntdMobileIsolated = ({
|
|
|
1132
810
|
AntdMobileIsolated.displayName = "AntdMobileIsolated";
|
|
1133
811
|
|
|
1134
812
|
// src/components/DemoRoom/utils/addressParser.ts
|
|
813
|
+
var KNOWN_COUNTRIES = [
|
|
814
|
+
"United States",
|
|
815
|
+
"United Kingdom",
|
|
816
|
+
"American Samoa",
|
|
817
|
+
"United Arab Emirates",
|
|
818
|
+
"Bosnia and Herzegovina",
|
|
819
|
+
"Trinidad and Tobago",
|
|
820
|
+
"Saint Kitts and Nevis",
|
|
821
|
+
"Antigua and Barbuda",
|
|
822
|
+
"Saint Vincent and the Grenadines",
|
|
823
|
+
"S\xE3o Tom\xE9 and Pr\xEDncipe",
|
|
824
|
+
"United States Minor Outlying Islands",
|
|
825
|
+
"British Virgin Islands",
|
|
826
|
+
"United States Virgin Islands",
|
|
827
|
+
"Cayman Islands",
|
|
828
|
+
"Cook Islands",
|
|
829
|
+
"Falkland Islands",
|
|
830
|
+
"Faroe Islands",
|
|
831
|
+
"Marshall Islands",
|
|
832
|
+
"Northern Mariana Islands",
|
|
833
|
+
"Pitcairn Islands",
|
|
834
|
+
"Solomon Islands",
|
|
835
|
+
"Turks and Caicos Islands",
|
|
836
|
+
"Wallis and Futuna"
|
|
837
|
+
];
|
|
1135
838
|
function parseAddress(address) {
|
|
1136
|
-
const parts = address.split(",").map((part) => part.trim());
|
|
839
|
+
const parts = address.split(",").map((part) => part.trim()).filter(Boolean);
|
|
1137
840
|
let country = "United States";
|
|
1138
841
|
let state = "";
|
|
1139
842
|
let city = "";
|
|
1140
|
-
if (parts.length
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
843
|
+
if (parts.length === 0) {
|
|
844
|
+
return { country, state, city };
|
|
845
|
+
}
|
|
846
|
+
const lastPart = parts[parts.length - 1];
|
|
847
|
+
const matchedCountry = KNOWN_COUNTRIES.find(
|
|
848
|
+
(knownCountry) => lastPart.toLowerCase() === knownCountry.toLowerCase()
|
|
849
|
+
);
|
|
850
|
+
if (matchedCountry) {
|
|
851
|
+
country = matchedCountry;
|
|
852
|
+
if (parts.length >= 2) {
|
|
853
|
+
state = parts[parts.length - 2].split(" ")[0];
|
|
854
|
+
}
|
|
855
|
+
if (parts.length >= 3) {
|
|
856
|
+
city = parts[parts.length - 3];
|
|
857
|
+
}
|
|
858
|
+
} else {
|
|
859
|
+
if (parts.length >= 2) {
|
|
860
|
+
state = parts[parts.length - 1].split(" ")[0];
|
|
861
|
+
city = parts[parts.length - 2];
|
|
862
|
+
} else if (parts.length === 1) {
|
|
863
|
+
city = parts[0];
|
|
864
|
+
}
|
|
1149
865
|
}
|
|
1150
866
|
return {
|
|
1151
867
|
country: country.trim(),
|
|
@@ -1233,9 +949,7 @@ var LocationFilter = ({
|
|
|
1233
949
|
items = locationData.countries;
|
|
1234
950
|
break;
|
|
1235
951
|
case "state":
|
|
1236
|
-
items = selectedCountry ? locationData.states.filter(
|
|
1237
|
-
(s) => s.parentCode === selectedCountry
|
|
1238
|
-
) : [];
|
|
952
|
+
items = selectedCountry ? locationData.states.filter((s) => s.parentCode === selectedCountry) : [];
|
|
1239
953
|
break;
|
|
1240
954
|
case "city":
|
|
1241
955
|
items = selectedState ? locationData.cities.filter((c) => c.parentCode === selectedState) : [];
|
|
@@ -1252,6 +966,7 @@ var LocationFilter = ({
|
|
|
1252
966
|
() => groupByAlphabet(filteredItems),
|
|
1253
967
|
[filteredItems]
|
|
1254
968
|
);
|
|
969
|
+
const showIndexBar = filteredItems.length >= 10;
|
|
1255
970
|
const handleItemClick = (item) => {
|
|
1256
971
|
if (currentLevel === "country") {
|
|
1257
972
|
setSelectedCountry(item.code);
|
|
@@ -1295,42 +1010,30 @@ var LocationFilter = ({
|
|
|
1295
1010
|
style: { background: "#F8F8F8" },
|
|
1296
1011
|
className: "rounded-[12px] rounded-b-none h-[72px] font-bold text-[14px] flex flex-col",
|
|
1297
1012
|
children: [
|
|
1298
|
-
/* @__PURE__ */
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
children: /* @__PURE__ */ jsx(
|
|
1323
|
-
"path",
|
|
1324
|
-
{
|
|
1325
|
-
d: "M6.4 19L5 17.6L10.6 12L5 6.4L6.4 5L12 10.6L17.6 5L19 6.4L13.4 12L19 17.6L17.6 19L12 13.4L6.4 19Z",
|
|
1326
|
-
fill: "#1D1D1F"
|
|
1327
|
-
}
|
|
1328
|
-
)
|
|
1329
|
-
}
|
|
1330
|
-
)
|
|
1331
|
-
}
|
|
1332
|
-
)
|
|
1333
|
-
] }),
|
|
1013
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-end px-[20px] pt-[12px] pb-[8px]", children: /* @__PURE__ */ jsx(
|
|
1014
|
+
"button",
|
|
1015
|
+
{
|
|
1016
|
+
onClick: onClose,
|
|
1017
|
+
className: "ml-[12px] w-[24px] h-[24px] flex items-center justify-end",
|
|
1018
|
+
children: /* @__PURE__ */ jsx(
|
|
1019
|
+
"svg",
|
|
1020
|
+
{
|
|
1021
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1022
|
+
width: "24",
|
|
1023
|
+
height: "24",
|
|
1024
|
+
viewBox: "0 0 24 24",
|
|
1025
|
+
fill: "none",
|
|
1026
|
+
children: /* @__PURE__ */ jsx(
|
|
1027
|
+
"path",
|
|
1028
|
+
{
|
|
1029
|
+
d: "M6.4 19L5 17.6L10.6 12L5 6.4L6.4 5L12 10.6L17.6 5L19 6.4L13.4 12L19 17.6L17.6 19L12 13.4L6.4 19Z",
|
|
1030
|
+
fill: "#1D1D1F"
|
|
1031
|
+
}
|
|
1032
|
+
)
|
|
1033
|
+
}
|
|
1034
|
+
)
|
|
1035
|
+
}
|
|
1036
|
+
) }),
|
|
1334
1037
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center px-[20px] gap-[16px] pb-[8px]", children: [
|
|
1335
1038
|
/* @__PURE__ */ jsx(
|
|
1336
1039
|
"button",
|
|
@@ -1373,38 +1076,26 @@ var LocationFilter = ({
|
|
|
1373
1076
|
]
|
|
1374
1077
|
}
|
|
1375
1078
|
),
|
|
1376
|
-
/* @__PURE__ */ jsx(AntdMobileIsolated, { style: { height: "calc(100% - 72px)" }, children: /* @__PURE__ */ jsx(IndexBar, { style: { height: "100%" }, children: groupedItems.map((group) => {
|
|
1079
|
+
/* @__PURE__ */ jsx(AntdMobileIsolated, { style: { height: "calc(100% - 72px)" }, children: showIndexBar ? /* @__PURE__ */ jsx(IndexBar, { style: { height: "100%" }, children: groupedItems.map((group) => {
|
|
1377
1080
|
const { title, items } = group;
|
|
1378
1081
|
return /* @__PURE__ */ jsx(IndexBar.Panel, { index: title, title, children: /* @__PURE__ */ jsx(List, { children: items.map((item) => /* @__PURE__ */ jsx(
|
|
1379
1082
|
List.Item,
|
|
1380
1083
|
{
|
|
1381
|
-
clickable: true,
|
|
1382
1084
|
onClick: () => handleItemClick(item),
|
|
1383
|
-
|
|
1384
|
-
/* @__PURE__ */ jsx("span", { className: "text-[#767880] text-[14px]", children: item.count }),
|
|
1385
|
-
/* @__PURE__ */ jsx(
|
|
1386
|
-
"svg",
|
|
1387
|
-
{
|
|
1388
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1389
|
-
width: "16",
|
|
1390
|
-
height: "16",
|
|
1391
|
-
viewBox: "0 0 16 16",
|
|
1392
|
-
fill: "none",
|
|
1393
|
-
children: /* @__PURE__ */ jsx(
|
|
1394
|
-
"path",
|
|
1395
|
-
{
|
|
1396
|
-
d: "M6.4 12L5.6 11.2L9.06667 7.73333L5.6 4.26667L6.4 3.46667L10.6667 7.73333L6.4 12Z",
|
|
1397
|
-
fill: "#767880"
|
|
1398
|
-
}
|
|
1399
|
-
)
|
|
1400
|
-
}
|
|
1401
|
-
)
|
|
1402
|
-
] }),
|
|
1085
|
+
style: { cursor: "pointer" },
|
|
1403
1086
|
children: item.name
|
|
1404
1087
|
},
|
|
1405
1088
|
item.code
|
|
1406
1089
|
)) }) }, title);
|
|
1407
|
-
}) }) })
|
|
1090
|
+
}) }) : /* @__PURE__ */ jsx("div", { style: { height: "100%", overflow: "auto" }, children: /* @__PURE__ */ jsx(List, { children: filteredItems.map((item) => /* @__PURE__ */ jsx(
|
|
1091
|
+
List.Item,
|
|
1092
|
+
{
|
|
1093
|
+
onClick: () => handleItemClick(item),
|
|
1094
|
+
style: { cursor: "pointer" },
|
|
1095
|
+
children: item.name
|
|
1096
|
+
},
|
|
1097
|
+
item.code
|
|
1098
|
+
)) }) }) })
|
|
1408
1099
|
]
|
|
1409
1100
|
}
|
|
1410
1101
|
);
|
|
@@ -1527,6 +1218,7 @@ var RoomsList = ({
|
|
|
1527
1218
|
}) => {
|
|
1528
1219
|
const [showLocationFilter, setShowLocationFilter] = useState(false);
|
|
1529
1220
|
const [selectedLocation, setSelectedLocation] = useState();
|
|
1221
|
+
const [hoveredRoomId, setHoveredRoomId] = useState(null);
|
|
1530
1222
|
const {
|
|
1531
1223
|
data: demoRooms,
|
|
1532
1224
|
loading,
|
|
@@ -1539,25 +1231,9 @@ var RoomsList = ({
|
|
|
1539
1231
|
const studioLocations = useMemo(() => {
|
|
1540
1232
|
if (!demoRooms) return defaultStudioLocations;
|
|
1541
1233
|
return demoRooms.map((room) => {
|
|
1542
|
-
const
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
start_time: "2026-01-13T09:00:00-05:00",
|
|
1546
|
-
end_time: "2026-01-13T10:00:00-05:00",
|
|
1547
|
-
capacity: 5,
|
|
1548
|
-
booked_count: 2,
|
|
1549
|
-
status: "available"
|
|
1550
|
-
},
|
|
1551
|
-
{
|
|
1552
|
-
id: 131,
|
|
1553
|
-
start_time: "2026-01-13T14:00:00-05:00",
|
|
1554
|
-
end_time: "2026-01-13T15:00:00-05:00",
|
|
1555
|
-
capacity: 5,
|
|
1556
|
-
booked_count: 5,
|
|
1557
|
-
status: "full"
|
|
1558
|
-
}
|
|
1559
|
-
];
|
|
1560
|
-
const nextAvailableTimeslot = (room.timeslots?.length ? room.timeslots : timeslots)?.find((slot) => slot.status === "available");
|
|
1234
|
+
const nextAvailableTimeslot = room?.timeslots?.find(
|
|
1235
|
+
(slot) => slot.status === "available"
|
|
1236
|
+
);
|
|
1561
1237
|
const { country, state, city } = parseAddress(room.address);
|
|
1562
1238
|
return {
|
|
1563
1239
|
id: room.code,
|
|
@@ -1608,18 +1284,18 @@ var RoomsList = ({
|
|
|
1608
1284
|
return /* @__PURE__ */ jsxs("div", { className, ...props, children: [
|
|
1609
1285
|
/* @__PURE__ */ jsx(Title, { title: "Find a Studio Near You" }),
|
|
1610
1286
|
loading && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-[794px]", children: /* @__PURE__ */ jsx("div", { className: "text-center", children: /* @__PURE__ */ jsx("div", { className: "text-lg font-medium", children: "Loading demo rooms..." }) }) }),
|
|
1611
|
-
error && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-[794px]", children: /* @__PURE__ */ jsxs("div", { className: "text-center
|
|
1287
|
+
error && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-[794px]", children: /* @__PURE__ */ jsxs("div", { className: "text-center", style: { color: "#FF4D4D" }, children: [
|
|
1612
1288
|
/* @__PURE__ */ jsx("div", { className: "text-lg font-medium", children: "Failed to load demo rooms" }),
|
|
1613
1289
|
/* @__PURE__ */ jsx("div", { className: "text-sm mt-2", children: error.message })
|
|
1614
1290
|
] }) }),
|
|
1615
|
-
!loading && !error && /* @__PURE__ */ jsxs("div", { className: "flex h-[794px]
|
|
1291
|
+
!loading && !error && /* @__PURE__ */ jsxs("div", { className: "flex h-[794px] gap-4", children: [
|
|
1616
1292
|
/* @__PURE__ */ jsxs(
|
|
1617
1293
|
"div",
|
|
1618
1294
|
{
|
|
1619
1295
|
className: "flex-none relative w-[420px]",
|
|
1620
1296
|
style: { height: "794px" },
|
|
1621
1297
|
children: [
|
|
1622
|
-
/* @__PURE__ */
|
|
1298
|
+
/* @__PURE__ */ jsx("div", { className: "rounded-[12px] mb-4 bg-white border border-[#E4E5E6] px-[20px] py-[16px]", children: /* @__PURE__ */ jsxs("div", { className: "h-[40px] font-bold text-[16px] gap-10 flex items-center", children: [
|
|
1623
1299
|
/* @__PURE__ */ jsxs(
|
|
1624
1300
|
"button",
|
|
1625
1301
|
{
|
|
@@ -1675,7 +1351,7 @@ var RoomsList = ({
|
|
|
1675
1351
|
}
|
|
1676
1352
|
)
|
|
1677
1353
|
] })
|
|
1678
|
-
] }),
|
|
1354
|
+
] }) }),
|
|
1679
1355
|
/* @__PURE__ */ jsx(
|
|
1680
1356
|
"div",
|
|
1681
1357
|
{
|
|
@@ -1693,7 +1369,9 @@ var RoomsList = ({
|
|
|
1693
1369
|
state: item?.state,
|
|
1694
1370
|
zipCode: item?.zipCode,
|
|
1695
1371
|
euifyMakeModel: item?.euifyMakeModel || "",
|
|
1696
|
-
onSchedule
|
|
1372
|
+
onSchedule,
|
|
1373
|
+
onMouseEnter: () => setHoveredRoomId(item.id),
|
|
1374
|
+
onMouseLeave: () => setHoveredRoomId(null)
|
|
1697
1375
|
},
|
|
1698
1376
|
item.id
|
|
1699
1377
|
);
|
|
@@ -1720,9 +1398,8 @@ var RoomsList = ({
|
|
|
1720
1398
|
{
|
|
1721
1399
|
googleMapsApiKey,
|
|
1722
1400
|
locations: filteredStudioLocations,
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
},
|
|
1401
|
+
hoveredLocationId: hoveredRoomId,
|
|
1402
|
+
onSchedule,
|
|
1726
1403
|
mapHeight: "794px"
|
|
1727
1404
|
}
|
|
1728
1405
|
) })
|
|
@@ -1899,7 +1576,7 @@ function createDemoRoomApi(config) {
|
|
|
1899
1576
|
}
|
|
1900
1577
|
var DemoRoom = ({
|
|
1901
1578
|
className,
|
|
1902
|
-
layoutClassName
|
|
1579
|
+
layoutClassName,
|
|
1903
1580
|
googleMapsApiKey,
|
|
1904
1581
|
apiConfig,
|
|
1905
1582
|
teamCode,
|
|
@@ -1911,427 +1588,149 @@ var DemoRoom = ({
|
|
|
1911
1588
|
() => createDemoRoomApi(apiConfig),
|
|
1912
1589
|
[apiConfig]
|
|
1913
1590
|
);
|
|
1914
|
-
return /* @__PURE__ */
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
/* @__PURE__ */ jsx(
|
|
1926
|
-
RoomsList,
|
|
1927
|
-
{
|
|
1928
|
-
className: layoutClassName,
|
|
1929
|
-
googleMapsApiKey,
|
|
1930
|
-
apiClient,
|
|
1931
|
-
teamCode,
|
|
1932
|
-
brandWebsite,
|
|
1933
|
-
onSchedule
|
|
1934
|
-
}
|
|
1935
|
-
),
|
|
1936
|
-
/* @__PURE__ */ jsx(EasySteps, { className: layoutClassName })
|
|
1937
|
-
] });
|
|
1591
|
+
return /* @__PURE__ */ jsx("div", { className: cn(className), ...props, children: /* @__PURE__ */ jsx(
|
|
1592
|
+
RoomsList,
|
|
1593
|
+
{
|
|
1594
|
+
className: layoutClassName,
|
|
1595
|
+
googleMapsApiKey,
|
|
1596
|
+
apiClient,
|
|
1597
|
+
teamCode,
|
|
1598
|
+
brandWebsite,
|
|
1599
|
+
onSchedule
|
|
1600
|
+
}
|
|
1601
|
+
) });
|
|
1938
1602
|
};
|
|
1939
1603
|
DemoRoom.displayName = "DemoRoom";
|
|
1940
|
-
var
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1604
|
+
var QuestionnaireForm = ({
|
|
1605
|
+
questions,
|
|
1606
|
+
onSubmit,
|
|
1607
|
+
pageData,
|
|
1608
|
+
loading = false,
|
|
1609
|
+
className
|
|
1610
|
+
}) => {
|
|
1611
|
+
console.log(pageData);
|
|
1612
|
+
const [responses, setResponses] = useState({});
|
|
1613
|
+
const [errors, setErrors] = useState({});
|
|
1614
|
+
const [agreements, setAgreements] = useState({});
|
|
1615
|
+
const [agreementError, setAgreementError] = useState("");
|
|
1616
|
+
const getQuestionId = (question) => {
|
|
1617
|
+
return question.id || question.key || "";
|
|
1618
|
+
};
|
|
1619
|
+
const handleChange = (questionId, value) => {
|
|
1620
|
+
setResponses((prev) => ({
|
|
1621
|
+
...prev,
|
|
1622
|
+
[questionId]: value
|
|
1623
|
+
}));
|
|
1624
|
+
if (errors[questionId]) {
|
|
1625
|
+
setErrors((prev) => {
|
|
1626
|
+
const newErrors = { ...prev };
|
|
1627
|
+
delete newErrors[questionId];
|
|
1628
|
+
return newErrors;
|
|
1629
|
+
});
|
|
1963
1630
|
}
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
} catch (e) {
|
|
1978
|
-
try {
|
|
1979
|
-
__require("swiper/swiper.min.css");
|
|
1980
|
-
__require("swiper/modules/navigation/navigation.min.css");
|
|
1981
|
-
__require("swiper/modules/pagination/pagination.min.css");
|
|
1982
|
-
} catch (e2) {
|
|
1983
|
-
console.warn("Failed to load swiper styles");
|
|
1631
|
+
};
|
|
1632
|
+
const handleCheckboxChange = (questionId, optionValue, checked) => {
|
|
1633
|
+
const currentValues = responses[questionId] || [];
|
|
1634
|
+
const newValues = checked ? [...currentValues, optionValue] : currentValues.filter((v) => v !== optionValue);
|
|
1635
|
+
handleChange(questionId, newValues);
|
|
1636
|
+
};
|
|
1637
|
+
const handleAgreementChange = (index, checked) => {
|
|
1638
|
+
setAgreements((prev) => ({
|
|
1639
|
+
...prev,
|
|
1640
|
+
[index]: checked
|
|
1641
|
+
}));
|
|
1642
|
+
if (checked && agreementError) {
|
|
1643
|
+
setAgreementError("");
|
|
1984
1644
|
}
|
|
1985
|
-
}
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
const
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
/* @__PURE__ */ jsx(
|
|
2028
|
-
|
|
2029
|
-
/* @__PURE__ */ jsx("div", { className: "h-8 bg-gray-200 rounded animate-pulse" })
|
|
2030
|
-
] }),
|
|
2031
|
-
/* @__PURE__ */ jsx("div", { className: "h-[400px] bg-gray-200 rounded-2xl animate-pulse" })
|
|
2032
|
-
] }) });
|
|
2033
|
-
}
|
|
2034
|
-
if (error && apiClient && demoRoomCode) {
|
|
2035
|
-
return /* @__PURE__ */ jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxs("div", { className: "text-center text-red-600 py-8", children: [
|
|
2036
|
-
/* @__PURE__ */ jsx("p", { className: "text-lg font-medium", children: "Failed to load demo room details" }),
|
|
2037
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm mt-2", children: error.message })
|
|
2038
|
-
] }) });
|
|
2039
|
-
}
|
|
2040
|
-
return /* @__PURE__ */ jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-8 items-start", children: [
|
|
2041
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
2042
|
-
/* @__PURE__ */ jsx("h1", { className: "text-[40px] font-bold text-gray-900 leading-tight", children: title }),
|
|
2043
|
-
/* @__PURE__ */ jsx("div", { className: "space-y-4", children: descriptions.map((desc, index) => /* @__PURE__ */ jsx(
|
|
2044
|
-
"p",
|
|
2045
|
-
{
|
|
2046
|
-
className: "text-base text-gray-600 leading-relaxed",
|
|
2047
|
-
children: desc
|
|
2048
|
-
},
|
|
2049
|
-
index
|
|
2050
|
-
)) }),
|
|
2051
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
2052
|
-
/* @__PURE__ */ jsxs(
|
|
2053
|
-
"svg",
|
|
1645
|
+
};
|
|
1646
|
+
const validateForm = () => {
|
|
1647
|
+
const newErrors = {};
|
|
1648
|
+
questions.forEach((question) => {
|
|
1649
|
+
if (question.required) {
|
|
1650
|
+
const questionId = getQuestionId(question);
|
|
1651
|
+
const value = responses[questionId];
|
|
1652
|
+
if (!value || Array.isArray(value) && value.length === 0) {
|
|
1653
|
+
newErrors[questionId] = "This field is required";
|
|
1654
|
+
}
|
|
1655
|
+
}
|
|
1656
|
+
});
|
|
1657
|
+
const agrees = pageData?.agrees || [];
|
|
1658
|
+
if (agrees.length > 0) {
|
|
1659
|
+
const allAgreed = agrees.every(
|
|
1660
|
+
(_, index) => agreements[index]
|
|
1661
|
+
);
|
|
1662
|
+
if (!allAgreed) {
|
|
1663
|
+
setAgreementError(
|
|
1664
|
+
"Please agree to all terms and conditions to continue"
|
|
1665
|
+
);
|
|
1666
|
+
setErrors(newErrors);
|
|
1667
|
+
return false;
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1670
|
+
setErrors(newErrors);
|
|
1671
|
+
setAgreementError("");
|
|
1672
|
+
return Object.keys(newErrors).length === 0;
|
|
1673
|
+
};
|
|
1674
|
+
const handleSubmit = (e) => {
|
|
1675
|
+
e.preventDefault();
|
|
1676
|
+
if (validateForm()) {
|
|
1677
|
+
onSubmit?.(responses);
|
|
1678
|
+
}
|
|
1679
|
+
};
|
|
1680
|
+
const renderQuestion = (question) => {
|
|
1681
|
+
const questionId = getQuestionId(question);
|
|
1682
|
+
const hasError = !!errors[questionId];
|
|
1683
|
+
switch (question.type) {
|
|
1684
|
+
case "text":
|
|
1685
|
+
case "email":
|
|
1686
|
+
case "tel":
|
|
1687
|
+
return /* @__PURE__ */ jsx(
|
|
1688
|
+
"input",
|
|
2054
1689
|
{
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
1690
|
+
type: question.type,
|
|
1691
|
+
value: responses[questionId] || "",
|
|
1692
|
+
onChange: (e) => handleChange(questionId, e.target.value),
|
|
1693
|
+
placeholder: question.placeholder,
|
|
1694
|
+
className: cn(
|
|
1695
|
+
"w-full px-4 py-3 rounded-lg border text-base",
|
|
1696
|
+
"focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:border-transparent",
|
|
1697
|
+
hasError ? "border-red-500" : "border-[#E4E5E6]"
|
|
1698
|
+
)
|
|
1699
|
+
}
|
|
1700
|
+
);
|
|
1701
|
+
case "textarea":
|
|
1702
|
+
return /* @__PURE__ */ jsx(
|
|
1703
|
+
"textarea",
|
|
1704
|
+
{
|
|
1705
|
+
value: responses[questionId] || "",
|
|
1706
|
+
onChange: (e) => handleChange(questionId, e.target.value),
|
|
1707
|
+
placeholder: question.placeholder,
|
|
1708
|
+
rows: 4,
|
|
1709
|
+
className: cn(
|
|
1710
|
+
"w-full px-4 py-3 rounded-lg border text-base resize-none",
|
|
1711
|
+
"focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:border-transparent",
|
|
1712
|
+
hasError ? "border-red-500" : "border-[#E4E5E6]"
|
|
1713
|
+
)
|
|
1714
|
+
}
|
|
1715
|
+
);
|
|
1716
|
+
case "radio":
|
|
1717
|
+
return /* @__PURE__ */ jsx("div", { className: "space-y-3", children: question?.options?.map((option) => /* @__PURE__ */ jsxs(
|
|
1718
|
+
"label",
|
|
1719
|
+
{
|
|
1720
|
+
className: "flex items-center gap-3 cursor-pointer group",
|
|
2061
1721
|
children: [
|
|
2062
1722
|
/* @__PURE__ */ jsx(
|
|
2063
|
-
"
|
|
2064
|
-
{
|
|
2065
|
-
x: "3",
|
|
2066
|
-
y: "3",
|
|
2067
|
-
width: "18",
|
|
2068
|
-
height: "18",
|
|
2069
|
-
rx: "2",
|
|
2070
|
-
stroke: "currentColor",
|
|
2071
|
-
strokeWidth: "2"
|
|
2072
|
-
}
|
|
2073
|
-
),
|
|
2074
|
-
/* @__PURE__ */ jsx(
|
|
2075
|
-
"path",
|
|
1723
|
+
"input",
|
|
2076
1724
|
{
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
1725
|
+
type: "radio",
|
|
1726
|
+
name: questionId,
|
|
1727
|
+
value: option.value || option.label,
|
|
1728
|
+
checked: responses[questionId] === (option.value || option.label),
|
|
1729
|
+
onChange: (e) => handleChange(questionId, e.target.value),
|
|
1730
|
+
className: "w-5 h-5 text-[#3ADB67] focus:ring-[#3ADB67] focus:ring-2"
|
|
2081
1731
|
}
|
|
2082
1732
|
),
|
|
2083
|
-
/* @__PURE__ */ jsx(
|
|
2084
|
-
"path",
|
|
2085
|
-
{
|
|
2086
|
-
d: "M8 14H16",
|
|
2087
|
-
stroke: "currentColor",
|
|
2088
|
-
strokeWidth: "2",
|
|
2089
|
-
strokeLinecap: "round"
|
|
2090
|
-
}
|
|
2091
|
-
)
|
|
2092
|
-
]
|
|
2093
|
-
}
|
|
2094
|
-
),
|
|
2095
|
-
/* @__PURE__ */ jsx("span", { className: "text-base text-gray-900", children: devices })
|
|
2096
|
-
] }),
|
|
2097
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
2098
|
-
/* @__PURE__ */ jsxs(
|
|
2099
|
-
"svg",
|
|
2100
|
-
{
|
|
2101
|
-
width: "24",
|
|
2102
|
-
height: "24",
|
|
2103
|
-
viewBox: "0 0 24 24",
|
|
2104
|
-
fill: "none",
|
|
2105
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2106
|
-
className: "flex-shrink-0 mt-0.5",
|
|
2107
|
-
children: [
|
|
2108
|
-
/* @__PURE__ */ jsx(
|
|
2109
|
-
"path",
|
|
2110
|
-
{
|
|
2111
|
-
d: "M12 2C8.13 2 5 5.13 5 9C5 14.25 12 22 12 22C12 22 19 14.25 19 9C19 5.13 15.87 2 12 2Z",
|
|
2112
|
-
stroke: "currentColor",
|
|
2113
|
-
strokeWidth: "2",
|
|
2114
|
-
strokeLinecap: "round",
|
|
2115
|
-
strokeLinejoin: "round"
|
|
2116
|
-
}
|
|
2117
|
-
),
|
|
2118
|
-
/* @__PURE__ */ jsx(
|
|
2119
|
-
"circle",
|
|
2120
|
-
{
|
|
2121
|
-
cx: "12",
|
|
2122
|
-
cy: "9",
|
|
2123
|
-
r: "2.5",
|
|
2124
|
-
stroke: "currentColor",
|
|
2125
|
-
strokeWidth: "2"
|
|
2126
|
-
}
|
|
2127
|
-
)
|
|
2128
|
-
]
|
|
2129
|
-
}
|
|
2130
|
-
),
|
|
2131
|
-
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
2132
|
-
/* @__PURE__ */ jsx("p", { className: "text-base text-gray-900", children: address }),
|
|
2133
|
-
/* @__PURE__ */ jsxs(
|
|
2134
|
-
"a",
|
|
2135
|
-
{
|
|
2136
|
-
href: googleMapsLink,
|
|
2137
|
-
target: "_blank",
|
|
2138
|
-
rel: "noopener noreferrer",
|
|
2139
|
-
className: "inline-flex items-center gap-1 text-sm text-blue-600 hover:text-blue-700 mt-1 underline",
|
|
2140
|
-
children: [
|
|
2141
|
-
"Open in Google Maps",
|
|
2142
|
-
/* @__PURE__ */ jsx(
|
|
2143
|
-
"svg",
|
|
2144
|
-
{
|
|
2145
|
-
width: "12",
|
|
2146
|
-
height: "12",
|
|
2147
|
-
viewBox: "0 0 12 12",
|
|
2148
|
-
fill: "none",
|
|
2149
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2150
|
-
children: /* @__PURE__ */ jsx(
|
|
2151
|
-
"path",
|
|
2152
|
-
{
|
|
2153
|
-
d: "M3 9L9 3M9 3H3M9 3V9",
|
|
2154
|
-
stroke: "currentColor",
|
|
2155
|
-
strokeWidth: "1.5",
|
|
2156
|
-
strokeLinecap: "round",
|
|
2157
|
-
strokeLinejoin: "round"
|
|
2158
|
-
}
|
|
2159
|
-
)
|
|
2160
|
-
}
|
|
2161
|
-
)
|
|
2162
|
-
]
|
|
2163
|
-
}
|
|
2164
|
-
)
|
|
2165
|
-
] })
|
|
2166
|
-
] })
|
|
2167
|
-
] }),
|
|
2168
|
-
/* @__PURE__ */ jsx("div", { className: "relative h-[400px] rounded-2xl overflow-hidden", children: images.length > 0 ? /* @__PURE__ */ jsx(
|
|
2169
|
-
Swiper,
|
|
2170
|
-
{
|
|
2171
|
-
...swiperVersion === "11+" && Navigation && Pagination && Autoplay ? { modules: [Navigation, Pagination, Autoplay] } : {},
|
|
2172
|
-
spaceBetween: 0,
|
|
2173
|
-
slidesPerView: 1,
|
|
2174
|
-
navigation: true,
|
|
2175
|
-
pagination: { clickable: true },
|
|
2176
|
-
autoplay: {
|
|
2177
|
-
delay: 3e3,
|
|
2178
|
-
disableOnInteraction: false
|
|
2179
|
-
},
|
|
2180
|
-
loop: true,
|
|
2181
|
-
className: "h-full rounded-2xl",
|
|
2182
|
-
children: images.map((img, index) => /* @__PURE__ */ jsx(SwiperSlide, { children: /* @__PURE__ */ jsx("div", { className: "relative w-full h-full bg-gray-100", children: /* @__PURE__ */ jsx(
|
|
2183
|
-
"img",
|
|
2184
|
-
{
|
|
2185
|
-
src: img,
|
|
2186
|
-
alt: `Demo room view ${index + 1}`,
|
|
2187
|
-
className: "w-full h-full object-cover"
|
|
2188
|
-
}
|
|
2189
|
-
) }) }, index))
|
|
2190
|
-
}
|
|
2191
|
-
) : /* @__PURE__ */ jsx("div", { className: "w-full h-full bg-gradient-to-br from-gray-100 to-gray-200 flex items-center justify-center rounded-2xl", children: /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
|
|
2192
|
-
/* @__PURE__ */ jsx("div", { className: "w-16 h-16 mx-auto mb-3 rounded-full bg-white flex items-center justify-center", children: /* @__PURE__ */ jsxs(
|
|
2193
|
-
"svg",
|
|
2194
|
-
{
|
|
2195
|
-
width: "32",
|
|
2196
|
-
height: "32",
|
|
2197
|
-
viewBox: "0 0 32 32",
|
|
2198
|
-
fill: "none",
|
|
2199
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2200
|
-
children: [
|
|
2201
|
-
/* @__PURE__ */ jsx(
|
|
2202
|
-
"rect",
|
|
2203
|
-
{
|
|
2204
|
-
x: "4",
|
|
2205
|
-
y: "8",
|
|
2206
|
-
width: "24",
|
|
2207
|
-
height: "16",
|
|
2208
|
-
rx: "2",
|
|
2209
|
-
stroke: "currentColor",
|
|
2210
|
-
strokeWidth: "2"
|
|
2211
|
-
}
|
|
2212
|
-
),
|
|
2213
|
-
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "14", r: "2", fill: "currentColor" }),
|
|
2214
|
-
/* @__PURE__ */ jsx(
|
|
2215
|
-
"path",
|
|
2216
|
-
{
|
|
2217
|
-
d: "M28 20L22 14L16 20",
|
|
2218
|
-
stroke: "currentColor",
|
|
2219
|
-
strokeWidth: "2",
|
|
2220
|
-
strokeLinecap: "round",
|
|
2221
|
-
strokeLinejoin: "round"
|
|
2222
|
-
}
|
|
2223
|
-
)
|
|
2224
|
-
]
|
|
2225
|
-
}
|
|
2226
|
-
) }),
|
|
2227
|
-
/* @__PURE__ */ jsx("p", { className: "text-gray-500 text-sm", children: "Demo Room Images" })
|
|
2228
|
-
] }) }) })
|
|
2229
|
-
] }) });
|
|
2230
|
-
};
|
|
2231
|
-
DemoRoomDetail.displayName = "DemoRoomDetail";
|
|
2232
|
-
var QuestionnaireForm = ({
|
|
2233
|
-
questions,
|
|
2234
|
-
onSubmit,
|
|
2235
|
-
loading = false,
|
|
2236
|
-
className
|
|
2237
|
-
}) => {
|
|
2238
|
-
const [responses, setResponses] = useState({});
|
|
2239
|
-
const [errors, setErrors] = useState({});
|
|
2240
|
-
const getQuestionId = (question) => {
|
|
2241
|
-
return question.id || question.key || "";
|
|
2242
|
-
};
|
|
2243
|
-
const handleChange = (questionId, value) => {
|
|
2244
|
-
setResponses((prev) => ({
|
|
2245
|
-
...prev,
|
|
2246
|
-
[questionId]: value
|
|
2247
|
-
}));
|
|
2248
|
-
if (errors[questionId]) {
|
|
2249
|
-
setErrors((prev) => {
|
|
2250
|
-
const newErrors = { ...prev };
|
|
2251
|
-
delete newErrors[questionId];
|
|
2252
|
-
return newErrors;
|
|
2253
|
-
});
|
|
2254
|
-
}
|
|
2255
|
-
};
|
|
2256
|
-
const handleCheckboxChange = (questionId, optionValue, checked) => {
|
|
2257
|
-
const currentValues = responses[questionId] || [];
|
|
2258
|
-
const newValues = checked ? [...currentValues, optionValue] : currentValues.filter((v) => v !== optionValue);
|
|
2259
|
-
handleChange(questionId, newValues);
|
|
2260
|
-
};
|
|
2261
|
-
const validateForm = () => {
|
|
2262
|
-
const newErrors = {};
|
|
2263
|
-
questions.forEach((question) => {
|
|
2264
|
-
if (question.required) {
|
|
2265
|
-
const questionId = getQuestionId(question);
|
|
2266
|
-
const value = responses[questionId];
|
|
2267
|
-
if (!value || Array.isArray(value) && value.length === 0) {
|
|
2268
|
-
newErrors[questionId] = "This field is required";
|
|
2269
|
-
}
|
|
2270
|
-
}
|
|
2271
|
-
});
|
|
2272
|
-
setErrors(newErrors);
|
|
2273
|
-
return Object.keys(newErrors).length === 0;
|
|
2274
|
-
};
|
|
2275
|
-
const handleSubmit = (e) => {
|
|
2276
|
-
e.preventDefault();
|
|
2277
|
-
if (validateForm()) {
|
|
2278
|
-
onSubmit?.(responses);
|
|
2279
|
-
}
|
|
2280
|
-
};
|
|
2281
|
-
const renderQuestion = (question) => {
|
|
2282
|
-
const questionId = getQuestionId(question);
|
|
2283
|
-
const hasError = !!errors[questionId];
|
|
2284
|
-
switch (question.type) {
|
|
2285
|
-
case "text":
|
|
2286
|
-
case "email":
|
|
2287
|
-
case "tel":
|
|
2288
|
-
return /* @__PURE__ */ jsx(
|
|
2289
|
-
"input",
|
|
2290
|
-
{
|
|
2291
|
-
type: question.type,
|
|
2292
|
-
value: responses[questionId] || "",
|
|
2293
|
-
onChange: (e) => handleChange(questionId, e.target.value),
|
|
2294
|
-
placeholder: question.placeholder,
|
|
2295
|
-
className: cn(
|
|
2296
|
-
"w-full px-4 py-3 rounded-lg border text-base",
|
|
2297
|
-
"focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:border-transparent",
|
|
2298
|
-
hasError ? "border-red-500" : "border-[#E4E5E6]"
|
|
2299
|
-
)
|
|
2300
|
-
}
|
|
2301
|
-
);
|
|
2302
|
-
case "textarea":
|
|
2303
|
-
return /* @__PURE__ */ jsx(
|
|
2304
|
-
"textarea",
|
|
2305
|
-
{
|
|
2306
|
-
value: responses[questionId] || "",
|
|
2307
|
-
onChange: (e) => handleChange(questionId, e.target.value),
|
|
2308
|
-
placeholder: question.placeholder,
|
|
2309
|
-
rows: 4,
|
|
2310
|
-
className: cn(
|
|
2311
|
-
"w-full px-4 py-3 rounded-lg border text-base resize-none",
|
|
2312
|
-
"focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:border-transparent",
|
|
2313
|
-
hasError ? "border-red-500" : "border-[#E4E5E6]"
|
|
2314
|
-
)
|
|
2315
|
-
}
|
|
2316
|
-
);
|
|
2317
|
-
case "radio":
|
|
2318
|
-
return /* @__PURE__ */ jsx("div", { className: "space-y-3", children: question?.options?.map((option) => /* @__PURE__ */ jsxs(
|
|
2319
|
-
"label",
|
|
2320
|
-
{
|
|
2321
|
-
className: "flex items-center gap-3 cursor-pointer group",
|
|
2322
|
-
children: [
|
|
2323
|
-
/* @__PURE__ */ jsx(
|
|
2324
|
-
"input",
|
|
2325
|
-
{
|
|
2326
|
-
type: "radio",
|
|
2327
|
-
name: questionId,
|
|
2328
|
-
value: option.value || option.label,
|
|
2329
|
-
checked: responses[questionId] === (option.value || option.label),
|
|
2330
|
-
onChange: (e) => handleChange(questionId, e.target.value),
|
|
2331
|
-
className: "w-5 h-5 text-[#3ADB67] focus:ring-[#3ADB67] focus:ring-2"
|
|
2332
|
-
}
|
|
2333
|
-
),
|
|
2334
|
-
/* @__PURE__ */ jsx("span", { className: "text-base text-gray-900 group-hover:text-[#3ADB67] transition-colors", children: option.label })
|
|
1733
|
+
/* @__PURE__ */ jsx("span", { className: "text-base text-gray-900 group-hover:text-[#3ADB67] transition-colors", children: option.label })
|
|
2335
1734
|
]
|
|
2336
1735
|
},
|
|
2337
1736
|
option.value || option.label
|
|
@@ -2395,8 +1794,8 @@ var QuestionnaireForm = ({
|
|
|
2395
1794
|
return null;
|
|
2396
1795
|
}
|
|
2397
1796
|
};
|
|
2398
|
-
return /* @__PURE__ */ jsxs("
|
|
2399
|
-
questions?.map((question) => {
|
|
1797
|
+
return /* @__PURE__ */ jsxs("div", { className: "pb-[80px]", children: [
|
|
1798
|
+
/* @__PURE__ */ jsx("div", { className: "bg-white rounded-[12px] border border-[#E4E5E6] p-8", children: /* @__PURE__ */ jsx("form", { onSubmit: handleSubmit, className: cn("space-y-6", className), children: questions?.map((question) => {
|
|
2400
1799
|
const questionId = getQuestionId(question);
|
|
2401
1800
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
2402
1801
|
/* @__PURE__ */ jsxs("label", { className: "block", children: [
|
|
@@ -2408,54 +1807,83 @@ var QuestionnaireForm = ({
|
|
|
2408
1807
|
] }),
|
|
2409
1808
|
renderQuestion(question),
|
|
2410
1809
|
question.hint && !errors[questionId] && /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500", children: question.hint }),
|
|
2411
|
-
errors[questionId] && /* @__PURE__ */ jsx("p", { className: "text-sm
|
|
1810
|
+
errors[questionId] && /* @__PURE__ */ jsx("p", { className: "text-sm", style: { color: "#FF4D4D" }, children: errors[questionId] })
|
|
2412
1811
|
] }, questionId);
|
|
2413
|
-
}),
|
|
2414
|
-
/* @__PURE__ */
|
|
2415
|
-
"
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
}
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
1812
|
+
}) }) }),
|
|
1813
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center", children: [
|
|
1814
|
+
pageData?.agrees && pageData.agrees.length > 0 && /* @__PURE__ */ jsxs("div", { className: "space-y-4 mt-8", children: [
|
|
1815
|
+
pageData.agrees.map((agreeContent, index) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
1816
|
+
/* @__PURE__ */ jsx(
|
|
1817
|
+
"input",
|
|
1818
|
+
{
|
|
1819
|
+
type: "checkbox",
|
|
1820
|
+
id: `agreement-${index}`,
|
|
1821
|
+
checked: agreements[index] || false,
|
|
1822
|
+
onChange: (e) => handleAgreementChange(index, e.target.checked),
|
|
1823
|
+
className: "w-5 h-5 rounded border-gray-300 text-[#2FC257] focus:ring-[#2FC257] cursor-pointer flex-shrink-0"
|
|
1824
|
+
}
|
|
1825
|
+
),
|
|
1826
|
+
/* @__PURE__ */ jsx(
|
|
1827
|
+
"label",
|
|
1828
|
+
{
|
|
1829
|
+
htmlFor: `agreement-${index}`,
|
|
1830
|
+
className: "text-sm text-gray-700 cursor-pointer select-none flex-1 [&_a]:underline [&_a]:text-blue-600 [&_a:hover]:text-blue-700",
|
|
1831
|
+
dangerouslySetInnerHTML: { __html: agreeContent },
|
|
1832
|
+
"aria-label": `Agreement ${index + 1}`
|
|
1833
|
+
}
|
|
1834
|
+
)
|
|
1835
|
+
] }, index)),
|
|
1836
|
+
agreementError && /* @__PURE__ */ jsx("p", { className: "text-sm mt-2", style: { color: "#FF4D4D" }, children: agreementError })
|
|
1837
|
+
] }),
|
|
1838
|
+
/* @__PURE__ */ jsx(
|
|
1839
|
+
"button",
|
|
1840
|
+
{
|
|
1841
|
+
type: "submit",
|
|
1842
|
+
disabled: loading,
|
|
1843
|
+
onClick: handleSubmit,
|
|
1844
|
+
className: cn(
|
|
1845
|
+
"w-fit mt-6 px-6 py-4 rounded-full",
|
|
1846
|
+
"bg-[#080A0F] text-white font-medium text-base",
|
|
1847
|
+
"hover:bg-[#2FC257] transition-colors",
|
|
1848
|
+
"focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:ring-offset-2",
|
|
1849
|
+
"disabled:opacity-50 disabled:cursor-not-allowed"
|
|
1850
|
+
),
|
|
1851
|
+
children: loading ? "Submitting..." : "Submit Booking"
|
|
1852
|
+
}
|
|
1853
|
+
)
|
|
1854
|
+
] })
|
|
1855
|
+
] });
|
|
1856
|
+
};
|
|
1857
|
+
dayjs.extend(dayLocaleData);
|
|
1858
|
+
dayjs.extend(weekday);
|
|
1859
|
+
dayjs.extend(weekOfYear);
|
|
1860
|
+
var DateTimePicker = ({
|
|
1861
|
+
apiClient,
|
|
1862
|
+
demoRoomCode,
|
|
1863
|
+
timezone,
|
|
1864
|
+
pageData,
|
|
1865
|
+
locale,
|
|
2439
1866
|
onBookingSuccess
|
|
2440
1867
|
}) => {
|
|
2441
1868
|
const { token } = theme.useToken();
|
|
2442
1869
|
const [selectMonth, setSelectMonth] = useState("");
|
|
2443
1870
|
const [selectedDate, setSelectedDate] = useState(dayjs());
|
|
2444
|
-
const [selectedTimeslotId, setSelectedTimeslotId] = useState(
|
|
1871
|
+
const [selectedTimeslotId, setSelectedTimeslotId] = useState(
|
|
1872
|
+
null
|
|
1873
|
+
);
|
|
2445
1874
|
const [showQuestionnaire, setShowQuestionnaire] = useState(false);
|
|
2446
|
-
const { createBooking, loading: bookingLoading, error: bookingError } = useCreateBooking(apiClient);
|
|
2447
1875
|
const {
|
|
2448
|
-
|
|
2449
|
-
|
|
1876
|
+
createBooking,
|
|
1877
|
+
loading: bookingLoading,
|
|
1878
|
+
error: bookingError
|
|
1879
|
+
} = useCreateBooking(apiClient);
|
|
1880
|
+
const { data: demoRoom } = useDemoRoom(
|
|
2450
1881
|
apiClient,
|
|
2451
1882
|
demoRoomCode || "",
|
|
2452
1883
|
locale,
|
|
2453
1884
|
{ enabled: !!demoRoomCode }
|
|
2454
1885
|
);
|
|
2455
|
-
const {
|
|
2456
|
-
data: questionnaire,
|
|
2457
|
-
loading: questionnaireLoading
|
|
2458
|
-
} = useQuestionnaire(
|
|
1886
|
+
const { data: questionnaire, loading: questionnaireLoading } = useQuestionnaire(
|
|
2459
1887
|
apiClient,
|
|
2460
1888
|
demoRoomCode || "",
|
|
2461
1889
|
demoRoom?.questionnaire_id,
|
|
@@ -2523,13 +1951,8 @@ var DateTimePicker = ({
|
|
|
2523
1951
|
}
|
|
2524
1952
|
}
|
|
2525
1953
|
},
|
|
2526
|
-
children: /* @__PURE__ */ jsxs(
|
|
2527
|
-
"
|
|
2528
|
-
{
|
|
2529
|
-
style: wrapperStyle,
|
|
2530
|
-
className: "calendar-custom-cell",
|
|
2531
|
-
children: [
|
|
2532
|
-
/* @__PURE__ */ jsx("style", { children: `
|
|
1954
|
+
children: /* @__PURE__ */ jsxs("div", { style: wrapperStyle, className: "calendar-custom-cell", children: [
|
|
1955
|
+
/* @__PURE__ */ jsx("style", { children: `
|
|
2533
1956
|
.calendar-custom-cell .ant-picker-cell {
|
|
2534
1957
|
padding: 6px !important;
|
|
2535
1958
|
}
|
|
@@ -2564,136 +1987,134 @@ var DateTimePicker = ({
|
|
|
2564
1987
|
line-height: 48px !important;
|
|
2565
1988
|
}
|
|
2566
1989
|
` }),
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
1990
|
+
/* @__PURE__ */ jsx(
|
|
1991
|
+
Calendar,
|
|
1992
|
+
{
|
|
1993
|
+
fullscreen: false,
|
|
1994
|
+
value: selectedDate,
|
|
1995
|
+
onChange: (date) => setSelectedDate(date),
|
|
1996
|
+
headerRender: ({ value, onChange }) => {
|
|
1997
|
+
const year = value.year();
|
|
1998
|
+
const month = value.month();
|
|
1999
|
+
const yearOptions = Array.from({ length: 20 }, (_, i) => {
|
|
2000
|
+
const label = year - 10 + i;
|
|
2001
|
+
return { label, value: label };
|
|
2002
|
+
});
|
|
2003
|
+
const monthOptions = value.localeData().months().map((label, index) => ({
|
|
2004
|
+
label,
|
|
2005
|
+
value: index
|
|
2006
|
+
}));
|
|
2007
|
+
const monthText = monthOptions?.find((item) => {
|
|
2008
|
+
return item?.value === month;
|
|
2009
|
+
});
|
|
2010
|
+
setSelectMonth(monthText?.label || "");
|
|
2011
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 py-3", children: [
|
|
2012
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
2013
|
+
/* @__PURE__ */ jsx(
|
|
2014
|
+
Select,
|
|
2015
|
+
{
|
|
2016
|
+
value: month,
|
|
2017
|
+
options: monthOptions,
|
|
2018
|
+
onChange: (newMonth) => {
|
|
2019
|
+
const now = value.clone().month(newMonth);
|
|
2020
|
+
onChange(now);
|
|
2021
|
+
},
|
|
2022
|
+
variant: "borderless",
|
|
2023
|
+
className: "text-2xl font-medium",
|
|
2024
|
+
popupMatchSelectWidth: false,
|
|
2025
|
+
style: {
|
|
2026
|
+
fontSize: "24px",
|
|
2027
|
+
fontWeight: 500
|
|
2028
|
+
}
|
|
2029
|
+
}
|
|
2030
|
+
),
|
|
2031
|
+
/* @__PURE__ */ jsx(
|
|
2032
|
+
Select,
|
|
2033
|
+
{
|
|
2034
|
+
value: year,
|
|
2035
|
+
options: yearOptions,
|
|
2036
|
+
onChange: (newYear) => {
|
|
2037
|
+
const now = value.clone().year(newYear);
|
|
2038
|
+
onChange(now);
|
|
2039
|
+
},
|
|
2040
|
+
variant: "borderless",
|
|
2041
|
+
className: "text-2xl font-medium",
|
|
2042
|
+
popupMatchSelectWidth: false,
|
|
2043
|
+
style: {
|
|
2044
|
+
fontSize: "24px",
|
|
2045
|
+
fontWeight: 500
|
|
2046
|
+
}
|
|
2047
|
+
}
|
|
2048
|
+
)
|
|
2049
|
+
] }),
|
|
2050
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2051
|
+
/* @__PURE__ */ jsx(
|
|
2052
|
+
"button",
|
|
2053
|
+
{
|
|
2054
|
+
onClick: () => {
|
|
2055
|
+
const newDate = value.subtract(1, "month");
|
|
2056
|
+
onChange(newDate);
|
|
2057
|
+
},
|
|
2058
|
+
className: "w-10 h-10 flex items-center justify-center hover:bg-gray-100 rounded-lg transition-colors",
|
|
2059
|
+
children: /* @__PURE__ */ jsx(
|
|
2060
|
+
"svg",
|
|
2630
2061
|
{
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2062
|
+
width: "20",
|
|
2063
|
+
height: "20",
|
|
2064
|
+
viewBox: "0 0 20 20",
|
|
2065
|
+
fill: "none",
|
|
2066
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2636
2067
|
children: /* @__PURE__ */ jsx(
|
|
2637
|
-
"
|
|
2068
|
+
"path",
|
|
2638
2069
|
{
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
children: /* @__PURE__ */ jsx(
|
|
2645
|
-
"path",
|
|
2646
|
-
{
|
|
2647
|
-
d: "M12 16L6 10L12 4",
|
|
2648
|
-
stroke: "currentColor",
|
|
2649
|
-
strokeWidth: "2",
|
|
2650
|
-
strokeLinecap: "round",
|
|
2651
|
-
strokeLinejoin: "round"
|
|
2652
|
-
}
|
|
2653
|
-
)
|
|
2070
|
+
d: "M12 16L6 10L12 4",
|
|
2071
|
+
stroke: "currentColor",
|
|
2072
|
+
strokeWidth: "2",
|
|
2073
|
+
strokeLinecap: "round",
|
|
2074
|
+
strokeLinejoin: "round"
|
|
2654
2075
|
}
|
|
2655
2076
|
)
|
|
2656
2077
|
}
|
|
2657
|
-
)
|
|
2658
|
-
|
|
2659
|
-
|
|
2078
|
+
)
|
|
2079
|
+
}
|
|
2080
|
+
),
|
|
2081
|
+
/* @__PURE__ */ jsx(
|
|
2082
|
+
"button",
|
|
2083
|
+
{
|
|
2084
|
+
onClick: () => {
|
|
2085
|
+
const newDate = value.add(1, "month");
|
|
2086
|
+
onChange(newDate);
|
|
2087
|
+
},
|
|
2088
|
+
className: "w-10 h-10 flex items-center justify-center hover:bg-gray-100 rounded-lg transition-colors",
|
|
2089
|
+
children: /* @__PURE__ */ jsx(
|
|
2090
|
+
"svg",
|
|
2660
2091
|
{
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2092
|
+
width: "20",
|
|
2093
|
+
height: "20",
|
|
2094
|
+
viewBox: "0 0 20 20",
|
|
2095
|
+
fill: "none",
|
|
2096
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2666
2097
|
children: /* @__PURE__ */ jsx(
|
|
2667
|
-
"
|
|
2098
|
+
"path",
|
|
2668
2099
|
{
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
children: /* @__PURE__ */ jsx(
|
|
2675
|
-
"path",
|
|
2676
|
-
{
|
|
2677
|
-
d: "M8 4L14 10L8 16",
|
|
2678
|
-
stroke: "currentColor",
|
|
2679
|
-
strokeWidth: "2",
|
|
2680
|
-
strokeLinecap: "round",
|
|
2681
|
-
strokeLinejoin: "round"
|
|
2682
|
-
}
|
|
2683
|
-
)
|
|
2100
|
+
d: "M8 4L14 10L8 16",
|
|
2101
|
+
stroke: "currentColor",
|
|
2102
|
+
strokeWidth: "2",
|
|
2103
|
+
strokeLinecap: "round",
|
|
2104
|
+
strokeLinejoin: "round"
|
|
2684
2105
|
}
|
|
2685
2106
|
)
|
|
2686
2107
|
}
|
|
2687
2108
|
)
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
}
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
)
|
|
2109
|
+
}
|
|
2110
|
+
)
|
|
2111
|
+
] })
|
|
2112
|
+
] });
|
|
2113
|
+
},
|
|
2114
|
+
onPanelChange
|
|
2115
|
+
}
|
|
2116
|
+
)
|
|
2117
|
+
] })
|
|
2697
2118
|
}
|
|
2698
2119
|
),
|
|
2699
2120
|
/* @__PURE__ */ jsxs("div", { className: "bg-white p-[24px] rounded-[12px] flex-1", children: [
|
|
@@ -2753,91 +2174,391 @@ var DateTimePicker = ({
|
|
|
2753
2174
|
)
|
|
2754
2175
|
}
|
|
2755
2176
|
)
|
|
2756
|
-
}
|
|
2757
|
-
)
|
|
2758
|
-
] })
|
|
2759
|
-
] }),
|
|
2760
|
-
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 mt-[40px] gap-4", children: timeslotsLoading ? /* @__PURE__ */ jsx("div", { className: "col-span-2 text-center text-[#767880] py-8", children: "Loading time slots..." }) : timeslotsError ? /* @__PURE__ */ jsx("div", { className: "col-span-2 text-center text-red-600 py-8", children: "Failed to load time slots" }) : dayTimeslots.length === 0 ? /* @__PURE__ */ jsx("div", { className: "col-span-2 text-center text-[#767880] py-8", children: "No available time slots for this date" }) : dayTimeslots.map((slot) => {
|
|
2761
|
-
const isAvailable = slot.status === "available";
|
|
2762
|
-
const isFull = slot.status === "full";
|
|
2763
|
-
const isSelected = selectedTimeslotId === slot.id;
|
|
2764
|
-
return /* @__PURE__ */ jsx(
|
|
2765
|
-
"button",
|
|
2766
|
-
{
|
|
2767
|
-
disabled: !isAvailable,
|
|
2768
|
-
onClick: () => {
|
|
2769
|
-
if (isAvailable) {
|
|
2770
|
-
setSelectedTimeslotId(slot.id);
|
|
2771
|
-
}
|
|
2772
|
-
},
|
|
2773
|
-
className: `
|
|
2774
|
-
rounded-[20px] w-full flex items-center justify-center gap-4 h-[76px]
|
|
2775
|
-
border text-center transition-colors
|
|
2776
|
-
${isSelected ? "border-[#3ADB67] bg-[#3ADB67] text-white cursor-pointer" : isAvailable ? "border-[#E4E5E6] hover:border-[#3ADB67] hover:bg-[#3ADB67]
|
|
2777
|
-
`,
|
|
2778
|
-
children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
|
|
2779
|
-
/* @__PURE__ */ jsx("div", { children: formatTimeslot(slot) }),
|
|
2780
|
-
isFull && /* @__PURE__ */ jsx("div", { className: "text-xs text-[#BDBDBD] mt-1", children: "Full" }),
|
|
2781
|
-
isAvailable && !isSelected && /* @__PURE__ */ jsxs("div", { className: "text-xs text-[#767880] mt-1", children: [
|
|
2782
|
-
slot.capacity - slot.booked_count,
|
|
2783
|
-
" spots left"
|
|
2784
|
-
] }),
|
|
2785
|
-
isAvailable && isSelected && /* @__PURE__ */ jsxs("div", { className: "text-xs text-white mt-1", children: [
|
|
2786
|
-
slot.capacity - slot.booked_count,
|
|
2787
|
-
" spots left"
|
|
2788
|
-
] })
|
|
2789
|
-
] })
|
|
2790
|
-
},
|
|
2791
|
-
slot.id
|
|
2792
|
-
);
|
|
2793
|
-
}) })
|
|
2177
|
+
}
|
|
2178
|
+
)
|
|
2179
|
+
] })
|
|
2180
|
+
] }),
|
|
2181
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 mt-[40px] gap-4", children: timeslotsLoading ? /* @__PURE__ */ jsx("div", { className: "col-span-2 text-center text-[#767880] py-8", children: "Loading time slots..." }) : timeslotsError ? /* @__PURE__ */ jsx("div", { className: "col-span-2 text-center text-red-600 py-8", children: "Failed to load time slots" }) : dayTimeslots.length === 0 ? /* @__PURE__ */ jsx("div", { className: "col-span-2 text-center text-[#767880] py-8", children: "No available time slots for this date" }) : dayTimeslots.map((slot) => {
|
|
2182
|
+
const isAvailable = slot.status === "available";
|
|
2183
|
+
const isFull = slot.status === "full";
|
|
2184
|
+
const isSelected = selectedTimeslotId === slot.id;
|
|
2185
|
+
return /* @__PURE__ */ jsx(
|
|
2186
|
+
"button",
|
|
2187
|
+
{
|
|
2188
|
+
disabled: !isAvailable,
|
|
2189
|
+
onClick: () => {
|
|
2190
|
+
if (isAvailable) {
|
|
2191
|
+
setSelectedTimeslotId(slot.id);
|
|
2192
|
+
}
|
|
2193
|
+
},
|
|
2194
|
+
className: `
|
|
2195
|
+
rounded-[20px] w-full flex items-center justify-center gap-4 h-[76px]
|
|
2196
|
+
border text-center transition-colors
|
|
2197
|
+
${isSelected ? "border-[#3ADB67] bg-[#3ADB67] text-white cursor-pointer" : isAvailable ? "border-[#E4E5E6] hover:border-[#3ADB67] hover:bg-[#3ADB67] cursor-pointer" : "border-[#E4E5E6] bg-[#F5F5F5] text-[#BDBDBD] cursor-not-allowed"}
|
|
2198
|
+
`,
|
|
2199
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
|
|
2200
|
+
/* @__PURE__ */ jsx("div", { children: formatTimeslot(slot) }),
|
|
2201
|
+
isFull && /* @__PURE__ */ jsx("div", { className: "text-xs text-[#BDBDBD] mt-1", children: "Full" }),
|
|
2202
|
+
isAvailable && !isSelected && /* @__PURE__ */ jsxs("div", { className: "text-xs text-[#767880] mt-1", children: [
|
|
2203
|
+
slot.capacity - slot.booked_count,
|
|
2204
|
+
" spots left"
|
|
2205
|
+
] }),
|
|
2206
|
+
isAvailable && isSelected && /* @__PURE__ */ jsxs("div", { className: "text-xs text-white mt-1", children: [
|
|
2207
|
+
slot.capacity - slot.booked_count,
|
|
2208
|
+
" spots left"
|
|
2209
|
+
] })
|
|
2210
|
+
] })
|
|
2211
|
+
},
|
|
2212
|
+
slot.id
|
|
2213
|
+
);
|
|
2214
|
+
}) })
|
|
2215
|
+
] })
|
|
2216
|
+
] }),
|
|
2217
|
+
showQuestionnaire && questionnaire && /* @__PURE__ */ jsxs("div", { className: "mt-12", children: [
|
|
2218
|
+
/* @__PURE__ */ jsx("div", { className: "text-[48px] font-bold text-center mb-8", children: "Fill out Form" }),
|
|
2219
|
+
questionnaireLoading ? /* @__PURE__ */ jsx("div", { className: "text-center text-[#767880] py-8", children: "Loading questionnaire..." }) : /* @__PURE__ */ jsx(
|
|
2220
|
+
QuestionnaireForm,
|
|
2221
|
+
{
|
|
2222
|
+
questions: questionnaire.questions,
|
|
2223
|
+
loading: bookingLoading,
|
|
2224
|
+
pageData,
|
|
2225
|
+
onSubmit: async (responses) => {
|
|
2226
|
+
try {
|
|
2227
|
+
const customerName = responses.name || responses.customer_name || "";
|
|
2228
|
+
const customerEmail = responses.email || responses.customer_email || "";
|
|
2229
|
+
const customerPhone = responses.phone || responses.customer_phone_number || "";
|
|
2230
|
+
const customerPhoneCode = responses.phone_code || responses.customer_phone_code || "+1";
|
|
2231
|
+
const result = await createBooking({
|
|
2232
|
+
demoroom_code: demoRoomCode,
|
|
2233
|
+
timeslot_id: selectedTimeslotId,
|
|
2234
|
+
questionnaire_id: questionnaire.id,
|
|
2235
|
+
questionnaire_response: responses,
|
|
2236
|
+
customer_name: customerName,
|
|
2237
|
+
customer_email: customerEmail,
|
|
2238
|
+
customer_phone_code: customerPhoneCode,
|
|
2239
|
+
customer_phone_number: customerPhone
|
|
2240
|
+
});
|
|
2241
|
+
if (result && onBookingSuccess) {
|
|
2242
|
+
onBookingSuccess(result?.cancel_token);
|
|
2243
|
+
}
|
|
2244
|
+
} catch (error) {
|
|
2245
|
+
console.error("Booking creation failed:", error);
|
|
2246
|
+
}
|
|
2247
|
+
}
|
|
2248
|
+
}
|
|
2249
|
+
)
|
|
2250
|
+
] }),
|
|
2251
|
+
bookingError && /* @__PURE__ */ jsxs("div", { className: "mt-8 p-4 bg-red-50 border border-red-200 rounded-lg text-red-600 max-w-2xl mx-auto", children: [
|
|
2252
|
+
/* @__PURE__ */ jsx("p", { className: "font-medium", children: "Booking failed" }),
|
|
2253
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm mt-1", children: bookingError.message })
|
|
2254
|
+
] })
|
|
2255
|
+
] });
|
|
2256
|
+
};
|
|
2257
|
+
var DateTimePicker_default = DateTimePicker;
|
|
2258
|
+
var Navigation;
|
|
2259
|
+
var Pagination;
|
|
2260
|
+
var Autoplay;
|
|
2261
|
+
var swiperVersion = "11+";
|
|
2262
|
+
try {
|
|
2263
|
+
const modules = __require("swiper/modules");
|
|
2264
|
+
Navigation = modules.Navigation;
|
|
2265
|
+
Pagination = modules.Pagination;
|
|
2266
|
+
Autoplay = modules.Autoplay;
|
|
2267
|
+
swiperVersion = "11+";
|
|
2268
|
+
} catch (e) {
|
|
2269
|
+
try {
|
|
2270
|
+
const SwiperCore = __require("swiper");
|
|
2271
|
+
const SwiperNavigation = __require("swiper/modules/navigation");
|
|
2272
|
+
const SwiperPagination = __require("swiper/modules/pagination");
|
|
2273
|
+
const SwiperAutoplay = __require("swiper/modules/autoplay");
|
|
2274
|
+
const SwiperClass = SwiperCore.default || SwiperCore;
|
|
2275
|
+
if (SwiperClass && SwiperClass.use) {
|
|
2276
|
+
SwiperClass.use([
|
|
2277
|
+
SwiperNavigation.default || SwiperNavigation,
|
|
2278
|
+
SwiperPagination.default || SwiperPagination,
|
|
2279
|
+
SwiperAutoplay.default || SwiperAutoplay
|
|
2280
|
+
]);
|
|
2281
|
+
}
|
|
2282
|
+
Navigation = SwiperNavigation.default || SwiperNavigation;
|
|
2283
|
+
Pagination = SwiperPagination.default || SwiperPagination;
|
|
2284
|
+
Autoplay = SwiperAutoplay.default || SwiperAutoplay;
|
|
2285
|
+
swiperVersion = "8";
|
|
2286
|
+
} catch (e2) {
|
|
2287
|
+
console.warn("Failed to load swiper modules:", e2);
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
if (typeof window !== "undefined") {
|
|
2291
|
+
try {
|
|
2292
|
+
__require("swiper/css");
|
|
2293
|
+
__require("swiper/css/navigation");
|
|
2294
|
+
__require("swiper/css/pagination");
|
|
2295
|
+
} catch (e) {
|
|
2296
|
+
try {
|
|
2297
|
+
__require("swiper/swiper.min.css");
|
|
2298
|
+
__require("swiper/modules/navigation/navigation.min.css");
|
|
2299
|
+
__require("swiper/modules/pagination/pagination.min.css");
|
|
2300
|
+
} catch (e2) {
|
|
2301
|
+
console.warn("Failed to load swiper styles");
|
|
2302
|
+
}
|
|
2303
|
+
}
|
|
2304
|
+
}
|
|
2305
|
+
var defaultDescriptions = [
|
|
2306
|
+
"Norem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis.",
|
|
2307
|
+
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos."
|
|
2308
|
+
];
|
|
2309
|
+
var defaultImages = [
|
|
2310
|
+
"https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
|
|
2311
|
+
"https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638"
|
|
2312
|
+
];
|
|
2313
|
+
var DemoRoomDetail = ({
|
|
2314
|
+
apiClient,
|
|
2315
|
+
demoRoomCode,
|
|
2316
|
+
locale,
|
|
2317
|
+
title: titleProp,
|
|
2318
|
+
descriptions: descriptionsProp,
|
|
2319
|
+
devices: devicesProp,
|
|
2320
|
+
address: addressProp,
|
|
2321
|
+
mapsLink,
|
|
2322
|
+
images: imagesProp,
|
|
2323
|
+
className,
|
|
2324
|
+
...props
|
|
2325
|
+
}) => {
|
|
2326
|
+
const {
|
|
2327
|
+
data: demoRoom,
|
|
2328
|
+
loading,
|
|
2329
|
+
error
|
|
2330
|
+
} = useDemoRoom(
|
|
2331
|
+
apiClient,
|
|
2332
|
+
demoRoomCode || "",
|
|
2333
|
+
locale,
|
|
2334
|
+
{ enabled: !!apiClient && !!demoRoomCode }
|
|
2335
|
+
);
|
|
2336
|
+
const title = demoRoom?.name || titleProp || "Design District Demo Room";
|
|
2337
|
+
const descriptions = demoRoom?.description ? [demoRoom.description] : descriptionsProp || defaultDescriptions;
|
|
2338
|
+
const devices = demoRoom?.description || devicesProp || "eufyMake E1, eufyMake M5";
|
|
2339
|
+
const address = demoRoom?.address || addressProp || "1111 8th St, San Francisco, CA United States 94108";
|
|
2340
|
+
const images = demoRoom?.images && demoRoom.images.length > 0 ? demoRoom.images : imagesProp || defaultImages;
|
|
2341
|
+
const googleMapsLink = mapsLink || (() => {
|
|
2342
|
+
if (demoRoom?.latitude && demoRoom?.longitude) {
|
|
2343
|
+
return `https://www.google.com/maps/search/?api=1&query=${demoRoom.latitude},${demoRoom.longitude}`;
|
|
2344
|
+
} else {
|
|
2345
|
+
return `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(address)}`;
|
|
2346
|
+
}
|
|
2347
|
+
})();
|
|
2348
|
+
if (loading && apiClient && demoRoomCode) {
|
|
2349
|
+
return /* @__PURE__ */ jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-8 items-start", children: [
|
|
2350
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
2351
|
+
/* @__PURE__ */ jsx("div", { className: "h-12 bg-gray-200 rounded animate-pulse" }),
|
|
2352
|
+
/* @__PURE__ */ jsx("div", { className: "h-24 bg-gray-200 rounded animate-pulse" }),
|
|
2353
|
+
/* @__PURE__ */ jsx("div", { className: "h-8 bg-gray-200 rounded animate-pulse" })
|
|
2354
|
+
] }),
|
|
2355
|
+
/* @__PURE__ */ jsx("div", { className: "h-[400px] bg-gray-200 rounded-2xl animate-pulse" })
|
|
2356
|
+
] }) });
|
|
2357
|
+
}
|
|
2358
|
+
if (error && apiClient && demoRoomCode) {
|
|
2359
|
+
return /* @__PURE__ */ jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxs("div", { className: "text-center text-red-600 py-8", children: [
|
|
2360
|
+
/* @__PURE__ */ jsx("p", { className: "text-lg font-medium", children: "Failed to load demo room details" }),
|
|
2361
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm mt-2", children: error.message })
|
|
2362
|
+
] }) });
|
|
2363
|
+
}
|
|
2364
|
+
return /* @__PURE__ */ jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-8 items-start", children: [
|
|
2365
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
2366
|
+
/* @__PURE__ */ jsx("h1", { className: "text-[40px] font-bold text-gray-900 leading-tight", children: title }),
|
|
2367
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-4", children: descriptions.map((desc, index) => /* @__PURE__ */ jsx(
|
|
2368
|
+
"p",
|
|
2369
|
+
{
|
|
2370
|
+
className: "text-base text-gray-600 leading-relaxed",
|
|
2371
|
+
children: desc
|
|
2372
|
+
},
|
|
2373
|
+
index
|
|
2374
|
+
)) }),
|
|
2375
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
2376
|
+
/* @__PURE__ */ jsxs(
|
|
2377
|
+
"svg",
|
|
2378
|
+
{
|
|
2379
|
+
width: "24",
|
|
2380
|
+
height: "24",
|
|
2381
|
+
viewBox: "0 0 24 24",
|
|
2382
|
+
fill: "none",
|
|
2383
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2384
|
+
className: "flex-shrink-0 mt-0.5",
|
|
2385
|
+
children: [
|
|
2386
|
+
/* @__PURE__ */ jsx(
|
|
2387
|
+
"rect",
|
|
2388
|
+
{
|
|
2389
|
+
x: "3",
|
|
2390
|
+
y: "3",
|
|
2391
|
+
width: "18",
|
|
2392
|
+
height: "18",
|
|
2393
|
+
rx: "2",
|
|
2394
|
+
stroke: "currentColor",
|
|
2395
|
+
strokeWidth: "2"
|
|
2396
|
+
}
|
|
2397
|
+
),
|
|
2398
|
+
/* @__PURE__ */ jsx(
|
|
2399
|
+
"path",
|
|
2400
|
+
{
|
|
2401
|
+
d: "M8 10H16",
|
|
2402
|
+
stroke: "currentColor",
|
|
2403
|
+
strokeWidth: "2",
|
|
2404
|
+
strokeLinecap: "round"
|
|
2405
|
+
}
|
|
2406
|
+
),
|
|
2407
|
+
/* @__PURE__ */ jsx(
|
|
2408
|
+
"path",
|
|
2409
|
+
{
|
|
2410
|
+
d: "M8 14H16",
|
|
2411
|
+
stroke: "currentColor",
|
|
2412
|
+
strokeWidth: "2",
|
|
2413
|
+
strokeLinecap: "round"
|
|
2414
|
+
}
|
|
2415
|
+
)
|
|
2416
|
+
]
|
|
2417
|
+
}
|
|
2418
|
+
),
|
|
2419
|
+
/* @__PURE__ */ jsx("span", { className: "text-base text-gray-900", children: devices })
|
|
2420
|
+
] }),
|
|
2421
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
2422
|
+
/* @__PURE__ */ jsxs(
|
|
2423
|
+
"svg",
|
|
2424
|
+
{
|
|
2425
|
+
width: "24",
|
|
2426
|
+
height: "24",
|
|
2427
|
+
viewBox: "0 0 24 24",
|
|
2428
|
+
fill: "none",
|
|
2429
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2430
|
+
className: "flex-shrink-0 mt-0.5",
|
|
2431
|
+
children: [
|
|
2432
|
+
/* @__PURE__ */ jsx(
|
|
2433
|
+
"path",
|
|
2434
|
+
{
|
|
2435
|
+
d: "M12 2C8.13 2 5 5.13 5 9C5 14.25 12 22 12 22C12 22 19 14.25 19 9C19 5.13 15.87 2 12 2Z",
|
|
2436
|
+
stroke: "currentColor",
|
|
2437
|
+
strokeWidth: "2",
|
|
2438
|
+
strokeLinecap: "round",
|
|
2439
|
+
strokeLinejoin: "round"
|
|
2440
|
+
}
|
|
2441
|
+
),
|
|
2442
|
+
/* @__PURE__ */ jsx(
|
|
2443
|
+
"circle",
|
|
2444
|
+
{
|
|
2445
|
+
cx: "12",
|
|
2446
|
+
cy: "9",
|
|
2447
|
+
r: "2.5",
|
|
2448
|
+
stroke: "currentColor",
|
|
2449
|
+
strokeWidth: "2"
|
|
2450
|
+
}
|
|
2451
|
+
)
|
|
2452
|
+
]
|
|
2453
|
+
}
|
|
2454
|
+
),
|
|
2455
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
2456
|
+
/* @__PURE__ */ jsx("p", { className: "text-base text-gray-900", children: address }),
|
|
2457
|
+
/* @__PURE__ */ jsxs(
|
|
2458
|
+
"a",
|
|
2459
|
+
{
|
|
2460
|
+
href: googleMapsLink,
|
|
2461
|
+
target: "_blank",
|
|
2462
|
+
rel: "noopener noreferrer",
|
|
2463
|
+
className: "inline-flex items-center gap-1 text-sm text-blue-600 hover:text-blue-700 mt-1 underline",
|
|
2464
|
+
children: [
|
|
2465
|
+
"Open in Google Maps",
|
|
2466
|
+
/* @__PURE__ */ jsx(
|
|
2467
|
+
"svg",
|
|
2468
|
+
{
|
|
2469
|
+
width: "12",
|
|
2470
|
+
height: "12",
|
|
2471
|
+
viewBox: "0 0 12 12",
|
|
2472
|
+
fill: "none",
|
|
2473
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2474
|
+
children: /* @__PURE__ */ jsx(
|
|
2475
|
+
"path",
|
|
2476
|
+
{
|
|
2477
|
+
d: "M3 9L9 3M9 3H3M9 3V9",
|
|
2478
|
+
stroke: "currentColor",
|
|
2479
|
+
strokeWidth: "1.5",
|
|
2480
|
+
strokeLinecap: "round",
|
|
2481
|
+
strokeLinejoin: "round"
|
|
2482
|
+
}
|
|
2483
|
+
)
|
|
2484
|
+
}
|
|
2485
|
+
)
|
|
2486
|
+
]
|
|
2487
|
+
}
|
|
2488
|
+
)
|
|
2489
|
+
] })
|
|
2794
2490
|
] })
|
|
2795
2491
|
] }),
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2492
|
+
/* @__PURE__ */ jsx("div", { className: "relative h-[400px] rounded-2xl overflow-hidden", children: images.length > 0 ? /* @__PURE__ */ jsx(
|
|
2493
|
+
Swiper,
|
|
2494
|
+
{
|
|
2495
|
+
...swiperVersion === "11+" && Navigation && Pagination && Autoplay ? { modules: [Navigation, Pagination, Autoplay] } : {},
|
|
2496
|
+
spaceBetween: 0,
|
|
2497
|
+
slidesPerView: 1,
|
|
2498
|
+
navigation: true,
|
|
2499
|
+
pagination: { clickable: true },
|
|
2500
|
+
autoplay: {
|
|
2501
|
+
delay: 3e3,
|
|
2502
|
+
disableOnInteraction: false
|
|
2503
|
+
},
|
|
2504
|
+
loop: true,
|
|
2505
|
+
className: "h-full rounded-2xl",
|
|
2506
|
+
children: images.map((img, index) => /* @__PURE__ */ jsx(SwiperSlide, { children: /* @__PURE__ */ jsx("div", { className: "relative w-full h-full bg-gray-100", children: /* @__PURE__ */ jsx(
|
|
2507
|
+
"img",
|
|
2508
|
+
{
|
|
2509
|
+
src: img,
|
|
2510
|
+
alt: `Demo room view ${index + 1}`,
|
|
2511
|
+
className: "w-full h-full object-cover"
|
|
2512
|
+
}
|
|
2513
|
+
) }) }, index))
|
|
2514
|
+
}
|
|
2515
|
+
) : /* @__PURE__ */ jsx("div", { className: "w-full h-full bg-gradient-to-br from-gray-100 to-gray-200 flex items-center justify-center rounded-2xl", children: /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
|
|
2516
|
+
/* @__PURE__ */ jsx("div", { className: "w-16 h-16 mx-auto mb-3 rounded-full bg-white flex items-center justify-center", children: /* @__PURE__ */ jsxs(
|
|
2517
|
+
"svg",
|
|
2800
2518
|
{
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
customer_phone_number: customerPhone
|
|
2818
|
-
});
|
|
2819
|
-
if (result && onBookingSuccess) {
|
|
2820
|
-
onBookingSuccess(result?.cancel_token);
|
|
2519
|
+
width: "32",
|
|
2520
|
+
height: "32",
|
|
2521
|
+
viewBox: "0 0 32 32",
|
|
2522
|
+
fill: "none",
|
|
2523
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2524
|
+
children: [
|
|
2525
|
+
/* @__PURE__ */ jsx(
|
|
2526
|
+
"rect",
|
|
2527
|
+
{
|
|
2528
|
+
x: "4",
|
|
2529
|
+
y: "8",
|
|
2530
|
+
width: "24",
|
|
2531
|
+
height: "16",
|
|
2532
|
+
rx: "2",
|
|
2533
|
+
stroke: "currentColor",
|
|
2534
|
+
strokeWidth: "2"
|
|
2821
2535
|
}
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2536
|
+
),
|
|
2537
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "14", r: "2", fill: "currentColor" }),
|
|
2538
|
+
/* @__PURE__ */ jsx(
|
|
2539
|
+
"path",
|
|
2540
|
+
{
|
|
2541
|
+
d: "M28 20L22 14L16 20",
|
|
2542
|
+
stroke: "currentColor",
|
|
2543
|
+
strokeWidth: "2",
|
|
2544
|
+
strokeLinecap: "round",
|
|
2545
|
+
strokeLinejoin: "round"
|
|
2546
|
+
}
|
|
2547
|
+
)
|
|
2548
|
+
]
|
|
2826
2549
|
}
|
|
2827
|
-
) })
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm mt-1", children: bookingError.message })
|
|
2832
|
-
] })
|
|
2833
|
-
] });
|
|
2550
|
+
) }),
|
|
2551
|
+
/* @__PURE__ */ jsx("p", { className: "text-gray-500 text-sm", children: "Demo Room Images" })
|
|
2552
|
+
] }) }) })
|
|
2553
|
+
] }) });
|
|
2834
2554
|
};
|
|
2835
|
-
|
|
2555
|
+
DemoRoomDetail.displayName = "DemoRoomDetail";
|
|
2836
2556
|
var BookingForm = ({
|
|
2837
2557
|
layoutClassName,
|
|
2838
2558
|
className,
|
|
2839
2559
|
apiConfig,
|
|
2840
2560
|
demoRoomCode,
|
|
2561
|
+
pageData,
|
|
2841
2562
|
timezone,
|
|
2842
2563
|
handleBookingSuccess,
|
|
2843
2564
|
...props
|
|
@@ -2847,24 +2568,15 @@ var BookingForm = ({
|
|
|
2847
2568
|
[apiConfig]
|
|
2848
2569
|
);
|
|
2849
2570
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
2850
|
-
/* @__PURE__ */
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
DemoRoomDetail,
|
|
2860
|
-
{
|
|
2861
|
-
className: cn("mt-8", layoutClassName),
|
|
2862
|
-
apiClient,
|
|
2863
|
-
demoRoomCode,
|
|
2864
|
-
locale: apiConfig.locale
|
|
2865
|
-
}
|
|
2866
|
-
)
|
|
2867
|
-
] }),
|
|
2571
|
+
/* @__PURE__ */ jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsx(
|
|
2572
|
+
DemoRoomDetail,
|
|
2573
|
+
{
|
|
2574
|
+
className: cn("mt-8", layoutClassName),
|
|
2575
|
+
apiClient,
|
|
2576
|
+
demoRoomCode,
|
|
2577
|
+
locale: apiConfig.locale
|
|
2578
|
+
}
|
|
2579
|
+
) }),
|
|
2868
2580
|
/* @__PURE__ */ jsx("div", { className: "bg-[#f5f5f5]", children: /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx(
|
|
2869
2581
|
DateTimePicker_default,
|
|
2870
2582
|
{
|
|
@@ -2872,7 +2584,8 @@ var BookingForm = ({
|
|
|
2872
2584
|
demoRoomCode,
|
|
2873
2585
|
timezone,
|
|
2874
2586
|
locale: apiConfig.locale,
|
|
2875
|
-
onBookingSuccess: handleBookingSuccess
|
|
2587
|
+
onBookingSuccess: handleBookingSuccess,
|
|
2588
|
+
pageData
|
|
2876
2589
|
}
|
|
2877
2590
|
) }) })
|
|
2878
2591
|
] });
|
|
@@ -2883,17 +2596,21 @@ var BookingSuccess = ({
|
|
|
2883
2596
|
token,
|
|
2884
2597
|
apiConfig,
|
|
2885
2598
|
onScheduleAgain,
|
|
2599
|
+
onCancelSuccess,
|
|
2886
2600
|
className
|
|
2887
2601
|
}) => {
|
|
2888
|
-
const [bookingData, setBookingData] = useState(
|
|
2602
|
+
const [bookingData, setBookingData] = useState(
|
|
2603
|
+
initialBookingData || null
|
|
2604
|
+
);
|
|
2889
2605
|
const [loading, setLoading] = useState(false);
|
|
2890
|
-
const [error, setError] = useState(null);
|
|
2891
2606
|
const [isCancelled, setIsCancelled] = useState(false);
|
|
2607
|
+
const [showCancelDialog, setShowCancelDialog] = useState(false);
|
|
2608
|
+
const [cancelLoading, setCancelLoading] = useState(false);
|
|
2609
|
+
const [cancelError, setCancelError] = useState(null);
|
|
2892
2610
|
useEffect(() => {
|
|
2893
2611
|
if (token && apiConfig && !initialBookingData) {
|
|
2894
2612
|
const fetchBookingData = async () => {
|
|
2895
2613
|
setLoading(true);
|
|
2896
|
-
setError(null);
|
|
2897
2614
|
try {
|
|
2898
2615
|
const apiClient = createDemoRoomApi(apiConfig);
|
|
2899
2616
|
const booking = await apiClient.getBooking(token, apiConfig.locale);
|
|
@@ -2901,7 +2618,6 @@ var BookingSuccess = ({
|
|
|
2901
2618
|
setIsCancelled(booking.status === "cancelled");
|
|
2902
2619
|
} catch (err) {
|
|
2903
2620
|
console.error("Failed to fetch booking data:", err);
|
|
2904
|
-
setError("Failed to load booking information");
|
|
2905
2621
|
} finally {
|
|
2906
2622
|
setLoading(false);
|
|
2907
2623
|
}
|
|
@@ -2909,8 +2625,36 @@ var BookingSuccess = ({
|
|
|
2909
2625
|
fetchBookingData();
|
|
2910
2626
|
}
|
|
2911
2627
|
}, [token, apiConfig, initialBookingData]);
|
|
2628
|
+
const handleCancelAppointment = async () => {
|
|
2629
|
+
if (!token || !apiConfig) {
|
|
2630
|
+
setCancelError("Unable to cancel: Missing token or API configuration");
|
|
2631
|
+
return;
|
|
2632
|
+
}
|
|
2633
|
+
setCancelLoading(true);
|
|
2634
|
+
setCancelError(null);
|
|
2635
|
+
try {
|
|
2636
|
+
const apiClient = createDemoRoomApi(apiConfig);
|
|
2637
|
+
const cancelledBooking = await apiClient.cancelBooking(
|
|
2638
|
+
token,
|
|
2639
|
+
apiConfig.locale
|
|
2640
|
+
);
|
|
2641
|
+
if (cancelledBooking) {
|
|
2642
|
+
setBookingData(cancelledBooking);
|
|
2643
|
+
}
|
|
2644
|
+
setIsCancelled(true);
|
|
2645
|
+
setShowCancelDialog(false);
|
|
2646
|
+
if (onCancelSuccess && cancelledBooking) {
|
|
2647
|
+
onCancelSuccess(cancelledBooking);
|
|
2648
|
+
}
|
|
2649
|
+
} catch (err) {
|
|
2650
|
+
console.error("Failed to cancel booking:", err);
|
|
2651
|
+
setCancelError("Failed to cancel appointment. Please try again.");
|
|
2652
|
+
} finally {
|
|
2653
|
+
setCancelLoading(false);
|
|
2654
|
+
}
|
|
2655
|
+
};
|
|
2912
2656
|
if (loading) {
|
|
2913
|
-
return /* @__PURE__ */ jsx("div", { className: `min-h-screen
|
|
2657
|
+
return /* @__PURE__ */ jsx("div", { className: `min-h-screen py-12 px-6 ${className || ""}`, children: /* @__PURE__ */ jsx("div", { className: "max-w-3xl mx-auto", children: /* @__PURE__ */ jsxs("div", { className: "animate-pulse space-y-6", children: [
|
|
2914
2658
|
/* @__PURE__ */ jsx("div", { className: "h-8 bg-gray-200 rounded w-1/3" }),
|
|
2915
2659
|
/* @__PURE__ */ jsx("div", { className: "h-24 bg-gray-200 rounded" }),
|
|
2916
2660
|
/* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
@@ -2920,24 +2664,12 @@ var BookingSuccess = ({
|
|
|
2920
2664
|
] })
|
|
2921
2665
|
] }) }) });
|
|
2922
2666
|
}
|
|
2923
|
-
if (
|
|
2924
|
-
return
|
|
2925
|
-
/* @__PURE__ */ jsx("div", { className: "text-6xl mb-4", children: "\u274C" }),
|
|
2926
|
-
/* @__PURE__ */ jsx("h2", { className: "text-2xl font-bold text-gray-900 mb-2", children: error || "Booking Not Found" }),
|
|
2927
|
-
/* @__PURE__ */ jsx("p", { className: "text-base text-gray-600 mb-6", children: "We couldn't find your booking information." }),
|
|
2928
|
-
onScheduleAgain && /* @__PURE__ */ jsx(
|
|
2929
|
-
"button",
|
|
2930
|
-
{
|
|
2931
|
-
onClick: onScheduleAgain,
|
|
2932
|
-
className: "px-6 py-3 bg-black text-white rounded-full font-medium hover:bg-gray-800 transition-colors",
|
|
2933
|
-
children: "Schedule Again"
|
|
2934
|
-
}
|
|
2935
|
-
)
|
|
2936
|
-
] }) }) });
|
|
2667
|
+
if (!bookingData) {
|
|
2668
|
+
return null;
|
|
2937
2669
|
}
|
|
2938
|
-
return /* @__PURE__ */ jsx("div", { className: `min-h-screen
|
|
2670
|
+
return /* @__PURE__ */ jsx("div", { className: `min-h-screen py-12 px-6 ${className || ""}`, children: /* @__PURE__ */ jsxs("div", { className: "max-w-3xl mx-auto", children: [
|
|
2939
2671
|
/* @__PURE__ */ jsx("h1", { className: "text-[40px] font-bold text-gray-900 mb-8", children: "Your Appointment" }),
|
|
2940
|
-
isCancelled
|
|
2672
|
+
isCancelled && /* @__PURE__ */ jsxs("div", { className: "bg-white rounded-lg p-6 mb-8 flex items-center justify-between", children: [
|
|
2941
2673
|
/* @__PURE__ */ jsx("p", { className: "text-base text-gray-700", children: "This appointment has been canceled." }),
|
|
2942
2674
|
onScheduleAgain && /* @__PURE__ */ jsx(
|
|
2943
2675
|
"button",
|
|
@@ -2947,11 +2679,8 @@ var BookingSuccess = ({
|
|
|
2947
2679
|
children: "Schedule again"
|
|
2948
2680
|
}
|
|
2949
2681
|
)
|
|
2950
|
-
] })
|
|
2951
|
-
|
|
2952
|
-
/* @__PURE__ */ jsx("p", { className: "text-base text-gray-700", children: "Your appointment has been confirmed." })
|
|
2953
|
-
] }) }),
|
|
2954
|
-
/* @__PURE__ */ jsxs("div", { className: "space-y-8", children: [
|
|
2682
|
+
] }),
|
|
2683
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-8 bg-white px-[48px] py-[32px] rounded-lg", children: [
|
|
2955
2684
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
2956
2685
|
/* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Location" }),
|
|
2957
2686
|
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
@@ -2990,15 +2719,24 @@ var BookingSuccess = ({
|
|
|
2990
2719
|
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
2991
2720
|
/* @__PURE__ */ jsx("p", { className: "text-base text-gray-900", children: bookingData.customer_name }),
|
|
2992
2721
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-base text-gray-600", children: [
|
|
2993
|
-
/* @__PURE__ */ jsx(
|
|
2994
|
-
"
|
|
2722
|
+
/* @__PURE__ */ jsx(
|
|
2723
|
+
"svg",
|
|
2995
2724
|
{
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
2725
|
+
className: "w-5 h-5",
|
|
2726
|
+
fill: "none",
|
|
2727
|
+
viewBox: "0 0 24 24",
|
|
2728
|
+
stroke: "currentColor",
|
|
2729
|
+
children: /* @__PURE__ */ jsx(
|
|
2730
|
+
"path",
|
|
2731
|
+
{
|
|
2732
|
+
strokeLinecap: "round",
|
|
2733
|
+
strokeLinejoin: "round",
|
|
2734
|
+
strokeWidth: 2,
|
|
2735
|
+
d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"
|
|
2736
|
+
}
|
|
2737
|
+
)
|
|
3000
2738
|
}
|
|
3001
|
-
)
|
|
2739
|
+
),
|
|
3002
2740
|
bookingData.phone_code && bookingData.phone_number ? /* @__PURE__ */ jsxs("span", { children: [
|
|
3003
2741
|
bookingData.phone_code,
|
|
3004
2742
|
" ",
|
|
@@ -3006,20 +2744,148 @@ var BookingSuccess = ({
|
|
|
3006
2744
|
] }) : /* @__PURE__ */ jsx("span", { children: "No phone provided" })
|
|
3007
2745
|
] }),
|
|
3008
2746
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-base text-gray-600", children: [
|
|
3009
|
-
/* @__PURE__ */ jsx(
|
|
3010
|
-
"
|
|
2747
|
+
/* @__PURE__ */ jsx(
|
|
2748
|
+
"svg",
|
|
3011
2749
|
{
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
2750
|
+
className: "w-5 h-5",
|
|
2751
|
+
fill: "none",
|
|
2752
|
+
viewBox: "0 0 24 24",
|
|
2753
|
+
stroke: "currentColor",
|
|
2754
|
+
children: /* @__PURE__ */ jsx(
|
|
2755
|
+
"path",
|
|
2756
|
+
{
|
|
2757
|
+
strokeLinecap: "round",
|
|
2758
|
+
strokeLinejoin: "round",
|
|
2759
|
+
strokeWidth: 2,
|
|
2760
|
+
d: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"
|
|
2761
|
+
}
|
|
2762
|
+
)
|
|
3016
2763
|
}
|
|
3017
|
-
)
|
|
2764
|
+
),
|
|
3018
2765
|
/* @__PURE__ */ jsx("span", { children: bookingData.customer_email })
|
|
3019
2766
|
] })
|
|
3020
2767
|
] })
|
|
3021
2768
|
] })
|
|
3022
|
-
] })
|
|
2769
|
+
] }),
|
|
2770
|
+
!isCancelled && /* @__PURE__ */ jsxs("div", { className: "mt-[64px]", children: [
|
|
2771
|
+
/* @__PURE__ */ jsx(
|
|
2772
|
+
"button",
|
|
2773
|
+
{
|
|
2774
|
+
onClick: () => setShowCancelDialog(true),
|
|
2775
|
+
disabled: cancelLoading,
|
|
2776
|
+
className: "text-[14px] cursor-pointer w-fit rounded-full text-[#080A0F] border border-[#080A0F] px-[20px] py-[10px] leading-[1] hover:bg-gray-50 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
2777
|
+
children: "Cancel Appointment"
|
|
2778
|
+
}
|
|
2779
|
+
),
|
|
2780
|
+
cancelError && /* @__PURE__ */ jsx("p", { className: "text-sm mt-2", style: { color: "#FF4D4D" }, children: cancelError })
|
|
2781
|
+
] }),
|
|
2782
|
+
showCancelDialog && /* @__PURE__ */ jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 px-4", children: /* @__PURE__ */ jsxs("div", { className: "bg-white rounded-[24px] max-w-[400px] p-8 shadow-xl relative", children: [
|
|
2783
|
+
/* @__PURE__ */ jsx(
|
|
2784
|
+
"button",
|
|
2785
|
+
{
|
|
2786
|
+
onClick: () => setShowCancelDialog(false),
|
|
2787
|
+
disabled: cancelLoading,
|
|
2788
|
+
className: "absolute top-6 right-[30px] w-8 h-8 flex items-center justify-center text-gray-400 hover:text-gray-600 transition-colors disabled:opacity-50",
|
|
2789
|
+
"aria-label": "Close",
|
|
2790
|
+
children: /* @__PURE__ */ jsx(
|
|
2791
|
+
"svg",
|
|
2792
|
+
{
|
|
2793
|
+
width: "24",
|
|
2794
|
+
height: "24",
|
|
2795
|
+
viewBox: "0 0 24 24",
|
|
2796
|
+
fill: "none",
|
|
2797
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2798
|
+
children: /* @__PURE__ */ jsx(
|
|
2799
|
+
"path",
|
|
2800
|
+
{
|
|
2801
|
+
d: "M18 6L6 18M6 6L18 18",
|
|
2802
|
+
stroke: "currentColor",
|
|
2803
|
+
strokeWidth: "2",
|
|
2804
|
+
strokeLinecap: "round",
|
|
2805
|
+
strokeLinejoin: "round"
|
|
2806
|
+
}
|
|
2807
|
+
)
|
|
2808
|
+
}
|
|
2809
|
+
)
|
|
2810
|
+
}
|
|
2811
|
+
),
|
|
2812
|
+
/* @__PURE__ */ jsx("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ jsx("div", { className: "w-16 h-16 rounded-full bg-[#F59E0B] flex items-center justify-center", children: /* @__PURE__ */ jsx(
|
|
2813
|
+
"svg",
|
|
2814
|
+
{
|
|
2815
|
+
width: "32",
|
|
2816
|
+
height: "32",
|
|
2817
|
+
viewBox: "0 0 32 32",
|
|
2818
|
+
fill: "none",
|
|
2819
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2820
|
+
children: /* @__PURE__ */ jsx(
|
|
2821
|
+
"path",
|
|
2822
|
+
{
|
|
2823
|
+
d: "M16 10V17M16 22H16.01",
|
|
2824
|
+
stroke: "white",
|
|
2825
|
+
strokeWidth: "3",
|
|
2826
|
+
strokeLinecap: "round",
|
|
2827
|
+
strokeLinejoin: "round"
|
|
2828
|
+
}
|
|
2829
|
+
)
|
|
2830
|
+
}
|
|
2831
|
+
) }) }),
|
|
2832
|
+
/* @__PURE__ */ jsxs("div", { className: "text-center mb-8", children: [
|
|
2833
|
+
/* @__PURE__ */ jsx("h3", { className: "text-[18px] font-semibold text-gray-900 mb-2", children: "Are you sure you want to cancel?" }),
|
|
2834
|
+
/* @__PURE__ */ jsx("p", { className: "text-[14px] text-gray-600", children: "You won't be able to restore the schedule." })
|
|
2835
|
+
] }),
|
|
2836
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-3 justify-center", children: [
|
|
2837
|
+
/* @__PURE__ */ jsx(
|
|
2838
|
+
"button",
|
|
2839
|
+
{
|
|
2840
|
+
onClick: () => setShowCancelDialog(false),
|
|
2841
|
+
disabled: cancelLoading,
|
|
2842
|
+
className: "px-8 py-3 border-2 border-black rounded-full text-black font-medium hover:bg-gray-50 transition-colors disabled:opacity-50 min-w-[120px]",
|
|
2843
|
+
children: "Back"
|
|
2844
|
+
}
|
|
2845
|
+
),
|
|
2846
|
+
/* @__PURE__ */ jsx(
|
|
2847
|
+
"button",
|
|
2848
|
+
{
|
|
2849
|
+
onClick: handleCancelAppointment,
|
|
2850
|
+
disabled: cancelLoading,
|
|
2851
|
+
className: "px-8 py-3 bg-black text-white rounded-full font-medium hover:bg-gray-800 transition-colors disabled:opacity-50 flex items-center gap-2 min-w-[180px] justify-center",
|
|
2852
|
+
children: cancelLoading ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2853
|
+
/* @__PURE__ */ jsxs(
|
|
2854
|
+
"svg",
|
|
2855
|
+
{
|
|
2856
|
+
className: "animate-spin h-5 w-5",
|
|
2857
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2858
|
+
fill: "none",
|
|
2859
|
+
viewBox: "0 0 24 24",
|
|
2860
|
+
children: [
|
|
2861
|
+
/* @__PURE__ */ jsx(
|
|
2862
|
+
"circle",
|
|
2863
|
+
{
|
|
2864
|
+
className: "opacity-25",
|
|
2865
|
+
cx: "12",
|
|
2866
|
+
cy: "12",
|
|
2867
|
+
r: "10",
|
|
2868
|
+
stroke: "currentColor",
|
|
2869
|
+
strokeWidth: "4"
|
|
2870
|
+
}
|
|
2871
|
+
),
|
|
2872
|
+
/* @__PURE__ */ jsx(
|
|
2873
|
+
"path",
|
|
2874
|
+
{
|
|
2875
|
+
className: "opacity-75",
|
|
2876
|
+
fill: "currentColor",
|
|
2877
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
2878
|
+
}
|
|
2879
|
+
)
|
|
2880
|
+
]
|
|
2881
|
+
}
|
|
2882
|
+
),
|
|
2883
|
+
"Canceling..."
|
|
2884
|
+
] }) : "Cancel Appointment"
|
|
2885
|
+
}
|
|
2886
|
+
)
|
|
2887
|
+
] })
|
|
2888
|
+
] }) })
|
|
3023
2889
|
] }) });
|
|
3024
2890
|
};
|
|
3025
2891
|
|
|
@@ -3161,6 +3027,6 @@ var ThemeProvider = ({
|
|
|
3161
3027
|
return /* @__PURE__ */ jsx(ThemeContext.Provider, { value: { theme: theme2 }, children });
|
|
3162
3028
|
};
|
|
3163
3029
|
|
|
3164
|
-
export { BookingForm, BookingSuccess, DemoRoom, DemoRoomApiClient,
|
|
3030
|
+
export { BookingForm, BookingSuccess, DemoRoom, DemoRoomApiClient, ThemeProvider, cn, createDemoRoomApi, useBooking, useCancelBooking, useCreateBooking, useDemoRoom, useDemoRooms, useQuestionnaire, useTheme, useTimeslots };
|
|
3165
3031
|
//# sourceMappingURL=index.mjs.map
|
|
3166
3032
|
//# sourceMappingURL=index.mjs.map
|