@kachingappz/bundles-js 1.1.0 → 1.1.2
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/bundles-js.iife.js +24 -24
- package/dist/index.d.ts +11 -13
- package/dist/index.js +478 -400
- package/dist/kaching-bundle-component/index.d.ts +11 -13
- package/dist/kaching-bundle-component/index.js +596 -515
- package/dist/react/index.cjs +26 -26
- package/dist/react/index.d.ts +11 -13
- package/dist/react/index.js +476 -398
- package/package.json +5 -5
package/dist/react/index.js
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as B, useState as
|
|
3
|
-
const
|
|
4
|
-
const a = [],
|
|
5
|
-
(
|
|
1
|
+
import { jsx as J } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as B, useState as z, useEffect as D, useLayoutEffect as Q } from "react";
|
|
3
|
+
const H = (e, t) => {
|
|
4
|
+
const a = [], r = e.filter(
|
|
5
|
+
(i) => i.blockVisibility === "selected-products"
|
|
6
6
|
);
|
|
7
|
-
for (const
|
|
8
|
-
|
|
7
|
+
for (const i of r)
|
|
8
|
+
i.selectedProductIds.map(Number).includes(t.id) && a.push(i);
|
|
9
9
|
const s = e.filter(
|
|
10
|
-
(
|
|
10
|
+
(i) => i.blockVisibility === "selected-collections"
|
|
11
11
|
);
|
|
12
|
-
for (const
|
|
12
|
+
for (const i of s)
|
|
13
13
|
t.collectionIds.some(
|
|
14
|
-
(
|
|
15
|
-
) && a.push(
|
|
16
|
-
const
|
|
17
|
-
(
|
|
14
|
+
(d) => i.selectedCollectionIds.map(Number).includes(d)
|
|
15
|
+
) && a.push(i);
|
|
16
|
+
const l = e.filter(
|
|
17
|
+
(i) => i.blockVisibility === "excluded-products"
|
|
18
18
|
);
|
|
19
|
-
for (const
|
|
20
|
-
!
|
|
21
|
-
(
|
|
22
|
-
) && a.push(
|
|
19
|
+
for (const i of l)
|
|
20
|
+
!i.excludedProductIds.map(Number).includes(t.id) && !(i.excludedCollectionIds || []).some(
|
|
21
|
+
(d) => t.collectionIds.includes(d)
|
|
22
|
+
) && a.push(i);
|
|
23
23
|
const o = e.filter(
|
|
24
|
-
(
|
|
24
|
+
(i) => i.blockVisibility === "all-products"
|
|
25
25
|
);
|
|
26
|
-
for (const
|
|
27
|
-
a.push(
|
|
26
|
+
for (const i of o)
|
|
27
|
+
a.push(i);
|
|
28
28
|
return a;
|
|
29
|
-
},
|
|
30
|
-
var
|
|
31
|
-
const
|
|
29
|
+
}, K = (e, { language: t, country: a }) => {
|
|
30
|
+
var p, g;
|
|
31
|
+
const r = W(t, a), s = new Intl.NumberFormat(r, {
|
|
32
32
|
style: "currency",
|
|
33
33
|
currency: e,
|
|
34
34
|
currencyDisplay: "narrowSymbol"
|
|
35
|
-
}).formatToParts(123456789e-2),
|
|
35
|
+
}).formatToParts(123456789e-2), l = (p = s.find((y) => y.type === "decimal")) == null ? void 0 : p.value, o = X(
|
|
36
36
|
(g = s.find((y) => y.type === "group")) == null ? void 0 : g.value
|
|
37
|
-
),
|
|
37
|
+
), i = s.some((y) => y.type === "fraction"), d = Y(
|
|
38
38
|
o,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
),
|
|
39
|
+
l,
|
|
40
|
+
i
|
|
41
|
+
), u = s.findIndex(C), c = s.findLastIndex(C);
|
|
42
42
|
return [
|
|
43
|
-
...s.slice(0,
|
|
44
|
-
|
|
45
|
-
...s.slice(c + 1).map(
|
|
43
|
+
...s.slice(0, u).map(G),
|
|
44
|
+
d,
|
|
45
|
+
...s.slice(c + 1).map(G)
|
|
46
46
|
].join("");
|
|
47
|
-
},
|
|
47
|
+
}, G = (e) => F(e.value), F = (e) => e.replace(/\s/g, " "), C = (e) => e.type === "integer" || e.type === "group" || e.type === "decimal" || e.type === "fraction", W = (e, t) => e && t ? `${e}-${t.toUpperCase()}` : e || (t ? t.toUpperCase() : "en"), X = (e) => e === void 0 ? void 0 : F(e).replace(/’/g, "'"), Y = (e, t, a) => t === "," && e === "." ? a ? "{{amount_with_comma_separator}}" : "{{amount_no_decimals_with_comma_separator}}" : t === "," && e === " " ? a ? "{{amount_with_space_separator}}" : "{{amount_no_decimals_with_space_separator}}" : t === "." && e === " " ? "{{amount_with_period_and_space_separator}}" : t === "." && e === "'" ? "{{amount_with_apostrophe_separator}}" : a ? "{{amount}}" : "{{amount_no_decimals}}", w = ({
|
|
48
48
|
country: e,
|
|
49
49
|
language: t
|
|
50
50
|
}) => {
|
|
51
51
|
const a = [];
|
|
52
52
|
return e && a.push(`country: ${e}`), t && a.push(`language: ${t}`), a.length > 0 ? `@inContext(${a.join(", ")})` : "";
|
|
53
|
-
},
|
|
53
|
+
}, Z = async (e, {
|
|
54
54
|
useExternalMetafieldNamespace: t,
|
|
55
55
|
useMetaobjects: a
|
|
56
|
-
}) => a ?
|
|
56
|
+
}) => a ? te(
|
|
57
57
|
e
|
|
58
|
-
) :
|
|
59
|
-
var
|
|
60
|
-
const a = (
|
|
58
|
+
) : ee(e), ee = async (e, t) => {
|
|
59
|
+
var r;
|
|
60
|
+
const a = (r = (await e.query(
|
|
61
61
|
`
|
|
62
62
|
query FetchDealBlocks($metafieldNamespace: String!) {
|
|
63
63
|
shop {
|
|
@@ -72,13 +72,13 @@ const J = (e, t) => {
|
|
|
72
72
|
metafieldNamespace: "app--2935586817--kaching_bundles"
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
)).shop.metafield) == null ? void 0 :
|
|
75
|
+
)).shop.metafield) == null ? void 0 : r.value;
|
|
76
76
|
return a ? JSON.parse(a) : [];
|
|
77
|
-
},
|
|
78
|
-
const a = "app--2935586817--deal_block",
|
|
77
|
+
}, te = async (e, t) => {
|
|
78
|
+
const a = "app--2935586817--deal_block", r = [];
|
|
79
79
|
let s = null;
|
|
80
80
|
for (; ; ) {
|
|
81
|
-
const
|
|
81
|
+
const l = await e.query(
|
|
82
82
|
`
|
|
83
83
|
query FetchDealBlockMetaobjects($type: String!, $cursor: String) {
|
|
84
84
|
metaobjects(type: $type, first: 250, after: $cursor) {
|
|
@@ -102,37 +102,37 @@ const J = (e, t) => {
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
);
|
|
105
|
-
for (const o of
|
|
106
|
-
const
|
|
107
|
-
(
|
|
105
|
+
for (const o of l.metaobjects.nodes) {
|
|
106
|
+
const i = o.fields.find(
|
|
107
|
+
(d) => d.key === "settings"
|
|
108
108
|
);
|
|
109
|
-
|
|
109
|
+
i != null && i.value && r.push(JSON.parse(i.value));
|
|
110
110
|
}
|
|
111
|
-
if (!
|
|
111
|
+
if (!l.metaobjects.pageInfo.hasNextPage)
|
|
112
112
|
break;
|
|
113
|
-
s =
|
|
113
|
+
s = l.metaobjects.pageInfo.endCursor;
|
|
114
114
|
}
|
|
115
|
-
return
|
|
116
|
-
},
|
|
115
|
+
return r;
|
|
116
|
+
}, T = async (e, {
|
|
117
117
|
country: t,
|
|
118
118
|
language: a,
|
|
119
|
-
blockVisibility:
|
|
119
|
+
blockVisibility: r,
|
|
120
120
|
excludedProductGIDs: s,
|
|
121
|
-
selectedProductGIDs:
|
|
121
|
+
selectedProductGIDs: l,
|
|
122
122
|
selectedCollectionGIDs: o,
|
|
123
|
-
limit:
|
|
123
|
+
limit: i = 1e3
|
|
124
124
|
}) => {
|
|
125
|
-
switch (
|
|
125
|
+
switch (r) {
|
|
126
126
|
case "selected-products":
|
|
127
|
-
return
|
|
127
|
+
return l.slice(0, i);
|
|
128
128
|
case "all-products":
|
|
129
129
|
case "excluded-products": {
|
|
130
|
-
const
|
|
131
|
-
let
|
|
132
|
-
for (;
|
|
133
|
-
const
|
|
130
|
+
const d = w({ country: t, language: a });
|
|
131
|
+
let u = [], c = null;
|
|
132
|
+
for (; u.length < i; ) {
|
|
133
|
+
const p = Math.min(i - u.length, 250), g = await e.query(
|
|
134
134
|
`
|
|
135
|
-
query FetchProductGIDs($limit: Int!, $cursor: String) ${
|
|
135
|
+
query FetchProductGIDs($limit: Int!, $cursor: String) ${d} {
|
|
136
136
|
products(first: $limit, after: $cursor) {
|
|
137
137
|
nodes {
|
|
138
138
|
id
|
|
@@ -146,24 +146,24 @@ const J = (e, t) => {
|
|
|
146
146
|
`,
|
|
147
147
|
{
|
|
148
148
|
variables: {
|
|
149
|
-
limit:
|
|
149
|
+
limit: p,
|
|
150
150
|
cursor: c
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
);
|
|
154
|
-
if (
|
|
154
|
+
if (u.push(...g.products.nodes.map((y) => y.id)), !g.products.pageInfo.hasNextPage) break;
|
|
155
155
|
c = g.products.pageInfo.endCursor;
|
|
156
156
|
}
|
|
157
|
-
if (
|
|
158
|
-
const
|
|
159
|
-
|
|
157
|
+
if (r === "excluded-products") {
|
|
158
|
+
const p = new Set(s);
|
|
159
|
+
u = u.filter((g) => !p.has(g));
|
|
160
160
|
}
|
|
161
|
-
return
|
|
161
|
+
return u;
|
|
162
162
|
}
|
|
163
163
|
case "selected-collections": {
|
|
164
|
-
const
|
|
164
|
+
const d = w({ country: t, language: a }), u = (await e.query(
|
|
165
165
|
`
|
|
166
|
-
query FetchCollectionProductGIDs($collectionGIDs: [ID!]!, $limit: Int!) ${
|
|
166
|
+
query FetchCollectionProductGIDs($collectionGIDs: [ID!]!, $limit: Int!) ${d} {
|
|
167
167
|
nodes(ids: $collectionGIDs) {
|
|
168
168
|
... on Collection {
|
|
169
169
|
products(first: $limit) {
|
|
@@ -178,16 +178,16 @@ const J = (e, t) => {
|
|
|
178
178
|
{
|
|
179
179
|
variables: {
|
|
180
180
|
collectionGIDs: o,
|
|
181
|
-
limit: Math.min(
|
|
181
|
+
limit: Math.min(i, 250)
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
)).nodes.filter((c) => c !== null).flatMap(
|
|
185
|
-
(c) => c.products.nodes.map((
|
|
185
|
+
(c) => c.products.nodes.map((p) => p.id)
|
|
186
186
|
);
|
|
187
|
-
return Array.from(new Set(
|
|
187
|
+
return Array.from(new Set(u)).slice(0, i);
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
-
},
|
|
190
|
+
}, L = `
|
|
191
191
|
id
|
|
192
192
|
availableForSale
|
|
193
193
|
price {
|
|
@@ -202,7 +202,7 @@ const J = (e, t) => {
|
|
|
202
202
|
}
|
|
203
203
|
image {
|
|
204
204
|
id
|
|
205
|
-
url(transform:
|
|
205
|
+
url(transform: $variantImageTransform)
|
|
206
206
|
}
|
|
207
207
|
unitPriceMeasurement {
|
|
208
208
|
quantityUnit
|
|
@@ -233,17 +233,18 @@ const J = (e, t) => {
|
|
|
233
233
|
`, A = async (e, {
|
|
234
234
|
country: t,
|
|
235
235
|
language: a,
|
|
236
|
-
productIds:
|
|
236
|
+
productIds: r,
|
|
237
237
|
includeSellingPlans: s = !0,
|
|
238
|
-
includeAvailableQuantity:
|
|
238
|
+
includeAvailableQuantity: l = !0,
|
|
239
239
|
useExternalMetafieldNamespace: o = !1,
|
|
240
|
-
batchSize:
|
|
241
|
-
onBatchError:
|
|
240
|
+
batchSize: i = 250,
|
|
241
|
+
onBatchError: d,
|
|
242
|
+
variantImageTransform: u = { maxWidth: 200, maxHeight: 200 }
|
|
242
243
|
}) => {
|
|
243
|
-
if (!
|
|
244
|
+
if (!r.length)
|
|
244
245
|
return [];
|
|
245
|
-
const
|
|
246
|
-
query FetchProducts($productGIDs: [ID!]!, $includeSellingPlans: Boolean!, $includeAvailableQuantity: Boolean!, $metafieldNamespace: String
|
|
246
|
+
const c = r.map((f) => typeof f == "string" && f.startsWith("gid://") ? f : `gid://shopify/Product/${f}`), p = w({ country: t, language: a }), g = `
|
|
247
|
+
query FetchProducts($productGIDs: [ID!]!, $includeSellingPlans: Boolean!, $includeAvailableQuantity: Boolean!, $metafieldNamespace: String!, $variantImageTransform: ImageTransformInput) ${p} {
|
|
247
248
|
shop {
|
|
248
249
|
currencyRateConstant: metafield(namespace: $metafieldNamespace, key: "currency_rate_constant") {
|
|
249
250
|
value
|
|
@@ -277,7 +278,7 @@ const J = (e, t) => {
|
|
|
277
278
|
}
|
|
278
279
|
variants(first: 250) {
|
|
279
280
|
nodes {
|
|
280
|
-
${
|
|
281
|
+
${L}
|
|
281
282
|
}
|
|
282
283
|
}
|
|
283
284
|
collections(first: 50) {
|
|
@@ -329,84 +330,90 @@ const J = (e, t) => {
|
|
|
329
330
|
}
|
|
330
331
|
}
|
|
331
332
|
}
|
|
332
|
-
`,
|
|
333
|
-
for (let
|
|
334
|
-
|
|
335
|
-
let
|
|
336
|
-
const
|
|
337
|
-
const v = await e.query(
|
|
333
|
+
`, y = o ? "app--2935586817--kaching_bundles" : "$app:kaching_bundles", h = [], n = Math.min(i, 250);
|
|
334
|
+
for (let f = 0; f < c.length; f += n)
|
|
335
|
+
h.push(c.slice(f, f + n));
|
|
336
|
+
let m = 1;
|
|
337
|
+
const b = async (f) => {
|
|
338
|
+
const v = await e.query(g, {
|
|
338
339
|
variables: {
|
|
339
|
-
productGIDs:
|
|
340
|
+
productGIDs: f,
|
|
340
341
|
includeSellingPlans: s,
|
|
341
|
-
includeAvailableQuantity:
|
|
342
|
-
metafieldNamespace:
|
|
342
|
+
includeAvailableQuantity: l,
|
|
343
|
+
metafieldNamespace: y,
|
|
344
|
+
variantImageTransform: u
|
|
343
345
|
}
|
|
344
346
|
});
|
|
345
|
-
return v.shop.currencyRateConstant && (
|
|
347
|
+
return v.shop.currencyRateConstant && (m = JSON.parse(v.shop.currencyRateConstant.value).amount / 1e6), v;
|
|
346
348
|
};
|
|
347
|
-
let
|
|
348
|
-
if (
|
|
349
|
-
const
|
|
350
|
-
for (const v of
|
|
351
|
-
v.status === "rejected" &&
|
|
349
|
+
let I;
|
|
350
|
+
if (d) {
|
|
351
|
+
const f = await Promise.allSettled(h.map(b));
|
|
352
|
+
for (const v of f)
|
|
353
|
+
v.status === "rejected" && d(
|
|
352
354
|
v.reason instanceof Error ? v.reason : new Error(String(v.reason))
|
|
353
355
|
);
|
|
354
|
-
|
|
356
|
+
I = f.filter(
|
|
355
357
|
(v) => v.status === "fulfilled"
|
|
356
358
|
).flatMap((v) => v.value.nodes);
|
|
357
359
|
} else
|
|
358
|
-
|
|
359
|
-
const _ =
|
|
360
|
-
if (
|
|
361
|
-
const
|
|
362
|
-
_.map(async (
|
|
363
|
-
const
|
|
360
|
+
I = (await Promise.all(h.map(b))).flatMap((f) => f.nodes);
|
|
361
|
+
const _ = I.filter((f) => f != null);
|
|
362
|
+
if (d) {
|
|
363
|
+
const f = await Promise.allSettled(
|
|
364
|
+
_.map(async (P) => {
|
|
365
|
+
const R = await M(
|
|
364
366
|
e,
|
|
365
|
-
|
|
366
|
-
{
|
|
367
|
-
|
|
367
|
+
P,
|
|
368
|
+
{
|
|
369
|
+
includeSellingPlans: s,
|
|
370
|
+
includeAvailableQuantity: l,
|
|
371
|
+
variantImageTransform: u
|
|
372
|
+
},
|
|
373
|
+
p
|
|
368
374
|
);
|
|
369
375
|
return q(
|
|
370
|
-
|
|
376
|
+
R,
|
|
371
377
|
e.shopifyDomain,
|
|
372
|
-
|
|
378
|
+
m
|
|
373
379
|
);
|
|
374
380
|
})
|
|
375
381
|
), v = [];
|
|
376
|
-
for (const
|
|
377
|
-
|
|
378
|
-
|
|
382
|
+
for (const P of f)
|
|
383
|
+
P.status === "fulfilled" ? v.push(P.value) : d(
|
|
384
|
+
P.reason instanceof Error ? P.reason : new Error(String(P.reason))
|
|
379
385
|
);
|
|
380
386
|
return v;
|
|
381
387
|
}
|
|
382
388
|
return (await Promise.all(
|
|
383
389
|
_.map(
|
|
384
|
-
(
|
|
390
|
+
(f) => M(
|
|
385
391
|
e,
|
|
386
|
-
|
|
392
|
+
f,
|
|
387
393
|
{
|
|
388
394
|
includeSellingPlans: s,
|
|
389
|
-
includeAvailableQuantity:
|
|
395
|
+
includeAvailableQuantity: l,
|
|
396
|
+
variantImageTransform: u
|
|
390
397
|
},
|
|
391
|
-
|
|
398
|
+
p
|
|
392
399
|
)
|
|
393
400
|
)
|
|
394
401
|
)).map(
|
|
395
|
-
(
|
|
402
|
+
(f) => q(f, e.shopifyDomain, m)
|
|
396
403
|
);
|
|
397
|
-
},
|
|
404
|
+
}, M = async (e, t, a, r = "") => {
|
|
398
405
|
if (t.variants.nodes.length < 250)
|
|
399
406
|
return t;
|
|
400
|
-
const s = /* @__PURE__ */ new Set(),
|
|
401
|
-
let
|
|
402
|
-
for (;
|
|
403
|
-
const
|
|
407
|
+
const s = /* @__PURE__ */ new Set(), l = [], o = [], i = async (d) => {
|
|
408
|
+
let u = !0, c = null;
|
|
409
|
+
for (; u; ) {
|
|
410
|
+
const p = await e.query(
|
|
404
411
|
`
|
|
405
|
-
query($productGID: ID!, $cursor: String, $reverse: Boolean, $includeSellingPlans: Boolean!, $includeAvailableQuantity: Boolean
|
|
412
|
+
query($productGID: ID!, $cursor: String, $reverse: Boolean, $includeSellingPlans: Boolean!, $includeAvailableQuantity: Boolean!, $variantImageTransform: ImageTransformInput) ${r} {
|
|
406
413
|
product(id: $productGID) {
|
|
407
414
|
variants(first: 250, after: $cursor, reverse: $reverse) {
|
|
408
415
|
nodes {
|
|
409
|
-
${
|
|
416
|
+
${L}
|
|
410
417
|
}
|
|
411
418
|
pageInfo {
|
|
412
419
|
endCursor
|
|
@@ -420,53 +427,53 @@ const J = (e, t) => {
|
|
|
420
427
|
variables: {
|
|
421
428
|
productGID: t.id,
|
|
422
429
|
cursor: c,
|
|
423
|
-
reverse:
|
|
430
|
+
reverse: d,
|
|
424
431
|
...a
|
|
425
432
|
}
|
|
426
433
|
}
|
|
427
|
-
), { nodes: g, pageInfo: y } =
|
|
434
|
+
), { nodes: g, pageInfo: y } = p.product.variants;
|
|
428
435
|
for (const h of g) {
|
|
429
436
|
if (s.has(h.id)) {
|
|
430
|
-
|
|
437
|
+
u = !1;
|
|
431
438
|
break;
|
|
432
439
|
}
|
|
433
|
-
s.add(h.id),
|
|
440
|
+
s.add(h.id), d ? o.push(h) : l.push(h);
|
|
434
441
|
}
|
|
435
|
-
y.hasNextPage || (
|
|
442
|
+
y.hasNextPage || (u = !1), c = y.endCursor;
|
|
436
443
|
}
|
|
437
444
|
};
|
|
438
445
|
return await Promise.all([
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
]), t.variants.nodes = [...
|
|
446
|
+
i(!1),
|
|
447
|
+
i(!0)
|
|
448
|
+
]), t.variants.nodes = [...l, ...o.reverse()], t;
|
|
442
449
|
}, q = (e, t, a) => {
|
|
443
|
-
var
|
|
444
|
-
const
|
|
445
|
-
({ unitPriceMeasurement: n, ...
|
|
446
|
-
var b,
|
|
450
|
+
var u, c, p, g, y, h;
|
|
451
|
+
const r = e.variants.nodes.map(
|
|
452
|
+
({ unitPriceMeasurement: n, ...m }) => {
|
|
453
|
+
var b, I;
|
|
447
454
|
return {
|
|
448
|
-
id: Number(
|
|
449
|
-
availableForSale:
|
|
450
|
-
price: Math.round(Number(
|
|
451
|
-
compareAtPrice:
|
|
452
|
-
options:
|
|
453
|
-
imageId:
|
|
454
|
-
image: ((b =
|
|
455
|
-
sellingPlans: ((
|
|
456
|
-
id: Number(
|
|
457
|
-
price:
|
|
458
|
-
compareAtPrice:
|
|
459
|
-
Number(
|
|
460
|
-
) : Math.round(Number(
|
|
461
|
-
perDeliveryPrice:
|
|
462
|
-
Number(
|
|
463
|
-
) : Math.round(Number(
|
|
455
|
+
id: Number(m.id.split("/").pop()),
|
|
456
|
+
availableForSale: m.availableForSale,
|
|
457
|
+
price: Math.round(Number(m.price.amount) * 100),
|
|
458
|
+
compareAtPrice: m.compareAtPrice ? Math.round(Number(m.compareAtPrice.amount) * 100) : null,
|
|
459
|
+
options: m.selectedOptions.map((_) => _.value),
|
|
460
|
+
imageId: m.image ? Number(m.image.id.split("/").pop()) : null,
|
|
461
|
+
image: ((b = m.image) == null ? void 0 : b.url) || null,
|
|
462
|
+
sellingPlans: ((I = m.sellingPlanAllocations) == null ? void 0 : I.nodes.map((_) => ({
|
|
463
|
+
id: Number(_.sellingPlan.id.split("/").pop()),
|
|
464
|
+
price: _.priceAdjustments.length > 0 ? Math.round(Number(_.priceAdjustments[0].price.amount) * 100) : Math.round(Number(m.price.amount) * 100),
|
|
465
|
+
compareAtPrice: _.priceAdjustments.length > 0 ? Math.round(
|
|
466
|
+
Number(_.priceAdjustments[0].compareAtPrice.amount) * 100
|
|
467
|
+
) : Math.round(Number(m.price.amount) * 100),
|
|
468
|
+
perDeliveryPrice: _.priceAdjustments.length > 0 ? Math.round(
|
|
469
|
+
Number(_.priceAdjustments[0].perDeliveryPrice.amount) * 100
|
|
470
|
+
) : Math.round(Number(m.price.amount) * 100)
|
|
464
471
|
}))) || [],
|
|
465
472
|
inventoryManagement: null,
|
|
466
473
|
// Storefront API does not return inventory management, only available in liquid
|
|
467
474
|
inventoryPolicy: null,
|
|
468
475
|
// Storefront API does not return inventory policy, only available in liquid
|
|
469
|
-
inventoryQuantity:
|
|
476
|
+
inventoryQuantity: m.quantityAvailable ?? null,
|
|
470
477
|
unitPriceMeasurement: n != null && n.quantityUnit && (n != null && n.referenceUnit) ? {
|
|
471
478
|
quantityValue: n.quantityValue,
|
|
472
479
|
quantityUnit: n.quantityUnit.toLowerCase(),
|
|
@@ -475,30 +482,30 @@ const J = (e, t) => {
|
|
|
475
482
|
} : null
|
|
476
483
|
};
|
|
477
484
|
}
|
|
478
|
-
), s = e.options.map((n,
|
|
479
|
-
const b = n.optionValues.map((
|
|
480
|
-
var
|
|
485
|
+
), s = e.options.map((n, m) => {
|
|
486
|
+
const b = n.optionValues.map((I) => {
|
|
487
|
+
var _, f, v, P;
|
|
481
488
|
return {
|
|
482
|
-
id: Number(
|
|
483
|
-
defaultName:
|
|
484
|
-
name:
|
|
489
|
+
id: Number(I.id.split("/").pop()),
|
|
490
|
+
defaultName: I.name,
|
|
491
|
+
name: I.name,
|
|
485
492
|
swatch: {
|
|
486
|
-
color: ((
|
|
487
|
-
image: ((P = (
|
|
493
|
+
color: ((_ = I.swatch) == null ? void 0 : _.color) || null,
|
|
494
|
+
image: ((P = (v = (f = I.swatch) == null ? void 0 : f.image) == null ? void 0 : v.previewImage) == null ? void 0 : P.url) || null
|
|
488
495
|
}
|
|
489
496
|
};
|
|
490
497
|
});
|
|
491
498
|
return {
|
|
492
499
|
defaultName: n.name,
|
|
493
500
|
name: n.name,
|
|
494
|
-
position:
|
|
495
|
-
optionValues:
|
|
501
|
+
position: m + 1,
|
|
502
|
+
optionValues: ae(b, m, r)
|
|
496
503
|
};
|
|
497
|
-
}),
|
|
498
|
-
const
|
|
499
|
-
if (!
|
|
504
|
+
}), l = (n) => {
|
|
505
|
+
const m = n.priceAdjustments[0];
|
|
506
|
+
if (!m)
|
|
500
507
|
return null;
|
|
501
|
-
const b =
|
|
508
|
+
const b = m.adjustmentValue;
|
|
502
509
|
switch (b.__typename) {
|
|
503
510
|
case "SellingPlanPercentagePriceAdjustment":
|
|
504
511
|
return {
|
|
@@ -520,13 +527,13 @@ const J = (e, t) => {
|
|
|
520
527
|
`Unknown price adjustment type: ${b.__typename}`
|
|
521
528
|
);
|
|
522
529
|
}
|
|
523
|
-
}, o = (n) => a === 1 ? Number(n) * 100 : Math.round(Number(n) * 100 * a),
|
|
524
|
-
(n) => n.sellingPlans.nodes.map((
|
|
525
|
-
id: Number(
|
|
526
|
-
name:
|
|
527
|
-
priceAdjustment:
|
|
530
|
+
}, o = (n) => a === 1 ? Number(n) * 100 : Math.round(Number(n) * 100 * a), i = ((u = e.sellingPlanGroups) == null ? void 0 : u.nodes.flatMap(
|
|
531
|
+
(n) => n.sellingPlans.nodes.map((m) => ({
|
|
532
|
+
id: Number(m.id.split("/").pop()),
|
|
533
|
+
name: m.name,
|
|
534
|
+
priceAdjustment: l(m)
|
|
528
535
|
}))
|
|
529
|
-
)) || [],
|
|
536
|
+
)) || [], d = e.variants.nodes.some(
|
|
530
537
|
(n) => n.requiresComponents
|
|
531
538
|
);
|
|
532
539
|
return {
|
|
@@ -544,35 +551,35 @@ const J = (e, t) => {
|
|
|
544
551
|
selectedVariantId: Number(
|
|
545
552
|
e.variants.nodes[0].id.split("/").pop()
|
|
546
553
|
),
|
|
547
|
-
variants:
|
|
554
|
+
variants: r,
|
|
548
555
|
requiresSellingPlan: e.requiresSellingPlan,
|
|
549
|
-
sellingPlans:
|
|
550
|
-
isNativeBundle:
|
|
556
|
+
sellingPlans: i,
|
|
557
|
+
isNativeBundle: d,
|
|
551
558
|
metafields: {
|
|
552
|
-
text: ((
|
|
559
|
+
text: ((p = e.metafield) == null ? void 0 : p.value) || null,
|
|
553
560
|
text2: ((g = e.metafield2) == null ? void 0 : g.value) || null,
|
|
554
561
|
text3: ((y = e.metafield3) == null ? void 0 : y.value) || null,
|
|
555
562
|
text4: ((h = e.metafield4) == null ? void 0 : h.value) || null
|
|
556
563
|
}
|
|
557
564
|
};
|
|
558
|
-
},
|
|
559
|
-
(s) => s.options[t] ===
|
|
560
|
-
).length > 0), j = "app--2935586817",
|
|
565
|
+
}, ae = (e, t, a) => e.filter((r) => a.filter(
|
|
566
|
+
(s) => s.options[t] === r.name
|
|
567
|
+
).length > 0), j = "app--2935586817", se = async (e, {
|
|
561
568
|
language: t,
|
|
562
569
|
country: a,
|
|
563
|
-
useExternalMetafieldNamespace:
|
|
570
|
+
useExternalMetafieldNamespace: r
|
|
564
571
|
}) => {
|
|
565
|
-
const s = `${j}--kaching_bundles`,
|
|
572
|
+
const s = `${j}--kaching_bundles`, l = j, o = w({ country: a }), {
|
|
566
573
|
localization: {
|
|
567
574
|
country: {
|
|
568
|
-
currency: { isoCode:
|
|
575
|
+
currency: { isoCode: i }
|
|
569
576
|
}
|
|
570
577
|
},
|
|
571
578
|
shop: {
|
|
572
|
-
moneyFormat:
|
|
573
|
-
paymentSettings: { currencyCode:
|
|
579
|
+
moneyFormat: d,
|
|
580
|
+
paymentSettings: { currencyCode: u },
|
|
574
581
|
currencyRateConstant: c,
|
|
575
|
-
primaryDomain:
|
|
582
|
+
primaryDomain: p,
|
|
576
583
|
settingsMetafield: g
|
|
577
584
|
}
|
|
578
585
|
} = await e.query(
|
|
@@ -605,12 +612,12 @@ const J = (e, t) => {
|
|
|
605
612
|
{
|
|
606
613
|
variables: {
|
|
607
614
|
metafieldNamespace: s,
|
|
608
|
-
settingsNamespace:
|
|
615
|
+
settingsNamespace: l
|
|
609
616
|
}
|
|
610
617
|
}
|
|
611
|
-
), y =
|
|
618
|
+
), y = i === u ? d : K(i, { language: t, country: a }), h = c ? re(c.value) : 1, n = g ? JSON.parse(g.value) : null, m = (n == null ? void 0 : n.feature_flags) ?? {}, b = (n == null ? void 0 : n.custom_selectors) ?? {};
|
|
612
619
|
return {
|
|
613
|
-
shopifyDomain:
|
|
620
|
+
shopifyDomain: p.host,
|
|
614
621
|
moneyFormat: y,
|
|
615
622
|
locale: (t == null ? void 0 : t.toLowerCase()) || "en",
|
|
616
623
|
liquidLocale: (t == null ? void 0 : t.toLowerCase()) || "en",
|
|
@@ -666,37 +673,48 @@ const J = (e, t) => {
|
|
|
666
673
|
priceCompare: b.price_compare ?? null
|
|
667
674
|
},
|
|
668
675
|
shopCustomStyles: (n == null ? void 0 : n.shop_custom_styles) ?? "",
|
|
669
|
-
featureFlags:
|
|
676
|
+
featureFlags: m,
|
|
670
677
|
brandColors: (n == null ? void 0 : n.brand_colors) ?? null
|
|
671
678
|
};
|
|
672
|
-
},
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
679
|
+
}, re = (e) => JSON.parse(e).amount / 1e6, ne = async (e, t, a = 200) => {
|
|
680
|
+
const r = [
|
|
681
|
+
...new Set(
|
|
682
|
+
t.filter(Boolean).filter((l) => !l.startsWith("placeholder"))
|
|
683
|
+
)
|
|
684
|
+
];
|
|
685
|
+
if (r.length === 0) return [];
|
|
686
|
+
const s = [];
|
|
687
|
+
for (let l = 0; l < r.length; l += 250)
|
|
688
|
+
s.push(r.slice(l, l + 250));
|
|
689
|
+
return (await Promise.all(
|
|
690
|
+
s.map(
|
|
691
|
+
(l) => e.query(
|
|
692
|
+
`
|
|
693
|
+
query FetchMediaImages($mediaImageIds: [ID!]!, $size: Int!) {
|
|
694
|
+
nodes(ids: $mediaImageIds) {
|
|
695
|
+
... on MediaImage {
|
|
696
|
+
id
|
|
697
|
+
image {
|
|
698
|
+
url(transform: { maxWidth: $size, maxHeight: $size })
|
|
699
|
+
}
|
|
700
|
+
}
|
|
680
701
|
}
|
|
681
702
|
}
|
|
703
|
+
`,
|
|
704
|
+
{
|
|
705
|
+
variables: {
|
|
706
|
+
mediaImageIds: l,
|
|
707
|
+
size: a
|
|
708
|
+
}
|
|
682
709
|
}
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
)).nodes.filter(Boolean).map((l) => ({
|
|
692
|
-
gid: l.id,
|
|
693
|
-
url: l.image.url
|
|
694
|
-
})));
|
|
710
|
+
)
|
|
711
|
+
)
|
|
712
|
+
)).flatMap((l) => l.nodes).flatMap(
|
|
713
|
+
(l) => l != null && l.image ? [{ gid: l.id, url: l.image.url }] : []
|
|
714
|
+
);
|
|
715
|
+
};
|
|
695
716
|
var k = /* @__PURE__ */ ((e) => (e.QuantityBreak = "quantity-break", e.Bxgy = "bxgy", e.Bundle = "bundle", e.MixAndMatch = "mix-and-match", e.Sku = "sku", e))(k || {});
|
|
696
|
-
const
|
|
697
|
-
...ne(e),
|
|
698
|
-
...le(e),
|
|
699
|
-
...re(e),
|
|
717
|
+
const le = (e) => [
|
|
700
718
|
...ie(e),
|
|
701
719
|
...oe(e),
|
|
702
720
|
...ce(e),
|
|
@@ -705,86 +723,123 @@ const se = (e) => [
|
|
|
705
723
|
...me(e),
|
|
706
724
|
...pe(e),
|
|
707
725
|
...fe(e),
|
|
726
|
+
...ge(e),
|
|
708
727
|
...ye(e),
|
|
709
|
-
...
|
|
710
|
-
|
|
728
|
+
...he(e),
|
|
729
|
+
...be(e),
|
|
730
|
+
...ve(e)
|
|
731
|
+
].filter((t) => t != null && !t.includes("placeholder")), ie = (e) => e.dealBars.flatMap((t) => [t.mediaImageGID, t.badgeImageGID]).filter((t) => t != null), oe = (e) => e.dealBars.flatMap(
|
|
711
732
|
(t) => t.dealBarType === k.Bundle ? t.bundleProducts.map(
|
|
712
733
|
(a) => a.mediaImageGID
|
|
713
734
|
) : []
|
|
714
|
-
).filter((t) => t != null),
|
|
735
|
+
).filter((t) => t != null), ce = (e) => e.dealBars.map(
|
|
715
736
|
({ freeGifts: t }) => (t || []).map((a) => a.mediaImageGID)
|
|
716
|
-
).reduce((t, a) => t.concat(a), []).filter((t) => t != null),
|
|
737
|
+
).reduce((t, a) => t.concat(a), []).filter((t) => t != null), ue = (e) => e.dealBars.flatMap(
|
|
717
738
|
({ multipleGiftsSelectors: t }) => (t || []).map((a) => a.mediaImageGID)
|
|
718
|
-
).filter((t) => t != null),
|
|
719
|
-
const
|
|
720
|
-
return [...t, ...
|
|
721
|
-
}, []) : [],
|
|
739
|
+
).filter((t) => t != null), de = (e) => e.dealBars.map(({ upsells: t }) => (t || []).map((a) => a.mediaImageGID)).reduce((t, a) => t.concat(a), []).filter((t) => t != null), me = (e) => e.swatchOptions ? e.swatchOptions.reduce((t, a) => {
|
|
740
|
+
const r = a.images.map((s) => s.mediaImageGID).filter((s) => s != null);
|
|
741
|
+
return [...t, ...r];
|
|
742
|
+
}, []) : [], pe = (e) => {
|
|
722
743
|
if (!e.collectionBreaksEnabled || !e.collectionBreaks)
|
|
723
744
|
return [];
|
|
724
745
|
const t = e.collectionBreaks.mediaImageGID;
|
|
725
746
|
return t ? [t] : [];
|
|
726
|
-
},
|
|
727
|
-
var t, a,
|
|
747
|
+
}, fe = (e) => {
|
|
748
|
+
var t, a, r;
|
|
728
749
|
return e.progressiveGifts ? [
|
|
729
750
|
...((t = e.progressiveGifts.gifts) == null ? void 0 : t.map((s) => s.mediaImageGID)) || [],
|
|
730
751
|
(a = e.progressiveGifts.style) == null ? void 0 : a.lockedMediaImageGID,
|
|
731
|
-
(
|
|
752
|
+
(r = e.progressiveGifts.dealBarStyle) == null ? void 0 : r.lockedMediaImageGID
|
|
732
753
|
].filter((s) => s != null) : [];
|
|
733
|
-
},
|
|
754
|
+
}, ge = (e) => !e.checkboxUpsellsEnabled || !e.checkboxUpsells ? [] : e.checkboxUpsells.upsells.flatMap((t) => [t.mediaImageGID, t.badgeImageGID]).filter((t) => t != null), ye = (e) => e.dealBars.map((t) => {
|
|
734
755
|
var a;
|
|
735
756
|
return (a = t.productPersonalisation) == null ? void 0 : a.mediaImageGID;
|
|
736
|
-
}).filter((t) => t != null),
|
|
737
|
-
var
|
|
738
|
-
const t = e.dealBars.map((
|
|
757
|
+
}).filter((t) => t != null), he = (e) => {
|
|
758
|
+
var r, s;
|
|
759
|
+
const t = e.dealBars.map((l) => {
|
|
739
760
|
var o;
|
|
740
|
-
return (o =
|
|
741
|
-
}).filter((
|
|
761
|
+
return (o = l.highlights) == null ? void 0 : o.customIconGID;
|
|
762
|
+
}).filter((l) => l != null), a = (s = (r = e.subscriptions) == null ? void 0 : r.highlights) == null ? void 0 : s.customIconGID;
|
|
742
763
|
return a ? [...t, a] : t;
|
|
743
|
-
},
|
|
764
|
+
}, be = (e) => (e.badges || []).flatMap(
|
|
744
765
|
(t) => t.badgeType === "custom" && t.imageGID ? [t.imageGID] : []
|
|
745
|
-
),
|
|
766
|
+
), ve = (e) => !e.savingsSummaryEnabled || !e.savingsSummary ? [] : e.savingsSummary.customIconGID ? [e.savingsSummary.customIconGID] : [], _e = (e) => {
|
|
746
767
|
const t = [
|
|
747
|
-
...be(e),
|
|
748
|
-
...ve(e),
|
|
749
|
-
..._e(e),
|
|
750
768
|
...Ie(e),
|
|
751
769
|
...Pe(e),
|
|
752
770
|
...Se(e),
|
|
753
771
|
...ke(e),
|
|
754
|
-
...we(e)
|
|
772
|
+
...we(e),
|
|
773
|
+
...$e(e),
|
|
774
|
+
...Ne(e),
|
|
775
|
+
...De(e)
|
|
755
776
|
];
|
|
756
777
|
return Array.from(new Set(t.filter((a) => a != null)));
|
|
757
|
-
},
|
|
778
|
+
}, Ie = (e) => e.dealBars.flatMap(
|
|
758
779
|
({ freeGifts: t }) => t ? t.map((a) => a.productGID) : []
|
|
759
|
-
).filter((t) => t != null),
|
|
780
|
+
).filter((t) => t != null), Pe = (e) => e.dealBars.flatMap(
|
|
760
781
|
({ multipleGiftsSelectors: t }) => t ? t.flatMap(
|
|
761
|
-
(a) => a.products ? a.products.map((
|
|
782
|
+
(a) => a.products ? a.products.map((r) => r.id) : []
|
|
762
783
|
) : []
|
|
763
|
-
).filter((t) => t != null),
|
|
784
|
+
).filter((t) => t != null), Se = (e) => {
|
|
764
785
|
var t;
|
|
765
786
|
return e.progressiveGiftsEnabled ? ((t = e.progressiveGifts) == null ? void 0 : t.gifts.map((a) => a.productGID).filter((a) => a != null)) || [] : [];
|
|
766
|
-
},
|
|
787
|
+
}, ke = (e) => e.dealBars.flatMap(({ upsells: t }) => t ? t.map((a) => a.productGID) : []).filter((t) => t != null), we = (e) => e.dealBars.filter((t) => t.dealBarType === k.Bundle).flatMap(
|
|
767
788
|
({ bundleProducts: t }) => t ? t.map((a) => a.productGID) : []
|
|
768
|
-
).filter((t) => t != null).filter((t) => t !== "default"),
|
|
789
|
+
).filter((t) => t != null).filter((t) => t !== "default"), $e = (e) => e.dealBars.filter((t) => t.dealBarType === k.MixAndMatch).flatMap(
|
|
769
790
|
({ bundleProducts: t }) => t ? t.flatMap((a) => {
|
|
770
|
-
var
|
|
791
|
+
var r;
|
|
771
792
|
return [
|
|
772
793
|
a.productGID,
|
|
773
|
-
...((
|
|
794
|
+
...((r = a.selectedProducts) == null ? void 0 : r.map((s) => s.id)) ?? []
|
|
774
795
|
];
|
|
775
796
|
}) : []
|
|
776
|
-
).filter((t) => t != null).filter((t) => t !== "default"),
|
|
777
|
-
class
|
|
797
|
+
).filter((t) => t != null).filter((t) => t !== "default"), Ne = (e) => !e.checkboxUpsellsEnabled || !e.checkboxUpsells ? [] : e.checkboxUpsells.upsells.map((t) => t.productGID).filter((t) => t != null), De = (e) => e.dealBars.filter((t) => t.dealBarType === k.Sku).flatMap(({ productGID: t }) => t ? [t] : []);
|
|
798
|
+
class O extends Error {
|
|
799
|
+
constructor({
|
|
800
|
+
status: t,
|
|
801
|
+
operationName: a,
|
|
802
|
+
graphqlErrors: r
|
|
803
|
+
}) {
|
|
804
|
+
const s = r.length ? `: ${r.join("; ")}` : "";
|
|
805
|
+
super(
|
|
806
|
+
`Storefront API ${a ?? "query"} failed (HTTP ${t})${s}`
|
|
807
|
+
), this.name = "StorefrontApiError", this.status = t, this.operationName = a, this.graphqlErrors = r;
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
const Ae = async (e, t) => {
|
|
811
|
+
const a = await e.text();
|
|
812
|
+
if (!a)
|
|
813
|
+
throw new Error("Empty graphql response");
|
|
814
|
+
let r;
|
|
815
|
+
try {
|
|
816
|
+
r = JSON.parse(a);
|
|
817
|
+
} catch (s) {
|
|
818
|
+
throw e.ok ? s : new O({
|
|
819
|
+
status: e.status,
|
|
820
|
+
operationName: t,
|
|
821
|
+
graphqlErrors: []
|
|
822
|
+
});
|
|
823
|
+
}
|
|
824
|
+
if (!e.ok || r.data === null || r.data === void 0)
|
|
825
|
+
throw new O({
|
|
826
|
+
status: e.status,
|
|
827
|
+
operationName: t,
|
|
828
|
+
graphqlErrors: (r.errors ?? []).map(({ message: s }) => s).filter(Boolean)
|
|
829
|
+
});
|
|
830
|
+
return r.data;
|
|
831
|
+
};
|
|
832
|
+
class xe {
|
|
778
833
|
constructor(t, a) {
|
|
779
834
|
this.storefrontApiVersion = "2026-07", this.storefrontAccessToken = a, this.shopifyDomain = t;
|
|
780
835
|
}
|
|
781
836
|
async query(t, a) {
|
|
782
|
-
var
|
|
783
|
-
const
|
|
837
|
+
var i;
|
|
838
|
+
const r = (a == null ? void 0 : a.variables) ?? {};
|
|
784
839
|
let s = `https://${this.shopifyDomain}/api/${this.storefrontApiVersion}/graphql.json`;
|
|
785
|
-
const
|
|
786
|
-
|
|
787
|
-
const o = await
|
|
840
|
+
const l = (i = t.match(/query\s+(\w+)/)) == null ? void 0 : i[1];
|
|
841
|
+
l && (s += `?operation_name=${l}`);
|
|
842
|
+
const o = await fetch(s, {
|
|
788
843
|
method: "POST",
|
|
789
844
|
headers: {
|
|
790
845
|
"Content-Type": "application/json",
|
|
@@ -792,158 +847,181 @@ class $e {
|
|
|
792
847
|
},
|
|
793
848
|
body: JSON.stringify({
|
|
794
849
|
query: t,
|
|
795
|
-
variables:
|
|
850
|
+
variables: r
|
|
796
851
|
})
|
|
797
|
-
})
|
|
798
|
-
|
|
799
|
-
throw new Error("Empty graphql response");
|
|
800
|
-
return JSON.parse(o).data;
|
|
852
|
+
});
|
|
853
|
+
return Ae(o, l);
|
|
801
854
|
}
|
|
802
855
|
}
|
|
803
|
-
const
|
|
856
|
+
const Ee = async (e, t, { country: a, language: r }) => {
|
|
804
857
|
const s = t.collectionBreaks;
|
|
805
858
|
if (!t.collectionBreaksEnabled || !s) return;
|
|
806
|
-
let
|
|
807
|
-
s.visibility === "deal-products" ?
|
|
859
|
+
let l;
|
|
860
|
+
s.visibility === "deal-products" ? l = await T(e, {
|
|
808
861
|
country: a,
|
|
809
|
-
language:
|
|
862
|
+
language: r,
|
|
810
863
|
blockVisibility: t.blockVisibility,
|
|
811
864
|
excludedProductGIDs: (t.excludedProductIds || []).map(
|
|
812
|
-
(
|
|
865
|
+
(i) => `gid://shopify/Product/${i}`
|
|
813
866
|
),
|
|
814
867
|
selectedProductGIDs: (t.selectedProductIds || []).map(
|
|
815
|
-
(
|
|
868
|
+
(i) => `gid://shopify/Product/${i}`
|
|
816
869
|
),
|
|
817
870
|
selectedCollectionGIDs: (t.selectedCollectionIds || []).map(
|
|
818
|
-
(
|
|
871
|
+
(i) => `gid://shopify/Collection/${i}`
|
|
819
872
|
)
|
|
820
|
-
}) :
|
|
873
|
+
}) : l = await T(e, {
|
|
821
874
|
country: a,
|
|
822
|
-
language:
|
|
875
|
+
language: r,
|
|
823
876
|
blockVisibility: s.visibility,
|
|
824
877
|
excludedProductGIDs: (s.excludedProducts || []).map(
|
|
825
|
-
({ id:
|
|
878
|
+
({ id: i }) => i
|
|
826
879
|
),
|
|
827
880
|
selectedProductGIDs: (s.selectedProducts || []).map(
|
|
828
|
-
({ id:
|
|
881
|
+
({ id: i }) => i
|
|
829
882
|
),
|
|
830
883
|
selectedCollectionGIDs: (s.selectedCollections || []).map(
|
|
831
|
-
({ id:
|
|
884
|
+
({ id: i }) => i
|
|
832
885
|
)
|
|
833
886
|
});
|
|
834
887
|
let o = await A(e, {
|
|
835
888
|
country: a,
|
|
836
|
-
language:
|
|
837
|
-
productIds:
|
|
889
|
+
language: r,
|
|
890
|
+
productIds: l.map((i) => Number(i.split("/").pop())),
|
|
838
891
|
useExternalMetafieldNamespace: !0
|
|
839
892
|
});
|
|
840
893
|
return o = o.filter(
|
|
841
|
-
(
|
|
894
|
+
(i) => i.availableForSale
|
|
842
895
|
), o;
|
|
843
|
-
},
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
896
|
+
}, Be = ({
|
|
897
|
+
language: e,
|
|
898
|
+
dealBlockId: t
|
|
899
|
+
}) => {
|
|
900
|
+
const a = {
|
|
901
|
+
"system.out_of_stock": "There's not enough items in our stock, please select smaller bundle.",
|
|
902
|
+
"system.invalid_variant": "Sorry, this is not currently available.",
|
|
903
|
+
"system.unavailable_option_value": "Unavailable",
|
|
904
|
+
"system.confirm": "Confirm",
|
|
905
|
+
"system.cancel": "Cancel",
|
|
906
|
+
"system.free": "FREE",
|
|
907
|
+
"system.search": "Search",
|
|
908
|
+
"system.quantity": "Quantity",
|
|
909
|
+
"system.subscription_plan": "Subscription plan",
|
|
910
|
+
"system.remove": "Remove",
|
|
911
|
+
"system.sort_by": "Sort by",
|
|
912
|
+
"system.sort_relevance": "Relevance",
|
|
913
|
+
"system.sort_newest_first": "Newest first",
|
|
914
|
+
"system.sort_price_low_to_high": "Price: Low → High",
|
|
915
|
+
"system.sort_price_high_to_low": "Price: High → Low",
|
|
916
|
+
"system.no_results_found": "No results found",
|
|
917
|
+
"system.no_results_description": "We can't find any item matching your search.",
|
|
918
|
+
"system.clear_search": "Clear search",
|
|
919
|
+
"system.no_products_available": "No products available",
|
|
920
|
+
"system.original_price": "Original price:",
|
|
921
|
+
"system.price": "Price:",
|
|
922
|
+
"system.letters_only": "Only letters are allowed.",
|
|
923
|
+
"system.numbers_only": "Only numbers are allowed.",
|
|
924
|
+
"system.personalisation_required_alert": "Please add personalisation for every item to continue."
|
|
925
|
+
}, r = e ? Ge(e) : void 0;
|
|
926
|
+
return {
|
|
927
|
+
...a,
|
|
928
|
+
...r == null ? void 0 : r.system,
|
|
929
|
+
...r == null ? void 0 : r.dealBlocks[t]
|
|
930
|
+
};
|
|
931
|
+
}, Ge = (e) => {
|
|
932
|
+
var s;
|
|
933
|
+
if (typeof document > "u") return;
|
|
934
|
+
const t = document.querySelector("script#kaching-bundles-translations");
|
|
935
|
+
if (!(t != null && t.textContent)) return;
|
|
936
|
+
let a;
|
|
937
|
+
try {
|
|
938
|
+
a = JSON.parse(t.textContent);
|
|
939
|
+
} catch {
|
|
940
|
+
return;
|
|
941
|
+
}
|
|
942
|
+
const r = V(e);
|
|
943
|
+
return (s = a.find(
|
|
944
|
+
(l) => V(l.locale) === r
|
|
945
|
+
)) == null ? void 0 : s.translations;
|
|
946
|
+
}, V = (e) => e.toLowerCase().replace(/_/g, "-"), Ce = "2026-07", Te = async (e, {
|
|
869
947
|
productId: t,
|
|
870
948
|
dealBlockId: a,
|
|
871
|
-
country:
|
|
949
|
+
country: r = void 0,
|
|
872
950
|
language: s = void 0
|
|
873
951
|
}) => {
|
|
874
|
-
var
|
|
952
|
+
var l, o;
|
|
875
953
|
try {
|
|
876
|
-
const
|
|
877
|
-
|
|
878
|
-
const
|
|
954
|
+
const i = [Number(t.split("/").pop())], d = new Me(e);
|
|
955
|
+
r = r || ((l = d.i18n) == null ? void 0 : l.country), s = s || ((o = d.i18n) == null ? void 0 : o.language);
|
|
956
|
+
const u = await se(d, {
|
|
879
957
|
language: s,
|
|
880
|
-
country:
|
|
958
|
+
country: r,
|
|
881
959
|
useExternalMetafieldNamespace: !0
|
|
882
960
|
});
|
|
883
|
-
|
|
884
|
-
const c =
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
) :
|
|
961
|
+
d.shopifyDomain = u.shopifyDomain;
|
|
962
|
+
const c = u.storefrontAccessToken ? new xe(
|
|
963
|
+
u.shopifyDomain,
|
|
964
|
+
u.storefrontAccessToken
|
|
965
|
+
) : d, [p, g] = await Promise.all([
|
|
888
966
|
A(c, {
|
|
889
|
-
country:
|
|
967
|
+
country: r,
|
|
890
968
|
language: s,
|
|
891
|
-
productIds:
|
|
969
|
+
productIds: i,
|
|
892
970
|
useExternalMetafieldNamespace: !0
|
|
893
971
|
}),
|
|
894
|
-
|
|
972
|
+
Z(c, {
|
|
895
973
|
useExternalMetafieldNamespace: !0,
|
|
896
|
-
useMetaobjects:
|
|
974
|
+
useMetaobjects: u.featureFlags.storefront_metaobjects
|
|
897
975
|
})
|
|
898
|
-
]), y =
|
|
976
|
+
]), y = p[0];
|
|
899
977
|
if (!y)
|
|
900
978
|
return null;
|
|
901
|
-
const h =
|
|
979
|
+
const h = H(g, y);
|
|
902
980
|
let n;
|
|
903
981
|
if (a ? (n = h.find(
|
|
904
982
|
(P) => P.id === a || P.nanoId === a
|
|
905
983
|
), n || (n = h[0])) : n = h[0], !n)
|
|
906
984
|
return null;
|
|
907
|
-
const
|
|
985
|
+
const m = le(n), b = _e(n), [I, _, f, v] = await Promise.all([
|
|
908
986
|
A(c, {
|
|
909
|
-
country:
|
|
987
|
+
country: r,
|
|
910
988
|
language: s,
|
|
911
989
|
productIds: b,
|
|
912
990
|
useExternalMetafieldNamespace: !0
|
|
913
991
|
}),
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
country:
|
|
992
|
+
ne(c, m, 300),
|
|
993
|
+
Ee(c, n, {
|
|
994
|
+
country: r,
|
|
917
995
|
language: s
|
|
918
996
|
}),
|
|
919
|
-
|
|
997
|
+
Be({ language: s, dealBlockId: n.id })
|
|
920
998
|
]);
|
|
921
999
|
return {
|
|
922
1000
|
product: y,
|
|
923
1001
|
dealBlock: n,
|
|
924
|
-
config:
|
|
925
|
-
otherProducts:
|
|
926
|
-
mediaImages:
|
|
927
|
-
collectionBreaksProducts:
|
|
928
|
-
translations:
|
|
1002
|
+
config: u,
|
|
1003
|
+
otherProducts: I,
|
|
1004
|
+
mediaImages: _,
|
|
1005
|
+
collectionBreaksProducts: f ?? [],
|
|
1006
|
+
translations: v
|
|
929
1007
|
};
|
|
930
|
-
} catch (
|
|
931
|
-
return console.error(
|
|
1008
|
+
} catch (i) {
|
|
1009
|
+
return console.error(i), null;
|
|
932
1010
|
}
|
|
933
1011
|
};
|
|
934
|
-
class
|
|
1012
|
+
class Me {
|
|
935
1013
|
constructor(t) {
|
|
936
1014
|
this.storefront = t, this.shopifyDomain = "";
|
|
937
1015
|
}
|
|
938
1016
|
async query(t, a) {
|
|
939
|
-
var
|
|
1017
|
+
var r;
|
|
940
1018
|
if ("query" in this.storefront && "i18n" in this.storefront)
|
|
941
1019
|
return await this.storefront.query(t, a);
|
|
942
1020
|
if ("graphql" in this.storefront) {
|
|
943
1021
|
const s = await this.storefront.graphql(t, a);
|
|
944
|
-
if ((
|
|
1022
|
+
if ((r = s.errors) != null && r.length)
|
|
945
1023
|
throw new Error(
|
|
946
|
-
s.errors.map((
|
|
1024
|
+
s.errors.map((l) => l.message).join(`
|
|
947
1025
|
`)
|
|
948
1026
|
);
|
|
949
1027
|
return s.data;
|
|
@@ -952,7 +1030,7 @@ class Ge {
|
|
|
952
1030
|
return (await this.storefront.request(t, a)).data;
|
|
953
1031
|
if ("shopifyDomain" in this.storefront && "storefrontAccessToken" in this.storefront) {
|
|
954
1032
|
const s = await fetch(
|
|
955
|
-
`https://${this.storefront.shopifyDomain}/api/${
|
|
1033
|
+
`https://${this.storefront.shopifyDomain}/api/${Ce}/graphql.json`,
|
|
956
1034
|
{
|
|
957
1035
|
body: JSON.stringify({
|
|
958
1036
|
query: t,
|
|
@@ -987,32 +1065,32 @@ class Ge {
|
|
|
987
1065
|
return this.storefront.i18n;
|
|
988
1066
|
}
|
|
989
1067
|
}
|
|
990
|
-
const
|
|
1068
|
+
const at = Te, $ = "kaching-bundles-block", U = 1e4, qe = "https://bundles-integrations-dev.kachingappz.dev/kaching-bundles-block.js", je = "https://bundles-integrations.kachingappz.app/kaching-bundles-block.js", N = /* @__PURE__ */ new WeakSet(), Oe = async (e) => {
|
|
991
1069
|
const t = e.document;
|
|
992
1070
|
if (!e.customElements.get($)) {
|
|
993
1071
|
if (N.has(t))
|
|
994
1072
|
return x(e, $);
|
|
995
1073
|
N.add(t);
|
|
996
1074
|
try {
|
|
997
|
-
await
|
|
1075
|
+
await Fe(e);
|
|
998
1076
|
} catch (a) {
|
|
999
1077
|
throw N.delete(t), a;
|
|
1000
1078
|
}
|
|
1001
1079
|
}
|
|
1002
|
-
},
|
|
1080
|
+
}, Ve = () => typeof window < "u" && typeof window.__KACHING_DEV__ < "u", Ue = () => Ve() ? qe : je, Fe = (e) => {
|
|
1003
1081
|
const t = e.document;
|
|
1004
|
-
return new Promise((a,
|
|
1005
|
-
const s =
|
|
1082
|
+
return new Promise((a, r) => {
|
|
1083
|
+
const s = Ue();
|
|
1006
1084
|
if (t.querySelector(
|
|
1007
1085
|
`script[src="${s}"]`
|
|
1008
1086
|
)) {
|
|
1009
|
-
x(e, $).then(a).catch(
|
|
1087
|
+
x(e, $).then(a).catch(r);
|
|
1010
1088
|
return;
|
|
1011
1089
|
}
|
|
1012
1090
|
const o = t.createElement("script");
|
|
1013
|
-
o.src = s, o.onload = () => x(e, $).then(a).catch(
|
|
1091
|
+
o.src = s, o.onload = () => x(e, $).then(a).catch(r), o.onerror = () => r(new Error("Failed to load script")), t.head.appendChild(o);
|
|
1014
1092
|
});
|
|
1015
|
-
}, x = (e, t) => new Promise((a,
|
|
1093
|
+
}, x = (e, t) => new Promise((a, r) => {
|
|
1016
1094
|
if (e.customElements.get(t)) {
|
|
1017
1095
|
a();
|
|
1018
1096
|
return;
|
|
@@ -1020,35 +1098,35 @@ const Xe = xe, $ = "kaching-bundles-block", O = 1e4, Be = "https://bundles-integ
|
|
|
1020
1098
|
Promise.race([
|
|
1021
1099
|
e.customElements.whenDefined(t),
|
|
1022
1100
|
new Promise(
|
|
1023
|
-
(s,
|
|
1024
|
-
() =>
|
|
1101
|
+
(s, l) => setTimeout(
|
|
1102
|
+
() => l(
|
|
1025
1103
|
new Error(
|
|
1026
|
-
`Custom element "${t}" failed to register within ${
|
|
1104
|
+
`Custom element "${t}" failed to register within ${U}ms`
|
|
1027
1105
|
)
|
|
1028
1106
|
),
|
|
1029
|
-
|
|
1107
|
+
U
|
|
1030
1108
|
)
|
|
1031
1109
|
)
|
|
1032
|
-
]).then(() => a()).catch(
|
|
1110
|
+
]).then(() => a()).catch(r);
|
|
1033
1111
|
});
|
|
1034
|
-
var
|
|
1035
|
-
const S = "a-f\\d",
|
|
1036
|
-
function
|
|
1037
|
-
if (typeof e != "string" ||
|
|
1112
|
+
var E = /* @__PURE__ */ ((e) => (e.QuantityBreak = "quantity-break", e.Bxgy = "bxgy", e.Bundle = "bundle", e.MixAndMatch = "mix-and-match", e.Sku = "sku", e))(E || {});
|
|
1113
|
+
const S = "a-f\\d", Le = `#?[${S}]{3}[${S}]?`, Re = `#?[${S}]{6}([${S}]{2})?`, Je = new RegExp(`[^#${S}]`, "gi"), ze = new RegExp(`^${Le}$|^${Re}$`, "i");
|
|
1114
|
+
function Qe(e, t = {}) {
|
|
1115
|
+
if (typeof e != "string" || Je.test(e) || !ze.test(e))
|
|
1038
1116
|
throw new TypeError("Expected a valid hex string");
|
|
1039
1117
|
e = e.replace(/^#/, "");
|
|
1040
1118
|
let a = 1;
|
|
1041
1119
|
e.length === 8 && (a = Number.parseInt(e.slice(6, 8), 16) / 255, e = e.slice(0, 6)), e.length === 4 && (a = Number.parseInt(e.slice(3, 4).repeat(2), 16) / 255, e = e.slice(0, 3)), e.length === 3 && (e = e[0] + e[0] + e[1] + e[1] + e[2] + e[2]);
|
|
1042
|
-
const
|
|
1120
|
+
const r = Number.parseInt(e, 16), s = r >> 16, l = r >> 8 & 255, o = r & 255, i = typeof t.alpha == "number" ? t.alpha : a;
|
|
1043
1121
|
if (t.format === "array")
|
|
1044
|
-
return [s,
|
|
1122
|
+
return [s, l, o, i];
|
|
1045
1123
|
if (t.format === "css") {
|
|
1046
|
-
const
|
|
1047
|
-
return `rgb(${s} ${
|
|
1124
|
+
const d = i === 1 ? "" : ` / ${Number((i * 100).toFixed(2))}%`;
|
|
1125
|
+
return `rgb(${s} ${l} ${o}${d})`;
|
|
1048
1126
|
}
|
|
1049
|
-
return { red: s, green:
|
|
1127
|
+
return { red: s, green: l, blue: o, alpha: i };
|
|
1050
1128
|
}
|
|
1051
|
-
const
|
|
1129
|
+
const He = ({ price: e }) => ({
|
|
1052
1130
|
id: 123,
|
|
1053
1131
|
handle: "123",
|
|
1054
1132
|
url: null,
|
|
@@ -1083,7 +1161,7 @@ const Re = ({ price: e }) => ({
|
|
|
1083
1161
|
text4: null
|
|
1084
1162
|
},
|
|
1085
1163
|
isNativeBundle: !1
|
|
1086
|
-
}),
|
|
1164
|
+
}), Ke = () => ({
|
|
1087
1165
|
shopifyDomain: "",
|
|
1088
1166
|
moneyFormat: "${{amount_with_comma_separator}}",
|
|
1089
1167
|
locale: "en",
|
|
@@ -1139,7 +1217,7 @@ const Re = ({ price: e }) => ({
|
|
|
1139
1217
|
},
|
|
1140
1218
|
shopCustomStyles: "",
|
|
1141
1219
|
featureFlags: {}
|
|
1142
|
-
}),
|
|
1220
|
+
}), We = ({
|
|
1143
1221
|
color: e,
|
|
1144
1222
|
cornerRadius: t
|
|
1145
1223
|
}) => {
|
|
@@ -1193,7 +1271,7 @@ const Re = ({ price: e }) => ({
|
|
|
1193
1271
|
dealBars: [
|
|
1194
1272
|
{
|
|
1195
1273
|
id: "PfFU",
|
|
1196
|
-
dealBarType:
|
|
1274
|
+
dealBarType: E.QuantityBreak,
|
|
1197
1275
|
title: "1 pack",
|
|
1198
1276
|
subtitle: "Standard price",
|
|
1199
1277
|
label: "",
|
|
@@ -1213,7 +1291,7 @@ const Re = ({ price: e }) => ({
|
|
|
1213
1291
|
},
|
|
1214
1292
|
{
|
|
1215
1293
|
id: "1f-9",
|
|
1216
|
-
dealBarType:
|
|
1294
|
+
dealBarType: E.QuantityBreak,
|
|
1217
1295
|
title: "2 pack",
|
|
1218
1296
|
subtitle: "You save {{saved_percentage}}",
|
|
1219
1297
|
label: "SAVE {{saved_total}}",
|
|
@@ -1403,88 +1481,88 @@ const Re = ({ price: e }) => ({
|
|
|
1403
1481
|
imageSize: 48,
|
|
1404
1482
|
imageCornerRadius: 6
|
|
1405
1483
|
};
|
|
1406
|
-
return e !== void 0 && (a.colors.border = { ...
|
|
1407
|
-
},
|
|
1484
|
+
return e !== void 0 && (a.colors.border = { ...Qe(e), alpha: 1 }), a;
|
|
1485
|
+
}, st = ({
|
|
1408
1486
|
data: e,
|
|
1409
1487
|
selectedVariantId: t,
|
|
1410
1488
|
preview: a,
|
|
1411
|
-
onLinesChange:
|
|
1489
|
+
onLinesChange: r,
|
|
1412
1490
|
targetWindow: s
|
|
1413
1491
|
}) => {
|
|
1414
|
-
const
|
|
1492
|
+
const l = B(null), [o, i] = z(!1), d = B(!1);
|
|
1415
1493
|
D(() => {
|
|
1416
|
-
if (!
|
|
1494
|
+
if (!l.current || o) return;
|
|
1417
1495
|
(async () => {
|
|
1418
|
-
await
|
|
1496
|
+
await Oe(s ?? window), i(!0);
|
|
1419
1497
|
})();
|
|
1420
1498
|
}, [o, s]), D(() => {
|
|
1421
|
-
const c =
|
|
1499
|
+
const c = l.current;
|
|
1422
1500
|
if (!o || !c) return;
|
|
1423
|
-
const
|
|
1501
|
+
const p = () => {
|
|
1424
1502
|
const y = c.items().map((h) => ({
|
|
1425
1503
|
merchandiseId: `gid://shopify/ProductVariant/${h.id}`,
|
|
1426
1504
|
quantity: h.quantity,
|
|
1427
|
-
attributes: Object.entries(h.properties).map(([n,
|
|
1505
|
+
attributes: Object.entries(h.properties).map(([n, m]) => ({
|
|
1428
1506
|
key: n,
|
|
1429
|
-
value: String(
|
|
1507
|
+
value: String(m)
|
|
1430
1508
|
})),
|
|
1431
1509
|
sellingPlanId: h.selling_plan ? `gid://shopify/SellingPlan/${h.selling_plan}` : void 0
|
|
1432
1510
|
}));
|
|
1433
|
-
|
|
1511
|
+
r == null || r(y);
|
|
1434
1512
|
};
|
|
1435
|
-
return
|
|
1436
|
-
c.removeEventListener("kaching-bundles-block-loaded",
|
|
1513
|
+
return d.current || (typeof c.items == "function" ? p() : c.addEventListener("kaching-bundles-block-loaded", p), d.current = !0), c.addEventListener("variants-changed", p), () => {
|
|
1514
|
+
c.removeEventListener("kaching-bundles-block-loaded", p), c.removeEventListener("variants-changed", p);
|
|
1437
1515
|
};
|
|
1438
|
-
}, [o,
|
|
1439
|
-
const
|
|
1440
|
-
return
|
|
1441
|
-
const c =
|
|
1442
|
-
if (!(!c || !
|
|
1443
|
-
for (const [
|
|
1444
|
-
c.getAttribute(
|
|
1445
|
-
}),
|
|
1516
|
+
}, [o, r]);
|
|
1517
|
+
const u = e ? Ye(e, t) : a ? Ze(a) : null;
|
|
1518
|
+
return Xe(() => {
|
|
1519
|
+
const c = l.current;
|
|
1520
|
+
if (!(!c || !u))
|
|
1521
|
+
for (const [p, g] of Object.entries(u.jsonAttributes))
|
|
1522
|
+
c.getAttribute(p) !== g && c.setAttribute(p, g);
|
|
1523
|
+
}), u ? /* @__PURE__ */ J(
|
|
1446
1524
|
"kaching-bundles-block",
|
|
1447
1525
|
{
|
|
1448
|
-
ref:
|
|
1449
|
-
"deal-block-id":
|
|
1450
|
-
...
|
|
1451
|
-
"current-variant-id":
|
|
1526
|
+
ref: l,
|
|
1527
|
+
"deal-block-id": u.dealBlockId,
|
|
1528
|
+
...u.jsonAttributes,
|
|
1529
|
+
"current-variant-id": u.currentVariantId
|
|
1452
1530
|
}
|
|
1453
1531
|
) : null;
|
|
1454
|
-
},
|
|
1532
|
+
}, Xe = typeof window > "u" ? D : Q, Ye = ({
|
|
1455
1533
|
config: e,
|
|
1456
1534
|
dealBlock: t,
|
|
1457
1535
|
product: a,
|
|
1458
|
-
otherProducts:
|
|
1536
|
+
otherProducts: r,
|
|
1459
1537
|
mediaImages: s,
|
|
1460
|
-
collectionBreaksProducts:
|
|
1538
|
+
collectionBreaksProducts: l,
|
|
1461
1539
|
translations: o
|
|
1462
|
-
},
|
|
1540
|
+
}, i) => ({
|
|
1463
1541
|
dealBlockId: t.id,
|
|
1464
|
-
currentVariantId:
|
|
1542
|
+
currentVariantId: i ? i.split("/").pop() : String(a.variants[0].id),
|
|
1465
1543
|
jsonAttributes: {
|
|
1466
1544
|
config: JSON.stringify(e),
|
|
1467
1545
|
"deal-block": JSON.stringify(t),
|
|
1468
1546
|
"media-images": JSON.stringify(s),
|
|
1469
1547
|
product: JSON.stringify(a),
|
|
1470
|
-
"other-products": JSON.stringify(
|
|
1471
|
-
"collection-breaks-products": JSON.stringify(
|
|
1548
|
+
"other-products": JSON.stringify(r),
|
|
1549
|
+
"collection-breaks-products": JSON.stringify(l),
|
|
1472
1550
|
translations: JSON.stringify(o)
|
|
1473
1551
|
}
|
|
1474
|
-
}),
|
|
1552
|
+
}), Ze = ({
|
|
1475
1553
|
cornerRadius: e,
|
|
1476
1554
|
color: t,
|
|
1477
1555
|
price: a
|
|
1478
1556
|
}) => {
|
|
1479
|
-
const
|
|
1557
|
+
const r = He({ price: a }), s = Ke(), l = We({ color: t, cornerRadius: e });
|
|
1480
1558
|
return {
|
|
1481
|
-
dealBlockId:
|
|
1482
|
-
currentVariantId: String(
|
|
1559
|
+
dealBlockId: l.id,
|
|
1560
|
+
currentVariantId: String(r.variants[0].id),
|
|
1483
1561
|
jsonAttributes: {
|
|
1484
1562
|
config: JSON.stringify(s),
|
|
1485
|
-
"deal-block": JSON.stringify(
|
|
1563
|
+
"deal-block": JSON.stringify(l),
|
|
1486
1564
|
"media-images": JSON.stringify([]),
|
|
1487
|
-
product: JSON.stringify(
|
|
1565
|
+
product: JSON.stringify(r),
|
|
1488
1566
|
"other-products": JSON.stringify([]),
|
|
1489
1567
|
"collection-breaks-products": JSON.stringify([]),
|
|
1490
1568
|
translations: JSON.stringify({})
|
|
@@ -1492,6 +1570,6 @@ const Re = ({ price: e }) => ({
|
|
|
1492
1570
|
};
|
|
1493
1571
|
};
|
|
1494
1572
|
export {
|
|
1495
|
-
|
|
1496
|
-
|
|
1573
|
+
st as KachingBundle,
|
|
1574
|
+
at as fetchKachingBundlesData
|
|
1497
1575
|
};
|