{"version":3,"file":"Examples.RmL7jtF6.mjs","names":["useState","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","window","_e","c","J","ce","init_framer_DymZktPS","Data","useObserveData","createStore","dataStore","state1","setDataStore","newState","storeState","storeSetters","setStoreState","setter","useStore","state","setState","init_createStore","init_store_js__1_0","centerContent","init_Utils","init_utils_js__0_9","withTenDigitPhoneValidation","validatePhone","value","target","handleSanitize","event","sanitized","onChange","props","onInput","onBlur","Component","ValidateThenGoToTenthpinThankYou","isVisible","style","element","onClickCapture","currentTarget","allInputs","textEmailTelInputs","type","field","checkboxInputs","trimmedValue","init_Examples","init_jsx_runtime"],"sources":["https:/framerusercontent.com/modules/vj7bFUjvEQFgEzNBkdoG/vf3CKm378wlVcBk7IhSU/createStore.js","https:/framer.com/m/framer/store.js@^1.0.0","https:/framerusercontent.com/modules/28rXvpPsrum7FH6cMELS/1jCAazZw1EGHjrG5Nu5D/Utils.js","https:/framer.com/m/framer/utils.js@^0.9.0","https:/framerusercontent.com/modules/H0TrQlE65HMKEJCBSN4n/d3MLvYLgF63rIkRhbvBe/Examples.js"],"sourcesContent":["import{useState,useEffect}from\"react\";import{Data,useObserveData}from\"framer\";export function createStore(state1){// Use Data so that a Preview reload resets the state\nconst dataStore=Data({state:Object.freeze({...state1})});// Create a set function that updates the state\nconst setDataStore=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(dataStore.state);}dataStore.state=Object.freeze({...dataStore.state,...newState});};// Store the initial state, copy the object if it's an object\nlet storeState=typeof state1===\"object\"?Object.freeze({...state1}):state1;// Keep a list of all the listeners, in the form of React hook setters\nconst storeSetters=new Set();// Create a set function that updates all the listeners / setters\nconst setStoreState=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(storeState);}storeState=typeof newState===\"object\"?Object.freeze({...storeState,...newState}):newState;// Update all the listeners / setters with the new value\nstoreSetters.forEach(setter=>setter(storeState));};// Create the actual hook based on everything above\nfunction useStore(){// Create the hook we are going to use as a listener\nconst[state,setState]=useState(storeState);// If we unmount the component using this hook, we need to remove the listener\n// @ts-ignore\nuseEffect(()=>{// But right now, we need to add the listener\nstoreSetters.add(setState);return()=>storeSetters.delete(setState);},[]);// If Data context exists, use Data, otherwise use vanilla React state\nif(useObserveData()===true){useObserveData();return[dataStore.state,setDataStore];}else{// Return the state and a function to update the central store\nreturn[state,setStoreState];}}return useStore;}\nexport const __FramerMetadata__ = {\"exports\":{\"createStore\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./createStore.map","/*\n * createStore (framer/store@1.0.1)\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/vj7bFUjvEQFgEzNBkdoG/vf3CKm378wlVcBk7IhSU/createStore.js\"\n","export const centerContent = {\n    display: \"flex\",\n    justifyContent: \"center\",\n    alignItems: \"center\"\n};\nexport const autoSizingText = {\n    width: \"max-content\",\n    wordBreak: \"break-word\",\n    overflowWrap: \"break-word\",\n    overflow: \"hidden\",\n    whiteSpace: \"pre-wrap\",\n    flexShrink: 0\n};\nexport const defaultContainerStyles = {\n    ...centerContent,\n    overflow: \"hidden\"\n};\nexport const containerStyles = defaultContainerStyles;\nexport const randomColor = ()=>\"#\" + Math.floor(Math.random() * 16777215).toString(16)\n;\n\nexport const __FramerMetadata__ = {\"exports\":{\"centerContent\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"containerStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"autoSizingText\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"defaultContainerStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"randomColor\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}}}}\n//# sourceMappingURL=./Utils.map","/*\n * Utils (framer/utils@0.9.0)\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/28rXvpPsrum7FH6cMELS/1jCAazZw1EGHjrG5Nu5D/Utils.js\"\n","import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{randomColor}from\"https://framer.com/m/framer/utils.js@^0.9.0\";// Learn more: https://www.framer.com/developers/overrides/\nconst useStore=createStore({background:\"#0099FF\"});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 withRandomColor(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{ref:ref,...props,animate:{background:store.background},onClick:()=>{setStore({background:randomColor()});}});});}export function withTenDigitPhoneValidation(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const validatePhone=target=>{const value=target.value||\"\";if(value.length===0){target.setCustomValidity(\"\");return;}if(/^\\d{10}$/.test(value)){target.setCustomValidity(\"\");}else{target.setCustomValidity(\"Please enter exactly 10 digits.\");}};const handleSanitize=event=>{const target=event?.target;if(!target)return;const sanitized=(target.value||\"\").replace(/\\D+/g,\"\").slice(0,10);if(target.value!==sanitized){target.value=sanitized;}validatePhone(target);};const onChange=event=>{handleSanitize(event);props.onChange?.(event);};const onInput=event=>{handleSanitize(event);props.onInput?.(event);};const onBlur=event=>{handleSanitize(event);const target=event?.target;if(target){validatePhone(target);}props.onBlur?.(event);};return /*#__PURE__*/_jsx(Component,{ref:ref,...props,type:\"tel\",inputMode:\"numeric\",pattern:\"\\\\\\\\d{10}\",maxLength:10,minLength:10,required:true,autoComplete:\"tel-national\",\"aria-label\":props[\"aria-label\"]??\"Phone number (10 digits required)\",title:props.title??\"Enter a 10-digit phone number\",onInput:onInput,onChange:onChange,onBlur:onBlur});});}export function ValidateThenGoToTenthpinThankYou(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const isVisible=element=>{if(typeof window===\"undefined\")return true;const style=window.getComputedStyle(element);if(style.display===\"none\"||style.visibility===\"hidden\")return false;return element.getClientRects().length>0;};const onClickCapture=event=>{props.onClickCapture?.(event);if(event.defaultPrevented)return;const target=event?.target;const currentTarget=event?.currentTarget;if(!target||!currentTarget)return;const clickable=target.closest('a,button,[role=\"button\"],input[type=\"submit\"],input[type=\"button\"]');if(!clickable)return;event.preventDefault?.();event.stopPropagation?.();const allInputs=Array.from(currentTarget.querySelectorAll(\"input\"));const textEmailTelInputs=allInputs.filter(field=>{const type=(field.type||\"text\").toLowerCase();return(type===\"text\"||type===\"email\"||type===\"tel\")&&isVisible(field);});const checkboxInputs=allInputs.filter(field=>{const type=(field.type||\"\").toLowerCase();return type===\"checkbox\"&&isVisible(field);});for(const field of textEmailTelInputs){const trimmedValue=(field.value||\"\").trim();field.value=trimmedValue;if(!trimmedValue){field.setCustomValidity(\"Please fill out this field.\");field.focus();field.reportValidity();return;}field.setCustomValidity(\"\");if(!field.checkValidity()){field.focus();field.reportValidity();return;}}for(const field of checkboxInputs){if(!field.checked){field.setCustomValidity(\"Please check this box to continue.\");field.focus();field.reportValidity();return;}field.setCustomValidity(\"\");if(!field.checkValidity()){field.focus();field.reportValidity();return;}}if(typeof window!==\"undefined\"){window.location.href=\"/tenthpin-thank-you\";}};return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onClickCapture:onClickCapture});});}\nexport const __FramerMetadata__ = {\"exports\":{\"ValidateThenGoToTenthpinThankYou\":{\"type\":\"reactHoc\",\"name\":\"ValidateThenGoToTenthpinThankYou\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTenDigitPhoneValidation\":{\"type\":\"reactHoc\",\"name\":\"withTenDigitPhoneValidation\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Examples.map"],"mappings":"A,kMAA8E,SAAgBY,EAAY,EAAO,CACjH,IAAMC,EAAUH,EAAK,CAAC,MAAM,OAAO,OAAO,CAAC,GAAGI,CAAM,CAAC,CAAC,CAAC,EACjDC,EAAa,GAAU,CAC1B,OAAOC,GAAW,aAAY,EAASA,EAASH,EAAU,KAAK,GAAG,EAAU,MAAM,OAAO,OAAO,CAAC,GAAGA,EAAU,MAAM,GAAGG,CAAQ,CAAC,CAAE,EACjIC,EAAW,OAAOH,GAAS,SAAS,OAAO,OAAO,CAAC,GAAGA,CAAM,CAAC,EAAEA,EAC7DI,kBAAa,IAAI,IACjBC,EAAc,GAAU,CAC3B,OAAOH,GAAW,aAAY,EAASA,EAASC,CAAU,GAAG,EAAW,OAAOD,GAAW,SAAS,OAAO,OAAO,CAAC,GAAGC,EAAW,GAAGD,CAAQ,CAAC,EAAEA,EACjJE,EAAa,QAAQ,GAAQE,EAAOH,CAAU,CAAC,CAAE,EACjD,SAASI,GAAU,CACnB,GAAK,CAACC,EAAMC,GAAUvB,EAASiB,CAAU,EAKzC,OAHAT,OACAU,EAAa,IAAIK,CAAQ,MAAYL,EAAa,OAAOK,CAAQ,GAAI,CAAC,CAAC,EACpEZ,EAAe,IAAI,IAAMA,EAAe,EAAQ,CAACE,EAAU,MAAME,CAAY,GAC1E,CAACO,EAAMH,CAAa,CAAG,CAAC,OAAOE,CAAS,C,wHEfjC,EAAgB,CACzB,QAAS,OACT,eAAgB,SAChB,WAAY,QAChB,EAWI,CADA,GAAGK,CACO,C,+C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