import { a as __toESM } from "../_runtime.mjs";
import { n as require_react, r as require_jsx_runtime } from "../_libs/react+tanstack__react-query.mjs";
import { n as redirectToThankYou } from "./redirect-thank-you-BiC9Z-_Q.mjs";
import { E as MessageCircle, d as Star, g as ShieldCheck, x as Phone } from "../_libs/lucide-react.mjs";
import { n as toast } from "../_libs/sonner.mjs";
//#region node_modules/.nitro/vite/services/ssr/assets/HeroLeadForm-CtHTUnJ2.js
var import_react = /* @__PURE__ */ __toESM(require_react());
var import_jsx_runtime = require_jsx_runtime();
/**
* Sends a lead submission to a Google Apps Script Web App, which appends
* the row to a connected Google Sheet.
*
* The Apps Script is deployed as a Web App ("Anyone" access) and expects a
* JSON POST body with the fields defined in `LeadPayload`.
*
* Because Apps Script does not return CORS headers on the /exec endpoint,
* we use `mode: "no-cors"` — the request fires, but we cannot read the
* response. Errors are swallowed so the user still reaches the Thank You page.
*/
var APPS_SCRIPT_URL = "https://script.google.com/macros/s/AKfycbwJa2cVWN5lx6slJCdR1WWKOUuezQ7zvqCVJqDftvzVlImlbgQjMh75eD3ZNV8aLFDVMw/exec";
async function submitToSheets(payload) {
	try {
		await fetch(APPS_SCRIPT_URL, {
			method: "POST",
			mode: "no-cors",
			headers: { "Content-Type": "text/plain;charset=utf-8" },
			body: JSON.stringify({
				...payload,
				page: typeof window !== "undefined" ? window.location.pathname : "",
				submittedAt: (/* @__PURE__ */ new Date()).toISOString()
			})
		});
	} catch (err) {
		console.error("submitToSheets failed", err);
	}
}
function HeroLeadForm({ eyebrow = "Get a FREE Quote", title, subtitle, serviceOptions, badge = "Save up to 30% this month", variant = "brand" }) {
	const COUNTRY_CODE = "+1";
	const [submitting, setSubmitting] = (0, import_react.useState)(false);
	const [phone, setPhone] = (0, import_react.useState)("");
	const onSubmit = (e) => {
		e.preventDefault();
		const formEl = e.currentTarget;
		const fd = new FormData(formEl);
		if (phone.length < 3) {
			toast.error("Please enter a phone number.");
			return;
		}
		setSubmitting(true);
		submitToSheets({
			source: "HeroLeadForm",
			name: String(fd.get("name") ?? ""),
			email: String(fd.get("email") ?? ""),
			phone: COUNTRY_CODE + phone,
			projectType: String(fd.get("service") ?? ""),
			message: String(fd.get("message") ?? "")
		});
		setTimeout(() => {
			redirectToThankYou(formEl);
		}, 300);
	};
	return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", {
		id: "lead-form",
		className: `relative overflow-hidden scroll-mt-24 ${variant === "dark" ? "bg-deep text-deep-foreground" : "bg-gradient-to-br from-brand via-brand to-deep text-white"}`,
		children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_20%_20%,rgba(255,193,7,0.25),transparent_45%),radial-gradient(circle_at_80%_70%,rgba(226,78,66,0.25),transparent_45%)]" }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
			className: "relative mx-auto grid max-w-7xl gap-10 px-4 py-16 md:grid-cols-2 md:items-center md:px-6 md:py-20",
			children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
				/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
					className: "inline-flex items-center gap-2 rounded-full bg-highlight px-3 py-1 text-[11px] font-bold uppercase tracking-wider text-highlight-foreground shadow",
					children: badge
				}),
				/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", {
					className: "mt-4 font-display text-3xl font-bold leading-tight md:text-5xl",
					children: title
				}),
				subtitle && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
					className: "mt-4 max-w-xl text-base text-white/85 md:text-lg",
					children: subtitle
				}),
				/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("ul", {
					className: "mt-6 space-y-2 text-sm text-white/90",
					children: [
						/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", {
							className: "flex items-start gap-2",
							children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ShieldCheck, { className: "mt-0.5 h-4 w-4 shrink-0 text-highlight" }), "100% Money-Back Guarantee — no questions asked"]
						}),
						/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", {
							className: "flex items-start gap-2",
							children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ShieldCheck, { className: "mt-0.5 h-4 w-4 shrink-0 text-highlight" }), "Free strategy call & project roadmap"]
						}),
						/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", {
							className: "flex items-start gap-2",
							children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ShieldCheck, { className: "mt-0.5 h-4 w-4 shrink-0 text-highlight" }), "Response within 1 business hour"]
						})
					]
				}),
				/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
					className: "mt-7 flex flex-wrap gap-3",
					children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("a", {
						href: "tel:+18883917298",
						className: "inline-flex items-center gap-2 rounded-full bg-highlight px-6 py-3 text-sm font-bold uppercase tracking-wider text-highlight-foreground shadow-lg transition hover:-translate-y-0.5",
						children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Phone, { className: "h-4 w-4" }), " Call (888) 391-7298"]
					}), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("a", {
						href: "#chat",
						className: "inline-flex items-center gap-2 rounded-full border border-white/30 bg-white/10 px-6 py-3 text-sm font-semibold text-white backdrop-blur transition hover:bg-white/20",
						children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(MessageCircle, { className: "h-4 w-4" }), " Live Chat"]
					})]
				}),
				/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", {
					className: "mt-6 text-sm font-semibold text-white/90",
					children: [
						"Rated 4.8",
						" ",
						/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
							className: "inline-flex align-middle text-highlight",
							children: Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Star, { className: "h-3.5 w-3.5 fill-current" }, i))
						}),
						" ",
						"by 50,000+ happy clients"
					]
				})
			] }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
				className: "rounded-3xl bg-white p-6 text-foreground shadow-2xl ring-1 ring-black/5 md:p-8",
				children: [
					/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
						className: "rounded-2xl bg-highlight px-5 py-3 text-center text-highlight-foreground",
						children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
							className: "font-display text-base font-bold uppercase tracking-wide md:text-lg",
							children: "GET STARTED NOW!"
						})
					}),
					/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
						className: "mt-5 text-sm font-semibold uppercase tracking-wider text-brand",
						children: "Talk to a specialist today"
					}),
					/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
						className: "mt-1 font-display text-xl font-bold",
						children: "Tell us what you need"
					}),
					/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("form", {
						className: "mt-5 space-y-3",
						onSubmit,
						children: [
							/* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", {
								required: true,
								name: "name",
								placeholder: "Full Name",
								className: "w-full rounded-lg border border-border bg-background px-4 py-3 text-sm focus:border-brand focus:outline-none focus:ring-2 focus:ring-brand/30"
							}),
							/* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", {
								required: true,
								type: "email",
								name: "email",
								placeholder: "Email Address",
								className: "w-full rounded-lg border border-border bg-background px-4 py-3 text-sm focus:border-brand focus:outline-none focus:ring-2 focus:ring-brand/30"
							}),
							/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
								className: "relative",
								children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
									className: "absolute left-3 top-1/2 -translate-y-1/2 text-sm font-semibold text-foreground",
									children: COUNTRY_CODE
								}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", {
									required: true,
									type: "tel",
									value: phone,
									onChange: (e) => {
										setPhone(e.target.value.replace(/\D/g, ""));
									},
									placeholder: "Phone Number",
									className: "w-full rounded-lg border border-border bg-background py-3 pl-10 pr-4 text-sm focus:border-brand focus:outline-none focus:ring-2 focus:ring-brand/30"
								})]
							}),
							/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("select", {
								name: "service",
								defaultValue: "",
								required: true,
								className: "w-full rounded-lg border border-border bg-background px-4 py-3 text-sm focus:border-brand focus:outline-none focus:ring-2 focus:ring-brand/30",
								children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", {
									value: "",
									disabled: true,
									children: "What service are you interested in?"
								}), serviceOptions.map((o) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", {
									value: o,
									children: o
								}, o))]
							}),
							/* @__PURE__ */ (0, import_jsx_runtime.jsx)("textarea", {
								name: "message",
								rows: 3,
								placeholder: "Tell us about your project (optional)",
								className: "w-full resize-none rounded-lg border border-border bg-background px-4 py-3 text-sm focus:border-brand focus:outline-none focus:ring-2 focus:ring-brand/30"
							}),
							/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
								type: "submit",
								disabled: submitting,
								className: "w-full rounded-lg bg-brand px-6 py-3.5 text-sm font-bold uppercase tracking-wider text-brand-foreground shadow-lg transition hover:-translate-y-0.5 disabled:opacity-70",
								children: submitting ? "Sending..." : "GET STARTED NOW!"
							}),
							/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
								className: "text-center text-[11px] text-muted-foreground",
								children: "🔒 Your info is safe. We reply within 1 hour, Mon–Fri."
							})
						]
					})
				]
			})]
		})]
	});
}
//#endregion
export { submitToSheets as n, HeroLeadForm as t };
