{"version":3,"file":"ApplyRedirect.CvuVVGOP.mjs","names":["useState","_Fragment","QuoteForm","RequirementForm"],"sources":["https:/framerusercontent.com/modules/GHBC1zBnyYtxgHtBNWDG/7lwkGIq8NRKjSST1bASA/ApplyRedirect.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import QuoteForm from\"https://framerusercontent.com/modules/P97A2VdFeHpUl0T02QTx/vMLTDXUm2ZstuUufmDh8/QuoteForm.js\";import RequirementForm from\"https://framerusercontent.com/modules/5OuoMdf1SV2EpMkt0pjj/bDZ4xEw3oZNixNDSu8T0/RequirementForm.js\";import ReactDOM from\"react-dom\";export default function ApplyRedirect(props){const{packageName,type,text,background,fontFamily,fontWeight,fontSize,padding,boxShadow,textColor,primaryColor,maxWidth,scriptUrl,title,targetPage,useRedirect}=props;const[isModalOpen,setIsModalOpen]=useState(false);const[showSuccess,setShowSuccess]=useState(false);const[windowWidth,setWindowWidth]=useState(0);// Responsive resize handler\nuseEffect(()=>{const handleResize=()=>setWindowWidth(window.innerWidth);if(typeof window!==\"undefined\"){handleResize();window.addEventListener(\"resize\",handleResize);return()=>window.removeEventListener(\"resize\",handleResize);}},[]);// Prevent body scroll\nuseEffect(()=>{if(isModalOpen&&typeof document!==\"undefined\"){document.body.style.overflow=\"hidden\";}else if(typeof document!==\"undefined\"){document.body.style.overflow=\"unset\";}return()=>{if(typeof document!==\"undefined\"){document.body.style.overflow=\"unset\";}};},[isModalOpen]);const isMobile=windowWidth<=768;const isTablet=windowWidth<=1024;const getServiceSlug=()=>{if(typeof window===\"undefined\")return\"\";return window.location.pathname.split(\"/\").pop()||\"\";};const handleClick=()=>{if(useRedirect){// Redirect mode — navigate to target page with query params\nif(typeof window===\"undefined\")return;const service=getServiceSlug();const params=new URLSearchParams;if(service)params.set(\"service\",service);if(packageName&&packageName.trim())params.set(\"package\",packageName.trim());const formTitle=title&&title.trim()?title.trim():text&&text.trim()?text.trim():\"\";if(formTitle)params.set(\"title\",formTitle);const query=params.toString()?`?${params.toString()}`:\"\";if(targetPage)window.location.href=`${targetPage}${query}`;}else{// Overlay mode — open modal\nsetIsModalOpen(true);}};const closeModal=()=>setIsModalOpen(false);return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"div\",{onClick:handleClick,style:{padding:padding,background,color:textColor,borderRadius:\"12px\",textAlign:\"center\",cursor:\"pointer\",fontFamily,fontWeight,fontSize:`${fontSize}px`,userSelect:\"none\",boxShadow:boxShadow,transition:\"all 0.2s ease\",width:\"100%\",maxWidth:maxWidth},children:text}),!useRedirect&&isModalOpen&&typeof document!==\"undefined\"&&/*#__PURE__*/ReactDOM.createPortal(/*#__PURE__*/_jsx(\"div\",{style:{position:\"fixed\",inset:0,width:\"100vw\",height:\"100dvh\",zIndex:999999,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",backgroundColor:\"rgba(0, 0, 0, 0.6)\",backdropFilter:\"blur(8px)\",padding:\"clamp(10px, 5vw, 40px)\"},onClick:closeModal,children:/*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",...showSuccess?{}:{width:\"100%\",maxWidth:isMobile?\"95vw\":isTablet?\"90vw\":\"992px\",minHeight:\"66dvh\",maxHeight:\"calc(100dvh - 1rem)\"},backgroundColor:\"white\",borderRadius:\"20px\",overflow:\"hidden\",boxShadow:\"0 25px 50px rgba(0, 0, 0, 0.25)\",display:\"flex\",flexDirection:\"column\"},onClick:e=>e.stopPropagation(),children:[/*#__PURE__*/_jsx(\"button\",{onClick:closeModal,style:{position:\"absolute\",top:\"12px\",right:\"12px\",zIndex:10,width:\"40px\",height:\"40px\",borderRadius:\"50%\",border:\"none\",backgroundColor:\"#f3f4f6\",cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",fontSize:\"24px\",color:\"#6b7280\",transition:\"all 0.2s\"},children:\"\\xd7\"}),/*#__PURE__*/_jsx(\"div\",{style:{flex:1,width:\"100%\",overflowY:\"auto\",overflowX:\"hidden\",backgroundColor:\"white\",WebkitOverflowScrolling:\"touch\",padding:\"clamp(20px, 4vw, 40px)\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:type===\"get-quote\"?/*#__PURE__*/_jsx(QuoteForm,{primaryColor:primaryColor,scriptUrl:scriptUrl,packageName:packageName,service:getServiceSlug(),onClose:closeModal,showSuccess:showSuccess,setShowSuccess:setShowSuccess,title:title}):type===\"post-requirements\"?/*#__PURE__*/_jsx(RequirementForm,{primaryColor:primaryColor,scriptUrl:scriptUrl,packageName:packageName,service:getServiceSlug(),onClose:closeModal,showSuccess:showSuccess,setShowSuccess:setShowSuccess}):/*#__PURE__*/_jsxs(\"div\",{style:{padding:\"40px\",textAlign:\"center\",color:\"#666\"},children:[\"Invalid type: \",type]})})]})}),document.body)]});}addPropertyControls(ApplyRedirect,{useRedirect:{type:ControlType.Boolean,title:\"Use Redirect\",defaultValue:false,enabledTitle:\"Page\",disabledTitle:\"Overlay\"},targetPage:{type:ControlType.Link,title:\"Target Page\",hidden:props=>!props.useRedirect},type:{type:ControlType.Enum,title:\"Type\",options:[\"get-quote\",\"post-requirements\"],defaultValue:\"get-quote\"},packageName:{type:ControlType.String,title:\"Package Name\",defaultValue:\"\"},text:{type:ControlType.String,title:\"Button Text\",defaultValue:\"Choose Plan\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#ffffff\"},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#8b5cf6\"},primaryColor:{type:ControlType.Color,title:\"Form Primary Color\",defaultValue:\"#8b5cf6\"},scriptUrl:{type:ControlType.String,title:\"Apps Script URL\",defaultValue:\"\",placeholder:\"Paste your deployed Apps Script URL\"},title:{type:ControlType.String,title:\"Title\",defaultValue:null,placeholder:\"Override form title (optional)\"},fontFamily:{type:ControlType.String,title:\"Font Family\",defaultValue:\"Inter, sans-serif\"},fontWeight:{type:ControlType.Enum,title:\"Font Weight\",options:[\"400\",\"500\",\"600\",\"700\",\"800\"],defaultValue:\"600\"},fontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:16,min:10,max:40,step:1},padding:{type:ControlType.String,title:\"Padding\",defaultValue:\"clamp(12px, 2.5vw, 16px) clamp(16px, 3vw, 20px)\",placeholder:\"e.g. 16px 24px or clamp(12px, 2vw, 20px)\",description:\"Use CSS padding format (top/bottom left/right). Supports px, %, rem, or clamp().\"},boxShadow:{type:ControlType.String,title:\"Box Shadow\",defaultValue:\"0 4px 12px rgba(0,0,0,0.15)\",placeholder:\"e.g. 0 4px 12px rgba(0,0,0,0.1) or none\",description:\"Use CSS box-shadow format: offset-x offset-y blur spread color. Enter 'none' to remove the shadow.\"},maxWidth:{type:ControlType.String,title:\"MaxWidth\",defaultValue:\"300px\",placeholder:\"e.g. 300px - Supports px, %, rem, or clamp().\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ApplyRedirect\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ApplyRedirect.map"],"mappings":"gUAA6b,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,cAAY,OAAK,OAAK,aAAW,aAAW,aAAW,WAAS,UAAQ,YAAU,YAAU,eAAa,WAAS,YAAU,QAAM,aAAW,eAAa,EAAW,CAAC,EAAY,GAAgBA,EAAS,GAAM,CAAM,CAAC,EAAY,GAAgBA,EAAS,GAAM,CAAM,CAAC,EAAY,GAAgBA,EAAS,EAAE,CACjyB,MAAc,CAAC,IAAM,MAAiB,EAAe,EAAO,WAAW,CAAC,GAAU,IAAS,OAA2E,OAA9D,GAAc,CAAC,EAAO,iBAAiB,SAAS,EAAa,KAAW,EAAO,oBAAoB,SAAS,EAAa,EAAI,EAAE,CAAC,CACxO,OAAkB,GAAa,OAAO,SAAW,IAAa,SAAS,KAAK,MAAM,SAAS,SAAkB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