{"version":3,"file":"ScrollLine.B8DbQnw2.mjs","names":["forwardRef","useRef","useCallback","_jsx","__esmMin","ne","de","c","J","init_jsx_runtime","init_npm_react_18_3_1","init_framer_B3LLf74D","RenderTarget","useSpring","useScroll","init_framer_motion_1EwlFBEG","withScrollLine","Component","props","ref","parent","setRef","el","scrollYProgress","scaleY","init_ScrollLine"],"sources":["https:/framerusercontent.com/modules/F8JkZwC58owFRLXbdCGb/z6rJ5Foc4P6Ro693t91d/ScrollLine.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useCallback,useRef}from\"react\";import{useScroll,useSpring}from\"framer-motion\";import{RenderTarget}from\"framer\";/**\n * A thin line that draws itself downward as you scroll through its parent (e.g. the credits).\n * Put it on an absolute 1px-wide frame inside the section it should follow.\n */export function withScrollLine(Component){return /*#__PURE__*/forwardRef(function ScrollLine(props,ref){const parent=useRef(null);const setRef=useCallback(el=>{parent.current=el?.parentElement||null;if(typeof ref===\"function\")ref(el);else if(ref)ref.current=el;},[ref]);const{scrollYProgress}=useScroll({target:parent,offset:[\"start 75%\",\"end 55%\"]});const scaleY=useSpring(scrollYProgress,{stiffness:220,damping:40,mass:.4});if(RenderTarget.current()===RenderTarget.canvas)return /*#__PURE__*/_jsx(Component,{...props});return /*#__PURE__*/_jsx(Component,{...props,ref:setRef,style:{...props.style,scaleY,originY:0}});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withScrollLine\":{\"type\":\"reactHoc\",\"name\":\"withScrollLine\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollLine.map"],"mappings":"A,0OAGG,SAAgBgB,EAAeC,EAAU,CAAC,MAAoBjB,gBAAW,SAAoBkB,EAAMC,EAAI,CAAC,IAAMC,EAAOnB,EAAO,IAAI,EAAQoB,EAAOnB,EAAYoB,GAAI,CAACF,EAAO,QAAQE,GAAI,eAAe,KAAQ,OAAOH,GAAM,WAAWA,EAAIG,CAAE,EAAUH,IAAIA,EAAI,QAAQG,EAAG,EAAE,CAACH,CAAG,CAAC,EAAO,CAACI,mBAAiBT,EAAU,CAAC,OAAOM,EAAO,OAAO,CAAC,YAAY,SAAS,CAAC,CAAC,EAAQI,EAAOX,EAAUU,EAAgB,CAAC,UAAU,IAAI,QAAQ,GAAG,KAAK,EAAE,CAAC,EAAiG,OAA5FX,EAAa,QAAQ,IAAIA,EAAa,OAA2BT,gBAAKc,EAAU,CAAC,GAAGC,CAAK,CAAC,EAAsBf,gBAAKc,EAAU,CAAC,GAAGC,EAAM,IAAIG,EAAO,MAAM,CAAC,GAAGH,EAAM,MAAMM,SAAO,QAAQ,CAAC,CAAC,CAAC,CAAE,CAAC,CAAE,C"}