{"version":3,"file":"EditorialImage.CfpoxDOX.mjs","names":["React.useRef","React.useState","__esmMin","window","init_npm_react_18_3_1","init_ssg_sandbox_shims","ce","init_jsx_runtime","c","p","_e","de","addPropertyControls","init_framer_B6PCHH0A","ControlType","useIsStaticRenderer","EditorialImage","props","ref","offset","setOffset","isStatic","update","rect","vh","progress","parallax","moving","style","image","decorative","altText","noizeVisible","noizeOpacity","init_EditorialImage"],"sources":["https:/framerusercontent.com/modules/nu9zAVFpjDr3N9Bym5dR/Ph6bz0IjkulK3ykPDVNv/EditorialImage.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function EditorialImage(props){const{image,altText=\"\",decorative=false,parallax=200,noizeVisible=true,noizeOpacity=.5,style}=props;const ref=React.useRef(null);const[offset,setOffset]=React.useState(0);const isStatic=useIsStaticRenderer();React.useEffect(()=>{if(isStatic||typeof window===\"undefined\")return;const update=()=>{if(!ref.current)return;const rect=ref.current.getBoundingClientRect(),vh=window.innerHeight;const progress=Math.max(0,Math.min(1,(vh-rect.top)/(vh+rect.height)));setOffset(parallax-progress*parallax);};window.addEventListener(\"scroll\",update,{passive:true});window.addEventListener(\"resize\",update);update();return()=>{window.removeEventListener(\"scroll\",update);window.removeEventListener(\"resize\",update);};},[parallax,isStatic]);const moving={height:isStatic?\"100%\":`calc(100% + ${parallax}px)`,transform:isStatic?\"translateY(0px)\":`translateY(${-offset}px)`};return /*#__PURE__*/_jsxs(\"div\",{ref:ref,style:{overflow:\"hidden\",position:\"relative\",backgroundColor:\"#ffffff\",width:\"100%\",height:\"100%\",...style},children:[image?.src&&/*#__PURE__*/_jsx(\"img\",{src:image.src,srcSet:image.srcSet,sizes:\"100vw\",alt:decorative?\"\":altText||image.alt||\"\",style:{width:\"100%\",...moving,objectFit:\"cover\",display:\"block\"}}),noizeVisible&&/*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":\"true\",style:{position:\"absolute\",top:0,left:0,width:\"100%\",...moving,backgroundImage:\"url(https://framerusercontent.com/images/hfyi67pKwBIagdce3cECqq02Do.png)\",backgroundRepeat:\"repeat\",backgroundSize:\"100px 100px\",opacity:noizeOpacity,pointerEvents:\"none\",zIndex:1,mixBlendMode:\"overlay\"}})]});}addPropertyControls(EditorialImage,{image:{type:ControlType.ResponsiveImage},altText:{type:ControlType.String,defaultValue:\"\"},decorative:{type:ControlType.Boolean,defaultValue:false},parallax:{type:ControlType.Number,defaultValue:200,min:0,max:500,step:10},noizeVisible:{type:ControlType.Boolean,defaultValue:true},noizeOpacity:{type:ControlType.Number,defaultValue:.5,min:0,max:1,step:.1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"EditorialImage\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./EditorialImage.map"],"mappings":"A,qNAGG,SAAwBgB,EAAe,EAAM,CAAC,GAAK,CAAC,QAAM,UAAQ,GAAG,aAAW,GAAM,WAAS,IAAI,eAAa,GAAK,eAAa,GAAG,SAAOC,EAAYC,EAAIlB,EAAa,IAAI,EAAO,CAACmB,EAAOC,GAAWnB,EAAe,CAAC,EAAQoB,EAASN,EAAoB,EAAET,MAAoB,CAAC,GAAGe,GAAiBlB,IAAS,OAAY,OAAO,IAAMmB,MAAW,CAAC,GAAG,CAACJ,EAAI,QAAQ,OAAO,IAAMK,EAAKL,EAAI,QAAQ,sBAAsB,EAAEM,EAAGrB,EAAO,YAAkBsB,EAAS,KAAK,IAAI,EAAE,KAAK,IAAI,GAAGD,EAAGD,EAAK,MAAMC,EAAGD,EAAK,OAAO,CAAC,EAAEH,EAAUM,EAASD,EAASC,CA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