{"version":3,"file":"EmbedLinkViewer.BzMTSxfc.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/faT9aDQxUl6DQ3M2Vbg2/o9oeSq4qXtG7WEKXJzHI/EmbedLinkViewer.js"],"sourcesContent":["// Embed link component that displays websites with device rotation detection for mobile/tablet\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect,useRef,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function EmbedLinkViewer(props){const{url=\"https://www.framer.com\",backgroundColor=\"#FFFFFF\",textColor=\"#000000\",messageFont,borderRadius=8,showBorder=true,borderColor=\"#EEEEEE\"}=props;const[isLandscape,setIsLandscape]=useState(true);const[isMobileOrTablet,setIsMobileOrTablet]=useState(false);const iframeRef=useRef(null);useEffect(()=>{if(typeof window===\"undefined\")return;const checkOrientation=()=>{const width=window.innerWidth;const height=window.innerHeight;const isLandscapeOrientation=width>height;// Check if device is mobile or tablet (width < 1200px to include more tablets)\nconst isMobileTablet=width<1200;startTransition(()=>{setIsLandscape(isLandscapeOrientation);setIsMobileOrTablet(isMobileTablet);});};// Initial check\ncheckOrientation();// Listen for orientation changes\nwindow.addEventListener(\"resize\",checkOrientation);window.addEventListener(\"orientationchange\",checkOrientation);return()=>{window.removeEventListener(\"resize\",checkOrientation);window.removeEventListener(\"orientationchange\",checkOrientation);};},[]);// Inject scaling CSS into iframe for mobile landscape\nuseEffect(()=>{if(!iframeRef.current||!isMobileOrTablet||!isLandscape)return;const iframe=iframeRef.current;const injectScaling=()=>{try{const iframeDoc=iframe.contentDocument||iframe.contentWindow?.document;if(!iframeDoc)return;// Remove existing scaling styles\nconst existingStyle=iframeDoc.getElementById(\"mobile-scaling-style\");if(existingStyle){existingStyle.remove();}// Create and inject new scaling styles\nconst style=iframeDoc.createElement(\"style\");style.id=\"mobile-scaling-style\";style.textContent=`\n                    html, body {\n                        transform: scale(0.75) !important;\n                        transform-origin: top left !important;\n                        width: 133.33% !important;\n                        height: 133.33% !important;\n                        overflow-x: hidden !important;\n                    }\n                    * {\n                        max-width: none !important;\n                    }\n                `;iframeDoc.head.appendChild(style);}catch(error){// Cross-origin restrictions prevent access\nconsole.log(\"Cannot inject styles due to cross-origin restrictions\");}};// Wait for iframe to load\niframe.addEventListener(\"load\",injectScaling);// Try to inject immediately if already loaded\nif(iframe.contentDocument?.readyState===\"complete\"){injectScaling();}return()=>{iframe.removeEventListener(\"load\",injectScaling);};},[isMobileOrTablet,isLandscape,url]);const shouldShowRotateMessage=isMobileOrTablet&&!isLandscape;const containerStyle={width:\"100%\",height:\"100%\",backgroundColor,borderRadius,border:showBorder?`1px solid ${borderColor}`:\"none\",overflow:\"hidden\",position:\"relative\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"};if(shouldShowRotateMessage){return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:/*#__PURE__*/_jsxs(\"div\",{style:{textAlign:\"center\",padding:\"20px\",color:textColor,...messageFont},children:[/*#__PURE__*/_jsx(\"div\",{style:{fontSize:\"48px\",marginBottom:\"16px\",transform:\"rotate(90deg)\",display:\"inline-block\"},children:\"📱\"}),/*#__PURE__*/_jsx(\"div\",{style:{marginBottom:\"8px\",fontWeight:\"600\"},children:\"Please rotate your device\"}),/*#__PURE__*/_jsx(\"div\",{style:{opacity:.7},children:\"Turn to landscape mode to view this content\"})]})});}return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:/*#__PURE__*/_jsx(\"iframe\",{ref:iframeRef,src:url,style:{width:\"100%\",height:\"100%\",border:\"none\",borderRadius:borderRadius},title:\"Embedded website\",loading:\"lazy\",sandbox:\"allow-scripts allow-same-origin allow-forms allow-popups allow-presentation\"})});}addPropertyControls(EmbedLinkViewer,{url:{type:ControlType.String,title:\"Website URL\",defaultValue:\"https://www.framer.com\",placeholder:\"Enter website URL...\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},messageFont:{type:ControlType.Font,title:\"Message Font\",defaultValue:{fontSize:\"16px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,max:32,unit:\"px\"},showBorder:{type:ControlType.Boolean,title:\"Show Border\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},borderColor:{type:ControlType.Color,title:\"Border Color\",defaultValue:\"#EEEEEE\",hidden:({showBorder})=>!showBorder}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"EmbedLinkViewer\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./EmbedLinkViewer.map"],"mappings":"oNAIG,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,MAAI,yBAAyB,kBAAgB,UAAU,YAAU,UAAU,cAAY,eAAa,EAAE,aAAW,GAAK,cAAY,WAAW,EAAW,CAAC,EAAY,GAAgBA,EAAS,GAAK,CAAM,CAAC,EAAiB,GAAqBA,EAAS,GAAM,CAAO,EAAUC,EAAO,KAAK,CAAC,MAAc,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,MAAqB,CAAC,IAAM,EAAM,EAAO,WAAiD,EAAuB,EAAhD,EAAO,YACld,EAAe,EAAM,KAAK,MAAoB,CAAC,EAAe,EAAuB,CAAC,EAAoB,EAAe,EAAG,EAEjB,OADjH,GAAkB,CAClB,EAAO,iBAAiB,SAAS,EAAiB,CAAC,EAAO,iBAAiB,oBAAoB,EAAiB,KAAW,CAAC,EAAO,oBAAoB,SAAS,EAAiB,CAAC,EAAO,oBAAoB,oBAAoB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