{"version":3,"file":"shared-lib.BySfJN6Q.mjs","names":["useRef","useState","useMemo","useCallback"],"sources":["https:/framerusercontent.com/modules/7aL1ww97rD1JfADQlPZz/lUzVOpyzuh31ytMYW3Fp/LuxuryCrossfadeHero.js","https:/framerusercontent.com/modules/5xRUjZEg58jKMtyjb8sS/XFsiHeQ5PlJdEcnGvJKw/siteMetadata.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useCallback,useEffect,useMemo,useRef,useState,startTransition}from\"react\";import{useInView}from\"framer-motion\";const sceneFallbacks={Home:[{src:\"https://framerusercontent.com/images/iO3Sp259rRZ1HdFSpeOyjDDg5w.jpg?width=2312&height=1297&kb=1642\",alt:\"Dubai skyline against cloudy sky\"}],About:[{src:\"https://images.unsplash.com/photo-1736893381583-dc1baae292d1?crop=entropy&cs=srgb&fm=jpg&ixlib=rb-4.1.0&q=85&w=1800\",alt:\"Editorial staircase interior\"}],WhatWeDo:[{src:\"https://framerusercontent.com/images/HoKyyQ6Q9GvNaw4QAKALe2wNh8.jpg?width=2121&height=1414&kb=2327\",alt:\"Luxurious pool with lounge area\"}],OffPlan:[{src:\"https://images.unsplash.com/photo-1783497607905-2ad168af9b4b?crop=entropy&cs=srgb&fm=jpg&ixlib=rb-4.1.0&q=85&w=2400\",alt:\"Dramatic oceanfront architecture at sunset\"},{src:\"https://images.unsplash.com/photo-1775112862850-02b1f72edcb1?crop=entropy&cs=srgb&fm=jpg&ixlib=rb-4.1.0&q=85&w=2400\",alt:\"Sculptural pool architecture at dusk\"},{src:\"https://images.unsplash.com/photo-1699965583636-4c9ee0aa317a?crop=entropy&cs=srgb&fm=jpg&ixlib=rb-4.1.0&q=85&w=2400\",alt:\"Warm-glow villa exterior at night\"},{src:\"https://images.unsplash.com/photo-1757439402342-976f4e0733ec?crop=entropy&cs=srgb&fm=jpg&ixlib=rb-4.1.0&q=85&w=2400\",alt:\"Private poolside dusk setting\"}],Remodel:[{src:\"https://images.unsplash.com/photo-1682662045890-e407e7ead8d7?crop=entropy&cs=srgb&fm=jpg&ixlib=rb-4.1.0&q=85&w=1800\",alt:\"Bespoke kitchen and spiral stair\"},{src:\"https://images.unsplash.com/photo-1743051883392-0070ca946873?crop=entropy&cs=srgb&fm=jpg&ixlib=rb-4.1.0&q=85&w=2400\",alt:\"Warm contemporary living room\"},{src:\"https://images.unsplash.com/photo-1666585607888-3f6fe0b323d8?crop=entropy&cs=srgb&fm=jpg&ixlib=rb-4.1.0&q=85&w=2400\",alt:\"High-end living room and large window\"},{src:\"https://images.unsplash.com/photo-1736893381583-dc1baae292d1?crop=entropy&cs=srgb&fm=jpg&ixlib=rb-4.1.0&q=85&w=1800\",alt:\"Dramatic staircase\"}],GroundUp:[{src:\"https://images.unsplash.com/photo-1707190205120-228c6656086c?crop=entropy&cs=srgb&fm=jpg&ixlib=rb-4.1.0&q=85&w=2400\",alt:\"Contemporary house and pool at night\"},{src:\"https://images.unsplash.com/photo-1757439402342-976f4e0733ec?crop=entropy&cs=srgb&fm=jpg&ixlib=rb-4.1.0&q=85&w=2400\",alt:\"Private poolside dusk setting\"},{src:\"https://images.unsplash.com/photo-1699965583636-4c9ee0aa317a?crop=entropy&cs=srgb&fm=jpg&ixlib=rb-4.1.0&q=85&w=2400\",alt:\"Warm-glow villa exterior at night\"},{src:\"https://images.unsplash.com/photo-1775112862850-02b1f72edcb1?crop=entropy&cs=srgb&fm=jpg&ixlib=rb-4.1.0&q=85&w=2400\",alt:\"Sculptural pool architecture at dusk\"}],Submit:[{src:\"https://images.unsplash.com/photo-1757439402342-976f4e0733ec?crop=entropy&cs=srgb&fm=jpg&ixlib=rb-4.1.0&q=85&w=2400\",alt:\"Private poolside dusk setting\"},{src:\"https://images.unsplash.com/photo-1743051883392-0070ca946873?crop=entropy&cs=srgb&fm=jpg&ixlib=rb-4.1.0&q=85&w=2400\",alt:\"Warm contemporary living room\"},{src:\"https://images.unsplash.com/photo-1723470918350-95210d01d8c1?crop=entropy&cs=srgb&fm=jpg&ixlib=rb-4.1.0&q=85&w=1800\",alt:\"Sculptural stair architecture\"},{src:\"https://images.unsplash.com/photo-1699965583636-4c9ee0aa317a?crop=entropy&cs=srgb&fm=jpg&ixlib=rb-4.1.0&q=85&w=2400\",alt:\"Warm-glow villa exterior at night\"}]};/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function LuxuryCrossfadeHero(props){const{images,scene=\"Home\",intervalSeconds=5,crossfadeDuration=1.2,overlayOpacity=.24}=props;const containerRef=useRef(null);const isInView=useInView(containerRef,{amount:.2});const isStaticRenderer=useIsStaticRenderer();const[currentIndex,setCurrentIndex]=useState(0);const sourceImages=useMemo(()=>{if(!images||images.length===0)return sceneFallbacks[scene];return images;},[images,scene]);const validImages=useMemo(()=>sourceImages.filter(image=>Boolean(image?.src)),[sourceImages]);const total=validImages.length;const safeDuration=useMemo(()=>Math.max(.1,crossfadeDuration),[crossfadeDuration]);const safeIntervalMs=useMemo(()=>Math.max(1e3,intervalSeconds*1e3),[intervalSeconds]);const getOpacity=useCallback(index=>{if(total<=1)return index===0?1:0;return index===currentIndex?1:0;},[currentIndex,total]);useEffect(()=>{if(isStaticRenderer||!isInView||total<=1)return;const timer=window.setInterval(()=>{startTransition(()=>{setCurrentIndex(prev=>(prev+1)%total);});},safeIntervalMs);return()=>{window.clearInterval(timer);};},[isInView,isStaticRenderer,safeIntervalMs,total]);const clampedOverlay=Math.min(.8,Math.max(0,overlayOpacity));if(total===0){return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\"},\"aria-hidden\":true});}return /*#__PURE__*/_jsxs(\"div\",{ref:containerRef,style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\"},role:\"img\",\"aria-label\":validImages[currentIndex]?.alt||\"Hero background slideshow\",children:[validImages.map((image,index)=>{const isActive=index===currentIndex;return /*#__PURE__*/_jsx(\"img\",{src:image.src,srcSet:image.srcSet,alt:image.alt||\"\",\"aria-hidden\":!isActive,style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\",opacity:isStaticRenderer?index===0?1:0:getOpacity(index),transition:isStaticRenderer?\"none\":`opacity ${safeDuration}s ease-in-out`,willChange:\"opacity\",pointerEvents:\"none\",userSelect:\"none\"}},`${image.src}-${index}`);}),/*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":true,style:{position:\"absolute\",inset:0,backgroundColor:`rgba(0, 0, 0, ${clampedOverlay})`,pointerEvents:\"none\"}})]});}addPropertyControls(LuxuryCrossfadeHero,{scene:{type:ControlType.Enum,title:\"Scene\",defaultValue:\"Home\",options:[\"Home\",\"About\",\"WhatWeDo\",\"OffPlan\",\"Remodel\",\"GroundUp\",\"Submit\"]},images:{type:ControlType.Array,title:\"Images\",control:{type:ControlType.ResponsiveImage},maxCount:12,defaultValue:[{src:\"https://media.gettyimages.com/id/722215279/photo/tranquil-dusk-sky-over-illuminated-home-showcase-exterior-patio-with-lap-swimming-pool.jpg\",alt:\"Illuminated luxury home patio with lap pool at dusk\"},{src:\"https://media.gettyimages.com/id/1271828605/photo/view-of-city-buildings-against-cloudy-sky-dubai-united-arab-emirates.jpg\",alt:\"Dubai skyline against cloudy sky\"},{src:\"https://media.gettyimages.com/id/909192728/photo/illuminated-modern-luxury-home-showcase-interior-living-room-with-ocean-view-at-dusk.jpg\",alt:\"Luxury ocean-view living room at dusk\"},{src:\"https://media.gettyimages.com/id/530578690/photo/island-villa.jpg\",alt:\"Private island villa exterior\"}]},intervalSeconds:{type:ControlType.Number,title:\"Interval\",defaultValue:5,min:1,max:20,step:.5,unit:\"s\"},crossfadeDuration:{type:ControlType.Number,title:\"Duration\",defaultValue:1.2,min:.1,max:6,step:.1,unit:\"s\"},overlayOpacity:{type:ControlType.Number,title:\"Overlay\",defaultValue:.24,min:0,max:.8,step:.01}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LuxuryCrossfadeHero\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LuxuryCrossfadeHero.map","// Generated by Framer (78ccf22)\nexport default function metadata(params,activeLocale){return{description:\"Storm is a Dubai-based principal investor and developer for prime real estate.\",robots:\"max-image-preview:large\",title:\"Storm Real Estate\"};}export const metadataVersion=1;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"metadataVersion\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"0RAGG,SAAwB,EAAoB,EAAM,CAAC,GAAK,CAAC,SAAO,QAAM,OAAO,kBAAgB,EAAE,oBAAkB,IAAI,iBAAe,KAAK,EAAY,EAAaA,EAAO,IAAI,EAAQ,EAAS,EAAU,EAAa,CAAC,OAAO,EAAE,CAAC,EAAQ,EAAiB,EAAoB,EAAO,CAAC,EAAa,GAAiBC,EAAS,CAAC,EAAQ,EAAaC,MAAgB,CAAC,GAAQ,EAAO,SAAS,EAAS,EAAe,GAAc,EAAS,CAAC,EAAO,CAAK,CAAC,EAAQ,EAAYA,MAAY,EAAa,OAAO,GAAO,EAAQ,GAAO,GAAI,EAAE,CAAC,CAAY,CAAC,EAAQ,EAAM,EAAY,OAAa,EAAaA,MAAY,KAAK,IAAI,GAAG,CAAiB,EAAE,CAAC,CAAiB,CAAC,EAAQ,EAAeA,MAAY,KAAK,IAAI,IAAI,EAAgB,GAAG,EAAE,CAAC,CAAe,CAAC,EAAQ,EAAWC,EAAY,GAAW,GAAO,EAAS,MAAQ,GAAa,MAAQ,GAAmB,CAAC,EAAa,CAA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