@nok-integration/storefront-react 0.19.19 → 0.19.21

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/index.mjs CHANGED
@@ -5313,9 +5313,9 @@ function ShopLink({ to, children, ...rest }) {
5313
5313
  }
5314
5314
  function anchorToTop() {
5315
5315
  if (typeof window === "undefined") return;
5316
- const top = () => window.scrollTo(0, 0);
5317
- top();
5318
- if (typeof window.requestAnimationFrame === "function") window.requestAnimationFrame(top);
5316
+ const top2 = () => window.scrollTo(0, 0);
5317
+ top2();
5318
+ if (typeof window.requestAnimationFrame === "function") window.requestAnimationFrame(top2);
5319
5319
  }
5320
5320
  function ShopImage({ src, alt, fill: fill2 = false, width, height, sizes, className, style, priority = false }) {
5321
5321
  const assetUrl = useAssetUrl();
@@ -5404,7 +5404,7 @@ const neutral$1 = "_neutral_1bagf_12";
5404
5404
  const success$1 = "_success_1bagf_17";
5405
5405
  const critical$1 = "_critical_1bagf_22";
5406
5406
  const promo = "_promo_1bagf_27";
5407
- const styles$Q = {
5407
+ const styles$R = {
5408
5408
  badge: badge$5,
5409
5409
  neutral: neutral$1,
5410
5410
  success: success$1,
@@ -5413,7 +5413,7 @@ const styles$Q = {
5413
5413
  };
5414
5414
  function Badge({ tone = "neutral", children }) {
5415
5415
  return jsx("span", {
5416
- className: [styles$Q.badge, styles$Q[tone]].join(" "),
5416
+ className: [styles$R.badge, styles$R[tone]].join(" "),
5417
5417
  children
5418
5418
  });
5419
5419
  }
@@ -5424,7 +5424,7 @@ const secondary = "_secondary_1u2uh_34";
5424
5424
  const ghost = "_ghost_1u2uh_40";
5425
5425
  const spinner = "_spinner_1u2uh_83";
5426
5426
  const spin = "_spin_1u2uh_83";
5427
- const styles$P = {
5427
+ const styles$Q = {
5428
5428
  button: button$1,
5429
5429
  fullWidth,
5430
5430
  primary,
@@ -5438,12 +5438,12 @@ const Button = forwardRef(function Button2({ variant = "primary", loading = fals
5438
5438
  return jsxs("button", {
5439
5439
  ref,
5440
5440
  type,
5441
- className: [styles$P.button, styles$P[variant], fullWidth2 ? styles$P.fullWidth : "", className ?? ""].filter(Boolean).join(" "),
5441
+ className: [styles$Q.button, styles$Q[variant], fullWidth2 ? styles$Q.fullWidth : "", className ?? ""].filter(Boolean).join(" "),
5442
5442
  disabled: isDisabled,
5443
5443
  "aria-busy": loading || void 0,
5444
5444
  ...rest,
5445
5445
  children: [loading && jsx("span", {
5446
- className: styles$P.spinner,
5446
+ className: styles$Q.spinner,
5447
5447
  "aria-hidden": "true"
5448
5448
  }), jsx("span", {
5449
5449
  children
@@ -5451,7 +5451,7 @@ const Button = forwardRef(function Button2({ variant = "primary", loading = fals
5451
5451
  });
5452
5452
  });
5453
5453
  const skeleton = "_skeleton_1nxz7_1";
5454
- const styles$O = {
5454
+ const styles$P = {
5455
5455
  skeleton
5456
5456
  };
5457
5457
  function Skeleton({ width, height, radius, className, circle }) {
@@ -5462,24 +5462,24 @@ function Skeleton({ width, height, radius, className, circle }) {
5462
5462
  };
5463
5463
  return jsx("span", {
5464
5464
  "aria-hidden": "true",
5465
- className: [styles$O.skeleton, className ?? ""].filter(Boolean).join(" "),
5465
+ className: [styles$P.skeleton, className ?? ""].filter(Boolean).join(" "),
5466
5466
  style
5467
5467
  });
5468
5468
  }
5469
5469
  const surface$1 = "_surface_cfqo9_10";
5470
5470
  const fill = "_fill_cfqo9_35";
5471
- const styles$N = {
5471
+ const styles$O = {
5472
5472
  surface: surface$1,
5473
5473
  fill
5474
5474
  };
5475
5475
  const SETTLE_MS$1 = 150;
5476
5476
  function offsetFromViewportTop(el) {
5477
- let top = el.getBoundingClientRect().top;
5477
+ let top2 = el.getBoundingClientRect().top;
5478
5478
  for (let node = el.parentElement; node; node = node.parentElement) {
5479
- top += node.scrollTop;
5479
+ top2 += node.scrollTop;
5480
5480
  if (getComputedStyle(node).position === "fixed") break;
5481
5481
  }
5482
- const offset = Math.max(0, Math.round(top));
5482
+ const offset = Math.max(0, Math.round(top2));
5483
5483
  return offset >= window.innerHeight ? 0 : offset;
5484
5484
  }
5485
5485
  function useTopOffset(ref, property, enabled = true) {
@@ -5495,6 +5495,8 @@ function useTopOffset(ref, property, enabled = true) {
5495
5495
  timer2 = setTimeout(measure, SETTLE_MS$1);
5496
5496
  };
5497
5497
  measure();
5498
+ const frame2 = typeof requestAnimationFrame === "undefined" ? void 0 : requestAnimationFrame(measure);
5499
+ const settleAfterMount = setTimeout(measure, SETTLE_MS$1);
5498
5500
  window.addEventListener("resize", measure);
5499
5501
  window.addEventListener("orientationchange", measure);
5500
5502
  document.addEventListener("scroll", settle, {
@@ -5505,6 +5507,8 @@ function useTopOffset(ref, property, enabled = true) {
5505
5507
  if (observer && el.parentElement) observer.observe(el.parentElement);
5506
5508
  return () => {
5507
5509
  if (timer2) clearTimeout(timer2);
5510
+ if (frame2 !== void 0) cancelAnimationFrame(frame2);
5511
+ clearTimeout(settleAfterMount);
5508
5512
  window.removeEventListener("resize", measure);
5509
5513
  window.removeEventListener("orientationchange", measure);
5510
5514
  document.removeEventListener("scroll", settle, {
@@ -5526,7 +5530,7 @@ const ShopSurface = forwardRef(function ShopSurface2({ tone, fill: fill2 = false
5526
5530
  ...rest,
5527
5531
  ref: attach,
5528
5532
  "data-shop-theme": tone,
5529
- className: [styles$N.surface, fill2 ? styles$N.fill : "", className ?? ""].filter(Boolean).join(" "),
5533
+ className: [styles$O.surface, fill2 ? styles$O.fill : "", className ?? ""].filter(Boolean).join(" "),
5530
5534
  children
5531
5535
  });
5532
5536
  });
@@ -5539,7 +5543,7 @@ const lineMid = "_lineMid_ney0g_45";
5539
5543
  const lineNarrow = "_lineNarrow_ney0g_49";
5540
5544
  const row$9 = "_row_ney0g_53";
5541
5545
  const action$2 = "_action_ney0g_57";
5542
- const styles$M = {
5546
+ const styles$N = {
5543
5547
  root: root$6,
5544
5548
  inner,
5545
5549
  media: media$3,
@@ -5751,36 +5755,36 @@ function ScreenSkeleton({ tone, shape = "media" }) {
5751
5755
  return jsx(ShopSurface, {
5752
5756
  tone,
5753
5757
  fill: true,
5754
- className: styles$M.root,
5758
+ className: styles$N.root,
5755
5759
  children: jsx("div", {
5756
- className: styles$M.inner,
5760
+ className: styles$N.inner,
5757
5761
  role: "status",
5758
5762
  "aria-label": t("Loading"),
5759
5763
  children: shape === "media" ? jsxs(Fragment, {
5760
5764
  children: [jsx(Skeleton, {
5761
- className: styles$M.media
5765
+ className: styles$N.media
5762
5766
  }), jsxs("div", {
5763
- className: styles$M.lines,
5767
+ className: styles$N.lines,
5764
5768
  children: [jsx(Skeleton, {
5765
5769
  height: 22,
5766
- className: styles$M.lineWide
5770
+ className: styles$N.lineWide
5767
5771
  }), jsx(Skeleton, {
5768
5772
  height: 16,
5769
- className: styles$M.lineMid
5773
+ className: styles$N.lineMid
5770
5774
  }), jsx(Skeleton, {
5771
5775
  height: 16,
5772
- className: styles$M.lineNarrow
5776
+ className: styles$N.lineNarrow
5773
5777
  })]
5774
5778
  }), jsx(Skeleton, {
5775
5779
  height: 48,
5776
5780
  radius: 8,
5777
- className: styles$M.action
5781
+ className: styles$N.action
5778
5782
  })]
5779
5783
  }) : jsx("div", {
5780
- className: styles$M.lines,
5784
+ className: styles$N.lines,
5781
5785
  children: [0, 1, 2, 3].map((i) => jsx(Skeleton, {
5782
5786
  height: 72,
5783
- className: styles$M.row
5787
+ className: styles$N.row
5784
5788
  }, i))
5785
5789
  })
5786
5790
  })
@@ -5792,7 +5796,7 @@ const text$5 = "_text_ryf3q_21";
5792
5796
  const title$n = "_title_ryf3q_35";
5793
5797
  const body$8 = "_body_ryf3q_40";
5794
5798
  const action$1 = "_action_ryf3q_48";
5795
- const styles$L = {
5799
+ const styles$M = {
5796
5800
  root: root$5,
5797
5801
  icon: icon$4,
5798
5802
  text: text$5,
@@ -5802,22 +5806,22 @@ const styles$L = {
5802
5806
  };
5803
5807
  function EmptyState({ title: title2, body: body3, action: action2, icon: icon2 }) {
5804
5808
  return jsxs("div", {
5805
- className: styles$L.root,
5809
+ className: styles$M.root,
5806
5810
  role: "status",
5807
5811
  children: [icon2 && jsx("div", {
5808
- className: styles$L.icon,
5812
+ className: styles$M.icon,
5809
5813
  children: icon2
5810
5814
  }), jsxs("div", {
5811
- className: styles$L.text,
5815
+ className: styles$M.text,
5812
5816
  children: [jsx("h2", {
5813
- className: styles$L.title,
5817
+ className: styles$M.title,
5814
5818
  children: title2
5815
5819
  }), body3 && jsx("p", {
5816
- className: styles$L.body,
5820
+ className: styles$M.body,
5817
5821
  children: body3
5818
5822
  })]
5819
5823
  }), action2 && jsx("div", {
5820
- className: styles$L.action,
5824
+ className: styles$M.action,
5821
5825
  children: action2
5822
5826
  })]
5823
5827
  });
@@ -5939,7 +5943,7 @@ function isDuplicateOrder(err) {
5939
5943
  const root$4 = "_root_1lbpx_1";
5940
5944
  const title$m = "_title_1lbpx_10";
5941
5945
  const body$7 = "_body_1lbpx_15";
5942
- const styles$K = {
5946
+ const styles$L = {
5943
5947
  root: root$4,
5944
5948
  title: title$m,
5945
5949
  body: body$7
@@ -5949,13 +5953,13 @@ function ErrorState({ code, title: title2, body: body3, onRetry, retryLabel }) {
5949
5953
  const treatment = treatmentFor(code);
5950
5954
  const showRetry = Boolean(onRetry) && treatment.retriable;
5951
5955
  return jsxs("div", {
5952
- className: styles$K.root,
5956
+ className: styles$L.root,
5953
5957
  role: "alert",
5954
5958
  children: [jsx("h2", {
5955
- className: styles$K.title,
5959
+ className: styles$L.title,
5956
5960
  children: title2 ?? t(treatment.title)
5957
5961
  }), jsx("p", {
5958
- className: styles$K.body,
5962
+ className: styles$L.body,
5959
5963
  children: body3 ?? t(treatment.body)
5960
5964
  }), showRetry && jsx(Button, {
5961
5965
  variant: "secondary",
@@ -6003,7 +6007,7 @@ const rich = "_rich_5aafz_183";
6003
6007
  const description = "_description_5aafz_198";
6004
6008
  const thumb$3 = "_thumb_5aafz_216";
6005
6009
  const thumbImage = "_thumbImage_5aafz_227";
6006
- const styles$J = {
6010
+ const styles$K = {
6007
6011
  viewport,
6008
6012
  anchor,
6009
6013
  caret,
@@ -6126,41 +6130,41 @@ function ToastProvider({ children }) {
6126
6130
  return jsxs(ToastContext.Provider, {
6127
6131
  value: api,
6128
6132
  children: [children, jsx("div", {
6129
- className: styles$J.viewport,
6133
+ className: styles$K.viewport,
6130
6134
  ref: viewportRef,
6131
6135
  "aria-live": "polite",
6132
6136
  "aria-atomic": "false",
6133
6137
  children: toasts.map((t) => {
6134
6138
  const rich2 = Boolean(t.description || t.image);
6135
6139
  return jsxs("div", {
6136
- className: styles$J.anchor,
6140
+ className: styles$K.anchor,
6137
6141
  children: [t.anchor === "cart" && jsx("span", {
6138
- className: styles$J.caret,
6142
+ className: styles$K.caret,
6139
6143
  children: jsx(Caret, {})
6140
6144
  }), jsxs("div", {
6141
- className: [styles$J.toast, rich2 ? styles$J.rich : styles$J[t.tone]].join(" "),
6145
+ className: [styles$K.toast, rich2 ? styles$K.rich : styles$K[t.tone]].join(" "),
6142
6146
  role: "status",
6143
6147
  children: [t.image && jsx("span", {
6144
- className: styles$J.thumb,
6148
+ className: styles$K.thumb,
6145
6149
  children: jsx(ShopImage, {
6146
6150
  src: t.image,
6147
6151
  alt: "",
6148
6152
  fill: true,
6149
6153
  sizes: "40px",
6150
- className: styles$J.thumbImage
6154
+ className: styles$K.thumbImage
6151
6155
  })
6152
6156
  }), jsxs("span", {
6153
- className: styles$J.text,
6157
+ className: styles$K.text,
6154
6158
  children: [jsx("span", {
6155
- className: styles$J.message,
6159
+ className: styles$K.message,
6156
6160
  children: t.message
6157
6161
  }), t.description && jsx("span", {
6158
- className: styles$J.description,
6162
+ className: styles$K.description,
6159
6163
  children: t.description
6160
6164
  })]
6161
6165
  }), t.action && jsx("button", {
6162
6166
  type: "button",
6163
- className: styles$J.action,
6167
+ className: styles$K.action,
6164
6168
  onClick: () => {
6165
6169
  t.action?.onAction();
6166
6170
  dismiss(t.id);
@@ -6175,15 +6179,15 @@ function ToastProvider({ children }) {
6175
6179
  }
6176
6180
  const badge$4 = "_badge_156ya_2";
6177
6181
  const icon$3 = "_icon_156ya_18";
6178
- const styles$I = {
6182
+ const styles$J = {
6179
6183
  badge: badge$4,
6180
6184
  icon: icon$3
6181
6185
  };
6182
6186
  function SaleBadge({ pct }) {
6183
6187
  return jsxs("span", {
6184
- className: styles$I.badge,
6188
+ className: styles$J.badge,
6185
6189
  children: [jsxs("svg", {
6186
- className: styles$I.icon,
6190
+ className: styles$J.icon,
6187
6191
  width: "12",
6188
6192
  height: "12",
6189
6193
  viewBox: "0 0 24 24",
@@ -6213,7 +6217,7 @@ const badge$3 = "_badge_rvfx9_48";
6213
6217
  const price$4 = "_price_rvfx9_52";
6214
6218
  const compareAt = "_compareAt_rvfx9_57";
6215
6219
  const strikethrough = "_strikethrough_rvfx9_65";
6216
- const styles$H = {
6220
+ const styles$I = {
6217
6221
  root: root$3,
6218
6222
  center: center$1,
6219
6223
  end,
@@ -6230,12 +6234,12 @@ function PriceBlock({ price: price2, compareAt: compareAt2, discountPct: discoun
6230
6234
  const pct = discountPct$1 ?? discountPct(price2, compareAt2);
6231
6235
  const hasCompare = compareAt2 && compareAt2.amount > price2.amount;
6232
6236
  return jsxs("div", {
6233
- className: [styles$H.root, styles$H[size], styles$H[align], styles$H[variant]].join(" "),
6237
+ className: [styles$I.root, styles$I[size], styles$I[align], styles$I[variant]].join(" "),
6234
6238
  children: [jsx("span", {
6235
- className: styles$H.price,
6239
+ className: styles$I.price,
6236
6240
  children: format(price2)
6237
6241
  }), hasCompare && jsxs("span", {
6238
- className: styles$H.compareAt,
6242
+ className: styles$I.compareAt,
6239
6243
  children: [jsx("span", {
6240
6244
  className: "visually-hidden",
6241
6245
  children: `Was ${format(compareAt2)}`
@@ -6261,7 +6265,7 @@ const past = "_past_1cum7_113";
6261
6265
  const current = "_current_1cum7_118";
6262
6266
  const future = "_future_1cum7_133";
6263
6267
  const date$1 = "_date_1cum7_138";
6264
- const styles$G = {
6268
+ const styles$H = {
6265
6269
  timeline,
6266
6270
  row: row$8,
6267
6271
  line: line$3,
@@ -6280,39 +6284,39 @@ function OrderTimeline({ progress: progress2, estimatedDelivery, locale: localeP
6280
6284
  const locale = useLocale(localeProp);
6281
6285
  const currentIndex = progress2.findIndex((e) => e.current);
6282
6286
  return jsx("ol", {
6283
- className: styles$G.timeline,
6287
+ className: styles$H.timeline,
6284
6288
  children: progress2.map((entry, i) => {
6285
6289
  const state = stateOf(entry, i, currentIndex);
6286
6290
  const estimate = !entry.at && i === progress2.length - 1 && estimatedDelivery ? formatWindow(estimatedDelivery, locale) : void 0;
6287
6291
  return jsxs("li", {
6288
- className: styles$G.row,
6292
+ className: styles$H.row,
6289
6293
  "aria-current": entry.current ? "step" : void 0,
6290
6294
  children: [jsxs("div", {
6291
- className: styles$G.line,
6295
+ className: styles$H.line,
6292
6296
  children: [jsx("span", {
6293
- className: styles$G.marker,
6297
+ className: styles$H.marker,
6294
6298
  children: state === "future" ? jsx("span", {
6295
- className: styles$G.pending,
6299
+ className: styles$H.pending,
6296
6300
  "aria-hidden": "true"
6297
6301
  }) : jsx(StepTick, {
6298
6302
  tone: state
6299
6303
  })
6300
6304
  }), jsxs("span", {
6301
- className: styles$G.text,
6305
+ className: styles$H.text,
6302
6306
  children: [jsx("span", {
6303
- className: [styles$G.label, styles$G[state]].join(" "),
6307
+ className: [styles$H.label, styles$H[state]].join(" "),
6304
6308
  children: entry.label
6305
6309
  }), entry.at ? jsx("time", {
6306
- className: styles$G.date,
6310
+ className: styles$H.date,
6307
6311
  dateTime: entry.at,
6308
6312
  children: formatStepDate(entry.at, locale)
6309
6313
  }) : estimate && jsx("span", {
6310
- className: styles$G.date,
6314
+ className: styles$H.date,
6311
6315
  children: estimate
6312
6316
  })]
6313
6317
  })]
6314
6318
  }), i < progress2.length - 1 && jsx("span", {
6315
- className: styles$G.connector,
6319
+ className: styles$H.connector,
6316
6320
  "aria-hidden": "true"
6317
6321
  })]
6318
6322
  }, entry.step);
@@ -6326,7 +6330,7 @@ function stateOf(entry, index, currentIndex) {
6326
6330
  }
6327
6331
  function StepTick({ tone }) {
6328
6332
  return jsxs("svg", {
6329
- className: styles$G.tick,
6333
+ className: styles$H.tick,
6330
6334
  width: "28",
6331
6335
  height: "28",
6332
6336
  viewBox: "0 0 28 28",
@@ -6471,7 +6475,7 @@ const row$7 = "_row_1hsxt_16";
6471
6475
  const free = "_free_1hsxt_53";
6472
6476
  const pending$1 = "_pending_1hsxt_59";
6473
6477
  const discount = "_discount_1hsxt_69";
6474
- const styles$F = {
6478
+ const styles$G = {
6475
6479
  summary,
6476
6480
  row: row$7,
6477
6481
  free,
@@ -6500,11 +6504,11 @@ function OrderSummary({ pricing, deferred = [], hidden = [], rows = CART_ROWS, d
6500
6504
  const isDeferred = (key) => deferred.includes(key);
6501
6505
  const visible = rows.filter((row2) => !hidden.includes(row2.key)).filter((row2) => row2.key !== "discount" || discount2 !== void 0);
6502
6506
  return jsx("dl", {
6503
- className: styles$F.summary,
6507
+ className: styles$G.summary,
6504
6508
  children: visible.map(({ label: label2, key }) => {
6505
6509
  if (key === "discount" && discount2) {
6506
6510
  return jsxs("div", {
6507
- className: [styles$F.row, styles$F.discount].join(" "),
6511
+ className: [styles$G.row, styles$G.discount].join(" "),
6508
6512
  children: [jsx("dt", {
6509
6513
  children: t(label2)
6510
6514
  }), jsx("dd", {
@@ -6514,11 +6518,11 @@ function OrderSummary({ pricing, deferred = [], hidden = [], rows = CART_ROWS, d
6514
6518
  }
6515
6519
  const pending2 = key !== "total" && isDeferred(key);
6516
6520
  return jsxs("div", {
6517
- className: styles$F.row,
6521
+ className: styles$G.row,
6518
6522
  children: [jsx("dt", {
6519
6523
  children: t(label2)
6520
6524
  }), jsx("dd", {
6521
- className: pending2 ? styles$F.pending : void 0,
6525
+ className: pending2 ? styles$G.pending : void 0,
6522
6526
  children: pending2 ? t("Calculated at checkout") : renderValue(key, pricing, format, t)
6523
6527
  })]
6524
6528
  }, key);
@@ -6528,7 +6532,7 @@ function OrderSummary({ pricing, deferred = [], hidden = [], rows = CART_ROWS, d
6528
6532
  function renderValue(key, pricing, format, t) {
6529
6533
  if (key === "shipping" && pricing.shipping.amount === 0) {
6530
6534
  return jsx("span", {
6531
- className: styles$F.free,
6535
+ className: styles$G.free,
6532
6536
  children: t("Free")
6533
6537
  });
6534
6538
  }
@@ -6551,7 +6555,7 @@ const card$4 = "_card_1vmnm_173";
6551
6555
  const cardTitle = "_cardTitle_1vmnm_181";
6552
6556
  const cardBody = "_cardBody_1vmnm_193";
6553
6557
  const summaryCard = "_summaryCard_1vmnm_165";
6554
- const styles$E = {
6558
+ const styles$F = {
6555
6559
  lines: lines$1,
6556
6560
  line: line$2,
6557
6561
  thumb: thumb$2,
@@ -6590,42 +6594,42 @@ function OrderLine({ item: item2 }) {
6590
6594
  const pct = compareAt2 ? discountPct(item2.unit_price, compareAt2) : void 0;
6591
6595
  const details2 = detailsOf(item2, t);
6592
6596
  return jsxs("li", {
6593
- className: styles$E.line,
6597
+ className: styles$F.line,
6594
6598
  children: [jsx("div", {
6595
- className: styles$E.thumb,
6599
+ className: styles$F.thumb,
6596
6600
  children: item2.image ? jsx(ShopImage, {
6597
6601
  src: item2.image,
6598
6602
  alt: "",
6599
6603
  fill: true,
6600
6604
  sizes: "48px",
6601
- className: styles$E.image
6605
+ className: styles$F.image
6602
6606
  }) : jsx("div", {
6603
- className: styles$E.placeholder,
6607
+ className: styles$F.placeholder,
6604
6608
  "aria-hidden": "true"
6605
6609
  })
6606
6610
  }), jsxs("div", {
6607
- className: styles$E.lineBody,
6611
+ className: styles$F.lineBody,
6608
6612
  children: [jsxs("div", {
6609
- className: styles$E.lineText,
6613
+ className: styles$F.lineText,
6610
6614
  children: [jsx("span", {
6611
- className: styles$E.lineTitle,
6615
+ className: styles$F.lineTitle,
6612
6616
  children: item2.title ?? item2.sku
6613
6617
  }), jsxs("span", {
6614
- className: styles$E.lineMeta,
6618
+ className: styles$F.lineMeta,
6615
6619
  children: [details2.map((detail2) => jsx("span", {
6616
- className: styles$E.detail,
6620
+ className: styles$F.detail,
6617
6621
  children: detail2
6618
6622
  }, detail2)), pct !== void 0 && jsx(SaleBadge, {
6619
6623
  pct
6620
6624
  })]
6621
6625
  })]
6622
6626
  }), jsxs("span", {
6623
- className: styles$E.linePrice,
6627
+ className: styles$F.linePrice,
6624
6628
  children: [jsx("span", {
6625
- className: styles$E.paid,
6629
+ className: styles$F.paid,
6626
6630
  children: format(item2.line_total)
6627
6631
  }), compareAt2 && jsxs("span", {
6628
- className: styles$E.was,
6632
+ className: styles$F.was,
6629
6633
  children: [jsx("span", {
6630
6634
  className: "visually-hidden",
6631
6635
  children: `Was ${format(compareAt2)}`
@@ -6641,7 +6645,7 @@ function OrderLine({ item: item2 }) {
6641
6645
  function OrderLines({ order }) {
6642
6646
  const t = useT();
6643
6647
  return jsx("ul", {
6644
- className: styles$E.lines,
6648
+ className: styles$F.lines,
6645
6649
  "aria-label": t("Items"),
6646
6650
  children: order.items.map((item2) => jsx(OrderLine, {
6647
6651
  item: item2
@@ -6651,13 +6655,13 @@ function OrderLines({ order }) {
6651
6655
  function ShippingAddressCard({ order }) {
6652
6656
  const t = useT();
6653
6657
  return jsxs("section", {
6654
- className: styles$E.card,
6658
+ className: styles$F.card,
6655
6659
  "aria-label": t("Shipping address"),
6656
6660
  children: [jsx("h2", {
6657
- className: styles$E.cardTitle,
6661
+ className: styles$F.cardTitle,
6658
6662
  children: "Shipping address"
6659
6663
  }), jsx("p", {
6660
- className: styles$E.cardBody,
6664
+ className: styles$F.cardBody,
6661
6665
  children: formatAddress(order.ship_to)
6662
6666
  })]
6663
6667
  });
@@ -6665,10 +6669,10 @@ function ShippingAddressCard({ order }) {
6665
6669
  function OrderSummaryCard({ order }) {
6666
6670
  const t = useT();
6667
6671
  return jsxs("section", {
6668
- className: [styles$E.card, styles$E.summaryCard].join(" "),
6672
+ className: [styles$F.card, styles$F.summaryCard].join(" "),
6669
6673
  "aria-label": t("Order summary"),
6670
6674
  children: [jsx("h2", {
6671
- className: styles$E.cardTitle,
6675
+ className: styles$F.cardTitle,
6672
6676
  children: "Order summary"
6673
6677
  }), jsx(OrderSummary, {
6674
6678
  pricing: toPricing(order),
@@ -6705,7 +6709,7 @@ const handleSlot = "_handleSlot_1f3nh_23";
6705
6709
  const handle = "_handle_1f3nh_23";
6706
6710
  const closeSlot$1 = "_closeSlot_1f3nh_35";
6707
6711
  const close$2 = "_close_1f3nh_35";
6708
- const styles$D = {
6712
+ const styles$E = {
6709
6713
  header: header$6,
6710
6714
  slot,
6711
6715
  handleSlot,
@@ -6733,23 +6737,23 @@ function CloseIcon$1() {
6733
6737
  }
6734
6738
  function SheetHeader({ onClose, closeLabel }) {
6735
6739
  return jsxs("div", {
6736
- className: styles$D.header,
6740
+ className: styles$E.header,
6737
6741
  children: [jsx("div", {
6738
- className: styles$D.slot,
6742
+ className: styles$E.slot,
6739
6743
  "aria-hidden": "true"
6740
6744
  }), jsx("div", {
6741
- className: styles$D.handleSlot,
6745
+ className: styles$E.handleSlot,
6742
6746
  "aria-hidden": "true",
6743
6747
  children: jsx("div", {
6744
- className: styles$D.handle
6748
+ className: styles$E.handle
6745
6749
  })
6746
6750
  }), jsx("button", {
6747
6751
  type: "button",
6748
- className: styles$D.closeSlot,
6752
+ className: styles$E.closeSlot,
6749
6753
  onClick: onClose,
6750
6754
  "aria-label": closeLabel,
6751
6755
  children: jsx("span", {
6752
- className: styles$D.close,
6756
+ className: styles$E.close,
6753
6757
  children: jsx(CloseIcon$1, {})
6754
6758
  })
6755
6759
  })]
@@ -6805,7 +6809,7 @@ const radio = "_radio_7on4q_88";
6805
6809
  const label$1 = "_label_7on4q_118";
6806
6810
  const footer$1 = "_footer_7on4q_127";
6807
6811
  const error$1 = "_error_7on4q_135";
6808
- const styles$C = {
6812
+ const styles$D = {
6809
6813
  scrim: scrim$5,
6810
6814
  sheet: sheet$3,
6811
6815
  body: body$6,
@@ -6822,12 +6826,12 @@ function ReasonSheet({ title: title2, options: options2, ctaLabel, selected: sel
6822
6826
  const [choice, setChoice] = useState(selected2);
6823
6827
  useModalDialog(true, onClose, sheetRef);
6824
6828
  return jsx("div", {
6825
- className: styles$C.scrim,
6829
+ className: styles$D.scrim,
6826
6830
  onClick: onClose,
6827
6831
  children: jsxs(ShopSurface, {
6828
6832
  tone: "light",
6829
6833
  ref: sheetRef,
6830
- className: styles$C.sheet,
6834
+ className: styles$D.sheet,
6831
6835
  role: "dialog",
6832
6836
  "aria-modal": "true",
6833
6837
  "aria-labelledby": "reason-sheet-title",
@@ -6836,23 +6840,23 @@ function ReasonSheet({ title: title2, options: options2, ctaLabel, selected: sel
6836
6840
  onClose,
6837
6841
  closeLabel
6838
6842
  }), jsxs("div", {
6839
- className: styles$C.body,
6843
+ className: styles$D.body,
6840
6844
  children: [jsx("h2", {
6841
6845
  id: "reason-sheet-title",
6842
- className: styles$C.title,
6846
+ className: styles$D.title,
6843
6847
  children: title2
6844
6848
  }), jsx("div", {
6845
- className: styles$C.options,
6849
+ className: styles$D.options,
6846
6850
  role: "radiogroup",
6847
6851
  "aria-labelledby": "reason-sheet-title",
6848
6852
  children: options2.map((o) => jsxs("button", {
6849
6853
  type: "button",
6850
6854
  role: "radio",
6851
6855
  "aria-checked": o.value === choice,
6852
- className: styles$C.option,
6856
+ className: styles$D.option,
6853
6857
  onClick: () => setChoice(o.value),
6854
6858
  children: [jsx("span", {
6855
- className: styles$C.radio,
6859
+ className: styles$D.radio,
6856
6860
  "aria-hidden": "true",
6857
6861
  children: o.value === choice && jsxs("svg", {
6858
6862
  width: "20",
@@ -6873,15 +6877,15 @@ function ReasonSheet({ title: title2, options: options2, ctaLabel, selected: sel
6873
6877
  })]
6874
6878
  })
6875
6879
  }), jsx("span", {
6876
- className: styles$C.label,
6880
+ className: styles$D.label,
6877
6881
  children: o.label
6878
6882
  })]
6879
6883
  }, o.value))
6880
6884
  })]
6881
6885
  }), jsxs("div", {
6882
- className: styles$C.footer,
6886
+ className: styles$D.footer,
6883
6887
  children: [error2 && jsx("p", {
6884
- className: styles$C.error,
6888
+ className: styles$D.error,
6885
6889
  role: "alert",
6886
6890
  children: error2
6887
6891
  }), jsx(Button, {
@@ -6896,27 +6900,82 @@ function ReasonSheet({ title: title2, options: options2, ctaLabel, selected: sel
6896
6900
  })
6897
6901
  });
6898
6902
  }
6899
- const page$6 = "_page_1c7ro_7";
6900
- const titles$2 = "_titles_1c7ro_15";
6901
- const title$k = "_title_1c7ro_15";
6902
- const subtitle$7 = "_subtitle_1c7ro_30";
6903
- const list$2 = "_list_1c7ro_38";
6904
- const card$3 = "_card_1c7ro_48";
6905
- const checkSlot = "_checkSlot_1c7ro_61";
6906
- const check = "_check_1c7ro_61";
6907
- const row$6 = "_row_1c7ro_105";
6908
- const line$1 = "_line_1c7ro_113";
6909
- const thumb$1 = "_thumb_1c7ro_119";
6910
- const img$1 = "_img_1c7ro_129";
6911
- const placeholder$7 = "_placeholder_1c7ro_133";
6912
- const meta$2 = "_meta_1c7ro_138";
6913
- const name$2 = "_name_1c7ro_147";
6914
- const attrs$1 = "_attrs_1c7ro_159";
6915
- const price$3 = "_price_1c7ro_167";
6916
- const paid$2 = "_paid_1c7ro_176";
6917
- const was$3 = "_was_1c7ro_184";
6918
- const reason = "_reason_1c7ro_199";
6919
- const reasonSet = "_reasonSet_1c7ro_217";
6903
+ const line$1 = "_line_1v0et_6";
6904
+ const thumb$1 = "_thumb_1v0et_12";
6905
+ const img$1 = "_img_1v0et_22";
6906
+ const placeholder$7 = "_placeholder_1v0et_26";
6907
+ const meta$2 = "_meta_1v0et_31";
6908
+ const name$2 = "_name_1v0et_40";
6909
+ const attrs$1 = "_attrs_1v0et_52";
6910
+ const price$3 = "_price_1v0et_60";
6911
+ const paid$2 = "_paid_1v0et_69";
6912
+ const was$3 = "_was_1v0et_77";
6913
+ const styles$C = {
6914
+ line: line$1,
6915
+ thumb: thumb$1,
6916
+ img: img$1,
6917
+ placeholder: placeholder$7,
6918
+ meta: meta$2,
6919
+ name: name$2,
6920
+ attrs: attrs$1,
6921
+ price: price$3,
6922
+ paid: paid$2,
6923
+ was: was$3
6924
+ };
6925
+ function ReturnItemRow({ item: item2, className }) {
6926
+ const { format } = useMoney();
6927
+ return jsxs("div", {
6928
+ className: [styles$C.line, className ?? ""].join(" ").trim(),
6929
+ children: [jsx("div", {
6930
+ className: styles$C.thumb,
6931
+ children: item2.image ? jsx(ShopImage, {
6932
+ src: item2.image,
6933
+ alt: "",
6934
+ fill: true,
6935
+ sizes: "48px",
6936
+ className: styles$C.img
6937
+ }) : jsx("div", {
6938
+ className: styles$C.placeholder,
6939
+ "aria-hidden": "true"
6940
+ })
6941
+ }), jsxs("div", {
6942
+ className: styles$C.meta,
6943
+ children: [jsx("p", {
6944
+ className: styles$C.name,
6945
+ children: item2.title ?? item2.sku
6946
+ }), item2.attributes?.size && jsx("p", {
6947
+ className: styles$C.attrs,
6948
+ children: `Size: ${item2.attributes.size}`
6949
+ })]
6950
+ }), jsxs("div", {
6951
+ className: styles$C.price,
6952
+ children: [jsx("span", {
6953
+ className: styles$C.paid,
6954
+ children: format(item2.unit_price)
6955
+ }), item2.compare_at_unit_price && jsxs("span", {
6956
+ className: styles$C.was,
6957
+ children: [jsx("span", {
6958
+ className: "visually-hidden",
6959
+ children: `Was ${format(item2.compare_at_unit_price)}`
6960
+ }), jsx("span", {
6961
+ "aria-hidden": "true",
6962
+ children: format(item2.compare_at_unit_price)
6963
+ })]
6964
+ })]
6965
+ })]
6966
+ });
6967
+ }
6968
+ const page$6 = "_page_6yt5y_7";
6969
+ const titles$2 = "_titles_6yt5y_15";
6970
+ const title$k = "_title_6yt5y_15";
6971
+ const subtitle$7 = "_subtitle_6yt5y_30";
6972
+ const list$2 = "_list_6yt5y_38";
6973
+ const card$3 = "_card_6yt5y_48";
6974
+ const checkSlot = "_checkSlot_6yt5y_61";
6975
+ const check = "_check_6yt5y_61";
6976
+ const row$6 = "_row_6yt5y_105";
6977
+ const reason = "_reason_6yt5y_119";
6978
+ const reasonSet = "_reasonSet_6yt5y_137";
6920
6979
  const styles$B = {
6921
6980
  page: page$6,
6922
6981
  titles: titles$2,
@@ -6927,16 +6986,6 @@ const styles$B = {
6927
6986
  checkSlot,
6928
6987
  check,
6929
6988
  row: row$6,
6930
- line: line$1,
6931
- thumb: thumb$1,
6932
- img: img$1,
6933
- placeholder: placeholder$7,
6934
- meta: meta$2,
6935
- name: name$2,
6936
- attrs: attrs$1,
6937
- price: price$3,
6938
- paid: paid$2,
6939
- was: was$3,
6940
6989
  reason,
6941
6990
  reasonSet
6942
6991
  };
@@ -7001,7 +7050,6 @@ function unitsLeft(item2) {
7001
7050
  return item2.qty - item2.cancelled_qty - item2.refunded_qty - (item2.returned_qty ?? 0);
7002
7051
  }
7003
7052
  function ReturnItemsView({ order, onSubmit, busy = false }) {
7004
- const { format } = useMoney();
7005
7053
  const [chosen, setChosen] = useState({});
7006
7054
  const [reasonFor, setReasonFor] = useState(null);
7007
7055
  const returnable = useMemo(() => order.items.filter((i) => unitsLeft(i) > 0), [order.items]);
@@ -7066,39 +7114,8 @@ function ReturnItemsView({ order, onSubmit, busy = false }) {
7066
7114
  })
7067
7115
  }), jsxs("div", {
7068
7116
  className: styles$B.row,
7069
- children: [jsxs("div", {
7070
- className: styles$B.line,
7071
- children: [jsx("div", {
7072
- className: styles$B.thumb,
7073
- children: item2.image ? jsx(ShopImage, {
7074
- src: item2.image,
7075
- alt: "",
7076
- fill: true,
7077
- sizes: "48px",
7078
- className: styles$B.img
7079
- }) : jsx("div", {
7080
- className: styles$B.placeholder,
7081
- "aria-hidden": "true"
7082
- })
7083
- }), jsxs("div", {
7084
- className: styles$B.meta,
7085
- children: [jsx("p", {
7086
- className: styles$B.name,
7087
- children: item2.title ?? item2.sku
7088
- }), item2.attributes?.size && jsx("p", {
7089
- className: styles$B.attrs,
7090
- children: `Size: ${item2.attributes.size}`
7091
- })]
7092
- }), jsxs("div", {
7093
- className: styles$B.price,
7094
- children: [jsx("span", {
7095
- className: styles$B.paid,
7096
- children: format(item2.unit_price)
7097
- }), item2.compare_at_unit_price && jsx("span", {
7098
- className: styles$B.was,
7099
- children: format(item2.compare_at_unit_price)
7100
- })]
7101
- })]
7117
+ children: [jsx(ReturnItemRow, {
7118
+ item: item2
7102
7119
  }), jsxs("button", {
7103
7120
  type: "button",
7104
7121
  className: `${styles$B.reason} ${reason2 ? styles$B.reasonSet : ""}`,
@@ -7137,22 +7154,26 @@ function ReturnItemsView({ order, onSubmit, busy = false }) {
7137
7154
  })]
7138
7155
  });
7139
7156
  }
7140
- const page$5 = "_page_1r0ea_7";
7141
- const intro$1 = "_intro_1r0ea_15";
7142
- const title$j = "_title_1r0ea_22";
7143
- const subtitle$6 = "_subtitle_1r0ea_31";
7144
- const card$2 = "_card_1r0ea_39";
7145
- const step = "_step_1r0ea_49";
7146
- const step2 = "_step2_1r0ea_56";
7147
- const stepHead = "_stepHead_1r0ea_62";
7148
- const number = "_number_1r0ea_69";
7149
- const stepTitle = "_stepTitle_1r0ea_84";
7150
- const body$5 = "_body_1r0ea_95";
7151
- const body2 = "_body2_1r0ea_103";
7152
- const download = "_download_1r0ea_121";
7153
- const note$1 = "_note_1r0ea_143";
7157
+ const page$5 = "_page_51f4e_7";
7158
+ const top = "_top_51f4e_20";
7159
+ const items$2 = "_items_51f4e_27";
7160
+ const intro$1 = "_intro_51f4e_33";
7161
+ const title$j = "_title_51f4e_40";
7162
+ const subtitle$6 = "_subtitle_51f4e_49";
7163
+ const card$2 = "_card_51f4e_57";
7164
+ const step = "_step_51f4e_67";
7165
+ const step2 = "_step2_51f4e_74";
7166
+ const stepHead = "_stepHead_51f4e_80";
7167
+ const number = "_number_51f4e_87";
7168
+ const stepTitle = "_stepTitle_51f4e_102";
7169
+ const body$5 = "_body_51f4e_113";
7170
+ const body2 = "_body2_51f4e_121";
7171
+ const download = "_download_51f4e_139";
7172
+ const note$1 = "_note_51f4e_161";
7154
7173
  const styles$A = {
7155
7174
  page: page$5,
7175
+ top,
7176
+ items: items$2,
7156
7177
  intro: intro$1,
7157
7178
  title: title$j,
7158
7179
  subtitle: subtitle$6,
@@ -7171,59 +7192,67 @@ function ReturnLabelView({ ret, onDone }) {
7171
7192
  return jsxs("div", {
7172
7193
  className: styles$A.page,
7173
7194
  children: [jsxs("div", {
7174
- className: styles$A.intro,
7175
- children: [jsx("h1", {
7176
- className: styles$A.title,
7177
- children: "We’ve generated your return label"
7178
- }), jsx("p", {
7179
- className: styles$A.subtitle,
7180
- children: "Follow the instructions below to complete your return"
7181
- })]
7182
- }), jsxs("div", {
7183
- className: styles$A.card,
7184
- children: [jsxs("section", {
7185
- className: styles$A.step,
7186
- children: [jsxs("div", {
7187
- className: styles$A.stepHead,
7188
- children: [jsx("span", {
7189
- className: styles$A.number,
7190
- "aria-hidden": "true",
7191
- children: "1"
7192
- }), jsx("h2", {
7193
- className: styles$A.stepTitle,
7194
- children: "Download your return label"
7195
- })]
7195
+ className: styles$A.top,
7196
+ children: [jsx("div", {
7197
+ className: styles$A.items,
7198
+ children: ret.items.map((item2) => jsx(ReturnItemRow, {
7199
+ item: item2
7200
+ }, item2.line_ref))
7201
+ }), jsxs("div", {
7202
+ className: styles$A.intro,
7203
+ children: [jsx("h1", {
7204
+ className: styles$A.title,
7205
+ children: "We’ve generated your return label"
7196
7206
  }), jsx("p", {
7197
- className: styles$A.body,
7198
- children: "Tap the button below to download your pre-paid return label"
7199
- }), ret.label_url && jsxs("a", {
7200
- className: styles$A.download,
7201
- href: ret.label_url,
7202
- target: "_blank",
7203
- rel: "noopener noreferrer",
7204
- children: ["Download return label", jsx("span", {
7205
- className: "visually-hidden",
7206
- children: " (opens in a new tab)"
7207
- })]
7208
- }), ret.label_email && jsxs("p", {
7209
- className: styles$A.note,
7210
- children: ["You’ll receive a shipping label PDF to your email as well.", jsx("br", {}), ret.label_email]
7207
+ className: styles$A.subtitle,
7208
+ children: "Follow the instructions below to complete your return"
7211
7209
  })]
7212
- }), jsxs("section", {
7213
- className: styles$A.step2,
7214
- children: [jsxs("div", {
7215
- className: styles$A.stepHead,
7216
- children: [jsx("span", {
7217
- className: styles$A.number,
7218
- "aria-hidden": "true",
7219
- children: "2"
7220
- }), jsx("h2", {
7221
- className: styles$A.stepTitle,
7222
- children: "Pack and ship the item"
7210
+ }), jsxs("div", {
7211
+ className: styles$A.card,
7212
+ children: [jsxs("section", {
7213
+ className: styles$A.step,
7214
+ children: [jsxs("div", {
7215
+ className: styles$A.stepHead,
7216
+ children: [jsx("span", {
7217
+ className: styles$A.number,
7218
+ "aria-hidden": "true",
7219
+ children: "1"
7220
+ }), jsx("h2", {
7221
+ className: styles$A.stepTitle,
7222
+ children: "Download your return label"
7223
+ })]
7224
+ }), jsx("p", {
7225
+ className: styles$A.body,
7226
+ children: "Tap the button below to download your pre-paid return label"
7227
+ }), ret.label_url && jsxs("a", {
7228
+ className: styles$A.download,
7229
+ href: ret.label_url,
7230
+ target: "_blank",
7231
+ rel: "noopener noreferrer",
7232
+ children: ["Download return label", jsx("span", {
7233
+ className: "visually-hidden",
7234
+ children: " (opens in a new tab)"
7235
+ })]
7236
+ }), ret.label_email && jsxs("p", {
7237
+ className: styles$A.note,
7238
+ children: ["You’ll receive a shipping label PDF to your email as well.", jsx("br", {}), ret.label_email]
7239
+ })]
7240
+ }), jsxs("section", {
7241
+ className: styles$A.step2,
7242
+ children: [jsxs("div", {
7243
+ className: styles$A.stepHead,
7244
+ children: [jsx("span", {
7245
+ className: styles$A.number,
7246
+ "aria-hidden": "true",
7247
+ children: "2"
7248
+ }), jsx("h2", {
7249
+ className: styles$A.stepTitle,
7250
+ children: "Pack and ship the item"
7251
+ })]
7252
+ }), jsxs("p", {
7253
+ className: styles$A.body2,
7254
+ children: ["Repackage the item securely and attach the return label to the outside of the package.", jsx("br", {}), "Drop it off at your local carrier or post office."]
7223
7255
  })]
7224
- }), jsxs("p", {
7225
- className: styles$A.body2,
7226
- children: ["Repackage the item securely and attach the return label to the outside of the package.", jsx("br", {}), "Drop it off at your local carrier or post office."]
7227
7256
  })]
7228
7257
  })]
7229
7258
  }), onDone && jsx(Button, {
@@ -10737,8 +10766,8 @@ function useDocumentSnap(ref, enabled = true) {
10737
10766
  const previousPadding = root2.style.scrollPaddingTop;
10738
10767
  let timer2;
10739
10768
  const syncPadding = () => {
10740
- const top = getComputedStyle(el).getPropertyValue("--showcase-top").trim();
10741
- root2.style.scrollPaddingTop = top === "" ? "0px" : top;
10769
+ const top2 = getComputedStyle(el).getPropertyValue("--showcase-top").trim();
10770
+ root2.style.scrollPaddingTop = top2 === "" ? "0px" : top2;
10742
10771
  };
10743
10772
  const schedule = () => {
10744
10773
  if (timer2) clearTimeout(timer2);
@@ -11096,8 +11125,8 @@ function useScrolledUnder(enabled) {
11096
11125
  if (!enabled) return;
11097
11126
  const read = (event) => {
11098
11127
  const target = event?.target;
11099
- const top = target && target !== document && target instanceof HTMLElement ? target.scrollTop : window.scrollY || document.documentElement.scrollTop;
11100
- setScrolled(top > 0);
11128
+ const top2 = target && target !== document && target instanceof HTMLElement ? target.scrollTop : window.scrollY || document.documentElement.scrollTop;
11129
+ setScrolled(top2 > 0);
11101
11130
  };
11102
11131
  read();
11103
11132
  document.addEventListener("scroll", read, {