1import{nn as e}from"./chunk-CJ6zSZCO.js";import{P as t}from"./chunk-BSk3lFnS.js";var n={root:[`cubeCoins`],packs:()=>[...n.root,`packs`]};function r(e){return e.split(`/`).pop()??e}function i(e,n){let i=new Map;for(let e of n)for(let t of e.variants)i.set(r(t.id),t);let a=[];for(let n of e){let e=i.get(r(n.shopifyVariantId));if(!e){console.warn(`Cubecoin pack ${n.id} has no matching Shopify variant (${n.shopifyVariantId}); skipping`);continue}let o={id:n.id,amount:n.amount,shopifyVariantId:e.id,price:{amount:e.price.amount.toString(),currencyCode:e.price.currencyCode}};t(n.imageUrl)&&(o.imageUrl=n.imageUrl),n.isHot&&(o.isHot=n.isHot),t(n.discountPercent)&&n.discountPercent>0&&(o.discountPercent=n.discountPercent,t(e.oldPrice)&&e.oldPrice.currencyCode===e.price.currencyCode&&e.oldPrice.amount.gt(e.price.amount)&&(o.oldPrice={amount:e.oldPrice.amount.toString(),currencyCode:e.oldPrice.currencyCode})),a.push(o)}return a}function a(t,r){function a(){return e({queryKey:n.packs(),queryFn:async()=>{let[{cubecoinPacks:e},n]=await Promise.all([t.getCubecoinPacks(),r.getCubeCoinsPacks()]);return i(e,n)},staleTime:6e5})}return{packs:a}}export{a as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.