@cimplify/sdk 0.68.0 → 0.70.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.
Files changed (46) hide show
  1. package/README.md +3 -2
  2. package/dist/advanced.d.mts +1 -1
  3. package/dist/advanced.d.ts +1 -1
  4. package/dist/advanced.js +20 -20
  5. package/dist/advanced.mjs +1 -1
  6. package/dist/{chunk-TAKORJP4.mjs → chunk-6XXVA3IV.mjs} +2 -2
  7. package/dist/{chunk-WCSAZRNC.js → chunk-BCWPRPK7.js} +10 -0
  8. package/dist/{chunk-KNPE4WCQ.mjs → chunk-EAVXSFAB.mjs} +1 -1
  9. package/dist/{chunk-SXGFJEME.js → chunk-I4MP2XZS.js} +73 -7
  10. package/dist/{chunk-SOV4H6PQ.mjs → chunk-M2CXZQHS.mjs} +10 -0
  11. package/dist/{chunk-FVGVJ4TC.mjs → chunk-O3ECKVOM.mjs} +73 -7
  12. package/dist/{chunk-5HAUJBOK.js → chunk-QZQEGRGB.js} +35 -35
  13. package/dist/{chunk-NGQCWFKF.js → chunk-SC5DUKGD.js} +4 -4
  14. package/dist/{client-CBE7ksYC.d.mts → client-BRGGjeny.d.mts} +1 -1
  15. package/dist/{client-Dyo3dvNy.d.mts → client-DRJvXz54.d.mts} +181 -21
  16. package/dist/{client-DlXfZy7N.d.ts → client-Des_GqmQ.d.ts} +1 -1
  17. package/dist/{client-CfeQRwhl.d.ts → client-DjQhg6yr.d.ts} +181 -21
  18. package/dist/index.d.mts +1 -1
  19. package/dist/index.d.ts +1 -1
  20. package/dist/index.js +68 -68
  21. package/dist/index.mjs +3 -3
  22. package/dist/mock/cli.mjs +73 -7
  23. package/dist/mock/library.js +73 -7
  24. package/dist/mock/library.mjs +73 -7
  25. package/dist/mock/msw.js +73 -7
  26. package/dist/mock/msw.mjs +73 -7
  27. package/dist/react.d.mts +166 -2
  28. package/dist/react.d.ts +166 -2
  29. package/dist/react.js +1223 -493
  30. package/dist/react.mjs +801 -79
  31. package/dist/server.d.mts +2 -2
  32. package/dist/server.d.ts +2 -2
  33. package/dist/server.js +7 -7
  34. package/dist/server.mjs +2 -2
  35. package/dist/styles.css +1 -1
  36. package/dist/testing/msw.js +2 -2
  37. package/dist/testing/msw.mjs +1 -1
  38. package/dist/testing/suite.d.mts +2 -2
  39. package/dist/testing/suite.d.ts +2 -2
  40. package/dist/testing/suite.js +23 -23
  41. package/dist/testing/suite.mjs +4 -4
  42. package/dist/testing.d.mts +2 -2
  43. package/dist/testing.d.ts +2 -2
  44. package/dist/testing.js +79 -79
  45. package/dist/testing.mjs +5 -5
  46. package/package.json +1 -1
package/dist/react.mjs CHANGED
@@ -1,15 +1,16 @@
1
1
  "use client";
2
2
  import { DURATION_UNIT, getVariantDisplayName, INPUT_FIELD_TYPE, PRODUCT_TYPE, resolveGallery, RENDER_HINT } from './chunk-E6T5VJMG.mjs';
3
3
  export { getVariantDisplayName } from './chunk-E6T5VJMG.mjs';
4
- import { createCimplifyClient } from './chunk-KNPE4WCQ.mjs';
5
- import { ELEMENT_TYPES, EVENT_TYPES, startSignIn } from './chunk-SOV4H6PQ.mjs';
6
- import { formatPrice, parsePrice, getUnitPriceAtQuantity, isOnSale, getDiscountPercentage, getBasePrice, getPriceRange, formatPriceRange } from './chunk-TD3AY34U.mjs';
4
+ import { createCimplifyClient } from './chunk-EAVXSFAB.mjs';
5
+ import { ELEMENT_TYPES, EVENT_TYPES, startSignIn } from './chunk-M2CXZQHS.mjs';
6
+ import { parsePrice, formatMoney, formatPrice, 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 React12, { createContext, useRef, useState, useCallback, useEffect, useContext, useMemo, useId, useSyncExternalStore } from 'react';
9
+ import React14, { 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';
13
+ import { format, parseISO, isValid } from 'date-fns';
13
14
  import { NumberField } from '@base-ui/react/number-field';
14
15
  import { RadioGroup } from '@base-ui/react/radio-group';
15
16
  import { Radio } from '@base-ui/react/radio';
@@ -17,7 +18,6 @@ import { Checkbox } from '@base-ui/react/checkbox';
17
18
  import { Button as Button$1 } from '@base-ui/react/button';
18
19
  import { Popover } from '@base-ui/react/popover';
19
20
  import { DayPicker } from 'react-day-picker';
20
- import { format, parseISO, isValid } from 'date-fns';
21
21
  import { Tabs } from '@base-ui/react/tabs';
22
22
  import { FilterXSS, safeAttrValue as safeAttrValue$1 } from 'xss';
23
23
  import { Dialog } from '@base-ui/react/dialog';
@@ -1427,14 +1427,14 @@ function CimplifyCheckout({
1427
1427
  const resolvedCartRef = useRef(resolvedCart);
1428
1428
  resolvedCartRef.current = resolvedCart;
1429
1429
  const isDark = appearance?.theme === "dark";
1430
- const emitStatus = React12.useEffectEvent(
1430
+ const emitStatus = React14.useEffectEvent(
1431
1431
  (nextStatus, context = {}) => {
1432
1432
  setStatus(nextStatus);
1433
1433
  setStatusText(context.display_text || "");
1434
1434
  onStatusChange?.(nextStatus, context);
1435
1435
  }
1436
1436
  );
1437
- const fireError = React12.useEffectEvent(
1437
+ const fireError = React14.useEffectEvent(
1438
1438
  (error) => {
1439
1439
  onError?.(error);
1440
1440
  }
@@ -1530,7 +1530,7 @@ function CimplifyCheckout({
1530
1530
  activeCheckoutRef.current = null;
1531
1531
  };
1532
1532
  }, []);
1533
- const handleSubmit = React12.useEffectEvent(async () => {
1533
+ const handleSubmit = React14.useEffectEvent(async () => {
1534
1534
  if (isSubmitting || isInitializing || !resolvedCartId) {
1535
1535
  if (!resolvedCartId && !isInitializing) {
1536
1536
  const message = "Your cart is empty. Add items before checkout.";
@@ -1668,7 +1668,7 @@ var BUTTON_SIZES = {
1668
1668
  sm: "px-[13px] py-[7px] text-[12.5px]",
1669
1669
  md: "px-[18px] py-[10px] text-[13.5px]"
1670
1670
  };
1671
- var Button = React12.forwardRef(function Button2({ variant = "primary", size = "md", className, children, ...props }, ref) {
1671
+ var Button = React14.forwardRef(function Button2({ variant = "primary", size = "md", className, children, ...props }, ref) {
1672
1672
  return /* @__PURE__ */ jsx(
1673
1673
  "button",
1674
1674
  {
@@ -2449,6 +2449,744 @@ function ContextCard({ rows, className }) {
2449
2449
  }
2450
2450
  );
2451
2451
  }
2452
+ function RiderAvatar({ rider, size }) {
2453
+ if (rider.photoUrl) {
2454
+ return /* @__PURE__ */ jsx(
2455
+ "img",
2456
+ {
2457
+ src: rider.photoUrl,
2458
+ alt: "",
2459
+ className: "rounded-full object-cover",
2460
+ style: { width: size, height: size }
2461
+ }
2462
+ );
2463
+ }
2464
+ return /* @__PURE__ */ jsx(
2465
+ "span",
2466
+ {
2467
+ "aria-hidden": true,
2468
+ className: "grid place-items-center rounded-full font-serif font-semibold text-white",
2469
+ style: { width: size, height: size, fontSize: size * 0.38, background: avatarGradient(rider.name) },
2470
+ children: initials(rider.name)
2471
+ }
2472
+ );
2473
+ }
2474
+ function RiderMeta({ rider }) {
2475
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
2476
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
2477
+ /* @__PURE__ */ jsx("span", { className: "truncate text-sm font-semibold text-foreground", children: rider.name }),
2478
+ rider.rating !== void 0 && /* @__PURE__ */ jsxs("span", { className: "shrink-0 text-xs font-semibold text-amber-500", children: [
2479
+ "\u2605 ",
2480
+ rider.rating.toFixed(1)
2481
+ ] })
2482
+ ] }),
2483
+ rider.vehicle && /* @__PURE__ */ jsx("div", { className: "truncate text-xs text-foreground/55", children: rider.vehicle })
2484
+ ] });
2485
+ }
2486
+ function DotStep({ steps }) {
2487
+ const current = steps.find((s) => s.state === "current") ?? [...steps].reverse().find((s) => s.state === "done");
2488
+ return /* @__PURE__ */ jsxs("div", { className: "mt-3.5", children: [
2489
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1.5", children: steps.map((step, i) => /* @__PURE__ */ jsxs(React14.Fragment, { children: [
2490
+ i > 0 && /* @__PURE__ */ jsx(
2491
+ "span",
2492
+ {
2493
+ className: cn(
2494
+ "h-0.5 flex-1 rounded-full",
2495
+ steps[i - 1].state === "done" ? "bg-primary" : "bg-border"
2496
+ )
2497
+ }
2498
+ ),
2499
+ /* @__PURE__ */ jsx(
2500
+ "span",
2501
+ {
2502
+ className: cn(
2503
+ "block size-[7px] shrink-0 rounded-full",
2504
+ step.state === "done" && "bg-primary",
2505
+ step.state === "current" && "bg-primary ring-4 ring-primary/15",
2506
+ step.state === "pending" && "bg-border"
2507
+ )
2508
+ }
2509
+ )
2510
+ ] }, step.label)) }),
2511
+ current && /* @__PURE__ */ jsx("div", { className: "mt-2 truncate text-center text-[11.5px] font-semibold text-primary", children: current.label })
2512
+ ] });
2513
+ }
2514
+ function DeliveryTracker({
2515
+ steps,
2516
+ statusLabel,
2517
+ etaLabel,
2518
+ rider,
2519
+ live,
2520
+ onTrackLive,
2521
+ onContactRider,
2522
+ variant = "card",
2523
+ className
2524
+ }) {
2525
+ return /* @__PURE__ */ jsx(
2526
+ "div",
2527
+ {
2528
+ "data-cimplify-delivery-tracker": true,
2529
+ "data-mode": live ? "live" : "steps",
2530
+ className: cn(
2531
+ "overflow-hidden",
2532
+ variant === "card" && "rounded-[var(--radius,12px)] border border-border/60 bg-card",
2533
+ className
2534
+ ),
2535
+ children: live ? /* @__PURE__ */ jsxs(Fragment, { children: [
2536
+ /* @__PURE__ */ jsxs("div", { className: "relative h-[216px] w-full overflow-hidden bg-muted", children: [
2537
+ live.map,
2538
+ /* @__PURE__ */ jsxs("div", { className: "absolute left-3 top-3 inline-flex items-center gap-1.5 rounded-full border border-border/40 bg-background/90 px-2.5 py-1 text-xs font-semibold shadow-sm backdrop-blur", children: [
2539
+ /* @__PURE__ */ jsx("span", { className: "relative size-[7px] rounded-full bg-emerald-500", children: /* @__PURE__ */ jsx("span", { className: "absolute inset-0 animate-ping rounded-full bg-emerald-500" }) }),
2540
+ "Live"
2541
+ ] }),
2542
+ (live.etaLabel ?? etaLabel) && /* @__PURE__ */ jsx("div", { className: "absolute right-3 top-3 rounded-full bg-foreground px-3 py-1.5 text-xs font-semibold text-background shadow-lg", children: live.etaLabel ?? etaLabel })
2543
+ ] }),
2544
+ rider && /* @__PURE__ */ jsxs("div", { className: "relative z-[2] -mt-6 mx-3.5 mb-3.5 rounded-2xl border border-border/60 bg-card p-3.5 shadow-[0_10px_30px_-16px_rgba(16,24,40,0.32)]", children: [
2545
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
2546
+ /* @__PURE__ */ jsxs("div", { className: "relative shrink-0", children: [
2547
+ /* @__PURE__ */ jsx(RiderAvatar, { rider, size: 46 }),
2548
+ /* @__PURE__ */ jsx("span", { className: "absolute -bottom-px -right-px size-3 rounded-full border-[2.5px] border-card bg-emerald-500" })
2549
+ ] }),
2550
+ /* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsx(RiderMeta, { rider }) }),
2551
+ (rider.etaLabel || rider.distanceLabel) && /* @__PURE__ */ jsxs("div", { className: "text-right", children: [
2552
+ rider.etaLabel && /* @__PURE__ */ jsx("div", { className: "text-[15px] font-semibold tabular-nums text-foreground", children: rider.etaLabel }),
2553
+ rider.distanceLabel && /* @__PURE__ */ jsx("div", { className: "text-[11.5px] text-foreground/55", children: rider.distanceLabel })
2554
+ ] })
2555
+ ] }),
2556
+ /* @__PURE__ */ jsxs("div", { className: "mt-3 flex gap-2", children: [
2557
+ /* @__PURE__ */ jsx(
2558
+ "button",
2559
+ {
2560
+ type: "button",
2561
+ onClick: onTrackLive,
2562
+ className: "h-10 flex-1 rounded-xl bg-primary text-sm font-semibold text-[var(--color-primary-foreground,#fff)] hover:brightness-105",
2563
+ children: "Track live"
2564
+ }
2565
+ ),
2566
+ /* @__PURE__ */ jsx(
2567
+ "button",
2568
+ {
2569
+ type: "button",
2570
+ onClick: onContactRider,
2571
+ "aria-label": `Contact ${rider.name}`,
2572
+ className: "grid size-10 place-items-center rounded-xl border border-border bg-card text-foreground hover:bg-muted/50",
2573
+ children: /* @__PURE__ */ jsx("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", children: /* @__PURE__ */ jsx("path", { d: "M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3 19.5 19.5 0 0 1-6-6 19.8 19.8 0 0 1-3-8.6A2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1 1 .4 1.9.7 2.8a2 2 0 0 1-.5 2.1L8.1 9.9a16 16 0 0 0 6 6l1.3-1.2a2 2 0 0 1 2.1-.5c.9.3 1.8.6 2.8.7a2 2 0 0 1 1.7 2Z" }) })
2574
+ }
2575
+ )
2576
+ ] }),
2577
+ /* @__PURE__ */ jsx(DotStep, { steps })
2578
+ ] })
2579
+ ] }) : /* @__PURE__ */ jsxs("div", { className: variant === "card" ? "p-4 sm:p-5" : "", children: [
2580
+ (statusLabel || etaLabel) && /* @__PURE__ */ jsxs("div", { className: "mb-4 flex items-center justify-between", children: [
2581
+ statusLabel && /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5 rounded-full bg-amber-500/10 px-2.5 py-1 text-xs font-semibold text-amber-600", children: [
2582
+ /* @__PURE__ */ jsx("span", { className: "size-1.5 rounded-full bg-current" }),
2583
+ statusLabel
2584
+ ] }),
2585
+ etaLabel && /* @__PURE__ */ jsx("span", { className: "text-[13px] font-semibold tabular-nums text-foreground", children: etaLabel })
2586
+ ] }),
2587
+ /* @__PURE__ */ jsx("ol", { className: "relative ml-[9px] border-l-2 border-border", children: steps.map((step) => /* @__PURE__ */ jsxs("li", { className: "relative pb-4 pl-6 last:pb-0", children: [
2588
+ /* @__PURE__ */ jsxs(
2589
+ "span",
2590
+ {
2591
+ className: cn(
2592
+ "absolute -left-[9px] top-px grid size-[18px] place-items-center rounded-full border-2 bg-card",
2593
+ step.state === "done" && "border-primary bg-primary",
2594
+ step.state === "current" && "border-primary ring-4 ring-primary/15",
2595
+ step.state === "pending" && "border-border"
2596
+ ),
2597
+ children: [
2598
+ step.state === "done" && /* @__PURE__ */ jsx("svg", { width: "10", height: "10", viewBox: "0 0 24 24", fill: "none", stroke: "#fff", strokeWidth: "3.5", children: /* @__PURE__ */ jsx("path", { d: "M20 6 9 17l-5-5" }) }),
2599
+ step.state === "current" && /* @__PURE__ */ jsx("span", { className: "size-[7px] rounded-full bg-primary" })
2600
+ ]
2601
+ }
2602
+ ),
2603
+ /* @__PURE__ */ jsx(
2604
+ "div",
2605
+ {
2606
+ className: cn(
2607
+ "text-[13px] font-semibold",
2608
+ step.state === "pending" ? "text-foreground/45" : "text-foreground"
2609
+ ),
2610
+ children: step.label
2611
+ }
2612
+ ),
2613
+ step.time && /* @__PURE__ */ jsx("div", { className: "text-xs text-foreground/55", children: step.time })
2614
+ ] }, step.label)) }),
2615
+ rider && /* @__PURE__ */ jsxs("div", { className: "mt-1 flex items-center gap-3 border-t border-border/60 pt-4", children: [
2616
+ /* @__PURE__ */ jsx(RiderAvatar, { rider, size: 42 }),
2617
+ /* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ jsx(RiderMeta, { rider }) }),
2618
+ /* @__PURE__ */ jsx(
2619
+ "button",
2620
+ {
2621
+ type: "button",
2622
+ onClick: onContactRider,
2623
+ className: "h-9 rounded-[10px] border border-border bg-card px-4 text-[13px] font-semibold text-foreground hover:bg-muted/50",
2624
+ children: "Contact"
2625
+ }
2626
+ )
2627
+ ] })
2628
+ ] })
2629
+ }
2630
+ );
2631
+ }
2632
+ var STATE_TONE = {
2633
+ preparing: "text-amber-600",
2634
+ ready: "text-emerald-600",
2635
+ delivered: "text-emerald-600",
2636
+ booked: "text-primary",
2637
+ cancelled: "text-destructive",
2638
+ default: "text-foreground/55"
2639
+ };
2640
+ function StateDot({ label, tone = "default" }) {
2641
+ return /* @__PURE__ */ jsxs("span", { className: cn("inline-flex items-center gap-1.5 text-xs font-medium", STATE_TONE[tone]), children: [
2642
+ /* @__PURE__ */ jsx("span", { className: "size-1.5 rounded-full bg-current" }),
2643
+ label
2644
+ ] });
2645
+ }
2646
+ var TYPE_GLYPH = {
2647
+ product: null,
2648
+ bundle: null,
2649
+ composite: null,
2650
+ service: /* @__PURE__ */ jsxs("svg", { width: "19", height: "19", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.6", children: [
2651
+ /* @__PURE__ */ jsx("rect", { x: "3", y: "4", width: "18", height: "17", rx: "2" }),
2652
+ /* @__PURE__ */ jsx("path", { d: "M3 9h18M8 2v4M16 2v4" })
2653
+ ] }),
2654
+ digital: /* @__PURE__ */ jsxs("svg", { width: "19", height: "19", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.6", children: [
2655
+ /* @__PURE__ */ jsx("path", { d: "M4 4h11l5 5v11a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1Z" }),
2656
+ /* @__PURE__ */ jsx("path", { d: "M14 4v5h5" })
2657
+ ] })
2658
+ };
2659
+ function Thumb({ item }) {
2660
+ const glyph = item.lineType ? TYPE_GLYPH[item.lineType] : null;
2661
+ return /* @__PURE__ */ jsx("div", { className: "mt-px size-[46px] shrink-0 overflow-hidden rounded-[10px] bg-muted/50", children: item.imageUrl ? /* @__PURE__ */ jsx("img", { src: item.imageUrl, alt: "", className: "size-full object-cover" }) : /* @__PURE__ */ jsx("div", { className: "grid size-full place-items-center text-foreground/35", children: glyph }) });
2662
+ }
2663
+ function AccountLineItem({ item, className }) {
2664
+ const [open, setOpen] = useState(false);
2665
+ const subtitle = item.subtitle ?? ([item.variant, item.addOns?.length ? `+ ${item.addOns.map((a) => a.name).join(", ")}` : null].filter(Boolean).join(" \xB7 ") || void 0);
2666
+ const hasDetail = !!item.customerInputs?.length || !!item.includes?.length || !!item.customisations?.length;
2667
+ return /* @__PURE__ */ jsx("div", { "data-cimplify-line-item": true, "data-type": item.lineType, className: cn("py-[15px]", className), children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-[46px_minmax(0,1fr)_auto] items-start gap-x-[13px]", children: [
2668
+ /* @__PURE__ */ jsx(Thumb, { item }),
2669
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
2670
+ /* @__PURE__ */ jsx("div", { className: "text-sm font-semibold leading-tight tracking-[-0.01em] text-foreground", children: item.name }),
2671
+ subtitle && /* @__PURE__ */ jsx("div", { className: "mt-0.5 text-[12.5px] text-foreground/55", children: subtitle }),
2672
+ item.scheduling && /* @__PURE__ */ jsxs("div", { className: "mt-0.5 text-[12.5px] text-foreground/55", children: [
2673
+ item.scheduling.whenLabel,
2674
+ item.scheduling.staffName && ` \xB7 with ${item.scheduling.staffName}`
2675
+ ] }),
2676
+ (item.stateLabel || item.scheduling?.confirmationCode || hasDetail || item.digital) && /* @__PURE__ */ jsxs("div", { className: "mt-2 flex flex-wrap items-center gap-x-3 gap-y-1.5", children: [
2677
+ item.stateLabel && /* @__PURE__ */ jsx(StateDot, { label: item.stateLabel, tone: item.stateTone }),
2678
+ item.scheduling?.confirmationCode && /* @__PURE__ */ jsxs("span", { className: "text-xs text-foreground/45", children: [
2679
+ "#",
2680
+ item.scheduling.confirmationCode
2681
+ ] }),
2682
+ item.digital && /* @__PURE__ */ jsxs(Fragment, { children: [
2683
+ /* @__PURE__ */ jsx(
2684
+ StateDot,
2685
+ {
2686
+ label: item.digital.statusLabel,
2687
+ tone: item.digital.tone === "revoked" ? "cancelled" : "ready"
2688
+ }
2689
+ ),
2690
+ item.digital.usageSummary && /* @__PURE__ */ jsx("span", { className: "text-[11.5px] text-foreground/55", children: item.digital.usageSummary }),
2691
+ item.digital.onDownload && /* @__PURE__ */ jsxs(
2692
+ "button",
2693
+ {
2694
+ type: "button",
2695
+ onClick: item.digital.onDownload,
2696
+ className: "inline-flex items-center gap-1.5 text-xs font-semibold text-primary hover:underline",
2697
+ children: [
2698
+ /* @__PURE__ */ jsx("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("path", { d: "M12 3v12m0 0 4-4m-4 4-4-4M5 21h14" }) }),
2699
+ "Download"
2700
+ ]
2701
+ }
2702
+ )
2703
+ ] }),
2704
+ hasDetail && /* @__PURE__ */ jsxs(
2705
+ "button",
2706
+ {
2707
+ type: "button",
2708
+ onClick: () => setOpen((v) => !v),
2709
+ "aria-expanded": open,
2710
+ className: "inline-flex items-center gap-1.5 text-[12.5px] font-semibold text-foreground/55 hover:text-foreground",
2711
+ children: [
2712
+ /* @__PURE__ */ jsx(
2713
+ "svg",
2714
+ {
2715
+ width: "13",
2716
+ height: "13",
2717
+ viewBox: "0 0 24 24",
2718
+ fill: "none",
2719
+ stroke: "currentColor",
2720
+ strokeWidth: "2",
2721
+ className: cn("transition-transform", open && "rotate-90"),
2722
+ children: /* @__PURE__ */ jsx("path", { d: "m9 18 6-6-6-6" })
2723
+ }
2724
+ ),
2725
+ item.customisations?.length || item.customerInputs?.length ? "Customisations & details" : "What's included"
2726
+ ]
2727
+ }
2728
+ )
2729
+ ] }),
2730
+ open && hasDetail && /* @__PURE__ */ jsx(LineItemDetails, { item, className: "ml-[1px] mt-2.5" })
2731
+ ] }),
2732
+ /* @__PURE__ */ jsx("div", { className: "text-sm font-semibold tabular-nums text-foreground", children: item.priceLabel })
2733
+ ] }) });
2734
+ }
2735
+ function ChildRow({ sel }) {
2736
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-baseline gap-2 py-1.5 [&:not(:first-child)]:border-t [&:not(:first-child)]:border-border/50", children: [
2737
+ /* @__PURE__ */ jsxs("span", { className: "shrink-0 text-[11px] font-semibold tabular-nums text-foreground/55", children: [
2738
+ sel.quantity ?? 1,
2739
+ "\xD7"
2740
+ ] }),
2741
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
2742
+ /* @__PURE__ */ jsx("div", { className: "text-[12.5px] font-medium text-foreground", children: sel.name }),
2743
+ sel.variantName && /* @__PURE__ */ jsx("div", { className: "text-[11px] text-foreground/55", children: sel.variantName })
2744
+ ] }),
2745
+ sel.priceLabel && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-[11.5px] tabular-nums text-foreground/55", children: sel.priceLabel })
2746
+ ] });
2747
+ }
2748
+ function LineItemDetails({
2749
+ item,
2750
+ className
2751
+ }) {
2752
+ return /* @__PURE__ */ jsxs("div", { className: cn("space-y-3", className), children: [
2753
+ item.includes && item.includes.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
2754
+ /* @__PURE__ */ jsx("div", { className: "mb-1 text-[10px] font-bold uppercase tracking-wider text-foreground/45", children: "Bundle includes" }),
2755
+ item.includes.map((sel, i) => /* @__PURE__ */ jsx(ChildRow, { sel }, i))
2756
+ ] }),
2757
+ item.customisations && item.customisations.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
2758
+ /* @__PURE__ */ jsx("div", { className: "mb-1 text-[10px] font-bold uppercase tracking-wider text-foreground/45", children: "Customisations" }),
2759
+ item.customisations.map((sel, i) => /* @__PURE__ */ jsx(ChildRow, { sel }, i))
2760
+ ] }),
2761
+ item.customerInputs && item.customerInputs.length > 0 && /* @__PURE__ */ jsx("div", { className: "grid grid-cols-[84px_minmax(0,1fr)] items-start gap-x-2.5 gap-y-1 text-xs sm:grid-cols-[104px_minmax(0,1fr)]", children: item.customerInputs.map((input) => /* @__PURE__ */ jsxs(React14.Fragment, { children: [
2762
+ /* @__PURE__ */ jsx("span", { className: "capitalize text-foreground/55", children: input.fieldName }),
2763
+ /* @__PURE__ */ jsx(CustomerInputValue, { input })
2764
+ ] }, input.fieldId)) })
2765
+ ] });
2766
+ }
2767
+ function asObject(v) {
2768
+ return v && typeof v === "object" && !Array.isArray(v) ? v : null;
2769
+ }
2770
+ function CustomerInputValue({ input }) {
2771
+ const v = input.value;
2772
+ const obj = asObject(v);
2773
+ if (input.semanticKind === "allergen" || input.semanticKind === "sensitivity") {
2774
+ return /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5 font-medium text-amber-600", children: [
2775
+ /* @__PURE__ */ jsx("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("path", { d: "M12 9v4M12 17h.01M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z" }) }),
2776
+ String(v ?? "")
2777
+ ] });
2778
+ }
2779
+ switch (input.fieldType) {
2780
+ case "textarea":
2781
+ return /* @__PURE__ */ jsx("span", { className: "block whitespace-pre-wrap rounded-md bg-muted/40 px-2.5 py-1.5 leading-relaxed text-foreground/90", children: String(v ?? "") });
2782
+ case "number":
2783
+ return /* @__PURE__ */ jsx("span", { className: "font-semibold tabular-nums text-foreground", children: String(v ?? "") });
2784
+ case "select":
2785
+ case "radio":
2786
+ return /* @__PURE__ */ jsx("span", { className: "inline-flex w-fit items-center rounded-full border border-primary/20 bg-primary/[0.12] px-2 py-0.5 text-[11.5px] font-medium text-primary", children: String(v ?? "") });
2787
+ case "multi_select":
2788
+ case "checkbox": {
2789
+ if (typeof v === "boolean") return /* @__PURE__ */ jsx(BooleanBadge, { value: v });
2790
+ const list = Array.isArray(v) ? v.map(String) : [String(v ?? "")];
2791
+ return /* @__PURE__ */ jsx("span", { className: "flex flex-wrap gap-1", children: list.filter(Boolean).map((label, i) => /* @__PURE__ */ jsx("span", { className: "inline-flex items-center rounded-full border border-border bg-muted/40 px-2 py-0.5 text-[11px] font-medium", children: label }, i)) });
2792
+ }
2793
+ case "color": {
2794
+ const hex = String(v ?? "");
2795
+ const label = obj?.label ? String(obj.label) : hex;
2796
+ return /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5 font-medium text-foreground", children: [
2797
+ /* @__PURE__ */ jsx("span", { className: "inline-block size-3.5 rounded-full border border-black/10", style: { background: hex } }),
2798
+ label,
2799
+ hex && hex !== label && /* @__PURE__ */ jsx("span", { className: "font-mono text-[11px] text-foreground/55", children: hex })
2800
+ ] });
2801
+ }
2802
+ case "date":
2803
+ case "date_time":
2804
+ case "time":
2805
+ return /* @__PURE__ */ jsx("span", { className: "font-medium tabular-nums text-foreground", children: String(v ?? "") });
2806
+ case "date_range": {
2807
+ return /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5 font-medium tabular-nums text-foreground", children: [
2808
+ /* @__PURE__ */ jsx("span", { children: String(obj?.start ?? "") }),
2809
+ /* @__PURE__ */ jsx("span", { className: "text-foreground/55", children: "\u2192" }),
2810
+ /* @__PURE__ */ jsx("span", { children: String(obj?.end ?? "") })
2811
+ ] });
2812
+ }
2813
+ case "file": {
2814
+ const url = String(v ?? "");
2815
+ const filename = url.split("/").pop() || "Attachment";
2816
+ return /* @__PURE__ */ jsxs(
2817
+ "a",
2818
+ {
2819
+ href: url,
2820
+ target: "_blank",
2821
+ rel: "noopener noreferrer",
2822
+ className: "inline-flex w-fit max-w-full items-center gap-1.5 rounded-md border border-border bg-muted/40 px-2 py-1 text-foreground hover:border-primary hover:text-primary",
2823
+ children: [
2824
+ /* @__PURE__ */ jsx("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", children: /* @__PURE__ */ jsx("path", { d: "M14 3v5h5M15 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8Z" }) }),
2825
+ /* @__PURE__ */ jsx("span", { className: "truncate text-[11.5px] font-medium", children: filename })
2826
+ ]
2827
+ }
2828
+ );
2829
+ }
2830
+ case "image": {
2831
+ const url = typeof v === "string" ? v : "";
2832
+ if (!url) return /* @__PURE__ */ jsx("span", { className: "italic text-foreground/55", children: "No image" });
2833
+ return /* @__PURE__ */ jsx("a", { href: url, target: "_blank", rel: "noopener noreferrer", className: "block size-14 overflow-hidden rounded-md border border-border", children: /* @__PURE__ */ jsx("img", { src: url, alt: input.fieldName, className: "size-full object-cover" }) });
2834
+ }
2835
+ case "url": {
2836
+ const url = String(v ?? "");
2837
+ return /* @__PURE__ */ jsx("a", { href: url, target: "_blank", rel: "noopener noreferrer", className: "inline-flex max-w-full items-center gap-1 truncate text-primary hover:underline", children: url.replace(/^https?:\/\//, "").replace(/\/$/, "") });
2838
+ }
2839
+ case "email":
2840
+ return /* @__PURE__ */ jsx("a", { href: `mailto:${String(v ?? "")}`, className: "text-primary hover:underline", children: String(v ?? "") });
2841
+ case "phone": {
2842
+ const display = obj?.formatted ? String(obj.formatted) : String(v ?? "");
2843
+ return /* @__PURE__ */ jsx("a", { href: `tel:${display}`, className: "tabular-nums text-primary hover:underline", children: display });
2844
+ }
2845
+ case "address": {
2846
+ const formatted = obj?.formatted_address ? String(obj.formatted_address) : String(v ?? "");
2847
+ return /* @__PURE__ */ jsx("span", { className: "block whitespace-pre-line rounded-md bg-muted/40 px-2.5 py-1.5 text-[11.5px] leading-relaxed", children: formatted });
2848
+ }
2849
+ case "location": {
2850
+ const label = obj?.label ? String(obj.label) : null;
2851
+ const lat = obj?.latitude;
2852
+ const lng = obj?.longitude;
2853
+ return /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5 font-medium text-foreground", children: [
2854
+ /* @__PURE__ */ jsxs("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", className: "text-destructive", children: [
2855
+ /* @__PURE__ */ jsx("path", { d: "M12 21s-7-5.5-7-11a7 7 0 0 1 14 0c0 5.5-7 11-7 11Z" }),
2856
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "10", r: "2.5" })
2857
+ ] }),
2858
+ label ?? `${lat ?? "?"}, ${lng ?? "?"}`
2859
+ ] });
2860
+ }
2861
+ case "signature": {
2862
+ const signer = obj?.signer_name ? String(obj.signer_name) : null;
2863
+ return /* @__PURE__ */ jsxs("span", { className: "inline-flex w-fit items-center gap-1 rounded-full border border-emerald-500/20 bg-emerald-500/[0.12] px-2 py-0.5 text-[11px] font-semibold text-emerald-600", children: [
2864
+ /* @__PURE__ */ jsx("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", children: /* @__PURE__ */ jsx("path", { d: "M20 6 9 17l-5-5" }) }),
2865
+ signer ? `Signed by ${signer}` : "Signed"
2866
+ ] });
2867
+ }
2868
+ case "text":
2869
+ default:
2870
+ return /* @__PURE__ */ jsxs("span", { className: "italic text-foreground/90", children: [
2871
+ "\u201C",
2872
+ String(v ?? ""),
2873
+ "\u201D"
2874
+ ] });
2875
+ }
2876
+ }
2877
+ function BooleanBadge({ value }) {
2878
+ return value ? /* @__PURE__ */ jsxs("span", { className: "inline-flex w-fit items-center gap-1 rounded-full border border-emerald-500/20 bg-emerald-500/[0.12] px-2 py-0.5 text-[11px] font-semibold text-emerald-600", children: [
2879
+ /* @__PURE__ */ jsx("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", children: /* @__PURE__ */ jsx("path", { d: "M20 6 9 17l-5-5" }) }),
2880
+ "Yes"
2881
+ ] }) : /* @__PURE__ */ jsx("span", { className: "inline-flex w-fit items-center rounded-full bg-muted/40 px-2 py-0.5 text-[11px] font-medium text-foreground/55", children: "No" });
2882
+ }
2883
+ function AccountLineItems({ items, className }) {
2884
+ return /* @__PURE__ */ jsx("div", { "data-cimplify-line-items": true, className: cn("divide-y divide-border/60", className), children: items.map((item) => /* @__PURE__ */ jsx(AccountLineItem, { item }, item.id)) });
2885
+ }
2886
+ var STATUS_TONE = {
2887
+ progress: "bg-amber-500/10 text-amber-600",
2888
+ positive: "bg-emerald-500/10 text-emerald-600",
2889
+ muted: "bg-muted/60 text-foreground/60"
2890
+ };
2891
+ function SectionLabel({ children }) {
2892
+ return /* @__PURE__ */ jsx("div", { className: "text-[10px] font-bold uppercase tracking-wider text-foreground/45", children });
2893
+ }
2894
+ function AccountOrderView({
2895
+ orderNumber,
2896
+ placedLabel,
2897
+ statusLabel,
2898
+ statusTone = "progress",
2899
+ items,
2900
+ itemsLabel = "Items",
2901
+ delivery,
2902
+ payment,
2903
+ shipTo,
2904
+ actions,
2905
+ onBack,
2906
+ backLabel = "Back to orders",
2907
+ className
2908
+ }) {
2909
+ return /* @__PURE__ */ jsxs("div", { "data-cimplify-order-view": true, className: cn("min-w-0", className), children: [
2910
+ onBack && /* @__PURE__ */ jsxs(
2911
+ "button",
2912
+ {
2913
+ type: "button",
2914
+ onClick: onBack,
2915
+ className: "mb-5 inline-flex items-center gap-1.5 text-[13px] font-medium text-foreground/55 hover:text-foreground",
2916
+ children: [
2917
+ /* @__PURE__ */ jsx("svg", { width: "15", height: "15", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("path", { d: "m15 18-6-6 6-6" }) }),
2918
+ backLabel
2919
+ ]
2920
+ }
2921
+ ),
2922
+ /* @__PURE__ */ jsxs("div", { className: "mb-5 flex items-start justify-between gap-3", children: [
2923
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
2924
+ /* @__PURE__ */ jsxs("h1", { className: "font-serif text-2xl font-semibold tracking-[-0.02em] tabular-nums text-foreground", children: [
2925
+ "Order #",
2926
+ orderNumber
2927
+ ] }),
2928
+ placedLabel && /* @__PURE__ */ jsx("div", { className: "mt-0.5 text-[13px] text-foreground/55", children: placedLabel })
2929
+ ] }),
2930
+ statusLabel && /* @__PURE__ */ jsx(
2931
+ "span",
2932
+ {
2933
+ className: cn(
2934
+ "shrink-0 rounded-full px-2.5 py-1 text-xs font-semibold",
2935
+ STATUS_TONE[statusTone]
2936
+ ),
2937
+ children: statusLabel
2938
+ }
2939
+ )
2940
+ ] }),
2941
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-8 lg:grid-cols-[minmax(0,1fr)_300px] lg:gap-14", children: [
2942
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
2943
+ /* @__PURE__ */ jsxs("section", { children: [
2944
+ /* @__PURE__ */ jsx(SectionLabel, { children: itemsLabel }),
2945
+ /* @__PURE__ */ jsx(AccountLineItems, { items, className: "mt-2.5" })
2946
+ ] }),
2947
+ delivery && /* @__PURE__ */ jsxs("section", { className: "mt-6 border-t border-border/60 pt-6", children: [
2948
+ /* @__PURE__ */ jsx("div", { className: "mb-1 flex items-center justify-between", children: /* @__PURE__ */ jsx(SectionLabel, { children: delivery.label ?? "Delivery" }) }),
2949
+ delivery.note && /* @__PURE__ */ jsx("p", { className: "mb-4 text-[11.5px] text-foreground/55", children: delivery.note }),
2950
+ /* @__PURE__ */ jsx(
2951
+ DeliveryTracker,
2952
+ {
2953
+ variant: "plain",
2954
+ steps: delivery.steps,
2955
+ statusLabel: delivery.statusLabel,
2956
+ etaLabel: delivery.etaLabel,
2957
+ rider: delivery.rider,
2958
+ live: delivery.live,
2959
+ onTrackLive: delivery.onTrackLive,
2960
+ onContactRider: delivery.onContactRider
2961
+ }
2962
+ )
2963
+ ] })
2964
+ ] }),
2965
+ /* @__PURE__ */ jsxs("div", { children: [
2966
+ /* @__PURE__ */ jsxs("div", { className: "rounded-[var(--radius,12px)] bg-muted/40 p-4", children: [
2967
+ /* @__PURE__ */ jsxs("div", { className: "mb-3 flex items-center justify-between", children: [
2968
+ /* @__PURE__ */ jsx(SectionLabel, { children: "Payment" }),
2969
+ payment.stateLabel && /* @__PURE__ */ jsx(
2970
+ "span",
2971
+ {
2972
+ className: cn(
2973
+ "rounded-full px-2 py-0.5 text-[11.5px] font-semibold",
2974
+ payment.stateTone === "warning" ? "bg-amber-500/10 text-amber-600" : payment.stateTone === "muted" ? "bg-muted/70 text-foreground/60" : "bg-emerald-500/10 text-emerald-600"
2975
+ ),
2976
+ children: payment.stateLabel
2977
+ }
2978
+ )
2979
+ ] }),
2980
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2 text-[13px]", children: [
2981
+ payment.rows.map((row, i) => /* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
2982
+ /* @__PURE__ */ jsx("span", { className: "text-foreground/55", children: row.label }),
2983
+ /* @__PURE__ */ jsx("span", { className: cn("tabular-nums", row.tone === "positive" && "text-emerald-600"), children: row.value })
2984
+ ] }, i)),
2985
+ /* @__PURE__ */ jsx("div", { className: "my-2 h-px bg-border" }),
2986
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-between text-[15px] font-semibold", children: [
2987
+ /* @__PURE__ */ jsx("span", { children: payment.total.label }),
2988
+ /* @__PURE__ */ jsx("span", { className: "tabular-nums", children: payment.total.value })
2989
+ ] })
2990
+ ] }),
2991
+ payment.method && /* @__PURE__ */ jsxs(Fragment, { children: [
2992
+ /* @__PURE__ */ jsx("div", { className: "my-3 h-px bg-border" }),
2993
+ /* @__PURE__ */ jsx("div", { className: "text-[12.5px] text-foreground", children: payment.method })
2994
+ ] })
2995
+ ] }),
2996
+ shipTo && /* @__PURE__ */ jsxs("div", { className: "mt-7", children: [
2997
+ /* @__PURE__ */ jsx(SectionLabel, { children: shipTo.heading ?? "Delivering to" }),
2998
+ shipTo.name && /* @__PURE__ */ jsx("div", { className: "mt-2 text-[13px] font-semibold text-foreground", children: shipTo.name }),
2999
+ /* @__PURE__ */ jsx("div", { className: "mt-1 text-[12.5px] leading-relaxed text-foreground/55", children: shipTo.lines })
3000
+ ] }),
3001
+ actions && /* @__PURE__ */ jsx("div", { className: "mt-7 space-y-2.5", children: actions })
3002
+ ] })
3003
+ ] })
3004
+ ] });
3005
+ }
3006
+ function fmtDateTime(iso) {
3007
+ if (!iso) return null;
3008
+ const d = parseISO(iso);
3009
+ return isValid(d) ? format(d, "EEE, MMM d \xB7 h:mm a") : null;
3010
+ }
3011
+ function fmtScheduleWindow(start, end) {
3012
+ const s = start ? parseISO(start) : null;
3013
+ if (!s || !isValid(s)) return "";
3014
+ const startStr = format(s, "EEE, MMM d \xB7 h:mm a");
3015
+ const e = end ? parseISO(end) : null;
3016
+ if (e && isValid(e)) {
3017
+ const sameDay = s.toDateString() === e.toDateString();
3018
+ return `${startStr} \u2013 ${format(e, sameDay ? "h:mm a" : "EEE, MMM d \xB7 h:mm a")}`;
3019
+ }
3020
+ return startStr;
3021
+ }
3022
+ var LINE_STATE_TONE = {
3023
+ in_preparation: "preparing",
3024
+ ready: "ready",
3025
+ served: "delivered",
3026
+ delivered: "delivered",
3027
+ completed: "delivered",
3028
+ cancelled: "cancelled"
3029
+ };
3030
+ var LINE_STATE_LABEL = {
3031
+ pending: "Pending",
3032
+ in_preparation: "Preparing",
3033
+ ready: "Ready",
3034
+ partially_served: "Partially served",
3035
+ served: "Served",
3036
+ delivered: "Delivered",
3037
+ completed: "Completed",
3038
+ cancelled: "Cancelled"
3039
+ };
3040
+ function digitalTone(status) {
3041
+ switch (status) {
3042
+ case "accessed":
3043
+ case "completed":
3044
+ return "accessed";
3045
+ case "ready":
3046
+ return "ready";
3047
+ case "revoked":
3048
+ case "expired":
3049
+ return "revoked";
3050
+ default:
3051
+ return "pending";
3052
+ }
3053
+ }
3054
+ function cap(s) {
3055
+ return s ? s.charAt(0).toUpperCase() + s.slice(1).replace(/_/g, " ") : "";
3056
+ }
3057
+ function lineStateKey(state) {
3058
+ return typeof state === "string" ? state : Object.keys(state)[0];
3059
+ }
3060
+ function variantLabel(item) {
3061
+ if (item.variant_info?.name) return item.variant_info.name;
3062
+ const props = item.variant_details?.properties;
3063
+ if (props) {
3064
+ const vals = Object.values(props).filter(Boolean);
3065
+ if (vals.length) return vals.join(" \xB7 ");
3066
+ }
3067
+ return void 0;
3068
+ }
3069
+ function lineSubtitle(item) {
3070
+ const parts = [];
3071
+ const v = variantLabel(item);
3072
+ if (v) parts.push(v);
3073
+ if (item.line_type === "bundle") parts.push(`Bundle \xB7 ${item.bundle_selections?.selections.length ?? 0} items`);
3074
+ if (item.line_type === "digital" && item.fulfillment?.digital_type) parts.push(item.fulfillment.digital_type);
3075
+ parts.push(`Qty ${item.quantity}`);
3076
+ const addOns = item.add_ons.flatMap((g) => g.options.map((o) => o.name));
3077
+ if (addOns.length) parts.push(`+ ${addOns.join(", ")}`);
3078
+ return parts.join(" \xB7 ");
3079
+ }
3080
+ function toCustomerInputs(item) {
3081
+ if (!item.customer_inputs.length) return void 0;
3082
+ return item.customer_inputs.map((ci) => ({
3083
+ fieldId: ci.field_id,
3084
+ fieldName: ci.field_name,
3085
+ fieldType: ci.field_type,
3086
+ value: ci.value,
3087
+ semanticKind: ci.semantic_kind
3088
+ }));
3089
+ }
3090
+ function toAccountLineItem(item, currency) {
3091
+ const includes = item.bundle_selections?.selections.map((s) => ({
3092
+ quantity: s.quantity,
3093
+ name: s.product_name,
3094
+ variantName: s.variant_name,
3095
+ priceLabel: parsePrice(s.unit_price) > 0 ? formatMoney(s.unit_price, currency) : void 0
3096
+ }));
3097
+ const customisations = item.composite_selections?.selections.map((s) => ({
3098
+ quantity: s.quantity,
3099
+ name: s.component_name,
3100
+ priceLabel: parsePrice(s.unit_price) > 0 ? `+${formatMoney(s.unit_price, currency)}` : void 0
3101
+ }));
3102
+ const data = {
3103
+ id: item.id,
3104
+ name: item.product_name ?? "Item",
3105
+ imageUrl: item.image_url,
3106
+ subtitle: lineSubtitle(item),
3107
+ priceLabel: formatMoney(item.total_price, currency),
3108
+ lineType: item.line_type,
3109
+ includes,
3110
+ customisations,
3111
+ customerInputs: toCustomerInputs(item)
3112
+ };
3113
+ const stateKey = item.line_state ? lineStateKey(item.line_state.state) : void 0;
3114
+ if (stateKey && stateKey !== "pending") {
3115
+ data.stateLabel = LINE_STATE_LABEL[stateKey] ?? cap(stateKey);
3116
+ data.stateTone = LINE_STATE_TONE[stateKey] ?? "default";
3117
+ }
3118
+ if (item.scheduled_start) {
3119
+ data.scheduling = {
3120
+ whenLabel: fmtScheduleWindow(item.scheduled_start, item.scheduled_end),
3121
+ confirmationCode: item.confirmation_code
3122
+ };
3123
+ if (!data.stateLabel) {
3124
+ data.stateLabel = "Booked";
3125
+ data.stateTone = "booked";
3126
+ }
3127
+ }
3128
+ if (item.line_type === "digital" && item.fulfillment) {
3129
+ data.digital = {
3130
+ statusLabel: cap(item.fulfillment.status) || "Pending",
3131
+ tone: digitalTone(item.fulfillment.status),
3132
+ usageSummary: item.fulfillment.usage_summary
3133
+ };
3134
+ }
3135
+ return data;
3136
+ }
3137
+ function toAccountLineItems(items, currency) {
3138
+ return items.map((item) => toAccountLineItem(item, currency));
3139
+ }
3140
+ var STATUS_TONE2 = {
3141
+ delivered: "positive",
3142
+ picked_up: "positive",
3143
+ served: "positive",
3144
+ completed: "positive",
3145
+ cancelled: "muted",
3146
+ refunded: "muted"
3147
+ };
3148
+ var PAYMENT_TONE = {
3149
+ paid: "positive",
3150
+ not_paid: "warning",
3151
+ partially_refunded: "warning",
3152
+ refunded: "muted"
3153
+ };
3154
+ function toAccountOrderView(order, opts = {}) {
3155
+ const currency = order.payment.currency;
3156
+ const rows = [
3157
+ { label: "Subtotal", value: formatMoney(order.pricing.subtotal, currency) }
3158
+ ];
3159
+ if (parsePrice(order.pricing.total_discount) > 0) {
3160
+ rows.push({
3161
+ label: "Discount",
3162
+ value: `\u2212${formatMoney(order.pricing.total_discount, currency)}`,
3163
+ tone: "positive"
3164
+ });
3165
+ }
3166
+ if (order.pricing.tax && parsePrice(order.pricing.tax) > 0) {
3167
+ rows.push({ label: "Tax", value: formatMoney(order.pricing.tax, currency) });
3168
+ }
3169
+ if (order.pricing.service_charge && parsePrice(order.pricing.service_charge) > 0) {
3170
+ rows.push({ label: "Service", value: formatMoney(order.pricing.service_charge, currency) });
3171
+ }
3172
+ const placed = fmtDateTime(order.timestamps.created_at);
3173
+ const placedLabel = opts.placedLabel ?? [placed && `Placed ${placed}`, `${order.items.length} item${order.items.length === 1 ? "" : "s"}`].filter(Boolean).join(" \xB7 ");
3174
+ return {
3175
+ orderNumber: order.user_friendly_id,
3176
+ placedLabel,
3177
+ statusLabel: cap(order.status),
3178
+ statusTone: STATUS_TONE2[order.status] ?? "progress",
3179
+ items: toAccountLineItems(order.items, currency),
3180
+ payment: {
3181
+ stateLabel: cap(order.payment.computed_status ?? order.payment.state),
3182
+ stateTone: PAYMENT_TONE[order.payment.state] ?? "muted",
3183
+ rows,
3184
+ total: { label: "Total", value: formatMoney(order.pricing.total_price, currency) }
3185
+ },
3186
+ shipTo: order.customer.delivery_address ? { lines: order.customer.delivery_address } : void 0,
3187
+ onBack: opts.onBack
3188
+ };
3189
+ }
2452
3190
  function SubscriptionRow({
2453
3191
  subscription,
2454
3192
  onSelect,
@@ -3264,27 +4002,11 @@ var DEFAULT_LINKS = [
3264
4002
  ] })
3265
4003
  },
3266
4004
  {
3267
- label: "Addresses",
3268
- href: "/account/addresses",
3269
- icon: /* @__PURE__ */ jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", "aria-hidden": true, children: [
3270
- /* @__PURE__ */ jsx("path", { d: "M12 21s-7-5.5-7-11a7 7 0 0 1 14 0c0 5.5-7 11-7 11Z" }),
3271
- /* @__PURE__ */ jsx("circle", { cx: "12", cy: "10", r: "2.5" })
3272
- ] })
3273
- },
3274
- {
3275
- label: "Payment methods",
3276
- href: "/account/payment",
3277
- icon: /* @__PURE__ */ jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", "aria-hidden": true, children: [
3278
- /* @__PURE__ */ jsx("rect", { x: "2", y: "5", width: "20", height: "14", rx: "2" }),
3279
- /* @__PURE__ */ jsx("path", { d: "M2 10h20" })
3280
- ] })
3281
- },
3282
- {
3283
- label: "Account",
3284
- href: "/account",
4005
+ label: "Subscriptions",
4006
+ href: "/account/subscriptions",
3285
4007
  icon: /* @__PURE__ */ jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", "aria-hidden": true, children: [
3286
- /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "3" }),
3287
- /* @__PURE__ */ jsx("path", { d: "M12 2v3M12 19v3M4.2 4.2l2.1 2.1M17.7 17.7l2.1 2.1M2 12h3M19 12h3M4.2 19.8l2.1-2.1M17.7 6.3l2.1-2.1" })
4008
+ /* @__PURE__ */ jsx("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2" }),
4009
+ /* @__PURE__ */ jsx("path", { d: "M3 9h18M8 2v4M16 2v4" })
3288
4010
  ] })
3289
4011
  }
3290
4012
  ];
@@ -3401,7 +4123,7 @@ function CimplifyUserButton({
3401
4123
  id: menuId,
3402
4124
  role: "menu",
3403
4125
  className: cn(
3404
- "absolute top-[calc(100%+8px)] z-50 w-[280px] overflow-hidden",
4126
+ "absolute top-[calc(100%+8px)] z-50 w-[280px] max-w-[calc(100vw-1.5rem)] overflow-hidden",
3405
4127
  "rounded-[14px] border border-border bg-card",
3406
4128
  "shadow-[0_1px_2px_rgba(16,24,40,0.04),0_16px_40px_-16px_rgba(16,24,40,0.24)]",
3407
4129
  align === "end" ? "right-0" : "left-0"
@@ -7327,7 +8049,7 @@ function FileUploadInput({
7327
8049
  onFileUpload,
7328
8050
  classNames
7329
8051
  }) {
7330
- const [isUploading, setIsUploading] = React12.useState(false);
8052
+ const [isUploading, setIsUploading] = React14.useState(false);
7331
8053
  const fileUrl = typeof value === "string" ? value : void 0;
7332
8054
  const acceptedFormats = field.validation?.accepted_formats;
7333
8055
  const accept = acceptedFormats ? acceptedFormats.map((f) => `.${f}`).join(",") : field.field_type === INPUT_FIELD_TYPE.Image ? "image/*" : void 0;
@@ -7477,22 +8199,22 @@ function AddressInput({
7477
8199
  }) {
7478
8200
  const clientContext = useOptionalCimplifyClient();
7479
8201
  const addr = value && typeof value === "object" ? value : null;
7480
- const [inputText, setInputText] = React12.useState(addr?.formatted_address ?? "");
7481
- const [suggestions, setSuggestions] = React12.useState([]);
7482
- const [isOpen, setIsOpen] = React12.useState(false);
7483
- const [highlightedIndex, setHighlightedIndex] = React12.useState(-1);
7484
- const debounceRef = React12.useRef(null);
7485
- const seqRef = React12.useRef(0);
7486
- const sessionTokenRef = React12.useRef(createSessionToken());
7487
- const blurTimeoutRef = React12.useRef(null);
7488
- React12.useEffect(() => {
8202
+ const [inputText, setInputText] = React14.useState(addr?.formatted_address ?? "");
8203
+ const [suggestions, setSuggestions] = React14.useState([]);
8204
+ const [isOpen, setIsOpen] = React14.useState(false);
8205
+ const [highlightedIndex, setHighlightedIndex] = React14.useState(-1);
8206
+ const debounceRef = React14.useRef(null);
8207
+ const seqRef = React14.useRef(0);
8208
+ const sessionTokenRef = React14.useRef(createSessionToken());
8209
+ const blurTimeoutRef = React14.useRef(null);
8210
+ React14.useEffect(() => {
7489
8211
  return () => {
7490
8212
  if (debounceRef.current) clearTimeout(debounceRef.current);
7491
8213
  if (blurTimeoutRef.current) clearTimeout(blurTimeoutRef.current);
7492
8214
  seqRef.current += 1;
7493
8215
  };
7494
8216
  }, []);
7495
- const fetchSuggestions = React12.useCallback(async (query) => {
8217
+ const fetchSuggestions = React14.useCallback(async (query) => {
7496
8218
  const client = clientContext?.client;
7497
8219
  if (!client || query.length < 3) {
7498
8220
  setSuggestions([]);
@@ -7516,7 +8238,7 @@ function AddressInput({
7516
8238
  if (debounceRef.current) clearTimeout(debounceRef.current);
7517
8239
  debounceRef.current = setTimeout(() => void fetchSuggestions(nextValue.trim()), 300);
7518
8240
  };
7519
- const selectSuggestion = React12.useCallback(async (suggestion) => {
8241
+ const selectSuggestion = React14.useCallback(async (suggestion) => {
7520
8242
  if (debounceRef.current) clearTimeout(debounceRef.current);
7521
8243
  if (blurTimeoutRef.current) clearTimeout(blurTimeoutRef.current);
7522
8244
  const fallback = suggestion.description.split(",")[0]?.trim() || suggestion.description;
@@ -7619,22 +8341,22 @@ function LocationInput({
7619
8341
  }) {
7620
8342
  const clientContext = useOptionalCimplifyClient();
7621
8343
  const loc = value && typeof value === "object" ? value : null;
7622
- const [inputText, setInputText] = React12.useState(loc?.label ?? "");
7623
- const [suggestions, setSuggestions] = React12.useState([]);
7624
- const [isOpen, setIsOpen] = React12.useState(false);
7625
- const [highlightedIndex, setHighlightedIndex] = React12.useState(-1);
7626
- const debounceRef = React12.useRef(null);
7627
- const seqRef = React12.useRef(0);
7628
- const sessionTokenRef = React12.useRef(createSessionToken());
7629
- const blurTimeoutRef = React12.useRef(null);
7630
- React12.useEffect(() => {
8344
+ const [inputText, setInputText] = React14.useState(loc?.label ?? "");
8345
+ const [suggestions, setSuggestions] = React14.useState([]);
8346
+ const [isOpen, setIsOpen] = React14.useState(false);
8347
+ const [highlightedIndex, setHighlightedIndex] = React14.useState(-1);
8348
+ const debounceRef = React14.useRef(null);
8349
+ const seqRef = React14.useRef(0);
8350
+ const sessionTokenRef = React14.useRef(createSessionToken());
8351
+ const blurTimeoutRef = React14.useRef(null);
8352
+ React14.useEffect(() => {
7631
8353
  return () => {
7632
8354
  if (debounceRef.current) clearTimeout(debounceRef.current);
7633
8355
  if (blurTimeoutRef.current) clearTimeout(blurTimeoutRef.current);
7634
8356
  seqRef.current += 1;
7635
8357
  };
7636
8358
  }, []);
7637
- const fetchSuggestions = React12.useCallback(async (query) => {
8359
+ const fetchSuggestions = React14.useCallback(async (query) => {
7638
8360
  const client = clientContext?.client;
7639
8361
  if (!client || query.length < 3) {
7640
8362
  setSuggestions([]);
@@ -7658,7 +8380,7 @@ function LocationInput({
7658
8380
  if (debounceRef.current) clearTimeout(debounceRef.current);
7659
8381
  debounceRef.current = setTimeout(() => void fetchSuggestions(nextValue.trim()), 300);
7660
8382
  };
7661
- const selectSuggestion = React12.useCallback(async (suggestion) => {
8383
+ const selectSuggestion = React14.useCallback(async (suggestion) => {
7662
8384
  if (debounceRef.current) clearTimeout(debounceRef.current);
7663
8385
  if (blurTimeoutRef.current) clearTimeout(blurTimeoutRef.current);
7664
8386
  const label = suggestion.description.split(",")[0]?.trim() || suggestion.description;
@@ -7747,8 +8469,8 @@ function PhoneInput({
7747
8469
  inputClass
7748
8470
  }) {
7749
8471
  const phone = value && typeof value === "object" ? value : null;
7750
- const [code, setCode] = React12.useState(phone?.country_code ?? "+1");
7751
- const [number, setNumber] = React12.useState(phone?.number ?? "");
8472
+ const [code, setCode] = React14.useState(phone?.country_code ?? "+1");
8473
+ const [number, setNumber] = React14.useState(phone?.number ?? "");
7752
8474
  const update = (nextCode, nextNumber) => {
7753
8475
  setCode(nextCode);
7754
8476
  setNumber(nextNumber);
@@ -7793,8 +8515,8 @@ function SignatureInput({
7793
8515
  classNames
7794
8516
  }) {
7795
8517
  const sig = value && typeof value === "object" ? value : null;
7796
- const canvasRef = React12.useRef(null);
7797
- const isDrawing = React12.useRef(false);
8518
+ const canvasRef = React14.useRef(null);
8519
+ const isDrawing = React14.useRef(false);
7798
8520
  const getCtx = () => canvasRef.current?.getContext("2d") ?? null;
7799
8521
  const startDraw = (e) => {
7800
8522
  const ctx = getCtx();
@@ -8826,7 +9548,7 @@ function ProductModel3D({
8826
9548
  "data-cimplify-product-model-3d": true,
8827
9549
  className,
8828
9550
  style: { position: "relative", overflow: "hidden", ...ASPECT_STYLES3[aspectRatio] },
8829
- children: ready ? React12.createElement("model-viewer", {
9551
+ children: ready ? React14.createElement("model-viewer", {
8830
9552
  src,
8831
9553
  "ios-src": iosSrc,
8832
9554
  alt,
@@ -8837,12 +9559,12 @@ function ProductModel3D({
8837
9559
  "auto-rotate": autoRotate || void 0,
8838
9560
  "shadow-intensity": "1",
8839
9561
  style: { width: "100%", height: "100%", backgroundColor: "transparent" }
8840
- }) : poster ? React12.createElement("img", {
9562
+ }) : poster ? React14.createElement("img", {
8841
9563
  src: poster,
8842
9564
  alt: alt ?? "",
8843
9565
  "data-cimplify-product-model-3d-loading": true,
8844
9566
  style: { width: "100%", height: "100%", objectFit: "cover" }
8845
- }) : React12.createElement("div", {
9567
+ }) : React14.createElement("div", {
8846
9568
  "data-cimplify-product-model-3d-loading": true,
8847
9569
  style: { width: "100%", height: "100%", backgroundColor: "var(--muted, #f3f4f6)" }
8848
9570
  })
@@ -8996,7 +9718,7 @@ function CartLineItemRow({
8996
9718
  const isOptimistic = item.isOptimistic === true;
8997
9719
  const lineTotal = parsePrice(unitPrice) * item.quantity;
8998
9720
  const imageUrl = item.product.image_url;
8999
- const variantLabel = item.variant ? getVariantDisplayName(item.variant, item.product.name) : null;
9721
+ const variantLabel2 = item.variant ? getVariantDisplayName(item.variant, item.product.name) : null;
9000
9722
  return /* @__PURE__ */ jsxs(
9001
9723
  "div",
9002
9724
  {
@@ -9049,13 +9771,13 @@ function CartLineItemRow({
9049
9771
  }
9050
9772
  )
9051
9773
  ] }),
9052
- (variantLabel || item.addOnOptions && item.addOnOptions.length > 0 || hasComposite || hasBundle) && /* @__PURE__ */ jsxs("div", { "data-cimplify-cart-item-pills": true, className: "flex flex-wrap gap-1.5 mt-1.5", children: [
9053
- variantLabel && /* @__PURE__ */ jsx(
9774
+ (variantLabel2 || item.addOnOptions && item.addOnOptions.length > 0 || hasComposite || hasBundle) && /* @__PURE__ */ jsxs("div", { "data-cimplify-cart-item-pills": true, className: "flex flex-wrap gap-1.5 mt-1.5", children: [
9775
+ variantLabel2 && /* @__PURE__ */ jsx(
9054
9776
  "span",
9055
9777
  {
9056
9778
  "data-cimplify-cart-item-variant": true,
9057
9779
  className: "inline-flex items-center px-2 py-0.5 rounded-full bg-muted text-[11px] font-medium text-foreground",
9058
- children: variantLabel
9780
+ children: variantLabel2
9059
9781
  }
9060
9782
  ),
9061
9783
  item.addOnOptions?.map((opt) => /* @__PURE__ */ jsxs(
@@ -10769,13 +11491,13 @@ function ProductGrid({
10769
11491
  className,
10770
11492
  classNames
10771
11493
  }) {
10772
- const rawId = React12.useId();
11494
+ const rawId = React14.useId();
10773
11495
  const gridId = `cimplify-grid-${rawId.replace(/:/g, "")}`;
10774
11496
  const sm = columns?.sm ?? 1;
10775
11497
  const md = columns?.md ?? 2;
10776
11498
  const lg = columns?.lg ?? 3;
10777
11499
  const xl = columns?.xl ?? 4;
10778
- const css = React12.useMemo(
11500
+ const css = React14.useMemo(
10779
11501
  () => [
10780
11502
  `#${gridId}{display:grid;grid-template-columns:repeat(${sm},1fr);gap:1rem}`,
10781
11503
  `@media(min-width:768px){#${gridId}{grid-template-columns:repeat(${md},1fr)}}`,
@@ -11136,7 +11858,7 @@ function CategoryGrid({
11136
11858
  enabled: categoriesProp === void 0
11137
11859
  });
11138
11860
  const categories = categoriesProp ?? fetched;
11139
- const rawId = React12.useId();
11861
+ const rawId = React14.useId();
11140
11862
  const gridId = `cimplify-cat-grid-${rawId.replace(/:/g, "")}`;
11141
11863
  const sm = columns?.sm ?? 2;
11142
11864
  const md = columns?.md ?? 3;
@@ -11362,7 +12084,7 @@ function OrderSummary({
11362
12084
  /* @__PURE__ */ jsx("p", { children: order.delivery_address })
11363
12085
  ] }),
11364
12086
  /* @__PURE__ */ jsx("div", { "data-cimplify-order-items": true, className: classNames?.items, children: order.items.map(
11365
- (item) => renderLineItem ? /* @__PURE__ */ jsx(React12.Fragment, { children: renderLineItem(item) }, item.id) : /* @__PURE__ */ jsxs("div", { "data-cimplify-order-line-item": true, className: classNames?.lineItem, children: [
12087
+ (item) => renderLineItem ? /* @__PURE__ */ jsx(React14.Fragment, { children: renderLineItem(item) }, item.id) : /* @__PURE__ */ jsxs("div", { "data-cimplify-order-line-item": true, className: classNames?.lineItem, children: [
11366
12088
  /* @__PURE__ */ jsxs("div", { "data-cimplify-order-line-info": true, children: [
11367
12089
  /* @__PURE__ */ jsxs("span", { "data-cimplify-order-line-qty": true, children: [
11368
12090
  item.quantity,
@@ -12522,7 +13244,7 @@ function DefaultCatalogueLayout({
12522
13244
  /* @__PURE__ */ jsx("p", { className: "text-lg font-medium", children: "No products found" }),
12523
13245
  /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-1", children: "Try adjusting your filters" })
12524
13246
  ] }) : /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 md:grid-cols-3 gap-4", children: products.map(
12525
- (product) => renderCard ? /* @__PURE__ */ jsx(React12.Fragment, { children: renderCard(product) }, product.id) : /* @__PURE__ */ jsx(
13247
+ (product) => renderCard ? /* @__PURE__ */ jsx(React14.Fragment, { children: renderCard(product) }, product.id) : /* @__PURE__ */ jsx(
12526
13248
  ProductCard,
12527
13249
  {
12528
13250
  product,
@@ -12629,7 +13351,7 @@ function CompactCatalogueLayout({
12629
13351
  /* @__PURE__ */ jsx("p", { className: "text-lg font-medium", children: "No items found" }),
12630
13352
  /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-1", children: "Try a different category or search" })
12631
13353
  ] }) : /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 lg:grid-cols-3 gap-5", children: products.map(
12632
- (product) => renderCard ? /* @__PURE__ */ jsx(React12.Fragment, { children: renderCard(product) }, product.id) : /* @__PURE__ */ jsx(
13354
+ (product) => renderCard ? /* @__PURE__ */ jsx(React14.Fragment, { children: renderCard(product) }, product.id) : /* @__PURE__ */ jsx(
12633
13355
  ProductCard,
12634
13356
  {
12635
13357
  product,
@@ -12652,8 +13374,8 @@ var BUILT_IN_LAYOUTS = {
12652
13374
  ["compact" /* Compact */]: CompactCatalogueLayout
12653
13375
  };
12654
13376
  function useDebounce(value, delay) {
12655
- const [debounced, setDebounced] = React12.useState(value);
12656
- React12.useEffect(() => {
13377
+ const [debounced, setDebounced] = React14.useState(value);
13378
+ React14.useEffect(() => {
12657
13379
  const timer = setTimeout(() => setDebounced(value), delay);
12658
13380
  return () => clearTimeout(timer);
12659
13381
  }, [value, delay]);
@@ -12909,7 +13631,7 @@ function DefaultProductLayout({
12909
13631
  showRelated = true,
12910
13632
  className
12911
13633
  }) {
12912
- const [selectedVariantId, setSelectedVariantId] = React12.useState();
13634
+ const [selectedVariantId, setSelectedVariantId] = React14.useState();
12913
13635
  const images = resolveGallery(product, selectedVariantId);
12914
13636
  const hasRange = product.quantity_pricing && product.quantity_pricing.length > 1 || product.variants && product.variants.length > 1;
12915
13637
  const onSale = isOnSale(product);
@@ -14175,7 +14897,7 @@ function DefaultCollectionLayout({
14175
14897
  ] })
14176
14898
  ] }),
14177
14899
  filtered.length > 0 ? /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4", children: filtered.map(
14178
- (product) => renderCard ? /* @__PURE__ */ jsx(React12.Fragment, { children: renderCard(product) }, product.id) : /* @__PURE__ */ jsx(
14900
+ (product) => renderCard ? /* @__PURE__ */ jsx(React14.Fragment, { children: renderCard(product) }, product.id) : /* @__PURE__ */ jsx(
14179
14901
  ProductCard,
14180
14902
  {
14181
14903
  product,
@@ -14228,7 +14950,7 @@ function FeaturedCollectionLayout({
14228
14950
  ] })
14229
14951
  ] }),
14230
14952
  /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6", children: products.map(
14231
- (product) => renderCard ? /* @__PURE__ */ jsx(React12.Fragment, { children: renderCard(product) }, product.id) : /* @__PURE__ */ jsx(
14953
+ (product) => renderCard ? /* @__PURE__ */ jsx(React14.Fragment, { children: renderCard(product) }, product.id) : /* @__PURE__ */ jsx(
14232
14954
  ProductCard,
14233
14955
  {
14234
14956
  product,
@@ -14352,7 +15074,7 @@ function CatalogueCollectionLayout({
14352
15074
  ] })
14353
15075
  ] }),
14354
15076
  filtered.length > 0 ? /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4", children: filtered.map(
14355
- (product) => renderCard ? /* @__PURE__ */ jsx(React12.Fragment, { children: renderCard(product) }, product.id) : /* @__PURE__ */ jsx(
15077
+ (product) => renderCard ? /* @__PURE__ */ jsx(React14.Fragment, { children: renderCard(product) }, product.id) : /* @__PURE__ */ jsx(
14356
15078
  ProductCard,
14357
15079
  {
14358
15080
  product,
@@ -14732,7 +15454,7 @@ function DefaultSearchLayout({
14732
15454
  /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-1", children: "Try a different search term" }),
14733
15455
  /* @__PURE__ */ jsx("button", { onClick: clear, className: "text-sm font-medium text-primary mt-4 hover:underline", children: "Clear search" })
14734
15456
  ] }) : results.length > 0 ? /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 md:grid-cols-3 gap-4", children: results.map(
14735
- (product) => renderCard ? /* @__PURE__ */ jsx(React12.Fragment, { children: renderCard(product) }, product.id) : /* @__PURE__ */ jsx(
15457
+ (product) => renderCard ? /* @__PURE__ */ jsx(React14.Fragment, { children: renderCard(product) }, product.id) : /* @__PURE__ */ jsx(
14736
15458
  ProductCard,
14737
15459
  {
14738
15460
  product,
@@ -14834,7 +15556,7 @@ function CompactSearchLayout({
14834
15556
  /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-1", children: "Try a different search term" }),
14835
15557
  /* @__PURE__ */ jsx("button", { onClick: clear, className: "text-sm font-medium text-primary mt-4 hover:underline", children: "Clear search" })
14836
15558
  ] }) : results.length > 0 ? /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 lg:grid-cols-3 gap-5", children: results.map(
14837
- (product) => renderCard ? /* @__PURE__ */ jsx(React12.Fragment, { children: renderCard(product) }, product.id) : /* @__PURE__ */ jsx(
15559
+ (product) => renderCard ? /* @__PURE__ */ jsx(React14.Fragment, { children: renderCard(product) }, product.id) : /* @__PURE__ */ jsx(
14838
15560
  ProductCard,
14839
15561
  {
14840
15562
  product,
@@ -15788,4 +16510,4 @@ function SparkleIcon({ className }) {
15788
16510
  );
15789
16511
  }
15790
16512
 
15791
- 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, CimplifyCheckout, CimplifyProvider, CimplifySignInButton, CimplifyUserButton, 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, RichText, 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, sanitizeRichTextHtml, stripHtmlToText, 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 };
16513
+ export { AccommodationCard, AccountContent, AccountDashboardPage, AccountHero, AccountIdentityStrip, AccountLineItem, AccountLineItems, AccountNav, AccountOrderDetailPage, AccountOrderView, 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, CimplifyCheckout, CimplifyProvider, CimplifySignInButton, CimplifyUserButton, 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, DeliveryTracker, DeliveryTruckIcon, DigitalProductCard, DigitalProductLayout, DiscountInput, ElementsProvider, EmptyState, ErrorState, FeaturedCollectionLayout, FilterTabs, FoodProductCard, FoodProductLayout, HappeningCard, IdentityIcon, IdentityOfframp, InventoryBadge, ItemsCard, LeaseServiceCard, LineItemDetails, 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, RichText, 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, sanitizeRichTextHtml, stripHtmlToText, toAccountLineItem, toAccountLineItems, toAccountOrderView, 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 };