{"version":3,"file":"EmbedLink.C6e2THp4.mjs","names":[],"sources":["https:/framerusercontent.com/modules/15t0cgxejmKEgJZWOfRB/VaZMwNJcpj60TMosuyA1/EmbedLink.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */function toYouTubeEmbedUrl(url=\"\"){if(!url)return\"\";try{const parsed=new URL(url);const host=parsed.hostname.replace(/^www\\./,\"\");const isYouTubeHost=host===\"youtube.com\"||host===\"m.youtube.com\"||host===\"youtu.be\"||host===\"youtube-nocookie.com\";if(!isYouTubeHost)return url;if(parsed.pathname.includes(\"/embed/\")){return url;}let videoId=\"\";if(host===\"youtu.be\"){videoId=parsed.pathname.split(\"/\").filter(Boolean)[0]||\"\";}else{videoId=parsed.searchParams.get(\"v\")||\"\";if(!videoId){const pathParts=parsed.pathname.split(\"/\").filter(Boolean);if(pathParts[0]===\"shorts\"||pathParts[0]===\"live\"){videoId=pathParts[1]||\"\";}}}if(!videoId)return url;const embedHost=host===\"youtube-nocookie.com\"?\"https://www.youtube-nocookie.com\":\"https://www.youtube.com\";const embedUrl=new URL(`${embedHost}/embed/${videoId}`);const start=parsed.searchParams.get(\"t\")||parsed.searchParams.get(\"start\");if(start){const seconds=Number.parseInt(start.replace(\"s\",\"\"),10);if(!Number.isNaN(seconds))embedUrl.searchParams.set(\"start\",String(seconds));}return embedUrl.toString();}catch(_error){return url;}}function IframeComponent({url=\"\"}){if(!url)return null;return /*#__PURE__*/_jsx(\"iframe\",{src:toYouTubeEmbedUrl(url),loading:\"lazy\",referrerPolicy:\"strict-origin-when-cross-origin\",sandbox:\"allow-same-origin allow-scripts allow-fullscreen allow-downloads allow-forms allow-modals allow-orientation-lock allow-pointer-lock allow-popups allow-popups-to-escape-sandbox allow-presentation allow-storage-access-by-user-activation allow-top-navigation-by-user-activation\",allow:\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\",allowFullScreen:true,style:{width:\"100%\",height:\"100%\",border:\"none\"}});}export default function EmbedLink(props){const{link,tag,style}=props;const rootStyle={...style,position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\"};if(tag===\"video\"){return /*#__PURE__*/_jsx(\"div\",{style:rootStyle,children:/*#__PURE__*/_jsx(\"video\",{style:{width:\"100%\",height:\"100%\"},src:link,loop:true,muted:true,autoPlay:true,playsInline:true,controlsList:\"nodownload\",children:/*#__PURE__*/_jsx(\"source\",{src:link,type:\"video/mp4\"})})});}return /*#__PURE__*/_jsx(\"div\",{style:rootStyle,children:/*#__PURE__*/_jsx(IframeComponent,{url:link})});}EmbedLink.displayName=\"Embed Link\";addPropertyControls(EmbedLink,{link:{type:ControlType.Link},tag:{title:\"Tag\",type:ControlType.Enum,displaySegmentedControl:true,segmentedControlDirection:\"vertical\",options:[\"iframe\",\"video\",\"custom_iframe\"],optionTitles:[\"Iframe\",\"Video\",\"Custom Iframe\"]}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"EmbedLink\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./EmbedLink.map"],"mappings":"6JAGG,SAAS,EAAkB,EAAI,GAAG,CAAC,GAAG,CAAC,EAAI,MAAM,GAAG,GAAG,CAAC,IAAM,EAAO,IAAI,IAAI,CAAG,EAAQ,EAAK,EAAO,SAAS,QAAQ,SAAS,EAAE,EAAkJ,GAA1B,EAAlG,IAAO,eAAe,IAAO,iBAAiB,IAAO,YAAY,IAAO,yBAAuD,EAAO,SAAS,SAAS,SAAS,EAAG,OAAO,EAAK,IAAI,EAAQ,GAAG,GAAG,IAAO,WAAY,EAAQ,EAAO,SAAS,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,IAAI,QAAkD,GAAzC,EAAQ,EAAO,aAAa,IAAI,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