{"version":3,"file":"VideoEmbed.CpuYwRZ2.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/GbZISGqreSsAaWO0WDVx/krFqJedPrJ5Bae98QrNJ/VideoEmbed.js"],"sourcesContent":["// VideoEmbed — self-hosted video block for Alex Sinn (Cloudinary/R2/Bunny mp4 URLs)\n// Click-to-play with poster, native controls + sound, zero cookies, zero third parties.\n// preload=\"none\": nothing loads until the visitor hits play.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useRef,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight 338\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function VideoEmbed(props){const{url=\"\",videoFile,poster,ratio=\"16:9\",customRatio=0,radius=12,accent=\"#F2EEE6\",label=\"\",autoplayBackground=false,style}=props;const[playing,setPlaying]=useState(false);const[w,h]=ratio.split(\":\").map(Number);const pad=customRatio&&customRatio>0?1/customRatio*100:h/w*100;// perf: pause playback while scrolled out of view; autoplay tiles resume on return\nconst wrapRef=useRef(null);const videoRef=useRef(null);useEffect(()=>{const el=wrapRef.current;if(!el||typeof IntersectionObserver===\"undefined\")return;const obs=new IntersectionObserver(entries=>{const v=videoRef.current;if(!v)return;if(!entries[0]?.isIntersecting)v.pause();else if(autoplayBackground)v.play().catch(()=>{});},{threshold:.05});obs.observe(el);return()=>obs.disconnect();},[autoplayBackground]);const src=url.trim()||videoFile||\"\";const hasUrl=!!src;const show=autoplayBackground||playing;return /*#__PURE__*/_jsx(\"div\",{ref:wrapRef,style:{position:\"relative\",width:\"100%\",paddingBottom:`${pad}%`,borderRadius:radius,overflow:\"hidden\",background:\"#181410\",...style},children:!hasUrl?/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",color:\"#fff\",fontFamily:\"'Switzer', sans-serif\",fontSize:13,opacity:.6},children:\"mp4-URL einf\\xfcgen (Cloudinary / R2 / Bunny)\"}):show?/*#__PURE__*/_jsx(\"video\",{ref:videoRef,src:src,poster:poster?.src,controls:!autoplayBackground,autoPlay:true,muted:autoplayBackground,loop:autoplayBackground,playsInline:true,preload:autoplayBackground?\"metadata\":\"auto\",style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\",border:\"none\",background:\"#181410\"}}):/*#__PURE__*/_jsxs(\"button\",{onClick:()=>setPlaying(true),style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",padding:0,border:\"none\",cursor:\"pointer\",background:poster?.src?`center/cover no-repeat url(${poster.src})`:\"#181410\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",WebkitTapHighlightColor:\"transparent\"},\"aria-label\":\"Play video\",children:[/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,background:\"linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.35) 100%)\"}}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:68,height:68,borderRadius:\"50%\",background:\"rgba(255,255,255,0.16)\",backdropFilter:\"blur(8px)\",border:\"1px solid rgba(255,255,255,0.4)\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",transition:\"transform 0.25s ease\"},onMouseEnter:e=>{e.currentTarget.style.transform=\"scale(1.08)\";},onMouseLeave:e=>{e.currentTarget.style.transform=\"scale(1)\";},children:/*#__PURE__*/_jsx(\"div\",{style:{width:0,height:0,borderTop:\"11px solid transparent\",borderBottom:\"11px solid transparent\",borderLeft:`18px solid ${accent}`,marginLeft:4}})}),label?/*#__PURE__*/_jsx(\"span\",{style:{position:\"absolute\",left:16,bottom:14,color:\"#fff\",fontFamily:\"'Switzer', sans-serif\",fontSize:13,fontWeight:600,letterSpacing:\"0.01em\",textShadow:\"0 1px 4px rgba(0,0,0,0.4)\"},children:label}):null]})});}addPropertyControls(VideoEmbed,{url:{type:ControlType.String,title:\"Video URL\",defaultValue:\"\",placeholder:\"https://…/reel.mp4\"},videoFile:{type:ControlType.File,title:\"Video File\",allowedFileTypes:[\"mp4\",\"webm\",\"mov\"]},poster:{type:ControlType.ResponsiveImage,title:\"Poster\"},ratio:{type:ControlType.Enum,title:\"Ratio\",options:[\"16:9\",\"9:16\",\"1:1\",\"4:5\",\"21:9\"],optionTitles:[\"16:9\",\"9:16 (Reel)\",\"1:1\",\"4:5\",\"21:9\"],defaultValue:\"16:9\"},customRatio:{type:ControlType.Number,title:\"Custom Ratio\",defaultValue:0,min:0,max:4,step:.001,displayStepper:false,description:\"Breite \\xf7 H\\xf6he. 0 = aus (Enum-Ratio gilt).\"},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:12,min:0,max:40,unit:\"px\"},accent:{type:ControlType.Color,title:\"Accent\",defaultValue:\"#F2EEE6\"},label:{type:ControlType.String,title:\"Label\"},autoplayBackground:{type:ControlType.Boolean,title:\"Autoplay (muted)\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VideoEmbed\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"600\",\"framerIntrinsicHeight\":\"338\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VideoEmbed.map"],"mappings":"+LAQG,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,MAAI,GAAG,YAAU,SAAO,QAAM,OAAO,cAAY,EAAE,SAAO,GAAG,SAAO,UAAU,QAAM,GAAG,qBAAmB,GAAM,SAAO,EAAW,CAAC,EAAQ,GAAYA,EAAS,EAAK,EAAO,CAAC,EAAE,GAAG,EAAM,MAAM,GAAG,CAAC,CAAC,IAAI,MAAM,EAAQ,EAAI,GAAa,EAAY,E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