1import{r as e,j as a}from"./react-vendor-hAxFZxNQ.js";import{k as s,m as t,B as r,l as i,X as o,n as l,o as n,r as d}from"./main-FMm0mhBU.js";import{B as c}from"./business-autocomplete-D9qFndlt.js";import{A as m}from"./Audit720Header-CHO9UhXj.js";import{A as u}from"./Audit720Footer-DK5jXZ4k.js";import"./ui-DlHKYJvh.js";import"./index-BGik27p8.js";import"./index-CZV6H2So.js";const p={marketing_agency:"marketing",advertising_agency:"marketing",software_company:"technology",computer_repair_service:"technology",restaurant:"restaurant",cafe:"restaurant",bakery:"restaurant",bar:"restaurant",food:"restaurant",store:"retail",shopping_mall:"retail",clothing_store:"retail",electronics_store:"retail",doctor:"healthcare",dentist:"healthcare",hospital:"healthcare",pharmacy:"healthcare",health:"healthcare",accounting:"professional_services",lawyer:"legal",insurance_agency:"financial",bank:"financial",plumber:"home_services",electrician:"home_services",locksmith:"home_services",roofing_contractor:"home_services",general_contractor:"home_services",car_dealer:"automotive",car_repair:"automotive",car_wash:"automotive",beauty_salon:"beauty",hair_care:"beauty",spa:"beauty",gym:"fitness",fitness_center:"fitness",school:"education",university:"education",real_estate_agency:"real_estate"},g=new Set(["healthcare","restaurant","legal","automotive","home_services","real_estate","fitness"]);function x(e){for(const a of e)if(p[a])return a.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase());return""}const h={hidden:{opacity:0,y:20},visible:{opacity:1,y:0,transition:{duration:.4,ease:"easeOut"}}},f={hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.1,delayChildren:.05}}};function b(){const{website:b,place_id:_,source:y}=s.useSearch(),[w,v]=e.useState(null),[j,N]=e.useState(!1),[k,S]=e.useState("idle"),[I,C]=e.useState(null);y&&"undefined"!=typeof window&&localStorage.setItem("audit_lead_source",y),e.useEffect(()=>{document.title="720 Digital Marketing - Local Business Audit"},[]),e.useEffect(()=>{(b||_)&&(S("loading"),async function(){window.google?.maps?.places||(document.querySelector('script[src*="maps.googleapis.com"]')?await new Promise((e,a)=>{let s=0;const t=setInterval(()=>{window.google?.maps?.places&&(clearInterval(t),e()),(s+=100)>1e4&&(clearInterval(t),a(new Error("timeout")))},100)}):await new Promise((e,a)=>{const s=document.createElement("script");s.src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCwfPK-9vhkOHFlnm_a2ZHLOLe00XsDpP8&libraries=places",s.onload=()=>e(),s.onerror=()=>a(new Error("script load failed")),document.head.appendChild(s)}))}().then(()=>{const e=window.google,a=document.createElement("div"),s=new e.maps.Map(a),t=new e.maps.places.PlacesService(s),r=["place_id","name","formatted_address","address_components","geometry","types","website","formatted_phone_number","rating","user_ratings_total","price_level","business_status","opening_hours","photos","editorial_summary","url"];function i(a,s){if(s!==e.maps.places.PlacesServiceStatus.OK||!a)return S("error"),void C("We couldn't find a Google Business listing for that address. Please search manually.");const t=a.address_components||[],r=e=>t.find(a=>a.types.includes(e))?.long_name||"",i=a.photos?.[0]?.getUrl({maxWidth:800})||"",o=a.photos?.slice(1,6).map(e=>e.getUrl({maxWidth:800}))||[],l={placeId:a.place_id,name:a.name,address:a.formatted_address||"",city:r("locality")||r("sublocality")||r("administrative_area_level_2"),state:t.find(e=>e.types.includes("administrative_area_level_1"))?.short_name||"",zip:r("postal_code"),phone:a.formatted_phone_number||"",website:a.website||"",rating:a.rating,reviewCount:a.user_ratings_total,priceLevel:a.price_level,types:a.types||[],businessStatus:a.business_status||"",businessHours:a.opening_hours?.periods?{periods:a.opening_hours.periods}:{},description:a.editorial_summary?.overview||"",googleMapsUrl:a.url||"",photoUrl:i,galleryUrls:o};v(l),S("idle")}_?t.getDetails({placeId:_,fields:r},i):b&&t.findPlaceFromQuery({query:b,fields:["place_id"]},(a,s)=>{if(s!==e.maps.places.PlacesServiceStatus.OK||!a?.length)return S("error"),void C("We couldn't find a Google Business listing for that website. Please search manually.");t.getDetails({placeId:a[0].place_id,fields:r},i)})}).catch(()=>{S("error"),C("Failed to load Google Maps. Please search manually.")}))},[]);const P=!(!b&&!_);return a.jsxs("div",{className:"min-h-screen flex flex-col bg-[#f9fafb] dark:bg-background",children:[a.jsx(m,{}),a.jsx("div",{className:"flex-1 flex flex-col justify-center pt-4 pb-12 overflow-hidden",children:a.jsx("div",{className:"max-w-[960px] relative z-10 mx-auto px-4 sm:px-6 lg:px-8 w-full",children:a.jsxs(t.div,{className:"flex flex-col items-center text-center gap-10",initial:"hidden",animate:"visible",variants:f,children:[a.jsxs(t.div,{variants:h,className:"flex flex-col gap-6 max-w-3xl mx-auto pt-4",children:[a.jsxs("h1",{className:"text-[#0f172a] dark:text-white text-4xl md:text-5xl font-black leading-[1.15] tracking-tight",children:["Grow your business with"," ",a.jsx("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-[#00C48C] to-[#2563EB]",children:"intelligent listings"}),", ","data, and reviews."]}),a.jsx("p",{className:"text-[#64748b] dark:text-gray-400 text-lg font-normal leading-relaxed max-w-2xl mx-auto",children:"Manage everything in one AI-powered platform. See where your business stands across 20+ directories and fix it all in one click."})]}),a.jsxs(t.div,{variants:h,className:"w-full max-w-[640px] mx-auto bg-white dark:bg-card p-6 md:p-10 rounded-3xl border border-[#e2e8f0] dark:border-border shadow-2xl shadow-gray-200/50 dark:shadow-black/20",children:[a.jsxs("div",{className:"mb-8 text-center border-b border-[#e2e8f0] dark:border-border pb-6",children:[a.jsxs("div",{className:"flex flex-col items-center",children:[a.jsx("img",{src:"/static/images/720-ai-digital-marketing-logo-navbar.png",alt:"720 AI Digital Marketing",className:"h-10 dar
1k:invert"}),a.jsx("span",{className:"text-sm font-semibold text-primary mt-1",children:"Local Business Audit"})]}),a.jsx("p",{className:"text-sm text-[#64748b] dark:text-gray-400 mt-2 font-medium",children:"Find your business to get started"})]}),a.jsxs("div",{className:"space-y-6",children:["error"===k&&I&&a.jsxs("div",{className:"flex items-start gap-2 rounded-xl bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-800 px-4 py-3 text-sm text-red-700 dark:text-red-400",children:[a.jsx("span",{children:"â "}),a.jsxs("span",{children:[I," Search manually below."]})]}),a.jsxs("label",{className:"flex flex-col w-full group",children:[a.jsx("p",{className:"text-foreground text-sm font-semibold leading-normal pb-2 ml-1",children:"Search Google My Business"}),"loading"!==k||w?w?a.jsxs("div",{className:"flex w-full items-center justify-between rounded-2xl border border-primary bg-primary/5 h-14 px-4 shadow-sm",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(r,{className:"w-5 h-5 text-primary"}),a.jsxs("div",{className:"flex flex-col",children:[a.jsx("span",{className:"text-foreground text-sm font-medium",children:w.name}),a.jsxs("span",{className:"text-muted-foreground text-xs flex items-center gap-1",children:[a.jsx(i,{className:"w-3 h-3"}),w.city,", ",w.state]})]})]}),a.jsx("button",{type:"button","aria-label":"Clear selection",onClick:()=>v(null),className:"text-muted-foreground hover:text-foreground transition-colors p-1",children:a.jsx(o,{className:"w-4 h-4"})})]}):a.jsxs("div",{className:"flex w-full items-stretch rounded-2xl border border-[#e2e8f0] dark:border-border group-focus-within:border-primary group-focus-within:shadow-[0_0_0_3px_rgba(124,93,250,0.15)] transition-all shadow-sm overflow-hidden",children:[a.jsx(c,{onSelect:e=>v(e),placeholder:"Search for your business...",className:"flex w-full min-w-0 flex-1 resize-none overflow-hidden text-foreground focus:outline-none border-none bg-transparent h-14 placeholder:text-muted-foreground/50 px-4 text-base font-medium leading-normal transition-colors focus:ring-0"}),a.jsx("div",{className:"text-muted-foreground flex items-center justify-center px-5 border-l border-[#e2e8f0] dark:border-border bg-muted/30",children:a.jsx(r,{className:"w-5 h-5"})})]}):a.jsxs("div",{className:"flex w-full items-center gap-3 rounded-2xl border border-border bg-muted/30 h-14 px-4 animate-pulse",children:[a.jsx("div",{className:"w-5 h-5 rounded bg-muted-foreground/20 shrink-0"}),a.jsxs("div",{className:"flex flex-col gap-1 flex-1",children:[a.jsx("div",{className:"h-3 w-32 rounded bg-muted-foreground/20"}),a.jsx("div",{className:"h-2 w-20 rounded bg-muted-foreground/15"})]})]}),a.jsx("p",{className:"text-[#64748b] dark:text-gray-400 text-xs mt-2 ml-1",children:"Search by business name to find your Google My Business listing"})]}),a.jsx("div",{className:"pt-2",children:a.jsx("button",{type:"button",onClick:async()=>{if(w&&!j){N(!0);try{const a=(e=function(e){for(const a of e)if(p[a])return p[a];return""}(w.types||[]),g.has(e)?e:"general"),s=await n.createGuestBusiness({business_name:w.name,address_display:w.address,address_city:w.city,address_state:w.state,address_zip:w.zip||"",phone:w.phone||"",website:w.website||"",google_place_id:w.placeId,google_maps_url:w.googleMapsUrl||"",google_rating:w.rating,google_review_count:w.reviewCount,primary_category:x(w.types||[]),business_vertical:a,description:w.description||"",temporarily_closed:"CLOSED_TEMPORARILY"===w.businessStatus});localStorage.setItem("local_guest_business_id",s.id),localStorage.setItem("local_preview_place",JSON.stringify(w)),window.location.href=d(`/local720/dashboard?id=${s.id}`)}catch(a){localStorage.setItem("local_preview_place",JSON.stringify(w)),window.location.href=d("/local720/dashboard")}var e}},disabled:!w||j,className:"group relative flex w-full cursor-pointer items-center justify-center overflow-hidden rounded-2xl h-14 px-8 bg-gradient-to-r from-primary to-[#7c5dfa] hover:to-primary text-white hover:shadow-lg hover:shadow-primary/30 active:scale-[0.98] transition-all duration-200 text-base font-bold leading-normal tracking-[0.01em] disabled:opacity-50 disabled:cursor-not-allowed",children:a.jsxs("span",{className:"flex items-center gap-3 relative z-10",children:[a.jsx(l,{className:"w-5 h-5 "+(j?"animate-spin":"")}),j?"Setting up...":P&&w?"Start Audit":"Continue"]})})})]})]})]})})}),a.jsx(u,{})]})}
1export{b as component};
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.