{"version":3,"file":"WithPhoneSmallViewportHeight.Bx7rDMW6.mjs","names":["useState","useCallback","useMemo","__esmMin","ne","init_npm_react_18_3_1","te","pe","window","ce","c","J","init_jsx_runtime","_e","init_ssg_sandbox_shims","withPhoneSmallViewportHeight","isPhoneWidth","setIsPhoneWidth","updateViewportMatch","matches","mediaQuery","handleChange","mergedStyle","props","Component","init_WithPhoneSmallViewportHeight"],"sources":["https:/framerusercontent.com/modules/80sqwPaM6hxTzJnYtk3B/DEcNUO19gp75u3QHWJaM/WithPhoneSmallViewportHeight.js"],"sourcesContent":["// Create a Framer code override export named withPhoneSmallViewportHeight for an existing canvas element.\n// Preserve all canvas styling and structure, and only at phone widths (max-width 809.98px)\n// force the rendered element’s height to 100svh. Above that width, leave the canvas-defined height untouched.\n// Keep the implementation minimal and compatible with Framer. This is an override, not a code component.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,startTransition,useCallback,useEffect,useMemo,useState}from\"react\";export function withPhoneSmallViewportHeight(Component){return /*#__PURE__*/forwardRef(function WithPhoneSmallViewportHeight(props,ref){const[isPhoneWidth,setIsPhoneWidth]=useState(()=>{if(typeof window!==\"undefined\"){return window.matchMedia(\"(max-width: 809.98px)\").matches;}return false;});const updateViewportMatch=useCallback(()=>{if(typeof window!==\"undefined\"){const matches=window.matchMedia(\"(max-width: 809.98px)\").matches;startTransition(()=>setIsPhoneWidth(matches));}else{startTransition(()=>setIsPhoneWidth(false));}},[]);useEffect(()=>{if(typeof window===\"undefined\")return;const mediaQuery=window.matchMedia(\"(max-width: 809.98px)\");const handleChange=()=>updateViewportMatch();handleChange();if(typeof mediaQuery.addEventListener===\"function\"){mediaQuery.addEventListener(\"change\",handleChange);return()=>mediaQuery.removeEventListener(\"change\",handleChange);}mediaQuery.addListener(handleChange);return()=>mediaQuery.removeListener(handleChange);},[updateViewportMatch]);const mergedStyle=useMemo(()=>({...props.style,...isPhoneWidth?{height:\"100svh\"}:{}}),[props.style,isPhoneWidth]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props,style:mergedStyle});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withPhoneSmallViewportHeight\":{\"type\":\"reactHoc\",\"name\":\"withPhoneSmallViewportHeight\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WithPhoneSmallViewportHeight.map"],"mappings":"A,mKAIgI,SAAgBe,EAA6B,EAAU,CAAC,MAAoB,gBAAW,SAAsC,EAAM,EAAI,CAAC,GAAK,CAACC,EAAaC,GAAiBjB,MAAwBQ,IAAS,QAAoBA,EAAO,WAAW,uBAAuB,CAAC,CAAC,OAAuB,EAAQU,EAAoBjB,MAAgB,CAAC,GAAUO,IAAS,OAAY,CAAC,IAAMW,EAAQX,EAAO,WAAW,uBAAuB,CAAC,CAAC,QAAQF,MAAoBW,EAAgBE,CAAO,CAAC,CAAE,MAAMb,MAAoBW,EAAgB,EAAK,CAAC,CAAG,EAAE,CAAC,CAAC,EAAER,MAAc,CAAC,GAAUD,IAAS,OAAY,OAAO,IAAMY,EAAWZ,EAAO,WAAW,uBAAuB,EAAQa,MAAiBH,EAAoB,EAA8N,OAA5NG,EAAa,EAAK,OAAOD,EAAW,kBAAmB,YAAYA,EAAW,iBAAiB,SAASC,CAAY,MAAYD,EAAW,oBAAoB,SAASC,CAAY,IAAGD,EAAW,YAAYC,CAAY,MAAYD,EAAW,eAAeC,CAAY,EAAE,EAAE,CAACH,CAAmB,CAAC,EAAE,IAAMI,EAAYpB,OAAa,CAAC,GAAGqB,EAAM,MAAM,GAAGP,EAAa,CAAC,OAAO,QAAQ,EAAE,CAAC,CAAC,GAAG,CAACO,EAAM,MAAMP,CAAY,CAAC,EAAE,MAAoB,gBAAKQ,EAAU,CAAK,MAAI,GAAGD,EAAM,MAAMD,CAAW,CAAC,CAAE,CAAC,CAAE,C"}