{"version":3,"file":"AvoidLayoutJumping_Prod.DY-NxSd5.mjs","names":["useRef","useEffect","_jsx","__esmMin","init_npm_react_18_3_1","ce","init_jsx_runtime","c","de","init_framer_ChujFWHC","addPropertyControls","ControlType","useIsStaticRenderer","useReducedMotion","init_framer_motion_1EwlFBEG","AvoidLayoutJumping","direction","style","className","isStatic","reducedMotion","rootRef","rafId","root","target","container","vertical","horizontal","disposed","inView","pageVisible","decided","skipOutOfFlow","lastWidth","lastHeight","cancelFrame","clearSizes","rememberFlow","position","commit","width","height","next","px","active","applyNow","rect","resizeObserver","intersectionObserver","entries","entry","onVisibility","following","stableFrames","readFrame","nextWidth","nextHeight","armFollow","onPointer","event","node","value","init_AvoidLayoutJumping_Prod"],"sources":["https:/framerusercontent.com/modules/h8ioHyt4BUxuvVCE1Q10/lSxCCQSg9Z004fOqQjUU/AvoidLayoutJumping_Prod.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useReducedMotion}from\"framer-motion\";import{useEffect,useRef}from\"react\";/**\n * Placement contract: this instance is an absolute, hidden utility inside the\n * frame whose height or width animates. Measure that frame (the grandparent)\n * and copy its border box onto the grandparent's parent so in-flow siblings\n * ease instead of jumping. Never write position, inset, or transform.\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n * @framerDisableUnlink\n */export default function AvoidLayoutJumping({direction=\"vertical\",style,className}){const isStatic=useIsStaticRenderer();const reducedMotion=useReducedMotion()??false;const rootRef=useRef(null);const rafId=useRef(null);useEffect(()=>{if(isStatic)return;const root=rootRef.current;const target=root?.parentElement?.parentElement;const container=target?.parentElement;if(!root||!target||!container)return;const vertical=direction===\"vertical\"||direction===\"both\";const horizontal=direction===\"horizontal\"||direction===\"both\";let disposed=false;let inView=true;let pageVisible=document.visibilityState===\"visible\";let decided=false;let skipOutOfFlow=false;let lastWidth=\"\";let lastHeight=\"\";const cancelFrame=()=>{if(rafId.current!=null)cancelAnimationFrame(rafId.current);rafId.current=null;};const clearSizes=()=>{if(horizontal)container.style.width=\"\";if(vertical)container.style.height=\"\";};const rememberFlow=()=>{if(decided)return;const position=getComputedStyle(container).position;// Absolute and fixed containers do not push siblings. Writing a\n// pixel size onto them fights their insets.\nskipOutOfFlow=position===\"absolute\"||position===\"fixed\";decided=true;};const commit=(width,height)=>{if(skipOutOfFlow||!target.isConnected)return;if(width===0&&height===0&&target.offsetParent===null){return;}if(horizontal){const next=px(width);if(next!==lastWidth){container.style.width=next;lastWidth=next;}}if(vertical){const next=px(height);if(next!==lastHeight){container.style.height=next;lastHeight=next;}}};const active=()=>!disposed&&inView&&pageVisible;// Reduced motion still copies the snapped size so surrounding layout\n// does not stay stuck. It does not schedule frames.\nif(reducedMotion){const applyNow=()=>{if(!active())return;rememberFlow();const rect=target.getBoundingClientRect();commit(rect.width,rect.height);};const resizeObserver=new ResizeObserver(()=>applyNow());const intersectionObserver=new IntersectionObserver(entries=>{inView=entries.some(entry=>entry.isIntersecting);if(active())applyNow();});const onVisibility=()=>{pageVisible=document.visibilityState===\"visible\";if(active())applyNow();};resizeObserver.observe(target);intersectionObserver.observe(target);document.addEventListener(\"visibilitychange\",onVisibility);applyNow();return()=>{disposed=true;resizeObserver.disconnect();intersectionObserver.disconnect();document.removeEventListener(\"visibilitychange\",onVisibility);clearSizes();};}let following=false;let stableFrames=0;const readFrame=()=>{rafId.current=null;if(!active()){following=false;return;}rememberFlow();if(skipOutOfFlow){following=false;return;}const rect=target.getBoundingClientRect();const nextWidth=horizontal?px(rect.width):lastWidth;const nextHeight=vertical?px(rect.height):lastHeight;const changed=nextWidth!==lastWidth||nextHeight!==lastHeight;if(changed){// Commit before paint. A second frame would leave the parent\n// one spring step behind the transformed frame.\nstableFrames=0;commit(rect.width,rect.height);}else{stableFrames+=1;}// Framer eases size with transforms ResizeObserver does not see.\n// Keep sampling only while the box is still changing, then stop.\nif(stableFrames<12){rafId.current=requestAnimationFrame(readFrame);return;}following=false;};const armFollow=()=>{if(!active()||following)return;following=true;stableFrames=0;rafId.current=requestAnimationFrame(readFrame);};const resizeObserver=new ResizeObserver(()=>armFollow());const intersectionObserver=new IntersectionObserver(entries=>{inView=entries.some(entry=>entry.isIntersecting);if(active())armFollow();else{following=false;cancelFrame();}});const onVisibility=()=>{pageVisible=document.visibilityState===\"visible\";if(active())armFollow();else{following=false;cancelFrame();}};const onPointer=event=>{const node=event.target;if(node instanceof Node&&target.contains(node))armFollow();};resizeObserver.observe(target);intersectionObserver.observe(target);document.addEventListener(\"visibilitychange\",onVisibility);document.addEventListener(\"pointerdown\",onPointer,true);armFollow();return()=>{disposed=true;following=false;cancelFrame();resizeObserver.disconnect();intersectionObserver.disconnect();document.removeEventListener(\"visibilitychange\",onVisibility);document.removeEventListener(\"pointerdown\",onPointer,true);clearSizes();};},[direction,isStatic,reducedMotion]);return /*#__PURE__*/_jsx(\"div\",{ref:rootRef,\"data-build\":\"layout-jump-preventer-prod-20260926-01\",className:className,\"aria-hidden\":\"true\",\"data-layout-jump-preventer\":\"\",style:{position:\"relative\",pointerEvents:\"none\",...style}});}function px(value){const rounded=Math.round(value*100)/100;return`${rounded}px`;}AvoidLayoutJumping.displayName=\"Layout Jump Preventer\";addPropertyControls(AvoidLayoutJumping,{direction:{type:ControlType.Enum,title:\"Direction\",defaultValue:\"vertical\",options:[\"vertical\",\"horizontal\",\"both\"],optionTitles:[\"Vertical\",\"Horizontal\",\"Both\"],displaySegmentedControl:true,segmentedControlDirection:\"vertical\",// @ts-ignore Framer ships optionIcons; the installed enum type omits them.\noptionIcons:[\"direction-vertical\",\"direction-horizontal\",\"direction-all\"],description:\"More components at [Framer University](https://frameruni.link/cc).\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AvoidLayoutJumping\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framer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