@reblu/site-blocks 0.18.0 → 0.20.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 +33 -0
- package/README.md +179 -2
- package/dist/_heading-BsNbc1wc.d.cts +4 -0
- package/dist/_heading-BsNbc1wc.d.ts +4 -0
- package/dist/client.cjs +449 -50
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +109 -2
- package/dist/client.d.ts +109 -2
- package/dist/client.js +446 -51
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +374 -309
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +51 -8
- package/dist/index.d.ts +51 -8
- package/dist/index.js +373 -309
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -13637,34 +13637,82 @@ function ParentPage({
|
|
|
13637
13637
|
var Specialty = ParentPage;
|
|
13638
13638
|
|
|
13639
13639
|
// src/components/profile-card.tsx
|
|
13640
|
+
import { cn as cn7 } from "@reblu/site-ui/utils";
|
|
13641
|
+
|
|
13642
|
+
// src/components/professional-fields.tsx
|
|
13640
13643
|
import { cn as cn6 } from "@reblu/site-ui/utils";
|
|
13641
13644
|
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
13645
|
+
function ProfessionalFields({
|
|
13646
|
+
fields,
|
|
13647
|
+
variant = "profile",
|
|
13648
|
+
className
|
|
13649
|
+
}) {
|
|
13650
|
+
const shown = (fields ?? []).filter((f) => variant !== "card" || f.showOnCard);
|
|
13651
|
+
if (shown.length === 0) return null;
|
|
13652
|
+
return /* @__PURE__ */ jsx7(
|
|
13653
|
+
"dl",
|
|
13654
|
+
{
|
|
13655
|
+
className: cn6(
|
|
13656
|
+
"grid gap-x-3 gap-y-1 text-sm",
|
|
13657
|
+
variant === "card" ? "justify-center" : "grid-cols-[auto_1fr]",
|
|
13658
|
+
className
|
|
13659
|
+
),
|
|
13660
|
+
"data-slot": "professional-fields",
|
|
13661
|
+
"data-variant": variant,
|
|
13662
|
+
children: shown.map((field, index) => /* @__PURE__ */ jsxs7(
|
|
13663
|
+
"div",
|
|
13664
|
+
{
|
|
13665
|
+
className: variant === "card" ? "flex justify-center gap-1" : "contents",
|
|
13666
|
+
children: [
|
|
13667
|
+
/* @__PURE__ */ jsx7("dt", { className: "text-muted-foreground", children: field.label }),
|
|
13668
|
+
/* @__PURE__ */ jsx7("dd", { className: "m-0 font-medium", children: field.value })
|
|
13669
|
+
]
|
|
13670
|
+
},
|
|
13671
|
+
`${field.label}-${index}`
|
|
13672
|
+
))
|
|
13673
|
+
}
|
|
13674
|
+
);
|
|
13675
|
+
}
|
|
13676
|
+
|
|
13677
|
+
// src/components/profile-card.tsx
|
|
13678
|
+
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
13642
13679
|
function initials(name) {
|
|
13643
13680
|
return name.split(/\s+/).filter(Boolean).slice(0, 2).map((part) => part[0]?.toUpperCase() ?? "").join("");
|
|
13644
13681
|
}
|
|
13645
|
-
function ProfileCard({
|
|
13682
|
+
function ProfileCard({
|
|
13683
|
+
name,
|
|
13684
|
+
role,
|
|
13685
|
+
imageUrl,
|
|
13686
|
+
specialties = [],
|
|
13687
|
+
bio,
|
|
13688
|
+
fields,
|
|
13689
|
+
href,
|
|
13690
|
+
className
|
|
13691
|
+
}) {
|
|
13646
13692
|
const NameTag = href ? "a" : "span";
|
|
13647
|
-
return /* @__PURE__ */
|
|
13693
|
+
return /* @__PURE__ */ jsxs8(
|
|
13648
13694
|
"article",
|
|
13649
13695
|
{
|
|
13650
|
-
className:
|
|
13696
|
+
className: cn7(
|
|
13651
13697
|
"flex flex-col items-center gap-3 rounded-lg border bg-card p-6 text-center",
|
|
13652
13698
|
className
|
|
13653
13699
|
),
|
|
13654
13700
|
"data-slot": "profile-card",
|
|
13655
13701
|
children: [
|
|
13656
|
-
/* @__PURE__ */
|
|
13657
|
-
|
|
13658
|
-
|
|
13659
|
-
|
|
13660
|
-
|
|
13661
|
-
|
|
13662
|
-
|
|
13663
|
-
|
|
13664
|
-
|
|
13665
|
-
|
|
13702
|
+
/* @__PURE__ */ jsx8("div", { className: "relative h-24 w-24 overflow-hidden rounded-full bg-muted", children: imageUrl ? /* @__PURE__ */ jsx8("img", { src: imageUrl, alt: name, loading: "lazy", className: "h-full w-full object-cover" }) : /* @__PURE__ */ jsx8(
|
|
13703
|
+
"span",
|
|
13704
|
+
{
|
|
13705
|
+
className: "flex h-full w-full items-center justify-center text-2xl font-semibold text-muted-foreground",
|
|
13706
|
+
"aria-hidden": "true",
|
|
13707
|
+
children: initials(name)
|
|
13708
|
+
}
|
|
13709
|
+
) }),
|
|
13710
|
+
/* @__PURE__ */ jsxs8("div", { className: "space-y-1", children: [
|
|
13711
|
+
/* @__PURE__ */ jsx8("h3", { className: "text-lg font-semibold leading-tight", children: /* @__PURE__ */ jsx8(NameTag, { ...href ? { href, className: "transition-colors hover:text-primary" } : {}, children: name }) }),
|
|
13712
|
+
role && /* @__PURE__ */ jsx8("p", { className: "text-sm text-muted-foreground", children: role })
|
|
13666
13713
|
] }),
|
|
13667
|
-
|
|
13714
|
+
/* @__PURE__ */ jsx8(ProfessionalFields, { fields, variant: "card" }),
|
|
13715
|
+
specialties.length > 0 && /* @__PURE__ */ jsx8("ul", { className: "flex flex-wrap justify-center gap-1.5 p-0", children: specialties.map((s2) => /* @__PURE__ */ jsx8(
|
|
13668
13716
|
"li",
|
|
13669
13717
|
{
|
|
13670
13718
|
className: "inline-flex items-center rounded-full bg-secondary px-2.5 py-0.5 text-xs font-medium text-secondary-foreground",
|
|
@@ -13672,28 +13720,28 @@ function ProfileCard({ name, role, imageUrl, specialties = [], bio, href, classN
|
|
|
13672
13720
|
},
|
|
13673
13721
|
s2
|
|
13674
13722
|
)) }),
|
|
13675
|
-
bio && /* @__PURE__ */
|
|
13723
|
+
bio && /* @__PURE__ */ jsx8("p", { className: "text-sm text-muted-foreground", children: bio })
|
|
13676
13724
|
]
|
|
13677
13725
|
}
|
|
13678
13726
|
);
|
|
13679
13727
|
}
|
|
13680
13728
|
|
|
13681
13729
|
// src/components/product-card.tsx
|
|
13682
|
-
import { cn as
|
|
13683
|
-
import { jsx as
|
|
13730
|
+
import { cn as cn8 } from "@reblu/site-ui/utils";
|
|
13731
|
+
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
13684
13732
|
function ProductCard({ product, href, currencyCode = "EUR", locale, className }) {
|
|
13685
13733
|
const image = product.images.find((i) => i.isPrimary) ?? product.images[0];
|
|
13686
13734
|
const hasDiscount = product.comparePrice != null && product.comparePrice > product.price;
|
|
13687
|
-
return /* @__PURE__ */
|
|
13735
|
+
return /* @__PURE__ */ jsxs9(
|
|
13688
13736
|
"article",
|
|
13689
13737
|
{
|
|
13690
|
-
className:
|
|
13738
|
+
className: cn8(
|
|
13691
13739
|
"group flex flex-col overflow-hidden rounded-lg border bg-card transition-shadow hover:shadow-lg",
|
|
13692
13740
|
className
|
|
13693
13741
|
),
|
|
13694
13742
|
"data-slot": "product-card",
|
|
13695
13743
|
children: [
|
|
13696
|
-
/* @__PURE__ */
|
|
13744
|
+
/* @__PURE__ */ jsx9("div", { className: "relative aspect-square overflow-hidden bg-muted", children: image ? /* @__PURE__ */ jsx9(
|
|
13697
13745
|
"img",
|
|
13698
13746
|
{
|
|
13699
13747
|
src: image.url,
|
|
@@ -13701,14 +13749,14 @@ function ProductCard({ product, href, currencyCode = "EUR", locale, className })
|
|
|
13701
13749
|
loading: "lazy",
|
|
13702
13750
|
className: "h-full w-full object-cover transition-transform group-hover:scale-105"
|
|
13703
13751
|
}
|
|
13704
|
-
) : /* @__PURE__ */
|
|
13705
|
-
/* @__PURE__ */
|
|
13706
|
-
product.category && /* @__PURE__ */
|
|
13707
|
-
/* @__PURE__ */
|
|
13708
|
-
product.shortDescription && /* @__PURE__ */
|
|
13709
|
-
/* @__PURE__ */
|
|
13710
|
-
/* @__PURE__ */
|
|
13711
|
-
hasDiscount && /* @__PURE__ */
|
|
13752
|
+
) : /* @__PURE__ */ jsx9("div", { className: "flex h-full items-center justify-center text-4xl text-muted-foreground/30", "aria-hidden": "true", children: "\u{1F6CD}\uFE0F" }) }),
|
|
13753
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex flex-1 flex-col gap-2 p-4", children: [
|
|
13754
|
+
product.category && /* @__PURE__ */ jsx9("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 }),
|
|
13755
|
+
/* @__PURE__ */ jsx9("h3", { className: "text-base font-semibold leading-tight", children: href ? /* @__PURE__ */ jsx9("a", { href, className: "transition-colors hover:text-primary", children: product.name }) : product.name }),
|
|
13756
|
+
product.shortDescription && /* @__PURE__ */ jsx9("p", { className: "line-clamp-2 text-sm text-muted-foreground", children: product.shortDescription }),
|
|
13757
|
+
/* @__PURE__ */ jsxs9("div", { className: "mt-auto flex items-baseline gap-2 pt-2", children: [
|
|
13758
|
+
/* @__PURE__ */ jsx9("span", { className: "text-lg font-bold text-foreground", children: formatPrice(product.price, currencyCode, locale) }),
|
|
13759
|
+
hasDiscount && /* @__PURE__ */ jsx9("span", { className: "text-sm text-muted-foreground line-through", children: formatPrice(product.comparePrice, currencyCode, locale) })
|
|
13712
13760
|
] })
|
|
13713
13761
|
] })
|
|
13714
13762
|
]
|
|
@@ -13910,7 +13958,7 @@ var __iconNode8 = [
|
|
|
13910
13958
|
var Truck = createLucideIcon("truck", __iconNode8);
|
|
13911
13959
|
|
|
13912
13960
|
// src/components/product-trust-items.tsx
|
|
13913
|
-
import { jsx as
|
|
13961
|
+
import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
13914
13962
|
var DEFAULT_TRUST_ICONS = Object.freeze({
|
|
13915
13963
|
shipping: Truck,
|
|
13916
13964
|
returns: RotateCcw,
|
|
@@ -13944,17 +13992,17 @@ function ProductTrustItems({
|
|
|
13944
13992
|
return [{ key: `${index}-${icon}`, Icon: Icon2, text: text3 }];
|
|
13945
13993
|
});
|
|
13946
13994
|
if (rows.length === 0) return null;
|
|
13947
|
-
return /* @__PURE__ */
|
|
13948
|
-
/* @__PURE__ */
|
|
13949
|
-
/* @__PURE__ */
|
|
13995
|
+
return /* @__PURE__ */ jsx10(List, { "data-slot": "product-trust-items", className: slotClassName("space-y-2.5", "", className), children: rows.map(({ key: key2, Icon: Icon2, text: text3 }) => /* @__PURE__ */ jsxs10("li", { className: slotClassName("flex items-center gap-3", "text-sm text-muted-foreground", itemClassName), children: [
|
|
13996
|
+
/* @__PURE__ */ jsx10(Icon2, { "aria-hidden": "true", className: "h-4 w-4 shrink-0 text-foreground/60" }),
|
|
13997
|
+
/* @__PURE__ */ jsx10("span", { children: text3 })
|
|
13950
13998
|
] }, key2)) });
|
|
13951
13999
|
}
|
|
13952
14000
|
|
|
13953
14001
|
// src/components/faq-accordion.tsx
|
|
13954
|
-
import { cn as
|
|
14002
|
+
import { cn as cn9 } from "@reblu/site-ui/utils";
|
|
13955
14003
|
|
|
13956
14004
|
// src/components/_heading.tsx
|
|
13957
|
-
import { jsx as
|
|
14005
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
13958
14006
|
function nextHeadingLevel(level) {
|
|
13959
14007
|
return Math.min(level + 1, 6);
|
|
13960
14008
|
}
|
|
@@ -13964,11 +14012,11 @@ function Heading({
|
|
|
13964
14012
|
children: children2
|
|
13965
14013
|
}) {
|
|
13966
14014
|
const Tag = `h${level}`;
|
|
13967
|
-
return /* @__PURE__ */
|
|
14015
|
+
return /* @__PURE__ */ jsx11(Tag, { className, children: children2 });
|
|
13968
14016
|
}
|
|
13969
14017
|
|
|
13970
14018
|
// src/components/faq-accordion.tsx
|
|
13971
|
-
import { jsx as
|
|
14019
|
+
import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
13972
14020
|
function FaqAccordion({
|
|
13973
14021
|
items,
|
|
13974
14022
|
heading,
|
|
@@ -13979,18 +14027,18 @@ function FaqAccordion({
|
|
|
13979
14027
|
}) {
|
|
13980
14028
|
const visible = items.map((item, index) => ({ item, index })).filter(({ item }) => item.q.trim() !== "");
|
|
13981
14029
|
if (visible.length === 0) return null;
|
|
13982
|
-
return /* @__PURE__ */
|
|
13983
|
-
heading && /* @__PURE__ */
|
|
13984
|
-
/* @__PURE__ */
|
|
14030
|
+
return /* @__PURE__ */ jsxs11("div", { className: cn9("space-y-4", className), "data-slot": "faq-accordion", children: [
|
|
14031
|
+
heading && /* @__PURE__ */ jsx12(Heading, { level: headingLevel, className: "text-2xl font-semibold tracking-tight", children: heading }),
|
|
14032
|
+
/* @__PURE__ */ jsx12("div", { className: "divide-y divide-border rounded-xl border border-border", children: visible.map(({ item, index }) => /* @__PURE__ */ jsxs11(
|
|
13985
14033
|
"details",
|
|
13986
14034
|
{
|
|
13987
14035
|
className: "group px-4",
|
|
13988
14036
|
"data-slot": "faq-item",
|
|
13989
14037
|
...defaultOpen.includes(index) ? { open: true } : {},
|
|
13990
14038
|
children: [
|
|
13991
|
-
/* @__PURE__ */
|
|
13992
|
-
questionHeadingLevel ? /* @__PURE__ */
|
|
13993
|
-
/* @__PURE__ */
|
|
14039
|
+
/* @__PURE__ */ jsxs11("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: [
|
|
14040
|
+
questionHeadingLevel ? /* @__PURE__ */ jsx12(Heading, { level: questionHeadingLevel, className: "text-base font-medium", children: item.q }) : /* @__PURE__ */ jsx12("span", { children: item.q }),
|
|
14041
|
+
/* @__PURE__ */ jsx12(
|
|
13994
14042
|
"span",
|
|
13995
14043
|
{
|
|
13996
14044
|
"aria-hidden": "true",
|
|
@@ -13999,7 +14047,7 @@ function FaqAccordion({
|
|
|
13999
14047
|
}
|
|
14000
14048
|
)
|
|
14001
14049
|
] }),
|
|
14002
|
-
/* @__PURE__ */
|
|
14050
|
+
/* @__PURE__ */ jsx12("p", { className: "whitespace-pre-line pb-4 text-muted-foreground", children: item.a })
|
|
14003
14051
|
]
|
|
14004
14052
|
},
|
|
14005
14053
|
index
|
|
@@ -14008,8 +14056,8 @@ function FaqAccordion({
|
|
|
14008
14056
|
}
|
|
14009
14057
|
|
|
14010
14058
|
// src/components/trust-badges.tsx
|
|
14011
|
-
import { cn as
|
|
14012
|
-
import { jsx as
|
|
14059
|
+
import { cn as cn10 } from "@reblu/site-ui/utils";
|
|
14060
|
+
import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
14013
14061
|
var DEFAULT_TRUST_BADGE_HEADINGS = Object.freeze(
|
|
14014
14062
|
{
|
|
14015
14063
|
PARTNER: "Colaboradores",
|
|
@@ -14051,18 +14099,18 @@ function BadgeContent({ badge, logoClassName }) {
|
|
|
14051
14099
|
if (src) {
|
|
14052
14100
|
return (
|
|
14053
14101
|
// eslint-disable-next-line @next/next/no-img-element -- framework-agnostic SDK; the SITE owns image optimisation
|
|
14054
|
-
/* @__PURE__ */
|
|
14102
|
+
/* @__PURE__ */ jsx13(
|
|
14055
14103
|
"img",
|
|
14056
14104
|
{
|
|
14057
14105
|
src,
|
|
14058
14106
|
alt: badge.name,
|
|
14059
14107
|
loading: "lazy",
|
|
14060
|
-
className:
|
|
14108
|
+
className: cn10("h-12 w-auto object-contain", logoClassName)
|
|
14061
14109
|
}
|
|
14062
14110
|
)
|
|
14063
14111
|
);
|
|
14064
14112
|
}
|
|
14065
|
-
return /* @__PURE__ */
|
|
14113
|
+
return /* @__PURE__ */ jsx13("span", { className: "text-sm font-medium", children: badge.name });
|
|
14066
14114
|
}
|
|
14067
14115
|
function TrustBadges({
|
|
14068
14116
|
badges,
|
|
@@ -14090,14 +14138,14 @@ function TrustBadges({
|
|
|
14090
14138
|
if (groups.length === 0) return null;
|
|
14091
14139
|
const hasHeading = heading !== void 0 && heading !== null && heading !== "";
|
|
14092
14140
|
const groupHeadingLevel = hasHeading ? nextHeadingLevel(headingLevel) : headingLevel;
|
|
14093
|
-
const content = groups.map(({ type, groupHeading, items }) => /* @__PURE__ */
|
|
14141
|
+
const content = groups.map(({ type, groupHeading, items }) => /* @__PURE__ */ jsxs12(
|
|
14094
14142
|
"div",
|
|
14095
14143
|
{
|
|
14096
14144
|
"data-slot": "trust-badge-group",
|
|
14097
14145
|
"data-type": type,
|
|
14098
|
-
className:
|
|
14146
|
+
className: cn10("space-y-3", groupClassName),
|
|
14099
14147
|
children: [
|
|
14100
|
-
groupHeading ? /* @__PURE__ */
|
|
14148
|
+
groupHeading ? /* @__PURE__ */ jsx13(
|
|
14101
14149
|
Heading,
|
|
14102
14150
|
{
|
|
14103
14151
|
level: groupHeadingLevel,
|
|
@@ -14109,30 +14157,30 @@ function TrustBadges({
|
|
|
14109
14157
|
children: groupHeading
|
|
14110
14158
|
}
|
|
14111
14159
|
) : null,
|
|
14112
|
-
/* @__PURE__ */
|
|
14160
|
+
/* @__PURE__ */ jsx13("ul", { className: cn10("flex flex-wrap items-center gap-6", listClassName), children: items.map((badge) => {
|
|
14113
14161
|
const href = safeHref(badge.url);
|
|
14114
|
-
return /* @__PURE__ */
|
|
14115
|
-
/* @__PURE__ */
|
|
14162
|
+
return /* @__PURE__ */ jsx13("li", { children: href ? /* @__PURE__ */ jsxs12("a", { href, target: "_blank", rel: "noopener noreferrer", className: "inline-flex", children: [
|
|
14163
|
+
/* @__PURE__ */ jsx13(BadgeContent, { badge, logoClassName }),
|
|
14116
14164
|
" ",
|
|
14117
|
-
/* @__PURE__ */
|
|
14118
|
-
] }) : /* @__PURE__ */
|
|
14165
|
+
/* @__PURE__ */ jsx13("span", { className: "sr-only", children: newWindowLabel })
|
|
14166
|
+
] }) : /* @__PURE__ */ jsx13(BadgeContent, { badge, logoClassName }) }, badge.id);
|
|
14119
14167
|
}) })
|
|
14120
14168
|
]
|
|
14121
14169
|
},
|
|
14122
14170
|
type
|
|
14123
14171
|
));
|
|
14124
14172
|
if (!hasHeading) {
|
|
14125
|
-
return /* @__PURE__ */
|
|
14173
|
+
return /* @__PURE__ */ jsx13("div", { "data-slot": "trust-badges", className: cn10("space-y-6", className), children: content });
|
|
14126
14174
|
}
|
|
14127
14175
|
const Tag = `h${headingLevel}`;
|
|
14128
|
-
return /* @__PURE__ */
|
|
14176
|
+
return /* @__PURE__ */ jsxs12(
|
|
14129
14177
|
"section",
|
|
14130
14178
|
{
|
|
14131
14179
|
"data-slot": "trust-badges",
|
|
14132
14180
|
"aria-labelledby": headingId,
|
|
14133
|
-
className:
|
|
14181
|
+
className: cn10("space-y-6", className),
|
|
14134
14182
|
children: [
|
|
14135
|
-
/* @__PURE__ */
|
|
14183
|
+
/* @__PURE__ */ jsx13(
|
|
14136
14184
|
Tag,
|
|
14137
14185
|
{
|
|
14138
14186
|
id: headingId,
|
|
@@ -14147,40 +14195,40 @@ function TrustBadges({
|
|
|
14147
14195
|
}
|
|
14148
14196
|
|
|
14149
14197
|
// src/components/page-blocks.tsx
|
|
14150
|
-
import { cn as
|
|
14198
|
+
import { cn as cn11 } from "@reblu/site-ui/utils";
|
|
14151
14199
|
import { buttonVariants as buttonVariants2 } from "@reblu/site-ui/button-variants";
|
|
14152
|
-
import { jsx as
|
|
14200
|
+
import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
14153
14201
|
var ALIASES = {
|
|
14154
14202
|
doctor_embed: "profile_embed",
|
|
14155
14203
|
specialty_embed: "page_embed"
|
|
14156
14204
|
};
|
|
14157
14205
|
function HeroBlock({ block, headingLevel }) {
|
|
14158
14206
|
const { title, subtitle, imageUrl } = block.data;
|
|
14159
|
-
return /* @__PURE__ */
|
|
14160
|
-
/* @__PURE__ */
|
|
14161
|
-
subtitle && /* @__PURE__ */
|
|
14162
|
-
imageUrl && /* @__PURE__ */
|
|
14207
|
+
return /* @__PURE__ */ jsxs13("div", { className: "space-y-4", children: [
|
|
14208
|
+
/* @__PURE__ */ jsx14(Heading, { level: headingLevel, className: "text-3xl font-bold tracking-tight md:text-4xl", children: title }),
|
|
14209
|
+
subtitle && /* @__PURE__ */ jsx14("p", { className: "text-lg opacity-80", children: subtitle }),
|
|
14210
|
+
imageUrl && /* @__PURE__ */ jsx14("div", { className: "relative aspect-[21/9] w-full overflow-hidden rounded-xl bg-muted", children: /* @__PURE__ */ jsx14("img", { src: imageUrl, alt: "", loading: "lazy", className: "h-full w-full object-cover" }) })
|
|
14163
14211
|
] });
|
|
14164
14212
|
}
|
|
14165
14213
|
function RichtextBlock({ block, headingLevel }) {
|
|
14166
|
-
return /* @__PURE__ */
|
|
14214
|
+
return /* @__PURE__ */ jsx14(SafeHtml, { html: sanitizeHtml(block.data.html), headingOffset: headingLevel - 1 });
|
|
14167
14215
|
}
|
|
14168
14216
|
function FaqBlock({ block }) {
|
|
14169
|
-
return /* @__PURE__ */
|
|
14217
|
+
return /* @__PURE__ */ jsx14(FaqAccordion, { items: block.data.items });
|
|
14170
14218
|
}
|
|
14171
14219
|
function StatsBlock({ block }) {
|
|
14172
|
-
return /* @__PURE__ */
|
|
14173
|
-
/* @__PURE__ */
|
|
14174
|
-
/* @__PURE__ */
|
|
14220
|
+
return /* @__PURE__ */ jsx14("dl", { className: "grid gap-6 sm:grid-cols-2 lg:grid-cols-4", children: block.data.items.map((item, i) => /* @__PURE__ */ jsxs13("div", { className: "flex flex-col-reverse gap-1", children: [
|
|
14221
|
+
/* @__PURE__ */ jsx14("dt", { className: "text-sm opacity-80", children: item.label }),
|
|
14222
|
+
/* @__PURE__ */ jsx14("dd", { className: "text-3xl font-bold", children: item.value })
|
|
14175
14223
|
] }, i)) });
|
|
14176
14224
|
}
|
|
14177
14225
|
function TestimonialBlock({ block }) {
|
|
14178
14226
|
const { quote, author, role, avatarUrl } = block.data;
|
|
14179
|
-
return /* @__PURE__ */
|
|
14180
|
-
/* @__PURE__ */
|
|
14181
|
-
/* @__PURE__ */
|
|
14227
|
+
return /* @__PURE__ */ jsxs13("figure", { className: "space-y-4", children: [
|
|
14228
|
+
/* @__PURE__ */ jsx14("blockquote", { className: "text-xl italic", children: /* @__PURE__ */ jsx14("p", { children: quote }) }),
|
|
14229
|
+
/* @__PURE__ */ jsxs13("figcaption", { className: "flex items-center gap-3", children: [
|
|
14182
14230
|
avatarUrl && // eslint-disable-next-line @next/next/no-img-element
|
|
14183
|
-
/* @__PURE__ */
|
|
14231
|
+
/* @__PURE__ */ jsx14(
|
|
14184
14232
|
"img",
|
|
14185
14233
|
{
|
|
14186
14234
|
src: avatarUrl,
|
|
@@ -14189,9 +14237,9 @@ function TestimonialBlock({ block }) {
|
|
|
14189
14237
|
className: "h-10 w-10 rounded-full object-cover"
|
|
14190
14238
|
}
|
|
14191
14239
|
),
|
|
14192
|
-
/* @__PURE__ */
|
|
14193
|
-
/* @__PURE__ */
|
|
14194
|
-
role && /* @__PURE__ */
|
|
14240
|
+
/* @__PURE__ */ jsxs13("span", { children: [
|
|
14241
|
+
/* @__PURE__ */ jsx14("span", { className: "font-semibold", children: author }),
|
|
14242
|
+
role && /* @__PURE__ */ jsx14("span", { className: "block text-sm opacity-80", children: role })
|
|
14195
14243
|
] })
|
|
14196
14244
|
] })
|
|
14197
14245
|
] });
|
|
@@ -14200,19 +14248,19 @@ function CtaSlotBlock(_props) {
|
|
|
14200
14248
|
return null;
|
|
14201
14249
|
}
|
|
14202
14250
|
function FeatureListBlock({ block }) {
|
|
14203
|
-
return /* @__PURE__ */
|
|
14251
|
+
return /* @__PURE__ */ jsx14("ul", { className: "grid list-disc gap-2 pl-5 sm:grid-cols-2", children: block.data.items.map((item, i) => /* @__PURE__ */ jsx14("li", { children: item.text }, i)) });
|
|
14204
14252
|
}
|
|
14205
14253
|
function GalleryBlock({ block }) {
|
|
14206
14254
|
const { images } = block.data;
|
|
14207
|
-
return /* @__PURE__ */
|
|
14255
|
+
return /* @__PURE__ */ jsx14(
|
|
14208
14256
|
"div",
|
|
14209
14257
|
{
|
|
14210
|
-
className:
|
|
14258
|
+
className: cn11(
|
|
14211
14259
|
"grid gap-4",
|
|
14212
14260
|
images.length > 1 ? "sm:grid-cols-2 lg:grid-cols-3" : "grid-cols-1"
|
|
14213
14261
|
),
|
|
14214
|
-
children: images.map((img, i) => /* @__PURE__ */
|
|
14215
|
-
/* @__PURE__ */
|
|
14262
|
+
children: images.map((img, i) => /* @__PURE__ */ jsxs13("figure", { className: "space-y-1", children: [
|
|
14263
|
+
/* @__PURE__ */ jsx14("div", { className: "relative aspect-video w-full overflow-hidden rounded-lg bg-muted", children: /* @__PURE__ */ jsx14(
|
|
14216
14264
|
"img",
|
|
14217
14265
|
{
|
|
14218
14266
|
src: img.url,
|
|
@@ -14221,7 +14269,7 @@ function GalleryBlock({ block }) {
|
|
|
14221
14269
|
className: "h-full w-full object-cover"
|
|
14222
14270
|
}
|
|
14223
14271
|
) }),
|
|
14224
|
-
img.caption && /* @__PURE__ */
|
|
14272
|
+
img.caption && /* @__PURE__ */ jsx14("figcaption", { className: "text-sm opacity-80", children: img.caption })
|
|
14225
14273
|
] }, `${img.url}-${i}`))
|
|
14226
14274
|
}
|
|
14227
14275
|
);
|
|
@@ -14231,13 +14279,13 @@ function EmbedCard({
|
|
|
14231
14279
|
headingLevel,
|
|
14232
14280
|
embedHref
|
|
14233
14281
|
}) {
|
|
14234
|
-
return /* @__PURE__ */
|
|
14282
|
+
return /* @__PURE__ */ jsxs13(
|
|
14235
14283
|
"a",
|
|
14236
14284
|
{
|
|
14237
14285
|
href: embedHref(resolved),
|
|
14238
14286
|
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",
|
|
14239
14287
|
children: [
|
|
14240
|
-
resolved.coverImageUrl && /* @__PURE__ */
|
|
14288
|
+
resolved.coverImageUrl && /* @__PURE__ */ jsx14("div", { className: "aspect-video w-full overflow-hidden bg-muted", children: /* @__PURE__ */ jsx14(
|
|
14241
14289
|
"img",
|
|
14242
14290
|
{
|
|
14243
14291
|
src: resolved.coverImageUrl,
|
|
@@ -14246,24 +14294,24 @@ function EmbedCard({
|
|
|
14246
14294
|
className: "h-full w-full object-cover"
|
|
14247
14295
|
}
|
|
14248
14296
|
) }),
|
|
14249
|
-
/* @__PURE__ */
|
|
14250
|
-
/* @__PURE__ */
|
|
14251
|
-
resolved.role && /* @__PURE__ */
|
|
14252
|
-
resolved.excerpt && /* @__PURE__ */
|
|
14297
|
+
/* @__PURE__ */ jsxs13("div", { className: "space-y-1 p-4", children: [
|
|
14298
|
+
/* @__PURE__ */ jsx14(Heading, { level: headingLevel, className: "text-lg font-semibold", children: resolved.title }),
|
|
14299
|
+
resolved.role && /* @__PURE__ */ jsx14("p", { className: "text-sm text-muted-foreground", children: resolved.role }),
|
|
14300
|
+
resolved.excerpt && /* @__PURE__ */ jsx14("p", { className: "text-muted-foreground", children: resolved.excerpt })
|
|
14253
14301
|
] })
|
|
14254
14302
|
]
|
|
14255
14303
|
}
|
|
14256
14304
|
);
|
|
14257
14305
|
}
|
|
14258
14306
|
function PageEmbedBlock({ block, headingLevel, embedHref }) {
|
|
14259
|
-
return /* @__PURE__ */
|
|
14307
|
+
return /* @__PURE__ */ jsx14(EmbedCard, { resolved: block.resolved, headingLevel, embedHref });
|
|
14260
14308
|
}
|
|
14261
14309
|
function ProfileEmbedBlock({
|
|
14262
14310
|
block,
|
|
14263
14311
|
headingLevel,
|
|
14264
14312
|
embedHref
|
|
14265
14313
|
}) {
|
|
14266
|
-
return /* @__PURE__ */
|
|
14314
|
+
return /* @__PURE__ */ jsx14(EmbedCard, { resolved: block.resolved, headingLevel, embedHref });
|
|
14267
14315
|
}
|
|
14268
14316
|
var DEFAULT_RENDERERS = {
|
|
14269
14317
|
hero: HeroBlock,
|
|
@@ -14320,14 +14368,14 @@ function toIdFragment(value) {
|
|
|
14320
14368
|
function SectionCta2({ cta }) {
|
|
14321
14369
|
if (!hasUsableCta(cta)) return null;
|
|
14322
14370
|
const variant = toButtonVariant(cta.variant);
|
|
14323
|
-
return /* @__PURE__ */
|
|
14371
|
+
return /* @__PURE__ */ jsx14("div", { className: "pt-2", children: /* @__PURE__ */ jsx14(
|
|
14324
14372
|
"a",
|
|
14325
14373
|
{
|
|
14326
14374
|
href: cta.url,
|
|
14327
14375
|
"data-slot": "button",
|
|
14328
14376
|
"data-variant": variant,
|
|
14329
14377
|
"data-size": "default",
|
|
14330
|
-
className:
|
|
14378
|
+
className: cn11(buttonVariants2({ variant, size: "default" })),
|
|
14331
14379
|
...cta.isExternal ? { target: "_blank", rel: "noopener noreferrer" } : {},
|
|
14332
14380
|
children: cta.label
|
|
14333
14381
|
}
|
|
@@ -14353,17 +14401,17 @@ function PageBlocks({
|
|
|
14353
14401
|
const headingId = block.heading ? `${safePrefix}-${toIdFragment(block.id)}-heading` : void 0;
|
|
14354
14402
|
const background = block.backgroundColor;
|
|
14355
14403
|
return [
|
|
14356
|
-
/* @__PURE__ */
|
|
14404
|
+
/* @__PURE__ */ jsxs13(
|
|
14357
14405
|
"section",
|
|
14358
14406
|
{
|
|
14359
14407
|
"data-slot": "page-block",
|
|
14360
14408
|
"data-block-type": type,
|
|
14361
14409
|
"aria-labelledby": headingId,
|
|
14362
14410
|
style: surfaceStyle(background),
|
|
14363
|
-
className:
|
|
14411
|
+
className: cn11("space-y-6", background && "rounded-xl px-6 py-10", sectionClassName),
|
|
14364
14412
|
children: [
|
|
14365
|
-
block.heading && /* @__PURE__ */
|
|
14366
|
-
/* @__PURE__ */
|
|
14413
|
+
block.heading && /* @__PURE__ */ jsx14(Heading, { level: headingLevel, className: "text-2xl font-bold tracking-tight", children: /* @__PURE__ */ jsx14("span", { id: headingId, children: block.heading }) }),
|
|
14414
|
+
/* @__PURE__ */ jsx14(
|
|
14367
14415
|
Renderer,
|
|
14368
14416
|
{
|
|
14369
14417
|
block,
|
|
@@ -14371,7 +14419,7 @@ function PageBlocks({
|
|
|
14371
14419
|
embedHref
|
|
14372
14420
|
}
|
|
14373
14421
|
),
|
|
14374
|
-
/* @__PURE__ */
|
|
14422
|
+
/* @__PURE__ */ jsx14(SectionCta2, { cta: block.cta })
|
|
14375
14423
|
]
|
|
14376
14424
|
},
|
|
14377
14425
|
block.id
|
|
@@ -14379,12 +14427,12 @@ function PageBlocks({
|
|
|
14379
14427
|
];
|
|
14380
14428
|
});
|
|
14381
14429
|
if (sections.length === 0) return null;
|
|
14382
|
-
return /* @__PURE__ */
|
|
14430
|
+
return /* @__PURE__ */ jsx14("div", { className: cn11("space-y-12", className), "data-slot": "page-blocks", children: sections });
|
|
14383
14431
|
}
|
|
14384
14432
|
|
|
14385
14433
|
// src/components/shop-filters.tsx
|
|
14386
|
-
import { cn as
|
|
14387
|
-
import { jsx as
|
|
14434
|
+
import { cn as cn12 } from "@reblu/site-ui/utils";
|
|
14435
|
+
import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
14388
14436
|
var DEFAULT_SHOP_PRICE_BANDS = [
|
|
14389
14437
|
{ max: 2500 },
|
|
14390
14438
|
{ min: 2500, max: 5e3 },
|
|
@@ -14428,7 +14476,7 @@ function priceBandLabel(band, t, currencyCode, locale) {
|
|
|
14428
14476
|
return "";
|
|
14429
14477
|
}
|
|
14430
14478
|
function OptionLink({ href, active, label, onActivate }) {
|
|
14431
|
-
return /* @__PURE__ */
|
|
14479
|
+
return /* @__PURE__ */ jsx15(
|
|
14432
14480
|
"a",
|
|
14433
14481
|
{
|
|
14434
14482
|
href,
|
|
@@ -14437,7 +14485,7 @@ function OptionLink({ href, active, label, onActivate }) {
|
|
|
14437
14485
|
event.preventDefault();
|
|
14438
14486
|
onActivate();
|
|
14439
14487
|
} : void 0,
|
|
14440
|
-
className:
|
|
14488
|
+
className: cn12(
|
|
14441
14489
|
"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",
|
|
14442
14490
|
active ? "border-transparent bg-primary text-primary-foreground" : "border-border text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
14443
14491
|
),
|
|
@@ -14446,9 +14494,9 @@ function OptionLink({ href, active, label, onActivate }) {
|
|
|
14446
14494
|
);
|
|
14447
14495
|
}
|
|
14448
14496
|
function FilterFieldset({ legend, children: children2 }) {
|
|
14449
|
-
return /* @__PURE__ */
|
|
14450
|
-
/* @__PURE__ */
|
|
14451
|
-
/* @__PURE__ */
|
|
14497
|
+
return /* @__PURE__ */ jsxs14("fieldset", { className: "space-y-2", children: [
|
|
14498
|
+
/* @__PURE__ */ jsx15("legend", { className: "text-sm font-medium text-foreground", children: legend }),
|
|
14499
|
+
/* @__PURE__ */ jsx15("div", { className: "flex flex-wrap gap-2", children: children2 })
|
|
14452
14500
|
] });
|
|
14453
14501
|
}
|
|
14454
14502
|
function ShopFilters({
|
|
@@ -14471,11 +14519,11 @@ function ShopFilters({
|
|
|
14471
14519
|
if (!shouldRenderShopFilters(facets, active)) {
|
|
14472
14520
|
return null;
|
|
14473
14521
|
}
|
|
14474
|
-
return /* @__PURE__ */
|
|
14522
|
+
return /* @__PURE__ */ jsxs14("div", { className: cn12("space-y-6", className), "data-slot": "shop-filters", children: [
|
|
14475
14523
|
visibleTaxonomies.map((axis) => {
|
|
14476
14524
|
const activeSlug = active.taxonomy?.[axis.key];
|
|
14477
|
-
return /* @__PURE__ */
|
|
14478
|
-
/* @__PURE__ */
|
|
14525
|
+
return /* @__PURE__ */ jsxs14(FilterFieldset, { legend: axis.label, children: [
|
|
14526
|
+
/* @__PURE__ */ jsx15(
|
|
14479
14527
|
OptionLink,
|
|
14480
14528
|
{
|
|
14481
14529
|
href: hrefs.taxonomy(axis.key, void 0),
|
|
@@ -14490,7 +14538,7 @@ function ShopFilters({
|
|
|
14490
14538
|
),
|
|
14491
14539
|
axis.terms.map((term) => {
|
|
14492
14540
|
const isActive = activeSlug === term.slug;
|
|
14493
|
-
return /* @__PURE__ */
|
|
14541
|
+
return /* @__PURE__ */ jsx15(
|
|
14494
14542
|
OptionLink,
|
|
14495
14543
|
{
|
|
14496
14544
|
href: hrefs.taxonomy(axis.key, isActive ? void 0 : term.slug),
|
|
@@ -14510,9 +14558,9 @@ function ShopFilters({
|
|
|
14510
14558
|
}),
|
|
14511
14559
|
visibleAttributes.map((attr) => {
|
|
14512
14560
|
const activeValues = toValueArray(active.attr?.[attr.key]);
|
|
14513
|
-
return /* @__PURE__ */
|
|
14561
|
+
return /* @__PURE__ */ jsx15(FilterFieldset, { legend: attr.label, children: attr.options.map((opt) => {
|
|
14514
14562
|
const isActive = activeValues.includes(opt.value);
|
|
14515
|
-
return /* @__PURE__ */
|
|
14563
|
+
return /* @__PURE__ */ jsx15(
|
|
14516
14564
|
OptionLink,
|
|
14517
14565
|
{
|
|
14518
14566
|
href: hrefs.attr(attr.key, opt.value),
|
|
@@ -14530,11 +14578,11 @@ function ShopFilters({
|
|
|
14530
14578
|
);
|
|
14531
14579
|
}) }, attr.key);
|
|
14532
14580
|
}),
|
|
14533
|
-
showPriceGroup && /* @__PURE__ */
|
|
14581
|
+
showPriceGroup && /* @__PURE__ */ jsx15(FilterFieldset, { legend: t.price, children: priceBands.map((band, i) => {
|
|
14534
14582
|
const isActive = active.priceMin === band.min && active.priceMax === band.max;
|
|
14535
14583
|
const nextMin = isActive ? void 0 : band.min;
|
|
14536
14584
|
const nextMax = isActive ? void 0 : band.max;
|
|
14537
|
-
return /* @__PURE__ */
|
|
14585
|
+
return /* @__PURE__ */ jsx15(
|
|
14538
14586
|
OptionLink,
|
|
14539
14587
|
{
|
|
14540
14588
|
href: hrefs.price(nextMin, nextMax),
|
|
@@ -14545,7 +14593,7 @@ function ShopFilters({
|
|
|
14545
14593
|
i
|
|
14546
14594
|
);
|
|
14547
14595
|
}) }),
|
|
14548
|
-
hasOnSale && /* @__PURE__ */
|
|
14596
|
+
hasOnSale && /* @__PURE__ */ jsx15(
|
|
14549
14597
|
OptionLink,
|
|
14550
14598
|
{
|
|
14551
14599
|
href: hrefs.onSale(!active.onSale),
|
|
@@ -14554,7 +14602,7 @@ function ShopFilters({
|
|
|
14554
14602
|
onActivate: onChange ? () => onChange({ onSale: !active.onSale }) : void 0
|
|
14555
14603
|
}
|
|
14556
14604
|
),
|
|
14557
|
-
/* @__PURE__ */
|
|
14605
|
+
/* @__PURE__ */ jsx15(
|
|
14558
14606
|
"a",
|
|
14559
14607
|
{
|
|
14560
14608
|
href: hrefs.clearAll(),
|
|
@@ -14570,8 +14618,8 @@ function ShopFilters({
|
|
|
14570
14618
|
}
|
|
14571
14619
|
|
|
14572
14620
|
// src/components/cart-line-list.tsx
|
|
14573
|
-
import { cn as
|
|
14574
|
-
import { jsx as
|
|
14621
|
+
import { cn as cn13 } from "@reblu/site-ui/utils";
|
|
14622
|
+
import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
14575
14623
|
var DEFAULT_LABELS2 = {
|
|
14576
14624
|
quantityLabel: "Cantidad",
|
|
14577
14625
|
decrease: "Reducir cantidad",
|
|
@@ -14597,9 +14645,9 @@ function CartLineList({
|
|
|
14597
14645
|
}) {
|
|
14598
14646
|
const t = { ...DEFAULT_LABELS2, ...labels };
|
|
14599
14647
|
const noticeContent = notice === true ? t.cancelledNotice : notice;
|
|
14600
|
-
return /* @__PURE__ */
|
|
14601
|
-
/* @__PURE__ */
|
|
14602
|
-
noticeContent != null && noticeContent !== false && /* @__PURE__ */
|
|
14648
|
+
return /* @__PURE__ */ jsxs15("div", { className: cn13("space-y-4", className), "data-slot": "cart-line-list", children: [
|
|
14649
|
+
/* @__PURE__ */ jsx16("div", { "aria-live": "polite", className: "sr-only", children: liveMessage }),
|
|
14650
|
+
noticeContent != null && noticeContent !== false && /* @__PURE__ */ jsx16(
|
|
14603
14651
|
"div",
|
|
14604
14652
|
{
|
|
14605
14653
|
role: "status",
|
|
@@ -14608,69 +14656,69 @@ function CartLineList({
|
|
|
14608
14656
|
children: noticeContent
|
|
14609
14657
|
}
|
|
14610
14658
|
),
|
|
14611
|
-
/* @__PURE__ */
|
|
14659
|
+
/* @__PURE__ */ jsx16("ul", { className: "space-y-4", children: items.map((item) => {
|
|
14612
14660
|
const maxQty = item.maxStock ?? Infinity;
|
|
14613
14661
|
const atMax = item.quantity >= maxQty;
|
|
14614
14662
|
const atMin = item.quantity <= 1;
|
|
14615
14663
|
const message = lineMessage?.(item);
|
|
14616
|
-
return /* @__PURE__ */
|
|
14664
|
+
return /* @__PURE__ */ jsxs15(
|
|
14617
14665
|
"li",
|
|
14618
14666
|
{
|
|
14619
14667
|
className: "flex gap-4 rounded-xl border border-border bg-card p-4",
|
|
14620
14668
|
children: [
|
|
14621
|
-
/* @__PURE__ */
|
|
14622
|
-
/* @__PURE__ */
|
|
14623
|
-
/* @__PURE__ */
|
|
14624
|
-
item.variantName && /* @__PURE__ */
|
|
14625
|
-
/* @__PURE__ */
|
|
14669
|
+
/* @__PURE__ */ jsx16("div", { className: "h-20 w-20 flex-shrink-0 overflow-hidden rounded-lg bg-muted", children: item.imageUrl ? /* @__PURE__ */ jsx16("img", { src: item.imageUrl, alt: item.name, className: "h-full w-full object-cover" }) : null }),
|
|
14670
|
+
/* @__PURE__ */ jsxs15("div", { className: "min-w-0 flex-1", children: [
|
|
14671
|
+
/* @__PURE__ */ jsx16("p", { className: "truncate text-sm font-semibold leading-tight", children: item.name }),
|
|
14672
|
+
item.variantName && /* @__PURE__ */ jsx16("p", { className: "mt-0.5 text-xs text-muted-foreground", children: item.variantName }),
|
|
14673
|
+
/* @__PURE__ */ jsxs15("p", { className: "mt-1 text-sm text-muted-foreground", children: [
|
|
14626
14674
|
formatPrice(item.unitPrice, currencyCode, locale),
|
|
14627
14675
|
" ",
|
|
14628
14676
|
t.unitPriceSuffix
|
|
14629
14677
|
] }),
|
|
14630
|
-
/* @__PURE__ */
|
|
14678
|
+
/* @__PURE__ */ jsxs15(
|
|
14631
14679
|
"div",
|
|
14632
14680
|
{
|
|
14633
14681
|
role: "group",
|
|
14634
14682
|
"aria-label": t.quantityLabel,
|
|
14635
14683
|
className: "mt-3 flex items-center gap-3",
|
|
14636
14684
|
children: [
|
|
14637
|
-
/* @__PURE__ */
|
|
14685
|
+
/* @__PURE__ */ jsx16(
|
|
14638
14686
|
"button",
|
|
14639
14687
|
{
|
|
14640
14688
|
type: "button",
|
|
14641
14689
|
"aria-label": t.decrease,
|
|
14642
14690
|
disabled: !onQuantityChange || atMin,
|
|
14643
14691
|
onClick: onQuantityChange ? () => onQuantityChange(item.productId, item.variantId, item.quantity - 1) : void 0,
|
|
14644
|
-
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",
|
|
14692
|
+
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",
|
|
14645
14693
|
children: "\u2212"
|
|
14646
14694
|
}
|
|
14647
14695
|
),
|
|
14648
|
-
/* @__PURE__ */
|
|
14649
|
-
/* @__PURE__ */
|
|
14696
|
+
/* @__PURE__ */ jsx16("span", { className: "w-8 text-center text-sm font-semibold tabular-nums", children: item.quantity }),
|
|
14697
|
+
/* @__PURE__ */ jsx16(
|
|
14650
14698
|
"button",
|
|
14651
14699
|
{
|
|
14652
14700
|
type: "button",
|
|
14653
14701
|
"aria-label": t.increase,
|
|
14654
14702
|
disabled: !onQuantityChange || atMax,
|
|
14655
14703
|
onClick: onQuantityChange ? () => onQuantityChange(item.productId, item.variantId, item.quantity + 1) : void 0,
|
|
14656
|
-
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",
|
|
14704
|
+
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",
|
|
14657
14705
|
children: "+"
|
|
14658
14706
|
}
|
|
14659
14707
|
),
|
|
14660
|
-
onRemove && /* @__PURE__ */
|
|
14708
|
+
onRemove && /* @__PURE__ */ jsx16(
|
|
14661
14709
|
"button",
|
|
14662
14710
|
{
|
|
14663
14711
|
type: "button",
|
|
14664
14712
|
"aria-label": `${t.remove} ${item.name}`,
|
|
14665
14713
|
onClick: () => onRemove(item.productId, item.variantId),
|
|
14666
|
-
className: "ml-2 text-muted-foreground transition-colors hover:text-destructive",
|
|
14714
|
+
className: "ml-2 cursor-pointer text-muted-foreground transition-colors hover:text-destructive",
|
|
14667
14715
|
children: t.remove
|
|
14668
14716
|
}
|
|
14669
14717
|
)
|
|
14670
14718
|
]
|
|
14671
14719
|
}
|
|
14672
14720
|
),
|
|
14673
|
-
message != null && message !== false && /* @__PURE__ */
|
|
14721
|
+
message != null && message !== false && /* @__PURE__ */ jsx16(
|
|
14674
14722
|
"p",
|
|
14675
14723
|
{
|
|
14676
14724
|
className: "mt-2 text-sm text-destructive",
|
|
@@ -14679,7 +14727,7 @@ function CartLineList({
|
|
|
14679
14727
|
}
|
|
14680
14728
|
)
|
|
14681
14729
|
] }),
|
|
14682
|
-
/* @__PURE__ */
|
|
14730
|
+
/* @__PURE__ */ jsx16("div", { className: "flex-shrink-0 text-right", children: /* @__PURE__ */ jsx16("p", { className: "text-base font-bold", children: formatPrice(item.unitPrice * item.quantity, currencyCode, locale) }) })
|
|
14683
14731
|
]
|
|
14684
14732
|
},
|
|
14685
14733
|
lineKey(item.productId, item.variantId)
|
|
@@ -14689,8 +14737,8 @@ function CartLineList({
|
|
|
14689
14737
|
}
|
|
14690
14738
|
|
|
14691
14739
|
// src/components/cart-summary.tsx
|
|
14692
|
-
import { cn as
|
|
14693
|
-
import { jsx as
|
|
14740
|
+
import { cn as cn14 } from "@reblu/site-ui/utils";
|
|
14741
|
+
import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
14694
14742
|
var DEFAULT_LABELS3 = {
|
|
14695
14743
|
subtotal: "Subtotal",
|
|
14696
14744
|
discountPrefix: "Descuento",
|
|
@@ -14698,12 +14746,14 @@ var DEFAULT_LABELS3 = {
|
|
|
14698
14746
|
freeShipping: "Env\xEDo gratis",
|
|
14699
14747
|
shippingCalculated: "Se calcula en el pago",
|
|
14700
14748
|
total: "Total",
|
|
14701
|
-
cancelledNotice: "Pago cancelado: tu carrito sigue aqu\xED"
|
|
14749
|
+
cancelledNotice: "Pago cancelado: tu carrito sigue aqu\xED",
|
|
14750
|
+
staffDiscountApplied: "Descuento de personal aplicado"
|
|
14702
14751
|
};
|
|
14703
14752
|
function CartSummary({
|
|
14704
14753
|
subtotal,
|
|
14705
14754
|
discount,
|
|
14706
14755
|
discountCode,
|
|
14756
|
+
autoDiscount,
|
|
14707
14757
|
shipping,
|
|
14708
14758
|
shippingEnabled,
|
|
14709
14759
|
total,
|
|
@@ -14714,43 +14764,41 @@ function CartSummary({
|
|
|
14714
14764
|
className
|
|
14715
14765
|
}) {
|
|
14716
14766
|
const t = { ...DEFAULT_LABELS3, ...labels };
|
|
14717
|
-
const
|
|
14767
|
+
const discountAmount = discount ?? autoDiscount?.amount;
|
|
14768
|
+
const hasDiscount = Boolean(discountAmount && discountAmount > 0);
|
|
14718
14769
|
const noticeContent = notice === true ? t.cancelledNotice : notice;
|
|
14719
14770
|
const hasNotice = noticeContent != null && noticeContent !== false;
|
|
14720
|
-
const breakdown = /* @__PURE__ */
|
|
14771
|
+
const breakdown = /* @__PURE__ */ jsxs16(
|
|
14721
14772
|
"dl",
|
|
14722
14773
|
{
|
|
14723
|
-
className:
|
|
14774
|
+
className: cn14("space-y-2 text-sm", !hasNotice && className),
|
|
14724
14775
|
"data-slot": "cart-summary",
|
|
14725
14776
|
children: [
|
|
14726
|
-
/* @__PURE__ */
|
|
14727
|
-
/* @__PURE__ */
|
|
14728
|
-
/* @__PURE__ */
|
|
14777
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex justify-between text-muted-foreground", children: [
|
|
14778
|
+
/* @__PURE__ */ jsx17("dt", { children: t.subtotal }),
|
|
14779
|
+
/* @__PURE__ */ jsx17("dd", { children: formatPrice(subtotal, currencyCode, locale) })
|
|
14729
14780
|
] }),
|
|
14730
|
-
hasDiscount && /* @__PURE__ */
|
|
14731
|
-
/* @__PURE__ */
|
|
14732
|
-
|
|
14733
|
-
discountCode ? ` (${discountCode})` : ""
|
|
14734
|
-
] }),
|
|
14735
|
-
/* @__PURE__ */ jsxs15("dd", { children: [
|
|
14781
|
+
hasDiscount && /* @__PURE__ */ jsxs16("div", { className: "flex justify-between text-green-600 dark:text-green-400", children: [
|
|
14782
|
+
/* @__PURE__ */ jsx17("dt", { children: autoDiscount ? t.staffDiscountApplied : `${t.discountPrefix}${discountCode ? ` (${discountCode})` : ""}` }),
|
|
14783
|
+
/* @__PURE__ */ jsxs16("dd", { children: [
|
|
14736
14784
|
"-",
|
|
14737
|
-
formatPrice(
|
|
14785
|
+
formatPrice(discountAmount, currencyCode, locale)
|
|
14738
14786
|
] })
|
|
14739
14787
|
] }),
|
|
14740
|
-
shippingEnabled && /* @__PURE__ */
|
|
14741
|
-
/* @__PURE__ */
|
|
14742
|
-
/* @__PURE__ */
|
|
14788
|
+
shippingEnabled && /* @__PURE__ */ jsxs16("div", { className: "flex justify-between text-muted-foreground", children: [
|
|
14789
|
+
/* @__PURE__ */ jsx17("dt", { children: t.shipping }),
|
|
14790
|
+
/* @__PURE__ */ jsx17("dd", { children: shipping == null || !Number.isFinite(shipping) ? t.shippingCalculated : shipping === 0 ? t.freeShipping : formatPrice(shipping, currencyCode, locale) })
|
|
14743
14791
|
] }),
|
|
14744
|
-
/* @__PURE__ */
|
|
14745
|
-
/* @__PURE__ */
|
|
14746
|
-
/* @__PURE__ */
|
|
14792
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex justify-between border-t border-border pt-2 text-base font-bold", children: [
|
|
14793
|
+
/* @__PURE__ */ jsx17("dt", { children: t.total }),
|
|
14794
|
+
/* @__PURE__ */ jsx17("dd", { children: formatPrice(total, currencyCode, locale) })
|
|
14747
14795
|
] })
|
|
14748
14796
|
]
|
|
14749
14797
|
}
|
|
14750
14798
|
);
|
|
14751
14799
|
if (!hasNotice) return breakdown;
|
|
14752
|
-
return /* @__PURE__ */
|
|
14753
|
-
/* @__PURE__ */
|
|
14800
|
+
return /* @__PURE__ */ jsxs16("div", { className: cn14("space-y-3", className), "data-slot": "cart-summary-wrapper", children: [
|
|
14801
|
+
/* @__PURE__ */ jsx17(
|
|
14754
14802
|
"div",
|
|
14755
14803
|
{
|
|
14756
14804
|
role: "status",
|
|
@@ -14764,8 +14812,8 @@ function CartSummary({
|
|
|
14764
14812
|
}
|
|
14765
14813
|
|
|
14766
14814
|
// src/components/cart-adjustments-notice.tsx
|
|
14767
|
-
import { cn as
|
|
14768
|
-
import { jsx as
|
|
14815
|
+
import { cn as cn15 } from "@reblu/site-ui/utils";
|
|
14816
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
14769
14817
|
var DEFAULT_LABELS4 = {
|
|
14770
14818
|
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.`,
|
|
14771
14819
|
quantityChanged: (name, quantity) => `Hemos ajustado la cantidad de ${name} a ${quantity} por el stock disponible.`,
|
|
@@ -14799,20 +14847,20 @@ function CartAdjustmentsNotice({
|
|
|
14799
14847
|
);
|
|
14800
14848
|
}
|
|
14801
14849
|
if (messages.length === 0) return null;
|
|
14802
|
-
return /* @__PURE__ */
|
|
14850
|
+
return /* @__PURE__ */ jsx18(
|
|
14803
14851
|
"div",
|
|
14804
14852
|
{
|
|
14805
14853
|
role: "status",
|
|
14806
|
-
className:
|
|
14854
|
+
className: cn15("rounded-lg border border-border bg-muted px-3 py-2 text-sm", className),
|
|
14807
14855
|
"data-slot": "cart-adjustments-notice",
|
|
14808
|
-
children: messages.length === 1 ? /* @__PURE__ */
|
|
14856
|
+
children: messages.length === 1 ? /* @__PURE__ */ jsx18("p", { children: messages[0] }) : /* @__PURE__ */ jsx18("ul", { className: "list-disc space-y-1 pl-4", children: messages.map((message, index) => /* @__PURE__ */ jsx18("li", { children: message }, index)) })
|
|
14809
14857
|
}
|
|
14810
14858
|
);
|
|
14811
14859
|
}
|
|
14812
14860
|
|
|
14813
14861
|
// src/components/added-to-cart-toast.tsx
|
|
14814
|
-
import { cn as
|
|
14815
|
-
import { jsx as
|
|
14862
|
+
import { cn as cn16 } from "@reblu/site-ui/utils";
|
|
14863
|
+
import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
14816
14864
|
var DEFAULT_LABELS5 = {
|
|
14817
14865
|
success: "A\xF1adido al carrito",
|
|
14818
14866
|
error: "No se pudo a\xF1adir al carrito",
|
|
@@ -14832,12 +14880,12 @@ function AddedToCartToast({
|
|
|
14832
14880
|
const message = status === "error" ? t.error : status === "outOfStock" ? t.outOfStock : t.success;
|
|
14833
14881
|
const hasThumbnail = Boolean(imageUrl && imageUrl.trim().length > 0);
|
|
14834
14882
|
const variant = status === "success" ? "success" : "error";
|
|
14835
|
-
return /* @__PURE__ */
|
|
14883
|
+
return /* @__PURE__ */ jsxs17(
|
|
14836
14884
|
"div",
|
|
14837
14885
|
{
|
|
14838
14886
|
"data-slot": "added-to-cart-toast",
|
|
14839
14887
|
"data-variant": variant,
|
|
14840
|
-
className:
|
|
14888
|
+
className: cn16(
|
|
14841
14889
|
"flex items-center gap-3 rounded-xl border border-border bg-card p-3 text-sm shadow-lg",
|
|
14842
14890
|
variant === "success" && "border-green-600/30 dark:border-green-400/30",
|
|
14843
14891
|
variant === "error" && "border-destructive/30",
|
|
@@ -14845,20 +14893,20 @@ function AddedToCartToast({
|
|
|
14845
14893
|
),
|
|
14846
14894
|
children: [
|
|
14847
14895
|
hasThumbnail && // eslint-disable-next-line @next/next/no-img-element -- toast content, not a Next <Image> layout context
|
|
14848
|
-
/* @__PURE__ */
|
|
14849
|
-
/* @__PURE__ */
|
|
14850
|
-
/* @__PURE__ */
|
|
14851
|
-
/* @__PURE__ */
|
|
14896
|
+
/* @__PURE__ */ jsx19("img", { src: imageUrl, alt: productName, className: "h-10 w-10 flex-shrink-0 rounded-lg object-cover" }),
|
|
14897
|
+
/* @__PURE__ */ jsxs17("div", { className: "min-w-0 flex-1", children: [
|
|
14898
|
+
/* @__PURE__ */ jsx19("p", { className: "truncate font-semibold text-foreground", children: productName }),
|
|
14899
|
+
/* @__PURE__ */ jsx19("p", { className: "truncate text-muted-foreground", children: quantity && quantity > 1 ? `${message} \xB7 x${quantity}` : message })
|
|
14852
14900
|
] }),
|
|
14853
|
-
/* @__PURE__ */
|
|
14901
|
+
/* @__PURE__ */ jsx19("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx19("a", { href: cartHref, className: "text-sm font-semibold text-primary underline-offset-2 hover:underline", children: t.viewCart }) })
|
|
14854
14902
|
]
|
|
14855
14903
|
}
|
|
14856
14904
|
);
|
|
14857
14905
|
}
|
|
14858
14906
|
|
|
14859
14907
|
// src/components/checkout-login-prompt.tsx
|
|
14860
|
-
import { cn as
|
|
14861
|
-
import { Fragment as Fragment3, jsx as
|
|
14908
|
+
import { cn as cn17 } from "@reblu/site-ui/utils";
|
|
14909
|
+
import { Fragment as Fragment3, jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
14862
14910
|
var DEFAULT_LABELS6 = {
|
|
14863
14911
|
title: "Identificaci\xF3n",
|
|
14864
14912
|
description: "Introduce tu email para agilizar el proceso o contin\xFAa como invitado.",
|
|
@@ -14885,39 +14933,39 @@ function CheckoutLoginPrompt({
|
|
|
14885
14933
|
if (!open) return null;
|
|
14886
14934
|
const t = { ...DEFAULT_LABELS6, ...labels };
|
|
14887
14935
|
const isValidEmail = EMAIL_PATTERN.test(email.trim());
|
|
14888
|
-
return /* @__PURE__ */
|
|
14889
|
-
/* @__PURE__ */
|
|
14890
|
-
/* @__PURE__ */
|
|
14936
|
+
return /* @__PURE__ */ jsxs18(Fragment3, { children: [
|
|
14937
|
+
/* @__PURE__ */ jsx20("div", { className: "fixed inset-0 z-50 bg-black/50", onClick: onClose, "aria-hidden": "true" }),
|
|
14938
|
+
/* @__PURE__ */ jsxs18(
|
|
14891
14939
|
"div",
|
|
14892
14940
|
{
|
|
14893
14941
|
role: "dialog",
|
|
14894
14942
|
"aria-modal": "true",
|
|
14895
14943
|
"aria-labelledby": "checkout-login-prompt-title",
|
|
14896
14944
|
"data-slot": "checkout-login-prompt",
|
|
14897
|
-
className:
|
|
14945
|
+
className: cn17(
|
|
14898
14946
|
"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",
|
|
14899
14947
|
className
|
|
14900
14948
|
),
|
|
14901
14949
|
children: [
|
|
14902
|
-
/* @__PURE__ */
|
|
14903
|
-
/* @__PURE__ */
|
|
14904
|
-
/* @__PURE__ */
|
|
14905
|
-
/* @__PURE__ */
|
|
14950
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-start justify-between gap-3", children: [
|
|
14951
|
+
/* @__PURE__ */ jsxs18("div", { children: [
|
|
14952
|
+
/* @__PURE__ */ jsx20("h2", { id: "checkout-login-prompt-title", className: "text-xl font-bold", children: t.title }),
|
|
14953
|
+
/* @__PURE__ */ jsx20("p", { className: "mt-1 text-sm text-muted-foreground", children: t.description })
|
|
14906
14954
|
] }),
|
|
14907
|
-
/* @__PURE__ */
|
|
14955
|
+
/* @__PURE__ */ jsx20(
|
|
14908
14956
|
"button",
|
|
14909
14957
|
{
|
|
14910
14958
|
type: "button",
|
|
14911
14959
|
onClick: onClose,
|
|
14912
14960
|
"aria-label": t.close,
|
|
14913
|
-
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",
|
|
14961
|
+
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",
|
|
14914
14962
|
children: "\u2715"
|
|
14915
14963
|
}
|
|
14916
14964
|
)
|
|
14917
14965
|
] }),
|
|
14918
|
-
/* @__PURE__ */
|
|
14919
|
-
/* @__PURE__ */
|
|
14920
|
-
/* @__PURE__ */
|
|
14966
|
+
/* @__PURE__ */ jsxs18("div", { className: "space-y-2", children: [
|
|
14967
|
+
/* @__PURE__ */ jsx20("label", { htmlFor: "checkout-login-prompt-email", className: "text-sm font-medium", children: t.emailLabel }),
|
|
14968
|
+
/* @__PURE__ */ jsx20(
|
|
14921
14969
|
"input",
|
|
14922
14970
|
{
|
|
14923
14971
|
id: "checkout-login-prompt-email",
|
|
@@ -14926,34 +14974,34 @@ function CheckoutLoginPrompt({
|
|
|
14926
14974
|
value: email,
|
|
14927
14975
|
onChange: (e) => onEmailChange(e.target.value),
|
|
14928
14976
|
placeholder: t.emailPlaceholder,
|
|
14929
|
-
className:
|
|
14977
|
+
className: cn17(
|
|
14930
14978
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
14931
14979
|
error ? "border-destructive" : "border-border focus:border-primary"
|
|
14932
14980
|
)
|
|
14933
14981
|
}
|
|
14934
14982
|
),
|
|
14935
|
-
error && /* @__PURE__ */
|
|
14983
|
+
error && /* @__PURE__ */ jsx20("p", { className: "text-xs text-destructive", children: error })
|
|
14936
14984
|
] }),
|
|
14937
|
-
/* @__PURE__ */
|
|
14938
|
-
/* @__PURE__ */
|
|
14985
|
+
/* @__PURE__ */ jsxs18("div", { className: "space-y-2", children: [
|
|
14986
|
+
/* @__PURE__ */ jsx20(
|
|
14939
14987
|
"button",
|
|
14940
14988
|
{
|
|
14941
14989
|
type: "button",
|
|
14942
14990
|
onClick: onSubmitEmail,
|
|
14943
14991
|
disabled: checking || !isValidEmail,
|
|
14944
|
-
className:
|
|
14945
|
-
"flex w-full items-center justify-center gap-2 rounded-xl px-4 py-2.5 text-sm font-semibold transition-all",
|
|
14992
|
+
className: cn17(
|
|
14993
|
+
"flex w-full cursor-pointer items-center justify-center gap-2 rounded-xl px-4 py-2.5 text-sm font-semibold transition-all",
|
|
14946
14994
|
checking || !isValidEmail ? "cursor-not-allowed bg-muted text-muted-foreground" : "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
14947
14995
|
),
|
|
14948
14996
|
children: checking ? t.checking : t.continueWithEmail
|
|
14949
14997
|
}
|
|
14950
14998
|
),
|
|
14951
|
-
/* @__PURE__ */
|
|
14999
|
+
/* @__PURE__ */ jsx20(
|
|
14952
15000
|
"button",
|
|
14953
15001
|
{
|
|
14954
15002
|
type: "button",
|
|
14955
15003
|
onClick: onContinueAsGuest,
|
|
14956
|
-
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",
|
|
15004
|
+
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",
|
|
14957
15005
|
children: t.continueAsGuest
|
|
14958
15006
|
}
|
|
14959
15007
|
)
|
|
@@ -14965,9 +15013,9 @@ function CheckoutLoginPrompt({
|
|
|
14965
15013
|
}
|
|
14966
15014
|
|
|
14967
15015
|
// src/components/checkout-form.tsx
|
|
14968
|
-
import { cn as
|
|
15016
|
+
import { cn as cn18 } from "@reblu/site-ui/utils";
|
|
14969
15017
|
import { PhoneInput } from "@reblu/site-ui/phone-input";
|
|
14970
|
-
import { Fragment as Fragment4, jsx as
|
|
15018
|
+
import { Fragment as Fragment4, jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
14971
15019
|
var DEFAULT_LABELS7 = {
|
|
14972
15020
|
contactTitle: "Datos de contacto",
|
|
14973
15021
|
nameLabel: "Nombre completo",
|
|
@@ -14981,6 +15029,7 @@ var DEFAULT_LABELS7 = {
|
|
|
14981
15029
|
applyingDiscount: "Aplicando\u2026",
|
|
14982
15030
|
removeDiscount: "Quitar",
|
|
14983
15031
|
discountAppliedSuffix: (amount) => `\u2014 ${amount} de descuento`,
|
|
15032
|
+
staffDiscountApplied: "Descuento de personal aplicado",
|
|
14984
15033
|
submit: "Confirmar y pagar",
|
|
14985
15034
|
submitting: "Procesando\u2026"
|
|
14986
15035
|
};
|
|
@@ -14995,6 +15044,7 @@ function CheckoutForm({
|
|
|
14995
15044
|
onApplyDiscount,
|
|
14996
15045
|
onRemoveDiscount,
|
|
14997
15046
|
appliedDiscount,
|
|
15047
|
+
autoDiscount,
|
|
14998
15048
|
discountApplying,
|
|
14999
15049
|
discountError,
|
|
15000
15050
|
loginPrompt,
|
|
@@ -15021,22 +15071,22 @@ function CheckoutForm({
|
|
|
15021
15071
|
event.preventDefault();
|
|
15022
15072
|
if (discountCode.trim() && !discountApplying) onApplyDiscount();
|
|
15023
15073
|
}
|
|
15024
|
-
return /* @__PURE__ */
|
|
15074
|
+
return /* @__PURE__ */ jsxs19(Fragment4, { children: [
|
|
15025
15075
|
loginPrompt,
|
|
15026
|
-
/* @__PURE__ */
|
|
15076
|
+
/* @__PURE__ */ jsxs19(
|
|
15027
15077
|
"form",
|
|
15028
15078
|
{
|
|
15029
15079
|
"data-testid": "checkout-form",
|
|
15030
15080
|
onSubmit,
|
|
15031
|
-
className:
|
|
15081
|
+
className: cn18("space-y-8", className),
|
|
15032
15082
|
"data-slot": "checkout-form",
|
|
15033
15083
|
children: [
|
|
15034
|
-
/* @__PURE__ */
|
|
15035
|
-
/* @__PURE__ */
|
|
15036
|
-
/* @__PURE__ */
|
|
15037
|
-
/* @__PURE__ */
|
|
15038
|
-
/* @__PURE__ */
|
|
15039
|
-
/* @__PURE__ */
|
|
15084
|
+
/* @__PURE__ */ jsxs19("section", { className: "space-y-4", children: [
|
|
15085
|
+
/* @__PURE__ */ jsx21("h2", { className: "border-b border-border pb-2 text-lg font-semibold", children: t.contactTitle }),
|
|
15086
|
+
/* @__PURE__ */ jsxs19("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
|
|
15087
|
+
/* @__PURE__ */ jsxs19("div", { className: "space-y-1", children: [
|
|
15088
|
+
/* @__PURE__ */ jsx21("label", { htmlFor: "checkout-form-name", className: "text-sm font-medium", children: t.nameLabel }),
|
|
15089
|
+
/* @__PURE__ */ jsx21(
|
|
15040
15090
|
"input",
|
|
15041
15091
|
{
|
|
15042
15092
|
id: "checkout-form-name",
|
|
@@ -15045,17 +15095,17 @@ function CheckoutForm({
|
|
|
15045
15095
|
value: contact.name,
|
|
15046
15096
|
onChange: (e) => patchContact({ name: e.target.value }),
|
|
15047
15097
|
placeholder: t.namePlaceholder,
|
|
15048
|
-
className:
|
|
15098
|
+
className: cn18(
|
|
15049
15099
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
15050
15100
|
contactErrors?.name ? "border-destructive" : "border-border focus:border-primary"
|
|
15051
15101
|
)
|
|
15052
15102
|
}
|
|
15053
15103
|
),
|
|
15054
|
-
contactErrors?.name && /* @__PURE__ */
|
|
15104
|
+
contactErrors?.name && /* @__PURE__ */ jsx21("p", { className: "text-xs text-destructive", children: contactErrors.name })
|
|
15055
15105
|
] }),
|
|
15056
|
-
/* @__PURE__ */
|
|
15057
|
-
/* @__PURE__ */
|
|
15058
|
-
/* @__PURE__ */
|
|
15106
|
+
/* @__PURE__ */ jsxs19("div", { className: "space-y-1", children: [
|
|
15107
|
+
/* @__PURE__ */ jsx21("label", { htmlFor: "checkout-form-email", className: "text-sm font-medium", children: t.emailLabel }),
|
|
15108
|
+
/* @__PURE__ */ jsx21(
|
|
15059
15109
|
"input",
|
|
15060
15110
|
{
|
|
15061
15111
|
id: "checkout-form-email",
|
|
@@ -15064,15 +15114,15 @@ function CheckoutForm({
|
|
|
15064
15114
|
value: contact.email,
|
|
15065
15115
|
onChange: (e) => patchContact({ email: e.target.value }),
|
|
15066
15116
|
placeholder: t.emailPlaceholder,
|
|
15067
|
-
className:
|
|
15117
|
+
className: cn18(
|
|
15068
15118
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
15069
15119
|
contactErrors?.email ? "border-destructive" : "border-border focus:border-primary"
|
|
15070
15120
|
)
|
|
15071
15121
|
}
|
|
15072
15122
|
),
|
|
15073
|
-
contactErrors?.email && /* @__PURE__ */
|
|
15123
|
+
contactErrors?.email && /* @__PURE__ */ jsx21("p", { className: "text-xs text-destructive", children: contactErrors.email })
|
|
15074
15124
|
] }),
|
|
15075
|
-
/* @__PURE__ */
|
|
15125
|
+
/* @__PURE__ */ jsx21("div", { className: "space-y-1", children: /* @__PURE__ */ jsx21(
|
|
15076
15126
|
PhoneInput,
|
|
15077
15127
|
{
|
|
15078
15128
|
id: "checkout-form-phone",
|
|
@@ -15086,27 +15136,38 @@ function CheckoutForm({
|
|
|
15086
15136
|
] })
|
|
15087
15137
|
] }),
|
|
15088
15138
|
children2,
|
|
15089
|
-
generalError ? /* @__PURE__ */
|
|
15090
|
-
/* @__PURE__ */
|
|
15091
|
-
/* @__PURE__ */
|
|
15092
|
-
|
|
15093
|
-
|
|
15094
|
-
|
|
15095
|
-
|
|
15139
|
+
generalError ? /* @__PURE__ */ jsx21("p", { role: "alert", className: "text-sm text-destructive", children: generalError }) : null,
|
|
15140
|
+
/* @__PURE__ */ jsxs19("section", { className: "space-y-3", children: [
|
|
15141
|
+
/* @__PURE__ */ jsx21("h2", { className: "border-b border-border pb-2 text-lg font-semibold", children: t.discountTitle }),
|
|
15142
|
+
autoDiscount ? /* @__PURE__ */ jsxs19(
|
|
15143
|
+
"div",
|
|
15144
|
+
{
|
|
15145
|
+
className: "flex items-center gap-2 rounded-lg border border-green-200 bg-green-50 px-4 py-3 text-sm text-green-700 dark:border-green-800 dark:bg-green-900/20 dark:text-green-400",
|
|
15146
|
+
"data-slot": "checkout-staff-discount",
|
|
15147
|
+
children: [
|
|
15148
|
+
/* @__PURE__ */ jsx21("span", { className: "font-semibold", children: t.staffDiscountApplied }),
|
|
15149
|
+
/* @__PURE__ */ jsx21("span", { children: t.discountAppliedSuffix(formatPrice(autoDiscount.amount, currencyCode, locale)) })
|
|
15150
|
+
]
|
|
15151
|
+
}
|
|
15152
|
+
) : null,
|
|
15153
|
+
appliedDiscount && !autoDiscount ? /* @__PURE__ */ jsxs19("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: [
|
|
15154
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2 text-sm text-green-700 dark:text-green-400", children: [
|
|
15155
|
+
/* @__PURE__ */ jsx21("span", { className: "font-semibold", children: appliedDiscount.code }),
|
|
15156
|
+
/* @__PURE__ */ jsx21("span", { children: t.discountAppliedSuffix(formatPrice(appliedDiscount.amount, currencyCode, locale)) })
|
|
15096
15157
|
] }),
|
|
15097
|
-
/* @__PURE__ */
|
|
15158
|
+
/* @__PURE__ */ jsx21(
|
|
15098
15159
|
"button",
|
|
15099
15160
|
{
|
|
15100
15161
|
type: "button",
|
|
15101
15162
|
onClick: onRemoveDiscount,
|
|
15102
15163
|
"aria-label": t.removeDiscount,
|
|
15103
|
-
className: "text-green-600 transition-colors hover:text-green-800 dark:text-green-400 dark:hover:text-green-200",
|
|
15164
|
+
className: "cursor-pointer text-green-600 transition-colors hover:text-green-800 dark:text-green-400 dark:hover:text-green-200",
|
|
15104
15165
|
children: t.removeDiscount
|
|
15105
15166
|
}
|
|
15106
15167
|
)
|
|
15107
|
-
] }) : /* @__PURE__ */
|
|
15108
|
-
/* @__PURE__ */
|
|
15109
|
-
/* @__PURE__ */
|
|
15168
|
+
] }) : /* @__PURE__ */ jsxs19("div", { className: "flex gap-2", children: [
|
|
15169
|
+
/* @__PURE__ */ jsx21("label", { htmlFor: "checkout-form-discount-code", className: "sr-only", children: t.discountTitle }),
|
|
15170
|
+
/* @__PURE__ */ jsx21(
|
|
15110
15171
|
"input",
|
|
15111
15172
|
{
|
|
15112
15173
|
id: "checkout-form-discount-code",
|
|
@@ -15118,26 +15179,26 @@ function CheckoutForm({
|
|
|
15118
15179
|
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"
|
|
15119
15180
|
}
|
|
15120
15181
|
),
|
|
15121
|
-
/* @__PURE__ */
|
|
15182
|
+
/* @__PURE__ */ jsx21(
|
|
15122
15183
|
"button",
|
|
15123
15184
|
{
|
|
15124
15185
|
type: "button",
|
|
15125
15186
|
onClick: onApplyDiscount,
|
|
15126
15187
|
disabled: !discountCode.trim() || discountApplying,
|
|
15127
|
-
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",
|
|
15188
|
+
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",
|
|
15128
15189
|
children: discountApplying ? t.applyingDiscount : t.applyDiscount
|
|
15129
15190
|
}
|
|
15130
15191
|
)
|
|
15131
15192
|
] }),
|
|
15132
|
-
discountError && /* @__PURE__ */
|
|
15193
|
+
discountError && /* @__PURE__ */ jsx21("p", { className: "text-xs text-destructive", children: discountError })
|
|
15133
15194
|
] }),
|
|
15134
|
-
/* @__PURE__ */
|
|
15195
|
+
/* @__PURE__ */ jsx21(
|
|
15135
15196
|
"button",
|
|
15136
15197
|
{
|
|
15137
15198
|
type: "submit",
|
|
15138
15199
|
disabled: submitting || submitDisabled,
|
|
15139
|
-
className:
|
|
15140
|
-
"flex w-full items-center justify-center gap-2 rounded-xl px-4 py-3 font-semibold transition-all",
|
|
15200
|
+
className: cn18(
|
|
15201
|
+
"flex w-full cursor-pointer items-center justify-center gap-2 rounded-xl px-4 py-3 font-semibold transition-all",
|
|
15141
15202
|
submitting || submitDisabled ? "cursor-not-allowed bg-muted text-muted-foreground" : "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
15142
15203
|
),
|
|
15143
15204
|
children: submitting ? t.submitting : t.submit
|
|
@@ -15150,11 +15211,11 @@ function CheckoutForm({
|
|
|
15150
15211
|
}
|
|
15151
15212
|
|
|
15152
15213
|
// src/components/order-confirmation.tsx
|
|
15153
|
-
import { cn as
|
|
15214
|
+
import { cn as cn20 } from "@reblu/site-ui/utils";
|
|
15154
15215
|
|
|
15155
15216
|
// src/components/order-invoice-link.tsx
|
|
15156
|
-
import { cn as
|
|
15157
|
-
import { jsx as
|
|
15217
|
+
import { cn as cn19 } from "@reblu/site-ui/utils";
|
|
15218
|
+
import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
15158
15219
|
var DEFAULT_LABELS8 = {
|
|
15159
15220
|
linkLabel: "Descargar la factura {number}",
|
|
15160
15221
|
signInHint: "Te pediremos que inicies sesi\xF3n para abrirla."
|
|
@@ -15162,8 +15223,8 @@ var DEFAULT_LABELS8 = {
|
|
|
15162
15223
|
function OrderInvoiceLink({ invoice, labels, className }) {
|
|
15163
15224
|
if (!invoice) return null;
|
|
15164
15225
|
const t = { ...DEFAULT_LABELS8, ...labels };
|
|
15165
|
-
return /* @__PURE__ */
|
|
15166
|
-
/* @__PURE__ */
|
|
15226
|
+
return /* @__PURE__ */ jsxs20("div", { className: cn19("space-y-1 text-sm", className), "data-slot": "order-invoice-link", children: [
|
|
15227
|
+
/* @__PURE__ */ jsx22(
|
|
15167
15228
|
"a",
|
|
15168
15229
|
{
|
|
15169
15230
|
href: invoice.url,
|
|
@@ -15171,17 +15232,19 @@ function OrderInvoiceLink({ invoice, labels, className }) {
|
|
|
15171
15232
|
children: t.linkLabel.replace("{number}", invoice.number)
|
|
15172
15233
|
}
|
|
15173
15234
|
),
|
|
15174
|
-
/* @__PURE__ */
|
|
15235
|
+
/* @__PURE__ */ jsx22("p", { className: "text-muted-foreground", children: t.signInHint })
|
|
15175
15236
|
] });
|
|
15176
15237
|
}
|
|
15177
15238
|
|
|
15178
15239
|
// src/components/order-confirmation.tsx
|
|
15179
|
-
import { jsx as
|
|
15240
|
+
import { jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
15180
15241
|
var DEFAULT_LABELS9 = {
|
|
15181
15242
|
pollingTitle: "Confirmando tu pedido\u2026",
|
|
15182
15243
|
pollingDescription: "Estamos procesando el pago, un momento\u2026",
|
|
15183
15244
|
foundTitle: "\xA1Pedido confirmado!",
|
|
15184
|
-
|
|
15245
|
+
// REB-1085: every buyer gets a customer account; the order email carries
|
|
15246
|
+
// the access link. Files are never served from this page.
|
|
15247
|
+
foundDescription: "Te hemos enviado un email con tu acceso.",
|
|
15185
15248
|
timeoutTitle: "Pago recibido",
|
|
15186
15249
|
timeoutDescription: "Tu pago se ha procesado. Recibir\xE1s un email de confirmaci\xF3n en breve.",
|
|
15187
15250
|
orderNumberLabel: "Pedido confirmado",
|
|
@@ -15240,43 +15303,43 @@ function OrderConfirmation({
|
|
|
15240
15303
|
const showOrderReference = Boolean(order) && !showFullOrderSummary && (status === "refunded" || status === "partially_refunded" || status === "pending_timeout");
|
|
15241
15304
|
const showSessionReference = !order && sessionId && (status === "timeout" || status === "not_found" || status === "pending_timeout");
|
|
15242
15305
|
const showRecheck = (status === "pending_timeout" || status === "error") && onRecheck;
|
|
15243
|
-
return /* @__PURE__ */
|
|
15244
|
-
/* @__PURE__ */
|
|
15245
|
-
/* @__PURE__ */
|
|
15246
|
-
showFullOrderSummary && order && /* @__PURE__ */
|
|
15247
|
-
/* @__PURE__ */
|
|
15248
|
-
/* @__PURE__ */
|
|
15249
|
-
/* @__PURE__ */
|
|
15306
|
+
return /* @__PURE__ */ jsxs21("div", { className: cn20("space-y-6 text-center", className), "data-slot": "order-confirmation", children: [
|
|
15307
|
+
/* @__PURE__ */ jsx23("h1", { className: "text-3xl font-bold", children: title }),
|
|
15308
|
+
/* @__PURE__ */ jsx23("p", { className: "text-lg text-muted-foreground", children: description }),
|
|
15309
|
+
showFullOrderSummary && order && /* @__PURE__ */ jsxs21("div", { className: "space-y-6", children: [
|
|
15310
|
+
/* @__PURE__ */ jsxs21("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
15311
|
+
/* @__PURE__ */ jsx23("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.orderNumberLabel }),
|
|
15312
|
+
/* @__PURE__ */ jsx23("p", { className: "font-mono text-lg font-semibold", children: order.orderNumber })
|
|
15250
15313
|
] }),
|
|
15251
|
-
/* @__PURE__ */
|
|
15252
|
-
order.items.map((item, idx) => /* @__PURE__ */
|
|
15314
|
+
/* @__PURE__ */ jsxs21("div", { className: "mx-auto max-w-sm space-y-3 rounded-xl border border-border bg-card p-5 text-left", children: [
|
|
15315
|
+
order.items.map((item, idx) => /* @__PURE__ */ jsxs21(
|
|
15253
15316
|
"div",
|
|
15254
15317
|
{
|
|
15255
15318
|
className: "flex justify-between gap-4 text-sm",
|
|
15256
15319
|
children: [
|
|
15257
|
-
/* @__PURE__ */
|
|
15320
|
+
/* @__PURE__ */ jsxs21("span", { className: "max-w-[60%] truncate text-muted-foreground", children: [
|
|
15258
15321
|
item.product.name,
|
|
15259
15322
|
item.variant ? ` (${item.variant.name})` : "",
|
|
15260
15323
|
" x",
|
|
15261
15324
|
item.quantity
|
|
15262
15325
|
] }),
|
|
15263
|
-
/* @__PURE__ */
|
|
15326
|
+
/* @__PURE__ */ jsx23("span", { children: formatPrice(item.total, currencyCode, locale) })
|
|
15264
15327
|
]
|
|
15265
15328
|
},
|
|
15266
15329
|
idx
|
|
15267
15330
|
)),
|
|
15268
|
-
/* @__PURE__ */
|
|
15269
|
-
/* @__PURE__ */
|
|
15270
|
-
/* @__PURE__ */
|
|
15331
|
+
/* @__PURE__ */ jsx23("div", { className: "space-y-1 border-t border-border pt-3 text-sm", children: /* @__PURE__ */ jsxs21("div", { className: "flex justify-between pt-1 text-base font-bold", children: [
|
|
15332
|
+
/* @__PURE__ */ jsx23("span", { children: t.totalLabel }),
|
|
15333
|
+
/* @__PURE__ */ jsx23("span", { children: formatPrice(order.total, currencyCode, locale) })
|
|
15271
15334
|
] }) })
|
|
15272
15335
|
] }),
|
|
15273
|
-
/* @__PURE__ */
|
|
15336
|
+
/* @__PURE__ */ jsxs21("p", { className: "mx-auto max-w-sm text-sm text-muted-foreground", children: [
|
|
15274
15337
|
t.confirmationEmailPrefix,
|
|
15275
15338
|
" ",
|
|
15276
|
-
/* @__PURE__ */
|
|
15339
|
+
/* @__PURE__ */ jsx23("span", { className: "font-medium text-foreground", children: order.customerEmail }),
|
|
15277
15340
|
"."
|
|
15278
15341
|
] }),
|
|
15279
|
-
/* @__PURE__ */
|
|
15342
|
+
/* @__PURE__ */ jsx23(
|
|
15280
15343
|
OrderInvoiceLink,
|
|
15281
15344
|
{
|
|
15282
15345
|
invoice: order.invoice,
|
|
@@ -15284,11 +15347,11 @@ function OrderConfirmation({
|
|
|
15284
15347
|
}
|
|
15285
15348
|
)
|
|
15286
15349
|
] }),
|
|
15287
|
-
showOrderReference && order && /* @__PURE__ */
|
|
15288
|
-
/* @__PURE__ */
|
|
15289
|
-
/* @__PURE__ */
|
|
15350
|
+
showOrderReference && order && /* @__PURE__ */ jsxs21("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
15351
|
+
/* @__PURE__ */ jsx23("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.orderReferenceLabel }),
|
|
15352
|
+
/* @__PURE__ */ jsx23("p", { className: "font-mono text-lg font-semibold", children: order.orderNumber })
|
|
15290
15353
|
] }),
|
|
15291
|
-
status === "failed" && cartHref && /* @__PURE__ */
|
|
15354
|
+
status === "failed" && cartHref && /* @__PURE__ */ jsx23(
|
|
15292
15355
|
"a",
|
|
15293
15356
|
{
|
|
15294
15357
|
href: cartHref,
|
|
@@ -15296,25 +15359,25 @@ function OrderConfirmation({
|
|
|
15296
15359
|
children: t.backToCartLabel
|
|
15297
15360
|
}
|
|
15298
15361
|
),
|
|
15299
|
-
showRecheck && /* @__PURE__ */
|
|
15362
|
+
showRecheck && /* @__PURE__ */ jsx23(
|
|
15300
15363
|
"button",
|
|
15301
15364
|
{
|
|
15302
15365
|
type: "button",
|
|
15303
15366
|
onClick: onRecheck,
|
|
15304
|
-
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",
|
|
15367
|
+
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",
|
|
15305
15368
|
children: t.recheckLabel
|
|
15306
15369
|
}
|
|
15307
15370
|
),
|
|
15308
|
-
showSessionReference && /* @__PURE__ */
|
|
15309
|
-
/* @__PURE__ */
|
|
15310
|
-
/* @__PURE__ */
|
|
15371
|
+
showSessionReference && /* @__PURE__ */ jsxs21("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
15372
|
+
/* @__PURE__ */ jsx23("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.sessionReferenceLabel }),
|
|
15373
|
+
/* @__PURE__ */ jsx23("p", { className: "break-all font-mono text-sm font-semibold", children: sessionId })
|
|
15311
15374
|
] })
|
|
15312
15375
|
] });
|
|
15313
15376
|
}
|
|
15314
15377
|
|
|
15315
15378
|
// src/components/full-invoice-fields.tsx
|
|
15316
|
-
import { cn as
|
|
15317
|
-
import { jsx as
|
|
15379
|
+
import { cn as cn21 } from "@reblu/site-ui/utils";
|
|
15380
|
+
import { jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
15318
15381
|
var EMPTY_FULL_INVOICE_VALUE = {
|
|
15319
15382
|
wantsFullInvoice: false,
|
|
15320
15383
|
billingIdType: "NIF",
|
|
@@ -15431,12 +15494,12 @@ function FullInvoiceFields({
|
|
|
15431
15494
|
const showFields = value.wantsFullInvoice || overCap;
|
|
15432
15495
|
const isSpanishNif = value.billingIdType === "NIF";
|
|
15433
15496
|
const set = (key2, next2) => onChange({ ...value, [key2]: next2 });
|
|
15434
|
-
const error = (key2) => errors[key2] ? /* @__PURE__ */
|
|
15497
|
+
const error = (key2) => errors[key2] ? /* @__PURE__ */ jsx24("p", { id: `full-invoice-${key2}-error`, className: "text-sm text-destructive", children: errors[key2] }) : null;
|
|
15435
15498
|
const invalid2 = (key2) => errors[key2] ? { "aria-invalid": true, "aria-describedby": `full-invoice-${key2}-error` } : {};
|
|
15436
|
-
return /* @__PURE__ */
|
|
15437
|
-
overCap ? /* @__PURE__ */
|
|
15438
|
-
/* @__PURE__ */
|
|
15439
|
-
/* @__PURE__ */
|
|
15499
|
+
return /* @__PURE__ */ jsxs22("section", { className: cn21("space-y-4", className), "data-slot": "full-invoice-fields", children: [
|
|
15500
|
+
overCap ? /* @__PURE__ */ jsx24("p", { role: "note", className: "rounded-lg border border-border p-4 text-sm", children: t.overCapNotice }) : /* @__PURE__ */ jsxs22("div", { className: "space-y-1", children: [
|
|
15501
|
+
/* @__PURE__ */ jsxs22("label", { className: "flex items-center gap-2 text-sm font-medium", children: [
|
|
15502
|
+
/* @__PURE__ */ jsx24(
|
|
15440
15503
|
"input",
|
|
15441
15504
|
{
|
|
15442
15505
|
type: "checkbox",
|
|
@@ -15446,12 +15509,12 @@ function FullInvoiceFields({
|
|
|
15446
15509
|
),
|
|
15447
15510
|
t.toggle
|
|
15448
15511
|
] }),
|
|
15449
|
-
/* @__PURE__ */
|
|
15512
|
+
/* @__PURE__ */ jsx24("p", { className: "text-sm text-muted-foreground", children: t.underCapNotice })
|
|
15450
15513
|
] }),
|
|
15451
|
-
showFields && /* @__PURE__ */
|
|
15452
|
-
/* @__PURE__ */
|
|
15453
|
-
/* @__PURE__ */
|
|
15454
|
-
/* @__PURE__ */
|
|
15514
|
+
showFields && /* @__PURE__ */ jsxs22("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
|
|
15515
|
+
/* @__PURE__ */ jsxs22("div", { className: "space-y-1", children: [
|
|
15516
|
+
/* @__PURE__ */ jsx24("label", { htmlFor: "full-invoice-id-type", className: "text-sm font-medium", children: t.idType }),
|
|
15517
|
+
/* @__PURE__ */ jsx24(
|
|
15455
15518
|
"select",
|
|
15456
15519
|
{
|
|
15457
15520
|
id: "full-invoice-id-type",
|
|
@@ -15460,14 +15523,14 @@ function FullInvoiceFields({
|
|
|
15460
15523
|
value: value.billingIdType,
|
|
15461
15524
|
onChange: (e) => set("billingIdType", e.target.value),
|
|
15462
15525
|
...invalid2("billingIdType"),
|
|
15463
|
-
children: ID_TYPES.map((type) => /* @__PURE__ */
|
|
15526
|
+
children: ID_TYPES.map((type) => /* @__PURE__ */ jsx24("option", { value: type, children: t.idTypeOptions[type] }, type))
|
|
15464
15527
|
}
|
|
15465
15528
|
),
|
|
15466
15529
|
error("billingIdType")
|
|
15467
15530
|
] }),
|
|
15468
|
-
!isSpanishNif && /* @__PURE__ */
|
|
15469
|
-
/* @__PURE__ */
|
|
15470
|
-
/* @__PURE__ */
|
|
15531
|
+
!isSpanishNif && /* @__PURE__ */ jsxs22("div", { className: "space-y-1", children: [
|
|
15532
|
+
/* @__PURE__ */ jsx24("label", { htmlFor: "full-invoice-id-country", className: "text-sm font-medium", children: t.idCountry }),
|
|
15533
|
+
/* @__PURE__ */ jsxs22(
|
|
15471
15534
|
"select",
|
|
15472
15535
|
{
|
|
15473
15536
|
id: "full-invoice-id-country",
|
|
@@ -15477,16 +15540,16 @@ function FullInvoiceFields({
|
|
|
15477
15540
|
onChange: (e) => set("billingIdCountry", e.target.value),
|
|
15478
15541
|
...invalid2("billingIdCountry"),
|
|
15479
15542
|
children: [
|
|
15480
|
-
/* @__PURE__ */
|
|
15481
|
-
countries.map((c) => /* @__PURE__ */
|
|
15543
|
+
/* @__PURE__ */ jsx24("option", { value: "", disabled: true, children: t.chooseCountry }),
|
|
15544
|
+
countries.map((c) => /* @__PURE__ */ jsx24("option", { value: c.code, children: c.name }, c.code))
|
|
15482
15545
|
]
|
|
15483
15546
|
}
|
|
15484
15547
|
),
|
|
15485
15548
|
error("billingIdCountry")
|
|
15486
15549
|
] }),
|
|
15487
|
-
/* @__PURE__ */
|
|
15488
|
-
/* @__PURE__ */
|
|
15489
|
-
/* @__PURE__ */
|
|
15550
|
+
/* @__PURE__ */ jsxs22("div", { className: "space-y-1", children: [
|
|
15551
|
+
/* @__PURE__ */ jsx24("label", { htmlFor: "full-invoice-nif", className: "text-sm font-medium", children: isSpanishNif ? t.spanishNif : t.documentNumber }),
|
|
15552
|
+
/* @__PURE__ */ jsx24(
|
|
15490
15553
|
"input",
|
|
15491
15554
|
{
|
|
15492
15555
|
id: "full-invoice-nif",
|
|
@@ -15499,9 +15562,9 @@ function FullInvoiceFields({
|
|
|
15499
15562
|
),
|
|
15500
15563
|
error("billingNif")
|
|
15501
15564
|
] }),
|
|
15502
|
-
/* @__PURE__ */
|
|
15503
|
-
/* @__PURE__ */
|
|
15504
|
-
/* @__PURE__ */
|
|
15565
|
+
/* @__PURE__ */ jsxs22("div", { className: "space-y-1", children: [
|
|
15566
|
+
/* @__PURE__ */ jsx24("label", { htmlFor: "full-invoice-name", className: "text-sm font-medium", children: t.name }),
|
|
15567
|
+
/* @__PURE__ */ jsx24(
|
|
15505
15568
|
"input",
|
|
15506
15569
|
{
|
|
15507
15570
|
id: "full-invoice-name",
|
|
@@ -15514,9 +15577,9 @@ function FullInvoiceFields({
|
|
|
15514
15577
|
),
|
|
15515
15578
|
error("billingName")
|
|
15516
15579
|
] }),
|
|
15517
|
-
/* @__PURE__ */
|
|
15518
|
-
/* @__PURE__ */
|
|
15519
|
-
/* @__PURE__ */
|
|
15580
|
+
/* @__PURE__ */ jsxs22("div", { className: "space-y-1 sm:col-span-2", children: [
|
|
15581
|
+
/* @__PURE__ */ jsx24("label", { htmlFor: "full-invoice-street", className: "text-sm font-medium", children: t.street }),
|
|
15582
|
+
/* @__PURE__ */ jsx24(
|
|
15520
15583
|
"input",
|
|
15521
15584
|
{
|
|
15522
15585
|
id: "full-invoice-street",
|
|
@@ -15528,9 +15591,9 @@ function FullInvoiceFields({
|
|
|
15528
15591
|
}
|
|
15529
15592
|
)
|
|
15530
15593
|
] }),
|
|
15531
|
-
/* @__PURE__ */
|
|
15532
|
-
/* @__PURE__ */
|
|
15533
|
-
/* @__PURE__ */
|
|
15594
|
+
/* @__PURE__ */ jsxs22("div", { className: "space-y-1", children: [
|
|
15595
|
+
/* @__PURE__ */ jsx24("label", { htmlFor: "full-invoice-postal-code", className: "text-sm font-medium", children: t.postalCode }),
|
|
15596
|
+
/* @__PURE__ */ jsx24(
|
|
15534
15597
|
"input",
|
|
15535
15598
|
{
|
|
15536
15599
|
id: "full-invoice-postal-code",
|
|
@@ -15541,9 +15604,9 @@ function FullInvoiceFields({
|
|
|
15541
15604
|
}
|
|
15542
15605
|
)
|
|
15543
15606
|
] }),
|
|
15544
|
-
/* @__PURE__ */
|
|
15545
|
-
/* @__PURE__ */
|
|
15546
|
-
/* @__PURE__ */
|
|
15607
|
+
/* @__PURE__ */ jsxs22("div", { className: "space-y-1", children: [
|
|
15608
|
+
/* @__PURE__ */ jsx24("label", { htmlFor: "full-invoice-city", className: "text-sm font-medium", children: t.city }),
|
|
15609
|
+
/* @__PURE__ */ jsx24(
|
|
15547
15610
|
"input",
|
|
15548
15611
|
{
|
|
15549
15612
|
id: "full-invoice-city",
|
|
@@ -15554,9 +15617,9 @@ function FullInvoiceFields({
|
|
|
15554
15617
|
}
|
|
15555
15618
|
)
|
|
15556
15619
|
] }),
|
|
15557
|
-
/* @__PURE__ */
|
|
15558
|
-
/* @__PURE__ */
|
|
15559
|
-
/* @__PURE__ */
|
|
15620
|
+
/* @__PURE__ */ jsxs22("div", { className: "space-y-1", children: [
|
|
15621
|
+
/* @__PURE__ */ jsx24("label", { htmlFor: "full-invoice-country", className: "text-sm font-medium", children: t.country }),
|
|
15622
|
+
/* @__PURE__ */ jsx24(
|
|
15560
15623
|
"select",
|
|
15561
15624
|
{
|
|
15562
15625
|
id: "full-invoice-country",
|
|
@@ -15564,11 +15627,11 @@ function FullInvoiceFields({
|
|
|
15564
15627
|
required: true,
|
|
15565
15628
|
value: value.country,
|
|
15566
15629
|
onChange: (e) => set("country", e.target.value),
|
|
15567
|
-
children: countries.map((c) => /* @__PURE__ */
|
|
15630
|
+
children: countries.map((c) => /* @__PURE__ */ jsx24("option", { value: c.code, children: c.name }, c.code))
|
|
15568
15631
|
}
|
|
15569
15632
|
)
|
|
15570
15633
|
] }),
|
|
15571
|
-
/* @__PURE__ */
|
|
15634
|
+
/* @__PURE__ */ jsx24("div", { className: "sm:col-span-2", children: error("address") })
|
|
15572
15635
|
] })
|
|
15573
15636
|
] });
|
|
15574
15637
|
}
|
|
@@ -15603,6 +15666,7 @@ export {
|
|
|
15603
15666
|
ParentPage,
|
|
15604
15667
|
ProductCard,
|
|
15605
15668
|
ProductTrustItems,
|
|
15669
|
+
ProfessionalFields,
|
|
15606
15670
|
ProfileCard,
|
|
15607
15671
|
SafeHtml,
|
|
15608
15672
|
ShopFilters,
|