{"version":3,"file":"VideoWindow.Do5WhPSN.mjs","names":["useRef","useState","_Fragment","__esmMin","init_ssg_sandbox_shims","navigator","window","l","_e","p","c","init_jsx_runtime","ce","init_npm_react_18_3_1","de","addPropertyControls","useIsStaticRenderer","ControlType","init_framer_D6uXRwWs","resized","m","url","size","posterSet","VideoWindow","props","isStatic","root","bg","full","inView","setInView","near","setNear","phone","setPhone","quiet","setQuiet","mode","setMode","tabVisible","setTabVisible","paused","setPaused","small","reduce","connection","update","onVis","host","io","entries","approach","v","openFull","closeFull","t","cover","src","backgroundMobile","backgroundDesktop","posterSmall","poster","style","INK","WHITE","title","subtitle","showLabel","fullVideo","init_VideoWindow"],"sources":["https:/framerusercontent.com/modules/D6ZhQC5h6GzxIUoYP3Vq/Ft4QyzhvMdi3jrHj63AF/VideoWindow.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useEffect,useRef,useState}from\"react\";const INK=\"var(--token-0366698a-eff1-4042-a42e-ff844100c20c, #111111)\";const WHITE=\"var(--token-1365406e-eeb0-4e05-85c2-d7c170858357, #ffffff)\";// Posters picked with a File control arrive as full-size /assets/ URLs; the same file under /images/ can be resized by the CDN.\nfunction resized(url,size){const m=url.match(/^https:\\/\\/framerusercontent\\.com\\/(?:assets|images)\\/([A-Za-z0-9]+\\.(?:jpe?g|png|webp))/i);return m?`https://framerusercontent.com/images/${m[1]}?scale-down-to=${size}`:url;}function posterSet(url){if(!/^https:\\/\\/framerusercontent\\.com\\/(?:assets|images)\\//.test(url))return undefined;return`${resized(url,512)} 512w, ${resized(url,1024)} 1024w, ${resized(url,2048)} 2048w`;}/**\n * Video window: a silent background loop that plays only while the window is on screen,\n * and a Play button that plays the full video with sound inside the same window.\n * Size it with the parent frame (16:9). No pop-up, no YouTube.\n *\n * @framerIntrinsicWidth 560\n * @framerIntrinsicHeight 315\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function VideoWindow(props){const{backgroundDesktop=\"https://framerusercontent.com/assets/fhm7j60SASjyb7Gx8D3r07hrDQ0.mp4\",backgroundMobile=\"https://framerusercontent.com/assets/xhjVyXGx0S5eFTE6yBDuPMk5EI.mp4\",fullVideo=\"https://framerusercontent.com/assets/bO8K9QlPuj9LRucvsrGK4PBMOo.mp4\",poster=\"https://framerusercontent.com/assets/9tDnzGjT0pBINKLmfiP3mlxNYK0.jpg\",title=\"Marian Vist\",subtitle=\"Founder and Principal Designer\",showLabel=true,style}=props;const isStatic=useIsStaticRenderer();const root=useRef(null);const bg=useRef(null);const full=useRef(null);const[inView,setInView]=useState(false);const[near,setNear]=useState(false);const[phone,setPhone]=useState(false);const[quiet,setQuiet]=useState(false);const[mode,setMode]=useState(\"preview\");const[tabVisible,setTabVisible]=useState(true);const[paused,setPaused]=useState(false);useEffect(()=>{if(isStatic||typeof window===\"undefined\")return;const small=window.matchMedia(\"(max-width: 809px)\");const reduce=window.matchMedia(\"(prefers-reduced-motion: reduce)\");const connection=navigator.connection;const update=()=>{setPhone(small.matches);setQuiet(reduce.matches||!!connection?.saveData);};update();small.addEventListener(\"change\",update);reduce.addEventListener(\"change\",update);const onVis=()=>setTabVisible(document.visibilityState===\"visible\");onVis();document.addEventListener(\"visibilitychange\",onVis);const host=root.current;const io=new IntersectionObserver(entries=>setInView(entries.some(e=>e.isIntersecting)),{threshold:.25});if(host)io.observe(host);// The loop is attached only once the window gets close, so it does not download with the page.\nconst approach=new IntersectionObserver(entries=>{if(!entries.some(e=>e.isIntersecting))return;setNear(true);approach.disconnect();},{rootMargin:\"400px 0px\"});if(host)approach.observe(host);return()=>{io.disconnect();approach.disconnect();document.removeEventListener(\"visibilitychange\",onVis);small.removeEventListener(\"change\",update);reduce.removeEventListener(\"change\",update);};},[isStatic]);// Silent loop: plays only while the window is visible; paused otherwise.\nuseEffect(()=>{const v=bg.current;if(!v||mode!==\"preview\")return;if(inView&&tabVisible&&!quiet)void v.play().catch(()=>{});else v.pause();},[inView,tabVisible,quiet,mode,phone]);// Full video: pause when the visitor scrolls away.\nuseEffect(()=>{const v=full.current;if(v&&mode===\"full\"&&(!inView||!tabVisible))v.pause();},[inView,tabVisible,mode]);const openFull=()=>{bg.current?.pause();setMode(\"full\");};const closeFull=()=>{full.current?.pause();setMode(\"preview\");};// Paused for more than a minute (by the visitor, by scrolling away or by leaving the tab):\n// close the full video; the silent loop takes over again the next time the window is on screen.\nuseEffect(()=>{if(mode!==\"full\"||!paused)return;const t=window.setTimeout(()=>{full.current?.pause();setPaused(false);setMode(\"preview\");},6e4);return()=>window.clearTimeout(t);},[mode,paused]);useEffect(()=>{if(mode!==\"full\")return;const v=full.current;if(!v)return;v.currentTime=0;void v.play().catch(()=>{});},[mode]);const cover={position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\",display:\"block\"};const src=phone?backgroundMobile||backgroundDesktop:backgroundDesktop;const posterSmall=poster?resized(poster,phone?1024:2048):undefined;return /*#__PURE__*/_jsxs(\"div\",{ref:root,className:\"v2-video-window\",style:{...style,position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",background:INK},children:[/*#__PURE__*/_jsx(\"style\",{children:`\n.v2-video-window .vw-round{transition:transform .5s cubic-bezier(.16,1,.3,1),background-color .5s cubic-bezier(.16,1,.3,1),border-color .5s cubic-bezier(.16,1,.3,1)}\n.v2-video-window:hover .vw-play{transform:translate(-50%,-50%) scale(1.06)}\n.v2-video-window .vw-round:hover{background:rgba(17,17,17,.72)!important;border-color:rgba(255,255,255,.9)!important}\n.v2-video-window button:focus-visible{outline:2px solid ${WHITE};outline-offset:3px}\n@media (prefers-reduced-motion: reduce){.v2-video-window *{transition:none!important}}\n`}),mode===\"preview\"&&/*#__PURE__*/_jsxs(_Fragment,{children:[poster&&/*#__PURE__*/_jsx(\"img\",{src:resized(poster,1024),srcSet:posterSet(poster),sizes:\"(max-width: 809px) 100vw, 60vw\",alt:`${title}, ${subtitle}`,loading:\"lazy\",decoding:\"async\",style:cover}),!isStatic&&!quiet&&near&&/*#__PURE__*/_jsx(\"video\",{ref:bg,src:src,muted:true,loop:true,playsInline:true,preload:\"metadata\",\"aria-hidden\":\"true\",style:cover},src),showLabel&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":\"true\",style:{position:\"absolute\",inset:0,background:\"linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,0.6) 100%)\",pointerEvents:\"none\"}}),/*#__PURE__*/_jsxs(\"div\",{style:{position:\"absolute\",left:phone?14:20,bottom:phone?12:18,right:90,color:WHITE,pointerEvents:\"none\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{fontFamily:'\"Cinzel\", serif',fontSize:phone?15:18,lineHeight:1.2},children:title}),/*#__PURE__*/_jsx(\"div\",{style:{fontFamily:'\"Inter Tight\", sans-serif',fontSize:phone?11:13,lineHeight:1.3,opacity:.85,marginTop:2},children:subtitle})]})]}),/*#__PURE__*/_jsx(\"button\",{type:\"button\",className:\"vw-play vw-round\",onClick:openFull,\"aria-label\":`Play video: ${title}`,style:{position:\"absolute\",left:\"50%\",top:\"50%\",transform:\"translate(-50%,-50%)\",width:phone?52:64,height:phone?52:64,border:\"1px solid rgba(255,255,255,.4)\",borderRadius:\"50%\",background:\"rgba(50,50,50,.47)\",backdropFilter:\"blur(6px)\",display:\"grid\",placeItems:\"center\",cursor:\"pointer\",padding:0},children:/*#__PURE__*/_jsx(\"svg\",{width:phone?16:20,height:phone?16:20,viewBox:\"0 0 24 24\",\"aria-hidden\":\"true\",style:{marginLeft:3},children:/*#__PURE__*/_jsx(\"path\",{d:\"M7 4l14 8-14 8z\",fill:\"rgba(255,255,255,.96)\"})})})]}),mode===\"full\"&&!isStatic&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"video\",{ref:full,src:fullVideo,poster:posterSmall,controls:true,playsInline:true,preload:\"auto\",onEnded:closeFull,onPause:()=>setPaused(true),onPlay:()=>setPaused(false),\"aria-label\":`${title}: ${subtitle}`,style:{...cover,objectFit:\"contain\",background:INK}}),/*#__PURE__*/_jsx(\"button\",{type:\"button\",className:\"vw-round\",onClick:closeFull,\"aria-label\":\"Close video\",style:{position:\"absolute\",right:10,top:10,width:40,height:40,border:\"1px solid rgba(255,255,255,.4)\",borderRadius:\"50%\",background:\"rgba(50,50,50,.47)\",backdropFilter:\"blur(6px)\",color:\"#fff\",display:\"grid\",placeItems:\"center\",cursor:\"pointer\",padding:0,fontSize:20,lineHeight:1},children:\"\\xd7\"})]})]});}addPropertyControls(VideoWindow,{backgroundDesktop:{type:ControlType.File,title:\"Loop (desktop)\",allowedFileTypes:[\"mp4\",\"webm\"]},backgroundMobile:{type:ControlType.File,title:\"Loop (phone)\",allowedFileTypes:[\"mp4\",\"webm\"]},fullVideo:{type:ControlType.File,title:\"Full video\",allowedFileTypes:[\"mp4\",\"webm\"]},poster:{type:ControlType.File,title:\"Poster\",allowedFileTypes:[\"jpg\",\"jpeg\",\"png\",\"webp\"]},title:{type:ControlType.String,title:\"Title\",defaultValue:\"Marian Vist\"},subtitle:{type:ControlType.String,title:\"Subtitle\",defaultValue:\"Founder and Principal Designer\"},showLabel:{type:ControlType.Boolean,title:\"Label\",defaultValue:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VideoWindow\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"560\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"315\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VideoWindow.map"],"mappings":"A,mOACA,SAASmB,EAAQ,EAAI,EAAK,CAAC,IAAMC,EAAEC,EAAI,MAAM,2FAA2F,EAAE,OAAOD,EA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