import{Link as u}from"./ebc50768.js";import{j as r,F as c,a as m,r as f}from"./index.1ec44e23.js";import{A as h}from"./70628a73.js";import{u as b}from"./c0ec5803.js";import"./2d3554bc.js";import"./ef11f8a9.js";import"./616890f5.js";import{ProductOptionsProvider as x}from"./cae1308a.js";import{B as g}from"./3ee3f568.js";import"./a8ae7088.js";import"./c268d3e4.js";import{T as N}from"./fbff0340.js";import{c as l}from"./2e4f433f.js";import"./6cbd8241.js";import"./8bce3399.js";import"./75d11d91.js";import"./ff692d55.js";import"./3c10424c.js";import"./b9494af1.js";import"./d6282b27.js";function p({label:o,tone:t}){return r("div",{className:l("relative bg-soldOut top-[10px]",t==="shopPay"&&"text-shopPay",t==="main"&&"text-main",t==="black"&&"text-black"),children:o})}function H({children:o,initialVariantId:t,linkAction:e,quantity:n,storefrontProduct:i}){return r(x,{data:i,initialVariantId:t,children:r(v,{linkAction:e,quantity:n,storefrontProduct:i,children:o})})}function v({children:o,linkAction:t,quantity:e,storefrontProduct:n}){const{handle:i,title:d}=n,{selectedVariant:a}=b();if(!(a!=null&&a.id))return r(c,{children:o});if(!a.availableForSale&&t!=="link")return m("span",{className:"bg-soldOut",children:[o,r("span",{className:"ml-fontSpace text-main",children:"[Sold out]"})]});const s=f.exports.useMemo(()=>r("span",{className:l("bg-highlight"),children:o}),[o,t]);return r(N,{interactive:t==="link",placement:"top-start",render:()=>t==="addToCart"?r(p,{label:`Add to cart [\xD7${e}]`,tone:"main"}):t==="buyNow"?r(p,{label:`Buy now [\xD7${e}]`,tone:"shopPay"}):t==="link"?r(p,{label:`Go to [${d}]`,tone:"black"}):null,children:m("span",{children:[t==="addToCart"&&r(h,{quantity:e,style:{fontWeight:"inherit",letterSpacing:"inherit"},variantId:a.id,children:s}),t==="buyNow"&&r(g,{quantity:e,style:{fontWeight:"inherit",letterSpacing:"inherit"},variantId:a.id,children:s}),t==="link"&&r(u,{className:"inline",to:`/products/${i}`,children:s})]})})}export{H as default}; //# sourceMappingURL=9872fe1e.js.map