{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/bXGhJgHWV7t5GE2I9VQ3/g0ddhJYnxU77T3YCHsHH/CustomVideo.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect,useState,useRef}from\"react\";function CustomVideo(props){const videoRef=useRef(null);const popupRef=useRef(null);const[showPopup,setShowPopup]=useState(false);const[hasStarted,setHasStarted]=useState(false);const savedDate=localStorage.getItem(\"user_email_date\");const isEmailCollectedToday=()=>{if(!savedDate)return false;const savedDay=new Date(savedDate).toDateString();const today=new Date().toDateString();return savedDay===today;};const movePopupToFullScreen=()=>{setTimeout(()=>{if(document.fullscreenElement&&document.exitFullscreen){document.exitFullscreen();}if(videoRef.current?.webkitExitFullscreen){videoRef.current.webkitExitFullscreen();}},100);};useEffect(()=>{const video=videoRef.current;if(!video)return;const handleTimeUpdate=()=>{if(video.currentTime>=600&&!isEmailCollectedToday()){video.pause();setShowPopup(true);movePopupToFullScreen();}};video.addEventListener(\"timeupdate\",handleTimeUpdate);return()=>video.removeEventListener(\"timeupdate\",handleTimeUpdate);},[isEmailCollectedToday]);const handleFormSubmit=()=>{setTimeout(()=>{setShowPopup(false);localStorage.setItem(\"user_email_date\",new Date().toISOString());videoRef.current?.play();},1e3);};useEffect(()=>{if(showPopup){document.body.style.overflow=\"hidden\";const portalId=\"46657045\";const formId=\"1c18e026-6868-4687-805f-61770d669c9d\";const script=document.createElement(\"script\");script.src=\"https://js.hsforms.net/forms/v2.js\";script.async=true;script.onload=()=>{if(window.hbspt){window.hbspt.forms.create({region:\"na1\",portalId:portalId,formId:formId,target:\"#hubspot-form\",onFormSubmitted:()=>handleFormSubmit()});}};document.body.appendChild(script);}else{document.body.style.overflow=\"\";}return()=>{document.body.style.overflow=\"\";};},[showPopup]);const handlePlay=()=>{setHasStarted(true);setTimeout(()=>{videoRef.current?.play();},100);};return /*#__PURE__*/_jsxs(\"div\",{style:containerStyle,children:[/*#__PURE__*/_jsxs(\"div\",{style:mediaWrapperStyle,children:[!hasStarted&&props.placeholderImage&&/*#__PURE__*/_jsxs(\"div\",{style:placeholderWrapperStyle,onClick:handlePlay,children:[/*#__PURE__*/_jsx(\"img\",{src:props.placeholderImage,alt:\"Play Preview\",style:mediaElementStyle}),/*#__PURE__*/_jsx(\"div\",{style:playButtonStyle,children:\"\u25B6\"})]}),/*#__PURE__*/_jsxs(\"video\",{ref:videoRef,style:mediaElementStyle,controls:true,playsInline:true,width:\"100%\",height:\"100%\",children:[/*#__PURE__*/_jsx(\"source\",{src:props.link,type:\"video/mp4\"}),\"Your browser does not support the video tag.\"]})]}),showPopup&&/*#__PURE__*/_jsx(\"div\",{ref:popupRef,style:popupStyle,children:/*#__PURE__*/_jsxs(\"div\",{style:formContainerStyle,children:[/*#__PURE__*/_jsx(\"h3\",{children:\"Enter Your Email to Continue\"}),/*#__PURE__*/_jsx(\"div\",{id:\"hubspot-form\"})]})})]});}addPropertyControls(CustomVideo,{link:{type:ControlType.Link,title:\"Video Link\",defaultValue:\"https://www.framer.com\"},placeholderImage:{type:ControlType.Image,title:\"Placeholder Image\"}});// Styles\nconst containerStyle={width:\"100%\",display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",position:\"relative\"};const mediaWrapperStyle={width:\"100%\",aspectRatio:\"16/9\",position:\"relative\",overflow:\"hidden\",borderRadius:\"8px\",background:\"#000\"};const mediaElementStyle={width:\"100%\",height:\"100%\",objectFit:\"cover\",borderRadius:\"8px\",display:\"block\",zIndex:1};const placeholderWrapperStyle={width:\"100%\",height:\"100%\",position:\"relative\",cursor:\"pointer\",zIndex:2};const playButtonStyle={position:\"absolute\",top:\"50%\",left:\"50%\",transform:\"translate(-50%, -50%)\",background:\"rgba(0, 0, 0, 0.6)\",color:\"#fff\",borderRadius:\"50%\",padding:\"16px 20px\",fontSize:\"24px\",pointerEvents:\"none\"};const popupStyle={position:\"fixed\",top:0,left:0,width:\"100%\",height:\"100%\",background:\"#fff\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",zIndex:1e3};const formContainerStyle={textAlign:\"center\"};export default CustomVideo;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CustomVideo\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CustomVideo.map"],
  "mappings": "8JAA0J,SAASA,EAAYC,EAAM,CAAC,IAAMC,EAASC,EAAO,IAAI,EAAQC,EAASD,EAAO,IAAI,EAAO,CAACE,EAAUC,CAAY,EAAEC,EAAS,EAAK,EAAO,CAACC,EAAWC,CAAa,EAAEF,EAAS,EAAK,EAAQG,EAAU,aAAa,QAAQ,iBAAiB,EAAQC,EAAsB,IAAI,CAAC,GAAG,CAACD,EAAU,MAAO,GAAM,IAAME,EAAS,IAAI,KAAKF,CAAS,EAAE,aAAa,EAAQG,EAAM,IAAI,KAAK,EAAE,aAAa,EAAE,OAAOD,IAAWC,CAAM,EAAQC,EAAsB,IAAI,CAAC,WAAW,IAAI,CAAI,SAAS,mBAAmB,SAAS,gBAAgB,SAAS,eAAe,EAAMZ,EAAS,SAAS,sBAAsBA,EAAS,QAAQ,qBAAqB,CAAG,EAAE,GAAG,CAAE,EAAEa,EAAU,IAAI,CAAC,IAAMC,EAAMd,EAAS,QAAQ,GAAG,CAACc,EAAM,OAAO,IAAMC,EAAiB,IAAI,CAAID,EAAM,aAAa,KAAK,CAACL,EAAsB,IAAGK,EAAM,MAAM,EAAEV,EAAa,EAAI,EAAEQ,EAAsB,EAAG,EAAE,OAAAE,EAAM,iBAAiB,aAAaC,CAAgB,EAAQ,IAAID,EAAM,oBAAoB,aAAaC,CAAgB,CAAE,EAAE,CAACN,CAAqB,CAAC,EAAE,IAAMO,EAAiB,IAAI,CAAC,WAAW,IAAI,CAACZ,EAAa,EAAK,EAAE,aAAa,QAAQ,kBAAkB,IAA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", "savedDay", "today", "movePopupToFullScreen", "ue", "video", "handleTimeUpdate", "handleFormSubmit", "portalId", "formId", "script", "window", "handlePlay", "u", "containerStyle", "mediaWrapperStyle", "placeholderWrapperStyle", "p", "mediaElementStyle", "playButtonStyle", "popupStyle", "formContainerStyle", "addPropertyControls", "ControlType", "CustomVideo_default"]
}
