{"version":3,"file":"ShopifyBuyButton.DIbaP0fP.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/j7dA7qEyCzQcVte16MvS/cwW7lIqHh7bSnTrb1Bf8/ShopifyBuyButton.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function ShopifyBuyButton(props){const{productId=\"8904042119445\",buttonColor=\"#4a8ff7\",buttonFont=\"Montserrat, sans-serif\",showQuantity=false}=props;const containerRef=useRef(null);useEffect(()=>{const hoverColor=adjustColor(buttonColor,-.07);if(containerRef.current){containerRef.current.innerHTML=\"\";}function init(){if(!containerRef.current)return;const client=window.ShopifyBuy.buildClient({domain:\"af90a5.myshopify.com\",storefrontAccessToken:\"7d31dc58221a1fca39bcff9c42f7046a\"});window.ShopifyBuy.UI.onReady(client).then(ui=>{ui.createComponent(\"product\",{id:productId,node:containerRef.current,moneyFormat:\"${{amount}}\",options:{product:{styles:{product:{\"@media (min-width: 100%)\":{\"margin-left\":\"0px\",\"margin-bottom\":\"0px\"}},button:{\"font-family\":buttonFont,\"border-radius\":\"8px\",\"padding-left\":\"88px\",\"padding-right\":\"88px\",\":hover\":{\"background-color\":hoverColor},\"background-color\":buttonColor,\":focus\":{\"background-color\":hoverColor}}},contents:{img:false,title:false,price:false,button:!showQuantity,buttonWithQuantity:showQuantity},text:{button:\"Add to cart\"},googleFonts:[\"Montserrat\"]},productSet:{styles:{products:{\"@media (min-width: 100%)\":{\"margin-left\":\"0px\"}}}},modalProduct:{contents:{img:false,imgWithCarousel:true,button:!showQuantity,buttonWithQuantity:showQuantity},styles:{product:{\"@media (min-width: 100%)\":{\"max-width\":\"100%\",\"margin-left\":\"0px\",\"margin-bottom\":\"0px\"}},button:{\"font-family\":buttonFont,\"border-radius\":\"8px\",\"padding-left\":\"88px\",\"padding-right\":\"88px\",\":hover\":{\"background-color\":hoverColor},\"background-color\":buttonColor,\":focus\":{\"background-color\":hoverColor}}},googleFonts:[\"Montserrat\"],text:{button:\"Add to cart\"}},option:{},cart:{styles:{button:{\"font-family\":buttonFont,\"border-radius\":\"8px\",\":hover\":{\"background-color\":hoverColor},\"background-color\":buttonColor,\":focus\":{\"background-color\":hoverColor}}},text:{total:\"Subtotal\",button:\"Checkout\"},popup:false,googleFonts:[\"Montserrat\"]},toggle:{styles:{toggle:{\"font-family\":buttonFont,\"background-color\":buttonColor,\":hover\":{\"background-color\":hoverColor},\":focus\":{\"background-color\":hoverColor}}},googleFonts:[\"Montserrat\"]}}});});}if(window.ShopifyBuy?.UI){init();}else{const script=document.createElement(\"script\");script.async=true;script.src=\"https://sdks.shopifycdn.com/buy-button/latest/buy-button-storefront.min.js\";script.onload=init;document.head.appendChild(script);}},[productId,buttonColor,buttonFont,showQuantity]);return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{width:\"100%\",height:\"auto\"}});}function adjustColor(hex,amount){const num=parseInt(hex.replace(\"#\",\"\"),16);const r=Math.min(255,Math.max(0,(num>>16)+Math.round(255*amount)));const g=Math.min(255,Math.max(0,(num>>8&255)+Math.round(255*amount)));const b=Math.min(255,Math.max(0,(num&255)+Math.round(255*amount)));return`#${(r<<16|g<<8|b).toString(16).padStart(6,\"0\")}`;}addPropertyControls(ShopifyBuyButton,{productId:{type:ControlType.String,title:\"Product ID\",defaultValue:\"8904042119445\"},buttonColor:{type:ControlType.Color,title:\"Button Color\",defaultValue:\"#4a8ff7\"},buttonFont:{type:ControlType.String,title:\"Button Font\",defaultValue:\"Montserrat, sans-serif\"},showQuantity:{type:ControlType.Boolean,title:\"Show Quantity\",defaultValue:false}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ShopifyBuyButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\"}},\"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