@reblu/site-blocks 0.17.1 → 0.19.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 +23 -0
- package/README.md +151 -0
- package/dist/_heading-BsNbc1wc.d.cts +4 -0
- package/dist/_heading-BsNbc1wc.d.ts +4 -0
- package/dist/client.cjs +256 -49
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +60 -2
- package/dist/client.d.ts +60 -2
- package/dist/client.js +255 -50
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +381 -308
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -8
- package/dist/index.d.ts +40 -8
- package/dist/index.js +380 -308
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -47,6 +47,7 @@ __export(src_exports, {
|
|
|
47
47
|
ParentPage: () => ParentPage,
|
|
48
48
|
ProductCard: () => ProductCard,
|
|
49
49
|
ProductTrustItems: () => ProductTrustItems,
|
|
50
|
+
ProfessionalFields: () => ProfessionalFields,
|
|
50
51
|
ProfileCard: () => ProfileCard,
|
|
51
52
|
SafeHtml: () => SafeHtml,
|
|
52
53
|
ShopFilters: () => ShopFilters,
|
|
@@ -13193,8 +13194,25 @@ function slotClassName(structural, defaults, consumer) {
|
|
|
13193
13194
|
// src/components/markdown-renderer.tsx
|
|
13194
13195
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
13195
13196
|
var HTML_TO_DOM_OPTIONS = { lowerCaseAttributeNames: false };
|
|
13196
|
-
function
|
|
13197
|
-
|
|
13197
|
+
function shallowestHeadingLevel(nodes) {
|
|
13198
|
+
let shallowest = null;
|
|
13199
|
+
for (const node of nodes) {
|
|
13200
|
+
if (!(node instanceof import_html_react_parser.Element)) continue;
|
|
13201
|
+
const match = /^h([1-6])$/.exec(node.name);
|
|
13202
|
+
const level = match ? Number(match[1]) : shallowestHeadingLevel(node.children);
|
|
13203
|
+
if (level !== null && (shallowest === null || level < shallowest)) shallowest = level;
|
|
13204
|
+
}
|
|
13205
|
+
return shallowest;
|
|
13206
|
+
}
|
|
13207
|
+
function headingShift(nodes, headingOffset, normalize2) {
|
|
13208
|
+
if (!normalize2) return headingOffset;
|
|
13209
|
+
const shallowest = shallowestHeadingLevel(nodes);
|
|
13210
|
+
return shallowest === null ? headingOffset : 1 + headingOffset - shallowest;
|
|
13211
|
+
}
|
|
13212
|
+
function parse3(html5, headingOffset, normalizeHeadings, images) {
|
|
13213
|
+
const nodes = (0, import_html_react_parser.htmlToDOM)(html5, HTML_TO_DOM_OPTIONS);
|
|
13214
|
+
const shift = headingShift(nodes, headingOffset, normalizeHeadings);
|
|
13215
|
+
return (0, import_html_react_parser.domToReact)(nodes, buildOptions(shift, images));
|
|
13198
13216
|
}
|
|
13199
13217
|
function isAllowedImage(src, prefixes) {
|
|
13200
13218
|
if (!src) return false;
|
|
@@ -13311,7 +13329,7 @@ function buildOptions(headingOffset, images) {
|
|
|
13311
13329
|
const author = authorAttributes(node);
|
|
13312
13330
|
const headingMatch = /^h([1-6])$/.exec(name);
|
|
13313
13331
|
if (headingMatch) {
|
|
13314
|
-
const rendered = Math.min(6, Number(headingMatch[1]) + headingOffset);
|
|
13332
|
+
const rendered = Math.max(1, Math.min(6, Number(headingMatch[1]) + headingOffset));
|
|
13315
13333
|
const Tag = `h${rendered}`;
|
|
13316
13334
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tag, { ...author, className: HEADING_CLASSES[rendered], children: children2() });
|
|
13317
13335
|
}
|
|
@@ -13442,15 +13460,21 @@ function MarkdownRenderer({
|
|
|
13442
13460
|
content,
|
|
13443
13461
|
className,
|
|
13444
13462
|
headingOffset = 0,
|
|
13463
|
+
normalizeHeadings = false,
|
|
13445
13464
|
images
|
|
13446
13465
|
}) {
|
|
13447
13466
|
const html5 = markdownToSafeHtml(content);
|
|
13448
13467
|
if (!html5) return null;
|
|
13449
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: slotClassName("max-w-none", "", className), "data-slot": "markdown", children: parse3(html5,
|
|
13468
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: slotClassName("max-w-none", "", className), "data-slot": "markdown", children: parse3(html5, headingOffset, normalizeHeadings, images) });
|
|
13450
13469
|
}
|
|
13451
|
-
function SafeHtml({
|
|
13470
|
+
function SafeHtml({
|
|
13471
|
+
html: html5,
|
|
13472
|
+
className,
|
|
13473
|
+
headingOffset = 0,
|
|
13474
|
+
normalizeHeadings = false
|
|
13475
|
+
}) {
|
|
13452
13476
|
if (!html5) return null;
|
|
13453
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: slotClassName("max-w-none", "", className), "data-slot": "safe-html", children: parse3(html5,
|
|
13477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: slotClassName("max-w-none", "", className), "data-slot": "safe-html", children: parse3(html5, headingOffset, normalizeHeadings) });
|
|
13454
13478
|
}
|
|
13455
13479
|
|
|
13456
13480
|
// src/components/course-description.tsx
|
|
@@ -13676,34 +13700,82 @@ function ParentPage({
|
|
|
13676
13700
|
var Specialty = ParentPage;
|
|
13677
13701
|
|
|
13678
13702
|
// src/components/profile-card.tsx
|
|
13703
|
+
var import_utils7 = require("@reblu/site-ui/utils");
|
|
13704
|
+
|
|
13705
|
+
// src/components/professional-fields.tsx
|
|
13679
13706
|
var import_utils6 = require("@reblu/site-ui/utils");
|
|
13680
13707
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
13708
|
+
function ProfessionalFields({
|
|
13709
|
+
fields,
|
|
13710
|
+
variant = "profile",
|
|
13711
|
+
className
|
|
13712
|
+
}) {
|
|
13713
|
+
const shown = (fields ?? []).filter((f) => variant !== "card" || f.showOnCard);
|
|
13714
|
+
if (shown.length === 0) return null;
|
|
13715
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
13716
|
+
"dl",
|
|
13717
|
+
{
|
|
13718
|
+
className: (0, import_utils6.cn)(
|
|
13719
|
+
"grid gap-x-3 gap-y-1 text-sm",
|
|
13720
|
+
variant === "card" ? "justify-center" : "grid-cols-[auto_1fr]",
|
|
13721
|
+
className
|
|
13722
|
+
),
|
|
13723
|
+
"data-slot": "professional-fields",
|
|
13724
|
+
"data-variant": variant,
|
|
13725
|
+
children: shown.map((field, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
13726
|
+
"div",
|
|
13727
|
+
{
|
|
13728
|
+
className: variant === "card" ? "flex justify-center gap-1" : "contents",
|
|
13729
|
+
children: [
|
|
13730
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("dt", { className: "text-muted-foreground", children: field.label }),
|
|
13731
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("dd", { className: "m-0 font-medium", children: field.value })
|
|
13732
|
+
]
|
|
13733
|
+
},
|
|
13734
|
+
`${field.label}-${index}`
|
|
13735
|
+
))
|
|
13736
|
+
}
|
|
13737
|
+
);
|
|
13738
|
+
}
|
|
13739
|
+
|
|
13740
|
+
// src/components/profile-card.tsx
|
|
13741
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
13681
13742
|
function initials(name) {
|
|
13682
13743
|
return name.split(/\s+/).filter(Boolean).slice(0, 2).map((part) => part[0]?.toUpperCase() ?? "").join("");
|
|
13683
13744
|
}
|
|
13684
|
-
function ProfileCard({
|
|
13745
|
+
function ProfileCard({
|
|
13746
|
+
name,
|
|
13747
|
+
role,
|
|
13748
|
+
imageUrl,
|
|
13749
|
+
specialties = [],
|
|
13750
|
+
bio,
|
|
13751
|
+
fields,
|
|
13752
|
+
href,
|
|
13753
|
+
className
|
|
13754
|
+
}) {
|
|
13685
13755
|
const NameTag = href ? "a" : "span";
|
|
13686
|
-
return /* @__PURE__ */ (0,
|
|
13756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
13687
13757
|
"article",
|
|
13688
13758
|
{
|
|
13689
|
-
className: (0,
|
|
13759
|
+
className: (0, import_utils7.cn)(
|
|
13690
13760
|
"flex flex-col items-center gap-3 rounded-lg border bg-card p-6 text-center",
|
|
13691
13761
|
className
|
|
13692
13762
|
),
|
|
13693
13763
|
"data-slot": "profile-card",
|
|
13694
13764
|
children: [
|
|
13695
|
-
/* @__PURE__ */ (0,
|
|
13696
|
-
|
|
13697
|
-
|
|
13698
|
-
|
|
13699
|
-
|
|
13700
|
-
|
|
13701
|
-
|
|
13702
|
-
|
|
13703
|
-
|
|
13704
|
-
|
|
13765
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "relative h-24 w-24 overflow-hidden rounded-full bg-muted", children: imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("img", { src: imageUrl, alt: name, loading: "lazy", className: "h-full w-full object-cover" }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
13766
|
+
"span",
|
|
13767
|
+
{
|
|
13768
|
+
className: "flex h-full w-full items-center justify-center text-2xl font-semibold text-muted-foreground",
|
|
13769
|
+
"aria-hidden": "true",
|
|
13770
|
+
children: initials(name)
|
|
13771
|
+
}
|
|
13772
|
+
) }),
|
|
13773
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "space-y-1", children: [
|
|
13774
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h3", { className: "text-lg font-semibold leading-tight", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(NameTag, { ...href ? { href, className: "transition-colors hover:text-primary" } : {}, children: name }) }),
|
|
13775
|
+
role && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-sm text-muted-foreground", children: role })
|
|
13705
13776
|
] }),
|
|
13706
|
-
|
|
13777
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ProfessionalFields, { fields, variant: "card" }),
|
|
13778
|
+
specialties.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("ul", { className: "flex flex-wrap justify-center gap-1.5 p-0", children: specialties.map((s2) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
13707
13779
|
"li",
|
|
13708
13780
|
{
|
|
13709
13781
|
className: "inline-flex items-center rounded-full bg-secondary px-2.5 py-0.5 text-xs font-medium text-secondary-foreground",
|
|
@@ -13711,28 +13783,28 @@ function ProfileCard({ name, role, imageUrl, specialties = [], bio, href, classN
|
|
|
13711
13783
|
},
|
|
13712
13784
|
s2
|
|
13713
13785
|
)) }),
|
|
13714
|
-
bio && /* @__PURE__ */ (0,
|
|
13786
|
+
bio && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-sm text-muted-foreground", children: bio })
|
|
13715
13787
|
]
|
|
13716
13788
|
}
|
|
13717
13789
|
);
|
|
13718
13790
|
}
|
|
13719
13791
|
|
|
13720
13792
|
// src/components/product-card.tsx
|
|
13721
|
-
var
|
|
13722
|
-
var
|
|
13793
|
+
var import_utils8 = require("@reblu/site-ui/utils");
|
|
13794
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
13723
13795
|
function ProductCard({ product, href, currencyCode = "EUR", locale, className }) {
|
|
13724
13796
|
const image = product.images.find((i) => i.isPrimary) ?? product.images[0];
|
|
13725
13797
|
const hasDiscount = product.comparePrice != null && product.comparePrice > product.price;
|
|
13726
|
-
return /* @__PURE__ */ (0,
|
|
13798
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
13727
13799
|
"article",
|
|
13728
13800
|
{
|
|
13729
|
-
className: (0,
|
|
13801
|
+
className: (0, import_utils8.cn)(
|
|
13730
13802
|
"group flex flex-col overflow-hidden rounded-lg border bg-card transition-shadow hover:shadow-lg",
|
|
13731
13803
|
className
|
|
13732
13804
|
),
|
|
13733
13805
|
"data-slot": "product-card",
|
|
13734
13806
|
children: [
|
|
13735
|
-
/* @__PURE__ */ (0,
|
|
13807
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "relative aspect-square overflow-hidden bg-muted", children: image ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
13736
13808
|
"img",
|
|
13737
13809
|
{
|
|
13738
13810
|
src: image.url,
|
|
@@ -13740,14 +13812,14 @@ function ProductCard({ product, href, currencyCode = "EUR", locale, className })
|
|
|
13740
13812
|
loading: "lazy",
|
|
13741
13813
|
className: "h-full w-full object-cover transition-transform group-hover:scale-105"
|
|
13742
13814
|
}
|
|
13743
|
-
) : /* @__PURE__ */ (0,
|
|
13744
|
-
/* @__PURE__ */ (0,
|
|
13745
|
-
product.category && /* @__PURE__ */ (0,
|
|
13746
|
-
/* @__PURE__ */ (0,
|
|
13747
|
-
product.shortDescription && /* @__PURE__ */ (0,
|
|
13748
|
-
/* @__PURE__ */ (0,
|
|
13749
|
-
/* @__PURE__ */ (0,
|
|
13750
|
-
hasDiscount && /* @__PURE__ */ (0,
|
|
13815
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex h-full items-center justify-center text-4xl text-muted-foreground/30", "aria-hidden": "true", children: "\u{1F6CD}\uFE0F" }) }),
|
|
13816
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-1 flex-col gap-2 p-4", children: [
|
|
13817
|
+
product.category && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "inline-flex w-fit items-center rounded-full bg-secondary px-2.5 py-0.5 text-xs font-medium text-secondary-foreground", children: product.category.name }),
|
|
13818
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h3", { className: "text-base font-semibold leading-tight", children: href ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("a", { href, className: "transition-colors hover:text-primary", children: product.name }) : product.name }),
|
|
13819
|
+
product.shortDescription && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "line-clamp-2 text-sm text-muted-foreground", children: product.shortDescription }),
|
|
13820
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "mt-auto flex items-baseline gap-2 pt-2", children: [
|
|
13821
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-lg font-bold text-foreground", children: formatPrice(product.price, currencyCode, locale) }),
|
|
13822
|
+
hasDiscount && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-sm text-muted-foreground line-through", children: formatPrice(product.comparePrice, currencyCode, locale) })
|
|
13751
13823
|
] })
|
|
13752
13824
|
] })
|
|
13753
13825
|
]
|
|
@@ -13949,7 +14021,7 @@ var __iconNode8 = [
|
|
|
13949
14021
|
var Truck = createLucideIcon("truck", __iconNode8);
|
|
13950
14022
|
|
|
13951
14023
|
// src/components/product-trust-items.tsx
|
|
13952
|
-
var
|
|
14024
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
13953
14025
|
var DEFAULT_TRUST_ICONS = Object.freeze({
|
|
13954
14026
|
shipping: Truck,
|
|
13955
14027
|
returns: RotateCcw,
|
|
@@ -13983,17 +14055,17 @@ function ProductTrustItems({
|
|
|
13983
14055
|
return [{ key: `${index}-${icon}`, Icon: Icon2, text: text3 }];
|
|
13984
14056
|
});
|
|
13985
14057
|
if (rows.length === 0) return null;
|
|
13986
|
-
return /* @__PURE__ */ (0,
|
|
13987
|
-
/* @__PURE__ */ (0,
|
|
13988
|
-
/* @__PURE__ */ (0,
|
|
14058
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(List, { "data-slot": "product-trust-items", className: slotClassName("space-y-2.5", "", className), children: rows.map(({ key: key2, Icon: Icon2, text: text3 }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("li", { className: slotClassName("flex items-center gap-3", "text-sm text-muted-foreground", itemClassName), children: [
|
|
14059
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Icon2, { "aria-hidden": "true", className: "h-4 w-4 shrink-0 text-foreground/60" }),
|
|
14060
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: text3 })
|
|
13989
14061
|
] }, key2)) });
|
|
13990
14062
|
}
|
|
13991
14063
|
|
|
13992
14064
|
// src/components/faq-accordion.tsx
|
|
13993
|
-
var
|
|
14065
|
+
var import_utils11 = require("@reblu/site-ui/utils");
|
|
13994
14066
|
|
|
13995
14067
|
// src/components/_heading.tsx
|
|
13996
|
-
var
|
|
14068
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
13997
14069
|
function nextHeadingLevel(level) {
|
|
13998
14070
|
return Math.min(level + 1, 6);
|
|
13999
14071
|
}
|
|
@@ -14003,11 +14075,11 @@ function Heading({
|
|
|
14003
14075
|
children: children2
|
|
14004
14076
|
}) {
|
|
14005
14077
|
const Tag = `h${level}`;
|
|
14006
|
-
return /* @__PURE__ */ (0,
|
|
14078
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Tag, { className, children: children2 });
|
|
14007
14079
|
}
|
|
14008
14080
|
|
|
14009
14081
|
// src/components/faq-accordion.tsx
|
|
14010
|
-
var
|
|
14082
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
14011
14083
|
function FaqAccordion({
|
|
14012
14084
|
items,
|
|
14013
14085
|
heading,
|
|
@@ -14018,18 +14090,18 @@ function FaqAccordion({
|
|
|
14018
14090
|
}) {
|
|
14019
14091
|
const visible = items.map((item, index) => ({ item, index })).filter(({ item }) => item.q.trim() !== "");
|
|
14020
14092
|
if (visible.length === 0) return null;
|
|
14021
|
-
return /* @__PURE__ */ (0,
|
|
14022
|
-
heading && /* @__PURE__ */ (0,
|
|
14023
|
-
/* @__PURE__ */ (0,
|
|
14093
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: (0, import_utils11.cn)("space-y-4", className), "data-slot": "faq-accordion", children: [
|
|
14094
|
+
heading && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Heading, { level: headingLevel, className: "text-2xl font-semibold tracking-tight", children: heading }),
|
|
14095
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "divide-y divide-border rounded-xl border border-border", children: visible.map(({ item, index }) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
14024
14096
|
"details",
|
|
14025
14097
|
{
|
|
14026
14098
|
className: "group px-4",
|
|
14027
14099
|
"data-slot": "faq-item",
|
|
14028
14100
|
...defaultOpen.includes(index) ? { open: true } : {},
|
|
14029
14101
|
children: [
|
|
14030
|
-
/* @__PURE__ */ (0,
|
|
14031
|
-
questionHeadingLevel ? /* @__PURE__ */ (0,
|
|
14032
|
-
/* @__PURE__ */ (0,
|
|
14102
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.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: [
|
|
14103
|
+
questionHeadingLevel ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Heading, { level: questionHeadingLevel, className: "text-base font-medium", children: item.q }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: item.q }),
|
|
14104
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
14033
14105
|
"span",
|
|
14034
14106
|
{
|
|
14035
14107
|
"aria-hidden": "true",
|
|
@@ -14038,7 +14110,7 @@ function FaqAccordion({
|
|
|
14038
14110
|
}
|
|
14039
14111
|
)
|
|
14040
14112
|
] }),
|
|
14041
|
-
/* @__PURE__ */ (0,
|
|
14113
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "whitespace-pre-line pb-4 text-muted-foreground", children: item.a })
|
|
14042
14114
|
]
|
|
14043
14115
|
},
|
|
14044
14116
|
index
|
|
@@ -14047,8 +14119,8 @@ function FaqAccordion({
|
|
|
14047
14119
|
}
|
|
14048
14120
|
|
|
14049
14121
|
// src/components/trust-badges.tsx
|
|
14050
|
-
var
|
|
14051
|
-
var
|
|
14122
|
+
var import_utils12 = require("@reblu/site-ui/utils");
|
|
14123
|
+
var import_jsx_runtime13 = (
|
|
14052
14124
|
// eslint-disable-next-line @next/next/no-img-element -- framework-agnostic SDK; the SITE owns image optimisation
|
|
14053
14125
|
require("react/jsx-runtime")
|
|
14054
14126
|
);
|
|
@@ -14091,17 +14163,17 @@ function safeLogoSrc(url) {
|
|
|
14091
14163
|
function BadgeContent({ badge, logoClassName }) {
|
|
14092
14164
|
const src = safeLogoSrc(badge.logoUrl);
|
|
14093
14165
|
if (src) {
|
|
14094
|
-
return /* @__PURE__ */ (0,
|
|
14166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
14095
14167
|
"img",
|
|
14096
14168
|
{
|
|
14097
14169
|
src,
|
|
14098
14170
|
alt: badge.name,
|
|
14099
14171
|
loading: "lazy",
|
|
14100
|
-
className: (0,
|
|
14172
|
+
className: (0, import_utils12.cn)("h-12 w-auto object-contain", logoClassName)
|
|
14101
14173
|
}
|
|
14102
14174
|
);
|
|
14103
14175
|
}
|
|
14104
|
-
return /* @__PURE__ */ (0,
|
|
14176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-sm font-medium", children: badge.name });
|
|
14105
14177
|
}
|
|
14106
14178
|
function TrustBadges({
|
|
14107
14179
|
badges,
|
|
@@ -14129,14 +14201,14 @@ function TrustBadges({
|
|
|
14129
14201
|
if (groups.length === 0) return null;
|
|
14130
14202
|
const hasHeading = heading !== void 0 && heading !== null && heading !== "";
|
|
14131
14203
|
const groupHeadingLevel = hasHeading ? nextHeadingLevel(headingLevel) : headingLevel;
|
|
14132
|
-
const content = groups.map(({ type, groupHeading, items }) => /* @__PURE__ */ (0,
|
|
14204
|
+
const content = groups.map(({ type, groupHeading, items }) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
14133
14205
|
"div",
|
|
14134
14206
|
{
|
|
14135
14207
|
"data-slot": "trust-badge-group",
|
|
14136
14208
|
"data-type": type,
|
|
14137
|
-
className: (0,
|
|
14209
|
+
className: (0, import_utils12.cn)("space-y-3", groupClassName),
|
|
14138
14210
|
children: [
|
|
14139
|
-
groupHeading ? /* @__PURE__ */ (0,
|
|
14211
|
+
groupHeading ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
14140
14212
|
Heading,
|
|
14141
14213
|
{
|
|
14142
14214
|
level: groupHeadingLevel,
|
|
@@ -14148,30 +14220,30 @@ function TrustBadges({
|
|
|
14148
14220
|
children: groupHeading
|
|
14149
14221
|
}
|
|
14150
14222
|
) : null,
|
|
14151
|
-
/* @__PURE__ */ (0,
|
|
14223
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("ul", { className: (0, import_utils12.cn)("flex flex-wrap items-center gap-6", listClassName), children: items.map((badge) => {
|
|
14152
14224
|
const href = safeHref(badge.url);
|
|
14153
|
-
return /* @__PURE__ */ (0,
|
|
14154
|
-
/* @__PURE__ */ (0,
|
|
14225
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("li", { children: href ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("a", { href, target: "_blank", rel: "noopener noreferrer", className: "inline-flex", children: [
|
|
14226
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(BadgeContent, { badge, logoClassName }),
|
|
14155
14227
|
" ",
|
|
14156
|
-
/* @__PURE__ */ (0,
|
|
14157
|
-
] }) : /* @__PURE__ */ (0,
|
|
14228
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "sr-only", children: newWindowLabel })
|
|
14229
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(BadgeContent, { badge, logoClassName }) }, badge.id);
|
|
14158
14230
|
}) })
|
|
14159
14231
|
]
|
|
14160
14232
|
},
|
|
14161
14233
|
type
|
|
14162
14234
|
));
|
|
14163
14235
|
if (!hasHeading) {
|
|
14164
|
-
return /* @__PURE__ */ (0,
|
|
14236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { "data-slot": "trust-badges", className: (0, import_utils12.cn)("space-y-6", className), children: content });
|
|
14165
14237
|
}
|
|
14166
14238
|
const Tag = `h${headingLevel}`;
|
|
14167
|
-
return /* @__PURE__ */ (0,
|
|
14239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
14168
14240
|
"section",
|
|
14169
14241
|
{
|
|
14170
14242
|
"data-slot": "trust-badges",
|
|
14171
14243
|
"aria-labelledby": headingId,
|
|
14172
|
-
className: (0,
|
|
14244
|
+
className: (0, import_utils12.cn)("space-y-6", className),
|
|
14173
14245
|
children: [
|
|
14174
|
-
/* @__PURE__ */ (0,
|
|
14246
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
14175
14247
|
Tag,
|
|
14176
14248
|
{
|
|
14177
14249
|
id: headingId,
|
|
@@ -14186,40 +14258,40 @@ function TrustBadges({
|
|
|
14186
14258
|
}
|
|
14187
14259
|
|
|
14188
14260
|
// src/components/page-blocks.tsx
|
|
14189
|
-
var
|
|
14261
|
+
var import_utils13 = require("@reblu/site-ui/utils");
|
|
14190
14262
|
var import_button_variants2 = require("@reblu/site-ui/button-variants");
|
|
14191
|
-
var
|
|
14263
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
14192
14264
|
var ALIASES = {
|
|
14193
14265
|
doctor_embed: "profile_embed",
|
|
14194
14266
|
specialty_embed: "page_embed"
|
|
14195
14267
|
};
|
|
14196
14268
|
function HeroBlock({ block, headingLevel }) {
|
|
14197
14269
|
const { title, subtitle, imageUrl } = block.data;
|
|
14198
|
-
return /* @__PURE__ */ (0,
|
|
14199
|
-
/* @__PURE__ */ (0,
|
|
14200
|
-
subtitle && /* @__PURE__ */ (0,
|
|
14201
|
-
imageUrl && /* @__PURE__ */ (0,
|
|
14270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "space-y-4", children: [
|
|
14271
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Heading, { level: headingLevel, className: "text-3xl font-bold tracking-tight md:text-4xl", children: title }),
|
|
14272
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-lg opacity-80", children: subtitle }),
|
|
14273
|
+
imageUrl && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "relative aspect-[21/9] w-full overflow-hidden rounded-xl bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("img", { src: imageUrl, alt: "", loading: "lazy", className: "h-full w-full object-cover" }) })
|
|
14202
14274
|
] });
|
|
14203
14275
|
}
|
|
14204
14276
|
function RichtextBlock({ block, headingLevel }) {
|
|
14205
|
-
return /* @__PURE__ */ (0,
|
|
14277
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SafeHtml, { html: sanitizeHtml(block.data.html), headingOffset: headingLevel - 1 });
|
|
14206
14278
|
}
|
|
14207
14279
|
function FaqBlock({ block }) {
|
|
14208
|
-
return /* @__PURE__ */ (0,
|
|
14280
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FaqAccordion, { items: block.data.items });
|
|
14209
14281
|
}
|
|
14210
14282
|
function StatsBlock({ block }) {
|
|
14211
|
-
return /* @__PURE__ */ (0,
|
|
14212
|
-
/* @__PURE__ */ (0,
|
|
14213
|
-
/* @__PURE__ */ (0,
|
|
14283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.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_runtime14.jsxs)("div", { className: "flex flex-col-reverse gap-1", children: [
|
|
14284
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dt", { className: "text-sm opacity-80", children: item.label }),
|
|
14285
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dd", { className: "text-3xl font-bold", children: item.value })
|
|
14214
14286
|
] }, i)) });
|
|
14215
14287
|
}
|
|
14216
14288
|
function TestimonialBlock({ block }) {
|
|
14217
14289
|
const { quote, author, role, avatarUrl } = block.data;
|
|
14218
|
-
return /* @__PURE__ */ (0,
|
|
14219
|
-
/* @__PURE__ */ (0,
|
|
14220
|
-
/* @__PURE__ */ (0,
|
|
14290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("figure", { className: "space-y-4", children: [
|
|
14291
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("blockquote", { className: "text-xl italic", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: quote }) }),
|
|
14292
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("figcaption", { className: "flex items-center gap-3", children: [
|
|
14221
14293
|
avatarUrl && // eslint-disable-next-line @next/next/no-img-element
|
|
14222
|
-
/* @__PURE__ */ (0,
|
|
14294
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
14223
14295
|
"img",
|
|
14224
14296
|
{
|
|
14225
14297
|
src: avatarUrl,
|
|
@@ -14228,9 +14300,9 @@ function TestimonialBlock({ block }) {
|
|
|
14228
14300
|
className: "h-10 w-10 rounded-full object-cover"
|
|
14229
14301
|
}
|
|
14230
14302
|
),
|
|
14231
|
-
/* @__PURE__ */ (0,
|
|
14232
|
-
/* @__PURE__ */ (0,
|
|
14233
|
-
role && /* @__PURE__ */ (0,
|
|
14303
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
|
|
14304
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "font-semibold", children: author }),
|
|
14305
|
+
role && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "block text-sm opacity-80", children: role })
|
|
14234
14306
|
] })
|
|
14235
14307
|
] })
|
|
14236
14308
|
] });
|
|
@@ -14239,19 +14311,19 @@ function CtaSlotBlock(_props) {
|
|
|
14239
14311
|
return null;
|
|
14240
14312
|
}
|
|
14241
14313
|
function FeatureListBlock({ block }) {
|
|
14242
|
-
return /* @__PURE__ */ (0,
|
|
14314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.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_runtime14.jsx)("li", { children: item.text }, i)) });
|
|
14243
14315
|
}
|
|
14244
14316
|
function GalleryBlock({ block }) {
|
|
14245
14317
|
const { images } = block.data;
|
|
14246
|
-
return /* @__PURE__ */ (0,
|
|
14318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
14247
14319
|
"div",
|
|
14248
14320
|
{
|
|
14249
|
-
className: (0,
|
|
14321
|
+
className: (0, import_utils13.cn)(
|
|
14250
14322
|
"grid gap-4",
|
|
14251
14323
|
images.length > 1 ? "sm:grid-cols-2 lg:grid-cols-3" : "grid-cols-1"
|
|
14252
14324
|
),
|
|
14253
|
-
children: images.map((img, i) => /* @__PURE__ */ (0,
|
|
14254
|
-
/* @__PURE__ */ (0,
|
|
14325
|
+
children: images.map((img, i) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("figure", { className: "space-y-1", children: [
|
|
14326
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "relative aspect-video w-full overflow-hidden rounded-lg bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
14255
14327
|
"img",
|
|
14256
14328
|
{
|
|
14257
14329
|
src: img.url,
|
|
@@ -14260,7 +14332,7 @@ function GalleryBlock({ block }) {
|
|
|
14260
14332
|
className: "h-full w-full object-cover"
|
|
14261
14333
|
}
|
|
14262
14334
|
) }),
|
|
14263
|
-
img.caption && /* @__PURE__ */ (0,
|
|
14335
|
+
img.caption && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("figcaption", { className: "text-sm opacity-80", children: img.caption })
|
|
14264
14336
|
] }, `${img.url}-${i}`))
|
|
14265
14337
|
}
|
|
14266
14338
|
);
|
|
@@ -14270,13 +14342,13 @@ function EmbedCard({
|
|
|
14270
14342
|
headingLevel,
|
|
14271
14343
|
embedHref
|
|
14272
14344
|
}) {
|
|
14273
|
-
return /* @__PURE__ */ (0,
|
|
14345
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
14274
14346
|
"a",
|
|
14275
14347
|
{
|
|
14276
14348
|
href: embedHref(resolved),
|
|
14277
14349
|
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",
|
|
14278
14350
|
children: [
|
|
14279
|
-
resolved.coverImageUrl && /* @__PURE__ */ (0,
|
|
14351
|
+
resolved.coverImageUrl && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "aspect-video w-full overflow-hidden bg-muted", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
14280
14352
|
"img",
|
|
14281
14353
|
{
|
|
14282
14354
|
src: resolved.coverImageUrl,
|
|
@@ -14285,24 +14357,24 @@ function EmbedCard({
|
|
|
14285
14357
|
className: "h-full w-full object-cover"
|
|
14286
14358
|
}
|
|
14287
14359
|
) }),
|
|
14288
|
-
/* @__PURE__ */ (0,
|
|
14289
|
-
/* @__PURE__ */ (0,
|
|
14290
|
-
resolved.role && /* @__PURE__ */ (0,
|
|
14291
|
-
resolved.excerpt && /* @__PURE__ */ (0,
|
|
14360
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "space-y-1 p-4", children: [
|
|
14361
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Heading, { level: headingLevel, className: "text-lg font-semibold", children: resolved.title }),
|
|
14362
|
+
resolved.role && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-sm text-muted-foreground", children: resolved.role }),
|
|
14363
|
+
resolved.excerpt && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-muted-foreground", children: resolved.excerpt })
|
|
14292
14364
|
] })
|
|
14293
14365
|
]
|
|
14294
14366
|
}
|
|
14295
14367
|
);
|
|
14296
14368
|
}
|
|
14297
14369
|
function PageEmbedBlock({ block, headingLevel, embedHref }) {
|
|
14298
|
-
return /* @__PURE__ */ (0,
|
|
14370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(EmbedCard, { resolved: block.resolved, headingLevel, embedHref });
|
|
14299
14371
|
}
|
|
14300
14372
|
function ProfileEmbedBlock({
|
|
14301
14373
|
block,
|
|
14302
14374
|
headingLevel,
|
|
14303
14375
|
embedHref
|
|
14304
14376
|
}) {
|
|
14305
|
-
return /* @__PURE__ */ (0,
|
|
14377
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(EmbedCard, { resolved: block.resolved, headingLevel, embedHref });
|
|
14306
14378
|
}
|
|
14307
14379
|
var DEFAULT_RENDERERS = {
|
|
14308
14380
|
hero: HeroBlock,
|
|
@@ -14359,14 +14431,14 @@ function toIdFragment(value) {
|
|
|
14359
14431
|
function SectionCta2({ cta }) {
|
|
14360
14432
|
if (!hasUsableCta(cta)) return null;
|
|
14361
14433
|
const variant = toButtonVariant(cta.variant);
|
|
14362
|
-
return /* @__PURE__ */ (0,
|
|
14434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
14363
14435
|
"a",
|
|
14364
14436
|
{
|
|
14365
14437
|
href: cta.url,
|
|
14366
14438
|
"data-slot": "button",
|
|
14367
14439
|
"data-variant": variant,
|
|
14368
14440
|
"data-size": "default",
|
|
14369
|
-
className: (0,
|
|
14441
|
+
className: (0, import_utils13.cn)((0, import_button_variants2.buttonVariants)({ variant, size: "default" })),
|
|
14370
14442
|
...cta.isExternal ? { target: "_blank", rel: "noopener noreferrer" } : {},
|
|
14371
14443
|
children: cta.label
|
|
14372
14444
|
}
|
|
@@ -14392,17 +14464,17 @@ function PageBlocks({
|
|
|
14392
14464
|
const headingId = block.heading ? `${safePrefix}-${toIdFragment(block.id)}-heading` : void 0;
|
|
14393
14465
|
const background = block.backgroundColor;
|
|
14394
14466
|
return [
|
|
14395
|
-
/* @__PURE__ */ (0,
|
|
14467
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
14396
14468
|
"section",
|
|
14397
14469
|
{
|
|
14398
14470
|
"data-slot": "page-block",
|
|
14399
14471
|
"data-block-type": type,
|
|
14400
14472
|
"aria-labelledby": headingId,
|
|
14401
14473
|
style: surfaceStyle(background),
|
|
14402
|
-
className: (0,
|
|
14474
|
+
className: (0, import_utils13.cn)("space-y-6", background && "rounded-xl px-6 py-10", sectionClassName),
|
|
14403
14475
|
children: [
|
|
14404
|
-
block.heading && /* @__PURE__ */ (0,
|
|
14405
|
-
/* @__PURE__ */ (0,
|
|
14476
|
+
block.heading && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Heading, { level: headingLevel, className: "text-2xl font-bold tracking-tight", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { id: headingId, children: block.heading }) }),
|
|
14477
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
14406
14478
|
Renderer,
|
|
14407
14479
|
{
|
|
14408
14480
|
block,
|
|
@@ -14410,7 +14482,7 @@ function PageBlocks({
|
|
|
14410
14482
|
embedHref
|
|
14411
14483
|
}
|
|
14412
14484
|
),
|
|
14413
|
-
/* @__PURE__ */ (0,
|
|
14485
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(SectionCta2, { cta: block.cta })
|
|
14414
14486
|
]
|
|
14415
14487
|
},
|
|
14416
14488
|
block.id
|
|
@@ -14418,12 +14490,12 @@ function PageBlocks({
|
|
|
14418
14490
|
];
|
|
14419
14491
|
});
|
|
14420
14492
|
if (sections.length === 0) return null;
|
|
14421
|
-
return /* @__PURE__ */ (0,
|
|
14493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: (0, import_utils13.cn)("space-y-12", className), "data-slot": "page-blocks", children: sections });
|
|
14422
14494
|
}
|
|
14423
14495
|
|
|
14424
14496
|
// src/components/shop-filters.tsx
|
|
14425
|
-
var
|
|
14426
|
-
var
|
|
14497
|
+
var import_utils14 = require("@reblu/site-ui/utils");
|
|
14498
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
14427
14499
|
var DEFAULT_SHOP_PRICE_BANDS = [
|
|
14428
14500
|
{ max: 2500 },
|
|
14429
14501
|
{ min: 2500, max: 5e3 },
|
|
@@ -14467,7 +14539,7 @@ function priceBandLabel(band, t, currencyCode, locale) {
|
|
|
14467
14539
|
return "";
|
|
14468
14540
|
}
|
|
14469
14541
|
function OptionLink({ href, active, label, onActivate }) {
|
|
14470
|
-
return /* @__PURE__ */ (0,
|
|
14542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
14471
14543
|
"a",
|
|
14472
14544
|
{
|
|
14473
14545
|
href,
|
|
@@ -14476,7 +14548,7 @@ function OptionLink({ href, active, label, onActivate }) {
|
|
|
14476
14548
|
event.preventDefault();
|
|
14477
14549
|
onActivate();
|
|
14478
14550
|
} : void 0,
|
|
14479
|
-
className: (0,
|
|
14551
|
+
className: (0, import_utils14.cn)(
|
|
14480
14552
|
"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",
|
|
14481
14553
|
active ? "border-transparent bg-primary text-primary-foreground" : "border-border text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
14482
14554
|
),
|
|
@@ -14485,9 +14557,9 @@ function OptionLink({ href, active, label, onActivate }) {
|
|
|
14485
14557
|
);
|
|
14486
14558
|
}
|
|
14487
14559
|
function FilterFieldset({ legend, children: children2 }) {
|
|
14488
|
-
return /* @__PURE__ */ (0,
|
|
14489
|
-
/* @__PURE__ */ (0,
|
|
14490
|
-
/* @__PURE__ */ (0,
|
|
14560
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("fieldset", { className: "space-y-2", children: [
|
|
14561
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("legend", { className: "text-sm font-medium text-foreground", children: legend }),
|
|
14562
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex flex-wrap gap-2", children: children2 })
|
|
14491
14563
|
] });
|
|
14492
14564
|
}
|
|
14493
14565
|
function ShopFilters({
|
|
@@ -14510,11 +14582,11 @@ function ShopFilters({
|
|
|
14510
14582
|
if (!shouldRenderShopFilters(facets, active)) {
|
|
14511
14583
|
return null;
|
|
14512
14584
|
}
|
|
14513
|
-
return /* @__PURE__ */ (0,
|
|
14585
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: (0, import_utils14.cn)("space-y-6", className), "data-slot": "shop-filters", children: [
|
|
14514
14586
|
visibleTaxonomies.map((axis) => {
|
|
14515
14587
|
const activeSlug = active.taxonomy?.[axis.key];
|
|
14516
|
-
return /* @__PURE__ */ (0,
|
|
14517
|
-
/* @__PURE__ */ (0,
|
|
14588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(FilterFieldset, { legend: axis.label, children: [
|
|
14589
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
14518
14590
|
OptionLink,
|
|
14519
14591
|
{
|
|
14520
14592
|
href: hrefs.taxonomy(axis.key, void 0),
|
|
@@ -14529,7 +14601,7 @@ function ShopFilters({
|
|
|
14529
14601
|
),
|
|
14530
14602
|
axis.terms.map((term) => {
|
|
14531
14603
|
const isActive = activeSlug === term.slug;
|
|
14532
|
-
return /* @__PURE__ */ (0,
|
|
14604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
14533
14605
|
OptionLink,
|
|
14534
14606
|
{
|
|
14535
14607
|
href: hrefs.taxonomy(axis.key, isActive ? void 0 : term.slug),
|
|
@@ -14549,9 +14621,9 @@ function ShopFilters({
|
|
|
14549
14621
|
}),
|
|
14550
14622
|
visibleAttributes.map((attr) => {
|
|
14551
14623
|
const activeValues = toValueArray(active.attr?.[attr.key]);
|
|
14552
|
-
return /* @__PURE__ */ (0,
|
|
14624
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FilterFieldset, { legend: attr.label, children: attr.options.map((opt) => {
|
|
14553
14625
|
const isActive = activeValues.includes(opt.value);
|
|
14554
|
-
return /* @__PURE__ */ (0,
|
|
14626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
14555
14627
|
OptionLink,
|
|
14556
14628
|
{
|
|
14557
14629
|
href: hrefs.attr(attr.key, opt.value),
|
|
@@ -14569,11 +14641,11 @@ function ShopFilters({
|
|
|
14569
14641
|
);
|
|
14570
14642
|
}) }, attr.key);
|
|
14571
14643
|
}),
|
|
14572
|
-
showPriceGroup && /* @__PURE__ */ (0,
|
|
14644
|
+
showPriceGroup && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FilterFieldset, { legend: t.price, children: priceBands.map((band, i) => {
|
|
14573
14645
|
const isActive = active.priceMin === band.min && active.priceMax === band.max;
|
|
14574
14646
|
const nextMin = isActive ? void 0 : band.min;
|
|
14575
14647
|
const nextMax = isActive ? void 0 : band.max;
|
|
14576
|
-
return /* @__PURE__ */ (0,
|
|
14648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
14577
14649
|
OptionLink,
|
|
14578
14650
|
{
|
|
14579
14651
|
href: hrefs.price(nextMin, nextMax),
|
|
@@ -14584,7 +14656,7 @@ function ShopFilters({
|
|
|
14584
14656
|
i
|
|
14585
14657
|
);
|
|
14586
14658
|
}) }),
|
|
14587
|
-
hasOnSale && /* @__PURE__ */ (0,
|
|
14659
|
+
hasOnSale && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
14588
14660
|
OptionLink,
|
|
14589
14661
|
{
|
|
14590
14662
|
href: hrefs.onSale(!active.onSale),
|
|
@@ -14593,7 +14665,7 @@ function ShopFilters({
|
|
|
14593
14665
|
onActivate: onChange ? () => onChange({ onSale: !active.onSale }) : void 0
|
|
14594
14666
|
}
|
|
14595
14667
|
),
|
|
14596
|
-
/* @__PURE__ */ (0,
|
|
14668
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
14597
14669
|
"a",
|
|
14598
14670
|
{
|
|
14599
14671
|
href: hrefs.clearAll(),
|
|
@@ -14609,8 +14681,8 @@ function ShopFilters({
|
|
|
14609
14681
|
}
|
|
14610
14682
|
|
|
14611
14683
|
// src/components/cart-line-list.tsx
|
|
14612
|
-
var
|
|
14613
|
-
var
|
|
14684
|
+
var import_utils15 = require("@reblu/site-ui/utils");
|
|
14685
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
14614
14686
|
var DEFAULT_LABELS2 = {
|
|
14615
14687
|
quantityLabel: "Cantidad",
|
|
14616
14688
|
decrease: "Reducir cantidad",
|
|
@@ -14636,9 +14708,9 @@ function CartLineList({
|
|
|
14636
14708
|
}) {
|
|
14637
14709
|
const t = { ...DEFAULT_LABELS2, ...labels };
|
|
14638
14710
|
const noticeContent = notice === true ? t.cancelledNotice : notice;
|
|
14639
|
-
return /* @__PURE__ */ (0,
|
|
14640
|
-
/* @__PURE__ */ (0,
|
|
14641
|
-
noticeContent != null && noticeContent !== false && /* @__PURE__ */ (0,
|
|
14711
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: (0, import_utils15.cn)("space-y-4", className), "data-slot": "cart-line-list", children: [
|
|
14712
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { "aria-live": "polite", className: "sr-only", children: liveMessage }),
|
|
14713
|
+
noticeContent != null && noticeContent !== false && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
14642
14714
|
"div",
|
|
14643
14715
|
{
|
|
14644
14716
|
role: "status",
|
|
@@ -14647,69 +14719,69 @@ function CartLineList({
|
|
|
14647
14719
|
children: noticeContent
|
|
14648
14720
|
}
|
|
14649
14721
|
),
|
|
14650
|
-
/* @__PURE__ */ (0,
|
|
14722
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("ul", { className: "space-y-4", children: items.map((item) => {
|
|
14651
14723
|
const maxQty = item.maxStock ?? Infinity;
|
|
14652
14724
|
const atMax = item.quantity >= maxQty;
|
|
14653
14725
|
const atMin = item.quantity <= 1;
|
|
14654
14726
|
const message = lineMessage?.(item);
|
|
14655
|
-
return /* @__PURE__ */ (0,
|
|
14727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
14656
14728
|
"li",
|
|
14657
14729
|
{
|
|
14658
14730
|
className: "flex gap-4 rounded-xl border border-border bg-card p-4",
|
|
14659
14731
|
children: [
|
|
14660
|
-
/* @__PURE__ */ (0,
|
|
14661
|
-
/* @__PURE__ */ (0,
|
|
14662
|
-
/* @__PURE__ */ (0,
|
|
14663
|
-
item.variantName && /* @__PURE__ */ (0,
|
|
14664
|
-
/* @__PURE__ */ (0,
|
|
14732
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "h-20 w-20 flex-shrink-0 overflow-hidden rounded-lg bg-muted", children: item.imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("img", { src: item.imageUrl, alt: item.name, className: "h-full w-full object-cover" }) : null }),
|
|
14733
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
14734
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "truncate text-sm font-semibold leading-tight", children: item.name }),
|
|
14735
|
+
item.variantName && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "mt-0.5 text-xs text-muted-foreground", children: item.variantName }),
|
|
14736
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("p", { className: "mt-1 text-sm text-muted-foreground", children: [
|
|
14665
14737
|
formatPrice(item.unitPrice, currencyCode, locale),
|
|
14666
14738
|
" ",
|
|
14667
14739
|
t.unitPriceSuffix
|
|
14668
14740
|
] }),
|
|
14669
|
-
/* @__PURE__ */ (0,
|
|
14741
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
14670
14742
|
"div",
|
|
14671
14743
|
{
|
|
14672
14744
|
role: "group",
|
|
14673
14745
|
"aria-label": t.quantityLabel,
|
|
14674
14746
|
className: "mt-3 flex items-center gap-3",
|
|
14675
14747
|
children: [
|
|
14676
|
-
/* @__PURE__ */ (0,
|
|
14748
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
14677
14749
|
"button",
|
|
14678
14750
|
{
|
|
14679
14751
|
type: "button",
|
|
14680
14752
|
"aria-label": t.decrease,
|
|
14681
14753
|
disabled: !onQuantityChange || atMin,
|
|
14682
14754
|
onClick: onQuantityChange ? () => onQuantityChange(item.productId, item.variantId, item.quantity - 1) : void 0,
|
|
14683
|
-
className: "flex h-7 w-7 items-center justify-center rounded border border-border transition hover:bg-muted disabled:cursor-not-allowed disabled:opacity-40",
|
|
14755
|
+
className: "flex h-7 w-7 cursor-pointer items-center justify-center rounded border border-border transition hover:bg-muted disabled:cursor-not-allowed disabled:opacity-40",
|
|
14684
14756
|
children: "\u2212"
|
|
14685
14757
|
}
|
|
14686
14758
|
),
|
|
14687
|
-
/* @__PURE__ */ (0,
|
|
14688
|
-
/* @__PURE__ */ (0,
|
|
14759
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "w-8 text-center text-sm font-semibold tabular-nums", children: item.quantity }),
|
|
14760
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
14689
14761
|
"button",
|
|
14690
14762
|
{
|
|
14691
14763
|
type: "button",
|
|
14692
14764
|
"aria-label": t.increase,
|
|
14693
14765
|
disabled: !onQuantityChange || atMax,
|
|
14694
14766
|
onClick: onQuantityChange ? () => onQuantityChange(item.productId, item.variantId, item.quantity + 1) : void 0,
|
|
14695
|
-
className: "flex h-7 w-7 items-center justify-center rounded border border-border transition hover:bg-muted disabled:cursor-not-allowed disabled:opacity-40",
|
|
14767
|
+
className: "flex h-7 w-7 cursor-pointer items-center justify-center rounded border border-border transition hover:bg-muted disabled:cursor-not-allowed disabled:opacity-40",
|
|
14696
14768
|
children: "+"
|
|
14697
14769
|
}
|
|
14698
14770
|
),
|
|
14699
|
-
onRemove && /* @__PURE__ */ (0,
|
|
14771
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
14700
14772
|
"button",
|
|
14701
14773
|
{
|
|
14702
14774
|
type: "button",
|
|
14703
14775
|
"aria-label": `${t.remove} ${item.name}`,
|
|
14704
14776
|
onClick: () => onRemove(item.productId, item.variantId),
|
|
14705
|
-
className: "ml-2 text-muted-foreground transition-colors hover:text-destructive",
|
|
14777
|
+
className: "ml-2 cursor-pointer text-muted-foreground transition-colors hover:text-destructive",
|
|
14706
14778
|
children: t.remove
|
|
14707
14779
|
}
|
|
14708
14780
|
)
|
|
14709
14781
|
]
|
|
14710
14782
|
}
|
|
14711
14783
|
),
|
|
14712
|
-
message != null && message !== false && /* @__PURE__ */ (0,
|
|
14784
|
+
message != null && message !== false && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
14713
14785
|
"p",
|
|
14714
14786
|
{
|
|
14715
14787
|
className: "mt-2 text-sm text-destructive",
|
|
@@ -14718,7 +14790,7 @@ function CartLineList({
|
|
|
14718
14790
|
}
|
|
14719
14791
|
)
|
|
14720
14792
|
] }),
|
|
14721
|
-
/* @__PURE__ */ (0,
|
|
14793
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex-shrink-0 text-right", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-base font-bold", children: formatPrice(item.unitPrice * item.quantity, currencyCode, locale) }) })
|
|
14722
14794
|
]
|
|
14723
14795
|
},
|
|
14724
14796
|
lineKey(item.productId, item.variantId)
|
|
@@ -14728,8 +14800,8 @@ function CartLineList({
|
|
|
14728
14800
|
}
|
|
14729
14801
|
|
|
14730
14802
|
// src/components/cart-summary.tsx
|
|
14731
|
-
var
|
|
14732
|
-
var
|
|
14803
|
+
var import_utils16 = require("@reblu/site-ui/utils");
|
|
14804
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
14733
14805
|
var DEFAULT_LABELS3 = {
|
|
14734
14806
|
subtotal: "Subtotal",
|
|
14735
14807
|
discountPrefix: "Descuento",
|
|
@@ -14756,40 +14828,40 @@ function CartSummary({
|
|
|
14756
14828
|
const hasDiscount = Boolean(discount && discount > 0);
|
|
14757
14829
|
const noticeContent = notice === true ? t.cancelledNotice : notice;
|
|
14758
14830
|
const hasNotice = noticeContent != null && noticeContent !== false;
|
|
14759
|
-
const breakdown = /* @__PURE__ */ (0,
|
|
14831
|
+
const breakdown = /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
14760
14832
|
"dl",
|
|
14761
14833
|
{
|
|
14762
|
-
className: (0,
|
|
14834
|
+
className: (0, import_utils16.cn)("space-y-2 text-sm", !hasNotice && className),
|
|
14763
14835
|
"data-slot": "cart-summary",
|
|
14764
14836
|
children: [
|
|
14765
|
-
/* @__PURE__ */ (0,
|
|
14766
|
-
/* @__PURE__ */ (0,
|
|
14767
|
-
/* @__PURE__ */ (0,
|
|
14837
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex justify-between text-muted-foreground", children: [
|
|
14838
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("dt", { children: t.subtotal }),
|
|
14839
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("dd", { children: formatPrice(subtotal, currencyCode, locale) })
|
|
14768
14840
|
] }),
|
|
14769
|
-
hasDiscount && /* @__PURE__ */ (0,
|
|
14770
|
-
/* @__PURE__ */ (0,
|
|
14841
|
+
hasDiscount && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex justify-between text-green-600 dark:text-green-400", children: [
|
|
14842
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("dt", { children: [
|
|
14771
14843
|
t.discountPrefix,
|
|
14772
14844
|
discountCode ? ` (${discountCode})` : ""
|
|
14773
14845
|
] }),
|
|
14774
|
-
/* @__PURE__ */ (0,
|
|
14846
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("dd", { children: [
|
|
14775
14847
|
"-",
|
|
14776
14848
|
formatPrice(discount, currencyCode, locale)
|
|
14777
14849
|
] })
|
|
14778
14850
|
] }),
|
|
14779
|
-
shippingEnabled && /* @__PURE__ */ (0,
|
|
14780
|
-
/* @__PURE__ */ (0,
|
|
14781
|
-
/* @__PURE__ */ (0,
|
|
14851
|
+
shippingEnabled && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex justify-between text-muted-foreground", children: [
|
|
14852
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("dt", { children: t.shipping }),
|
|
14853
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("dd", { children: shipping == null || !Number.isFinite(shipping) ? t.shippingCalculated : shipping === 0 ? t.freeShipping : formatPrice(shipping, currencyCode, locale) })
|
|
14782
14854
|
] }),
|
|
14783
|
-
/* @__PURE__ */ (0,
|
|
14784
|
-
/* @__PURE__ */ (0,
|
|
14785
|
-
/* @__PURE__ */ (0,
|
|
14855
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex justify-between border-t border-border pt-2 text-base font-bold", children: [
|
|
14856
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("dt", { children: t.total }),
|
|
14857
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("dd", { children: formatPrice(total, currencyCode, locale) })
|
|
14786
14858
|
] })
|
|
14787
14859
|
]
|
|
14788
14860
|
}
|
|
14789
14861
|
);
|
|
14790
14862
|
if (!hasNotice) return breakdown;
|
|
14791
|
-
return /* @__PURE__ */ (0,
|
|
14792
|
-
/* @__PURE__ */ (0,
|
|
14863
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: (0, import_utils16.cn)("space-y-3", className), "data-slot": "cart-summary-wrapper", children: [
|
|
14864
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
14793
14865
|
"div",
|
|
14794
14866
|
{
|
|
14795
14867
|
role: "status",
|
|
@@ -14803,8 +14875,8 @@ function CartSummary({
|
|
|
14803
14875
|
}
|
|
14804
14876
|
|
|
14805
14877
|
// src/components/cart-adjustments-notice.tsx
|
|
14806
|
-
var
|
|
14807
|
-
var
|
|
14878
|
+
var import_utils17 = require("@reblu/site-ui/utils");
|
|
14879
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
14808
14880
|
var DEFAULT_LABELS4 = {
|
|
14809
14881
|
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.`,
|
|
14810
14882
|
quantityChanged: (name, quantity) => `Hemos ajustado la cantidad de ${name} a ${quantity} por el stock disponible.`,
|
|
@@ -14838,20 +14910,20 @@ function CartAdjustmentsNotice({
|
|
|
14838
14910
|
);
|
|
14839
14911
|
}
|
|
14840
14912
|
if (messages.length === 0) return null;
|
|
14841
|
-
return /* @__PURE__ */ (0,
|
|
14913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14842
14914
|
"div",
|
|
14843
14915
|
{
|
|
14844
14916
|
role: "status",
|
|
14845
|
-
className: (0,
|
|
14917
|
+
className: (0, import_utils17.cn)("rounded-lg border border-border bg-muted px-3 py-2 text-sm", className),
|
|
14846
14918
|
"data-slot": "cart-adjustments-notice",
|
|
14847
|
-
children: messages.length === 1 ? /* @__PURE__ */ (0,
|
|
14919
|
+
children: messages.length === 1 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { children: messages[0] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("ul", { className: "list-disc space-y-1 pl-4", children: messages.map((message, index) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("li", { children: message }, index)) })
|
|
14848
14920
|
}
|
|
14849
14921
|
);
|
|
14850
14922
|
}
|
|
14851
14923
|
|
|
14852
14924
|
// src/components/added-to-cart-toast.tsx
|
|
14853
|
-
var
|
|
14854
|
-
var
|
|
14925
|
+
var import_utils18 = require("@reblu/site-ui/utils");
|
|
14926
|
+
var import_jsx_runtime19 = (
|
|
14855
14927
|
// eslint-disable-next-line @next/next/no-img-element -- toast content, not a Next <Image> layout context
|
|
14856
14928
|
require("react/jsx-runtime")
|
|
14857
14929
|
);
|
|
@@ -14874,32 +14946,32 @@ function AddedToCartToast({
|
|
|
14874
14946
|
const message = status === "error" ? t.error : status === "outOfStock" ? t.outOfStock : t.success;
|
|
14875
14947
|
const hasThumbnail = Boolean(imageUrl && imageUrl.trim().length > 0);
|
|
14876
14948
|
const variant = status === "success" ? "success" : "error";
|
|
14877
|
-
return /* @__PURE__ */ (0,
|
|
14949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
14878
14950
|
"div",
|
|
14879
14951
|
{
|
|
14880
14952
|
"data-slot": "added-to-cart-toast",
|
|
14881
14953
|
"data-variant": variant,
|
|
14882
|
-
className: (0,
|
|
14954
|
+
className: (0, import_utils18.cn)(
|
|
14883
14955
|
"flex items-center gap-3 rounded-xl border border-border bg-card p-3 text-sm shadow-lg",
|
|
14884
14956
|
variant === "success" && "border-green-600/30 dark:border-green-400/30",
|
|
14885
14957
|
variant === "error" && "border-destructive/30",
|
|
14886
14958
|
className
|
|
14887
14959
|
),
|
|
14888
14960
|
children: [
|
|
14889
|
-
hasThumbnail && /* @__PURE__ */ (0,
|
|
14890
|
-
/* @__PURE__ */ (0,
|
|
14891
|
-
/* @__PURE__ */ (0,
|
|
14892
|
-
/* @__PURE__ */ (0,
|
|
14961
|
+
hasThumbnail && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("img", { src: imageUrl, alt: productName, className: "h-10 w-10 flex-shrink-0 rounded-lg object-cover" }),
|
|
14962
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
14963
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "truncate font-semibold text-foreground", children: productName }),
|
|
14964
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "truncate text-muted-foreground", children: quantity && quantity > 1 ? `${message} \xB7 x${quantity}` : message })
|
|
14893
14965
|
] }),
|
|
14894
|
-
/* @__PURE__ */ (0,
|
|
14966
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("a", { href: cartHref, className: "text-sm font-semibold text-primary underline-offset-2 hover:underline", children: t.viewCart }) })
|
|
14895
14967
|
]
|
|
14896
14968
|
}
|
|
14897
14969
|
);
|
|
14898
14970
|
}
|
|
14899
14971
|
|
|
14900
14972
|
// src/components/checkout-login-prompt.tsx
|
|
14901
|
-
var
|
|
14902
|
-
var
|
|
14973
|
+
var import_utils19 = require("@reblu/site-ui/utils");
|
|
14974
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
14903
14975
|
var DEFAULT_LABELS6 = {
|
|
14904
14976
|
title: "Identificaci\xF3n",
|
|
14905
14977
|
description: "Introduce tu email para agilizar el proceso o contin\xFAa como invitado.",
|
|
@@ -14926,39 +14998,39 @@ function CheckoutLoginPrompt({
|
|
|
14926
14998
|
if (!open) return null;
|
|
14927
14999
|
const t = { ...DEFAULT_LABELS6, ...labels };
|
|
14928
15000
|
const isValidEmail = EMAIL_PATTERN.test(email.trim());
|
|
14929
|
-
return /* @__PURE__ */ (0,
|
|
14930
|
-
/* @__PURE__ */ (0,
|
|
14931
|
-
/* @__PURE__ */ (0,
|
|
15001
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
15002
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "fixed inset-0 z-50 bg-black/50", onClick: onClose, "aria-hidden": "true" }),
|
|
15003
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
14932
15004
|
"div",
|
|
14933
15005
|
{
|
|
14934
15006
|
role: "dialog",
|
|
14935
15007
|
"aria-modal": "true",
|
|
14936
15008
|
"aria-labelledby": "checkout-login-prompt-title",
|
|
14937
15009
|
"data-slot": "checkout-login-prompt",
|
|
14938
|
-
className: (0,
|
|
15010
|
+
className: (0, import_utils19.cn)(
|
|
14939
15011
|
"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",
|
|
14940
15012
|
className
|
|
14941
15013
|
),
|
|
14942
15014
|
children: [
|
|
14943
|
-
/* @__PURE__ */ (0,
|
|
14944
|
-
/* @__PURE__ */ (0,
|
|
14945
|
-
/* @__PURE__ */ (0,
|
|
14946
|
-
/* @__PURE__ */ (0,
|
|
15015
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|
|
15016
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { children: [
|
|
15017
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h2", { id: "checkout-login-prompt-title", className: "text-xl font-bold", children: t.title }),
|
|
15018
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "mt-1 text-sm text-muted-foreground", children: t.description })
|
|
14947
15019
|
] }),
|
|
14948
|
-
/* @__PURE__ */ (0,
|
|
15020
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
14949
15021
|
"button",
|
|
14950
15022
|
{
|
|
14951
15023
|
type: "button",
|
|
14952
15024
|
onClick: onClose,
|
|
14953
15025
|
"aria-label": t.close,
|
|
14954
|
-
className: "flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
|
|
15026
|
+
className: "flex h-8 w-8 flex-shrink-0 cursor-pointer items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
|
|
14955
15027
|
children: "\u2715"
|
|
14956
15028
|
}
|
|
14957
15029
|
)
|
|
14958
15030
|
] }),
|
|
14959
|
-
/* @__PURE__ */ (0,
|
|
14960
|
-
/* @__PURE__ */ (0,
|
|
14961
|
-
/* @__PURE__ */ (0,
|
|
15031
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "space-y-2", children: [
|
|
15032
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("label", { htmlFor: "checkout-login-prompt-email", className: "text-sm font-medium", children: t.emailLabel }),
|
|
15033
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
14962
15034
|
"input",
|
|
14963
15035
|
{
|
|
14964
15036
|
id: "checkout-login-prompt-email",
|
|
@@ -14967,34 +15039,34 @@ function CheckoutLoginPrompt({
|
|
|
14967
15039
|
value: email,
|
|
14968
15040
|
onChange: (e) => onEmailChange(e.target.value),
|
|
14969
15041
|
placeholder: t.emailPlaceholder,
|
|
14970
|
-
className: (0,
|
|
15042
|
+
className: (0, import_utils19.cn)(
|
|
14971
15043
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
14972
15044
|
error ? "border-destructive" : "border-border focus:border-primary"
|
|
14973
15045
|
)
|
|
14974
15046
|
}
|
|
14975
15047
|
),
|
|
14976
|
-
error && /* @__PURE__ */ (0,
|
|
15048
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-xs text-destructive", children: error })
|
|
14977
15049
|
] }),
|
|
14978
|
-
/* @__PURE__ */ (0,
|
|
14979
|
-
/* @__PURE__ */ (0,
|
|
15050
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "space-y-2", children: [
|
|
15051
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
14980
15052
|
"button",
|
|
14981
15053
|
{
|
|
14982
15054
|
type: "button",
|
|
14983
15055
|
onClick: onSubmitEmail,
|
|
14984
15056
|
disabled: checking || !isValidEmail,
|
|
14985
|
-
className: (0,
|
|
14986
|
-
"flex w-full items-center justify-center gap-2 rounded-xl px-4 py-2.5 text-sm font-semibold transition-all",
|
|
15057
|
+
className: (0, import_utils19.cn)(
|
|
15058
|
+
"flex w-full cursor-pointer items-center justify-center gap-2 rounded-xl px-4 py-2.5 text-sm font-semibold transition-all",
|
|
14987
15059
|
checking || !isValidEmail ? "cursor-not-allowed bg-muted text-muted-foreground" : "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
14988
15060
|
),
|
|
14989
15061
|
children: checking ? t.checking : t.continueWithEmail
|
|
14990
15062
|
}
|
|
14991
15063
|
),
|
|
14992
|
-
/* @__PURE__ */ (0,
|
|
15064
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
14993
15065
|
"button",
|
|
14994
15066
|
{
|
|
14995
15067
|
type: "button",
|
|
14996
15068
|
onClick: onContinueAsGuest,
|
|
14997
|
-
className: "flex w-full items-center justify-center gap-2 rounded-xl bg-muted px-4 py-2.5 text-sm font-semibold text-muted-foreground transition-colors hover:bg-muted/70",
|
|
15069
|
+
className: "flex w-full cursor-pointer items-center justify-center gap-2 rounded-xl bg-muted px-4 py-2.5 text-sm font-semibold text-muted-foreground transition-colors hover:bg-muted/70",
|
|
14998
15070
|
children: t.continueAsGuest
|
|
14999
15071
|
}
|
|
15000
15072
|
)
|
|
@@ -15006,9 +15078,9 @@ function CheckoutLoginPrompt({
|
|
|
15006
15078
|
}
|
|
15007
15079
|
|
|
15008
15080
|
// src/components/checkout-form.tsx
|
|
15009
|
-
var
|
|
15081
|
+
var import_utils20 = require("@reblu/site-ui/utils");
|
|
15010
15082
|
var import_phone_input = require("@reblu/site-ui/phone-input");
|
|
15011
|
-
var
|
|
15083
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
15012
15084
|
var DEFAULT_LABELS7 = {
|
|
15013
15085
|
contactTitle: "Datos de contacto",
|
|
15014
15086
|
nameLabel: "Nombre completo",
|
|
@@ -15062,22 +15134,22 @@ function CheckoutForm({
|
|
|
15062
15134
|
event.preventDefault();
|
|
15063
15135
|
if (discountCode.trim() && !discountApplying) onApplyDiscount();
|
|
15064
15136
|
}
|
|
15065
|
-
return /* @__PURE__ */ (0,
|
|
15137
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
15066
15138
|
loginPrompt,
|
|
15067
|
-
/* @__PURE__ */ (0,
|
|
15139
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
15068
15140
|
"form",
|
|
15069
15141
|
{
|
|
15070
15142
|
"data-testid": "checkout-form",
|
|
15071
15143
|
onSubmit,
|
|
15072
|
-
className: (0,
|
|
15144
|
+
className: (0, import_utils20.cn)("space-y-8", className),
|
|
15073
15145
|
"data-slot": "checkout-form",
|
|
15074
15146
|
children: [
|
|
15075
|
-
/* @__PURE__ */ (0,
|
|
15076
|
-
/* @__PURE__ */ (0,
|
|
15077
|
-
/* @__PURE__ */ (0,
|
|
15078
|
-
/* @__PURE__ */ (0,
|
|
15079
|
-
/* @__PURE__ */ (0,
|
|
15080
|
-
/* @__PURE__ */ (0,
|
|
15147
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("section", { className: "space-y-4", children: [
|
|
15148
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h2", { className: "border-b border-border pb-2 text-lg font-semibold", children: t.contactTitle }),
|
|
15149
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
|
|
15150
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "space-y-1", children: [
|
|
15151
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", { htmlFor: "checkout-form-name", className: "text-sm font-medium", children: t.nameLabel }),
|
|
15152
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
15081
15153
|
"input",
|
|
15082
15154
|
{
|
|
15083
15155
|
id: "checkout-form-name",
|
|
@@ -15086,17 +15158,17 @@ function CheckoutForm({
|
|
|
15086
15158
|
value: contact.name,
|
|
15087
15159
|
onChange: (e) => patchContact({ name: e.target.value }),
|
|
15088
15160
|
placeholder: t.namePlaceholder,
|
|
15089
|
-
className: (0,
|
|
15161
|
+
className: (0, import_utils20.cn)(
|
|
15090
15162
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
15091
15163
|
contactErrors?.name ? "border-destructive" : "border-border focus:border-primary"
|
|
15092
15164
|
)
|
|
15093
15165
|
}
|
|
15094
15166
|
),
|
|
15095
|
-
contactErrors?.name && /* @__PURE__ */ (0,
|
|
15167
|
+
contactErrors?.name && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-xs text-destructive", children: contactErrors.name })
|
|
15096
15168
|
] }),
|
|
15097
|
-
/* @__PURE__ */ (0,
|
|
15098
|
-
/* @__PURE__ */ (0,
|
|
15099
|
-
/* @__PURE__ */ (0,
|
|
15169
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "space-y-1", children: [
|
|
15170
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", { htmlFor: "checkout-form-email", className: "text-sm font-medium", children: t.emailLabel }),
|
|
15171
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
15100
15172
|
"input",
|
|
15101
15173
|
{
|
|
15102
15174
|
id: "checkout-form-email",
|
|
@@ -15105,15 +15177,15 @@ function CheckoutForm({
|
|
|
15105
15177
|
value: contact.email,
|
|
15106
15178
|
onChange: (e) => patchContact({ email: e.target.value }),
|
|
15107
15179
|
placeholder: t.emailPlaceholder,
|
|
15108
|
-
className: (0,
|
|
15180
|
+
className: (0, import_utils20.cn)(
|
|
15109
15181
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
15110
15182
|
contactErrors?.email ? "border-destructive" : "border-border focus:border-primary"
|
|
15111
15183
|
)
|
|
15112
15184
|
}
|
|
15113
15185
|
),
|
|
15114
|
-
contactErrors?.email && /* @__PURE__ */ (0,
|
|
15186
|
+
contactErrors?.email && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-xs text-destructive", children: contactErrors.email })
|
|
15115
15187
|
] }),
|
|
15116
|
-
/* @__PURE__ */ (0,
|
|
15188
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
15117
15189
|
import_phone_input.PhoneInput,
|
|
15118
15190
|
{
|
|
15119
15191
|
id: "checkout-form-phone",
|
|
@@ -15127,27 +15199,27 @@ function CheckoutForm({
|
|
|
15127
15199
|
] })
|
|
15128
15200
|
] }),
|
|
15129
15201
|
children2,
|
|
15130
|
-
generalError ? /* @__PURE__ */ (0,
|
|
15131
|
-
/* @__PURE__ */ (0,
|
|
15132
|
-
/* @__PURE__ */ (0,
|
|
15133
|
-
appliedDiscount ? /* @__PURE__ */ (0,
|
|
15134
|
-
/* @__PURE__ */ (0,
|
|
15135
|
-
/* @__PURE__ */ (0,
|
|
15136
|
-
/* @__PURE__ */ (0,
|
|
15202
|
+
generalError ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { role: "alert", className: "text-sm text-destructive", children: generalError }) : null,
|
|
15203
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("section", { className: "space-y-3", children: [
|
|
15204
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h2", { className: "border-b border-border pb-2 text-lg font-semibold", children: t.discountTitle }),
|
|
15205
|
+
appliedDiscount ? /* @__PURE__ */ (0, import_jsx_runtime21.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: [
|
|
15206
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-2 text-sm text-green-700 dark:text-green-400", children: [
|
|
15207
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "font-semibold", children: appliedDiscount.code }),
|
|
15208
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: t.discountAppliedSuffix(formatPrice(appliedDiscount.amount, currencyCode, locale)) })
|
|
15137
15209
|
] }),
|
|
15138
|
-
/* @__PURE__ */ (0,
|
|
15210
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
15139
15211
|
"button",
|
|
15140
15212
|
{
|
|
15141
15213
|
type: "button",
|
|
15142
15214
|
onClick: onRemoveDiscount,
|
|
15143
15215
|
"aria-label": t.removeDiscount,
|
|
15144
|
-
className: "text-green-600 transition-colors hover:text-green-800 dark:text-green-400 dark:hover:text-green-200",
|
|
15216
|
+
className: "cursor-pointer text-green-600 transition-colors hover:text-green-800 dark:text-green-400 dark:hover:text-green-200",
|
|
15145
15217
|
children: t.removeDiscount
|
|
15146
15218
|
}
|
|
15147
15219
|
)
|
|
15148
|
-
] }) : /* @__PURE__ */ (0,
|
|
15149
|
-
/* @__PURE__ */ (0,
|
|
15150
|
-
/* @__PURE__ */ (0,
|
|
15220
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex gap-2", children: [
|
|
15221
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", { htmlFor: "checkout-form-discount-code", className: "sr-only", children: t.discountTitle }),
|
|
15222
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
15151
15223
|
"input",
|
|
15152
15224
|
{
|
|
15153
15225
|
id: "checkout-form-discount-code",
|
|
@@ -15159,26 +15231,26 @@ function CheckoutForm({
|
|
|
15159
15231
|
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"
|
|
15160
15232
|
}
|
|
15161
15233
|
),
|
|
15162
|
-
/* @__PURE__ */ (0,
|
|
15234
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
15163
15235
|
"button",
|
|
15164
15236
|
{
|
|
15165
15237
|
type: "button",
|
|
15166
15238
|
onClick: onApplyDiscount,
|
|
15167
15239
|
disabled: !discountCode.trim() || discountApplying,
|
|
15168
|
-
className: "rounded-lg bg-muted px-4 py-2 text-sm font-medium text-foreground transition hover:bg-muted/70 disabled:cursor-not-allowed disabled:opacity-50",
|
|
15240
|
+
className: "cursor-pointer rounded-lg bg-muted px-4 py-2 text-sm font-medium text-foreground transition hover:bg-muted/70 disabled:cursor-not-allowed disabled:opacity-50",
|
|
15169
15241
|
children: discountApplying ? t.applyingDiscount : t.applyDiscount
|
|
15170
15242
|
}
|
|
15171
15243
|
)
|
|
15172
15244
|
] }),
|
|
15173
|
-
discountError && /* @__PURE__ */ (0,
|
|
15245
|
+
discountError && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-xs text-destructive", children: discountError })
|
|
15174
15246
|
] }),
|
|
15175
|
-
/* @__PURE__ */ (0,
|
|
15247
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
15176
15248
|
"button",
|
|
15177
15249
|
{
|
|
15178
15250
|
type: "submit",
|
|
15179
15251
|
disabled: submitting || submitDisabled,
|
|
15180
|
-
className: (0,
|
|
15181
|
-
"flex w-full items-center justify-center gap-2 rounded-xl px-4 py-3 font-semibold transition-all",
|
|
15252
|
+
className: (0, import_utils20.cn)(
|
|
15253
|
+
"flex w-full cursor-pointer items-center justify-center gap-2 rounded-xl px-4 py-3 font-semibold transition-all",
|
|
15182
15254
|
submitting || submitDisabled ? "cursor-not-allowed bg-muted text-muted-foreground" : "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
15183
15255
|
),
|
|
15184
15256
|
children: submitting ? t.submitting : t.submit
|
|
@@ -15191,11 +15263,11 @@ function CheckoutForm({
|
|
|
15191
15263
|
}
|
|
15192
15264
|
|
|
15193
15265
|
// src/components/order-confirmation.tsx
|
|
15194
|
-
var
|
|
15266
|
+
var import_utils22 = require("@reblu/site-ui/utils");
|
|
15195
15267
|
|
|
15196
15268
|
// src/components/order-invoice-link.tsx
|
|
15197
|
-
var
|
|
15198
|
-
var
|
|
15269
|
+
var import_utils21 = require("@reblu/site-ui/utils");
|
|
15270
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
15199
15271
|
var DEFAULT_LABELS8 = {
|
|
15200
15272
|
linkLabel: "Descargar la factura {number}",
|
|
15201
15273
|
signInHint: "Te pediremos que inicies sesi\xF3n para abrirla."
|
|
@@ -15203,8 +15275,8 @@ var DEFAULT_LABELS8 = {
|
|
|
15203
15275
|
function OrderInvoiceLink({ invoice, labels, className }) {
|
|
15204
15276
|
if (!invoice) return null;
|
|
15205
15277
|
const t = { ...DEFAULT_LABELS8, ...labels };
|
|
15206
|
-
return /* @__PURE__ */ (0,
|
|
15207
|
-
/* @__PURE__ */ (0,
|
|
15278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: (0, import_utils21.cn)("space-y-1 text-sm", className), "data-slot": "order-invoice-link", children: [
|
|
15279
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15208
15280
|
"a",
|
|
15209
15281
|
{
|
|
15210
15282
|
href: invoice.url,
|
|
@@ -15212,12 +15284,12 @@ function OrderInvoiceLink({ invoice, labels, className }) {
|
|
|
15212
15284
|
children: t.linkLabel.replace("{number}", invoice.number)
|
|
15213
15285
|
}
|
|
15214
15286
|
),
|
|
15215
|
-
/* @__PURE__ */ (0,
|
|
15287
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-muted-foreground", children: t.signInHint })
|
|
15216
15288
|
] });
|
|
15217
15289
|
}
|
|
15218
15290
|
|
|
15219
15291
|
// src/components/order-confirmation.tsx
|
|
15220
|
-
var
|
|
15292
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
15221
15293
|
var DEFAULT_LABELS9 = {
|
|
15222
15294
|
pollingTitle: "Confirmando tu pedido\u2026",
|
|
15223
15295
|
pollingDescription: "Estamos procesando el pago, un momento\u2026",
|
|
@@ -15281,43 +15353,43 @@ function OrderConfirmation({
|
|
|
15281
15353
|
const showOrderReference = Boolean(order) && !showFullOrderSummary && (status === "refunded" || status === "partially_refunded" || status === "pending_timeout");
|
|
15282
15354
|
const showSessionReference = !order && sessionId && (status === "timeout" || status === "not_found" || status === "pending_timeout");
|
|
15283
15355
|
const showRecheck = (status === "pending_timeout" || status === "error") && onRecheck;
|
|
15284
|
-
return /* @__PURE__ */ (0,
|
|
15285
|
-
/* @__PURE__ */ (0,
|
|
15286
|
-
/* @__PURE__ */ (0,
|
|
15287
|
-
showFullOrderSummary && order && /* @__PURE__ */ (0,
|
|
15288
|
-
/* @__PURE__ */ (0,
|
|
15289
|
-
/* @__PURE__ */ (0,
|
|
15290
|
-
/* @__PURE__ */ (0,
|
|
15356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: (0, import_utils22.cn)("space-y-6 text-center", className), "data-slot": "order-confirmation", children: [
|
|
15357
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("h1", { className: "text-3xl font-bold", children: title }),
|
|
15358
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-lg text-muted-foreground", children: description }),
|
|
15359
|
+
showFullOrderSummary && order && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "space-y-6", children: [
|
|
15360
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
15361
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.orderNumberLabel }),
|
|
15362
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "font-mono text-lg font-semibold", children: order.orderNumber })
|
|
15291
15363
|
] }),
|
|
15292
|
-
/* @__PURE__ */ (0,
|
|
15293
|
-
order.items.map((item, idx) => /* @__PURE__ */ (0,
|
|
15364
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "mx-auto max-w-sm space-y-3 rounded-xl border border-border bg-card p-5 text-left", children: [
|
|
15365
|
+
order.items.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
15294
15366
|
"div",
|
|
15295
15367
|
{
|
|
15296
15368
|
className: "flex justify-between gap-4 text-sm",
|
|
15297
15369
|
children: [
|
|
15298
|
-
/* @__PURE__ */ (0,
|
|
15370
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "max-w-[60%] truncate text-muted-foreground", children: [
|
|
15299
15371
|
item.product.name,
|
|
15300
15372
|
item.variant ? ` (${item.variant.name})` : "",
|
|
15301
15373
|
" x",
|
|
15302
15374
|
item.quantity
|
|
15303
15375
|
] }),
|
|
15304
|
-
/* @__PURE__ */ (0,
|
|
15376
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: formatPrice(item.total, currencyCode, locale) })
|
|
15305
15377
|
]
|
|
15306
15378
|
},
|
|
15307
15379
|
idx
|
|
15308
15380
|
)),
|
|
15309
|
-
/* @__PURE__ */ (0,
|
|
15310
|
-
/* @__PURE__ */ (0,
|
|
15311
|
-
/* @__PURE__ */ (0,
|
|
15381
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "space-y-1 border-t border-border pt-3 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex justify-between pt-1 text-base font-bold", children: [
|
|
15382
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: t.totalLabel }),
|
|
15383
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: formatPrice(order.total, currencyCode, locale) })
|
|
15312
15384
|
] }) })
|
|
15313
15385
|
] }),
|
|
15314
|
-
/* @__PURE__ */ (0,
|
|
15386
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("p", { className: "mx-auto max-w-sm text-sm text-muted-foreground", children: [
|
|
15315
15387
|
t.confirmationEmailPrefix,
|
|
15316
15388
|
" ",
|
|
15317
|
-
/* @__PURE__ */ (0,
|
|
15389
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "font-medium text-foreground", children: order.customerEmail }),
|
|
15318
15390
|
"."
|
|
15319
15391
|
] }),
|
|
15320
|
-
/* @__PURE__ */ (0,
|
|
15392
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15321
15393
|
OrderInvoiceLink,
|
|
15322
15394
|
{
|
|
15323
15395
|
invoice: order.invoice,
|
|
@@ -15325,11 +15397,11 @@ function OrderConfirmation({
|
|
|
15325
15397
|
}
|
|
15326
15398
|
)
|
|
15327
15399
|
] }),
|
|
15328
|
-
showOrderReference && order && /* @__PURE__ */ (0,
|
|
15329
|
-
/* @__PURE__ */ (0,
|
|
15330
|
-
/* @__PURE__ */ (0,
|
|
15400
|
+
showOrderReference && order && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
15401
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.orderReferenceLabel }),
|
|
15402
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "font-mono text-lg font-semibold", children: order.orderNumber })
|
|
15331
15403
|
] }),
|
|
15332
|
-
status === "failed" && cartHref && /* @__PURE__ */ (0,
|
|
15404
|
+
status === "failed" && cartHref && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15333
15405
|
"a",
|
|
15334
15406
|
{
|
|
15335
15407
|
href: cartHref,
|
|
@@ -15337,25 +15409,25 @@ function OrderConfirmation({
|
|
|
15337
15409
|
children: t.backToCartLabel
|
|
15338
15410
|
}
|
|
15339
15411
|
),
|
|
15340
|
-
showRecheck && /* @__PURE__ */ (0,
|
|
15412
|
+
showRecheck && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15341
15413
|
"button",
|
|
15342
15414
|
{
|
|
15343
15415
|
type: "button",
|
|
15344
15416
|
onClick: onRecheck,
|
|
15345
|
-
className: "inline-flex items-center justify-center rounded-xl bg-primary px-4 py-2.5 text-sm font-semibold text-primary-foreground transition-colors hover:bg-primary/90",
|
|
15417
|
+
className: "inline-flex cursor-pointer items-center justify-center rounded-xl bg-primary px-4 py-2.5 text-sm font-semibold text-primary-foreground transition-colors hover:bg-primary/90",
|
|
15346
15418
|
children: t.recheckLabel
|
|
15347
15419
|
}
|
|
15348
15420
|
),
|
|
15349
|
-
showSessionReference && /* @__PURE__ */ (0,
|
|
15350
|
-
/* @__PURE__ */ (0,
|
|
15351
|
-
/* @__PURE__ */ (0,
|
|
15421
|
+
showSessionReference && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
15422
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.sessionReferenceLabel }),
|
|
15423
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "break-all font-mono text-sm font-semibold", children: sessionId })
|
|
15352
15424
|
] })
|
|
15353
15425
|
] });
|
|
15354
15426
|
}
|
|
15355
15427
|
|
|
15356
15428
|
// src/components/full-invoice-fields.tsx
|
|
15357
|
-
var
|
|
15358
|
-
var
|
|
15429
|
+
var import_utils23 = require("@reblu/site-ui/utils");
|
|
15430
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
15359
15431
|
var EMPTY_FULL_INVOICE_VALUE = {
|
|
15360
15432
|
wantsFullInvoice: false,
|
|
15361
15433
|
billingIdType: "NIF",
|
|
@@ -15472,12 +15544,12 @@ function FullInvoiceFields({
|
|
|
15472
15544
|
const showFields = value.wantsFullInvoice || overCap;
|
|
15473
15545
|
const isSpanishNif = value.billingIdType === "NIF";
|
|
15474
15546
|
const set = (key2, next2) => onChange({ ...value, [key2]: next2 });
|
|
15475
|
-
const error = (key2) => errors[key2] ? /* @__PURE__ */ (0,
|
|
15547
|
+
const error = (key2) => errors[key2] ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { id: `full-invoice-${key2}-error`, className: "text-sm text-destructive", children: errors[key2] }) : null;
|
|
15476
15548
|
const invalid2 = (key2) => errors[key2] ? { "aria-invalid": true, "aria-describedby": `full-invoice-${key2}-error` } : {};
|
|
15477
|
-
return /* @__PURE__ */ (0,
|
|
15478
|
-
overCap ? /* @__PURE__ */ (0,
|
|
15479
|
-
/* @__PURE__ */ (0,
|
|
15480
|
-
/* @__PURE__ */ (0,
|
|
15549
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("section", { className: (0, import_utils23.cn)("space-y-4", className), "data-slot": "full-invoice-fields", children: [
|
|
15550
|
+
overCap ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { role: "note", className: "rounded-lg border border-border p-4 text-sm", children: t.overCapNotice }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "space-y-1", children: [
|
|
15551
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { className: "flex items-center gap-2 text-sm font-medium", children: [
|
|
15552
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15481
15553
|
"input",
|
|
15482
15554
|
{
|
|
15483
15555
|
type: "checkbox",
|
|
@@ -15487,12 +15559,12 @@ function FullInvoiceFields({
|
|
|
15487
15559
|
),
|
|
15488
15560
|
t.toggle
|
|
15489
15561
|
] }),
|
|
15490
|
-
/* @__PURE__ */ (0,
|
|
15562
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-sm text-muted-foreground", children: t.underCapNotice })
|
|
15491
15563
|
] }),
|
|
15492
|
-
showFields && /* @__PURE__ */ (0,
|
|
15493
|
-
/* @__PURE__ */ (0,
|
|
15494
|
-
/* @__PURE__ */ (0,
|
|
15495
|
-
/* @__PURE__ */ (0,
|
|
15564
|
+
showFields && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
|
|
15565
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "space-y-1", children: [
|
|
15566
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("label", { htmlFor: "full-invoice-id-type", className: "text-sm font-medium", children: t.idType }),
|
|
15567
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15496
15568
|
"select",
|
|
15497
15569
|
{
|
|
15498
15570
|
id: "full-invoice-id-type",
|
|
@@ -15501,14 +15573,14 @@ function FullInvoiceFields({
|
|
|
15501
15573
|
value: value.billingIdType,
|
|
15502
15574
|
onChange: (e) => set("billingIdType", e.target.value),
|
|
15503
15575
|
...invalid2("billingIdType"),
|
|
15504
|
-
children: ID_TYPES.map((type) => /* @__PURE__ */ (0,
|
|
15576
|
+
children: ID_TYPES.map((type) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: type, children: t.idTypeOptions[type] }, type))
|
|
15505
15577
|
}
|
|
15506
15578
|
),
|
|
15507
15579
|
error("billingIdType")
|
|
15508
15580
|
] }),
|
|
15509
|
-
!isSpanishNif && /* @__PURE__ */ (0,
|
|
15510
|
-
/* @__PURE__ */ (0,
|
|
15511
|
-
/* @__PURE__ */ (0,
|
|
15581
|
+
!isSpanishNif && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "space-y-1", children: [
|
|
15582
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("label", { htmlFor: "full-invoice-id-country", className: "text-sm font-medium", children: t.idCountry }),
|
|
15583
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
15512
15584
|
"select",
|
|
15513
15585
|
{
|
|
15514
15586
|
id: "full-invoice-id-country",
|
|
@@ -15518,16 +15590,16 @@ function FullInvoiceFields({
|
|
|
15518
15590
|
onChange: (e) => set("billingIdCountry", e.target.value),
|
|
15519
15591
|
...invalid2("billingIdCountry"),
|
|
15520
15592
|
children: [
|
|
15521
|
-
/* @__PURE__ */ (0,
|
|
15522
|
-
countries.map((c) => /* @__PURE__ */ (0,
|
|
15593
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "", disabled: true, children: t.chooseCountry }),
|
|
15594
|
+
countries.map((c) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: c.code, children: c.name }, c.code))
|
|
15523
15595
|
]
|
|
15524
15596
|
}
|
|
15525
15597
|
),
|
|
15526
15598
|
error("billingIdCountry")
|
|
15527
15599
|
] }),
|
|
15528
|
-
/* @__PURE__ */ (0,
|
|
15529
|
-
/* @__PURE__ */ (0,
|
|
15530
|
-
/* @__PURE__ */ (0,
|
|
15600
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "space-y-1", children: [
|
|
15601
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("label", { htmlFor: "full-invoice-nif", className: "text-sm font-medium", children: isSpanishNif ? t.spanishNif : t.documentNumber }),
|
|
15602
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15531
15603
|
"input",
|
|
15532
15604
|
{
|
|
15533
15605
|
id: "full-invoice-nif",
|
|
@@ -15540,9 +15612,9 @@ function FullInvoiceFields({
|
|
|
15540
15612
|
),
|
|
15541
15613
|
error("billingNif")
|
|
15542
15614
|
] }),
|
|
15543
|
-
/* @__PURE__ */ (0,
|
|
15544
|
-
/* @__PURE__ */ (0,
|
|
15545
|
-
/* @__PURE__ */ (0,
|
|
15615
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "space-y-1", children: [
|
|
15616
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("label", { htmlFor: "full-invoice-name", className: "text-sm font-medium", children: t.name }),
|
|
15617
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15546
15618
|
"input",
|
|
15547
15619
|
{
|
|
15548
15620
|
id: "full-invoice-name",
|
|
@@ -15555,9 +15627,9 @@ function FullInvoiceFields({
|
|
|
15555
15627
|
),
|
|
15556
15628
|
error("billingName")
|
|
15557
15629
|
] }),
|
|
15558
|
-
/* @__PURE__ */ (0,
|
|
15559
|
-
/* @__PURE__ */ (0,
|
|
15560
|
-
/* @__PURE__ */ (0,
|
|
15630
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "space-y-1 sm:col-span-2", children: [
|
|
15631
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("label", { htmlFor: "full-invoice-street", className: "text-sm font-medium", children: t.street }),
|
|
15632
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15561
15633
|
"input",
|
|
15562
15634
|
{
|
|
15563
15635
|
id: "full-invoice-street",
|
|
@@ -15569,9 +15641,9 @@ function FullInvoiceFields({
|
|
|
15569
15641
|
}
|
|
15570
15642
|
)
|
|
15571
15643
|
] }),
|
|
15572
|
-
/* @__PURE__ */ (0,
|
|
15573
|
-
/* @__PURE__ */ (0,
|
|
15574
|
-
/* @__PURE__ */ (0,
|
|
15644
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "space-y-1", children: [
|
|
15645
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("label", { htmlFor: "full-invoice-postal-code", className: "text-sm font-medium", children: t.postalCode }),
|
|
15646
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15575
15647
|
"input",
|
|
15576
15648
|
{
|
|
15577
15649
|
id: "full-invoice-postal-code",
|
|
@@ -15582,9 +15654,9 @@ function FullInvoiceFields({
|
|
|
15582
15654
|
}
|
|
15583
15655
|
)
|
|
15584
15656
|
] }),
|
|
15585
|
-
/* @__PURE__ */ (0,
|
|
15586
|
-
/* @__PURE__ */ (0,
|
|
15587
|
-
/* @__PURE__ */ (0,
|
|
15657
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "space-y-1", children: [
|
|
15658
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("label", { htmlFor: "full-invoice-city", className: "text-sm font-medium", children: t.city }),
|
|
15659
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15588
15660
|
"input",
|
|
15589
15661
|
{
|
|
15590
15662
|
id: "full-invoice-city",
|
|
@@ -15595,9 +15667,9 @@ function FullInvoiceFields({
|
|
|
15595
15667
|
}
|
|
15596
15668
|
)
|
|
15597
15669
|
] }),
|
|
15598
|
-
/* @__PURE__ */ (0,
|
|
15599
|
-
/* @__PURE__ */ (0,
|
|
15600
|
-
/* @__PURE__ */ (0,
|
|
15670
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "space-y-1", children: [
|
|
15671
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("label", { htmlFor: "full-invoice-country", className: "text-sm font-medium", children: t.country }),
|
|
15672
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15601
15673
|
"select",
|
|
15602
15674
|
{
|
|
15603
15675
|
id: "full-invoice-country",
|
|
@@ -15605,11 +15677,11 @@ function FullInvoiceFields({
|
|
|
15605
15677
|
required: true,
|
|
15606
15678
|
value: value.country,
|
|
15607
15679
|
onChange: (e) => set("country", e.target.value),
|
|
15608
|
-
children: countries.map((c) => /* @__PURE__ */ (0,
|
|
15680
|
+
children: countries.map((c) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: c.code, children: c.name }, c.code))
|
|
15609
15681
|
}
|
|
15610
15682
|
)
|
|
15611
15683
|
] }),
|
|
15612
|
-
/* @__PURE__ */ (0,
|
|
15684
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "sm:col-span-2", children: error("address") })
|
|
15613
15685
|
] })
|
|
15614
15686
|
] });
|
|
15615
15687
|
}
|
|
@@ -15645,6 +15717,7 @@ var import_site_contracts = require("@reblu/site-contracts");
|
|
|
15645
15717
|
ParentPage,
|
|
15646
15718
|
ProductCard,
|
|
15647
15719
|
ProductTrustItems,
|
|
15720
|
+
ProfessionalFields,
|
|
15648
15721
|
ProfileCard,
|
|
15649
15722
|
SafeHtml,
|
|
15650
15723
|
ShopFilters,
|