{"version":3,"file":"Examples.6C3pjxpN.mjs","names":["useState","useState","useRef"],"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/RWhkOhJaJSBueoQ4fpeb/UrW66pnIjkxWjMD49E2O/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{useEffect,useState,useRef,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 withTextLeadingTrim(Component){return props=>{useEffect(()=>{if(document.getElementById(\"leading-trim-style\"))return;const style=document.createElement(\"style\");style.id=\"leading-trim-style\";style.textContent=`\n                .leading-trim, .leading-trim * {\n                    text-box: trim-both cap alphabetic;\n                }\n            `;document.head.appendChild(style);},[]);return /*#__PURE__*/_jsx(Component,{...props,className:`${props.className??\"\"} leading-trim`});};}const SCROLL_THRESHOLD=100;const DESKTOP_MIN_WIDTH=1200;export function withHeaderScrollReveal(Component){return props=>{const[visible,setVisible]=useState(false);const[enableTransition,setEnableTransition]=useState(false);const lastPathRef=useRef(typeof window!==\"undefined\"?window.location.pathname:\"\");const isNavigatingRef=useRef(false);useEffect(()=>{const handleScroll=()=>{// While navigating, ignore scroll events — keep nav hidden\nif(isNavigatingRef.current)return;setVisible(window.scrollY>SCROLL_THRESHOLD);};const handleRouteChange=()=>{if(window.location.pathname!==lastPathRef.current){lastPathRef.current=window.location.pathname;isNavigatingRef.current=true;setEnableTransition(false);setVisible(false);// Wait long enough for Framer's scroll reset + any lingering scroll events\nsetTimeout(()=>{isNavigatingRef.current=false;setEnableTransition(true);// Now sync to actual scroll position\nsetVisible(window.scrollY>SCROLL_THRESHOLD);},400);}};window.addEventListener(\"scroll\",handleScroll,{passive:true});const origPush=history.pushState;const origReplace=history.replaceState;history.pushState=function(...args){origPush.apply(this,args);handleRouteChange();};history.replaceState=function(...args){origReplace.apply(this,args);handleRouteChange();};window.addEventListener(\"popstate\",handleRouteChange);handleScroll();requestAnimationFrame(()=>setEnableTransition(true));return()=>{window.removeEventListener(\"scroll\",handleScroll);window.removeEventListener(\"popstate\",handleRouteChange);history.pushState=origPush;history.replaceState=origReplace;};},[]);return /*#__PURE__*/_jsx(Component,{...props,style:{...props.style,transform:visible?\"translateY(0)\":\"translateY(calc(-100% - 44px))\",pointerEvents:visible?\"auto\":\"none\",transition:enableTransition?\"transform 0.35s ease\":\"none\"}});};}// CSS for hiding elements visually but keeping them for screen readers\n// Define the styles with CSSProperties for better type safety\nconst srOnlyStyle={position:\"absolute\",width:\"1px\",height:\"1px\",padding:\"0\",margin:\"-1px\",overflow:\"hidden\",clip:\"rect(0, 0, 0, 0)\",whiteSpace:\"nowrap\",border:\"0\"};export function withSrOnly(Component){// Adding ': any' to props tells TypeScript not to worry about strict property checks here\nreturn props=>{return /*#__PURE__*/_jsx(Component,{...props,style:{...props.style,...srOnlyStyle}});};}//\n//\n//\n//\n//\n//\n//\nexport function withCurrentTab(Component){return props=>{const ref=useRef(null);const[variant,setVariant]=useState(\"MenuTab\");useEffect(()=>{const check=()=>{if(!ref.current)return;const link=ref.current.querySelector(\"a\");if(!link)return;const isCurrent=link.getAttribute(\"data-framer-page-link-current\")===\"true\";console.log(\"[CurrentTab] href:\",link.getAttribute(\"href\"),\"isCurrent:\",isCurrent);setVariant(isCurrent?\"MenuTab \\xb7 Pressed\":\"MenuTab\");};check();const timeout=setTimeout(check,100);window.addEventListener(\"popstate\",check);return()=>{clearTimeout(timeout);window.removeEventListener(\"popstate\",check);};},[]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{display:\"contents\"},children:/*#__PURE__*/_jsx(Component,{...props,variant:variant})});};}//\n//\n//\n//\n//\n//\nconst SCROLL_KEY=\"menu-scroll-position\";export function withScrollMemory(Component){return props=>{useEffect(()=>{if(window.location.pathname.startsWith(\"/menu/\")){const saved=sessionStorage.getItem(SCROLL_KEY);if(saved){window.scrollTo(0,parseInt(saved,10));}}const saveScroll=()=>{if(window.location.pathname.startsWith(\"/menu/\")){sessionStorage.setItem(SCROLL_KEY,String(window.scrollY));}};const handleClick=e=>{const target=e.target.closest(\"a\");if(target)saveScroll();};document.addEventListener(\"click\",handleClick,true);window.addEventListener(\"beforeunload\",saveScroll);return()=>{document.removeEventListener(\"click\",handleClick,true);window.removeEventListener(\"beforeunload\",saveScroll);};},[]);return /*#__PURE__*/_jsx(Component,{...props});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTextLeadingTrim\":{\"type\":\"reactHoc\",\"name\":\"withTextLeadingTrim\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCurrentTab\":{\"type\":\"reactHoc\",\"name\":\"withCurrentTab\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHeaderScrollReveal\":{\"type\":\"reactHoc\",\"name\":\"withHeaderScrollReveal\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSrOnly\":{\"type\":\"reactHoc\",\"name\":\"withSrOnly\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withScrollMemory\":{\"type\":\"reactHoc\",\"name\":\"withScrollMemory\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Examples.map"],"mappings":"uMAA8E,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,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