{"version":3,"file":"utils.CZYryAFC.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/XG5eOGGUUXOZCb2nrU9D/Msv1atb18GI4Hn57lDgN/utils.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useEffect,useRef}from\"react\";import{useInView}from\"framer-motion\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{Children}from\"react\";// Learn more: https://www.framer.com/developers/overrides/\nconst useStore=createStore({background:\"#0099FF\"});export function useUrlLinkToSetIsActivePage(Component){return props=>{const p=props;if(window&&p.link&&p.isActivePage!=undefined&&p.link==window.location.pathname){p.isActivePage=true;}return /*#__PURE__*/_jsx(Component,{...props});};}export function withRotate(Component){return /*#__PURE__*/forwardRef((props,ref)=>{return /*#__PURE__*/_jsx(Component,{ref:ref,...props,animate:{rotate:90},transition:{duration:2}});});}export function withHover(Component){return /*#__PURE__*/forwardRef((props,ref)=>{return /*#__PURE__*/_jsx(Component,{ref:ref,...props,whileHover:{scale:1.05}});});}export function animateWhenInview(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const isInView=useInView(ref,{once:true});useEffect(()=>{console.log(\"Element is in view: \",isInView);},[isInView]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props});});}const applyStyleToProps=(props,style)=>{const firstChild=Children.toArray(props.children)[0].props;const applyStyle=e=>{e.props.style={...e.props.style,...style};};if(firstChild.children?.forEach){firstChild.children.forEach(applyStyle);}else if(firstChild.children?.props){applyStyle(firstChild.children);}};export function useCleave(){if(window){setTimeout(()=>(function(){function applyCleaveToPhoneInputs(){document.querySelectorAll('input[type=\"tel\"]').forEach(input=>{if(!input.dataset.cleaveAttached){new Cleave(input,{phone:true,phoneRegionCode:\"US\"});input.dataset.cleaveAttached=\"true\";}});}function loadScript(src){return new Promise((resolve,reject)=>{if(document.querySelector(`script[src=\"${src}\"]`)){resolve()// Already loaded\n    ;return;}const script=document.createElement(\"script\");script.src=src;script.onload=()=>resolve();script.onerror=()=>reject(new Error(`Failed to load ${src}`));document.head.appendChild(script);});}const cleaveSrc=\"https://cdnjs.cloudflare.com/ajax/libs/cleave.js/1.6.0/cleave.min.js\";const addonSrc=\"https://cdnjs.cloudflare.com/ajax/libs/cleave.js/1.6.0/addons/cleave-phone.us.js\";// Check if Cleave is already loaded\n    if(typeof Cleave!==\"undefined\"){applyCleaveToPhoneInputs();}else{loadScript(addonSrc).then(()=>loadScript(cleaveSrc)).then(()=>{setTimeout(applyCleaveToPhoneInputs,1e3);}).catch(err=>{console.error(\"Cleave.js failed to load:\",err);});}})(),1e3);}}export function withDetectScrolledToBottom(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const hasFiredRef=useRef(false);useEffect(()=>{if(typeof window===\"undefined\")return;const handleScroll=()=>{if(hasFiredRef.current)return;const el=document.scrollingElement||document.documentElement;const isAtBottom=el.scrollTop+el.clientHeight>=el.scrollHeight-1;if(isAtBottom){hasFiredRef.current=true;console.log(\"Reached bottom of document\");// Emit to parent if inside iframe\nif(window.parent&&window.parent!==window){window.parent.postMessage({type:\"SCROLLED_TO_BOTTOM\",payload:{url:window.location.href}},\"*\"//\n);}}};window.addEventListener(\"scroll\",handleScroll,{passive:true});// Run once in case already at bottom\nhandleScroll();return()=>{window.removeEventListener(\"scroll\",handleScroll);};},[]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withDetectScrolledToBottom\":{\"type\":\"reactHoc\",\"name\":\"withDetectScrolledToBottom\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useCleave\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"animateWhenInview\":{\"type\":\"reactHoc\",\"name\":\"animateWhenInview\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useUrlLinkToSetIsActivePage\":{\"type\":\"reactHoc\",\"name\":\"useUrlLinkToSetIsActivePage\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./utils.map"],"mappings":"gPACmD,SAAgB,EAA4B,EAAU,CAAC,MAAO,IAAO,CAAC,IAAM,EAAE,EAA2G,OAAlG,GAAQ,EAAE,MAAM,EAAE,cAAc,MAAW,EAAE,MAAM,EAAO,SAAS,WAAU,EAAE,aAAa,IAA0B,EAAK,EAAU,CAAC,GAAG,CAAK,CAAC,CAAE,CAAE,CAElC,SAAgB,EAA2B,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,IAAM,EAAYA,EAAO,EAAK,EAGxS,OAH0S,MAAc,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,MAAiB,CAAC,GAAG,EAAY,QAAQ,OAAO,IAAM,EAAG,SAAS,kBAAkB,SAAS,gBAAiC,EAAG,UAAU,EAAG,cAAc,EAAG,aAAa,IAAiB,EAAY,QAAQ,GAAK,QAAQ,IAAI,4BAA4B,EACprB,EAAO,QAAQ,EAAO,SAAS,GAAQ,EAAO,OAAO,YAAY,CAAC,KAAK,qBAAqB,QAAQ,CAAC,IAAI,EAAO,SAAS,IAAI,CAAC,EAAE,GACnI,EAAI,EACW,OADT,EAAO,iBAAiB,SAAS,EAAa,CAAC,QAAQ,EAAI,CAAC,EAClE,EAAa,MAAY,CAAC,EAAO,oBAAoB,SAAS,CAAY,CAAE,CAAE,EAAE,CAAC,CAAC,EAAsB,EAAK,EAAU,CAAK,MAAI,GAAG,CAAK,CAAC,CAAE,CAAC,CAAE,qBANpG,IAA+C,IAAqC,IAAqE,EACpL,EAAY,CAAC,WAAW,SAAS,CAAC"}