{"version":3,"file":"TrailerEmbed.DI7glRe2.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/0JE0ZxPf8XtwfkErQlLr/dJpLWuRdsJyoy6sSNWK4/TrailerEmbed.js"],"sourcesContent":["// Trailer embed for the film page template. Paste or connect a YouTube or Vimeo link\n// (e.g. the CMS \"Trailer\" field). If the link is empty or not a video link, the whole\n// block (heading + player) disappears on the live site, so films without trailers stay clean.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useMemo}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";function toEmbedUrl(raw){if(!raw||typeof raw!==\"string\")return null;const url=raw.trim();if(!url)return null;// YouTube: watch?v=, youtu.be/, embed/, shorts/, live/\nconst yt=url.match(/youtu\\.be\\/([A-Za-z0-9_-]{6,})/)||url.match(/[?&]v=([A-Za-z0-9_-]{6,})/)||url.match(/youtube(?:-nocookie)?\\.com\\/(?:embed|shorts|live)\\/([A-Za-z0-9_-]{6,})/);if(yt){return`https://www.youtube-nocookie.com/embed/${yt[1]}?rel=0&modestbranding=1`;}// Vimeo: vimeo.com/123, vimeo.com/123/abcdef (unlisted hash), player.vimeo.com/video/123?h=abc\nconst vimeoPlayer=url.match(/player\\.vimeo\\.com\\/video\\/(\\d+)(?:\\?[^#]*?h=([A-Za-z0-9]+))?/);if(vimeoPlayer){const hash=vimeoPlayer[2]?`&h=${vimeoPlayer[2]}`:\"\";return`https://player.vimeo.com/video/${vimeoPlayer[1]}?dnt=1${hash}`;}const vimeo=url.match(/vimeo\\.com\\/(?:.*\\/)?(\\d+)(?:\\/([A-Za-z0-9]+))?/);if(vimeo){const hash=vimeo[2]?`&h=${vimeo[2]}`:\"\";return`https://player.vimeo.com/video/${vimeo[1]}?dnt=1${hash}`;}return null;}/**\n * Trailer Embed\n *\n * @framerIntrinsicWidth 960\n * @framerIntrinsicHeight 600\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight auto\n */export default function TrailerEmbed(props){const{url,title=\"Trailer\",showTitle=true,titleColor=\"rgb(245, 242, 234)\",gap=32,radius=2,style}=props;const embedUrl=useMemo(()=>toEmbedUrl(url),[url]);const onCanvas=RenderTarget.current()===RenderTarget.canvas;if(!embedUrl){if(!onCanvas)return null;// Canvas-only placeholder so the layer is visible while designing\nreturn /*#__PURE__*/_jsx(\"div\",{style:{...style,position:\"relative\",width:\"100%\",aspectRatio:\"16 / 9\",borderRadius:radius,border:\"1px dashed rgba(245,242,234,0.3)\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",color:\"rgba(245,242,234,0.5)\",fontFamily:\"Inter, sans-serif\",fontSize:13,letterSpacing:\"0.08em\",textTransform:\"uppercase\"},children:\"No video link: hidden on the live site\"});}return /*#__PURE__*/_jsxs(\"section\",{\"aria-label\":title||\"Video\",style:{...style,position:\"relative\",width:\"100%\",display:\"flex\",flexDirection:\"column\",gap},children:[showTitle&&title?/*#__PURE__*/_jsx(\"h2\",{style:{margin:0,color:titleColor,fontFamily:\"Inter, sans-serif\",fontWeight:600,fontSize:36,lineHeight:\"1.2em\",letterSpacing:\"-0.01em\"},children:title}):null,/*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",aspectRatio:\"16 / 9\",borderRadius:radius,overflow:\"hidden\",background:\"#000\"},children:/*#__PURE__*/_jsx(\"iframe\",{src:embedUrl,title:title||\"Video\",allow:\"autoplay; fullscreen; picture-in-picture; encrypted-media\",allowFullScreen:true,loading:\"lazy\",style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",border:0}})})]});}addPropertyControls(TrailerEmbed,{url:{type:ControlType.Link,title:\"Video Link\"},showTitle:{type:ControlType.Boolean,title:\"Heading\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},title:{type:ControlType.String,title:\"Heading Text\",defaultValue:\"Trailer\",hidden:props=>!props.showTitle},titleColor:{type:ControlType.Color,title:\"Heading Color\",defaultValue:\"rgb(245, 242, 234)\",hidden:props=>!props.showTitle},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:32,min:0,max:120,unit:\"px\"},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:2,min:0,max:48,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TrailerEmbed\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"600\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerIntrinsicWidth\":\"960\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TrailerEmbed.map"],"mappings":"wLAGqJ,SAAS,EAAW,EAAI,CAAC,GAAG,CAAC,GAAK,OAAO,GAAM,SAAS,OAAO,KAAK,IAAM,EAAI,EAAI,KAAK,EAAE,GAAG,CAAC,EAAI,OAAO,KAC7P,IAAM,EAAG,EAAI,MAAM,gCAAgC,GAAG,EAAI,MAAM,2BAA2B,GAAG,EAAI,MAAM,wEAAwE,EAAE,GAAG,EAAI,MAAM,0CAA0C,EAAG,GAAG,yBAC/O,IAAM,EAAY,EAAI,MAAM,+DAA+D,EAAE,GAAG,EAAY,CAAC,IAAM,EAAK,EAAY,GAAG,MAAM,EAAY,KAAK,GAAG,MAAM,kCAAkC,EAAY,GAAG,QAAQ,GAAO,CAAC,IAAM,EAAM,EAAI,MAAM,iDAAiD,EAAE,GAAG,EAAM,CAAC,IAAM,EAAK,EAAM,GAAG,MAAM,EAAM,KAAK,GAAG,MAAM,kCAAkC,EAAM,GAAG,QAAQ,GAAO,CAAC,OAAO,IAAK,CAQ7a,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,MAAI,QAAM,UAAU,YAAU,GAAK,aAAW,qBAAqB,MAAI,GAAG,SAAO,EAAE,SAAO,EAAY,EAASA,MAAY,EAAW,CAAG,EAAE,CAAC,CAAG,CAAC,EAAQ,EAAS,EAAa,QAAQ,IAAI,EAAa,OACmJ,OADxI,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