{"version":3,"file":"SimpleHeroSlideshow.DD-ZtMR4.mjs","names":["React.useState","__esmMin","init_ssg_sandbox_shims","init_npm_react_18_3_1","window","ce","init_jsx_runtime","c","_e","addPropertyControls","init_framer_Bf4_tcb2","ControlType","SimpleHeroSlideshow","images","props","activeIndex","setActiveIndex","timer","current","src","image","index","init_SimpleHeroSlideshow"],"sources":["https:/framerusercontent.com/modules/LCKOk0PkA7Cv9MCPi9SV/BflI1tEAk49GfEOO3UvQ/SimpleHeroSlideshow.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function SimpleHeroSlideshow(props){const images=(props.images??[]).filter(Boolean);const[activeIndex,setActiveIndex]=React.useState(0);React.useEffect(()=>{if(images.length<2)return;const timer=window.setInterval(()=>{setActiveIndex(current=>(current+1)%images.length);},Math.max(1,props.interval??5)*1e3);return()=>window.clearInterval(timer);},[images.length,props.interval]);React.useEffect(()=>{if(activeIndex>=images.length)setActiveIndex(0);},[activeIndex,images.length]);return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",...props.style},children:images.map((image,index)=>{const src=typeof image===\"string\"?image:image?.src??image?.value??image?.image;if(!src)return null;return /*#__PURE__*/_jsx(\"img\",{src:src,alt:\"\",style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\",opacity:index===activeIndex?1:0,transition:\"opacity 850ms cubic-bezier(0.4, 0, 0.2, 1)\"}},src+index);})});}addPropertyControls(SimpleHeroSlideshow,{images:{type:ControlType.Array,title:\"Images\",control:{type:ControlType.Image},maxCount:12},interval:{type:ControlType.Number,title:\"Change every\",defaultValue:5,min:2,max:12,step:1,unit:\"s\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SimpleHeroSlideshow\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SimpleHeroSlideshow.map"],"mappings":"A,+LAGG,SAAwBY,EAAoB,EAAM,CAAC,IAAMC,GAAQC,EAAM,QAAQ,CAAC,EAAA,CAAG,OAAO,OAAO,EAAO,CAACC,EAAYC,GAAgBhB,EAAe,CAAC,EAAyV,OAAvVK,MAAoB,CAAC,GAAGQ,EAAO,OAAO,EAAE,OAAO,IAAMI,EAAMb,EAAO,gBAAgB,CAACY,EAAe,IAAUE,EAAQ,GAAGL,EAAO,MAAM,CAAE,EAAE,KAAK,IAAI,EAAEC,EAAM,UAAU,CAAC,EAAE,GAAG,EAAE,UAAUV,EAAO,cAAca,CAAK,CAAE,EAAE,CAACJ,EAAO,OAAOC,EAAM,QAAQ,CAAC,EAAET,MAAoB,CAAIU,GAAaF,EAAO,QAAOG,EAAe,CAAC,CAAE,EAAE,CAACD,EAAYF,EAAO,MAAM,CAAC,EAAsB,gBAAK,MAAM,CAAC,MAAM,CAAC,SAAS,WAAW,MAAM,OAAO,OAAO,OAAO,SAAS,SAAS,GAAGC,EAAM,KAAK,EAAE,SAASD,EAAO,KAAK,EAAM,IAAQ,CAAC,IAAMM,EAAI,OAAOC,GAAQ,SAASA,EAAMA,GAAO,KAAKA,GAAO,OAAOA,GAAO,MAA0B,OAAhBD,EAAoC,gBAAK,MAAM,CAAK,MAAI,IAAI,GAAG,MAAM,CAAC,SAAS,WAAW,MAAM,EAAE,MAAM,OAAO,OAAO,OAAO,UAAU,QAAQ,QAAQ,MAAQJ,GAAgB,WAAW,4CAA4C,CAAC,EAAEI,EAAIE,CAAK,EAAvO,IAAyO,CAAC,CAAC,CAAC,CAAE,C,8CAACZ,EAAoBG,EAAoB,CAAC,OAAO,CAAC,KAAKD,EAAY,MAAM,MAAM,SAAS,QAAQ,CAAC,KAAKA,EAAY,KAAK,EAAE,SAAS,EAAE,EAAE,SAAS,CAAC,KAAKA,EAAY,OAAO,MAAM,eAAe,aAAa,EAAE,IAAI,EAAE,IAAI,GAAG,KAAK,EAAE,KAAK,GAAG,CAAC,CAAC,C"}