{"version":3,"file":"Session_modal_Override.CTD81041.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/xJXZDgMtfT1oB93VwT32/DGd893dzhOCMlGIfVqQ4/Session_modal_Override.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";// Create a store to manage modal state\nconst useStore=createStore({modal:false});// Main modal function\nexport function sessionModal(OriginalComponent){return function Override(props){// const [store, setStore] = useStore()\n// const showModal = \"false\"\nconst[showModal,setShowModal]=useState(false);const[store,setStore]=useStore();useEffect(()=>{const hasSeenModal=sessionStorage.getItem(\"modalShown\");const isModalVisible=sessionStorage.getItem(\"modalIsVisible\");if(!hasSeenModal&&!isModalVisible){const timer=setTimeout(()=>{sessionStorage.setItem(\"modalShown\",\"true\");sessionStorage.setItem(\"modalIsVisible\",\"true\");setStore({modal:true});},3e4)// 30 second\n;return()=>clearTimeout(timer)// Cleanup function\n;}},[setStore]);console.log(store);return store.modal?/*#__PURE__*/_jsx(OriginalComponent,{...props}):null;// return <OriginalComponent {...props} />\n};}// Separate Close Button using the Store\nexport function CloseButton(Component){// Get store state and setter function\nreturn function Override(props){const[store,setStore]=useStore();useEffect(()=>{const hasSeenModal=sessionStorage.getItem(\"modalShown\");const isModalVisible=sessionStorage.getItem(\"modalIsVisible\");if(!hasSeenModal&&!isModalVisible){setStore({modal:true});}},[setStore]);return store.modal?/*#__PURE__*/_jsx(Component,{...props,onClick:()=>{sessionStorage.setItem(\"modalIsVisible\",\"false\");setStore({modal:false})// Set the store to hide modal\n;}}):null;};}// Add property controls (optional)\naddPropertyControls(sessionModal,{resetSession:{type:ControlType.Boolean,defaultValue:false,title:\"Reset Session\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"CloseButton\":{\"type\":\"reactHoc\",\"name\":\"CloseButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"sessionModal\":{\"type\":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