@kachingappz/bundles-js 1.2.0 → 1.2.1

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.
@@ -23,29 +23,33 @@ var e = /* @__PURE__ */ function(e) {
23
23
  ...e,
24
24
  variants: n,
25
25
  options: r,
26
- selectedVariantId: i
26
+ selectedVariantId: i,
27
+ availableForSale: n.some((e) => e.availableForSale)
27
28
  };
28
- }, o = (e, t) => s(e) ? c(e, t, l(e)) : t, s = (e) => !!e.selectedVariants?.length, c = (e, t, n) => t.flatMap((t) => {
29
+ }, o = (e, t) => c(e) ? l(e, t, /* @__PURE__ */ new Set()) : t, s = (e, t) => c(e) ? l(e, t, u(e)) : t, c = (e) => !!e.selectedVariants?.length, l = (e, t, n) => t.flatMap((t) => {
29
30
  let r = i(e, t);
30
31
  if (!r) return [t];
31
32
  let o = a(t, [...r, ...t.variants.map((e) => e.id).filter((e) => n.has(e))]);
32
33
  return o.variants.length ? [o] : [];
33
- }), l = (e) => new Set([
34
- ...e.dealBars.flatMap(u),
34
+ }), u = (e) => new Set([
35
+ ...e.dealBars.flatMap(d),
35
36
  ...(e.progressiveGifts?.gifts ?? []).flatMap((e) => e.variantGIDs ?? []),
36
37
  ...(e.checkboxUpsells?.upsells ?? []).flatMap((e) => e.variantGIDs ?? [])
37
- ].map(f)), u = (e) => [
38
+ ].map(p)), d = (e) => [
38
39
  ...e.freeGifts.flatMap((e) => e.variantGIDs ?? []),
39
40
  ...e.upsells.flatMap((e) => e.variantGIDs ?? []),
40
41
  ...(e.multipleGiftsSelectors ?? []).flatMap((e) => e.products.flatMap((e) => e.variantGIDs ?? [])),
41
- ...d(e)
42
- ], d = (t) => {
42
+ ...f(e)
43
+ ], f = (t) => {
43
44
  switch (t.dealBarType) {
44
45
  case e.Bundle: return t.bundleProducts.flatMap((e) => e.productGID === "default" ? [] : e.variantGIDs ?? []);
45
46
  case e.MixAndMatch: return t.bundleProducts.flatMap((e) => [...e.productGID === "default" ? [] : e.variantGIDs ?? [], ...(e.selectedProducts ?? []).flatMap((e) => e.variantGIDs ?? [])]);
46
47
  default: return [];
47
48
  }
48
- }, f = (e) => Number(e.split("/").pop()), p = (e, n, i) => {
49
+ }, p = (e) => Number(e.split("/").pop()), m = (e, t) => t ? e : e.map(h), h = (e) => {
50
+ let t = { ...e };
51
+ return delete t.selectedVariants, t;
52
+ }, g = (e, n, i) => {
49
53
  let a = (e) => i !== void 0 && r(e, n.id, i), o = e.filter((e) => t(e, n.id)?.some((e) => n.variants.some((t) => t.id === e))), s = o.filter(a), c = [...s], l = o.filter((e) => !s.includes(e)), u = e.filter((e) => e.blockVisibility === "selected-products");
50
54
  for (let e of u) e.selectedProductIds.map(Number).includes(n.id) && c.push(e);
51
55
  let d = e.filter((e) => e.blockVisibility === "selected-collections");
@@ -55,24 +59,24 @@ var e = /* @__PURE__ */ function(e) {
55
59
  let p = e.filter((e) => e.blockVisibility === "all-products");
56
60
  for (let e of p) c.push(e);
57
61
  return i === void 0 ? c : [...c, ...l];
58
- }, m = (e, { language: t, country: n }) => {
59
- let r = v(t, n), i = new Intl.NumberFormat(r, {
62
+ }, _ = (e, { language: t, country: n }) => {
63
+ let r = x(t, n), i = new Intl.NumberFormat(r, {
60
64
  style: "currency",
61
65
  currency: e,
62
66
  currencyDisplay: "narrowSymbol"
63
- }).formatToParts(1234567.89), a = i.find((e) => e.type === "decimal")?.value, o = b(y(i.find((e) => e.type === "group")?.value), a, i.some((e) => e.type === "fraction")), s = i.findIndex(_), c = i.findLastIndex(_);
67
+ }).formatToParts(1234567.89), a = i.find((e) => e.type === "decimal")?.value, o = C(S(i.find((e) => e.type === "group")?.value), a, i.some((e) => e.type === "fraction")), s = i.findIndex(b), c = i.findLastIndex(b);
64
68
  return [
65
- ...i.slice(0, s).map(h),
69
+ ...i.slice(0, s).map(v),
66
70
  o,
67
- ...i.slice(c + 1).map(h)
71
+ ...i.slice(c + 1).map(v)
68
72
  ].join("");
69
- }, h = (e) => g(e.value), g = (e) => e.replace(/\s/g, " "), _ = (e) => e.type === "integer" || e.type === "group" || e.type === "decimal" || e.type === "fraction", v = (e, t) => e && t ? `${e}-${t.toUpperCase()}` : e || (t ? t.toUpperCase() : "en"), y = (e) => e === void 0 ? void 0 : g(e).replace(/’/g, "'"), b = (e, t, n) => t === "," && e === "." ? n ? "{{amount_with_comma_separator}}" : "{{amount_no_decimals_with_comma_separator}}" : t === "," && e === " " ? n ? "{{amount_with_space_separator}}" : "{{amount_no_decimals_with_space_separator}}" : t === "." && e === " " ? "{{amount_with_period_and_space_separator}}" : t === "." && e === "'" ? "{{amount_with_apostrophe_separator}}" : n ? "{{amount}}" : "{{amount_no_decimals}}", x = ({ country: e, language: t }) => {
73
+ }, v = (e) => y(e.value), y = (e) => e.replace(/\s/g, " "), b = (e) => e.type === "integer" || e.type === "group" || e.type === "decimal" || e.type === "fraction", x = (e, t) => e && t ? `${e}-${t.toUpperCase()}` : e || (t ? t.toUpperCase() : "en"), S = (e) => e === void 0 ? void 0 : y(e).replace(/’/g, "'"), C = (e, t, n) => t === "," && e === "." ? n ? "{{amount_with_comma_separator}}" : "{{amount_no_decimals_with_comma_separator}}" : t === "," && e === " " ? n ? "{{amount_with_space_separator}}" : "{{amount_no_decimals_with_space_separator}}" : t === "." && e === " " ? "{{amount_with_period_and_space_separator}}" : t === "." && e === "'" ? "{{amount_with_apostrophe_separator}}" : n ? "{{amount}}" : "{{amount_no_decimals}}", w = ({ country: e, language: t }) => {
70
74
  let n = [];
71
75
  return e && n.push(`country: ${e}`), t && n.push(`language: ${t}`), n.length > 0 ? `@inContext(${n.join(", ")})` : "";
72
- }, S = async (e, { useExternalMetafieldNamespace: t, useMetaobjects: n }) => n ? w(e, t) : C(e, t), C = async (e, t) => {
76
+ }, T = async (e, { useExternalMetafieldNamespace: t, useMetaobjects: n }) => n ? D(e, t) : E(e, t), E = async (e, t) => {
73
77
  let n = (await e.query("\n query FetchDealBlocks($metafieldNamespace: String!) {\n shop {\n metafield(namespace: $metafieldNamespace, key: \"deal_blocks\") {\n value\n }\n }\n }\n ", { variables: { metafieldNamespace: t ? "app--2935586817--kaching_bundles" : "$app:kaching_bundles" } })).shop.metafield?.value;
74
78
  return n ? JSON.parse(n) : [];
75
- }, w = async (e, t) => {
79
+ }, D = async (e, t) => {
76
80
  let n = t ? "app--2935586817--deal_block" : "$app:deal_block", r = [], i = null;
77
81
  for (;;) {
78
82
  let t = await e.query("\n query FetchDealBlockMetaobjects($type: String!, $cursor: String) {\n metaobjects(type: $type, first: 250, after: $cursor) {\n nodes {\n fields {\n key\n value\n }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n ", { variables: {
@@ -101,14 +105,14 @@ var e = /* @__PURE__ */ function(e) {
101
105
  "badgeText",
102
106
  "error"
103
107
  ].map((e) => `brand_${e}`);
104
- var T = /* @__PURE__ */ function(e) {
108
+ var O = /* @__PURE__ */ function(e) {
105
109
  return e.QuantityBreak = "quantity-break", e.Bxgy = "bxgy", e.Bundle = "bundle", e.MixAndMatch = "mix-and-match", e.Sku = "sku", e;
106
- }({}), E = async (e, { country: t, language: n, blockVisibility: r, excludedProductGIDs: i, selectedProductGIDs: a, selectedCollectionGIDs: o, limit: s = 1e3 }) => {
110
+ }({}), k = async (e, { country: t, language: n, blockVisibility: r, excludedProductGIDs: i, selectedProductGIDs: a, selectedCollectionGIDs: o, limit: s = 1e3 }) => {
107
111
  switch (r) {
108
112
  case "selected-products": return a.slice(0, s);
109
113
  case "all-products":
110
114
  case "excluded-products": {
111
- let a = x({
115
+ let a = w({
112
116
  country: t,
113
117
  language: n
114
118
  }), o = [], c = null;
@@ -139,7 +143,7 @@ var T = /* @__PURE__ */ function(e) {
139
143
  return o;
140
144
  }
141
145
  case "selected-collections": {
142
- let r = x({
146
+ let r = w({
143
147
  country: t,
144
148
  language: n
145
149
  }), i = (await e.query(`
@@ -161,12 +165,12 @@ var T = /* @__PURE__ */ function(e) {
161
165
  return Array.from(new Set(i)).slice(0, s);
162
166
  }
163
167
  }
164
- }, D = "\n id\n availableForSale\n price {\n amount\n }\n compareAtPrice {\n amount\n }\n selectedOptions {\n name\n value\n }\n image {\n id\n url(transform: $variantImageTransform)\n }\n unitPriceMeasurement {\n quantityUnit\n quantityValue\n referenceUnit\n referenceValue\n }\n requiresComponents\n sellingPlanAllocations(first: 100) @include(if: $includeSellingPlans) {\n nodes {\n sellingPlan {\n id\n }\n priceAdjustments {\n price {\n amount\n }\n compareAtPrice {\n amount\n }\n perDeliveryPrice {\n amount\n }\n }\n }\n }\n quantityAvailable @include(if: $includeAvailableQuantity)\n", O = async (e, { country: t, language: n, productIds: r, includeSellingPlans: i = !0, includeAvailableQuantity: a = !0, includeProductRating: o = !1, includeProductSubtitle: s = !1, includeProductTabFields: c = !1, productSubtitleMetafield: l = "descriptors.subtitle", useExternalMetafieldNamespace: u = !1, batchSize: d = 250, onBatchError: f, variantImageTransform: p = {
168
+ }, A = "\n id\n availableForSale\n price {\n amount\n }\n compareAtPrice {\n amount\n }\n selectedOptions {\n name\n value\n }\n image {\n id\n url(transform: $variantImageTransform)\n }\n unitPriceMeasurement {\n quantityUnit\n quantityValue\n referenceUnit\n referenceValue\n }\n requiresComponents\n sellingPlanAllocations(first: 100) @include(if: $includeSellingPlans) {\n nodes {\n sellingPlan {\n id\n }\n priceAdjustments {\n price {\n amount\n }\n compareAtPrice {\n amount\n }\n perDeliveryPrice {\n amount\n }\n }\n }\n }\n quantityAvailable @include(if: $includeAvailableQuantity)\n", j = async (e, { country: t, language: n, productIds: r, includeSellingPlans: i = !0, includeAvailableQuantity: a = !0, includeProductRating: o = !1, includeProductSubtitle: s = !1, includeProductTabFields: c = !1, productSubtitleMetafield: l = "descriptors.subtitle", useExternalMetafieldNamespace: u = !1, batchSize: d = 250, onBatchError: f, variantImageTransform: p = {
165
169
  maxWidth: 200,
166
170
  maxHeight: 200
167
171
  } }) => {
168
172
  if (!r.length) return [];
169
- let m = r.map((e) => typeof e == "string" && e.startsWith("gid://") ? e : `gid://shopify/Product/${e}`), h = x({
173
+ let m = r.map((e) => typeof e == "string" && e.startsWith("gid://") ? e : `gid://shopify/Product/${e}`), h = w({
170
174
  country: t,
171
175
  language: n
172
176
  }), g = `
@@ -204,7 +208,7 @@ var T = /* @__PURE__ */ function(e) {
204
208
  }
205
209
  variants(first: 250) {
206
210
  nodes {
207
- ${D}
211
+ ${A}
208
212
  }
209
213
  }
210
214
  collections(first: 50) {
@@ -270,9 +274,9 @@ var T = /* @__PURE__ */ function(e) {
270
274
  }
271
275
  }
272
276
  }
273
- `, _ = u ? "app--2935586817--kaching_bundles" : "$app:kaching_bundles", v = l.indexOf("."), y = l.slice(0, v), b = l.slice(v + 1), S = [], C = Math.min(d, 250);
274
- for (let e = 0; e < m.length; e += C) S.push(m.slice(e, e + C));
275
- let w = 1, T = async (n) => {
277
+ `, _ = u ? "app--2935586817--kaching_bundles" : "$app:kaching_bundles", v = l.indexOf("."), y = l.slice(0, v), b = l.slice(v + 1), x = [], S = Math.min(d, 250);
278
+ for (let e = 0; e < m.length; e += S) x.push(m.slice(e, e + S));
279
+ let C = 1, T = async (n) => {
276
280
  let [r, l] = await Promise.all([e.query(g, { variables: {
277
281
  productGIDs: n,
278
282
  includeSellingPlans: i,
@@ -285,35 +289,35 @@ var T = /* @__PURE__ */ function(e) {
285
289
  metafieldNamespace: _,
286
290
  variantImageTransform: p
287
291
  } }), c ? ee(e, t, n) : null]);
288
- return r.shop.currencyRateConstant && (w = JSON.parse(r.shop.currencyRateConstant.value).amount / 1e6), l ? { nodes: r.nodes.map((e) => e && {
292
+ return r.shop.currencyRateConstant && (C = JSON.parse(r.shop.currencyRateConstant.value).amount / 1e6), l ? { nodes: r.nodes.map((e) => e && {
289
293
  ...e,
290
294
  productType: l.get(e.id)
291
295
  }) } : r;
292
296
  }, E;
293
297
  if (f) {
294
- let e = await Promise.allSettled(S.map(T));
298
+ let e = await Promise.allSettled(x.map(T));
295
299
  for (let t of e) t.status === "rejected" && f(t.reason instanceof Error ? t.reason : Error(String(t.reason)));
296
300
  E = e.filter((e) => e.status === "fulfilled").flatMap((e) => e.value.nodes);
297
- } else E = (await Promise.all(S.map(T))).flatMap((e) => e.nodes);
298
- let O = E.filter((e) => e != null);
301
+ } else E = (await Promise.all(x.map(T))).flatMap((e) => e.nodes);
302
+ let D = E.filter((e) => e != null);
299
303
  if (f) {
300
- let t = await Promise.allSettled(O.map(async (t) => A(await k(e, t, {
304
+ let t = await Promise.allSettled(D.map(async (t) => N(await M(e, t, {
301
305
  includeSellingPlans: i,
302
306
  includeAvailableQuantity: a,
303
307
  variantImageTransform: p
304
- }, h), e.shopifyDomain, w))), n = [];
308
+ }, h), e.shopifyDomain, C))), n = [];
305
309
  for (let e of t) e.status === "fulfilled" ? n.push(e.value) : f(e.reason instanceof Error ? e.reason : Error(String(e.reason)));
306
310
  return n;
307
311
  }
308
- return (await Promise.all(O.map((t) => k(e, t, {
312
+ return (await Promise.all(D.map((t) => M(e, t, {
309
313
  includeSellingPlans: i,
310
314
  includeAvailableQuantity: a,
311
315
  variantImageTransform: p
312
- }, h)))).map((t) => A(t, e.shopifyDomain, w));
316
+ }, h)))).map((t) => N(t, e.shopifyDomain, C));
313
317
  }, ee = async (e, t, n) => {
314
318
  try {
315
319
  let r = await e.query(`
316
- query FetchProductTypes($productGIDs: [ID!]!) ${x({ country: t })} {
320
+ query FetchProductTypes($productGIDs: [ID!]!) ${w({ country: t })} {
317
321
  nodes(ids: $productGIDs) {
318
322
  ... on Product {
319
323
  id
@@ -326,7 +330,7 @@ var T = /* @__PURE__ */ function(e) {
326
330
  } catch (e) {
327
331
  return console.error(e), null;
328
332
  }
329
- }, k = async (e, t, n, r = "") => {
333
+ }, M = async (e, t, n, r = "") => {
330
334
  if (t.variants.nodes.length < 250) return t;
331
335
  let i = /* @__PURE__ */ new Set(), a = [], o = [], s = async (s) => {
332
336
  let c = !0, l = null;
@@ -336,7 +340,7 @@ var T = /* @__PURE__ */ function(e) {
336
340
  product(id: $productGID) {
337
341
  variants(first: 250, after: $cursor, reverse: $reverse) {
338
342
  nodes {
339
- ${D}
343
+ ${A}
340
344
  }
341
345
  pageInfo {
342
346
  endCursor
@@ -362,7 +366,7 @@ var T = /* @__PURE__ */ function(e) {
362
366
  }
363
367
  };
364
368
  return await Promise.all([s(!1), s(!0)]), t.variants.nodes = [...a, ...o.reverse()], t;
365
- }, A = (e, t, n) => {
369
+ }, N = (e, t, n) => {
366
370
  let r = e.variants.nodes.map(({ unitPriceMeasurement: e, ...t }) => ({
367
371
  id: Number(t.id.split("/").pop()),
368
372
  availableForSale: t.availableForSale,
@@ -470,8 +474,8 @@ var T = /* @__PURE__ */ function(e) {
470
474
  } catch {
471
475
  return null;
472
476
  }
473
- }, re = (e, t, n) => e.filter((e) => n.filter((n) => n.options[t] === e.name).length > 0), j = "app--2935586817", ie = async (e, { language: t, country: n, useExternalMetafieldNamespace: r }) => {
474
- let i = r ? `${j}--kaching_bundles` : "$app:kaching_bundles", a = r ? j : "$app", o = x({ country: n }), { localization: { country: { currency: { isoCode: s } } }, shop: { moneyFormat: c, paymentSettings: { currencyCode: l }, currencyRateConstant: u, primaryDomain: d, settingsMetafield: f } } = await e.query(`
477
+ }, re = (e, t, n) => e.filter((e) => n.filter((n) => n.options[t] === e.name).length > 0), P = "app--2935586817", ie = async (e, { language: t, country: n, useExternalMetafieldNamespace: r }) => {
478
+ let i = r ? `${P}--kaching_bundles` : "$app:kaching_bundles", a = r ? P : "$app", o = w({ country: n }), { localization: { country: { currency: { isoCode: s } } }, shop: { moneyFormat: c, paymentSettings: { currencyCode: l }, currencyRateConstant: u, primaryDomain: d, settingsMetafield: f } } = await e.query(`
475
479
  query config($metafieldNamespace: String!, $settingsNamespace: String!) ${o} {
476
480
  localization {
477
481
  country {
@@ -499,29 +503,29 @@ var T = /* @__PURE__ */ function(e) {
499
503
  `, { variables: {
500
504
  metafieldNamespace: i,
501
505
  settingsNamespace: a
502
- } }), p = s === l ? c : m(s, {
506
+ } }), p = s === l ? c : _(s, {
503
507
  language: t,
504
508
  country: n
505
- }), h = u ? ae(u.value) : 1, g = f ? JSON.parse(f.value) : null, _ = g?.feature_flags ?? {}, v = g?.custom_selectors ?? {};
509
+ }), m = u ? ae(u.value) : 1, h = f ? JSON.parse(f.value) : null, g = h?.feature_flags ?? {}, v = h?.custom_selectors ?? {};
506
510
  return {
507
511
  shopifyDomain: d.host,
508
512
  moneyFormat: p,
509
513
  locale: t?.toLowerCase() || "en",
510
514
  liquidLocale: t?.toLowerCase() || "en",
511
515
  country: n ?? "US",
512
- currencyRate: h,
516
+ currencyRate: m,
513
517
  marketId: 0,
514
518
  productId: null,
515
- storefrontAccessToken: g?.storefront_access_token ?? null,
516
- includeSellingPlans: g?.include_selling_plans ?? !1,
517
- includeAvailableQuantity: g?.include_available_quantity ?? !1,
518
- customApiHost: g?.custom_api_host ?? null,
519
- keepQuantityInput: g?.keep_quantity_input ?? !1,
520
- ignoreDeselect: g?.ignore_deselect ?? !1,
521
- ignoreUnitPrice: g?.ignore_unit_price ?? !1,
522
- requireCustomerLogin: g?.require_customer_login ?? !1,
523
- abTestsRunning: g?.ab_tests_running ?? !1,
524
- webPixel: g?.web_pixel ?? !1,
519
+ storefrontAccessToken: h?.storefront_access_token ?? null,
520
+ includeSellingPlans: h?.include_selling_plans ?? !1,
521
+ includeAvailableQuantity: h?.include_available_quantity ?? !1,
522
+ customApiHost: h?.custom_api_host ?? null,
523
+ keepQuantityInput: h?.keep_quantity_input ?? !1,
524
+ ignoreDeselect: h?.ignore_deselect ?? !1,
525
+ ignoreUnitPrice: h?.ignore_unit_price ?? !1,
526
+ requireCustomerLogin: h?.require_customer_login ?? !1,
527
+ abTestsRunning: h?.ab_tests_running ?? !1,
528
+ webPixel: h?.web_pixel ?? !1,
525
529
  b2bCustomer: !1,
526
530
  isLoggedIn: !1,
527
531
  preview: !1,
@@ -559,9 +563,9 @@ var T = /* @__PURE__ */ function(e) {
559
563
  price: v.price ?? null,
560
564
  priceCompare: v.price_compare ?? null
561
565
  },
562
- shopCustomStyles: g?.shop_custom_styles ?? "",
563
- featureFlags: _,
564
- brandColors: g?.brand_colors ?? null
566
+ shopCustomStyles: h?.shop_custom_styles ?? "",
567
+ featureFlags: g,
568
+ brandColors: h?.brand_colors ?? null
565
569
  };
566
570
  }, ae = (e) => JSON.parse(e).amount / 1e6, oe = async (e, t, n = 200) => {
567
571
  let r = [...new Set(t.filter(Boolean).filter((e) => !e.startsWith("placeholder")))];
@@ -576,9 +580,9 @@ var T = /* @__PURE__ */ function(e) {
576
580
  url: e.image.url
577
581
  }] : []);
578
582
  }, se = 100, ce = async (e, { dealBlock: t, country: n, language: r }) => {
579
- let i = [...new Set(t.dealBars.flatMap((e) => e.dealBarType === T.MixAndMatch ? e.bundleProducts : []).flatMap((e) => (e.selectedCollections ?? []).map((e) => e.id)))];
583
+ let i = [...new Set(t.dealBars.flatMap((e) => e.dealBarType === O.MixAndMatch ? e.bundleProducts : []).flatMap((e) => (e.selectedCollections ?? []).map((e) => e.id)))];
580
584
  if (i.length === 0) return [];
581
- let a = x({
585
+ let a = w({
582
586
  country: n,
583
587
  language: r
584
588
  }), o = await e.query(`
@@ -607,46 +611,46 @@ var T = /* @__PURE__ */ function(e) {
607
611
  ...fe(e),
608
612
  ...pe(e),
609
613
  ...me(e),
610
- ...M(e),
611
- ...N(e),
612
- ...P(e),
613
614
  ...F(e),
614
615
  ...I(e),
615
616
  ...L(e),
616
617
  ...R(e),
617
- ...z(e)
618
- ].filter((e) => e != null && !e.includes("placeholder")), ue = (e) => e.dealBars.flatMap((e) => [e.mediaImageGID, e.badgeImageGID]).filter((e) => e != null), de = (e) => e.dealBars.flatMap((e) => e.dealBarType === T.Bundle ? e.bundleProducts.map((e) => e.mediaImageGID) : []).filter((e) => e != null), fe = (e) => e.dealBars.map(({ freeGifts: e }) => (e || []).map((e) => e.mediaImageGID)).reduce((e, t) => e.concat(t), []).filter((e) => e != null), pe = (e) => e.dealBars.flatMap(({ multipleGiftsSelectors: e }) => (e || []).map((e) => e.mediaImageGID)).filter((e) => e != null), me = (e) => e.dealBars.map(({ upsells: e }) => (e || []).map((e) => e.mediaImageGID)).reduce((e, t) => e.concat(t), []).filter((e) => e != null), M = (e) => e.swatchOptions ? e.swatchOptions.reduce((e, t) => {
618
+ ...z(e),
619
+ ...he(e),
620
+ ...ge(e),
621
+ ..._e(e)
622
+ ].filter((e) => e != null && !e.includes("placeholder")), ue = (e) => e.dealBars.flatMap((e) => [e.mediaImageGID, e.badgeImageGID]).filter((e) => e != null), de = (e) => e.dealBars.flatMap((e) => e.dealBarType === O.Bundle ? e.bundleProducts.map((e) => e.mediaImageGID) : []).filter((e) => e != null), fe = (e) => e.dealBars.map(({ freeGifts: e }) => (e || []).map((e) => e.mediaImageGID)).reduce((e, t) => e.concat(t), []).filter((e) => e != null), pe = (e) => e.dealBars.flatMap(({ multipleGiftsSelectors: e }) => (e || []).map((e) => e.mediaImageGID)).filter((e) => e != null), me = (e) => e.dealBars.map(({ upsells: e }) => (e || []).map((e) => e.mediaImageGID)).reduce((e, t) => e.concat(t), []).filter((e) => e != null), F = (e) => e.swatchOptions ? e.swatchOptions.reduce((e, t) => {
619
623
  let n = t.images.map((e) => e.mediaImageGID).filter((e) => e != null);
620
624
  return [...e, ...n];
621
- }, []) : [], N = (e) => {
625
+ }, []) : [], I = (e) => {
622
626
  if (!e.collectionBreaksEnabled || !e.collectionBreaks) return [];
623
627
  let t = e.collectionBreaks.mediaImageGID;
624
628
  return t ? [t] : [];
625
- }, P = (e) => e.progressiveGifts ? [
629
+ }, L = (e) => e.progressiveGifts ? [
626
630
  ...e.progressiveGifts.gifts?.map((e) => e.mediaImageGID) || [],
627
631
  e.progressiveGifts.style?.lockedMediaImageGID,
628
632
  e.progressiveGifts.dealBarStyle?.lockedMediaImageGID
629
- ].filter((e) => e != null) : [], F = (e) => !e.checkboxUpsellsEnabled || !e.checkboxUpsells ? [] : e.checkboxUpsells.upsells.flatMap((e) => [e.mediaImageGID, e.badgeImageGID]).filter((e) => e != null), I = (e) => e.dealBars.map((e) => e.productPersonalisation?.mediaImageGID).filter((e) => e != null), L = (e) => {
633
+ ].filter((e) => e != null) : [], R = (e) => !e.checkboxUpsellsEnabled || !e.checkboxUpsells ? [] : e.checkboxUpsells.upsells.flatMap((e) => [e.mediaImageGID, e.badgeImageGID]).filter((e) => e != null), z = (e) => e.dealBars.map((e) => e.productPersonalisation?.mediaImageGID).filter((e) => e != null), he = (e) => {
630
634
  let t = e.dealBars.map((e) => e.highlights?.customIconGID).filter((e) => e != null), n = e.subscriptions?.highlights?.customIconGID;
631
635
  return n ? [...t, n] : t;
632
- }, R = (e) => (e.badges || []).flatMap((e) => e.badgeType === "custom" && e.imageGID ? [e.imageGID] : []), z = (e) => !e.savingsSummaryEnabled || !e.savingsSummary ? [] : e.savingsSummary.customIconGID ? [e.savingsSummary.customIconGID] : [], he = (e, { includeMixAndMatchSwapProducts: t = !0 } = {}) => {
636
+ }, ge = (e) => (e.badges || []).flatMap((e) => e.badgeType === "custom" && e.imageGID ? [e.imageGID] : []), _e = (e) => !e.savingsSummaryEnabled || !e.savingsSummary ? [] : e.savingsSummary.customIconGID ? [e.savingsSummary.customIconGID] : [], ve = (e, { includeMixAndMatchSwapProducts: t = !0 } = {}) => {
633
637
  let n = [
634
- ...ge(e),
635
- ..._e(e),
636
- ...ve(e),
637
638
  ...ye(e),
638
639
  ...be(e),
639
- ...xe(e, t),
640
+ ...xe(e),
640
641
  ...Se(e),
641
- ...Ce(e)
642
+ ...Ce(e),
643
+ ...we(e, t),
644
+ ...Te(e),
645
+ ...Ee(e)
642
646
  ];
643
647
  return Array.from(new Set(n.filter((e) => e != null)));
644
- }, ge = (e) => e.dealBars.flatMap(({ freeGifts: e }) => e ? e.map((e) => e.productGID) : []).filter((e) => e != null), _e = (e) => e.dealBars.flatMap(({ multipleGiftsSelectors: e }) => e ? e.flatMap((e) => e.products ? e.products.map((e) => e.id) : []) : []).filter((e) => e != null), ve = (e) => e.progressiveGiftsEnabled && e.progressiveGifts?.gifts.map((e) => e.productGID).filter((e) => e != null) || [], ye = (e) => e.dealBars.flatMap(({ upsells: e }) => e ? e.map((e) => e.productGID) : []).filter((e) => e != null), be = (e) => e.dealBars.filter((e) => e.dealBarType === T.Bundle).flatMap(({ bundleProducts: e }) => e ? e.map((e) => e.productGID) : []).filter((e) => e != null).filter((e) => e !== "default"), xe = (e, t) => e.dealBars.filter((e) => e.dealBarType === T.MixAndMatch).flatMap(({ bundleProducts: e }) => e ? e.flatMap((e) => [e.productGID, ...t ? e.selectedProducts?.map((e) => e.id) ?? [] : []]) : []).filter((e) => e != null).filter((e) => e !== "default"), Se = (e) => !e.checkboxUpsellsEnabled || !e.checkboxUpsells ? [] : e.checkboxUpsells.upsells.map((e) => e.productGID).filter((e) => e != null), Ce = (e) => e.dealBars.filter((e) => e.dealBarType === T.Sku).flatMap(({ productGID: e }) => e ? [e] : []), B = class extends Error {
648
+ }, ye = (e) => e.dealBars.flatMap(({ freeGifts: e }) => e ? e.map((e) => e.productGID) : []).filter((e) => e != null), be = (e) => e.dealBars.flatMap(({ multipleGiftsSelectors: e }) => e ? e.flatMap((e) => e.products ? e.products.map((e) => e.id) : []) : []).filter((e) => e != null), xe = (e) => e.progressiveGiftsEnabled && e.progressiveGifts?.gifts.map((e) => e.productGID).filter((e) => e != null) || [], Se = (e) => e.dealBars.flatMap(({ upsells: e }) => e ? e.map((e) => e.productGID) : []).filter((e) => e != null), Ce = (e) => e.dealBars.filter((e) => e.dealBarType === O.Bundle).flatMap(({ bundleProducts: e }) => e ? e.map((e) => e.productGID) : []).filter((e) => e != null).filter((e) => e !== "default"), we = (e, t) => e.dealBars.filter((e) => e.dealBarType === O.MixAndMatch).flatMap(({ bundleProducts: e }) => e ? e.flatMap((e) => [e.productGID, ...t ? e.selectedProducts?.map((e) => e.id) ?? [] : []]) : []).filter((e) => e != null).filter((e) => e !== "default"), Te = (e) => !e.checkboxUpsellsEnabled || !e.checkboxUpsells ? [] : e.checkboxUpsells.upsells.map((e) => e.productGID).filter((e) => e != null), Ee = (e) => e.dealBars.filter((e) => e.dealBarType === O.Sku).flatMap(({ productGID: e }) => e ? [e] : []), B = class extends Error {
645
649
  constructor({ status: e, operationName: t, graphqlErrors: n }) {
646
650
  let r = n.length ? `: ${n.join("; ")}` : "";
647
651
  super(`Storefront API ${t ?? "query"} failed (HTTP ${e})${r}`), this.name = "StorefrontApiError", this.status = e, this.operationName = t, this.graphqlErrors = n;
648
652
  }
649
- }, we = async (e, t) => {
653
+ }, De = async (e, t) => {
650
654
  let n = await e.text();
651
655
  if (!n) throw Error("Empty graphql response");
652
656
  let r;
@@ -665,13 +669,13 @@ var T = /* @__PURE__ */ function(e) {
665
669
  graphqlErrors: (r.errors ?? []).map(({ message: e }) => e).filter(Boolean)
666
670
  });
667
671
  return r.data;
668
- }, Te = class {
672
+ }, Oe = class {
669
673
  constructor(e, t) {
670
674
  this.storefrontApiVersion = "2026-07", this.storefrontAccessToken = t, this.shopifyDomain = e;
671
675
  }
672
676
  async query(e, t) {
673
677
  let n = t?.variables ?? {}, r = `https://${this.shopifyDomain}/api/${this.storefrontApiVersion}/graphql.json`, i = e.match(/query\s+(\w+)/)?.[1];
674
- return i && (r += `?operation_name=${i}`), we(await fetch(r, {
678
+ return i && (r += `?operation_name=${i}`), De(await fetch(r, {
675
679
  method: "POST",
676
680
  headers: {
677
681
  "Content-Type": "application/json",
@@ -699,18 +703,18 @@ var T = /* @__PURE__ */ function(e) {
699
703
  ].map((e) => `brand_${e}`);
700
704
  var V = /* @__PURE__ */ function(e) {
701
705
  return e.QuantityBreak = "quantity-break", e.Bxgy = "bxgy", e.Bundle = "bundle", e.MixAndMatch = "mix-and-match", e.Sku = "sku", e;
702
- }({}), Ee = async (e, t, { country: n, language: r }) => {
706
+ }({}), ke = async (e, t, { country: n, language: r }) => {
703
707
  let i = t.collectionBreaks;
704
708
  if (!t.collectionBreaksEnabled || !i) return;
705
709
  let a;
706
- a = i.visibility === "deal-products" ? await E(e, {
710
+ a = i.visibility === "deal-products" ? await k(e, {
707
711
  country: n,
708
712
  language: r,
709
713
  blockVisibility: t.blockVisibility,
710
714
  excludedProductGIDs: (t.excludedProductIds || []).map((e) => `gid://shopify/Product/${e}`),
711
- selectedProductGIDs: (t.selectedProductIds || []).map((e) => `gid://shopify/Product/${e}`),
715
+ selectedProductGIDs: [...t.selectedProductIds || [], ...(t.selectedVariants || []).map(({ productId: e }) => e)].map((e) => `gid://shopify/Product/${e}`),
712
716
  selectedCollectionGIDs: (t.selectedCollectionIds || []).map((e) => `gid://shopify/Collection/${e}`)
713
- }) : await E(e, {
717
+ }) : await k(e, {
714
718
  country: n,
715
719
  language: r,
716
720
  blockVisibility: i.visibility,
@@ -718,14 +722,14 @@ var V = /* @__PURE__ */ function(e) {
718
722
  selectedProductGIDs: (i.selectedProducts || []).map(({ id: e }) => e),
719
723
  selectedCollectionGIDs: (i.selectedCollections || []).map(({ id: e }) => e)
720
724
  });
721
- let o = await O(e, {
725
+ let s = await j(e, {
722
726
  country: n,
723
727
  language: r,
724
728
  productIds: a.map((e) => Number(e.split("/").pop())),
725
729
  useExternalMetafieldNamespace: !0
726
- }), s = i.visibility === "deal-products" && t.blockVisibility === "excluded-products";
727
- return o = o.filter((e) => e.availableForSale && (!s || p([t], e).length > 0)), o;
728
- }, De = ({ language: e, dealBlockId: t }) => {
730
+ }), c = i.visibility === "deal-products" && t.blockVisibility === "excluded-products";
731
+ return o(t, s).filter((e) => e.availableForSale && (!c || g([t], e).length > 0));
732
+ }, Ae = ({ language: e, dealBlockId: t }) => {
729
733
  let n = {
730
734
  "system.out_of_stock": "There's not enough items in our stock, please select smaller bundle.",
731
735
  "system.invalid_variant": "Sorry, this is not currently available.",
@@ -752,13 +756,13 @@ var V = /* @__PURE__ */ function(e) {
752
756
  "system.numbers_only": "Only numbers are allowed.",
753
757
  "system.personalisation_required_alert": "Please add personalisation for every item to continue.",
754
758
  "system.gifts_required_alert": "Please choose your free gifts"
755
- }, r = e ? Oe(e) : void 0;
759
+ }, r = e ? je(e) : void 0;
756
760
  return {
757
761
  ...n,
758
762
  ...r?.system,
759
763
  ...r?.dealBlocks[t]
760
764
  };
761
- }, Oe = (e) => {
765
+ }, je = (e) => {
762
766
  if (typeof document > "u") return;
763
767
  let t = document.querySelector("script#kaching-bundles-translations");
764
768
  if (!t?.textContent) return;
@@ -770,9 +774,9 @@ var V = /* @__PURE__ */ function(e) {
770
774
  }
771
775
  let r = H(e);
772
776
  return n.find((e) => H(e.locale) === r)?.translations;
773
- }, H = (e) => e.toLowerCase().replace(/_/g, "-"), ke = "2026-07", U = async (e, { productId: t, dealBlockId: n, abTestVariantId: r, country: i = void 0, language: a = void 0 }) => {
777
+ }, H = (e) => e.toLowerCase().replace(/_/g, "-"), Me = "2026-07", U = async (e, { productId: t, dealBlockId: n, abTestVariantId: r, country: i = void 0, language: a = void 0 }) => {
774
778
  try {
775
- let s = [Number(t.split("/").pop())], c = new Pe(e);
779
+ let o = [Number(t.split("/").pop())], c = new Le(e);
776
780
  i ||= c.i18n?.country, a ||= c.i18n?.language;
777
781
  let l = await ie(c, {
778
782
  language: a,
@@ -780,56 +784,56 @@ var V = /* @__PURE__ */ function(e) {
780
784
  useExternalMetafieldNamespace: !0
781
785
  });
782
786
  c.shopifyDomain = l.shopifyDomain;
783
- let u = l.storefrontAccessToken ? new Te(l.shopifyDomain, l.storefrontAccessToken) : c, [d, f] = await Promise.all([O(u, {
787
+ let u = l.storefrontAccessToken ? new Oe(l.shopifyDomain, l.storefrontAccessToken) : c, [d, f] = await Promise.all([j(u, {
784
788
  country: i,
785
789
  language: a,
786
- productIds: s,
790
+ productIds: o,
787
791
  useExternalMetafieldNamespace: !0
788
- }), S(u, {
792
+ }), T(u, {
789
793
  useExternalMetafieldNamespace: !0,
790
794
  useMetaobjects: l.featureFlags.storefront_metaobjects
791
- })]), m = d[0];
792
- if (!m) return null;
793
- let h = p(f, m), g = n ? h.filter((e) => e.id === n || e.nanoId === n) : h, _ = (r ? g.find((e) => e.abTestVariantId === r) : void 0) ?? g[0] ?? h[0];
794
- if (!_) return null;
795
- let v = he(_, { includeMixAndMatchSwapProducts: !1 }), y = Ae(u, _, {
796
- otherProductGIDs: v,
795
+ })]), p = m(f, l.featureFlags.selected_variants), h = d[0];
796
+ if (!h) return null;
797
+ let _ = g(p, h), v = n ? _.filter((e) => e.id === n || e.nanoId === n) : _, y = (r ? v.find((e) => e.abTestVariantId === r) : void 0) ?? v[0] ?? _[0];
798
+ if (!y) return null;
799
+ let b = ve(y, { includeMixAndMatchSwapProducts: !1 }), x = Ne(u, y, {
800
+ otherProductGIDs: b,
797
801
  country: i,
798
802
  language: a
799
- }), [b, x, C] = await Promise.all([
800
- O(u, {
803
+ }), [S, C, w] = await Promise.all([
804
+ j(u, {
801
805
  country: i,
802
806
  language: a,
803
- productIds: v,
807
+ productIds: b,
804
808
  useExternalMetafieldNamespace: !0
805
809
  }),
806
- oe(u, le(_), 300),
807
- De({
810
+ oe(u, le(y), 300),
811
+ Ae({
808
812
  language: a,
809
- dealBlockId: _.id
813
+ dealBlockId: y.id
810
814
  })
811
815
  ]);
812
816
  return {
813
817
  data: {
814
818
  config: l,
815
- dealBlock: _,
816
- product: m,
817
- otherProducts: o(_, b),
818
- mediaImages: x,
819
- translations: C
819
+ dealBlock: y,
820
+ product: h,
821
+ otherProducts: s(y, S),
822
+ mediaImages: C,
823
+ translations: w
820
824
  },
821
- modalProducts: y
825
+ modalProducts: x
822
826
  };
823
827
  } catch (e) {
824
828
  return console.error(e), null;
825
829
  }
826
- }, Ae = async (e, t, n) => {
827
- let [r, i] = await Promise.all([je(e, t, n), Ne(e, t, n)]);
830
+ }, Ne = async (e, t, n) => {
831
+ let [r, i] = await Promise.all([Pe(e, t, n), Ie(e, t, n)]);
828
832
  return {
829
833
  mixAndMatchSwapProducts: r,
830
834
  collectionBreaksProducts: i
831
835
  };
832
- }, je = async (e, t, { otherProductGIDs: n, country: r, language: i }) => {
836
+ }, Pe = async (e, t, { otherProductGIDs: n, country: r, language: i }) => {
833
837
  try {
834
838
  let a = [];
835
839
  try {
@@ -841,8 +845,8 @@ var V = /* @__PURE__ */ function(e) {
841
845
  } catch (e) {
842
846
  console.error(e);
843
847
  }
844
- let s = new Set(n), c = [.../* @__PURE__ */ new Set([...Me(t), ...a])].filter((e) => !s.has(e));
845
- return c.length ? o(t, await O(e, {
848
+ let o = new Set(n), c = [.../* @__PURE__ */ new Set([...Fe(t), ...a])].filter((e) => !o.has(e));
849
+ return c.length ? s(t, await j(e, {
846
850
  country: r,
847
851
  language: i,
848
852
  productIds: c,
@@ -851,16 +855,16 @@ var V = /* @__PURE__ */ function(e) {
851
855
  } catch (e) {
852
856
  return console.error(e), [];
853
857
  }
854
- }, Me = (e) => e.dealBars.flatMap((e) => e.dealBarType === V.MixAndMatch ? e.bundleProducts.flatMap((e) => (e.selectedProducts ?? []).map((e) => e.id)) : []), Ne = async (e, t, { country: n, language: r }) => {
858
+ }, Fe = (e) => e.dealBars.flatMap((e) => e.dealBarType === V.MixAndMatch ? e.bundleProducts.flatMap((e) => (e.selectedProducts ?? []).map((e) => e.id)) : []), Ie = async (e, t, { country: n, language: r }) => {
855
859
  try {
856
- return await Ee(e, t, {
860
+ return await ke(e, t, {
857
861
  country: n,
858
862
  language: r
859
863
  }) ?? [];
860
864
  } catch (e) {
861
865
  return console.error(e), [];
862
866
  }
863
- }, Pe = class {
867
+ }, Le = class {
864
868
  constructor(e) {
865
869
  this.storefront = e, this.shopifyDomain = "";
866
870
  }
@@ -873,7 +877,7 @@ var V = /* @__PURE__ */ function(e) {
873
877
  }
874
878
  if ("request" in this.storefront) return (await this.storefront.request(e, t)).data;
875
879
  if ("shopifyDomain" in this.storefront && "storefrontAccessToken" in this.storefront) {
876
- let n = await fetch(`https://${this.storefront.shopifyDomain}/api/${ke}/graphql.json`, {
880
+ let n = await fetch(`https://${this.storefront.shopifyDomain}/api/${Me}/graphql.json`, {
877
881
  body: JSON.stringify({
878
882
  query: e,
879
883
  variables: t?.variables
@@ -903,46 +907,46 @@ var V = /* @__PURE__ */ function(e) {
903
907
  get i18n() {
904
908
  if ("i18n" in this.storefront) return this.storefront.i18n;
905
909
  }
906
- }, W = "kaching-bundles-block", G = 1e4, K = "/kaching-bundles-block.js", Fe = "https://bundles-integrations-dev.kachingappz.dev/kaching-bundles-block.js", Ie = "https://bundles-integrations.kachingappz.app/kaching-bundles-block.js", q = /* @__PURE__ */ new WeakSet(), J = async (e) => {
910
+ }, W = "kaching-bundles-block", G = 1e4, K = "/kaching-bundles-block.js", Re = "https://bundles-integrations-dev.kachingappz.dev/kaching-bundles-block.js", ze = "https://bundles-integrations.kachingappz.app/kaching-bundles-block.js", q = /* @__PURE__ */ new WeakSet(), J = async (e) => {
907
911
  let t = e.document;
908
912
  if (!e.customElements.get(W)) {
909
- if (q.has(t)) return Z(e, W);
913
+ if (q.has(t)) return X(e, W);
910
914
  q.add(t);
911
915
  try {
912
- await ze(e);
916
+ await He(e);
913
917
  } catch (e) {
914
918
  throw q.delete(t), e;
915
919
  }
916
920
  }
917
- }, Le = () => typeof window < "u" && window.__KACHING_DEV__ !== void 0, Re = () => Le() ? Fe : Ie, ze = async (e) => {
918
- let t = e.document, n = Re();
919
- if (t.querySelector(`script[src="${n}"]`)) return Z(e, W);
920
- let r = Be(t);
921
- if (r && await Y(t, r)) return Z(e, W);
921
+ }, Be = () => typeof window < "u" && window.__KACHING_DEV__ !== void 0, Ve = () => Be() ? Re : ze, He = async (e) => {
922
+ let t = e.document, n = Ve();
923
+ if (t.querySelector(`script[src="${n}"]`)) return X(e, W);
924
+ let r = Ue(t);
925
+ if (r && await Ge(t, r)) return X(e, W);
922
926
  let i = t.createElement("script");
923
- return i.src = n, await X(t, i), Z(e, W);
924
- }, Be = (e) => {
927
+ return i.src = n, await Y(t, i), X(e, W);
928
+ }, Ue = (e) => {
925
929
  let t = e.querySelectorAll(`link[rel="modulepreload"][href$="${K}"]`);
926
- return Array.from(t, (e) => e.href).find(Ve);
927
- }, Ve = (e) => {
930
+ return Array.from(t, (e) => e.href).find(We);
931
+ }, We = (e) => {
928
932
  try {
929
933
  return new URL(e).pathname.endsWith(K);
930
934
  } catch {
931
935
  return !1;
932
936
  }
933
- }, Y = async (e, t) => {
937
+ }, Ge = async (e, t) => {
934
938
  let n = e.createElement("script");
935
939
  n.type = "module", n.setAttribute("crossorigin", "anonymous"), n.src = t;
936
940
  try {
937
- return await X(e, n), !0;
941
+ return await Y(e, n), !0;
938
942
  } catch {
939
943
  return n.remove(), !1;
940
944
  }
941
- }, X = (e, t) => new Promise((n, r) => {
945
+ }, Y = (e, t) => new Promise((n, r) => {
942
946
  t.onload = () => n(), t.onerror = () => r(/* @__PURE__ */ Error("Failed to load script")), e.head.appendChild(t);
943
- }), Z = (e, t) => new Promise((n, r) => {
947
+ }), X = (e, t) => new Promise((n, r) => {
944
948
  e.customElements.get(t) ? n() : Promise.race([e.customElements.whenDefined(t), new Promise((e, n) => setTimeout(() => n(/* @__PURE__ */ Error(`Custom element "${t}" failed to register within ${G}ms`)), G))]).then(() => n()).catch(r);
945
- }), Q = {
949
+ }), Z = {
946
950
  config: {
947
951
  shopifyDomain: "",
948
952
  moneyFormat: "${{amount}}",
@@ -1342,7 +1346,7 @@ var V = /* @__PURE__ */ function(e) {
1342
1346
  mediaImages: [],
1343
1347
  collectionBreaksProducts: [],
1344
1348
  translations: {}
1345
- }, He = async (e, t) => {
1349
+ }, Q = async (e, t) => {
1346
1350
  try {
1347
1351
  let n = await U(e, t);
1348
1352
  if (!n) return null;
@@ -1360,7 +1364,7 @@ var V = /* @__PURE__ */ function(e) {
1360
1364
  } catch (e) {
1361
1365
  return console.error(e), null;
1362
1366
  }
1363
- }, Ue = class extends HTMLElement {
1367
+ }, Ke = class extends HTMLElement {
1364
1368
  constructor(...e) {
1365
1369
  super(...e), this.innerElement = null, this.handleItemsChanged = null, this.initializeId = 0;
1366
1370
  }
@@ -1379,7 +1383,7 @@ var V = /* @__PURE__ */ function(e) {
1379
1383
  let e = ++this.initializeId;
1380
1384
  if (this.cleanup(), this.hasAttribute("demo")) {
1381
1385
  if (await J(window), e !== this.initializeId) return;
1382
- $(this.renderInnerElement(Q), Q);
1386
+ $(this.renderInnerElement(Z), Z);
1383
1387
  return;
1384
1388
  }
1385
1389
  let t = this.getAttribute("shop-domain"), n = this.getAttribute("storefront-token"), r = this.getAttribute("product-id");
@@ -1434,5 +1438,5 @@ var V = /* @__PURE__ */ function(e) {
1434
1438
  }, $ = (e, { mixAndMatchSwapProducts: t, collectionBreaksProducts: n }) => {
1435
1439
  t.length && e.setAttribute("mix-and-match-swap-products", JSON.stringify(t)), e.setAttribute("collection-breaks-products", JSON.stringify(n));
1436
1440
  };
1437
- customElements.define("kaching-bundle-component", Ue);
1438
- export { He as fetchKachingBundlesData };
1441
+ customElements.define("kaching-bundle-component", Ke);
1442
+ export { Q as fetchKachingBundlesData };