1import{s as L,v as I,ax as A,r as B,t as l,g as b,j as e,aw as D,e as Q,K as P,L as o,E as R,H as m,M as f,D as S,ar as E,T as y,O as v}from"./index-DxpMJHht.js";import{R as K}from"./ruler-B6XtE2y1.js";function w(s){return s?s>=1e4?`HK$${(s/1e4).toFixed(0)}è¬`:`HK$${s.toLocaleString()}`:"广 ¼å¾
è°"}function z(s){return s?`${s} å`:"â"}const U=["æ¦è¦½","å¨å®ç¤æº","æäº¤ç´é","æ¶åå"];function q(){const{id:s}=L(),{user:u}=I(),p=A(),[r,d]=B.useState("æ¦è¦½"),{data:a,isLoading:k}=l.estates.detail.useQuery({id:Number(s)},{enabled:!!s,staleTime:3e5}),{data:c}=l.properties.listFull.useQuery({keyword:a?.name,limit:12,offset:0},{enabled:!!a?.name,staleTime:12e4}),{data:$}=l.transactions.list.useQuery({estateId:Number(s),limit:20,offset:0},{enabled:!!s,staleTime:3e5}),{data:C}=l.brochures.detail.useQuery({id:Number(s)},{enabled:!!s,staleTime:3e5}),{data:F,refetch:T}=l.estateFollows.check.useQuery({estateId:Number(s)},{enabled:!!u&&!!s,staleTime:3e4}),H=l.useUtils(),N=l.estateFollows.toggle.useMutation({onSuccess:t=>{T(),H.estateFollows.list.invalidate(),b.success(t.isFollowing?`已鿳¨ ${a?.name}`:`已忶鿳¨ ${a?.name}`)},onError:()=>b.error("æä½å¤±æï¼è«ç¨å¾å試")}),h=F?.isFollowing??!1,n=c?.items??[],g=$?.items??[],j=C?.floorPlans??[],i=a?.name??`å±è #${s}`;return k?e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:87",className:"min-h-screen bg-gray-50",children:[p&&e.jsx(D,{"data-loc":"client/src/pages/EstateDetailPage.tsx:88"}),e.jsx("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:89",className:"flex items-center justify-center min-h-[60vh]",children:e.jsx(Q,{"data-loc":"client/src/pages/EstateDetailPage.tsx:90",className:"animate-spin text-orange-500",size:40})})]}):a?e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:113",className:"min-h-screen bg-gray-50",children:[p&&e.jsx(D,{"data-loc":"client/src/pages/EstateDetailPage.tsx:114"}),e.jsx("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:117",className:"bg-gradient-to-r from-orange-500 to-orange-600 text-white",children:e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:118",className:"max-w-6xl mx-auto px-4 py-6",children:[e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:120",className:"flex items-center gap-2 text-orange-100 text-sm mb-3",children:[e.jsxs(o,{"data-loc":"client/src/pages/EstateDetailPage.tsx:121",href:"/",className:"hover:text-white flex items-center gap-1",children:[e.jsx(m,{"data-loc":"client/src/pages/EstateDetailPage.tsx:122",size:14})," é¦é "]}),e.jsx("span",{"data-loc":"client/src/pages/EstateDetailPage.tsx:124",children:"/"}),e.jsx("span",{"data-loc":"client/src/pages/EstateDetailPage.tsx:125",className:"text-white font-medium",children:i})]}),e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:128",className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:129",children:[e.jsx("h1",{"data-loc":"client/src/pages/EstateDetailPage.tsx:130",className:"text-2xl md:text-3xl font-bold mb-2",children:i}),a.street&&e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:132",className:"flex items-center gap-1 text-orange-100",children:[e.jsx(f,{"data-loc":"client/src/pages/EstateDetailPage.tsx:133",size:14}),e.jsx("span",{"data-loc":"client/src/pages/EstateDetailPage.tsx:134",className:"text-sm",children:a.street})]}),e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:138",className:"flex items-center gap-4 mt-3 text-sm",children:[e.jsx("span",{"data-loc":"client/src/pages/EstateDetailPage.tsx:139",className:"bg-white/20 rounded-full px-3 py-1",children:n.length>0?`${c?.total??n.length} åå¨å®ç¤æº`:"æ«ç¡å¨å®ç¤æº"}),g.length>0&&e.jsxs("span",{"data-loc":"client/src/pages/EstateDetailPage.tsx:143",className:"bg-white/20 rounded-full px-3 py-1",children:[g.length," çæäº¤è¨é"]})]})]}),u&&e.jsxs("button",{"data-loc":"client/src/pages/EstateDetailPage.tsx:152",onClick:()=>N.mutate({estateId:Number(s)}),disabled:N.isPending,className:`flex items-center gap-2 px-4 py-2 rounded-full font-medium text-sm transition-all ${h?"bg-white text-orange-500 hover:bg-orange-50":"bg-white/20 text-white hover:bg-white/30 border border-white/40"}`,children:[e.jsx(S,{"data-loc":"client/src/pages/EstateDetailPage.tsx:161",size:16,className:h?"fill-orange-500":""}),h?"已鿳¨":"éæ³¨å±è"]})]})]})}),e.jsx("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:170",className:"bg-white border-b border-gray-200 sticky top-0 z-10",children:e.jsx("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:171",className:"max-w-6xl mx-auto px-4",children:e.jsx("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:172",className:"flex gap-0",children:U.map(t=>e.jsx("button",{"data-loc":"client/src/pages/EstateDetailPage.tsx:174",onClick:()=>d(t),className:`px-5 py-4 text-sm font-medium border-b-2 transition-all ${r===t?"border-orange-500 text-orange-600":"border-transparent text-gray-500 hover:text-gray-700"}`,children:t},t))})})}),e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:191",className:"max-w-6xl mx-auto px-4 py-6",children:[r==="æ¦è¦½"&&e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:195",className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:197",className:"md:col-span-2 space-y-4",children:[e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:198",className:"bg-white rounded-xl shadow-sm p-5",children:[e.jsxs("h2",{"data-loc":"client/src/pages/EstateDetailPage.tsx:199",className:"text-base font-semibold text-gray-800 mb
1-4 flex items-center gap-2",children:[e.jsx(P,{"data-loc":"client/src/pages/EstateDetailPage.tsx:200",size:18,className:"text-orange-500"})," å±èè³æ"]}),e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:202",className:"grid grid-cols-2 gap-3 text-sm",children:[a.street&&e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:204",children:[e.jsx("span",{"data-loc":"client/src/pages/EstateDetailPage.tsx:205",className:"text-gray-500",children:"è¡é"}),e.jsx("p",{"data-loc":"client/src/pages/EstateDetailPage.tsx:206",className:"font-medium text-gray-800 mt-0.5",children:a.street})]}),a.developer&&e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:210",children:[e.jsx("span",{"data-loc":"client/src/pages/EstateDetailPage.tsx:211",className:"text-gray-500",children:"ç¼å±å"}),e.jsx("p",{"data-loc":"client/src/pages/EstateDetailPage.tsx:212",className:"font-medium text-gray-800 mt-0.5",children:a.developer})]}),a.totalBlocks&&e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:216",children:[e.jsx("span",{"data-loc":"client/src/pages/EstateDetailPage.tsx:217",className:"text-gray-500",children:"座æ¸"}),e.jsxs("p",{"data-loc":"client/src/pages/EstateDetailPage.tsx:218",className:"font-medium text-gray-800 mt-0.5",children:[a.totalBlocks," 座"]})]}),a.completionYear&&e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:222",children:[e.jsx("span",{"data-loc":"client/src/pages/EstateDetailPage.tsx:223",className:"text-gray-500",children:"è½æå¹´ä»½"}),e.jsxs("p",{"data-loc":"client/src/pages/EstateDetailPage.tsx:224",className:"font-medium text-gray-800 mt-0.5",children:[a.completionYear," å¹´"]})]})]})]}),a.blocks&&a.blocks.length>0&&e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:232",className:"bg-white rounded-xl shadow-sm p-5",children:[e.jsxs("h2",{"data-loc":"client/src/pages/EstateDetailPage.tsx:233",className:"text-base font-semibold text-gray-800 mb-4 flex items-center gap-2",children:[e.jsx(P,{"data-loc":"client/src/pages/EstateDetailPage.tsx:234",size:18,className:"text-orange-500"})," 座æ¸"]}),e.jsx("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:236",className:"grid grid-cols-2 md:grid-cols-3 gap-3",children:a.blocks.map(t=>e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:238",className:"bg-gray-50 rounded-lg p-3 text-sm",children:[e.jsx("p",{"data-loc":"client/src/pages/EstateDetailPage.tsx:239",className:"font-medium text-gray-800",children:t.name}),t.totalFloors&&e.jsxs("p",{"data-loc":"client/src/pages/EstateDetailPage.tsx:241",className:"text-gray-500 text-xs mt-0.5",children:[t.totalFloors," 層"]})]},t.id))})]})]}),e.jsx("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:251",className:"space-y-4",children:e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:252",className:"bg-white rounded-xl shadow-sm p-5",children:[e.jsx("h2",{"data-loc":"client/src/pages/EstateDetailPage.tsx:253",className:"text-base font-semibold text-gray-800 mb-3",children:"å¿«éæä½"}),e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:254",className:"space-y-2",children:[e.jsxs("button",{"data-loc":"client/src/pages/EstateDetailPage.tsx:255",onClick:()=>d("å¨å®ç¤æº"),className:"w-full flex items-center justify-between px-3 py-2.5 bg-orange-50 text-orange-600 rounded-lg text-sm font-medium hover:bg-orange-100 transition-colors",children:[e.jsxs("span",{"data-loc":"client/src/pages/EstateDetailPage.tsx:259",className:"flex items-center gap-2",children:[e.jsx(m,{"data-loc":"client/src/pages/EstateDetailPage.tsx:259",size:15})," æ¥çå¨å®ç¤æº"]}),e.jsx(E,{"data-loc":"client/src/pages/EstateDetailPage.tsx:260",size:14})]}),e.jsxs("button",{"data-loc":"client/src/pages/EstateDetailPage.tsx:262",onClick:()=>d("æäº¤ç´é"),className:"w-full flex items-center justify-between px-3 py-2.5 bg-blue-50 text-blue-600 rounded-lg text-sm font-medium hover:bg-blue-100 transition-colors",children:[e.jsxs("span",{"data-loc":"client/src/pages/EstateDetailPage.tsx:266",className:"flex items-center gap-2",children:[e.jsx(y,{"data-loc":"client/src/pages/EstateDetailPage.tsx:266",size:15})," æäº¤ç´é"]}),e.jsx(E,{"data-loc":"client/src/pages/EstateDetailPage.tsx:267",size:14})]}),j.length>0&&e.jsxs("button",{"data-loc":"client/src/pages/EstateDetailPage.tsx:270",onClick:()=>d("æ¶åå"),className:"w-full flex items-center justify-between px-3 py-2.5 bg-green-50 text-green-600 rounded-lg text-sm font-medium hover:bg-green-100 transition-colors",children:[e.jsxs("span",{"data-loc":"client/src/pages/EstateDetailPage.tsx:274",className:"flex items-center gap-2",children:[e.jsx(v,{"data-loc":"client/src/pages/EstateDetailPage.tsx:274",size:15})," æ¶åå"]}),e.jsx(E,{"data-loc":"client/src/pages/EstateDetailPage.tsx:275",size:14})]})]})]})})]}),r==="å¨å®ç¤æº"&&e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:286",children:[e.jsx("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:287",className:"flex items-center justify-between mb-4",children:e.jsxs("h2",{"data-loc":"client/src/pages/EstateDetailPage.tsx:288",className:"text-base font-semibold text-gray-800",children:[i," å¨å®ç¤æº",c?.total?e.jsxs("span",{"data-loc":"client/src/pages/EstateDetailPage.tsx:290",className:"text-gray-400 font-normal ml-2",children:["å
± ",c.total," å"]}):null]})}),n.length===0?e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:294",className:"bg-white rounded-xl shadow-sm p-12 text-center",children:[e.jsx(m,{"data-loc":"client/src/pages/EstateDetailPage.tsx:295",size:40,className:"text-gray-200 mx-auto mb-3"}),e.jsx("p",{"data-loc":"client/src/pages/EstateDetailPage.tsx:296",className:"text-gray-400",children:"æ«ç¡å¨å®ç¤æº"})]}):e.jsx("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:299",className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:n.map(t=>e.jsx(o,{"data-loc":"client/src/pages/EstateDetailPage.tsx:301",href:`/property/${t.id}`,children:e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:302",className:"bg-white rounded-xl shadow-sm overflow-hidden hover:shadow-md transition-shadow cursor-pointer",children:[t.coverImage?e.jsx("img",{"data-loc":"client/src/pages/EstateDetailPage.tsx:304",src:t.coverImage,alt:t.title,className:"w-full h-44 object-cover",loading:"lazy"}):e.jsx("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:306",className:"w-full h-44 bg-gray-100 flex items-center justify-center",children:e.jsx(m,{"data-loc":"client/src/pages/EstateDetailPage.tsx:307",size:32,className:"text-gray-300"})}),e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:310",className:"p-3",children:[e.jsx("p",{"data-loc":"client/src/pages/EstateDetailPage.tsx:311",className:"font-semibold text-gray-800 text-sm line-clamp-1",children:t.title}),e.jsx("p",{"data-loc":"client/src/pages/EstateDetailPage.tsx:312",className:"text-orange-500 font-bold mt-1",children:w(t.price)}),e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:313",className:"flex items-center gap-3 text-xs text-gray-500 mt-1.5",children:[t.area&&e.jsxs("span",{"data-loc":"client/src/pages/EstateDetailPage.tsx:314",className:"flex items-center gap-0.5",children:[e.jsx(K,{"data-loc":"client/src/pages/EstateDetailPage.tsx:314",size:11}),z(t.area)]}),t.district&&e.jsxs("span",{"data-loc":"client/src/pages/EstateDetailPage.tsx:315",className:"flex items-center gap-0.5",children:[e.jsx(f,{"data-loc":"client/src/pages/EstateDetailPage.tsx:315",size:11}),t.district]})]})]})]})},t.id))}),(c?.total??0)>n.length&&e.jsx("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:324",className:"text-center mt-6",children:e.jsx(o,{"data-loc":"client/src/pages/EstateDetailPage.tsx:325",href:`/listings?ke
1yword=${encodeURIComponent(i)}`,children:e.jsxs("button",{"data-loc":"client/src/pages/EstateDetailPage.tsx:326",className:"px-6 py-2.5 bg-orange-500 text-white rounded-full text-sm font-medium hover:bg-orange-600 transition-colors",children:["æ¥çå
¨é¨ ",c?.total," åç¤æº â"]})})})]}),r==="æäº¤ç´é"&&e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:337",children:[e.jsxs("h2",{"data-loc":"client/src/pages/EstateDetailPage.tsx:338",className:"text-base font-semibold text-gray-800 mb-4",children:[i," æäº¤ç´é"]}),g.length===0?e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:342",className:"bg-white rounded-xl shadow-sm p-12 text-center",children:[e.jsx(y,{"data-loc":"client/src/pages/EstateDetailPage.tsx:343",size:40,className:"text-gray-200 mx-auto mb-3"}),e.jsx("p",{"data-loc":"client/src/pages/EstateDetailPage.tsx:344",className:"text-gray-400",children:"æ«ç¡æäº¤ç´é"})]}):e.jsx("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:347",className:"bg-white rounded-xl shadow-sm overflow-hidden",children:e.jsxs("table",{"data-loc":"client/src/pages/EstateDetailPage.tsx:348",className:"w-full text-sm",children:[e.jsx("thead",{"data-loc":"client/src/pages/EstateDetailPage.tsx:349",children:e.jsxs("tr",{"data-loc":"client/src/pages/EstateDetailPage.tsx:350",className:"bg-gray-50 border-b border-gray-100",children:[e.jsx("th",{"data-loc":"client/src/pages/EstateDetailPage.tsx:351",className:"text-left px-4 py-3 text-gray-500 font-medium",children:"å®ä½"}),e.jsx("th",{"data-loc":"client/src/pages/EstateDetailPage.tsx:352",className:"text-left px-4 py-3 text-gray-500 font-medium",children:"æäº¤å¹"}),e.jsx("th",{"data-loc":"client/src/pages/EstateDetailPage.tsx:353",className:"text-left px-4 py-3 text-gray-500 font-medium",children:"é¢ç©"}),e.jsx("th",{"data-loc":"client/src/pages/EstateDetailPage.tsx:354",className:"text-left px-4 py-3 text-gray-500 font-medium hidden md:table-cell",children:"æäº¤æ¥æ"})]})}),e.jsx("tbody",{"data-loc":"client/src/pages/EstateDetailPage.tsx:357",children:g.map((t,x)=>e.jsxs("tr",{"data-loc":"client/src/pages/EstateDetailPage.tsx:359",className:"border-b border-gray-50 hover:bg-gray-50 transition-colors",children:[e.jsx("td",{"data-loc":"client/src/pages/EstateDetailPage.tsx:360",className:"px-4 py-3 text-gray-800",children:t.unitNumber||t.floor||"â"}),e.jsx("td",{"data-loc":"client/src/pages/EstateDetailPage.tsx:361",className:"px-4 py-3 font-semibold text-orange-500",children:w(t.price)}),e.jsx("td",{"data-loc":"client/src/pages/EstateDetailPage.tsx:362",className:"px-4 py-3 text-gray-600",children:z(t.area)}),e.jsx("td",{"data-loc":"client/src/pages/EstateDetailPage.tsx:363",className:"px-4 py-3 text-gray-500 hidden md:table-cell",children:t.transactionDate?new Date(t.transactionDate).toLocaleDateString("zh-HK"):"â"})]},x))})]})})]}),r==="æ¶åå"&&e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:377",children:[e.jsxs("h2",{"data-loc":"client/src/pages/EstateDetailPage.tsx:378",className:"text-base font-semibold text-gray-800 mb-4",children:[i," æ¶åå"]}),j.length===0?e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:382",className:"bg-white rounded-xl shadow-sm p-12 text-center",children:[e.jsx(v,{"data-loc":"client/src/pages/EstateDetailPage.tsx:383",size:40,className:"text-gray-200 mx-auto mb-3"}),e.jsx("p",{"data-loc":"client/src/pages/EstateDetailPage.tsx:384",className:"text-gray-400",children:"æ«ç¡æ¶åå"})]}):e.jsx("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:387",className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:j.map((t,x)=>e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:389",className:"bg-white rounded-xl shadow-sm overflow-hidden",children:[e.jsx("img",{"data-loc":"client/src/pages/EstateDetailPage.tsx:390",src:t.url||t.imageUrl,alt:t.name||`æ¶åå ${x+1}`,className:"w-full object-contain max-h-64",loading:"lazy"}),t.name&&e.jsx("p",{"data-loc":"client/src/pages/EstateDetailPage.tsx:391",className:"px-3 py-2 text-sm text-gray-600",children:t.name})]},x))})]})]})]}):e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:98",className:"min-h-screen bg-gray-50",children:[p&&e.jsx(D,{"data-loc":"client/src/pages/EstateDetailPage.tsx:99"}),e.jsxs("div",{"data-loc":"client/src/pages/EstateDetailPage.tsx:100",className:"flex flex-col items-center justify-center min-h-[60vh] gap-4",children:[e.jsx(P,{"data-loc":"client/src/pages/EstateDetailPage.tsx:101",size:48,className:"text-gray-300"}),e.jsx("p",{"data-loc":"client/src/pages/EstateDetailPage.tsx:102",className:"text-gray-500 text-lg",children:"æ¾ä¸å°æ¤å±è"}),e.jsxs(o,{"data-loc":"client/src/pages/EstateDetailPage.tsx:103",href:"/",className:"text-orange-500 hover:underline flex items-center gap-1",children:[e.jsx(R,{"data-loc":"client/src/pages/EstateDetailPage.tsx:104",size:16})," è¿åé¦é "]})]})]})}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.