@anker-in/ui 0.3.8 → 0.3.10-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +91 -1
- package/dist/index.d.ts +91 -1
- package/dist/index.js +521 -195
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +521 -195
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/.next-refresh +0 -1
package/dist/index.mjs
CHANGED
|
@@ -10913,6 +10913,9 @@ var QuestionnaireForm2 = ({
|
|
|
10913
10913
|
questions,
|
|
10914
10914
|
onSubmit,
|
|
10915
10915
|
onCancel,
|
|
10916
|
+
onFormStart,
|
|
10917
|
+
onFormFieldChange,
|
|
10918
|
+
onFormSubmit,
|
|
10916
10919
|
pageData,
|
|
10917
10920
|
selectedTimeslotId,
|
|
10918
10921
|
loading = false,
|
|
@@ -11024,6 +11027,52 @@ var QuestionnaireForm2 = ({
|
|
|
11024
11027
|
const getQuestionId = (question) => {
|
|
11025
11028
|
return question.key || question.id || "";
|
|
11026
11029
|
};
|
|
11030
|
+
const hasFormStartedRef = useRef(false);
|
|
11031
|
+
const emitFormStart = () => {
|
|
11032
|
+
if (hasFormStartedRef.current) return;
|
|
11033
|
+
hasFormStartedRef.current = true;
|
|
11034
|
+
onFormStart?.();
|
|
11035
|
+
};
|
|
11036
|
+
const lastReportedValuesRef = useRef({});
|
|
11037
|
+
const totalSteps = visibleQuestions.length + (pageData?.agrees?.length || 0);
|
|
11038
|
+
const stripHtml = (html) => html.replace(/<[^>]+>/g, "").trim();
|
|
11039
|
+
const resolveOptionLabel = (question, rawValue) => {
|
|
11040
|
+
const option = question?.options?.find(
|
|
11041
|
+
(opt) => (opt.value || opt.label) === rawValue
|
|
11042
|
+
);
|
|
11043
|
+
return option?.label || rawValue;
|
|
11044
|
+
};
|
|
11045
|
+
const getStepIndex = (questionId) => {
|
|
11046
|
+
const index = visibleQuestions.findIndex(
|
|
11047
|
+
(q) => getQuestionId(q) === questionId
|
|
11048
|
+
);
|
|
11049
|
+
return index >= 0 ? index + 1 : 0;
|
|
11050
|
+
};
|
|
11051
|
+
const emitFieldChange = (ctx) => {
|
|
11052
|
+
onFormFieldChange?.({
|
|
11053
|
+
stepIndex: getStepIndex(ctx.questionId),
|
|
11054
|
+
totalSteps,
|
|
11055
|
+
fieldId: ctx.questionId,
|
|
11056
|
+
fieldLabel: ctx.fieldLabel,
|
|
11057
|
+
fieldType: ctx.fieldType,
|
|
11058
|
+
value: ctx.value
|
|
11059
|
+
});
|
|
11060
|
+
};
|
|
11061
|
+
const emitBlurFieldChange = (question, rawValue) => {
|
|
11062
|
+
const questionId = getQuestionId(question);
|
|
11063
|
+
const trimmed = rawValue.trim();
|
|
11064
|
+
if (!trimmed || trimmed === lastReportedValuesRef.current[questionId]) {
|
|
11065
|
+
return false;
|
|
11066
|
+
}
|
|
11067
|
+
lastReportedValuesRef.current[questionId] = trimmed;
|
|
11068
|
+
emitFieldChange({
|
|
11069
|
+
questionId,
|
|
11070
|
+
fieldLabel: question.label,
|
|
11071
|
+
fieldType: question.type,
|
|
11072
|
+
value: trimmed
|
|
11073
|
+
});
|
|
11074
|
+
return true;
|
|
11075
|
+
};
|
|
11027
11076
|
const handleChange = (questionId, value) => {
|
|
11028
11077
|
setResponses((prev) => ({
|
|
11029
11078
|
...prev,
|
|
@@ -11057,6 +11106,13 @@ var QuestionnaireForm2 = ({
|
|
|
11057
11106
|
...prev,
|
|
11058
11107
|
[questionId]: code
|
|
11059
11108
|
}));
|
|
11109
|
+
const question = visibleQuestions.find(
|
|
11110
|
+
(q) => getQuestionId(q) === questionId
|
|
11111
|
+
);
|
|
11112
|
+
const phoneNumber = String(responses[questionId] || "").trim();
|
|
11113
|
+
if (question && phoneNumber) {
|
|
11114
|
+
emitBlurFieldChange(question, `${code} ${phoneNumber}`);
|
|
11115
|
+
}
|
|
11060
11116
|
};
|
|
11061
11117
|
const handleCheckboxChange = (questionId, optionValue, checked) => {
|
|
11062
11118
|
const currentValues = responses[questionId] || [];
|
|
@@ -11064,6 +11120,7 @@ var QuestionnaireForm2 = ({
|
|
|
11064
11120
|
handleChange(questionId, newValues);
|
|
11065
11121
|
};
|
|
11066
11122
|
const handleAgreementChange = (index, checked) => {
|
|
11123
|
+
emitFormStart();
|
|
11067
11124
|
setAgreements((prev) => ({
|
|
11068
11125
|
...prev,
|
|
11069
11126
|
[index]: checked
|
|
@@ -11071,6 +11128,15 @@ var QuestionnaireForm2 = ({
|
|
|
11071
11128
|
if (checked && agreementError) {
|
|
11072
11129
|
setAgreementError("");
|
|
11073
11130
|
}
|
|
11131
|
+
const agreeContent = pageData?.agrees?.[index] || "";
|
|
11132
|
+
onFormFieldChange?.({
|
|
11133
|
+
stepIndex: visibleQuestions.length + index + 1,
|
|
11134
|
+
totalSteps,
|
|
11135
|
+
fieldId: `agreement-${index}`,
|
|
11136
|
+
fieldLabel: stripHtml(agreeContent),
|
|
11137
|
+
fieldType: "agreement",
|
|
11138
|
+
value: checked
|
|
11139
|
+
});
|
|
11074
11140
|
};
|
|
11075
11141
|
const handleOtherInputChange = (questionId, value) => {
|
|
11076
11142
|
setOtherInputs((prev) => ({
|
|
@@ -11130,6 +11196,7 @@ var QuestionnaireForm2 = ({
|
|
|
11130
11196
|
}
|
|
11131
11197
|
}
|
|
11132
11198
|
});
|
|
11199
|
+
onFormSubmit?.({ responses: finalResponses });
|
|
11133
11200
|
onSubmit?.(finalResponses);
|
|
11134
11201
|
} else {
|
|
11135
11202
|
setTimeout(() => {
|
|
@@ -11156,6 +11223,7 @@ var QuestionnaireForm2 = ({
|
|
|
11156
11223
|
type: question.type,
|
|
11157
11224
|
value: responses[questionId] || "",
|
|
11158
11225
|
onChange: (e) => handleChange(questionId, e.target.value),
|
|
11226
|
+
onBlur: () => emitBlurFieldChange(question, String(responses[questionId] || "")),
|
|
11159
11227
|
placeholder: question.placeholder,
|
|
11160
11228
|
className: cn(
|
|
11161
11229
|
"w-full px-4 py-3 rounded-lg border text-base bg-white dark:bg-white dark:text-[#080A0F]",
|
|
@@ -11171,7 +11239,12 @@ var QuestionnaireForm2 = ({
|
|
|
11171
11239
|
type: "email",
|
|
11172
11240
|
value: responses[questionId] || "",
|
|
11173
11241
|
onChange: (e) => handleChange(questionId, e.target.value),
|
|
11174
|
-
onBlur: (e) =>
|
|
11242
|
+
onBlur: (e) => {
|
|
11243
|
+
handleEmailBlur(questionId, e.target.value);
|
|
11244
|
+
if (e.target.value.trim() && EMAIL_REGEX.test(e.target.value)) {
|
|
11245
|
+
emitBlurFieldChange(question, e.target.value);
|
|
11246
|
+
}
|
|
11247
|
+
},
|
|
11175
11248
|
placeholder: question.placeholder,
|
|
11176
11249
|
className: cn(
|
|
11177
11250
|
"w-full px-4 py-3 rounded-lg border text-base bg-white dark:bg-white dark:text-[#080A0F]",
|
|
@@ -11226,6 +11299,13 @@ var QuestionnaireForm2 = ({
|
|
|
11226
11299
|
type: "tel",
|
|
11227
11300
|
value: responses[questionId] || "",
|
|
11228
11301
|
onChange: (e) => handleChange(questionId, e.target.value),
|
|
11302
|
+
onBlur: () => {
|
|
11303
|
+
const code = phoneCountryCodes[questionId] || "+1";
|
|
11304
|
+
const phoneNumber = String(responses[questionId] || "").trim();
|
|
11305
|
+
if (phoneNumber) {
|
|
11306
|
+
emitBlurFieldChange(question, `${code} ${phoneNumber}`);
|
|
11307
|
+
}
|
|
11308
|
+
},
|
|
11229
11309
|
placeholder: question.placeholder,
|
|
11230
11310
|
className: cn(
|
|
11231
11311
|
"flex-1 px-4 py-3 rounded-lg border text-base bg-white dark:bg-white dark:text-[#080A0F]",
|
|
@@ -11241,6 +11321,7 @@ var QuestionnaireForm2 = ({
|
|
|
11241
11321
|
{
|
|
11242
11322
|
value: responses[questionId] || "",
|
|
11243
11323
|
onChange: (e) => handleChange(questionId, e.target.value),
|
|
11324
|
+
onBlur: () => emitBlurFieldChange(question, String(responses[questionId] || "")),
|
|
11244
11325
|
placeholder: question.placeholder,
|
|
11245
11326
|
rows: 4,
|
|
11246
11327
|
className: cn(
|
|
@@ -11264,7 +11345,16 @@ var QuestionnaireForm2 = ({
|
|
|
11264
11345
|
name: questionId,
|
|
11265
11346
|
value: option.value || option.label,
|
|
11266
11347
|
checked: responses[questionId] === (option.value || option.label),
|
|
11267
|
-
onChange: (e) =>
|
|
11348
|
+
onChange: (e) => {
|
|
11349
|
+
emitFormStart();
|
|
11350
|
+
handleChange(questionId, e.target.value);
|
|
11351
|
+
emitFieldChange({
|
|
11352
|
+
questionId,
|
|
11353
|
+
fieldLabel: question.label,
|
|
11354
|
+
fieldType: "radio",
|
|
11355
|
+
value: resolveOptionLabel(question, e.target.value)
|
|
11356
|
+
});
|
|
11357
|
+
},
|
|
11268
11358
|
className: "w-5 h-5 appearance-none cursor-pointer flex-shrink-0",
|
|
11269
11359
|
style: {
|
|
11270
11360
|
backgroundImage: responses[questionId] === (option.value || option.label) ? "url(https://cdn.shopify.com/s/files/1/0569/5147/2268/files/SelectBox.png?v=1769507941)" : "url(https://cdn.shopify.com/s/files/1/0569/5147/2268/files/Frame_2121235232_2.png?v=1769507995)",
|
|
@@ -11296,15 +11386,23 @@ var QuestionnaireForm2 = ({
|
|
|
11296
11386
|
value: optionValue,
|
|
11297
11387
|
checked: isOtherOption ? isOtherSelected : responses[questionId] === optionValue,
|
|
11298
11388
|
onChange: (e) => {
|
|
11389
|
+
emitFormStart();
|
|
11299
11390
|
if (isOtherOption) {
|
|
11300
11391
|
handleChange(questionId, "__other__");
|
|
11301
11392
|
setOtherInputs((prev) => ({
|
|
11302
11393
|
...prev,
|
|
11303
11394
|
[questionId]: ""
|
|
11304
11395
|
}));
|
|
11305
|
-
|
|
11306
|
-
handleChange(questionId, e.target.value);
|
|
11396
|
+
return;
|
|
11307
11397
|
}
|
|
11398
|
+
handleChange(questionId, e.target.value);
|
|
11399
|
+
lastReportedValuesRef.current[questionId] = e.target.value;
|
|
11400
|
+
emitFieldChange({
|
|
11401
|
+
questionId,
|
|
11402
|
+
fieldLabel: question.label,
|
|
11403
|
+
fieldType: "radio_with_other",
|
|
11404
|
+
value: resolveOptionLabel(question, e.target.value)
|
|
11405
|
+
});
|
|
11308
11406
|
},
|
|
11309
11407
|
className: "w-5 h-5 appearance-none cursor-pointer flex-shrink-0",
|
|
11310
11408
|
style: {
|
|
@@ -11323,6 +11421,10 @@ var QuestionnaireForm2 = ({
|
|
|
11323
11421
|
type: "text",
|
|
11324
11422
|
value: otherInputs[questionId] || "",
|
|
11325
11423
|
onChange: (e) => handleOtherInputChange(questionId, e.target.value),
|
|
11424
|
+
onBlur: () => emitBlurFieldChange(
|
|
11425
|
+
question,
|
|
11426
|
+
String(otherInputs[questionId] || "")
|
|
11427
|
+
),
|
|
11326
11428
|
placeholder: question.placeholder || "Please specify...",
|
|
11327
11429
|
className: cn(
|
|
11328
11430
|
"w-full px-4 py-3 rounded-lg border text-base bg-white dark:bg-white dark:text-[#080A0F]",
|
|
@@ -11350,11 +11452,25 @@ var QuestionnaireForm2 = ({
|
|
|
11350
11452
|
{
|
|
11351
11453
|
type: "checkbox",
|
|
11352
11454
|
checked: isChecked,
|
|
11353
|
-
onChange: (e) =>
|
|
11354
|
-
|
|
11355
|
-
|
|
11356
|
-
|
|
11357
|
-
|
|
11455
|
+
onChange: (e) => {
|
|
11456
|
+
emitFormStart();
|
|
11457
|
+
handleCheckboxChange(
|
|
11458
|
+
questionId,
|
|
11459
|
+
optionValue,
|
|
11460
|
+
e.target.checked
|
|
11461
|
+
);
|
|
11462
|
+
const newChecked = e.target.checked ? [...responses[questionId] || [], optionValue] : (responses[questionId] || []).filter(
|
|
11463
|
+
(v) => v !== optionValue
|
|
11464
|
+
);
|
|
11465
|
+
emitFieldChange({
|
|
11466
|
+
questionId,
|
|
11467
|
+
fieldLabel: question.label,
|
|
11468
|
+
fieldType: "checkbox",
|
|
11469
|
+
value: newChecked.map(
|
|
11470
|
+
(v) => resolveOptionLabel(question, v)
|
|
11471
|
+
)
|
|
11472
|
+
});
|
|
11473
|
+
},
|
|
11358
11474
|
className: "w-4 h-4 text-[#fff] rounded",
|
|
11359
11475
|
style: {
|
|
11360
11476
|
accentColor: "#080A0F"
|
|
@@ -11378,7 +11494,16 @@ var QuestionnaireForm2 = ({
|
|
|
11378
11494
|
"select",
|
|
11379
11495
|
{
|
|
11380
11496
|
value: defaultValue,
|
|
11381
|
-
onChange: (e) =>
|
|
11497
|
+
onChange: (e) => {
|
|
11498
|
+
emitFormStart();
|
|
11499
|
+
handleChange(questionId, e.target.value);
|
|
11500
|
+
emitFieldChange({
|
|
11501
|
+
questionId,
|
|
11502
|
+
fieldLabel: question.label,
|
|
11503
|
+
fieldType: "select",
|
|
11504
|
+
value: resolveOptionLabel(question, e.target.value)
|
|
11505
|
+
});
|
|
11506
|
+
},
|
|
11382
11507
|
className: cn(
|
|
11383
11508
|
"w-full px-4 py-3 rounded-lg border text-base bg-white dark:bg-white dark:text-[#080A0F]",
|
|
11384
11509
|
"focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:border-transparent",
|
|
@@ -11400,118 +11525,130 @@ var QuestionnaireForm2 = ({
|
|
|
11400
11525
|
return null;
|
|
11401
11526
|
}
|
|
11402
11527
|
};
|
|
11403
|
-
return /* @__PURE__ */ jsxs(
|
|
11404
|
-
|
|
11405
|
-
|
|
11406
|
-
|
|
11407
|
-
|
|
11408
|
-
|
|
11409
|
-
{
|
|
11410
|
-
|
|
11411
|
-
|
|
11412
|
-
|
|
11413
|
-
|
|
11414
|
-
|
|
11415
|
-
|
|
11416
|
-
|
|
11417
|
-
|
|
11418
|
-
|
|
11419
|
-
|
|
11420
|
-
|
|
11421
|
-
|
|
11422
|
-
|
|
11423
|
-
|
|
11424
|
-
|
|
11528
|
+
return /* @__PURE__ */ jsxs(
|
|
11529
|
+
"div",
|
|
11530
|
+
{
|
|
11531
|
+
className: "pb-[80px] light",
|
|
11532
|
+
onFocusCapture: (e) => {
|
|
11533
|
+
const tag = e.target?.tagName;
|
|
11534
|
+
if (tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT") {
|
|
11535
|
+
emitFormStart();
|
|
11536
|
+
}
|
|
11537
|
+
},
|
|
11538
|
+
children: [
|
|
11539
|
+
visibleQuestions && visibleQuestions.length > 0 && /* @__PURE__ */ jsx("div", { className: "bg-white rounded-[12px] p-8 dark:bg-white l:p-4", children: /* @__PURE__ */ jsx("form", { onSubmit: handleSubmit, className: cn("space-y-6", className), children: visibleQuestions.map((question) => {
|
|
11540
|
+
const questionId = getQuestionId(question);
|
|
11541
|
+
const hasError = !!errors[questionId];
|
|
11542
|
+
return /* @__PURE__ */ jsxs(
|
|
11543
|
+
"div",
|
|
11544
|
+
{
|
|
11545
|
+
className: "space-y-2",
|
|
11546
|
+
"data-has-error": hasError ? "true" : "false",
|
|
11547
|
+
children: [
|
|
11548
|
+
/* @__PURE__ */ jsxs("label", { className: "block", children: [
|
|
11549
|
+
/* @__PURE__ */ jsxs("span", { className: "text-base font-bold text-[#080A0F] dark:text-[#080A0F]", children: [
|
|
11550
|
+
question.label,
|
|
11551
|
+
question.required && /* @__PURE__ */ jsx("span", { className: "text-red-500 ml-1", children: "*" })
|
|
11552
|
+
] }),
|
|
11553
|
+
question.description && /* @__PURE__ */ jsx("span", { className: "block text-sm text-gray-600 dark:text-gray-600 font-bold mt-1", children: question.description }),
|
|
11554
|
+
question.type === "email" && questionId === "email" && pageData?.emailDescription && /* @__PURE__ */ jsx("span", { className: "block text-sm text-gray-600 dark:text-gray-600 font-bold mt-1", children: pageData.emailDescription })
|
|
11555
|
+
] }),
|
|
11556
|
+
renderQuestion(question),
|
|
11557
|
+
question.hint && !errors[questionId] && /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500 dark:text-gray-500 font-bold", children: question.hint }),
|
|
11558
|
+
errors[questionId] && /* @__PURE__ */ jsx(
|
|
11559
|
+
"p",
|
|
11560
|
+
{
|
|
11561
|
+
className: "text-sm font-bold",
|
|
11562
|
+
style: { color: "#FF4D4D" },
|
|
11563
|
+
children: errors[questionId]
|
|
11564
|
+
}
|
|
11565
|
+
)
|
|
11566
|
+
]
|
|
11567
|
+
},
|
|
11568
|
+
questionId
|
|
11569
|
+
);
|
|
11570
|
+
}) }) }),
|
|
11571
|
+
!!selectedTimeslotId && /* @__PURE__ */ jsxs("div", { className: "flex flex-col justify-center", children: [
|
|
11572
|
+
pageData?.agrees && pageData.agrees.length > 0 && /* @__PURE__ */ jsxs(
|
|
11573
|
+
"div",
|
|
11574
|
+
{
|
|
11575
|
+
className: "space-y-4 mt-8",
|
|
11576
|
+
"data-has-error": agreementError ? "true" : "false",
|
|
11577
|
+
children: [
|
|
11578
|
+
pageData.agrees.map((agreeContent, index) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
11579
|
+
/* @__PURE__ */ jsx(
|
|
11580
|
+
"input",
|
|
11581
|
+
{
|
|
11582
|
+
type: "checkbox",
|
|
11583
|
+
id: `agreement-${index}`,
|
|
11584
|
+
checked: agreements[index] || false,
|
|
11585
|
+
onChange: (e) => handleAgreementChange(index, e.target.checked),
|
|
11586
|
+
className: "w-4 h-4 border border-[#080A0F] rounded text-[#fff] cursor-pointer flex-shrink-0",
|
|
11587
|
+
style: {
|
|
11588
|
+
accentColor: "#080A0F"
|
|
11589
|
+
}
|
|
11590
|
+
}
|
|
11591
|
+
),
|
|
11592
|
+
/* @__PURE__ */ jsx(
|
|
11593
|
+
"label",
|
|
11594
|
+
{
|
|
11595
|
+
htmlFor: `agreement-${index}`,
|
|
11596
|
+
className: "text-sm text-gray-700 dark:text-gray-700 font-bold cursor-pointer select-none flex-1 [&_a]:underline [&_a]:text-blue-600 [&_a:hover]:text-blue-700",
|
|
11597
|
+
dangerouslySetInnerHTML: { __html: agreeContent },
|
|
11598
|
+
"aria-label": `Agreement ${index + 1}`
|
|
11599
|
+
}
|
|
11600
|
+
)
|
|
11601
|
+
] }, index)),
|
|
11602
|
+
agreementError && /* @__PURE__ */ jsx(
|
|
11603
|
+
"p",
|
|
11604
|
+
{
|
|
11605
|
+
className: "text-sm font-bold mt-2",
|
|
11606
|
+
style: { color: "#FF4D4D" },
|
|
11607
|
+
children: agreementError
|
|
11608
|
+
}
|
|
11609
|
+
)
|
|
11610
|
+
]
|
|
11611
|
+
}
|
|
11612
|
+
),
|
|
11613
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-4", children: [
|
|
11614
|
+
/* @__PURE__ */ jsx(
|
|
11615
|
+
"button",
|
|
11425
11616
|
{
|
|
11426
|
-
|
|
11427
|
-
|
|
11428
|
-
|
|
11617
|
+
type: "submit",
|
|
11618
|
+
disabled: loading,
|
|
11619
|
+
onClick: handleSubmit,
|
|
11620
|
+
className: cn(
|
|
11621
|
+
"w-fit mt-6 px-6 py-4 rounded-full",
|
|
11622
|
+
"bg-[#080A0F] text-white font-bold text-base",
|
|
11623
|
+
"hover:bg-[#2FC257] hover:text-[#080A0F] transition-colors",
|
|
11624
|
+
"focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:ring-offset-2",
|
|
11625
|
+
"disabled:opacity-50 disabled:cursor-not-allowed"
|
|
11626
|
+
),
|
|
11627
|
+
children: loading ? pageData?.submitting || "Submitting..." : pageData?.submit || "Submit Booking"
|
|
11429
11628
|
}
|
|
11430
|
-
)
|
|
11431
|
-
|
|
11432
|
-
|
|
11433
|
-
questionId
|
|
11434
|
-
);
|
|
11435
|
-
}) }) }),
|
|
11436
|
-
!!selectedTimeslotId && /* @__PURE__ */ jsxs("div", { className: "flex flex-col justify-center", children: [
|
|
11437
|
-
pageData?.agrees && pageData.agrees.length > 0 && /* @__PURE__ */ jsxs(
|
|
11438
|
-
"div",
|
|
11439
|
-
{
|
|
11440
|
-
className: "space-y-4 mt-8",
|
|
11441
|
-
"data-has-error": agreementError ? "true" : "false",
|
|
11442
|
-
children: [
|
|
11443
|
-
pageData.agrees.map((agreeContent, index) => /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
11444
|
-
/* @__PURE__ */ jsx(
|
|
11445
|
-
"input",
|
|
11446
|
-
{
|
|
11447
|
-
type: "checkbox",
|
|
11448
|
-
id: `agreement-${index}`,
|
|
11449
|
-
checked: agreements[index] || false,
|
|
11450
|
-
onChange: (e) => handleAgreementChange(index, e.target.checked),
|
|
11451
|
-
className: "w-4 h-4 border border-[#080A0F] rounded text-[#fff] cursor-pointer flex-shrink-0",
|
|
11452
|
-
style: {
|
|
11453
|
-
accentColor: "#080A0F"
|
|
11454
|
-
}
|
|
11455
|
-
}
|
|
11456
|
-
),
|
|
11457
|
-
/* @__PURE__ */ jsx(
|
|
11458
|
-
"label",
|
|
11459
|
-
{
|
|
11460
|
-
htmlFor: `agreement-${index}`,
|
|
11461
|
-
className: "text-sm text-gray-700 dark:text-gray-700 font-bold cursor-pointer select-none flex-1 [&_a]:underline [&_a]:text-blue-600 [&_a:hover]:text-blue-700",
|
|
11462
|
-
dangerouslySetInnerHTML: { __html: agreeContent },
|
|
11463
|
-
"aria-label": `Agreement ${index + 1}`
|
|
11464
|
-
}
|
|
11465
|
-
)
|
|
11466
|
-
] }, index)),
|
|
11467
|
-
agreementError && /* @__PURE__ */ jsx(
|
|
11468
|
-
"p",
|
|
11629
|
+
),
|
|
11630
|
+
pageData?.discardEdit && !!initialResponses && /* @__PURE__ */ jsx(
|
|
11631
|
+
"button",
|
|
11469
11632
|
{
|
|
11470
|
-
|
|
11471
|
-
|
|
11472
|
-
|
|
11633
|
+
type: "submit",
|
|
11634
|
+
onClick: () => {
|
|
11635
|
+
onCancel?.();
|
|
11636
|
+
},
|
|
11637
|
+
className: cn(
|
|
11638
|
+
"w-fit mt-6 px-6 py-4 rounded-full",
|
|
11639
|
+
"border-[#080A0F] border-2 text-[#080A0F] font-bold text-base",
|
|
11640
|
+
"transition-colors",
|
|
11641
|
+
"disabled:opacity-50 disabled:cursor-not-allowed"
|
|
11642
|
+
),
|
|
11643
|
+
children: pageData?.discardEdit
|
|
11473
11644
|
}
|
|
11474
11645
|
)
|
|
11475
|
-
]
|
|
11476
|
-
|
|
11477
|
-
|
|
11478
|
-
|
|
11479
|
-
|
|
11480
|
-
|
|
11481
|
-
{
|
|
11482
|
-
type: "submit",
|
|
11483
|
-
disabled: loading,
|
|
11484
|
-
onClick: handleSubmit,
|
|
11485
|
-
className: cn(
|
|
11486
|
-
"w-fit mt-6 px-6 py-4 rounded-full",
|
|
11487
|
-
"bg-[#080A0F] text-white font-bold text-base",
|
|
11488
|
-
"hover:bg-[#2FC257] hover:text-[#080A0F] transition-colors",
|
|
11489
|
-
"focus:outline-none focus:ring-2 focus:ring-[#3ADB67] focus:ring-offset-2",
|
|
11490
|
-
"disabled:opacity-50 disabled:cursor-not-allowed"
|
|
11491
|
-
),
|
|
11492
|
-
children: loading ? pageData?.submitting || "Submitting..." : pageData?.submit || "Submit Booking"
|
|
11493
|
-
}
|
|
11494
|
-
),
|
|
11495
|
-
pageData?.discardEdit && !!initialResponses && /* @__PURE__ */ jsx(
|
|
11496
|
-
"button",
|
|
11497
|
-
{
|
|
11498
|
-
type: "submit",
|
|
11499
|
-
onClick: () => {
|
|
11500
|
-
onCancel?.();
|
|
11501
|
-
},
|
|
11502
|
-
className: cn(
|
|
11503
|
-
"w-fit mt-6 px-6 py-4 rounded-full",
|
|
11504
|
-
"border-[#080A0F] border-2 text-[#080A0F] font-bold text-base",
|
|
11505
|
-
"transition-colors",
|
|
11506
|
-
"disabled:opacity-50 disabled:cursor-not-allowed"
|
|
11507
|
-
),
|
|
11508
|
-
children: pageData?.discardEdit
|
|
11509
|
-
}
|
|
11510
|
-
)
|
|
11511
|
-
] }),
|
|
11512
|
-
error && /* @__PURE__ */ jsx("div", { className: "text-center w-full p-4", children: /* @__PURE__ */ jsx("p", { className: "text-[#FF4D4D] font-bold", children: pageData?.errorMsg?.[String(error.code)] || pageData?.errorMsg?.[error.code || ""] || error.message }) })
|
|
11513
|
-
] })
|
|
11514
|
-
] });
|
|
11646
|
+
] }),
|
|
11647
|
+
error && /* @__PURE__ */ jsx("div", { className: "text-center w-full p-4", children: /* @__PURE__ */ jsx("p", { className: "text-[#FF4D4D] font-bold", children: pageData?.errorMsg?.[String(error.code)] || pageData?.errorMsg?.[error.code || ""] || error.message }) })
|
|
11648
|
+
] })
|
|
11649
|
+
]
|
|
11650
|
+
}
|
|
11651
|
+
);
|
|
11515
11652
|
};
|
|
11516
11653
|
dayjs4.extend(dayLocaleData);
|
|
11517
11654
|
dayjs4.extend(weekday);
|
|
@@ -11531,7 +11668,8 @@ var DateTimePicker2 = ({
|
|
|
11531
11668
|
onBookingSuccess,
|
|
11532
11669
|
onQuestionnaireSubmit,
|
|
11533
11670
|
selectedPurposeType,
|
|
11534
|
-
podDesignId
|
|
11671
|
+
podDesignId,
|
|
11672
|
+
trackCallbacks
|
|
11535
11673
|
}) => {
|
|
11536
11674
|
const { token: themeToken } = theme.useToken();
|
|
11537
11675
|
const [selectedDate, setSelectedDate] = useState(
|
|
@@ -11920,9 +12058,14 @@ var DateTimePicker2 = ({
|
|
|
11920
12058
|
{
|
|
11921
12059
|
fullscreen: false,
|
|
11922
12060
|
value: calendarValue,
|
|
11923
|
-
onSelect: (date) => {
|
|
12061
|
+
onSelect: (date, info) => {
|
|
11924
12062
|
setSelectedDate(date);
|
|
11925
12063
|
setCalendarValue(date);
|
|
12064
|
+
if (info?.source === "date") {
|
|
12065
|
+
trackCallbacks?.onDateSelect?.({
|
|
12066
|
+
date: date.format("YYYY-MM-DD")
|
|
12067
|
+
});
|
|
12068
|
+
}
|
|
11926
12069
|
},
|
|
11927
12070
|
onPanelChange: (date) => {
|
|
11928
12071
|
setCalendarValue(date);
|
|
@@ -12010,6 +12153,10 @@ var DateTimePicker2 = ({
|
|
|
12010
12153
|
onClick: () => {
|
|
12011
12154
|
const newDate = value.subtract(1, "month");
|
|
12012
12155
|
onChange(newDate);
|
|
12156
|
+
trackCallbacks?.onMonthChange?.({
|
|
12157
|
+
direction: "left",
|
|
12158
|
+
month: newDate.format("YYYY-MM")
|
|
12159
|
+
});
|
|
12013
12160
|
},
|
|
12014
12161
|
className: "w-10 h-10 flex items-center justify-center hover:bg-gray-100 rounded-lg transition-colors",
|
|
12015
12162
|
children: /* @__PURE__ */ jsx(
|
|
@@ -12040,6 +12187,10 @@ var DateTimePicker2 = ({
|
|
|
12040
12187
|
onClick: () => {
|
|
12041
12188
|
const newDate = value.add(1, "month");
|
|
12042
12189
|
onChange(newDate);
|
|
12190
|
+
trackCallbacks?.onMonthChange?.({
|
|
12191
|
+
direction: "right",
|
|
12192
|
+
month: newDate.format("YYYY-MM")
|
|
12193
|
+
});
|
|
12043
12194
|
},
|
|
12044
12195
|
className: "w-10 h-10 flex items-center justify-center hover:bg-gray-100 rounded-lg transition-colors",
|
|
12045
12196
|
children: /* @__PURE__ */ jsx(
|
|
@@ -12087,6 +12238,10 @@ var DateTimePicker2 = ({
|
|
|
12087
12238
|
if (!newDate.isBefore(dayjs4(), "day")) {
|
|
12088
12239
|
setSelectedDate(newDate);
|
|
12089
12240
|
setCalendarValue(newDate);
|
|
12241
|
+
trackCallbacks?.onDateStepClick?.({
|
|
12242
|
+
direction: "left",
|
|
12243
|
+
date: newDate.format("YYYY-MM-DD")
|
|
12244
|
+
});
|
|
12090
12245
|
}
|
|
12091
12246
|
}
|
|
12092
12247
|
},
|
|
@@ -12120,6 +12275,10 @@ var DateTimePicker2 = ({
|
|
|
12120
12275
|
const newDate = selectedDate.add(1, "day");
|
|
12121
12276
|
setSelectedDate(newDate);
|
|
12122
12277
|
setCalendarValue(newDate);
|
|
12278
|
+
trackCallbacks?.onDateStepClick?.({
|
|
12279
|
+
direction: "right",
|
|
12280
|
+
date: newDate.format("YYYY-MM-DD")
|
|
12281
|
+
});
|
|
12123
12282
|
}
|
|
12124
12283
|
},
|
|
12125
12284
|
disabled: !selectedDate,
|
|
@@ -12156,6 +12315,10 @@ var DateTimePicker2 = ({
|
|
|
12156
12315
|
onClick: () => {
|
|
12157
12316
|
if (isAvailable) {
|
|
12158
12317
|
setSelectedTimeslotId(slot.id);
|
|
12318
|
+
trackCallbacks?.onTimeslotSelect?.({
|
|
12319
|
+
slotId: slot.id,
|
|
12320
|
+
label: formatTimeslot(slot)
|
|
12321
|
+
});
|
|
12159
12322
|
}
|
|
12160
12323
|
},
|
|
12161
12324
|
className: `
|
|
@@ -12193,6 +12356,9 @@ var DateTimePicker2 = ({
|
|
|
12193
12356
|
selectedTimeslotId,
|
|
12194
12357
|
error: bookingError || editError,
|
|
12195
12358
|
initialResponses,
|
|
12359
|
+
onFormStart: trackCallbacks?.onFormStart,
|
|
12360
|
+
onFormFieldChange: trackCallbacks?.onFormFieldChange,
|
|
12361
|
+
onFormSubmit: trackCallbacks?.onFormSubmit,
|
|
12196
12362
|
onCancel: () => {
|
|
12197
12363
|
onBookingSuccess?.(token || "");
|
|
12198
12364
|
},
|
|
@@ -12275,6 +12441,8 @@ var DemoRoomDetail2 = ({
|
|
|
12275
12441
|
openInGoogleMaps: "Open in Google Maps",
|
|
12276
12442
|
demoRoomImages: "Demo Room Images"
|
|
12277
12443
|
},
|
|
12444
|
+
onGoogleMapsClick,
|
|
12445
|
+
onImageSlideChange,
|
|
12278
12446
|
className,
|
|
12279
12447
|
...props
|
|
12280
12448
|
}) => {
|
|
@@ -12303,6 +12471,7 @@ var DemoRoomDetail2 = ({
|
|
|
12303
12471
|
}
|
|
12304
12472
|
return "#";
|
|
12305
12473
|
})();
|
|
12474
|
+
const userSlideTriggerRef = useRef(null);
|
|
12306
12475
|
const isLoading = isManagedByParent ? !!demoRoomLoading : loading && shouldFetch;
|
|
12307
12476
|
if (isLoading) {
|
|
12308
12477
|
return /* @__PURE__ */ jsx("div", { className: cn("w-full pb-4", className), ...props, children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-8 items-start", children: [
|
|
@@ -12416,6 +12585,12 @@ var DemoRoomDetail2 = ({
|
|
|
12416
12585
|
href: googleMapsLink,
|
|
12417
12586
|
target: "_blank",
|
|
12418
12587
|
rel: "noopener noreferrer",
|
|
12588
|
+
onClick: () => {
|
|
12589
|
+
onGoogleMapsClick?.({
|
|
12590
|
+
demoRoomName: title,
|
|
12591
|
+
url: googleMapsLink
|
|
12592
|
+
});
|
|
12593
|
+
},
|
|
12419
12594
|
className: "inline-flex items-center gap-1 text-sm text-blue-600 hover:text-blue-700 mt-1 underline",
|
|
12420
12595
|
children: [
|
|
12421
12596
|
pageData.openInGoogleMaps,
|
|
@@ -12445,8 +12620,27 @@ var DemoRoomDetail2 = ({
|
|
|
12445
12620
|
] })
|
|
12446
12621
|
] })
|
|
12447
12622
|
] }),
|
|
12448
|
-
images.length > 0 && /* @__PURE__ */ jsxs(
|
|
12449
|
-
|
|
12623
|
+
images.length > 0 && /* @__PURE__ */ jsxs(
|
|
12624
|
+
"div",
|
|
12625
|
+
{
|
|
12626
|
+
className: "relative l:w-full min-l:h-[400px] rounded-2xl overflow-hidden demo-room-swiper",
|
|
12627
|
+
onClickCapture: (e) => {
|
|
12628
|
+
const target = e.target;
|
|
12629
|
+
const bullet = target.closest(".swiper-pagination-bullet");
|
|
12630
|
+
if (bullet && !bullet.classList.contains("swiper-pagination-bullet-active")) {
|
|
12631
|
+
userSlideTriggerRef.current = "pagination";
|
|
12632
|
+
return;
|
|
12633
|
+
}
|
|
12634
|
+
if (target.closest(".swiper-button-prev")) {
|
|
12635
|
+
userSlideTriggerRef.current = "prev";
|
|
12636
|
+
return;
|
|
12637
|
+
}
|
|
12638
|
+
if (target.closest(".swiper-button-next")) {
|
|
12639
|
+
userSlideTriggerRef.current = "next";
|
|
12640
|
+
}
|
|
12641
|
+
},
|
|
12642
|
+
children: [
|
|
12643
|
+
/* @__PURE__ */ jsx("style", { children: `
|
|
12450
12644
|
.demo-room-swiper .swiper-pagination-bullet {
|
|
12451
12645
|
background-color: rgba(255, 255, 255, 0.5);
|
|
12452
12646
|
}
|
|
@@ -12476,31 +12670,53 @@ var DemoRoomDetail2 = ({
|
|
|
12476
12670
|
right: 16px !important;
|
|
12477
12671
|
}
|
|
12478
12672
|
` }),
|
|
12479
|
-
|
|
12480
|
-
|
|
12481
|
-
{
|
|
12482
|
-
modules: [Navigation, Pagination, Autoplay],
|
|
12483
|
-
spaceBetween: 0,
|
|
12484
|
-
slidesPerView: 1,
|
|
12485
|
-
navigation: images.length > 1,
|
|
12486
|
-
pagination: images.length > 1 ? { clickable: true } : false,
|
|
12487
|
-
autoplay: images.length > 1 ? {
|
|
12488
|
-
delay: 3e3,
|
|
12489
|
-
disableOnInteraction: false
|
|
12490
|
-
} : false,
|
|
12491
|
-
loop: images.length > 1,
|
|
12492
|
-
className: "h-full rounded-2xl",
|
|
12493
|
-
children: images.map((img, index) => /* @__PURE__ */ jsx(SwiperSlide, { children: /* @__PURE__ */ jsx("div", { className: "relative w-full h-full bg-gray-100", children: /* @__PURE__ */ jsx(
|
|
12494
|
-
"img",
|
|
12673
|
+
/* @__PURE__ */ jsx(
|
|
12674
|
+
Swiper2,
|
|
12495
12675
|
{
|
|
12496
|
-
|
|
12497
|
-
|
|
12498
|
-
|
|
12676
|
+
modules: [Navigation, Pagination, Autoplay],
|
|
12677
|
+
spaceBetween: 0,
|
|
12678
|
+
slidesPerView: 1,
|
|
12679
|
+
navigation: images.length > 1,
|
|
12680
|
+
pagination: images.length > 1 ? { clickable: true } : false,
|
|
12681
|
+
autoplay: images.length > 1 ? {
|
|
12682
|
+
delay: 3e3,
|
|
12683
|
+
disableOnInteraction: false
|
|
12684
|
+
} : false,
|
|
12685
|
+
loop: images.length > 1,
|
|
12686
|
+
className: "h-full rounded-2xl",
|
|
12687
|
+
onSliderFirstMove: () => {
|
|
12688
|
+
userSlideTriggerRef.current = "swipe";
|
|
12689
|
+
},
|
|
12690
|
+
onTouchEnd: () => {
|
|
12691
|
+
setTimeout(() => {
|
|
12692
|
+
if (userSlideTriggerRef.current === "swipe") {
|
|
12693
|
+
userSlideTriggerRef.current = null;
|
|
12694
|
+
}
|
|
12695
|
+
}, 0);
|
|
12696
|
+
},
|
|
12697
|
+
onSlideChange: (swiper) => {
|
|
12698
|
+
const trigger = userSlideTriggerRef.current;
|
|
12699
|
+
if (!trigger) return;
|
|
12700
|
+
userSlideTriggerRef.current = null;
|
|
12701
|
+
onImageSlideChange?.({
|
|
12702
|
+
trigger,
|
|
12703
|
+
activeIndex: swiper.realIndex,
|
|
12704
|
+
imageUrl: images[swiper.realIndex] || ""
|
|
12705
|
+
});
|
|
12706
|
+
},
|
|
12707
|
+
children: images.map((img, index) => /* @__PURE__ */ jsx(SwiperSlide, { children: /* @__PURE__ */ jsx("div", { className: "relative w-full h-full bg-gray-100", children: /* @__PURE__ */ jsx(
|
|
12708
|
+
"img",
|
|
12709
|
+
{
|
|
12710
|
+
src: img,
|
|
12711
|
+
alt: `Demo room view ${index + 1}`,
|
|
12712
|
+
className: "w-full h-full object-cover"
|
|
12713
|
+
}
|
|
12714
|
+
) }) }, index))
|
|
12499
12715
|
}
|
|
12500
|
-
)
|
|
12501
|
-
|
|
12502
|
-
|
|
12503
|
-
|
|
12716
|
+
)
|
|
12717
|
+
]
|
|
12718
|
+
}
|
|
12719
|
+
)
|
|
12504
12720
|
]
|
|
12505
12721
|
}
|
|
12506
12722
|
) });
|
|
@@ -12532,7 +12748,8 @@ function buildMirWelcomeUrl({
|
|
|
12532
12748
|
credential,
|
|
12533
12749
|
currentUrl,
|
|
12534
12750
|
managerIdParam = "email",
|
|
12535
|
-
credentialParam = "credential"
|
|
12751
|
+
credentialParam = "credential",
|
|
12752
|
+
ref
|
|
12536
12753
|
}) {
|
|
12537
12754
|
const url = new URL(baseUrl);
|
|
12538
12755
|
if (language) {
|
|
@@ -12541,26 +12758,72 @@ function buildMirWelcomeUrl({
|
|
|
12541
12758
|
url.searchParams.set("countrycode", countrycode);
|
|
12542
12759
|
url.searchParams.set(managerIdParam, managerId);
|
|
12543
12760
|
url.searchParams.set(credentialParam, credential);
|
|
12761
|
+
if (ref) {
|
|
12762
|
+
url.searchParams.set("ref", ref);
|
|
12763
|
+
}
|
|
12544
12764
|
const redirectSource = sanitizeRedirectSource(
|
|
12545
12765
|
currentUrl ?? (typeof window !== "undefined" ? window.location.href : "")
|
|
12546
12766
|
);
|
|
12547
12767
|
url.searchParams.set("redirect_url", encodeURIComponent(redirectSource));
|
|
12548
12768
|
return url.toString();
|
|
12549
12769
|
}
|
|
12550
|
-
var
|
|
12770
|
+
var PurposeCheckedIcon = () => /* @__PURE__ */ jsxs(
|
|
12551
12771
|
"svg",
|
|
12552
12772
|
{
|
|
12553
12773
|
xmlns: "http://www.w3.org/2000/svg",
|
|
12554
|
-
width: "
|
|
12555
|
-
height: "
|
|
12556
|
-
viewBox: "0 0
|
|
12774
|
+
width: "20",
|
|
12775
|
+
height: "20",
|
|
12776
|
+
viewBox: "0 0 20 20",
|
|
12557
12777
|
fill: "none",
|
|
12558
12778
|
"aria-hidden": "true",
|
|
12779
|
+
className: "shrink-0",
|
|
12780
|
+
children: [
|
|
12781
|
+
/* @__PURE__ */ jsx("rect", { x: "0.8", y: "0.8", width: "18.4", height: "18.4", rx: "9.2", fill: "#000F16" }),
|
|
12782
|
+
/* @__PURE__ */ jsx(
|
|
12783
|
+
"rect",
|
|
12784
|
+
{
|
|
12785
|
+
x: "0.8",
|
|
12786
|
+
y: "0.8",
|
|
12787
|
+
width: "18.4",
|
|
12788
|
+
height: "18.4",
|
|
12789
|
+
rx: "9.2",
|
|
12790
|
+
stroke: "#000F16",
|
|
12791
|
+
strokeWidth: "1.6"
|
|
12792
|
+
}
|
|
12793
|
+
),
|
|
12794
|
+
/* @__PURE__ */ jsx(
|
|
12795
|
+
"path",
|
|
12796
|
+
{
|
|
12797
|
+
d: "M6 9.58333L8.94737 12.5L14 7.5",
|
|
12798
|
+
strokeWidth: "1.6",
|
|
12799
|
+
strokeLinecap: "round",
|
|
12800
|
+
strokeLinejoin: "round",
|
|
12801
|
+
stroke: "white"
|
|
12802
|
+
}
|
|
12803
|
+
)
|
|
12804
|
+
]
|
|
12805
|
+
}
|
|
12806
|
+
);
|
|
12807
|
+
var PurposeRadioIcon = () => /* @__PURE__ */ jsx(
|
|
12808
|
+
"svg",
|
|
12809
|
+
{
|
|
12810
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
12811
|
+
width: "20",
|
|
12812
|
+
height: "20",
|
|
12813
|
+
viewBox: "0 0 20 20",
|
|
12814
|
+
fill: "none",
|
|
12815
|
+
"aria-hidden": "true",
|
|
12816
|
+
className: "shrink-0",
|
|
12559
12817
|
children: /* @__PURE__ */ jsx(
|
|
12560
|
-
"
|
|
12818
|
+
"rect",
|
|
12561
12819
|
{
|
|
12562
|
-
|
|
12563
|
-
|
|
12820
|
+
x: "0.8",
|
|
12821
|
+
y: "0.8",
|
|
12822
|
+
width: "18.4",
|
|
12823
|
+
height: "18.4",
|
|
12824
|
+
rx: "9.2",
|
|
12825
|
+
stroke: "currentColor",
|
|
12826
|
+
strokeWidth: "1.6"
|
|
12564
12827
|
}
|
|
12565
12828
|
)
|
|
12566
12829
|
}
|
|
@@ -12633,6 +12896,8 @@ var BookingFormO2O = ({
|
|
|
12633
12896
|
timezone: timezone5,
|
|
12634
12897
|
handleBookingSuccess,
|
|
12635
12898
|
onQuestionnaireSubmit,
|
|
12899
|
+
podDesignRef,
|
|
12900
|
+
trackCallbacks,
|
|
12636
12901
|
...props
|
|
12637
12902
|
}) => {
|
|
12638
12903
|
const apiClient = useMemo(
|
|
@@ -12730,7 +12995,8 @@ var BookingFormO2O = ({
|
|
|
12730
12995
|
managerId: effectiveStoreManagerId,
|
|
12731
12996
|
credential: effectiveMirSessionId,
|
|
12732
12997
|
managerIdParam: "store_manager_id",
|
|
12733
|
-
credentialParam: "sessionid"
|
|
12998
|
+
credentialParam: "sessionid",
|
|
12999
|
+
ref: podDesignRef
|
|
12734
13000
|
});
|
|
12735
13001
|
}
|
|
12736
13002
|
if (!managerId) return void 0;
|
|
@@ -12741,7 +13007,8 @@ var BookingFormO2O = ({
|
|
|
12741
13007
|
language: apiConfig?.podLanguage,
|
|
12742
13008
|
countrycode: apiConfig?.podCountry,
|
|
12743
13009
|
managerId,
|
|
12744
|
-
credential: mirCredential
|
|
13010
|
+
credential: mirCredential,
|
|
13011
|
+
ref: podDesignRef
|
|
12745
13012
|
});
|
|
12746
13013
|
}, [
|
|
12747
13014
|
isPodButtonDisabled,
|
|
@@ -12753,7 +13020,8 @@ var BookingFormO2O = ({
|
|
|
12753
13020
|
apiConfig?.podCountry,
|
|
12754
13021
|
mirCredential,
|
|
12755
13022
|
effectiveStoreManagerId,
|
|
12756
|
-
effectiveMirSessionId
|
|
13023
|
+
effectiveMirSessionId,
|
|
13024
|
+
podDesignRef
|
|
12757
13025
|
]);
|
|
12758
13026
|
const dateTimePickerPageData = useMemo(
|
|
12759
13027
|
() => ({
|
|
@@ -12772,7 +13040,9 @@ var BookingFormO2O = ({
|
|
|
12772
13040
|
demoRoom,
|
|
12773
13041
|
demoRoomLoading,
|
|
12774
13042
|
locale: apiConfig.locale,
|
|
12775
|
-
pageData: pageData?.demoRoomDetail
|
|
13043
|
+
pageData: pageData?.demoRoomDetail,
|
|
13044
|
+
onGoogleMapsClick: trackCallbacks?.onGoogleMapsClick,
|
|
13045
|
+
onImageSlideChange: trackCallbacks?.onImageSlideChange
|
|
12776
13046
|
}
|
|
12777
13047
|
) }),
|
|
12778
13048
|
/* @__PURE__ */ jsxs("div", { className: "bg-[#f5f5f5]", children: [
|
|
@@ -12794,44 +13064,91 @@ var BookingFormO2O = ({
|
|
|
12794
13064
|
isPodSelected && "grid-cols-2"
|
|
12795
13065
|
),
|
|
12796
13066
|
children: [
|
|
12797
|
-
/* @__PURE__ */ jsxs(
|
|
12798
|
-
|
|
12799
|
-
|
|
12800
|
-
|
|
12801
|
-
|
|
12802
|
-
|
|
12803
|
-
|
|
12804
|
-
|
|
12805
|
-
),
|
|
12806
|
-
/* @__PURE__ */ jsxs("div", { className: "relative mt-[14px]", children: [
|
|
12807
|
-
/* @__PURE__ */ jsx(
|
|
12808
|
-
"select",
|
|
12809
|
-
{
|
|
12810
|
-
id: "booking-purpose-select",
|
|
12811
|
-
value: selectedPurpose?.type || "",
|
|
12812
|
-
onChange: (event2) => {
|
|
12813
|
-
setSelectedPurposeType(event2.target.value);
|
|
12814
|
-
setIsPurposeConfirmed(true);
|
|
12815
|
-
},
|
|
12816
|
-
disabled: !!token,
|
|
12817
|
-
className: cn(
|
|
12818
|
-
"h-[48px] w-full appearance-none rounded-[8px] border border-[#D9DCE1] bg-white px-[16px] pr-[48px] text-[16px] font-medium text-[#2A2C32] outline-none transition-colors focus:border-[#080A0F] focus:ring-2 focus:ring-[#3ADB67]/30 l:text-[14px]",
|
|
12819
|
-
token && "pointer-events-none cursor-not-allowed opacity-50"
|
|
12820
|
-
),
|
|
12821
|
-
children: purposeOptions.map((item, index) => /* @__PURE__ */ jsx(
|
|
12822
|
-
"option",
|
|
12823
|
-
{
|
|
12824
|
-
value: item.type || "",
|
|
12825
|
-
children: item.label || item.type
|
|
12826
|
-
},
|
|
12827
|
-
`${item.type || item.label || "purpose"}-${index}`
|
|
12828
|
-
))
|
|
12829
|
-
}
|
|
13067
|
+
/* @__PURE__ */ jsxs(
|
|
13068
|
+
"section",
|
|
13069
|
+
{
|
|
13070
|
+
className: cn(
|
|
13071
|
+
"flex flex-col rounded-[16px] bg-white px-[32px] py-[24px] l:px-[16px] l:py-[20px]",
|
|
13072
|
+
// 双栏时左卡高度由右侧 POD 卡撑开(与下拉版一致),选项列表内部滚动,
|
|
13073
|
+
// 避免选项+说明过多把左卡撑得比右卡高;h-0 让本卡不参与 grid 行高计算
|
|
13074
|
+
isPodSelected && "min-l:h-0 min-l:min-h-full min-l:overflow-hidden"
|
|
12830
13075
|
),
|
|
12831
|
-
|
|
12832
|
-
|
|
12833
|
-
|
|
12834
|
-
|
|
13076
|
+
children: [
|
|
13077
|
+
/* @__PURE__ */ jsx(
|
|
13078
|
+
"p",
|
|
13079
|
+
{
|
|
13080
|
+
id: "booking-purpose-label",
|
|
13081
|
+
className: "block text-[16px] font-bold text-[#080A0F] l:text-[14px]",
|
|
13082
|
+
children: getPurposeLabel(pageData)
|
|
13083
|
+
}
|
|
13084
|
+
),
|
|
13085
|
+
/* @__PURE__ */ jsx(
|
|
13086
|
+
"div",
|
|
13087
|
+
{
|
|
13088
|
+
role: "radiogroup",
|
|
13089
|
+
"aria-labelledby": "booking-purpose-label",
|
|
13090
|
+
className: cn(
|
|
13091
|
+
"mt-[14px] flex min-h-0 flex-col gap-[16px] overflow-y-auto pr-[4px]",
|
|
13092
|
+
// 仅桌面双栏时列表受右卡高度约束内部滚动;独占一行(未选 POD / 移动端)不限高
|
|
13093
|
+
isPodSelected && "min-l:flex-1"
|
|
13094
|
+
),
|
|
13095
|
+
children: purposeOptions.map((item, index) => {
|
|
13096
|
+
const isSelected = !!item.type && selectedPurpose?.type === item.type;
|
|
13097
|
+
const selectItem = () => {
|
|
13098
|
+
if (token) return;
|
|
13099
|
+
setSelectedPurposeType(item.type || "");
|
|
13100
|
+
setIsPurposeConfirmed(true);
|
|
13101
|
+
};
|
|
13102
|
+
return /* @__PURE__ */ jsxs(
|
|
13103
|
+
"div",
|
|
13104
|
+
{
|
|
13105
|
+
role: "radio",
|
|
13106
|
+
"aria-checked": isSelected,
|
|
13107
|
+
tabIndex: token ? -1 : 0,
|
|
13108
|
+
onClick: selectItem,
|
|
13109
|
+
onKeyDown: (event2) => {
|
|
13110
|
+
if (event2.key === "Enter" || event2.key === " ") {
|
|
13111
|
+
event2.preventDefault();
|
|
13112
|
+
selectItem();
|
|
13113
|
+
}
|
|
13114
|
+
},
|
|
13115
|
+
className: cn(
|
|
13116
|
+
"shrink-0 cursor-pointer overflow-hidden rounded-[8px] bg-[#F5F6F7] outline-none",
|
|
13117
|
+
token && "pointer-events-none cursor-not-allowed"
|
|
13118
|
+
),
|
|
13119
|
+
children: [
|
|
13120
|
+
/* @__PURE__ */ jsxs(
|
|
13121
|
+
"div",
|
|
13122
|
+
{
|
|
13123
|
+
className: cn(
|
|
13124
|
+
"group flex h-[60px] w-full items-center gap-[12px] px-[16px] text-left text-[16px] font-bold text-[#000F16] transition-[box-shadow,color] l:text-[14px]",
|
|
13125
|
+
isSelected ? "bg-[#93E0EC]" : "rounded-[8px] bg-white text-[#5A5E66] shadow-[inset_0_0_0_1px_#D9DCE1] hover:text-[#000F16] hover:shadow-[inset_0_0_0_1.6px_#00CBEB]"
|
|
13126
|
+
),
|
|
13127
|
+
children: [
|
|
13128
|
+
/* @__PURE__ */ jsx(
|
|
13129
|
+
"span",
|
|
13130
|
+
{
|
|
13131
|
+
className: cn(
|
|
13132
|
+
!isSelected && "text-[#D9DCE1] group-hover:text-[#00CBEB]"
|
|
13133
|
+
),
|
|
13134
|
+
children: isSelected ? /* @__PURE__ */ jsx(PurposeCheckedIcon, {}) : /* @__PURE__ */ jsx(PurposeRadioIcon, {})
|
|
13135
|
+
}
|
|
13136
|
+
),
|
|
13137
|
+
item.label || item.type
|
|
13138
|
+
]
|
|
13139
|
+
}
|
|
13140
|
+
),
|
|
13141
|
+
!!item.purposeNote && /* @__PURE__ */ jsx("p", { className: " px-[16px] py-[8px] text-[14px] font-medium leading-[1.35] text-[#080A0F] l:text-[13px]", children: item.purposeNote })
|
|
13142
|
+
]
|
|
13143
|
+
},
|
|
13144
|
+
`${item.type || item.label || "purpose"}-${index}`
|
|
13145
|
+
);
|
|
13146
|
+
})
|
|
13147
|
+
}
|
|
13148
|
+
)
|
|
13149
|
+
]
|
|
13150
|
+
}
|
|
13151
|
+
),
|
|
12835
13152
|
isPodSelected && !!selectedPodContent && /* @__PURE__ */ jsxs("section", { className: "rounded-[16px] bg-white px-[28px] py-[20px] l:px-[16px] l:py-[20px]", children: [
|
|
12836
13153
|
!!selectedPodContent.title && /* @__PURE__ */ jsx("h2", { className: "text-[16px] font-bold text-[#080A0F] l:text-[14px]", children: selectedPodContent.title }),
|
|
12837
13154
|
!!selectedPodDescription && /* @__PURE__ */ jsx("p", { className: "mt-[6px] text-[13px] font-medium leading-[1.35] text-[#080A0F] l:text-[12px]", children: selectedPodDescription }),
|
|
@@ -12853,7 +13170,15 @@ var BookingFormO2O = ({
|
|
|
12853
13170
|
"aria-disabled": isPodButtonDisabled,
|
|
12854
13171
|
tabIndex: isPodButtonDisabled ? -1 : void 0,
|
|
12855
13172
|
onClick: (event2) => {
|
|
12856
|
-
if (isPodButtonDisabled)
|
|
13173
|
+
if (isPodButtonDisabled) {
|
|
13174
|
+
event2.preventDefault();
|
|
13175
|
+
return;
|
|
13176
|
+
}
|
|
13177
|
+
trackCallbacks?.onPodDesignClick?.({
|
|
13178
|
+
buttonText: selectedPodButtonText || "",
|
|
13179
|
+
url: selectedPodButtonLink || "",
|
|
13180
|
+
isEditMode: isPodDesignEditMode
|
|
13181
|
+
});
|
|
12857
13182
|
},
|
|
12858
13183
|
rel: "noopener noreferrer",
|
|
12859
13184
|
className: cn(
|
|
@@ -12911,7 +13236,8 @@ var BookingFormO2O = ({
|
|
|
12911
13236
|
onQuestionnaireSubmit,
|
|
12912
13237
|
pageData: dateTimePickerPageData,
|
|
12913
13238
|
selectedPurposeType: selectedPurpose?.type,
|
|
12914
|
-
podDesignId: mirSessionId
|
|
13239
|
+
podDesignId: mirSessionId,
|
|
13240
|
+
trackCallbacks
|
|
12915
13241
|
}
|
|
12916
13242
|
) })
|
|
12917
13243
|
] })
|