1import{s as e}from"./BlVK-YvN.js";import{En as t,g as n}from"./B4b-2GOK.js";import{a as r,r as i,s as a}from"./DWiS8f_f2.js";function o(o,s){let{$customCurrency:c}=e(),l=()=>r(t(o),t(s)),u=n(()=>{let e=l()?.price.amount;if(e==null)return;let t=Number(e);return Number.isFinite(t)?t:void 0}),d=n(()=>{let e=u.value;return e===void 0?``:c(e)}),f=n(()=>{let e=l()?.compareAtPrice;if(!e?.amount)return;let t=parseFloat(e.amount);return Number.isNaN(t)?void 0:t}),p=n(()=>f.value&&u.value?f.value-u.value:0),m=n(()=>{let e=f.value;return e?c(e):``}),h=n(()=>l()?.id),g=e=>n(()=>{let n=i(t(o),t(e));return n.length?n.reduce((e,t)=>parseFloat(t.price.amount)<parseFloat(e.price.amount)?t:e):null}),_=n(()=>{let e=l();return e?.sku?e.sku:void 0}),v=n(()=>{let e=t(o);return e?e.images.edges[0]?.node??null:null}),y=n(()=>{let e=v.value;if(e)return e.url;console.warn(`No image found for product`,t(o))}),b=n(()=>{let e=l();return e?parseInt(e.subscriptionDuration?.value??`0`):0}),x=n(()=>l()?.preorderShipDate?.value??void 0),S=n(()=>{let e=l();return e?(e.subscriptionsUpsell?.references?.edges?.map(e=>e.node)??[]).filter(e=>a(e)):[]});return{getProductPrice:u,getProductPriceWithCurrency:d,getCompareAtPrice:f,savings:p,getCompareAtPriceWithCurrency:m,getProductId:h,getCheapestVariant:g,getProductSku:_,getProductImageUrl:y,getVariantSubscriptionDuration:b,getVariantPreorderShipDate:x,getVariantSubscriptionUpsell:S,getSubscriptionUpsellOption:n(()=>{let e=S.value[0];if(!e||!(`price`in e))return null;let t=u.value;if(t===void 0)return null;let n=parseFloat(e.price.amount),r=n-t;if(!(r>0))return null;let i=parseInt(e.subscriptionDuration?.value??`0`);return i>0?{id:e.id,priceDiff:r,totalPrice:n,totalDuration:i,addedDuration:i-b.value,subscriptionType:e.subscriptionType?.value??null}:null})}}export{o 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.