PageSourceSearch

https://zyrox.ai/assets/ExitIntentPopup-cUH8vE1L.js

js zyrox.ai collected 2026-10-05 13:21:19 UTC 4,609 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-framer-BopOTbAw.js";import{r as s}from"./vendor-react-DCum3kP0.js";import{D as R,a as Y,B as y,I as u,S as D,b as T,d as _,e as G,f as H,u as r,s as b}from"./index-DfhYtJxq.js";import{i as F,a6 as M,F as V,e as A}from"./vendor-lucide-CoeZ2i33.js";import"./vendor-tanstack-C3evQHA6.js";import"./vendor-supabase-CORtF97s.js";const w="zyrox_exit_intent_seen_v3",B=[{value:"hvac",label:"HVAC"},{value:"dental",label:"Dental"},{value:"med-spa",label:"Med Spa"},{value:"clinic",label:"Clinic / Healthcare"},{value:"home-services",label:"Home Services"},{value:"real-estate",label:"Real Estate"},{value:"legal",label:"Legal / Law Firm"},{value:"other",label:"Other"}],Q=()=>{const[j,o]=s.useState(!1),[i,S]=s.useState(""),[c,C]=s.useState(""),[n,N]=s.useState(""),[l,E]=s.useState(""),[d,I]=s.useState(""),[m,p]=s.useState(!1),[L,x]=s.useState(!1);s.useEffect(()=>{if(typeof window>"u"||sessionStorage.getItem(w))return;let t=!1;const a=()=>{t||(t=!0,o(!0),sessionStorage.setItem(w,"1"))},h=g=>{g.clientY<=0&&a()},f=()=>{document.visibilityState==="hidden"&&a()},v=()=>{(window.scrollY+window.innerHeight)/document.documentElement.scrollHeight>.55&&a()},k=window.setTimeout(a,25e3);return document.addEventListener("mouseleave",h),document.addEventListener("visibilitychange",f),window.addEventListener("scroll",v,{passive:!0}),()=>{document.removeEventListener("mouseleave",h),document.removeEventListener("visibilitychange",f),window.removeEventListener("scroll",v),window.clearTimeout(k)}},[]);const O=async t=>{if(t.preventDefault(),d){x(!0),r.success("Your ROI guide is on the way!");return}if(!n||!n.includes("@")){r.error("Enter a valid email");return}if(!i.trim()){r.error("Enter your name");return}if(!l){r.error("Select your industry");return}p(!0);try{const{error:a}=await b.functions.invoke("capture-lead",{body:{email:n.toLowerCase().trim(),name:i.trim(),company:c.trim()||null,category:l,source:"exit-intent"}});if(a)throw a;b.functions.invoke("send-roi-pdf",{body:{email:n.toLowerCase().trim(),name:i.trim(),company:c.trim()||null,category:l}}).catch(()=>{}),x(!0),r.success("Your ROI guide is on the way!")}catch{r.error("Something went wrong. Try again.")}finally{p(!1)}};return e.jsx(R,{open:j,onOpenChange:o,children:e.jsxs(Y,{className:"max-w-sm p-0 overflow-hidden border-0",children:[e.jsxs("div",{className:"bg-gradient-to-br from-primary to-accent text-primary-foreground p-5",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2 opacity-90",children:[e.jsx(F,{className:"h-4 w-4"}),e.jsx("span",{className:"text-[11px] font-bold uppercase tracking-widest",children:"Before You Go"})]}),e.jsx("h3",{className:"text-xl font-display font-bold leading-tight",children:"Get Your Free Industry-Specific ROI Guide"}),e.jsx("p",{className:"text-xs opacity-90 mt-2",children:"Personalised PDF with benchmarks & savings tailored to your business — delivered to your inbox."})]}),e.jsx("div",{className:"p-5 bg-background",children:L?e.jsxs("div",{className:"text-center py-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center mx-auto mb-3",children:e.jsx(M,{className:"h-5 w-5 text-primary"})}),e.jsx("p",{className:"font-semibold text-foreground",children:"Check your inbox!"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Your personalised ROI guide is on its way."}),e.jsx(y,{onClick:()=>o(!1),variant:"outline",className:"mt-4 rounded-full",children:"Close"})]}):e.jsxs("form",{onSubmit:O,className:"space-y-3",children:[e.jsx("div",{className:"hidden","aria-hidden":"true",tabIndex:-1,children:e.jsx("input",{type:"text",name:"website_url_hp",tabIndex:-1,autoComplete:"off",value:d,onChange:t=>I(t.target.value)})}),e.jsx(u,{placeholder:"Your name",value:i,onChange:t=>S(t.target.value),required:!0}),e.jsx(u,{placeholder:"Company name (optional)",value:c,onChange:t=>C(t.target.value)}),e.jsx(u,{type:"email",placeholder:"[email protected]",value:n,onChange:t=>N(t.target.value),required:!0}),e.jsxs(D,{value:l,onValueChange:E,children:[e.jsx(T,{children:e.jsx(_,{placeholder:"Select your industry"})}),e.jsx(G,{children:B.map(t=>e.jsx(H,{value:t.value,children:t.label},t.value))})]}),e.jsxs(y,{type:"submit",disabled:m,className:"w-full rounded-full font-semibold",children:[e.jsx(V,{className:"mr-2 h-4 w-4"}),m?"Sending…":"Email Me My ROI Guide"]}),e.jsxs("p",{className:"text-[11px] text-muted-foreground text-center flex items-center justify-center gap-1",children:[e.jsx(A,{className:"h-3 w-3"})," No spam. Unsubscribe anytime."]})]})})]})})};export{Q as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.