@reblu/site-blocks 0.27.0 → 0.29.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/CHANGELOG.md +17 -0
- package/README.md +188 -1
- package/dist/index.cjs +757 -274
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +245 -5
- package/dist/index.d.ts +245 -5
- package/dist/index.js +744 -273
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -22,16 +22,23 @@ var src_exports = {};
|
|
|
22
22
|
__export(src_exports, {
|
|
23
23
|
ALLOWED_YOUTUBE_HOSTS: () => ALLOWED_YOUTUBE_HOSTS,
|
|
24
24
|
AddedToCartToast: () => AddedToCartToast,
|
|
25
|
+
ArbitrationBadge: () => ArbitrationBadge,
|
|
25
26
|
CartAdjustmentsNotice: () => CartAdjustmentsNotice,
|
|
26
27
|
CartLineList: () => CartLineList,
|
|
27
28
|
CartSummary: () => CartSummary,
|
|
29
|
+
CheckoutDeliveryChoice: () => CheckoutDeliveryChoice,
|
|
28
30
|
CheckoutForm: () => CheckoutForm,
|
|
29
31
|
CheckoutLoginPrompt: () => CheckoutLoginPrompt,
|
|
32
|
+
CheckoutPayAction: () => CheckoutPayAction,
|
|
33
|
+
CheckoutQuoteSummary: () => CheckoutQuoteSummary,
|
|
34
|
+
CheckoutTermsAcceptance: () => CheckoutTermsAcceptance,
|
|
30
35
|
ContactInterestField: () => ContactInterestField,
|
|
31
36
|
CourseCatalogFilters: () => CourseCatalogFilters,
|
|
32
37
|
CourseDescription: () => CourseDescription,
|
|
33
38
|
CoursePurchaseTerms: () => CoursePurchaseTerms,
|
|
34
39
|
DATA_REQUEST_TYPES: () => import_site_contracts.DATA_REQUEST_TYPES,
|
|
40
|
+
DEFAULT_CHECKOUT_DELIVERY_CHOICE_LABELS: () => DEFAULT_CHECKOUT_DELIVERY_CHOICE_LABELS,
|
|
41
|
+
DEFAULT_CHECKOUT_QUOTE_SUMMARY_LABELS: () => DEFAULT_CHECKOUT_QUOTE_SUMMARY_LABELS,
|
|
35
42
|
DEFAULT_COURSE_CATALOG_FILTERS_LABELS: () => DEFAULT_COURSE_CATALOG_FILTERS_LABELS,
|
|
36
43
|
DEFAULT_COURSE_PRICE_BANDS: () => DEFAULT_COURSE_PRICE_BANDS,
|
|
37
44
|
DEFAULT_COURSE_PURCHASE_TERMS_LABELS: () => DEFAULT_COURSE_PURCHASE_TERMS_LABELS,
|
|
@@ -43,6 +50,7 @@ __export(src_exports, {
|
|
|
43
50
|
DEFAULT_TRUST_BADGE_HEADINGS: () => DEFAULT_TRUST_BADGE_HEADINGS,
|
|
44
51
|
DEFAULT_TRUST_BADGE_TYPE_ORDER: () => DEFAULT_TRUST_BADGE_TYPE_ORDER,
|
|
45
52
|
DEFAULT_TRUST_ICONS: () => DEFAULT_TRUST_ICONS,
|
|
53
|
+
EMPTY_CHECKOUT_ADDRESS: () => EMPTY_CHECKOUT_ADDRESS,
|
|
46
54
|
EMPTY_FULL_INVOICE_VALUE: () => EMPTY_FULL_INVOICE_VALUE,
|
|
47
55
|
FaqAccordion: () => FaqAccordion,
|
|
48
56
|
FullInvoiceFields: () => FullInvoiceFields,
|
|
@@ -66,17 +74,21 @@ __export(src_exports, {
|
|
|
66
74
|
buildFaqPageJsonLd: () => buildFaqPageJsonLd,
|
|
67
75
|
buildShareUrls: () => buildShareUrls,
|
|
68
76
|
collectFaqItems: () => collectFaqItems,
|
|
77
|
+
defaultCheckoutFulfillment: () => defaultCheckoutFulfillment,
|
|
69
78
|
formatPrice: () => formatPrice,
|
|
70
79
|
getShopErrorMessage: () => getShopErrorMessage,
|
|
71
80
|
isAllowedYouTubeHost: () => isAllowedYouTubeHost,
|
|
72
81
|
isOverSimplifiedInvoiceCap: () => isOverSimplifiedInvoiceCap,
|
|
73
82
|
markdownToPlainText: () => markdownToPlainText,
|
|
74
83
|
markdownToSafeHtml: () => markdownToSafeHtml,
|
|
84
|
+
quoteRequiresDelivery: () => quoteRequiresDelivery,
|
|
75
85
|
readingTime: () => readingTime,
|
|
76
86
|
sanitizeHtml: () => sanitizeHtml,
|
|
77
87
|
shopIssuesInvoices: () => shopIssuesInvoices,
|
|
78
88
|
shouldRenderShopFilters: () => shouldRenderShopFilters,
|
|
79
|
-
|
|
89
|
+
toCheckoutFulfillmentFields: () => toCheckoutFulfillmentFields,
|
|
90
|
+
toCheckoutInvoiceFields: () => toCheckoutInvoiceFields,
|
|
91
|
+
toCheckoutTermsFields: () => toCheckoutTermsFields
|
|
80
92
|
});
|
|
81
93
|
module.exports = __toCommonJS(src_exports);
|
|
82
94
|
|
|
@@ -14369,6 +14381,33 @@ function FaqAccordion({
|
|
|
14369
14381
|
|
|
14370
14382
|
// src/components/trust-badges.tsx
|
|
14371
14383
|
var import_utils12 = require("@reblu/site-ui/utils");
|
|
14384
|
+
|
|
14385
|
+
// src/lib/trust-badge-media.ts
|
|
14386
|
+
var DEFAULT_ADHESION_NUMBER_LABEL = "N.\xBA de adhesi\xF3n";
|
|
14387
|
+
function safeHref(url) {
|
|
14388
|
+
if (typeof url !== "string") return null;
|
|
14389
|
+
try {
|
|
14390
|
+
const parsed = new URL(url);
|
|
14391
|
+
return parsed.protocol === "https:" || parsed.protocol === "http:" ? url : null;
|
|
14392
|
+
} catch {
|
|
14393
|
+
return null;
|
|
14394
|
+
}
|
|
14395
|
+
}
|
|
14396
|
+
function safeLogoSrc(url) {
|
|
14397
|
+
if (typeof url !== "string" || url === "") return null;
|
|
14398
|
+
if (url.startsWith("/")) return url.startsWith("//") || url.startsWith("/\\") ? null : url;
|
|
14399
|
+
return safeHref(url);
|
|
14400
|
+
}
|
|
14401
|
+
function adhesionNumberOf(badge) {
|
|
14402
|
+
const value = badge.adhesionNumber;
|
|
14403
|
+
return typeof value === "string" && value.trim() !== "" ? value.trim() : null;
|
|
14404
|
+
}
|
|
14405
|
+
function trustBadgeAlt(badge, numberLabel = DEFAULT_ADHESION_NUMBER_LABEL) {
|
|
14406
|
+
const number2 = adhesionNumberOf(badge);
|
|
14407
|
+
return number2 ? `${badge.name}. ${numberLabel} ${number2}` : badge.name;
|
|
14408
|
+
}
|
|
14409
|
+
|
|
14410
|
+
// src/components/trust-badges.tsx
|
|
14372
14411
|
var import_jsx_runtime16 = (
|
|
14373
14412
|
// eslint-disable-next-line @next/next/no-img-element -- framework-agnostic SDK; the SITE owns image optimisation
|
|
14374
14413
|
require("react/jsx-runtime")
|
|
@@ -14379,7 +14418,8 @@ var DEFAULT_TRUST_BADGE_HEADINGS = Object.freeze(
|
|
|
14379
14418
|
INSURANCE: "Aseguradoras",
|
|
14380
14419
|
SUBVENTION: "Financiaci\xF3n",
|
|
14381
14420
|
CERTIFICATION: "Certificaciones",
|
|
14382
|
-
AWARD: "Premios"
|
|
14421
|
+
AWARD: "Premios",
|
|
14422
|
+
CONSUMER_ARBITRATION: "Arbitraje de consumo"
|
|
14383
14423
|
}
|
|
14384
14424
|
);
|
|
14385
14425
|
var DEFAULT_TRUST_BADGE_TYPE_ORDER = Object.freeze([
|
|
@@ -14389,26 +14429,12 @@ var DEFAULT_TRUST_BADGE_TYPE_ORDER = Object.freeze([
|
|
|
14389
14429
|
"PARTNER",
|
|
14390
14430
|
"INSURANCE"
|
|
14391
14431
|
]);
|
|
14392
|
-
var KNOWN_TYPES = new Set(
|
|
14432
|
+
var KNOWN_TYPES = new Set(Object.keys(DEFAULT_TRUST_BADGE_HEADINGS));
|
|
14393
14433
|
function isUsable(value) {
|
|
14394
14434
|
if (typeof value !== "object" || value === null) return false;
|
|
14395
14435
|
const entry = value;
|
|
14396
14436
|
return typeof entry.type === "string" && KNOWN_TYPES.has(entry.type) && typeof entry.name === "string" && entry.name.trim() !== "";
|
|
14397
14437
|
}
|
|
14398
|
-
function safeHref(url) {
|
|
14399
|
-
if (typeof url !== "string") return null;
|
|
14400
|
-
try {
|
|
14401
|
-
const parsed = new URL(url);
|
|
14402
|
-
return parsed.protocol === "https:" || parsed.protocol === "http:" ? url : null;
|
|
14403
|
-
} catch {
|
|
14404
|
-
return null;
|
|
14405
|
-
}
|
|
14406
|
-
}
|
|
14407
|
-
function safeLogoSrc(url) {
|
|
14408
|
-
if (typeof url !== "string" || url === "") return null;
|
|
14409
|
-
if (url.startsWith("/")) return url.startsWith("//") || url.startsWith("/\\") ? null : url;
|
|
14410
|
-
return safeHref(url);
|
|
14411
|
-
}
|
|
14412
14438
|
function BadgeContent({ badge, logoClassName }) {
|
|
14413
14439
|
const src = safeLogoSrc(badge.logoUrl);
|
|
14414
14440
|
if (src) {
|
|
@@ -14416,7 +14442,7 @@ function BadgeContent({ badge, logoClassName }) {
|
|
|
14416
14442
|
"img",
|
|
14417
14443
|
{
|
|
14418
14444
|
src,
|
|
14419
|
-
alt: badge
|
|
14445
|
+
alt: trustBadgeAlt(badge),
|
|
14420
14446
|
loading: "lazy",
|
|
14421
14447
|
className: (0, import_utils12.cn)("h-12 w-auto object-contain", logoClassName)
|
|
14422
14448
|
}
|
|
@@ -14506,41 +14532,96 @@ function TrustBadges({
|
|
|
14506
14532
|
);
|
|
14507
14533
|
}
|
|
14508
14534
|
|
|
14509
|
-
// src/components/
|
|
14535
|
+
// src/components/arbitration-badge.tsx
|
|
14510
14536
|
var import_utils13 = require("@reblu/site-ui/utils");
|
|
14511
|
-
var import_button_variants2 = require("@reblu/site-ui/button-variants");
|
|
14512
14537
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
14538
|
+
function isArbitrationBadge(value) {
|
|
14539
|
+
if (typeof value !== "object" || value === null) return false;
|
|
14540
|
+
const entry = value;
|
|
14541
|
+
return entry.type === "CONSUMER_ARBITRATION" && typeof entry.name === "string" && entry.name.trim() !== "";
|
|
14542
|
+
}
|
|
14543
|
+
function ArbitrationBadge({
|
|
14544
|
+
badges,
|
|
14545
|
+
numberLabel = DEFAULT_ADHESION_NUMBER_LABEL,
|
|
14546
|
+
showNumber = true,
|
|
14547
|
+
newWindowLabel = "(se abre en una ventana nueva)",
|
|
14548
|
+
className,
|
|
14549
|
+
logoClassName,
|
|
14550
|
+
numberClassName
|
|
14551
|
+
}) {
|
|
14552
|
+
if (!Array.isArray(badges)) return null;
|
|
14553
|
+
const items = badges.filter(isArbitrationBadge);
|
|
14554
|
+
if (items.length === 0) return null;
|
|
14555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
14556
|
+
"ul",
|
|
14557
|
+
{
|
|
14558
|
+
"data-slot": "arbitration-badges",
|
|
14559
|
+
className: (0, import_utils13.cn)("flex flex-wrap items-start gap-6", className),
|
|
14560
|
+
children: items.map((badge) => {
|
|
14561
|
+
const src = safeLogoSrc(badge.logoUrl);
|
|
14562
|
+
const href = safeHref(badge.url);
|
|
14563
|
+
const number2 = adhesionNumberOf(badge);
|
|
14564
|
+
const caption = number2 && (showNumber || !src) ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: (0, import_utils13.cn)("text-xs", numberClassName), "aria-hidden": src ? "true" : void 0, children: `${numberLabel} ${number2}` }) : null;
|
|
14565
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "inline-flex flex-col items-center gap-1 text-center", children: [
|
|
14566
|
+
src ? (
|
|
14567
|
+
// eslint-disable-next-line @next/next/no-img-element -- framework-agnostic SDK; the SITE owns image optimisation
|
|
14568
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
14569
|
+
"img",
|
|
14570
|
+
{
|
|
14571
|
+
src,
|
|
14572
|
+
alt: trustBadgeAlt(badge, numberLabel),
|
|
14573
|
+
loading: "lazy",
|
|
14574
|
+
className: (0, import_utils13.cn)("h-16 w-auto object-contain", logoClassName)
|
|
14575
|
+
}
|
|
14576
|
+
)
|
|
14577
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-sm font-medium", children: badge.name }),
|
|
14578
|
+
caption
|
|
14579
|
+
] });
|
|
14580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("li", { "data-slot": "arbitration-badge", children: href ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("a", { href, target: "_blank", rel: "noopener noreferrer", className: "inline-flex", children: [
|
|
14581
|
+
content,
|
|
14582
|
+
" ",
|
|
14583
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "sr-only", children: newWindowLabel })
|
|
14584
|
+
] }) : content }, badge.id);
|
|
14585
|
+
})
|
|
14586
|
+
}
|
|
14587
|
+
);
|
|
14588
|
+
}
|
|
14589
|
+
|
|
14590
|
+
// src/components/page-blocks.tsx
|
|
14591
|
+
var import_utils14 = require("@reblu/site-ui/utils");
|
|
14592
|
+
var import_button_variants2 = require("@reblu/site-ui/button-variants");
|
|
14593
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
14513
14594
|
var ALIASES = {
|
|
14514
14595
|
doctor_embed: "profile_embed",
|
|
14515
14596
|
specialty_embed: "page_embed"
|
|
14516
14597
|
};
|
|
14517
14598
|
function HeroBlock({ block, headingLevel }) {
|
|
14518
14599
|
const { title, subtitle, imageUrl } = block.data;
|
|
14519
|
-
return /* @__PURE__ */ (0,
|
|
14520
|
-
/* @__PURE__ */ (0,
|
|
14521
|
-
subtitle && /* @__PURE__ */ (0,
|
|
14522
|
-
imageUrl && /* @__PURE__ */ (0,
|
|
14600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "space-y-4", children: [
|
|
14601
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Heading, { level: headingLevel, className: "text-3xl font-bold tracking-tight md:text-4xl", children: title }),
|
|
14602
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-lg opacity-80", children: subtitle }),
|
|
14603
|
+
imageUrl && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "relative aspect-[21/9] w-full overflow-hidden rounded-xl bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("img", { src: imageUrl, alt: "", loading: "lazy", className: "h-full w-full object-cover" }) })
|
|
14523
14604
|
] });
|
|
14524
14605
|
}
|
|
14525
14606
|
function RichtextBlock({ block, headingLevel }) {
|
|
14526
|
-
return /* @__PURE__ */ (0,
|
|
14607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SafeHtml, { html: sanitizeHtml(block.data.html), headingOffset: headingLevel - 1 });
|
|
14527
14608
|
}
|
|
14528
14609
|
function FaqBlock({ block }) {
|
|
14529
|
-
return /* @__PURE__ */ (0,
|
|
14610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(FaqAccordion, { items: block.data.items });
|
|
14530
14611
|
}
|
|
14531
14612
|
function StatsBlock({ block }) {
|
|
14532
|
-
return /* @__PURE__ */ (0,
|
|
14533
|
-
/* @__PURE__ */ (0,
|
|
14534
|
-
/* @__PURE__ */ (0,
|
|
14613
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("dl", { className: "grid gap-6 sm:grid-cols-2 lg:grid-cols-4", children: block.data.items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-col-reverse gap-1", children: [
|
|
14614
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("dt", { className: "text-sm opacity-80", children: item.label }),
|
|
14615
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("dd", { className: "text-3xl font-bold", children: item.value })
|
|
14535
14616
|
] }, i)) });
|
|
14536
14617
|
}
|
|
14537
14618
|
function TestimonialBlock({ block }) {
|
|
14538
14619
|
const { quote, author, role, avatarUrl } = block.data;
|
|
14539
|
-
return /* @__PURE__ */ (0,
|
|
14540
|
-
/* @__PURE__ */ (0,
|
|
14541
|
-
/* @__PURE__ */ (0,
|
|
14620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("figure", { className: "space-y-4", children: [
|
|
14621
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("blockquote", { className: "text-xl italic", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { children: quote }) }),
|
|
14622
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("figcaption", { className: "flex items-center gap-3", children: [
|
|
14542
14623
|
avatarUrl && // eslint-disable-next-line @next/next/no-img-element
|
|
14543
|
-
/* @__PURE__ */ (0,
|
|
14624
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14544
14625
|
"img",
|
|
14545
14626
|
{
|
|
14546
14627
|
src: avatarUrl,
|
|
@@ -14549,9 +14630,9 @@ function TestimonialBlock({ block }) {
|
|
|
14549
14630
|
className: "h-10 w-10 rounded-full object-cover"
|
|
14550
14631
|
}
|
|
14551
14632
|
),
|
|
14552
|
-
/* @__PURE__ */ (0,
|
|
14553
|
-
/* @__PURE__ */ (0,
|
|
14554
|
-
role && /* @__PURE__ */ (0,
|
|
14633
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { children: [
|
|
14634
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "font-semibold", children: author }),
|
|
14635
|
+
role && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "block text-sm opacity-80", children: role })
|
|
14555
14636
|
] })
|
|
14556
14637
|
] })
|
|
14557
14638
|
] });
|
|
@@ -14560,19 +14641,19 @@ function CtaSlotBlock(_props) {
|
|
|
14560
14641
|
return null;
|
|
14561
14642
|
}
|
|
14562
14643
|
function FeatureListBlock({ block }) {
|
|
14563
|
-
return /* @__PURE__ */ (0,
|
|
14644
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("ul", { className: "grid list-disc gap-2 pl-5 sm:grid-cols-2", children: block.data.items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("li", { children: item.text }, i)) });
|
|
14564
14645
|
}
|
|
14565
14646
|
function GalleryBlock({ block }) {
|
|
14566
14647
|
const { images } = block.data;
|
|
14567
|
-
return /* @__PURE__ */ (0,
|
|
14648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14568
14649
|
"div",
|
|
14569
14650
|
{
|
|
14570
|
-
className: (0,
|
|
14651
|
+
className: (0, import_utils14.cn)(
|
|
14571
14652
|
"grid gap-4",
|
|
14572
14653
|
images.length > 1 ? "sm:grid-cols-2 lg:grid-cols-3" : "grid-cols-1"
|
|
14573
14654
|
),
|
|
14574
|
-
children: images.map((img, i) => /* @__PURE__ */ (0,
|
|
14575
|
-
/* @__PURE__ */ (0,
|
|
14655
|
+
children: images.map((img, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("figure", { className: "space-y-1", children: [
|
|
14656
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "relative aspect-video w-full overflow-hidden rounded-lg bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14576
14657
|
"img",
|
|
14577
14658
|
{
|
|
14578
14659
|
src: img.url,
|
|
@@ -14581,7 +14662,7 @@ function GalleryBlock({ block }) {
|
|
|
14581
14662
|
className: "h-full w-full object-cover"
|
|
14582
14663
|
}
|
|
14583
14664
|
) }),
|
|
14584
|
-
img.caption && /* @__PURE__ */ (0,
|
|
14665
|
+
img.caption && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("figcaption", { className: "text-sm opacity-80", children: img.caption })
|
|
14585
14666
|
] }, `${img.url}-${i}`))
|
|
14586
14667
|
}
|
|
14587
14668
|
);
|
|
@@ -14591,13 +14672,13 @@ function EmbedCard({
|
|
|
14591
14672
|
headingLevel,
|
|
14592
14673
|
embedHref
|
|
14593
14674
|
}) {
|
|
14594
|
-
return /* @__PURE__ */ (0,
|
|
14675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
14595
14676
|
"a",
|
|
14596
14677
|
{
|
|
14597
14678
|
href: embedHref(resolved),
|
|
14598
14679
|
className: "group block overflow-hidden rounded-xl border border-border bg-card text-card-foreground transition-shadow hover:shadow-md focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",
|
|
14599
14680
|
children: [
|
|
14600
|
-
resolved.coverImageUrl && /* @__PURE__ */ (0,
|
|
14681
|
+
resolved.coverImageUrl && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "aspect-video w-full overflow-hidden bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14601
14682
|
"img",
|
|
14602
14683
|
{
|
|
14603
14684
|
src: resolved.coverImageUrl,
|
|
@@ -14606,24 +14687,24 @@ function EmbedCard({
|
|
|
14606
14687
|
className: "h-full w-full object-cover"
|
|
14607
14688
|
}
|
|
14608
14689
|
) }),
|
|
14609
|
-
/* @__PURE__ */ (0,
|
|
14610
|
-
/* @__PURE__ */ (0,
|
|
14611
|
-
resolved.role && /* @__PURE__ */ (0,
|
|
14612
|
-
resolved.excerpt && /* @__PURE__ */ (0,
|
|
14690
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "space-y-1 p-4", children: [
|
|
14691
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Heading, { level: headingLevel, className: "text-lg font-semibold", children: resolved.title }),
|
|
14692
|
+
resolved.role && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-sm text-muted-foreground", children: resolved.role }),
|
|
14693
|
+
resolved.excerpt && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-muted-foreground", children: resolved.excerpt })
|
|
14613
14694
|
] })
|
|
14614
14695
|
]
|
|
14615
14696
|
}
|
|
14616
14697
|
);
|
|
14617
14698
|
}
|
|
14618
14699
|
function PageEmbedBlock({ block, headingLevel, embedHref }) {
|
|
14619
|
-
return /* @__PURE__ */ (0,
|
|
14700
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(EmbedCard, { resolved: block.resolved, headingLevel, embedHref });
|
|
14620
14701
|
}
|
|
14621
14702
|
function ProfileEmbedBlock({
|
|
14622
14703
|
block,
|
|
14623
14704
|
headingLevel,
|
|
14624
14705
|
embedHref
|
|
14625
14706
|
}) {
|
|
14626
|
-
return /* @__PURE__ */ (0,
|
|
14707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(EmbedCard, { resolved: block.resolved, headingLevel, embedHref });
|
|
14627
14708
|
}
|
|
14628
14709
|
var DEFAULT_RENDERERS = {
|
|
14629
14710
|
hero: HeroBlock,
|
|
@@ -14680,14 +14761,14 @@ function toIdFragment(value) {
|
|
|
14680
14761
|
function SectionCta2({ cta }) {
|
|
14681
14762
|
if (!hasUsableCta(cta)) return null;
|
|
14682
14763
|
const variant = toButtonVariant(cta.variant);
|
|
14683
|
-
return /* @__PURE__ */ (0,
|
|
14764
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14684
14765
|
"a",
|
|
14685
14766
|
{
|
|
14686
14767
|
href: cta.url,
|
|
14687
14768
|
"data-slot": "button",
|
|
14688
14769
|
"data-variant": variant,
|
|
14689
14770
|
"data-size": "default",
|
|
14690
|
-
className: (0,
|
|
14771
|
+
className: (0, import_utils14.cn)((0, import_button_variants2.buttonVariants)({ variant, size: "default" })),
|
|
14691
14772
|
...cta.isExternal ? { target: "_blank", rel: "noopener noreferrer" } : {},
|
|
14692
14773
|
children: cta.label
|
|
14693
14774
|
}
|
|
@@ -14713,17 +14794,17 @@ function PageBlocks({
|
|
|
14713
14794
|
const headingId = block.heading ? `${safePrefix}-${toIdFragment(block.id)}-heading` : void 0;
|
|
14714
14795
|
const background = block.backgroundColor;
|
|
14715
14796
|
return [
|
|
14716
|
-
/* @__PURE__ */ (0,
|
|
14797
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
14717
14798
|
"section",
|
|
14718
14799
|
{
|
|
14719
14800
|
"data-slot": "page-block",
|
|
14720
14801
|
"data-block-type": type,
|
|
14721
14802
|
"aria-labelledby": headingId,
|
|
14722
14803
|
style: surfaceStyle(background),
|
|
14723
|
-
className: (0,
|
|
14804
|
+
className: (0, import_utils14.cn)("space-y-6", background && "rounded-xl px-6 py-10", sectionClassName),
|
|
14724
14805
|
children: [
|
|
14725
|
-
block.heading && /* @__PURE__ */ (0,
|
|
14726
|
-
/* @__PURE__ */ (0,
|
|
14806
|
+
block.heading && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Heading, { level: headingLevel, className: "text-2xl font-bold tracking-tight", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { id: headingId, children: block.heading }) }),
|
|
14807
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14727
14808
|
Renderer,
|
|
14728
14809
|
{
|
|
14729
14810
|
block,
|
|
@@ -14731,7 +14812,7 @@ function PageBlocks({
|
|
|
14731
14812
|
embedHref
|
|
14732
14813
|
}
|
|
14733
14814
|
),
|
|
14734
|
-
/* @__PURE__ */ (0,
|
|
14815
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SectionCta2, { cta: block.cta })
|
|
14735
14816
|
]
|
|
14736
14817
|
},
|
|
14737
14818
|
block.id
|
|
@@ -14739,12 +14820,12 @@ function PageBlocks({
|
|
|
14739
14820
|
];
|
|
14740
14821
|
});
|
|
14741
14822
|
if (sections.length === 0) return null;
|
|
14742
|
-
return /* @__PURE__ */ (0,
|
|
14823
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: (0, import_utils14.cn)("space-y-12", className), "data-slot": "page-blocks", children: sections });
|
|
14743
14824
|
}
|
|
14744
14825
|
|
|
14745
14826
|
// src/components/shop-filters.tsx
|
|
14746
|
-
var
|
|
14747
|
-
var
|
|
14827
|
+
var import_utils15 = require("@reblu/site-ui/utils");
|
|
14828
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
14748
14829
|
var DEFAULT_SHOP_PRICE_BANDS = [
|
|
14749
14830
|
{ max: 2500 },
|
|
14750
14831
|
{ min: 2500, max: 5e3 },
|
|
@@ -14788,7 +14869,7 @@ function priceBandLabel(band, t, currencyCode, locale) {
|
|
|
14788
14869
|
return "";
|
|
14789
14870
|
}
|
|
14790
14871
|
function OptionLink({ href, active, label, onActivate }) {
|
|
14791
|
-
return /* @__PURE__ */ (0,
|
|
14872
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
14792
14873
|
"a",
|
|
14793
14874
|
{
|
|
14794
14875
|
href,
|
|
@@ -14797,7 +14878,7 @@ function OptionLink({ href, active, label, onActivate }) {
|
|
|
14797
14878
|
event.preventDefault();
|
|
14798
14879
|
onActivate();
|
|
14799
14880
|
} : void 0,
|
|
14800
|
-
className: (0,
|
|
14881
|
+
className: (0, import_utils15.cn)(
|
|
14801
14882
|
"inline-flex items-center rounded-full border px-3 py-1 text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
14802
14883
|
active ? "border-transparent bg-primary text-primary-foreground" : "border-border text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
14803
14884
|
),
|
|
@@ -14806,9 +14887,9 @@ function OptionLink({ href, active, label, onActivate }) {
|
|
|
14806
14887
|
);
|
|
14807
14888
|
}
|
|
14808
14889
|
function FilterFieldset({ legend, children: children2 }) {
|
|
14809
|
-
return /* @__PURE__ */ (0,
|
|
14810
|
-
/* @__PURE__ */ (0,
|
|
14811
|
-
/* @__PURE__ */ (0,
|
|
14890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("fieldset", { className: "space-y-2", children: [
|
|
14891
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("legend", { className: "text-sm font-medium text-foreground", children: legend }),
|
|
14892
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex flex-wrap gap-2", children: children2 })
|
|
14812
14893
|
] });
|
|
14813
14894
|
}
|
|
14814
14895
|
function ShopFilters({
|
|
@@ -14831,11 +14912,11 @@ function ShopFilters({
|
|
|
14831
14912
|
if (!shouldRenderShopFilters(facets, active)) {
|
|
14832
14913
|
return null;
|
|
14833
14914
|
}
|
|
14834
|
-
return /* @__PURE__ */ (0,
|
|
14915
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: (0, import_utils15.cn)("space-y-6", className), "data-slot": "shop-filters", children: [
|
|
14835
14916
|
visibleTaxonomies.map((axis) => {
|
|
14836
14917
|
const activeSlug = active.taxonomy?.[axis.key];
|
|
14837
|
-
return /* @__PURE__ */ (0,
|
|
14838
|
-
/* @__PURE__ */ (0,
|
|
14918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(FilterFieldset, { legend: axis.label, children: [
|
|
14919
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
14839
14920
|
OptionLink,
|
|
14840
14921
|
{
|
|
14841
14922
|
href: hrefs.taxonomy(axis.key, void 0),
|
|
@@ -14850,7 +14931,7 @@ function ShopFilters({
|
|
|
14850
14931
|
),
|
|
14851
14932
|
axis.terms.map((term) => {
|
|
14852
14933
|
const isActive = activeSlug === term.slug;
|
|
14853
|
-
return /* @__PURE__ */ (0,
|
|
14934
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
14854
14935
|
OptionLink,
|
|
14855
14936
|
{
|
|
14856
14937
|
href: hrefs.taxonomy(axis.key, isActive ? void 0 : term.slug),
|
|
@@ -14870,9 +14951,9 @@ function ShopFilters({
|
|
|
14870
14951
|
}),
|
|
14871
14952
|
visibleAttributes.map((attr) => {
|
|
14872
14953
|
const activeValues = toValueArray(active.attr?.[attr.key]);
|
|
14873
|
-
return /* @__PURE__ */ (0,
|
|
14954
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(FilterFieldset, { legend: attr.label, children: attr.options.map((opt) => {
|
|
14874
14955
|
const isActive = activeValues.includes(opt.value);
|
|
14875
|
-
return /* @__PURE__ */ (0,
|
|
14956
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
14876
14957
|
OptionLink,
|
|
14877
14958
|
{
|
|
14878
14959
|
href: hrefs.attr(attr.key, opt.value),
|
|
@@ -14890,11 +14971,11 @@ function ShopFilters({
|
|
|
14890
14971
|
);
|
|
14891
14972
|
}) }, attr.key);
|
|
14892
14973
|
}),
|
|
14893
|
-
showPriceGroup && /* @__PURE__ */ (0,
|
|
14974
|
+
showPriceGroup && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(FilterFieldset, { legend: t.price, children: priceBands.map((band, i) => {
|
|
14894
14975
|
const isActive = active.priceMin === band.min && active.priceMax === band.max;
|
|
14895
14976
|
const nextMin = isActive ? void 0 : band.min;
|
|
14896
14977
|
const nextMax = isActive ? void 0 : band.max;
|
|
14897
|
-
return /* @__PURE__ */ (0,
|
|
14978
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
14898
14979
|
OptionLink,
|
|
14899
14980
|
{
|
|
14900
14981
|
href: hrefs.price(nextMin, nextMax),
|
|
@@ -14905,7 +14986,7 @@ function ShopFilters({
|
|
|
14905
14986
|
i
|
|
14906
14987
|
);
|
|
14907
14988
|
}) }),
|
|
14908
|
-
hasOnSale && /* @__PURE__ */ (0,
|
|
14989
|
+
hasOnSale && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
14909
14990
|
OptionLink,
|
|
14910
14991
|
{
|
|
14911
14992
|
href: hrefs.onSale(!active.onSale),
|
|
@@ -14914,7 +14995,7 @@ function ShopFilters({
|
|
|
14914
14995
|
onActivate: onChange ? () => onChange({ onSale: !active.onSale }) : void 0
|
|
14915
14996
|
}
|
|
14916
14997
|
),
|
|
14917
|
-
/* @__PURE__ */ (0,
|
|
14998
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
14918
14999
|
"a",
|
|
14919
15000
|
{
|
|
14920
15001
|
href: hrefs.clearAll(),
|
|
@@ -14930,8 +15011,8 @@ function ShopFilters({
|
|
|
14930
15011
|
}
|
|
14931
15012
|
|
|
14932
15013
|
// src/components/course-catalog-filters.tsx
|
|
14933
|
-
var
|
|
14934
|
-
var
|
|
15014
|
+
var import_utils16 = require("@reblu/site-ui/utils");
|
|
15015
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
14935
15016
|
var DEFAULT_COURSE_PRICE_BANDS = [
|
|
14936
15017
|
{ max: 5e3 },
|
|
14937
15018
|
{ min: 5e3, max: 15e3 },
|
|
@@ -14984,9 +15065,9 @@ function CourseCatalogFilters({
|
|
|
14984
15065
|
const showPrice = enabled.price !== false;
|
|
14985
15066
|
const isFree = Boolean(active.free);
|
|
14986
15067
|
if (!showCategories && !showInstructors && !showPrice) return null;
|
|
14987
|
-
return /* @__PURE__ */ (0,
|
|
14988
|
-
showCategories && /* @__PURE__ */ (0,
|
|
14989
|
-
/* @__PURE__ */ (0,
|
|
15068
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: (0, import_utils16.cn)("space-y-6", className), "data-slot": "course-catalog-filters", children: [
|
|
15069
|
+
showCategories && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(FilterFieldset, { legend: t.category, children: [
|
|
15070
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
14990
15071
|
OptionLink,
|
|
14991
15072
|
{
|
|
14992
15073
|
href: categoryHref(void 0),
|
|
@@ -14998,7 +15079,7 @@ function CourseCatalogFilters({
|
|
|
14998
15079
|
sortedCategories.map((category) => {
|
|
14999
15080
|
const isActive = active.category === category.slug;
|
|
15000
15081
|
const next2 = isActive ? void 0 : category.slug;
|
|
15001
|
-
return /* @__PURE__ */ (0,
|
|
15082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
15002
15083
|
OptionLink,
|
|
15003
15084
|
{
|
|
15004
15085
|
href: categoryHref(next2),
|
|
@@ -15010,8 +15091,8 @@ function CourseCatalogFilters({
|
|
|
15010
15091
|
);
|
|
15011
15092
|
})
|
|
15012
15093
|
] }),
|
|
15013
|
-
showInstructors && /* @__PURE__ */ (0,
|
|
15014
|
-
/* @__PURE__ */ (0,
|
|
15094
|
+
showInstructors && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(FilterFieldset, { legend: t.instructor, children: [
|
|
15095
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
15015
15096
|
OptionLink,
|
|
15016
15097
|
{
|
|
15017
15098
|
href: hrefs.instructor(void 0),
|
|
@@ -15023,7 +15104,7 @@ function CourseCatalogFilters({
|
|
|
15023
15104
|
named.map((instructor) => {
|
|
15024
15105
|
const isActive = active.instructor === instructor.id;
|
|
15025
15106
|
const next2 = isActive ? void 0 : instructor.id;
|
|
15026
|
-
return /* @__PURE__ */ (0,
|
|
15107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
15027
15108
|
OptionLink,
|
|
15028
15109
|
{
|
|
15029
15110
|
href: hrefs.instructor(next2),
|
|
@@ -15035,8 +15116,8 @@ function CourseCatalogFilters({
|
|
|
15035
15116
|
);
|
|
15036
15117
|
})
|
|
15037
15118
|
] }),
|
|
15038
|
-
showPrice && /* @__PURE__ */ (0,
|
|
15039
|
-
/* @__PURE__ */ (0,
|
|
15119
|
+
showPrice && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(FilterFieldset, { legend: t.price, children: [
|
|
15120
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
15040
15121
|
OptionLink,
|
|
15041
15122
|
{
|
|
15042
15123
|
href: hrefs.free(!isFree),
|
|
@@ -15051,7 +15132,7 @@ function CourseCatalogFilters({
|
|
|
15051
15132
|
const isActive = !isFree && active.priceMin === band.min && active.priceMax === band.max;
|
|
15052
15133
|
const nextMin = isActive ? void 0 : band.min;
|
|
15053
15134
|
const nextMax = isActive ? void 0 : band.max;
|
|
15054
|
-
return /* @__PURE__ */ (0,
|
|
15135
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
15055
15136
|
OptionLink,
|
|
15056
15137
|
{
|
|
15057
15138
|
href: hrefs.price(nextMin, nextMax),
|
|
@@ -15063,7 +15144,7 @@ function CourseCatalogFilters({
|
|
|
15063
15144
|
);
|
|
15064
15145
|
})
|
|
15065
15146
|
] }),
|
|
15066
|
-
/* @__PURE__ */ (0,
|
|
15147
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
15067
15148
|
"a",
|
|
15068
15149
|
{
|
|
15069
15150
|
href: hrefs.clearAll(),
|
|
@@ -15085,8 +15166,8 @@ function CourseCatalogFilters({
|
|
|
15085
15166
|
}
|
|
15086
15167
|
|
|
15087
15168
|
// src/components/cart-line-list.tsx
|
|
15088
|
-
var
|
|
15089
|
-
var
|
|
15169
|
+
var import_utils17 = require("@reblu/site-ui/utils");
|
|
15170
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
15090
15171
|
var DEFAULT_LABELS2 = {
|
|
15091
15172
|
quantityLabel: "Cantidad",
|
|
15092
15173
|
decrease: "Reducir cantidad",
|
|
@@ -15112,9 +15193,9 @@ function CartLineList({
|
|
|
15112
15193
|
}) {
|
|
15113
15194
|
const t = { ...DEFAULT_LABELS2, ...labels };
|
|
15114
15195
|
const noticeContent = notice === true ? t.cancelledNotice : notice;
|
|
15115
|
-
return /* @__PURE__ */ (0,
|
|
15116
|
-
/* @__PURE__ */ (0,
|
|
15117
|
-
noticeContent != null && noticeContent !== false && /* @__PURE__ */ (0,
|
|
15196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: (0, import_utils17.cn)("space-y-4", className), "data-slot": "cart-line-list", children: [
|
|
15197
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { "aria-live": "polite", className: "sr-only", children: liveMessage }),
|
|
15198
|
+
noticeContent != null && noticeContent !== false && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
15118
15199
|
"div",
|
|
15119
15200
|
{
|
|
15120
15201
|
role: "status",
|
|
@@ -15123,33 +15204,33 @@ function CartLineList({
|
|
|
15123
15204
|
children: noticeContent
|
|
15124
15205
|
}
|
|
15125
15206
|
),
|
|
15126
|
-
/* @__PURE__ */ (0,
|
|
15207
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("ul", { className: "space-y-4", children: items.map((item) => {
|
|
15127
15208
|
const maxQty = item.maxStock ?? Infinity;
|
|
15128
15209
|
const atMax = item.quantity >= maxQty;
|
|
15129
15210
|
const atMin = item.quantity <= 1;
|
|
15130
15211
|
const message = lineMessage?.(item);
|
|
15131
|
-
return /* @__PURE__ */ (0,
|
|
15212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
15132
15213
|
"li",
|
|
15133
15214
|
{
|
|
15134
15215
|
className: "flex gap-4 rounded-xl border border-border bg-card p-4",
|
|
15135
15216
|
children: [
|
|
15136
|
-
/* @__PURE__ */ (0,
|
|
15137
|
-
/* @__PURE__ */ (0,
|
|
15138
|
-
/* @__PURE__ */ (0,
|
|
15139
|
-
item.variantName && /* @__PURE__ */ (0,
|
|
15140
|
-
/* @__PURE__ */ (0,
|
|
15217
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "h-20 w-20 flex-shrink-0 overflow-hidden rounded-lg bg-muted", children: item.imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("img", { src: item.imageUrl, alt: item.name, className: "h-full w-full object-cover" }) : null }),
|
|
15218
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
15219
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "truncate text-sm font-semibold leading-tight", children: item.name }),
|
|
15220
|
+
item.variantName && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "mt-0.5 text-xs text-muted-foreground", children: item.variantName }),
|
|
15221
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("p", { className: "mt-1 text-sm text-muted-foreground", children: [
|
|
15141
15222
|
formatPrice(item.unitPrice, currencyCode, locale),
|
|
15142
15223
|
" ",
|
|
15143
15224
|
t.unitPriceSuffix
|
|
15144
15225
|
] }),
|
|
15145
|
-
/* @__PURE__ */ (0,
|
|
15226
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
15146
15227
|
"div",
|
|
15147
15228
|
{
|
|
15148
15229
|
role: "group",
|
|
15149
15230
|
"aria-label": t.quantityLabel,
|
|
15150
15231
|
className: "mt-3 flex items-center gap-3",
|
|
15151
15232
|
children: [
|
|
15152
|
-
/* @__PURE__ */ (0,
|
|
15233
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
15153
15234
|
"button",
|
|
15154
15235
|
{
|
|
15155
15236
|
type: "button",
|
|
@@ -15160,8 +15241,8 @@ function CartLineList({
|
|
|
15160
15241
|
children: "\u2212"
|
|
15161
15242
|
}
|
|
15162
15243
|
),
|
|
15163
|
-
/* @__PURE__ */ (0,
|
|
15164
|
-
/* @__PURE__ */ (0,
|
|
15244
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "w-8 text-center text-sm font-semibold tabular-nums", children: item.quantity }),
|
|
15245
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
15165
15246
|
"button",
|
|
15166
15247
|
{
|
|
15167
15248
|
type: "button",
|
|
@@ -15172,7 +15253,7 @@ function CartLineList({
|
|
|
15172
15253
|
children: "+"
|
|
15173
15254
|
}
|
|
15174
15255
|
),
|
|
15175
|
-
onRemove && /* @__PURE__ */ (0,
|
|
15256
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
15176
15257
|
"button",
|
|
15177
15258
|
{
|
|
15178
15259
|
type: "button",
|
|
@@ -15185,7 +15266,7 @@ function CartLineList({
|
|
|
15185
15266
|
]
|
|
15186
15267
|
}
|
|
15187
15268
|
),
|
|
15188
|
-
message != null && message !== false && /* @__PURE__ */ (0,
|
|
15269
|
+
message != null && message !== false && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
15189
15270
|
"p",
|
|
15190
15271
|
{
|
|
15191
15272
|
className: "mt-2 text-sm text-destructive",
|
|
@@ -15194,7 +15275,7 @@ function CartLineList({
|
|
|
15194
15275
|
}
|
|
15195
15276
|
)
|
|
15196
15277
|
] }),
|
|
15197
|
-
/* @__PURE__ */ (0,
|
|
15278
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex-shrink-0 text-right", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-base font-bold", children: formatPrice(item.unitPrice * item.quantity, currencyCode, locale) }) })
|
|
15198
15279
|
]
|
|
15199
15280
|
},
|
|
15200
15281
|
lineKey(item.productId, item.variantId)
|
|
@@ -15204,8 +15285,8 @@ function CartLineList({
|
|
|
15204
15285
|
}
|
|
15205
15286
|
|
|
15206
15287
|
// src/components/cart-summary.tsx
|
|
15207
|
-
var
|
|
15208
|
-
var
|
|
15288
|
+
var import_utils18 = require("@reblu/site-ui/utils");
|
|
15289
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
15209
15290
|
var DEFAULT_LABELS3 = {
|
|
15210
15291
|
subtotal: "Subtotal",
|
|
15211
15292
|
discountPrefix: "Descuento",
|
|
@@ -15235,37 +15316,37 @@ function CartSummary({
|
|
|
15235
15316
|
const hasDiscount = Boolean(discountAmount && discountAmount > 0);
|
|
15236
15317
|
const noticeContent = notice === true ? t.cancelledNotice : notice;
|
|
15237
15318
|
const hasNotice = noticeContent != null && noticeContent !== false;
|
|
15238
|
-
const breakdown = /* @__PURE__ */ (0,
|
|
15319
|
+
const breakdown = /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
15239
15320
|
"dl",
|
|
15240
15321
|
{
|
|
15241
|
-
className: (0,
|
|
15322
|
+
className: (0, import_utils18.cn)("space-y-2 text-sm", !hasNotice && className),
|
|
15242
15323
|
"data-slot": "cart-summary",
|
|
15243
15324
|
children: [
|
|
15244
|
-
/* @__PURE__ */ (0,
|
|
15245
|
-
/* @__PURE__ */ (0,
|
|
15246
|
-
/* @__PURE__ */ (0,
|
|
15325
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex justify-between text-muted-foreground", children: [
|
|
15326
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("dt", { children: t.subtotal }),
|
|
15327
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("dd", { children: formatPrice(subtotal, currencyCode, locale) })
|
|
15247
15328
|
] }),
|
|
15248
|
-
hasDiscount && /* @__PURE__ */ (0,
|
|
15249
|
-
/* @__PURE__ */ (0,
|
|
15250
|
-
/* @__PURE__ */ (0,
|
|
15329
|
+
hasDiscount && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex justify-between text-green-600 dark:text-green-400", children: [
|
|
15330
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("dt", { children: autoDiscount ? t.staffDiscountApplied : `${t.discountPrefix}${discountCode ? ` (${discountCode})` : ""}` }),
|
|
15331
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("dd", { children: [
|
|
15251
15332
|
"-",
|
|
15252
15333
|
formatPrice(discountAmount, currencyCode, locale)
|
|
15253
15334
|
] })
|
|
15254
15335
|
] }),
|
|
15255
|
-
shippingEnabled && /* @__PURE__ */ (0,
|
|
15256
|
-
/* @__PURE__ */ (0,
|
|
15257
|
-
/* @__PURE__ */ (0,
|
|
15336
|
+
shippingEnabled && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex justify-between text-muted-foreground", children: [
|
|
15337
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("dt", { children: t.shipping }),
|
|
15338
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("dd", { children: shipping == null || !Number.isFinite(shipping) ? t.shippingCalculated : shipping === 0 ? t.freeShipping : formatPrice(shipping, currencyCode, locale) })
|
|
15258
15339
|
] }),
|
|
15259
|
-
/* @__PURE__ */ (0,
|
|
15260
|
-
/* @__PURE__ */ (0,
|
|
15261
|
-
/* @__PURE__ */ (0,
|
|
15340
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex justify-between border-t border-border pt-2 text-base font-bold", children: [
|
|
15341
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("dt", { children: t.total }),
|
|
15342
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("dd", { children: formatPrice(total, currencyCode, locale) })
|
|
15262
15343
|
] })
|
|
15263
15344
|
]
|
|
15264
15345
|
}
|
|
15265
15346
|
);
|
|
15266
15347
|
if (!hasNotice) return breakdown;
|
|
15267
|
-
return /* @__PURE__ */ (0,
|
|
15268
|
-
/* @__PURE__ */ (0,
|
|
15348
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: (0, import_utils18.cn)("space-y-3", className), "data-slot": "cart-summary-wrapper", children: [
|
|
15349
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15269
15350
|
"div",
|
|
15270
15351
|
{
|
|
15271
15352
|
role: "status",
|
|
@@ -15279,8 +15360,8 @@ function CartSummary({
|
|
|
15279
15360
|
}
|
|
15280
15361
|
|
|
15281
15362
|
// src/components/cart-adjustments-notice.tsx
|
|
15282
|
-
var
|
|
15283
|
-
var
|
|
15363
|
+
var import_utils19 = require("@reblu/site-ui/utils");
|
|
15364
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
15284
15365
|
var DEFAULT_LABELS4 = {
|
|
15285
15366
|
removed: (names) => names.length === 1 ? `Hemos quitado del carrito: ${names[0]}, ya no est\xE1 disponible.` : `Hemos quitado del carrito: ${names.join(", ")}, ya no est\xE1n disponibles.`,
|
|
15286
15367
|
quantityChanged: (name, quantity) => `Hemos ajustado la cantidad de ${name} a ${quantity} por el stock disponible.`,
|
|
@@ -15314,20 +15395,20 @@ function CartAdjustmentsNotice({
|
|
|
15314
15395
|
);
|
|
15315
15396
|
}
|
|
15316
15397
|
if (messages.length === 0) return null;
|
|
15317
|
-
return /* @__PURE__ */ (0,
|
|
15398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15318
15399
|
"div",
|
|
15319
15400
|
{
|
|
15320
15401
|
role: "status",
|
|
15321
|
-
className: (0,
|
|
15402
|
+
className: (0, import_utils19.cn)("rounded-lg border border-border bg-muted px-3 py-2 text-sm", className),
|
|
15322
15403
|
"data-slot": "cart-adjustments-notice",
|
|
15323
|
-
children: messages.length === 1 ? /* @__PURE__ */ (0,
|
|
15404
|
+
children: messages.length === 1 ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { children: messages[0] }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("ul", { className: "list-disc space-y-1 pl-4", children: messages.map((message, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("li", { children: message }, index)) })
|
|
15324
15405
|
}
|
|
15325
15406
|
);
|
|
15326
15407
|
}
|
|
15327
15408
|
|
|
15328
15409
|
// src/components/added-to-cart-toast.tsx
|
|
15329
|
-
var
|
|
15330
|
-
var
|
|
15410
|
+
var import_utils20 = require("@reblu/site-ui/utils");
|
|
15411
|
+
var import_jsx_runtime24 = (
|
|
15331
15412
|
// eslint-disable-next-line @next/next/no-img-element -- toast content, not a Next <Image> layout context
|
|
15332
15413
|
require("react/jsx-runtime")
|
|
15333
15414
|
);
|
|
@@ -15350,32 +15431,32 @@ function AddedToCartToast({
|
|
|
15350
15431
|
const message = status === "error" ? t.error : status === "outOfStock" ? t.outOfStock : t.success;
|
|
15351
15432
|
const hasThumbnail = Boolean(imageUrl && imageUrl.trim().length > 0);
|
|
15352
15433
|
const variant = status === "success" ? "success" : "error";
|
|
15353
|
-
return /* @__PURE__ */ (0,
|
|
15434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
15354
15435
|
"div",
|
|
15355
15436
|
{
|
|
15356
15437
|
"data-slot": "added-to-cart-toast",
|
|
15357
15438
|
"data-variant": variant,
|
|
15358
|
-
className: (0,
|
|
15439
|
+
className: (0, import_utils20.cn)(
|
|
15359
15440
|
"flex items-center gap-3 rounded-xl border border-border bg-card p-3 text-sm shadow-lg",
|
|
15360
15441
|
variant === "success" && "border-green-600/30 dark:border-green-400/30",
|
|
15361
15442
|
variant === "error" && "border-destructive/30",
|
|
15362
15443
|
className
|
|
15363
15444
|
),
|
|
15364
15445
|
children: [
|
|
15365
|
-
hasThumbnail && /* @__PURE__ */ (0,
|
|
15366
|
-
/* @__PURE__ */ (0,
|
|
15367
|
-
/* @__PURE__ */ (0,
|
|
15368
|
-
/* @__PURE__ */ (0,
|
|
15446
|
+
hasThumbnail && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("img", { src: imageUrl, alt: productName, className: "h-10 w-10 flex-shrink-0 rounded-lg object-cover" }),
|
|
15447
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
15448
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "truncate font-semibold text-foreground", children: productName }),
|
|
15449
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "truncate text-muted-foreground", children: quantity && quantity > 1 ? `${message} \xB7 x${quantity}` : message })
|
|
15369
15450
|
] }),
|
|
15370
|
-
/* @__PURE__ */ (0,
|
|
15451
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("a", { href: cartHref, className: "text-sm font-semibold text-primary underline-offset-2 hover:underline", children: t.viewCart }) })
|
|
15371
15452
|
]
|
|
15372
15453
|
}
|
|
15373
15454
|
);
|
|
15374
15455
|
}
|
|
15375
15456
|
|
|
15376
15457
|
// src/components/checkout-login-prompt.tsx
|
|
15377
|
-
var
|
|
15378
|
-
var
|
|
15458
|
+
var import_utils21 = require("@reblu/site-ui/utils");
|
|
15459
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
15379
15460
|
var DEFAULT_LABELS6 = {
|
|
15380
15461
|
title: "Identificaci\xF3n",
|
|
15381
15462
|
description: "Introduce tu email para agilizar el proceso o contin\xFAa como invitado.",
|
|
@@ -15402,26 +15483,26 @@ function CheckoutLoginPrompt({
|
|
|
15402
15483
|
if (!open) return null;
|
|
15403
15484
|
const t = { ...DEFAULT_LABELS6, ...labels };
|
|
15404
15485
|
const isValidEmail = EMAIL_PATTERN.test(email.trim());
|
|
15405
|
-
return /* @__PURE__ */ (0,
|
|
15406
|
-
/* @__PURE__ */ (0,
|
|
15407
|
-
/* @__PURE__ */ (0,
|
|
15486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
15487
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "fixed inset-0 z-50 bg-black/50", onClick: onClose, "aria-hidden": "true" }),
|
|
15488
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
15408
15489
|
"div",
|
|
15409
15490
|
{
|
|
15410
15491
|
role: "dialog",
|
|
15411
15492
|
"aria-modal": "true",
|
|
15412
15493
|
"aria-labelledby": "checkout-login-prompt-title",
|
|
15413
15494
|
"data-slot": "checkout-login-prompt",
|
|
15414
|
-
className: (0,
|
|
15495
|
+
className: (0, import_utils21.cn)(
|
|
15415
15496
|
"fixed left-1/2 top-1/2 z-50 w-full max-w-md -translate-x-1/2 -translate-y-1/2 space-y-5 rounded-2xl border border-border bg-background p-6 shadow-2xl",
|
|
15416
15497
|
className
|
|
15417
15498
|
),
|
|
15418
15499
|
children: [
|
|
15419
|
-
/* @__PURE__ */ (0,
|
|
15420
|
-
/* @__PURE__ */ (0,
|
|
15421
|
-
/* @__PURE__ */ (0,
|
|
15422
|
-
/* @__PURE__ */ (0,
|
|
15500
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|
|
15501
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { children: [
|
|
15502
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h2", { id: "checkout-login-prompt-title", className: "text-xl font-bold", children: t.title }),
|
|
15503
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "mt-1 text-sm text-muted-foreground", children: t.description })
|
|
15423
15504
|
] }),
|
|
15424
|
-
/* @__PURE__ */ (0,
|
|
15505
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
15425
15506
|
"button",
|
|
15426
15507
|
{
|
|
15427
15508
|
type: "button",
|
|
@@ -15432,9 +15513,9 @@ function CheckoutLoginPrompt({
|
|
|
15432
15513
|
}
|
|
15433
15514
|
)
|
|
15434
15515
|
] }),
|
|
15435
|
-
/* @__PURE__ */ (0,
|
|
15436
|
-
/* @__PURE__ */ (0,
|
|
15437
|
-
/* @__PURE__ */ (0,
|
|
15516
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "space-y-2", children: [
|
|
15517
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("label", { htmlFor: "checkout-login-prompt-email", className: "text-sm font-medium", children: t.emailLabel }),
|
|
15518
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
15438
15519
|
"input",
|
|
15439
15520
|
{
|
|
15440
15521
|
id: "checkout-login-prompt-email",
|
|
@@ -15443,29 +15524,29 @@ function CheckoutLoginPrompt({
|
|
|
15443
15524
|
value: email,
|
|
15444
15525
|
onChange: (e) => onEmailChange(e.target.value),
|
|
15445
15526
|
placeholder: t.emailPlaceholder,
|
|
15446
|
-
className: (0,
|
|
15527
|
+
className: (0, import_utils21.cn)(
|
|
15447
15528
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
15448
15529
|
error ? "border-destructive" : "border-border focus:border-primary"
|
|
15449
15530
|
)
|
|
15450
15531
|
}
|
|
15451
15532
|
),
|
|
15452
|
-
error && /* @__PURE__ */ (0,
|
|
15533
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-xs text-destructive", children: error })
|
|
15453
15534
|
] }),
|
|
15454
|
-
/* @__PURE__ */ (0,
|
|
15455
|
-
/* @__PURE__ */ (0,
|
|
15535
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "space-y-2", children: [
|
|
15536
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
15456
15537
|
"button",
|
|
15457
15538
|
{
|
|
15458
15539
|
type: "button",
|
|
15459
15540
|
onClick: onSubmitEmail,
|
|
15460
15541
|
disabled: checking || !isValidEmail,
|
|
15461
|
-
className: (0,
|
|
15542
|
+
className: (0, import_utils21.cn)(
|
|
15462
15543
|
"flex w-full cursor-pointer items-center justify-center gap-2 rounded-xl px-4 py-2.5 text-sm font-semibold transition-all",
|
|
15463
15544
|
checking || !isValidEmail ? "cursor-not-allowed bg-muted text-muted-foreground" : "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
15464
15545
|
),
|
|
15465
15546
|
children: checking ? t.checking : t.continueWithEmail
|
|
15466
15547
|
}
|
|
15467
15548
|
),
|
|
15468
|
-
/* @__PURE__ */ (0,
|
|
15549
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
15469
15550
|
"button",
|
|
15470
15551
|
{
|
|
15471
15552
|
type: "button",
|
|
@@ -15482,9 +15563,9 @@ function CheckoutLoginPrompt({
|
|
|
15482
15563
|
}
|
|
15483
15564
|
|
|
15484
15565
|
// src/components/checkout-form.tsx
|
|
15485
|
-
var
|
|
15566
|
+
var import_utils22 = require("@reblu/site-ui/utils");
|
|
15486
15567
|
var import_phone_input = require("@reblu/site-ui/phone-input");
|
|
15487
|
-
var
|
|
15568
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
15488
15569
|
var DEFAULT_LABELS7 = {
|
|
15489
15570
|
contactTitle: "Datos de contacto",
|
|
15490
15571
|
nameLabel: "Nombre completo",
|
|
@@ -15540,22 +15621,22 @@ function CheckoutForm({
|
|
|
15540
15621
|
event.preventDefault();
|
|
15541
15622
|
if (discountCode.trim() && !discountApplying) onApplyDiscount();
|
|
15542
15623
|
}
|
|
15543
|
-
return /* @__PURE__ */ (0,
|
|
15624
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
15544
15625
|
loginPrompt,
|
|
15545
|
-
/* @__PURE__ */ (0,
|
|
15626
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
15546
15627
|
"form",
|
|
15547
15628
|
{
|
|
15548
15629
|
"data-testid": "checkout-form",
|
|
15549
15630
|
onSubmit,
|
|
15550
|
-
className: (0,
|
|
15631
|
+
className: (0, import_utils22.cn)("space-y-8", className),
|
|
15551
15632
|
"data-slot": "checkout-form",
|
|
15552
15633
|
children: [
|
|
15553
|
-
/* @__PURE__ */ (0,
|
|
15554
|
-
/* @__PURE__ */ (0,
|
|
15555
|
-
/* @__PURE__ */ (0,
|
|
15556
|
-
/* @__PURE__ */ (0,
|
|
15557
|
-
/* @__PURE__ */ (0,
|
|
15558
|
-
/* @__PURE__ */ (0,
|
|
15634
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("section", { className: "space-y-4", children: [
|
|
15635
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h2", { className: "border-b border-border pb-2 text-lg font-semibold", children: t.contactTitle }),
|
|
15636
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
|
|
15637
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "space-y-1", children: [
|
|
15638
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("label", { htmlFor: "checkout-form-name", className: "text-sm font-medium", children: t.nameLabel }),
|
|
15639
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
15559
15640
|
"input",
|
|
15560
15641
|
{
|
|
15561
15642
|
id: "checkout-form-name",
|
|
@@ -15564,17 +15645,17 @@ function CheckoutForm({
|
|
|
15564
15645
|
value: contact.name,
|
|
15565
15646
|
onChange: (e) => patchContact({ name: e.target.value }),
|
|
15566
15647
|
placeholder: t.namePlaceholder,
|
|
15567
|
-
className: (0,
|
|
15648
|
+
className: (0, import_utils22.cn)(
|
|
15568
15649
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
15569
15650
|
contactErrors?.name ? "border-destructive" : "border-border focus:border-primary"
|
|
15570
15651
|
)
|
|
15571
15652
|
}
|
|
15572
15653
|
),
|
|
15573
|
-
contactErrors?.name && /* @__PURE__ */ (0,
|
|
15654
|
+
contactErrors?.name && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-xs text-destructive", children: contactErrors.name })
|
|
15574
15655
|
] }),
|
|
15575
|
-
/* @__PURE__ */ (0,
|
|
15576
|
-
/* @__PURE__ */ (0,
|
|
15577
|
-
/* @__PURE__ */ (0,
|
|
15656
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "space-y-1", children: [
|
|
15657
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("label", { htmlFor: "checkout-form-email", className: "text-sm font-medium", children: t.emailLabel }),
|
|
15658
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
15578
15659
|
"input",
|
|
15579
15660
|
{
|
|
15580
15661
|
id: "checkout-form-email",
|
|
@@ -15583,15 +15664,15 @@ function CheckoutForm({
|
|
|
15583
15664
|
value: contact.email,
|
|
15584
15665
|
onChange: (e) => patchContact({ email: e.target.value }),
|
|
15585
15666
|
placeholder: t.emailPlaceholder,
|
|
15586
|
-
className: (0,
|
|
15667
|
+
className: (0, import_utils22.cn)(
|
|
15587
15668
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
15588
15669
|
contactErrors?.email ? "border-destructive" : "border-border focus:border-primary"
|
|
15589
15670
|
)
|
|
15590
15671
|
}
|
|
15591
15672
|
),
|
|
15592
|
-
contactErrors?.email && /* @__PURE__ */ (0,
|
|
15673
|
+
contactErrors?.email && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-xs text-destructive", children: contactErrors.email })
|
|
15593
15674
|
] }),
|
|
15594
|
-
/* @__PURE__ */ (0,
|
|
15675
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
15595
15676
|
import_phone_input.PhoneInput,
|
|
15596
15677
|
{
|
|
15597
15678
|
id: "checkout-form-phone",
|
|
@@ -15605,26 +15686,26 @@ function CheckoutForm({
|
|
|
15605
15686
|
] })
|
|
15606
15687
|
] }),
|
|
15607
15688
|
children2,
|
|
15608
|
-
generalError ? /* @__PURE__ */ (0,
|
|
15609
|
-
/* @__PURE__ */ (0,
|
|
15610
|
-
/* @__PURE__ */ (0,
|
|
15611
|
-
autoDiscount ? /* @__PURE__ */ (0,
|
|
15689
|
+
generalError ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { role: "alert", className: "text-sm text-destructive", children: generalError }) : null,
|
|
15690
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("section", { className: "space-y-3", children: [
|
|
15691
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h2", { className: "border-b border-border pb-2 text-lg font-semibold", children: t.discountTitle }),
|
|
15692
|
+
autoDiscount ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
15612
15693
|
"div",
|
|
15613
15694
|
{
|
|
15614
15695
|
className: "flex items-center gap-2 rounded-lg border border-green-200 bg-green-50 px-4 py-3 text-sm text-green-700 dark:border-green-800 dark:bg-green-900/20 dark:text-green-400",
|
|
15615
15696
|
"data-slot": "checkout-staff-discount",
|
|
15616
15697
|
children: [
|
|
15617
|
-
/* @__PURE__ */ (0,
|
|
15618
|
-
/* @__PURE__ */ (0,
|
|
15698
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "font-semibold", children: t.staffDiscountApplied }),
|
|
15699
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: t.discountAppliedSuffix(formatPrice(autoDiscount.amount, currencyCode, locale)) })
|
|
15619
15700
|
]
|
|
15620
15701
|
}
|
|
15621
15702
|
) : null,
|
|
15622
|
-
appliedDiscount && !autoDiscount ? /* @__PURE__ */ (0,
|
|
15623
|
-
/* @__PURE__ */ (0,
|
|
15624
|
-
/* @__PURE__ */ (0,
|
|
15625
|
-
/* @__PURE__ */ (0,
|
|
15703
|
+
appliedDiscount && !autoDiscount ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center justify-between rounded-lg border border-green-200 bg-green-50 px-4 py-3 dark:border-green-800 dark:bg-green-900/20", children: [
|
|
15704
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center gap-2 text-sm text-green-700 dark:text-green-400", children: [
|
|
15705
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "font-semibold", children: appliedDiscount.code }),
|
|
15706
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: t.discountAppliedSuffix(formatPrice(appliedDiscount.amount, currencyCode, locale)) })
|
|
15626
15707
|
] }),
|
|
15627
|
-
/* @__PURE__ */ (0,
|
|
15708
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
15628
15709
|
"button",
|
|
15629
15710
|
{
|
|
15630
15711
|
type: "button",
|
|
@@ -15634,9 +15715,9 @@ function CheckoutForm({
|
|
|
15634
15715
|
children: t.removeDiscount
|
|
15635
15716
|
}
|
|
15636
15717
|
)
|
|
15637
|
-
] }) : /* @__PURE__ */ (0,
|
|
15638
|
-
/* @__PURE__ */ (0,
|
|
15639
|
-
/* @__PURE__ */ (0,
|
|
15718
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex gap-2", children: [
|
|
15719
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("label", { htmlFor: "checkout-form-discount-code", className: "sr-only", children: t.discountTitle }),
|
|
15720
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
15640
15721
|
"input",
|
|
15641
15722
|
{
|
|
15642
15723
|
id: "checkout-form-discount-code",
|
|
@@ -15648,7 +15729,7 @@ function CheckoutForm({
|
|
|
15648
15729
|
className: "flex-1 rounded-lg border border-border bg-background px-3 py-2 text-sm uppercase transition focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/20"
|
|
15649
15730
|
}
|
|
15650
15731
|
),
|
|
15651
|
-
/* @__PURE__ */ (0,
|
|
15732
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
15652
15733
|
"button",
|
|
15653
15734
|
{
|
|
15654
15735
|
type: "button",
|
|
@@ -15659,14 +15740,14 @@ function CheckoutForm({
|
|
|
15659
15740
|
}
|
|
15660
15741
|
)
|
|
15661
15742
|
] }),
|
|
15662
|
-
discountError && /* @__PURE__ */ (0,
|
|
15743
|
+
discountError && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-xs text-destructive", children: discountError })
|
|
15663
15744
|
] }),
|
|
15664
|
-
/* @__PURE__ */ (0,
|
|
15745
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
15665
15746
|
"button",
|
|
15666
15747
|
{
|
|
15667
15748
|
type: "submit",
|
|
15668
15749
|
disabled: submitting || submitDisabled,
|
|
15669
|
-
className: (0,
|
|
15750
|
+
className: (0, import_utils22.cn)(
|
|
15670
15751
|
"flex w-full cursor-pointer items-center justify-center gap-2 rounded-xl px-4 py-3 font-semibold transition-all",
|
|
15671
15752
|
submitting || submitDisabled ? "cursor-not-allowed bg-muted text-muted-foreground" : "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
15672
15753
|
),
|
|
@@ -15680,11 +15761,11 @@ function CheckoutForm({
|
|
|
15680
15761
|
}
|
|
15681
15762
|
|
|
15682
15763
|
// src/components/order-confirmation.tsx
|
|
15683
|
-
var
|
|
15764
|
+
var import_utils24 = require("@reblu/site-ui/utils");
|
|
15684
15765
|
|
|
15685
15766
|
// src/components/order-invoice-link.tsx
|
|
15686
|
-
var
|
|
15687
|
-
var
|
|
15767
|
+
var import_utils23 = require("@reblu/site-ui/utils");
|
|
15768
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
15688
15769
|
var DEFAULT_LABELS8 = {
|
|
15689
15770
|
linkLabel: "Descargar la factura {number}",
|
|
15690
15771
|
signInHint: "Te pediremos que inicies sesi\xF3n para abrirla."
|
|
@@ -15692,8 +15773,8 @@ var DEFAULT_LABELS8 = {
|
|
|
15692
15773
|
function OrderInvoiceLink({ invoice, labels, className }) {
|
|
15693
15774
|
if (!invoice) return null;
|
|
15694
15775
|
const t = { ...DEFAULT_LABELS8, ...labels };
|
|
15695
|
-
return /* @__PURE__ */ (0,
|
|
15696
|
-
/* @__PURE__ */ (0,
|
|
15776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: (0, import_utils23.cn)("space-y-1 text-sm", className), "data-slot": "order-invoice-link", children: [
|
|
15777
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
15697
15778
|
"a",
|
|
15698
15779
|
{
|
|
15699
15780
|
href: invoice.url,
|
|
@@ -15701,12 +15782,12 @@ function OrderInvoiceLink({ invoice, labels, className }) {
|
|
|
15701
15782
|
children: t.linkLabel.replace("{number}", invoice.number)
|
|
15702
15783
|
}
|
|
15703
15784
|
),
|
|
15704
|
-
/* @__PURE__ */ (0,
|
|
15785
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-muted-foreground", children: t.signInHint })
|
|
15705
15786
|
] });
|
|
15706
15787
|
}
|
|
15707
15788
|
|
|
15708
15789
|
// src/components/order-confirmation.tsx
|
|
15709
|
-
var
|
|
15790
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
15710
15791
|
var DEFAULT_LABELS9 = {
|
|
15711
15792
|
pollingTitle: "Confirmando tu pedido\u2026",
|
|
15712
15793
|
pollingDescription: "Estamos procesando el pago, un momento\u2026",
|
|
@@ -15772,43 +15853,43 @@ function OrderConfirmation({
|
|
|
15772
15853
|
const showOrderReference = Boolean(order) && !showFullOrderSummary && (status === "refunded" || status === "partially_refunded" || status === "pending_timeout");
|
|
15773
15854
|
const showSessionReference = !order && sessionId && (status === "timeout" || status === "not_found" || status === "pending_timeout");
|
|
15774
15855
|
const showRecheck = (status === "pending_timeout" || status === "error") && onRecheck;
|
|
15775
|
-
return /* @__PURE__ */ (0,
|
|
15776
|
-
/* @__PURE__ */ (0,
|
|
15777
|
-
/* @__PURE__ */ (0,
|
|
15778
|
-
showFullOrderSummary && order && /* @__PURE__ */ (0,
|
|
15779
|
-
/* @__PURE__ */ (0,
|
|
15780
|
-
/* @__PURE__ */ (0,
|
|
15781
|
-
/* @__PURE__ */ (0,
|
|
15856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: (0, import_utils24.cn)("space-y-6 text-center", className), "data-slot": "order-confirmation", children: [
|
|
15857
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("h1", { className: "text-3xl font-bold", children: title }),
|
|
15858
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "text-lg text-muted-foreground", children: description }),
|
|
15859
|
+
showFullOrderSummary && order && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "space-y-6", children: [
|
|
15860
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
15861
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.orderNumberLabel }),
|
|
15862
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "font-mono text-lg font-semibold", children: order.orderNumber })
|
|
15782
15863
|
] }),
|
|
15783
|
-
/* @__PURE__ */ (0,
|
|
15784
|
-
order.items.map((item, idx) => /* @__PURE__ */ (0,
|
|
15864
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "mx-auto max-w-sm space-y-3 rounded-xl border border-border bg-card p-5 text-left", children: [
|
|
15865
|
+
order.items.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
15785
15866
|
"div",
|
|
15786
15867
|
{
|
|
15787
15868
|
className: "flex justify-between gap-4 text-sm",
|
|
15788
15869
|
children: [
|
|
15789
|
-
/* @__PURE__ */ (0,
|
|
15870
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "max-w-[60%] truncate text-muted-foreground", children: [
|
|
15790
15871
|
item.product.name,
|
|
15791
15872
|
item.variant ? ` (${item.variant.name})` : "",
|
|
15792
15873
|
" x",
|
|
15793
15874
|
item.quantity
|
|
15794
15875
|
] }),
|
|
15795
|
-
/* @__PURE__ */ (0,
|
|
15876
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: formatPrice(item.total, currencyCode, locale) })
|
|
15796
15877
|
]
|
|
15797
15878
|
},
|
|
15798
15879
|
idx
|
|
15799
15880
|
)),
|
|
15800
|
-
/* @__PURE__ */ (0,
|
|
15801
|
-
/* @__PURE__ */ (0,
|
|
15802
|
-
/* @__PURE__ */ (0,
|
|
15881
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "space-y-1 border-t border-border pt-3 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex justify-between pt-1 text-base font-bold", children: [
|
|
15882
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: t.totalLabel }),
|
|
15883
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: formatPrice(order.total, currencyCode, locale) })
|
|
15803
15884
|
] }) })
|
|
15804
15885
|
] }),
|
|
15805
|
-
/* @__PURE__ */ (0,
|
|
15886
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("p", { className: "mx-auto max-w-sm text-sm text-muted-foreground", children: [
|
|
15806
15887
|
t.confirmationEmailPrefix,
|
|
15807
15888
|
" ",
|
|
15808
|
-
/* @__PURE__ */ (0,
|
|
15889
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "font-medium text-foreground", children: order.customerEmail }),
|
|
15809
15890
|
"."
|
|
15810
15891
|
] }),
|
|
15811
|
-
/* @__PURE__ */ (0,
|
|
15892
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
15812
15893
|
OrderInvoiceLink,
|
|
15813
15894
|
{
|
|
15814
15895
|
invoice: order.invoice,
|
|
@@ -15816,11 +15897,11 @@ function OrderConfirmation({
|
|
|
15816
15897
|
}
|
|
15817
15898
|
)
|
|
15818
15899
|
] }),
|
|
15819
|
-
showOrderReference && order && /* @__PURE__ */ (0,
|
|
15820
|
-
/* @__PURE__ */ (0,
|
|
15821
|
-
/* @__PURE__ */ (0,
|
|
15900
|
+
showOrderReference && order && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
15901
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.orderReferenceLabel }),
|
|
15902
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "font-mono text-lg font-semibold", children: order.orderNumber })
|
|
15822
15903
|
] }),
|
|
15823
|
-
status === "failed" && cartHref && /* @__PURE__ */ (0,
|
|
15904
|
+
status === "failed" && cartHref && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
15824
15905
|
"a",
|
|
15825
15906
|
{
|
|
15826
15907
|
href: cartHref,
|
|
@@ -15828,7 +15909,7 @@ function OrderConfirmation({
|
|
|
15828
15909
|
children: t.backToCartLabel
|
|
15829
15910
|
}
|
|
15830
15911
|
),
|
|
15831
|
-
showRecheck && /* @__PURE__ */ (0,
|
|
15912
|
+
showRecheck && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
15832
15913
|
"button",
|
|
15833
15914
|
{
|
|
15834
15915
|
type: "button",
|
|
@@ -15837,16 +15918,16 @@ function OrderConfirmation({
|
|
|
15837
15918
|
children: t.recheckLabel
|
|
15838
15919
|
}
|
|
15839
15920
|
),
|
|
15840
|
-
showSessionReference && /* @__PURE__ */ (0,
|
|
15841
|
-
/* @__PURE__ */ (0,
|
|
15842
|
-
/* @__PURE__ */ (0,
|
|
15921
|
+
showSessionReference && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
15922
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.sessionReferenceLabel }),
|
|
15923
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "break-all font-mono text-sm font-semibold", children: sessionId })
|
|
15843
15924
|
] })
|
|
15844
15925
|
] });
|
|
15845
15926
|
}
|
|
15846
15927
|
|
|
15847
15928
|
// src/components/full-invoice-fields.tsx
|
|
15848
|
-
var
|
|
15849
|
-
var
|
|
15929
|
+
var import_utils25 = require("@reblu/site-ui/utils");
|
|
15930
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
15850
15931
|
var EMPTY_FULL_INVOICE_VALUE = {
|
|
15851
15932
|
wantsFullInvoice: false,
|
|
15852
15933
|
billingIdType: "NIF",
|
|
@@ -15963,12 +16044,12 @@ function FullInvoiceFields({
|
|
|
15963
16044
|
const showFields = value.wantsFullInvoice || overCap;
|
|
15964
16045
|
const isSpanishNif = value.billingIdType === "NIF";
|
|
15965
16046
|
const set = (key2, next2) => onChange({ ...value, [key2]: next2 });
|
|
15966
|
-
const error = (key2) => errors[key2] ? /* @__PURE__ */ (0,
|
|
16047
|
+
const error = (key2) => errors[key2] ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { id: `full-invoice-${key2}-error`, className: "text-sm text-destructive", children: errors[key2] }) : null;
|
|
15967
16048
|
const invalid2 = (key2) => errors[key2] ? { "aria-invalid": true, "aria-describedby": `full-invoice-${key2}-error` } : {};
|
|
15968
|
-
return /* @__PURE__ */ (0,
|
|
15969
|
-
overCap ? /* @__PURE__ */ (0,
|
|
15970
|
-
/* @__PURE__ */ (0,
|
|
15971
|
-
/* @__PURE__ */ (0,
|
|
16049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("section", { className: (0, import_utils25.cn)("space-y-4", className), "data-slot": "full-invoice-fields", children: [
|
|
16050
|
+
overCap ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { role: "note", className: "rounded-lg border border-border p-4 text-sm", children: t.overCapNotice }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "space-y-1", children: [
|
|
16051
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("label", { className: "flex items-center gap-2 text-sm font-medium", children: [
|
|
16052
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
15972
16053
|
"input",
|
|
15973
16054
|
{
|
|
15974
16055
|
type: "checkbox",
|
|
@@ -15978,12 +16059,12 @@ function FullInvoiceFields({
|
|
|
15978
16059
|
),
|
|
15979
16060
|
t.toggle
|
|
15980
16061
|
] }),
|
|
15981
|
-
/* @__PURE__ */ (0,
|
|
16062
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "text-sm text-muted-foreground", children: t.underCapNotice })
|
|
15982
16063
|
] }),
|
|
15983
|
-
showFields && /* @__PURE__ */ (0,
|
|
15984
|
-
/* @__PURE__ */ (0,
|
|
15985
|
-
/* @__PURE__ */ (0,
|
|
15986
|
-
/* @__PURE__ */ (0,
|
|
16064
|
+
showFields && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
|
|
16065
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "space-y-1", children: [
|
|
16066
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("label", { htmlFor: "full-invoice-id-type", className: "text-sm font-medium", children: t.idType }),
|
|
16067
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
15987
16068
|
"select",
|
|
15988
16069
|
{
|
|
15989
16070
|
id: "full-invoice-id-type",
|
|
@@ -15992,14 +16073,14 @@ function FullInvoiceFields({
|
|
|
15992
16073
|
value: value.billingIdType,
|
|
15993
16074
|
onChange: (e) => set("billingIdType", e.target.value),
|
|
15994
16075
|
...invalid2("billingIdType"),
|
|
15995
|
-
children: ID_TYPES.map((type) => /* @__PURE__ */ (0,
|
|
16076
|
+
children: ID_TYPES.map((type) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("option", { value: type, children: t.idTypeOptions[type] }, type))
|
|
15996
16077
|
}
|
|
15997
16078
|
),
|
|
15998
16079
|
error("billingIdType")
|
|
15999
16080
|
] }),
|
|
16000
|
-
!isSpanishNif && /* @__PURE__ */ (0,
|
|
16001
|
-
/* @__PURE__ */ (0,
|
|
16002
|
-
/* @__PURE__ */ (0,
|
|
16081
|
+
!isSpanishNif && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "space-y-1", children: [
|
|
16082
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("label", { htmlFor: "full-invoice-id-country", className: "text-sm font-medium", children: t.idCountry }),
|
|
16083
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
16003
16084
|
"select",
|
|
16004
16085
|
{
|
|
16005
16086
|
id: "full-invoice-id-country",
|
|
@@ -16009,16 +16090,16 @@ function FullInvoiceFields({
|
|
|
16009
16090
|
onChange: (e) => set("billingIdCountry", e.target.value),
|
|
16010
16091
|
...invalid2("billingIdCountry"),
|
|
16011
16092
|
children: [
|
|
16012
|
-
/* @__PURE__ */ (0,
|
|
16013
|
-
countries.map((c) => /* @__PURE__ */ (0,
|
|
16093
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("option", { value: "", disabled: true, children: t.chooseCountry }),
|
|
16094
|
+
countries.map((c) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("option", { value: c.code, children: c.name }, c.code))
|
|
16014
16095
|
]
|
|
16015
16096
|
}
|
|
16016
16097
|
),
|
|
16017
16098
|
error("billingIdCountry")
|
|
16018
16099
|
] }),
|
|
16019
|
-
/* @__PURE__ */ (0,
|
|
16020
|
-
/* @__PURE__ */ (0,
|
|
16021
|
-
/* @__PURE__ */ (0,
|
|
16100
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "space-y-1", children: [
|
|
16101
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("label", { htmlFor: "full-invoice-nif", className: "text-sm font-medium", children: isSpanishNif ? t.spanishNif : t.documentNumber }),
|
|
16102
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
16022
16103
|
"input",
|
|
16023
16104
|
{
|
|
16024
16105
|
id: "full-invoice-nif",
|
|
@@ -16031,9 +16112,9 @@ function FullInvoiceFields({
|
|
|
16031
16112
|
),
|
|
16032
16113
|
error("billingNif")
|
|
16033
16114
|
] }),
|
|
16034
|
-
/* @__PURE__ */ (0,
|
|
16035
|
-
/* @__PURE__ */ (0,
|
|
16036
|
-
/* @__PURE__ */ (0,
|
|
16115
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "space-y-1", children: [
|
|
16116
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("label", { htmlFor: "full-invoice-name", className: "text-sm font-medium", children: t.name }),
|
|
16117
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
16037
16118
|
"input",
|
|
16038
16119
|
{
|
|
16039
16120
|
id: "full-invoice-name",
|
|
@@ -16046,9 +16127,9 @@ function FullInvoiceFields({
|
|
|
16046
16127
|
),
|
|
16047
16128
|
error("billingName")
|
|
16048
16129
|
] }),
|
|
16049
|
-
/* @__PURE__ */ (0,
|
|
16050
|
-
/* @__PURE__ */ (0,
|
|
16051
|
-
/* @__PURE__ */ (0,
|
|
16130
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "space-y-1 sm:col-span-2", children: [
|
|
16131
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("label", { htmlFor: "full-invoice-street", className: "text-sm font-medium", children: t.street }),
|
|
16132
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
16052
16133
|
"input",
|
|
16053
16134
|
{
|
|
16054
16135
|
id: "full-invoice-street",
|
|
@@ -16060,9 +16141,9 @@ function FullInvoiceFields({
|
|
|
16060
16141
|
}
|
|
16061
16142
|
)
|
|
16062
16143
|
] }),
|
|
16063
|
-
/* @__PURE__ */ (0,
|
|
16064
|
-
/* @__PURE__ */ (0,
|
|
16065
|
-
/* @__PURE__ */ (0,
|
|
16144
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "space-y-1", children: [
|
|
16145
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("label", { htmlFor: "full-invoice-postal-code", className: "text-sm font-medium", children: t.postalCode }),
|
|
16146
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
16066
16147
|
"input",
|
|
16067
16148
|
{
|
|
16068
16149
|
id: "full-invoice-postal-code",
|
|
@@ -16073,9 +16154,9 @@ function FullInvoiceFields({
|
|
|
16073
16154
|
}
|
|
16074
16155
|
)
|
|
16075
16156
|
] }),
|
|
16076
|
-
/* @__PURE__ */ (0,
|
|
16077
|
-
/* @__PURE__ */ (0,
|
|
16078
|
-
/* @__PURE__ */ (0,
|
|
16157
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "space-y-1", children: [
|
|
16158
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("label", { htmlFor: "full-invoice-city", className: "text-sm font-medium", children: t.city }),
|
|
16159
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
16079
16160
|
"input",
|
|
16080
16161
|
{
|
|
16081
16162
|
id: "full-invoice-city",
|
|
@@ -16086,9 +16167,9 @@ function FullInvoiceFields({
|
|
|
16086
16167
|
}
|
|
16087
16168
|
)
|
|
16088
16169
|
] }),
|
|
16089
|
-
/* @__PURE__ */ (0,
|
|
16090
|
-
/* @__PURE__ */ (0,
|
|
16091
|
-
/* @__PURE__ */ (0,
|
|
16170
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "space-y-1", children: [
|
|
16171
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("label", { htmlFor: "full-invoice-country", className: "text-sm font-medium", children: t.country }),
|
|
16172
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
16092
16173
|
"select",
|
|
16093
16174
|
{
|
|
16094
16175
|
id: "full-invoice-country",
|
|
@@ -16096,18 +16177,408 @@ function FullInvoiceFields({
|
|
|
16096
16177
|
required: true,
|
|
16097
16178
|
value: value.country,
|
|
16098
16179
|
onChange: (e) => set("country", e.target.value),
|
|
16099
|
-
children: countries.map((c) => /* @__PURE__ */ (0,
|
|
16180
|
+
children: countries.map((c) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("option", { value: c.code, children: c.name }, c.code))
|
|
16100
16181
|
}
|
|
16101
16182
|
)
|
|
16102
16183
|
] }),
|
|
16103
|
-
/* @__PURE__ */ (0,
|
|
16184
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "sm:col-span-2", children: error("address") })
|
|
16104
16185
|
] })
|
|
16105
16186
|
] });
|
|
16106
16187
|
}
|
|
16107
16188
|
|
|
16189
|
+
// src/components/checkout-delivery-choice.tsx
|
|
16190
|
+
var import_utils26 = require("@reblu/site-ui/utils");
|
|
16191
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
16192
|
+
var EMPTY_CHECKOUT_ADDRESS = {
|
|
16193
|
+
firstName: "",
|
|
16194
|
+
lastName: "",
|
|
16195
|
+
street: "",
|
|
16196
|
+
postalCode: "",
|
|
16197
|
+
city: "",
|
|
16198
|
+
region: ""
|
|
16199
|
+
};
|
|
16200
|
+
var DEFAULT_CHECKOUT_DELIVERY_CHOICE_LABELS = {
|
|
16201
|
+
legend: "Entrega",
|
|
16202
|
+
free: "Gratis",
|
|
16203
|
+
pickupPointsLegend: "Punto de recogida",
|
|
16204
|
+
addressLegend: "Direcci\xF3n de entrega",
|
|
16205
|
+
firstName: "Nombre",
|
|
16206
|
+
lastName: "Apellidos",
|
|
16207
|
+
street: "Direcci\xF3n",
|
|
16208
|
+
postalCode: "C\xF3digo postal",
|
|
16209
|
+
city: "Ciudad",
|
|
16210
|
+
region: "Provincia"
|
|
16211
|
+
};
|
|
16212
|
+
var INPUT_CLASS = "w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20";
|
|
16213
|
+
var ADDRESS_FIELDS = [
|
|
16214
|
+
{ key: "firstName", autoComplete: "shipping given-name", required: true },
|
|
16215
|
+
{ key: "lastName", autoComplete: "shipping family-name", required: true },
|
|
16216
|
+
{ key: "street", autoComplete: "shipping street-address", required: true, wide: true },
|
|
16217
|
+
{ key: "postalCode", autoComplete: "shipping postal-code", required: true },
|
|
16218
|
+
{ key: "city", autoComplete: "shipping address-level2", required: true },
|
|
16219
|
+
{ key: "region", autoComplete: "shipping address-level1", required: false }
|
|
16220
|
+
];
|
|
16221
|
+
function pickupDescription(location2) {
|
|
16222
|
+
return [
|
|
16223
|
+
`${location2.address}, ${location2.postalCode} ${location2.city}`,
|
|
16224
|
+
location2.openingHoursText,
|
|
16225
|
+
location2.pickupReadyText
|
|
16226
|
+
].filter(Boolean).join(". ");
|
|
16227
|
+
}
|
|
16228
|
+
function CheckoutDeliveryChoice({
|
|
16229
|
+
delivery,
|
|
16230
|
+
copy,
|
|
16231
|
+
value,
|
|
16232
|
+
onChange,
|
|
16233
|
+
address,
|
|
16234
|
+
onAddressChange,
|
|
16235
|
+
addressErrors,
|
|
16236
|
+
error,
|
|
16237
|
+
quote,
|
|
16238
|
+
requiresDelivery = true,
|
|
16239
|
+
labels,
|
|
16240
|
+
currencyCode,
|
|
16241
|
+
locale,
|
|
16242
|
+
id: uid = "checkout-delivery",
|
|
16243
|
+
className
|
|
16244
|
+
}) {
|
|
16245
|
+
const t = { ...DEFAULT_CHECKOUT_DELIVERY_CHOICE_LABELS, ...labels };
|
|
16246
|
+
const { homeDelivery, pickup } = delivery.methods;
|
|
16247
|
+
if (!requiresDelivery || !homeDelivery && !pickup) return null;
|
|
16248
|
+
const price = (cents) => formatPrice(cents, currencyCode, locale);
|
|
16249
|
+
const quotedShipping = quote?.fulfillment.type === "SHIPPING" ? quote.shipping : null;
|
|
16250
|
+
const homeCost = quotedShipping ? quotedShipping.isFree ? t.free : price(quotedShipping.cost) : delivery.shippingEnabled && delivery.defaultShippingCost ? price(delivery.defaultShippingCost) : t.free;
|
|
16251
|
+
const isPickup = value?.type === "PICKUP";
|
|
16252
|
+
const isShipping = value?.type === "SHIPPING";
|
|
16253
|
+
const errorId = `${uid}-delivery-error`;
|
|
16254
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
16255
|
+
"fieldset",
|
|
16256
|
+
{
|
|
16257
|
+
"data-slot": "checkout-delivery",
|
|
16258
|
+
"aria-describedby": error ? errorId : void 0,
|
|
16259
|
+
className: (0, import_utils26.cn)("space-y-4", className),
|
|
16260
|
+
children: [
|
|
16261
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("legend", { className: "mb-2 text-lg font-semibold", children: t.legend }),
|
|
16262
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "grid gap-3 sm:grid-cols-2", children: [
|
|
16263
|
+
homeDelivery ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "flex cursor-pointer items-start gap-3 rounded-xl border border-border p-4 has-[:checked]:border-primary", children: [
|
|
16264
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
16265
|
+
"input",
|
|
16266
|
+
{
|
|
16267
|
+
type: "radio",
|
|
16268
|
+
name: `${uid}-method`,
|
|
16269
|
+
checked: isShipping,
|
|
16270
|
+
onChange: () => onChange({ type: "SHIPPING" }),
|
|
16271
|
+
className: "mt-0.5 size-4 accent-primary"
|
|
16272
|
+
}
|
|
16273
|
+
),
|
|
16274
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { className: "flex-1 space-y-1", children: [
|
|
16275
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { className: "flex justify-between gap-2 font-medium", children: [
|
|
16276
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: copy.shippingOptionLabel }),
|
|
16277
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "tabular-nums", children: homeCost })
|
|
16278
|
+
] }),
|
|
16279
|
+
delivery.estimatedDeliveryText ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "block text-sm text-muted-foreground", children: delivery.estimatedDeliveryText }) : null
|
|
16280
|
+
] })
|
|
16281
|
+
] }) : null,
|
|
16282
|
+
pickup ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("label", { className: "flex cursor-pointer items-start gap-3 rounded-xl border border-border p-4 has-[:checked]:border-primary", children: [
|
|
16283
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
16284
|
+
"input",
|
|
16285
|
+
{
|
|
16286
|
+
type: "radio",
|
|
16287
|
+
name: `${uid}-method`,
|
|
16288
|
+
checked: isPickup,
|
|
16289
|
+
onChange: () => onChange({ type: "PICKUP" }),
|
|
16290
|
+
className: "mt-0.5 size-4 accent-primary"
|
|
16291
|
+
}
|
|
16292
|
+
),
|
|
16293
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { className: "flex flex-1 justify-between gap-2 font-medium", children: [
|
|
16294
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: copy.pickupOptionLabel }),
|
|
16295
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: t.free })
|
|
16296
|
+
] })
|
|
16297
|
+
] }) : null
|
|
16298
|
+
] }),
|
|
16299
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { id: errorId, role: "alert", className: "text-sm text-destructive", children: error }) : null,
|
|
16300
|
+
isPickup ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { role: "radiogroup", "aria-labelledby": `${uid}-points`, className: "space-y-2", children: [
|
|
16301
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { id: `${uid}-points`, className: "text-sm font-medium", children: t.pickupPointsLegend }),
|
|
16302
|
+
delivery.pickupLocations.map((location2) => {
|
|
16303
|
+
const descId = `${uid}-point-${location2.id}`;
|
|
16304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
16305
|
+
"label",
|
|
16306
|
+
{
|
|
16307
|
+
className: "flex cursor-pointer items-start gap-3 rounded-lg border border-border p-3 has-[:checked]:border-primary",
|
|
16308
|
+
children: [
|
|
16309
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
16310
|
+
"input",
|
|
16311
|
+
{
|
|
16312
|
+
type: "radio",
|
|
16313
|
+
name: `${uid}-point`,
|
|
16314
|
+
checked: value?.pickupLocationId === location2.id,
|
|
16315
|
+
onChange: () => onChange({ type: "PICKUP", pickupLocationId: location2.id }),
|
|
16316
|
+
"aria-describedby": descId,
|
|
16317
|
+
className: "mt-0.5 size-4 accent-primary"
|
|
16318
|
+
}
|
|
16319
|
+
),
|
|
16320
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { className: "space-y-0.5 text-sm", children: [
|
|
16321
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "block font-medium", children: location2.name }),
|
|
16322
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { id: descId, className: "block text-muted-foreground", children: pickupDescription(location2) })
|
|
16323
|
+
] })
|
|
16324
|
+
]
|
|
16325
|
+
},
|
|
16326
|
+
location2.id
|
|
16327
|
+
);
|
|
16328
|
+
})
|
|
16329
|
+
] }) : null,
|
|
16330
|
+
isShipping ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("fieldset", { className: "space-y-3", children: [
|
|
16331
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("legend", { className: "mb-2 text-sm font-medium", children: t.addressLegend }),
|
|
16332
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: ADDRESS_FIELDS.map(({ key: key2, autoComplete, required, wide }) => {
|
|
16333
|
+
const fieldId = `${uid}-${key2}`;
|
|
16334
|
+
const fieldError = addressErrors?.[key2];
|
|
16335
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: (0, import_utils26.cn)("space-y-1", wide && "sm:col-span-2"), children: [
|
|
16336
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("label", { htmlFor: fieldId, className: "text-sm font-medium", children: t[key2] }),
|
|
16337
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
16338
|
+
"input",
|
|
16339
|
+
{
|
|
16340
|
+
id: fieldId,
|
|
16341
|
+
type: "text",
|
|
16342
|
+
required,
|
|
16343
|
+
autoComplete,
|
|
16344
|
+
value: address[key2],
|
|
16345
|
+
onChange: (e) => onAddressChange({ ...address, [key2]: e.target.value }),
|
|
16346
|
+
"aria-invalid": fieldError ? true : void 0,
|
|
16347
|
+
"aria-describedby": fieldError ? `${fieldId}-error` : void 0,
|
|
16348
|
+
className: (0, import_utils26.cn)(
|
|
16349
|
+
INPUT_CLASS,
|
|
16350
|
+
fieldError ? "border-destructive" : "border-border focus:border-primary"
|
|
16351
|
+
)
|
|
16352
|
+
}
|
|
16353
|
+
),
|
|
16354
|
+
fieldError ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { id: `${fieldId}-error`, className: "text-sm text-destructive", children: fieldError }) : null
|
|
16355
|
+
] }, key2);
|
|
16356
|
+
}) })
|
|
16357
|
+
] }) : null
|
|
16358
|
+
]
|
|
16359
|
+
}
|
|
16360
|
+
);
|
|
16361
|
+
}
|
|
16362
|
+
function defaultCheckoutFulfillment(delivery) {
|
|
16363
|
+
if (!delivery) return null;
|
|
16364
|
+
if (delivery.methods.homeDelivery) return { type: "SHIPPING" };
|
|
16365
|
+
if (!delivery.methods.pickup) return null;
|
|
16366
|
+
const [only, ...rest] = delivery.pickupLocations;
|
|
16367
|
+
return only && rest.length === 0 ? { type: "PICKUP", pickupLocationId: only.id } : { type: "PICKUP" };
|
|
16368
|
+
}
|
|
16369
|
+
function quoteRequiresDelivery(quote) {
|
|
16370
|
+
return quote ? quote.lines.some((line) => line.isShippable) : true;
|
|
16371
|
+
}
|
|
16372
|
+
function toCheckoutFulfillmentFields(value, address, requiresDelivery = true) {
|
|
16373
|
+
if (!value || !requiresDelivery) return { fulfillment: { type: "SHIPPING" } };
|
|
16374
|
+
if (value.type === "PICKUP") {
|
|
16375
|
+
return { fulfillment: value.pickupLocationId ? { type: "PICKUP", pickupLocationId: value.pickupLocationId } : { type: "PICKUP" } };
|
|
16376
|
+
}
|
|
16377
|
+
const shippingAddress = {
|
|
16378
|
+
firstName: address.firstName.trim(),
|
|
16379
|
+
lastName: address.lastName.trim(),
|
|
16380
|
+
street: address.street.trim(),
|
|
16381
|
+
postalCode: address.postalCode.trim(),
|
|
16382
|
+
city: address.city.trim(),
|
|
16383
|
+
...address.region.trim() ? { region: address.region.trim() } : {}
|
|
16384
|
+
};
|
|
16385
|
+
return { fulfillment: { type: "SHIPPING" }, shippingAddress };
|
|
16386
|
+
}
|
|
16387
|
+
|
|
16388
|
+
// src/components/checkout-quote-summary.tsx
|
|
16389
|
+
var import_utils27 = require("@reblu/site-ui/utils");
|
|
16390
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
16391
|
+
var DEFAULT_CHECKOUT_QUOTE_SUMMARY_LABELS = {
|
|
16392
|
+
subtotal: "Subtotal",
|
|
16393
|
+
discount: (codeOrLabel, isAutomatic) => isAutomatic ? codeOrLabel : `Descuento (${codeOrLabel})`,
|
|
16394
|
+
free: "Gratis",
|
|
16395
|
+
delivery: "Entrega",
|
|
16396
|
+
remainingForFree: (amount) => `Te faltan ${amount} para el env\xEDo gratis`,
|
|
16397
|
+
taxIncluded: (label) => `De los cuales ${label}`,
|
|
16398
|
+
total: "Total",
|
|
16399
|
+
taxesIncludedNote: "Impuestos incluidos",
|
|
16400
|
+
quantityTimesUnit: (quantity, unit) => `${quantity} \xD7 ${unit}`
|
|
16401
|
+
};
|
|
16402
|
+
function Row({
|
|
16403
|
+
name,
|
|
16404
|
+
value,
|
|
16405
|
+
className
|
|
16406
|
+
}) {
|
|
16407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { "data-slot": "checkout-quote-row", className: (0, import_utils27.cn)("flex justify-between gap-4", className), children: [
|
|
16408
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("dt", { children: name }),
|
|
16409
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("dd", { className: "shrink-0 tabular-nums", children: value })
|
|
16410
|
+
] });
|
|
16411
|
+
}
|
|
16412
|
+
function CheckoutQuoteSummary({
|
|
16413
|
+
quote,
|
|
16414
|
+
heading,
|
|
16415
|
+
headingLevel = 2,
|
|
16416
|
+
labels,
|
|
16417
|
+
currencyCode,
|
|
16418
|
+
locale,
|
|
16419
|
+
className
|
|
16420
|
+
}) {
|
|
16421
|
+
const t = { ...DEFAULT_CHECKOUT_QUOTE_SUMMARY_LABELS, ...labels };
|
|
16422
|
+
const price = (cents) => formatPrice(cents, currencyCode, locale);
|
|
16423
|
+
const { fulfillment, shipping, tax, discount } = quote;
|
|
16424
|
+
const Tag = `h${headingLevel}`;
|
|
16425
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("section", { "data-slot": "checkout-quote-summary", className: slotClassName("space-y-4", "", className), children: [
|
|
16426
|
+
heading ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Tag, { className: "text-lg font-semibold", children: heading }) : null,
|
|
16427
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("ul", { className: "space-y-3 text-sm", children: quote.lines.map((line) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("li", { className: "flex justify-between gap-4", children: [
|
|
16428
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "min-w-0 space-y-0.5", children: [
|
|
16429
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "font-medium", children: line.name }),
|
|
16430
|
+
line.variantName ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-muted-foreground", children: line.variantName }) : null,
|
|
16431
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("p", { className: "flex flex-wrap items-center gap-2 text-muted-foreground", children: [
|
|
16432
|
+
line.kindLabel ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { "data-slot": "checkout-quote-kind", className: "rounded-full border border-border px-2 py-0.5 text-xs font-medium text-foreground", children: line.kindLabel }) : null,
|
|
16433
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: t.quantityTimesUnit(line.quantity, price(line.unitPrice)) })
|
|
16434
|
+
] })
|
|
16435
|
+
] }),
|
|
16436
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "shrink-0 tabular-nums", children: price(line.total) })
|
|
16437
|
+
] }, `${line.productId}-${line.variantId ?? ""}`)) }),
|
|
16438
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("dl", { className: "space-y-2 border-t border-border pt-3 text-sm", children: [
|
|
16439
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Row, { name: t.subtotal, value: price(quote.subtotal) }),
|
|
16440
|
+
discount && discount.amount > 0 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
16441
|
+
Row,
|
|
16442
|
+
{
|
|
16443
|
+
className: "text-green-700 dark:text-green-400",
|
|
16444
|
+
name: t.discount(discount.isAutomatic ? discount.label ?? discount.code : discount.code, discount.isAutomatic),
|
|
16445
|
+
value: `\u2212${price(discount.amount)}`
|
|
16446
|
+
}
|
|
16447
|
+
) : null,
|
|
16448
|
+
fulfillment.type ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
16449
|
+
Row,
|
|
16450
|
+
{
|
|
16451
|
+
name: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
16452
|
+
fulfillment.label ?? t.delivery,
|
|
16453
|
+
fulfillment.type === "PICKUP" && fulfillment.pickupLocation ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "block text-muted-foreground", children: fulfillment.pickupLocation.name }) : null
|
|
16454
|
+
] }),
|
|
16455
|
+
value: fulfillment.type === "PICKUP" || shipping.isFree ? t.free : price(shipping.cost)
|
|
16456
|
+
}
|
|
16457
|
+
) : null,
|
|
16458
|
+
tax.isLineVisible ? tax.breakdown.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
16459
|
+
Row,
|
|
16460
|
+
{
|
|
16461
|
+
className: tax.isIncluded ? "text-muted-foreground" : void 0,
|
|
16462
|
+
name: tax.isIncluded ? t.taxIncluded(entry.label) : entry.label,
|
|
16463
|
+
value: price(entry.amount)
|
|
16464
|
+
},
|
|
16465
|
+
entry.label
|
|
16466
|
+
)) : null,
|
|
16467
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Row, { className: "border-t border-border pt-2 text-base font-bold", name: t.total, value: price(quote.total) })
|
|
16468
|
+
] }),
|
|
16469
|
+
tax.isIncluded ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-sm text-muted-foreground", children: t.taxesIncludedNote }) : null,
|
|
16470
|
+
fulfillment.type === "SHIPPING" && !shipping.isFree && shipping.remainingForFree ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-sm text-muted-foreground", children: t.remainingForFree(price(shipping.remainingForFree)) }) : null,
|
|
16471
|
+
fulfillment.type && quote.deliveryEstimateText ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { "data-slot": "checkout-quote-estimate", className: "text-sm text-muted-foreground", children: quote.deliveryEstimateText }) : null,
|
|
16472
|
+
quote.discountError ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { role: "status", className: "text-sm text-destructive", children: quote.discountError.message }) : null,
|
|
16473
|
+
quote.blockingReason ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { role: "alert", className: "rounded-lg border border-destructive/50 bg-destructive/10 p-3 text-sm text-destructive", children: quote.blockingReason.message }) : null
|
|
16474
|
+
] });
|
|
16475
|
+
}
|
|
16476
|
+
|
|
16477
|
+
// src/components/checkout-terms-acceptance.tsx
|
|
16478
|
+
var import_utils28 = require("@reblu/site-ui/utils");
|
|
16479
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
16480
|
+
function splitTermsLabel(label) {
|
|
16481
|
+
const at = label.indexOf("{terms}");
|
|
16482
|
+
return at === -1 ? [`${label} `, ""] : [label.slice(0, at), label.slice(at + "{terms}".length)];
|
|
16483
|
+
}
|
|
16484
|
+
function CheckoutTermsAcceptance({
|
|
16485
|
+
copy,
|
|
16486
|
+
termsHref,
|
|
16487
|
+
checked,
|
|
16488
|
+
onCheckedChange,
|
|
16489
|
+
error,
|
|
16490
|
+
newTabHint = "(se abre en una pesta\xF1a nueva)",
|
|
16491
|
+
id,
|
|
16492
|
+
className
|
|
16493
|
+
}) {
|
|
16494
|
+
if (!copy.termsVersion) return null;
|
|
16495
|
+
const boxId = id ?? "checkout-terms";
|
|
16496
|
+
const errorId = `${boxId}-error`;
|
|
16497
|
+
const [before, after] = splitTermsLabel(copy.termsCheckboxLabel).map(
|
|
16498
|
+
(part) => part.replaceAll("{tenant}", copy.tenantName)
|
|
16499
|
+
);
|
|
16500
|
+
const newTab = copy.isTermsLinkNewTab;
|
|
16501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { "data-slot": "checkout-terms", className: (0, import_utils28.cn)("space-y-1", className), children: [
|
|
16502
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-start gap-3", children: [
|
|
16503
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
16504
|
+
"input",
|
|
16505
|
+
{
|
|
16506
|
+
id: boxId,
|
|
16507
|
+
type: "checkbox",
|
|
16508
|
+
required: true,
|
|
16509
|
+
checked,
|
|
16510
|
+
onChange: (e) => onCheckedChange(e.target.checked),
|
|
16511
|
+
"aria-invalid": error ? true : void 0,
|
|
16512
|
+
"aria-describedby": error ? errorId : void 0,
|
|
16513
|
+
className: "mt-0.5 size-5 shrink-0 cursor-pointer accent-primary"
|
|
16514
|
+
}
|
|
16515
|
+
),
|
|
16516
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("label", { htmlFor: boxId, className: "text-sm leading-relaxed", children: [
|
|
16517
|
+
before,
|
|
16518
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
16519
|
+
"a",
|
|
16520
|
+
{
|
|
16521
|
+
href: copy.termsLinkUrl ?? termsHref,
|
|
16522
|
+
...newTab ? { target: "_blank", rel: "noopener noreferrer" } : {},
|
|
16523
|
+
className: "font-medium underline underline-offset-2 hover:text-primary",
|
|
16524
|
+
children: [
|
|
16525
|
+
copy.termsLinkText,
|
|
16526
|
+
newTab ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
16527
|
+
" ",
|
|
16528
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "sr-only", children: newTabHint })
|
|
16529
|
+
] }) : null
|
|
16530
|
+
]
|
|
16531
|
+
}
|
|
16532
|
+
),
|
|
16533
|
+
after
|
|
16534
|
+
] })
|
|
16535
|
+
] }),
|
|
16536
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { id: errorId, className: "pl-8 text-sm text-destructive", children: error }) : null
|
|
16537
|
+
] });
|
|
16538
|
+
}
|
|
16539
|
+
function toCheckoutTermsFields(copy, accepted) {
|
|
16540
|
+
const version = copy?.termsVersion;
|
|
16541
|
+
return version ? { acceptsTerms: accepted, termsVersionId: version.id } : {};
|
|
16542
|
+
}
|
|
16543
|
+
|
|
16544
|
+
// src/components/checkout-pay-action.tsx
|
|
16545
|
+
var import_utils29 = require("@reblu/site-ui/utils");
|
|
16546
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
16547
|
+
function CheckoutPayAction({
|
|
16548
|
+
label,
|
|
16549
|
+
notice,
|
|
16550
|
+
submitting = false,
|
|
16551
|
+
submittingLabel = "Procesando\u2026",
|
|
16552
|
+
disabled = false,
|
|
16553
|
+
id = "checkout-pay",
|
|
16554
|
+
className,
|
|
16555
|
+
buttonClassName,
|
|
16556
|
+
noticeClassName
|
|
16557
|
+
}) {
|
|
16558
|
+
const noticeId = `${id}-notice`;
|
|
16559
|
+
const isDisabled = submitting || disabled;
|
|
16560
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { "data-slot": "checkout-pay-action", className: (0, import_utils29.cn)("space-y-3", className), children: [
|
|
16561
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
16562
|
+
"button",
|
|
16563
|
+
{
|
|
16564
|
+
type: "submit",
|
|
16565
|
+
disabled: isDisabled,
|
|
16566
|
+
"aria-busy": submitting || void 0,
|
|
16567
|
+
"aria-describedby": notice ? noticeId : void 0,
|
|
16568
|
+
className: buttonClassName ?? (0, import_utils29.cn)(
|
|
16569
|
+
"flex w-full items-center justify-center gap-2 rounded-xl px-4 py-3 text-base font-semibold transition-all",
|
|
16570
|
+
isDisabled ? "cursor-not-allowed bg-muted text-muted-foreground" : "cursor-pointer bg-primary text-primary-foreground hover:bg-primary/90"
|
|
16571
|
+
),
|
|
16572
|
+
children: submitting ? submittingLabel : label
|
|
16573
|
+
}
|
|
16574
|
+
),
|
|
16575
|
+
notice ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { id: noticeId, "data-slot": "checkout-pay-notice", className: noticeClassName ?? "text-sm text-muted-foreground", children: notice }) : null
|
|
16576
|
+
] });
|
|
16577
|
+
}
|
|
16578
|
+
|
|
16108
16579
|
// src/components/contact-interest-field.tsx
|
|
16109
|
-
var
|
|
16110
|
-
var
|
|
16580
|
+
var import_utils30 = require("@reblu/site-ui/utils");
|
|
16581
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
16111
16582
|
function ContactInterestField({
|
|
16112
16583
|
interest,
|
|
16113
16584
|
value,
|
|
@@ -16124,18 +16595,18 @@ function ContactInterestField({
|
|
|
16124
16595
|
else next2.delete(option2);
|
|
16125
16596
|
onChange(interest.options.filter((candidate) => next2.has(candidate)));
|
|
16126
16597
|
};
|
|
16127
|
-
return /* @__PURE__ */ (0,
|
|
16128
|
-
/* @__PURE__ */ (0,
|
|
16129
|
-
/* @__PURE__ */ (0,
|
|
16598
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("fieldset", { "data-slot": "contact-interest", className: (0, import_utils30.cn)("space-y-2", className), children: [
|
|
16599
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("legend", { className: "text-sm font-medium", children: interest.label }),
|
|
16600
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex flex-col gap-2", children: interest.options.map((option2, index) => {
|
|
16130
16601
|
const id = `${idPrefix}-${index}`;
|
|
16131
|
-
return /* @__PURE__ */ (0,
|
|
16602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
16132
16603
|
"label",
|
|
16133
16604
|
{
|
|
16134
16605
|
htmlFor: id,
|
|
16135
16606
|
"data-slot": "contact-interest-option",
|
|
16136
16607
|
className: "flex items-center gap-2 text-sm",
|
|
16137
16608
|
children: [
|
|
16138
|
-
/* @__PURE__ */ (0,
|
|
16609
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
16139
16610
|
"input",
|
|
16140
16611
|
{
|
|
16141
16612
|
id,
|
|
@@ -16160,16 +16631,23 @@ var import_site_contracts = require("@reblu/site-contracts");
|
|
|
16160
16631
|
0 && (module.exports = {
|
|
16161
16632
|
ALLOWED_YOUTUBE_HOSTS,
|
|
16162
16633
|
AddedToCartToast,
|
|
16634
|
+
ArbitrationBadge,
|
|
16163
16635
|
CartAdjustmentsNotice,
|
|
16164
16636
|
CartLineList,
|
|
16165
16637
|
CartSummary,
|
|
16638
|
+
CheckoutDeliveryChoice,
|
|
16166
16639
|
CheckoutForm,
|
|
16167
16640
|
CheckoutLoginPrompt,
|
|
16641
|
+
CheckoutPayAction,
|
|
16642
|
+
CheckoutQuoteSummary,
|
|
16643
|
+
CheckoutTermsAcceptance,
|
|
16168
16644
|
ContactInterestField,
|
|
16169
16645
|
CourseCatalogFilters,
|
|
16170
16646
|
CourseDescription,
|
|
16171
16647
|
CoursePurchaseTerms,
|
|
16172
16648
|
DATA_REQUEST_TYPES,
|
|
16649
|
+
DEFAULT_CHECKOUT_DELIVERY_CHOICE_LABELS,
|
|
16650
|
+
DEFAULT_CHECKOUT_QUOTE_SUMMARY_LABELS,
|
|
16173
16651
|
DEFAULT_COURSE_CATALOG_FILTERS_LABELS,
|
|
16174
16652
|
DEFAULT_COURSE_PRICE_BANDS,
|
|
16175
16653
|
DEFAULT_COURSE_PURCHASE_TERMS_LABELS,
|
|
@@ -16181,6 +16659,7 @@ var import_site_contracts = require("@reblu/site-contracts");
|
|
|
16181
16659
|
DEFAULT_TRUST_BADGE_HEADINGS,
|
|
16182
16660
|
DEFAULT_TRUST_BADGE_TYPE_ORDER,
|
|
16183
16661
|
DEFAULT_TRUST_ICONS,
|
|
16662
|
+
EMPTY_CHECKOUT_ADDRESS,
|
|
16184
16663
|
EMPTY_FULL_INVOICE_VALUE,
|
|
16185
16664
|
FaqAccordion,
|
|
16186
16665
|
FullInvoiceFields,
|
|
@@ -16204,17 +16683,21 @@ var import_site_contracts = require("@reblu/site-contracts");
|
|
|
16204
16683
|
buildFaqPageJsonLd,
|
|
16205
16684
|
buildShareUrls,
|
|
16206
16685
|
collectFaqItems,
|
|
16686
|
+
defaultCheckoutFulfillment,
|
|
16207
16687
|
formatPrice,
|
|
16208
16688
|
getShopErrorMessage,
|
|
16209
16689
|
isAllowedYouTubeHost,
|
|
16210
16690
|
isOverSimplifiedInvoiceCap,
|
|
16211
16691
|
markdownToPlainText,
|
|
16212
16692
|
markdownToSafeHtml,
|
|
16693
|
+
quoteRequiresDelivery,
|
|
16213
16694
|
readingTime,
|
|
16214
16695
|
sanitizeHtml,
|
|
16215
16696
|
shopIssuesInvoices,
|
|
16216
16697
|
shouldRenderShopFilters,
|
|
16217
|
-
|
|
16698
|
+
toCheckoutFulfillmentFields,
|
|
16699
|
+
toCheckoutInvoiceFields,
|
|
16700
|
+
toCheckoutTermsFields
|
|
16218
16701
|
});
|
|
16219
16702
|
/*! Bundled license information:
|
|
16220
16703
|
|