@reblu/site-blocks 0.8.0 → 0.10.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 +32 -0
- package/README.md +147 -1
- package/dist/index.cjs +490 -150
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +138 -12
- package/dist/index.d.ts +138 -12
- package/dist/index.js +486 -151
- package/dist/index.js.map +1 -1
- package/dist/seo.cjs +59 -0
- package/dist/seo.cjs.map +1 -0
- package/dist/seo.d.cts +47 -0
- package/dist/seo.d.ts +47 -0
- package/dist/seo.js +31 -0
- package/dist/seo.js.map +1 -0
- package/package.json +14 -4
package/dist/index.cjs
CHANGED
|
@@ -29,15 +29,20 @@ __export(src_exports, {
|
|
|
29
29
|
DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE: () => DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE,
|
|
30
30
|
DEFAULT_SHOP_ERROR_MESSAGES: () => DEFAULT_SHOP_ERROR_MESSAGES,
|
|
31
31
|
DEFAULT_SHOP_PRICE_BANDS: () => DEFAULT_SHOP_PRICE_BANDS,
|
|
32
|
+
FaqAccordion: () => FaqAccordion,
|
|
32
33
|
MarkdownRenderer: () => MarkdownRenderer,
|
|
33
34
|
OrderConfirmation: () => OrderConfirmation,
|
|
35
|
+
PageBlocks: () => PageBlocks,
|
|
36
|
+
ParentPage: () => ParentPage,
|
|
34
37
|
ProductCard: () => ProductCard,
|
|
35
38
|
ProfileCard: () => ProfileCard,
|
|
36
39
|
SafeHtml: () => SafeHtml,
|
|
37
40
|
ShopFilters: () => ShopFilters,
|
|
38
41
|
Specialty: () => Specialty,
|
|
39
42
|
Treatment: () => Treatment,
|
|
43
|
+
buildFaqPageJsonLd: () => buildFaqPageJsonLd,
|
|
40
44
|
buildShareUrls: () => buildShareUrls,
|
|
45
|
+
collectFaqItems: () => collectFaqItems,
|
|
41
46
|
formatPrice: () => formatPrice,
|
|
42
47
|
getShopErrorMessage: () => getShopErrorMessage,
|
|
43
48
|
isAllowedYouTubeHost: () => isAllowedYouTubeHost,
|
|
@@ -99,6 +104,33 @@ function getShopErrorMessage(code, overrides, fallback = DEFAULT_SHOP_ERROR_FALL
|
|
|
99
104
|
return messages[code] ?? fallback;
|
|
100
105
|
}
|
|
101
106
|
|
|
107
|
+
// src/lib/block-order.ts
|
|
108
|
+
function sortBlocksByOrder(blocks) {
|
|
109
|
+
return [...blocks].sort((a, b2) => a.order - b2.order);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// src/lib/faq-json-ld.ts
|
|
113
|
+
function normaliseText(value) {
|
|
114
|
+
return value.replace(/\s+/g, " ").trim();
|
|
115
|
+
}
|
|
116
|
+
function buildFaqPageJsonLd(items) {
|
|
117
|
+
const mainEntity = [];
|
|
118
|
+
for (const item of items) {
|
|
119
|
+
const name = normaliseText(item.q);
|
|
120
|
+
const text3 = normaliseText(item.a);
|
|
121
|
+
if (!name || !text3) continue;
|
|
122
|
+
mainEntity.push({ "@type": "Question", name, acceptedAnswer: { "@type": "Answer", text: text3 } });
|
|
123
|
+
}
|
|
124
|
+
if (mainEntity.length === 0) return null;
|
|
125
|
+
return { "@context": "https://schema.org", "@type": "FAQPage", mainEntity };
|
|
126
|
+
}
|
|
127
|
+
function collectFaqItems(blocks) {
|
|
128
|
+
if (!blocks) return [];
|
|
129
|
+
return sortBlocksByOrder(blocks).flatMap(
|
|
130
|
+
(block) => block.blockType === "faq" ? block.data.items : []
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
102
134
|
// ../../node_modules/.pnpm/devlop@1.1.0/node_modules/devlop/lib/default.js
|
|
103
135
|
function ok() {
|
|
104
136
|
}
|
|
@@ -13340,25 +13372,32 @@ function Treatment({ page, className }) {
|
|
|
13340
13372
|
] });
|
|
13341
13373
|
}
|
|
13342
13374
|
|
|
13343
|
-
// src/components/
|
|
13375
|
+
// src/components/parent-page.tsx
|
|
13344
13376
|
var import_utils4 = require("@reblu/site-ui/utils");
|
|
13345
13377
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
13346
|
-
|
|
13378
|
+
var defaultChildPageHref = (slug) => `/${slug}`;
|
|
13379
|
+
function ParentPage({
|
|
13347
13380
|
page,
|
|
13348
|
-
|
|
13349
|
-
|
|
13350
|
-
|
|
13381
|
+
childPages,
|
|
13382
|
+
childPageHref,
|
|
13383
|
+
childPagesLabel,
|
|
13384
|
+
treatments,
|
|
13385
|
+
treatmentHref,
|
|
13386
|
+
treatmentsLabel,
|
|
13351
13387
|
className
|
|
13352
13388
|
}) {
|
|
13389
|
+
const pages = childPages ?? treatments ?? [];
|
|
13390
|
+
const hrefFor = childPageHref ?? treatmentHref ?? defaultChildPageHref;
|
|
13391
|
+
const label = childPagesLabel ?? treatmentsLabel ?? "Treatments";
|
|
13353
13392
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("article", { className: (0, import_utils4.cn)("space-y-12", className), "data-slot": "specialty", children: [
|
|
13354
13393
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PageHero, { page }),
|
|
13355
13394
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PageSectionList, { sections: page.sections }),
|
|
13356
|
-
|
|
13357
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h2", { className: "text-2xl font-bold", children:
|
|
13358
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { className: "grid list-none grid-cols-1 gap-6 p-0 sm:grid-cols-2 lg:grid-cols-3", children:
|
|
13395
|
+
pages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("section", { className: "space-y-6", children: [
|
|
13396
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h2", { className: "text-2xl font-bold", children: label }),
|
|
13397
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { className: "grid list-none grid-cols-1 gap-6 p-0 sm:grid-cols-2 lg:grid-cols-3", children: pages.map((t) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
13359
13398
|
"a",
|
|
13360
13399
|
{
|
|
13361
|
-
href:
|
|
13400
|
+
href: hrefFor(t.slug),
|
|
13362
13401
|
className: "group flex h-full flex-col overflow-hidden rounded-lg border bg-card transition-shadow hover:shadow-lg",
|
|
13363
13402
|
children: [
|
|
13364
13403
|
t.coverImageUrl && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "relative aspect-video overflow-hidden bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
@@ -13381,6 +13420,9 @@ function Specialty({
|
|
|
13381
13420
|
] });
|
|
13382
13421
|
}
|
|
13383
13422
|
|
|
13423
|
+
// src/components/specialty.tsx
|
|
13424
|
+
var Specialty = ParentPage;
|
|
13425
|
+
|
|
13384
13426
|
// src/components/profile-card.tsx
|
|
13385
13427
|
var import_utils5 = require("@reblu/site-ui/utils");
|
|
13386
13428
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
@@ -13461,9 +13503,302 @@ function ProductCard({ product, href, currencyCode = "EUR", locale, className })
|
|
|
13461
13503
|
);
|
|
13462
13504
|
}
|
|
13463
13505
|
|
|
13464
|
-
// src/components/
|
|
13506
|
+
// src/components/faq-accordion.tsx
|
|
13465
13507
|
var import_utils7 = require("@reblu/site-ui/utils");
|
|
13508
|
+
|
|
13509
|
+
// src/components/_heading.tsx
|
|
13466
13510
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
13511
|
+
function nextHeadingLevel(level) {
|
|
13512
|
+
return Math.min(level + 1, 6);
|
|
13513
|
+
}
|
|
13514
|
+
function Heading({
|
|
13515
|
+
level,
|
|
13516
|
+
className,
|
|
13517
|
+
children: children2
|
|
13518
|
+
}) {
|
|
13519
|
+
const Tag = `h${level}`;
|
|
13520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Tag, { className, children: children2 });
|
|
13521
|
+
}
|
|
13522
|
+
|
|
13523
|
+
// src/components/faq-accordion.tsx
|
|
13524
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
13525
|
+
function FaqAccordion({
|
|
13526
|
+
items,
|
|
13527
|
+
heading,
|
|
13528
|
+
headingLevel = 2,
|
|
13529
|
+
questionHeadingLevel,
|
|
13530
|
+
defaultOpen = [],
|
|
13531
|
+
className
|
|
13532
|
+
}) {
|
|
13533
|
+
const visible = items.map((item, index) => ({ item, index })).filter(({ item }) => item.q.trim() !== "");
|
|
13534
|
+
if (visible.length === 0) return null;
|
|
13535
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: (0, import_utils7.cn)("space-y-4", className), "data-slot": "faq-accordion", children: [
|
|
13536
|
+
heading && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Heading, { level: headingLevel, className: "text-2xl font-semibold tracking-tight", children: heading }),
|
|
13537
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "divide-y divide-border rounded-xl border border-border", children: visible.map(({ item, index }) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
13538
|
+
"details",
|
|
13539
|
+
{
|
|
13540
|
+
className: "group px-4",
|
|
13541
|
+
"data-slot": "faq-item",
|
|
13542
|
+
...defaultOpen.includes(index) ? { open: true } : {},
|
|
13543
|
+
children: [
|
|
13544
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-4 py-4 font-medium focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring [&::-webkit-details-marker]:hidden", children: [
|
|
13545
|
+
questionHeadingLevel ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Heading, { level: questionHeadingLevel, className: "text-base font-medium", children: item.q }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: item.q }),
|
|
13546
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
13547
|
+
"span",
|
|
13548
|
+
{
|
|
13549
|
+
"aria-hidden": "true",
|
|
13550
|
+
className: "shrink-0 text-muted-foreground transition-transform group-open:rotate-45",
|
|
13551
|
+
children: "+"
|
|
13552
|
+
}
|
|
13553
|
+
)
|
|
13554
|
+
] }),
|
|
13555
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "whitespace-pre-line pb-4 text-muted-foreground", children: item.a })
|
|
13556
|
+
]
|
|
13557
|
+
},
|
|
13558
|
+
index
|
|
13559
|
+
)) })
|
|
13560
|
+
] });
|
|
13561
|
+
}
|
|
13562
|
+
|
|
13563
|
+
// src/components/page-blocks.tsx
|
|
13564
|
+
var import_utils8 = require("@reblu/site-ui/utils");
|
|
13565
|
+
var import_button_variants2 = require("@reblu/site-ui/button-variants");
|
|
13566
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
13567
|
+
var ALIASES = {
|
|
13568
|
+
doctor_embed: "profile_embed",
|
|
13569
|
+
specialty_embed: "page_embed"
|
|
13570
|
+
};
|
|
13571
|
+
function HeroBlock({ block, headingLevel }) {
|
|
13572
|
+
const { title, subtitle, imageUrl } = block.data;
|
|
13573
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-4", children: [
|
|
13574
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Heading, { level: headingLevel, className: "text-3xl font-bold tracking-tight md:text-4xl", children: title }),
|
|
13575
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-lg opacity-80", children: subtitle }),
|
|
13576
|
+
imageUrl && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "relative aspect-[21/9] w-full overflow-hidden rounded-xl bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("img", { src: imageUrl, alt: "", loading: "lazy", className: "h-full w-full object-cover" }) })
|
|
13577
|
+
] });
|
|
13578
|
+
}
|
|
13579
|
+
function RichtextBlock({ block, headingLevel }) {
|
|
13580
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SafeHtml, { html: sanitizeHtml(block.data.html), headingOffset: headingLevel - 1 });
|
|
13581
|
+
}
|
|
13582
|
+
function FaqBlock({ block }) {
|
|
13583
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FaqAccordion, { items: block.data.items });
|
|
13584
|
+
}
|
|
13585
|
+
function StatsBlock({ block }) {
|
|
13586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.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_runtime9.jsxs)("div", { className: "flex flex-col-reverse gap-1", children: [
|
|
13587
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("dt", { className: "text-sm opacity-80", children: item.label }),
|
|
13588
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("dd", { className: "text-3xl font-bold", children: item.value })
|
|
13589
|
+
] }, i)) });
|
|
13590
|
+
}
|
|
13591
|
+
function TestimonialBlock({ block }) {
|
|
13592
|
+
const { quote, author, role, avatarUrl } = block.data;
|
|
13593
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("figure", { className: "space-y-4", children: [
|
|
13594
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("blockquote", { className: "text-xl italic", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { children: quote }) }),
|
|
13595
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("figcaption", { className: "flex items-center gap-3", children: [
|
|
13596
|
+
avatarUrl && // eslint-disable-next-line @next/next/no-img-element
|
|
13597
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
13598
|
+
"img",
|
|
13599
|
+
{
|
|
13600
|
+
src: avatarUrl,
|
|
13601
|
+
alt: "",
|
|
13602
|
+
loading: "lazy",
|
|
13603
|
+
className: "h-10 w-10 rounded-full object-cover"
|
|
13604
|
+
}
|
|
13605
|
+
),
|
|
13606
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { children: [
|
|
13607
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "font-semibold", children: author }),
|
|
13608
|
+
role && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "block text-sm opacity-80", children: role })
|
|
13609
|
+
] })
|
|
13610
|
+
] })
|
|
13611
|
+
] });
|
|
13612
|
+
}
|
|
13613
|
+
function CtaSlotBlock(_props) {
|
|
13614
|
+
return null;
|
|
13615
|
+
}
|
|
13616
|
+
function FeatureListBlock({ block }) {
|
|
13617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.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_runtime9.jsx)("li", { children: item.text }, i)) });
|
|
13618
|
+
}
|
|
13619
|
+
function GalleryBlock({ block }) {
|
|
13620
|
+
const { images } = block.data;
|
|
13621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
13622
|
+
"div",
|
|
13623
|
+
{
|
|
13624
|
+
className: (0, import_utils8.cn)(
|
|
13625
|
+
"grid gap-4",
|
|
13626
|
+
images.length > 1 ? "sm:grid-cols-2 lg:grid-cols-3" : "grid-cols-1"
|
|
13627
|
+
),
|
|
13628
|
+
children: images.map((img, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("figure", { className: "space-y-1", children: [
|
|
13629
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "relative aspect-video w-full overflow-hidden rounded-lg bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
13630
|
+
"img",
|
|
13631
|
+
{
|
|
13632
|
+
src: img.url,
|
|
13633
|
+
alt: img.alt ?? "",
|
|
13634
|
+
loading: "lazy",
|
|
13635
|
+
className: "h-full w-full object-cover"
|
|
13636
|
+
}
|
|
13637
|
+
) }),
|
|
13638
|
+
img.caption && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("figcaption", { className: "text-sm opacity-80", children: img.caption })
|
|
13639
|
+
] }, `${img.url}-${i}`))
|
|
13640
|
+
}
|
|
13641
|
+
);
|
|
13642
|
+
}
|
|
13643
|
+
function EmbedCard({
|
|
13644
|
+
resolved,
|
|
13645
|
+
headingLevel,
|
|
13646
|
+
embedHref
|
|
13647
|
+
}) {
|
|
13648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
13649
|
+
"a",
|
|
13650
|
+
{
|
|
13651
|
+
href: embedHref(resolved),
|
|
13652
|
+
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",
|
|
13653
|
+
children: [
|
|
13654
|
+
resolved.coverImageUrl && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "aspect-video w-full overflow-hidden bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
13655
|
+
"img",
|
|
13656
|
+
{
|
|
13657
|
+
src: resolved.coverImageUrl,
|
|
13658
|
+
alt: "",
|
|
13659
|
+
loading: "lazy",
|
|
13660
|
+
className: "h-full w-full object-cover"
|
|
13661
|
+
}
|
|
13662
|
+
) }),
|
|
13663
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-1 p-4", children: [
|
|
13664
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Heading, { level: headingLevel, className: "text-lg font-semibold", children: resolved.title }),
|
|
13665
|
+
resolved.role && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-sm text-muted-foreground", children: resolved.role }),
|
|
13666
|
+
resolved.excerpt && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-muted-foreground", children: resolved.excerpt })
|
|
13667
|
+
] })
|
|
13668
|
+
]
|
|
13669
|
+
}
|
|
13670
|
+
);
|
|
13671
|
+
}
|
|
13672
|
+
function PageEmbedBlock({ block, headingLevel, embedHref }) {
|
|
13673
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(EmbedCard, { resolved: block.resolved, headingLevel, embedHref });
|
|
13674
|
+
}
|
|
13675
|
+
function ProfileEmbedBlock({
|
|
13676
|
+
block,
|
|
13677
|
+
headingLevel,
|
|
13678
|
+
embedHref
|
|
13679
|
+
}) {
|
|
13680
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(EmbedCard, { resolved: block.resolved, headingLevel, embedHref });
|
|
13681
|
+
}
|
|
13682
|
+
var DEFAULT_RENDERERS = {
|
|
13683
|
+
hero: HeroBlock,
|
|
13684
|
+
richtext: RichtextBlock,
|
|
13685
|
+
faq: FaqBlock,
|
|
13686
|
+
stats: StatsBlock,
|
|
13687
|
+
testimonial: TestimonialBlock,
|
|
13688
|
+
cta: CtaSlotBlock,
|
|
13689
|
+
feature_list: FeatureListBlock,
|
|
13690
|
+
gallery: GalleryBlock,
|
|
13691
|
+
page_embed: PageEmbedBlock,
|
|
13692
|
+
profile_embed: ProfileEmbedBlock
|
|
13693
|
+
};
|
|
13694
|
+
var EMBED_TYPES = /* @__PURE__ */ new Set([
|
|
13695
|
+
"page_embed",
|
|
13696
|
+
"profile_embed"
|
|
13697
|
+
]);
|
|
13698
|
+
function canonicalTypeOf(blockType) {
|
|
13699
|
+
if (Object.prototype.hasOwnProperty.call(ALIASES, blockType))
|
|
13700
|
+
return ALIASES[blockType];
|
|
13701
|
+
if (Object.prototype.hasOwnProperty.call(DEFAULT_RENDERERS, blockType))
|
|
13702
|
+
return blockType;
|
|
13703
|
+
return null;
|
|
13704
|
+
}
|
|
13705
|
+
var TOKEN_FOREGROUND = {
|
|
13706
|
+
"var(--primary)": "var(--primary-foreground)",
|
|
13707
|
+
"var(--secondary)": "var(--secondary-foreground)",
|
|
13708
|
+
"var(--accent)": "var(--accent-foreground)"
|
|
13709
|
+
};
|
|
13710
|
+
function hexLuminance(color2) {
|
|
13711
|
+
const match = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(color2.trim());
|
|
13712
|
+
if (!match) return null;
|
|
13713
|
+
const hex = match[1].length === 3 ? [...match[1]].map((c) => c + c).join("") : match[1];
|
|
13714
|
+
const [r, g, b2] = [0, 2, 4].map((i) => {
|
|
13715
|
+
const s2 = parseInt(hex.slice(i, i + 2), 16) / 255;
|
|
13716
|
+
return s2 <= 0.03928 ? s2 / 12.92 : Math.pow((s2 + 0.055) / 1.055, 2.4);
|
|
13717
|
+
});
|
|
13718
|
+
return 0.2126 * r + 0.7152 * g + 0.0722 * b2;
|
|
13719
|
+
}
|
|
13720
|
+
function surfaceStyle(background) {
|
|
13721
|
+
if (!background) return void 0;
|
|
13722
|
+
const token = TOKEN_FOREGROUND[background];
|
|
13723
|
+
if (token) return { backgroundColor: background, color: token };
|
|
13724
|
+
const luminance = hexLuminance(background);
|
|
13725
|
+
if (luminance === null) return { backgroundColor: background };
|
|
13726
|
+
return { backgroundColor: background, color: luminance < 0.179 ? "#ffffff" : "#111827" };
|
|
13727
|
+
}
|
|
13728
|
+
function hasUsableCta(cta) {
|
|
13729
|
+
return !!cta && !!cta.label && !!cta.url;
|
|
13730
|
+
}
|
|
13731
|
+
function toIdFragment(value) {
|
|
13732
|
+
return value.replace(/[^A-Za-z0-9_-]/g, "-");
|
|
13733
|
+
}
|
|
13734
|
+
function SectionCta2({ cta }) {
|
|
13735
|
+
if (!hasUsableCta(cta)) return null;
|
|
13736
|
+
const variant = toButtonVariant(cta.variant);
|
|
13737
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
13738
|
+
"a",
|
|
13739
|
+
{
|
|
13740
|
+
href: cta.url,
|
|
13741
|
+
"data-slot": "button",
|
|
13742
|
+
"data-variant": variant,
|
|
13743
|
+
"data-size": "default",
|
|
13744
|
+
className: (0, import_utils8.cn)((0, import_button_variants2.buttonVariants)({ variant, size: "default" })),
|
|
13745
|
+
...cta.isExternal ? { target: "_blank", rel: "noopener noreferrer" } : {},
|
|
13746
|
+
children: cta.label
|
|
13747
|
+
}
|
|
13748
|
+
) });
|
|
13749
|
+
}
|
|
13750
|
+
function PageBlocks({
|
|
13751
|
+
blocks,
|
|
13752
|
+
components,
|
|
13753
|
+
headingLevel = 2,
|
|
13754
|
+
embedHref = (resolved) => `/${resolved.slug}`,
|
|
13755
|
+
idPrefix = "page-block",
|
|
13756
|
+
className,
|
|
13757
|
+
sectionClassName
|
|
13758
|
+
}) {
|
|
13759
|
+
if (!blocks || blocks.length === 0) return null;
|
|
13760
|
+
const safePrefix = `pb-${toIdFragment(idPrefix)}`;
|
|
13761
|
+
const sections = sortBlocksByOrder(blocks).flatMap((block) => {
|
|
13762
|
+
const type = canonicalTypeOf(block.blockType);
|
|
13763
|
+
if (type === null) return [];
|
|
13764
|
+
if (EMBED_TYPES.has(type) && !block.resolved) return [];
|
|
13765
|
+
if (type === "cta" && !components?.cta && !block.heading && !hasUsableCta(block.cta)) return [];
|
|
13766
|
+
const Renderer = components?.[type] ?? DEFAULT_RENDERERS[type];
|
|
13767
|
+
const headingId = block.heading ? `${safePrefix}-${toIdFragment(block.id)}-heading` : void 0;
|
|
13768
|
+
const background = block.backgroundColor;
|
|
13769
|
+
return [
|
|
13770
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
13771
|
+
"section",
|
|
13772
|
+
{
|
|
13773
|
+
"data-slot": "page-block",
|
|
13774
|
+
"data-block-type": type,
|
|
13775
|
+
"aria-labelledby": headingId,
|
|
13776
|
+
style: surfaceStyle(background),
|
|
13777
|
+
className: (0, import_utils8.cn)("space-y-6", background && "rounded-xl px-6 py-10", sectionClassName),
|
|
13778
|
+
children: [
|
|
13779
|
+
block.heading && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Heading, { level: headingLevel, className: "text-2xl font-bold tracking-tight", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { id: headingId, children: block.heading }) }),
|
|
13780
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
13781
|
+
Renderer,
|
|
13782
|
+
{
|
|
13783
|
+
block,
|
|
13784
|
+
headingLevel: block.heading ? nextHeadingLevel(headingLevel) : headingLevel,
|
|
13785
|
+
embedHref
|
|
13786
|
+
}
|
|
13787
|
+
),
|
|
13788
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SectionCta2, { cta: block.cta })
|
|
13789
|
+
]
|
|
13790
|
+
},
|
|
13791
|
+
block.id
|
|
13792
|
+
)
|
|
13793
|
+
];
|
|
13794
|
+
});
|
|
13795
|
+
if (sections.length === 0) return null;
|
|
13796
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: (0, import_utils8.cn)("space-y-12", className), "data-slot": "page-blocks", children: sections });
|
|
13797
|
+
}
|
|
13798
|
+
|
|
13799
|
+
// src/components/shop-filters.tsx
|
|
13800
|
+
var import_utils9 = require("@reblu/site-ui/utils");
|
|
13801
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
13467
13802
|
var DEFAULT_SHOP_PRICE_BANDS = [
|
|
13468
13803
|
{ max: 2500 },
|
|
13469
13804
|
{ min: 2500, max: 5e3 },
|
|
@@ -13507,7 +13842,7 @@ function priceBandLabel(band, t, currencyCode, locale) {
|
|
|
13507
13842
|
return "";
|
|
13508
13843
|
}
|
|
13509
13844
|
function OptionLink({ href, active, label, onActivate }) {
|
|
13510
|
-
return /* @__PURE__ */ (0,
|
|
13845
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
13511
13846
|
"a",
|
|
13512
13847
|
{
|
|
13513
13848
|
href,
|
|
@@ -13516,7 +13851,7 @@ function OptionLink({ href, active, label, onActivate }) {
|
|
|
13516
13851
|
event.preventDefault();
|
|
13517
13852
|
onActivate();
|
|
13518
13853
|
} : void 0,
|
|
13519
|
-
className: (0,
|
|
13854
|
+
className: (0, import_utils9.cn)(
|
|
13520
13855
|
"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",
|
|
13521
13856
|
active ? "border-transparent bg-primary text-primary-foreground" : "border-border text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
13522
13857
|
),
|
|
@@ -13525,9 +13860,9 @@ function OptionLink({ href, active, label, onActivate }) {
|
|
|
13525
13860
|
);
|
|
13526
13861
|
}
|
|
13527
13862
|
function FilterFieldset({ legend, children: children2 }) {
|
|
13528
|
-
return /* @__PURE__ */ (0,
|
|
13529
|
-
/* @__PURE__ */ (0,
|
|
13530
|
-
/* @__PURE__ */ (0,
|
|
13863
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("fieldset", { className: "space-y-2", children: [
|
|
13864
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("legend", { className: "text-sm font-medium text-foreground", children: legend }),
|
|
13865
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex flex-wrap gap-2", children: children2 })
|
|
13531
13866
|
] });
|
|
13532
13867
|
}
|
|
13533
13868
|
function ShopFilters({
|
|
@@ -13550,11 +13885,11 @@ function ShopFilters({
|
|
|
13550
13885
|
if (!shouldRenderShopFilters(facets, active)) {
|
|
13551
13886
|
return null;
|
|
13552
13887
|
}
|
|
13553
|
-
return /* @__PURE__ */ (0,
|
|
13888
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: (0, import_utils9.cn)("space-y-6", className), "data-slot": "shop-filters", children: [
|
|
13554
13889
|
visibleTaxonomies.map((axis) => {
|
|
13555
13890
|
const activeSlug = active.taxonomy?.[axis.key];
|
|
13556
|
-
return /* @__PURE__ */ (0,
|
|
13557
|
-
/* @__PURE__ */ (0,
|
|
13891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(FilterFieldset, { legend: axis.label, children: [
|
|
13892
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
13558
13893
|
OptionLink,
|
|
13559
13894
|
{
|
|
13560
13895
|
href: hrefs.taxonomy(axis.key, void 0),
|
|
@@ -13569,7 +13904,7 @@ function ShopFilters({
|
|
|
13569
13904
|
),
|
|
13570
13905
|
axis.terms.map((term) => {
|
|
13571
13906
|
const isActive = activeSlug === term.slug;
|
|
13572
|
-
return /* @__PURE__ */ (0,
|
|
13907
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
13573
13908
|
OptionLink,
|
|
13574
13909
|
{
|
|
13575
13910
|
href: hrefs.taxonomy(axis.key, isActive ? void 0 : term.slug),
|
|
@@ -13589,9 +13924,9 @@ function ShopFilters({
|
|
|
13589
13924
|
}),
|
|
13590
13925
|
visibleAttributes.map((attr) => {
|
|
13591
13926
|
const activeValues = toValueArray(active.attr?.[attr.key]);
|
|
13592
|
-
return /* @__PURE__ */ (0,
|
|
13927
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FilterFieldset, { legend: attr.label, children: attr.options.map((opt) => {
|
|
13593
13928
|
const isActive = activeValues.includes(opt.value);
|
|
13594
|
-
return /* @__PURE__ */ (0,
|
|
13929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
13595
13930
|
OptionLink,
|
|
13596
13931
|
{
|
|
13597
13932
|
href: hrefs.attr(attr.key, opt.value),
|
|
@@ -13609,11 +13944,11 @@ function ShopFilters({
|
|
|
13609
13944
|
);
|
|
13610
13945
|
}) }, attr.key);
|
|
13611
13946
|
}),
|
|
13612
|
-
showPriceGroup && /* @__PURE__ */ (0,
|
|
13947
|
+
showPriceGroup && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FilterFieldset, { legend: t.price, children: priceBands.map((band, i) => {
|
|
13613
13948
|
const isActive = active.priceMin === band.min && active.priceMax === band.max;
|
|
13614
13949
|
const nextMin = isActive ? void 0 : band.min;
|
|
13615
13950
|
const nextMax = isActive ? void 0 : band.max;
|
|
13616
|
-
return /* @__PURE__ */ (0,
|
|
13951
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
13617
13952
|
OptionLink,
|
|
13618
13953
|
{
|
|
13619
13954
|
href: hrefs.price(nextMin, nextMax),
|
|
@@ -13624,7 +13959,7 @@ function ShopFilters({
|
|
|
13624
13959
|
i
|
|
13625
13960
|
);
|
|
13626
13961
|
}) }),
|
|
13627
|
-
hasOnSale && /* @__PURE__ */ (0,
|
|
13962
|
+
hasOnSale && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
13628
13963
|
OptionLink,
|
|
13629
13964
|
{
|
|
13630
13965
|
href: hrefs.onSale(!active.onSale),
|
|
@@ -13633,7 +13968,7 @@ function ShopFilters({
|
|
|
13633
13968
|
onActivate: onChange ? () => onChange({ onSale: !active.onSale }) : void 0
|
|
13634
13969
|
}
|
|
13635
13970
|
),
|
|
13636
|
-
/* @__PURE__ */ (0,
|
|
13971
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
13637
13972
|
"a",
|
|
13638
13973
|
{
|
|
13639
13974
|
href: hrefs.clearAll(),
|
|
@@ -13649,8 +13984,8 @@ function ShopFilters({
|
|
|
13649
13984
|
}
|
|
13650
13985
|
|
|
13651
13986
|
// src/components/cart-line-list.tsx
|
|
13652
|
-
var
|
|
13653
|
-
var
|
|
13987
|
+
var import_utils10 = require("@reblu/site-ui/utils");
|
|
13988
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
13654
13989
|
var DEFAULT_LABELS2 = {
|
|
13655
13990
|
quantityLabel: "Cantidad",
|
|
13656
13991
|
decrease: "Reducir cantidad",
|
|
@@ -13675,9 +14010,9 @@ function CartLineList({
|
|
|
13675
14010
|
}) {
|
|
13676
14011
|
const t = { ...DEFAULT_LABELS2, ...labels };
|
|
13677
14012
|
const noticeContent = notice === true ? t.cancelledNotice : notice;
|
|
13678
|
-
return /* @__PURE__ */ (0,
|
|
13679
|
-
/* @__PURE__ */ (0,
|
|
13680
|
-
noticeContent != null && noticeContent !== false && /* @__PURE__ */ (0,
|
|
14013
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: (0, import_utils10.cn)("space-y-4", className), "data-slot": "cart-line-list", children: [
|
|
14014
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { "aria-live": "polite", className: "sr-only", children: liveMessage }),
|
|
14015
|
+
noticeContent != null && noticeContent !== false && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
13681
14016
|
"div",
|
|
13682
14017
|
{
|
|
13683
14018
|
role: "status",
|
|
@@ -13686,32 +14021,32 @@ function CartLineList({
|
|
|
13686
14021
|
children: noticeContent
|
|
13687
14022
|
}
|
|
13688
14023
|
),
|
|
13689
|
-
/* @__PURE__ */ (0,
|
|
14024
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("ul", { className: "space-y-4", children: items.map((item) => {
|
|
13690
14025
|
const maxQty = item.maxStock ?? Infinity;
|
|
13691
14026
|
const atMax = item.quantity >= maxQty;
|
|
13692
14027
|
const atMin = item.quantity <= 1;
|
|
13693
|
-
return /* @__PURE__ */ (0,
|
|
14028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
13694
14029
|
"li",
|
|
13695
14030
|
{
|
|
13696
14031
|
className: "flex gap-4 rounded-xl border border-border bg-card p-4",
|
|
13697
14032
|
children: [
|
|
13698
|
-
/* @__PURE__ */ (0,
|
|
13699
|
-
/* @__PURE__ */ (0,
|
|
13700
|
-
/* @__PURE__ */ (0,
|
|
13701
|
-
item.variantName && /* @__PURE__ */ (0,
|
|
13702
|
-
/* @__PURE__ */ (0,
|
|
14033
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "h-20 w-20 flex-shrink-0 overflow-hidden rounded-lg bg-muted", children: item.imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("img", { src: item.imageUrl, alt: item.name, className: "h-full w-full object-cover" }) : null }),
|
|
14034
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
14035
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "truncate text-sm font-semibold leading-tight", children: item.name }),
|
|
14036
|
+
item.variantName && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "mt-0.5 text-xs text-muted-foreground", children: item.variantName }),
|
|
14037
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { className: "mt-1 text-sm text-muted-foreground", children: [
|
|
13703
14038
|
formatPrice(item.unitPrice, currencyCode, locale),
|
|
13704
14039
|
" ",
|
|
13705
14040
|
t.unitPriceSuffix
|
|
13706
14041
|
] }),
|
|
13707
|
-
/* @__PURE__ */ (0,
|
|
14042
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
13708
14043
|
"div",
|
|
13709
14044
|
{
|
|
13710
14045
|
role: "group",
|
|
13711
14046
|
"aria-label": t.quantityLabel,
|
|
13712
14047
|
className: "mt-3 flex items-center gap-3",
|
|
13713
14048
|
children: [
|
|
13714
|
-
/* @__PURE__ */ (0,
|
|
14049
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
13715
14050
|
"button",
|
|
13716
14051
|
{
|
|
13717
14052
|
type: "button",
|
|
@@ -13722,8 +14057,8 @@ function CartLineList({
|
|
|
13722
14057
|
children: "\u2212"
|
|
13723
14058
|
}
|
|
13724
14059
|
),
|
|
13725
|
-
/* @__PURE__ */ (0,
|
|
13726
|
-
/* @__PURE__ */ (0,
|
|
14060
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "w-8 text-center text-sm font-semibold tabular-nums", children: item.quantity }),
|
|
14061
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
13727
14062
|
"button",
|
|
13728
14063
|
{
|
|
13729
14064
|
type: "button",
|
|
@@ -13734,7 +14069,7 @@ function CartLineList({
|
|
|
13734
14069
|
children: "+"
|
|
13735
14070
|
}
|
|
13736
14071
|
),
|
|
13737
|
-
onRemove && /* @__PURE__ */ (0,
|
|
14072
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
13738
14073
|
"button",
|
|
13739
14074
|
{
|
|
13740
14075
|
type: "button",
|
|
@@ -13748,7 +14083,7 @@ function CartLineList({
|
|
|
13748
14083
|
}
|
|
13749
14084
|
)
|
|
13750
14085
|
] }),
|
|
13751
|
-
/* @__PURE__ */ (0,
|
|
14086
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "flex-shrink-0 text-right", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-base font-bold", children: formatPrice(item.unitPrice * item.quantity, currencyCode, locale) }) })
|
|
13752
14087
|
]
|
|
13753
14088
|
},
|
|
13754
14089
|
lineKey(item.productId, item.variantId)
|
|
@@ -13758,8 +14093,8 @@ function CartLineList({
|
|
|
13758
14093
|
}
|
|
13759
14094
|
|
|
13760
14095
|
// src/components/cart-summary.tsx
|
|
13761
|
-
var
|
|
13762
|
-
var
|
|
14096
|
+
var import_utils11 = require("@reblu/site-ui/utils");
|
|
14097
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
13763
14098
|
var DEFAULT_LABELS3 = {
|
|
13764
14099
|
subtotal: "Subtotal",
|
|
13765
14100
|
discountPrefix: "Descuento",
|
|
@@ -13786,40 +14121,40 @@ function CartSummary({
|
|
|
13786
14121
|
const hasDiscount = Boolean(discount && discount > 0);
|
|
13787
14122
|
const noticeContent = notice === true ? t.cancelledNotice : notice;
|
|
13788
14123
|
const hasNotice = noticeContent != null && noticeContent !== false;
|
|
13789
|
-
const breakdown = /* @__PURE__ */ (0,
|
|
14124
|
+
const breakdown = /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
13790
14125
|
"dl",
|
|
13791
14126
|
{
|
|
13792
|
-
className: (0,
|
|
14127
|
+
className: (0, import_utils11.cn)("space-y-2 text-sm", !hasNotice && className),
|
|
13793
14128
|
"data-slot": "cart-summary",
|
|
13794
14129
|
children: [
|
|
13795
|
-
/* @__PURE__ */ (0,
|
|
13796
|
-
/* @__PURE__ */ (0,
|
|
13797
|
-
/* @__PURE__ */ (0,
|
|
14130
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex justify-between text-muted-foreground", children: [
|
|
14131
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("dt", { children: t.subtotal }),
|
|
14132
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("dd", { children: formatPrice(subtotal, currencyCode, locale) })
|
|
13798
14133
|
] }),
|
|
13799
|
-
hasDiscount && /* @__PURE__ */ (0,
|
|
13800
|
-
/* @__PURE__ */ (0,
|
|
14134
|
+
hasDiscount && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex justify-between text-green-600 dark:text-green-400", children: [
|
|
14135
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("dt", { children: [
|
|
13801
14136
|
t.discountPrefix,
|
|
13802
14137
|
discountCode ? ` (${discountCode})` : ""
|
|
13803
14138
|
] }),
|
|
13804
|
-
/* @__PURE__ */ (0,
|
|
14139
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("dd", { children: [
|
|
13805
14140
|
"-",
|
|
13806
14141
|
formatPrice(discount, currencyCode, locale)
|
|
13807
14142
|
] })
|
|
13808
14143
|
] }),
|
|
13809
|
-
shippingEnabled && /* @__PURE__ */ (0,
|
|
13810
|
-
/* @__PURE__ */ (0,
|
|
13811
|
-
/* @__PURE__ */ (0,
|
|
14144
|
+
shippingEnabled && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex justify-between text-muted-foreground", children: [
|
|
14145
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("dt", { children: t.shipping }),
|
|
14146
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("dd", { children: shipping == null || !Number.isFinite(shipping) ? t.shippingCalculated : shipping === 0 ? t.freeShipping : formatPrice(shipping, currencyCode, locale) })
|
|
13812
14147
|
] }),
|
|
13813
|
-
/* @__PURE__ */ (0,
|
|
13814
|
-
/* @__PURE__ */ (0,
|
|
13815
|
-
/* @__PURE__ */ (0,
|
|
14148
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex justify-between border-t border-border pt-2 text-base font-bold", children: [
|
|
14149
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("dt", { children: t.total }),
|
|
14150
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("dd", { children: formatPrice(total, currencyCode, locale) })
|
|
13816
14151
|
] })
|
|
13817
14152
|
]
|
|
13818
14153
|
}
|
|
13819
14154
|
);
|
|
13820
14155
|
if (!hasNotice) return breakdown;
|
|
13821
|
-
return /* @__PURE__ */ (0,
|
|
13822
|
-
/* @__PURE__ */ (0,
|
|
14156
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: (0, import_utils11.cn)("space-y-3", className), "data-slot": "cart-summary-wrapper", children: [
|
|
14157
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
13823
14158
|
"div",
|
|
13824
14159
|
{
|
|
13825
14160
|
role: "status",
|
|
@@ -13833,8 +14168,8 @@ function CartSummary({
|
|
|
13833
14168
|
}
|
|
13834
14169
|
|
|
13835
14170
|
// src/components/added-to-cart-toast.tsx
|
|
13836
|
-
var
|
|
13837
|
-
var
|
|
14171
|
+
var import_utils12 = require("@reblu/site-ui/utils");
|
|
14172
|
+
var import_jsx_runtime13 = (
|
|
13838
14173
|
// eslint-disable-next-line @next/next/no-img-element -- toast content, not a Next <Image> layout context
|
|
13839
14174
|
require("react/jsx-runtime")
|
|
13840
14175
|
);
|
|
@@ -13857,32 +14192,32 @@ function AddedToCartToast({
|
|
|
13857
14192
|
const message = status === "error" ? t.error : status === "outOfStock" ? t.outOfStock : t.success;
|
|
13858
14193
|
const hasThumbnail = Boolean(imageUrl && imageUrl.trim().length > 0);
|
|
13859
14194
|
const variant = status === "success" ? "success" : "error";
|
|
13860
|
-
return /* @__PURE__ */ (0,
|
|
14195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
13861
14196
|
"div",
|
|
13862
14197
|
{
|
|
13863
14198
|
"data-slot": "added-to-cart-toast",
|
|
13864
14199
|
"data-variant": variant,
|
|
13865
|
-
className: (0,
|
|
14200
|
+
className: (0, import_utils12.cn)(
|
|
13866
14201
|
"flex items-center gap-3 rounded-xl border border-border bg-card p-3 text-sm shadow-lg",
|
|
13867
14202
|
variant === "success" && "border-green-600/30 dark:border-green-400/30",
|
|
13868
14203
|
variant === "error" && "border-destructive/30",
|
|
13869
14204
|
className
|
|
13870
14205
|
),
|
|
13871
14206
|
children: [
|
|
13872
|
-
hasThumbnail && /* @__PURE__ */ (0,
|
|
13873
|
-
/* @__PURE__ */ (0,
|
|
13874
|
-
/* @__PURE__ */ (0,
|
|
13875
|
-
/* @__PURE__ */ (0,
|
|
14207
|
+
hasThumbnail && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("img", { src: imageUrl, alt: productName, className: "h-10 w-10 flex-shrink-0 rounded-lg object-cover" }),
|
|
14208
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
14209
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "truncate font-semibold text-foreground", children: productName }),
|
|
14210
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "truncate text-muted-foreground", children: quantity && quantity > 1 ? `${message} \xB7 x${quantity}` : message })
|
|
13876
14211
|
] }),
|
|
13877
|
-
/* @__PURE__ */ (0,
|
|
14212
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("a", { href: cartHref, className: "text-sm font-semibold text-primary underline-offset-2 hover:underline", children: t.viewCart }) })
|
|
13878
14213
|
]
|
|
13879
14214
|
}
|
|
13880
14215
|
);
|
|
13881
14216
|
}
|
|
13882
14217
|
|
|
13883
14218
|
// src/components/checkout-login-prompt.tsx
|
|
13884
|
-
var
|
|
13885
|
-
var
|
|
14219
|
+
var import_utils13 = require("@reblu/site-ui/utils");
|
|
14220
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
13886
14221
|
var DEFAULT_LABELS5 = {
|
|
13887
14222
|
title: "Identificaci\xF3n",
|
|
13888
14223
|
description: "Introduce tu email para agilizar el proceso o contin\xFAa como invitado.",
|
|
@@ -13909,26 +14244,26 @@ function CheckoutLoginPrompt({
|
|
|
13909
14244
|
if (!open) return null;
|
|
13910
14245
|
const t = { ...DEFAULT_LABELS5, ...labels };
|
|
13911
14246
|
const isValidEmail = EMAIL_PATTERN.test(email.trim());
|
|
13912
|
-
return /* @__PURE__ */ (0,
|
|
13913
|
-
/* @__PURE__ */ (0,
|
|
13914
|
-
/* @__PURE__ */ (0,
|
|
14247
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
14248
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "fixed inset-0 z-50 bg-black/50", onClick: onClose, "aria-hidden": "true" }),
|
|
14249
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
13915
14250
|
"div",
|
|
13916
14251
|
{
|
|
13917
14252
|
role: "dialog",
|
|
13918
14253
|
"aria-modal": "true",
|
|
13919
14254
|
"aria-labelledby": "checkout-login-prompt-title",
|
|
13920
14255
|
"data-slot": "checkout-login-prompt",
|
|
13921
|
-
className: (0,
|
|
14256
|
+
className: (0, import_utils13.cn)(
|
|
13922
14257
|
"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",
|
|
13923
14258
|
className
|
|
13924
14259
|
),
|
|
13925
14260
|
children: [
|
|
13926
|
-
/* @__PURE__ */ (0,
|
|
13927
|
-
/* @__PURE__ */ (0,
|
|
13928
|
-
/* @__PURE__ */ (0,
|
|
13929
|
-
/* @__PURE__ */ (0,
|
|
14261
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|
|
14262
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
|
|
14263
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h2", { id: "checkout-login-prompt-title", className: "text-xl font-bold", children: t.title }),
|
|
14264
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "mt-1 text-sm text-muted-foreground", children: t.description })
|
|
13930
14265
|
] }),
|
|
13931
|
-
/* @__PURE__ */ (0,
|
|
14266
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
13932
14267
|
"button",
|
|
13933
14268
|
{
|
|
13934
14269
|
type: "button",
|
|
@@ -13939,9 +14274,9 @@ function CheckoutLoginPrompt({
|
|
|
13939
14274
|
}
|
|
13940
14275
|
)
|
|
13941
14276
|
] }),
|
|
13942
|
-
/* @__PURE__ */ (0,
|
|
13943
|
-
/* @__PURE__ */ (0,
|
|
13944
|
-
/* @__PURE__ */ (0,
|
|
14277
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "space-y-2", children: [
|
|
14278
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { htmlFor: "checkout-login-prompt-email", className: "text-sm font-medium", children: t.emailLabel }),
|
|
14279
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
13945
14280
|
"input",
|
|
13946
14281
|
{
|
|
13947
14282
|
id: "checkout-login-prompt-email",
|
|
@@ -13950,29 +14285,29 @@ function CheckoutLoginPrompt({
|
|
|
13950
14285
|
value: email,
|
|
13951
14286
|
onChange: (e) => onEmailChange(e.target.value),
|
|
13952
14287
|
placeholder: t.emailPlaceholder,
|
|
13953
|
-
className: (0,
|
|
14288
|
+
className: (0, import_utils13.cn)(
|
|
13954
14289
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
13955
14290
|
error ? "border-destructive" : "border-border focus:border-primary"
|
|
13956
14291
|
)
|
|
13957
14292
|
}
|
|
13958
14293
|
),
|
|
13959
|
-
error && /* @__PURE__ */ (0,
|
|
14294
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-xs text-destructive", children: error })
|
|
13960
14295
|
] }),
|
|
13961
|
-
/* @__PURE__ */ (0,
|
|
13962
|
-
/* @__PURE__ */ (0,
|
|
14296
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "space-y-2", children: [
|
|
14297
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
13963
14298
|
"button",
|
|
13964
14299
|
{
|
|
13965
14300
|
type: "button",
|
|
13966
14301
|
onClick: onSubmitEmail,
|
|
13967
14302
|
disabled: checking || !isValidEmail,
|
|
13968
|
-
className: (0,
|
|
14303
|
+
className: (0, import_utils13.cn)(
|
|
13969
14304
|
"flex w-full items-center justify-center gap-2 rounded-xl px-4 py-2.5 text-sm font-semibold transition-all",
|
|
13970
14305
|
checking || !isValidEmail ? "cursor-not-allowed bg-muted text-muted-foreground" : "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
13971
14306
|
),
|
|
13972
14307
|
children: checking ? t.checking : t.continueWithEmail
|
|
13973
14308
|
}
|
|
13974
14309
|
),
|
|
13975
|
-
/* @__PURE__ */ (0,
|
|
14310
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
13976
14311
|
"button",
|
|
13977
14312
|
{
|
|
13978
14313
|
type: "button",
|
|
@@ -13989,9 +14324,9 @@ function CheckoutLoginPrompt({
|
|
|
13989
14324
|
}
|
|
13990
14325
|
|
|
13991
14326
|
// src/components/checkout-form.tsx
|
|
13992
|
-
var
|
|
14327
|
+
var import_utils14 = require("@reblu/site-ui/utils");
|
|
13993
14328
|
var import_phone_input = require("@reblu/site-ui/phone-input");
|
|
13994
|
-
var
|
|
14329
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
13995
14330
|
var DEFAULT_LABELS6 = {
|
|
13996
14331
|
contactTitle: "Datos de contacto",
|
|
13997
14332
|
nameLabel: "Nombre completo",
|
|
@@ -14045,22 +14380,22 @@ function CheckoutForm({
|
|
|
14045
14380
|
event.preventDefault();
|
|
14046
14381
|
if (discountCode.trim() && !discountApplying) onApplyDiscount();
|
|
14047
14382
|
}
|
|
14048
|
-
return /* @__PURE__ */ (0,
|
|
14383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
14049
14384
|
loginPrompt,
|
|
14050
|
-
/* @__PURE__ */ (0,
|
|
14385
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
14051
14386
|
"form",
|
|
14052
14387
|
{
|
|
14053
14388
|
"data-testid": "checkout-form",
|
|
14054
14389
|
onSubmit,
|
|
14055
|
-
className: (0,
|
|
14390
|
+
className: (0, import_utils14.cn)("space-y-8", className),
|
|
14056
14391
|
"data-slot": "checkout-form",
|
|
14057
14392
|
children: [
|
|
14058
|
-
/* @__PURE__ */ (0,
|
|
14059
|
-
/* @__PURE__ */ (0,
|
|
14060
|
-
/* @__PURE__ */ (0,
|
|
14061
|
-
/* @__PURE__ */ (0,
|
|
14062
|
-
/* @__PURE__ */ (0,
|
|
14063
|
-
/* @__PURE__ */ (0,
|
|
14393
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { className: "space-y-4", children: [
|
|
14394
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h2", { className: "border-b border-border pb-2 text-lg font-semibold", children: t.contactTitle }),
|
|
14395
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
|
|
14396
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "space-y-1", children: [
|
|
14397
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("label", { htmlFor: "checkout-form-name", className: "text-sm font-medium", children: t.nameLabel }),
|
|
14398
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
14064
14399
|
"input",
|
|
14065
14400
|
{
|
|
14066
14401
|
id: "checkout-form-name",
|
|
@@ -14069,17 +14404,17 @@ function CheckoutForm({
|
|
|
14069
14404
|
value: contact.name,
|
|
14070
14405
|
onChange: (e) => patchContact({ name: e.target.value }),
|
|
14071
14406
|
placeholder: t.namePlaceholder,
|
|
14072
|
-
className: (0,
|
|
14407
|
+
className: (0, import_utils14.cn)(
|
|
14073
14408
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
14074
14409
|
contactErrors?.name ? "border-destructive" : "border-border focus:border-primary"
|
|
14075
14410
|
)
|
|
14076
14411
|
}
|
|
14077
14412
|
),
|
|
14078
|
-
contactErrors?.name && /* @__PURE__ */ (0,
|
|
14413
|
+
contactErrors?.name && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-xs text-destructive", children: contactErrors.name })
|
|
14079
14414
|
] }),
|
|
14080
|
-
/* @__PURE__ */ (0,
|
|
14081
|
-
/* @__PURE__ */ (0,
|
|
14082
|
-
/* @__PURE__ */ (0,
|
|
14415
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "space-y-1", children: [
|
|
14416
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("label", { htmlFor: "checkout-form-email", className: "text-sm font-medium", children: t.emailLabel }),
|
|
14417
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
14083
14418
|
"input",
|
|
14084
14419
|
{
|
|
14085
14420
|
id: "checkout-form-email",
|
|
@@ -14088,15 +14423,15 @@ function CheckoutForm({
|
|
|
14088
14423
|
value: contact.email,
|
|
14089
14424
|
onChange: (e) => patchContact({ email: e.target.value }),
|
|
14090
14425
|
placeholder: t.emailPlaceholder,
|
|
14091
|
-
className: (0,
|
|
14426
|
+
className: (0, import_utils14.cn)(
|
|
14092
14427
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
14093
14428
|
contactErrors?.email ? "border-destructive" : "border-border focus:border-primary"
|
|
14094
14429
|
)
|
|
14095
14430
|
}
|
|
14096
14431
|
),
|
|
14097
|
-
contactErrors?.email && /* @__PURE__ */ (0,
|
|
14432
|
+
contactErrors?.email && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-xs text-destructive", children: contactErrors.email })
|
|
14098
14433
|
] }),
|
|
14099
|
-
/* @__PURE__ */ (0,
|
|
14434
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
14100
14435
|
import_phone_input.PhoneInput,
|
|
14101
14436
|
{
|
|
14102
14437
|
id: "checkout-form-phone",
|
|
@@ -14110,15 +14445,15 @@ function CheckoutForm({
|
|
|
14110
14445
|
] })
|
|
14111
14446
|
] }),
|
|
14112
14447
|
children2,
|
|
14113
|
-
generalError ? /* @__PURE__ */ (0,
|
|
14114
|
-
/* @__PURE__ */ (0,
|
|
14115
|
-
/* @__PURE__ */ (0,
|
|
14116
|
-
appliedDiscount ? /* @__PURE__ */ (0,
|
|
14117
|
-
/* @__PURE__ */ (0,
|
|
14118
|
-
/* @__PURE__ */ (0,
|
|
14119
|
-
/* @__PURE__ */ (0,
|
|
14448
|
+
generalError ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { role: "alert", className: "text-sm text-destructive", children: generalError }) : null,
|
|
14449
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { className: "space-y-3", children: [
|
|
14450
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h2", { className: "border-b border-border pb-2 text-lg font-semibold", children: t.discountTitle }),
|
|
14451
|
+
appliedDiscount ? /* @__PURE__ */ (0, import_jsx_runtime15.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: [
|
|
14452
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center gap-2 text-sm text-green-700 dark:text-green-400", children: [
|
|
14453
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "font-semibold", children: appliedDiscount.code }),
|
|
14454
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: t.discountAppliedSuffix(formatPrice(appliedDiscount.amount, currencyCode, locale)) })
|
|
14120
14455
|
] }),
|
|
14121
|
-
/* @__PURE__ */ (0,
|
|
14456
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
14122
14457
|
"button",
|
|
14123
14458
|
{
|
|
14124
14459
|
type: "button",
|
|
@@ -14128,9 +14463,9 @@ function CheckoutForm({
|
|
|
14128
14463
|
children: t.removeDiscount
|
|
14129
14464
|
}
|
|
14130
14465
|
)
|
|
14131
|
-
] }) : /* @__PURE__ */ (0,
|
|
14132
|
-
/* @__PURE__ */ (0,
|
|
14133
|
-
/* @__PURE__ */ (0,
|
|
14466
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex gap-2", children: [
|
|
14467
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("label", { htmlFor: "checkout-form-discount-code", className: "sr-only", children: t.discountTitle }),
|
|
14468
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
14134
14469
|
"input",
|
|
14135
14470
|
{
|
|
14136
14471
|
id: "checkout-form-discount-code",
|
|
@@ -14142,7 +14477,7 @@ function CheckoutForm({
|
|
|
14142
14477
|
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"
|
|
14143
14478
|
}
|
|
14144
14479
|
),
|
|
14145
|
-
/* @__PURE__ */ (0,
|
|
14480
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
14146
14481
|
"button",
|
|
14147
14482
|
{
|
|
14148
14483
|
type: "button",
|
|
@@ -14153,14 +14488,14 @@ function CheckoutForm({
|
|
|
14153
14488
|
}
|
|
14154
14489
|
)
|
|
14155
14490
|
] }),
|
|
14156
|
-
discountError && /* @__PURE__ */ (0,
|
|
14491
|
+
discountError && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-xs text-destructive", children: discountError })
|
|
14157
14492
|
] }),
|
|
14158
|
-
/* @__PURE__ */ (0,
|
|
14493
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
14159
14494
|
"button",
|
|
14160
14495
|
{
|
|
14161
14496
|
type: "submit",
|
|
14162
14497
|
disabled: submitting || submitDisabled,
|
|
14163
|
-
className: (0,
|
|
14498
|
+
className: (0, import_utils14.cn)(
|
|
14164
14499
|
"flex w-full items-center justify-center gap-2 rounded-xl px-4 py-3 font-semibold transition-all",
|
|
14165
14500
|
submitting || submitDisabled ? "cursor-not-allowed bg-muted text-muted-foreground" : "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
14166
14501
|
),
|
|
@@ -14174,8 +14509,8 @@ function CheckoutForm({
|
|
|
14174
14509
|
}
|
|
14175
14510
|
|
|
14176
14511
|
// src/components/order-confirmation.tsx
|
|
14177
|
-
var
|
|
14178
|
-
var
|
|
14512
|
+
var import_utils15 = require("@reblu/site-ui/utils");
|
|
14513
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
14179
14514
|
var DEFAULT_LABELS7 = {
|
|
14180
14515
|
pollingTitle: "Confirmando tu pedido\u2026",
|
|
14181
14516
|
pollingDescription: "Estamos procesando el pago, un momento\u2026",
|
|
@@ -14237,48 +14572,48 @@ function OrderConfirmation({
|
|
|
14237
14572
|
const showOrderReference = Boolean(order) && !showFullOrderSummary && (status === "refunded" || status === "partially_refunded" || status === "pending_timeout");
|
|
14238
14573
|
const showSessionReference = !order && sessionId && (status === "timeout" || status === "not_found" || status === "pending_timeout");
|
|
14239
14574
|
const showRecheck = (status === "pending_timeout" || status === "error") && onRecheck;
|
|
14240
|
-
return /* @__PURE__ */ (0,
|
|
14241
|
-
/* @__PURE__ */ (0,
|
|
14242
|
-
/* @__PURE__ */ (0,
|
|
14243
|
-
showFullOrderSummary && order && /* @__PURE__ */ (0,
|
|
14244
|
-
/* @__PURE__ */ (0,
|
|
14245
|
-
/* @__PURE__ */ (0,
|
|
14246
|
-
/* @__PURE__ */ (0,
|
|
14575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: (0, import_utils15.cn)("space-y-6 text-center", className), "data-slot": "order-confirmation", children: [
|
|
14576
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h1", { className: "text-3xl font-bold", children: title }),
|
|
14577
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-lg text-muted-foreground", children: description }),
|
|
14578
|
+
showFullOrderSummary && order && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "space-y-6", children: [
|
|
14579
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
14580
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.orderNumberLabel }),
|
|
14581
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "font-mono text-lg font-semibold", children: order.orderNumber })
|
|
14247
14582
|
] }),
|
|
14248
|
-
/* @__PURE__ */ (0,
|
|
14249
|
-
order.items.map((item, idx) => /* @__PURE__ */ (0,
|
|
14583
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "mx-auto max-w-sm space-y-3 rounded-xl border border-border bg-card p-5 text-left", children: [
|
|
14584
|
+
order.items.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
14250
14585
|
"div",
|
|
14251
14586
|
{
|
|
14252
14587
|
className: "flex justify-between gap-4 text-sm",
|
|
14253
14588
|
children: [
|
|
14254
|
-
/* @__PURE__ */ (0,
|
|
14589
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: "max-w-[60%] truncate text-muted-foreground", children: [
|
|
14255
14590
|
item.product.name,
|
|
14256
14591
|
item.variant ? ` (${item.variant.name})` : "",
|
|
14257
14592
|
" x",
|
|
14258
14593
|
item.quantity
|
|
14259
14594
|
] }),
|
|
14260
|
-
/* @__PURE__ */ (0,
|
|
14595
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: formatPrice(item.total, currencyCode, locale) })
|
|
14261
14596
|
]
|
|
14262
14597
|
},
|
|
14263
14598
|
idx
|
|
14264
14599
|
)),
|
|
14265
|
-
/* @__PURE__ */ (0,
|
|
14266
|
-
/* @__PURE__ */ (0,
|
|
14267
|
-
/* @__PURE__ */ (0,
|
|
14600
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "space-y-1 border-t border-border pt-3 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex justify-between pt-1 text-base font-bold", children: [
|
|
14601
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: t.totalLabel }),
|
|
14602
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: formatPrice(order.total, currencyCode, locale) })
|
|
14268
14603
|
] }) })
|
|
14269
14604
|
] }),
|
|
14270
|
-
/* @__PURE__ */ (0,
|
|
14605
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("p", { className: "mx-auto max-w-sm text-sm text-muted-foreground", children: [
|
|
14271
14606
|
t.confirmationEmailPrefix,
|
|
14272
14607
|
" ",
|
|
14273
|
-
/* @__PURE__ */ (0,
|
|
14608
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "font-medium text-foreground", children: order.customerEmail }),
|
|
14274
14609
|
"."
|
|
14275
14610
|
] })
|
|
14276
14611
|
] }),
|
|
14277
|
-
showOrderReference && order && /* @__PURE__ */ (0,
|
|
14278
|
-
/* @__PURE__ */ (0,
|
|
14279
|
-
/* @__PURE__ */ (0,
|
|
14612
|
+
showOrderReference && order && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
14613
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.orderReferenceLabel }),
|
|
14614
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "font-mono text-lg font-semibold", children: order.orderNumber })
|
|
14280
14615
|
] }),
|
|
14281
|
-
status === "failed" && cartHref && /* @__PURE__ */ (0,
|
|
14616
|
+
status === "failed" && cartHref && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
14282
14617
|
"a",
|
|
14283
14618
|
{
|
|
14284
14619
|
href: cartHref,
|
|
@@ -14286,7 +14621,7 @@ function OrderConfirmation({
|
|
|
14286
14621
|
children: t.backToCartLabel
|
|
14287
14622
|
}
|
|
14288
14623
|
),
|
|
14289
|
-
showRecheck && /* @__PURE__ */ (0,
|
|
14624
|
+
showRecheck && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
14290
14625
|
"button",
|
|
14291
14626
|
{
|
|
14292
14627
|
type: "button",
|
|
@@ -14295,9 +14630,9 @@ function OrderConfirmation({
|
|
|
14295
14630
|
children: t.recheckLabel
|
|
14296
14631
|
}
|
|
14297
14632
|
),
|
|
14298
|
-
showSessionReference && /* @__PURE__ */ (0,
|
|
14299
|
-
/* @__PURE__ */ (0,
|
|
14300
|
-
/* @__PURE__ */ (0,
|
|
14633
|
+
showSessionReference && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
14634
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.sessionReferenceLabel }),
|
|
14635
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "break-all font-mono text-sm font-semibold", children: sessionId })
|
|
14301
14636
|
] })
|
|
14302
14637
|
] });
|
|
14303
14638
|
}
|
|
@@ -14312,15 +14647,20 @@ function OrderConfirmation({
|
|
|
14312
14647
|
DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE,
|
|
14313
14648
|
DEFAULT_SHOP_ERROR_MESSAGES,
|
|
14314
14649
|
DEFAULT_SHOP_PRICE_BANDS,
|
|
14650
|
+
FaqAccordion,
|
|
14315
14651
|
MarkdownRenderer,
|
|
14316
14652
|
OrderConfirmation,
|
|
14653
|
+
PageBlocks,
|
|
14654
|
+
ParentPage,
|
|
14317
14655
|
ProductCard,
|
|
14318
14656
|
ProfileCard,
|
|
14319
14657
|
SafeHtml,
|
|
14320
14658
|
ShopFilters,
|
|
14321
14659
|
Specialty,
|
|
14322
14660
|
Treatment,
|
|
14661
|
+
buildFaqPageJsonLd,
|
|
14323
14662
|
buildShareUrls,
|
|
14663
|
+
collectFaqItems,
|
|
14324
14664
|
formatPrice,
|
|
14325
14665
|
getShopErrorMessage,
|
|
14326
14666
|
isAllowedYouTubeHost,
|