{"version":3,"file":"VideoOverlay.D0elFbqd.mjs","names":["useRef","useState","React.useState","React.useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/jfK7C7JmdHGaVBsvt1V7/G0lF2a2mezep3QZSQZwm/DotLottie.js","https:/framerusercontent.com/modules/OKnYAR9CzSCjvlUnaS37/tA77sa5sreEXxFmXXcF4/VideoOverlay.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useEffect,useRef,useState}from\"react\";const placeholderUrl=\"https://lottie.host/d826e0a7-b7e8-4072-8afe-c943ed2dd2ca/DpX3m5yT5Z.lottie\";/**\n * DOT LOTTIE\n *\n * @framerIntrinsicWidth 200\n * @framerIntrinsicHeight 200\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */ export default function DotLottie(props){return /*#__PURE__*/ _jsx(OptimizationFriendly,{loading:/*#__PURE__*/ _jsx(\"div\",{}),loaded:/*#__PURE__*/ _jsx(LottiePlayer,{...props})});};function LottiePlayer(props){/* Checks */ const isCanvas=RenderTarget.current()===RenderTarget.canvas;const lottieInstanceRef=useRef(null);const shouldPlay=isCanvas||props.hover===true||props.autoplay===false?null:true;/* File or URL */ let src;switch(props.srcType){case\"url\":src=props.srcUrl;break;case\"file\":src=props.srcFile;break;default:src=placeholderUrl;break;}/* Progress */ const[isReady,setIsReady]=useState(false);/* For canvas states */ useEffect(()=>{if(!lottieInstanceRef.current)return;lottieInstanceRef.current.addEventListener(\"ready\",()=>setIsReady(true));},[]);useEffect(()=>{if(!lottieInstanceRef.current)return;lottieInstanceRef.current.seek(`${props.progress}%`);},[isReady,props.progress]);const lastVariant=useRef();/* For component variant support */ useEffect(()=>{if(isCanvas)return;if(lastVariant.current!==props.autoplay){if(!lottieInstanceRef.current)return;if(props.autoplay===true){lottieInstanceRef.current.play();}if(props.autoplay===false){lottieInstanceRef.current.pause();}}lastVariant.current=props.autoplay;},[props.autoplay]);return(// @ts-ignore\n/*#__PURE__*/ _jsx(\"dotlottie-player\",{src:src,ref:lottieInstanceRef,autoplay:shouldPlay,loop:props.loop?true:null,hover:props.hover?true:null,controls:props.controls?true:null,background:props.background?props.background:null,speed:props.speed,direction:props.direction,style:{...props.style,width:\"100%\",height:\"100%\"}},src));}DotLottie.defaultProps={srcUrl:placeholderUrl,autoplay:true,background:\"#05F\",controls:false,direction:1,hover:false,loop:true,speed:1};DotLottie.displayName=\"Dot Lottie\";addPropertyControls(DotLottie,{srcType:{type:ControlType.Enum,displaySegmentedControl:true,title:\"Source\",options:[\"url\",\"file\"],optionTitles:[\"URL\",\"File\"]},srcUrl:{type:ControlType.String,title:\"Link\",placeholder:\"../example.lottie\",hidden:props=>props.srcType===\"file\"},srcFile:{type:ControlType.File,title:\"File\",allowedFileTypes:[\"lottie\",\"json\"],hidden:props=>props.srcType===\"url\"},autoplay:{type:ControlType.Boolean,title:\"Autoplay\",defaultValue:true},background:{type:ControlType.Color,title:\"Backdrop\",defaultValue:\"#05F\"},controls:{type:ControlType.Boolean,title:\"Controls\"},direction:{type:ControlType.Enum,title:\"Direction\",defaultValue:\"1\",displaySegmentedControl:true,segmentedControlDirection:\"horizontal\",options:[\"1\",\"-1\"],optionTitles:[\"Normal\",\"Reverse\"]},hover:{type:ControlType.Boolean,title:\"Hover Play\"},loop:{type:ControlType.Boolean,title:\"Loop\"},speed:{type:ControlType.Number,title:\"Speed\",defaultValue:1,min:1,max:10,unit:\"x\",step:.5,displayStepper:true},progress:{type:ControlType.Number,title:\"Progress\",defaultValue:0,min:0,max:100,step:1,description:\"This component is made for Lottie files. [Learn more here](https://dotlottie.io/).\"}});/* For SSG */ function OptimizationFriendly({loading,loaded}){const[isLoading,setLoading]=React.useState(true);// We can't load web-components in ssg on the server,\n// so we defer rendering until we hit the client.\nReact.useEffect(()=>{import(\"https://unpkg.com/@dotlottie/player-component@1.3.2/dist/dotlottie-player.js\").then(()=>{setLoading(false);});},[]);return isLoading?loading:loaded;}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"DotLottie\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"200\",\"framerIntrinsicHeight\":\"200\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerDisableUnlink\":\"*\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DotLottie.map","import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import*as React from\"react\";import{createPortal}from\"react-dom\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function VideoOverlay(props){const{videoUrl,effect,overlay,closeIcon,closeButtonTop,closeButtonRight}=props;const[isOpen,setIsOpen]=React.useState(false);// Function to check if the URL is YouTube/Vimeo and format accordingly\nconst getEmbedUrl=url=>{const youtubeMatch=url.match(/(?:youtube\\.com\\/(?:watch\\?v=|embed\\/|v\\/)|youtu\\.be\\/)([^?&/]+)/);const vimeoMatch=url.match(/(?:vimeo\\.com\\/|player\\.vimeo\\.com\\/video\\/)(\\d+)/);if(youtubeMatch){return`https://www.youtube.com/embed/${youtubeMatch[1]}?autoplay=1&controls=1`;}else if(vimeoMatch){return`https://player.vimeo.com/video/${vimeoMatch[1]}?autoplay=1&controls=1`;}return url;};// Simplified overlay click handler to debug the issue\nconst handleOverlayClick=e=>{e.stopPropagation();setIsOpen(false);};const handleCloseClick=e=>{e.stopPropagation();setIsOpen(false);};// Prevent clicks on the video container from closing the overlay\nconst handleVideoContainerClick=e=>{console.log(\"Video container clicked\");e.stopPropagation();};return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:`\n        .close-button {\n            position: absolute;\n            top: -48px;\n            right: 0;\n            background: none;\n            cursor: pointer;\n            width: 40px;\n            height: 40px;\n            border: 1px solid #767676;\n            border-radius: 50px;\n            display: flex;\n            justify-content: center;\n            align-items: center;\n        }\n\n        .close-svg {\n            width: 10px;\n        }\n\n        @media (min-width: 768px) {\n            .close-button {\n                top: -56px;\n                width: 48px;\n                height: 48px;\n            }\n\n            .close-svg {\n                width: 15px;\n            }\n        }\n        `}),/*#__PURE__*/_jsx(\"button\",{style:{width:\"100%\",height:\"100%\",cursor:\"pointer\",background:\"transparent\",border:\"none\",padding:0,outline:\"none\"},onClick:()=>setIsOpen(true),children:isOpen&&/*#__PURE__*/createPortal(/*#__PURE__*/_jsx(\"div\",{style:{...styles.overlay,animation:effectStyles[effect]||\"none\"},onClick:handleOverlayClick,children:/*#__PURE__*/_jsxs(\"div\",{style:styles.videoContainer,children:[/*#__PURE__*/_jsx(\"button\",{className:\"close-button\",onClick:handleCloseClick,children:/*#__PURE__*/_jsxs(\"svg\",{height:\"14\",viewBox:\"0 0 15 14\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",className:\"close-svg\",children:[/*#__PURE__*/_jsx(\"path\",{d:\"M14.1475 0.868164L8.04688 6.99805L14.1475 13.127L13.3271 13.9443L7.17578 7.81543L1.02344 13.9443L0.203125 13.127L6.35547 6.99805L0.203125 0.868164L1.02344 0L7.17578 6.12988L13.3271 0L14.1475 0.868164Z\",fill:\"white\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M14.1475 0.868164L8.04688 6.99805L14.1475 13.127L13.3271 13.9443L7.17578 7.81543L1.02344 13.9443L0.203125 13.127L6.35547 6.99805L0.203125 0.868164L1.02344 0L7.17578 6.12988L13.3271 0L14.1475 0.868164Z\",stroke:\"white\"})]})}),/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",position:\"relative\"},onClick:handleVideoContainerClick,children:videoUrl.includes(\"youtube.com\")||videoUrl.includes(\"youtu.be\")||videoUrl.includes(\"vimeo.com\")?/*#__PURE__*/_jsx(\"iframe\",{src:getEmbedUrl(videoUrl),style:styles.iframe,allow:\"autoplay; fullscreen\",allowFullScreen:true}):/*#__PURE__*/_jsx(\"video\",{src:videoUrl,controls:true,autoPlay:true,style:styles.video})})]})}),document.body)})]});}// Styles\nconst styles={overlay:{position:\"fixed\",top:0,left:0,width:\"100vw\",height:\"100vh\",backgroundColor:\"rgba(0, 0, 0, 0.8)\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",zIndex:1e3},videoContainer:{position:\"relative\",width:\"80%\",maxWidth:\"800px\"},video:{width:\"100%\",borderRadius:\"8px\"},iframe:{width:\"100%\",height:\"450px\",borderRadius:\"8px\",border:\"none\"},closeButton:{position:\"absolute\",top:\"-56px\",right:\"0\",background:\"none\",fontSize:\"24px\",color:\"white\",cursor:\"pointer\",width:\"48px\",height:\"48px\",border:\"1px solid #767676\",borderRadius:\"50px\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\"}};// Effect Styles\nconst effectStyles={\"Fade In\":\"fadeIn 0.3s ease-in-out\",\"Slide from Top\":\"slideFromTop 0.3s ease-in-out\",\"Slide from Bottom\":\"slideFromBottom 0.3s ease-in-out\",\"Scale In\":\"scaleIn 0.3s ease-in-out\"};// Property Controls\naddPropertyControls(VideoOverlay,{videoUrl:{type:ControlType.String,title:\"Video URL\",defaultValue:\"https://www.w3schools.com/html/mov_bbb.mp4\"},effect:{type:ControlType.Enum,title:\"Effect\",options:[\"None\",\"Fade In\",\"Slide from Top\",\"Slide from Bottom\",\"Scale In\"],defaultValue:\"Fade In\"},overlay:{type:ControlType.Object,title:\"Overlay Options\",controls:{dismissOnOverlayClick:{type:ControlType.Boolean,title:\"Dismiss on Click\",defaultValue:true}}},closeIcon:{type:ControlType.String,title:\"Close Icon\",defaultValue:\"✕\"},closeButtonTop:{type:ControlType.Number,title:\"Close Btn Top\",defaultValue:20,min:0,max:200},closeButtonRight:{type:ControlType.Number,title:\"Close Btn Right\",defaultValue:20,min:0,max:200}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VideoOverlay\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VideoOverlay.map"],"mappings":"6NASI,SAAwB,EAAU,EAAM,CAAC,OAAqB,EAAK,EAAqB,CAAC,QAAsB,EAAK,MAAM,CAAC,CAAC,EAAE,OAAqB,EAAK,EAAa,CAAC,GAAG,CAAK,CAAC,CAAC,CAAC,CAAE,CAAE,SAAS,EAAa,EAAM,CAAc,IAAM,EAAS,EAAa,QAAQ,IAAI,EAAa,OAAa,EAAkBA,EAAO,IAAI,EAAQ,EAAW,GAAU,EAAM,QAAQ,IAAM,EAAM,WAAW,GAAM,KAAK,GAA2B,EAAI,OAAO,EAAM,QAAb,CAAsB,IAAI,MAAM,EAAI,EAAM,OAAO,MAAM,IAAI,OAAO,EAAI,EAAM,QAAQ,MAAM,QAAQ,EAAI,EAAe,KAAM,CAAgB,GAAK,CAAC,EAAQ,GAAYC,EAAS,EAAK,EAA0B,MAAc,CAAK,EAAkB,SAAe,EAAkB,QAAQ,iBAAiB,YAAY,EAAW,EAAI,CAAC,CAAE,EAAE,CAAC,CAAC,EAAE,MAAc,CAAK,EAAkB,SAAe,EAAkB,QAAQ,KAAK,GAAG,EAAM,SAAS,EAAE,CAAE,EAAE,CAAC,EAAQ,EAAM,QAAQ,CAAC,EAAE,IAAM,EAAYD,EAAO,EAAwU,OAAlS,MAAc,CAAI,MAAgB,IAAG,EAAY,UAAU,EAAM,SAAS,CAAC,GAAG,CAAC,EAAkB,QAAQ,OAAU,EAAM,WAAW,IAAM,EAAkB,QAAQ,KAAK,EAAM,EAAM,WAAW,IAAO,EAAkB,QAAQ,MAAM,CAAG,CAAC,EAAY,QAAQ,EAAM,QAA3B,CAAoC,EAAE,CAAC,EAAM,QAAQ,CAAC,EACptC,EAAK,mBAAmB,CAAK,M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