{"version":3,"file":"VideoModule.BM5CAYAE.mjs","names":["useState","useRef","_Fragment","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","window","te","l","_e","p","init_jsx_runtime","ce","de","addPropertyControls","init_framer_CaDWdxiz","ControlType","VideoModule","props","isPlaying","setIsPlaying","showCover","setShowCover","videoRef","iframeRef","isMobile","setIsMobile","checkMobile","getEmbedUrl","videoSource","youtubeUrl","videoId","extractYouTubeId","vimeoUrl","extractVimeoId","bunnyUrl","ids","extractBunnyIds","params","match","url","handlePlay","video","handleEnded","embedUrl","uploadedVideo","coverImage","playButtonSize","playButtonColor","playButtonIconColor","showBurst","burstSize","burstColor","burstTextColor","burstFont","burstText","init_VideoModule"],"sources":["https:/framerusercontent.com/modules/Ik0V8VJkIyybgVTJC0IP/2IY8fKC1P6GEURLAXXpC/VideoModule.js"],"sourcesContent":["// Video module with custom play button, \"See how it works\" burst element, and custom cover image\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,useRef,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Video Module\n *\n * @framerIntrinsicWidth 800\n * @framerIntrinsicHeight 450\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function VideoModule(props){const{videoSource=\"upload\",uploadedVideo=\"https://framerusercontent.com/assets/MLWPbW1dUQawJLhhun3dBwpgJak.mp4\",youtubeUrl=\"\",vimeoUrl=\"\",bunnyUrl=\"\",coverImage={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Video cover\"},showBurst=true,burstText=\"See how\\nit works\",burstColor=\"#5B5FED\",burstTextColor=\"#FFFFFF\",playButtonColor=\"#FFFFFF\",playButtonIconColor=\"#5B5FED\",playButtonSize=100,burstSize=160,burstFont}=props;const[isPlaying,setIsPlaying]=useState(false);const[showCover,setShowCover]=useState(true);const videoRef=useRef(null);const iframeRef=useRef(null);const[isMobile,setIsMobile]=useState(false);useEffect(()=>{if(typeof window!==\"undefined\"){const checkMobile=()=>{startTransition(()=>setIsMobile(window.innerWidth<768));};checkMobile();window.addEventListener(\"resize\",checkMobile);return()=>window.removeEventListener(\"resize\",checkMobile);}},[]);const getEmbedUrl=()=>{if(videoSource===\"youtube\"&&youtubeUrl){const videoId=extractYouTubeId(youtubeUrl);return videoId?`https://www.youtube.com/embed/${videoId}?autoplay=1&rel=0&modestbranding=1&showinfo=0`:\"\";}if(videoSource===\"vimeo\"&&vimeoUrl){const videoId=extractVimeoId(vimeoUrl);return videoId?`https://player.vimeo.com/video/${videoId}?autoplay=1&byline=0&portrait=0`:\"\";}if(videoSource===\"bunny\"&&bunnyUrl){const ids=extractBunnyIds(bunnyUrl);if(!ids)return\"\";// Suppress the native Bunny player chrome (controls=false) so the\n// component's own cover + play button stays the only UI.\nconst params=[\"autoplay=true\",\"preload=true\",\"responsive=true\",\"loop=false\",\"muted=false\",\"controls=false\"].join(\"&\");return`https://iframe.mediadelivery.net/embed/${ids.libraryId}/${ids.videoId}?${params}`;}return\"\";};const extractYouTubeId=url=>{const regExp=/^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|&v=)([^#&?]*).*/;const match=url.match(regExp);return match&&match[2].length===11?match[2]:null;};const extractVimeoId=url=>{const regExp=/vimeo\\.com\\/(\\d+)/;const match=url.match(regExp);return match?match[1]:null;};// Accepts bunny.net play, embed, or direct iframe URLs, e.g.\n//   https://player.mediadelivery.net/play/678884/87856a59-bc7d-4681-9541-d3b7d7893b2b\n//   https://iframe.mediadelivery.net/embed/678884/87856a59-bc7d-4681-9541-d3b7d7893b2b\n// and returns the numeric library id + video GUID.\nconst extractBunnyIds=url=>{const regExp=/mediadelivery\\.net\\/(?:play|embed)\\/(\\d+)\\/([a-f0-9-]{36})/i;const match=url.match(regExp);return match?{libraryId:match[1],videoId:match[2]}:null;};const handlePlay=()=>{startTransition(()=>{setIsPlaying(true);setShowCover(false);});if(videoSource===\"upload\"&&videoRef.current){videoRef.current.play();}};useEffect(()=>{if(videoSource===\"upload\"&&videoRef.current){const video=videoRef.current;const handleEnded=()=>{startTransition(()=>{setIsPlaying(false);setShowCover(true);});};video.addEventListener(\"ended\",handleEnded);return()=>video.removeEventListener(\"ended\",handleEnded);}},[videoSource]);const embedUrl=getEmbedUrl();return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",borderRadius:16,backgroundColor:\"#000\"},children:[videoSource===\"upload\"?/*#__PURE__*/_jsx(\"video\",{ref:videoRef,src:uploadedVideo,style:{width:\"100%\",height:\"100%\",objectFit:\"contain\"},controls:isPlaying}):embedUrl&&/*#__PURE__*/_jsx(\"iframe\",{ref:iframeRef,src:isPlaying?embedUrl:\"\",style:{width:\"100%\",height:\"100%\",border:\"none\",display:isPlaying?\"block\":\"none\"},allow:\"autoplay; fullscreen; picture-in-picture\",allowFullScreen:true,title:\"Video player\"}),showCover&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",backgroundImage:`url(${coverImage.src})`,backgroundSize:\"cover\",backgroundPosition:\"center\"},role:\"img\",\"aria-label\":coverImage.alt}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:/*#__PURE__*/_jsx(\"button\",{onClick:handlePlay,style:{width:playButtonSize,height:playButtonSize,borderRadius:\"50%\",backgroundColor:playButtonColor,border:\"none\",cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",boxShadow:\"0 8px 24px rgba(0, 0, 0, 0.3)\",transition:\"transform 0.2s ease\",zIndex:2},onMouseEnter:e=>{e.currentTarget.style.transform=\"scale(1.1)\";},onMouseLeave:e=>{e.currentTarget.style.transform=\"scale(1)\";},\"aria-label\":\"Play video\",children:/*#__PURE__*/_jsx(\"svg\",{width:playButtonSize*.4,height:playButtonSize*.4,viewBox:\"0 0 24 24\",fill:playButtonIconColor,children:/*#__PURE__*/_jsx(\"path\",{d:\"M8 5v14l11-7z\"})})})}),showBurst&&/*#__PURE__*/_jsxs(\"div\",{style:{position:\"absolute\",bottom:isMobile?20:40,left:isMobile?20:40,width:isMobile?burstSize*.5:burstSize,height:isMobile?burstSize*.5:burstSize,borderRadius:\"50%\",backgroundColor:burstColor,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",boxShadow:\"0 4px 16px rgba(0, 0, 0, 0.2)\",zIndex:3,animation:\"pulse 2s ease-in-out infinite\"},children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                                    @keyframes pulse {\n                                        0%, 100% {\n                                            transform: scale(1);\n                                        }\n                                        50% {\n                                            transform: scale(1.05);\n                                        }\n                                    }\n                                    @media (max-width: 768px) {\n                                        .burst-text {\n                                            font-size: 9px !important;\n                                        }\n                                    }\n                                `}),/*#__PURE__*/_jsx(\"span\",{className:\"burst-text\",style:{color:burstTextColor,textAlign:\"center\",whiteSpace:\"pre-line\",...burstFont},children:burstText})]})]})]});}addPropertyControls(VideoModule,{videoSource:{type:ControlType.Enum,title:\"Video Source\",options:[\"upload\",\"youtube\",\"vimeo\",\"bunny\"],optionTitles:[\"Upload\",\"YouTube\",\"Vimeo\",\"Bunny\"],defaultValue:\"upload\",displaySegmentedControl:true},uploadedVideo:{type:ControlType.File,title:\"Video File\",allowedFileTypes:[\"mp4\",\"webm\",\"mov\"],hidden:({videoSource})=>videoSource!==\"upload\"},youtubeUrl:{type:ControlType.String,title:\"YouTube URL\",placeholder:\"https://www.youtube.com/watch?v=...\",hidden:({videoSource})=>videoSource!==\"youtube\"},vimeoUrl:{type:ControlType.String,title:\"Vimeo URL\",placeholder:\"https://vimeo.com/...\",hidden:({videoSource})=>videoSource!==\"vimeo\"},bunnyUrl:{type:ControlType.String,title:\"Bunny URL\",placeholder:\"https://player.mediadelivery.net/play/...\",hidden:({videoSource})=>videoSource!==\"bunny\"},coverImage:{type:ControlType.ResponsiveImage,title:\"Cover Image\"},showBurst:{type:ControlType.Boolean,title:\"Show Burst\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},burstText:{type:ControlType.String,title:\"Burst Text\",defaultValue:\"See how\\nit works\",displayTextArea:true,hidden:({showBurst})=>!showBurst},burstColor:{type:ControlType.Color,title:\"Burst Color\",defaultValue:\"#5B5FED\",hidden:({showBurst})=>!showBurst},burstTextColor:{type:ControlType.Color,title:\"Burst Text Color\",defaultValue:\"#FFFFFF\",hidden:({showBurst})=>!showBurst},burstSize:{type:ControlType.Number,title:\"Burst Size\",defaultValue:160,min:80,max:200,step:10,unit:\"px\",hidden:({showBurst})=>!showBurst},burstFont:{type:ControlType.Font,title:\"Burst Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"},hidden:({showBurst})=>!showBurst},playButtonColor:{type:ControlType.Color,title:\"Play Button Color\",defaultValue:\"#FFFFFF\"},playButtonIconColor:{type:ControlType.Color,title:\"Play Icon Color\",defaultValue:\"#5B5FED\"},playButtonSize:{type:ControlType.Number,title:\"Play Button Size\",defaultValue:120,min:40,max:160,step:10,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VideoModule\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"any\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"800\",\"framerIntrinsicHeight\":\"450\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VideoModule.map"],"mappings":"A,2NASG,SAAwBiB,EAAY,EAAM,CAAC,GAAK,CAAC,cAAY,SAAS,gBAAc,uEAAuE,aAAW,GAAG,WAAS,GAAG,WAAS,GAAG,aAAW,CAAC,IA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