{"version":3,"file":"Redirect.Cdb9KCP9.mjs","names":[],"sources":["https:/framerusercontent.com/modules/ej0QJv1jS0Z35RMKlahg/a5lhRgZJRO5wN1wO3Z05/Redirect.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any\n * @framerDisableUnlink\n * @framerSupportedLayoutHeight any\n */ export default function Redirect(props){// Function to check if running inside Framer\nconst isInsideFramerBuilder=()=>{// Checking for Framer-specific global objects\nreturn typeof window[\"Framer\"]!==\"undefined\";};// Automatically redirect if isActive is true, URL is provided, and not running inside Framer builder\nReact.useEffect(()=>{if(props.isActive&&props.url&&!isInsideFramerBuilder()){const timer=setTimeout(()=>{if(props.newTab){window.open(props.url,\"_blank\");}else{window.location.href=props.url;}},props.seconds*1e3);return()=>clearTimeout(timer);}},[props.seconds,props.url,props.isActive,props.newTab]);return /*#__PURE__*/ _jsx(\"div\",{style:{...containerStyle,width:props.width,height:props.height}});};// Define property controls\naddPropertyControls(Redirect,{isActive:{type:ControlType.Boolean,title:\"Active\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\",description:\"Toggle to activate or deactivate the redirect.\"},seconds:{type:ControlType.Number,title:\"Seconds\",defaultValue:5,min:0,max:60,step:1,description:\"Time in seconds before redirecting.\"},url:{type:ControlType.String,title:\"URL\",description:\"The URL to redirect to.\"},newTab:{type:ControlType.Boolean,title:\"New Tab\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\",description:\"Toggle to open the URL in a new tab.\"}});// Styles are written in object syntax\nconst containerStyle={opacity:0};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Redirect\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"* @framerSupportedLayoutHeight any\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Redirect.map"],"mappings":"mLAII,SAAwB,EAAS,EAAM,CAC3C,IAAM,MACQ,EAAO,SAAY,OAC4Q,OAA7S,MAAoB,CAAC,GAAG,EAAM,UAAU,EAAM,KAAK,CAAC,GAAuB,CAAC,CAAC,IAAM,EAAM,eAAe,CAAI,EAAM,OAAQ,EAAO,KAAK,EAAM,IAAI,SAAS,CAAO,EAAO,SAAS,KAAK,EAAM,KAAO,EAAM,QAAQ,IAAI,CAAC,UAAU,aAAa,EAAM,GAAI,CAAC,EAAM,QAAQ,EAAM,IAAI,EAAM,SAAS,EAAM,OAAO,CAAC,CAAsB,EAAK,MAAM,CAAC,MAAM,CAAC,GAAG,EAAe,MAAM,EAAM,MAAM,OAAO,EAAM,OAAO,CAAC,CAAC,wBAPpW,IAA4B,IAAoD,CAQ3H,EAAoB,EAAS,CAAC,SAAS,CAAC,KAAK,EAAY,QAAQ,MAAM,SAAS,aAAa,GAAM,aAAa,KAAK,cAAc,MAAM,YAAY,iDAAiD,CAAC,QAAQ,CAAC,KAAK,EAAY,OAAO,MAAM,UAAU,aAAa,EAAE,IAAI,EAAE,IAAI,GAAG,KAAK,EAAE,YAAY,sCAAsC,CAAC,IAAI,CAAC,KAAK,EAAY,OAAO,MAAM,MAAM,YAAY,0BAA0B,CAAC,OAAO,CAAC,KAAK,EAAY,QAAQ,MAAM,UAAU,aAAa,GAAM,aAAa,KAAK,cAAc,MAAM,YAAY,uCAAuC,CAAC,CAAC,CACvjB,EAAe,CAAC,QAAQ,EAAE"}