{"version":3,"file":"RedThreadLine.CpkcfViO.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/FsqgP4FJ7t3DmQjTRWpG/AW4BPUMBSEzJn7xj8fIK/RedThreadLine.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{startTransition,useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useReducedMotion}from\"framer-motion\";/**\n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight 2\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function RedThreadLine(props){const{orientation=\"horizontal\",color=\"#AF3213\",baseColor=\"rgba(175, 50, 19, 0.16)\",duration=.9}=props;const rootRef=useRef(null);const isStatic=useIsStaticRenderer();const reduceMotion=useReducedMotion();const[revealed,setRevealed]=useState(isStatic||Boolean(reduceMotion));const isHorizontal=orientation===\"horizontal\";useEffect(()=>{if(isStatic||reduceMotion){startTransition(()=>setRevealed(true));return;}const root=rootRef.current;if(!root||typeof window===\"undefined\")return;let firstFrame=0;let secondFrame=0;let observer=null;const revealAfterInitialPaint=()=>{firstFrame=window.requestAnimationFrame(()=>{secondFrame=window.requestAnimationFrame(()=>{startTransition(()=>setRevealed(true));});});};if(\"IntersectionObserver\"in window){observer=new IntersectionObserver(entries=>{if(!entries.some(entry=>entry.isIntersecting))return;observer?.disconnect();revealAfterInitialPaint();},{threshold:.12,rootMargin:\"0px 0px -8% 0px\"});observer.observe(root);}else{revealAfterInitialPaint();}return()=>{observer?.disconnect();window.cancelAnimationFrame(firstFrame);window.cancelAnimationFrame(secondFrame);};},[isStatic,reduceMotion]);return /*#__PURE__*/_jsx(\"div\",{ref:rootRef,\"aria-hidden\":\"true\",style:{...props.style,position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",background:baseColor},children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",background:color,transformOrigin:isHorizontal?\"left center\":\"center top\",transform:isHorizontal?`scaleX(${revealed?1:0})`:`scaleY(${revealed?1:0})`,transition:reduceMotion?\"none\":`transform ${duration}s cubic-bezier(0.22, 1, 0.36, 1)`,willChange:\"transform\"}})});}addPropertyControls(RedThreadLine,{orientation:{type:ControlType.Enum,title:\"Ausrichtung\",options:[\"horizontal\",\"vertical\"],optionTitles:[\"Horizontal\",\"Vertikal\"],defaultValue:\"horizontal\",displaySegmentedControl:true},color:{type:ControlType.Color,title:\"Linie\",defaultValue:\"#AF3213\"},baseColor:{type:ControlType.Color,title:\"Grundlinie\",defaultValue:\"rgba(175, 50, 19, 0.16)\"},duration:{type:ControlType.Number,title:\"Dauer\",defaultValue:.9,min:.2,max:3,step:.1,unit:\"s\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RedThreadLine\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"600\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"2\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RedThreadLine.map"],"mappings":"sQAKG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,cAAY,aAAa,QAAM,UAAU,YAAU,0BAA0B,WAAS,IAAI,EAAY,EAAQA,EAAO,IAAI,EAAQ,EAAS,EAAoB,EAAQ,EAAa,EAAiB,EAAO,CAAC,EAAS,GAAaC,EAAS,GAAU,EAAQ,CAAa,EAAQ,EAAa,IAAc,aAA8zB,OAAjzB,MAAc,CAAC,GAAG,GAAU,EAAa,CAAC,MAAoB,EAAY,EAAI,CAAC,EAAE,MAAO,CAAC,IAAM,EAAK,EAAQ,QAAQ,GAAG,CAAC,GAAa,IAAS,OAAY,OAAO,IAAI,EAAW,EAAM,EAAY,EAAM,EAAS,KAAW,MAA4B,CAAC,EA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