@cimplify/sdk 0.55.0 → 0.57.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/dist/react.d.mts +441 -2
- package/dist/react.d.ts +441 -2
- package/dist/react.js +2026 -454
- package/dist/react.mjs +1573 -55
- package/dist/server.d.mts +12 -1
- package/dist/server.d.ts +12 -1
- package/dist/server.js +57 -5
- package/dist/server.mjs +55 -6
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/react.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { DURATION_UNIT,
|
|
2
|
+
import { DURATION_UNIT, getVariantDisplayName, INPUT_FIELD_TYPE, PRODUCT_TYPE, startSignIn, RENDER_HINT } from './chunk-XYI4NXWG.mjs';
|
|
3
3
|
export { getVariantDisplayName } from './chunk-XYI4NXWG.mjs';
|
|
4
4
|
import { createCimplifyClient } from './chunk-SQ7U3BWY.mjs';
|
|
5
5
|
import { ELEMENT_TYPES, EVENT_TYPES } from './chunk-I4IXPQIX.mjs';
|
|
6
6
|
import { formatPrice, parsePrice, getUnitPriceAtQuantity, isOnSale, getDiscountPercentage, getBasePrice, getPriceRange, formatPriceRange } from './chunk-TD3AY34U.mjs';
|
|
7
7
|
import { isSupportedCurrency } from './chunk-AMZXALF6.mjs';
|
|
8
8
|
import './chunk-3G6RQLXK.mjs';
|
|
9
|
-
import
|
|
9
|
+
import React12, { createContext, useRef, useState, useCallback, useEffect, useContext, useMemo, useId, useSyncExternalStore } from 'react';
|
|
10
10
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
11
11
|
import { clsx } from 'clsx';
|
|
12
12
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -14,7 +14,7 @@ import { NumberField } from '@base-ui/react/number-field';
|
|
|
14
14
|
import { RadioGroup } from '@base-ui/react/radio-group';
|
|
15
15
|
import { Radio } from '@base-ui/react/radio';
|
|
16
16
|
import { Checkbox } from '@base-ui/react/checkbox';
|
|
17
|
-
import { Button } from '@base-ui/react/button';
|
|
17
|
+
import { Button as Button$1 } from '@base-ui/react/button';
|
|
18
18
|
import { Popover } from '@base-ui/react/popover';
|
|
19
19
|
import { DayPicker } from 'react-day-picker';
|
|
20
20
|
import { format, parseISO, isValid } from 'date-fns';
|
|
@@ -1426,14 +1426,14 @@ function CimplifyCheckout({
|
|
|
1426
1426
|
const resolvedCartRef = useRef(resolvedCart);
|
|
1427
1427
|
resolvedCartRef.current = resolvedCart;
|
|
1428
1428
|
const isDark = appearance?.theme === "dark";
|
|
1429
|
-
const emitStatus =
|
|
1429
|
+
const emitStatus = React12.useEffectEvent(
|
|
1430
1430
|
(nextStatus, context = {}) => {
|
|
1431
1431
|
setStatus(nextStatus);
|
|
1432
1432
|
setStatusText(context.display_text || "");
|
|
1433
1433
|
onStatusChange?.(nextStatus, context);
|
|
1434
1434
|
}
|
|
1435
1435
|
);
|
|
1436
|
-
const fireError =
|
|
1436
|
+
const fireError = React12.useEffectEvent(
|
|
1437
1437
|
(error) => {
|
|
1438
1438
|
onError?.(error);
|
|
1439
1439
|
}
|
|
@@ -1529,7 +1529,7 @@ function CimplifyCheckout({
|
|
|
1529
1529
|
activeCheckoutRef.current = null;
|
|
1530
1530
|
};
|
|
1531
1531
|
}, []);
|
|
1532
|
-
const handleSubmit =
|
|
1532
|
+
const handleSubmit = React12.useEffectEvent(async () => {
|
|
1533
1533
|
if (isSubmitting || isInitializing || !resolvedCartId) {
|
|
1534
1534
|
if (!resolvedCartId && !isInitializing) {
|
|
1535
1535
|
const message = "Your cart is empty. Add items before checkout.";
|
|
@@ -1750,6 +1750,944 @@ function CimplifyAccount({
|
|
|
1750
1750
|
}
|
|
1751
1751
|
);
|
|
1752
1752
|
}
|
|
1753
|
+
var BUTTON_BASE = "inline-flex items-center justify-center gap-2 font-semibold leading-none transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 disabled:opacity-50 disabled:cursor-not-allowed [font-family:inherit] cursor-pointer rounded-[10px]";
|
|
1754
|
+
var BUTTON_VARIANTS = {
|
|
1755
|
+
primary: "bg-foreground text-background hover:bg-foreground/90",
|
|
1756
|
+
secondary: "bg-card text-foreground border border-border hover:bg-muted/40 hover:border-foreground/40",
|
|
1757
|
+
ghost: "bg-transparent text-foreground/80 hover:bg-muted/40 hover:text-foreground",
|
|
1758
|
+
danger: "bg-transparent text-destructive border border-border hover:bg-destructive/10 hover:border-destructive"
|
|
1759
|
+
};
|
|
1760
|
+
var BUTTON_SIZES = {
|
|
1761
|
+
sm: "px-[13px] py-[7px] text-[12.5px]",
|
|
1762
|
+
md: "px-[18px] py-[10px] text-[13.5px]"
|
|
1763
|
+
};
|
|
1764
|
+
var Button = React12.forwardRef(function Button2({ variant = "primary", size = "md", className, children, ...props }, ref) {
|
|
1765
|
+
return /* @__PURE__ */ jsx(
|
|
1766
|
+
"button",
|
|
1767
|
+
{
|
|
1768
|
+
ref,
|
|
1769
|
+
type: props.type ?? "button",
|
|
1770
|
+
className: cn(BUTTON_BASE, BUTTON_VARIANTS[variant], BUTTON_SIZES[size], className),
|
|
1771
|
+
"data-cimplify-account-button": true,
|
|
1772
|
+
"data-variant": variant,
|
|
1773
|
+
...props,
|
|
1774
|
+
children
|
|
1775
|
+
}
|
|
1776
|
+
);
|
|
1777
|
+
});
|
|
1778
|
+
var STATUS_COLOR = {
|
|
1779
|
+
preparing: "text-amber-600",
|
|
1780
|
+
active: "text-amber-600",
|
|
1781
|
+
delivered: "text-emerald-600",
|
|
1782
|
+
completed: "text-foreground/55",
|
|
1783
|
+
cancelled: "text-destructive",
|
|
1784
|
+
paused: "text-foreground/55"
|
|
1785
|
+
};
|
|
1786
|
+
var STATUS_WEIGHT = {
|
|
1787
|
+
preparing: "font-semibold",
|
|
1788
|
+
active: "font-semibold",
|
|
1789
|
+
delivered: "font-medium",
|
|
1790
|
+
completed: "font-medium",
|
|
1791
|
+
cancelled: "font-medium",
|
|
1792
|
+
paused: "font-medium"
|
|
1793
|
+
};
|
|
1794
|
+
var STATUS_DEFAULT_LABEL = {
|
|
1795
|
+
preparing: "In progress",
|
|
1796
|
+
active: "Active",
|
|
1797
|
+
delivered: "Delivered",
|
|
1798
|
+
completed: "Completed",
|
|
1799
|
+
cancelled: "Cancelled",
|
|
1800
|
+
paused: "Paused"
|
|
1801
|
+
};
|
|
1802
|
+
function Status({ status, className }) {
|
|
1803
|
+
const label = status.label ?? STATUS_DEFAULT_LABEL[status.kind];
|
|
1804
|
+
return /* @__PURE__ */ jsxs(
|
|
1805
|
+
"span",
|
|
1806
|
+
{
|
|
1807
|
+
"data-cimplify-account-status": true,
|
|
1808
|
+
"data-kind": status.kind,
|
|
1809
|
+
className: cn(
|
|
1810
|
+
"inline-flex items-center gap-[7px] text-[12.5px]",
|
|
1811
|
+
STATUS_COLOR[status.kind],
|
|
1812
|
+
STATUS_WEIGHT[status.kind],
|
|
1813
|
+
className
|
|
1814
|
+
),
|
|
1815
|
+
children: [
|
|
1816
|
+
/* @__PURE__ */ jsx("span", { className: "size-[7px] rounded-full bg-current", "aria-hidden": true }),
|
|
1817
|
+
label
|
|
1818
|
+
]
|
|
1819
|
+
}
|
|
1820
|
+
);
|
|
1821
|
+
}
|
|
1822
|
+
function BackLink({ label = "Back", className, ...props }) {
|
|
1823
|
+
return /* @__PURE__ */ jsxs(
|
|
1824
|
+
"a",
|
|
1825
|
+
{
|
|
1826
|
+
"data-cimplify-account-back": true,
|
|
1827
|
+
className: cn(
|
|
1828
|
+
"inline-flex items-center gap-1.5 text-[13px] text-foreground/55 hover:text-primary",
|
|
1829
|
+
"transition-colors mb-7",
|
|
1830
|
+
className
|
|
1831
|
+
),
|
|
1832
|
+
...props,
|
|
1833
|
+
children: [
|
|
1834
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "\u2190" }),
|
|
1835
|
+
props.children ?? label
|
|
1836
|
+
]
|
|
1837
|
+
}
|
|
1838
|
+
);
|
|
1839
|
+
}
|
|
1840
|
+
function FilterTabs({
|
|
1841
|
+
items,
|
|
1842
|
+
value,
|
|
1843
|
+
onChange,
|
|
1844
|
+
className
|
|
1845
|
+
}) {
|
|
1846
|
+
return /* @__PURE__ */ jsx(
|
|
1847
|
+
"div",
|
|
1848
|
+
{
|
|
1849
|
+
role: "tablist",
|
|
1850
|
+
"data-cimplify-account-filter-tabs": true,
|
|
1851
|
+
className: cn("flex gap-0 border-b border-border/60 mb-7 overflow-x-auto", className),
|
|
1852
|
+
children: items.map((item) => {
|
|
1853
|
+
const active = item.value === value;
|
|
1854
|
+
return /* @__PURE__ */ jsxs(
|
|
1855
|
+
"button",
|
|
1856
|
+
{
|
|
1857
|
+
role: "tab",
|
|
1858
|
+
"aria-selected": active,
|
|
1859
|
+
type: "button",
|
|
1860
|
+
onClick: () => onChange?.(item.value),
|
|
1861
|
+
"data-active": active || void 0,
|
|
1862
|
+
className: cn(
|
|
1863
|
+
"inline-flex items-baseline gap-2 px-4 pt-3 pb-[13px] text-[13.5px]",
|
|
1864
|
+
"border-b-2 -mb-px whitespace-nowrap transition-colors",
|
|
1865
|
+
active ? "text-foreground border-foreground font-semibold" : "text-foreground/55 border-transparent hover:text-foreground font-medium"
|
|
1866
|
+
),
|
|
1867
|
+
children: [
|
|
1868
|
+
item.label,
|
|
1869
|
+
item.count !== void 0 && /* @__PURE__ */ jsx(
|
|
1870
|
+
"span",
|
|
1871
|
+
{
|
|
1872
|
+
className: cn(
|
|
1873
|
+
"text-[11.5px] tabular-nums font-medium",
|
|
1874
|
+
active ? "text-foreground/70" : "text-foreground/55"
|
|
1875
|
+
),
|
|
1876
|
+
children: item.count
|
|
1877
|
+
}
|
|
1878
|
+
)
|
|
1879
|
+
]
|
|
1880
|
+
},
|
|
1881
|
+
item.value
|
|
1882
|
+
);
|
|
1883
|
+
})
|
|
1884
|
+
}
|
|
1885
|
+
);
|
|
1886
|
+
}
|
|
1887
|
+
function EmptyState({ glyph, title, description, action, className }) {
|
|
1888
|
+
return /* @__PURE__ */ jsxs(
|
|
1889
|
+
"div",
|
|
1890
|
+
{
|
|
1891
|
+
"data-cimplify-account-empty": true,
|
|
1892
|
+
className: cn(
|
|
1893
|
+
"rounded-[16px] border border-dashed border-border bg-card",
|
|
1894
|
+
"px-6 py-20 text-center",
|
|
1895
|
+
className
|
|
1896
|
+
),
|
|
1897
|
+
children: [
|
|
1898
|
+
glyph && /* @__PURE__ */ jsx("div", { className: "mx-auto mb-5 size-14 rounded-[12px] bg-muted/40 text-foreground/55 grid place-items-center", children: glyph }),
|
|
1899
|
+
/* @__PURE__ */ jsx("h3", { className: "font-serif text-[22px] font-semibold tracking-[-0.02em] text-foreground mb-2", children: title }),
|
|
1900
|
+
description && /* @__PURE__ */ jsx("p", { className: "mx-auto mb-6 max-w-[380px] text-sm leading-[1.55] text-foreground/70", children: description }),
|
|
1901
|
+
action
|
|
1902
|
+
]
|
|
1903
|
+
}
|
|
1904
|
+
);
|
|
1905
|
+
}
|
|
1906
|
+
function ErrorState({
|
|
1907
|
+
title = "Something went wrong",
|
|
1908
|
+
message = "We couldn't load this right now. Try again in a moment.",
|
|
1909
|
+
onRetry,
|
|
1910
|
+
className
|
|
1911
|
+
}) {
|
|
1912
|
+
return /* @__PURE__ */ jsxs(
|
|
1913
|
+
"div",
|
|
1914
|
+
{
|
|
1915
|
+
"data-cimplify-account-error": true,
|
|
1916
|
+
className: cn("rounded-[16px] border border-border bg-card px-6 py-8 text-center", className),
|
|
1917
|
+
children: [
|
|
1918
|
+
/* @__PURE__ */ jsx("div", { className: "mx-auto mb-4 size-11 rounded-[12px] bg-destructive/10 text-destructive grid place-items-center", children: /* @__PURE__ */ jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", children: [
|
|
1919
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "9" }),
|
|
1920
|
+
/* @__PURE__ */ jsx("path", { d: "M12 8v5M12 16v.5" })
|
|
1921
|
+
] }) }),
|
|
1922
|
+
/* @__PURE__ */ jsx("h4", { className: "text-sm font-semibold mb-1.5 text-foreground", children: title }),
|
|
1923
|
+
/* @__PURE__ */ jsx("p", { className: "text-[12.5px] text-foreground/55 mb-4 leading-[1.5]", children: message }),
|
|
1924
|
+
onRetry && /* @__PURE__ */ jsx(Button, { variant: "secondary", size: "sm", onClick: onRetry, children: "Try again" })
|
|
1925
|
+
]
|
|
1926
|
+
}
|
|
1927
|
+
);
|
|
1928
|
+
}
|
|
1929
|
+
function Skeleton({ className, variant = "block" }) {
|
|
1930
|
+
if (variant === "row") {
|
|
1931
|
+
return /* @__PURE__ */ jsxs("div", { "data-cimplify-account-skeleton": true, className: cn("grid grid-cols-[44px_1fr_60px] gap-3 items-center py-3", className), children: [
|
|
1932
|
+
/* @__PURE__ */ jsx("div", { className: "size-11 rounded-md bg-muted/50 animate-pulse" }),
|
|
1933
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
1934
|
+
/* @__PURE__ */ jsx("div", { className: "h-3 bg-muted/50 rounded animate-pulse w-3/4" }),
|
|
1935
|
+
/* @__PURE__ */ jsx("div", { className: "h-2.5 bg-muted/40 rounded animate-pulse w-1/2" })
|
|
1936
|
+
] }),
|
|
1937
|
+
/* @__PURE__ */ jsx("div", { className: "h-4 bg-muted/50 rounded animate-pulse" })
|
|
1938
|
+
] });
|
|
1939
|
+
}
|
|
1940
|
+
return /* @__PURE__ */ jsx("div", { "data-cimplify-account-skeleton": true, className: cn("bg-muted/50 rounded-md animate-pulse", className) });
|
|
1941
|
+
}
|
|
1942
|
+
function Toast({ title, description, onUndo, onDismiss, className }) {
|
|
1943
|
+
return /* @__PURE__ */ jsxs(
|
|
1944
|
+
"div",
|
|
1945
|
+
{
|
|
1946
|
+
"data-cimplify-account-toast": true,
|
|
1947
|
+
role: "status",
|
|
1948
|
+
"aria-live": "polite",
|
|
1949
|
+
className: cn(
|
|
1950
|
+
"relative grid grid-cols-[22px_1fr_auto_auto] gap-3 items-center mb-6",
|
|
1951
|
+
"rounded-[10px] bg-foreground text-background px-4 py-3.5 pr-5 text-[13.5px]",
|
|
1952
|
+
"shadow-[0_1px_0_rgba(0,0,0,0.04),0_8px_24px_rgba(0,0,0,0.12)]",
|
|
1953
|
+
className
|
|
1954
|
+
),
|
|
1955
|
+
children: [
|
|
1956
|
+
/* @__PURE__ */ jsx("div", { className: "size-[22px] rounded-full bg-emerald-500 grid place-items-center", children: /* @__PURE__ */ jsx("svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "none", stroke: "white", strokeWidth: "2.4", children: /* @__PURE__ */ jsx("path", { d: "M4 8.5l2.5 2.5L12 5.5" }) }) }),
|
|
1957
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
1958
|
+
/* @__PURE__ */ jsx("div", { className: "font-semibold", children: title }),
|
|
1959
|
+
description && /* @__PURE__ */ jsx("div", { className: "text-[12px] opacity-75 mt-0.5", children: description })
|
|
1960
|
+
] }),
|
|
1961
|
+
onUndo && /* @__PURE__ */ jsx(
|
|
1962
|
+
"button",
|
|
1963
|
+
{
|
|
1964
|
+
type: "button",
|
|
1965
|
+
onClick: onUndo,
|
|
1966
|
+
className: "rounded-[8px] border border-white/20 bg-transparent text-background px-3 py-1.5 text-[12.5px] font-semibold hover:bg-white/10",
|
|
1967
|
+
children: "Undo"
|
|
1968
|
+
}
|
|
1969
|
+
),
|
|
1970
|
+
onDismiss && /* @__PURE__ */ jsx(
|
|
1971
|
+
"button",
|
|
1972
|
+
{
|
|
1973
|
+
type: "button",
|
|
1974
|
+
"aria-label": "Dismiss",
|
|
1975
|
+
onClick: onDismiss,
|
|
1976
|
+
className: "bg-transparent border-0 text-background/60 p-1 hover:text-background",
|
|
1977
|
+
children: /* @__PURE__ */ jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", stroke: "currentColor", strokeWidth: "1.6", children: /* @__PURE__ */ jsx("path", { d: "M3.5 3.5l7 7M10.5 3.5l-7 7" }) })
|
|
1978
|
+
}
|
|
1979
|
+
)
|
|
1980
|
+
]
|
|
1981
|
+
}
|
|
1982
|
+
);
|
|
1983
|
+
}
|
|
1984
|
+
function AccountShell({ sidebar, children, className }) {
|
|
1985
|
+
return /* @__PURE__ */ jsxs(
|
|
1986
|
+
"div",
|
|
1987
|
+
{
|
|
1988
|
+
"data-cimplify-account-shell": true,
|
|
1989
|
+
className: cn(
|
|
1990
|
+
"grid min-h-[720px] bg-background",
|
|
1991
|
+
"grid-cols-1 md:grid-cols-[280px_1fr]",
|
|
1992
|
+
className
|
|
1993
|
+
),
|
|
1994
|
+
children: [
|
|
1995
|
+
sidebar,
|
|
1996
|
+
/* @__PURE__ */ jsx("div", { className: "min-w-0", children })
|
|
1997
|
+
]
|
|
1998
|
+
}
|
|
1999
|
+
);
|
|
2000
|
+
}
|
|
2001
|
+
function AccountSidebar({ children, scopeNote, className }) {
|
|
2002
|
+
return /* @__PURE__ */ jsxs(
|
|
2003
|
+
"aside",
|
|
2004
|
+
{
|
|
2005
|
+
"data-cimplify-account-sidebar": true,
|
|
2006
|
+
className: cn(
|
|
2007
|
+
"hidden md:flex flex-col bg-background border-r border-border/60",
|
|
2008
|
+
"px-6 pt-9 pb-7",
|
|
2009
|
+
className
|
|
2010
|
+
),
|
|
2011
|
+
children: [
|
|
2012
|
+
children,
|
|
2013
|
+
scopeNote && /* @__PURE__ */ jsx("div", { className: "mt-auto pt-6 px-2 text-[11.5px] leading-[1.55] text-foreground/55", children: scopeNote })
|
|
2014
|
+
]
|
|
2015
|
+
}
|
|
2016
|
+
);
|
|
2017
|
+
}
|
|
2018
|
+
function avatarGradient(seed) {
|
|
2019
|
+
let hash = 0;
|
|
2020
|
+
for (let i = 0; i < seed.length; i++) hash = (hash << 5) - hash + seed.charCodeAt(i) | 0;
|
|
2021
|
+
const hue = (Math.abs(hash) % 60 + 20) % 360;
|
|
2022
|
+
return `linear-gradient(135deg, oklch(0.78 0.10 ${hue}), oklch(0.55 0.16 ${hue - 8}))`;
|
|
2023
|
+
}
|
|
2024
|
+
function initials(name) {
|
|
2025
|
+
return name.trim().split(/\s+/).map((p) => p[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
|
|
2026
|
+
}
|
|
2027
|
+
function AccountIdentityStrip({
|
|
2028
|
+
name,
|
|
2029
|
+
email,
|
|
2030
|
+
customerId,
|
|
2031
|
+
className
|
|
2032
|
+
}) {
|
|
2033
|
+
const seed = customerId ?? name;
|
|
2034
|
+
return /* @__PURE__ */ jsxs(
|
|
2035
|
+
"div",
|
|
2036
|
+
{
|
|
2037
|
+
"data-cimplify-account-identity": true,
|
|
2038
|
+
className: cn(
|
|
2039
|
+
"grid grid-cols-[40px_1fr] gap-3 items-center",
|
|
2040
|
+
"border-b border-border/60 px-2 pb-[22px] mb-2",
|
|
2041
|
+
className
|
|
2042
|
+
),
|
|
2043
|
+
children: [
|
|
2044
|
+
/* @__PURE__ */ jsx(
|
|
2045
|
+
"div",
|
|
2046
|
+
{
|
|
2047
|
+
"aria-hidden": true,
|
|
2048
|
+
className: "size-10 rounded-full grid place-items-center text-white font-serif font-semibold text-[16px] tracking-[-0.01em]",
|
|
2049
|
+
style: { background: avatarGradient(seed) },
|
|
2050
|
+
children: initials(name)
|
|
2051
|
+
}
|
|
2052
|
+
),
|
|
2053
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
2054
|
+
/* @__PURE__ */ jsx("div", { className: "text-[14px] font-semibold text-foreground truncate", children: name }),
|
|
2055
|
+
email && /* @__PURE__ */ jsx("div", { className: "text-[12px] text-foreground/55 truncate", children: email })
|
|
2056
|
+
] })
|
|
2057
|
+
]
|
|
2058
|
+
}
|
|
2059
|
+
);
|
|
2060
|
+
}
|
|
2061
|
+
var externIcon = /* @__PURE__ */ jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.5", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M4 8l4-4M5 4h3v3" }) });
|
|
2062
|
+
function AccountNav({ items, activeHref, className }) {
|
|
2063
|
+
return /* @__PURE__ */ jsx("nav", { "aria-label": "Account", "data-cimplify-account-nav": true, className: cn("pt-4", className), children: /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-px list-none p-0 m-0", children: items.map((item, idx) => {
|
|
2064
|
+
if (item.divider) {
|
|
2065
|
+
return /* @__PURE__ */ jsx("li", { "aria-hidden": true, children: /* @__PURE__ */ jsx("div", { className: "h-px bg-border/60 mx-2 my-3" }) }, `d-${idx}`);
|
|
2066
|
+
}
|
|
2067
|
+
const active = item.href === activeHref;
|
|
2068
|
+
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
|
|
2069
|
+
"a",
|
|
2070
|
+
{
|
|
2071
|
+
href: item.href,
|
|
2072
|
+
"aria-current": active ? "page" : void 0,
|
|
2073
|
+
"data-active": active || void 0,
|
|
2074
|
+
className: cn(
|
|
2075
|
+
"grid grid-cols-[16px_1fr_auto] gap-3 items-center rounded-lg px-3 py-2",
|
|
2076
|
+
"text-[13.5px] no-underline transition-colors",
|
|
2077
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",
|
|
2078
|
+
active ? "bg-card shadow-[0_0_0_1px_var(--color-border)] text-foreground font-semibold" : "text-foreground/70 font-medium hover:bg-muted/40 hover:text-foreground"
|
|
2079
|
+
),
|
|
2080
|
+
children: [
|
|
2081
|
+
/* @__PURE__ */ jsx("span", { className: cn("size-4 grid place-items-center", active ? "text-primary opacity-100" : "opacity-70"), children: item.icon }),
|
|
2082
|
+
/* @__PURE__ */ jsx("span", { children: item.label }),
|
|
2083
|
+
item.external && /* @__PURE__ */ jsx("span", { className: "text-foreground/55 opacity-70", children: externIcon })
|
|
2084
|
+
]
|
|
2085
|
+
}
|
|
2086
|
+
) }, item.href);
|
|
2087
|
+
}) }) });
|
|
2088
|
+
}
|
|
2089
|
+
function AccountHero({ eyebrow = "Your account", title, subtitle, className }) {
|
|
2090
|
+
return /* @__PURE__ */ jsxs(
|
|
2091
|
+
"header",
|
|
2092
|
+
{
|
|
2093
|
+
"data-cimplify-account-hero": true,
|
|
2094
|
+
className: cn("mb-11", className),
|
|
2095
|
+
children: [
|
|
2096
|
+
eyebrow && /* @__PURE__ */ jsx("div", { className: "text-[11px] font-semibold tracking-[0.16em] uppercase text-primary mb-2", children: eyebrow }),
|
|
2097
|
+
/* @__PURE__ */ jsx("h1", { className: "font-serif text-[clamp(28px,3vw,40px)] font-semibold tracking-[-0.025em] leading-[1.05] text-foreground m-0", children: title }),
|
|
2098
|
+
subtitle && /* @__PURE__ */ jsx("p", { className: "text-foreground/70 mt-3 text-[14.5px] m-0", children: subtitle })
|
|
2099
|
+
]
|
|
2100
|
+
}
|
|
2101
|
+
);
|
|
2102
|
+
}
|
|
2103
|
+
function AccountContent({ children, className }) {
|
|
2104
|
+
return /* @__PURE__ */ jsx(
|
|
2105
|
+
"main",
|
|
2106
|
+
{
|
|
2107
|
+
"data-cimplify-account-content": true,
|
|
2108
|
+
className: cn(
|
|
2109
|
+
"bg-background min-w-0",
|
|
2110
|
+
"px-6 sm:px-10 md:px-16 pt-14 pb-18",
|
|
2111
|
+
className
|
|
2112
|
+
),
|
|
2113
|
+
children
|
|
2114
|
+
}
|
|
2115
|
+
);
|
|
2116
|
+
}
|
|
2117
|
+
function Section({ title, meta, action, children, className }) {
|
|
2118
|
+
return /* @__PURE__ */ jsxs("section", { "data-cimplify-account-section": true, className: cn("mt-11 first:mt-0", className), children: [
|
|
2119
|
+
(title || meta || action) && /* @__PURE__ */ jsxs("div", { className: "flex items-baseline justify-between mb-3.5", children: [
|
|
2120
|
+
title && /* @__PURE__ */ jsx("h2", { className: "text-[12px] font-semibold tracking-[0.1em] uppercase text-foreground/55 m-0", children: title }),
|
|
2121
|
+
meta && /* @__PURE__ */ jsx("span", { className: "text-[12px] text-foreground/55 tabular-nums", children: meta }),
|
|
2122
|
+
action
|
|
2123
|
+
] }),
|
|
2124
|
+
children
|
|
2125
|
+
] });
|
|
2126
|
+
}
|
|
2127
|
+
function SectionMore({ children, className, ...props }) {
|
|
2128
|
+
return /* @__PURE__ */ jsx(
|
|
2129
|
+
"a",
|
|
2130
|
+
{
|
|
2131
|
+
"data-cimplify-account-section-more": true,
|
|
2132
|
+
className: cn("text-[13px] font-medium text-primary no-underline hover:underline", className),
|
|
2133
|
+
...props,
|
|
2134
|
+
children
|
|
2135
|
+
}
|
|
2136
|
+
);
|
|
2137
|
+
}
|
|
2138
|
+
function Pane({ pane, side }) {
|
|
2139
|
+
const color = pane.variant === "live" ? "text-amber-600" : "text-emerald-600";
|
|
2140
|
+
const haloAnim = pane.variant === "live" ? "cimplify-live-pulse" : "";
|
|
2141
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-4", side === "right" && "md:pl-8 md:border-l border-border/60"), children: [
|
|
2142
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
2143
|
+
/* @__PURE__ */ jsxs("span", { className: cn("inline-flex items-center gap-2 text-[11.5px] font-semibold tracking-[0.08em] uppercase", color), children: [
|
|
2144
|
+
/* @__PURE__ */ jsx(
|
|
2145
|
+
"span",
|
|
2146
|
+
{
|
|
2147
|
+
"data-cimplify-live-dot": pane.variant === "live" || void 0,
|
|
2148
|
+
className: cn("size-1.5 rounded-full bg-current", haloAnim),
|
|
2149
|
+
"aria-hidden": true
|
|
2150
|
+
}
|
|
2151
|
+
),
|
|
2152
|
+
pane.label
|
|
2153
|
+
] }),
|
|
2154
|
+
/* @__PURE__ */ jsx("h3", { className: "font-serif text-[22px] font-semibold tracking-[-0.02em] leading-[1.2] text-foreground m-0", children: pane.title }),
|
|
2155
|
+
/* @__PURE__ */ jsx("div", { className: "text-[13.5px] text-foreground/70", children: pane.when })
|
|
2156
|
+
] }),
|
|
2157
|
+
pane.actions && /* @__PURE__ */ jsx("div", { className: "flex gap-2.5 mt-auto", children: pane.actions })
|
|
2158
|
+
] });
|
|
2159
|
+
}
|
|
2160
|
+
function HappeningCard({ left, right, className }) {
|
|
2161
|
+
if (!left && !right) return null;
|
|
2162
|
+
const dual = !!left && !!right;
|
|
2163
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2164
|
+
/* @__PURE__ */ jsx("style", { children: `
|
|
2165
|
+
@keyframes cimplify-live-pulse {
|
|
2166
|
+
0%, 100% { box-shadow: 0 0 0 4px color-mix(in oklch, currentColor 18%, transparent); }
|
|
2167
|
+
50% { box-shadow: 0 0 0 8px color-mix(in oklch, currentColor 5%, transparent); }
|
|
2168
|
+
}
|
|
2169
|
+
.cimplify-live-pulse { animation: cimplify-live-pulse 1.8s ease-in-out infinite; }
|
|
2170
|
+
` }),
|
|
2171
|
+
/* @__PURE__ */ jsxs(
|
|
2172
|
+
"div",
|
|
2173
|
+
{
|
|
2174
|
+
"data-cimplify-happening-card": true,
|
|
2175
|
+
"data-dual": dual || void 0,
|
|
2176
|
+
className: cn(
|
|
2177
|
+
"bg-card border border-border rounded-[16px] p-7",
|
|
2178
|
+
"grid gap-4 md:gap-0 items-stretch",
|
|
2179
|
+
dual ? "md:grid-cols-2" : "grid-cols-1",
|
|
2180
|
+
className
|
|
2181
|
+
),
|
|
2182
|
+
children: [
|
|
2183
|
+
left && /* @__PURE__ */ jsx(Pane, { pane: left, side: "left" }),
|
|
2184
|
+
right && /* @__PURE__ */ jsx(Pane, { pane: right, side: "right" })
|
|
2185
|
+
]
|
|
2186
|
+
}
|
|
2187
|
+
)
|
|
2188
|
+
] });
|
|
2189
|
+
}
|
|
2190
|
+
function ContinuityCard({ glyph, title, description, badge, className }) {
|
|
2191
|
+
return /* @__PURE__ */ jsxs(
|
|
2192
|
+
"div",
|
|
2193
|
+
{
|
|
2194
|
+
"data-cimplify-continuity-card": true,
|
|
2195
|
+
className: cn(
|
|
2196
|
+
"grid grid-cols-[auto_1fr_auto] gap-3.5 items-center",
|
|
2197
|
+
"rounded-[12px] px-5 py-3.5 mb-8 -mt-5",
|
|
2198
|
+
"border bg-card text-foreground text-[13.5px]",
|
|
2199
|
+
// soft primary-tinted gradient
|
|
2200
|
+
"bg-[linear-gradient(135deg,color-mix(in_oklch,var(--color-primary)_8%,transparent),var(--color-background))]",
|
|
2201
|
+
"border-[color-mix(in_oklch,var(--color-primary)_18%,transparent)]",
|
|
2202
|
+
className
|
|
2203
|
+
),
|
|
2204
|
+
children: [
|
|
2205
|
+
glyph && /* @__PURE__ */ jsx("div", { className: "size-[26px] rounded-full bg-card border border-border grid place-items-center text-primary text-[13px]", children: glyph }),
|
|
2206
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2207
|
+
/* @__PURE__ */ jsx("div", { className: "font-semibold text-foreground", children: title }),
|
|
2208
|
+
description && /* @__PURE__ */ jsx("div", { className: "text-foreground/55 text-[12px] mt-0.5", children: description })
|
|
2209
|
+
] }),
|
|
2210
|
+
badge && /* @__PURE__ */ jsx("span", { className: "text-[11.5px] text-primary font-semibold uppercase tracking-[0.06em] px-2.5 py-1 rounded-full bg-card border border-border", children: badge })
|
|
2211
|
+
]
|
|
2212
|
+
}
|
|
2213
|
+
);
|
|
2214
|
+
}
|
|
2215
|
+
function WelcomeCard({ title, description, action, className }) {
|
|
2216
|
+
return /* @__PURE__ */ jsxs(
|
|
2217
|
+
"div",
|
|
2218
|
+
{
|
|
2219
|
+
"data-cimplify-welcome-card": true,
|
|
2220
|
+
className: cn(
|
|
2221
|
+
"rounded-[16px] border border-border bg-card",
|
|
2222
|
+
"px-9 py-9 grid grid-cols-1 md:grid-cols-[1fr_auto] gap-8 items-center",
|
|
2223
|
+
className
|
|
2224
|
+
),
|
|
2225
|
+
children: [
|
|
2226
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2227
|
+
/* @__PURE__ */ jsx("h3", { className: "font-serif text-[24px] font-semibold tracking-[-0.02em] text-foreground m-0 mb-2", children: title }),
|
|
2228
|
+
/* @__PURE__ */ jsx("p", { className: "text-foreground/70 text-sm leading-[1.55] max-w-[460px] m-0", children: description })
|
|
2229
|
+
] }),
|
|
2230
|
+
/* @__PURE__ */ jsx("div", { children: action })
|
|
2231
|
+
]
|
|
2232
|
+
}
|
|
2233
|
+
);
|
|
2234
|
+
}
|
|
2235
|
+
function summaryLine(s) {
|
|
2236
|
+
if (!s) return "Addresses, payment, profile \xB7 syncs to every Cimplify shop";
|
|
2237
|
+
const parts = [];
|
|
2238
|
+
if (typeof s.addresses === "number")
|
|
2239
|
+
parts.push(`${s.addresses} address${s.addresses === 1 ? "" : "es"}`);
|
|
2240
|
+
if (typeof s.paymentMethods === "number")
|
|
2241
|
+
parts.push(`${s.paymentMethods} payment method${s.paymentMethods === 1 ? "" : "s"}`);
|
|
2242
|
+
if (typeof s.shops === "number")
|
|
2243
|
+
parts.push(`${s.shops} shop${s.shops === 1 ? "" : "s"}`);
|
|
2244
|
+
if (parts.length === 0) return "Addresses, payment, profile \xB7 syncs to every Cimplify shop";
|
|
2245
|
+
return parts.join(" \xB7 ");
|
|
2246
|
+
}
|
|
2247
|
+
function IdentityOfframp({
|
|
2248
|
+
title = "Cimplify identity",
|
|
2249
|
+
summary,
|
|
2250
|
+
href = "https://link.cimplify.io",
|
|
2251
|
+
className,
|
|
2252
|
+
...props
|
|
2253
|
+
}) {
|
|
2254
|
+
return /* @__PURE__ */ jsxs(
|
|
2255
|
+
"a",
|
|
2256
|
+
{
|
|
2257
|
+
"data-cimplify-identity-offramp": true,
|
|
2258
|
+
href,
|
|
2259
|
+
target: href.startsWith("http") ? "_blank" : void 0,
|
|
2260
|
+
rel: href.startsWith("http") ? "noopener noreferrer" : void 0,
|
|
2261
|
+
className: cn(
|
|
2262
|
+
"grid grid-cols-[40px_1fr_auto] gap-4 items-center",
|
|
2263
|
+
"rounded-[16px] border border-border bg-card px-5 py-4",
|
|
2264
|
+
"no-underline text-foreground transition-colors",
|
|
2265
|
+
"hover:bg-muted/40 hover:border-foreground/40",
|
|
2266
|
+
"group",
|
|
2267
|
+
className
|
|
2268
|
+
),
|
|
2269
|
+
...props,
|
|
2270
|
+
children: [
|
|
2271
|
+
/* @__PURE__ */ jsx("div", { className: "size-10 rounded-md bg-foreground text-background grid place-items-center font-serif font-bold text-[18px]", children: "C" }),
|
|
2272
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2273
|
+
/* @__PURE__ */ jsx("div", { className: "text-[14px] font-semibold text-foreground", children: title }),
|
|
2274
|
+
/* @__PURE__ */ jsx("div", { className: "text-[12.5px] text-foreground/55 mt-0.5 tabular-nums", children: summaryLine(summary) })
|
|
2275
|
+
] }),
|
|
2276
|
+
/* @__PURE__ */ jsx(
|
|
2277
|
+
"svg",
|
|
2278
|
+
{
|
|
2279
|
+
width: "14",
|
|
2280
|
+
height: "14",
|
|
2281
|
+
viewBox: "0 0 14 14",
|
|
2282
|
+
fill: "none",
|
|
2283
|
+
stroke: "currentColor",
|
|
2284
|
+
strokeWidth: "1.6",
|
|
2285
|
+
className: "text-foreground/55 transition-transform group-hover:text-primary group-hover:translate-x-0.5",
|
|
2286
|
+
children: /* @__PURE__ */ jsx("path", { d: "M5 3l4 4-4 4" })
|
|
2287
|
+
}
|
|
2288
|
+
)
|
|
2289
|
+
]
|
|
2290
|
+
}
|
|
2291
|
+
);
|
|
2292
|
+
}
|
|
2293
|
+
var THUMB_GRADIENTS = [
|
|
2294
|
+
"linear-gradient(135deg, oklch(0.86 0.06 60), oklch(0.74 0.11 35))",
|
|
2295
|
+
"linear-gradient(135deg, oklch(0.92 0.04 80), oklch(0.84 0.08 60))",
|
|
2296
|
+
"linear-gradient(135deg, oklch(0.94 0.05 25), oklch(0.82 0.10 30))",
|
|
2297
|
+
"linear-gradient(135deg, oklch(0.74 0.10 45), oklch(0.58 0.13 30))"
|
|
2298
|
+
];
|
|
2299
|
+
function deterministicGradient(seed, idx) {
|
|
2300
|
+
let hash = idx;
|
|
2301
|
+
for (let i = 0; i < seed.length; i++) hash = (hash << 5) - hash + seed.charCodeAt(i) | 0;
|
|
2302
|
+
return THUMB_GRADIENTS[Math.abs(hash) % THUMB_GRADIENTS.length];
|
|
2303
|
+
}
|
|
2304
|
+
function Thumbs({ thumbnails, seed = "" }) {
|
|
2305
|
+
const list = thumbnails && thumbnails.length > 0 ? thumbnails : [`${seed}-a`, `${seed}-b`, `${seed}-c`];
|
|
2306
|
+
const solo = list.length === 1;
|
|
2307
|
+
return /* @__PURE__ */ jsx("div", { className: "relative size-14", "aria-hidden": true, children: list.slice(0, 3).map((src, i) => {
|
|
2308
|
+
const isImg = src.startsWith("http") || src.startsWith("/");
|
|
2309
|
+
const sizes = solo ? "size-14 left-0 top-0 z-30" : [
|
|
2310
|
+
"size-11 left-0 top-0 z-30",
|
|
2311
|
+
"size-[38px] left-[14px] top-1 z-20",
|
|
2312
|
+
"size-8 left-6 top-2 z-10"
|
|
2313
|
+
][i];
|
|
2314
|
+
const style = isImg ? { backgroundImage: `url(${src})`, backgroundSize: "cover", backgroundPosition: "center" } : { background: deterministicGradient(src, i) };
|
|
2315
|
+
return /* @__PURE__ */ jsx(
|
|
2316
|
+
"div",
|
|
2317
|
+
{
|
|
2318
|
+
className: cn(
|
|
2319
|
+
"absolute rounded-md shadow-[0_0_0_2px_var(--color-card)]",
|
|
2320
|
+
sizes
|
|
2321
|
+
),
|
|
2322
|
+
style
|
|
2323
|
+
},
|
|
2324
|
+
i
|
|
2325
|
+
);
|
|
2326
|
+
}) });
|
|
2327
|
+
}
|
|
2328
|
+
function OrderRow({ order, onSelect, className }) {
|
|
2329
|
+
const Element = order.href ? "a" : "button";
|
|
2330
|
+
return /* @__PURE__ */ jsxs(
|
|
2331
|
+
Element,
|
|
2332
|
+
{
|
|
2333
|
+
"data-cimplify-order-row": true,
|
|
2334
|
+
href: order.href,
|
|
2335
|
+
type: order.href ? void 0 : "button",
|
|
2336
|
+
onClick: () => onSelect?.(order.id),
|
|
2337
|
+
className: cn(
|
|
2338
|
+
"grid grid-cols-[56px_1fr_auto_auto] gap-5 items-center px-[22px] py-[18px]",
|
|
2339
|
+
"border-b border-border/60 last:border-b-0",
|
|
2340
|
+
"text-left no-underline w-full bg-transparent",
|
|
2341
|
+
"transition-colors hover:bg-muted/40",
|
|
2342
|
+
"group cursor-pointer",
|
|
2343
|
+
className
|
|
2344
|
+
),
|
|
2345
|
+
children: [
|
|
2346
|
+
/* @__PURE__ */ jsx(Thumbs, { thumbnails: order.thumbnails, seed: order.id }),
|
|
2347
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 min-w-0", children: [
|
|
2348
|
+
/* @__PURE__ */ jsx("div", { className: "text-[14px] font-semibold text-foreground leading-[1.4] truncate", children: order.summary }),
|
|
2349
|
+
/* @__PURE__ */ jsxs("div", { className: "text-[12.5px] text-foreground/55 flex gap-2 items-center tabular-nums", children: [
|
|
2350
|
+
/* @__PURE__ */ jsx("span", { children: order.meta }),
|
|
2351
|
+
/* @__PURE__ */ jsx("span", { className: "text-border", children: "\xB7" }),
|
|
2352
|
+
/* @__PURE__ */ jsxs("span", { className: "font-mono text-[11px]", children: [
|
|
2353
|
+
"#",
|
|
2354
|
+
order.id
|
|
2355
|
+
] })
|
|
2356
|
+
] })
|
|
2357
|
+
] }),
|
|
2358
|
+
/* @__PURE__ */ jsx(Status, { status: order.status }),
|
|
2359
|
+
/* @__PURE__ */ jsx("div", { className: "text-[14.5px] font-semibold text-foreground tabular-nums", children: order.total })
|
|
2360
|
+
]
|
|
2361
|
+
}
|
|
2362
|
+
);
|
|
2363
|
+
}
|
|
2364
|
+
function OrderList({ orders, onSelect, className }) {
|
|
2365
|
+
return /* @__PURE__ */ jsx(
|
|
2366
|
+
"div",
|
|
2367
|
+
{
|
|
2368
|
+
"data-cimplify-order-list": true,
|
|
2369
|
+
className: cn("bg-card border border-border rounded-[16px] overflow-hidden", className),
|
|
2370
|
+
children: orders.map((order) => /* @__PURE__ */ jsx(OrderRow, { order, onSelect }, order.id))
|
|
2371
|
+
}
|
|
2372
|
+
);
|
|
2373
|
+
}
|
|
2374
|
+
function OrderDetailHeader({ title, meta, className }) {
|
|
2375
|
+
return /* @__PURE__ */ jsxs("header", { "data-cimplify-order-detail-header": true, className: cn("mb-9", className), children: [
|
|
2376
|
+
/* @__PURE__ */ jsx("h1", { className: "font-serif font-semibold text-[clamp(26px,2.8vw,34px)] tracking-[-0.025em] leading-[1.1] text-foreground m-0 mb-2.5", children: title }),
|
|
2377
|
+
meta && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-3 flex-wrap text-[13px] text-foreground/55", children: meta })
|
|
2378
|
+
] });
|
|
2379
|
+
}
|
|
2380
|
+
function OrderDetailMetaPipe() {
|
|
2381
|
+
return /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "text-border", children: "\xB7" });
|
|
2382
|
+
}
|
|
2383
|
+
function OrderTimeline({ steps, className }) {
|
|
2384
|
+
const doneCount = steps.filter((s) => s.state === "done").length;
|
|
2385
|
+
const currentIdx = steps.findIndex((s) => s.state === "current");
|
|
2386
|
+
const filledRatio = currentIdx >= 0 ? (doneCount + (currentIdx >= doneCount ? 0.5 : 0)) / (steps.length - 1) : doneCount / Math.max(1, steps.length - 1);
|
|
2387
|
+
return /* @__PURE__ */ jsxs(
|
|
2388
|
+
"div",
|
|
2389
|
+
{
|
|
2390
|
+
"data-cimplify-order-timeline": true,
|
|
2391
|
+
className: cn("bg-card border border-border rounded-[16px] px-7 py-8 mb-6 relative", className),
|
|
2392
|
+
children: [
|
|
2393
|
+
/* @__PURE__ */ jsx(
|
|
2394
|
+
"div",
|
|
2395
|
+
{
|
|
2396
|
+
className: "absolute top-[18px] h-0.5 bg-border z-[1]",
|
|
2397
|
+
style: {
|
|
2398
|
+
left: `calc(${100 / steps.length / 2}% + 18px)`,
|
|
2399
|
+
right: `calc(${100 / steps.length / 2}% + 18px)`
|
|
2400
|
+
},
|
|
2401
|
+
children: /* @__PURE__ */ jsx(
|
|
2402
|
+
"div",
|
|
2403
|
+
{
|
|
2404
|
+
className: "h-full bg-primary",
|
|
2405
|
+
style: { width: `${Math.min(100, filledRatio * 100)}%` }
|
|
2406
|
+
}
|
|
2407
|
+
)
|
|
2408
|
+
}
|
|
2409
|
+
),
|
|
2410
|
+
/* @__PURE__ */ jsx(
|
|
2411
|
+
"div",
|
|
2412
|
+
{
|
|
2413
|
+
className: "grid relative",
|
|
2414
|
+
style: { gridTemplateColumns: `repeat(${steps.length}, 1fr)` },
|
|
2415
|
+
children: steps.map((step, i) => /* @__PURE__ */ jsxs("div", { className: "text-center px-1 relative", children: [
|
|
2416
|
+
/* @__PURE__ */ jsx(
|
|
2417
|
+
"div",
|
|
2418
|
+
{
|
|
2419
|
+
className: cn(
|
|
2420
|
+
"size-9 rounded-full border-2 grid place-items-center mx-auto mb-3 relative z-[2]",
|
|
2421
|
+
step.state === "current" && "bg-primary text-white border-primary shadow-[0_0_0_6px_color-mix(in_oklch,var(--color-primary)_18%,transparent)]",
|
|
2422
|
+
step.state === "done" && "bg-foreground text-white border-foreground",
|
|
2423
|
+
step.state === "pending" && "bg-muted/40 text-foreground/55 border-border"
|
|
2424
|
+
),
|
|
2425
|
+
children: step.icon
|
|
2426
|
+
}
|
|
2427
|
+
),
|
|
2428
|
+
/* @__PURE__ */ jsx(
|
|
2429
|
+
"div",
|
|
2430
|
+
{
|
|
2431
|
+
className: cn(
|
|
2432
|
+
"text-[12.5px] font-semibold",
|
|
2433
|
+
step.state === "current" ? "text-foreground" : "text-foreground/70"
|
|
2434
|
+
),
|
|
2435
|
+
children: step.label
|
|
2436
|
+
}
|
|
2437
|
+
),
|
|
2438
|
+
step.time && /* @__PURE__ */ jsx("div", { className: "text-[11.5px] text-foreground/55 mt-0.5", children: step.time })
|
|
2439
|
+
] }, i))
|
|
2440
|
+
}
|
|
2441
|
+
)
|
|
2442
|
+
]
|
|
2443
|
+
}
|
|
2444
|
+
);
|
|
2445
|
+
}
|
|
2446
|
+
function ItemsCard({ title, rightLabel, items, totals, className }) {
|
|
2447
|
+
return /* @__PURE__ */ jsxs(
|
|
2448
|
+
"div",
|
|
2449
|
+
{
|
|
2450
|
+
"data-cimplify-items-card": true,
|
|
2451
|
+
className: cn("bg-card border border-border rounded-[16px] overflow-hidden", className),
|
|
2452
|
+
children: [
|
|
2453
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-[22px] py-4 border-b border-border/60", children: [
|
|
2454
|
+
/* @__PURE__ */ jsx("h3", { className: "text-[13.5px] font-semibold text-foreground m-0", children: title }),
|
|
2455
|
+
rightLabel && /* @__PURE__ */ jsx("span", { className: "text-[12.5px] text-foreground/55", children: rightLabel })
|
|
2456
|
+
] }),
|
|
2457
|
+
/* @__PURE__ */ jsx("ul", { className: "list-none p-0 m-0", children: items.map((item, idx) => /* @__PURE__ */ jsxs(
|
|
2458
|
+
"li",
|
|
2459
|
+
{
|
|
2460
|
+
className: "grid grid-cols-[48px_1fr_auto_auto] gap-4 items-center px-[22px] py-3.5 border-b border-border/60 last:border-b-0",
|
|
2461
|
+
children: [
|
|
2462
|
+
/* @__PURE__ */ jsx(
|
|
2463
|
+
"div",
|
|
2464
|
+
{
|
|
2465
|
+
className: "size-12 rounded",
|
|
2466
|
+
style: {
|
|
2467
|
+
background: item.thumbnail ? `url(${item.thumbnail}) center/cover` : deterministicGradient(item.id, idx)
|
|
2468
|
+
},
|
|
2469
|
+
"aria-hidden": true
|
|
2470
|
+
}
|
|
2471
|
+
),
|
|
2472
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2473
|
+
/* @__PURE__ */ jsx("div", { className: "text-[14px] font-semibold text-foreground", children: item.name }),
|
|
2474
|
+
item.meta && /* @__PURE__ */ jsx("div", { className: "text-[12px] text-foreground/55 mt-0.5", children: item.meta })
|
|
2475
|
+
] }),
|
|
2476
|
+
/* @__PURE__ */ jsxs("div", { className: "text-[12.5px] text-foreground/55 tabular-nums", children: [
|
|
2477
|
+
"\xD7 ",
|
|
2478
|
+
item.qty
|
|
2479
|
+
] }),
|
|
2480
|
+
/* @__PURE__ */ jsx("div", { className: "text-[14px] font-semibold text-foreground tabular-nums", children: item.price })
|
|
2481
|
+
]
|
|
2482
|
+
},
|
|
2483
|
+
item.id
|
|
2484
|
+
)) }),
|
|
2485
|
+
totals && /* @__PURE__ */ jsx(OrderTotals, { data: totals })
|
|
2486
|
+
]
|
|
2487
|
+
}
|
|
2488
|
+
);
|
|
2489
|
+
}
|
|
2490
|
+
function OrderTotals({ data, className }) {
|
|
2491
|
+
return /* @__PURE__ */ jsxs(
|
|
2492
|
+
"div",
|
|
2493
|
+
{
|
|
2494
|
+
"data-cimplify-order-totals": true,
|
|
2495
|
+
className: cn("px-[22px] py-4 bg-muted/30 border-t border-border/60", className),
|
|
2496
|
+
children: [
|
|
2497
|
+
data.rows.map((row) => /* @__PURE__ */ jsxs("div", { className: "flex justify-between py-1 text-[13.5px]", children: [
|
|
2498
|
+
/* @__PURE__ */ jsx("span", { className: "text-foreground/70", children: row.label }),
|
|
2499
|
+
/* @__PURE__ */ jsx("span", { className: "tabular-nums text-foreground", children: row.value })
|
|
2500
|
+
] }, row.label)),
|
|
2501
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-between pt-3 mt-2 border-t border-border font-bold text-[15px]", children: [
|
|
2502
|
+
/* @__PURE__ */ jsx("span", { className: "text-foreground", children: data.grandLabel }),
|
|
2503
|
+
/* @__PURE__ */ jsx("span", { className: "tabular-nums text-foreground", children: data.grandValue })
|
|
2504
|
+
] })
|
|
2505
|
+
]
|
|
2506
|
+
}
|
|
2507
|
+
);
|
|
2508
|
+
}
|
|
2509
|
+
function ContextCard({ rows, className }) {
|
|
2510
|
+
return /* @__PURE__ */ jsx(
|
|
2511
|
+
"div",
|
|
2512
|
+
{
|
|
2513
|
+
"data-cimplify-context-card": true,
|
|
2514
|
+
className: cn("bg-card border border-border rounded-[16px] overflow-hidden", className),
|
|
2515
|
+
children: rows.map((row) => /* @__PURE__ */ jsxs(
|
|
2516
|
+
"div",
|
|
2517
|
+
{
|
|
2518
|
+
className: "grid grid-cols-[130px_1fr_auto] gap-5 px-[22px] py-4 border-b border-border/60 last:border-b-0 items-center",
|
|
2519
|
+
children: [
|
|
2520
|
+
/* @__PURE__ */ jsx("div", { className: "text-[12.5px] text-foreground/55 font-medium", children: row.label }),
|
|
2521
|
+
/* @__PURE__ */ jsx("div", { className: "text-[13.5px] text-foreground leading-[1.5]", children: row.value }),
|
|
2522
|
+
row.manageHref && /* @__PURE__ */ jsxs(
|
|
2523
|
+
"a",
|
|
2524
|
+
{
|
|
2525
|
+
href: row.manageHref,
|
|
2526
|
+
target: "_blank",
|
|
2527
|
+
rel: "noopener noreferrer",
|
|
2528
|
+
className: "text-[12px] text-foreground/55 no-underline hover:text-primary inline-flex items-center gap-1 transition-colors",
|
|
2529
|
+
children: [
|
|
2530
|
+
row.manageLabel ?? "Manage",
|
|
2531
|
+
" ",
|
|
2532
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "\u2197" })
|
|
2533
|
+
]
|
|
2534
|
+
}
|
|
2535
|
+
)
|
|
2536
|
+
]
|
|
2537
|
+
},
|
|
2538
|
+
row.label
|
|
2539
|
+
))
|
|
2540
|
+
}
|
|
2541
|
+
);
|
|
2542
|
+
}
|
|
2543
|
+
function SubscriptionRow({
|
|
2544
|
+
subscription,
|
|
2545
|
+
onSelect,
|
|
2546
|
+
iconTile,
|
|
2547
|
+
className
|
|
2548
|
+
}) {
|
|
2549
|
+
const Element = subscription.href ? "a" : "button";
|
|
2550
|
+
const muted = subscription.cancelled;
|
|
2551
|
+
return /* @__PURE__ */ jsxs(
|
|
2552
|
+
Element,
|
|
2553
|
+
{
|
|
2554
|
+
"data-cimplify-subscription-row": true,
|
|
2555
|
+
href: subscription.href,
|
|
2556
|
+
type: subscription.href ? void 0 : "button",
|
|
2557
|
+
onClick: () => onSelect?.(subscription.id),
|
|
2558
|
+
className: cn(
|
|
2559
|
+
"grid grid-cols-[56px_1fr_auto_auto] gap-5 items-center px-[22px] py-5",
|
|
2560
|
+
"border-b border-border/60 last:border-b-0",
|
|
2561
|
+
"text-left no-underline w-full bg-transparent",
|
|
2562
|
+
"transition-colors hover:bg-muted/40 cursor-pointer",
|
|
2563
|
+
muted && "opacity-60",
|
|
2564
|
+
className
|
|
2565
|
+
),
|
|
2566
|
+
children: [
|
|
2567
|
+
/* @__PURE__ */ jsx(
|
|
2568
|
+
"div",
|
|
2569
|
+
{
|
|
2570
|
+
className: cn(
|
|
2571
|
+
"size-14 rounded-[12px] grid place-items-center",
|
|
2572
|
+
subscription.paused || muted ? "bg-muted/40 text-foreground/55" : "text-amber-700 bg-[linear-gradient(135deg,oklch(0.92_0.05_80),oklch(0.84_0.10_60))]"
|
|
2573
|
+
),
|
|
2574
|
+
children: iconTile ?? /* @__PURE__ */ jsxs("svg", { width: "26", height: "26", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
2575
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "9" }),
|
|
2576
|
+
/* @__PURE__ */ jsx("path", { d: "M12 7v5l3 2" })
|
|
2577
|
+
] })
|
|
2578
|
+
}
|
|
2579
|
+
),
|
|
2580
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
2581
|
+
/* @__PURE__ */ jsx("div", { className: "text-[14.5px] font-semibold text-foreground", children: subscription.title }),
|
|
2582
|
+
/* @__PURE__ */ jsx("div", { className: "text-[12.5px] text-foreground/55 mt-0.5", children: subscription.meta })
|
|
2583
|
+
] }),
|
|
2584
|
+
/* @__PURE__ */ jsx(Status, { status: subscription.status }),
|
|
2585
|
+
/* @__PURE__ */ jsxs("div", { className: "text-right tabular-nums", children: [
|
|
2586
|
+
/* @__PURE__ */ jsx(
|
|
2587
|
+
"span",
|
|
2588
|
+
{
|
|
2589
|
+
className: cn(
|
|
2590
|
+
"text-[14.5px] font-semibold",
|
|
2591
|
+
muted ? "text-foreground/55" : "text-foreground"
|
|
2592
|
+
),
|
|
2593
|
+
children: subscription.price
|
|
2594
|
+
}
|
|
2595
|
+
),
|
|
2596
|
+
/* @__PURE__ */ jsx("span", { className: "block text-[11px] text-foreground/55 mt-0.5", children: subscription.unit })
|
|
2597
|
+
] })
|
|
2598
|
+
]
|
|
2599
|
+
}
|
|
2600
|
+
);
|
|
2601
|
+
}
|
|
2602
|
+
function SubscriptionList({
|
|
2603
|
+
subscriptions,
|
|
2604
|
+
onSelect,
|
|
2605
|
+
renderIcon,
|
|
2606
|
+
className
|
|
2607
|
+
}) {
|
|
2608
|
+
return /* @__PURE__ */ jsx(
|
|
2609
|
+
"div",
|
|
2610
|
+
{
|
|
2611
|
+
"data-cimplify-subscription-list": true,
|
|
2612
|
+
className: cn("bg-card border border-border rounded-[16px] overflow-hidden", className),
|
|
2613
|
+
children: subscriptions.map((s) => /* @__PURE__ */ jsx(
|
|
2614
|
+
SubscriptionRow,
|
|
2615
|
+
{
|
|
2616
|
+
subscription: s,
|
|
2617
|
+
onSelect,
|
|
2618
|
+
iconTile: renderIcon?.(s)
|
|
2619
|
+
},
|
|
2620
|
+
s.id
|
|
2621
|
+
))
|
|
2622
|
+
}
|
|
2623
|
+
);
|
|
2624
|
+
}
|
|
2625
|
+
function NextDeliveryCard({
|
|
2626
|
+
label,
|
|
2627
|
+
date,
|
|
2628
|
+
meta,
|
|
2629
|
+
actions,
|
|
2630
|
+
footnote,
|
|
2631
|
+
rightFootnote,
|
|
2632
|
+
paused,
|
|
2633
|
+
className
|
|
2634
|
+
}) {
|
|
2635
|
+
return /* @__PURE__ */ jsxs(
|
|
2636
|
+
"div",
|
|
2637
|
+
{
|
|
2638
|
+
"data-cimplify-next-delivery": true,
|
|
2639
|
+
"data-paused": paused || void 0,
|
|
2640
|
+
className: cn(
|
|
2641
|
+
"bg-card border border-border rounded-[16px] mb-6 overflow-hidden",
|
|
2642
|
+
className
|
|
2643
|
+
),
|
|
2644
|
+
children: [
|
|
2645
|
+
/* @__PURE__ */ jsxs(
|
|
2646
|
+
"div",
|
|
2647
|
+
{
|
|
2648
|
+
className: cn(
|
|
2649
|
+
"px-8 py-7 grid grid-cols-1 md:grid-cols-[1fr_auto] gap-6 items-center",
|
|
2650
|
+
paused && "opacity-85"
|
|
2651
|
+
),
|
|
2652
|
+
children: [
|
|
2653
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
2654
|
+
/* @__PURE__ */ jsxs(
|
|
2655
|
+
"span",
|
|
2656
|
+
{
|
|
2657
|
+
className: cn(
|
|
2658
|
+
"inline-flex items-center gap-2 text-[11.5px] font-semibold tracking-[0.08em] uppercase",
|
|
2659
|
+
paused ? "text-foreground/55" : "text-emerald-600"
|
|
2660
|
+
),
|
|
2661
|
+
children: [
|
|
2662
|
+
/* @__PURE__ */ jsx("span", { className: "size-1.5 rounded-full bg-current", "aria-hidden": true }),
|
|
2663
|
+
label
|
|
2664
|
+
]
|
|
2665
|
+
}
|
|
2666
|
+
),
|
|
2667
|
+
/* @__PURE__ */ jsx(
|
|
2668
|
+
"div",
|
|
2669
|
+
{
|
|
2670
|
+
className: cn(
|
|
2671
|
+
"font-serif font-semibold text-[30px] tracking-[-0.025em] leading-[1.05]",
|
|
2672
|
+
paused ? "text-foreground/55" : "text-foreground"
|
|
2673
|
+
),
|
|
2674
|
+
children: date
|
|
2675
|
+
}
|
|
2676
|
+
),
|
|
2677
|
+
meta && /* @__PURE__ */ jsx("div", { className: "text-[14px] text-foreground/70 mt-0.5", children: meta })
|
|
2678
|
+
] }),
|
|
2679
|
+
actions && /* @__PURE__ */ jsx("div", { className: "flex gap-2.5", children: actions })
|
|
2680
|
+
]
|
|
2681
|
+
}
|
|
2682
|
+
),
|
|
2683
|
+
(footnote || rightFootnote) && /* @__PURE__ */ jsxs("div", { className: "px-8 py-3.5 border-t border-dashed border-border bg-muted/30 flex justify-between items-center text-[12px] text-foreground/55", children: [
|
|
2684
|
+
footnote && /* @__PURE__ */ jsx("span", { children: footnote }),
|
|
2685
|
+
rightFootnote && /* @__PURE__ */ jsx("span", { children: rightFootnote })
|
|
2686
|
+
] })
|
|
2687
|
+
]
|
|
2688
|
+
}
|
|
2689
|
+
);
|
|
2690
|
+
}
|
|
1753
2691
|
var BASE_CLASSES = "inline-flex items-center justify-center gap-2 font-medium text-sm rounded-md transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed";
|
|
1754
2692
|
var VARIANT_CLASSES = {
|
|
1755
2693
|
primary: "bg-emerald-600 text-white hover:bg-emerald-700 px-4 py-2.5 border border-transparent",
|
|
@@ -1768,7 +2706,7 @@ function CimplifySignInButton({
|
|
|
1768
2706
|
...signInOpts
|
|
1769
2707
|
}) {
|
|
1770
2708
|
const [busy, setBusy] = useState(false);
|
|
1771
|
-
const onClick =
|
|
2709
|
+
const onClick = async () => {
|
|
1772
2710
|
if (busy || disabled) return;
|
|
1773
2711
|
setBusy(true);
|
|
1774
2712
|
await startSignIn({
|
|
@@ -1782,7 +2720,7 @@ function CimplifySignInButton({
|
|
|
1782
2720
|
onError?.(e);
|
|
1783
2721
|
}
|
|
1784
2722
|
});
|
|
1785
|
-
}
|
|
2723
|
+
};
|
|
1786
2724
|
return /* @__PURE__ */ jsxs(
|
|
1787
2725
|
"button",
|
|
1788
2726
|
{
|
|
@@ -1801,6 +2739,586 @@ function CimplifySignInButton({
|
|
|
1801
2739
|
}
|
|
1802
2740
|
);
|
|
1803
2741
|
}
|
|
2742
|
+
function AccountSignedOutPrompt({
|
|
2743
|
+
eyebrow = "Sign in",
|
|
2744
|
+
title = "Sign in to see your account",
|
|
2745
|
+
description = "Your orders and subscriptions, all in one place.",
|
|
2746
|
+
clientId,
|
|
2747
|
+
redirectUri,
|
|
2748
|
+
lastEmail,
|
|
2749
|
+
onSuccess,
|
|
2750
|
+
className
|
|
2751
|
+
}) {
|
|
2752
|
+
return /* @__PURE__ */ jsx(
|
|
2753
|
+
"div",
|
|
2754
|
+
{
|
|
2755
|
+
"data-cimplify-signed-out": true,
|
|
2756
|
+
className: cn(
|
|
2757
|
+
"min-h-[480px] px-6 pt-24 pb-32",
|
|
2758
|
+
"bg-[radial-gradient(900px_480px_at_50%_0%,color-mix(in_oklch,var(--color-primary)_8%,transparent),transparent_70%),var(--color-background)]",
|
|
2759
|
+
className
|
|
2760
|
+
),
|
|
2761
|
+
children: /* @__PURE__ */ jsxs("div", { className: "max-w-[420px] mx-auto p-10 bg-card border border-border rounded-[16px] text-center shadow-[0_1px_0_rgba(0,0,0,0.04),0_16px_48px_rgba(0,0,0,0.08)]", children: [
|
|
2762
|
+
/* @__PURE__ */ jsx("div", { className: "text-[11px] font-semibold tracking-[0.16em] uppercase text-primary mb-2.5", children: eyebrow }),
|
|
2763
|
+
/* @__PURE__ */ jsx("h2", { className: "font-serif text-[28px] font-semibold tracking-[-0.025em] leading-[1.15] m-0 mb-3 text-foreground", children: title }),
|
|
2764
|
+
/* @__PURE__ */ jsx("p", { className: "text-foreground/70 text-sm leading-[1.55] m-0 mb-7", children: description }),
|
|
2765
|
+
/* @__PURE__ */ jsx(
|
|
2766
|
+
CimplifySignInButton,
|
|
2767
|
+
{
|
|
2768
|
+
clientId,
|
|
2769
|
+
redirectUri,
|
|
2770
|
+
fullWidth: true,
|
|
2771
|
+
onSuccess
|
|
2772
|
+
}
|
|
2773
|
+
),
|
|
2774
|
+
/* @__PURE__ */ jsxs("div", { className: "inline-flex items-center gap-1.5 mt-5 text-[11.5px] text-foreground/55", children: [
|
|
2775
|
+
/* @__PURE__ */ jsxs("svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
2776
|
+
/* @__PURE__ */ jsx("rect", { x: "3", y: "7", width: "10", height: "7", rx: "1" }),
|
|
2777
|
+
/* @__PURE__ */ jsx("path", { d: "M5.5 7V5a2.5 2.5 0 0 1 5 0v2" })
|
|
2778
|
+
] }),
|
|
2779
|
+
"One identity for every Cimplify shop"
|
|
2780
|
+
] }),
|
|
2781
|
+
lastEmail && /* @__PURE__ */ jsxs("div", { className: "text-[12.5px] text-foreground/55 mt-4 pt-4 border-t border-border/60", children: [
|
|
2782
|
+
"Returning? Last signed in as ",
|
|
2783
|
+
/* @__PURE__ */ jsx("strong", { className: "text-foreground font-semibold", children: lastEmail })
|
|
2784
|
+
] })
|
|
2785
|
+
] })
|
|
2786
|
+
}
|
|
2787
|
+
);
|
|
2788
|
+
}
|
|
2789
|
+
function MobileAccountShell({
|
|
2790
|
+
storeName,
|
|
2791
|
+
leading,
|
|
2792
|
+
trailing,
|
|
2793
|
+
tabBar,
|
|
2794
|
+
children,
|
|
2795
|
+
className
|
|
2796
|
+
}) {
|
|
2797
|
+
return /* @__PURE__ */ jsxs(
|
|
2798
|
+
"div",
|
|
2799
|
+
{
|
|
2800
|
+
"data-cimplify-mobile-shell": true,
|
|
2801
|
+
className: cn(
|
|
2802
|
+
"md:hidden flex flex-col min-h-screen bg-background",
|
|
2803
|
+
className
|
|
2804
|
+
),
|
|
2805
|
+
children: [
|
|
2806
|
+
/* @__PURE__ */ jsxs("header", { className: "flex items-center justify-between px-[18px] py-3.5 border-b border-border/60 flex-shrink-0", children: [
|
|
2807
|
+
leading ?? /* @__PURE__ */ jsx("div", { className: "w-9" }),
|
|
2808
|
+
/* @__PURE__ */ jsx("div", { className: "font-serif font-semibold text-[17px] tracking-[-0.015em]", children: storeName }),
|
|
2809
|
+
trailing ?? /* @__PURE__ */ jsx("div", { className: "w-9" })
|
|
2810
|
+
] }),
|
|
2811
|
+
/* @__PURE__ */ jsx("main", { className: "flex-1 overflow-y-auto px-[18px] py-6", children }),
|
|
2812
|
+
tabBar
|
|
2813
|
+
]
|
|
2814
|
+
}
|
|
2815
|
+
);
|
|
2816
|
+
}
|
|
2817
|
+
function MobileTabBar({ items, activeHref, className }) {
|
|
2818
|
+
return /* @__PURE__ */ jsx(
|
|
2819
|
+
"nav",
|
|
2820
|
+
{
|
|
2821
|
+
"data-cimplify-mobile-tabbar": true,
|
|
2822
|
+
"aria-label": "Account",
|
|
2823
|
+
className: cn("grid grid-cols-3 border-t border-border bg-background flex-shrink-0", className),
|
|
2824
|
+
children: items.map((item) => {
|
|
2825
|
+
const active = item.href === activeHref;
|
|
2826
|
+
return /* @__PURE__ */ jsxs(
|
|
2827
|
+
"a",
|
|
2828
|
+
{
|
|
2829
|
+
href: item.href,
|
|
2830
|
+
"aria-current": active ? "page" : void 0,
|
|
2831
|
+
className: cn(
|
|
2832
|
+
"flex flex-col items-center gap-1 py-3 pb-3.5 no-underline text-[10.5px] font-medium",
|
|
2833
|
+
active ? "text-primary" : "text-foreground/55"
|
|
2834
|
+
),
|
|
2835
|
+
children: [
|
|
2836
|
+
/* @__PURE__ */ jsx("span", { className: "size-5", children: item.icon }),
|
|
2837
|
+
item.label
|
|
2838
|
+
]
|
|
2839
|
+
},
|
|
2840
|
+
item.href
|
|
2841
|
+
);
|
|
2842
|
+
})
|
|
2843
|
+
}
|
|
2844
|
+
);
|
|
2845
|
+
}
|
|
2846
|
+
function MobileBackButton({ href, label = "Back" }) {
|
|
2847
|
+
return /* @__PURE__ */ jsxs(
|
|
2848
|
+
"a",
|
|
2849
|
+
{
|
|
2850
|
+
href,
|
|
2851
|
+
className: "inline-flex items-center gap-1 text-foreground/70 text-[13.5px] font-medium no-underline",
|
|
2852
|
+
children: [
|
|
2853
|
+
/* @__PURE__ */ jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.8", children: /* @__PURE__ */ jsx("path", { d: "M7.5 2L3.5 6l4 4" }) }),
|
|
2854
|
+
label
|
|
2855
|
+
]
|
|
2856
|
+
}
|
|
2857
|
+
);
|
|
2858
|
+
}
|
|
2859
|
+
function MobileMoreButton({ onClick }) {
|
|
2860
|
+
return /* @__PURE__ */ jsx(
|
|
2861
|
+
"button",
|
|
2862
|
+
{
|
|
2863
|
+
type: "button",
|
|
2864
|
+
onClick,
|
|
2865
|
+
"aria-label": "Menu",
|
|
2866
|
+
className: "size-9 rounded-[12px] bg-card border border-border grid place-items-center text-foreground/70",
|
|
2867
|
+
children: /* @__PURE__ */ jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
2868
|
+
/* @__PURE__ */ jsx("circle", { cx: "8", cy: "4", r: "1" }),
|
|
2869
|
+
/* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "1" }),
|
|
2870
|
+
/* @__PURE__ */ jsx("circle", { cx: "8", cy: "12", r: "1" })
|
|
2871
|
+
] })
|
|
2872
|
+
}
|
|
2873
|
+
);
|
|
2874
|
+
}
|
|
2875
|
+
var I = (props) => /* @__PURE__ */ jsx("svg", { fill: "none", stroke: "currentColor", strokeWidth: "1.5", viewBox: "0 0 16 16", ...props });
|
|
2876
|
+
var I20 = (props) => /* @__PURE__ */ jsx("svg", { fill: "none", stroke: "currentColor", strokeWidth: "1.5", viewBox: "0 0 20 20", ...props });
|
|
2877
|
+
var DashboardIcon = () => /* @__PURE__ */ jsxs(I, { children: [
|
|
2878
|
+
/* @__PURE__ */ jsx("rect", { x: "2", y: "2", width: "5", height: "5", rx: "1" }),
|
|
2879
|
+
/* @__PURE__ */ jsx("rect", { x: "9", y: "2", width: "5", height: "5", rx: "1" }),
|
|
2880
|
+
/* @__PURE__ */ jsx("rect", { x: "2", y: "9", width: "5", height: "5", rx: "1" }),
|
|
2881
|
+
/* @__PURE__ */ jsx("rect", { x: "9", y: "9", width: "5", height: "5", rx: "1" })
|
|
2882
|
+
] });
|
|
2883
|
+
var OrdersIcon = () => /* @__PURE__ */ jsxs(I, { children: [
|
|
2884
|
+
/* @__PURE__ */ jsx("path", { d: "M3 4l5-2 5 2v8l-5 2-5-2V4z" }),
|
|
2885
|
+
/* @__PURE__ */ jsx("path", { d: "M3 4l5 2 5-2M8 6v8" })
|
|
2886
|
+
] });
|
|
2887
|
+
var SubscriptionsIcon = () => /* @__PURE__ */ jsxs(I, { children: [
|
|
2888
|
+
/* @__PURE__ */ jsx("path", { d: "M13 6a5 5 0 1 0-1.5 3.5L13 11" }),
|
|
2889
|
+
/* @__PURE__ */ jsx("path", { d: "M13 4v3h-3" })
|
|
2890
|
+
] });
|
|
2891
|
+
var IdentityIcon = () => /* @__PURE__ */ jsxs(I, { children: [
|
|
2892
|
+
/* @__PURE__ */ jsx("circle", { cx: "8", cy: "6", r: "2.5" }),
|
|
2893
|
+
/* @__PURE__ */ jsx("path", { d: "M3.5 13.5a4.5 4.5 0 0 1 9 0" })
|
|
2894
|
+
] });
|
|
2895
|
+
var SignOutIcon = () => /* @__PURE__ */ jsxs(I, { children: [
|
|
2896
|
+
/* @__PURE__ */ jsx("path", { d: "M6.5 3.5h-3v9h3" }),
|
|
2897
|
+
/* @__PURE__ */ jsx("path", { d: "M9 5l3 3-3 3" }),
|
|
2898
|
+
/* @__PURE__ */ jsx("path", { d: "M12 8H6" })
|
|
2899
|
+
] });
|
|
2900
|
+
var DashboardIcon20 = () => /* @__PURE__ */ jsxs(I20, { children: [
|
|
2901
|
+
/* @__PURE__ */ jsx("rect", { x: "3", y: "3", width: "6", height: "6", rx: "1" }),
|
|
2902
|
+
/* @__PURE__ */ jsx("rect", { x: "11", y: "3", width: "6", height: "6", rx: "1" }),
|
|
2903
|
+
/* @__PURE__ */ jsx("rect", { x: "3", y: "11", width: "6", height: "6", rx: "1" }),
|
|
2904
|
+
/* @__PURE__ */ jsx("rect", { x: "11", y: "11", width: "6", height: "6", rx: "1" })
|
|
2905
|
+
] });
|
|
2906
|
+
var OrdersIcon20 = () => /* @__PURE__ */ jsxs(I20, { children: [
|
|
2907
|
+
/* @__PURE__ */ jsx("path", { d: "M4 5l6-2 6 2v10l-6 2-6-2V5z" }),
|
|
2908
|
+
/* @__PURE__ */ jsx("path", { d: "M4 5l6 2 6-2M10 7v10" })
|
|
2909
|
+
] });
|
|
2910
|
+
var SubscriptionsIcon20 = () => /* @__PURE__ */ jsx(I20, { children: /* @__PURE__ */ jsx("path", { d: "M16 8a6 6 0 1 0-1.5 4M16 5v3h-3" }) });
|
|
2911
|
+
var CheckIcon = () => /* @__PURE__ */ jsx(I, { children: /* @__PURE__ */ jsx("path", { strokeWidth: "2", d: "M3 8l3.5 3.5L13 5" }) });
|
|
2912
|
+
var OvenIcon = () => /* @__PURE__ */ jsx(I, { children: /* @__PURE__ */ jsx("path", { strokeWidth: "2", d: "M3 11h10M3 8l1.5-4.5h7L13 8M5 11v2M11 11v2" }) });
|
|
2913
|
+
var DeliveryTruckIcon = () => /* @__PURE__ */ jsx(I, { children: /* @__PURE__ */ jsx("path", { strokeWidth: "2", d: "M2 6h9v6H2zM11 9h2l1 2v1h-3M5 14v-1M11 14v-1" }) });
|
|
2914
|
+
var PackageIcon = () => /* @__PURE__ */ jsxs(I, { children: [
|
|
2915
|
+
/* @__PURE__ */ jsx("path", { strokeWidth: "2", d: "M3 6l5-3 5 3v6l-5 3-5-3V6z" }),
|
|
2916
|
+
/* @__PURE__ */ jsx("path", { strokeWidth: "2", d: "M3 6l5 3 5-3M8 9v6" })
|
|
2917
|
+
] });
|
|
2918
|
+
var BoxIcon24 = () => /* @__PURE__ */ jsxs("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: [
|
|
2919
|
+
/* @__PURE__ */ jsx("path", { d: "M5 6l7-3 7 3v10l-7 3-7-3V6z" }),
|
|
2920
|
+
/* @__PURE__ */ jsx("path", { d: "M5 6l7 3 7-3M12 9v10" })
|
|
2921
|
+
] });
|
|
2922
|
+
function defaultNavItems(opts) {
|
|
2923
|
+
const items = [
|
|
2924
|
+
{ label: "Dashboard", href: "/account", icon: /* @__PURE__ */ jsx(DashboardIcon, {}) },
|
|
2925
|
+
{ label: opts.ordersLabel ?? "Orders", href: "/account/orders", icon: /* @__PURE__ */ jsx(OrdersIcon, {}) }
|
|
2926
|
+
];
|
|
2927
|
+
if (opts.showSubscriptions !== false) {
|
|
2928
|
+
items.push({
|
|
2929
|
+
label: opts.subscriptionsLabel ?? "Subscriptions",
|
|
2930
|
+
href: "/account/subscriptions",
|
|
2931
|
+
icon: /* @__PURE__ */ jsx(SubscriptionsIcon, {})
|
|
2932
|
+
});
|
|
2933
|
+
}
|
|
2934
|
+
items.push({ label: "Cimplify identity", href: "https://link.cimplify.io", icon: /* @__PURE__ */ jsx(IdentityIcon, {}), external: true });
|
|
2935
|
+
items.push({ label: "Sign out", href: "/auth/signout", icon: /* @__PURE__ */ jsx(SignOutIcon, {}) });
|
|
2936
|
+
return items;
|
|
2937
|
+
}
|
|
2938
|
+
function timeOfDayGreeting(name) {
|
|
2939
|
+
if (typeof window === "undefined") return `Hi, ${name}`;
|
|
2940
|
+
const h = (/* @__PURE__ */ new Date()).getHours();
|
|
2941
|
+
if (h < 5) return `Up late, ${name}`;
|
|
2942
|
+
if (h < 12) return `Good morning, ${name}`;
|
|
2943
|
+
if (h < 17) return `Good afternoon, ${name}`;
|
|
2944
|
+
return `Good evening, ${name}`;
|
|
2945
|
+
}
|
|
2946
|
+
function AccountDashboardPage({
|
|
2947
|
+
customerName,
|
|
2948
|
+
customerEmail,
|
|
2949
|
+
customerId,
|
|
2950
|
+
merchantName,
|
|
2951
|
+
nav,
|
|
2952
|
+
activeHref = "/account",
|
|
2953
|
+
scopeNote,
|
|
2954
|
+
greeting,
|
|
2955
|
+
activePane,
|
|
2956
|
+
upcomingPane,
|
|
2957
|
+
continuity,
|
|
2958
|
+
recentOrders,
|
|
2959
|
+
identitySummary,
|
|
2960
|
+
welcomeCta
|
|
2961
|
+
}) {
|
|
2962
|
+
const navItems = nav ?? defaultNavItems({});
|
|
2963
|
+
const hasHero = !!activePane || !!upcomingPane;
|
|
2964
|
+
const hasOrders = !!recentOrders && recentOrders.length > 0;
|
|
2965
|
+
const isNewCustomer = !hasHero && !hasOrders;
|
|
2966
|
+
return /* @__PURE__ */ jsx(
|
|
2967
|
+
AccountShell,
|
|
2968
|
+
{
|
|
2969
|
+
sidebar: /* @__PURE__ */ jsxs(
|
|
2970
|
+
AccountSidebar,
|
|
2971
|
+
{
|
|
2972
|
+
scopeNote: scopeNote ?? /* @__PURE__ */ jsxs("span", { children: [
|
|
2973
|
+
"Your orders and subscriptions with ",
|
|
2974
|
+
/* @__PURE__ */ jsx("strong", { className: "text-foreground font-semibold", children: merchantName }),
|
|
2975
|
+
"."
|
|
2976
|
+
] }),
|
|
2977
|
+
children: [
|
|
2978
|
+
/* @__PURE__ */ jsx(AccountIdentityStrip, { name: customerName, email: customerEmail, customerId }),
|
|
2979
|
+
/* @__PURE__ */ jsx(AccountNav, { items: navItems, activeHref })
|
|
2980
|
+
]
|
|
2981
|
+
}
|
|
2982
|
+
),
|
|
2983
|
+
children: /* @__PURE__ */ jsxs(AccountContent, { children: [
|
|
2984
|
+
/* @__PURE__ */ jsx(AccountHero, { title: greeting ?? timeOfDayGreeting(customerName.split(" ")[0] ?? customerName) }),
|
|
2985
|
+
continuity && /* @__PURE__ */ jsx(
|
|
2986
|
+
ContinuityCard,
|
|
2987
|
+
{
|
|
2988
|
+
glyph: continuity.glyph,
|
|
2989
|
+
title: continuity.title,
|
|
2990
|
+
description: continuity.description,
|
|
2991
|
+
badge: continuity.badge
|
|
2992
|
+
}
|
|
2993
|
+
),
|
|
2994
|
+
isNewCustomer ? /* @__PURE__ */ jsx(
|
|
2995
|
+
WelcomeCard,
|
|
2996
|
+
{
|
|
2997
|
+
title: `Welcome to ${merchantName}`,
|
|
2998
|
+
description: "Your orders and subscriptions will appear here. Start with something fresh?",
|
|
2999
|
+
action: welcomeCta ?? /* @__PURE__ */ jsx(Button, { variant: "primary", children: "Browse" })
|
|
3000
|
+
}
|
|
3001
|
+
) : hasHero && /* @__PURE__ */ jsx(
|
|
3002
|
+
HappeningCard,
|
|
3003
|
+
{
|
|
3004
|
+
left: activePane ? { ...activePane, variant: "live" } : void 0,
|
|
3005
|
+
right: upcomingPane ? { ...upcomingPane, variant: "next" } : void 0
|
|
3006
|
+
}
|
|
3007
|
+
),
|
|
3008
|
+
hasOrders && /* @__PURE__ */ jsx(
|
|
3009
|
+
Section,
|
|
3010
|
+
{
|
|
3011
|
+
title: "Recent orders",
|
|
3012
|
+
action: /* @__PURE__ */ jsx(SectionMore, { href: "/account/orders", children: "View all \u2192" }),
|
|
3013
|
+
children: /* @__PURE__ */ jsx(OrderList, { orders: recentOrders })
|
|
3014
|
+
}
|
|
3015
|
+
),
|
|
3016
|
+
/* @__PURE__ */ jsx(Section, { title: "Identity", children: /* @__PURE__ */ jsx(IdentityOfframp, { summary: identitySummary }) })
|
|
3017
|
+
] })
|
|
3018
|
+
}
|
|
3019
|
+
);
|
|
3020
|
+
}
|
|
3021
|
+
function AccountOrdersPage({
|
|
3022
|
+
customerName,
|
|
3023
|
+
customerEmail,
|
|
3024
|
+
customerId,
|
|
3025
|
+
merchantName,
|
|
3026
|
+
nav,
|
|
3027
|
+
activeHref = "/account/orders",
|
|
3028
|
+
scopeNote,
|
|
3029
|
+
title = "Orders",
|
|
3030
|
+
description,
|
|
3031
|
+
orders,
|
|
3032
|
+
filterTabs,
|
|
3033
|
+
loadMore,
|
|
3034
|
+
emptyAction,
|
|
3035
|
+
emptyTitle = "No orders yet",
|
|
3036
|
+
emptyDescription
|
|
3037
|
+
}) {
|
|
3038
|
+
const navItems = nav ?? defaultNavItems({});
|
|
3039
|
+
return /* @__PURE__ */ jsx(
|
|
3040
|
+
AccountShell,
|
|
3041
|
+
{
|
|
3042
|
+
sidebar: /* @__PURE__ */ jsxs(
|
|
3043
|
+
AccountSidebar,
|
|
3044
|
+
{
|
|
3045
|
+
scopeNote: scopeNote ?? /* @__PURE__ */ jsxs("span", { children: [
|
|
3046
|
+
"Your activity with ",
|
|
3047
|
+
/* @__PURE__ */ jsx("strong", { className: "text-foreground font-semibold", children: merchantName }),
|
|
3048
|
+
"."
|
|
3049
|
+
] }),
|
|
3050
|
+
children: [
|
|
3051
|
+
/* @__PURE__ */ jsx(AccountIdentityStrip, { name: customerName, email: customerEmail, customerId }),
|
|
3052
|
+
/* @__PURE__ */ jsx(AccountNav, { items: navItems, activeHref })
|
|
3053
|
+
]
|
|
3054
|
+
}
|
|
3055
|
+
),
|
|
3056
|
+
children: /* @__PURE__ */ jsxs(AccountContent, { children: [
|
|
3057
|
+
/* @__PURE__ */ jsx(
|
|
3058
|
+
AccountHero,
|
|
3059
|
+
{
|
|
3060
|
+
title,
|
|
3061
|
+
subtitle: description ?? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3062
|
+
orders.length,
|
|
3063
|
+
" orders with ",
|
|
3064
|
+
/* @__PURE__ */ jsx("strong", { children: merchantName }),
|
|
3065
|
+
"."
|
|
3066
|
+
] })
|
|
3067
|
+
}
|
|
3068
|
+
),
|
|
3069
|
+
orders.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3070
|
+
filterTabs,
|
|
3071
|
+
/* @__PURE__ */ jsx(OrderList, { orders }),
|
|
3072
|
+
loadMore && /* @__PURE__ */ jsx("div", { className: "text-center mt-8", children: loadMore })
|
|
3073
|
+
] }) : /* @__PURE__ */ jsx(
|
|
3074
|
+
EmptyState,
|
|
3075
|
+
{
|
|
3076
|
+
glyph: /* @__PURE__ */ jsx(BoxIcon24, {}),
|
|
3077
|
+
title: emptyTitle,
|
|
3078
|
+
description: emptyDescription ?? `Your first order from ${merchantName} will show up here.`,
|
|
3079
|
+
action: emptyAction
|
|
3080
|
+
}
|
|
3081
|
+
)
|
|
3082
|
+
] })
|
|
3083
|
+
}
|
|
3084
|
+
);
|
|
3085
|
+
}
|
|
3086
|
+
function AccountOrderDetailPage({
|
|
3087
|
+
customerName,
|
|
3088
|
+
customerEmail,
|
|
3089
|
+
customerId,
|
|
3090
|
+
merchantName,
|
|
3091
|
+
nav,
|
|
3092
|
+
activeHref = "/account/orders",
|
|
3093
|
+
scopeNote,
|
|
3094
|
+
title,
|
|
3095
|
+
metaText,
|
|
3096
|
+
orderId,
|
|
3097
|
+
status,
|
|
3098
|
+
timelineSteps,
|
|
3099
|
+
itemsTitle = "Items",
|
|
3100
|
+
itemsRightLabel,
|
|
3101
|
+
items,
|
|
3102
|
+
totals,
|
|
3103
|
+
contextRows,
|
|
3104
|
+
primaryAction,
|
|
3105
|
+
secondaryAction,
|
|
3106
|
+
continuity
|
|
3107
|
+
}) {
|
|
3108
|
+
const navItems = nav ?? defaultNavItems({});
|
|
3109
|
+
return /* @__PURE__ */ jsx(
|
|
3110
|
+
AccountShell,
|
|
3111
|
+
{
|
|
3112
|
+
sidebar: /* @__PURE__ */ jsxs(
|
|
3113
|
+
AccountSidebar,
|
|
3114
|
+
{
|
|
3115
|
+
scopeNote: scopeNote ?? /* @__PURE__ */ jsxs("span", { children: [
|
|
3116
|
+
"Your activity with ",
|
|
3117
|
+
/* @__PURE__ */ jsx("strong", { className: "text-foreground font-semibold", children: merchantName }),
|
|
3118
|
+
"."
|
|
3119
|
+
] }),
|
|
3120
|
+
children: [
|
|
3121
|
+
/* @__PURE__ */ jsx(AccountIdentityStrip, { name: customerName, email: customerEmail, customerId }),
|
|
3122
|
+
/* @__PURE__ */ jsx(AccountNav, { items: navItems, activeHref })
|
|
3123
|
+
]
|
|
3124
|
+
}
|
|
3125
|
+
),
|
|
3126
|
+
children: /* @__PURE__ */ jsxs(AccountContent, { children: [
|
|
3127
|
+
/* @__PURE__ */ jsx("a", { href: "/account/orders", className: "text-foreground/55 text-[13px] no-underline hover:text-primary inline-block mb-7", children: "\u2190 All orders" }),
|
|
3128
|
+
/* @__PURE__ */ jsx(
|
|
3129
|
+
OrderDetailHeader,
|
|
3130
|
+
{
|
|
3131
|
+
title,
|
|
3132
|
+
meta: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3133
|
+
/* @__PURE__ */ jsx("span", { children: metaText }),
|
|
3134
|
+
/* @__PURE__ */ jsx(OrderDetailMetaPipe, {}),
|
|
3135
|
+
/* @__PURE__ */ jsxs("span", { className: "font-mono text-[11.5px]", children: [
|
|
3136
|
+
"#",
|
|
3137
|
+
orderId
|
|
3138
|
+
] }),
|
|
3139
|
+
/* @__PURE__ */ jsx(OrderDetailMetaPipe, {}),
|
|
3140
|
+
/* @__PURE__ */ jsx(Status, { status })
|
|
3141
|
+
] })
|
|
3142
|
+
}
|
|
3143
|
+
),
|
|
3144
|
+
continuity && /* @__PURE__ */ jsx(
|
|
3145
|
+
ContinuityCard,
|
|
3146
|
+
{
|
|
3147
|
+
glyph: continuity.glyph,
|
|
3148
|
+
title: continuity.title,
|
|
3149
|
+
description: continuity.description,
|
|
3150
|
+
className: "mt-0 mb-6"
|
|
3151
|
+
}
|
|
3152
|
+
),
|
|
3153
|
+
/* @__PURE__ */ jsx(OrderTimeline, { steps: timelineSteps }),
|
|
3154
|
+
/* @__PURE__ */ jsx(ItemsCard, { title: itemsTitle, rightLabel: itemsRightLabel, items, totals, className: "mb-4" }),
|
|
3155
|
+
contextRows && contextRows.length > 0 && /* @__PURE__ */ jsx(
|
|
3156
|
+
ContextCard,
|
|
3157
|
+
{
|
|
3158
|
+
rows: contextRows.map((r) => ({
|
|
3159
|
+
label: r.label,
|
|
3160
|
+
value: r.value,
|
|
3161
|
+
manageHref: r.manageHref,
|
|
3162
|
+
manageLabel: "Manage"
|
|
3163
|
+
}))
|
|
3164
|
+
}
|
|
3165
|
+
),
|
|
3166
|
+
(primaryAction || secondaryAction) && /* @__PURE__ */ jsxs("div", { className: "flex gap-3 mt-8", children: [
|
|
3167
|
+
primaryAction,
|
|
3168
|
+
secondaryAction
|
|
3169
|
+
] })
|
|
3170
|
+
] })
|
|
3171
|
+
}
|
|
3172
|
+
);
|
|
3173
|
+
}
|
|
3174
|
+
function AccountSubscriptionsPage({
|
|
3175
|
+
customerName,
|
|
3176
|
+
customerEmail,
|
|
3177
|
+
customerId,
|
|
3178
|
+
merchantName,
|
|
3179
|
+
nav,
|
|
3180
|
+
activeHref = "/account/subscriptions",
|
|
3181
|
+
scopeNote,
|
|
3182
|
+
active,
|
|
3183
|
+
paused,
|
|
3184
|
+
past,
|
|
3185
|
+
emptyAction,
|
|
3186
|
+
emptyTitle = "No subscriptions yet",
|
|
3187
|
+
emptyDescription
|
|
3188
|
+
}) {
|
|
3189
|
+
const navItems = nav ?? defaultNavItems({});
|
|
3190
|
+
const isEmpty = (!active || active.length === 0) && (!paused || paused.length === 0) && (!past || past.length === 0);
|
|
3191
|
+
return /* @__PURE__ */ jsx(
|
|
3192
|
+
AccountShell,
|
|
3193
|
+
{
|
|
3194
|
+
sidebar: /* @__PURE__ */ jsxs(
|
|
3195
|
+
AccountSidebar,
|
|
3196
|
+
{
|
|
3197
|
+
scopeNote: scopeNote ?? /* @__PURE__ */ jsxs("span", { children: [
|
|
3198
|
+
"Your activity with ",
|
|
3199
|
+
/* @__PURE__ */ jsx("strong", { className: "text-foreground font-semibold", children: merchantName }),
|
|
3200
|
+
"."
|
|
3201
|
+
] }),
|
|
3202
|
+
children: [
|
|
3203
|
+
/* @__PURE__ */ jsx(AccountIdentityStrip, { name: customerName, email: customerEmail, customerId }),
|
|
3204
|
+
/* @__PURE__ */ jsx(AccountNav, { items: navItems, activeHref })
|
|
3205
|
+
]
|
|
3206
|
+
}
|
|
3207
|
+
),
|
|
3208
|
+
children: /* @__PURE__ */ jsxs(AccountContent, { children: [
|
|
3209
|
+
/* @__PURE__ */ jsx(
|
|
3210
|
+
AccountHero,
|
|
3211
|
+
{
|
|
3212
|
+
title: "Subscriptions",
|
|
3213
|
+
subtitle: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3214
|
+
"Recurring orders from ",
|
|
3215
|
+
/* @__PURE__ */ jsx("strong", { children: merchantName }),
|
|
3216
|
+
"."
|
|
3217
|
+
] })
|
|
3218
|
+
}
|
|
3219
|
+
),
|
|
3220
|
+
isEmpty ? /* @__PURE__ */ jsx(
|
|
3221
|
+
EmptyState,
|
|
3222
|
+
{
|
|
3223
|
+
title: emptyTitle,
|
|
3224
|
+
description: emptyDescription ?? `Set up a recurring delivery from ${merchantName} and it'll show up here.`,
|
|
3225
|
+
action: emptyAction
|
|
3226
|
+
}
|
|
3227
|
+
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3228
|
+
active && active.length > 0 && /* @__PURE__ */ jsx(Section, { title: "Active", meta: `${active.length}`, children: /* @__PURE__ */ jsx(SubscriptionList, { subscriptions: active }) }),
|
|
3229
|
+
paused && paused.length > 0 && /* @__PURE__ */ jsx(Section, { title: "Paused", meta: `${paused.length}`, children: /* @__PURE__ */ jsx(SubscriptionList, { subscriptions: paused }) }),
|
|
3230
|
+
past && past.length > 0 && /* @__PURE__ */ jsx(Section, { title: "Past", meta: `${past.length}`, children: /* @__PURE__ */ jsx(SubscriptionList, { subscriptions: past }) })
|
|
3231
|
+
] })
|
|
3232
|
+
] })
|
|
3233
|
+
}
|
|
3234
|
+
);
|
|
3235
|
+
}
|
|
3236
|
+
function AccountSubscriptionDetailPage({
|
|
3237
|
+
customerName,
|
|
3238
|
+
customerEmail,
|
|
3239
|
+
customerId,
|
|
3240
|
+
merchantName,
|
|
3241
|
+
nav,
|
|
3242
|
+
activeHref = "/account/subscriptions",
|
|
3243
|
+
scopeNote,
|
|
3244
|
+
title,
|
|
3245
|
+
metaText,
|
|
3246
|
+
status,
|
|
3247
|
+
paused,
|
|
3248
|
+
nextDeliveryLabel,
|
|
3249
|
+
nextDeliveryDate,
|
|
3250
|
+
nextDeliveryMeta,
|
|
3251
|
+
nextDeliveryActions,
|
|
3252
|
+
nextDeliveryFootnote,
|
|
3253
|
+
nextDeliveryRightFootnote,
|
|
3254
|
+
itemsTitle = "What's in each delivery",
|
|
3255
|
+
items,
|
|
3256
|
+
totals,
|
|
3257
|
+
contextRows,
|
|
3258
|
+
toast,
|
|
3259
|
+
cancelAction
|
|
3260
|
+
}) {
|
|
3261
|
+
const navItems = nav ?? defaultNavItems({});
|
|
3262
|
+
return /* @__PURE__ */ jsx(
|
|
3263
|
+
AccountShell,
|
|
3264
|
+
{
|
|
3265
|
+
sidebar: /* @__PURE__ */ jsxs(
|
|
3266
|
+
AccountSidebar,
|
|
3267
|
+
{
|
|
3268
|
+
scopeNote: scopeNote ?? /* @__PURE__ */ jsxs("span", { children: [
|
|
3269
|
+
"Your activity with ",
|
|
3270
|
+
/* @__PURE__ */ jsx("strong", { className: "text-foreground font-semibold", children: merchantName }),
|
|
3271
|
+
"."
|
|
3272
|
+
] }),
|
|
3273
|
+
children: [
|
|
3274
|
+
/* @__PURE__ */ jsx(AccountIdentityStrip, { name: customerName, email: customerEmail, customerId }),
|
|
3275
|
+
/* @__PURE__ */ jsx(AccountNav, { items: navItems, activeHref })
|
|
3276
|
+
]
|
|
3277
|
+
}
|
|
3278
|
+
),
|
|
3279
|
+
children: /* @__PURE__ */ jsxs(AccountContent, { children: [
|
|
3280
|
+
/* @__PURE__ */ jsx("a", { href: "/account/subscriptions", className: "text-foreground/55 text-[13px] no-underline hover:text-primary inline-block mb-7", children: "\u2190 All subscriptions" }),
|
|
3281
|
+
/* @__PURE__ */ jsx(
|
|
3282
|
+
OrderDetailHeader,
|
|
3283
|
+
{
|
|
3284
|
+
title,
|
|
3285
|
+
meta: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3286
|
+
/* @__PURE__ */ jsx("span", { children: metaText }),
|
|
3287
|
+
/* @__PURE__ */ jsx(OrderDetailMetaPipe, {}),
|
|
3288
|
+
/* @__PURE__ */ jsx(Status, { status })
|
|
3289
|
+
] })
|
|
3290
|
+
}
|
|
3291
|
+
),
|
|
3292
|
+
toast,
|
|
3293
|
+
/* @__PURE__ */ jsx(
|
|
3294
|
+
NextDeliveryCard,
|
|
3295
|
+
{
|
|
3296
|
+
label: nextDeliveryLabel,
|
|
3297
|
+
date: nextDeliveryDate,
|
|
3298
|
+
meta: nextDeliveryMeta,
|
|
3299
|
+
actions: nextDeliveryActions,
|
|
3300
|
+
footnote: nextDeliveryFootnote,
|
|
3301
|
+
rightFootnote: nextDeliveryRightFootnote,
|
|
3302
|
+
paused
|
|
3303
|
+
}
|
|
3304
|
+
),
|
|
3305
|
+
/* @__PURE__ */ jsx(ItemsCard, { title: itemsTitle, items, totals, className: "mb-4" }),
|
|
3306
|
+
contextRows && contextRows.length > 0 && /* @__PURE__ */ jsx(
|
|
3307
|
+
ContextCard,
|
|
3308
|
+
{
|
|
3309
|
+
rows: contextRows.map((r) => ({
|
|
3310
|
+
label: r.label,
|
|
3311
|
+
value: r.value,
|
|
3312
|
+
manageHref: r.manageHref,
|
|
3313
|
+
manageLabel: "Manage"
|
|
3314
|
+
}))
|
|
3315
|
+
}
|
|
3316
|
+
),
|
|
3317
|
+
cancelAction && /* @__PURE__ */ jsx("div", { className: "mt-9 pt-7 border-t border-border", children: cancelAction })
|
|
3318
|
+
] })
|
|
3319
|
+
}
|
|
3320
|
+
);
|
|
3321
|
+
}
|
|
1804
3322
|
function useCimplifySession(options) {
|
|
1805
3323
|
const sessionUri = options?.sessionUri ?? "/auth/session";
|
|
1806
3324
|
const [session, setSession] = useState(null);
|
|
@@ -5684,7 +7202,7 @@ function FileUploadInput({
|
|
|
5684
7202
|
onFileUpload,
|
|
5685
7203
|
classNames
|
|
5686
7204
|
}) {
|
|
5687
|
-
const [isUploading, setIsUploading] =
|
|
7205
|
+
const [isUploading, setIsUploading] = React12.useState(false);
|
|
5688
7206
|
const fileUrl = typeof value === "string" ? value : void 0;
|
|
5689
7207
|
const acceptedFormats = field.validation?.accepted_formats;
|
|
5690
7208
|
const accept = acceptedFormats ? acceptedFormats.map((f) => `.${f}`).join(",") : field.field_type === INPUT_FIELD_TYPE.Image ? "image/*" : void 0;
|
|
@@ -5834,22 +7352,22 @@ function AddressInput({
|
|
|
5834
7352
|
}) {
|
|
5835
7353
|
const clientContext = useOptionalCimplifyClient();
|
|
5836
7354
|
const addr = value && typeof value === "object" ? value : null;
|
|
5837
|
-
const [inputText, setInputText] =
|
|
5838
|
-
const [suggestions, setSuggestions] =
|
|
5839
|
-
const [isOpen, setIsOpen] =
|
|
5840
|
-
const [highlightedIndex, setHighlightedIndex] =
|
|
5841
|
-
const debounceRef =
|
|
5842
|
-
const seqRef =
|
|
5843
|
-
const sessionTokenRef =
|
|
5844
|
-
const blurTimeoutRef =
|
|
5845
|
-
|
|
7355
|
+
const [inputText, setInputText] = React12.useState(addr?.formatted_address ?? "");
|
|
7356
|
+
const [suggestions, setSuggestions] = React12.useState([]);
|
|
7357
|
+
const [isOpen, setIsOpen] = React12.useState(false);
|
|
7358
|
+
const [highlightedIndex, setHighlightedIndex] = React12.useState(-1);
|
|
7359
|
+
const debounceRef = React12.useRef(null);
|
|
7360
|
+
const seqRef = React12.useRef(0);
|
|
7361
|
+
const sessionTokenRef = React12.useRef(createSessionToken());
|
|
7362
|
+
const blurTimeoutRef = React12.useRef(null);
|
|
7363
|
+
React12.useEffect(() => {
|
|
5846
7364
|
return () => {
|
|
5847
7365
|
if (debounceRef.current) clearTimeout(debounceRef.current);
|
|
5848
7366
|
if (blurTimeoutRef.current) clearTimeout(blurTimeoutRef.current);
|
|
5849
7367
|
seqRef.current += 1;
|
|
5850
7368
|
};
|
|
5851
7369
|
}, []);
|
|
5852
|
-
const fetchSuggestions =
|
|
7370
|
+
const fetchSuggestions = React12.useCallback(async (query) => {
|
|
5853
7371
|
const client = clientContext?.client;
|
|
5854
7372
|
if (!client || query.length < 3) {
|
|
5855
7373
|
setSuggestions([]);
|
|
@@ -5873,7 +7391,7 @@ function AddressInput({
|
|
|
5873
7391
|
if (debounceRef.current) clearTimeout(debounceRef.current);
|
|
5874
7392
|
debounceRef.current = setTimeout(() => void fetchSuggestions(nextValue.trim()), 300);
|
|
5875
7393
|
};
|
|
5876
|
-
const selectSuggestion =
|
|
7394
|
+
const selectSuggestion = React12.useCallback(async (suggestion) => {
|
|
5877
7395
|
if (debounceRef.current) clearTimeout(debounceRef.current);
|
|
5878
7396
|
if (blurTimeoutRef.current) clearTimeout(blurTimeoutRef.current);
|
|
5879
7397
|
const fallback = suggestion.description.split(",")[0]?.trim() || suggestion.description;
|
|
@@ -5976,22 +7494,22 @@ function LocationInput({
|
|
|
5976
7494
|
}) {
|
|
5977
7495
|
const clientContext = useOptionalCimplifyClient();
|
|
5978
7496
|
const loc = value && typeof value === "object" ? value : null;
|
|
5979
|
-
const [inputText, setInputText] =
|
|
5980
|
-
const [suggestions, setSuggestions] =
|
|
5981
|
-
const [isOpen, setIsOpen] =
|
|
5982
|
-
const [highlightedIndex, setHighlightedIndex] =
|
|
5983
|
-
const debounceRef =
|
|
5984
|
-
const seqRef =
|
|
5985
|
-
const sessionTokenRef =
|
|
5986
|
-
const blurTimeoutRef =
|
|
5987
|
-
|
|
7497
|
+
const [inputText, setInputText] = React12.useState(loc?.label ?? "");
|
|
7498
|
+
const [suggestions, setSuggestions] = React12.useState([]);
|
|
7499
|
+
const [isOpen, setIsOpen] = React12.useState(false);
|
|
7500
|
+
const [highlightedIndex, setHighlightedIndex] = React12.useState(-1);
|
|
7501
|
+
const debounceRef = React12.useRef(null);
|
|
7502
|
+
const seqRef = React12.useRef(0);
|
|
7503
|
+
const sessionTokenRef = React12.useRef(createSessionToken());
|
|
7504
|
+
const blurTimeoutRef = React12.useRef(null);
|
|
7505
|
+
React12.useEffect(() => {
|
|
5988
7506
|
return () => {
|
|
5989
7507
|
if (debounceRef.current) clearTimeout(debounceRef.current);
|
|
5990
7508
|
if (blurTimeoutRef.current) clearTimeout(blurTimeoutRef.current);
|
|
5991
7509
|
seqRef.current += 1;
|
|
5992
7510
|
};
|
|
5993
7511
|
}, []);
|
|
5994
|
-
const fetchSuggestions =
|
|
7512
|
+
const fetchSuggestions = React12.useCallback(async (query) => {
|
|
5995
7513
|
const client = clientContext?.client;
|
|
5996
7514
|
if (!client || query.length < 3) {
|
|
5997
7515
|
setSuggestions([]);
|
|
@@ -6015,7 +7533,7 @@ function LocationInput({
|
|
|
6015
7533
|
if (debounceRef.current) clearTimeout(debounceRef.current);
|
|
6016
7534
|
debounceRef.current = setTimeout(() => void fetchSuggestions(nextValue.trim()), 300);
|
|
6017
7535
|
};
|
|
6018
|
-
const selectSuggestion =
|
|
7536
|
+
const selectSuggestion = React12.useCallback(async (suggestion) => {
|
|
6019
7537
|
if (debounceRef.current) clearTimeout(debounceRef.current);
|
|
6020
7538
|
if (blurTimeoutRef.current) clearTimeout(blurTimeoutRef.current);
|
|
6021
7539
|
const label = suggestion.description.split(",")[0]?.trim() || suggestion.description;
|
|
@@ -6104,8 +7622,8 @@ function PhoneInput({
|
|
|
6104
7622
|
inputClass
|
|
6105
7623
|
}) {
|
|
6106
7624
|
const phone = value && typeof value === "object" ? value : null;
|
|
6107
|
-
const [code, setCode] =
|
|
6108
|
-
const [number, setNumber] =
|
|
7625
|
+
const [code, setCode] = React12.useState(phone?.country_code ?? "+1");
|
|
7626
|
+
const [number, setNumber] = React12.useState(phone?.number ?? "");
|
|
6109
7627
|
const update = (nextCode, nextNumber) => {
|
|
6110
7628
|
setCode(nextCode);
|
|
6111
7629
|
setNumber(nextNumber);
|
|
@@ -6150,8 +7668,8 @@ function SignatureInput({
|
|
|
6150
7668
|
classNames
|
|
6151
7669
|
}) {
|
|
6152
7670
|
const sig = value && typeof value === "object" ? value : null;
|
|
6153
|
-
const canvasRef =
|
|
6154
|
-
const isDrawing =
|
|
7671
|
+
const canvasRef = React12.useRef(null);
|
|
7672
|
+
const isDrawing = React12.useRef(false);
|
|
6155
7673
|
const getCtx = () => canvasRef.current?.getContext("2d") ?? null;
|
|
6156
7674
|
const startDraw = (e) => {
|
|
6157
7675
|
const ctx = getCtx();
|
|
@@ -6948,7 +8466,7 @@ function ProductCustomizer({
|
|
|
6948
8466
|
" ea."
|
|
6949
8467
|
] }),
|
|
6950
8468
|
/* @__PURE__ */ jsx(
|
|
6951
|
-
Button,
|
|
8469
|
+
Button$1,
|
|
6952
8470
|
{
|
|
6953
8471
|
onClick: handleAddToCart,
|
|
6954
8472
|
disabled: isAdded || isSubmitting || !quoteEnabled,
|
|
@@ -7183,7 +8701,7 @@ function ProductModel3D({
|
|
|
7183
8701
|
"data-cimplify-product-model-3d": true,
|
|
7184
8702
|
className,
|
|
7185
8703
|
style: { position: "relative", overflow: "hidden", ...ASPECT_STYLES3[aspectRatio] },
|
|
7186
|
-
children: ready ?
|
|
8704
|
+
children: ready ? React12.createElement("model-viewer", {
|
|
7187
8705
|
src,
|
|
7188
8706
|
"ios-src": iosSrc,
|
|
7189
8707
|
alt,
|
|
@@ -7194,12 +8712,12 @@ function ProductModel3D({
|
|
|
7194
8712
|
"auto-rotate": autoRotate || void 0,
|
|
7195
8713
|
"shadow-intensity": "1",
|
|
7196
8714
|
style: { width: "100%", height: "100%", backgroundColor: "transparent" }
|
|
7197
|
-
}) : poster ?
|
|
8715
|
+
}) : poster ? React12.createElement("img", {
|
|
7198
8716
|
src: poster,
|
|
7199
8717
|
alt: alt ?? "",
|
|
7200
8718
|
"data-cimplify-product-model-3d-loading": true,
|
|
7201
8719
|
style: { width: "100%", height: "100%", objectFit: "cover" }
|
|
7202
|
-
}) :
|
|
8720
|
+
}) : React12.createElement("div", {
|
|
7203
8721
|
"data-cimplify-product-model-3d-loading": true,
|
|
7204
8722
|
style: { width: "100%", height: "100%", backgroundColor: "var(--muted, #f3f4f6)" }
|
|
7205
8723
|
})
|
|
@@ -8960,13 +10478,13 @@ function ProductGrid({
|
|
|
8960
10478
|
className,
|
|
8961
10479
|
classNames
|
|
8962
10480
|
}) {
|
|
8963
|
-
const rawId =
|
|
10481
|
+
const rawId = React12.useId();
|
|
8964
10482
|
const gridId = `cimplify-grid-${rawId.replace(/:/g, "")}`;
|
|
8965
10483
|
const sm = columns?.sm ?? 1;
|
|
8966
10484
|
const md = columns?.md ?? 2;
|
|
8967
10485
|
const lg = columns?.lg ?? 3;
|
|
8968
10486
|
const xl = columns?.xl ?? 4;
|
|
8969
|
-
const css =
|
|
10487
|
+
const css = React12.useMemo(
|
|
8970
10488
|
() => [
|
|
8971
10489
|
`#${gridId}{display:grid;grid-template-columns:repeat(${sm},1fr);gap:1rem}`,
|
|
8972
10490
|
`@media(min-width:768px){#${gridId}{grid-template-columns:repeat(${md},1fr)}}`,
|
|
@@ -9327,7 +10845,7 @@ function CategoryGrid({
|
|
|
9327
10845
|
enabled: categoriesProp === void 0
|
|
9328
10846
|
});
|
|
9329
10847
|
const categories = categoriesProp ?? fetched;
|
|
9330
|
-
const rawId =
|
|
10848
|
+
const rawId = React12.useId();
|
|
9331
10849
|
const gridId = `cimplify-cat-grid-${rawId.replace(/:/g, "")}`;
|
|
9332
10850
|
const sm = columns?.sm ?? 2;
|
|
9333
10851
|
const md = columns?.md ?? 3;
|
|
@@ -9553,7 +11071,7 @@ function OrderSummary({
|
|
|
9553
11071
|
/* @__PURE__ */ jsx("p", { children: order.delivery_address })
|
|
9554
11072
|
] }),
|
|
9555
11073
|
/* @__PURE__ */ jsx("div", { "data-cimplify-order-items": true, className: classNames?.items, children: order.items.map(
|
|
9556
|
-
(item) => renderLineItem ? /* @__PURE__ */ jsx(
|
|
11074
|
+
(item) => renderLineItem ? /* @__PURE__ */ jsx(React12.Fragment, { children: renderLineItem(item) }, item.id) : /* @__PURE__ */ jsxs("div", { "data-cimplify-order-line-item": true, className: classNames?.lineItem, children: [
|
|
9557
11075
|
/* @__PURE__ */ jsxs("div", { "data-cimplify-order-line-info": true, children: [
|
|
9558
11076
|
/* @__PURE__ */ jsxs("span", { "data-cimplify-order-line-qty": true, children: [
|
|
9559
11077
|
item.quantity,
|
|
@@ -10713,7 +12231,7 @@ function DefaultCatalogueLayout({
|
|
|
10713
12231
|
/* @__PURE__ */ jsx("p", { className: "text-lg font-medium", children: "No products found" }),
|
|
10714
12232
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-1", children: "Try adjusting your filters" })
|
|
10715
12233
|
] }) : /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 md:grid-cols-3 gap-4", children: products.map(
|
|
10716
|
-
(product) => renderCard ? /* @__PURE__ */ jsx(
|
|
12234
|
+
(product) => renderCard ? /* @__PURE__ */ jsx(React12.Fragment, { children: renderCard(product) }, product.id) : /* @__PURE__ */ jsx(
|
|
10717
12235
|
ProductCard,
|
|
10718
12236
|
{
|
|
10719
12237
|
product,
|
|
@@ -10820,7 +12338,7 @@ function CompactCatalogueLayout({
|
|
|
10820
12338
|
/* @__PURE__ */ jsx("p", { className: "text-lg font-medium", children: "No items found" }),
|
|
10821
12339
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-1", children: "Try a different category or search" })
|
|
10822
12340
|
] }) : /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 lg:grid-cols-3 gap-5", children: products.map(
|
|
10823
|
-
(product) => renderCard ? /* @__PURE__ */ jsx(
|
|
12341
|
+
(product) => renderCard ? /* @__PURE__ */ jsx(React12.Fragment, { children: renderCard(product) }, product.id) : /* @__PURE__ */ jsx(
|
|
10824
12342
|
ProductCard,
|
|
10825
12343
|
{
|
|
10826
12344
|
product,
|
|
@@ -10843,8 +12361,8 @@ var BUILT_IN_LAYOUTS = {
|
|
|
10843
12361
|
["compact" /* Compact */]: CompactCatalogueLayout
|
|
10844
12362
|
};
|
|
10845
12363
|
function useDebounce(value, delay) {
|
|
10846
|
-
const [debounced, setDebounced] =
|
|
10847
|
-
|
|
12364
|
+
const [debounced, setDebounced] = React12.useState(value);
|
|
12365
|
+
React12.useEffect(() => {
|
|
10848
12366
|
const timer = setTimeout(() => setDebounced(value), delay);
|
|
10849
12367
|
return () => clearTimeout(timer);
|
|
10850
12368
|
}, [value, delay]);
|
|
@@ -12171,7 +13689,7 @@ function CartDrawer({
|
|
|
12171
13689
|
}
|
|
12172
13690
|
) })
|
|
12173
13691
|
] }),
|
|
12174
|
-
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto px-6", children: cart.isEmpty ? /* @__PURE__ */ jsx(
|
|
13692
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto px-6", children: cart.isEmpty ? /* @__PURE__ */ jsx(EmptyState2, { onShop: handleShop }) : /* @__PURE__ */ jsx(CartSummary, { showTotals: false, showCheckoutButton: false }) }),
|
|
12175
13693
|
!cart.isEmpty && /* @__PURE__ */ jsxs("footer", { className: "border-t border-border px-6 py-5 shrink-0 space-y-3 bg-background", children: [
|
|
12176
13694
|
/* @__PURE__ */ jsxs("div", { className: "flex items-baseline justify-between", children: [
|
|
12177
13695
|
/* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: "Subtotal" }),
|
|
@@ -12211,7 +13729,7 @@ function CartDrawer({
|
|
|
12211
13729
|
}
|
|
12212
13730
|
);
|
|
12213
13731
|
}
|
|
12214
|
-
function
|
|
13732
|
+
function EmptyState2({ onShop }) {
|
|
12215
13733
|
return /* @__PURE__ */ jsx("div", { "data-cimplify-cart-empty": true, className: "h-full grid place-items-center text-center py-16", children: /* @__PURE__ */ jsxs("div", { className: "space-y-5 max-w-[260px]", children: [
|
|
12216
13734
|
/* @__PURE__ */ jsxs("div", { className: "relative w-20 h-20 mx-auto", children: [
|
|
12217
13735
|
/* @__PURE__ */ jsx("div", { className: "absolute inset-0 rounded-full bg-muted" }),
|
|
@@ -12364,7 +13882,7 @@ function DefaultCollectionLayout({
|
|
|
12364
13882
|
] })
|
|
12365
13883
|
] }),
|
|
12366
13884
|
filtered.length > 0 ? /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4", children: filtered.map(
|
|
12367
|
-
(product) => renderCard ? /* @__PURE__ */ jsx(
|
|
13885
|
+
(product) => renderCard ? /* @__PURE__ */ jsx(React12.Fragment, { children: renderCard(product) }, product.id) : /* @__PURE__ */ jsx(
|
|
12368
13886
|
ProductCard,
|
|
12369
13887
|
{
|
|
12370
13888
|
product,
|
|
@@ -12417,7 +13935,7 @@ function FeaturedCollectionLayout({
|
|
|
12417
13935
|
] })
|
|
12418
13936
|
] }),
|
|
12419
13937
|
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6", children: products.map(
|
|
12420
|
-
(product) => renderCard ? /* @__PURE__ */ jsx(
|
|
13938
|
+
(product) => renderCard ? /* @__PURE__ */ jsx(React12.Fragment, { children: renderCard(product) }, product.id) : /* @__PURE__ */ jsx(
|
|
12421
13939
|
ProductCard,
|
|
12422
13940
|
{
|
|
12423
13941
|
product,
|
|
@@ -12541,7 +14059,7 @@ function CatalogueCollectionLayout({
|
|
|
12541
14059
|
] })
|
|
12542
14060
|
] }),
|
|
12543
14061
|
filtered.length > 0 ? /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4", children: filtered.map(
|
|
12544
|
-
(product) => renderCard ? /* @__PURE__ */ jsx(
|
|
14062
|
+
(product) => renderCard ? /* @__PURE__ */ jsx(React12.Fragment, { children: renderCard(product) }, product.id) : /* @__PURE__ */ jsx(
|
|
12545
14063
|
ProductCard,
|
|
12546
14064
|
{
|
|
12547
14065
|
product,
|
|
@@ -12921,7 +14439,7 @@ function DefaultSearchLayout({
|
|
|
12921
14439
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-1", children: "Try a different search term" }),
|
|
12922
14440
|
/* @__PURE__ */ jsx("button", { onClick: clear, className: "text-sm font-medium text-primary mt-4 hover:underline", children: "Clear search" })
|
|
12923
14441
|
] }) : results.length > 0 ? /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 md:grid-cols-3 gap-4", children: results.map(
|
|
12924
|
-
(product) => renderCard ? /* @__PURE__ */ jsx(
|
|
14442
|
+
(product) => renderCard ? /* @__PURE__ */ jsx(React12.Fragment, { children: renderCard(product) }, product.id) : /* @__PURE__ */ jsx(
|
|
12925
14443
|
ProductCard,
|
|
12926
14444
|
{
|
|
12927
14445
|
product,
|
|
@@ -13023,7 +14541,7 @@ function CompactSearchLayout({
|
|
|
13023
14541
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-1", children: "Try a different search term" }),
|
|
13024
14542
|
/* @__PURE__ */ jsx("button", { onClick: clear, className: "text-sm font-medium text-primary mt-4 hover:underline", children: "Clear search" })
|
|
13025
14543
|
] }) : results.length > 0 ? /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 lg:grid-cols-3 gap-5", children: results.map(
|
|
13026
|
-
(product) => renderCard ? /* @__PURE__ */ jsx(
|
|
14544
|
+
(product) => renderCard ? /* @__PURE__ */ jsx(React12.Fragment, { children: renderCard(product) }, product.id) : /* @__PURE__ */ jsx(
|
|
13027
14545
|
ProductCard,
|
|
13028
14546
|
{
|
|
13029
14547
|
product,
|
|
@@ -13977,4 +15495,4 @@ function SparkleIcon({ className }) {
|
|
|
13977
15495
|
);
|
|
13978
15496
|
}
|
|
13979
15497
|
|
|
13980
|
-
export { AccommodationCard, Ad, AdProvider, AddOnSelector, AddressElement, AuthElement, AvailabilityBadge, BillingPlanSelector, BookingCard, BookingList, BookingPage, BookingsPage, BundleProductCard, BundleProductLayout, BundleSelector, CardImage, CardShell, CardVariant, CartDrawer, CartDrawerProvider, CartPage, CartSummary, CartTemplate, CatalogueCollectionLayout, CataloguePage, CatalogueTemplate, CategoryFilter, CategoryGrid, ChatWidget, CheckoutPage, CimplifyAccount, CimplifyCheckout, CimplifyProvider, CimplifySignInButton, CollectionPage, CollectionTemplate, CompactCartLayout, CompactCatalogueLayout, CompactSearchLayout, CompactServiceCard, CompositeProductCard, CompositeProductLayout, CompositeSelector, CurrencySelector, CustomAttributesTable, CustomerInputFields, DatePicker, DateSlotPicker, DealBanner, DealsPage, DefaultCartLayout, DefaultCatalogueLayout, DefaultCollectionLayout, DefaultProductLayout, DefaultSearchLayout, DeliveryEstimate, DigitalProductCard, DigitalProductLayout, DiscountInput, ElementsProvider, FeaturedCollectionLayout, FoodProductCard, FoodProductLayout, InventoryBadge, LeaseServiceCard, LocationPicker, MediaGallery, MetadataStringList, OrderDetailPage, OrderHistory, OrderHistoryPage, OrderSummary, PaymentElement, Price, PriceRange, ProductCard, ProductCustomizer, ProductGrid, ProductImageGallery, ProductModel3D, ProductPage, ProductSheet, ProductTemplate, PropertiesTable, QuantitySelector, QuickAddButton, RecentlyViewed, RecommendationCarousel, RelatedProductsSection, RentalServiceCard, ResourcePicker, RetailProductCard, SaleBadge, ScheduleServiceCard, SearchInput, SearchPage, SearchTemplate, ServiceProductLayout, SessionMessageBanner, SlotPicker, SoldOutOverlay, StaffPicker, StandardServiceCard, StoreNav, StoreVideo, SubscriptionCard, TagPills, TimePicker, TwoColumnGrid, VariantSelector, VolumePricing, WholesaleProductCard, WholesaleProductLayout, WishlistButton, cn, roomToResource, useActivityState, useAds, useAttributeDefinitions, useAvailableSlots, useBillingPlans, useBookings, useBootstrap, useBundles, useCart, useCartDrawer, useCategories, useChat, useCheckout, useCimplify, useCimplifyClient, useCimplifySession, useCollection, useCollections, useDeals, useDeliveryFee, useElements, useElementsReady, useFxRate, useLocations, useOptionalCimplify, useOrder, useOrders, useProduct, useProductAvailability, useProductDeals, useProductPrice, useProductSchedules, useProducts, useProductsOnSale, usePropertyFacets, useQuote, useRecommendations, useSearch, useServiceAvailability, useServices, useSubscription, useSubscriptions, useTaxonomies, useTaxonomy, useTaxonomyPath, useValidateDiscount, useVariantSelector };
|
|
15498
|
+
export { AccommodationCard, AccountContent, AccountDashboardPage, AccountHero, AccountIdentityStrip, AccountNav, AccountOrderDetailPage, AccountOrdersPage, AccountShell, AccountSidebar, AccountSignedOutPrompt, AccountSubscriptionDetailPage, AccountSubscriptionsPage, Ad, AdProvider, AddOnSelector, AddressElement, AuthElement, AvailabilityBadge, BackLink, BillingPlanSelector, BookingCard, BookingList, BookingPage, BookingsPage, BoxIcon24, BundleProductCard, BundleProductLayout, BundleSelector, Button, CardImage, CardShell, CardVariant, CartDrawer, CartDrawerProvider, CartPage, CartSummary, CartTemplate, CatalogueCollectionLayout, CataloguePage, CatalogueTemplate, CategoryFilter, CategoryGrid, ChatWidget, CheckIcon, CheckoutPage, CimplifyAccount, CimplifyCheckout, CimplifyProvider, CimplifySignInButton, CollectionPage, CollectionTemplate, CompactCartLayout, CompactCatalogueLayout, CompactSearchLayout, CompactServiceCard, CompositeProductCard, CompositeProductLayout, CompositeSelector, ContextCard, ContinuityCard, CurrencySelector, CustomAttributesTable, CustomerInputFields, DashboardIcon, DashboardIcon20, DatePicker, DateSlotPicker, DealBanner, DealsPage, DefaultCartLayout, DefaultCatalogueLayout, DefaultCollectionLayout, DefaultProductLayout, DefaultSearchLayout, DeliveryEstimate, DeliveryTruckIcon, DigitalProductCard, DigitalProductLayout, DiscountInput, ElementsProvider, EmptyState, ErrorState, FeaturedCollectionLayout, FilterTabs, FoodProductCard, FoodProductLayout, HappeningCard, IdentityIcon, IdentityOfframp, InventoryBadge, ItemsCard, LeaseServiceCard, LocationPicker, MediaGallery, MetadataStringList, MobileAccountShell, MobileBackButton, MobileMoreButton, MobileTabBar, NextDeliveryCard, OrderDetailHeader, OrderDetailMetaPipe, OrderDetailPage, OrderHistory, OrderHistoryPage, OrderList, OrderRow, OrderSummary, OrderTimeline, OrderTotals, OrdersIcon, OrdersIcon20, OvenIcon, PackageIcon, PaymentElement, Price, PriceRange, ProductCard, ProductCustomizer, ProductGrid, ProductImageGallery, ProductModel3D, ProductPage, ProductSheet, ProductTemplate, PropertiesTable, QuantitySelector, QuickAddButton, RecentlyViewed, RecommendationCarousel, RelatedProductsSection, RentalServiceCard, ResourcePicker, RetailProductCard, SaleBadge, ScheduleServiceCard, SearchInput, SearchPage, SearchTemplate, Section, SectionMore, ServiceProductLayout, SessionMessageBanner, SignOutIcon, Skeleton, SlotPicker, SoldOutOverlay, StaffPicker, StandardServiceCard, Status, StoreNav, StoreVideo, SubscriptionCard, SubscriptionList, SubscriptionRow, SubscriptionsIcon, SubscriptionsIcon20, TagPills, TimePicker, Toast, TwoColumnGrid, VariantSelector, VolumePricing, WelcomeCard, WholesaleProductCard, WholesaleProductLayout, WishlistButton, cn, roomToResource, useActivityState, useAds, useAttributeDefinitions, useAvailableSlots, useBillingPlans, useBookings, useBootstrap, useBundles, useCart, useCartDrawer, useCategories, useChat, useCheckout, useCimplify, useCimplifyClient, useCimplifySession, useCollection, useCollections, useDeals, useDeliveryFee, useElements, useElementsReady, useFxRate, useLocations, useOptionalCimplify, useOrder, useOrders, useProduct, useProductAvailability, useProductDeals, useProductPrice, useProductSchedules, useProducts, useProductsOnSale, usePropertyFacets, useQuote, useRecommendations, useSearch, useServiceAvailability, useServices, useSubscription, useSubscriptions, useTaxonomies, useTaxonomy, useTaxonomyPath, useValidateDiscount, useVariantSelector };
|