{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/38BUhTOXdmoRine1OvjI/jWThqZwhq8E8ztab7m2j/Default.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";export const lineClamp1=Component=>{return props=>{return /*#__PURE__*/_jsx(Component,{...props,style:{textOverflow:\"ellipsis\",overflow:\"hidden\",display:\"-webkit-box\",WebkitBoxOrient:\"vertical\",WebkitLineClamp:\"1\"}});};};export const lineClamp3=Component=>{return props=>{return /*#__PURE__*/_jsx(Component,{...props,style:{textOverflow:\"ellipsis\",overflow:\"hidden\",display:\"-webkit-box\",WebkitBoxOrient:\"vertical\",WebkitLineClamp:\"3\"}});};};export function scrollToReviews(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,onClick:()=>{window.open(window.location.pathname+\"#featured-customer-reviews\",\"_self\");}});};}export function copyDiscountToClipboard(Component){return props=>{const discountCode=props.text;const[text,setText]=useState(props.text);return /*#__PURE__*/_jsx(Component,{...props,text:text,onClick:()=>{navigator.clipboard.writeText(discountCode);setText(\"Code copied\");setTimeout(()=>{setText(discountCode)// Change text to \"Success\" after 500ms\n;},500);}});// Cleanup the timeout if the component unmounts or the props change\nuseEffect(()=>{return()=>clearTimeout();},[]);};}export function copyDiscountToClipboardWithQueryParams(Component){return props=>{// Helper function to recursively search for the \"refer-url\" node\nconst findReferUrlChild=children=>{if(!children)return null;if(Array.isArray(children)){for(const child of children){const result=findReferUrlChild(child);if(result)return result;}}else if(children.props?.dataFramerName===\"refer-url\"){return children;}else if(children.props?.children){return findReferUrlChild(children.props.children);}return null;};// Find the \"refer-url\" child recursively\nconst referUrlChild=findReferUrlChild(props.children);console.log(referUrlChild);// Extract the discount code from \"refer-url\"\nconst discountCode=referUrlChild?.props?.children?.props?.children||\"DefaultDiscountCode\";const[text,setText]=useState(discountCode);return /*#__PURE__*/_jsx(Component,{...props,text:text,onClick:()=>{// Get the current window search parameters\nconst queryParams=window.location.search;// Combine the discount code and the query parameters\nconst textToCopy=`${discountCode} ${queryParams}`;// Show the combined text before copying\nsetText(textToCopy);// Copy the combined text to the clipboard\nnavigator.clipboard.writeText(textToCopy).then(()=>{setText(\"Code copied\");// Reset the text back to the discount code after 500ms\nsetTimeout(()=>{setText(discountCode);},500);}).catch(error=>{console.error(\"Failed to copy text: \",error);});}});// Cleanup any timeout if the component unmounts\nuseEffect(()=>{return()=>clearTimeout();},[]);};}export function addClassHeroPrimary(Component){return props=>{const newProps={...props,className:\"hero-primary\"};return /*#__PURE__*/_jsx(Component,{...newProps});};}export function addClassProductSelectorPrimary(Component){return props=>{const newProps={...props,className:\"product-selector-primary\"};return /*#__PURE__*/_jsx(Component,{...newProps});};}export function addClassProductSelectorSecondary(Component){return props=>{const newProps={...props,className:\"product-selector-secondary\"};return /*#__PURE__*/_jsx(Component,{...newProps});};}export function addClassNavButton(Component){return props=>{const newProps={...props,className:\"nav-button\"};return /*#__PURE__*/_jsx(Component,{...newProps});};}export function withQueryParams(Component){return props=>{const handleClick=e=>{e.preventDefault();e.stopPropagation();const newUrl=props.link.includes(\"?\")&&window.location.search.startsWith(\"?\")?`${props.link}&${encodeURI(encodeURI(window.location.search.slice(1)))}`:`${props.link}${encodeURI(encodeURI(window.location.search))}`;window.location.replace(newUrl);};if(props.link){return /*#__PURE__*/_jsx(\"div\",{onClick:handleClick,children:/*#__PURE__*/_jsx(Component,{...props})});}return /*#__PURE__*/_jsx(Component,{...props});};}export function withDiscountParam(Component){return props=>{const handleClick=e=>{e.preventDefault();e.stopPropagation();const params=new URLSearchParams(window.location.search);// Get the potentially contaminated discount code (e.g. \"DAVE10%3Futm_source=OrganicSocial...\")\nconst encodedDiscount=params.get(\"discount\");// Clean the discount code by:\n// 1. Decoding the URL encoding (converting %3F back to ? etc)\n// 2. Splitting on ? to remove any UTM params that Instagram added\nconst decodedDiscount=encodedDiscount?decodeURIComponent(encodedDiscount).split(\"?\")[0]:null;// Apply double encoding to match existing behavior\nconst newUrl=decodedDiscount?`${props.link}?discount=${encodeURI(encodeURI(decodedDiscount))}`:props.link;window.location.replace(newUrl);};if(props.link){return /*#__PURE__*/_jsx(\"div\",{onClick:handleClick,children:/*#__PURE__*/_jsx(Component,{...props})});}return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withQueryParams\":{\"type\":\"reactHoc\",\"name\":\"withQueryParams\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"addClassProductSelectorPrimary\":{\"type\":\"reactHoc\",\"name\":\"addClassProductSelectorPrimary\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"lineClamp3\":{\"type\":\"reactHoc\",\"name\":\"lineClamp3\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"scrollToReviews\":{\"type\":\"reactHoc\",\"name\":\"scrollToReviews\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"addClassNavButton\":{\"type\":\"reactHoc\",\"name\":\"addClassNavButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withDiscountParam\":{\"type\":\"reactHoc\",\"name\":\"withDiscountParam\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"addClassProductSelectorSecondary\":{\"type\":\"reactHoc\",\"name\":\"addClassProductSelectorSecondary\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"copyDiscountToClipboardWithQueryParams\":{\"type\":\"reactHoc\",\"name\":\"copyDiscountToClipboardWithQueryParams\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"copyDiscountToClipboard\":{\"type\":\"reactHoc\",\"name\":\"copyDiscountToClipboard\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"addClassHeroPrimary\":{\"type\":\"reactHoc\",\"name\":\"addClassHeroPrimary\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"lineClamp1\":{\"type\":\"reactHoc\",\"name\":\"lineClamp1\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Default.map"],
  "mapp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AE,OAAGT,EAAM,KAA0BE,EAAK,MAAM,CAAC,QAAQK,EAAY,SAAsBL,EAAKH,EAAU,CAAC,GAAGC,CAAK,CAAC,CAAC,CAAC,EAAuBE,EAAKH,EAAU,CAAC,GAAGC,CAAK,CAAC,CAAE,CAAE",
  "names": ["lineClamp1", "Component", "props", "p", "lineClamp3", "scrollToReviews", "window", "copyDiscountToClipboard", "discountCode", "text", "setText", "ye", "navigator", "addClassHeroPrimary", "Component", "props", "newProps", "p", "addClassProductSelectorPrimary", "addClassProductSelectorSecondary", "addClassNavButton", "withQueryParams", "handleClick", "e", "newUrl", "window", "withDiscountParam", "encodedDiscount", "decodedDiscount"]
}
