{"version":3,"file":"SimpleCMSVideo.Cyi52mKo.mjs","names":[],"sources":["https:/framerusercontent.com/modules/AsPPqdHb3gQuAZTgjmGF/Opw55iWhH1pB4lvwfx3W/SimpleCMSVideo.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";export default function UniversalCMSMedia(props){const{src,poster,autoPlay,muted,loop,objectFit,radius,isVisible}=props;// --- THE FIX ---\n// Instead of returning null, we return an empty div with display: none.\n// This ensures the component collapses completely and takes up zero space in the layout.\nif(!isVisible){return /*#__PURE__*/_jsx(\"div\",{style:{display:\"none\",width:0,height:0}});}// ----------------\n// 2. Logic check: Is there actually a file connected?\n// Show placeholder only if it IS set to be visible but no file is supplied.\nif(!src){return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",backgroundColor:\"#1a1a1a\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",color:\"#888\",fontSize:14,borderRadius:radius,border:\"1px dashed #333\",// Ensure the placeholder takes up space when needed\nminHeight:50},children:\"Connect CMS Media\"});}// 3. The \"Smart\" Check: Look at the URL extension to see if it's a video file\n// We check for common video extensions at the end of the URL.\nconst isVideo=src.match(/\\.(mp4|mov|webm|m4v)(\\?.*)?$/i);// 4A. If it IS a video, render the video player\nif(isVideo){return /*#__PURE__*/_jsx(\"video\",{src:src,poster:poster,autoPlay:autoPlay,muted:muted,loop:loop,playsInline:true,style:{width:\"100%\",height:\"100%\",objectFit:objectFit,borderRadius:radius,display:\"block\"}});}// 4B. If it is NOT a video (meaning it's a GIF, PNG, JPG, etc.), render a standard image\nreturn /*#__PURE__*/_jsx(\"img\",{src:src,alt:\"CMS Media\",style:{width:\"100%\",height:\"100%\",objectFit:objectFit,borderRadius:radius,display:\"block\"}});}addPropertyControls(UniversalCMSMedia,{isVisible:{type:ControlType.Boolean,title:\"Visible\",defaultValue:true,description:\"Set variable to 'Is Set' to hide completely when empty.\"},src:{type:ControlType.File,// Expanded to accept common video and image formats\nallowedFileTypes:[\"mp4\",\"mov\",\"webm\",\"m4v\",\"gif\",\"jpg\",\"jpeg\",\"png\",\"webp\",\"svg\"],title:\"Media File\"},poster:{type:ControlType.Image,title:\"Poster Image\",description:\"Optional. Only applies if media is a video.\"},autoPlay:{type:ControlType.Boolean,title:\"Auto Play\",defaultValue:true},muted:{type:ControlType.Boolean,title:\"Muted\",defaultValue:true,description:\"Must be muted to auto-play in most browsers.\"},loop:{type:ControlType.Boolean,title:\"Loop\",defaultValue:true},objectFit:{type:ControlType.Enum,title:\"Fit\",options:[\"cover\",\"contain\",\"fill\"],optionTitles:[\"Cover\",\"Contain\",\"Fill\"],defaultValue:\"cover\"},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:0,min:0}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"UniversalCMSMedia\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SimpleCMSVideo.map"],"mappings":"4JAA+F,SAAwB,EAAkB,EAAM,CAAC,GAAK,CAAC,MAAI,SAAO,WAAS,QAAM,OAAK,YAAU,SAAO,aAAW,EAWjN,OARI,EAGA,EAGU,EAAI,MAAM,gCAAgC,CACxB,EAAK,QAAQ,CAAK,MAAW,SAAgB,WAAe,QAAW,OAAK,YAAY,GAAK,MAAM,CAAC,MAAM,OAAO,OAAO,OAAiB,YAAU,aAAa,EAAO,QAAQ,QAAQ,CAAC,CAAC,CACrM,EAAK,MAAM,CAAK,MAAI,IAAI,YAAY,MAAM,CAAC,MAAM,OAAO,OAAO,OAAiB,YAAU,aAAa,EAAO,QAAQ,QAAQ,CAAC,CAAC,CALvH,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,gBAAgB,UAAU,QAAQ,OAAO,WAAW,SAAS,eAAe,SAAS,MAAM,OAAO,SAAS,GAAG,aAAa,EAAO,OAAO,kBACp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