{"version":3,"file":"Loading.j8MQs6eP.mjs","names":["React","useState","useRef","useCallback","useState","useCallback","useRef","React.useCallback","__esmMin","window","z","init_ssg_sandbox_shims","init_npm_react_18_3_1","_e","de","init_jsx_runtime","ne","c","e","ce","useAnimation","motion","addPropertyControls","init_framer_CN96F41L","ControlType","RenderTarget","init_IsBrowser","getSCARefParameters","trackFacebookPixelAddToCart","init_Fb_pixel","getProductMetafields","init_lodash","init_mutations_v2","get","updateCartAttributes","addToCartMutation","cartQuery","trackFacebookPixelInitiateCheckout","createCartMutation","updateCartCurrency","appendAllTrackingParamsToUrl","init_locales","useIsBrowser","trackFacebookPixelViewContent","getUTMParameters","appendLanguageToUrl","defaultEvents","useOnEnter","init_default_utils_js__0_45","useOnExit","sanitizeChildrenRecursively","node","sanitizedProps","init_cloning","initializeStore","originalPushState","originalReplaceState","error","init_initialize","init_utmParams","FC_ProductPurchaseButton","props","product","setProduct","activeVariant","setActiveVariant","isInStock","setIsInStock","needsVariantSelection","setNeedsVariantSelection","isLoading","setIsLoading","hasInitialized","setHasInitialized","countryCode","setCountryCode","isBrowser","planSelected","setPlanSelected","persisted","shopifyProductID","cartExistingData","setCartExistingData","errorMessage","setErrorMessage","productQuantity","setProductQuantity","viewContentFired","autoSelectFirst","setAutoSelectFirst","isVariantManuallySelected","setIsVariantManuallySelected","maxQuantityReached","setMaxQuantityReached","orderMax","setOrderMax","handleAutoSelectFlag","event","calculateTotalInventory","productData","total","isVariantAvailable","variant","\"shopXtools\"","savedCartId","data","handleSubscriptionChange","handleQuantityChange","handleCurrencyChange","existingCartId","updateData","handleSingleVariantProduct","productNode","variants","handleProductData","currentProductId","incomingProductId","_matchingProduct","fetchOrderMax","shopifyProductVariantId","variantId","matchingVariant","firstAvailableVariant","edge","hasMultipleVariants","anyVariantAvailable","productsReadyHandler","matchingProduct","variantChangeHandler","productOptions","selectedArray","selectedNames","o","isCompleteFromNames","opt","isComplete","getCurrentCartQuantity","orderFieldError","setOrderFieldError","validateOrderField","productSpecificKey","storedAttributes","parsedAttrs","value","isValid","handleOrderFieldChange","isInputRequired","setIsInputRequired","checkInputRequirement","configKey","config","required","getLineItem","merchandiseId","lineItem","\"sellingPlanId\"","stored","attributes","key","\"attributes\"","productHandle","metafieldsResponse","max","liveCart","liveEdges","productVariantIds","handleAddToCart","currentCartQuantity","inputElement","currentInputValue","attrValue","lines","BuyNowATC","cartData","currency","item_id","cleanShopifyId","item_name","item_variant","price","payload","openCart","variables","checkoutUrl","finalCheckoutUrl","cartId","timer","isDesignOrPreview","content","available","maxQuantity","OutOfStock","SelectVariant","canAddToCart","handleClick","currentQuantity","shouldBeAtMax","currentInCart","remainingAllowed","handleCartUpdate","orderMaxRemainingAllowed","variantQnt","handleResize","storedId","found","viewItemTrackedRef","pageViewTrackedRef","item_brand","item_category","defaultVariant","focused","canvasContent","LoadingState","hasAnyState","isPreview","sanitizedCanvasContent","sanitizedLoadingState","sanitizedContent","init_FC_ProductPurchaseButton","gid","FC_ProductVariantState","selectedOptions","setSelectedOptions","handleVariantSelection","prev","_product","remainingOptions","displayText","textTemplate","init_FC_ProductVariantState","DotWave","circles","animProps","animation","transition","color","circle","Material","IOS","arrayRotate","arr","n","i","lineOpacities","lineKeyframes","getIndicator","indicator","Indicators","handleTimeout","id","callback","duration","Loading","controls","animDuration","fadeOut","animDelay","currentIndicator","handlers","onFadeOut","hasDuration","resetOpacity","onTimeout","cleanup","style","init_Loading","\"DotWave\"","\"Material\"","\"IOS\""],"sources":["https:/framerusercontent.com/modules/Da0ApllLKQHSw8djEYKs/NKlmeTJYy3YIy3O2qsS9/cloning.js","https:/framerusercontent.com/modules/FXrY3V9ZYVL8aziafDQn/HIuMDRrKIIcsJe65kZwo/initialize.js","https:/framerusercontent.com/modules/DfixsupJND2Hhr1xcPbk/zYiTTDRsHtf2S3Zf8E7G/FC_ProductPurchaseButton.js","https:/framerusercontent.com/modules/B12xzzGu5tV27jDrWyaW/dyGmYzzIUDiXU0ubHYzE/FC_ProductVariantState.js","https:/framerusercontent.com/modules/NQ9LlTfXzHTRhTTi6qMI/5u9VoSaQM7qxLI2scUcH/Loading.js"],"sourcesContent":["import React from\"react\";// It walks every level of the element tree: each nested container, stack, frame gets rendersWithMotion = false\n// It preserves all other props (styles, events, Framer props)\n// It prevents Framer from rewrapping anything in internal motion components, which stops layout animation flickers, re-renders, and performance loss\nexport function sanitizeChildrenRecursively(node){if(!/*#__PURE__*/React.isValidElement(node))return node;// Clone node with motion props disabled\nconst sanitizedProps={...node.props,rendersWithMotion:false,layoutId:undefined,scopeId:undefined};// If there are nested children, recurse into them\nif(node.props.children){sanitizedProps.children=React.Children.map(node.props.children,sanitizeChildrenRecursively);}return /*#__PURE__*/React.cloneElement(node,sanitizedProps);}\nexport const __FramerMetadata__ = {\"exports\":{\"sanitizeChildrenRecursively\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./cloning.map","/**\n * Initialization utilities for Framer Commerce\n * This file contains functions that should run when the application first loads\n */import{getUTMParameters,getSCARefParameters}from\"https://framerusercontent.com/modules/w24ELWa2giT3SFaWpV77/398w6fPyag8B92ojouQr/utmParams.js\";/**\n * Initialize global functionality for the store\n * This includes capturing UTM parameters, setting up event listeners, etc.\n */export function initializeStore(){// Capture UTM and SCA ref parameters when the page loads\nif(typeof window!==\"undefined\"){// Initialize UTM parameter tracking\ngetUTMParameters();// Initialize SCA ref parameter tracking\ngetSCARefParameters();// Add a listener for history changes to capture tracking parameters\n// when users navigate between pages\ntry{const originalPushState=history.pushState;const originalReplaceState=history.replaceState;history.pushState=function(){originalPushState.apply(this,arguments);getUTMParameters()// Capture UTM parameters after navigation\n;getSCARefParameters()// Capture SCA ref parameters after navigation\n;};history.replaceState=function(){originalReplaceState.apply(this,arguments);getUTMParameters()// Capture UTM parameters after navigation\n;getSCARefParameters()// Capture SCA ref parameters after navigation\n;};// Also listen for popstate events (back/forward navigation)\nwindow.addEventListener(\"popstate\",()=>{getUTMParameters();getSCARefParameters();});}catch(error){console.error(\"Error setting up history listeners:\",error);}}}// Auto-initialize if this module is loaded\ninitializeStore();export default initializeStore;\nexport const __FramerMetadata__ = {\"exports\":{\"initializeStore\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","/*\n * Framer Commerce\n * Confidential and Proprietary - All Rights Reserved\n * Unauthorized use, reproduction, distribution, or disclosure of this\n * source code or any related information is strictly prohibited.\n *\n * This software is the exclusive property of Framer Commerce (\"Company\").\n * It is considered highly confidential and proprietary information.\n *\n * Any use, copying, modification, distribution, or sharing of this software,\n * in whole or in part, without the express written permission of the Company\n * is strictly prohibited and may result in legal action.\n *\n * DISCLAIMER: This software does not provide any express or\n * implied warranties, including, but not limited to, the implied warranties\n * of merchantability and fitness for a particular purpose. In no event shall\n * Framer Commerce be liable for any direct, indirect, incidental, special,\n * exemplary, or consequential damages (including, but not limited to, procurement\n * of substitute goods or services; loss of use, data, or profits; or business\n * interruption) however caused and on any theory of liability, whether in\n * contract, strict liability, or tort (including negligence or otherwise)\n * arising in any way out of the use of this software, even if advised of\n * the possibility of such damage.\n *\n * Any unauthorized possession, use, copying, distribution, or dissemination\n * of this software will be considered a breach of confidentiality and may\n * result in legal action.\n *\n * For inquiries, contact:\n * Framer Commerce\n * Email: hello@framercommerce.com\n *\n * © 2025 Butter Supply Inc. All Rights Reserved.\n */import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,useRef,useCallback,cloneElement}from\"react\";import{createCartMutation,addToCartMutation,cartQuery,updateCartAttributes,updateCartCurrency,getProductMetafields}from\"https://framerusercontent.com/modules/yiRfl1JCGhIBUL31WVDk/wupS2XmBAHu1kBQNv9pi/mutations_v2.js\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{get}from\"lodash-es\";import{appendAllTrackingParamsToUrl}from\"https://framerusercontent.com/modules/w24ELWa2giT3SFaWpV77/398w6fPyag8B92ojouQr/utmParams.js\";import{appendLanguageToUrl}from\"https://framerusercontent.com/modules/vC6fzbfO83MgBPIhn5zl/DUlbmWuOELzEUenVmv3G/locales.js\";import{useIsBrowser}from\"https://framerusercontent.com/modules/ncBs5KPMI9I5GEta13fn/zGXDjuZapa1SGy6D8P5e/IsBrowser.js\";import{trackFacebookPixelAddToCart,trackFacebookPixelInitiateCheckout,trackFacebookPixelViewContent}from\"https://framerusercontent.com/modules/6Zs9CjkPbKzHjoy8LK08/iqoIwmJw4hztafi4V4IV/Fb_pixel.js\";import{sanitizeChildrenRecursively}from\"https://framerusercontent.com/modules/Da0ApllLKQHSw8djEYKs/NKlmeTJYy3YIy3O2qsS9/cloning.js\";// Import initialization utility to ensure UTM tracking is set up\nimport\"https://framerusercontent.com/modules/FXrY3V9ZYVL8aziafDQn/HIuMDRrKIIcsJe65kZwo/initialize.js\";/**\n * @framerDisableUnlink\n */export default function FC_ProductPurchaseButton(props){const{shopifyProductID,available,OutOfStock,SelectVariant,LoadingState,maxQuantity,shopifyProductVariantId,BuyNowATC,title=\"Add to Cart\",required=false,openCart=true}=props;// State from original component\nconst[product,setProduct]=useState();const[activeVariant,setActiveVariant]=useState();const[isInStock,setIsInStock]=useState(true);const[needsVariantSelection,setNeedsVariantSelection]=useState(false);const[isLoading,setIsLoading]=useState(true);const[hasInitialized,setHasInitialized]=useState(false);const[countryCode,setCountryCode]=useState();const isBrowser=useIsBrowser();// Additional state for cart functionality — read persisted state to\n// avoid flickering to 'one-time' on Framer component-variant remounts\nconst[planSelected,setPlanSelected]=useState(()=>{if(typeof window!==\"undefined\"){const persisted=window.__fc_activeSubscription?.[shopifyProductID];if(persisted?.subscriptionId)return persisted.subscriptionId;}return\"one-time\";});const[cartExistingData,setCartExistingData]=useState();const[errorMessage,setErrorMessage]=useState();const[productQuantity,setProductQuantity]=useState(1);const viewContentFired=useRef(false);const[autoSelectFirst,setAutoSelectFirst]=useState(false);const[isVariantManuallySelected,setIsVariantManuallySelected]=useState(false);const[maxQuantityReached,setMaxQuantityReached]=useState(false);const[orderMax,setOrderMax]=useState(0);// Check if variant is autoselected by default\nuseEffect(()=>{if(!isBrowser)return;//console.log(\"FC_ProductPurchaseButton mounted\")\nconst handleAutoSelectFlag=event=>{// console.log(\n//     \"Auto Select event received as:\",\n//     event.detail.autoSelectFirst\n// )\nif(event.detail.shopifyProductID!==`gid://shopify/Product/${props.shopifyProductID}`){return;}setAutoSelectFirst(event.detail.autoSelectFirst);window.__fc_autoSelectFirst=event.detail.autoSelectFirst;//console.log(\"Auto Select First Flag:\", event.detail.autoSelectFirst)\n};document.addEventListener(\"auto_select_first_flag\",handleAutoSelectFlag);return()=>{document.removeEventListener(\"auto_select_first_flag\",handleAutoSelectFlag);};},[isBrowser]);// Calculate total inventory helper function\nconst calculateTotalInventory=useCallback(productData=>{if(!productData||productData===\"404\")return 0;// If totalInventory is available, use it\nif(typeof productData.totalInventory===\"number\"){return productData.totalInventory;}// Otherwise sum up variant quantities\nreturn get(productData,\"variants.edges\",[]).reduce((total,{node})=>{return total+(node.quantityAvailable||0);},0);},[]);// Helper function to check if variant is available for sale\nconst isVariantAvailable=useCallback(variant=>{if(!variant)return false;// If availableForSale is true, the variant can be sold regardless of quantity\nif(variant.availableForSale)return true;// If availableForSale is false, check quantity\nreturn variant.quantityAvailable>0;},[]);// Error handling\nuseEffect(()=>{if(errorMessage&&isBrowser){const event=new CustomEvent(\"errorChanged\",{detail:errorMessage});window.dispatchEvent(event);}},[errorMessage]);// Load cart from localStorage\nuseEffect(()=>{if(!isBrowser||!window[\"shopXtools\"])return;// Try to load cart ID first\nconst savedCartId=localStorage.getItem(\"shopX_cart_id\");if(savedCartId){// If we have a cart ID, fetch the cart data\nwindow.shopXtools.handleCartMutation(cartQuery,{cartId:savedCartId}).then(data=>{if(data?.cart){setCartExistingData(data.cart);window.shopXtools.cart=data.cart;localStorage.setItem(\"shopXtools.cart\",JSON.stringify(data.cart));}}).catch(error=>{// Clear invalid cart data\nlocalStorage.removeItem(\"shopX_cart_id\");localStorage.removeItem(\"shopXtools.cart\");});}// Check for persisted subscription state that may have been set\n// before this component mounted (solves race on page load when\n// default is \"Subscribe\")\nconst persisted=window.__fc_activeSubscription?.[shopifyProductID];if(persisted?.subscriptionId){setPlanSelected(persisted.subscriptionId);}const handleSubscriptionChange=event=>{// Only apply subscription selection for this specific product\nif(event.detail?.productId&&event.detail.productId!==shopifyProductID)return;setPlanSelected(event.detail.subscriptionId);};document.addEventListener(\"subscription__selection-sync\",handleSubscriptionChange);return()=>document.removeEventListener(\"subscription__selection-sync\",handleSubscriptionChange);},[isBrowser,shopifyProductID]);// Add this at the top level with other event handlers\nconst handleQuantityChange=event=>{// console.log(\"Quantity change event received:\", event.detail)\nsetProductQuantity(event.detail);};useEffect(()=>{if(isBrowser){window.addEventListener(\"FcQuantitySelectorchanges\",handleQuantityChange);// Cleanup\nreturn()=>{window.removeEventListener(\"FcQuantitySelectorchanges\",handleQuantityChange);};}},[isBrowser]);// Separate effect for ViewContent tracking - more reliable\nuseEffect(()=>{if(!isBrowser||!product||viewContentFired.current)return;// Wait for either activeVariant or at least one variant to be available\nconst hasVariantData=activeVariant||product.variants?.edges?.length>0;if(hasVariantData){// console.log('[ViewContent] Firing ViewContent event for product:', product.title);\ntrackFacebookPixelViewContent({variant:activeVariant||product.variants?.edges?.[0]?.node,product:product,currency:activeVariant?.price?.currencyCode||product.variants?.edges?.[0]?.node?.price?.currencyCode||\"USD\"});viewContentFired.current=true;}},[isBrowser,product,activeVariant]);useEffect(()=>{if(!isBrowser)return;const handleCurrencyChange=async event=>{const{countryCode}=event.detail;setCountryCode(countryCode);const existingCartId=localStorage.getItem(\"shopX_cart_id\");if(existingCartId){try{const updateData=await window.shopXtools.handleCartMutation(updateCartCurrency,{cartId:existingCartId,countryCode:countryCode});if(updateData?.cartBuyerIdentityUpdate?.cart){window.shopXtools.cart=updateData.cartBuyerIdentityUpdate.cart;window.dispatchEvent(new Event(\"shopXtools-cart-update\"));}else{window.dispatchEvent(new CustomEvent(\"errorChanged\",{detail:\"Failed to update cart with new country code\"}));}}catch(error){window.dispatchEvent(new CustomEvent(\"errorChanged\",{detail:error.message||\"Failed to update cart currency\"}));}}};window.addEventListener(\"currency_changed\",handleCurrencyChange);return()=>{window.removeEventListener(\"currency_changed\",handleCurrencyChange);};},[isBrowser]);// Load product data and set up event listeners\nuseEffect(()=>{if(!isBrowser)return;const handleSingleVariantProduct=productNode=>{if(!productNode)return false;const variants=get(productNode,\"variants.edges\",[]);if(variants.length===1){const variant=variants[0].node;setActiveVariant(variant);if(!isVariantManuallySelected){window.__fc_activeVariantId=variant.id;}setIsInStock(isVariantAvailable(variant));setNeedsVariantSelection(false);return true;}return false;};const handleProductData=_matchingProduct=>{// Early return if we already have this exact product loaded\nif(product&&product!==\"404\"){const currentProductId=product?.id;const incomingProductId=_matchingProduct?.node?.id;if(currentProductId&&incomingProductId&&currentProductId===incomingProductId){// console.log(\n//   '[handleProductData] Product already loaded, skipping update'\n// );\nreturn;}}// console.log(\n//   '[handleProductData] Processing product update',\n//   product,\n//   _matchingProduct\n// );\nif(_matchingProduct){const productNode=_matchingProduct.node;setProduct(productNode||\"404\");// Fetch order_max if we have a product handle\nif(productNode?.handle){fetchOrderMax(productNode.handle);}// If shopifyProductVariantId is provided, find and set that variant\nif(shopifyProductVariantId&&productNode){const variantId=`gid://shopify/ProductVariant/${shopifyProductVariantId}`;const matchingVariant=get(productNode,\"variants.edges\",[]).find(({node})=>node.id===variantId);if(matchingVariant){setActiveVariant(matchingVariant.node);if(!isVariantManuallySelected){window.__fc_activeVariantId=matchingVariant.node.id;}setIsInStock(isVariantAvailable(matchingVariant.node));setNeedsVariantSelection(false);return;// Exit early as we've found our variant\n}}// Immediately handle single variant products\nif(handleSingleVariantProduct(productNode)){return;// Exit early as we've handled the single variant\n}if(autoSelectFirst&&!isVariantManuallySelected){//console.log(\"Auto-selecting the first variant\");\nconst firstAvailableVariant=productNode.variants.edges.find(edge=>edge.node.availableForSale)?.node;if(firstAvailableVariant){setActiveVariant(firstAvailableVariant);if(!isVariantManuallySelected){window.__fc_activeVariantId=firstAvailableVariant.id;}setIsInStock(isVariantAvailable(firstAvailableVariant));setNeedsVariantSelection(false);return;// Exit early as we've set the active variant\n}}// For multi-variant products without a selected variant\nconst variants=get(productNode,\"variants.edges\",[]);const hasMultipleVariants=variants.length>1;const optionsCount=get(productNode,\"options\",[]).length||0;// Only update needsVariantSelection if we don't have an active variant.\n// This is to prevent the \"Select Variant\" button from showing when the variant is already selected.\nif(!activeVariant){if(!autoSelectFirst&&hasMultipleVariants){setNeedsVariantSelection(true);}else{setNeedsVariantSelection(!shopifyProductVariantId&&hasMultipleVariants);}}// Check if any variant is available\nconst anyVariantAvailable=variants.some(({node})=>isVariantAvailable(node));setIsInStock(anyVariantAvailable);// If nothing is available, do not prompt for variant selection\nif(!anyVariantAvailable){setNeedsVariantSelection(false);}}else{setProduct(\"404\");setIsInStock(false);}};// Check if we already have product data available\nif(window.shopXtools?.products&&Array.isArray(window.shopXtools.products)&&!product){const _matchingProduct=window.shopXtools.products.find(({node})=>node.id===`gid://shopify/Product/${shopifyProductID}`);if(_matchingProduct){// console.log(\n//   '[PURCHASE BUTTON] Found matching product on mount, loading it'\n// );\nhandleProductData(_matchingProduct);}else{// console.log(\n//   '[PURCHASE BUTTON] No matching product found in existing products'\n// );\n}}const productsReadyHandler=()=>{if(window?.shopXtools?.products){const matchingProduct=window.shopXtools.products.find(({node:product})=>product.id===`gid://shopify/Product/${shopifyProductID}`);// console.log(\n//   '[productsReadyHandler] Found matching product:',\n//   !!matchingProduct\n// );\n// Only update if we don't already have this product data loaded\nif(!product||product===\"404\"){// console.log(\n//   '[productsReadyHandler] No product loaded yet, calling handleProductData'\n// );\nhandleProductData(matchingProduct);}}};const variantChangeHandler=e=>{// Only update the variant if no shopifyProductVariantId is provided\n// console.log(\"Variant changed, active variant is\", e.detail)\nif(e.detail.productId!==`gid://shopify/Product/${shopifyProductID}`){return;}if(e.detail){// Normalize completeness: some dispatchers may omit isCompleteVariant.\nconst productOptions=get(product,\"options\",[])||[];const selectedArray=Array.isArray(e.detail.selectedOptions)?e.detail.selectedOptions:[];const selectedNames=new Set(selectedArray.map(o=>o?.name).filter(Boolean));const isCompleteFromNames=productOptions.length>0&&productOptions.every(opt=>selectedNames.has(opt.name));const isComplete=e.detail.isCompleteVariant===true||isCompleteFromNames;// If selection is partial, DO NOT treat it as an active variant for purchasing\nif(!isComplete){setIsVariantManuallySelected(true);setActiveVariant(null);window.__fc_activeVariantId=undefined;setNeedsVariantSelection(true);return;}// Complete selection – safe to treat as active variant\nsetActiveVariant(e.detail);setIsVariantManuallySelected(true);window.__fc_activeVariantId=e.detail.id;setIsInStock(e.detail.quantityAvailable>0);// console.log(\"e.detail.id\", e.detail.id)\n// console.log(\n//     \"window.__fc_activeVariantId\",\n//     window.__fc_activeVariantId\n// )\nconst cartQuantity=getCurrentCartQuantity(e.detail.id);// console.log(\"variantChangeHandler: cartQuantity\", cartQuantity)\n// if there's a cart item, it can reach the stock limit only if variant's quantityAvailable > 0\n// if variant's quantityAvailable = 0, it's out of stock, and we don't show 'limit reached' state\n// if variant's quantityAvailable < 0, continue selling when out of stock is enabled, so limit cannot ever be reached\nif(cartQuantity===e.detail.quantityAvailable&&e.detail.quantityAvailable>0){// console.log(\"variantChangeHandler: max reached\")\nsetMaxQuantityReached(true);}else{setMaxQuantityReached(false);}// When autoSelectFirst is false, we need to make sure all variants are selected\n// before changing the button state\n// Only mark selection as complete when all options are selected\nif(isComplete){setNeedsVariantSelection(false);}else{setNeedsVariantSelection(true);}}};document.addEventListener(\"data__products-ready\",productsReadyHandler);document.addEventListener(\"product__active-variant__changed\",variantChangeHandler);return()=>{document.removeEventListener(\"data__products-ready\",productsReadyHandler);document.removeEventListener(\"product__active-variant__changed\",variantChangeHandler);};},[shopifyProductID,shopifyProductVariantId,activeVariant,isBrowser,calculateTotalInventory,autoSelectFirst,product]);// Update variant selection state when activeVariant changes\nuseEffect(()=>{if(!product||product===\"404\")return;const variants=get(product,\"variants.edges\",[]);const hasMultipleVariants=variants.length>1;const noVariantSelected=!activeVariant&&!shopifyProductVariantId;// console.log('Variant selection state update:', {\n//     hasMultipleVariants,\n//     noVariantSelected,\n//     activeVariant,\n//     shopifyProductVariantId\n// })\nsetNeedsVariantSelection(hasMultipleVariants&&noVariantSelected);},[product,activeVariant,shopifyProductVariantId]);// Cart functionality\n// Add new state for order field validation\nconst[orderFieldError,setOrderFieldError]=useState(false);// Debug logging function\nconst logDebug=(message,data)=>{// Empty function - no logging\n};// Enhanced validation function with logging\nconst validateOrderField=()=>{if(!props.required){logDebug(\"Validation skipped - not required\",{required:props.required});return true;}const productSpecificKey=`fc_cart_attributes_${props.shopifyProductID}`;const storedAttributes=sessionStorage.getItem(productSpecificKey);logDebug(\"Checking stored attributes\",{productSpecificKey,hasStoredAttributes:!!storedAttributes});if(!storedAttributes){return false;}try{const parsedAttrs=JSON.parse(storedAttributes);// Check if any attribute has a non-empty value\nconst hasValidValue=Object.values(parsedAttrs).some(value=>value&&String(value).trim()!==\"\");logDebug(\"Validation result\",{attributes:parsedAttrs,isValid:hasValidValue});return hasValidValue;}catch(error){return false;}};// Effect to initialize validation state\nuseEffect(()=>{if(props.required){const isValid=validateOrderField();logDebug(\"Initial validation\",{isValid,required:props.required});setOrderFieldError(!isValid);}},[props.required,props.shopifyProductID]);// Listen for order field changes with logging\nuseEffect(()=>{if(props.required){const handleOrderFieldChange=event=>{logDebug(\"Order field change event received\",event.detail);const isValid=validateOrderField();setOrderFieldError(!isValid);logDebug(\"Order field validation updated\",{isValid,orderFieldError:!isValid});};window.addEventListener(\"orderFieldChanged\",handleOrderFieldChange);return()=>window.removeEventListener(\"orderFieldChanged\",handleOrderFieldChange);}},[props.required]);const[isInputRequired,setIsInputRequired]=useState(false);// Effect to check if the input field exists and is required\nuseEffect(()=>{const checkInputRequirement=()=>{const configKey=`fc_input_config_${shopifyProductID}`;const config=sessionStorage.getItem(configKey);// Only set as required if the config exists and required is true\nif(config){const{required}=JSON.parse(config);setIsInputRequired(required);}else{// If no config exists, the field isn't on the page\nsetIsInputRequired(false);}};checkInputRequirement();// Listen for config changes\nwindow.addEventListener(\"inputConfigChanged\",checkInputRequirement);return()=>window.removeEventListener(\"inputConfigChanged\",checkInputRequirement);},[shopifyProductID]);const getLineItem=()=>{const merchandiseId=activeVariant?.id||(props.shopifyProductVariantId?`gid://shopify/ProductVariant/${props.shopifyProductVariantId}`:null);if(!merchandiseId){throw new Error(\"No valid product variant selected\");}const lineItem={merchandiseId,quantity:productQuantity};// Add selling plan ID if a subscription is selected\nif(planSelected&&planSelected!==\"one-time\"){lineItem[\"sellingPlanId\"]=planSelected;}try{const productSpecificKey=`fc_cart_attributes_${props.shopifyProductID}`;const stored=sessionStorage.getItem(productSpecificKey);if(!stored)return lineItem;const data=JSON.parse(stored);// Get all attributes instead of just checking for specific ones\nconst attributes=[];// Process all key-value pairs in the stored data\nObject.entries(data).forEach(([key,value])=>{if(value&&String(value).trim()){attributes.push({key,value:String(value).trim()});}});// Only add attributes if we have any\nif(attributes.length>0){lineItem[\"attributes\"]=attributes;}}catch(e){console.error(\"Error adding attributes to cart item:\",e);}return lineItem;};// Fetch order_max from product metafields\nconst fetchOrderMax=useCallback(async productHandle=>{if(!productHandle)return;try{const metafieldsResponse=await window.shopXtools?.handleCartMutation?.(getProductMetafields,{handle:productHandle});const max=parseInt(metafieldsResponse?.product?.metafield_order_max?.value,10);if(!isNaN(max)&&max>0){setOrderMax(max);// console.log(\"Fetched order max\", max)\n}else{setOrderMax(0);}}catch(error){console.warn(\"Could not fetch product metafields for order_max:\",error);setOrderMax(0);}},[]);// Modify the getCurrentCartQuantity function to calculate per-product quantity\nconst getCurrentCartQuantity=useCallback(variantId=>{// if (!cartExistingData?.lines?.edges) {\n//     return 0\n// }\nconst liveCart=window?.shopXtools?.cart;setCartExistingData(liveCart);const liveEdges=liveCart?.lines?.edges;if(!liveEdges)return 0;// If we have a product handle, calculate per-product quantity\nif(product?.handle&&orderMax>0){const productVariantIds=get(product,\"variants.edges\",[]).map(({node})=>node.id);const totalQuantity=liveEdges.reduce((total,{node})=>{if(productVariantIds.includes(node.merchandise.id)){return total+node.quantity;}return total;},0);// console.log(\"getCurrentCartQuantity (per-product):\", totalQuantity)\nreturn totalQuantity;}// Fallback to variant-specific quantity\nconst quantity=liveEdges.reduce((total,{node})=>{if(node.merchandise.id===variantId){return total+node.quantity;}return total;},0);// console.log(\"getCurrentCartQuantity (per-variant):\", quantity)\nreturn quantity;},[product,orderMax]);const handleAddToCart=async()=>{try{if(!isBrowser)return;const variantId=activeVariant?.id||(props.shopifyProductVariantId?`gid://shopify/ProductVariant/${props.shopifyProductVariantId}`:null);const currentCartQuantity=getCurrentCartQuantity(variantId);// console.log(\"currentCartQuantity\", currentCartQuantity)\n// Check order_max from product metafields\nif(orderMax>0){// console.log(\"orderMax > 0\", orderMax)\n// Check if we've already reached the product limit\nif(currentCartQuantity>=orderMax){// console.log(\"currentCartQuantity >= orderMax: Max reached\")\nsetMaxQuantityReached(true);return;}}// Check quantityAvailable when orderMax is 0 or not set\nif(orderMax===0&&activeVariant&&activeVariant.quantityAvailable>0){// console.log(\"orderMax is 0, checking quantityAvailable\")\n// console.log(\"activeVariant.quantityAvailable\", activeVariant.quantityAvailable)\n// Check if we've already reached the available quantity\nif(currentCartQuantity>=activeVariant.quantityAvailable){// console.log(\"currentCartQuantity >= quantityAvailable: Max reached\")\nsetMaxQuantityReached(true);return;}}if(props.required||isInputRequired){const productSpecificKey=`fc_cart_attributes_${props.shopifyProductID}`;const storedAttributes=sessionStorage.getItem(productSpecificKey);const inputElement=document.querySelector(`[data-product-id=\"${props.shopifyProductID}\"]`);const currentInputValue=inputElement?.value||\"\";// Don't check for unsaved input if there's no input element or value\nif(inputElement&&currentInputValue&&storedAttributes){try{// Parse stored attributes\nconst parsedAttrs=JSON.parse(storedAttributes);// Check if the current input value is different from any of the stored attribute values\nconst valueIsSaved=Object.values(parsedAttrs).some(attrValue=>String(attrValue).trim()===currentInputValue.trim());if(!valueIsSaved){window.dispatchEvent(new CustomEvent(\"inputValidationFailed\",{detail:{productId:props.shopifyProductID,message:\"Please save your input before adding to cart\"}}));return;}}catch(e){// If we can't parse stored attributes, we can't validate\nwindow.dispatchEvent(new CustomEvent(\"inputValidationFailed\",{detail:{productId:props.shopifyProductID,message:\"Please fill in all required fields\"}}));return;}}// Now check if there are any stored attributes at all\nif(!storedAttributes){window.dispatchEvent(new CustomEvent(\"inputValidationFailed\",{detail:{productId:props.shopifyProductID,message:\"Please fill in all required fields\"}}));return;}// Finally check if any of the stored attributes has a valid value\ntry{const parsedAttrs=JSON.parse(storedAttributes);const hasValidValue=Object.values(parsedAttrs).some(value=>value&&String(value).trim()!==\"\");if(!hasValidValue){window.dispatchEvent(new CustomEvent(\"inputValidationFailed\",{detail:{productId:props.shopifyProductID,message:\"Please fill in all required fields\"}}));return;}}catch(e){window.dispatchEvent(new CustomEvent(\"inputValidationFailed\",{detail:{productId:props.shopifyProductID,message:\"Please fill in all required fields\"}}));return;}}const lines=[getLineItem()];// console.log(\"handleAddToCart lines:\", lines)\n// Retrieve the selected country code from localStorage\nconst countryCode=localStorage.getItem(\"selectedCountryCode\");let existingCartId=localStorage.getItem(\"shopX_cart_id\");if(!BuyNowATC){if(existingCartId){try{const cartValidation=await window.shopXtools.handleCartMutation(cartQuery,{cartId:existingCartId});if(!cartValidation?.cart){localStorage.removeItem(\"shopX_cart_id\");localStorage.removeItem(\"shopXtools.cart\");existingCartId=null;}}catch(error){localStorage.removeItem(\"shopX_cart_id\");localStorage.removeItem(\"shopXtools.cart\");existingCartId=null;}}if(!existingCartId){try{const cartData=await window.shopXtools.handleCartMutation(createCartMutation,{lines,countryCode:countryCode});if(cartData?.cartCreate?.cart?.id){localStorage.setItem(\"shopX_cart_id\",cartData.cartCreate.cart.id);localStorage.setItem(\"shopXtools.cart\",JSON.stringify(cartData.cartCreate.cart));window.shopXtools.cart=cartData.cartCreate.cart;setCartExistingData(window.shopXtools.cart);// Dispatch event after updating the cart\nwindow.dispatchEvent(new Event(\"shopXtools-cart-update\"));// Analytics\nconst currency=activeVariant?.price?.currencyCode||\"USD\";const value=parseFloat((parseFloat(activeVariant?.price?.amount||\"0\")*productQuantity).toFixed(2));const item_id=cleanShopifyId(activeVariant?.id);const item_name=product?.title||\"\";// const item_variant = activeVariant?.selectedOptions\n//     .map(opt => `${opt.name} ${opt.value}`)\n//     .join(\" / \") || null\nconst item_variant=activeVariant?.selectedOptions?activeVariant.selectedOptions.map(opt=>`${opt.name} ${opt.value}`).join(\" / \")||null:\"\";const price=parseFloat(activeVariant?.price?.amount||\"0\");// Google Analytics tracking (add_to_cart)\nif(item_id&&item_name&&item_variant&&price>0){const payload={currency,value,items:[{item_id,item_name,item_variant,price,item_brand:product?.vendor||null,item_category:product?.productType||null,quantity:productQuantity,// TagHound compatibility\nSKU:item_id,\"Item Name\":item_name}]};// console.log('[FC_ProductPurchaseButton ANALYTICS] About to fire add_to_cart with payload:', payload);\nif(typeof window.fcTrackGAEvent===\"function\"){window.fcTrackGAEvent(\"add_to_cart\",payload);// console.log('[FC_ProductPurchaseButton ANALYTICS] Fired add_to_cart:', payload.items[0]);\n}}else{console.warn(\"❌ Skipping add_to_cart: missing item data\",{item_id,item_name,item_variant,price,value});}// Meta Pixel tracking\ntrackFacebookPixelAddToCart({variant:activeVariant,product:product,quantity:productQuantity,currency:currency});window.shopXtools.dispatchEvent(\"checkout__changed\",{__triggerCartModal:openCart});}else{window.dispatchEvent(new CustomEvent(\"errorChanged\",{detail:\"Failed to add to cart\"}));}}catch(error){window.dispatchEvent(new CustomEvent(\"errorChanged\",{detail:error.message||\"Failed to create new cart\"}));}}else{const cartData=await window.shopXtools.handleCartMutation(addToCartMutation,{cartId:existingCartId,lines});if(cartData?.cartLinesAdd?.cart){localStorage.setItem(\"shopXtools.cart\",JSON.stringify(cartData.cartLinesAdd.cart));window.shopXtools.cart=cartData.cartLinesAdd.cart;// console.log(\"handleAddToCart cart:\", window.shopXtools.cart)\nsetCartExistingData(window.shopXtools.cart);// Dispatch event after updating the cart\nwindow.dispatchEvent(new Event(\"shopXtools-cart-update\"));// Google Analytics tracking\nconst currency=activeVariant?.price?.currencyCode||\"USD\";const value=parseFloat((parseFloat(activeVariant?.price?.amount||\"0\")*productQuantity).toFixed(2));const item_id=cleanShopifyId(activeVariant?.id);const item_name=product?.title||\"\";// const item_variant = activeVariant?.selectedOptions\n//     .map(opt => `${opt.name} ${opt.value}`)\n//     .join(\" / \") || null\nconst item_variant=activeVariant?.selectedOptions?activeVariant.selectedOptions.map(opt=>`${opt.name} ${opt.value}`).join(\" / \")||null:\"\";const price=parseFloat(activeVariant?.price?.amount||\"0\");// Google Analytics tracking (add_to_cart)\nif(item_id&&item_name&&item_variant&&price>0){const payload={currency,value,items:[{item_id,item_name,item_variant,price,item_brand:product?.vendor||null,item_category:product?.productType||null,quantity:productQuantity,// TagHound compatibility\nSKU:item_id,\"Item Name\":item_name}]};// console.log('[FC_ProductPurchaseButton ANALYTICS] About to fire add_to_cart with payload:', payload);\nif(typeof window.fcTrackGAEvent===\"function\"){window.fcTrackGAEvent(\"add_to_cart\",payload);// console.log('[FC_ProductPurchaseButton ANALYTICS] Fired add_to_cart:', payload.items[0]);\n}}else{console.warn(\"❌ Skipping add_to_cart: missing item data\",{item_id,item_name,item_variant,price,value});}// Meta Pixel tracking\ntrackFacebookPixelAddToCart({variant:activeVariant,product:product,quantity:productQuantity,currency:currency});window.shopXtools.dispatchEvent(\"checkout__changed\",{__triggerCartModal:openCart});}else{window.dispatchEvent(new CustomEvent(\"errorChanged\",{detail:\"Failed to add to cart\"}));}}}// Directly proceed to checkout without opening the cart modal\nif(BuyNowATC){//console.log(\"Directly proceeding to checkout without opening the cart modal\")\n// Create the cart and proceed to checkout\nconst variables={lines,countryCode:countryCode};//console.log(\"Sending mutation with variables:\", variables)\nconst result=await window[\"shopXtools\"]?.handleTemporaryCartMutation(createCartMutation,variables);//console.log(\"result:\", result)\nconst checkoutUrl=result.cartCreate.cart.checkoutUrl;if(checkoutUrl){//console.log(\"checkoutUrl:\", checkoutUrl)\nlet finalCheckoutUrl=checkoutUrl;if(finalCheckoutUrl){// Analytics\nconst currency=activeVariant?.price?.currencyCode||\"USD\";const value=parseFloat((parseFloat(activeVariant?.price?.amount||\"0\")*productQuantity).toFixed(2));const item_id=cleanShopifyId(activeVariant?.id);const item_name=product?.title||\"\";// const item_variant = activeVariant?.selectedOptions\n//     .map(opt => `${opt.name} ${opt.value}`)\n//     .join(\" / \") || null\nconst item_variant=activeVariant?.selectedOptions?activeVariant.selectedOptions.map(opt=>`${opt.name} ${opt.value}`).join(\" / \")||null:\"\";const price=parseFloat(activeVariant?.price?.amount||\"0\");// Google Analytics tracking (begin_checkout)\nif(item_id&&item_name&&item_variant&&price>0){const payload={currency,value,items:[{item_id,item_name,item_variant,price,item_brand:product?.vendor||null,item_category:product?.productType||null,quantity:productQuantity,// TagHound compatibility\nSKU:item_id,\"Item Name\":item_name}]};// console.log('[FC_ProductPurchaseButton ANALYTICS] About to fire begin_checkout with payload:', payload);\nif(typeof window.fcTrackGAEvent===\"function\"){window.fcTrackGAEvent(\"begin_checkout\",payload);// console.log('[FC_ProductPurchaseButton ANALYTICS] Fired begin_checkout:', payload.items[0]);\n}}else{console.warn(\"❌ Skipping begin_checkout: missing item data\",{item_id,item_name,item_variant,price,value});}// Meta Pixel tracking\ntrackFacebookPixelInitiateCheckout({variant:activeVariant,product:product,quantity:productQuantity,currency:currency,useBeacon:true});finalCheckoutUrl=appendAllTrackingParamsToUrl(finalCheckoutUrl);finalCheckoutUrl=appendLanguageToUrl(finalCheckoutUrl);window.location.assign(finalCheckoutUrl);}}else{window.dispatchEvent(new CustomEvent(\"errorChanged\",{detail:\"Failed to create cart for checkout\"}));}}if(lines[0].attributes){// const cartId = existingCartId || cartData?.cartCreate?.cart?.id;\nconst cartId=existingCartId//removed check for cartData\n;await window.shopXtools.handleCartMutation(updateCartAttributes,{cartId,attributes:lines[0].attributes});}}catch(error){window.dispatchEvent(new CustomEvent(\"errorChanged\",{detail:error.message||\"Failed to add item to cart\"}));}};// Update loading state when product data is received\nuseEffect(()=>{if(product){setIsLoading(false);}},[product]);// Initialize hasInitialized\nuseEffect(()=>{if(!hasInitialized&&(product||shopifyProductID)){// && (product || shopifyProductID) part ensures the button is rendered in Framer preview\n// Small delay to ensure we have all the necessary data\nconst timer=setTimeout(()=>{setHasInitialized(true);},50);return()=>clearTimeout(timer);}},[product]);// Handle loading state for canvas preview\nconst isDesignOrPreview=RenderTarget.current()===RenderTarget.canvas;let content=null;if(isDesignOrPreview){content=available?.[0]||null// Always show available state in canvas\n;}else if(!hasInitialized){content=null;}else if(maxQuantityReached&&maxQuantity?.[0]){content=maxQuantity?.[0]||null;}else if(!isInStock&&!activeVariant?.availableForSale||activeVariant&&!isVariantAvailable(activeVariant)||product&&!get(product,\"variants.edges\",[]).some(({node})=>isVariantAvailable(node))||props.required&&orderFieldError){// Prioritize Out of Stock over prompting variant selection\ncontent=OutOfStock?.[0]||null;}else if(needsVariantSelection){content=SelectVariant?.[0]||null;}else{content=available?.[0]||null;}// Near the bottom of the component where we create clonedElement\nconst canAddToCart=(isInStock||activeVariant&&activeVariant.availableForSale)&&!needsVariantSelection&&!maxQuantityReached&&(!props.required||!orderFieldError);const handleClick=e=>{if(canAddToCart){handleAddToCart();}};// Single consolidated effect for maxQuantityReached\nuseEffect(()=>{const variantId=activeVariant?.id||(props.shopifyProductVariantId?`gid://shopify/ProductVariant/${props.shopifyProductVariantId}`:null);// Always read from live cart to avoid stale state after updates\nconst currentQuantity=getCurrentCartQuantity(variantId);// console.log(\"currentQuantity\", currentQuantity)\nlet shouldBeAtMax=false;// Check orderMax first (takes precedence)\nif(orderMax>0){shouldBeAtMax=currentQuantity>=orderMax;// console.log(\"orderMax check - shouldBeAtMax:\", shouldBeAtMax)\n}else if(orderMax===0&&activeVariant){if(activeVariant.quantityAvailable>0&&activeVariant.availableForSale){// If no orderMax, check quantityAvailable\nshouldBeAtMax=currentQuantity>=activeVariant.quantityAvailable;// console.log(\"quantityAvailable check - shouldBeAtMax:\", shouldBeAtMax)\n}}if(shouldBeAtMax!==maxQuantityReached){// console.log(\"shouldBeAtMax !== maxQuantityReached\", maxQuantityReached, shouldBeAtMax)\nsetMaxQuantityReached(shouldBeAtMax);}},[orderMax,activeVariant,props.shopifyProductVariantId,maxQuantityReached,getCurrentCartQuantity]);// Add this effect near the other useEffect hooks\nuseEffect(()=>{if(orderMax>0){window.dispatchEvent(new CustomEvent(\"setMaxQuantity\",{detail:{productId:props.shopifyProductID,maxQuantity:orderMax}}));}},[orderMax,props.shopifyProductID]);// Add this effect to handle cart updates\nuseEffect(()=>{const variantId=activeVariant?.id||(props.shopifyProductVariantId?`gid://shopify/ProductVariant/${props.shopifyProductVariantId}`:null);const currentInCart=getCurrentCartQuantity(variantId);if(orderMax>0&&cartExistingData){// Handle orderMax scenario\nconst remainingAllowed=Math.max(0,orderMax-currentInCart);window.dispatchEvent(new CustomEvent(\"setMaxQuantity\",{detail:{productId:props.shopifyProductID,maxQuantity:remainingAllowed}}));// console.log(\"sending setMaxQuantity, orderMAx > 0 (cartExistingData)\", {\n//     detail: {\n//         productId: props.shopifyProductID,\n//         maxQuantity: remainingAllowed,\n//     },\n// })\n}else if(orderMax===0&&activeVariant&&cartExistingData){// console.log(\"cartExistingData, currentInCart\", cartExistingData, currentInCart)\nif(activeVariant.quantityAvailable>0&&activeVariant.availableForSale){// Handle quantityAvailable scenario\nconst remainingAllowed=Math.max(0,activeVariant.quantityAvailable-currentInCart);window.dispatchEvent(new CustomEvent(\"setMaxQuantity\",{detail:{productId:props.shopifyProductID,maxQuantity:remainingAllowed}}));// console.log(\"sending setMaxQuantity,  orderMAx = 0 (cartExistingData)\", {\n//     detail: {\n//         productId: props.shopifyProductID,\n//         maxQuantity: remainingAllowed,\n//     },\n// })\n}}},[cartExistingData,orderMax,activeVariant,props.shopifyProductVariantId,getCurrentCartQuantity,productQuantity]);// Effect to handle general cart updates\nuseEffect(()=>{const handleCartUpdate=()=>{// console.log(\"handleCartUpdate: Cart updated, refreshing purchase button state\")\n// Force recalculation of maxQuantityReached state\nconst variantId=activeVariant?.id||null;const currentQuantity=getCurrentCartQuantity(variantId);if(orderMax>0){const shouldBeAtMax=currentQuantity>=orderMax;setMaxQuantityReached(shouldBeAtMax);// console.log(\"handleCartUpdate: orderMax > 0, shouldBeAtMax:\", shouldBeAtMax)\n}else if(orderMax===0&&activeVariant&&activeVariant.quantityAvailable>0){const shouldBeAtMax=currentQuantity>=activeVariant.quantityAvailable;setMaxQuantityReached(shouldBeAtMax);// console.log(\"handleCartUpdate: orderMax = 0, shouldBeAtMax:\", shouldBeAtMax)\n}else{setMaxQuantityReached(false);// console.log(\"handleCartUpdate: resetting maxQuantityReached to false\")\n}const orderMaxRemainingAllowed=Math.max(0,orderMax-currentQuantity);// console.log(\"handleCartUpdate: orderMaxRemainingAllowed\", orderMaxRemainingAllowed)\nconst variantQnt=activeVariant?.quantityAvailable<=0&&activeVariant?.availableForSale?100:activeVariant?.quantityAvailable;// console.log(\"handleCartUpdate: variantQnt\", variantQnt)\nconst remainingAllowed=Math.max(0,variantQnt-currentQuantity);// console.log(\"handleCartUpdate: remainingAllowed\", remainingAllowed)\nwindow.dispatchEvent(new CustomEvent(\"setMaxQuantity\",{detail:{productId:props.shopifyProductID,maxQuantity:orderMax>0?orderMaxRemainingAllowed:remainingAllowed}}));// console.log(\"handleCartUpdate: sending setMaxQuantity\", {\n//     detail: {\n//         productId: props.shopifyProductID,\n//         maxQuantity: orderMax > 0 ? orderMaxRemainingAllowed : remainingAllowed,\n//     },\n// })\n};window.addEventListener(\"shopXtools-cart-update\",handleCartUpdate);return()=>window.removeEventListener(\"shopXtools-cart-update\",handleCartUpdate);},[activeVariant,orderMax,getCurrentCartQuantity,props.shopifyProductID]);useEffect(()=>{if(!isBrowser)return;const handleResize=()=>{if(typeof window!==\"undefined\"&&window.__fc_autoSelectFirst!==undefined){setAutoSelectFirst(window.__fc_autoSelectFirst);}if(typeof window!==\"undefined\"&&window.__fc_activeVariantId!==undefined){const storedId=window.__fc_activeVariantId;// console.log(\"storedId\", storedId)\nif(storedId){const variants=get(product,\"variants.edges\",[]);const found=variants.find(({node})=>node.id===storedId);// console.log(\"found\", found)\nif(found)setActiveVariant(found.node);// console.log(\"setting activeVariant\", found.node)\n}}if(product){const variants=get(product,\"variants.edges\",[]);const hasMultipleVariants=variants.length>1;// console.log(\"activeVariant\", activeVariant)\nif(autoSelectFirst){setNeedsVariantSelection(false);// console.log(\"handleResize: autoSelectFirst, setting needsVariantSelection to false\");\n}else if(activeVariant){// If a variant is already selected, don't require selection\nsetNeedsVariantSelection(false);// console.log(\"handleResize: activeVariant exists, setting needsVariantSelection to false\");\n}else if(!autoSelectFirst&&hasMultipleVariants){setNeedsVariantSelection(true);// console.log(\"handleResize: !autoSelectFirst && hasMultipleVariants\", autoSelectFirst, hasMultipleVariants);\n}else{setNeedsVariantSelection(!shopifyProductVariantId&&hasMultipleVariants);//console.log(\"handleResize: !shopifyProductVariantId && hasMultipleVariants\", shopifyProductVariantId, hasMultipleVariants);\n}}};window.addEventListener(\"resize\",handleResize);return()=>{window.removeEventListener(\"resize\",handleResize);};},[isBrowser,product,activeVariant,autoSelectFirst,shopifyProductVariantId]);const viewItemTrackedRef=useRef();const pageViewTrackedRef=useRef(false);// Single consolidated analytics effect\nuseEffect(()=>{if(!product)return;// Helper to extract brand and category if available\nconst item_brand=product.vendor||null;const item_category=product.productType||null;// Always fire page_view on initial load\nif(!pageViewTrackedRef.current){const productId=cleanShopifyId(product.id);const productName=product.title;const defaultVariant=get(product,\"variants.edges\",[])[0]?.node;let payload;if(defaultVariant){// Product with variants\npayload={currency:defaultVariant.price?.currencyCode||\"USD\",value:parseFloat(defaultVariant.price?.amount||\"0\"),items:[{item_id:cleanShopifyId(defaultVariant.id),item_name:productName,item_variant:defaultVariant.title,price:parseFloat(defaultVariant.price?.amount||\"0\"),item_brand,item_category,quantity:1,// TagHound compatibility\nSKU:cleanShopifyId(defaultVariant.id),\"Item Name\":productName}]};}else{// Product with no variants\npayload={currency:product.priceRange?.minVariantPrice?.currencyCode||\"USD\",value:parseFloat(product.priceRange?.minVariantPrice?.amount||\"0\"),items:[{item_id:productId,item_name:productName,price:parseFloat(product.priceRange?.minVariantPrice?.amount||\"0\"),item_brand,item_category,quantity:1,// TagHound compatibility\nSKU:productId,\"Item Name\":productName}]};}// We do not fire GA4 page_view manually; GA4 config handles it. Keep only view_item below.\npageViewTrackedRef.current=true;}// Fire view_item when variant is selected\nif(activeVariant&&product?.title){const item_id=cleanShopifyId(activeVariant.id);const item_name=product.title;// console.log(\"activeVariant\", activeVariant)\nconst item_variant=activeVariant?.selectedOptions?activeVariant.selectedOptions.map(opt=>`${opt.name} ${opt.value}`).join(\" / \")||null:\"\";const price=parseFloat(activeVariant.price?.amount||\"0\");const currency=activeVariant.price?.currencyCode||\"USD\";const value=price;// Only fire if all data is present and not already tracked for this variant\nif(item_id&&item_name&&item_variant&&price>0&&viewItemTrackedRef.current!==item_id){const payload={currency,value,items:[{item_id,item_name,item_variant,price,item_brand,item_category,quantity:1,// TagHound compatibility\nSKU:item_id,\"Item Name\":item_name}]};if(payload.items&&payload.items.length>0&&payload.items[0].item_id&&payload.items[0].item_name){window.fcTrackGAEvent&&window.fcTrackGAEvent(\"view_item\",payload);viewItemTrackedRef.current=item_id;}else{// Skipping view_item - invalid payload\n}}}},[product,activeVariant]);useEffect(()=>{// On state transition, blur any currently focused button that is about to be hidden\nconst focused=document.activeElement;if(focused&&focused.closest(\".fc-purchase-button-container\")){focused.blur();}},[content]);// Determine canvas preview content\nlet canvasContent=null;if(isDesignOrPreview){// If \"Available\" (Add to Cart) is connected, it dominates\nif(available?.[0]){canvasContent=available[0];}else if(SelectVariant?.[0]){canvasContent=SelectVariant[0];}else if(OutOfStock?.[0]){canvasContent=OutOfStock[0];}else if(maxQuantity?.[0]){canvasContent=maxQuantity[0];}else if(LoadingState?.[0]){canvasContent=LoadingState[0];}}// Check if we need to show \"Connect Instance\" in canvas\nconst hasAnyState=available?.[0]||SelectVariant?.[0]||OutOfStock?.[0]||maxQuantity?.[0]||LoadingState?.[0];if(isDesignOrPreview&&!hasAnyState){return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",color:\"#666\",fontSize:\"14px\",border:\"1px dashed #ccc\",borderRadius:\"4px\"},children:\"Connect Instance\"});}const href=typeof window!==\"undefined\"?window.location.href:\"\";const isPreview=href.includes(\"framercanvas.com\")// projects in preview always run under the internal domain framercanvas.com\n;// Sanitize content instances before cloning\nconst sanitizedCanvasContent=canvasContent?sanitizeChildrenRecursively(canvasContent):null;const sanitizedLoadingState=LoadingState?.[0]?sanitizeChildrenRecursively(LoadingState[0]):null;const sanitizedContent=content?sanitizeChildrenRecursively(content):null;return /*#__PURE__*/_jsxs(\"div\",{style:{height:\"100%\",position:\"relative\"},role:\"none\",className:\"fc-purchase-button-container\",children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                .fc-purchase-button-container :focus-visible {\n                    outline: ${props.focus.width}px solid ${props.focus.color} !important;\n                    outline-offset: ${props.focus.padding}px !important;\n                    border-radius: ${props.focus.radius}px !important;\n                }\n            `}),isDesignOrPreview?sanitizedCanvasContent&&/*#__PURE__*/cloneElement(sanitizedCanvasContent,{style:{...canvasContent?.props?.style||{},width:\"100%\",height:\"100%\",cursor:\"pointer\",outline:\"none\"},onClick:handleClick,role:\"button\",\"aria-label\":canvasContent===available?.[0]?props.BuyNowATC?\"Buy now\":\"Add to cart\":canvasContent===SelectVariant?.[0]?\"Select variant\":canvasContent===OutOfStock?.[0]?\"Out of stock\":canvasContent===maxQuantity?.[0]?\"Max quantity reached\":\"Loading\"}):isLoading&&!props.skipLoading&&sanitizedLoadingState&&!isPreview?/*#__PURE__*/cloneElement(sanitizedLoadingState,{style:{...LoadingState[0].props?.style||{},width:\"100%\",height:\"100%\",outline:\"none\"},role:\"status\",\"aria-label\":`Loading ${props.BuyNowATC?\"buy now\":\"add to cart\"} button`,\"aria-live\":\"polite\",tabIndex:-1}):sanitizedContent?/*#__PURE__*/cloneElement(sanitizedContent,{style:{...content?.props?.style||{},width:\"100%\",height:\"100%\",cursor:canAddToCart?\"pointer\":\"not-allowed\",outline:\"none\"},onClick:canAddToCart?handleClick:undefined,onKeyDown:canAddToCart?e=>{if(e.key===\"Enter\"||e.key===\" \"){e.preventDefault();handleClick(e);}}:undefined,role:\"button\",\"aria-disabled\":!canAddToCart,\"aria-label\":content===available?.[0]?props.BuyNowATC?\"Buy now\":\"Add to cart\":content===SelectVariant?.[0]?\"Select variant\":content===OutOfStock?.[0]?\"Out of stock\":\"Max quantity reached\",tabIndex:hasInitialized?0:-1}):null]});}addPropertyControls(FC_ProductPurchaseButton,{shopifyProductID:{type:ControlType.String,title:\"Product ID\",description:\"Connect to CMS (required)\"},LoadingState:{type:ControlType.ComponentInstance,title:\"Loading\",hidden:props=>props.skipLoading,description:\"Display when product/variant is determining state to show.\"},available:{type:ControlType.ComponentInstance,title:\"Available\",description:\"Display when product/variant is available (Add to Cart or Buy Now).\"},SelectVariant:{type:ControlType.ComponentInstance,title:\"Select Variant\",description:\"Display when product/variant requires a variant selection.\"},OutOfStock:{type:ControlType.ComponentInstance,title:\"Out of Stock\",description:\"Display when product/variant is out of stock.\"},maxQuantity:{type:ControlType.ComponentInstance,title:\"Limit Reached\",description:\"Display when maximum cart quantity is reached.  \\n\\n –––– \\n\\n Connect each state to button component off-page. \\n\\n If you detatch the button component, you'll need to reconnect the states.\"},BuyNowATC:{title:\"Buy Now\",type:ControlType.Boolean,enabledTitle:\"Yes\",disabledTitle:\"No\",defaultValue:false},skipLoading:{title:\"Loading State\",type:ControlType.Boolean,enabledTitle:\"No\",disabledTitle:\"Yes\",defaultValue:false},openCart:{title:\"Trigger Cart\",description:\"If button is inside the cart, select No to keep the cart open.\",type:ControlType.Boolean,enabledTitle:\"Yes\",disabledTitle:\"No\",defaultValue:true,hidden:props=>props.BuyNowATC},focus:{type:ControlType.Object,title:\"Focus\",controls:{radius:{type:ControlType.Number,title:\"Radius\",defaultValue:0,min:0,max:100,step:1,displayStepper:true},width:{type:ControlType.Number,title:\"Width\",defaultValue:2,min:0,max:20,step:1,displayStepper:true},padding:{type:ControlType.Number,title:\"Padding\",defaultValue:2,min:0,max:20,step:1,displayStepper:true},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#007AFF\"}}},shopifyProductVariantId:{type:ControlType.String,title:\"Variant ID\",description:\"Advanced: Manually set a specific product variant ID (optional).\"}});// Utility to clean Shopify GID to just the numeric ID\nconst cleanShopifyId=gid=>gid?.split(\"/\").pop();\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FC_ProductPurchaseButton\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FC_ProductPurchaseButton.map","/*\n * Framer Commerce\n * Confidential and Proprietary - All Rights Reserved\n * Unauthorized use, reproduction, distribution, or disclosure of this\n * source code or any related information is strictly prohibited.\n *\n * This software is the exclusive property of Framer Commerce (\"Company\").\n * It is considered highly confidential and proprietary information.\n *\n * Any use, copying, modification, distribution, or sharing of this software,\n * in whole or in part, without the express written permission of the Company\n * is strictly prohibited and may result in legal action.\n *\n * DISCLAIMER: This software does not provide any express or\n * implied warranties, including, but not limited to, the implied warranties\n * of merchantability and fitness for a particular purpose. In no event shall\n * Framer Commerce be liable for any direct, indirect, incidental, special,\n * exemplary, or consequential damages (including, but not limited to, procurement\n * of substitute goods or services; loss of use, data, or profits; or business\n * interruption) however caused and on any theory of liability, whether in\n * contract, strict liability, or tort (including negligence or otherwise)\n * arising in any way out of the use of this software, even if advised of\n * the possibility of such damage.\n *\n * Any unauthorized possession, use, copying, distribution, or dissemination\n * of this software will be considered a breach of confidentiality and may\n * result in legal action.\n *\n * For inquiries, contact:\n * Framer Commerce\n * Email: hello@framercommerce.com\n *\n * © 2025 Butter Supply Inc. All Rights Reserved.\n */import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect,useState,useCallback}from\"react\";import{get}from\"lodash-es\";/**\n * @framerDisableUnlink\n */export default function FC_ProductVariantState(props){const{shopifyProductID,textTemplate}=props;const[product,setProduct]=useState();const[selectedOptions,setSelectedOptions]=useState({});// Move handler outside useEffect for better stability\nconst handleVariantSelection=useCallback(event=>{// Directly set the new selected options\nsetSelectedOptions(prev=>({...prev,[event.detail.optionName]:event.detail.value}));},[]);useEffect(()=>{if(window[\"shopXtools\"]&&Array.isArray(window[\"shopXtools\"].products)){const _matchingProduct=window[\"shopXtools\"].products.find(({node:_product})=>_product.id===`gid://shopify/Product/${shopifyProductID}`);setProduct(_matchingProduct?_matchingProduct.node:\"404\");}else{document.addEventListener(\"data__products-ready\",e=>{if(Array.isArray(e.detail.products)){const _matchingProduct=e.detail.products.find(({node:_product})=>_product.id===`gid://shopify/Product/${shopifyProductID}`);setProduct(_matchingProduct?_matchingProduct.node:\"404\");}});}document.addEventListener(\"variant_option_selected\",handleVariantSelection);return()=>{document.removeEventListener(\"variant_option_selected\",handleVariantSelection);};},[shopifyProductID,handleVariantSelection]);useEffect(()=>{const handleCurrencyChange=event=>{const{currency}=event.detail;if(window[\"shopXtools\"]&&Array.isArray(window[\"shopXtools\"].products)){const _matchingProduct=window[\"shopXtools\"].products.find(({node:_product})=>_product.id===`gid://shopify/Product/${shopifyProductID}`);if(_matchingProduct){setProduct(_matchingProduct.node);}}};window.addEventListener(\"currency_changed\",handleCurrencyChange);return()=>{window.removeEventListener(\"currency_changed\",handleCurrencyChange);};},[shopifyProductID]);const options=get(product,\"options\",[]);// Get remaining unselected options\nconst remainingOptions=options.filter(opt=>!selectedOptions[opt.name]).map(opt=>opt.name);// In Framer canvas or when shopXtools is not ready, show placeholder\nconst isFramerCanvas=typeof window===\"undefined\"||!window[\"shopXtools\"];const displayText=isFramerCanvas?textTemplate.replace(\"{{variant}}\",\"Size\"):remainingOptions.length===0?\"\":textTemplate.replace(\"{{variant}}\",remainingOptions.join(\", \"));// If no text to display, return empty div\nif(!displayText){return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\"}});}return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:/*#__PURE__*/_jsx(\"p\",{style:{...props.font,color:props.color,margin:0,textAlign:\"center\",textTransform:props.textTransform},children:displayText})});}FC_ProductVariantState.defaultProps={shopifyProductID:\"\",textTemplate:\"Select {{variant}}\",textTransform:\"none\",color:\"#000000\"};addPropertyControls(FC_ProductVariantState,{shopifyProductID:{type:ControlType.String,title:\"Product ID\"},textTemplate:{type:ControlType.String,title:\"Format\",description:\"Use {{variant}} to insert the variant name\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\"},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000000\"},textTransform:{type:ControlType.Enum,title:\"Transform\",options:[\"None\",\"Uppercase\",\"Lowercase\",\"Capitalize\"],defaultValue:\"none\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FC_ProductVariantState\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FC_ProductVariantState.map","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{useRef,useEffect}from\"react\";import{addPropertyControls,ControlType,useAnimation,motion}from\"framer\";import{defaultEvents,useOnEnter,useOnExit}from\"https://framer.com/m/framer/default-utils.js@^0.45.0\";var Indicators;(function(Indicators){Indicators[\"DotWave\"]=\"Dots\";Indicators[\"Material\"]=\"Material\";Indicators[\"IOS\"]=\"iOS\";})(Indicators||(Indicators={}));const angleInRadians=angleInDegrees=>(angleInDegrees-90)*(Math.PI/180);const polarToCartesian=(centerX,centerY,radius,angleInDegrees)=>{const a=angleInRadians(angleInDegrees);return{x:centerX+radius*Math.cos(a),y:centerY+radius*Math.sin(a)};};const arc=(x,y,radius,startAngle,endAngle)=>{const fullCircle=endAngle-startAngle===360;const start=polarToCartesian(x,y,radius,endAngle-0.01);const end=polarToCartesian(x,y,radius,startAngle);const arcFlag=endAngle-startAngle<=180?\"0\":\"1\";let d=[\"M\",start.x,start.y,\"A\",radius,radius,0,arcFlag,0,end.x,end.y,].join(\" \");if(fullCircle)d+=\"z\";return d;};function Spinner({color}){const length=360;const endPercentage=length/360*100;const strokeWidth=10;const width=100;const height=100;return(/*#__PURE__*/ _jsxs(motion.div,{style:{height:\"85%\",width:\"85%\",position:\"relative\",originX:0.5,originY:0.5},animate:{rotate:360},transition:{loop:Infinity,ease:\"linear\",duration:0.5},children:[/*#__PURE__*/ _jsx(motion.svg,{style:{height:\"100%\",width:\"100%\",top:0,left:0,right:0,bottom:0,position:\"absolute\",WebkitMask:`conic-gradient(rgba(0, 0, 0, 0.0) 0%, rgba(0, 0, 0,1.0) ${endPercentage}%)`},viewBox:\"0 0 100 100\",children:/*#__PURE__*/ _jsx(\"g\",{transform:\"translate(0 0)\",children:/*#__PURE__*/ _jsx(\"path\",{d:arc(width/2,height/2,width/2-strokeWidth/2,0,length),fill:\"none\",stroke:color,strokeWidth:strokeWidth,strokeLinecap:\"round\"})})}),/*#__PURE__*/ _jsx(motion.svg,{style:{height:\"100%\",width:\"100%\",position:\"absolute\"},viewBox:\"0 0 100 100\",children:/*#__PURE__*/ _jsx(\"g\",{transform:\"translate(50 0)\",children:/*#__PURE__*/ _jsx(\"path\",{d:\"M 0 0 C 2.761 0 5 2.239 5 5 C 5 7.761 2.761 10 0 10 C 0 10 0 0 0 0 Z\",fill:color})})})]}));}// <path d=\"M 0 0 C 2.761 0 5 2.239 5 5 C 5 7.761 2.761 10 0 10 C 0 10 0 0 0 0 Z\" fill=\"#CCC\"></path>\n// function Spinner({ color }) {\n//     return (\n//         <svg style={{ height: \"85%\", width: \"85%\" }} viewBox=\"0 0 100 100\">\n//             <motion.g\n//                 transform=\"translate(3 3)\"\n//                 animate={{ rotate: 360 }}\n//                 transition={{ loop: Infinity, ease: \"linear\", duration: 1 }}\n//             >\n//                 {pathStrings.map((data, i) => {\n//                     return <path d={data} fill={color} opacity={i / pathStrings.length} />\n//                 })}\n//             </motion.g>\n//         </svg>\n//     )\n// }\nfunction DotWave({color,animation}){const circles=[0,1,2];const{delay,ease,duration,...animProps}=animation;const transition=animation.type===\"spring\"?animProps:{...animProps,ease,duration};// console.log(animProps)\nreturn(/*#__PURE__*/ _jsx(motion.svg,{style:{height:\"85%\",width:\"85%\"},viewBox:\"0 0 30 30\",variants:{show:{transition:{delayChildren:0.1,staggerChildren:0.12}}},animate:\"show\",children:circles.map(circle=>/*#__PURE__*/ _jsx(motion.circle,{style:{fill:color},variants:{hidden:{y:0},show:{y:[0,0,0,-10,0,0,0]}},transition:{...transition,yoyo:Infinity},r:3,cx:circle*10+5,cy:15},circle))}));}function Material({color,animation}){return(/*#__PURE__*/ _jsx(motion.svg,{style:{height:\"85%\",width:\"85%\",overflow:\"visible\",originX:\"50%\",originY:\"50%\"},animate:{rotate:360},transition:{ease:\"linear\",loop:Infinity,duration:2},viewBox:\"25 25 50 50\",children:/*#__PURE__*/ _jsx(motion.circle,{style:{stroke:color,strokeLinecap:\"round\"},animate:{strokeDasharray:[\"1, 200\",\"89, 200\",\"89, 200\"],strokeDashoffset:[0,-35,-124]},transition:{...animation,loop:Infinity,ease:\"easeInOut\"},cx:\"50\",cy:\"50\",r:\"20\",fill:\"none\",strokeWidth:2,strokeMiterlimit:\"10\"})}));}function IOS({color,animation}){const particles=12;// this was the death of me\nconst arrayRotate=(arr,n)=>arr.slice(n,arr.length).concat(arr.slice(0,n));const lines=[...new Array(particles)].map((l,i)=>0.9/particles*i+0.1).reverse();const lineOpacities=lines.map((l,i)=>arrayRotate(lines,i));return(/*#__PURE__*/ _jsx(motion.svg,{viewBox:\"-15 -15 30 30\",style:{width:\"100%\",height:\"100%\"},children:lineOpacities.map((lineKeyframes,i)=>/*#__PURE__*/ _jsx(motion.g,{initial:{opacity:lineKeyframes[0]},animate:{opacity:lineKeyframes},transition:{...animation,loop:Infinity,repeatDelay:0.0005},children:/*#__PURE__*/ _jsx(\"rect\",{style:{width:7,height:2,fill:color,transform:`rotate(${(particles-i)/particles*360-90}deg)`},x:5,y:-1,rx:1})},i))}));}function getIndicator(indicator,props){switch(indicator){case Indicators.DotWave:return(/*#__PURE__*/ _jsx(DotWave,{...props}));case Indicators.Material:return(/*#__PURE__*/ _jsx(Material,{...props}));case Indicators.IOS:return(/*#__PURE__*/ _jsx(IOS,{...props}));// case Indicators.Spinner:\n//     return <Spinner {...props} />\ndefault:return(/*#__PURE__*/ _jsx(DotWave,{...props}));}}export function handleTimeout(duration,callback){const id=setTimeout(callback,duration*1e3);return()=>clearTimeout(id);}/**\n * Loading\n *\n * @framerIntrinsicWidth 40\n * @framerIntrinsicHeight 40\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */ export function Loading(props){const{duration,onTimeout,fadeOut,hasDuration,indicator,onClick,onMouseDown,onMouseUp,onMouseEnter,onMouseLeave,style}=props;const controls=useAnimation();const animDuration=fadeOut?Math.min(duration,0.35):0;const animDelay=fadeOut?duration-animDuration:duration;const currentIndicator=getIndicator(indicator,props);const handlers=useRef([]);const onFadeOut=React.useCallback(()=>{if(hasDuration)controls.start({opacity:0,transition:{duration:animDuration,ease:\"easeIn\"}});},[hasDuration,animDuration]);const resetOpacity=async()=>{controls.set({opacity:1});};useOnEnter(()=>{resetOpacity();if(hasDuration)handlers.current=[handleTimeout(duration,onTimeout),handleTimeout(animDelay,onFadeOut),];});// Cancel all timers on exit.\nuseOnExit(()=>handlers.current.forEach(cleanup=>cleanup));// Cancel all timers on unmount.\nuseEffect(()=>()=>handlers.current.forEach(cleanup=>cleanup),[]);return(/*#__PURE__*/ _jsx(motion.div,{onClick,onMouseDown,onMouseUp,onMouseEnter,onMouseLeave,animate:controls,style:{position:\"relative\",overflow:\"show\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",...style},children:currentIndicator}));}Loading.defaultProps={height:40,width:40,duration:2,color:\"#888\",animation:{type:\"tween\",ease:\"linear\",duration:1.3},hasDuration:false};// Learn more: https://framer.com/api/property-controls/\naddPropertyControls(Loading,{indicator:{title:\"Indicator\",type:ControlType.Enum,options:Object.keys(Indicators).map(i=>Indicators[i])},color:{type:ControlType.Color,defaultValue:\"#888\"},// transition: { title: \"Animation\", type: ControlType.Transition },\nhasDuration:{title:\"Duration\",type:ControlType.Boolean,defaultValue:Loading.defaultProps.hasDuration,enabledTitle:\"Timeout\",disabledTitle:\"Infinity\"},duration:{title:\"Time\",hidden:({hasDuration})=>!hasDuration,min:0.1,max:10,defaultValue:Loading.defaultProps.duration,type:ControlType.Number,step:0.1},animation:{type:ControlType.Transition},fadeOut:{title:\"Fade Out\",hidden:({hasDuration})=>!hasDuration,type:ControlType.Boolean,enabledTitle:\"Yes\",disabledTitle:\"No\"},onTimeout:{type:ControlType.EventHandler},...defaultEvents});\nexport const __FramerMetadata__ = {\"exports\":{\"handleTimeout\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"Loading\":{\"type\":\"reactComponent\",\"name\":\"Loading\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"40\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerIntrinsicHeight\":\"40\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Loading.map"],"mappings":"A,4iBAGA,SAAgBkD,EAA4B,EAAK,C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