{"version":3,"file":"IframeButton.C7PEvuCf.mjs","names":["useStore","useState","useRef","_Fragment","useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/vj7bFUjvEQFgEzNBkdoG/vf3CKm378wlVcBk7IhSU/createStore.js","https:/framer.com/m/framer/store.js@^1.0.0","https:/framerusercontent.com/modules/zHJIgcgYq6VqniKMdFxG/ia9DbBSL5ENoHMdtHe94/Iframe.js","https:/framerusercontent.com/modules/srwHeK5VoDINZItO75MB/zr0Mh1hOTQ6b9sgwJ7Hc/IframeButton.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","import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{ControlType,addPropertyControls}from\"framer\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{useEffect,useRef}from\"react\";import{createPortal}from\"react-dom\";export const useStore=createStore({isRendered:false,isVisible:false,isLoaded:false});/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/#code-components-auto-sizing\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function Iframe(props){const iframeRef=useRef(null);const[store,setStore]=useStore();const lockBody=()=>document?.body.classList.add(\"no-scroll\");const unlockBody=()=>document?.body.classList.remove(\"no-scroll\");const close=shouldReload=>{setStore({isVisible:false});unlockBody();if(iframeRef.current&&shouldReload){iframeRef.current.src=iframeRef.current?.src;}};useEffect(()=>{window.addEventListener(\"message\",e=>{if(e.data&&typeof e.data===\"string\"){try{const response=JSON.parse(e.data);if(response?.success&&response?.origin===\"uxify\"&&response?.form===\"request-access\"&&response?.height){iframeRef.current.style.height=response.height;}if(response?.success&&response?.origin===\"uxify\"&&response?.destination){window.location.href=response.destination;close(true);}if(response?.success&&response?.origin===\"uxify\"&&response?.action===\"close\"){close(response?.reload);}if(response?.success&&response?.origin===\"uxify\"&&response?.event===\"ea_form_submitted\"){window?.dataLayer?.push({event:response?.event,\"gtm.elementId\":response?.[\"gtm.elementId\"]});}}catch(error){console.error(error);}}});},[]);return store.isRendered?/*#__PURE__*/createPortal(/*#__PURE__*/_jsxs(\"div\",{id:\"form-background\",onClick:()=>{if(props.dismissible){setStore({isVisible:false});unlockBody();}},style:{opacity:store.isVisible?1:0,visibility:store.isVisible?\"visible\":\"hidden\",pointerEvents:store.isVisible?\"auto\":\"none\",zIndex:9999,position:\"fixed\",top:0,left:0,right:0,bottom:0,width:\"100vw\",height:\"100vh\",backgroundColor:\"rgba(0,0,0,0.5)\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:[!store.isLoaded&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:`@keyframes spinner {\n                                    to {transform: rotate(360deg);}\n                                }`}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:\"50%\",left:\"50%\",transform:\"translate(-50%, -50%)\"},children:/*#__PURE__*/_jsx(\"div\",{style:{width:\"20px\",height:\"20px\",borderRadius:\"50%\",border:\"2px solid #ACD4FF\",borderTopColor:\"#007AFF\",animation:\"spinner .8s linear infinite\"}})})]}),/*#__PURE__*/_jsx(\"iframe\",{id:\"request-access-form-iframe\",ref:iframeRef,src:\"https://iframe.uxify.com/request-access\",style:{width:\"602px\",height:\"991px\",maxHeight:\"100dvh\",border:\"1px solid #007AFF\",borderRadius:\"24px\",background:\"#fff\",paddingBottom:\"env(safe-area-inset-bottom)\"},onLoad:()=>setStore({isLoaded:true}),loading:\"lazy\",fetchpriority:\"auto\",referrerPolicy:\"no-referrer-when-downgrade\",sandbox:\"allow-same-origin allow-scripts allow-downloads allow-forms allow-modals allow-orientation-lock allow-pointer-lock allow-popups allow-popups-to-escape-sandbox allow-presentation allow-storage-access-by-user-activation allow-top-navigation-by-user-activation\"})]}),document?.body):null;}addPropertyControls(Iframe,{dismissible:{title:\"Dismissible\",type:ControlType.Boolean,defaultValue:false}});\nexport const __FramerMetadata__ = {\"exports\":{\"useStore\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"Iframe\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Iframe.map","import{jsx as _jsx,Fragment as _Fragment}from\"react/jsx-runtime\";import{ControlType,addPropertyControls}from\"framer\";import{useState}from\"react\";import{useStore}from\"https://framerusercontent.com/modules/zHJIgcgYq6VqniKMdFxG/ia9DbBSL5ENoHMdtHe94/Iframe.js\";/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/#code-components-auto-sizing\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function IframeButton(props){const[store,setStore]=useStore();const[hovered,setHovered]=useState(false);const lockBody=()=>document?.body.classList.add(\"no-scroll\");const open=()=>{setStore({isRendered:true,isVisible:true});lockBody();window?.dataLayer?.push({event:\"ea_form_opened\",\"gtm.elementId\":\"request-access-form\"});};return /*#__PURE__*/_jsx(_Fragment,{children:/*#__PURE__*/_jsx(\"button\",{onClick:open,onMouseEnter:()=>setHovered(true),onMouseLeave:()=>setHovered(false),style:{height:\"100%\",width:\"100%\",cursor:\"pointer\",backgroundColor:hovered?\"#0068D9\":\"#172AC9\",padding:`${props.padding}`,borderRadius:`${props.borderRadius}`,boxShadow:\"none\",border:\"none\",transition:\"background-color 225ms ease\",color:\"#fff\",fontWeight:500,fontFamily:\"system-ui\",letterSpacing:`${props.fontSize*-.01}px`,fontSize:`${props.fontSize}px`,whiteSpace:\"nowrap\"},children:props.buttonText})});}addPropertyControls(IframeButton,{fontSize:{title:\"FontSize\",type:ControlType.Number,defaultValue:18},buttonText:{title:\"Text\",type:ControlType.String,defaultValue:\"Request early access\"},padding:{title:\"Padding\",type:ControlType.String,defaultValue:\"8px 24px\"},borderRadius:{title:\"BorderRadius\",type:ControlType.String,defaultValue:\"4px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"IframeButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata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