{"version":3,"file":"LoopVideo.M-dpXkzs.mjs","names":["useRef","__esmMin","c","init_jsx_runtime","ce","init_npm_react_18_3_1","de","init_framer_B6PCHH0A","addPropertyControls","ControlType","LoopVideo","props","src","file","url","original","size","videoRef","v","p","fit","init_LoopVideo"],"sources":["https:/framerusercontent.com/modules/NNsxcoSwdI2lTYIpy42w/JTM0xIr6wQCyLAQDxVAp/LoopVideo.js"],"sourcesContent":["// Request: add a video to the Home page hero card (Case Thumbnail, La Lune) in place of the image.\n// Framer's image layer only accepts images, so this is a simple video layer that sits inside the\n// card's Image layer, fills it like an image (cover), plays silently on a loop, and keeps the\n// hover zoom.\n// Fix: the video wasn't showing. Removed the card-link check and the fade-in wait, which could\n// both keep the video hidden. Now, if a video is set, it simply plays.\n// Update: new \"Size\" option. \"Fill\" (default, unchanged) fills its frame like before.\n// \"Original\" shows the video at full width with its own proportions, so the layer's height\n// follows the video's shape (set the layer's height to Fit Content).\n//\n// Setup: select this layer and upload the video in \"Video File\" (or paste a link in \"Video URL\").\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Loop Video\n *\n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight 400\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function LoopVideo(props){const{file,url,fit=\"cover\",size=\"fill\"}=props;const src=file||url;const original=size===\"original\";const videoRef=useRef(null);// Make sure it starts playing (some browsers need a nudge even with autoplay + muted)\nuseEffect(()=>{const v=videoRef.current;if(!v)return;v.muted=true;const p=v.play();if(p&&typeof p.catch===\"function\")p.catch(()=>{});},[src]);return /*#__PURE__*/_jsx(\"div\",{style:{...props.style,position:\"relative\",width:\"100%\",height:original?\"auto\":\"100%\",overflow:\"hidden\",pointerEvents:\"none\"},children:src?/*#__PURE__*/_jsx(\"video\",{ref:videoRef,src:src,muted:true,loop:true,autoPlay:true,playsInline:true,preload:\"auto\",\"aria-hidden\":\"true\",style:original?{// Full width, height from the video's own proportions\nposition:\"relative\",width:\"100%\",height:\"auto\",display:\"block\"}:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:fit,display:\"block\"}},src):null});}addPropertyControls(LoopVideo,{file:{type:ControlType.File,title:\"Video File\",allowedFileTypes:[\"mp4\",\"webm\",\"mov\"]},url:{type:ControlType.String,title:\"Video URL\",placeholder:\"https://…/video.mp4\",defaultValue:\"\"},size:{type:ControlType.Enum,title:\"Size\",options:[\"fill\",\"original\"],optionTitles:[\"Fill\",\"Original\"],defaultValue:\"fill\",displaySegmentedControl:true,description:\"Original: full width, height follows the video's own shape.\"},fit:{type:ControlType.Enum,title:\"Fit\",options:[\"cover\",\"contain\"],optionTitles:[\"Fill\",\"Fit\"],defaultValue:\"cover\",displaySegmentedControl:true,hidden:p=>p.size===\"original\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LoopVideo\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"400\",\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\",\"framerIntrinsicWidth\":\"600\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LoopVideo.map"],"mappings":"A,iLAmBG,SAAwBU,EAAU,EAAM,CAAC,GAAK,CAAC,OAAK,MAAI,MAAI,QAAQ,OAAK,QAAQC,EAAYC,EAAIC,GAAMC,EAAUC,EAASC,IAAO,WAAiBC,EAASjB,EAAO,IAAI,EAC3B,OAA9II,MAAc,CAAC,IAAMc,EAAED,EAAS,QAAQ,GAAG,CAACC,EAAE,OAAO,EAAE,MAAM,GAAK,IAAMC,EAAED,EAAE,KAAK,EAAKC,GAAG,OAAOA,EAAE,OAAQ,YAAWA,EAAE,UAAU,CAAC,CAAC,CAAE,EAAE,CAACP,CAAG,CAAC,EAAsB,gBAAK,MAAM,CAAC,MAAM,CAAC,GAAGD,EA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