1import{j as e}from"./vendor-CPSTkeCi.js";import{e as $,u as L,f as T,L as n,B as l,d as r,C as d,S as C,b as z,c as o}from"./index--N5l2f8e.js";import{a as f}from"./query-HvZ_PWjv.js";import{G as A,S as I}from"./index-Zav636p8.js";import{v as b,H as m,F as D,w as F,k as B,s as U,t as R,u as q,x as E,y as O,z as P,V}from"./icons-CvnKvojW.js";import"./ui-CWrUbQ55.js";function H(i){return A({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"},child:[]}]})(i)}function p(i){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(Number(i))}function W(i){return new Intl.NumberFormat("en-US").format(i)}function X(){const{id:i}=$(),{t:a}=L(),{data:s,isLoading:N}=f({queryKey:["/api/listings",i],enabled:!!i}),{toast:v}=T(),{data:y}=f({queryKey:["/api/listings",i,"showings"]});if(N)return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("nav",{className:"sticky top-0 z-50 backdrop-blur-md bg-background/80 border-b",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"flex items-center gap-4 h-16",children:[e.jsx(n,{href:"/browse",children:e.jsx(l,{variant:"ghost",size:"icon",children:e.jsx(b,{className:"h-4 w-4"})})}),e.jsx(r,{className:"h-6 w-48"})]})})}),e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8 space-y-6",children:[e.jsx(r,{className:"h-96 w-full rounded-md"}),e.jsxs("div",{className:"grid lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-4",children:[e.jsx(r,{className:"h-8 w-3/4"}),e.jsx(r,{className:"h-4 w-full"}),e.jsx(r,{className:"h-4 w-full"})]}),e.jsx(r,{className:"h-64"})]})]})]});if(!s)return e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsxs("div",{className:"text-center space-y-4",children:[e.jsx(m,{className:"h-12 w-12 text-muted-foreground/40 mx-auto"}),e.jsx("h2",{className:"text-xl font-semibold",children:"Property Not Found"}),e.jsx(n,{href:"/browse",children:e.jsx(l,{variant:"outline",children:a("listing","backToListings")})})]})});const x=s.images&&s.images.length>0?s.images:["https://images.unsplash.com/photo-1560518883-ce09059eeffa?w=800&h=600&fit=crop&q=80"],g=y?.filter(t=>t.status==="live"||t.status==="scheduled")||[],c=window.location.href,w=a("dashboard","shareWhatsApp").replace("{beds}",s.bedrooms.toString()).replace("{baths}",s.bathrooms.toString()).replace("{city}",s.city).replace("{price}",p(s.price)).replace("{url}",c),k=a("dashboard","shareTwitter").replace("{price}",p(s.price)).replace("{city}",s.city).replace("{url}",c),S=()=>{navigator.clipboard.writeText(c),v({title:a("dashboard","linkCopied")})},u=e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wider",children:a("dashboard","shareListing")}),e.jsxs("div",{className:"flex flex-row lg:flex-col gap-2",children:[e.jsxs(l,{variant:"outline",size:"icon",className:"h-10 w-10 lg:w-full lg:justify-start lg:px-3 lg:gap-3",onClick:()=>window.open(`https://wa.me/?text=${encodeURIComponent(w)}`,"_blank"),"data-testid":"button-share-whatsapp",children:[e.jsx(I,{className:"h-5 w-5 text-[#25D366]"}),e.jsx("span",{className:"hidden lg:inline",children:"WhatsApp"})]}),e.jsxs(l,{variant:"outline",size:"icon",className:"h-10 w-10 lg:w-full lg:justify-start lg:px-3 lg:gap-3",onClick:()=>window.open(`https://twitter.com/intent/tweet?text=${encodeURIComponent(k)}`,"_blank"),"data-testid":"button-share-twitter",children:[e.jsx(H,{className:"h-5 w-5 text-[#1DA1F2]"}),e.jsx("span",{className:"hidden lg:inline",children:"Twitter / X"})]}),e.jsxs(l,{variant:"outline",size:"icon",className:"h-10 w-10 lg:w-full lg:justify-start lg:px-3 lg:gap-3",onClick:()=>window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(c)}`,"_blank"),"data-testid":"button-share-facebook",children:[e.jsx(D,{className:"h-5 w-5 text-[#1877F2]"}),e.jsx("span",{className:"hidden lg:inline",children:"Facebook"})]}),e.jsxs(l,{variant:"outline",size:"icon",className:"h-10 w-10 lg:w-full lg:justify-start lg:px-3 lg:gap-3",onClick:S,"data-testid":"button-share-copy",children:[e.jsx(F,{className:"h-5 w-5"}),e.jsx("span",{className:"hidden lg:inline",children:a("dashboard","copyLink")})]})]})]});return e.jsxs("div",{className:"min-h-screen bg-background relative",children:[e.jsx("div",{className:"hidden lg:block fixed left-8 top-1/2 -translate-y-1/2 z-40",children:e.jsx(d,{className:"p-4 shadow-lg border-2",children:u})}),e.jsx(C,{title:s?`${s.title} | ${s.city}, ${s.state} - Savely.io`:"Property Details - Savely.io",description:s?`${s.propertyType==="house"?"House":s.propertyType==="condo"?"Condo":s.propertyType==="apartment"?"Apartment":"Property"} for sale in ${s.city}, ${s.state}. ${s.bedrooms} bedrooms, ${Number(s.bathrooms)}
1 bathrooms, ${Number(s.sqft).toLocaleString()} sq ft. ${(s.description||"").substring(0,120)}`:"View property details on Savely.io.",keywords:s?`${s.city} real estate, ${s.propertyType} for sale ${s.city}, ${s.bedrooms} bedroom ${s.propertyType}, homes for sale ${s.state}, ${s.zipCode} real estate`:"property details, real estate listing",ogType:"article",structuredData:s?{"@context":"https://schema.org","@type":"RealEstateListing",name:s.title,description:(s.description||"").substring(0,200),url:`https://savely.io/listing/${s.id}`,datePosted:s.createdAt?new Date(s.createdAt).toISOString():new Date().toISOString(),image:s.images&&s.images.length>0?s.images:void 0,address:{"@type":"PostalAddress",streetAddress:s.address,addressLocality:s.city,addressRegion:s.state,postalCode:s.zipCode,addressCountry:"US"},offers:{"@type":"Offer",price:s.price,priceCurrency:"USD",availability:s.status==="active"?"https://schema.org/InStock":"https://schema.org/SoldOut"},numberOfRooms:s.bedrooms,numberOfBathroomsTotal:Number(s.bathrooms),floorSize:{"@type":"QuantitativeValue",value:s.sqft,unitCode:"FTK"}}:void 0,additionalStructuredData:s?[{"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://savely.io"},{"@type":"ListItem",position:2,name:"Browse Properties",item:"https://savely.io/browse"},{"@type":"ListItem",position:3,name:s.title,item:`https://savely.io/listing/${s.id}`}]}]:void 0}),e.jsx("nav",{className:"sticky top-0 z-50 backdrop-blur-md bg-background/80 border-b",children:e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"flex items-center justify-between gap-4 h-16",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(n,{href:"/browse",children:e.jsx(l,{variant:"ghost",size:"icon","data-testid":"button-back",children:e.jsx(b,{className:"h-4 w-4"})})}),e.jsx("span",{className:"font-semibold truncate",children:s.title})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(z,{}),e.jsx(n,{href:"/",children:e.jsxs("div",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx(m,{className:"h-5 w-5 text-primary"}),e.jsx("span",{className:"font-bold hidden sm:inline",children:"Savely.io"})]})})]})]})})}),e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[(()=>{const t=!!(s.agent?.trialEndsAt&&new Date(s.agent.trialEndsAt)>new Date);return e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2 mb-8 rounded-md overflow-hidden",children:[e.jsxs("div",{className:"md:row-span-2 relative",children:[e.jsx("img",{src:x[0],alt:s.title,className:"w-full h-full object-cover min-h-[300px] md:min-h-[400px]"}),t&&e.jsxs("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:[e.jsx("div",{className:"bg-black/25 absolute inset-0"}),e.jsx("span",{className:"relative text-white/70 text-sm font-bold tracking-widest uppercase rotate-[-30deg] select-none border border-white/40 px-4 py-2 rounded",children:"SAVELY.IO TRIAL"})]})]}),x.slice(1,3).map((h,j)=>e.jsxs("div",{className:"relative",children:[e.jsx("img",{src:h,alt:`${s.title} - ${j+2}`,className:"w-full h-48 md:h-[198px] object-cover"}),t&&e.jsxs("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:[e.jsx("div",{className:"bg-black/25 absolute inset-0"}),e.jsx("span",{className:"relative text-white/60 text-xs font-bold tracking-widest uppercase rotate-[-30deg] select-none border border-white/30 px-3 py-1 rounded",children:"SAVELY.IO TRIAL"})]})]},j)),x.length<=1&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"bg-muted flex items-center justify-center h-48 md:h-[198px]",children:e.jsx(m,{className:"h-8 w-8 text-muted-foreground/30"})}),e.jsx("div",{className:"bg-muted flex items-center justify-center h-48 md:h-[198px]",children:e.jsx(m,{className:"h-8 w-8 text-muted-foreground/30"})})]})]})})(),e.jsxs("div",{className:"grid lg:grid-cols-3 gap-8",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-8",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4 mb-2",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl sm:text-3xl font-bold","data-testid":"text-listing-title",children:s.title}),e.jsxs("div",{className:"flex items-center gap-1 text-muted-foreground mt-1",children:[e.jsx(B,{className:"h-4 w-4"}
1),e.jsxs("span",{"data-testid":"text-listing-address",children:[s.address,", ",s.city,", ",s.state," ",s.zipCode]})]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("p",{className:"text-3xl font-bold text-primary","data-testid":"text-listing-price",children:p(s.price)}),e.jsx("div",{className:"lg:hidden mt-2",children:u})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3 mt-4",children:[e.jsx(o,{variant:"secondary",children:s.propertyType}),e.jsx(o,{variant:s.status==="active"?"default":"secondary",children:s.status})]})]}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:[{icon:U,label:a("listing","bedrooms"),value:s.bedrooms},{icon:R,label:a("listing","bathrooms"),value:Number(s.bathrooms)},{icon:q,label:a("listing","squareFeet"),value:W(s.sqft)},{icon:E,label:a("listing","yearBuilt"),value:s.yearBuilt||"N/A"}].map(t=>e.jsxs(d,{className:"p-4 text-center",children:[e.jsx(t.icon,{className:"h-5 w-5 text-primary mx-auto mb-1"}),e.jsx("p",{className:"text-lg font-bold",children:t.value}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t.label})]},t.label))}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold mb-3",children:a("listing","description")}),e.jsx("p",{className:"text-muted-foreground leading-relaxed whitespace-pre-wrap","data-testid":"text-listing-description",children:s.description})]}),s.features&&s.features.length>0&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold mb-3",children:"Features"}),e.jsx("div",{className:"grid sm:grid-cols-2 gap-2",children:s.features.map((t,h)=>e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(O,{className:"h-4 w-4 text-primary flex-shrink-0"}),e.jsx("span",{children:t})]},h))})]}),s.lotSize&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(P,{className:"h-4 w-4"}),e.jsxs("span",{children:["Lot Size: ",Number(s.lotSize).toLocaleString()," sq ft"]})]})]}),e.jsxs("div",{className:"space-y-6",children:[s.agent&&e.jsxs(d,{className:"p-6 space-y-4",children:[e.jsx("h3",{className:"font-semibold",children:a("listing","listedBy")}),e.jsxs("div",{className:"flex items-center gap-3",children:[s.agent.profileImageUrl?e.jsx("img",{src:s.agent.profileImageUrl,alt:`${s.agent.firstName||""} ${s.agent.lastName||""} - Real Estate Agent`.trim(),className:"h-12 w-12 rounded-full object-cover"}):e.jsx("div",{className:"h-12 w-12 rounded-full bg-primary/10 flex items-center justify-center",children:e.jsx("span",{className:"text-primary font-bold",children:(s.agent.firstName?.[0]||"")+(s.agent.lastName?.[0]||"")})}),e.jsxs("div",{children:[e.jsxs("p",{className:"font-medium","data-testid":"text-agent-name",children:[s.agent.firstName," ",s.agent.lastName]}),s.agent.email&&e.jsx("p",{className:"text-sm text-muted-foreground",children:s.agent.email})]})]})]}),g.length>0&&e.jsxs(d,{className:"p-6 space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(V,{className:"h-5 w-5 text-primary"}),e.jsx("h3",{className:"font-semibold",children:a("listing","scheduledShowings")})]}),e.jsx("div",{className:"space-y-3",children:g.map(t=>e.jsx(n,{href:`/live/${t.id}`,children:e.jsxs("div",{className:"p-3 rounded-md bg-muted hover-elevate cursor-pointer space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[t.status==="live"&&e.jsxs(o,{variant:"destructive",className:"gap-1",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-white animate-pulse"})," LIVE"]}),t.status==="scheduled"&&e.jsx(o,{variant:"secondary",children:a("liveShowing","scheduled")})]}),e.jsx("p",{className:"text-sm font-medium",children:t.title}),e.jsx("p",{className:"text-xs text-muted-foreground",children:new Date(t.scheduledAt).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})})]})},t.id))})]})]})]})]})]})}export{X 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.