{"version":3,"file":"useAutoDemo.DGkDb_qf.mjs","names":["useState","useRef","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","window","_e","ce","de","RenderTarget","init_framer_CN96F41L","useAutoDemo","running","setRunning","step","onStep","el","ref","timer","stopped","stop","io","i","tick","steps","interval","wait","init_useAutoDemo"],"sources":["https:/framerusercontent.com/modules/t0pFtxiMwgL5ROfqSC87/TfUSJ0pbgBpHox9cUWIq/useAutoDemo.js"],"sourcesContent":["import{useEffect,useRef,useState}from\"react\";import{RenderTarget}from\"framer\";// Plays a short demo once when the element scrolls into view, then hands over to the visitor.\n// Skipped on the canvas and with reduced motion. The first pointer or key press inside stops it.\n// Returns true while the demo runs, so callers can mute aria-live updates.\nexport function useAutoDemo(ref,steps,onStep,interval=1600,wait=900){const[running,setRunning]=useState(false);const step=useRef(onStep);step.current=onStep;useEffect(()=>{const el=ref.current;if(!el||typeof IntersectionObserver===\"undefined\"||RenderTarget.current()===RenderTarget.canvas)return;if(window.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches)return;let timer=0;let stopped=false;const stop=()=>{stopped=true;window.clearTimeout(timer);setRunning(false);io.disconnect();};const io=new IntersectionObserver(([e])=>{if(!e.isIntersecting||stopped)return;io.disconnect();setRunning(true);let i=0;const tick=()=>{if(stopped)return;if(i>=steps)return stop();step.current(i++);timer=window.setTimeout(tick,interval);};timer=window.setTimeout(tick,wait);},{rootMargin:\"0px 0px -35% 0px\"});io.observe(el);el.addEventListener(\"pointerdown\",stop);el.addEventListener(\"keydown\",stop);el.addEventListener(\"click\",stop,true);return()=>{stopped=true;window.clearTimeout(timer);io.disconnect();el.removeEventListener(\"pointerdown\",stop);el.removeEventListener(\"keydown\",stop);el.removeEventListener(\"click\",stop,true);};},[]);return running;}\nexport const __FramerMetadata__ = {\"exports\":{\"useAutoDemo\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./useA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