@anker-in/ui 0.1.4 → 0.1.8

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/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, jsx } from 'react/jsx-runtime';
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,463 +23,66 @@ 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
182
29
  }) => {
183
- return /* @__PURE__ */ jsx("div", { className: cn("w-full"), ...props, children: /* @__PURE__ */ jsx("h2", { className: "text-[48px] font-semibold mb-12 text-[#080A0F]", children: title }) });
30
+ return /* @__PURE__ */ jsx("div", { className: cn("w-full"), ...props, children: /* @__PURE__ */ jsx("h2", { className: "text-[32px] min-l:text-[48px] font-bold 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,
458
36
  availableTime,
459
37
  address,
460
- city,
461
- state,
462
- zipCode,
463
- country = "United States",
464
38
  euifyMakeModel,
39
+ distance,
465
40
  onSchedule,
41
+ pageData = {
42
+ scheduleNow: "Schedule Now",
43
+ available: "Available",
44
+ away: "away"
45
+ },
466
46
  className,
47
+ style,
467
48
  ...props
468
49
  }) => {
469
- 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__ */ jsx("h3", { className: "text-xl font-semibold text-gray-900 mb-4", children: name }),
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
+ " ",
83
+ pageData.away
84
+ ] })
85
+ ] }),
484
86
  /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3 mb-3", children: [
485
87
  /* @__PURE__ */ jsxs(
486
88
  "svg",
@@ -535,7 +137,8 @@ var StudioCard = ({
535
137
  }
536
138
  ),
537
139
  /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs("p", { className: "text-sm text-gray-600", children: [
538
- "Available ",
140
+ pageData.available,
141
+ " ",
539
142
  availableTime
540
143
  ] }) })
541
144
  ] }),
@@ -569,7 +172,7 @@ var StudioCard = ({
569
172
  ]
570
173
  }
571
174
  ),
572
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-600", children: fullAddress }) })
175
+ /* @__PURE__ */ jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-600 break-words", children: address }) })
573
176
  ] }),
574
177
  /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3 mb-6", children: [
575
178
  /* @__PURE__ */ jsxs(
@@ -629,7 +232,7 @@ var StudioCard = ({
629
232
  "hover:bg-gray-900 hover:text-white",
630
233
  "transition-all duration-200"
631
234
  ),
632
- children: "Schedule Now"
235
+ children: pageData.scheduleNow
633
236
  }
634
237
  )
635
238
  ]
@@ -655,11 +258,18 @@ var defaultLocations = [
655
258
  var StudioMap = ({
656
259
  googleMapsApiKey,
657
260
  locations = defaultLocations,
261
+ hoveredLocationId,
658
262
  defaultCenter = { lat: 39.8283, lng: -98.5795 },
659
263
  // US center
660
264
  defaultZoom = 4,
661
265
  mapHeight = "600px",
662
266
  onSchedule,
267
+ pageData = {
268
+ apiKeyRequired: "Google Maps API Key is required",
269
+ loadingMap: "Loading map...",
270
+ scheduleNow: "Schedule Now",
271
+ available: "Available"
272
+ },
663
273
  className,
664
274
  ...props
665
275
  }) => {
@@ -758,13 +368,13 @@ var StudioMap = ({
758
368
  <svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
759
369
  <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"/>
760
370
  </svg>
761
- <span style="vertical-align: middle;">Available ${location.availableTime}</span>
371
+ <span style="vertical-align: middle;">${pageData.available} ${location.availableTime}</span>
762
372
  </div>` : ""}
763
373
  <div style="margin-bottom: 8px; color: #666;">
764
374
  <svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
765
375
  <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"/>
766
376
  </svg>
767
- <span style="vertical-align: middle;">${location.address}, ${location.city}, ${location.state} ${location.country} ${location.zipCode}</span>
377
+ <span style="vertical-align: middle;">${location.address}</span>
768
378
  </div>
769
379
  ${location.euifyMakeModel ? `<div style="margin-bottom: 12px; color: #666;">
770
380
  <svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
@@ -788,7 +398,7 @@ var StudioMap = ({
788
398
  onmouseover="this.style.background='#333'"
789
399
  onmouseout="this.style.background='#000'"
790
400
  >
791
- Schedule Now
401
+ ${pageData.scheduleNow}
792
402
  </button>
793
403
  </div>
794
404
  `;
@@ -803,7 +413,7 @@ var StudioMap = ({
803
413
  if (btn) {
804
414
  btn.addEventListener("click", () => {
805
415
  if (onSchedule) {
806
- onSchedule(location);
416
+ onSchedule(location.id);
807
417
  }
808
418
  });
809
419
  }
@@ -824,6 +434,82 @@ var StudioMap = ({
824
434
  googleMapRef.current.fitBounds(bounds);
825
435
  }
826
436
  }, [isLoaded, locations, onSchedule]);
437
+ React2.useEffect(() => {
438
+ if (!isLoaded || !googleMapRef.current || !hoveredLocationId) {
439
+ if (!hoveredLocationId && infoWindowRef.current) {
440
+ infoWindowRef.current.close();
441
+ }
442
+ return;
443
+ }
444
+ const location = locations.find((loc) => loc.id === hoveredLocationId);
445
+ const markerIndex = locations.findIndex(
446
+ (loc) => loc.id === hoveredLocationId
447
+ );
448
+ const marker = markersRef.current[markerIndex];
449
+ if (location && marker) {
450
+ const content = `
451
+ <div style="padding: 16px; max-width: 300px; font-family: system-ui, sans-serif;">
452
+ <h3 style="margin: 0 0 12px 0; font-size: 18px; font-weight: 600;">${location.name}</h3>
453
+ ${location.availableTime ? `<div style="margin-bottom: 8px; color: #666;">
454
+ <svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
455
+ <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"/>
456
+ </svg>
457
+ <span style="vertical-align: middle;">${pageData.available} ${location.availableTime}</span>
458
+ </div>` : ""}
459
+ <div style="margin-bottom: 8px; color: #666;">
460
+ <svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
461
+ <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"/>
462
+ </svg>
463
+ <span style="vertical-align: middle;">${location.address}</span>
464
+ </div>
465
+ ${location.euifyMakeModel ? `<div style="margin-bottom: 12px; color: #666;">
466
+ <svg style="display: inline-block; width: 16px; height: 16px; margin-right: 4px; vertical-align: middle;" fill="currentColor" viewBox="0 0 20 20">
467
+ <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"/>
468
+ </svg>
469
+ <span style="vertical-align: middle;">${location.euifyMakeModel}</span>
470
+ </div>` : ""}
471
+ <button
472
+ id="schedule-btn-hover-${location.id}"
473
+ style="
474
+ width: 100%;
475
+ padding: 10px 16px;
476
+ background: #000;
477
+ color: #fff;
478
+ border: none;
479
+ border-radius: 6px;
480
+ font-weight: 500;
481
+ cursor: pointer;
482
+ font-size: 14px;
483
+ "
484
+ onmouseover="this.style.background='#333'"
485
+ onmouseout="this.style.background='#000'"
486
+ >
487
+ ${pageData.scheduleNow}
488
+ </button>
489
+ </div>
490
+ `;
491
+ if (infoWindowRef.current) {
492
+ infoWindowRef.current.setContent(content);
493
+ infoWindowRef.current.open(googleMapRef.current, marker);
494
+ google.maps.event.addListenerOnce(
495
+ infoWindowRef.current,
496
+ "domready",
497
+ () => {
498
+ const btn = document.getElementById(
499
+ `schedule-btn-hover-${location.id}`
500
+ );
501
+ if (btn) {
502
+ btn.addEventListener("click", () => {
503
+ if (onSchedule) {
504
+ onSchedule(location.id);
505
+ }
506
+ });
507
+ }
508
+ }
509
+ );
510
+ }
511
+ }
512
+ }, [hoveredLocationId, isLoaded, locations, onSchedule]);
827
513
  if (!googleMapsApiKey) {
828
514
  return /* @__PURE__ */ jsx(
829
515
  "div",
@@ -834,7 +520,7 @@ var StudioMap = ({
834
520
  ),
835
521
  style: { height: mapHeight },
836
522
  ...props,
837
- children: /* @__PURE__ */ jsx("p", { className: "text-gray-600", children: "Google Maps API Key is required" })
523
+ children: /* @__PURE__ */ jsx("p", { className: "text-gray-600", children: pageData.apiKeyRequired })
838
524
  }
839
525
  );
840
526
  }
@@ -847,7 +533,7 @@ var StudioMap = ({
847
533
  /* @__PURE__ */ jsx("div", { ref: mapRef, style: { height: mapHeight } }),
848
534
  !isLoaded && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-gray-100", children: /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
849
535
  /* @__PURE__ */ jsx("div", { className: "inline-block animate-spin rounded-full h-8 w-8 border-4 border-gray-300 border-t-gray-900 mb-2" }),
850
- /* @__PURE__ */ jsx("p", { className: "text-gray-600", children: "Loading map..." })
536
+ /* @__PURE__ */ jsx("p", { className: "text-gray-600", children: pageData.loadingMap })
851
537
  ] }) })
852
538
  ]
853
539
  }
@@ -976,7 +662,14 @@ function useQuestionnaire(client, code, questionnaire_id, locale, options) {
976
662
  });
977
663
  const enabled = options?.enabled !== false;
978
664
  useEffect(() => {
979
- if (!enabled || !code || !questionnaire_id) return;
665
+ if (!enabled || !code || !questionnaire_id) {
666
+ setState({
667
+ data: null,
668
+ loading: false,
669
+ error: null
670
+ });
671
+ return;
672
+ }
980
673
  let cancelled = false;
981
674
  const fetchData = async () => {
982
675
  setState((prev) => ({ ...prev, loading: true, error: null }));
@@ -1132,27 +825,6 @@ var AntdMobileIsolated = ({
1132
825
  AntdMobileIsolated.displayName = "AntdMobileIsolated";
1133
826
 
1134
827
  // src/components/DemoRoom/utils/addressParser.ts
1135
- function parseAddress(address) {
1136
- const parts = address.split(",").map((part) => part.trim());
1137
- let country = "United States";
1138
- let state = "";
1139
- let city = "";
1140
- if (parts.length >= 3) {
1141
- city = parts[1] || "";
1142
- state = parts[2]?.split(" ")[0] || "";
1143
- country = parts[3] || country;
1144
- } else if (parts.length === 2) {
1145
- city = parts[0] || "";
1146
- state = parts[1]?.split(" ")[0] || "";
1147
- } else if (parts.length === 1) {
1148
- city = parts[0] || "";
1149
- }
1150
- return {
1151
- country: country.trim(),
1152
- state: state.trim(),
1153
- city: city.trim()
1154
- };
1155
- }
1156
828
  function groupByAlphabet(items) {
1157
829
  const groups = /* @__PURE__ */ new Map();
1158
830
  items.forEach((item) => {
@@ -1179,7 +851,15 @@ var LocationFilter = ({
1179
851
  locations,
1180
852
  onSelect,
1181
853
  visible = false,
1182
- onClose
854
+ onClose,
855
+ pageData = {
856
+ allLocations: "All Locations",
857
+ clear: "Clear",
858
+ country: "Country",
859
+ state: "State",
860
+ city: "City",
861
+ noStudiosFound: "No studios found in this location"
862
+ }
1183
863
  }) => {
1184
864
  const [currentLevel, setCurrentLevel] = useState("country");
1185
865
  const [selectedCountry, setSelectedCountry] = useState();
@@ -1190,7 +870,7 @@ var LocationFilter = ({
1190
870
  const states = /* @__PURE__ */ new Map();
1191
871
  const cities = /* @__PURE__ */ new Map();
1192
872
  locations.forEach((location) => {
1193
- const { country, state, city } = parseAddress(location.address);
873
+ const { country, state, city } = location;
1194
874
  if (country) {
1195
875
  const existing = countries.get(country);
1196
876
  countries.set(country, {
@@ -1233,9 +913,7 @@ var LocationFilter = ({
1233
913
  items = locationData.countries;
1234
914
  break;
1235
915
  case "state":
1236
- items = selectedCountry ? locationData.states.filter(
1237
- (s) => s.parentCode === selectedCountry
1238
- ) : [];
916
+ items = selectedCountry ? locationData.states.filter((s) => s.parentCode === selectedCountry) : [];
1239
917
  break;
1240
918
  case "city":
1241
919
  items = selectedState ? locationData.cities.filter((c) => c.parentCode === selectedState) : [];
@@ -1252,6 +930,7 @@ var LocationFilter = ({
1252
930
  () => groupByAlphabet(filteredItems),
1253
931
  [filteredItems]
1254
932
  );
933
+ const showIndexBar = filteredItems.length >= 10;
1255
934
  const handleItemClick = (item) => {
1256
935
  if (currentLevel === "country") {
1257
936
  setSelectedCountry(item.code);
@@ -1295,42 +974,30 @@ var LocationFilter = ({
1295
974
  style: { background: "#F8F8F8" },
1296
975
  className: "rounded-[12px] rounded-b-none h-[72px] font-bold text-[14px] flex flex-col",
1297
976
  children: [
1298
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-[20px] pt-[12px] pb-[8px]", children: [
1299
- /* @__PURE__ */ jsx(
1300
- "input",
1301
- {
1302
- type: "text",
1303
- placeholder: "Please enter the search city",
1304
- value: searchQuery,
1305
- onChange: (e) => setSearchQuery(e.target.value),
1306
- className: "flex-1 h-[32px] px-[12px] rounded-[6px] border border-[#E4E5E6] text-[14px] outline-none focus:border-[#2E8B57]"
1307
- }
1308
- ),
1309
- /* @__PURE__ */ jsx(
1310
- "button",
1311
- {
1312
- onClick: onClose,
1313
- className: "ml-[12px] w-[24px] h-[24px] flex items-center justify-center",
1314
- children: /* @__PURE__ */ jsx(
1315
- "svg",
1316
- {
1317
- xmlns: "http://www.w3.org/2000/svg",
1318
- width: "24",
1319
- height: "24",
1320
- viewBox: "0 0 24 24",
1321
- fill: "none",
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
- ] }),
977
+ /* @__PURE__ */ jsx("div", { className: "flex items-center justify-end px-[20px] pt-[12px] pb-[8px]", children: /* @__PURE__ */ jsx(
978
+ "button",
979
+ {
980
+ onClick: onClose,
981
+ className: "ml-[12px] w-[24px] h-[24px] flex items-center justify-end",
982
+ children: /* @__PURE__ */ jsx(
983
+ "svg",
984
+ {
985
+ xmlns: "http://www.w3.org/2000/svg",
986
+ width: "24",
987
+ height: "24",
988
+ viewBox: "0 0 24 24",
989
+ fill: "none",
990
+ children: /* @__PURE__ */ jsx(
991
+ "path",
992
+ {
993
+ 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",
994
+ fill: "#1D1D1F"
995
+ }
996
+ )
997
+ }
998
+ )
999
+ }
1000
+ ) }),
1334
1001
  /* @__PURE__ */ jsxs("div", { className: "flex items-center px-[20px] gap-[16px] pb-[8px]", children: [
1335
1002
  /* @__PURE__ */ jsx(
1336
1003
  "button",
@@ -1340,7 +1007,7 @@ var LocationFilter = ({
1340
1007
  "pb-[4px] transition-colors",
1341
1008
  currentLevel === "country" ? "text-[#1D1D1F] border-b-2 border-[#2E8B57]" : "text-[#767880]"
1342
1009
  ),
1343
- children: "Country"
1010
+ children: pageData.country
1344
1011
  }
1345
1012
  ),
1346
1013
  /* @__PURE__ */ jsx(
@@ -1353,7 +1020,7 @@ var LocationFilter = ({
1353
1020
  currentLevel === "state" ? "text-[#1D1D1F] border-b-2 border-[#2E8B57]" : "text-[#767880]",
1354
1021
  !selectedCountry && "opacity-50 cursor-not-allowed"
1355
1022
  ),
1356
- children: "State"
1023
+ children: pageData.state
1357
1024
  }
1358
1025
  ),
1359
1026
  /* @__PURE__ */ jsx(
@@ -1366,55 +1033,69 @@ var LocationFilter = ({
1366
1033
  currentLevel === "city" ? "text-[#1D1D1F] border-b-2 border-[#2E8B57]" : "text-[#767880]",
1367
1034
  !selectedState && "opacity-50 cursor-not-allowed"
1368
1035
  ),
1369
- children: "City"
1036
+ children: pageData.city
1370
1037
  }
1371
1038
  )
1372
1039
  ] })
1373
1040
  ]
1374
1041
  }
1375
1042
  ),
1376
- /* @__PURE__ */ jsx(AntdMobileIsolated, { style: { height: "calc(100% - 72px)" }, children: /* @__PURE__ */ jsx(IndexBar, { style: { height: "100%" }, children: groupedItems.map((group) => {
1043
+ /* @__PURE__ */ jsx(AntdMobileIsolated, { style: { height: "calc(100% - 72px)" }, children: showIndexBar ? /* @__PURE__ */ jsx(IndexBar, { style: { height: "100%" }, children: groupedItems.map((group) => {
1377
1044
  const { title, items } = group;
1378
1045
  return /* @__PURE__ */ jsx(IndexBar.Panel, { index: title, title, children: /* @__PURE__ */ jsx(List, { children: items.map((item) => /* @__PURE__ */ jsx(
1379
1046
  List.Item,
1380
1047
  {
1381
- clickable: true,
1382
1048
  onClick: () => handleItemClick(item),
1383
- extra: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-[8px]", children: [
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
- ] }),
1049
+ style: { cursor: "pointer" },
1403
1050
  children: item.name
1404
1051
  },
1405
1052
  item.code
1406
1053
  )) }) }, title);
1407
- }) }) })
1054
+ }) }) : /* @__PURE__ */ jsx("div", { style: { height: "100%", overflow: "auto" }, children: /* @__PURE__ */ jsx(List, { children: filteredItems.map((item) => /* @__PURE__ */ jsx(
1055
+ List.Item,
1056
+ {
1057
+ onClick: () => handleItemClick(item),
1058
+ style: { cursor: "pointer" },
1059
+ children: item.name
1060
+ },
1061
+ item.code
1062
+ )) }) }) })
1408
1063
  ]
1409
1064
  }
1410
1065
  );
1411
1066
  };
1412
1067
  LocationFilter.displayName = "LocationFilter";
1413
- var defaultStudioLocations = [
1414
- {
1068
+ var defaultPageData = {
1069
+ title: "Find a Studio Near You",
1070
+ loadingText: "Loading demo rooms...",
1071
+ errorTitle: "Failed to load demo rooms",
1072
+ locationFilter: {
1073
+ allLocations: "All Locations",
1074
+ clear: "Clear",
1075
+ country: "Country",
1076
+ state: "State",
1077
+ city: "City",
1078
+ noStudiosFound: "No studios found in this location"
1079
+ },
1080
+ studioCard: {
1081
+ scheduleNow: "Schedule Now",
1082
+ available: "Available",
1083
+ away: "away"
1084
+ },
1085
+ map: {
1086
+ apiKeyRequired: "Google Maps API Key is required",
1087
+ loadingMap: "Loading map...",
1088
+ scheduleNow: "Schedule Now",
1089
+ available: "Available"
1090
+ },
1091
+ defaultCountry: "United States",
1092
+ noAvailableTime: "No available time"
1093
+ };
1094
+ var defaultStudioLocations = [
1095
+ {
1415
1096
  id: "1",
1416
1097
  name: "Design District Demo Room",
1417
- address: "111 8th St",
1098
+ address: "111 8th St, San Francisco, CA, United States",
1418
1099
  city: "San Francisco",
1419
1100
  state: "CA",
1420
1101
  zipCode: "94108",
@@ -1427,7 +1108,7 @@ var defaultStudioLocations = [
1427
1108
  {
1428
1109
  id: "2",
1429
1110
  name: "Brooklyn Creative Studio",
1430
- address: "456 Broadway",
1111
+ address: "456 Broadway, Brooklyn, NY, United States",
1431
1112
  city: "Brooklyn",
1432
1113
  state: "NY",
1433
1114
  zipCode: "11211",
@@ -1440,7 +1121,7 @@ var defaultStudioLocations = [
1440
1121
  {
1441
1122
  id: "3",
1442
1123
  name: "Austin Innovation Hub",
1443
- address: "789 Tech Blvd",
1124
+ address: "789 Tech Blvd, Austin, TX, United States",
1444
1125
  city: "Austin",
1445
1126
  state: "TX",
1446
1127
  zipCode: "78701",
@@ -1453,7 +1134,7 @@ var defaultStudioLocations = [
1453
1134
  {
1454
1135
  id: "4",
1455
1136
  name: "Seattle Maker Space",
1456
- address: "321 Pine St",
1137
+ address: "321 Pine St, Seattle, WA, United States",
1457
1138
  city: "Seattle",
1458
1139
  state: "WA",
1459
1140
  zipCode: "98101",
@@ -1466,7 +1147,7 @@ var defaultStudioLocations = [
1466
1147
  {
1467
1148
  id: "5",
1468
1149
  name: "Chicago Design Center",
1469
- address: "654 Michigan Ave",
1150
+ address: "654 Michigan Ave, Chicago, IL, United States",
1470
1151
  city: "Chicago",
1471
1152
  state: "IL",
1472
1153
  zipCode: "60611",
@@ -1479,7 +1160,7 @@ var defaultStudioLocations = [
1479
1160
  {
1480
1161
  id: "6",
1481
1162
  name: "Miami Beach Studio",
1482
- address: "987 Ocean Drive",
1163
+ address: "987 Ocean Drive, Miami Beach, FL, United States",
1483
1164
  city: "Miami Beach",
1484
1165
  state: "FL",
1485
1166
  zipCode: "33139",
@@ -1492,7 +1173,7 @@ var defaultStudioLocations = [
1492
1173
  {
1493
1174
  id: "7",
1494
1175
  name: "Denver Mountain Studio",
1495
- address: "147 16th St",
1176
+ address: "147 16th St, Denver, CO, United States",
1496
1177
  city: "Denver",
1497
1178
  state: "CO",
1498
1179
  zipCode: "80202",
@@ -1505,7 +1186,7 @@ var defaultStudioLocations = [
1505
1186
  {
1506
1187
  id: "8",
1507
1188
  name: "Los Angeles Creative Lab",
1508
- address: "258 Main St",
1189
+ address: "258 Main St, Los Angeles, CA, United States",
1509
1190
  city: "Los Angeles",
1510
1191
  state: "CA",
1511
1192
  zipCode: "90012",
@@ -1523,10 +1204,25 @@ var RoomsList = ({
1523
1204
  teamCode,
1524
1205
  brandWebsite,
1525
1206
  onSchedule,
1207
+ pageData,
1526
1208
  ...props
1527
1209
  }) => {
1210
+ const mergedPageData = useMemo(
1211
+ () => ({
1212
+ ...defaultPageData,
1213
+ ...pageData,
1214
+ locationFilter: {
1215
+ ...defaultPageData.locationFilter,
1216
+ ...pageData?.locationFilter
1217
+ },
1218
+ studioCard: { ...defaultPageData.studioCard, ...pageData?.studioCard },
1219
+ map: { ...defaultPageData.map, ...pageData?.map }
1220
+ }),
1221
+ [pageData]
1222
+ );
1528
1223
  const [showLocationFilter, setShowLocationFilter] = useState(false);
1529
1224
  const [selectedLocation, setSelectedLocation] = useState();
1225
+ const [hoveredRoomId, setHoveredRoomId] = useState(null);
1530
1226
  const {
1531
1227
  data: demoRooms,
1532
1228
  loading,
@@ -1539,37 +1235,25 @@ var RoomsList = ({
1539
1235
  const studioLocations = useMemo(() => {
1540
1236
  if (!demoRooms) return defaultStudioLocations;
1541
1237
  return demoRooms.map((room) => {
1542
- const timeslots = [
1543
- {
1544
- id: 130,
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");
1561
- const { country, state, city } = parseAddress(room.address);
1238
+ const nextAvailableTimeslot = room?.timeslots?.find(
1239
+ (slot) => slot.status === "available"
1240
+ );
1241
+ const country = room.location?.country || mergedPageData.defaultCountry;
1242
+ const state = room.location?.state || "";
1243
+ const city = room.location?.city || "";
1244
+ const addressParts = [room.address, city, state, country].filter(Boolean);
1245
+ const fullAddress = addressParts.join(", ");
1562
1246
  return {
1563
1247
  id: room.code,
1564
1248
  name: room.name,
1565
- address: room.address,
1249
+ address: fullAddress,
1566
1250
  city,
1567
1251
  state,
1568
1252
  zipCode: "",
1569
1253
  country,
1570
1254
  lat: Number(room.latitude) || 34.0522,
1571
1255
  lng: Number(room.longitude) || -118.2437,
1572
- availableTime: nextAvailableTimeslot ? `${nextAvailableTimeslot.start_time}` : "No available time",
1256
+ availableTime: nextAvailableTimeslot ? `${nextAvailableTimeslot.start_time}` : mergedPageData.noAvailableTime,
1573
1257
  euifyMakeModel: room?.description
1574
1258
  };
1575
1259
  });
@@ -1577,25 +1261,24 @@ var RoomsList = ({
1577
1261
  const filteredStudioLocations = useMemo(() => {
1578
1262
  if (!selectedLocation) return studioLocations;
1579
1263
  return studioLocations.filter((location) => {
1580
- const { country, state, city } = parseAddress(location.address);
1581
1264
  if (selectedLocation.city) {
1582
- return country === selectedLocation.country && state === selectedLocation.state && city === selectedLocation.city;
1265
+ return location.country === selectedLocation.country && location.state === selectedLocation.state && location.city === selectedLocation.city;
1583
1266
  }
1584
1267
  if (selectedLocation.state) {
1585
- return country === selectedLocation.country && state === selectedLocation.state;
1268
+ return location.country === selectedLocation.country && location.state === selectedLocation.state;
1586
1269
  }
1587
1270
  if (selectedLocation.country) {
1588
- return country === selectedLocation.country;
1271
+ return location.country === selectedLocation.country;
1589
1272
  }
1590
1273
  return true;
1591
1274
  });
1592
1275
  }, [studioLocations, selectedLocation]);
1593
1276
  const getSelectedLocationName = () => {
1594
- if (!selectedLocation) return "All Locations";
1277
+ if (!selectedLocation) return mergedPageData.locationFilter.allLocations;
1595
1278
  if (selectedLocation.city) return selectedLocation.city;
1596
1279
  if (selectedLocation.state) return selectedLocation.state;
1597
1280
  if (selectedLocation.country) return selectedLocation.country;
1598
- return "All Locations";
1281
+ return mergedPageData.locationFilter.allLocations;
1599
1282
  };
1600
1283
  const handleLocationSelect = (selection) => {
1601
1284
  setSelectedLocation(selection);
@@ -1606,20 +1289,20 @@ var RoomsList = ({
1606
1289
  };
1607
1290
  console.log(filteredStudioLocations);
1608
1291
  return /* @__PURE__ */ jsxs("div", { className, ...props, children: [
1609
- /* @__PURE__ */ jsx(Title, { title: "Find a Studio Near You" }),
1610
- 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 text-red-600", children: [
1612
- /* @__PURE__ */ jsx("div", { className: "text-lg font-medium", children: "Failed to load demo rooms" }),
1292
+ /* @__PURE__ */ jsx(Title, { title: mergedPageData.title }),
1293
+ 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: mergedPageData.loadingText }) }) }),
1294
+ error && /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-[794px]", children: /* @__PURE__ */ jsxs("div", { className: "text-center", style: { color: "#FF4D4D" }, children: [
1295
+ /* @__PURE__ */ jsx("div", { className: "text-lg font-medium", children: mergedPageData.errorTitle }),
1613
1296
  /* @__PURE__ */ jsx("div", { className: "text-sm mt-2", children: error.message })
1614
1297
  ] }) }),
1615
- !loading && !error && /* @__PURE__ */ jsxs("div", { className: "flex h-[794px] overflow-auto gap-4", children: [
1298
+ !loading && !error && /* @__PURE__ */ jsxs("div", { className: "flex h-[794px] gap-4", children: [
1616
1299
  /* @__PURE__ */ jsxs(
1617
1300
  "div",
1618
1301
  {
1619
- className: "flex-none relative w-[420px]",
1302
+ className: "flex-none relative w-[420px] l:!w-full",
1620
1303
  style: { height: "794px" },
1621
1304
  children: [
1622
- /* @__PURE__ */ jsxs("div", { className: "rounded-[12px] items-center h-[72px] mb-4 font-bold text-[16px] gap-10 flex bg-white border border-[#E4E5E6] px-[20px] py-[16px]", children: [
1305
+ /* @__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
1306
  /* @__PURE__ */ jsxs(
1624
1307
  "button",
1625
1308
  {
@@ -1652,7 +1335,7 @@ var RoomsList = ({
1652
1335
  {
1653
1336
  onClick: handleClearFilter,
1654
1337
  className: "ml-auto text-[14px] text-[#2E8B57] hover:underline",
1655
- children: "Clear"
1338
+ children: mergedPageData.locationFilter.clear
1656
1339
  }
1657
1340
  ),
1658
1341
  /* @__PURE__ */ jsxs("div", { className: "flex text-[#767880] cursor-not-allowed", children: [
@@ -1675,13 +1358,13 @@ var RoomsList = ({
1675
1358
  }
1676
1359
  )
1677
1360
  ] })
1678
- ] }),
1361
+ ] }) }),
1679
1362
  /* @__PURE__ */ jsx(
1680
1363
  "div",
1681
1364
  {
1682
1365
  style: { maxHeight: "706px", overflow: "auto" },
1683
1366
  className: "rounded-[12px] bg-white border border-[#E4E5E6]",
1684
- children: filteredStudioLocations.length === 0 ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-[200px] text-[#767880]", children: "No studios found in this location" }) : filteredStudioLocations.map((item) => {
1367
+ children: filteredStudioLocations.length === 0 ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-[200px] text-[#767880]", children: mergedPageData.locationFilter.noStudiosFound }) : filteredStudioLocations.map((item) => {
1685
1368
  return /* @__PURE__ */ jsx(
1686
1369
  StudioCard,
1687
1370
  {
@@ -1693,7 +1376,10 @@ var RoomsList = ({
1693
1376
  state: item?.state,
1694
1377
  zipCode: item?.zipCode,
1695
1378
  euifyMakeModel: item?.euifyMakeModel || "",
1696
- onSchedule
1379
+ onSchedule,
1380
+ onMouseEnter: () => setHoveredRoomId(item.id),
1381
+ onMouseLeave: () => setHoveredRoomId(null),
1382
+ pageData: mergedPageData.studioCard
1697
1383
  },
1698
1384
  item.id
1699
1385
  );
@@ -1704,26 +1390,29 @@ var RoomsList = ({
1704
1390
  LocationFilter,
1705
1391
  {
1706
1392
  locations: studioLocations.map((loc) => ({
1707
- address: loc.address,
1708
- id: loc.id
1393
+ id: loc.id,
1394
+ country: loc.country,
1395
+ state: loc.state,
1396
+ city: loc.city
1709
1397
  })),
1710
1398
  visible: showLocationFilter,
1711
1399
  onSelect: handleLocationSelect,
1712
- onClose: () => setShowLocationFilter(false)
1400
+ onClose: () => setShowLocationFilter(false),
1401
+ pageData: mergedPageData.locationFilter
1713
1402
  }
1714
1403
  )
1715
1404
  ]
1716
1405
  }
1717
1406
  ),
1718
- googleMapsApiKey && /* @__PURE__ */ jsx("div", { className: cn("flex-1"), children: /* @__PURE__ */ jsx(
1407
+ googleMapsApiKey && /* @__PURE__ */ jsx("div", { className: cn("flex-1 l:!hidden"), children: /* @__PURE__ */ jsx(
1719
1408
  StudioMap,
1720
1409
  {
1721
1410
  googleMapsApiKey,
1722
1411
  locations: filteredStudioLocations,
1723
- onSchedule: () => {
1724
- console.log(111);
1725
- },
1726
- mapHeight: "794px"
1412
+ hoveredLocationId: hoveredRoomId,
1413
+ onSchedule,
1414
+ mapHeight: "794px",
1415
+ pageData: mergedPageData.map
1727
1416
  }
1728
1417
  ) })
1729
1418
  ] })
@@ -1899,436 +1588,160 @@ function createDemoRoomApi(config) {
1899
1588
  }
1900
1589
  var DemoRoom = ({
1901
1590
  className,
1902
- layoutClassName = "w-safe11",
1591
+ layoutClassName,
1903
1592
  googleMapsApiKey,
1904
1593
  apiConfig,
1905
1594
  teamCode,
1906
1595
  brandWebsite,
1907
1596
  onSchedule,
1597
+ pageData,
1908
1598
  ...props
1909
1599
  }) => {
1910
1600
  const apiClient = useMemo(
1911
1601
  () => createDemoRoomApi(apiConfig),
1912
1602
  [apiConfig]
1913
1603
  );
1914
- return /* @__PURE__ */ jsxs("div", { className: cn(className), ...props, children: [
1915
- /* @__PURE__ */ jsx(Banner, { className: layoutClassName }),
1916
- /* @__PURE__ */ jsx(
1917
- BreadCrumbs,
1918
- {
1919
- className: layoutClassName,
1920
- items: [{ label: "Home", link: "/" }, { label: "Demo Room" }]
1921
- }
1922
- ),
1923
- /* @__PURE__ */ jsx(HelpNav, {}),
1924
- /* @__PURE__ */ jsx(UpcomingEvents, { className: layoutClassName }),
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
- ] });
1604
+ return /* @__PURE__ */ jsx("div", { className: cn(className), ...props, children: /* @__PURE__ */ jsx(
1605
+ RoomsList,
1606
+ {
1607
+ className: layoutClassName,
1608
+ googleMapsApiKey,
1609
+ apiClient,
1610
+ teamCode,
1611
+ brandWebsite,
1612
+ onSchedule,
1613
+ pageData
1614
+ }
1615
+ ) });
1938
1616
  };
1939
1617
  DemoRoom.displayName = "DemoRoom";
1940
- var Navigation;
1941
- var Pagination;
1942
- var Autoplay;
1943
- var swiperVersion = "11+";
1944
- try {
1945
- const modules = __require("swiper/modules");
1946
- Navigation = modules.Navigation;
1947
- Pagination = modules.Pagination;
1948
- Autoplay = modules.Autoplay;
1949
- swiperVersion = "11+";
1950
- } catch (e) {
1951
- try {
1952
- const SwiperCore = __require("swiper");
1953
- const SwiperNavigation = __require("swiper/modules/navigation");
1954
- const SwiperPagination = __require("swiper/modules/pagination");
1955
- const SwiperAutoplay = __require("swiper/modules/autoplay");
1956
- const SwiperClass = SwiperCore.default || SwiperCore;
1957
- if (SwiperClass && SwiperClass.use) {
1958
- SwiperClass.use([
1959
- SwiperNavigation.default || SwiperNavigation,
1960
- SwiperPagination.default || SwiperPagination,
1961
- SwiperAutoplay.default || SwiperAutoplay
1962
- ]);
1618
+ var QuestionnaireForm = ({
1619
+ questions,
1620
+ onSubmit,
1621
+ pageData,
1622
+ selectedTimeslotId,
1623
+ loading = false,
1624
+ className
1625
+ }) => {
1626
+ const [responses, setResponses] = useState({});
1627
+ const [errors, setErrors] = useState({});
1628
+ const [agreements, setAgreements] = useState({});
1629
+ const [agreementError, setAgreementError] = useState("");
1630
+ const getQuestionId = (question) => {
1631
+ return question.id || question.key || "";
1632
+ };
1633
+ const handleChange = (questionId, value) => {
1634
+ setResponses((prev) => ({
1635
+ ...prev,
1636
+ [questionId]: value
1637
+ }));
1638
+ if (errors[questionId]) {
1639
+ setErrors((prev) => {
1640
+ const newErrors = { ...prev };
1641
+ delete newErrors[questionId];
1642
+ return newErrors;
1643
+ });
1963
1644
  }
1964
- Navigation = SwiperNavigation.default || SwiperNavigation;
1965
- Pagination = SwiperPagination.default || SwiperPagination;
1966
- Autoplay = SwiperAutoplay.default || SwiperAutoplay;
1967
- swiperVersion = "8";
1968
- } catch (e2) {
1969
- console.warn("Failed to load swiper modules:", e2);
1970
- }
1971
- }
1972
- if (typeof window !== "undefined") {
1973
- try {
1974
- __require("swiper/css");
1975
- __require("swiper/css/navigation");
1976
- __require("swiper/css/pagination");
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");
1645
+ };
1646
+ const handleCheckboxChange = (questionId, optionValue, checked) => {
1647
+ const currentValues = responses[questionId] || [];
1648
+ const newValues = checked ? [...currentValues, optionValue] : currentValues.filter((v) => v !== optionValue);
1649
+ handleChange(questionId, newValues);
1650
+ };
1651
+ const handleAgreementChange = (index, checked) => {
1652
+ setAgreements((prev) => ({
1653
+ ...prev,
1654
+ [index]: checked
1655
+ }));
1656
+ if (checked && agreementError) {
1657
+ setAgreementError("");
1984
1658
  }
1985
- }
1986
- }
1987
- var defaultDescriptions = [
1988
- "Norem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis.",
1989
- "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."
1990
- ];
1991
- var defaultImages = [
1992
- "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
1993
- "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638"
1994
- ];
1995
- var DemoRoomDetail = ({
1996
- apiClient,
1997
- demoRoomCode,
1998
- locale,
1999
- title: titleProp,
2000
- descriptions: descriptionsProp,
2001
- devices: devicesProp,
2002
- address: addressProp,
2003
- mapsLink,
2004
- images: imagesProp,
2005
- className,
2006
- ...props
2007
- }) => {
2008
- const {
2009
- data: demoRoom,
2010
- loading,
2011
- error
2012
- } = useDemoRoom(
2013
- apiClient,
2014
- demoRoomCode || "",
2015
- locale,
2016
- { enabled: !!apiClient && !!demoRoomCode }
2017
- );
2018
- const title = demoRoom?.name || titleProp || "Design District Demo Room";
2019
- const descriptions = demoRoom?.description ? [demoRoom.description] : descriptionsProp || defaultDescriptions;
2020
- const devices = demoRoom?.description || devicesProp || "eufyMake E1, eufyMake M5";
2021
- const address = demoRoom?.address || addressProp || "1111 8th St, San Francisco, CA United States 94108";
2022
- const images = demoRoom?.images && demoRoom.images.length > 0 ? demoRoom.images : imagesProp || defaultImages;
2023
- const googleMapsLink = mapsLink || (demoRoom?.latitude && demoRoom?.longitude ? `https://www.google.com/maps/search/?api=1&query=${demoRoom.latitude},${demoRoom.longitude}` : "#");
2024
- if (loading && apiClient && demoRoomCode) {
2025
- return /* @__PURE__ */ jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-8 items-start", children: [
2026
- /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
2027
- /* @__PURE__ */ jsx("div", { className: "h-12 bg-gray-200 rounded animate-pulse" }),
2028
- /* @__PURE__ */ jsx("div", { className: "h-24 bg-gray-200 rounded animate-pulse" }),
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",
1659
+ };
1660
+ const validateForm = () => {
1661
+ const newErrors = {};
1662
+ questions.forEach((question) => {
1663
+ if (question.required) {
1664
+ const questionId = getQuestionId(question);
1665
+ const value = responses[questionId];
1666
+ if (!value || Array.isArray(value) && value.length === 0) {
1667
+ newErrors[questionId] = "This field is required";
1668
+ }
1669
+ }
1670
+ });
1671
+ const agrees = pageData?.agrees || [];
1672
+ if (agrees.length > 0) {
1673
+ const allAgreed = agrees.every(
1674
+ (_, index) => agreements[index]
1675
+ );
1676
+ if (!allAgreed) {
1677
+ setAgreementError(
1678
+ "Please agree to all terms and conditions to continue"
1679
+ );
1680
+ setErrors(newErrors);
1681
+ return false;
1682
+ }
1683
+ }
1684
+ setErrors(newErrors);
1685
+ setAgreementError("");
1686
+ return Object.keys(newErrors).length === 0;
1687
+ };
1688
+ const handleSubmit = (e) => {
1689
+ e.preventDefault();
1690
+ if (validateForm()) {
1691
+ onSubmit?.(responses);
1692
+ }
1693
+ };
1694
+ const renderQuestion = (question) => {
1695
+ const questionId = getQuestionId(question);
1696
+ const hasError = !!errors[questionId];
1697
+ switch (question.type) {
1698
+ case "text":
1699
+ case "email":
1700
+ case "tel":
1701
+ return /* @__PURE__ */ jsx(
1702
+ "input",
2054
1703
  {
2055
- width: "24",
2056
- height: "24",
2057
- viewBox: "0 0 24 24",
2058
- fill: "none",
2059
- xmlns: "http://www.w3.org/2000/svg",
2060
- className: "flex-shrink-0 mt-0.5",
1704
+ type: question.type,
1705
+ value: responses[questionId] || "",
1706
+ onChange: (e) => handleChange(questionId, e.target.value),
1707
+ placeholder: question.placeholder,
1708
+ className: cn(
1709
+ "w-full px-4 py-3 rounded-lg border text-base",
1710
+ "focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:border-transparent",
1711
+ hasError ? "border-red-500" : "border-[#E4E5E6]"
1712
+ )
1713
+ }
1714
+ );
1715
+ case "textarea":
1716
+ return /* @__PURE__ */ jsx(
1717
+ "textarea",
1718
+ {
1719
+ value: responses[questionId] || "",
1720
+ onChange: (e) => handleChange(questionId, e.target.value),
1721
+ placeholder: question.placeholder,
1722
+ rows: 4,
1723
+ className: cn(
1724
+ "w-full px-4 py-3 rounded-lg border text-base resize-none",
1725
+ "focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:border-transparent",
1726
+ hasError ? "border-red-500" : "border-[#E4E5E6]"
1727
+ )
1728
+ }
1729
+ );
1730
+ case "radio":
1731
+ return /* @__PURE__ */ jsx("div", { className: "space-y-3", children: question?.options?.map((option) => /* @__PURE__ */ jsxs(
1732
+ "label",
1733
+ {
1734
+ className: "flex items-center gap-3 cursor-pointer group",
2061
1735
  children: [
2062
1736
  /* @__PURE__ */ jsx(
2063
- "rect",
1737
+ "input",
2064
1738
  {
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",
2076
- {
2077
- d: "M8 10H16",
2078
- stroke: "currentColor",
2079
- strokeWidth: "2",
2080
- strokeLinecap: "round"
2081
- }
2082
- ),
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"
1739
+ type: "radio",
1740
+ name: questionId,
1741
+ value: option.value || option.label,
1742
+ checked: responses[questionId] === (option.value || option.label),
1743
+ onChange: (e) => handleChange(questionId, e.target.value),
1744
+ className: "w-5 h-5 text-[#3ADB67] focus:ring-[#3ADB67] focus:ring-2"
2332
1745
  }
2333
1746
  ),
2334
1747
  /* @__PURE__ */ jsx("span", { className: "text-base text-gray-900 group-hover:text-[#3ADB67] transition-colors", children: option.label })
@@ -2395,8 +1808,8 @@ var QuestionnaireForm = ({
2395
1808
  return null;
2396
1809
  }
2397
1810
  };
2398
- return /* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit, className: cn("space-y-6", className), children: [
2399
- questions?.map((question) => {
1811
+ return /* @__PURE__ */ jsxs("div", { className: "pb-[80px]", children: [
1812
+ questions && questions.length > 0 && /* @__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
1813
  const questionId = getQuestionId(question);
2401
1814
  return /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
2402
1815
  /* @__PURE__ */ jsxs("label", { className: "block", children: [
@@ -2408,24 +1821,51 @@ var QuestionnaireForm = ({
2408
1821
  ] }),
2409
1822
  renderQuestion(question),
2410
1823
  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 text-red-500", children: errors[questionId] })
1824
+ errors[questionId] && /* @__PURE__ */ jsx("p", { className: "text-sm", style: { color: "#FF4D4D" }, children: errors[questionId] })
2412
1825
  ] }, questionId);
2413
- }),
2414
- /* @__PURE__ */ jsx(
2415
- "button",
2416
- {
2417
- type: "submit",
2418
- disabled: loading,
2419
- className: cn(
2420
- "w-full px-6 py-4 rounded-full",
2421
- "bg-[#3ADB67] text-white font-medium text-base",
2422
- "hover:bg-[#2FC257] transition-colors",
2423
- "focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:ring-offset-2",
2424
- "disabled:opacity-50 disabled:cursor-not-allowed"
2425
- ),
2426
- children: loading ? "Submitting..." : "Submit Booking"
2427
- }
2428
- )
1826
+ }) }) }),
1827
+ !!selectedTimeslotId && /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center", children: [
1828
+ pageData?.agrees && pageData.agrees.length > 0 && /* @__PURE__ */ jsxs("div", { className: "space-y-4 mt-8", children: [
1829
+ pageData.agrees.map((agreeContent, index) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
1830
+ /* @__PURE__ */ jsx(
1831
+ "input",
1832
+ {
1833
+ type: "checkbox",
1834
+ id: `agreement-${index}`,
1835
+ checked: agreements[index] || false,
1836
+ onChange: (e) => handleAgreementChange(index, e.target.checked),
1837
+ className: "w-5 h-5 rounded border-gray-300 text-[#2FC257] focus:ring-[#2FC257] cursor-pointer flex-shrink-0"
1838
+ }
1839
+ ),
1840
+ /* @__PURE__ */ jsx(
1841
+ "label",
1842
+ {
1843
+ htmlFor: `agreement-${index}`,
1844
+ className: "text-sm text-gray-700 cursor-pointer select-none flex-1 [&_a]:underline [&_a]:text-blue-600 [&_a:hover]:text-blue-700",
1845
+ dangerouslySetInnerHTML: { __html: agreeContent },
1846
+ "aria-label": `Agreement ${index + 1}`
1847
+ }
1848
+ )
1849
+ ] }, index)),
1850
+ agreementError && /* @__PURE__ */ jsx("p", { className: "text-sm mt-2", style: { color: "#FF4D4D" }, children: agreementError })
1851
+ ] }),
1852
+ /* @__PURE__ */ jsx(
1853
+ "button",
1854
+ {
1855
+ type: "submit",
1856
+ disabled: loading,
1857
+ onClick: handleSubmit,
1858
+ className: cn(
1859
+ "w-fit mt-6 px-6 py-4 rounded-full",
1860
+ "bg-[#080A0F] text-white font-medium text-base",
1861
+ "hover:bg-[#2FC257] transition-colors",
1862
+ "focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:ring-offset-2",
1863
+ "disabled:opacity-50 disabled:cursor-not-allowed"
1864
+ ),
1865
+ children: loading ? pageData?.submitting || "Submitting..." : pageData?.submit || "Submit Booking"
1866
+ }
1867
+ )
1868
+ ] })
2429
1869
  ] });
2430
1870
  };
2431
1871
  dayjs.extend(dayLocaleData);
@@ -2435,38 +1875,45 @@ var DateTimePicker = ({
2435
1875
  apiClient,
2436
1876
  demoRoomCode,
2437
1877
  timezone,
1878
+ pageData = {
1879
+ scheduleYourVisit: "Schedule Your Visit",
1880
+ timeSlot: "Time Slot",
1881
+ loadingTimeSlots: "Loading time slots...",
1882
+ failedToLoadTimeSlots: "Failed to load time slots",
1883
+ noAvailableTimeSlots: "No available time slots for this date",
1884
+ full: "Full",
1885
+ spotsLeft: "spots left",
1886
+ fillOutForm: "Fill out Form",
1887
+ loadingQuestionnaire: "Loading questionnaire...",
1888
+ bookingFailed: "Booking failed"
1889
+ },
2438
1890
  locale,
2439
1891
  onBookingSuccess
2440
1892
  }) => {
2441
1893
  const { token } = theme.useToken();
2442
1894
  const [selectMonth, setSelectMonth] = useState("");
2443
1895
  const [selectedDate, setSelectedDate] = useState(dayjs());
2444
- const [selectedTimeslotId, setSelectedTimeslotId] = useState(null);
2445
- const [showQuestionnaire, setShowQuestionnaire] = useState(false);
2446
- const { createBooking, loading: bookingLoading, error: bookingError } = useCreateBooking(apiClient);
1896
+ const [selectedTimeslotId, setSelectedTimeslotId] = useState(
1897
+ null
1898
+ );
2447
1899
  const {
2448
- data: demoRoom
2449
- } = useDemoRoom(
1900
+ createBooking,
1901
+ loading: bookingLoading,
1902
+ error: bookingError
1903
+ } = useCreateBooking(apiClient);
1904
+ const { data: demoRoom } = useDemoRoom(
2450
1905
  apiClient,
2451
1906
  demoRoomCode || "",
2452
1907
  locale,
2453
1908
  { enabled: !!demoRoomCode }
2454
1909
  );
2455
- const {
2456
- data: questionnaire,
2457
- loading: questionnaireLoading
2458
- } = useQuestionnaire(
1910
+ const { data: questionnaire, loading: questionnaireLoading } = useQuestionnaire(
2459
1911
  apiClient,
2460
1912
  demoRoomCode || "",
2461
1913
  demoRoom?.questionnaire_id,
2462
1914
  locale,
2463
1915
  { enabled: !!demoRoomCode && !!demoRoom?.questionnaire_id }
2464
1916
  );
2465
- useEffect(() => {
2466
- if (questionnaire) {
2467
- setShowQuestionnaire(true);
2468
- }
2469
- }, [questionnaire]);
2470
1917
  const startDate = selectedDate.startOf("month").format("YYYY-MM-DD");
2471
1918
  const endDate = selectedDate.endOf("month").format("YYYY-MM-DD");
2472
1919
  const {
@@ -2506,7 +1953,7 @@ var DateTimePicker = ({
2506
1953
  borderRadius: token.borderRadiusLG
2507
1954
  };
2508
1955
  return /* @__PURE__ */ jsxs("div", { children: [
2509
- /* @__PURE__ */ jsx("div", { className: "text-[48px] py-[64px] font-bold text-center", children: "Schedule Your Visit" }),
1956
+ /* @__PURE__ */ jsx("div", { className: "text-[48px] py-[64px] font-bold text-center", children: pageData.scheduleYourVisit }),
2510
1957
  /* @__PURE__ */ jsxs("div", { className: "flex gap-4", children: [
2511
1958
  /* @__PURE__ */ jsx(
2512
1959
  ConfigProvider,
@@ -2523,13 +1970,8 @@ var DateTimePicker = ({
2523
1970
  }
2524
1971
  }
2525
1972
  },
2526
- children: /* @__PURE__ */ jsxs(
2527
- "div",
2528
- {
2529
- style: wrapperStyle,
2530
- className: "calendar-custom-cell",
2531
- children: [
2532
- /* @__PURE__ */ jsx("style", { children: `
1973
+ children: /* @__PURE__ */ jsxs("div", { style: wrapperStyle, className: "calendar-custom-cell", children: [
1974
+ /* @__PURE__ */ jsx("style", { children: `
2533
1975
  .calendar-custom-cell .ant-picker-cell {
2534
1976
  padding: 6px !important;
2535
1977
  }
@@ -2564,141 +2006,139 @@ var DateTimePicker = ({
2564
2006
  line-height: 48px !important;
2565
2007
  }
2566
2008
  ` }),
2567
- /* @__PURE__ */ jsx(
2568
- Calendar,
2569
- {
2570
- fullscreen: false,
2571
- value: selectedDate,
2572
- onChange: (date) => setSelectedDate(date),
2573
- headerRender: ({ value, onChange }) => {
2574
- const year = value.year();
2575
- const month = value.month();
2576
- const yearOptions = Array.from({ length: 20 }, (_, i) => {
2577
- const label = year - 10 + i;
2578
- return { label, value: label };
2579
- });
2580
- const monthOptions = value.localeData().months().map((label, index) => ({
2581
- label,
2582
- value: index
2583
- }));
2584
- const monthText = monthOptions?.find((item) => {
2585
- return item?.value === month;
2586
- });
2587
- setSelectMonth(monthText?.label || "");
2588
- return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 py-3", children: [
2589
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
2590
- /* @__PURE__ */ jsx(
2591
- Select,
2592
- {
2593
- value: month,
2594
- options: monthOptions,
2595
- onChange: (newMonth) => {
2596
- const now = value.clone().month(newMonth);
2597
- onChange(now);
2598
- },
2599
- variant: "borderless",
2600
- className: "text-2xl font-medium",
2601
- popupMatchSelectWidth: false,
2602
- style: {
2603
- fontSize: "24px",
2604
- fontWeight: 500
2605
- }
2606
- }
2607
- ),
2608
- /* @__PURE__ */ jsx(
2609
- Select,
2610
- {
2611
- value: year,
2612
- options: yearOptions,
2613
- onChange: (newYear) => {
2614
- const now = value.clone().year(newYear);
2615
- onChange(now);
2616
- },
2617
- variant: "borderless",
2618
- className: "text-2xl font-medium",
2619
- popupMatchSelectWidth: false,
2620
- style: {
2621
- fontSize: "24px",
2622
- fontWeight: 500
2623
- }
2624
- }
2625
- )
2626
- ] }),
2627
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
2628
- /* @__PURE__ */ jsx(
2629
- "button",
2009
+ /* @__PURE__ */ jsx(
2010
+ Calendar,
2011
+ {
2012
+ fullscreen: false,
2013
+ value: selectedDate,
2014
+ onChange: (date) => setSelectedDate(date),
2015
+ headerRender: ({ value, onChange }) => {
2016
+ const year = value.year();
2017
+ const month = value.month();
2018
+ const yearOptions = Array.from({ length: 20 }, (_, i) => {
2019
+ const label = year - 10 + i;
2020
+ return { label, value: label };
2021
+ });
2022
+ const monthOptions = value.localeData().months().map((label, index) => ({
2023
+ label,
2024
+ value: index
2025
+ }));
2026
+ const monthText = monthOptions?.find((item) => {
2027
+ return item?.value === month;
2028
+ });
2029
+ setSelectMonth(monthText?.label || "");
2030
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 py-3", children: [
2031
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
2032
+ /* @__PURE__ */ jsx(
2033
+ Select,
2034
+ {
2035
+ value: month,
2036
+ options: monthOptions,
2037
+ onChange: (newMonth) => {
2038
+ const now = value.clone().month(newMonth);
2039
+ onChange(now);
2040
+ },
2041
+ variant: "borderless",
2042
+ className: "text-2xl font-medium",
2043
+ popupMatchSelectWidth: false,
2044
+ style: {
2045
+ fontSize: "24px",
2046
+ fontWeight: 500
2047
+ }
2048
+ }
2049
+ ),
2050
+ /* @__PURE__ */ jsx(
2051
+ Select,
2052
+ {
2053
+ value: year,
2054
+ options: yearOptions,
2055
+ onChange: (newYear) => {
2056
+ const now = value.clone().year(newYear);
2057
+ onChange(now);
2058
+ },
2059
+ variant: "borderless",
2060
+ className: "text-2xl font-medium",
2061
+ popupMatchSelectWidth: false,
2062
+ style: {
2063
+ fontSize: "24px",
2064
+ fontWeight: 500
2065
+ }
2066
+ }
2067
+ )
2068
+ ] }),
2069
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
2070
+ /* @__PURE__ */ jsx(
2071
+ "button",
2072
+ {
2073
+ onClick: () => {
2074
+ const newDate = value.subtract(1, "month");
2075
+ onChange(newDate);
2076
+ },
2077
+ className: "w-10 h-10 flex items-center justify-center hover:bg-gray-100 rounded-lg transition-colors",
2078
+ children: /* @__PURE__ */ jsx(
2079
+ "svg",
2630
2080
  {
2631
- onClick: () => {
2632
- const newDate = value.subtract(1, "month");
2633
- onChange(newDate);
2634
- },
2635
- className: "w-10 h-10 flex items-center justify-center hover:bg-gray-100 rounded-lg transition-colors",
2081
+ width: "20",
2082
+ height: "20",
2083
+ viewBox: "0 0 20 20",
2084
+ fill: "none",
2085
+ xmlns: "http://www.w3.org/2000/svg",
2636
2086
  children: /* @__PURE__ */ jsx(
2637
- "svg",
2087
+ "path",
2638
2088
  {
2639
- width: "20",
2640
- height: "20",
2641
- viewBox: "0 0 20 20",
2642
- fill: "none",
2643
- xmlns: "http://www.w3.org/2000/svg",
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
- )
2089
+ d: "M12 16L6 10L12 4",
2090
+ stroke: "currentColor",
2091
+ strokeWidth: "2",
2092
+ strokeLinecap: "round",
2093
+ strokeLinejoin: "round"
2654
2094
  }
2655
2095
  )
2656
2096
  }
2657
- ),
2658
- /* @__PURE__ */ jsx(
2659
- "button",
2097
+ )
2098
+ }
2099
+ ),
2100
+ /* @__PURE__ */ jsx(
2101
+ "button",
2102
+ {
2103
+ onClick: () => {
2104
+ const newDate = value.add(1, "month");
2105
+ onChange(newDate);
2106
+ },
2107
+ className: "w-10 h-10 flex items-center justify-center hover:bg-gray-100 rounded-lg transition-colors",
2108
+ children: /* @__PURE__ */ jsx(
2109
+ "svg",
2660
2110
  {
2661
- onClick: () => {
2662
- const newDate = value.add(1, "month");
2663
- onChange(newDate);
2664
- },
2665
- className: "w-10 h-10 flex items-center justify-center hover:bg-gray-100 rounded-lg transition-colors",
2111
+ width: "20",
2112
+ height: "20",
2113
+ viewBox: "0 0 20 20",
2114
+ fill: "none",
2115
+ xmlns: "http://www.w3.org/2000/svg",
2666
2116
  children: /* @__PURE__ */ jsx(
2667
- "svg",
2117
+ "path",
2668
2118
  {
2669
- width: "20",
2670
- height: "20",
2671
- viewBox: "0 0 20 20",
2672
- fill: "none",
2673
- xmlns: "http://www.w3.org/2000/svg",
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
- )
2119
+ d: "M8 4L14 10L8 16",
2120
+ stroke: "currentColor",
2121
+ strokeWidth: "2",
2122
+ strokeLinecap: "round",
2123
+ strokeLinejoin: "round"
2684
2124
  }
2685
2125
  )
2686
2126
  }
2687
2127
  )
2688
- ] })
2689
- ] });
2690
- },
2691
- onPanelChange
2692
- }
2693
- )
2694
- ]
2695
- }
2696
- )
2128
+ }
2129
+ )
2130
+ ] })
2131
+ ] });
2132
+ },
2133
+ onPanelChange
2134
+ }
2135
+ )
2136
+ ] })
2697
2137
  }
2698
2138
  ),
2699
2139
  /* @__PURE__ */ jsxs("div", { className: "bg-white p-[24px] rounded-[12px] flex-1", children: [
2700
2140
  /* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
2701
- "Time Slot",
2141
+ pageData.timeSlot,
2702
2142
  /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
2703
2143
  /* @__PURE__ */ jsx(
2704
2144
  "button",
@@ -2739,105 +2179,412 @@ var DateTimePicker = ({
2739
2179
  children: /* @__PURE__ */ jsx(
2740
2180
  "svg",
2741
2181
  {
2742
- xmlns: "http://www.w3.org/2000/svg",
2743
- width: "24",
2744
- height: "24",
2745
- viewBox: "0 0 24 24",
2182
+ xmlns: "http://www.w3.org/2000/svg",
2183
+ width: "24",
2184
+ height: "24",
2185
+ viewBox: "0 0 24 24",
2186
+ fill: "none",
2187
+ children: /* @__PURE__ */ jsx(
2188
+ "path",
2189
+ {
2190
+ d: "M8.29289 5.29289C8.68342 4.90237 9.31643 4.90237 9.70696 5.29289L15.707 11.2929C16.0975 11.6834 16.0975 12.3164 15.707 12.707L9.70696 18.707C9.31643 19.0975 8.68342 19.0975 8.29289 18.707C7.90237 18.3164 7.90237 17.6834 8.29289 17.2929L13.5859 11.9999L8.29289 6.70696C7.90237 6.31643 7.90237 5.68342 8.29289 5.29289Z",
2191
+ fill: "#1D1D1F"
2192
+ }
2193
+ )
2194
+ }
2195
+ )
2196
+ }
2197
+ )
2198
+ ] })
2199
+ ] }),
2200
+ /* @__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: pageData.loadingTimeSlots }) : timeslotsError ? /* @__PURE__ */ jsx("div", { className: "col-span-2 text-center text-red-600 py-8", children: pageData.failedToLoadTimeSlots }) : dayTimeslots.length === 0 ? /* @__PURE__ */ jsx("div", { className: "col-span-2 text-center text-[#767880] py-8", children: pageData.noAvailableTimeSlots }) : dayTimeslots.map((slot) => {
2201
+ const isAvailable = slot.status === "available";
2202
+ const isFull = slot.status === "full";
2203
+ const isSelected = selectedTimeslotId === slot.id;
2204
+ return /* @__PURE__ */ jsx(
2205
+ "button",
2206
+ {
2207
+ disabled: !isAvailable,
2208
+ onClick: () => {
2209
+ if (isAvailable) {
2210
+ setSelectedTimeslotId(slot.id);
2211
+ }
2212
+ },
2213
+ className: `
2214
+ rounded-[20px] w-full flex items-center justify-center gap-4 h-[76px]
2215
+ border text-center transition-colors
2216
+ ${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"}
2217
+ `,
2218
+ children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
2219
+ /* @__PURE__ */ jsx("div", { children: formatTimeslot(slot) }),
2220
+ isFull && /* @__PURE__ */ jsx("div", { className: "text-xs text-[#BDBDBD] mt-1", children: pageData.full }),
2221
+ isAvailable && !isSelected && /* @__PURE__ */ jsxs("div", { className: "text-xs text-[#767880] mt-1", children: [
2222
+ slot.capacity - slot.booked_count,
2223
+ " ",
2224
+ pageData.spotsLeft
2225
+ ] }),
2226
+ isAvailable && isSelected && /* @__PURE__ */ jsxs("div", { className: "text-xs text-white mt-1", children: [
2227
+ slot.capacity - slot.booked_count,
2228
+ " ",
2229
+ pageData.spotsLeft
2230
+ ] })
2231
+ ] })
2232
+ },
2233
+ slot.id
2234
+ );
2235
+ }) })
2236
+ ] })
2237
+ ] }),
2238
+ /* @__PURE__ */ jsxs("div", { className: "mt-12", children: [
2239
+ !!questionnaire?.questions?.length && /* @__PURE__ */ jsx("div", { className: "text-[48px] font-bold text-center mb-8", children: pageData.fillOutForm }),
2240
+ questionnaireLoading ? /* @__PURE__ */ jsx("div", { className: "text-center text-[#767880] py-8", children: pageData.loadingQuestionnaire }) : /* @__PURE__ */ jsx(
2241
+ QuestionnaireForm,
2242
+ {
2243
+ questions: questionnaire?.questions || [],
2244
+ loading: bookingLoading,
2245
+ pageData,
2246
+ selectedTimeslotId,
2247
+ onSubmit: async (responses) => {
2248
+ try {
2249
+ const customerName = responses.name || responses.customer_name || "";
2250
+ const customerEmail = responses.email || responses.customer_email || "";
2251
+ const customerPhone = responses.phone || responses.customer_phone_number || "";
2252
+ const customerPhoneCode = responses.phone_code || responses.customer_phone_code || "+1";
2253
+ if (selectedTimeslotId) {
2254
+ const result = await createBooking({
2255
+ demoroom_code: demoRoomCode,
2256
+ timeslot_id: selectedTimeslotId,
2257
+ questionnaire_id: questionnaire?.id,
2258
+ questionnaire_response: responses,
2259
+ customer_name: customerName,
2260
+ customer_email: customerEmail,
2261
+ customer_phone_code: customerPhoneCode,
2262
+ customer_phone_number: customerPhone
2263
+ });
2264
+ if (result && onBookingSuccess) {
2265
+ onBookingSuccess(result?.cancel_token);
2266
+ }
2267
+ }
2268
+ } catch (error) {
2269
+ console.error("Booking creation failed:", error);
2270
+ }
2271
+ }
2272
+ }
2273
+ )
2274
+ ] })
2275
+ ] });
2276
+ };
2277
+ var DateTimePicker_default = DateTimePicker;
2278
+ var Navigation;
2279
+ var Pagination;
2280
+ var Autoplay;
2281
+ var swiperVersion = "11+";
2282
+ try {
2283
+ const modules = __require("swiper/modules");
2284
+ Navigation = modules.Navigation;
2285
+ Pagination = modules.Pagination;
2286
+ Autoplay = modules.Autoplay;
2287
+ swiperVersion = "11+";
2288
+ } catch (e) {
2289
+ try {
2290
+ const SwiperCore = __require("swiper");
2291
+ const SwiperNavigation = __require("swiper/modules/navigation");
2292
+ const SwiperPagination = __require("swiper/modules/pagination");
2293
+ const SwiperAutoplay = __require("swiper/modules/autoplay");
2294
+ const SwiperClass = SwiperCore.default || SwiperCore;
2295
+ if (SwiperClass && SwiperClass.use) {
2296
+ SwiperClass.use([
2297
+ SwiperNavigation.default || SwiperNavigation,
2298
+ SwiperPagination.default || SwiperPagination,
2299
+ SwiperAutoplay.default || SwiperAutoplay
2300
+ ]);
2301
+ }
2302
+ Navigation = SwiperNavigation.default || SwiperNavigation;
2303
+ Pagination = SwiperPagination.default || SwiperPagination;
2304
+ Autoplay = SwiperAutoplay.default || SwiperAutoplay;
2305
+ swiperVersion = "8";
2306
+ } catch (e2) {
2307
+ console.warn("Failed to load swiper modules:", e2);
2308
+ }
2309
+ }
2310
+ if (typeof window !== "undefined") {
2311
+ try {
2312
+ __require("swiper/css");
2313
+ __require("swiper/css/navigation");
2314
+ __require("swiper/css/pagination");
2315
+ } catch (e) {
2316
+ try {
2317
+ __require("swiper/swiper.min.css");
2318
+ __require("swiper/modules/navigation/navigation.min.css");
2319
+ __require("swiper/modules/pagination/pagination.min.css");
2320
+ } catch (e2) {
2321
+ console.warn("Failed to load swiper styles");
2322
+ }
2323
+ }
2324
+ }
2325
+ var defaultDescriptions = [
2326
+ "Norem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis.",
2327
+ "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."
2328
+ ];
2329
+ var defaultImages = [
2330
+ "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638",
2331
+ "https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Component_3_1.png?v=1765274638"
2332
+ ];
2333
+ var DemoRoomDetail = ({
2334
+ apiClient,
2335
+ demoRoomCode,
2336
+ locale,
2337
+ title: titleProp,
2338
+ descriptions: descriptionsProp,
2339
+ devices: devicesProp,
2340
+ address: addressProp,
2341
+ mapsLink,
2342
+ images: imagesProp,
2343
+ pageData = {
2344
+ loadingText: "Loading...",
2345
+ errorTitle: "Failed to load demo room details",
2346
+ openInGoogleMaps: "Open in Google Maps",
2347
+ demoRoomImages: "Demo Room Images"
2348
+ },
2349
+ className,
2350
+ ...props
2351
+ }) => {
2352
+ const {
2353
+ data: demoRoom,
2354
+ loading,
2355
+ error
2356
+ } = useDemoRoom(
2357
+ apiClient,
2358
+ demoRoomCode || "",
2359
+ locale,
2360
+ { enabled: !!apiClient && !!demoRoomCode }
2361
+ );
2362
+ const title = demoRoom?.name || titleProp || "Design District Demo Room";
2363
+ const descriptions = demoRoom?.description ? [demoRoom.description] : descriptionsProp || defaultDescriptions;
2364
+ const devices = demoRoom?.description || devicesProp || "eufyMake E1, eufyMake M5";
2365
+ const address = demoRoom?.address || addressProp || "1111 8th St, San Francisco, CA United States 94108";
2366
+ const images = demoRoom?.images && demoRoom.images.length > 0 ? demoRoom.images : imagesProp || defaultImages;
2367
+ const googleMapsLink = mapsLink || (() => {
2368
+ if (demoRoom?.latitude && demoRoom?.longitude) {
2369
+ return `https://www.google.com/maps/search/?api=1&query=${demoRoom.latitude},${demoRoom.longitude}`;
2370
+ } else {
2371
+ return `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(address)}`;
2372
+ }
2373
+ })();
2374
+ if (loading && apiClient && demoRoomCode) {
2375
+ return /* @__PURE__ */ jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-8 items-start", children: [
2376
+ /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
2377
+ /* @__PURE__ */ jsx("div", { className: "h-12 bg-gray-200 rounded animate-pulse" }),
2378
+ /* @__PURE__ */ jsx("div", { className: "h-24 bg-gray-200 rounded animate-pulse" }),
2379
+ /* @__PURE__ */ jsx("div", { className: "h-8 bg-gray-200 rounded animate-pulse" })
2380
+ ] }),
2381
+ /* @__PURE__ */ jsx("div", { className: "h-[400px] bg-gray-200 rounded-2xl animate-pulse" })
2382
+ ] }) });
2383
+ }
2384
+ if (error && apiClient && demoRoomCode) {
2385
+ return /* @__PURE__ */ jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxs("div", { className: "text-center text-red-600 py-8", children: [
2386
+ /* @__PURE__ */ jsx("p", { className: "text-lg font-medium", children: pageData.errorTitle }),
2387
+ /* @__PURE__ */ jsx("p", { className: "text-sm mt-2", children: error.message })
2388
+ ] }) });
2389
+ }
2390
+ return /* @__PURE__ */ jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-8 items-start", children: [
2391
+ /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
2392
+ /* @__PURE__ */ jsx("h1", { className: "text-[40px] font-bold text-gray-900 leading-tight", children: title }),
2393
+ /* @__PURE__ */ jsx("div", { className: "space-y-4", children: descriptions.map((desc, index) => /* @__PURE__ */ jsx(
2394
+ "p",
2395
+ {
2396
+ className: "text-base text-gray-600 leading-relaxed",
2397
+ children: desc
2398
+ },
2399
+ index
2400
+ )) }),
2401
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
2402
+ /* @__PURE__ */ jsxs(
2403
+ "svg",
2404
+ {
2405
+ width: "24",
2406
+ height: "24",
2407
+ viewBox: "0 0 24 24",
2408
+ fill: "none",
2409
+ xmlns: "http://www.w3.org/2000/svg",
2410
+ className: "flex-shrink-0 mt-0.5",
2411
+ children: [
2412
+ /* @__PURE__ */ jsx(
2413
+ "rect",
2414
+ {
2415
+ x: "3",
2416
+ y: "3",
2417
+ width: "18",
2418
+ height: "18",
2419
+ rx: "2",
2420
+ stroke: "currentColor",
2421
+ strokeWidth: "2"
2422
+ }
2423
+ ),
2424
+ /* @__PURE__ */ jsx(
2425
+ "path",
2426
+ {
2427
+ d: "M8 10H16",
2428
+ stroke: "currentColor",
2429
+ strokeWidth: "2",
2430
+ strokeLinecap: "round"
2431
+ }
2432
+ ),
2433
+ /* @__PURE__ */ jsx(
2434
+ "path",
2435
+ {
2436
+ d: "M8 14H16",
2437
+ stroke: "currentColor",
2438
+ strokeWidth: "2",
2439
+ strokeLinecap: "round"
2440
+ }
2441
+ )
2442
+ ]
2443
+ }
2444
+ ),
2445
+ /* @__PURE__ */ jsx("span", { className: "text-base text-gray-900", children: devices })
2446
+ ] }),
2447
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
2448
+ /* @__PURE__ */ jsxs(
2449
+ "svg",
2450
+ {
2451
+ width: "24",
2452
+ height: "24",
2453
+ viewBox: "0 0 24 24",
2454
+ fill: "none",
2455
+ xmlns: "http://www.w3.org/2000/svg",
2456
+ className: "flex-shrink-0 mt-0.5",
2457
+ children: [
2458
+ /* @__PURE__ */ jsx(
2459
+ "path",
2460
+ {
2461
+ 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",
2462
+ stroke: "currentColor",
2463
+ strokeWidth: "2",
2464
+ strokeLinecap: "round",
2465
+ strokeLinejoin: "round"
2466
+ }
2467
+ ),
2468
+ /* @__PURE__ */ jsx(
2469
+ "circle",
2470
+ {
2471
+ cx: "12",
2472
+ cy: "9",
2473
+ r: "2.5",
2474
+ stroke: "currentColor",
2475
+ strokeWidth: "2"
2476
+ }
2477
+ )
2478
+ ]
2479
+ }
2480
+ ),
2481
+ /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
2482
+ /* @__PURE__ */ jsx("p", { className: "text-base text-gray-900", children: address }),
2483
+ /* @__PURE__ */ jsxs(
2484
+ "a",
2485
+ {
2486
+ href: googleMapsLink,
2487
+ target: "_blank",
2488
+ rel: "noopener noreferrer",
2489
+ className: "inline-flex items-center gap-1 text-sm text-blue-600 hover:text-blue-700 mt-1 underline",
2490
+ children: [
2491
+ pageData.openInGoogleMaps,
2492
+ /* @__PURE__ */ jsx(
2493
+ "svg",
2494
+ {
2495
+ width: "12",
2496
+ height: "12",
2497
+ viewBox: "0 0 12 12",
2746
2498
  fill: "none",
2499
+ xmlns: "http://www.w3.org/2000/svg",
2747
2500
  children: /* @__PURE__ */ jsx(
2748
2501
  "path",
2749
2502
  {
2750
- d: "M8.29289 5.29289C8.68342 4.90237 9.31643 4.90237 9.70696 5.29289L15.707 11.2929C16.0975 11.6834 16.0975 12.3164 15.707 12.707L9.70696 18.707C9.31643 19.0975 8.68342 19.0975 8.29289 18.707C7.90237 18.3164 7.90237 17.6834 8.29289 17.2929L13.5859 11.9999L8.29289 6.70696C7.90237 6.31643 7.90237 5.68342 8.29289 5.29289Z",
2751
- fill: "#1D1D1F"
2503
+ d: "M3 9L9 3M9 3H3M9 3V9",
2504
+ stroke: "currentColor",
2505
+ strokeWidth: "1.5",
2506
+ strokeLinecap: "round",
2507
+ strokeLinejoin: "round"
2752
2508
  }
2753
2509
  )
2754
2510
  }
2755
2511
  )
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] hover:text-white cursor-pointer" : "border-[#E4E5E6] bg-[#F5F5F5] text-[#BDBDBD] cursor-not-allowed"}
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
- }) })
2512
+ ]
2513
+ }
2514
+ )
2515
+ ] })
2794
2516
  ] })
2795
2517
  ] }),
2796
- showQuestionnaire && questionnaire && /* @__PURE__ */ jsxs("div", { className: "mt-12", children: [
2797
- /* @__PURE__ */ jsx("div", { className: "text-[48px] font-bold text-center mb-8", children: "Fill out Form" }),
2798
- questionnaireLoading ? /* @__PURE__ */ jsx("div", { className: "text-center text-[#767880] py-8", children: "Loading questionnaire..." }) : /* @__PURE__ */ jsx("div", { className: "bg-white rounded-[12px] border border-[#E4E5E6] p-8", children: /* @__PURE__ */ jsx(
2799
- QuestionnaireForm,
2518
+ /* @__PURE__ */ jsx("div", { className: "relative h-[400px] rounded-2xl overflow-hidden", children: images.length > 0 ? /* @__PURE__ */ jsx(
2519
+ Swiper,
2520
+ {
2521
+ ...swiperVersion === "11+" && Navigation && Pagination && Autoplay ? { modules: [Navigation, Pagination, Autoplay] } : {},
2522
+ spaceBetween: 0,
2523
+ slidesPerView: 1,
2524
+ navigation: true,
2525
+ pagination: { clickable: true },
2526
+ autoplay: {
2527
+ delay: 3e3,
2528
+ disableOnInteraction: false
2529
+ },
2530
+ loop: true,
2531
+ className: "h-full rounded-2xl",
2532
+ children: images.map((img, index) => /* @__PURE__ */ jsx(SwiperSlide, { children: /* @__PURE__ */ jsx("div", { className: "relative w-full h-full bg-gray-100", children: /* @__PURE__ */ jsx(
2533
+ "img",
2534
+ {
2535
+ src: img,
2536
+ alt: `Demo room view ${index + 1}`,
2537
+ className: "w-full h-full object-cover"
2538
+ }
2539
+ ) }) }, index))
2540
+ }
2541
+ ) : /* @__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: [
2542
+ /* @__PURE__ */ jsx("div", { className: "w-16 h-16 mx-auto mb-3 rounded-full bg-white flex items-center justify-center", children: /* @__PURE__ */ jsxs(
2543
+ "svg",
2800
2544
  {
2801
- questions: questionnaire.questions,
2802
- loading: bookingLoading,
2803
- onSubmit: async (responses) => {
2804
- try {
2805
- const customerName = responses.name || responses.customer_name || "";
2806
- const customerEmail = responses.email || responses.customer_email || "";
2807
- const customerPhone = responses.phone || responses.customer_phone_number || "";
2808
- const customerPhoneCode = responses.phone_code || responses.customer_phone_code || "+1";
2809
- const result = await createBooking({
2810
- demoroom_code: demoRoomCode,
2811
- timeslot_id: selectedTimeslotId,
2812
- questionnaire_id: questionnaire.id,
2813
- questionnaire_response: responses,
2814
- customer_name: customerName,
2815
- customer_email: customerEmail,
2816
- customer_phone_code: customerPhoneCode,
2817
- customer_phone_number: customerPhone
2818
- });
2819
- if (result && onBookingSuccess) {
2820
- onBookingSuccess(result?.cancel_token);
2545
+ width: "32",
2546
+ height: "32",
2547
+ viewBox: "0 0 32 32",
2548
+ fill: "none",
2549
+ xmlns: "http://www.w3.org/2000/svg",
2550
+ children: [
2551
+ /* @__PURE__ */ jsx(
2552
+ "rect",
2553
+ {
2554
+ x: "4",
2555
+ y: "8",
2556
+ width: "24",
2557
+ height: "16",
2558
+ rx: "2",
2559
+ stroke: "currentColor",
2560
+ strokeWidth: "2"
2821
2561
  }
2822
- } catch (error) {
2823
- console.error("Booking creation failed:", error);
2824
- }
2825
- }
2562
+ ),
2563
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "14", r: "2", fill: "currentColor" }),
2564
+ /* @__PURE__ */ jsx(
2565
+ "path",
2566
+ {
2567
+ d: "M28 20L22 14L16 20",
2568
+ stroke: "currentColor",
2569
+ strokeWidth: "2",
2570
+ strokeLinecap: "round",
2571
+ strokeLinejoin: "round"
2572
+ }
2573
+ )
2574
+ ]
2826
2575
  }
2827
- ) })
2828
- ] }),
2829
- 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: [
2830
- /* @__PURE__ */ jsx("p", { className: "font-medium", children: "Booking failed" }),
2831
- /* @__PURE__ */ jsx("p", { className: "text-sm mt-1", children: bookingError.message })
2832
- ] })
2833
- ] });
2576
+ ) }),
2577
+ /* @__PURE__ */ jsx("p", { className: "text-gray-500 text-sm", children: pageData.demoRoomImages })
2578
+ ] }) }) })
2579
+ ] }) });
2834
2580
  };
2835
- var DateTimePicker_default = DateTimePicker;
2581
+ DemoRoomDetail.displayName = "DemoRoomDetail";
2836
2582
  var BookingForm = ({
2837
2583
  layoutClassName,
2838
2584
  className,
2839
2585
  apiConfig,
2840
2586
  demoRoomCode,
2587
+ pageData,
2841
2588
  timezone,
2842
2589
  handleBookingSuccess,
2843
2590
  ...props
@@ -2846,25 +2593,21 @@ var BookingForm = ({
2846
2593
  () => createDemoRoomApi(apiConfig),
2847
2594
  [apiConfig]
2848
2595
  );
2596
+ const dateTimePickerPageData = useMemo(() => ({
2597
+ ...pageData?.dateTimePicker,
2598
+ ...pageData?.questionnaireForm
2599
+ }), [pageData?.dateTimePicker, pageData?.questionnaireForm]);
2849
2600
  return /* @__PURE__ */ jsxs("div", { children: [
2850
- /* @__PURE__ */ jsxs("div", { className: cn("w-full", className), ...props, children: [
2851
- /* @__PURE__ */ jsx(
2852
- BreadCrumbs,
2853
- {
2854
- className: layoutClassName,
2855
- items: [{ label: "Home", link: "/" }, { label: "Demo Room" }]
2856
- }
2857
- ),
2858
- /* @__PURE__ */ jsx(
2859
- DemoRoomDetail,
2860
- {
2861
- className: cn("mt-8", layoutClassName),
2862
- apiClient,
2863
- demoRoomCode,
2864
- locale: apiConfig.locale
2865
- }
2866
- )
2867
- ] }),
2601
+ /* @__PURE__ */ jsx("div", { className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsx(
2602
+ DemoRoomDetail,
2603
+ {
2604
+ className: cn("mt-8", layoutClassName),
2605
+ apiClient,
2606
+ demoRoomCode,
2607
+ locale: apiConfig.locale,
2608
+ pageData: pageData?.demoRoomDetail
2609
+ }
2610
+ ) }),
2868
2611
  /* @__PURE__ */ jsx("div", { className: "bg-[#f5f5f5]", children: /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx(
2869
2612
  DateTimePicker_default,
2870
2613
  {
@@ -2872,7 +2615,8 @@ var BookingForm = ({
2872
2615
  demoRoomCode,
2873
2616
  timezone,
2874
2617
  locale: apiConfig.locale,
2875
- onBookingSuccess: handleBookingSuccess
2618
+ onBookingSuccess: handleBookingSuccess,
2619
+ pageData: dateTimePickerPageData
2876
2620
  }
2877
2621
  ) }) })
2878
2622
  ] });
@@ -2883,17 +2627,42 @@ var BookingSuccess = ({
2883
2627
  token,
2884
2628
  apiConfig,
2885
2629
  onScheduleAgain,
2886
- className
2630
+ onCancelSuccess,
2631
+ className,
2632
+ pageData = {
2633
+ yourAppointment: "Your Appointment",
2634
+ appointmentCanceled: "This appointment has been canceled.",
2635
+ scheduleAgain: "Schedule again",
2636
+ location: "Location",
2637
+ openInGoogleMaps: "Open in Google Maps \u2197",
2638
+ dateAndTime: "Date and Time",
2639
+ event: "Event",
2640
+ demoRoom: "Demo Room",
2641
+ visitorInfo: "Visitor Info",
2642
+ noPhoneProvided: "No phone provided",
2643
+ cancelAppointment: "Cancel Appointment",
2644
+ cancelDialog: {
2645
+ title: "Are you sure you want to cancel?",
2646
+ description: "You won't be able to restore the schedule.",
2647
+ backButton: "Back",
2648
+ confirmButton: "Cancel Appointment",
2649
+ canceling: "Canceling..."
2650
+ },
2651
+ cancelError: "Failed to cancel appointment. Please try again."
2652
+ }
2887
2653
  }) => {
2888
- const [bookingData, setBookingData] = useState(initialBookingData || null);
2654
+ const [bookingData, setBookingData] = useState(
2655
+ initialBookingData || null
2656
+ );
2889
2657
  const [loading, setLoading] = useState(false);
2890
- const [error, setError] = useState(null);
2891
2658
  const [isCancelled, setIsCancelled] = useState(false);
2659
+ const [showCancelDialog, setShowCancelDialog] = useState(false);
2660
+ const [cancelLoading, setCancelLoading] = useState(false);
2661
+ const [cancelError, setCancelError] = useState(null);
2892
2662
  useEffect(() => {
2893
2663
  if (token && apiConfig && !initialBookingData) {
2894
2664
  const fetchBookingData = async () => {
2895
2665
  setLoading(true);
2896
- setError(null);
2897
2666
  try {
2898
2667
  const apiClient = createDemoRoomApi(apiConfig);
2899
2668
  const booking = await apiClient.getBooking(token, apiConfig.locale);
@@ -2901,7 +2670,6 @@ var BookingSuccess = ({
2901
2670
  setIsCancelled(booking.status === "cancelled");
2902
2671
  } catch (err) {
2903
2672
  console.error("Failed to fetch booking data:", err);
2904
- setError("Failed to load booking information");
2905
2673
  } finally {
2906
2674
  setLoading(false);
2907
2675
  }
@@ -2909,8 +2677,36 @@ var BookingSuccess = ({
2909
2677
  fetchBookingData();
2910
2678
  }
2911
2679
  }, [token, apiConfig, initialBookingData]);
2680
+ const handleCancelAppointment = async () => {
2681
+ if (!token || !apiConfig) {
2682
+ setCancelError(pageData.cancelError || "Unable to cancel: Missing token or API configuration");
2683
+ return;
2684
+ }
2685
+ setCancelLoading(true);
2686
+ setCancelError(null);
2687
+ try {
2688
+ const apiClient = createDemoRoomApi(apiConfig);
2689
+ const cancelledBooking = await apiClient.cancelBooking(
2690
+ token,
2691
+ apiConfig.locale
2692
+ );
2693
+ if (cancelledBooking) {
2694
+ setBookingData(cancelledBooking);
2695
+ }
2696
+ setIsCancelled(true);
2697
+ setShowCancelDialog(false);
2698
+ if (onCancelSuccess && cancelledBooking) {
2699
+ onCancelSuccess(cancelledBooking);
2700
+ }
2701
+ } catch (err) {
2702
+ console.error("Failed to cancel booking:", err);
2703
+ setCancelError(pageData.cancelError || "Failed to cancel appointment. Please try again.");
2704
+ } finally {
2705
+ setCancelLoading(false);
2706
+ }
2707
+ };
2912
2708
  if (loading) {
2913
- return /* @__PURE__ */ jsx("div", { className: `min-h-screen bg-white 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: [
2709
+ 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
2710
  /* @__PURE__ */ jsx("div", { className: "h-8 bg-gray-200 rounded w-1/3" }),
2915
2711
  /* @__PURE__ */ jsx("div", { className: "h-24 bg-gray-200 rounded" }),
2916
2712
  /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
@@ -2920,40 +2716,25 @@ var BookingSuccess = ({
2920
2716
  ] })
2921
2717
  ] }) }) });
2922
2718
  }
2923
- if (error || !bookingData) {
2924
- return /* @__PURE__ */ jsx("div", { className: `min-h-screen bg-white py-12 px-6 ${className || ""}`, children: /* @__PURE__ */ jsx("div", { className: "max-w-3xl mx-auto", children: /* @__PURE__ */ jsxs("div", { className: "text-center py-12", children: [
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
- ] }) }) });
2719
+ if (!bookingData) {
2720
+ return null;
2937
2721
  }
2938
- return /* @__PURE__ */ jsx("div", { className: `min-h-screen bg-white py-12 px-6 ${className || ""}`, children: /* @__PURE__ */ jsxs("div", { className: "max-w-3xl mx-auto", children: [
2939
- /* @__PURE__ */ jsx("h1", { className: "text-[40px] font-bold text-gray-900 mb-8", children: "Your Appointment" }),
2940
- isCancelled ? /* @__PURE__ */ jsxs("div", { className: "bg-gray-50 rounded-lg p-6 mb-8 flex items-center justify-between", children: [
2941
- /* @__PURE__ */ jsx("p", { className: "text-base text-gray-700", children: "This appointment has been canceled." }),
2722
+ return /* @__PURE__ */ jsx("div", { className: `min-h-screen py-12 px-6 ${className || ""}`, children: /* @__PURE__ */ jsxs("div", { className: "max-w-3xl mx-auto", children: [
2723
+ /* @__PURE__ */ jsx("h1", { className: "text-[40px] font-bold text-gray-900 mb-8", children: pageData.yourAppointment }),
2724
+ isCancelled && /* @__PURE__ */ jsxs("div", { className: "bg-white rounded-lg p-6 mb-8 flex items-center justify-between", children: [
2725
+ /* @__PURE__ */ jsx("p", { className: "text-base text-gray-700", children: pageData.appointmentCanceled }),
2942
2726
  onScheduleAgain && /* @__PURE__ */ jsx(
2943
2727
  "button",
2944
2728
  {
2945
2729
  onClick: onScheduleAgain,
2946
2730
  className: "px-6 py-3 bg-black text-white rounded-full font-medium hover:bg-gray-800 transition-colors whitespace-nowrap",
2947
- children: "Schedule again"
2731
+ children: pageData.scheduleAgain
2948
2732
  }
2949
2733
  )
2950
- ] }) : /* @__PURE__ */ jsx("div", { className: "bg-green-50 rounded-lg p-6 mb-8 flex items-center justify-between border border-green-200", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
2951
- /* @__PURE__ */ jsx("svg", { className: "w-6 h-6 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" }) }),
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: [
2734
+ ] }),
2735
+ /* @__PURE__ */ jsxs("div", { className: "space-y-8 bg-white px-[48px] py-[32px] rounded-lg", children: [
2955
2736
  /* @__PURE__ */ jsxs("div", { children: [
2956
- /* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Location" }),
2737
+ /* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: pageData.location }),
2957
2738
  /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
2958
2739
  bookingData.demoroom_name && /* @__PURE__ */ jsx("p", { className: "text-base font-medium text-gray-900", children: bookingData.demoroom_name }),
2959
2740
  bookingData.address && /* @__PURE__ */ jsx("p", { className: "text-base text-gray-600", children: bookingData.address }),
@@ -2964,13 +2745,13 @@ var BookingSuccess = ({
2964
2745
  target: "_blank",
2965
2746
  rel: "noopener noreferrer",
2966
2747
  className: "inline-flex items-center gap-1 text-base text-blue-600 hover:text-blue-700 hover:underline",
2967
- children: "Open in Google Maps \u2197"
2748
+ children: pageData.openInGoogleMaps
2968
2749
  }
2969
2750
  )
2970
2751
  ] })
2971
2752
  ] }),
2972
2753
  /* @__PURE__ */ jsxs("div", { children: [
2973
- /* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Date and Time" }),
2754
+ /* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: pageData.dateAndTime }),
2974
2755
  /* @__PURE__ */ jsxs("p", { className: "text-base text-gray-900", children: [
2975
2756
  bookingData.booking_date,
2976
2757
  bookingData.time_slot && `, ${bookingData.time_slot}`,
@@ -2978,48 +2759,185 @@ var BookingSuccess = ({
2978
2759
  ] })
2979
2760
  ] }),
2980
2761
  bookingData.equipment && /* @__PURE__ */ jsxs("div", { children: [
2981
- /* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Event" }),
2762
+ /* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: pageData.event }),
2982
2763
  /* @__PURE__ */ jsx("p", { className: "text-base text-gray-900", children: bookingData.equipment })
2983
2764
  ] }),
2984
2765
  /* @__PURE__ */ jsxs("div", { children: [
2985
- /* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Demo Room" }),
2766
+ /* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: pageData.demoRoom }),
2986
2767
  /* @__PURE__ */ jsx("p", { className: "text-base text-gray-900", children: bookingData.demoroom_code })
2987
2768
  ] }),
2988
2769
  /* @__PURE__ */ jsxs("div", { children: [
2989
- /* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: "Visitor Info" }),
2770
+ /* @__PURE__ */ jsx("h2", { className: "text-lg font-semibold text-gray-900 mb-3", children: pageData.visitorInfo }),
2990
2771
  /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
2991
2772
  /* @__PURE__ */ jsx("p", { className: "text-base text-gray-900", children: bookingData.customer_name }),
2992
2773
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-base text-gray-600", children: [
2993
- /* @__PURE__ */ jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx(
2994
- "path",
2774
+ /* @__PURE__ */ jsx(
2775
+ "svg",
2995
2776
  {
2996
- strokeLinecap: "round",
2997
- strokeLinejoin: "round",
2998
- strokeWidth: 2,
2999
- 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"
2777
+ className: "w-5 h-5",
2778
+ fill: "none",
2779
+ viewBox: "0 0 24 24",
2780
+ stroke: "currentColor",
2781
+ children: /* @__PURE__ */ jsx(
2782
+ "path",
2783
+ {
2784
+ strokeLinecap: "round",
2785
+ strokeLinejoin: "round",
2786
+ strokeWidth: 2,
2787
+ 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"
2788
+ }
2789
+ )
3000
2790
  }
3001
- ) }),
2791
+ ),
3002
2792
  bookingData.phone_code && bookingData.phone_number ? /* @__PURE__ */ jsxs("span", { children: [
3003
2793
  bookingData.phone_code,
3004
2794
  " ",
3005
2795
  bookingData.phone_number
3006
- ] }) : /* @__PURE__ */ jsx("span", { children: "No phone provided" })
2796
+ ] }) : /* @__PURE__ */ jsx("span", { children: pageData.noPhoneProvided })
3007
2797
  ] }),
3008
2798
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-base text-gray-600", children: [
3009
- /* @__PURE__ */ jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx(
3010
- "path",
2799
+ /* @__PURE__ */ jsx(
2800
+ "svg",
3011
2801
  {
3012
- strokeLinecap: "round",
3013
- strokeLinejoin: "round",
3014
- strokeWidth: 2,
3015
- 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"
2802
+ className: "w-5 h-5",
2803
+ fill: "none",
2804
+ viewBox: "0 0 24 24",
2805
+ stroke: "currentColor",
2806
+ children: /* @__PURE__ */ jsx(
2807
+ "path",
2808
+ {
2809
+ strokeLinecap: "round",
2810
+ strokeLinejoin: "round",
2811
+ strokeWidth: 2,
2812
+ 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"
2813
+ }
2814
+ )
3016
2815
  }
3017
- ) }),
2816
+ ),
3018
2817
  /* @__PURE__ */ jsx("span", { children: bookingData.customer_email })
3019
2818
  ] })
3020
2819
  ] })
3021
2820
  ] })
3022
- ] })
2821
+ ] }),
2822
+ !isCancelled && /* @__PURE__ */ jsxs("div", { className: "mt-[64px]", children: [
2823
+ /* @__PURE__ */ jsx(
2824
+ "button",
2825
+ {
2826
+ onClick: () => setShowCancelDialog(true),
2827
+ disabled: cancelLoading,
2828
+ 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",
2829
+ children: pageData.cancelAppointment
2830
+ }
2831
+ ),
2832
+ cancelError && /* @__PURE__ */ jsx("p", { className: "text-sm mt-2", style: { color: "#FF4D4D" }, children: cancelError })
2833
+ ] }),
2834
+ 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: [
2835
+ /* @__PURE__ */ jsx(
2836
+ "button",
2837
+ {
2838
+ onClick: () => setShowCancelDialog(false),
2839
+ disabled: cancelLoading,
2840
+ 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",
2841
+ "aria-label": "Close",
2842
+ children: /* @__PURE__ */ jsx(
2843
+ "svg",
2844
+ {
2845
+ width: "24",
2846
+ height: "24",
2847
+ viewBox: "0 0 24 24",
2848
+ fill: "none",
2849
+ xmlns: "http://www.w3.org/2000/svg",
2850
+ children: /* @__PURE__ */ jsx(
2851
+ "path",
2852
+ {
2853
+ d: "M18 6L6 18M6 6L18 18",
2854
+ stroke: "currentColor",
2855
+ strokeWidth: "2",
2856
+ strokeLinecap: "round",
2857
+ strokeLinejoin: "round"
2858
+ }
2859
+ )
2860
+ }
2861
+ )
2862
+ }
2863
+ ),
2864
+ /* @__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(
2865
+ "svg",
2866
+ {
2867
+ width: "32",
2868
+ height: "32",
2869
+ viewBox: "0 0 32 32",
2870
+ fill: "none",
2871
+ xmlns: "http://www.w3.org/2000/svg",
2872
+ children: /* @__PURE__ */ jsx(
2873
+ "path",
2874
+ {
2875
+ d: "M16 10V17M16 22H16.01",
2876
+ stroke: "white",
2877
+ strokeWidth: "3",
2878
+ strokeLinecap: "round",
2879
+ strokeLinejoin: "round"
2880
+ }
2881
+ )
2882
+ }
2883
+ ) }) }),
2884
+ /* @__PURE__ */ jsxs("div", { className: "text-center mb-8", children: [
2885
+ /* @__PURE__ */ jsx("h3", { className: "text-[18px] font-semibold text-gray-900 mb-2", children: pageData.cancelDialog?.title }),
2886
+ /* @__PURE__ */ jsx("p", { className: "text-[14px] text-gray-600", children: pageData.cancelDialog?.description })
2887
+ ] }),
2888
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-3 justify-center", children: [
2889
+ /* @__PURE__ */ jsx(
2890
+ "button",
2891
+ {
2892
+ onClick: () => setShowCancelDialog(false),
2893
+ disabled: cancelLoading,
2894
+ 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]",
2895
+ children: pageData.cancelDialog?.backButton
2896
+ }
2897
+ ),
2898
+ /* @__PURE__ */ jsx(
2899
+ "button",
2900
+ {
2901
+ onClick: handleCancelAppointment,
2902
+ disabled: cancelLoading,
2903
+ 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",
2904
+ children: cancelLoading ? /* @__PURE__ */ jsxs(Fragment, { children: [
2905
+ /* @__PURE__ */ jsxs(
2906
+ "svg",
2907
+ {
2908
+ className: "animate-spin h-5 w-5",
2909
+ xmlns: "http://www.w3.org/2000/svg",
2910
+ fill: "none",
2911
+ viewBox: "0 0 24 24",
2912
+ children: [
2913
+ /* @__PURE__ */ jsx(
2914
+ "circle",
2915
+ {
2916
+ className: "opacity-25",
2917
+ cx: "12",
2918
+ cy: "12",
2919
+ r: "10",
2920
+ stroke: "currentColor",
2921
+ strokeWidth: "4"
2922
+ }
2923
+ ),
2924
+ /* @__PURE__ */ jsx(
2925
+ "path",
2926
+ {
2927
+ className: "opacity-75",
2928
+ fill: "currentColor",
2929
+ 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"
2930
+ }
2931
+ )
2932
+ ]
2933
+ }
2934
+ ),
2935
+ pageData.cancelDialog?.canceling
2936
+ ] }) : pageData.cancelDialog?.confirmButton
2937
+ }
2938
+ )
2939
+ ] })
2940
+ ] }) })
3023
2941
  ] }) });
3024
2942
  };
3025
2943
 
@@ -3161,6 +3079,6 @@ var ThemeProvider = ({
3161
3079
  return /* @__PURE__ */ jsx(ThemeContext.Provider, { value: { theme: theme2 }, children });
3162
3080
  };
3163
3081
 
3164
- export { BookingForm, BookingSuccess, DemoRoom, DemoRoomApiClient, DemoRoomDetail, ThemeProvider, cn, createDemoRoomApi, useBooking, useCancelBooking, useCreateBooking, useDemoRoom, useDemoRooms, useQuestionnaire, useTheme, useTimeslots };
3082
+ export { BookingForm, BookingSuccess, DemoRoom, DemoRoomApiClient, ThemeProvider, cn, createDemoRoomApi, useBooking, useCancelBooking, useCreateBooking, useDemoRoom, useDemoRooms, useQuestionnaire, useTheme, useTimeslots };
3165
3083
  //# sourceMappingURL=index.mjs.map
3166
3084
  //# sourceMappingURL=index.mjs.map