@nok-integration/storefront-react 0.19.53 → 0.20.6

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
@@ -4403,6 +4403,53 @@ function requireContent() {
4403
4403
  })(content$1);
4404
4404
  return content$1;
4405
4405
  }
4406
+ var storefrontConfig = {};
4407
+ var hasRequiredStorefrontConfig;
4408
+ function requireStorefrontConfig() {
4409
+ if (hasRequiredStorefrontConfig) return storefrontConfig;
4410
+ hasRequiredStorefrontConfig = 1;
4411
+ (function(exports) {
4412
+ Object.defineProperty(exports, "__esModule", {
4413
+ value: true
4414
+ });
4415
+ exports.STOREFRONT_CONFIG_FALLBACK = exports.StorefrontConfig = exports.StorefrontMarketConfig = exports.StorefrontPresentationConfig = exports.StorefrontAnalyticsConfig = void 0;
4416
+ const zod_1 = requireZod();
4417
+ exports.StorefrontAnalyticsConfig = zod_1.z.object({
4418
+ ga4_measurement_id: zod_1.z.string().nullable(),
4419
+ debug: zod_1.z.boolean()
4420
+ });
4421
+ exports.StorefrontPresentationConfig = zod_1.z.object({
4422
+ show_cart_tax: zod_1.z.boolean(),
4423
+ show_size_charts: zod_1.z.boolean(),
4424
+ show_stock_alerts: zod_1.z.boolean()
4425
+ });
4426
+ exports.StorefrontMarketConfig = zod_1.z.object({
4427
+ default_country: zod_1.z.string(),
4428
+ default_lang: zod_1.z.string()
4429
+ });
4430
+ exports.StorefrontConfig = zod_1.z.object({
4431
+ analytics: exports.StorefrontAnalyticsConfig,
4432
+ presentation: exports.StorefrontPresentationConfig,
4433
+ market: exports.StorefrontMarketConfig
4434
+ });
4435
+ exports.STOREFRONT_CONFIG_FALLBACK = {
4436
+ analytics: {
4437
+ ga4_measurement_id: null,
4438
+ debug: false
4439
+ },
4440
+ presentation: {
4441
+ show_cart_tax: true,
4442
+ show_size_charts: true,
4443
+ show_stock_alerts: true
4444
+ },
4445
+ market: {
4446
+ default_country: "GB",
4447
+ default_lang: "en"
4448
+ }
4449
+ };
4450
+ })(storefrontConfig);
4451
+ return storefrontConfig;
4452
+ }
4406
4453
  var inventory = {};
4407
4454
  var hasRequiredInventory;
4408
4455
  function requireInventory() {
@@ -4885,6 +4932,7 @@ function requireClient() {
4885
4932
  client.createClient = createClient;
4886
4933
  const catalog_1 = requireCatalog();
4887
4934
  const content_1 = requireContent();
4935
+ const storefront_config_1 = requireStorefrontConfig();
4888
4936
  const inventory_1 = requireInventory();
4889
4937
  const cart_1 = requireCart();
4890
4938
  const session_1 = requireSession();
@@ -5012,6 +5060,13 @@ function requireClient() {
5012
5060
  schema: content_1.HomeContent
5013
5061
  })
5014
5062
  },
5063
+ storefrontConfig: {
5064
+ get: () => request({
5065
+ method: "GET",
5066
+ path: "/storefront-config",
5067
+ schema: storefront_config_1.StorefrontConfig
5068
+ })
5069
+ },
5015
5070
  inventory: {
5016
5071
  get: (sku) => request({
5017
5072
  method: "GET",
@@ -5134,8 +5189,8 @@ function resolveAssetUrl(src, base) {
5134
5189
  const MAX_AGE_MS = 5 * 6e4;
5135
5190
  const CAPACITY = 60;
5136
5191
  class ProductCache {
5137
- constructor(now = () => Date.now()) {
5138
- this.now = now;
5192
+ constructor(now2 = () => Date.now()) {
5193
+ this.now = now2;
5139
5194
  }
5140
5195
  now;
5141
5196
  entries = /* @__PURE__ */ new Map();
@@ -5275,7 +5330,7 @@ function NoScreenTitle({ children }) {
5275
5330
  }
5276
5331
  const ShopContext = createContext(null);
5277
5332
  function DaznShopProvider({ children, ...config }) {
5278
- const { apiBaseUrl, getToken, market, navigate: hostNavigate, prefetch: hostPrefetch, sessionTransport = "bearer", theme = "auto", notifications = "internal", onEvent, locale, assetBaseUrl } = config;
5333
+ const { apiBaseUrl, getToken, market, navigate: hostNavigate, prefetch: hostPrefetch, sessionTransport = "bearer", theme = "auto", notifications = "internal", features, onEvent, locale, assetBaseUrl } = config;
5279
5334
  const listeners = useRef(/* @__PURE__ */ new Set());
5280
5335
  const subscribe = useCallback((listener) => {
5281
5336
  listeners.current.add(listener);
@@ -5329,19 +5384,24 @@ function DaznShopProvider({ children, ...config }) {
5329
5384
  type: "ready"
5330
5385
  });
5331
5386
  }, []);
5387
+ const resolvedFeatures = useMemo(() => ({
5388
+ sizeCharts: features?.sizeCharts ?? true,
5389
+ stockAlerts: features?.stockAlerts ?? true
5390
+ }), [features?.sizeCharts, features?.stockAlerts]);
5332
5391
  const value2 = useMemo(() => ({
5333
5392
  api,
5334
5393
  market,
5335
5394
  products,
5336
5395
  theme,
5337
5396
  notifications,
5397
+ features: resolvedFeatures,
5338
5398
  locale,
5339
5399
  assetBaseUrl,
5340
5400
  emit,
5341
5401
  subscribe,
5342
5402
  navigate,
5343
5403
  prefetch: hostPrefetch ?? null
5344
- }), [api, market, products, theme, notifications, locale, assetBaseUrl, emit, subscribe, navigate, hostPrefetch]);
5404
+ }), [api, market, products, theme, resolvedFeatures, notifications, locale, assetBaseUrl, emit, subscribe, navigate, hostPrefetch]);
5345
5405
  return jsx(ShopContext.Provider, {
5346
5406
  value: value2,
5347
5407
  children: jsx(ScreenTitleProvider, {
@@ -5376,6 +5436,12 @@ function useShopEvent() {
5376
5436
  const emit = useShopOptional()?.emit;
5377
5437
  return useCallback((event) => emit?.(event), [emit]);
5378
5438
  }
5439
+ function useShopFeatures() {
5440
+ return useShopOptional()?.features ?? {
5441
+ sizeCharts: true,
5442
+ stockAlerts: true
5443
+ };
5444
+ }
5379
5445
  function ShopLink({ to, children, ...rest }) {
5380
5446
  const navigate = useNavigate();
5381
5447
  const prefetch = usePrefetch();
@@ -5531,13 +5597,13 @@ function Badge({ tone = "neutral", children }) {
5531
5597
  children
5532
5598
  });
5533
5599
  }
5534
- const button$1 = "_button_1u2uh_1";
5535
- const fullWidth = "_fullWidth_1u2uh_25";
5536
- const primary = "_primary_1u2uh_29";
5537
- const secondary = "_secondary_1u2uh_34";
5538
- const ghost = "_ghost_1u2uh_40";
5539
- const spinner = "_spinner_1u2uh_83";
5540
- const spin = "_spin_1u2uh_83";
5600
+ const button$1 = "_button_17pvl_1";
5601
+ const fullWidth = "_fullWidth_17pvl_25";
5602
+ const primary = "_primary_17pvl_29";
5603
+ const secondary = "_secondary_17pvl_34";
5604
+ const ghost = "_ghost_17pvl_40";
5605
+ const spinner = "_spinner_17pvl_83";
5606
+ const spin = "_spin_17pvl_83";
5541
5607
  const styles$Q = {
5542
5608
  button: button$1,
5543
5609
  fullWidth,
@@ -5580,8 +5646,8 @@ function Skeleton({ width, height, radius, className, circle }) {
5580
5646
  style
5581
5647
  });
5582
5648
  }
5583
- const surface$1 = "_surface_1xwok_10";
5584
- const fill = "_fill_1xwok_35";
5649
+ const surface$1 = "_surface_stwld_10";
5650
+ const fill = "_fill_stwld_35";
5585
5651
  const styles$O = {
5586
5652
  surface: surface$1,
5587
5653
  fill
@@ -5636,8 +5702,63 @@ function useTopOffset(ref, property, enabled = true) {
5636
5702
  };
5637
5703
  }, [ref, property, enabled]);
5638
5704
  }
5705
+ const HOLD_MS = 1e3;
5706
+ const RELEASES = ["touchstart", "wheel", "keydown", "pointerdown"];
5707
+ function anchorTop(shouldHold = () => true) {
5708
+ let released = false;
5709
+ const top2 = () => {
5710
+ if (released) return;
5711
+ const scrolled2 = window.scrollY || document.documentElement.scrollTop || 0;
5712
+ if (scrolled2 > 0 && shouldHold()) window.scrollTo(0, 0);
5713
+ };
5714
+ const release = () => {
5715
+ if (released) return;
5716
+ released = true;
5717
+ if (frame2 !== null && typeof cancelAnimationFrame === "function") cancelAnimationFrame(frame2);
5718
+ clearTimeout(timer2);
5719
+ window.removeEventListener("scroll", top2);
5720
+ for (const type of RELEASES) window.removeEventListener(type, release);
5721
+ };
5722
+ top2();
5723
+ const frame2 = typeof requestAnimationFrame === "function" ? requestAnimationFrame(top2) : null;
5724
+ const timer2 = setTimeout(release, HOLD_MS);
5725
+ window.addEventListener("scroll", top2, {
5726
+ passive: true
5727
+ });
5728
+ for (const type of RELEASES) window.addEventListener(type, release, {
5729
+ passive: true
5730
+ });
5731
+ return release;
5732
+ }
5733
+ const TRAVERSAL_WINDOW_MS = 1e3;
5734
+ const now = () => typeof performance !== "undefined" ? performance.now() : Date.now();
5735
+ let lastTraversal = -Infinity;
5736
+ if (typeof window !== "undefined") {
5737
+ window.addEventListener("popstate", () => {
5738
+ lastTraversal = now();
5739
+ });
5740
+ }
5741
+ function documentTop(el) {
5742
+ let top2 = 0;
5743
+ for (let node = el; node; node = node.offsetParent) {
5744
+ top2 += node.offsetTop;
5745
+ }
5746
+ return top2;
5747
+ }
5748
+ function beginsOnTheFirstViewport(el) {
5749
+ return documentTop(el) < window.innerHeight;
5750
+ }
5751
+ function useScreenAnchor(ref, enabled = true) {
5752
+ useEffect(() => {
5753
+ const el = ref.current;
5754
+ if (!el || !enabled) return;
5755
+ if (now() - lastTraversal < TRAVERSAL_WINDOW_MS) return;
5756
+ return anchorTop(() => beginsOnTheFirstViewport(el));
5757
+ }, [ref, enabled]);
5758
+ }
5639
5759
  const ShopSurface = forwardRef(function ShopSurface2({ tone, fill: fill2 = false, children, className, ...rest }, ref) {
5640
5760
  const own = useRef(null);
5761
+ useScreenAnchor(own, fill2);
5641
5762
  useTopOffset(own, "--surface-top", fill2);
5642
5763
  const attach = useCallback((node) => {
5643
5764
  own.current = node;
@@ -5689,14 +5810,14 @@ function minorUnitExponent(currency) {
5689
5810
  }
5690
5811
  function formatMoney(money2, locale) {
5691
5812
  const exponent = minorUnitExponent(money2.currency);
5692
- const major = money2.amount / 10 ** exponent;
5813
+ const major2 = money2.amount / 10 ** exponent;
5693
5814
  try {
5694
5815
  return new Intl.NumberFormat(locale, {
5695
5816
  style: "currency",
5696
5817
  currency: money2.currency
5697
- }).format(major);
5818
+ }).format(major2);
5698
5819
  } catch {
5699
- return `${major.toFixed(exponent)} ${money2.currency}`;
5820
+ return `${major2.toFixed(exponent)} ${money2.currency}`;
5700
5821
  }
5701
5822
  }
5702
5823
  function discountPct(price2, compareAt2) {
@@ -6116,20 +6237,20 @@ function StatusBadge({ status }) {
6116
6237
  children: t(label2)
6117
6238
  });
6118
6239
  }
6119
- const viewport = "_viewport_1tc1q_14";
6120
- const anchor = "_anchor_1tc1q_41";
6121
- const caret = "_caret_1tc1q_59";
6122
- const toast = "_toast_1tc1q_82";
6123
- const text$4 = "_text_1tc1q_111";
6124
- const message$1 = "_message_1tc1q_120";
6125
- const action = "_action_1tc1q_133";
6126
- const neutral = "_neutral_1tc1q_158";
6127
- const success = "_success_1tc1q_163";
6128
- const critical$1 = "_critical_1tc1q_168";
6129
- const rich = "_rich_1tc1q_183";
6130
- const description = "_description_1tc1q_198";
6131
- const thumb$3 = "_thumb_1tc1q_216";
6132
- const thumbImage = "_thumbImage_1tc1q_227";
6240
+ const viewport = "_viewport_oz4st_14";
6241
+ const anchor = "_anchor_oz4st_41";
6242
+ const caret = "_caret_oz4st_59";
6243
+ const toast = "_toast_oz4st_82";
6244
+ const text$4 = "_text_oz4st_111";
6245
+ const message$1 = "_message_oz4st_120";
6246
+ const action = "_action_oz4st_133";
6247
+ const neutral = "_neutral_oz4st_158";
6248
+ const success = "_success_oz4st_163";
6249
+ const critical$1 = "_critical_oz4st_168";
6250
+ const rich = "_rich_oz4st_183";
6251
+ const description = "_description_oz4st_198";
6252
+ const thumb$3 = "_thumb_oz4st_216";
6253
+ const thumbImage = "_thumbImage_oz4st_227";
6133
6254
  const styles$K = {
6134
6255
  viewport,
6135
6256
  anchor,
@@ -6661,27 +6782,27 @@ function renderValue(key, pricing, format, t) {
6661
6782
  }
6662
6783
  return key === "discount" ? null : format(pricing[key]);
6663
6784
  }
6664
- const lines$1 = "_lines_15b52_19";
6665
- const line$2 = "_line_15b52_19";
6666
- const thumb$2 = "_thumb_15b52_34";
6667
- const image$9 = "_image_15b52_44";
6668
- const placeholder$8 = "_placeholder_15b52_51";
6669
- const lineBody = "_lineBody_15b52_56";
6670
- const lineText = "_lineText_15b52_65";
6671
- const lineTitle = "_lineTitle_15b52_75";
6672
- const lineMeta = "_lineMeta_15b52_107";
6673
- const detail$1 = "_detail_15b52_104";
6674
- const linePrice = "_linePrice_15b52_128";
6675
- const paid$3 = "_paid_15b52_140";
6676
- const was$4 = "_was_15b52_153";
6677
- const card$4 = "_card_15b52_176";
6678
- const cardTitle = "_cardTitle_15b52_184";
6679
- const cardBody = "_cardBody_15b52_196";
6680
- const summaryCard = "_summaryCard_15b52_168";
6681
- const itemsHeader = "_itemsHeader_15b52_14";
6682
- const itemsTitle = "_itemsTitle_15b52_225";
6683
- const itemsCount = "_itemsCount_15b52_236";
6684
- const cardLines = "_cardLines_15b52_255";
6785
+ const lines$1 = "_lines_1lx0d_19";
6786
+ const line$2 = "_line_1lx0d_19";
6787
+ const thumb$2 = "_thumb_1lx0d_34";
6788
+ const image$9 = "_image_1lx0d_44";
6789
+ const placeholder$8 = "_placeholder_1lx0d_51";
6790
+ const lineBody = "_lineBody_1lx0d_56";
6791
+ const lineText = "_lineText_1lx0d_65";
6792
+ const lineTitle = "_lineTitle_1lx0d_75";
6793
+ const lineMeta = "_lineMeta_1lx0d_106";
6794
+ const detail$1 = "_detail_1lx0d_103";
6795
+ const linePrice = "_linePrice_1lx0d_127";
6796
+ const paid$3 = "_paid_1lx0d_139";
6797
+ const was$4 = "_was_1lx0d_152";
6798
+ const card$4 = "_card_1lx0d_175";
6799
+ const cardTitle = "_cardTitle_1lx0d_183";
6800
+ const cardBody = "_cardBody_1lx0d_195";
6801
+ const summaryCard = "_summaryCard_1lx0d_167";
6802
+ const itemsHeader = "_itemsHeader_1lx0d_14";
6803
+ const itemsTitle = "_itemsTitle_1lx0d_238";
6804
+ const itemsCount = "_itemsCount_1lx0d_249";
6805
+ const cardLines = "_cardLines_1lx0d_268";
6685
6806
  const styles$F = {
6686
6807
  lines: lines$1,
6687
6808
  line: line$2,
@@ -7119,17 +7240,17 @@ function ReturnItemRow({ item: item2, className }) {
7119
7240
  })]
7120
7241
  });
7121
7242
  }
7122
- const page$6 = "_page_1fvla_7";
7123
- const titles$2 = "_titles_1fvla_15";
7124
- const title$k = "_title_1fvla_15";
7125
- const subtitle$7 = "_subtitle_1fvla_35";
7126
- const list$2 = "_list_1fvla_43";
7127
- const card$3 = "_card_1fvla_53";
7128
- const checkSlot = "_checkSlot_1fvla_66";
7129
- const check = "_check_1fvla_66";
7130
- const row$6 = "_row_1fvla_110";
7131
- const reason = "_reason_1fvla_117";
7132
- const reasonSet = "_reasonSet_1fvla_137";
7243
+ const page$6 = "_page_15fz5_7";
7244
+ const titles$2 = "_titles_15fz5_15";
7245
+ const title$k = "_title_15fz5_15";
7246
+ const subtitle$7 = "_subtitle_15fz5_35";
7247
+ const list$2 = "_list_15fz5_43";
7248
+ const card$3 = "_card_15fz5_53";
7249
+ const checkSlot = "_checkSlot_15fz5_66";
7250
+ const check = "_check_15fz5_66";
7251
+ const row$6 = "_row_15fz5_110";
7252
+ const reason = "_reason_15fz5_135";
7253
+ const reasonSet = "_reasonSet_15fz5_155";
7133
7254
  const styles$B = {
7134
7255
  page: page$6,
7135
7256
  titles: titles$2,
@@ -7644,22 +7765,22 @@ function ReturnFlowContent({ orderRef, returnRef, onDone, locale }) {
7644
7765
  busy
7645
7766
  });
7646
7767
  }
7647
- const page$3 = "_page_1xl59_8";
7648
- const widget = "_widget_1xl59_18";
7649
- const titleRow = "_titleRow_1xl59_26";
7650
- const headline$1 = "_headline_1xl59_42";
7651
- const track$5 = "_track_1xl59_74";
7652
- const rule$1 = "_rule_1xl59_99";
7653
- const help = "_help_1xl59_109";
7654
- const helpTitle = "_helpTitle_1xl59_115";
7655
- const helpRows = "_helpRows_1xl59_122";
7656
- const helpRowEnd = "_helpRowEnd_1xl59_131";
7657
- const helpStatus = "_helpStatus_1xl59_139";
7658
- const helpRow = "_helpRow_1xl59_122";
7659
- const cancel = "_cancel_1xl59_197";
7660
- const cancelledHead = "_cancelledHead_1xl59_221";
7661
- const cancelledTitle = "_cancelledTitle_1xl59_227";
7662
- const cancelledMeta = "_cancelledMeta_1xl59_241";
7768
+ const page$3 = "_page_1iwin_8";
7769
+ const widget = "_widget_1iwin_18";
7770
+ const titleRow = "_titleRow_1iwin_26";
7771
+ const headline$1 = "_headline_1iwin_42";
7772
+ const track$5 = "_track_1iwin_74";
7773
+ const rule$1 = "_rule_1iwin_99";
7774
+ const help = "_help_1iwin_109";
7775
+ const helpTitle = "_helpTitle_1iwin_115";
7776
+ const helpRows = "_helpRows_1iwin_122";
7777
+ const helpRowEnd = "_helpRowEnd_1iwin_131";
7778
+ const helpStatus = "_helpStatus_1iwin_139";
7779
+ const helpRow = "_helpRow_1iwin_122";
7780
+ const cancel = "_cancel_1iwin_197";
7781
+ const cancelledHead = "_cancelledHead_1iwin_221";
7782
+ const cancelledTitle = "_cancelledTitle_1iwin_227";
7783
+ const cancelledMeta = "_cancelledMeta_1iwin_241";
7663
7784
  const styles$y = {
7664
7785
  page: page$3,
7665
7786
  widget,
@@ -8231,11 +8352,19 @@ function Chevron() {
8231
8352
  });
8232
8353
  }
8233
8354
  function OrderListView(props) {
8355
+ const [opened, setOpened] = useState(null);
8356
+ if (opened !== null) {
8357
+ return jsx(ReturnFlowView, {
8358
+ returnRef: opened,
8359
+ onDone: () => setOpened(null)
8360
+ });
8361
+ }
8234
8362
  return jsx(ShopSurface, {
8235
8363
  tone: "light",
8236
8364
  fill: true,
8237
8365
  children: jsx(OrderListContent, {
8238
- ...props
8366
+ ...props,
8367
+ onOpenReturn: props.onOpenReturn ?? setOpened
8239
8368
  })
8240
8369
  });
8241
8370
  }
@@ -9112,25 +9241,25 @@ function QtyStepper({ qty, max, onChange, onRemove, disabled: disabled2, capDesc
9112
9241
  })]
9113
9242
  });
9114
9243
  }
9115
- const line = "_line_1ritd_6";
9116
- const row$5 = "_row_1ritd_12";
9117
- const pending = "_pending_1ritd_18";
9118
- const labels = "_labels_1ritd_24";
9119
- const lowStock$1 = "_lowStock_1ritd_39";
9120
- const media$1 = "_media_1ritd_49";
9121
- const image$5 = "_image_1ritd_59";
9122
- const placeholder$2 = "_placeholder_1ritd_75";
9123
- const saleBadge = "_saleBadge_1ritd_88";
9124
- const oos$1 = "_oos_1ritd_103";
9125
- const info$2 = "_info_1ritd_116";
9126
- const head = "_head_1ritd_124";
9127
- const meta = "_meta_1ritd_131";
9128
- const title$b = "_title_1ritd_146";
9129
- const details = "_details_1ritd_164";
9130
- const detail = "_detail_1ritd_164";
9131
- const price = "_price_1ritd_183";
9132
- const amount = "_amount_1ritd_191";
9133
- const was = "_was_1ritd_200";
9244
+ const line = "_line_1dx14_6";
9245
+ const row$5 = "_row_1dx14_12";
9246
+ const pending = "_pending_1dx14_18";
9247
+ const labels = "_labels_1dx14_24";
9248
+ const lowStock$1 = "_lowStock_1dx14_39";
9249
+ const media$1 = "_media_1dx14_49";
9250
+ const image$5 = "_image_1dx14_59";
9251
+ const placeholder$2 = "_placeholder_1dx14_75";
9252
+ const saleBadge = "_saleBadge_1dx14_88";
9253
+ const oos$1 = "_oos_1dx14_103";
9254
+ const info$2 = "_info_1dx14_116";
9255
+ const head = "_head_1dx14_124";
9256
+ const meta = "_meta_1dx14_131";
9257
+ const title$b = "_title_1dx14_146";
9258
+ const details = "_details_1dx14_164";
9259
+ const detail = "_detail_1dx14_164";
9260
+ const price = "_price_1dx14_183";
9261
+ const amount = "_amount_1dx14_191";
9262
+ const was = "_was_1dx14_200";
9134
9263
  const styles$m = {
9135
9264
  line,
9136
9265
  row: row$5,
@@ -9315,11 +9444,11 @@ function ShippingInfo() {
9315
9444
  })]
9316
9445
  });
9317
9446
  }
9318
- const bar = "_bar_v20rr_1";
9319
- const floating$1 = "_floating_v20rr_31";
9320
- const divider = "_divider_v20rr_37";
9321
- const info$1 = "_info_v20rr_41";
9322
- const actions = "_actions_v20rr_49";
9447
+ const bar = "_bar_23dkv_1";
9448
+ const floating$1 = "_floating_23dkv_52";
9449
+ const divider = "_divider_23dkv_58";
9450
+ const info$1 = "_info_23dkv_62";
9451
+ const actions = "_actions_23dkv_70";
9323
9452
  const styles$k = {
9324
9453
  bar,
9325
9454
  floating: floating$1,
@@ -9339,14 +9468,14 @@ function StickyCtaBar({ children, info: info2, variant = "floating" }) {
9339
9468
  })]
9340
9469
  });
9341
9470
  }
9342
- const surface = "_surface_15488_15";
9343
- const screen = "_screen_15488_20";
9344
- const body$3 = "_body_15488_12";
9345
- const items = "_items_15488_34";
9346
- const sectionHeader = "_sectionHeader_15488_40";
9347
- const sectionTitle = "_sectionTitle_15488_46";
9348
- const count = "_count_15488_55";
9349
- const lines = "_lines_15488_79";
9471
+ const surface = "_surface_1bdb0_15";
9472
+ const screen = "_screen_1bdb0_20";
9473
+ const body$3 = "_body_1bdb0_12";
9474
+ const items = "_items_1bdb0_34";
9475
+ const sectionHeader = "_sectionHeader_1bdb0_40";
9476
+ const sectionTitle = "_sectionTitle_1bdb0_46";
9477
+ const count = "_count_1bdb0_67";
9478
+ const lines = "_lines_1bdb0_91";
9350
9479
  const styles$j = {
9351
9480
  surface,
9352
9481
  screen,
@@ -9605,14 +9734,14 @@ function CartSheetProvider({ children }) {
9605
9734
  })]
9606
9735
  });
9607
9736
  }
9608
- const gallery = "_gallery_1wmgz_1";
9609
- const track$2 = "_track_1wmgz_5";
9610
- const slide$1 = "_slide_1wmgz_20";
9611
- const image$4 = "_image_1wmgz_27";
9612
- const placeholder$1 = "_placeholder_1wmgz_31";
9613
- const dots$2 = "_dots_1wmgz_49";
9614
- const dot$2 = "_dot_1wmgz_49";
9615
- const dotActive$2 = "_dotActive_1wmgz_100";
9737
+ const gallery = "_gallery_1vbj7_1";
9738
+ const track$2 = "_track_1vbj7_5";
9739
+ const slide$1 = "_slide_1vbj7_20";
9740
+ const image$4 = "_image_1vbj7_27";
9741
+ const placeholder$1 = "_placeholder_1vbj7_31";
9742
+ const dots$2 = "_dots_1vbj7_49";
9743
+ const dot$2 = "_dot_1vbj7_49";
9744
+ const dotActive$2 = "_dotActive_1vbj7_100";
9616
9745
  const styles$i = {
9617
9746
  gallery,
9618
9747
  track: track$2,
@@ -9912,6 +10041,7 @@ const styles$g = {
9912
10041
  function SizeSelector({ sizes, selected: selected2, onSelect, error: error2 = false, lowStock: lowStock2, guide }) {
9913
10042
  const t = useT();
9914
10043
  const [guideOpen, setGuideOpen] = useState(false);
10044
+ const showGuide = useShopFeatures().sizeCharts && guide !== void 0;
9915
10045
  return jsxs("section", {
9916
10046
  className: styles$g.root,
9917
10047
  "aria-labelledby": "size-heading",
@@ -9921,7 +10051,7 @@ function SizeSelector({ sizes, selected: selected2, onSelect, error: error2 = fa
9921
10051
  id: "size-heading",
9922
10052
  className: styles$g.title,
9923
10053
  children: "Size"
9924
- }), guide && jsxs("button", {
10054
+ }), showGuide && jsxs("button", {
9925
10055
  type: "button",
9926
10056
  className: styles$g.sizeGuide,
9927
10057
  onClick: () => setGuideOpen(true),
@@ -9983,7 +10113,7 @@ function SizeSelector({ sizes, selected: selected2, onSelect, error: error2 = fa
9983
10113
  className: styles$g.lowStock,
9984
10114
  role: "status",
9985
10115
  children: lowStock2
9986
- }), guide && guideOpen && jsx(SizeGuideSheet, {
10116
+ }), showGuide && guideOpen && jsx(SizeGuideSheet, {
9987
10117
  guide,
9988
10118
  onClose: () => setGuideOpen(false)
9989
10119
  })]
@@ -10228,14 +10358,14 @@ function formatRemaining(ms) {
10228
10358
  return `${hh}:${mm}:${ss}`;
10229
10359
  }
10230
10360
  function PromoBanner({ promo: promo2 }) {
10231
- const [now, setNow] = useState(null);
10361
+ const [now2, setNow] = useState(null);
10232
10362
  useEffect(() => {
10233
10363
  if (!promo2.ends_at) return;
10234
10364
  setNow(Date.now());
10235
10365
  const id = setInterval(() => setNow(Date.now()), 1e3);
10236
10366
  return () => clearInterval(id);
10237
10367
  }, [promo2.ends_at]);
10238
- const remaining = promo2.ends_at && now !== null ? new Date(promo2.ends_at).getTime() - now : null;
10368
+ const remaining = promo2.ends_at && now2 !== null ? new Date(promo2.ends_at).getTime() - now2 : null;
10239
10369
  const showTimer = remaining !== null && remaining > 0;
10240
10370
  return jsxs("div", {
10241
10371
  className: styles$b.banner,
@@ -10341,6 +10471,7 @@ function ProductDetail({ product, inventory: inventory2, recommendations = [] })
10341
10471
  const [busy, setBusy] = useState(null);
10342
10472
  const [sizeError, setSizeError] = useState(false);
10343
10473
  const [reminded, setReminded] = useState([]);
10474
+ const features = useShopFeatures();
10344
10475
  const [added, setAdded] = useState([]);
10345
10476
  const sizeRef = useRef(null);
10346
10477
  const colourRef = useRef(null);
@@ -10498,12 +10629,16 @@ function ProductDetail({ product, inventory: inventory2, recommendations = [] })
10498
10629
  loading: busy === "add",
10499
10630
  disabled: busy !== null,
10500
10631
  children: busy === "add" ? t("Adding to cart") : inCart ? t("Go to cart") : t("Add to cart")
10501
- }) : jsx(Button, {
10632
+ }) : features.stockAlerts ? jsx(Button, {
10502
10633
  variant: "primary",
10503
10634
  onClick: handleRemind,
10504
10635
  loading: busy === "remind",
10505
10636
  disabled: alerted || busy !== null,
10506
10637
  children: alerted ? t("We'll remind you") : t("Remind me when available")
10638
+ }) : jsx(Button, {
10639
+ variant: "primary",
10640
+ disabled: true,
10641
+ children: t("Out of stock")
10507
10642
  });
10508
10643
  return jsxs(ShopSurface, {
10509
10644
  tone: "light",
@@ -10768,10 +10903,10 @@ function ReviewCarousel({ quotes }) {
10768
10903
  })]
10769
10904
  });
10770
10905
  }
10771
- const section$1 = "_section_6zy7l_1";
10772
- const row$2 = "_row_6zy7l_9";
10773
- const title$4 = "_title_6zy7l_21";
10774
- const body = "_body_6zy7l_44";
10906
+ const section$1 = "_section_1nrsi_1";
10907
+ const row$2 = "_row_1nrsi_9";
10908
+ const title$4 = "_title_1nrsi_20";
10909
+ const body = "_body_1nrsi_43";
10775
10910
  const styles$5 = {
10776
10911
  section: section$1,
10777
10912
  row: row$2,
@@ -10839,12 +10974,12 @@ function ExploreList({ title: title2, links }) {
10839
10974
  })]
10840
10975
  });
10841
10976
  }
10842
- const pcp = "_pcp_yu17f_6";
10843
- const blocks = "_blocks_yu17f_25";
10844
- const featured = "_featured_yu17f_38";
10845
- const gridBlock = "_gridBlock_yu17f_39";
10846
- const blockTitle = "_blockTitle_yu17f_46";
10847
- const grid = "_grid_yu17f_39";
10977
+ const pcp = "_pcp_1kft8_6";
10978
+ const blocks = "_blocks_1kft8_24";
10979
+ const featured = "_featured_1kft8_36";
10980
+ const gridBlock = "_gridBlock_1kft8_37";
10981
+ const blockTitle = "_blockTitle_1kft8_44";
10982
+ const grid = "_grid_1kft8_37";
10848
10983
  const styles$3 = {
10849
10984
  pcp,
10850
10985
  blocks,
@@ -11101,24 +11236,24 @@ function ProductView({ sku, initialData, showRecommendations = true, onNotFound
11101
11236
  })
11102
11237
  });
11103
11238
  }
11104
- const showcase = "_showcase_15pba_14";
11105
- const panel = "_panel_15pba_57";
11106
- const image = "_image_15pba_122";
11107
- const hero = "_hero_15pba_162";
11108
- const heroContent = "_heroContent_15pba_254";
11109
- const heroText = "_heroText_15pba_278";
11110
- const logo = "_logo_15pba_287";
11111
- const heroTitle = "_heroTitle_15pba_307";
11112
- const heroSub = "_heroSub_15pba_331";
11113
- const swipe = "_swipe_15pba_350";
11114
- const swipeLabel = "_swipeLabel_15pba_357";
11115
- const chevron$1 = "_chevron_15pba_363";
11116
- const overlay$1 = "_overlay_15pba_11";
11117
- const copy = "_copy_15pba_398";
11118
- const title$2 = "_title_15pba_403";
11119
- const subtitle$1 = "_subtitle_15pba_410";
11120
- const cta = "_cta_15pba_416";
11121
- const mosaic = "_mosaic_15pba_460";
11239
+ const showcase = "_showcase_9ibf6_14";
11240
+ const panel = "_panel_9ibf6_40";
11241
+ const image = "_image_9ibf6_93";
11242
+ const hero = "_hero_9ibf6_133";
11243
+ const heroContent = "_heroContent_9ibf6_224";
11244
+ const heroText = "_heroText_9ibf6_248";
11245
+ const logo = "_logo_9ibf6_257";
11246
+ const heroTitle = "_heroTitle_9ibf6_277";
11247
+ const heroSub = "_heroSub_9ibf6_301";
11248
+ const swipe = "_swipe_9ibf6_320";
11249
+ const swipeLabel = "_swipeLabel_9ibf6_327";
11250
+ const chevron$1 = "_chevron_9ibf6_333";
11251
+ const overlay$1 = "_overlay_9ibf6_11";
11252
+ const copy = "_copy_9ibf6_368";
11253
+ const title$2 = "_title_9ibf6_373";
11254
+ const subtitle$1 = "_subtitle_9ibf6_380";
11255
+ const cta = "_cta_9ibf6_386";
11256
+ const mosaic = "_mosaic_9ibf6_430";
11122
11257
  const styles$2 = {
11123
11258
  showcase,
11124
11259
  panel,
@@ -11151,10 +11286,21 @@ function useDocumentSnap(ref, enabled = true) {
11151
11286
  const top2 = () => window.scrollTo(0, 0);
11152
11287
  top2();
11153
11288
  const frame2 = typeof window.requestAnimationFrame === "function" ? window.requestAnimationFrame(top2) : null;
11289
+ const release = anchorTop();
11290
+ const history = window.history;
11291
+ const previousRestoration = history && "scrollRestoration" in history ? history.scrollRestoration : null;
11292
+ if (previousRestoration !== null) history.scrollRestoration = "manual";
11293
+ const onPageShow = (event) => {
11294
+ if (event.persisted) top2();
11295
+ };
11296
+ window.addEventListener("pageshow", onPageShow);
11154
11297
  return () => {
11298
+ release();
11155
11299
  if (frame2 !== null && typeof window.cancelAnimationFrame === "function") {
11156
11300
  window.cancelAnimationFrame(frame2);
11157
11301
  }
11302
+ window.removeEventListener("pageshow", onPageShow);
11303
+ if (previousRestoration !== null) history.scrollRestoration = previousRestoration;
11158
11304
  root2.style.scrollSnapType = previousType;
11159
11305
  root2.style.scrollPaddingTop = previousPadding;
11160
11306
  };
@@ -11276,17 +11422,27 @@ function useSlides() {
11276
11422
  }, [shop]);
11277
11423
  return fetched ?? fallback;
11278
11424
  }
11425
+ const RESIZED_BETWEEN_TOOLBARS = /\b(CriOS|FxiOS|EdgiOS|OPiOS|OPT)\b/;
11426
+ function useViewportKind() {
11427
+ const [kind, setKind] = useState(void 0);
11428
+ useEffect(() => {
11429
+ if (RESIZED_BETWEEN_TOOLBARS.test(navigator.userAgent)) setKind("fixed");
11430
+ }, []);
11431
+ return kind;
11432
+ }
11279
11433
  function HomeShowcase() {
11280
11434
  const t = useT();
11281
11435
  const assetUrl = useAssetUrl();
11282
11436
  const panels = useSlides();
11283
11437
  const showcaseRef = useRef(null);
11284
11438
  useDocumentSnap(showcaseRef);
11439
+ const viewport2 = useViewportKind();
11285
11440
  return jsx(ShopSurface, {
11286
11441
  tone: "dark",
11287
11442
  children: jsxs("div", {
11288
11443
  className: styles$2.showcase,
11289
11444
  ref: showcaseRef,
11445
+ "data-viewport": viewport2,
11290
11446
  children: [jsxs("section", {
11291
11447
  className: `${styles$2.panel} ${styles$2.hero}`,
11292
11448
  "aria-label": t("DAZN Shop"),
@@ -11797,6 +11953,102 @@ function ShopMenuSheet({ open, onClose, onManageOrders, onHelp, closeLabel, labe
11797
11953
  })]
11798
11954
  });
11799
11955
  }
11956
+ function major(money2) {
11957
+ return money2.amount / 100;
11958
+ }
11959
+ function toGa4Event(event) {
11960
+ switch (event.type) {
11961
+ case "product_viewed":
11962
+ return {
11963
+ name: "view_item",
11964
+ params: {
11965
+ items: [{
11966
+ item_id: event.sku
11967
+ }]
11968
+ }
11969
+ };
11970
+ case "add_to_cart":
11971
+ return {
11972
+ name: "add_to_cart",
11973
+ params: {
11974
+ items: [{
11975
+ item_id: event.sku,
11976
+ quantity: event.qty,
11977
+ ...event.title ? {
11978
+ item_name: event.title
11979
+ } : {},
11980
+ ...event.attributes?.colour ? {
11981
+ item_variant: event.attributes.colour
11982
+ } : {},
11983
+ ...event.size ? {
11984
+ item_category: event.size
11985
+ } : {}
11986
+ }]
11987
+ }
11988
+ };
11989
+ case "remove_from_cart":
11990
+ return {
11991
+ name: "remove_from_cart",
11992
+ params: {
11993
+ items: [{
11994
+ item_id: event.sku,
11995
+ quantity: event.qty
11996
+ }]
11997
+ }
11998
+ };
11999
+ case "cart_updated":
12000
+ return {
12001
+ name: "view_cart",
12002
+ params: {
12003
+ currency: event.subtotal.currency,
12004
+ value: major(event.subtotal),
12005
+ items: []
12006
+ }
12007
+ };
12008
+ case "checkout_handoff":
12009
+ return {
12010
+ name: "begin_checkout",
12011
+ params: {
12012
+ checkout_id: event.cartId
12013
+ }
12014
+ };
12015
+ case "stock_alert_requested":
12016
+ return {
12017
+ name: "join_group",
12018
+ params: {
12019
+ group_id: `back_in_stock:${event.sku}`
12020
+ }
12021
+ };
12022
+ case "return_requested":
12023
+ return {
12024
+ name: "refund",
12025
+ params: {
12026
+ transaction_id: event.orderRef,
12027
+ items: []
12028
+ }
12029
+ };
12030
+ case "error":
12031
+ return {
12032
+ name: "exception",
12033
+ params: {
12034
+ description: `${event.scope}:${event.code ?? "unknown"}`,
12035
+ fatal: false
12036
+ }
12037
+ };
12038
+ case "ready":
12039
+ case "navigate":
12040
+ case "support_requested":
12041
+ case "order_cancellation_requested":
12042
+ case "reorder_requested":
12043
+ case "session_required":
12044
+ case "session_expired":
12045
+ case "notification":
12046
+ return null;
12047
+ default: {
12048
+ return null;
12049
+ }
12050
+ }
12051
+ }
11800
12052
  export {
11801
12053
  Badge,
11802
12054
  BottomSheet,
@@ -11879,6 +12131,7 @@ export {
11879
12131
  resolveSku,
11880
12132
  sizeOptions,
11881
12133
  swatchColour,
12134
+ toGa4Event,
11882
12135
  treatmentFor,
11883
12136
  useAssetUrl,
11884
12137
  useCartCount,