{"version":3,"file":"FeaturedMedia.DTh_zuOS.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/dyy9eS4W6IWb8GiDvlhW/MESZD8hRRRgHfCcnaT7m/FeaturedMedia.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Plays an uploaded MP4 as a looping, muted featured video. Falls back to the\n * still image when no video is set, or when the visitor prefers reduced motion.\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function FeaturedMedia(props){const{video,image,matchText,label,fit,style}=props;const[reduced,setReduced]=React.useState(false);React.useEffect(()=>{const mq=window.matchMedia(\"(prefers-reduced-motion: reduce)\");setReduced(mq.matches);const onChange=()=>setReduced(mq.matches);mq.addEventListener(\"change\",onChange);return()=>mq.removeEventListener(\"change\",onChange);},[]);// Optional scope: only play the video when the bound label contains matchText.\nconst matches=!matchText||(label||\"\").toLowerCase().includes(matchText.toLowerCase());const showVideo=!!video&&matches&&!reduced;const poster=image?.src;const common={width:\"100%\",height:\"100%\",objectFit:fit,display:\"block\"};return /*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"100%\",height:\"100%\",overflow:\"hidden\"},children:showVideo?/*#__PURE__*/_jsx(\"video\",{src:video,poster:poster,autoPlay:true,loop:true,muted:true,playsInline:true,preload:\"auto\",\"aria-hidden\":\"true\",style:common}):poster?/*#__PURE__*/_jsx(\"img\",{src:poster,srcSet:image?.srcSet,alt:image?.alt??\"\",style:common}):null});}FeaturedMedia.defaultProps={fit:\"cover\",matchText:\"\",label:\"\"};addPropertyControls(FeaturedMedia,{video:{type:ControlType.File,title:\"Video\",allowedFileTypes:[\"mp4\",\"webm\"]},image:{type:ControlType.ResponsiveImage,title:\"Image / Poster\"},label:{type:ControlType.String,title:\"Label\",defaultValue:\"\",description:\"Bind to the project title (CMS).\"},matchText:{type:ControlType.String,title:\"Only if label has\",defaultValue:\"\",description:\"Leave empty to play on every project.\"},fit:{type:ControlType.Enum,title:\"Fit\",options:[\"cover\",\"contain\"],optionTitles:[\"Cover\",\"Contain\"],defaultValue:\"cover\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FeaturedMedia\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"any\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FeaturedMedia.map"],"mappings":"+LAMG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,QAAM,QAAM,YAAU,QAAM,MAAI,SAAO,EAAW,CAAC,EAAQ,GAAYA,EAAe,EAAK,EAAE,MAAoB,CAAC,IAAM,EAAG,EAAO,WAAW,kCAAkC,EAAE,EAAW,EAAG,OAAO,EAAE,IAAM,MAAa,EAAW,EAAG,OAAO,EAAyC,OAAvC,EAAG,iBAAiB,SAAS,CAAQ,MAAY,EAAG,oBAAoB,SAAS,CAAQ,CAAE,EAAE,CAAC,CAAC,EACvY,IAAM,EAAQ,CAAC,IAAY,GAAO,GAAA,CAAI,YAAY,CAAC,CAAC,SAAS,EAAU,YAAY,CAAC,EAAQ,EAAU,CAAC,CAAC,GAAO,GAAS,CAAC,EAAc,EAAO,GAAO,IAAU,EAAO,CAAC,MAAM,OAAO,OAAO,OAAO,UAAU,EAAI,QAAQ,OAAO,EAAE,OAAoB,EAAK,MAAM,CAAC,MAAM,CAAC,GAAG,EAAM,MAAM,OAAO,OAAO,OAAO,SAAS,QAAQ,EAAE,SAAS,EAAuB,EAAK,QAAQ,CAAC,IAAI,EAAa,SAAO,SAAS,GAAK,KAAK,GAAK,MAAM,GAAK,YAAY,GAAK,QAAQ,OAAO,cAAc,OAAO,MAAM,CAAM,CAAC,EAAE,EAAoB,EAAK,MAAM,CAAC,IAAI,EAAO,OAAO,GAAO,OAAO,IAAI,GAAO,KAAK,GAAG,MAAM,CAAM,CAAC,EAA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