{"version":3,"file":"BlurGradient_Prod.BrP0-R1b.mjs","names":["React.useContext","React.useMemo","React.useRef","React.useState","__esmMin","init_ssg_sandbox_shims","pe","init_npm_react_18_3_1","_e","oe","ce","de","window","spring","MotionConfigContext","init_framer_motion_DhsWWWsN","addPropertyControls","init_framer_B1b760uK","ControlType","BlurGradient","nativeTransition","seconds","delay","timing","match","animationMs","part","rootRef","renderLayers","setRenderLayers","hasBlurLayers","setHasBlurLayers","blur","displayBlur","setDisplayBlur","frame","nextFrame","settleTimer","settleMs","root","inView","update","observer","entry","getGradientDirection","direction","blurSteps","index","step","filterTransition","init_BlurGradient_Prod","init_jsx_runtime"],"sources":["https:/framerusercontent.com/modules/rofp3mS0LNY15cjhHzia/zmpvLkvKOP6Dr1PgUapT/BlurGradient_Prod.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{MotionConfigContext,spring}from\"framer-motion\";/**\n * @framerDisableUnlink\n *\n * @framerIntrinsicWidth 240\n * @framerIntrinsicHeight 240\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */function BlurGradient({blur,borderRadius,direction}){// Framer supplies its native Styles transition through MotionConfig.\nconst nativeTransition=React.useContext(MotionConfigContext).transition;// Keep browser interpolation: no React render or filter write on every frame.\nconst{filterTransition,settleMs}=React.useMemo(()=>{const seconds=Math.max(0,Number(nativeTransition?.duration??.3));const delay=Math.max(0,Number(nativeTransition?.delay??0));let timing=`${seconds}s linear`;if(nativeTransition?.type===\"spring\"){if(nativeTransition.stiffness&&nativeTransition.damping){timing=String(spring({keyframes:[0,1],stiffness:nativeTransition.stiffness,damping:nativeTransition.damping,mass:nativeTransition.mass??1}));}else{timing=String(spring(seconds,nativeTransition.bounce??.25));}}else if(Array.isArray(nativeTransition?.ease)&&nativeTransition.ease.length===4){timing=`${seconds}s cubic-bezier(${nativeTransition.ease.join(\", \")})`;}else if(typeof nativeTransition?.ease===\"string\"&&[\"linear\",\"ease\",\"ease-in\",\"ease-out\",\"ease-in-out\"].includes(nativeTransition.ease)){timing=`${seconds}s ${nativeTransition.ease}`;}const match=timing.match(/^([\\d.]+)(ms|s)/);const animationMs=match?Number(match[1])*(match[2]===\"s\"?1e3:1):seconds*1e3;const part=`${timing} ${delay}s`;return{filterTransition:`backdrop-filter ${part}, -webkit-backdrop-filter ${part}`,settleMs:animationMs+delay*1e3};},[nativeTransition]);const rootRef=React.useRef(null);const[renderLayers,setRenderLayers]=React.useState(true);const[hasBlurLayers,setHasBlurLayers]=React.useState(blur>0);const[displayBlur,setDisplayBlur]=React.useState(blur);React.useEffect(()=>{let frame=0;let nextFrame=0;let settleTimer=0;if(blur>0){if(!hasBlurLayers){// Mount at zero first so a hover from a settled zero state still animates.\nsetDisplayBlur(0);setHasBlurLayers(true);frame=requestAnimationFrame(()=>{nextFrame=requestAnimationFrame(()=>setDisplayBlur(blur));});}else{setDisplayBlur(blur);}}else{setDisplayBlur(0);if(settleMs===0)setHasBlurLayers(false);else settleTimer=window.setTimeout(()=>setHasBlurLayers(false),settleMs+50);}return()=>{cancelAnimationFrame(frame);cancelAnimationFrame(nextFrame);window.clearTimeout(settleTimer);};},[blur,settleMs]);React.useEffect(()=>{const root=rootRef.current;if(!root)return;let inView=true;const update=()=>setRenderLayers(inView&&!document.hidden);const observer=typeof IntersectionObserver!==\"undefined\"?new IntersectionObserver(([entry])=>{inView=entry.isIntersecting;update();}):null;observer?.observe(root);document.addEventListener(\"visibilitychange\",update);update();return()=>{observer?.disconnect();document.removeEventListener(\"visibilitychange\",update);};},[]);const getGradientDirection=direction=>{switch(direction){case\"toBottom\":return\"to bottom\";case\"toTop\":return\"to top\";case\"toLeft\":return\"to left\";case\"toRight\":return\"to right\";default:return\"to bottom\";}};const blurSteps=React.useMemo(()=>[{blur:`${displayBlur/2/2/2/2/2/2/2}px`,gradient:`rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 12.5%, rgba(0, 0, 0, 1) 25%, rgba(0, 0, 0, 0) 37.5%`},{blur:`${displayBlur/2/2/2/2/2/2}px`,gradient:`rgba(0, 0, 0, 0) 12.5%, rgba(0, 0, 0, 1) 25%, rgba(0, 0, 0, 1) 37.5%, rgba(0, 0, 0, 0) 50%`},{blur:`${displayBlur/2/2/2/2/2}px`,gradient:`rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, 1) 37.5%, rgba(0, 0, 0, 1) 50%, rgba(0, 0, 0, 0) 62.5%`},{blur:`${displayBlur/2/2/2/2}px`,gradient:`rgba(0, 0, 0, 0) 37.5%, rgba(0, 0, 0, 1) 50%, rgba(0, 0, 0, 1) 62.5%, rgba(0, 0, 0, 0) 75%`},{blur:`${displayBlur/2/2/2}px`,gradient:`rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 1) 62.5%, rgba(0, 0, 0, 1) 75%, rgba(0, 0, 0, 0) 87.5%`},{blur:`${displayBlur/2/2}px`,gradient:`rgba(0, 0, 0, 0) 62.5%, rgba(0, 0, 0, 1) 75%, rgba(0, 0, 0, 1) 87.5%, rgba(0, 0, 0, 0) 100%`},{blur:`${displayBlur/2}px`,gradient:`rgba(0, 0, 0, 0) 75%, rgba(0, 0, 0, 1) 87.5%, rgba(0, 0, 0, 1) 100%`},{blur:`${displayBlur}px`,gradient:`rgba(0, 0, 0, 0) 87.5%, rgba(0, 0, 0, 1) 100%`}],[displayBlur]);return /*#__PURE__*/_jsx(\"div\",{ref:rootRef,style:{position:\"absolute\",inset:0,overflow:\"hidden\"},children:renderLayers&&hasBlurLayers&&blurSteps.map((step,index)=>/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,zIndex:index+1,backdropFilter:`blur(${step.blur})`,WebkitBackdropFilter:`blur(${step.blur})`,maskImage:`linear-gradient(${getGradientDirection(direction)}, ${step.gradient})`,WebkitMaskImage:`linear-gradient(${getGradientDirection(direction)}, ${step.gradient})`,borderRadius:borderRadius,pointerEvents:\"none\",transition:filterTransition}},index))});}BlurGradient.defaultProps={blur:10,borderRadius:\"0px\",direction:\"toBottom\"};addPropertyControls(BlurGradient,{blur:{title:\"Blur\",type:ControlType.Number,defaultValue:10,min:0,max:100,step:1,description:\"Large blur values (10<) can impact performance.\"},borderRadius:{title:\"Radius\",type:ControlType.BorderRadius,defaultValue:\"0px\"},direction:{title:\"Direction\",type:ControlType.SegmentedEnum,options:[\"toBottom\",\"toTop\",\"toLeft\",\"toRight\"],optionTitles:[\"↓\",\"↑\",\"←\",\"→\"],defaultValue:\"toBottom\",description:\"More components at [Framer University](https://frameruni.link/cc).\"}});BlurGradient.displayName=\"Blur Gradient\";export default BlurGradient;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BlurGradient\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"240\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerDisableUnlink\":\"*\",\"framerIntrinsicWidth\":\"240\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./BlurGradient_Prod.map"],"mappings":"A,kQAQG,SAASmB,EAAa,CAAC,OAAK,eAAa,aAAW,CACvD,IAAMC,EAAiBpB,EAAiBc,CAAmB,CAAC,CAAC,WACxD,CAAC,mBAAiB,YAAUb,MAAkB,CAAC,IAAMoB,EAAQ,KAAK,IAAI,EAAE,OAAOD,GAAkB,UAAU,EAAE,CAAC,EAAQE,EAAM,KAAK,IAAI,EAAE,OAAOF,GAAkB,OAAO,CAAC,CAAC,EAAMG,EAAO,GAAGF,EAAQ,UAAaD,GAAkB,OAAO,SAAU,AAA4MG,EAAzMH,EAAiB,WAAWA,EAAiB,QAAgB,OAAOP,EAAO,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,UAAUO,EAAiB,UAAU,QAAQA,EAAiB,QAAQ,KAAKA,EAAiB,MAAM,CA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