{"version":3,"file":"Stagger.C8J5d4E2.mjs","names":["React.useRef","React.useId","__esmMin","ie","init_ssg_sandbox_shims","window","de","p","init_npm_react_18_3_1","ce","init_framer_Bf4_tcb2","useIsStaticRenderer","withStagger","isStatic","ref","id","host","reduce","seen","reveal","els","ra","a","rb","b","el","i","STEP","raf","check","limit","due","c","schedule","mo","safety","left","Component","props","css","DISTANCE","DURATION","EASE","init_Stagger","init_jsx_runtime"],"sources":["https:/framerusercontent.com/modules/ID07wLBBDrepbyLEDUGp/3PaUARVkwKKFyZmr3AWs/Stagger.js"],"sourcesContent":["// Ashwood — cards in a CMS grid arrive one after another, left to right.\n// Framer gives every repeated item the same appear delay, so a row of cards pops in at once.\n// Put this override on a collection list (the grid itself). Items fade up as they enter the screen,\n// 0.15s apart in reading order. On the canvas everything stays visible.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{useIsStaticRenderer}from\"framer\";const EASE=\"cubic-bezier(0.65, 0, 0.35, 1)\";const STEP=.15// seconds between cards\n;const DURATION=1.17;const DISTANCE=32// px\n;export function withStagger(Component){return props=>{const isStatic=useIsStaticRenderer();const ref=React.useRef(null);const id=\"s\"+React.useId().replace(/[^a-zA-Z0-9]/g,\"\");React.useEffect(()=>{if(isStatic||typeof window===\"undefined\")return;const host=ref.current?.querySelector(\":scope > :not(style)\");if(!host)return;const reduce=window.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches;const seen=new WeakSet;const reveal=els=>{els.sort((a,b)=>{const ra=a.getBoundingClientRect(),rb=b.getBoundingClientRect();return Math.abs(ra.top-rb.top)>8?ra.top-rb.top:ra.left-rb.left;}).forEach((el,i)=>{seen.add(el);el.style.transitionDelay=reduce?\"0s\":`${Math.min(i*STEP,.6)}s`;el.setAttribute(\"data-in\",\"\");});};// reveal every card whose top has come into the lower part of the screen\nlet raf=0;const check=()=>{raf=0;const limit=window.innerHeight*.92;const due=Array.from(host.children).filter(c=>!seen.has(c)&&c.getBoundingClientRect().top<limit);if(due.length)reveal(due);};const schedule=()=>{if(!raf)raf=requestAnimationFrame(check);};schedule();window.addEventListener(\"scroll\",schedule,{passive:true});window.addEventListener(\"resize\",schedule);// CMS items can render after mount (load more, route change)\nconst mo=new MutationObserver(schedule);mo.observe(host,{childList:true});// never leave a card hidden: show whatever is left after a while\nconst safety=window.setTimeout(()=>{const left=Array.from(host.children).filter(c=>!seen.has(c)&&c.getBoundingClientRect().top<window.innerHeight);if(left.length)reveal(left);},4e3);return()=>{cancelAnimationFrame(raf);window.clearTimeout(safety);window.removeEventListener(\"scroll\",schedule);window.removeEventListener(\"resize\",schedule);mo.disconnect();};},[isStatic]);if(isStatic)return /*#__PURE__*/_jsx(Component,{...props});const css=`[data-ash-stagger=${id}]>*>*{opacity:0;translate:0 ${DISTANCE}px;transition:opacity ${DURATION}s ${EASE},translate ${DURATION}s ${EASE}}`+`[data-ash-stagger=${id}]>*>[data-in]{opacity:1;translate:0 0}`+`@media (prefers-reduced-motion: reduce){[data-ash-stagger=${id}]>*>*{translate:0 0}}`;return /*#__PURE__*/_jsxs(\"div\",{ref:ref,\"data-ash-stagger\":id,style:{display:\"contents\"},children:[/*#__PURE__*/_jsx(\"style\",{dangerouslySetInnerHTML:{__html:css}}),/*#__PURE__*/_jsx(Component,{...props})]});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withStagger\":{\"type\":\"reactHoc\",\"name\":\"withStagger\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Stagger.map"],"mappings":"A,6LAMC,SAAgBY,EAAY,EAAU,CAAC,MAAO,IAAO,CAAC,IAAMC,EAASF,EAAoB,EAAQG,EAAId,EAAa,IAAI,EAAQe,EAAG,IAAId,EAAY,CAAC,CAAC,QAAQ,gBAAgB,EAAE,EAGqM,GAHnMQ,MAAoB,CAAC,GAAGI,GAAiBR,IAAS,OAAY,OAAO,IAAMW,EAAKF,EAAI,SAAS,cAAc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