{"version":3,"file":"Examples.CQAen1Be.mjs","names":["useState","useState","useRef","useMemo","useCallback","_Fragment"],"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/LDuog2Fwuj1h0ttt0sC3/5alkksuEFLe6pMFdxWOH/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,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{forwardRef,startTransition,useCallback,useMemo,useRef,useState}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 withFormSparkContact(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[statusMessage,setStatusMessage]=useState(\"\");const[statusType,setStatusType]=useState(\"idle\");const isSubmittingRef=useRef(false);const liveRegionStyle=useMemo(()=>({position:\"absolute\",width:1,height:1,padding:0,margin:-1,overflow:\"hidden\",clip:\"rect(0, 0, 0, 0)\",whiteSpace:\"nowrap\",border:0}),[]);const getFormElementFromNode=useCallback(node=>{if(typeof window===\"undefined\"||!node)return null;if(node instanceof HTMLFormElement)return node;return node.closest(\"form\");},[]);const submitFormData=useCallback(async(formElement,submitter)=>{if(isSubmittingRef.current)return;isSubmittingRef.current=true;const canDisableSubmitter=!!submitter&&\"disabled\"in submitter;const previousDisabledState=canDisableSubmitter?submitter.disabled:undefined;if(!formElement){startTransition(()=>{setStatusType(\"error\");setStatusMessage(\"Unable to submit right now. Please try again.\");});isSubmittingRef.current=false;return;}try{if(canDisableSubmitter){submitter.disabled=true;}startTransition(()=>{setStatusType(\"sending\");setStatusMessage(\"Sending…\");});const formData=new FormData(formElement);const response=await fetch(\"https://submit-form.com/xMmJDw3GN\",{method:\"POST\",body:formData,headers:{Accept:\"application/json\"}});if(!response.ok){throw new Error(\"Submission failed\");}startTransition(()=>{setStatusType(\"success\");setStatusMessage(\"Thanks! Your message was sent.\");});}catch(error){startTransition(()=>{setStatusType(\"error\");setStatusMessage(\"Submission failed. Please try again.\");});}finally{if(canDisableSubmitter&&previousDisabledState!==undefined){submitter.disabled=previousDisabledState;}isSubmittingRef.current=false;}},[]);const handleSubmit=useCallback(async event=>{event.preventDefault();if(typeof props.onSubmit===\"function\"){props.onSubmit(event);}const target=event.target;const currentTarget=event.currentTarget;const targetElement=target instanceof Element?target:null;const currentElement=currentTarget instanceof Element?currentTarget:null;let formElement=getFormElementFromNode(targetElement);if(!formElement){formElement=getFormElementFromNode(currentElement);}if(!formElement&&currentElement){formElement=currentElement.querySelector(\"form\");}const nativeEvent=event.nativeEvent;const submitter=nativeEvent?.submitter;if(formElement){await submitFormData(formElement,submitter);}else{startTransition(()=>{setStatusType(\"error\");setStatusMessage(\"Unable to submit right now. Please try again.\");});}},[getFormElementFromNode,props,submitFormData]);const handleClickCapture=useCallback(async event=>{if(typeof window===\"undefined\")return;const target=event.target;const currentTarget=event.currentTarget;if(!(target instanceof Element))return;if(!(currentTarget instanceof Element))return;const submitControl=target.closest('button, input[type=\"submit\"], input[type=\"image\"]');if(!submitControl)return;if(submitControl instanceof HTMLButtonElement&&submitControl.type&&submitControl.type.toLowerCase()!==\"submit\"){return;}const formFromClosest=getFormElementFromNode(submitControl);const formFromAttribute=!formFromClosest&&submitControl instanceof HTMLElement&&submitControl.getAttribute(\"form\")?document.getElementById(submitControl.getAttribute(\"form\")||\"\") instanceof HTMLFormElement?document.getElementById(submitControl.getAttribute(\"form\")||\"\"):null:null;const formElement=formFromClosest??formFromAttribute;if(!formElement)return;if(!(currentTarget===formElement||currentTarget.contains(formElement)))return;event.preventDefault();await submitFormData(formElement,submitControl);},[getFormElementFromNode,submitFormData]);return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Component,{ref:ref,...props,onSubmit:handleSubmit,onClickCapture:handleClickCapture}),/*#__PURE__*/_jsx(\"span\",{\"aria-live\":\"polite\",role:\"status\",style:liveRegionStyle,children:statusMessage}),statusType===\"success\"||statusType===\"error\"?/*#__PURE__*/_jsx(\"p\",{\"aria-live\":\"polite\",role:statusType===\"error\"?\"alert\":\"status\",style:{margin:\"10px 0 0 0\",fontSize:12,lineHeight:1.4,color:statusType===\"error\"?\"#B00020\":\"#067647\"},children:statusMessage}):null]});});}export function withMobileJapanMapScale(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const existingTransform=props?.style&&typeof props.style.transform===\"string\"?props.style.transform:\"\";const combinedTransform=`${existingTransform}${existingTransform?\" \":\"\"}scale(0.27)`;return /*#__PURE__*/_jsx(Component,{ref:ref,...props,style:{...props.style,transformOrigin:\"top center\",transform:combinedTransform}});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withMobileJapanMapScale\":{\"type\":\"reactHoc\",\"name\":\"withMobileJapanMapScale\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withFormSparkContact\":{\"type\":\"reactHoc\",\"name\":\"withFormSparkContact\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Examples.map"],"mappings":"4OAA8E,SAAgB,EAAY,EAAO,CACjH,IAAM,EAAU,EAAK,CAAC,MAAM,OAAO,OAAO,CAAC,GAAG,CAAM,CAAC,CAAC,CAAC,EACjD,EAAa,GAAU,CAC1B,OAAO,GAAW,aAAY,EAAS,EAAS,EAAU,KAAK,GAAG,EAAU,MAAM,OAAO,OAAO,CAAC,GAAG,EAAU,MAAM,GAAG,CAAQ,CAAC,CAAE,EACjI,EAAW,OAAO,GAAS,SAAS,OAAO,OAAO,CAAC,GAAG,CAAM,CAAC,EAAE,EAC7D,EAAa,IAAI,IACjB,EAAc,GAAU,CAC3B,OAAO,GAA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