{"version":3,"file":"Examples_1.C_Yu1_Tf.mjs","names":["useStore","useState"],"sources":["https:/framerusercontent.com/modules/vj7bFUjvEQFgEzNBkdoG/vf3CKm378wlVcBk7IhSU/createStore.js","https:/framer.com/m/framer/store.js@^1.0.0","https:/framerusercontent.com/modules/FhmuhkINtgEkGQLqhXOB/HpIsv3l8iZyaPo9f5xZu/Examples_1.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}from\"react/jsx-runtime\";import{forwardRef}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.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 checkOutStarter(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onClick:async e=>{await startCheckout(\"999\");}});});}export function checkOutCreator(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onClick:async e=>{await startCheckout(\"1499\");}});});}export function checkOutMax(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onClick:async e=>{await startCheckout(\"1999\");}});});}const BACKEND_URL=\"https://plugmytag-backend.onrender.com\";const STRIPE_PUBLISHABLE_KEY=\"pk_live_51RZux1GDlgwCTdf2W8qfPIxZ6hSsfKFqqtY8Rod0RbOmz2kQEwu9ymA8UmACo1IsxhbXXFNSAf4ZJJM7Z3u3PoAq004LUNY16k\"// <- your pk_ key\n;function getFPTid(){// Try FPROM object, then cookie\nconst tid=window.FPROM&&window.FPROM.data&&window.FPROM.data.tid||(document.cookie.match(/(?:^|;\\s*)_fprom_tid=([^;]+)/)||[])[1];return tid?decodeURIComponent(tid):null;}async function startCheckout(tier){const fp_tid=await getFPTid();const res=await fetch(`${BACKEND_URL}/create-checkout-session`,{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({priceTier:tier,fp_tid})});const{id}=await res.json();if(!window.Stripe){alert(\"Stripe.js not loaded\");return;}const stripe=window.Stripe(STRIPE_PUBLISHABLE_KEY);return stripe.redirectToCheckout({sessionId:id});}// ---- HOC overrides (these will appear where withRotate does) ----\nexport function withBuyStarter(Component){return /*#__PURE__*/forwardRef((props,ref)=>/*#__PURE__*/_jsx(Component,{ref:ref,...props,onClick:e=>{e.preventDefault();e.stopPropagation();startCheckout(\"999\");}}));}export function withBuyCreator(Component){return /*#__PURE__*/forwardRef((props,ref)=>/*#__PURE__*/_jsx(Component,{ref:ref,...props,onClick:e=>{e.preventDefault();e.stopPropagation();startCheckout(\"1499\");}}));}export function withBuyMax(Component){return /*#__PURE__*/forwardRef((props,ref)=>/*#__PURE__*/_jsx(Component,{ref:ref,...props,onClick:e=>{e.preventDefault();e.stopPropagation();startCheckout(\"1999\");}}));}\nexport const __FramerMetadata__ = {\"exports\":{\"checkOutCreator\":{\"type\":\"reactHoc\",\"name\":\"checkOutCreator\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withBuyStarter\":{\"type\":\"reactComponent\",\"name\":\"withBuyStarter\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"checkOutStarter\":{\"type\":\"reactHoc\",\"name\":\"checkOutStarter\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withBuyCreator\":{\"type\":\"reactComponent\",\"name\":\"withBuyCreator\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"withBuyMax\":{\"type\":\"reactComponent\",\"name\":\"withBuyMax\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"checkOutMax\":{\"type\":\"reactHoc\",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