{"version":3,"file":"DrawLine.MiPLd8To.mjs","names":["useRef","useState","__esmMin","init_npm_react_18_3_1","window","ce","init_jsx_runtime","c","_e","de","init_ssg_sandbox_shims","addPropertyControls","RenderTarget","init_framer_CDGohruR","ControlType","DrawLine","props","ref","isStatic","shown","setShown","instant","setInstant","el","done","fire","io","failsafe","e","entries","sweep","node","onScreen","r","ease","transition","draw","duration","delay","color","init_DrawLine"],"sources":["https:/framerusercontent.com/modules/UKGHArsnfXNtyWFVtML4/C1UXmWzInn8Cqa7VCydR/DrawLine.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * DrawLine — a horizontal rule that draws itself in (left → right) on first\n * viewport entry. Falls back to a plain fade when `draw` is off, renders\n * fully drawn on the canvas and for reduced-motion users.\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n * @framerIntrinsicWidth 200\n * @framerIntrinsicHeight 1\n * @framerDisableUnlink\n */export default function DrawLine(props){const{color,duration,delay,draw}=props;const ref=useRef(null);const isStatic=RenderTarget.current()===RenderTarget.canvas;const[shown,setShown]=useState(isStatic);const[instant,setInstant]=useState(isStatic);useEffect(()=>{if(isStatic)return;if(typeof window!==\"undefined\"&&window.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches){setInstant(true);setShown(true);return;}const el=ref.current;if(!el)return;let done=false;const fire=()=>{if(done)return;done=true;setShown(true);io.disconnect();clearTimeout(failsafe);};const io=new IntersectionObserver(entries=>{for(const e of entries)if(e.isIntersecting)fire();},{threshold:0,rootMargin:\"0px 0px -8% 0px\"});io.observe(el);// Failsafe must not reveal what the reader has not reached: firing blind\n// pre-reveals everything below the fold, so on a long page every element\n// past that point arrives already visible. Poll instead, and fire only\n// once the element is genuinely on screen.\nlet sweep=null;const node=el;const onScreen=()=>{if(!node||!node.isConnected)return false;const r=node.getBoundingClientRect();return r.bottom>0&&r.top<(window.innerHeight||0);};const failsafe=setTimeout(()=>{sweep=setInterval(()=>{if(onScreen()){clearInterval(sweep);fire();}},400);},3e4);return()=>{io.disconnect();clearTimeout(failsafe);if(sweep)clearInterval(sweep);};},[isStatic]);const ease=\"cubic-bezier(0.16, 1, 0.3, 1)\";const transition=instant?\"none\":draw?`transform ${duration}s ${ease} ${delay}s`:`opacity ${duration}s ${ease} ${delay}s`;return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{...props.style,position:\"relative\",overflow:\"hidden\",pointerEvents:\"none\"},children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,background:color,transformOrigin:\"left center\",transform:draw&&!shown?\"scaleX(0)\":\"scaleX(1)\",opacity:draw?1:shown?1:0,transition}})});}DrawLine.defaultProps={color:\"rgba(15, 23, 42, 0.1)\",duration:.5,delay:0,draw:true};addPropertyControls(DrawLine,{color:{type:ControlType.Color,title:\"Color\",defaultValue:\"rgba(15, 23, 42, 0.1)\"},draw:{type:ControlType.Boolean,title:\"Draw\",defaultValue:true,description:\"On: wipes in left to right on first view. Off: plain fade instead.\"},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:.5,step:.05,unit:\"s\",description:\"SECONDS (0.5 = half a second). DecodeText and Stat Card take milliseconds — do not copy values between them.\"},delay:{type:ControlType.Number,title:\"Delay\",defaultValue:0,step:.02,unit:\"s\",description:\"SECONDS before the draw starts. DecodeText and Stat Card take milliseconds — do not copy values between them.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"DrawLine\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"200\",\"framerIntrinsicHeight\":\"1\",\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"\",\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DrawLine.map"],"mappings":"A,8MAUG,SAAwBe,EAAS,EAAM,CAA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