@kachingappz/bundles-js 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("react/jsx-runtime"),S=require("react"),F=(e,t)=>{const a=[],l=e.filter(n=>n.blockVisibility==="selected-products");for(const n of l)n.selectedProductIds.map(Number).includes(t.id)&&a.push(n);const r=e.filter(n=>n.blockVisibility==="selected-collections");for(const n of r)t.collectionIds.some(m=>n.selectedCollectionIds.map(Number).includes(m))&&a.push(n);const i=e.filter(n=>n.blockVisibility==="excluded-products");for(const n of i)!n.excludedProductIds.map(Number).includes(t.id)&&!(n.excludedCollectionIds||[]).some(m=>t.collectionIds.includes(m))&&a.push(n);const o=e.filter(n=>n.blockVisibility==="all-products");for(const n of o)a.push(n);return a},R=(e,{language:t,country:a})=>{var g,y;const l=L(t,a),r=new Intl.NumberFormat(l,{style:"currency",currency:e,currencyDisplay:"narrowSymbol"}).formatToParts(123456789e-2),i=(g=r.find(p=>p.type==="decimal"))==null?void 0:g.value,o=J((y=r.find(p=>p.type==="group"))==null?void 0:y.value),n=r.some(p=>p.type==="fraction"),m=z(o,i,n),c=r.findIndex(C),d=r.findLastIndex(C);return[...r.slice(0,c).map(E),m,...r.slice(d+1).map(E)].join("")},E=e=>U(e.value),U=e=>e.replace(/\s/g," "),C=e=>e.type==="integer"||e.type==="group"||e.type==="decimal"||e.type==="fraction",L=(e,t)=>e&&t?`${e}-${t.toUpperCase()}`:e||(t?t.toUpperCase():"en"),J=e=>e===void 0?void 0:U(e).replace(/’/g,"'"),z=(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}}",$=({country:e,language:t})=>{const a=[];return e&&a.push(`country: ${e}`),t&&a.push(`language: ${t}`),a.length>0?`@inContext(${a.join(", ")})`:""},Q=async(e,{useExternalMetafieldNamespace:t,useMetaobjects:a})=>a?K(e):H(e),H=async(e,t)=>{var l;const a=(l=(await e.query(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const U=require("react/jsx-runtime"),S=require("react"),F=(e,t)=>{const a=[],l=e.filter(r=>r.blockVisibility==="selected-products");for(const r of l)r.selectedProductIds.map(Number).includes(t.id)&&a.push(r);const s=e.filter(r=>r.blockVisibility==="selected-collections");for(const r of s)t.collectionIds.some(m=>r.selectedCollectionIds.map(Number).includes(m))&&a.push(r);const i=e.filter(r=>r.blockVisibility==="excluded-products");for(const r of i)!r.excludedProductIds.map(Number).includes(t.id)&&!(r.excludedCollectionIds||[]).some(m=>t.collectionIds.includes(m))&&a.push(r);const o=e.filter(r=>r.blockVisibility==="all-products");for(const r of o)a.push(r);return a},R=(e,{language:t,country:a})=>{var f,g;const l=L(t,a),s=new Intl.NumberFormat(l,{style:"currency",currency:e,currencyDisplay:"narrowSymbol"}).formatToParts(123456789e-2),i=(f=s.find(y=>y.type==="decimal"))==null?void 0:f.value,o=J((g=s.find(y=>y.type==="group"))==null?void 0:g.value),r=s.some(y=>y.type==="fraction"),m=z(o,i,r),d=s.findIndex(E),c=s.findLastIndex(E);return[...s.slice(0,d).map(G),m,...s.slice(c+1).map(G)].join("")},G=e=>O(e.value),O=e=>e.replace(/\s/g," "),E=e=>e.type==="integer"||e.type==="group"||e.type==="decimal"||e.type==="fraction",L=(e,t)=>e&&t?`${e}-${t.toUpperCase()}`:e||(t?t.toUpperCase():"en"),J=e=>e===void 0?void 0:O(e).replace(/’/g,"'"),z=(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}}",$=({country:e,language:t})=>{const a=[];return e&&a.push(`country: ${e}`),t&&a.push(`language: ${t}`),a.length>0?`@inContext(${a.join(", ")})`:""},Q=async(e,{useExternalMetafieldNamespace:t,useMetaobjects:a})=>a?K(e):H(e),H=async(e,t)=>{var l;const a=(l=(await e.query(`
2
2
  query FetchDealBlocks($metafieldNamespace: String!) {
3
3
  shop {
4
4
  metafield(namespace: $metafieldNamespace, key: "deal_blocks") {
@@ -6,7 +6,7 @@
6
6
  }
7
7
  }
8
8
  }
9
- `,{variables:{metafieldNamespace:"app--2935586817--kaching_bundles"}})).shop.metafield)==null?void 0:l.value;return a?JSON.parse(a):[]},K=async(e,t)=>{const a="app--2935586817--deal_block",l=[];let r=null;for(;;){const i=await e.query(`
9
+ `,{variables:{metafieldNamespace:"app--2935586817--kaching_bundles"}})).shop.metafield)==null?void 0:l.value;return a?JSON.parse(a):[]},K=async(e,t)=>{const a="app--2935586817--deal_block",l=[];let s=null;for(;;){const i=await e.query(`
10
10
  query FetchDealBlockMetaobjects($type: String!, $cursor: String) {
11
11
  metaobjects(type: $type, first: 250, after: $cursor) {
12
12
  nodes {
@@ -21,7 +21,7 @@
21
21
  }
22
22
  }
23
23
  }
24
- `,{variables:{type:a,cursor:r}});for(const o of i.metaobjects.nodes){const n=o.fields.find(m=>m.key==="settings");n!=null&&n.value&&l.push(JSON.parse(n.value))}if(!i.metaobjects.pageInfo.hasNextPage)break;r=i.metaobjects.pageInfo.endCursor}return l},M=async(e,{country:t,language:a,blockVisibility:l,excludedProductGIDs:r,selectedProductGIDs:i,selectedCollectionGIDs:o,limit:n=1e3})=>{switch(l){case"selected-products":return i.slice(0,n);case"all-products":case"excluded-products":{const m=$({country:t,language:a});let c=[],d=null;for(;c.length<n;){const g=Math.min(n-c.length,250),y=await e.query(`
24
+ `,{variables:{type:a,cursor:s}});for(const o of i.metaobjects.nodes){const r=o.fields.find(m=>m.key==="settings");r!=null&&r.value&&l.push(JSON.parse(r.value))}if(!i.metaobjects.pageInfo.hasNextPage)break;s=i.metaobjects.pageInfo.endCursor}return l},C=async(e,{country:t,language:a,blockVisibility:l,excludedProductGIDs:s,selectedProductGIDs:i,selectedCollectionGIDs:o,limit:r=1e3})=>{switch(l){case"selected-products":return i.slice(0,r);case"all-products":case"excluded-products":{const m=$({country:t,language:a});let d=[],c=null;for(;d.length<r;){const f=Math.min(r-d.length,250),g=await e.query(`
25
25
  query FetchProductGIDs($limit: Int!, $cursor: String) ${m} {
26
26
  products(first: $limit, after: $cursor) {
27
27
  nodes {
@@ -33,7 +33,7 @@
33
33
  }
34
34
  }
35
35
  }
36
- `,{variables:{limit:g,cursor:d}});if(c.push(...y.products.nodes.map(p=>p.id)),!y.products.pageInfo.hasNextPage)break;d=y.products.pageInfo.endCursor}if(l==="excluded-products"){const g=new Set(r);c=c.filter(y=>!g.has(y))}return c}case"selected-collections":{const m=$({country:t,language:a}),c=(await e.query(`
36
+ `,{variables:{limit:f,cursor:c}});if(d.push(...g.products.nodes.map(y=>y.id)),!g.products.pageInfo.hasNextPage)break;c=g.products.pageInfo.endCursor}if(l==="excluded-products"){const f=new Set(s);d=d.filter(g=>!f.has(g))}return d}case"selected-collections":{const m=$({country:t,language:a}),d=(await e.query(`
37
37
  query FetchCollectionProductGIDs($collectionGIDs: [ID!]!, $limit: Int!) ${m} {
38
38
  nodes(ids: $collectionGIDs) {
39
39
  ... on Collection {
@@ -45,7 +45,7 @@
45
45
  }
46
46
  }
47
47
  }
48
- `,{variables:{collectionGIDs:o,limit:Math.min(n,250)}})).nodes.filter(d=>d!==null).flatMap(d=>d.products.nodes.map(g=>g.id));return Array.from(new Set(c)).slice(0,n)}}},V=`
48
+ `,{variables:{collectionGIDs:o,limit:Math.min(r,250)}})).nodes.filter(c=>c!==null).flatMap(c=>c.products.nodes.map(f=>f.id));return Array.from(new Set(d)).slice(0,r)}}},V=`
49
49
  id
50
50
  availableForSale
51
51
  price {
@@ -88,8 +88,8 @@
88
88
  }
89
89
  }
90
90
  quantityAvailable @include(if: $includeAvailableQuantity)
91
- `,A=async(e,{country:t,language:a,productIds:l,includeSellingPlans:r=!0,includeAvailableQuantity:i=!0,useExternalMetafieldNamespace:o=!1,batchSize:n=250,onBatchError:m})=>{if(!l.length)return[];const c=l.map(u=>typeof u=="string"&&u.startsWith("gid://")?u:`gid://shopify/Product/${u}`),d=$({country:t,language:a}),g=`
92
- query FetchProducts($productGIDs: [ID!]!, $includeSellingPlans: Boolean!, $includeAvailableQuantity: Boolean!, $metafieldNamespace: String!) ${d} {
91
+ `,A=async(e,{country:t,language:a,productIds:l,includeSellingPlans:s=!0,includeAvailableQuantity:i=!0,useExternalMetafieldNamespace:o=!1,batchSize:r=250,onBatchError:m})=>{if(!l.length)return[];const d=l.map(u=>typeof u=="string"&&u.startsWith("gid://")?u:`gid://shopify/Product/${u}`),c=$({country:t,language:a}),f=`
92
+ query FetchProducts($productGIDs: [ID!]!, $includeSellingPlans: Boolean!, $includeAvailableQuantity: Boolean!, $metafieldNamespace: String!) ${c} {
93
93
  shop {
94
94
  currencyRateConstant: metafield(namespace: $metafieldNamespace, key: "currency_rate_constant") {
95
95
  value
@@ -175,7 +175,7 @@
175
175
  }
176
176
  }
177
177
  }
178
- `,y=o?"app--2935586817--kaching_bundles":"$app:kaching_bundles",p=[],h=Math.min(n,250);for(let u=0;u<c.length;u+=h)p.push(c.slice(u,u+h));let s=1;const f=async u=>{const v=await e.query(g,{variables:{productGIDs:u,includeSellingPlans:r,includeAvailableQuantity:i,metafieldNamespace:y}});return v.shop.currencyRateConstant&&(s=JSON.parse(v.shop.currencyRateConstant.value).amount/1e6),v};let b;if(m){const u=await Promise.allSettled(p.map(f));for(const v of u)v.status==="rejected"&&m(v.reason instanceof Error?v.reason:new Error(String(v.reason)));b=u.filter(v=>v.status==="fulfilled").flatMap(v=>v.value.nodes)}else b=(await Promise.all(p.map(f))).flatMap(u=>u.nodes);const _=b.filter(u=>u!=null);if(m){const u=await Promise.allSettled(_.map(async P=>{const I=await T(e,P,{includeSellingPlans:r,includeAvailableQuantity:i},d);return q(I,e.shopifyDomain,s)})),v=[];for(const P of u)P.status==="fulfilled"?v.push(P.value):m(P.reason instanceof Error?P.reason:new Error(String(P.reason)));return v}return(await Promise.all(_.map(u=>T(e,u,{includeSellingPlans:r,includeAvailableQuantity:i},d)))).map(u=>q(u,e.shopifyDomain,s))},T=async(e,t,a,l="")=>{if(t.variants.nodes.length<250)return t;const r=new Set,i=[],o=[],n=async m=>{let c=!0,d=null;for(;c;){const g=await e.query(`
178
+ `,g=o?"app--2935586817--kaching_bundles":"$app:kaching_bundles",y=[],h=Math.min(r,250);for(let u=0;u<d.length;u+=h)y.push(d.slice(u,u+h));let n=1;const p=async u=>{const v=await e.query(f,{variables:{productGIDs:u,includeSellingPlans:s,includeAvailableQuantity:i,metafieldNamespace:g}});return v.shop.currencyRateConstant&&(n=JSON.parse(v.shop.currencyRateConstant.value).amount/1e6),v};let b;if(m){const u=await Promise.allSettled(y.map(p));for(const v of u)v.status==="rejected"&&m(v.reason instanceof Error?v.reason:new Error(String(v.reason)));b=u.filter(v=>v.status==="fulfilled").flatMap(v=>v.value.nodes)}else b=(await Promise.all(y.map(p))).flatMap(u=>u.nodes);const _=b.filter(u=>u!=null);if(m){const u=await Promise.allSettled(_.map(async I=>{const P=await M(e,I,{includeSellingPlans:s,includeAvailableQuantity:i},c);return T(P,e.shopifyDomain,n)})),v=[];for(const I of u)I.status==="fulfilled"?v.push(I.value):m(I.reason instanceof Error?I.reason:new Error(String(I.reason)));return v}return(await Promise.all(_.map(u=>M(e,u,{includeSellingPlans:s,includeAvailableQuantity:i},c)))).map(u=>T(u,e.shopifyDomain,n))},M=async(e,t,a,l="")=>{if(t.variants.nodes.length<250)return t;const s=new Set,i=[],o=[],r=async m=>{let d=!0,c=null;for(;d;){const f=await e.query(`
179
179
  query($productGID: ID!, $cursor: String, $reverse: Boolean, $includeSellingPlans: Boolean!, $includeAvailableQuantity: Boolean!) ${l} {
180
180
  product(id: $productGID) {
181
181
  variants(first: 250, after: $cursor, reverse: $reverse) {
@@ -189,7 +189,7 @@
189
189
  }
190
190
  }
191
191
  }
192
- `,{variables:{productGID:t.id,cursor:d,reverse:m,...a}}),{nodes:y,pageInfo:p}=g.product.variants;for(const h of y){if(r.has(h.id)){c=!1;break}r.add(h.id),m?o.push(h):i.push(h)}p.hasNextPage||(c=!1),d=p.endCursor}};return await Promise.all([n(!1),n(!0)]),t.variants.nodes=[...i,...o.reverse()],t},q=(e,t,a)=>{var c,d,g,y,p,h;const l=e.variants.nodes.map(({unitPriceMeasurement:s,...f})=>{var b,_;return{id:Number(f.id.split("/").pop()),availableForSale:f.availableForSale,price:Math.round(Number(f.price.amount)*100),compareAtPrice:f.compareAtPrice?Math.round(Number(f.compareAtPrice.amount)*100):null,options:f.selectedOptions.map(u=>u.value),imageId:f.image?Number(f.image.id.split("/").pop()):null,image:((b=f.image)==null?void 0:b.url)||null,sellingPlans:((_=f.sellingPlanAllocations)==null?void 0:_.nodes.map(u=>({id:Number(u.sellingPlan.id.split("/").pop()),price:u.priceAdjustments.length>0?Math.round(Number(u.priceAdjustments[0].price.amount)*100):Math.round(Number(f.price.amount)*100),compareAtPrice:u.priceAdjustments.length>0?Math.round(Number(u.priceAdjustments[0].compareAtPrice.amount)*100):Math.round(Number(f.price.amount)*100),perDeliveryPrice:u.priceAdjustments.length>0?Math.round(Number(u.priceAdjustments[0].perDeliveryPrice.amount)*100):Math.round(Number(f.price.amount)*100)})))||[],inventoryManagement:null,inventoryPolicy:null,inventoryQuantity:f.quantityAvailable??null,unitPriceMeasurement:s!=null&&s.quantityUnit&&(s!=null&&s.referenceUnit)?{quantityValue:s.quantityValue,quantityUnit:s.quantityUnit.toLowerCase(),referenceValue:s.referenceValue,referenceUnit:s.referenceUnit.toLowerCase()}:null}}),r=e.options.map((s,f)=>{const b=s.optionValues.map(_=>{var u,v,P,I;return{id:Number(_.id.split("/").pop()),defaultName:_.name,name:_.name,swatch:{color:((u=_.swatch)==null?void 0:u.color)||null,image:((I=(P=(v=_.swatch)==null?void 0:v.image)==null?void 0:P.previewImage)==null?void 0:I.url)||null}}});return{defaultName:s.name,name:s.name,position:f+1,optionValues:W(b,f,l)}}),i=s=>{const f=s.priceAdjustments[0];if(!f)return null;const b=f.adjustmentValue;switch(b.__typename){case"SellingPlanPercentagePriceAdjustment":return{type:"percentage",value:b.adjustmentPercentage};case"SellingPlanFixedAmountPriceAdjustment":return{type:"fixed_amount",value:o(b.adjustmentAmount.amount)};case"SellingPlanFixedPriceAdjustment":return{type:"price",value:o(b.price.amount)};default:throw new Error(`Unknown price adjustment type: ${b.__typename}`)}},o=s=>a===1?Number(s)*100:Math.round(Number(s)*100*a),n=((c=e.sellingPlanGroups)==null?void 0:c.nodes.flatMap(s=>s.sellingPlans.nodes.map(f=>({id:Number(f.id.split("/").pop()),name:f.name,priceAdjustment:i(f)}))))||[],m=e.variants.nodes.some(s=>s.requiresComponents);return{id:Number(e.id.split("/").pop()),handle:e.handle,url:e.onlineStoreUrl||`https://${t}/products/${e.handle}`,availableForSale:e.availableForSale,createdAt:e.createdAt,title:e.title,image:((d=e.featuredImage)==null?void 0:d.url)||null,collectionIds:e.collections.nodes.map(s=>Number(s.id.split("/").pop())),options:r,selectedVariantId:Number(e.variants.nodes[0].id.split("/").pop()),variants:l,requiresSellingPlan:e.requiresSellingPlan,sellingPlans:n,isNativeBundle:m,metafields:{text:((g=e.metafield)==null?void 0:g.value)||null,text2:((y=e.metafield2)==null?void 0:y.value)||null,text3:((p=e.metafield3)==null?void 0:p.value)||null,text4:((h=e.metafield4)==null?void 0:h.value)||null}}},W=(e,t,a)=>e.filter(l=>a.filter(r=>r.options[t]===l.name).length>0),O="app--2935586817",X=async(e,{language:t,country:a,useExternalMetafieldNamespace:l})=>{const r=`${O}--kaching_bundles`,i=O,o=$({country:a}),{localization:{country:{currency:{isoCode:n}}},shop:{moneyFormat:m,paymentSettings:{currencyCode:c},currencyRateConstant:d,primaryDomain:g,settingsMetafield:y}}=await e.query(`
192
+ `,{variables:{productGID:t.id,cursor:c,reverse:m,...a}}),{nodes:g,pageInfo:y}=f.product.variants;for(const h of g){if(s.has(h.id)){d=!1;break}s.add(h.id),m?o.push(h):i.push(h)}y.hasNextPage||(d=!1),c=y.endCursor}};return await Promise.all([r(!1),r(!0)]),t.variants.nodes=[...i,...o.reverse()],t},T=(e,t,a)=>{var d,c,f,g,y,h;const l=e.variants.nodes.map(({unitPriceMeasurement:n,...p})=>{var b,_;return{id:Number(p.id.split("/").pop()),availableForSale:p.availableForSale,price:Math.round(Number(p.price.amount)*100),compareAtPrice:p.compareAtPrice?Math.round(Number(p.compareAtPrice.amount)*100):null,options:p.selectedOptions.map(u=>u.value),imageId:p.image?Number(p.image.id.split("/").pop()):null,image:((b=p.image)==null?void 0:b.url)||null,sellingPlans:((_=p.sellingPlanAllocations)==null?void 0:_.nodes.map(u=>({id:Number(u.sellingPlan.id.split("/").pop()),price:u.priceAdjustments.length>0?Math.round(Number(u.priceAdjustments[0].price.amount)*100):Math.round(Number(p.price.amount)*100),compareAtPrice:u.priceAdjustments.length>0?Math.round(Number(u.priceAdjustments[0].compareAtPrice.amount)*100):Math.round(Number(p.price.amount)*100),perDeliveryPrice:u.priceAdjustments.length>0?Math.round(Number(u.priceAdjustments[0].perDeliveryPrice.amount)*100):Math.round(Number(p.price.amount)*100)})))||[],inventoryManagement:null,inventoryPolicy:null,inventoryQuantity:p.quantityAvailable??null,unitPriceMeasurement:n!=null&&n.quantityUnit&&(n!=null&&n.referenceUnit)?{quantityValue:n.quantityValue,quantityUnit:n.quantityUnit.toLowerCase(),referenceValue:n.referenceValue,referenceUnit:n.referenceUnit.toLowerCase()}:null}}),s=e.options.map((n,p)=>{const b=n.optionValues.map(_=>{var u,v,I,P;return{id:Number(_.id.split("/").pop()),defaultName:_.name,name:_.name,swatch:{color:((u=_.swatch)==null?void 0:u.color)||null,image:((P=(I=(v=_.swatch)==null?void 0:v.image)==null?void 0:I.previewImage)==null?void 0:P.url)||null}}});return{defaultName:n.name,name:n.name,position:p+1,optionValues:W(b,p,l)}}),i=n=>{const p=n.priceAdjustments[0];if(!p)return null;const b=p.adjustmentValue;switch(b.__typename){case"SellingPlanPercentagePriceAdjustment":return{type:"percentage",value:b.adjustmentPercentage};case"SellingPlanFixedAmountPriceAdjustment":return{type:"fixed_amount",value:o(b.adjustmentAmount.amount)};case"SellingPlanFixedPriceAdjustment":return{type:"price",value:o(b.price.amount)};default:throw new Error(`Unknown price adjustment type: ${b.__typename}`)}},o=n=>a===1?Number(n)*100:Math.round(Number(n)*100*a),r=((d=e.sellingPlanGroups)==null?void 0:d.nodes.flatMap(n=>n.sellingPlans.nodes.map(p=>({id:Number(p.id.split("/").pop()),name:p.name,priceAdjustment:i(p)}))))||[],m=e.variants.nodes.some(n=>n.requiresComponents);return{id:Number(e.id.split("/").pop()),handle:e.handle,url:e.onlineStoreUrl||`https://${t}/products/${e.handle}`,availableForSale:e.availableForSale,createdAt:e.createdAt,title:e.title,image:((c=e.featuredImage)==null?void 0:c.url)||null,collectionIds:e.collections.nodes.map(n=>Number(n.id.split("/").pop())),options:s,selectedVariantId:Number(e.variants.nodes[0].id.split("/").pop()),variants:l,requiresSellingPlan:e.requiresSellingPlan,sellingPlans:r,isNativeBundle:m,metafields:{text:((f=e.metafield)==null?void 0:f.value)||null,text2:((g=e.metafield2)==null?void 0:g.value)||null,text3:((y=e.metafield3)==null?void 0:y.value)||null,text4:((h=e.metafield4)==null?void 0:h.value)||null}}},W=(e,t,a)=>e.filter(l=>a.filter(s=>s.options[t]===l.name).length>0),q="app--2935586817",X=async(e,{language:t,country:a,useExternalMetafieldNamespace:l})=>{const s=`${q}--kaching_bundles`,i=q,o=$({country:a}),{localization:{country:{currency:{isoCode:r}}},shop:{moneyFormat:m,paymentSettings:{currencyCode:d},currencyRateConstant:c,primaryDomain:f,settingsMetafield:g}}=await e.query(`
193
193
  query config($metafieldNamespace: String!, $settingsNamespace: String!) ${o} {
194
194
  localization {
195
195
  country {
@@ -214,7 +214,7 @@
214
214
  }
215
215
  }
216
216
  }
217
- `,{variables:{metafieldNamespace:r,settingsNamespace:i}}),p=n===c?m:R(n,{language:t,country:a}),h=d?Y(d.value):1,s=y?JSON.parse(y.value):null,f=(s==null?void 0:s.feature_flags)??{},b=(s==null?void 0:s.custom_selectors)??{};return{shopifyDomain:g.host,moneyFormat:p,locale:(t==null?void 0:t.toLowerCase())||"en",liquidLocale:(t==null?void 0:t.toLowerCase())||"en",country:a??"US",currencyRate:h,marketId:0,productId:null,storefrontAccessToken:(s==null?void 0:s.storefront_access_token)??null,includeSellingPlans:(s==null?void 0:s.include_selling_plans)??!1,includeAvailableQuantity:(s==null?void 0:s.include_available_quantity)??!1,customApiHost:(s==null?void 0:s.custom_api_host)??null,keepQuantityInput:(s==null?void 0:s.keep_quantity_input)??!1,ignoreDeselect:(s==null?void 0:s.ignore_deselect)??!1,ignoreUnitPrice:(s==null?void 0:s.ignore_unit_price)??!1,requireCustomerLogin:(s==null?void 0:s.require_customer_login)??!1,abTestsRunning:(s==null?void 0:s.ab_tests_running)??!1,webPixel:(s==null?void 0:s.web_pixel)??!1,b2bCustomer:!1,isLoggedIn:!1,preview:!1,previewAlerts:!1,previewScratchOff:!1,defaultTranslations:{"system.out_of_stock":"Out of stock","system.invalid_variant":"Invalid variant","system.unavailable_option_value":"Unavailable option value","system.confirm":"Confirm","system.cancel":"Cancel","system.free":"FREE","system.search":"Search","system.quantity":"Quantity","system.subscription_plan":"Subscription plan","system.remove":"Remove","system.sort_by":"Sort by","system.sort_relevance":"Relevance","system.sort_newest_first":"Newest first","system.sort_price_low_to_high":"Price: Low → High","system.sort_price_high_to_low":"Price: High → Low","system.no_results_found":"No results found","system.no_results_description":"We can't find any item matching your search.","system.clear_search":"Clear search","system.no_products_available":"No products available","system.original_price":"Original price:","system.price":"Price:","system.letters_only":"Only letters are allowed.","system.numbers_only":"Only numbers are allowed."},customSelectors:{quantity:b.quantity??null,addToCartButton:b.add_to_cart_button??null,variantPicker:b.variant_picker??null,price:b.price??null,priceCompare:b.price_compare??null},shopCustomStyles:(s==null?void 0:s.shop_custom_styles)??"",featureFlags:f,brandColors:(s==null?void 0:s.brand_colors)??null}},Y=e=>JSON.parse(e).amount/1e6,Z=async(e,t,a=200)=>(t=t.filter(Boolean).filter(l=>!l.startsWith("placeholder")),t.length===0?[]:(await e.query(`
217
+ `,{variables:{metafieldNamespace:s,settingsNamespace:i}}),y=r===d?m:R(r,{language:t,country:a}),h=c?Y(c.value):1,n=g?JSON.parse(g.value):null,p=(n==null?void 0:n.feature_flags)??{},b=(n==null?void 0:n.custom_selectors)??{};return{shopifyDomain:f.host,moneyFormat:y,locale:(t==null?void 0:t.toLowerCase())||"en",liquidLocale:(t==null?void 0:t.toLowerCase())||"en",country:a??"US",currencyRate:h,marketId:0,productId:null,storefrontAccessToken:(n==null?void 0:n.storefront_access_token)??null,includeSellingPlans:(n==null?void 0:n.include_selling_plans)??!1,includeAvailableQuantity:(n==null?void 0:n.include_available_quantity)??!1,customApiHost:(n==null?void 0:n.custom_api_host)??null,keepQuantityInput:(n==null?void 0:n.keep_quantity_input)??!1,ignoreDeselect:(n==null?void 0:n.ignore_deselect)??!1,ignoreUnitPrice:(n==null?void 0:n.ignore_unit_price)??!1,requireCustomerLogin:(n==null?void 0:n.require_customer_login)??!1,abTestsRunning:(n==null?void 0:n.ab_tests_running)??!1,webPixel:(n==null?void 0:n.web_pixel)??!1,b2bCustomer:!1,isLoggedIn:!1,preview:!1,previewAlerts:!1,previewScratchOff:!1,defaultTranslations:{"system.out_of_stock":"Out of stock","system.invalid_variant":"Invalid variant","system.unavailable_option_value":"Unavailable option value","system.confirm":"Confirm","system.cancel":"Cancel","system.free":"FREE","system.search":"Search","system.quantity":"Quantity","system.subscription_plan":"Subscription plan","system.remove":"Remove","system.sort_by":"Sort by","system.sort_relevance":"Relevance","system.sort_newest_first":"Newest first","system.sort_price_low_to_high":"Price: Low → High","system.sort_price_high_to_low":"Price: High → Low","system.no_results_found":"No results found","system.no_results_description":"We can't find any item matching your search.","system.clear_search":"Clear search","system.no_products_available":"No products available","system.original_price":"Original price:","system.price":"Price:","system.letters_only":"Only letters are allowed.","system.numbers_only":"Only numbers are allowed."},customSelectors:{quantity:b.quantity??null,addToCartButton:b.add_to_cart_button??null,variantPicker:b.variant_picker??null,price:b.price??null,priceCompare:b.price_compare??null},shopCustomStyles:(n==null?void 0:n.shop_custom_styles)??"",featureFlags:p,brandColors:(n==null?void 0:n.brand_colors)??null}},Y=e=>JSON.parse(e).amount/1e6,Z=async(e,t,a=200)=>(t=t.filter(Boolean).filter(l=>!l.startsWith("placeholder")),t.length===0?[]:(await e.query(`
218
218
  query FetchMediaImages($mediaImageIds: [ID!]!, $size: Int!) {
219
219
  nodes(ids: $mediaImageIds) {
220
220
  ... on MediaImage {
@@ -225,4 +225,5 @@
225
225
  }
226
226
  }
227
227
  }
228
- `,{variables:{mediaImageIds:t,size:a}})).nodes.filter(Boolean).map(l=>({gid:l.id,url:l.image.url})));var w=(e=>(e.QuantityBreak="quantity-break",e.Bxgy="bxgy",e.Bundle="bundle",e.MixAndMatch="mix-and-match",e.Sku="sku",e))(w||{});const ee=e=>[...te(e),...ae(e),...se(e),...le(e),...ne(e),...re(e),...ie(e),...oe(e),...ce(e),...ue(e),...de(e),...me(e),...pe(e)].filter(t=>t!=null&&!t.includes("placeholder")),te=e=>e.dealBars.flatMap(t=>[t.mediaImageGID,t.badgeImageGID]).filter(t=>t!=null),ae=e=>e.dealBars.flatMap(t=>t.dealBarType===w.Bundle?t.bundleProducts.map(a=>a.mediaImageGID):[]).filter(t=>t!=null),se=e=>e.dealBars.map(({freeGifts:t})=>(t||[]).map(a=>a.mediaImageGID)).reduce((t,a)=>t.concat(a),[]).filter(t=>t!=null),le=e=>e.dealBars.flatMap(({multipleGiftsSelectors:t})=>(t||[]).map(a=>a.mediaImageGID)).filter(t=>t!=null),ne=e=>e.dealBars.map(({upsells:t})=>(t||[]).map(a=>a.mediaImageGID)).reduce((t,a)=>t.concat(a),[]).filter(t=>t!=null),re=e=>e.swatchOptions?e.swatchOptions.reduce((t,a)=>{const l=a.images.map(r=>r.mediaImageGID).filter(r=>r!=null);return[...t,...l]},[]):[],ie=e=>{if(!e.collectionBreaksEnabled||!e.collectionBreaks)return[];const t=e.collectionBreaks.mediaImageGID;return t?[t]:[]},oe=e=>{var t,a,l;return e.progressiveGifts?[...((t=e.progressiveGifts.gifts)==null?void 0:t.map(r=>r.mediaImageGID))||[],(a=e.progressiveGifts.style)==null?void 0:a.lockedMediaImageGID,(l=e.progressiveGifts.dealBarStyle)==null?void 0:l.lockedMediaImageGID].filter(r=>r!=null):[]},ce=e=>!e.checkboxUpsellsEnabled||!e.checkboxUpsells?[]:e.checkboxUpsells.upsells.flatMap(t=>[t.mediaImageGID,t.badgeImageGID]).filter(t=>t!=null),ue=e=>e.dealBars.map(t=>{var a;return(a=t.productPersonalisation)==null?void 0:a.mediaImageGID}).filter(t=>t!=null),de=e=>{var l,r;const t=e.dealBars.map(i=>{var o;return(o=i.highlights)==null?void 0:o.customIconGID}).filter(i=>i!=null),a=(r=(l=e.subscriptions)==null?void 0:l.highlights)==null?void 0:r.customIconGID;return a?[...t,a]:t},me=e=>(e.badges||[]).flatMap(t=>t.badgeType==="custom"&&t.imageGID?[t.imageGID]:[]),pe=e=>!e.savingsSummaryEnabled||!e.savingsSummary?[]:e.savingsSummary.customIconGID?[e.savingsSummary.customIconGID]:[],fe=e=>{const t=[...ye(e),...ge(e),...he(e),...be(e),...ve(e),..._e(e),...Pe(e),...Ie(e)];return Array.from(new Set(t.filter(a=>a!=null)))},ye=e=>e.dealBars.flatMap(({freeGifts:t})=>t?t.map(a=>a.productGID):[]).filter(t=>t!=null),ge=e=>e.dealBars.flatMap(({multipleGiftsSelectors:t})=>t?t.flatMap(a=>a.products?a.products.map(l=>l.id):[]):[]).filter(t=>t!=null),he=e=>{var t;return e.progressiveGiftsEnabled?((t=e.progressiveGifts)==null?void 0:t.gifts.map(a=>a.productGID).filter(a=>a!=null))||[]:[]},be=e=>e.dealBars.flatMap(({upsells:t})=>t?t.map(a=>a.productGID):[]).filter(t=>t!=null),ve=e=>e.dealBars.filter(t=>t.dealBarType===w.Bundle).flatMap(({bundleProducts:t})=>t?t.map(a=>a.productGID):[]).filter(t=>t!=null).filter(t=>t!=="default"),_e=e=>e.dealBars.filter(t=>t.dealBarType===w.MixAndMatch).flatMap(({bundleProducts:t})=>t?t.flatMap(a=>{var l;return[a.productGID,...((l=a.selectedProducts)==null?void 0:l.map(r=>r.id))??[]]}):[]).filter(t=>t!=null).filter(t=>t!=="default"),Pe=e=>!e.checkboxUpsellsEnabled||!e.checkboxUpsells?[]:e.checkboxUpsells.upsells.map(t=>t.productGID).filter(t=>t!=null),Ie=e=>e.dealBars.filter(t=>t.dealBarType===w.Sku).flatMap(({productGID:t})=>t?[t]:[]);class Se{constructor(t,a){this.storefrontApiVersion="2026-07",this.storefrontAccessToken=a,this.shopifyDomain=t}async query(t,a){var n;const l=(a==null?void 0:a.variables)??{};let r=`https://${this.shopifyDomain}/api/${this.storefrontApiVersion}/graphql.json`;const i=(n=t.match(/query\s+(\w+)/))==null?void 0:n[1];i&&(r+=`?operation_name=${i}`);const o=await(await fetch(r,{method:"POST",headers:{"Content-Type":"application/json","X-Shopify-Storefront-Access-Token":this.storefrontAccessToken},body:JSON.stringify({query:t,variables:l})})).text();if(!o)throw new Error("Empty graphql response");return JSON.parse(o).data}}const ke=async(e,t,{country:a,language:l})=>{const r=t.collectionBreaks;if(!t.collectionBreaksEnabled||!r)return;let i;r.visibility==="deal-products"?i=await M(e,{country:a,language:l,blockVisibility:t.blockVisibility,excludedProductGIDs:(t.excludedProductIds||[]).map(n=>`gid://shopify/Product/${n}`),selectedProductGIDs:(t.selectedProductIds||[]).map(n=>`gid://shopify/Product/${n}`),selectedCollectionGIDs:(t.selectedCollectionIds||[]).map(n=>`gid://shopify/Collection/${n}`)}):i=await M(e,{country:a,language:l,blockVisibility:r.visibility,excludedProductGIDs:(r.excludedProducts||[]).map(({id:n})=>n),selectedProductGIDs:(r.selectedProducts||[]).map(({id:n})=>n),selectedCollectionGIDs:(r.selectedCollections||[]).map(({id:n})=>n)});let o=await A(e,{country:a,language:l,productIds:i.map(n=>Number(n.split("/").pop())),useExternalMetafieldNamespace:!0});return o=o.filter(n=>n.availableForSale),o},we=()=>({"system.out_of_stock":"There's not enough items in our stock, please select smaller bundle.","system.invalid_variant":"Sorry, this is not currently available.","system.unavailable_option_value":"Unavailable","system.confirm":"Confirm","system.cancel":"Cancel","system.free":"FREE","system.search":"Search","system.quantity":"Quantity","system.subscription_plan":"Subscription plan","system.remove":"Remove","system.sort_by":"Sort by","system.sort_relevance":"Relevance","system.sort_newest_first":"Newest first","system.sort_price_low_to_high":"Price: Low → High","system.sort_price_high_to_low":"Price: High → Low","system.no_results_found":"No results found","system.no_results_description":"We can't find any item matching your search.","system.clear_search":"Clear search","system.no_products_available":"No products available","system.original_price":"Original price:","system.price":"Price:","system.letters_only":"Only letters are allowed.","system.numbers_only":"Only numbers are allowed.","system.personalisation_required_alert":"Please add personalisation for every item to continue."}),$e="2026-07",Ne=async(e,{productId:t,dealBlockId:a,country:l=void 0,language:r=void 0})=>{var i,o;try{const n=[Number(t.split("/").pop())],m=new De(e);l=l||((i=m.i18n)==null?void 0:i.country),r=r||((o=m.i18n)==null?void 0:o.language);const c=await X(m,{language:r,country:l,useExternalMetafieldNamespace:!0});m.shopifyDomain=c.shopifyDomain;const d=c.storefrontAccessToken?new Se(c.shopifyDomain,c.storefrontAccessToken):m,[g,y]=await Promise.all([A(d,{country:l,language:r,productIds:n,useExternalMetafieldNamespace:!0}),Q(d,{useExternalMetafieldNamespace:!0,useMetaobjects:c.featureFlags.storefront_metaobjects})]),p=g[0];if(!p)return null;const h=F(y,p);let s;if(a?(s=h.find(I=>I.id===a||I.nanoId===a),s||(s=h[0])):s=h[0],!s)return null;const f=ee(s),b=fe(s),[_,u,v,P]=await Promise.all([A(d,{country:l,language:r,productIds:b,useExternalMetafieldNamespace:!0}),Z(d,f,300),ke(d,s,{country:l,language:r}),we()]);return{product:p,dealBlock:s,config:c,otherProducts:_,mediaImages:u,collectionBreaksProducts:v??[],translations:P}}catch(n){return console.error(n),null}};class De{constructor(t){this.storefront=t,this.shopifyDomain=""}async query(t,a){if("query"in this.storefront&&"i18n"in this.storefront)return await this.storefront.query(t,a);if("request"in this.storefront)return(await this.storefront.request(t,a)).data;if("shopifyDomain"in this.storefront&&"storefrontAccessToken"in this.storefront){const l=await fetch(`https://${this.storefront.shopifyDomain}/api/${$e}/graphql.json`,{body:JSON.stringify({query:t,variables:a==null?void 0:a.variables}),headers:{"Content-Type":"application/json","X-Shopify-Storefront-Access-Token":this.storefront.storefrontAccessToken},method:"POST"});if(!l.ok)throw new Error(l.statusText);return(await l.json()).data}else{const l=await fetch(this.storefront.getStorefrontApiUrl(),{body:JSON.stringify({query:t,variables:a==null?void 0:a.variables}),headers:this.storefront.getPublicTokenHeaders(),method:"POST"});if(!l.ok)throw new Error(l.statusText);return(await l.json()).data}}get i18n(){if("i18n"in this.storefront)return this.storefront.i18n}}const Ae=Ne,N="kaching-bundles-block",j=1e4,xe="https://bundles-integrations-dev.kachingappz.dev/kaching-bundles-block.js",Ge="https://bundles-integrations.kachingappz.app/kaching-bundles-block.js",D=new WeakSet,Be=async e=>{const t=e.document;if(!e.customElements.get(N)){if(D.has(t))return x(e,N);D.add(t);try{await Me(e)}catch(a){throw D.delete(t),a}}},Ee=()=>typeof window<"u"&&typeof window.__KACHING_DEV__<"u",Ce=()=>Ee()?xe:Ge,Me=e=>{const t=e.document;return new Promise((a,l)=>{const r=Ce();if(t.querySelector(`script[src="${r}"]`)){x(e,N).then(a).catch(l);return}const o=t.createElement("script");o.src=r,o.onload=()=>x(e,N).then(a).catch(l),o.onerror=()=>l(new Error("Failed to load script")),t.head.appendChild(o)})},x=(e,t)=>new Promise((a,l)=>{if(e.customElements.get(t)){a();return}Promise.race([e.customElements.whenDefined(t),new Promise((r,i)=>setTimeout(()=>i(new Error(`Custom element "${t}" failed to register within ${j}ms`)),j))]).then(()=>a()).catch(l)});var G=(e=>(e.QuantityBreak="quantity-break",e.Bxgy="bxgy",e.Bundle="bundle",e.MixAndMatch="mix-and-match",e.Sku="sku",e))(G||{});const k="a-f\\d",Te=`#?[${k}]{3}[${k}]?`,qe=`#?[${k}]{6}([${k}]{2})?`,Oe=new RegExp(`[^#${k}]`,"gi"),je=new RegExp(`^${Te}$|^${qe}$`,"i");function Ue(e,t={}){if(typeof e!="string"||Oe.test(e)||!je.test(e))throw new TypeError("Expected a valid hex string");e=e.replace(/^#/,"");let a=1;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]);const l=Number.parseInt(e,16),r=l>>16,i=l>>8&255,o=l&255,n=typeof t.alpha=="number"?t.alpha:a;if(t.format==="array")return[r,i,o,n];if(t.format==="css"){const m=n===1?"":` / ${Number((n*100).toFixed(2))}%`;return`rgb(${r} ${i} ${o}${m})`}return{red:r,green:i,blue:o,alpha:n}}const Ve=({price:e})=>({id:123,handle:"123",url:null,availableForSale:!0,requiresSellingPlan:!1,title:"",image:null,selectedVariantId:456,collectionIds:[],options:[],sellingPlans:[],variants:[{id:456,availableForSale:!0,price:Math.round((e??10)*100),compareAtPrice:null,options:[],imageId:null,image:null,sellingPlans:[],inventoryManagement:null,inventoryPolicy:null,inventoryQuantity:50,unitPriceMeasurement:null}],metafields:{text:null,text2:null,text3:null,text4:null},isNativeBundle:!1}),Fe=()=>({shopifyDomain:"",moneyFormat:"${{amount_with_comma_separator}}",locale:"en",liquidLocale:"en",country:"US",marketId:0,productId:null,storefrontAccessToken:null,includeSellingPlans:!1,includeAvailableQuantity:!1,customApiHost:null,keepQuantityInput:!1,ignoreDeselect:!1,ignoreUnitPrice:!1,requireCustomerLogin:!1,abTestsRunning:!1,webPixel:!1,b2bCustomer:!1,isLoggedIn:!1,preview:!1,previewAlerts:!1,previewScratchOff:!1,currencyRate:1,defaultTranslations:{"system.out_of_stock":"","system.invalid_variant":"","system.unavailable_option_value":"","system.confirm":"","system.cancel":"","system.free":"","system.search":"","system.quantity":"","system.subscription_plan":"","system.remove":"","system.sort_by":"","system.sort_relevance":"","system.sort_newest_first":"","system.sort_price_low_to_high":"","system.sort_price_high_to_low":"","system.no_results_found":"","system.no_results_description":"","system.clear_search":"","system.no_products_available":"","system.original_price":"","system.price":"","system.letters_only":"","system.numbers_only":""},customSelectors:{quantity:null,addToCartButton:null,variantPicker:null},shopCustomStyles:"",featureFlags:{}}),Re=({color:e,cornerRadius:t})=>{const a={id:"123",nanoId:"123",blockName:"Bundle",discountName:"",blockTitle:"BUNDLE & SAVE",blockLayout:"vertical",blockVisibility:"all-products",marketId:null,currency:null,excludedProductIds:[],excludedCollectionIds:[],selectedProductIds:[],selectedCollectionIds:[],excludeB2bCustomers:!1,excludePos:!1,startTimestamp:175811496e4,endTimestamp:null,differentVariantsEnabled:!0,hideVariantPicker:!1,showPricesPerItem:!1,showBothPrices:!1,useProductCompareAtPrice:!0,showPricesWithoutDecimals:!1,priceRounding:!1,priceRoundingPrecision:".00",updateNativePrice:!1,updateNativePriceType:"item",skipCart:!1,showVariantsForSingleQuantity:!0,preselectedDealBarId:"1f-9",defaultVariantsV2:[],collectionBreaksEnabled:!1,collectionBreaks:null,chooseProductModal:null,timerEnabled:!1,timer:null,subscriptionsEnabled:!1,subscriptions:null,stickyAtcEnabled:!1,stickyAtc:null,progressiveGiftsEnabled:!1,progressiveGifts:null,checkboxUpsellsEnabled:!1,checkboxUpsells:null,lowStockAlertEnabled:!1,lowStockAlert:null,dealBars:[{id:"PfFU",dealBarType:G.QuantityBreak,title:"1 pack",subtitle:"Standard price",label:"",quantity:1,discountType:"default",discountValue:"",badgeStyle:"simple",badgeText:"",badgeImageGID:null,mediaImageGID:null,freeGifts:[],multipleGiftsSelectors:[],upsells:[],showAsSoldOutEnabled:!1,showAsSoldOut:null,productPersonalisation:null},{id:"1f-9",dealBarType:G.QuantityBreak,title:"2 pack",subtitle:"You save {{saved_percentage}}",label:"SAVE {{saved_total}}",quantity:2,discountType:"percentage",discountValue:"15",badgeStyle:"most-popular",badgeText:"",badgeImageGID:null,mediaImageGID:null,freeGifts:[],multipleGiftsSelectors:[],upsells:[],showAsSoldOutEnabled:!1,showAsSoldOut:null,productPersonalisation:null}],badgesEnabled:!0,badges:[{id:"bdg1",attachedTo:{type:"dealBar",dealBarId:"1f-9"},text:"MOST POPULAR",colors:null,badgeType:"most-popular",size:90}],cornerRadius:t??8,spacing:1,colors:{background:{red:255,green:255,blue:255,alpha:1},selectedBackground:{red:255,green:255,blue:255,alpha:1},border:{red:0,green:0,blue:0,alpha:1},blockTitle:{red:0,green:0,blue:0,alpha:1},title:{red:0,green:0,blue:0,alpha:1},subtitle:{red:85,green:85,blue:85,alpha:1},price:{red:0,green:0,blue:0,alpha:1},fullPrice:{red:85,green:85,blue:85,alpha:1},labelBackground:{red:238,green:238,blue:238,alpha:1},label:{red:0,green:0,blue:0,alpha:1},badgeBackground:{red:255,green:17,blue:17,alpha:1},badgeText:{red:255,green:255,blue:255,alpha:1},freeGiftBackground:{red:0,green:0,blue:0,alpha:.3},freeGiftText:{red:0,green:0,blue:0,alpha:1},freeGiftSelectedBackground:{red:0,green:0,blue:0,alpha:1},freeGiftSelectedText:{red:255,green:255,blue:255,alpha:1},upsellBackground:{red:0,green:0,blue:0,alpha:.2},upsellText:{red:0,green:0,blue:0,alpha:1},upsellSelectedBackground:{red:0,green:0,blue:0,alpha:.2},upsellSelectedText:{red:0,green:0,blue:0,alpha:1}},fonts:{blockTitle:{size:"14",style:"bold"},title:{size:"20",style:"bold"},subtitle:{size:"14",style:"regular"},label:{size:"12",style:"regular"},freeGift:{size:"13",style:"bold"},upsell:{size:"13",style:"bold"},unitLabel:{size:"14",style:"regular"}},swatchOptions:[],swatchSize:18,swatchShape:"circle",imageSize:48,imageCornerRadius:6};return e!==void 0&&(a.colors.border={...Ue(e),alpha:1}),a},Le=({data:e,selectedVariantId:t,preview:a,onLinesChange:l,targetWindow:r})=>{const i=S.useRef(null),[o,n]=S.useState(!1),m=S.useRef(!1);if(S.useEffect(()=>{if(!i.current||o)return;(async()=>{await Be(r??window),n(!0)})()},[o,r]),S.useEffect(()=>{const c=i.current;if(!o||!c)return;const d=()=>{const y=c.items().map(p=>({merchandiseId:`gid://shopify/ProductVariant/${p.id}`,quantity:p.quantity,attributes:Object.entries(p.properties).map(([h,s])=>({key:h,value:String(s)})),sellingPlanId:p.selling_plan?`gid://shopify/SellingPlan/${p.selling_plan}`:void 0}));l==null||l(y)};return m.current||(typeof c.items=="function"?d():c.addEventListener("kaching-bundles-block-loaded",d),m.current=!0),c.addEventListener("variants-changed",d),()=>{c.removeEventListener("kaching-bundles-block-loaded",d),c.removeEventListener("variants-changed",d)}},[o,l]),e){const{config:c,dealBlock:d,product:g,otherProducts:y,mediaImages:p,collectionBreaksProducts:h,translations:s}=e;return B.jsx("kaching-bundles-block",{ref:i,"deal-block-id":d.id,config:JSON.stringify(c),"deal-block":JSON.stringify(d),"media-images":JSON.stringify(p),product:JSON.stringify(g),"other-products":JSON.stringify(y),"collection-breaks-products":JSON.stringify(h),translations:JSON.stringify(s),"current-variant-id":t?t.split("/").pop():String(g.variants[0].id)})}else if(a){const{cornerRadius:c,color:d,price:g}=a,y=Ve({price:g}),p=Fe(),h=Re({color:d,cornerRadius:c});return B.jsx("kaching-bundles-block",{ref:i,"deal-block-id":h.id,config:JSON.stringify(p),"deal-block":JSON.stringify(h),"media-images":JSON.stringify([]),product:JSON.stringify(y),"other-products":JSON.stringify([]),"collection-breaks-products":JSON.stringify([]),translations:JSON.stringify({}),"current-variant-id":String(y.variants[0].id)})}else return null};exports.KachingBundle=Le;exports.fetchKachingBundlesData=Ae;
228
+ `,{variables:{mediaImageIds:t,size:a}})).nodes.filter(Boolean).map(l=>({gid:l.id,url:l.image.url})));var w=(e=>(e.QuantityBreak="quantity-break",e.Bxgy="bxgy",e.Bundle="bundle",e.MixAndMatch="mix-and-match",e.Sku="sku",e))(w||{});const ee=e=>[...te(e),...ae(e),...se(e),...ne(e),...le(e),...re(e),...ie(e),...oe(e),...ce(e),...ue(e),...de(e),...me(e),...pe(e)].filter(t=>t!=null&&!t.includes("placeholder")),te=e=>e.dealBars.flatMap(t=>[t.mediaImageGID,t.badgeImageGID]).filter(t=>t!=null),ae=e=>e.dealBars.flatMap(t=>t.dealBarType===w.Bundle?t.bundleProducts.map(a=>a.mediaImageGID):[]).filter(t=>t!=null),se=e=>e.dealBars.map(({freeGifts:t})=>(t||[]).map(a=>a.mediaImageGID)).reduce((t,a)=>t.concat(a),[]).filter(t=>t!=null),ne=e=>e.dealBars.flatMap(({multipleGiftsSelectors:t})=>(t||[]).map(a=>a.mediaImageGID)).filter(t=>t!=null),le=e=>e.dealBars.map(({upsells:t})=>(t||[]).map(a=>a.mediaImageGID)).reduce((t,a)=>t.concat(a),[]).filter(t=>t!=null),re=e=>e.swatchOptions?e.swatchOptions.reduce((t,a)=>{const l=a.images.map(s=>s.mediaImageGID).filter(s=>s!=null);return[...t,...l]},[]):[],ie=e=>{if(!e.collectionBreaksEnabled||!e.collectionBreaks)return[];const t=e.collectionBreaks.mediaImageGID;return t?[t]:[]},oe=e=>{var t,a,l;return e.progressiveGifts?[...((t=e.progressiveGifts.gifts)==null?void 0:t.map(s=>s.mediaImageGID))||[],(a=e.progressiveGifts.style)==null?void 0:a.lockedMediaImageGID,(l=e.progressiveGifts.dealBarStyle)==null?void 0:l.lockedMediaImageGID].filter(s=>s!=null):[]},ce=e=>!e.checkboxUpsellsEnabled||!e.checkboxUpsells?[]:e.checkboxUpsells.upsells.flatMap(t=>[t.mediaImageGID,t.badgeImageGID]).filter(t=>t!=null),ue=e=>e.dealBars.map(t=>{var a;return(a=t.productPersonalisation)==null?void 0:a.mediaImageGID}).filter(t=>t!=null),de=e=>{var l,s;const t=e.dealBars.map(i=>{var o;return(o=i.highlights)==null?void 0:o.customIconGID}).filter(i=>i!=null),a=(s=(l=e.subscriptions)==null?void 0:l.highlights)==null?void 0:s.customIconGID;return a?[...t,a]:t},me=e=>(e.badges||[]).flatMap(t=>t.badgeType==="custom"&&t.imageGID?[t.imageGID]:[]),pe=e=>!e.savingsSummaryEnabled||!e.savingsSummary?[]:e.savingsSummary.customIconGID?[e.savingsSummary.customIconGID]:[],fe=e=>{const t=[...ye(e),...ge(e),...he(e),...be(e),...ve(e),..._e(e),...Ie(e),...Pe(e)];return Array.from(new Set(t.filter(a=>a!=null)))},ye=e=>e.dealBars.flatMap(({freeGifts:t})=>t?t.map(a=>a.productGID):[]).filter(t=>t!=null),ge=e=>e.dealBars.flatMap(({multipleGiftsSelectors:t})=>t?t.flatMap(a=>a.products?a.products.map(l=>l.id):[]):[]).filter(t=>t!=null),he=e=>{var t;return e.progressiveGiftsEnabled?((t=e.progressiveGifts)==null?void 0:t.gifts.map(a=>a.productGID).filter(a=>a!=null))||[]:[]},be=e=>e.dealBars.flatMap(({upsells:t})=>t?t.map(a=>a.productGID):[]).filter(t=>t!=null),ve=e=>e.dealBars.filter(t=>t.dealBarType===w.Bundle).flatMap(({bundleProducts:t})=>t?t.map(a=>a.productGID):[]).filter(t=>t!=null).filter(t=>t!=="default"),_e=e=>e.dealBars.filter(t=>t.dealBarType===w.MixAndMatch).flatMap(({bundleProducts:t})=>t?t.flatMap(a=>{var l;return[a.productGID,...((l=a.selectedProducts)==null?void 0:l.map(s=>s.id))??[]]}):[]).filter(t=>t!=null).filter(t=>t!=="default"),Ie=e=>!e.checkboxUpsellsEnabled||!e.checkboxUpsells?[]:e.checkboxUpsells.upsells.map(t=>t.productGID).filter(t=>t!=null),Pe=e=>e.dealBars.filter(t=>t.dealBarType===w.Sku).flatMap(({productGID:t})=>t?[t]:[]);class Se{constructor(t,a){this.storefrontApiVersion="2026-07",this.storefrontAccessToken=a,this.shopifyDomain=t}async query(t,a){var r;const l=(a==null?void 0:a.variables)??{};let s=`https://${this.shopifyDomain}/api/${this.storefrontApiVersion}/graphql.json`;const i=(r=t.match(/query\s+(\w+)/))==null?void 0:r[1];i&&(s+=`?operation_name=${i}`);const o=await(await fetch(s,{method:"POST",headers:{"Content-Type":"application/json","X-Shopify-Storefront-Access-Token":this.storefrontAccessToken},body:JSON.stringify({query:t,variables:l})})).text();if(!o)throw new Error("Empty graphql response");return JSON.parse(o).data}}const ke=async(e,t,{country:a,language:l})=>{const s=t.collectionBreaks;if(!t.collectionBreaksEnabled||!s)return;let i;s.visibility==="deal-products"?i=await C(e,{country:a,language:l,blockVisibility:t.blockVisibility,excludedProductGIDs:(t.excludedProductIds||[]).map(r=>`gid://shopify/Product/${r}`),selectedProductGIDs:(t.selectedProductIds||[]).map(r=>`gid://shopify/Product/${r}`),selectedCollectionGIDs:(t.selectedCollectionIds||[]).map(r=>`gid://shopify/Collection/${r}`)}):i=await C(e,{country:a,language:l,blockVisibility:s.visibility,excludedProductGIDs:(s.excludedProducts||[]).map(({id:r})=>r),selectedProductGIDs:(s.selectedProducts||[]).map(({id:r})=>r),selectedCollectionGIDs:(s.selectedCollections||[]).map(({id:r})=>r)});let o=await A(e,{country:a,language:l,productIds:i.map(r=>Number(r.split("/").pop())),useExternalMetafieldNamespace:!0});return o=o.filter(r=>r.availableForSale),o},we=()=>({"system.out_of_stock":"There's not enough items in our stock, please select smaller bundle.","system.invalid_variant":"Sorry, this is not currently available.","system.unavailable_option_value":"Unavailable","system.confirm":"Confirm","system.cancel":"Cancel","system.free":"FREE","system.search":"Search","system.quantity":"Quantity","system.subscription_plan":"Subscription plan","system.remove":"Remove","system.sort_by":"Sort by","system.sort_relevance":"Relevance","system.sort_newest_first":"Newest first","system.sort_price_low_to_high":"Price: Low → High","system.sort_price_high_to_low":"Price: High → Low","system.no_results_found":"No results found","system.no_results_description":"We can't find any item matching your search.","system.clear_search":"Clear search","system.no_products_available":"No products available","system.original_price":"Original price:","system.price":"Price:","system.letters_only":"Only letters are allowed.","system.numbers_only":"Only numbers are allowed.","system.personalisation_required_alert":"Please add personalisation for every item to continue."}),$e="2026-07",De=async(e,{productId:t,dealBlockId:a,country:l=void 0,language:s=void 0})=>{var i,o;try{const r=[Number(t.split("/").pop())],m=new Ne(e);l=l||((i=m.i18n)==null?void 0:i.country),s=s||((o=m.i18n)==null?void 0:o.language);const d=await X(m,{language:s,country:l,useExternalMetafieldNamespace:!0});m.shopifyDomain=d.shopifyDomain;const c=d.storefrontAccessToken?new Se(d.shopifyDomain,d.storefrontAccessToken):m,[f,g]=await Promise.all([A(c,{country:l,language:s,productIds:r,useExternalMetafieldNamespace:!0}),Q(c,{useExternalMetafieldNamespace:!0,useMetaobjects:d.featureFlags.storefront_metaobjects})]),y=f[0];if(!y)return null;const h=F(g,y);let n;if(a?(n=h.find(P=>P.id===a||P.nanoId===a),n||(n=h[0])):n=h[0],!n)return null;const p=ee(n),b=fe(n),[_,u,v,I]=await Promise.all([A(c,{country:l,language:s,productIds:b,useExternalMetafieldNamespace:!0}),Z(c,p,300),ke(c,n,{country:l,language:s}),we()]);return{product:y,dealBlock:n,config:d,otherProducts:_,mediaImages:u,collectionBreaksProducts:v??[],translations:I}}catch(r){return console.error(r),null}};class Ne{constructor(t){this.storefront=t,this.shopifyDomain=""}async query(t,a){var l;if("query"in this.storefront&&"i18n"in this.storefront)return await this.storefront.query(t,a);if("graphql"in this.storefront){const s=await this.storefront.graphql(t,a);if((l=s.errors)!=null&&l.length)throw new Error(s.errors.map(i=>i.message).join(`
229
+ `));return s.data}if("request"in this.storefront)return(await this.storefront.request(t,a)).data;if("shopifyDomain"in this.storefront&&"storefrontAccessToken"in this.storefront){const s=await fetch(`https://${this.storefront.shopifyDomain}/api/${$e}/graphql.json`,{body:JSON.stringify({query:t,variables:a==null?void 0:a.variables}),headers:{"Content-Type":"application/json","X-Shopify-Storefront-Access-Token":this.storefront.storefrontAccessToken},method:"POST"});if(!s.ok)throw new Error(s.statusText);return(await s.json()).data}else{const s=await fetch(this.storefront.getStorefrontApiUrl(),{body:JSON.stringify({query:t,variables:a==null?void 0:a.variables}),headers:this.storefront.getPublicTokenHeaders(),method:"POST"});if(!s.ok)throw new Error(s.statusText);return(await s.json()).data}}get i18n(){if("i18n"in this.storefront)return this.storefront.i18n}}const Ae=De,D="kaching-bundles-block",j=1e4,xe="https://bundles-integrations-dev.kachingappz.dev/kaching-bundles-block.js",Be="https://bundles-integrations.kachingappz.app/kaching-bundles-block.js",N=new WeakSet,Ge=async e=>{const t=e.document;if(!e.customElements.get(D)){if(N.has(t))return x(e,D);N.add(t);try{await Me(e)}catch(a){throw N.delete(t),a}}},Ee=()=>typeof window<"u"&&typeof window.__KACHING_DEV__<"u",Ce=()=>Ee()?xe:Be,Me=e=>{const t=e.document;return new Promise((a,l)=>{const s=Ce();if(t.querySelector(`script[src="${s}"]`)){x(e,D).then(a).catch(l);return}const o=t.createElement("script");o.src=s,o.onload=()=>x(e,D).then(a).catch(l),o.onerror=()=>l(new Error("Failed to load script")),t.head.appendChild(o)})},x=(e,t)=>new Promise((a,l)=>{if(e.customElements.get(t)){a();return}Promise.race([e.customElements.whenDefined(t),new Promise((s,i)=>setTimeout(()=>i(new Error(`Custom element "${t}" failed to register within ${j}ms`)),j))]).then(()=>a()).catch(l)});var B=(e=>(e.QuantityBreak="quantity-break",e.Bxgy="bxgy",e.Bundle="bundle",e.MixAndMatch="mix-and-match",e.Sku="sku",e))(B||{});const k="a-f\\d",Te=`#?[${k}]{3}[${k}]?`,qe=`#?[${k}]{6}([${k}]{2})?`,je=new RegExp(`[^#${k}]`,"gi"),Oe=new RegExp(`^${Te}$|^${qe}$`,"i");function Ve(e,t={}){if(typeof e!="string"||je.test(e)||!Oe.test(e))throw new TypeError("Expected a valid hex string");e=e.replace(/^#/,"");let a=1;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]);const l=Number.parseInt(e,16),s=l>>16,i=l>>8&255,o=l&255,r=typeof t.alpha=="number"?t.alpha:a;if(t.format==="array")return[s,i,o,r];if(t.format==="css"){const m=r===1?"":` / ${Number((r*100).toFixed(2))}%`;return`rgb(${s} ${i} ${o}${m})`}return{red:s,green:i,blue:o,alpha:r}}const Ue=({price:e})=>({id:123,handle:"123",url:null,availableForSale:!0,requiresSellingPlan:!1,title:"",image:null,selectedVariantId:456,collectionIds:[],options:[],sellingPlans:[],variants:[{id:456,availableForSale:!0,price:Math.round((e??10)*100),compareAtPrice:null,options:[],imageId:null,image:null,sellingPlans:[],inventoryManagement:null,inventoryPolicy:null,inventoryQuantity:50,unitPriceMeasurement:null}],metafields:{text:null,text2:null,text3:null,text4:null},isNativeBundle:!1}),Fe=()=>({shopifyDomain:"",moneyFormat:"${{amount_with_comma_separator}}",locale:"en",liquidLocale:"en",country:"US",marketId:0,productId:null,storefrontAccessToken:null,includeSellingPlans:!1,includeAvailableQuantity:!1,customApiHost:null,keepQuantityInput:!1,ignoreDeselect:!1,ignoreUnitPrice:!1,requireCustomerLogin:!1,abTestsRunning:!1,webPixel:!1,b2bCustomer:!1,isLoggedIn:!1,preview:!1,previewAlerts:!1,previewScratchOff:!1,currencyRate:1,defaultTranslations:{"system.out_of_stock":"","system.invalid_variant":"","system.unavailable_option_value":"","system.confirm":"","system.cancel":"","system.free":"","system.search":"","system.quantity":"","system.subscription_plan":"","system.remove":"","system.sort_by":"","system.sort_relevance":"","system.sort_newest_first":"","system.sort_price_low_to_high":"","system.sort_price_high_to_low":"","system.no_results_found":"","system.no_results_description":"","system.clear_search":"","system.no_products_available":"","system.original_price":"","system.price":"","system.letters_only":"","system.numbers_only":""},customSelectors:{quantity:null,addToCartButton:null,variantPicker:null},shopCustomStyles:"",featureFlags:{}}),Re=({color:e,cornerRadius:t})=>{const a={id:"123",nanoId:"123",blockName:"Bundle",discountName:"",blockTitle:"BUNDLE & SAVE",blockLayout:"vertical",blockVisibility:"all-products",marketId:null,currency:null,excludedProductIds:[],excludedCollectionIds:[],selectedProductIds:[],selectedCollectionIds:[],excludeB2bCustomers:!1,excludePos:!1,startTimestamp:175811496e4,endTimestamp:null,differentVariantsEnabled:!0,hideVariantPicker:!1,showPricesPerItem:!1,showBothPrices:!1,useProductCompareAtPrice:!0,showPricesWithoutDecimals:!1,priceRounding:!1,priceRoundingPrecision:".00",updateNativePrice:!1,updateNativePriceType:"item",skipCart:!1,showVariantsForSingleQuantity:!0,preselectedDealBarId:"1f-9",defaultVariantsV2:[],collectionBreaksEnabled:!1,collectionBreaks:null,chooseProductModal:null,timerEnabled:!1,timer:null,subscriptionsEnabled:!1,subscriptions:null,stickyAtcEnabled:!1,stickyAtc:null,progressiveGiftsEnabled:!1,progressiveGifts:null,checkboxUpsellsEnabled:!1,checkboxUpsells:null,lowStockAlertEnabled:!1,lowStockAlert:null,dealBars:[{id:"PfFU",dealBarType:B.QuantityBreak,title:"1 pack",subtitle:"Standard price",label:"",quantity:1,discountType:"default",discountValue:"",badgeStyle:"simple",badgeText:"",badgeImageGID:null,mediaImageGID:null,freeGifts:[],multipleGiftsSelectors:[],upsells:[],showAsSoldOutEnabled:!1,showAsSoldOut:null,productPersonalisation:null},{id:"1f-9",dealBarType:B.QuantityBreak,title:"2 pack",subtitle:"You save {{saved_percentage}}",label:"SAVE {{saved_total}}",quantity:2,discountType:"percentage",discountValue:"15",badgeStyle:"most-popular",badgeText:"",badgeImageGID:null,mediaImageGID:null,freeGifts:[],multipleGiftsSelectors:[],upsells:[],showAsSoldOutEnabled:!1,showAsSoldOut:null,productPersonalisation:null}],badgesEnabled:!0,badges:[{id:"bdg1",attachedTo:{type:"dealBar",dealBarId:"1f-9"},text:"MOST POPULAR",colors:null,badgeType:"most-popular",size:90}],cornerRadius:t??8,spacing:1,colors:{background:{red:255,green:255,blue:255,alpha:1},selectedBackground:{red:255,green:255,blue:255,alpha:1},border:{red:0,green:0,blue:0,alpha:1},blockTitle:{red:0,green:0,blue:0,alpha:1},title:{red:0,green:0,blue:0,alpha:1},subtitle:{red:85,green:85,blue:85,alpha:1},price:{red:0,green:0,blue:0,alpha:1},fullPrice:{red:85,green:85,blue:85,alpha:1},labelBackground:{red:238,green:238,blue:238,alpha:1},label:{red:0,green:0,blue:0,alpha:1},badgeBackground:{red:255,green:17,blue:17,alpha:1},badgeText:{red:255,green:255,blue:255,alpha:1},freeGiftBackground:{red:0,green:0,blue:0,alpha:.3},freeGiftText:{red:0,green:0,blue:0,alpha:1},freeGiftSelectedBackground:{red:0,green:0,blue:0,alpha:1},freeGiftSelectedText:{red:255,green:255,blue:255,alpha:1},upsellBackground:{red:0,green:0,blue:0,alpha:.2},upsellText:{red:0,green:0,blue:0,alpha:1},upsellSelectedBackground:{red:0,green:0,blue:0,alpha:.2},upsellSelectedText:{red:0,green:0,blue:0,alpha:1}},fonts:{blockTitle:{size:"14",style:"bold"},title:{size:"20",style:"bold"},subtitle:{size:"14",style:"regular"},label:{size:"12",style:"regular"},freeGift:{size:"13",style:"bold"},upsell:{size:"13",style:"bold"},unitLabel:{size:"14",style:"regular"}},swatchOptions:[],swatchSize:18,swatchShape:"circle",imageSize:48,imageCornerRadius:6};return e!==void 0&&(a.colors.border={...Ve(e),alpha:1}),a},Le=({data:e,selectedVariantId:t,preview:a,onLinesChange:l,targetWindow:s})=>{const i=S.useRef(null),[o,r]=S.useState(!1),m=S.useRef(!1);S.useEffect(()=>{if(!i.current||o)return;(async()=>{await Ge(s??window),r(!0)})()},[o,s]),S.useEffect(()=>{const c=i.current;if(!o||!c)return;const f=()=>{const y=c.items().map(h=>({merchandiseId:`gid://shopify/ProductVariant/${h.id}`,quantity:h.quantity,attributes:Object.entries(h.properties).map(([n,p])=>({key:n,value:String(p)})),sellingPlanId:h.selling_plan?`gid://shopify/SellingPlan/${h.selling_plan}`:void 0}));l==null||l(y)};return m.current||(typeof c.items=="function"?f():c.addEventListener("kaching-bundles-block-loaded",f),m.current=!0),c.addEventListener("variants-changed",f),()=>{c.removeEventListener("kaching-bundles-block-loaded",f),c.removeEventListener("variants-changed",f)}},[o,l]);const d=e?ze(e,t):a?Qe(a):null;return Je(()=>{const c=i.current;if(!(!c||!d))for(const[f,g]of Object.entries(d.jsonAttributes))c.getAttribute(f)!==g&&c.setAttribute(f,g)}),d?U.jsx("kaching-bundles-block",{ref:i,"deal-block-id":d.dealBlockId,...d.jsonAttributes,"current-variant-id":d.currentVariantId}):null},Je=typeof window>"u"?S.useEffect:S.useLayoutEffect,ze=({config:e,dealBlock:t,product:a,otherProducts:l,mediaImages:s,collectionBreaksProducts:i,translations:o},r)=>({dealBlockId:t.id,currentVariantId:r?r.split("/").pop():String(a.variants[0].id),jsonAttributes:{config:JSON.stringify(e),"deal-block":JSON.stringify(t),"media-images":JSON.stringify(s),product:JSON.stringify(a),"other-products":JSON.stringify(l),"collection-breaks-products":JSON.stringify(i),translations:JSON.stringify(o)}}),Qe=({cornerRadius:e,color:t,price:a})=>{const l=Ue({price:a}),s=Fe(),i=Re({color:t,cornerRadius:e});return{dealBlockId:i.id,currentVariantId:String(l.variants[0].id),jsonAttributes:{config:JSON.stringify(s),"deal-block":JSON.stringify(i),"media-images":JSON.stringify([]),product:JSON.stringify(l),"other-products":JSON.stringify([]),"collection-breaks-products":JSON.stringify([]),translations:JSON.stringify({})}}};exports.KachingBundle=Le;exports.fetchKachingBundlesData=Ae;
@@ -245,6 +245,8 @@ declare type DealBarProgressiveGiftStyle = {
245
245
  labelBackgroundColor: Color;
246
246
  labelTextColor: Color;
247
247
  labelTextSize: number;
248
+ backgroundColor?: Color | null;
249
+ selectedBackgroundColor?: Color | null;
248
250
  textColor: Color;
249
251
  selectedTextColor: Color;
250
252
  textSize: number;
@@ -405,7 +407,7 @@ declare type DiscountType = "default" | "percentage" | "amount" | "specific";
405
407
 
406
408
  export declare const fetchKachingBundlesData: (...args: Parameters<typeof fetchKachingBundlesData_2>) => Promise<KachingBundlesData | null>;
407
409
 
408
- declare const fetchKachingBundlesData_2: (storefront: HydrogenV2Storefront | ReactHydrogenStorefront | ShopifyStorefrontApiClient | StorefrontCredentials, { productId, dealBlockId, country, language, }: {
410
+ declare const fetchKachingBundlesData_2: (storefront: HydrogenV2Storefront | HydrogenStorefrontClient | ReactHydrogenStorefront | ShopifyStorefrontApiClient | StorefrontCredentials, { productId, dealBlockId, country, language, }: {
409
411
  productId: string;
410
412
  dealBlockId?: string;
411
413
  country?: string;
@@ -509,7 +511,6 @@ declare interface GlobalConfig {
509
511
  "system.deal_page_percentage_off"?: string;
510
512
  "system.deal_page_price_each"?: string;
511
513
  "system.deal_page_quantity_for_price"?: string;
512
- "system.deal_page_save_up_to"?: string;
513
514
  "system.deal_page_in_your_box"?: string;
514
515
  "system.deal_page_in_your_box_count"?: string;
515
516
  "system.deal_page_in_box_count"?: string;
@@ -587,6 +588,7 @@ declare interface GlobalConfig {
587
588
  label?: string | null;
588
589
  };
589
590
  featureFlags: {
591
+ accelerated_checkout_additional_items?: boolean;
590
592
  atc_total_price?: boolean;
591
593
  cart_change_response_rewrite?: boolean;
592
594
  cart_interceptor_dedupe_disabled?: boolean;
@@ -632,6 +634,21 @@ declare type Highlights = {
632
634
  customIconGID?: string | null;
633
635
  };
634
636
 
637
+ declare interface HydrogenStorefrontClient {
638
+ graphql(query: string, options?: {
639
+ variables?: Record<string, unknown>;
640
+ }): Promise<{
641
+ data: unknown;
642
+ errors?: readonly {
643
+ message: string;
644
+ }[];
645
+ }>;
646
+ i18n: {
647
+ country: string;
648
+ language: string;
649
+ };
650
+ }
651
+
635
652
  declare interface HydrogenV2Storefront {
636
653
  query: (query: string, options?: {
637
654
  variables?: Record<string, unknown>;
@@ -825,6 +842,7 @@ declare type ProgressiveGifts = {
825
842
  hideLockedGifts: boolean;
826
843
  showLockedGiftLabels: boolean;
827
844
  showLockedGiftProducts: boolean;
845
+ includeInCompareAt?: boolean;
828
846
  gifts: ProgressiveGift[];
829
847
  titleColor: Color;
830
848
  titleAlignment: "start" | "center" | "end";