{"version":3,"file":"EverReadyVideoModal.CmPvqO2m.mjs","names":["useState","useCallback"],"sources":["https:/framerusercontent.com/modules/5Igsrhja0GR5dWa4BxrJ/kntSFrGsiEiopYSDY4uD/EverReadyVideoModal.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,useIsStaticRenderer}from\"framer\";import{useEffect,useState,useCallback}from\"react\";import{createPortal}from\"react-dom\";// EverReady video lightbox. Renders 0-height in flow (drop it anywhere on a page, no layout impact).\n// On the client it adds a CAPTURE-phase document click listener on any <a> that points at a video.\n// Demo videos are now hosted on Vimeo (off Framer, to save bandwidth): the mp4 URLs the buttons\n// still carry are MAPPED to their Vimeo id and the modal opens the Vimeo player iframe instead —\n// so the .mp4 is never downloaded from Framer. Links that are already vimeo.com URLs work too.\n// Any mp4 not in the map (e.g. onboarding videos not yet migrated) still plays as a raw <video> (fallback).\n// Close via the X button, a backdrop click, or the Escape key.\n// mp4 asset key (substring of the framerusercontent URL) -> Vimeo video id\nconst VIMEO={d2SA145X:\"1213593903\",wse2KkZw:\"1213593935\",f6saRYt0:\"1213986403\",\"2x4qqHjL\":\"1213593898\",S1TaisZt:\"1213593899\",Dt0ACZh8:\"1213618029\",JM14Hk0Q:\"1213618028\"};function vimeoIdFor(href){if(!href)return null;const m=href.match(/vimeo\\.com\\/(?:video\\/)?(\\d+)/);if(m)return m[1];for(const k in VIMEO)if(href.indexOf(k)>=0)return VIMEO[k];return null;}const CSS=`\n.evm-root{font-family:Urbanist,-apple-system,BlinkMacSystemFont,\"Segoe UI\",sans-serif;}\n.evm-overlay{position:fixed;inset:0;z-index:2147483000;display:flex;align-items:center;justify-content:center;padding:clamp(16px,4vw,48px);background:rgba(6,7,20,.82);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);animation:evm-fade .2s ease;box-sizing:border-box;}\n@keyframes evm-fade{from{opacity:0}to{opacity:1}}\n.evm-box{position:relative;width:min(1040px,92vw,150vh);max-height:85vh;aspect-ratio:16/9;background:#000;border-radius:18px;box-shadow:0 40px 120px -30px rgba(0,0,0,.7);animation:evm-pop .26s cubic-bezier(.2,.8,.2,1);}\n@keyframes evm-pop{from{transform:scale(.94);opacity:.4}to{transform:scale(1);opacity:1}}\n.evm-box video,.evm-box iframe{width:100%;height:100%;display:block;border:0;object-fit:contain;background:#000;border-radius:18px;}\n.evm-close{position:absolute;top:-16px;right:-16px;width:40px;height:40px;border-radius:50%;border:none;background:#fff;color:#0B0D2A;font-size:22px;line-height:1;font-weight:700;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 10px 30px -8px rgba(0,0,0,.5);transition:transform .18s;z-index:2;}\n.evm-close:hover{transform:scale(1.08);}\n@media(max-width:640px){.evm-close{top:10px;right:10px;background:rgba(255,255,255,.92);}}\n@media(prefers-reduced-motion:reduce){.evm-overlay,.evm-box{animation:none;}}\n`;/**\n * EverReady Video Modal\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight fixed\n */export default function EverReadyVideoModal(props){const isStatic=useIsStaticRenderer();const[media,setMedia]=useState(null);const close=useCallback(()=>setMedia(null),[]);useEffect(()=>{if(isStatic)return;const onClick=e=>{const t=e.target;const a=t&&t.closest?t.closest(\"a\"):null;if(!a)return;const href=a.getAttribute(\"href\")||\"\";const vid=vimeoIdFor(href);if(vid){e.preventDefault();e.stopPropagation();setMedia({kind:\"vimeo\",id:vid});}else if(/\\.mp4($|\\?|#)/i.test(href)){e.preventDefault();e.stopPropagation();setMedia({kind:\"mp4\",src:a.href});}};const onKey=e=>{if(e.key===\"Escape\")setMedia(null);};document.addEventListener(\"click\",onClick,true)// capture phase → beats Framer's link navigation\n;document.addEventListener(\"keydown\",onKey);return()=>{document.removeEventListener(\"click\",onClick,true);document.removeEventListener(\"keydown\",onKey);};},[isStatic]);// The overlay is portaled to <body> so position:fixed escapes any transformed Framer ancestor.\nconst overlay=media?/*#__PURE__*/_jsx(\"div\",{className:\"evm-overlay\",onClick:close,role:\"dialog\",\"aria-modal\":\"true\",children:/*#__PURE__*/_jsxs(\"div\",{className:\"evm-box\",onClick:e=>e.stopPropagation(),children:[/*#__PURE__*/_jsx(\"button\",{className:\"evm-close\",\"aria-label\":\"Close video\",onClick:close,children:\"\\xd7\"}),media.kind===\"vimeo\"?/*#__PURE__*/_jsx(\"iframe\",{src:`https://player.vimeo.com/video/${media.id}?autoplay=1&title=0&byline=0&portrait=0&dnt=1`,allow:\"autoplay; fullscreen; picture-in-picture\",allowFullScreen:true,title:\"EverReady demo video\"}):/*#__PURE__*/_jsx(\"video\",{src:media.src,controls:true,autoPlay:true,playsInline:true,preload:\"auto\"})]})}):null;return /*#__PURE__*/_jsxs(\"div\",{className:\"evm-root\",style:{width:\"100%\",height:0,...props.style},children:[/*#__PURE__*/_jsx(\"link\",{rel:\"stylesheet\",href:\"https://fonts.googleapis.com/css2?family=Urbanist:wght@400;600;700;800&display=swap\"}),/*#__PURE__*/_jsx(\"style\",{dangerouslySetInnerHTML:{__html:CSS}}),overlay&&typeof document!==\"undefined\"?/*#__PURE__*/createPortal(overlay,document.body):null]});}addPropertyControls(EverReadyVideoModal,{});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"EverReadyVideoModal\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./EverReadyVideoModal.map"],"mappings":"8MAQ0K,SAAS,EAAW,EAAK,CAAC,GAAG,CAAC,EAAK,OAAO,KAAK,IAAM,EAAE,EAAK,MAAM,+BAA+B,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,IAAI,IAAM,KAAK,EAAM,GAAG,EAAK,QAAQ,CAAC,GAAG,EAAE,OAAO,EAAM,GAAG,OAAO,IAAK,CAelW,SAAwB,EAAoB,EAAM,CAAC,IAAM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