@reblu/site-blocks 0.21.0 → 0.22.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 +22 -0
- package/README.md +125 -0
- package/dist/index.cjs +357 -178
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +101 -2
- package/dist/index.d.ts +101 -2
- package/dist/index.js +353 -178
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -27,8 +27,12 @@ __export(src_exports, {
|
|
|
27
27
|
CartSummary: () => CartSummary,
|
|
28
28
|
CheckoutForm: () => CheckoutForm,
|
|
29
29
|
CheckoutLoginPrompt: () => CheckoutLoginPrompt,
|
|
30
|
+
ContactInterestField: () => ContactInterestField,
|
|
31
|
+
CourseCatalogFilters: () => CourseCatalogFilters,
|
|
30
32
|
CourseDescription: () => CourseDescription,
|
|
31
33
|
DATA_REQUEST_TYPES: () => import_site_contracts.DATA_REQUEST_TYPES,
|
|
34
|
+
DEFAULT_COURSE_CATALOG_FILTERS_LABELS: () => DEFAULT_COURSE_CATALOG_FILTERS_LABELS,
|
|
35
|
+
DEFAULT_COURSE_PRICE_BANDS: () => DEFAULT_COURSE_PRICE_BANDS,
|
|
32
36
|
DEFAULT_INVOICE_COUNTRIES: () => DEFAULT_INVOICE_COUNTRIES,
|
|
33
37
|
DEFAULT_LESSON_PREVIEW_LABELS: () => DEFAULT_LESSON_PREVIEW_LABELS,
|
|
34
38
|
DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE: () => DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE,
|
|
@@ -119,7 +123,9 @@ var DEFAULT_SHOP_ERROR_MESSAGES = {
|
|
|
119
123
|
// REB-73 — checkout refusals before any payment.
|
|
120
124
|
BILLING_DATA_REQUIRED: "Para emitir tu factura necesitamos tu NIF/NIE o un documento de identificaci\xF3n, tu nombre y tu direcci\xF3n de facturaci\xF3n.",
|
|
121
125
|
INVOICING_NOT_READY: "No se puede completar la compra en este momento. Int\xE9ntalo m\xE1s tarde.",
|
|
122
|
-
FULL_INVOICE_UNAVAILABLE: "Esta tienda no emite facturas completas: contin\xFAa sin solicitarla."
|
|
126
|
+
FULL_INVOICE_UNAVAILABLE: "Esta tienda no emite facturas completas: contin\xFAa sin solicitarla.",
|
|
127
|
+
// REB-912 — the code used up its total uses; refused before any payment.
|
|
128
|
+
DISCOUNT_LIMIT_REACHED: "Este c\xF3digo ya ha alcanzado su l\xEDmite de usos"
|
|
123
129
|
};
|
|
124
130
|
var DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE = "No se ha podido completar la operaci\xF3n. Int\xE9ntalo de nuevo.";
|
|
125
131
|
function getShopErrorMessage(code, overrides, fallback = DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE) {
|
|
@@ -14798,9 +14804,129 @@ function ShopFilters({
|
|
|
14798
14804
|
] });
|
|
14799
14805
|
}
|
|
14800
14806
|
|
|
14801
|
-
// src/components/
|
|
14807
|
+
// src/components/course-catalog-filters.tsx
|
|
14802
14808
|
var import_utils15 = require("@reblu/site-ui/utils");
|
|
14803
14809
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
14810
|
+
var DEFAULT_COURSE_PRICE_BANDS = [
|
|
14811
|
+
{ max: 5e3 },
|
|
14812
|
+
{ min: 5e3, max: 15e3 },
|
|
14813
|
+
{ min: 15e3, max: 3e4 },
|
|
14814
|
+
{ min: 3e4 }
|
|
14815
|
+
];
|
|
14816
|
+
var DEFAULT_COURSE_CATALOG_FILTERS_LABELS = {
|
|
14817
|
+
instructor: "Docente",
|
|
14818
|
+
allInstructors: "Todos",
|
|
14819
|
+
price: "Precio",
|
|
14820
|
+
free: "Gratis",
|
|
14821
|
+
clearAll: "Quitar filtros",
|
|
14822
|
+
priceUnder: (formattedMax) => `Hasta ${formattedMax}`,
|
|
14823
|
+
priceOver: (formattedMin) => `Desde ${formattedMin}`,
|
|
14824
|
+
priceRange: (formattedMin, formattedMax) => `${formattedMin} \u2013 ${formattedMax}`
|
|
14825
|
+
};
|
|
14826
|
+
function instructorName(instructor) {
|
|
14827
|
+
return [instructor.firstName, instructor.lastName].filter(Boolean).join(" ");
|
|
14828
|
+
}
|
|
14829
|
+
function bandLabel(band, t, currencyCode, locale) {
|
|
14830
|
+
if (band.label) return band.label;
|
|
14831
|
+
const fmt = (cents) => formatPrice(cents, currencyCode, locale);
|
|
14832
|
+
if (band.min !== void 0 && band.max !== void 0)
|
|
14833
|
+
return t.priceRange(fmt(band.min), fmt(band.max));
|
|
14834
|
+
if (band.max !== void 0) return t.priceUnder(fmt(band.max));
|
|
14835
|
+
if (band.min !== void 0) return t.priceOver(fmt(band.min));
|
|
14836
|
+
return "";
|
|
14837
|
+
}
|
|
14838
|
+
function CourseCatalogFilters({
|
|
14839
|
+
instructors,
|
|
14840
|
+
hrefs,
|
|
14841
|
+
active = {},
|
|
14842
|
+
onChange,
|
|
14843
|
+
priceBands = DEFAULT_COURSE_PRICE_BANDS,
|
|
14844
|
+
labels,
|
|
14845
|
+
currencyCode,
|
|
14846
|
+
locale,
|
|
14847
|
+
className
|
|
14848
|
+
}) {
|
|
14849
|
+
const t = { ...DEFAULT_COURSE_CATALOG_FILTERS_LABELS, ...labels };
|
|
14850
|
+
const named = instructors.filter((i) => instructorName(i) !== "");
|
|
14851
|
+
const showInstructors = named.length > 0 || active.instructor !== void 0;
|
|
14852
|
+
const isFree = Boolean(active.free);
|
|
14853
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: (0, import_utils15.cn)("space-y-6", className), "data-slot": "course-catalog-filters", children: [
|
|
14854
|
+
showInstructors && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(FilterFieldset, { legend: t.instructor, children: [
|
|
14855
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
14856
|
+
OptionLink,
|
|
14857
|
+
{
|
|
14858
|
+
href: hrefs.instructor(void 0),
|
|
14859
|
+
active: active.instructor === void 0,
|
|
14860
|
+
label: t.allInstructors,
|
|
14861
|
+
onActivate: onChange ? () => onChange({ instructor: void 0 }) : void 0
|
|
14862
|
+
}
|
|
14863
|
+
),
|
|
14864
|
+
named.map((instructor) => {
|
|
14865
|
+
const isActive = active.instructor === instructor.id;
|
|
14866
|
+
const next2 = isActive ? void 0 : instructor.id;
|
|
14867
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
14868
|
+
OptionLink,
|
|
14869
|
+
{
|
|
14870
|
+
href: hrefs.instructor(next2),
|
|
14871
|
+
active: isActive,
|
|
14872
|
+
label: instructorName(instructor),
|
|
14873
|
+
onActivate: onChange ? () => onChange({ instructor: next2 }) : void 0
|
|
14874
|
+
},
|
|
14875
|
+
instructor.id
|
|
14876
|
+
);
|
|
14877
|
+
})
|
|
14878
|
+
] }),
|
|
14879
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(FilterFieldset, { legend: t.price, children: [
|
|
14880
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
14881
|
+
OptionLink,
|
|
14882
|
+
{
|
|
14883
|
+
href: hrefs.free(!isFree),
|
|
14884
|
+
active: isFree,
|
|
14885
|
+
label: t.free,
|
|
14886
|
+
onActivate: onChange ? () => onChange(
|
|
14887
|
+
isFree ? { free: false } : { free: true, priceMin: void 0, priceMax: void 0 }
|
|
14888
|
+
) : void 0
|
|
14889
|
+
}
|
|
14890
|
+
),
|
|
14891
|
+
priceBands.map((band, i) => {
|
|
14892
|
+
const isActive = !isFree && active.priceMin === band.min && active.priceMax === band.max;
|
|
14893
|
+
const nextMin = isActive ? void 0 : band.min;
|
|
14894
|
+
const nextMax = isActive ? void 0 : band.max;
|
|
14895
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
14896
|
+
OptionLink,
|
|
14897
|
+
{
|
|
14898
|
+
href: hrefs.price(nextMin, nextMax),
|
|
14899
|
+
active: isActive,
|
|
14900
|
+
label: bandLabel(band, t, currencyCode, locale),
|
|
14901
|
+
onActivate: onChange ? () => onChange({ priceMin: nextMin, priceMax: nextMax, free: false }) : void 0
|
|
14902
|
+
},
|
|
14903
|
+
i
|
|
14904
|
+
);
|
|
14905
|
+
})
|
|
14906
|
+
] }),
|
|
14907
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
14908
|
+
"a",
|
|
14909
|
+
{
|
|
14910
|
+
href: hrefs.clearAll(),
|
|
14911
|
+
onClick: onChange ? (event) => {
|
|
14912
|
+
event.preventDefault();
|
|
14913
|
+
onChange({
|
|
14914
|
+
instructor: void 0,
|
|
14915
|
+
priceMin: void 0,
|
|
14916
|
+
priceMax: void 0,
|
|
14917
|
+
free: false
|
|
14918
|
+
});
|
|
14919
|
+
} : void 0,
|
|
14920
|
+
className: "text-sm font-medium text-muted-foreground underline-offset-4 hover:text-foreground hover:underline",
|
|
14921
|
+
children: t.clearAll
|
|
14922
|
+
}
|
|
14923
|
+
)
|
|
14924
|
+
] });
|
|
14925
|
+
}
|
|
14926
|
+
|
|
14927
|
+
// src/components/cart-line-list.tsx
|
|
14928
|
+
var import_utils16 = require("@reblu/site-ui/utils");
|
|
14929
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
14804
14930
|
var DEFAULT_LABELS2 = {
|
|
14805
14931
|
quantityLabel: "Cantidad",
|
|
14806
14932
|
decrease: "Reducir cantidad",
|
|
@@ -14826,9 +14952,9 @@ function CartLineList({
|
|
|
14826
14952
|
}) {
|
|
14827
14953
|
const t = { ...DEFAULT_LABELS2, ...labels };
|
|
14828
14954
|
const noticeContent = notice === true ? t.cancelledNotice : notice;
|
|
14829
|
-
return /* @__PURE__ */ (0,
|
|
14830
|
-
/* @__PURE__ */ (0,
|
|
14831
|
-
noticeContent != null && noticeContent !== false && /* @__PURE__ */ (0,
|
|
14955
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: (0, import_utils16.cn)("space-y-4", className), "data-slot": "cart-line-list", children: [
|
|
14956
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { "aria-live": "polite", className: "sr-only", children: liveMessage }),
|
|
14957
|
+
noticeContent != null && noticeContent !== false && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14832
14958
|
"div",
|
|
14833
14959
|
{
|
|
14834
14960
|
role: "status",
|
|
@@ -14837,33 +14963,33 @@ function CartLineList({
|
|
|
14837
14963
|
children: noticeContent
|
|
14838
14964
|
}
|
|
14839
14965
|
),
|
|
14840
|
-
/* @__PURE__ */ (0,
|
|
14966
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("ul", { className: "space-y-4", children: items.map((item) => {
|
|
14841
14967
|
const maxQty = item.maxStock ?? Infinity;
|
|
14842
14968
|
const atMax = item.quantity >= maxQty;
|
|
14843
14969
|
const atMin = item.quantity <= 1;
|
|
14844
14970
|
const message = lineMessage?.(item);
|
|
14845
|
-
return /* @__PURE__ */ (0,
|
|
14971
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
14846
14972
|
"li",
|
|
14847
14973
|
{
|
|
14848
14974
|
className: "flex gap-4 rounded-xl border border-border bg-card p-4",
|
|
14849
14975
|
children: [
|
|
14850
|
-
/* @__PURE__ */ (0,
|
|
14851
|
-
/* @__PURE__ */ (0,
|
|
14852
|
-
/* @__PURE__ */ (0,
|
|
14853
|
-
item.variantName && /* @__PURE__ */ (0,
|
|
14854
|
-
/* @__PURE__ */ (0,
|
|
14976
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "h-20 w-20 flex-shrink-0 overflow-hidden rounded-lg bg-muted", children: item.imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("img", { src: item.imageUrl, alt: item.name, className: "h-full w-full object-cover" }) : null }),
|
|
14977
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
14978
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "truncate text-sm font-semibold leading-tight", children: item.name }),
|
|
14979
|
+
item.variantName && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "mt-0.5 text-xs text-muted-foreground", children: item.variantName }),
|
|
14980
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("p", { className: "mt-1 text-sm text-muted-foreground", children: [
|
|
14855
14981
|
formatPrice(item.unitPrice, currencyCode, locale),
|
|
14856
14982
|
" ",
|
|
14857
14983
|
t.unitPriceSuffix
|
|
14858
14984
|
] }),
|
|
14859
|
-
/* @__PURE__ */ (0,
|
|
14985
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
14860
14986
|
"div",
|
|
14861
14987
|
{
|
|
14862
14988
|
role: "group",
|
|
14863
14989
|
"aria-label": t.quantityLabel,
|
|
14864
14990
|
className: "mt-3 flex items-center gap-3",
|
|
14865
14991
|
children: [
|
|
14866
|
-
/* @__PURE__ */ (0,
|
|
14992
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14867
14993
|
"button",
|
|
14868
14994
|
{
|
|
14869
14995
|
type: "button",
|
|
@@ -14874,8 +15000,8 @@ function CartLineList({
|
|
|
14874
15000
|
children: "\u2212"
|
|
14875
15001
|
}
|
|
14876
15002
|
),
|
|
14877
|
-
/* @__PURE__ */ (0,
|
|
14878
|
-
/* @__PURE__ */ (0,
|
|
15003
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w-8 text-center text-sm font-semibold tabular-nums", children: item.quantity }),
|
|
15004
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14879
15005
|
"button",
|
|
14880
15006
|
{
|
|
14881
15007
|
type: "button",
|
|
@@ -14886,7 +15012,7 @@ function CartLineList({
|
|
|
14886
15012
|
children: "+"
|
|
14887
15013
|
}
|
|
14888
15014
|
),
|
|
14889
|
-
onRemove && /* @__PURE__ */ (0,
|
|
15015
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14890
15016
|
"button",
|
|
14891
15017
|
{
|
|
14892
15018
|
type: "button",
|
|
@@ -14899,7 +15025,7 @@ function CartLineList({
|
|
|
14899
15025
|
]
|
|
14900
15026
|
}
|
|
14901
15027
|
),
|
|
14902
|
-
message != null && message !== false && /* @__PURE__ */ (0,
|
|
15028
|
+
message != null && message !== false && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
14903
15029
|
"p",
|
|
14904
15030
|
{
|
|
14905
15031
|
className: "mt-2 text-sm text-destructive",
|
|
@@ -14908,7 +15034,7 @@ function CartLineList({
|
|
|
14908
15034
|
}
|
|
14909
15035
|
)
|
|
14910
15036
|
] }),
|
|
14911
|
-
/* @__PURE__ */ (0,
|
|
15037
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex-shrink-0 text-right", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-base font-bold", children: formatPrice(item.unitPrice * item.quantity, currencyCode, locale) }) })
|
|
14912
15038
|
]
|
|
14913
15039
|
},
|
|
14914
15040
|
lineKey(item.productId, item.variantId)
|
|
@@ -14918,8 +15044,8 @@ function CartLineList({
|
|
|
14918
15044
|
}
|
|
14919
15045
|
|
|
14920
15046
|
// src/components/cart-summary.tsx
|
|
14921
|
-
var
|
|
14922
|
-
var
|
|
15047
|
+
var import_utils17 = require("@reblu/site-ui/utils");
|
|
15048
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
14923
15049
|
var DEFAULT_LABELS3 = {
|
|
14924
15050
|
subtotal: "Subtotal",
|
|
14925
15051
|
discountPrefix: "Descuento",
|
|
@@ -14949,37 +15075,37 @@ function CartSummary({
|
|
|
14949
15075
|
const hasDiscount = Boolean(discountAmount && discountAmount > 0);
|
|
14950
15076
|
const noticeContent = notice === true ? t.cancelledNotice : notice;
|
|
14951
15077
|
const hasNotice = noticeContent != null && noticeContent !== false;
|
|
14952
|
-
const breakdown = /* @__PURE__ */ (0,
|
|
15078
|
+
const breakdown = /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
14953
15079
|
"dl",
|
|
14954
15080
|
{
|
|
14955
|
-
className: (0,
|
|
15081
|
+
className: (0, import_utils17.cn)("space-y-2 text-sm", !hasNotice && className),
|
|
14956
15082
|
"data-slot": "cart-summary",
|
|
14957
15083
|
children: [
|
|
14958
|
-
/* @__PURE__ */ (0,
|
|
14959
|
-
/* @__PURE__ */ (0,
|
|
14960
|
-
/* @__PURE__ */ (0,
|
|
15084
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex justify-between text-muted-foreground", children: [
|
|
15085
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("dt", { children: t.subtotal }),
|
|
15086
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("dd", { children: formatPrice(subtotal, currencyCode, locale) })
|
|
14961
15087
|
] }),
|
|
14962
|
-
hasDiscount && /* @__PURE__ */ (0,
|
|
14963
|
-
/* @__PURE__ */ (0,
|
|
14964
|
-
/* @__PURE__ */ (0,
|
|
15088
|
+
hasDiscount && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex justify-between text-green-600 dark:text-green-400", children: [
|
|
15089
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("dt", { children: autoDiscount ? t.staffDiscountApplied : `${t.discountPrefix}${discountCode ? ` (${discountCode})` : ""}` }),
|
|
15090
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("dd", { children: [
|
|
14965
15091
|
"-",
|
|
14966
15092
|
formatPrice(discountAmount, currencyCode, locale)
|
|
14967
15093
|
] })
|
|
14968
15094
|
] }),
|
|
14969
|
-
shippingEnabled && /* @__PURE__ */ (0,
|
|
14970
|
-
/* @__PURE__ */ (0,
|
|
14971
|
-
/* @__PURE__ */ (0,
|
|
15095
|
+
shippingEnabled && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex justify-between text-muted-foreground", children: [
|
|
15096
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("dt", { children: t.shipping }),
|
|
15097
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("dd", { children: shipping == null || !Number.isFinite(shipping) ? t.shippingCalculated : shipping === 0 ? t.freeShipping : formatPrice(shipping, currencyCode, locale) })
|
|
14972
15098
|
] }),
|
|
14973
|
-
/* @__PURE__ */ (0,
|
|
14974
|
-
/* @__PURE__ */ (0,
|
|
14975
|
-
/* @__PURE__ */ (0,
|
|
15099
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex justify-between border-t border-border pt-2 text-base font-bold", children: [
|
|
15100
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("dt", { children: t.total }),
|
|
15101
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("dd", { children: formatPrice(total, currencyCode, locale) })
|
|
14976
15102
|
] })
|
|
14977
15103
|
]
|
|
14978
15104
|
}
|
|
14979
15105
|
);
|
|
14980
15106
|
if (!hasNotice) return breakdown;
|
|
14981
|
-
return /* @__PURE__ */ (0,
|
|
14982
|
-
/* @__PURE__ */ (0,
|
|
15107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: (0, import_utils17.cn)("space-y-3", className), "data-slot": "cart-summary-wrapper", children: [
|
|
15108
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
14983
15109
|
"div",
|
|
14984
15110
|
{
|
|
14985
15111
|
role: "status",
|
|
@@ -14993,8 +15119,8 @@ function CartSummary({
|
|
|
14993
15119
|
}
|
|
14994
15120
|
|
|
14995
15121
|
// src/components/cart-adjustments-notice.tsx
|
|
14996
|
-
var
|
|
14997
|
-
var
|
|
15122
|
+
var import_utils18 = require("@reblu/site-ui/utils");
|
|
15123
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
14998
15124
|
var DEFAULT_LABELS4 = {
|
|
14999
15125
|
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.`,
|
|
15000
15126
|
quantityChanged: (name, quantity) => `Hemos ajustado la cantidad de ${name} a ${quantity} por el stock disponible.`,
|
|
@@ -15028,20 +15154,20 @@ function CartAdjustmentsNotice({
|
|
|
15028
15154
|
);
|
|
15029
15155
|
}
|
|
15030
15156
|
if (messages.length === 0) return null;
|
|
15031
|
-
return /* @__PURE__ */ (0,
|
|
15157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
15032
15158
|
"div",
|
|
15033
15159
|
{
|
|
15034
15160
|
role: "status",
|
|
15035
|
-
className: (0,
|
|
15161
|
+
className: (0, import_utils18.cn)("rounded-lg border border-border bg-muted px-3 py-2 text-sm", className),
|
|
15036
15162
|
"data-slot": "cart-adjustments-notice",
|
|
15037
|
-
children: messages.length === 1 ? /* @__PURE__ */ (0,
|
|
15163
|
+
children: messages.length === 1 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: messages[0] }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("ul", { className: "list-disc space-y-1 pl-4", children: messages.map((message, index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("li", { children: message }, index)) })
|
|
15038
15164
|
}
|
|
15039
15165
|
);
|
|
15040
15166
|
}
|
|
15041
15167
|
|
|
15042
15168
|
// src/components/added-to-cart-toast.tsx
|
|
15043
|
-
var
|
|
15044
|
-
var
|
|
15169
|
+
var import_utils19 = require("@reblu/site-ui/utils");
|
|
15170
|
+
var import_jsx_runtime21 = (
|
|
15045
15171
|
// eslint-disable-next-line @next/next/no-img-element -- toast content, not a Next <Image> layout context
|
|
15046
15172
|
require("react/jsx-runtime")
|
|
15047
15173
|
);
|
|
@@ -15064,32 +15190,32 @@ function AddedToCartToast({
|
|
|
15064
15190
|
const message = status === "error" ? t.error : status === "outOfStock" ? t.outOfStock : t.success;
|
|
15065
15191
|
const hasThumbnail = Boolean(imageUrl && imageUrl.trim().length > 0);
|
|
15066
15192
|
const variant = status === "success" ? "success" : "error";
|
|
15067
|
-
return /* @__PURE__ */ (0,
|
|
15193
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
15068
15194
|
"div",
|
|
15069
15195
|
{
|
|
15070
15196
|
"data-slot": "added-to-cart-toast",
|
|
15071
15197
|
"data-variant": variant,
|
|
15072
|
-
className: (0,
|
|
15198
|
+
className: (0, import_utils19.cn)(
|
|
15073
15199
|
"flex items-center gap-3 rounded-xl border border-border bg-card p-3 text-sm shadow-lg",
|
|
15074
15200
|
variant === "success" && "border-green-600/30 dark:border-green-400/30",
|
|
15075
15201
|
variant === "error" && "border-destructive/30",
|
|
15076
15202
|
className
|
|
15077
15203
|
),
|
|
15078
15204
|
children: [
|
|
15079
|
-
hasThumbnail && /* @__PURE__ */ (0,
|
|
15080
|
-
/* @__PURE__ */ (0,
|
|
15081
|
-
/* @__PURE__ */ (0,
|
|
15082
|
-
/* @__PURE__ */ (0,
|
|
15205
|
+
hasThumbnail && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("img", { src: imageUrl, alt: productName, className: "h-10 w-10 flex-shrink-0 rounded-lg object-cover" }),
|
|
15206
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
15207
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "truncate font-semibold text-foreground", children: productName }),
|
|
15208
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "truncate text-muted-foreground", children: quantity && quantity > 1 ? `${message} \xB7 x${quantity}` : message })
|
|
15083
15209
|
] }),
|
|
15084
|
-
/* @__PURE__ */ (0,
|
|
15210
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("a", { href: cartHref, className: "text-sm font-semibold text-primary underline-offset-2 hover:underline", children: t.viewCart }) })
|
|
15085
15211
|
]
|
|
15086
15212
|
}
|
|
15087
15213
|
);
|
|
15088
15214
|
}
|
|
15089
15215
|
|
|
15090
15216
|
// src/components/checkout-login-prompt.tsx
|
|
15091
|
-
var
|
|
15092
|
-
var
|
|
15217
|
+
var import_utils20 = require("@reblu/site-ui/utils");
|
|
15218
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
15093
15219
|
var DEFAULT_LABELS6 = {
|
|
15094
15220
|
title: "Identificaci\xF3n",
|
|
15095
15221
|
description: "Introduce tu email para agilizar el proceso o contin\xFAa como invitado.",
|
|
@@ -15116,26 +15242,26 @@ function CheckoutLoginPrompt({
|
|
|
15116
15242
|
if (!open) return null;
|
|
15117
15243
|
const t = { ...DEFAULT_LABELS6, ...labels };
|
|
15118
15244
|
const isValidEmail = EMAIL_PATTERN.test(email.trim());
|
|
15119
|
-
return /* @__PURE__ */ (0,
|
|
15120
|
-
/* @__PURE__ */ (0,
|
|
15121
|
-
/* @__PURE__ */ (0,
|
|
15245
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
15246
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "fixed inset-0 z-50 bg-black/50", onClick: onClose, "aria-hidden": "true" }),
|
|
15247
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
15122
15248
|
"div",
|
|
15123
15249
|
{
|
|
15124
15250
|
role: "dialog",
|
|
15125
15251
|
"aria-modal": "true",
|
|
15126
15252
|
"aria-labelledby": "checkout-login-prompt-title",
|
|
15127
15253
|
"data-slot": "checkout-login-prompt",
|
|
15128
|
-
className: (0,
|
|
15254
|
+
className: (0, import_utils20.cn)(
|
|
15129
15255
|
"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",
|
|
15130
15256
|
className
|
|
15131
15257
|
),
|
|
15132
15258
|
children: [
|
|
15133
|
-
/* @__PURE__ */ (0,
|
|
15134
|
-
/* @__PURE__ */ (0,
|
|
15135
|
-
/* @__PURE__ */ (0,
|
|
15136
|
-
/* @__PURE__ */ (0,
|
|
15259
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [
|
|
15260
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { children: [
|
|
15261
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h2", { id: "checkout-login-prompt-title", className: "text-xl font-bold", children: t.title }),
|
|
15262
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "mt-1 text-sm text-muted-foreground", children: t.description })
|
|
15137
15263
|
] }),
|
|
15138
|
-
/* @__PURE__ */ (0,
|
|
15264
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15139
15265
|
"button",
|
|
15140
15266
|
{
|
|
15141
15267
|
type: "button",
|
|
@@ -15146,9 +15272,9 @@ function CheckoutLoginPrompt({
|
|
|
15146
15272
|
}
|
|
15147
15273
|
)
|
|
15148
15274
|
] }),
|
|
15149
|
-
/* @__PURE__ */ (0,
|
|
15150
|
-
/* @__PURE__ */ (0,
|
|
15151
|
-
/* @__PURE__ */ (0,
|
|
15275
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "space-y-2", children: [
|
|
15276
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("label", { htmlFor: "checkout-login-prompt-email", className: "text-sm font-medium", children: t.emailLabel }),
|
|
15277
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15152
15278
|
"input",
|
|
15153
15279
|
{
|
|
15154
15280
|
id: "checkout-login-prompt-email",
|
|
@@ -15157,29 +15283,29 @@ function CheckoutLoginPrompt({
|
|
|
15157
15283
|
value: email,
|
|
15158
15284
|
onChange: (e) => onEmailChange(e.target.value),
|
|
15159
15285
|
placeholder: t.emailPlaceholder,
|
|
15160
|
-
className: (0,
|
|
15286
|
+
className: (0, import_utils20.cn)(
|
|
15161
15287
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
15162
15288
|
error ? "border-destructive" : "border-border focus:border-primary"
|
|
15163
15289
|
)
|
|
15164
15290
|
}
|
|
15165
15291
|
),
|
|
15166
|
-
error && /* @__PURE__ */ (0,
|
|
15292
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-xs text-destructive", children: error })
|
|
15167
15293
|
] }),
|
|
15168
|
-
/* @__PURE__ */ (0,
|
|
15169
|
-
/* @__PURE__ */ (0,
|
|
15294
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "space-y-2", children: [
|
|
15295
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15170
15296
|
"button",
|
|
15171
15297
|
{
|
|
15172
15298
|
type: "button",
|
|
15173
15299
|
onClick: onSubmitEmail,
|
|
15174
15300
|
disabled: checking || !isValidEmail,
|
|
15175
|
-
className: (0,
|
|
15301
|
+
className: (0, import_utils20.cn)(
|
|
15176
15302
|
"flex w-full cursor-pointer items-center justify-center gap-2 rounded-xl px-4 py-2.5 text-sm font-semibold transition-all",
|
|
15177
15303
|
checking || !isValidEmail ? "cursor-not-allowed bg-muted text-muted-foreground" : "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
15178
15304
|
),
|
|
15179
15305
|
children: checking ? t.checking : t.continueWithEmail
|
|
15180
15306
|
}
|
|
15181
15307
|
),
|
|
15182
|
-
/* @__PURE__ */ (0,
|
|
15308
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
15183
15309
|
"button",
|
|
15184
15310
|
{
|
|
15185
15311
|
type: "button",
|
|
@@ -15196,9 +15322,9 @@ function CheckoutLoginPrompt({
|
|
|
15196
15322
|
}
|
|
15197
15323
|
|
|
15198
15324
|
// src/components/checkout-form.tsx
|
|
15199
|
-
var
|
|
15325
|
+
var import_utils21 = require("@reblu/site-ui/utils");
|
|
15200
15326
|
var import_phone_input = require("@reblu/site-ui/phone-input");
|
|
15201
|
-
var
|
|
15327
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
15202
15328
|
var DEFAULT_LABELS7 = {
|
|
15203
15329
|
contactTitle: "Datos de contacto",
|
|
15204
15330
|
nameLabel: "Nombre completo",
|
|
@@ -15254,22 +15380,22 @@ function CheckoutForm({
|
|
|
15254
15380
|
event.preventDefault();
|
|
15255
15381
|
if (discountCode.trim() && !discountApplying) onApplyDiscount();
|
|
15256
15382
|
}
|
|
15257
|
-
return /* @__PURE__ */ (0,
|
|
15383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
15258
15384
|
loginPrompt,
|
|
15259
|
-
/* @__PURE__ */ (0,
|
|
15385
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
15260
15386
|
"form",
|
|
15261
15387
|
{
|
|
15262
15388
|
"data-testid": "checkout-form",
|
|
15263
15389
|
onSubmit,
|
|
15264
|
-
className: (0,
|
|
15390
|
+
className: (0, import_utils21.cn)("space-y-8", className),
|
|
15265
15391
|
"data-slot": "checkout-form",
|
|
15266
15392
|
children: [
|
|
15267
|
-
/* @__PURE__ */ (0,
|
|
15268
|
-
/* @__PURE__ */ (0,
|
|
15269
|
-
/* @__PURE__ */ (0,
|
|
15270
|
-
/* @__PURE__ */ (0,
|
|
15271
|
-
/* @__PURE__ */ (0,
|
|
15272
|
-
/* @__PURE__ */ (0,
|
|
15393
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("section", { className: "space-y-4", children: [
|
|
15394
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("h2", { className: "border-b border-border pb-2 text-lg font-semibold", children: t.contactTitle }),
|
|
15395
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
|
|
15396
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "space-y-1", children: [
|
|
15397
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("label", { htmlFor: "checkout-form-name", className: "text-sm font-medium", children: t.nameLabel }),
|
|
15398
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15273
15399
|
"input",
|
|
15274
15400
|
{
|
|
15275
15401
|
id: "checkout-form-name",
|
|
@@ -15278,17 +15404,17 @@ function CheckoutForm({
|
|
|
15278
15404
|
value: contact.name,
|
|
15279
15405
|
onChange: (e) => patchContact({ name: e.target.value }),
|
|
15280
15406
|
placeholder: t.namePlaceholder,
|
|
15281
|
-
className: (0,
|
|
15407
|
+
className: (0, import_utils21.cn)(
|
|
15282
15408
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
15283
15409
|
contactErrors?.name ? "border-destructive" : "border-border focus:border-primary"
|
|
15284
15410
|
)
|
|
15285
15411
|
}
|
|
15286
15412
|
),
|
|
15287
|
-
contactErrors?.name && /* @__PURE__ */ (0,
|
|
15413
|
+
contactErrors?.name && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-xs text-destructive", children: contactErrors.name })
|
|
15288
15414
|
] }),
|
|
15289
|
-
/* @__PURE__ */ (0,
|
|
15290
|
-
/* @__PURE__ */ (0,
|
|
15291
|
-
/* @__PURE__ */ (0,
|
|
15415
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "space-y-1", children: [
|
|
15416
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("label", { htmlFor: "checkout-form-email", className: "text-sm font-medium", children: t.emailLabel }),
|
|
15417
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15292
15418
|
"input",
|
|
15293
15419
|
{
|
|
15294
15420
|
id: "checkout-form-email",
|
|
@@ -15297,15 +15423,15 @@ function CheckoutForm({
|
|
|
15297
15423
|
value: contact.email,
|
|
15298
15424
|
onChange: (e) => patchContact({ email: e.target.value }),
|
|
15299
15425
|
placeholder: t.emailPlaceholder,
|
|
15300
|
-
className: (0,
|
|
15426
|
+
className: (0, import_utils21.cn)(
|
|
15301
15427
|
"w-full rounded-lg border bg-background px-3 py-2 text-sm transition focus:outline-none focus:ring-2 focus:ring-primary/20",
|
|
15302
15428
|
contactErrors?.email ? "border-destructive" : "border-border focus:border-primary"
|
|
15303
15429
|
)
|
|
15304
15430
|
}
|
|
15305
15431
|
),
|
|
15306
|
-
contactErrors?.email && /* @__PURE__ */ (0,
|
|
15432
|
+
contactErrors?.email && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-xs text-destructive", children: contactErrors.email })
|
|
15307
15433
|
] }),
|
|
15308
|
-
/* @__PURE__ */ (0,
|
|
15434
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15309
15435
|
import_phone_input.PhoneInput,
|
|
15310
15436
|
{
|
|
15311
15437
|
id: "checkout-form-phone",
|
|
@@ -15319,26 +15445,26 @@ function CheckoutForm({
|
|
|
15319
15445
|
] })
|
|
15320
15446
|
] }),
|
|
15321
15447
|
children2,
|
|
15322
|
-
generalError ? /* @__PURE__ */ (0,
|
|
15323
|
-
/* @__PURE__ */ (0,
|
|
15324
|
-
/* @__PURE__ */ (0,
|
|
15325
|
-
autoDiscount ? /* @__PURE__ */ (0,
|
|
15448
|
+
generalError ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { role: "alert", className: "text-sm text-destructive", children: generalError }) : null,
|
|
15449
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("section", { className: "space-y-3", children: [
|
|
15450
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("h2", { className: "border-b border-border pb-2 text-lg font-semibold", children: t.discountTitle }),
|
|
15451
|
+
autoDiscount ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
15326
15452
|
"div",
|
|
15327
15453
|
{
|
|
15328
15454
|
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",
|
|
15329
15455
|
"data-slot": "checkout-staff-discount",
|
|
15330
15456
|
children: [
|
|
15331
|
-
/* @__PURE__ */ (0,
|
|
15332
|
-
/* @__PURE__ */ (0,
|
|
15457
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "font-semibold", children: t.staffDiscountApplied }),
|
|
15458
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: t.discountAppliedSuffix(formatPrice(autoDiscount.amount, currencyCode, locale)) })
|
|
15333
15459
|
]
|
|
15334
15460
|
}
|
|
15335
15461
|
) : null,
|
|
15336
|
-
appliedDiscount && !autoDiscount ? /* @__PURE__ */ (0,
|
|
15337
|
-
/* @__PURE__ */ (0,
|
|
15338
|
-
/* @__PURE__ */ (0,
|
|
15339
|
-
/* @__PURE__ */ (0,
|
|
15462
|
+
appliedDiscount && !autoDiscount ? /* @__PURE__ */ (0, import_jsx_runtime23.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: [
|
|
15463
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex items-center gap-2 text-sm text-green-700 dark:text-green-400", children: [
|
|
15464
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "font-semibold", children: appliedDiscount.code }),
|
|
15465
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children: t.discountAppliedSuffix(formatPrice(appliedDiscount.amount, currencyCode, locale)) })
|
|
15340
15466
|
] }),
|
|
15341
|
-
/* @__PURE__ */ (0,
|
|
15467
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15342
15468
|
"button",
|
|
15343
15469
|
{
|
|
15344
15470
|
type: "button",
|
|
@@ -15348,9 +15474,9 @@ function CheckoutForm({
|
|
|
15348
15474
|
children: t.removeDiscount
|
|
15349
15475
|
}
|
|
15350
15476
|
)
|
|
15351
|
-
] }) : /* @__PURE__ */ (0,
|
|
15352
|
-
/* @__PURE__ */ (0,
|
|
15353
|
-
/* @__PURE__ */ (0,
|
|
15477
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex gap-2", children: [
|
|
15478
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("label", { htmlFor: "checkout-form-discount-code", className: "sr-only", children: t.discountTitle }),
|
|
15479
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15354
15480
|
"input",
|
|
15355
15481
|
{
|
|
15356
15482
|
id: "checkout-form-discount-code",
|
|
@@ -15362,7 +15488,7 @@ function CheckoutForm({
|
|
|
15362
15488
|
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"
|
|
15363
15489
|
}
|
|
15364
15490
|
),
|
|
15365
|
-
/* @__PURE__ */ (0,
|
|
15491
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15366
15492
|
"button",
|
|
15367
15493
|
{
|
|
15368
15494
|
type: "button",
|
|
@@ -15373,14 +15499,14 @@ function CheckoutForm({
|
|
|
15373
15499
|
}
|
|
15374
15500
|
)
|
|
15375
15501
|
] }),
|
|
15376
|
-
discountError && /* @__PURE__ */ (0,
|
|
15502
|
+
discountError && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-xs text-destructive", children: discountError })
|
|
15377
15503
|
] }),
|
|
15378
|
-
/* @__PURE__ */ (0,
|
|
15504
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
15379
15505
|
"button",
|
|
15380
15506
|
{
|
|
15381
15507
|
type: "submit",
|
|
15382
15508
|
disabled: submitting || submitDisabled,
|
|
15383
|
-
className: (0,
|
|
15509
|
+
className: (0, import_utils21.cn)(
|
|
15384
15510
|
"flex w-full cursor-pointer items-center justify-center gap-2 rounded-xl px-4 py-3 font-semibold transition-all",
|
|
15385
15511
|
submitting || submitDisabled ? "cursor-not-allowed bg-muted text-muted-foreground" : "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
15386
15512
|
),
|
|
@@ -15394,11 +15520,11 @@ function CheckoutForm({
|
|
|
15394
15520
|
}
|
|
15395
15521
|
|
|
15396
15522
|
// src/components/order-confirmation.tsx
|
|
15397
|
-
var
|
|
15523
|
+
var import_utils23 = require("@reblu/site-ui/utils");
|
|
15398
15524
|
|
|
15399
15525
|
// src/components/order-invoice-link.tsx
|
|
15400
|
-
var
|
|
15401
|
-
var
|
|
15526
|
+
var import_utils22 = require("@reblu/site-ui/utils");
|
|
15527
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
15402
15528
|
var DEFAULT_LABELS8 = {
|
|
15403
15529
|
linkLabel: "Descargar la factura {number}",
|
|
15404
15530
|
signInHint: "Te pediremos que inicies sesi\xF3n para abrirla."
|
|
@@ -15406,8 +15532,8 @@ var DEFAULT_LABELS8 = {
|
|
|
15406
15532
|
function OrderInvoiceLink({ invoice, labels, className }) {
|
|
15407
15533
|
if (!invoice) return null;
|
|
15408
15534
|
const t = { ...DEFAULT_LABELS8, ...labels };
|
|
15409
|
-
return /* @__PURE__ */ (0,
|
|
15410
|
-
/* @__PURE__ */ (0,
|
|
15535
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: (0, import_utils22.cn)("space-y-1 text-sm", className), "data-slot": "order-invoice-link", children: [
|
|
15536
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
15411
15537
|
"a",
|
|
15412
15538
|
{
|
|
15413
15539
|
href: invoice.url,
|
|
@@ -15415,12 +15541,12 @@ function OrderInvoiceLink({ invoice, labels, className }) {
|
|
|
15415
15541
|
children: t.linkLabel.replace("{number}", invoice.number)
|
|
15416
15542
|
}
|
|
15417
15543
|
),
|
|
15418
|
-
/* @__PURE__ */ (0,
|
|
15544
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-muted-foreground", children: t.signInHint })
|
|
15419
15545
|
] });
|
|
15420
15546
|
}
|
|
15421
15547
|
|
|
15422
15548
|
// src/components/order-confirmation.tsx
|
|
15423
|
-
var
|
|
15549
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
15424
15550
|
var DEFAULT_LABELS9 = {
|
|
15425
15551
|
pollingTitle: "Confirmando tu pedido\u2026",
|
|
15426
15552
|
pollingDescription: "Estamos procesando el pago, un momento\u2026",
|
|
@@ -15486,43 +15612,43 @@ function OrderConfirmation({
|
|
|
15486
15612
|
const showOrderReference = Boolean(order) && !showFullOrderSummary && (status === "refunded" || status === "partially_refunded" || status === "pending_timeout");
|
|
15487
15613
|
const showSessionReference = !order && sessionId && (status === "timeout" || status === "not_found" || status === "pending_timeout");
|
|
15488
15614
|
const showRecheck = (status === "pending_timeout" || status === "error") && onRecheck;
|
|
15489
|
-
return /* @__PURE__ */ (0,
|
|
15490
|
-
/* @__PURE__ */ (0,
|
|
15491
|
-
/* @__PURE__ */ (0,
|
|
15492
|
-
showFullOrderSummary && order && /* @__PURE__ */ (0,
|
|
15493
|
-
/* @__PURE__ */ (0,
|
|
15494
|
-
/* @__PURE__ */ (0,
|
|
15495
|
-
/* @__PURE__ */ (0,
|
|
15615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: (0, import_utils23.cn)("space-y-6 text-center", className), "data-slot": "order-confirmation", children: [
|
|
15616
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h1", { className: "text-3xl font-bold", children: title }),
|
|
15617
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-lg text-muted-foreground", children: description }),
|
|
15618
|
+
showFullOrderSummary && order && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "space-y-6", children: [
|
|
15619
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
15620
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.orderNumberLabel }),
|
|
15621
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "font-mono text-lg font-semibold", children: order.orderNumber })
|
|
15496
15622
|
] }),
|
|
15497
|
-
/* @__PURE__ */ (0,
|
|
15498
|
-
order.items.map((item, idx) => /* @__PURE__ */ (0,
|
|
15623
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "mx-auto max-w-sm space-y-3 rounded-xl border border-border bg-card p-5 text-left", children: [
|
|
15624
|
+
order.items.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
15499
15625
|
"div",
|
|
15500
15626
|
{
|
|
15501
15627
|
className: "flex justify-between gap-4 text-sm",
|
|
15502
15628
|
children: [
|
|
15503
|
-
/* @__PURE__ */ (0,
|
|
15629
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "max-w-[60%] truncate text-muted-foreground", children: [
|
|
15504
15630
|
item.product.name,
|
|
15505
15631
|
item.variant ? ` (${item.variant.name})` : "",
|
|
15506
15632
|
" x",
|
|
15507
15633
|
item.quantity
|
|
15508
15634
|
] }),
|
|
15509
|
-
/* @__PURE__ */ (0,
|
|
15635
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { children: formatPrice(item.total, currencyCode, locale) })
|
|
15510
15636
|
]
|
|
15511
15637
|
},
|
|
15512
15638
|
idx
|
|
15513
15639
|
)),
|
|
15514
|
-
/* @__PURE__ */ (0,
|
|
15515
|
-
/* @__PURE__ */ (0,
|
|
15516
|
-
/* @__PURE__ */ (0,
|
|
15640
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "space-y-1 border-t border-border pt-3 text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex justify-between pt-1 text-base font-bold", children: [
|
|
15641
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { children: t.totalLabel }),
|
|
15642
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { children: formatPrice(order.total, currencyCode, locale) })
|
|
15517
15643
|
] }) })
|
|
15518
15644
|
] }),
|
|
15519
|
-
/* @__PURE__ */ (0,
|
|
15645
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("p", { className: "mx-auto max-w-sm text-sm text-muted-foreground", children: [
|
|
15520
15646
|
t.confirmationEmailPrefix,
|
|
15521
15647
|
" ",
|
|
15522
|
-
/* @__PURE__ */ (0,
|
|
15648
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "font-medium text-foreground", children: order.customerEmail }),
|
|
15523
15649
|
"."
|
|
15524
15650
|
] }),
|
|
15525
|
-
/* @__PURE__ */ (0,
|
|
15651
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
15526
15652
|
OrderInvoiceLink,
|
|
15527
15653
|
{
|
|
15528
15654
|
invoice: order.invoice,
|
|
@@ -15530,11 +15656,11 @@ function OrderConfirmation({
|
|
|
15530
15656
|
}
|
|
15531
15657
|
)
|
|
15532
15658
|
] }),
|
|
15533
|
-
showOrderReference && order && /* @__PURE__ */ (0,
|
|
15534
|
-
/* @__PURE__ */ (0,
|
|
15535
|
-
/* @__PURE__ */ (0,
|
|
15659
|
+
showOrderReference && order && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
15660
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.orderReferenceLabel }),
|
|
15661
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "font-mono text-lg font-semibold", children: order.orderNumber })
|
|
15536
15662
|
] }),
|
|
15537
|
-
status === "failed" && cartHref && /* @__PURE__ */ (0,
|
|
15663
|
+
status === "failed" && cartHref && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
15538
15664
|
"a",
|
|
15539
15665
|
{
|
|
15540
15666
|
href: cartHref,
|
|
@@ -15542,7 +15668,7 @@ function OrderConfirmation({
|
|
|
15542
15668
|
children: t.backToCartLabel
|
|
15543
15669
|
}
|
|
15544
15670
|
),
|
|
15545
|
-
showRecheck && /* @__PURE__ */ (0,
|
|
15671
|
+
showRecheck && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
15546
15672
|
"button",
|
|
15547
15673
|
{
|
|
15548
15674
|
type: "button",
|
|
@@ -15551,16 +15677,16 @@ function OrderConfirmation({
|
|
|
15551
15677
|
children: t.recheckLabel
|
|
15552
15678
|
}
|
|
15553
15679
|
),
|
|
15554
|
-
showSessionReference && /* @__PURE__ */ (0,
|
|
15555
|
-
/* @__PURE__ */ (0,
|
|
15556
|
-
/* @__PURE__ */ (0,
|
|
15680
|
+
showSessionReference && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "inline-block rounded-xl bg-muted px-6 py-4", children: [
|
|
15681
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "mb-1 text-xs uppercase tracking-widest text-muted-foreground", children: t.sessionReferenceLabel }),
|
|
15682
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "break-all font-mono text-sm font-semibold", children: sessionId })
|
|
15557
15683
|
] })
|
|
15558
15684
|
] });
|
|
15559
15685
|
}
|
|
15560
15686
|
|
|
15561
15687
|
// src/components/full-invoice-fields.tsx
|
|
15562
|
-
var
|
|
15563
|
-
var
|
|
15688
|
+
var import_utils24 = require("@reblu/site-ui/utils");
|
|
15689
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
15564
15690
|
var EMPTY_FULL_INVOICE_VALUE = {
|
|
15565
15691
|
wantsFullInvoice: false,
|
|
15566
15692
|
billingIdType: "NIF",
|
|
@@ -15677,12 +15803,12 @@ function FullInvoiceFields({
|
|
|
15677
15803
|
const showFields = value.wantsFullInvoice || overCap;
|
|
15678
15804
|
const isSpanishNif = value.billingIdType === "NIF";
|
|
15679
15805
|
const set = (key2, next2) => onChange({ ...value, [key2]: next2 });
|
|
15680
|
-
const error = (key2) => errors[key2] ? /* @__PURE__ */ (0,
|
|
15806
|
+
const error = (key2) => errors[key2] ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { id: `full-invoice-${key2}-error`, className: "text-sm text-destructive", children: errors[key2] }) : null;
|
|
15681
15807
|
const invalid2 = (key2) => errors[key2] ? { "aria-invalid": true, "aria-describedby": `full-invoice-${key2}-error` } : {};
|
|
15682
|
-
return /* @__PURE__ */ (0,
|
|
15683
|
-
overCap ? /* @__PURE__ */ (0,
|
|
15684
|
-
/* @__PURE__ */ (0,
|
|
15685
|
-
/* @__PURE__ */ (0,
|
|
15808
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("section", { className: (0, import_utils24.cn)("space-y-4", className), "data-slot": "full-invoice-fields", children: [
|
|
15809
|
+
overCap ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { role: "note", className: "rounded-lg border border-border p-4 text-sm", children: t.overCapNotice }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "space-y-1", children: [
|
|
15810
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("label", { className: "flex items-center gap-2 text-sm font-medium", children: [
|
|
15811
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
15686
15812
|
"input",
|
|
15687
15813
|
{
|
|
15688
15814
|
type: "checkbox",
|
|
@@ -15692,12 +15818,12 @@ function FullInvoiceFields({
|
|
|
15692
15818
|
),
|
|
15693
15819
|
t.toggle
|
|
15694
15820
|
] }),
|
|
15695
|
-
/* @__PURE__ */ (0,
|
|
15821
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-sm text-muted-foreground", children: t.underCapNotice })
|
|
15696
15822
|
] }),
|
|
15697
|
-
showFields && /* @__PURE__ */ (0,
|
|
15698
|
-
/* @__PURE__ */ (0,
|
|
15699
|
-
/* @__PURE__ */ (0,
|
|
15700
|
-
/* @__PURE__ */ (0,
|
|
15823
|
+
showFields && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
|
|
15824
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "space-y-1", children: [
|
|
15825
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("label", { htmlFor: "full-invoice-id-type", className: "text-sm font-medium", children: t.idType }),
|
|
15826
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
15701
15827
|
"select",
|
|
15702
15828
|
{
|
|
15703
15829
|
id: "full-invoice-id-type",
|
|
@@ -15706,14 +15832,14 @@ function FullInvoiceFields({
|
|
|
15706
15832
|
value: value.billingIdType,
|
|
15707
15833
|
onChange: (e) => set("billingIdType", e.target.value),
|
|
15708
15834
|
...invalid2("billingIdType"),
|
|
15709
|
-
children: ID_TYPES.map((type) => /* @__PURE__ */ (0,
|
|
15835
|
+
children: ID_TYPES.map((type) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("option", { value: type, children: t.idTypeOptions[type] }, type))
|
|
15710
15836
|
}
|
|
15711
15837
|
),
|
|
15712
15838
|
error("billingIdType")
|
|
15713
15839
|
] }),
|
|
15714
|
-
!isSpanishNif && /* @__PURE__ */ (0,
|
|
15715
|
-
/* @__PURE__ */ (0,
|
|
15716
|
-
/* @__PURE__ */ (0,
|
|
15840
|
+
!isSpanishNif && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "space-y-1", children: [
|
|
15841
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("label", { htmlFor: "full-invoice-id-country", className: "text-sm font-medium", children: t.idCountry }),
|
|
15842
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
15717
15843
|
"select",
|
|
15718
15844
|
{
|
|
15719
15845
|
id: "full-invoice-id-country",
|
|
@@ -15723,16 +15849,16 @@ function FullInvoiceFields({
|
|
|
15723
15849
|
onChange: (e) => set("billingIdCountry", e.target.value),
|
|
15724
15850
|
...invalid2("billingIdCountry"),
|
|
15725
15851
|
children: [
|
|
15726
|
-
/* @__PURE__ */ (0,
|
|
15727
|
-
countries.map((c) => /* @__PURE__ */ (0,
|
|
15852
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("option", { value: "", disabled: true, children: t.chooseCountry }),
|
|
15853
|
+
countries.map((c) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("option", { value: c.code, children: c.name }, c.code))
|
|
15728
15854
|
]
|
|
15729
15855
|
}
|
|
15730
15856
|
),
|
|
15731
15857
|
error("billingIdCountry")
|
|
15732
15858
|
] }),
|
|
15733
|
-
/* @__PURE__ */ (0,
|
|
15734
|
-
/* @__PURE__ */ (0,
|
|
15735
|
-
/* @__PURE__ */ (0,
|
|
15859
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "space-y-1", children: [
|
|
15860
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("label", { htmlFor: "full-invoice-nif", className: "text-sm font-medium", children: isSpanishNif ? t.spanishNif : t.documentNumber }),
|
|
15861
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
15736
15862
|
"input",
|
|
15737
15863
|
{
|
|
15738
15864
|
id: "full-invoice-nif",
|
|
@@ -15745,9 +15871,9 @@ function FullInvoiceFields({
|
|
|
15745
15871
|
),
|
|
15746
15872
|
error("billingNif")
|
|
15747
15873
|
] }),
|
|
15748
|
-
/* @__PURE__ */ (0,
|
|
15749
|
-
/* @__PURE__ */ (0,
|
|
15750
|
-
/* @__PURE__ */ (0,
|
|
15874
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "space-y-1", children: [
|
|
15875
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("label", { htmlFor: "full-invoice-name", className: "text-sm font-medium", children: t.name }),
|
|
15876
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
15751
15877
|
"input",
|
|
15752
15878
|
{
|
|
15753
15879
|
id: "full-invoice-name",
|
|
@@ -15760,9 +15886,9 @@ function FullInvoiceFields({
|
|
|
15760
15886
|
),
|
|
15761
15887
|
error("billingName")
|
|
15762
15888
|
] }),
|
|
15763
|
-
/* @__PURE__ */ (0,
|
|
15764
|
-
/* @__PURE__ */ (0,
|
|
15765
|
-
/* @__PURE__ */ (0,
|
|
15889
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "space-y-1 sm:col-span-2", children: [
|
|
15890
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("label", { htmlFor: "full-invoice-street", className: "text-sm font-medium", children: t.street }),
|
|
15891
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
15766
15892
|
"input",
|
|
15767
15893
|
{
|
|
15768
15894
|
id: "full-invoice-street",
|
|
@@ -15774,9 +15900,9 @@ function FullInvoiceFields({
|
|
|
15774
15900
|
}
|
|
15775
15901
|
)
|
|
15776
15902
|
] }),
|
|
15777
|
-
/* @__PURE__ */ (0,
|
|
15778
|
-
/* @__PURE__ */ (0,
|
|
15779
|
-
/* @__PURE__ */ (0,
|
|
15903
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "space-y-1", children: [
|
|
15904
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("label", { htmlFor: "full-invoice-postal-code", className: "text-sm font-medium", children: t.postalCode }),
|
|
15905
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
15780
15906
|
"input",
|
|
15781
15907
|
{
|
|
15782
15908
|
id: "full-invoice-postal-code",
|
|
@@ -15787,9 +15913,9 @@ function FullInvoiceFields({
|
|
|
15787
15913
|
}
|
|
15788
15914
|
)
|
|
15789
15915
|
] }),
|
|
15790
|
-
/* @__PURE__ */ (0,
|
|
15791
|
-
/* @__PURE__ */ (0,
|
|
15792
|
-
/* @__PURE__ */ (0,
|
|
15916
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "space-y-1", children: [
|
|
15917
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("label", { htmlFor: "full-invoice-city", className: "text-sm font-medium", children: t.city }),
|
|
15918
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
15793
15919
|
"input",
|
|
15794
15920
|
{
|
|
15795
15921
|
id: "full-invoice-city",
|
|
@@ -15800,9 +15926,9 @@ function FullInvoiceFields({
|
|
|
15800
15926
|
}
|
|
15801
15927
|
)
|
|
15802
15928
|
] }),
|
|
15803
|
-
/* @__PURE__ */ (0,
|
|
15804
|
-
/* @__PURE__ */ (0,
|
|
15805
|
-
/* @__PURE__ */ (0,
|
|
15929
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "space-y-1", children: [
|
|
15930
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("label", { htmlFor: "full-invoice-country", className: "text-sm font-medium", children: t.country }),
|
|
15931
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
15806
15932
|
"select",
|
|
15807
15933
|
{
|
|
15808
15934
|
id: "full-invoice-country",
|
|
@@ -15810,15 +15936,64 @@ function FullInvoiceFields({
|
|
|
15810
15936
|
required: true,
|
|
15811
15937
|
value: value.country,
|
|
15812
15938
|
onChange: (e) => set("country", e.target.value),
|
|
15813
|
-
children: countries.map((c) => /* @__PURE__ */ (0,
|
|
15939
|
+
children: countries.map((c) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("option", { value: c.code, children: c.name }, c.code))
|
|
15814
15940
|
}
|
|
15815
15941
|
)
|
|
15816
15942
|
] }),
|
|
15817
|
-
/* @__PURE__ */ (0,
|
|
15943
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "sm:col-span-2", children: error("address") })
|
|
15818
15944
|
] })
|
|
15819
15945
|
] });
|
|
15820
15946
|
}
|
|
15821
15947
|
|
|
15948
|
+
// src/components/contact-interest-field.tsx
|
|
15949
|
+
var import_utils25 = require("@reblu/site-ui/utils");
|
|
15950
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
15951
|
+
function ContactInterestField({
|
|
15952
|
+
interest,
|
|
15953
|
+
value,
|
|
15954
|
+
onChange,
|
|
15955
|
+
idPrefix = "contact-interest",
|
|
15956
|
+
disabled,
|
|
15957
|
+
className
|
|
15958
|
+
}) {
|
|
15959
|
+
if (!interest || interest.options.length === 0) return null;
|
|
15960
|
+
const chosen = new Set(value);
|
|
15961
|
+
const toggle = (option2, checked) => {
|
|
15962
|
+
const next2 = new Set(chosen);
|
|
15963
|
+
if (checked) next2.add(option2);
|
|
15964
|
+
else next2.delete(option2);
|
|
15965
|
+
onChange(interest.options.filter((candidate) => next2.has(candidate)));
|
|
15966
|
+
};
|
|
15967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("fieldset", { "data-slot": "contact-interest", className: (0, import_utils25.cn)("space-y-2", className), children: [
|
|
15968
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("legend", { className: "text-sm font-medium", children: interest.label }),
|
|
15969
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex flex-col gap-2", children: interest.options.map((option2, index) => {
|
|
15970
|
+
const id = `${idPrefix}-${index}`;
|
|
15971
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
15972
|
+
"label",
|
|
15973
|
+
{
|
|
15974
|
+
htmlFor: id,
|
|
15975
|
+
"data-slot": "contact-interest-option",
|
|
15976
|
+
className: "flex items-center gap-2 text-sm",
|
|
15977
|
+
children: [
|
|
15978
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
15979
|
+
"input",
|
|
15980
|
+
{
|
|
15981
|
+
id,
|
|
15982
|
+
type: "checkbox",
|
|
15983
|
+
checked: chosen.has(option2),
|
|
15984
|
+
disabled,
|
|
15985
|
+
onChange: (event) => toggle(option2, event.target.checked)
|
|
15986
|
+
}
|
|
15987
|
+
),
|
|
15988
|
+
option2
|
|
15989
|
+
]
|
|
15990
|
+
},
|
|
15991
|
+
option2
|
|
15992
|
+
);
|
|
15993
|
+
}) })
|
|
15994
|
+
] });
|
|
15995
|
+
}
|
|
15996
|
+
|
|
15822
15997
|
// src/index.ts
|
|
15823
15998
|
var import_site_contracts = require("@reblu/site-contracts");
|
|
15824
15999
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -15830,8 +16005,12 @@ var import_site_contracts = require("@reblu/site-contracts");
|
|
|
15830
16005
|
CartSummary,
|
|
15831
16006
|
CheckoutForm,
|
|
15832
16007
|
CheckoutLoginPrompt,
|
|
16008
|
+
ContactInterestField,
|
|
16009
|
+
CourseCatalogFilters,
|
|
15833
16010
|
CourseDescription,
|
|
15834
16011
|
DATA_REQUEST_TYPES,
|
|
16012
|
+
DEFAULT_COURSE_CATALOG_FILTERS_LABELS,
|
|
16013
|
+
DEFAULT_COURSE_PRICE_BANDS,
|
|
15835
16014
|
DEFAULT_INVOICE_COUNTRIES,
|
|
15836
16015
|
DEFAULT_LESSON_PREVIEW_LABELS,
|
|
15837
16016
|
DEFAULT_SHOP_ERROR_FALLBACK_MESSAGE,
|