{"version":3,"file":"WithPhoneSmallViewportHeight.CpW9Knjo.mjs","names":["useState","useCallback","useMemo"],"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":"mKAIgI,SAAgB,EAA6B,EAAU,CAAC,OAAoB,EAAW,SAAsC,EAAM,EAAI,CAAC,GAAK,CAAC,EAAa,GAAiBA,MAAwB,IAAS,QAAoB,EAAO,WAAW,uBAAuB,CAAC,CAAC,OAAuB,EAAQ,EAAoBC,MAAgB,CAAC,GAAU,IAAS,OAAY,CAAC,IAAM,EAAQ,EAAO,WAAW,uBAAuB,CAAC,CAAC,QAAQ,MAAoB,EAAgB,CAAO,CAAC,CAAE,MAAM,MAAoB,EAAgB,EAAK,CAAC,CAAG,EAAE,CAAC,CAAC,EAAE,MAAc,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,EAAW,EAAO,WAAW,uBAAuB,EAAQ,MAAiB,EAAoB,EAA8N,OAA5N,EAAa,EAAK,OAAO,EAAW,kBAAmB,YAAY,EAAW,iBAAiB,SAAS,CAAY,MAAY,EAAW,oBAAoB,SAAS,CAAY,IAAG,EAAW,YAAY,CAAY,MAAY,EAAW,eAAe,CAAY,EAAE,EAAE,CAAC,CAAmB,CAAC,EAAE,IAAM,EAAYC,OAAa,CAAC,GAAG,EAAM,MAAM,GAAG,EAAa,CAAC,OAAO,QAAQ,EAAE,CAAC,CAAC,GAAG,CAAC,EAAM,MAAM,CAAY,CAAC,EAAE,OAAoB,EAAK,EAAU,CAAK,MAAI,GAAG,EAAM,MAAM,CAAW,CAAC,CAAE,CAAC,CAAE,qBAAjvC,IAAqF"}