PageSourceSearch

https://nestmatch-app-v3.vercel.app/_next/static/chunks/app/your-results/page-7007643ca7e93934.js

js nestmatch-app-v3.vercel.app collected 2026-10-03 07:22:47 UTC 25,163 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="10bc4595-7483-4695-a682-6868763a90b5",e._sentryDebugIdIdentifier="sentry-dbid-10bc4595-7483-4695-a682-6868763a90b5")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3596],{34789:function(e,t,r){Promise.resolve().then(r.bind(r,97233))},76858:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});let l=(0,r(79205).Z)("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},40875:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});let l=(0,r(79205).Z)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},22135:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});let l=(0,r(79205).Z)("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},91723:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});let l=(0,r(79205).Z)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},41905:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});let l=(0,r(79205).Z)("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]])},88997:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});let l=(0,r(79205).Z)("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]])},14938:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});let l=(0,r(79205).Z)("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]])},83774:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});let l=(0,r(79205).Z)("MapPin",[["path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z",key:"2oe9fu"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]])},75255:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});let l=(0,r(79205).Z)("PoundSterling",[["path",{d:"M18 7c0-5.333-8-5.333-8 0",key:"1prm2n"}],["path",{d:"M10 7v14",key:"18tmcs"}],["path",{d:"M6 21h12",key:"4dkmi1"}],["path",{d:"M6 13h10",key:"ybwr4a"}]])},73247:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});let l=(0,r(79205).Z)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},82023:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});let l=(0,r(79205).Z)("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]])},64908:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});let l=(0,r(79205).Z)("TramFront",[["rect",{width:"16",height:"16",x:"4",y:"3",rx:"2",key:"1wxw4b"}],["path",{d:"M4 11h16",key:"mpoxn0"}],["path",{d:"M12 3v8",key:"1h2ygw"}],["path",{d:"m8 19-2 3",key:"13i0xs"}],["path",{d:"m18 22-2-3",key:"1p0ohu"}],["path",{d:"M8 15h.01",key:"a7atzg"}],["path",{d:"M16 15h.01",key:"rnfrdf"}]])},18930:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});let l=(0,r(79205).Z)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},27648:function(e,t,r){"use strict";r.d(t,{default:function(){return s.a}});var l=r(72972),s=r.n(l)},97233:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return j}});
1var l=r(57437),s=r(2265),n=r(1188),a=r(27648),i=r(80605),o=r(88997),c=r(76858),d=r(83774),u=r(82023),h=r(18930),m=r(41905),f=r(22135),x=r(40875),g=r(73247),p=r(75255),y=r(14938),b=r(64908),v=r(91723),k=r(265);function j(){var e,t,r;let{data:j}=(0,i.useSession)(),[w,N]=s.useState(!1),[S,Z]=s.useState(!1),I=(0,k.n)(),E=I.likes,T=w?E:E.slice(0,3),[M,C]=s.useState(null),D=function(e){let[t,r]=s.useState({}),l=e.join(",");return s.useEffect(()=>{if(!l){r({});return}let e=!1;return fetch("/api/images?slugs=".concat(encodeURIComponent(l))).then(e=>e.ok?e.json():null).then(t=>{!e&&(null==t?void 0:t.images)&&r(t.images)}).catch(()=>{}),()=>{e=!0}},[l]),t}(E.map(e=>e.slug)),_=s.useCallback(e=>{if(!M||M===e)return;let t=E.map(e=>e.slug),r=t.indexOf(M),l=t.indexOf(e);if(r<0||l<0)return;let[s]=t.splice(r,1);t.splice(l,0,s),I.reorderLikes(t),C(null)},[M,E,I]),[A,L]=s.useState([]),[P,z]=s.useState(!1),[O,F]=s.useState(!1),[R,U]=s.useState(""),[V,Y]=s.useState(!1),[q,H]=s.useState(null);s.useEffect(()=>{var e;if(!(null==j?void 0:null===(e=j.user)||void 0===e?void 0:e.id)){L([]);return}let t=!1;return z(!0),fetch("/api/searches",{credentials:"include"}).then(e=>e.ok?e.json():{searches:[]}).then(e=>{var r;t||L(null!==(r=e.searches)&&void 0!==r?r:[])}).catch(()=>{t||L([])}).finally(()=>{t||z(!1)}),()=>{t=!0}},[null==j?void 0:null===(e=j.user)||void 0===e?void 0:e.id]);let B=(null==j?void 0:null===(t=j.user)||void 0===t?void 0:t.name)||"Explorer",W=async()=>{if("DELETE"===R.trim()){Y(!0),H(null);try{let t=await fetch("/api/account/delete",{method:"DELETE",credentials:"include"});if(!t.ok){var e;let r=await t.json().catch(()=>({}));H(null!==(e=r.error)&&void 0!==e?e:"Something went wrong"),Y(!1);return}await (0,i.signOut)({callbackUrl:"/"})}catch(e){H("Network error — please try again."),Y(!1)}}};return(0,l.jsx)("main",{className:"min-h-screen relative bg-background",children:(0,l.jsxs)("div",{className:"relative z-10 max-w-3xl mx-auto px-5 md:px-8 py-8 md:py-12",children:[(0,l.jsxs)(n.E.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.6},className:"text-center",children:[(0,l.jsxs)("p",{className:"nm-eyebrow mb-3",children:["Welcome back, ",B]}),(0,l.jsxs)("h1",{className:"font-serif text-h1 text-forest",children:["Your ",(0,l.jsx)("em",{className:"not-italic font-serif italic text-sage",children:"results"})]}),(0,l.jsx)("p",{className:"text-sm text-forest/60 mt-3.5 max-w-sm mx-auto leading-relaxed",children:"Every area you’ve saved, and every search you’ve run — all in one place."})]}),(0,l.jsxs)(n.E.section,{className:"mt-10",initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{delay:.15,duration:.6},children:[(0,l.jsx)("span",{className:"nm-eyebrow block mb-2",children:"Your matches"}),(0,l.jsx)("h2",{className:"font-serif text-h2 text-forest mb-5",children:"Saved areas"}),I.loading&&0===E.length?(0,l.jsx)("div",{className:"rounded-card border border-stone bg-cardSurface p-8 text-center text-sm text-forest/55",children:"Loading your saved areas…"}):0===E.length?(0,l.jsxs)("div",{className:"rounded-card border border-dashed border-stone bg-sand/40 p-8 text-center",children:[(0,l.jsx)(o.Z,{className:"w-5 h-5 text-forest/40 mx-auto mb-3",strokeWidth:1.6}),(0,l.jsx)("p",{className:"text-sm text-forest/70",children:"Save areas you love from your search results to see them here."}),(0,l.jsxs)(a.default,{href:"/results",className:"mt-4 inline-flex items-center gap-1.5 text-sm text-sage hover:text-forest transition-colors",children:["Explore results ",(0,l.jsx)(c.Z,{className:"w-3.5 h-3.5"})]})]}):(0,l.jsx)("div",{className:"space-y-3",children:T.map((e,t)=>{var r;let s=0===t,i=null!==(r=e.matchScore)&&void 0!==r?r:null,o=e.regionLabel||e.districtBorough||e.countyUnitary||"",c=D[e.slug];return(0,l.jsxs)(n.E.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.2+.08*t},draggable:!0,onDragStart:()=>C(e.slug),onDragOver:e=>{e.preventDefault()},onDrop:()=>_(e.slug),onDragEnd:()=>C(null),className:"group relative flex flex-col overflow-hidden rounded-card border bg-cardSurface shadow-soft transition-all duration-500 ease-editorial hover:shadow-medium hover:-translate-y-0.5 sm:flex-row ".concat(s?"border-sage/40":"border-stone/60"," ").concat(M===e.slug?"opacity-50":""),children:[(0,l.jsxs)(a.default,{href:e.searchId?"/results/".concat(e.slug,"?searchId=").concat(encodeURIComponent(e.searchId)):"/results/".concat(e.slug),className:"relative h-36 w-full flex-shrink-0 overflow-hidden bg-sand sm:h-auto sm:w-40 md:w-48",draggable:!1,
1children:[c?(0,l.jsx)("img",{src:c.thumbnailUrl||c.url,alt:"".concat(e.name||e.slug," neighbourhood"),className:"absolute inset-0 h-full w-full object-cover transition-transform duration-[1.2s] ease-editorial [@media(hover:hover)]:group-hover:scale-[1.03]",loading:"lazy",draggable:!1}):(0,l.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-sand",children:(0,l.jsx)(d.Z,{className:"h-6 w-6 text-forest/25","aria-hidden":!0})}),(0,l.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-forest/75 via-forest/10 to-transparent"}),(0,l.jsx)("span",{className:"absolute left-3 top-2.5 font-serif text-2xl leading-none tracking-tight text-cream drop-shadow-[0_2px_8px_rgba(31,42,35,0.5)]",children:String(t+1).padStart(2,"0")}),s&&(0,l.jsxs)("span",{className:"absolute right-3 top-2.5 inline-flex items-center gap-1 rounded-pill border border-cream/70 bg-cream/90 px-2 py-0.5 text-micro font-medium uppercase tracking-eyebrow text-forest backdrop-blur-sm",children:[(0,l.jsx)(u.Z,{className:"h-2.5 w-2.5 text-accent","aria-hidden":!0}),"Top pick"]})]}),(0,l.jsxs)("div",{className:"flex flex-1 min-w-0 items-center gap-3 p-4",children:[(0,l.jsxs)(a.default,{href:e.searchId?"/results/".concat(e.slug,"?searchId=").concat(encodeURIComponent(e.searchId)):"/results/".concat(e.slug),className:"flex-1 min-w-0",draggable:!1,children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-serif text-h4 text-forest truncate",children:e.name||e.slug}),null!==i&&(0,l.jsxs)("span",{className:"nm-chip-match whitespace-nowrap",children:[i,"% match"]})]}),o&&(0,l.jsx)("p",{className:"mt-0.5 text-xs text-forest/55 truncate",children:o})]}),(0,l.jsx)("button",{type:"button",onClick:()=>I.toggleLike(e.slug),"aria-label":"Delete ".concat(e.name||e.slug," from saved"),title:"Delete from saved",className:"flex-shrink-0 w-7 h-7 rounded-pill text-forest/45 hover:text-error hover:bg-error/10 flex items-center justify-center transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-error/40",children:(0,l.jsx)(h.Z,{className:"w-3.5 h-3.5",strokeWidth:1.6})}),(0,l.jsx)("span",{"aria-hidden":!0,className:"hidden flex-shrink-0 h-7 w-7 cursor-grab select-none items-center justify-center rounded-pill border border-stone/60 bg-sand/40 text-forest/45 sm:flex",children:(0,l.jsx)(m.Z,{className:"w-3.5 h-3.5",strokeWidth:1.6})})]})]},e.slug)})}),E.length>3&&(0,l.jsx)("button",{onClick:()=>N(!w),className:"mt-3 w-full flex items-center justify-center gap-1.5 text-xs text-forest/55 hover:text-forest py-2 transition-colors",children:w?(0,l.jsxs)(l.Fragment,{children:["Show fewer ",(0,l.jsx)(f.Z,{className:"w-3 h-3"})]}):(0,l.jsxs)(l.Fragment,{children:["See all ",E.length," saved ",(0,l.jsx)(x.Z,{className:"w-3 h-3"})]})}),(0,l.jsx)("div",{className:"mt-4 flex gap-3",children:(0,l.jsxs)(a.default,{href:"/onboarding",className:"nm-btn-primary flex-1 text-sm flex items-center justify-center gap-2",children:["Retake quiz",(0,l.jsx)(u.Z,{className:"w-4 h-4","aria-hidden":!0})]})})]}),(0,l.jsxs)(n.E.section,{className:"mt-10",initial:{opacity:0,y:16},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6},children:[(0,l.jsx)("span",{className:"nm-eyebrow block mb-2",children:"Search history"}),(0,l.jsx)("h2",{className:"font-serif text-h2 text-forest mb-5",children:"Your recent searches"}),P&&0===A.length?(0,l.jsx)("div",{className:"rounded-card border border-stone bg-cardSurface p-6 text-center text-sm text-forest/55",children:"Loading…"}):0===A.length?(0,l.jsxs)("div",{className:"rounded-card border border-dashed border-stone bg-sand/40 p-8 text-center",children:[(0,l.jsx)(g.Z,{className:"w-5 h-5 text-forest/40 mx-auto mb-3",strokeWidth:1.6}),(0,l.jsx)("p",{className:"text-sm text-forest/70",children:"No searches yet — start exploring."}),(0,l.jsxs)(a.default,{href:"/onboarding",className:"mt-4 inline-flex items-center gap-1.5 text-sm text-sage hover:text-forest transition-colors",children:["Start a search ",(0,l.jsx)(c.Z,{className:"w-3.5 h-3.5"})]})]}):(0,l.jsx)("div",{className:"space-y-2.5",children:(S?A:A.slice(0,3)).map((e,t)=>{var r,s,i,o;let u=new Date(e.createdAt),h=Math.floor((new Date().getTime()-u.getTime())/864e5),m=0===h?"Today":1===h?"Yesterday":h<7?"".concat(h," days ago"):h<14?"Last week":u.toLocaleDateString(),f={student:"Student",couples_starting_out:"Couple",professionals:"Professional",young_family:"Young family",established_family:"Family",retired:"Retired"},x={city_buzz:"City buzz",suburban_comfort:"Suburban",market_town:"Market town",coastal:"Coastal",rural_countryside:"Countryside",quiet_village:"Village"},k={work:"for work",study:"for study",family:"for family",pace:"pace of life"},j=(null!==(s=e.lifeStage)&&void 0!==s?s:[]).map(e=>{var t;return null!==(t=f[e])&&void 0!==t?t:e}),w=(null!==(i=e.settlementType)&&void 0!==i?i:[]).map(e=>{var t;return null!==(t=x[e])&&void 0!==t?t:e}),N=j.length&&w.length?"".concat(j.slice(0,2).join(" & ")," — ").concat(w.slice(0,2).join(" / ")):j.length?j.slice(0,2).join(" & "):w.length?w.slice(0,2).join(" / "):e.moveReason&&k[e.moveReason]?"Moving ".concat(k[e.moveReason]):"Lifestyle search",S=[],Z=e.accommodation;if((null==Z?void 0:Z.budget)&&(Z.budget.min||Z.budget.max)){let e=e=>"number"==typeof e?e>=1e3?"\xa3".concat(Math.round(e/100)/10,"k"):"\xa3".concat(e):"?",t=Z.budget.min&&Z.budget.max?"".concat(e(Z.budget.min),"–").concat(e(Z.budget.max)):e(null!==(o=Z.budget.min)&&void 0!==o?o:Z.budget.max),r="month"===Z.budget.period?"/mo":"year"===Z.budget.period?"/yr":"";S.push({icon:p.Z,label:"".concat(t).concat(r)})}if(null==Z?void 0:Z.bedrooms){let e=String(Z.bedrooms);S.push({icon:y.Z,label:"".concat(e," bed").concat("1"===e?"":"s")})}else(null==Z?void 0:Z.tenure)&&S.push({icon:y.Z,label:"buy"===Z.tenure?"Buying":"Renting"});let I=(Array.isArray(e.placesToInclude)?e.placesToInclude:[]).map(e=>
1null==e?void 0:e.label).filter(Boolean);I.length&&S.push({icon:d.Z,label:1===I.length?"Near ".concat(I[0]):"Near ".concat(I[0]," +").concat(I.length-1)});let E=Array.isArray(e.commuteDestinations)?e.commuteDestinations:[];if(E.length&&(null===(r=E[0])||void 0===r?void 0:r.label)){let e=E[0];S.push({icon:b.Z,label:e.maxMinutes?"".concat(e.maxMinutes,"m to ").concat(e.label):"Commute: ".concat(e.label)})}let T="completed"===e.status?null:"pending"===e.status||"processing"===e.status?(0,l.jsxs)("span",{className:"nm-chip",children:[(0,l.jsx)(v.Z,{className:"h-3.5 w-3.5 text-forest/55","aria-hidden":!0}),"processing"===e.status?"Processing":"Pending"]}):(0,l.jsx)("span",{className:"inline-flex items-center gap-1.5 rounded-pill border border-error/30 bg-error/10 px-3.5 py-2 text-sm font-medium leading-none text-error",children:"Failed"});return(0,l.jsx)(n.E.div,{initial:{opacity:0,y:10},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{delay:.06*t},children:(0,l.jsxs)(a.default,{href:"/results?searchId=".concat(e.id),className:"block rounded-card border border-stone bg-cardSurface shadow-soft p-4 group transition-all duration-500 ease-editorial hover:shadow-medium hover:-translate-y-0.5",children:[(0,l.jsxs)("div",{className:"flex items-start gap-3.5",children:[(0,l.jsx)("div",{className:"w-10 h-10 rounded-pill border border-stone bg-sand flex items-center justify-center flex-shrink-0",children:(0,l.jsx)(g.Z,{className:"w-4 h-4 text-sage","aria-hidden":!0})}),(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("p",{className:"font-serif text-h4 text-forest truncate",children:N}),T]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,l.jsx)("span",{className:"text-micro text-forest/55",children:m}),(0,l.jsx)("span",{className:"text-micro text-stone",children:"•"}),(0,l.jsxs)("span",{className:"text-micro text-forest/55",children:[e.resultCount," results"]})]})]}),(0,l.jsx)(c.Z,{className:"w-4 h-4 text-stone group-hover:text-sage transition-colors flex-shrink-0 mt-1","aria-hidden":!0})]}),S.length>0&&(0,l.jsx)("div",{className:"mt-3 ml-[3.375rem] flex flex-wrap gap-1.5",children:S.map((e,t)=>{let r=e.icon;return(0,l.jsxs)("span",{className:"nm-chip",children:[(0,l.jsx)(r,{className:"h-3.5 w-3.5 text-sage","aria-hidden":!0}),e.label]},t)})})]})},e.id)})}),A.length>3&&(0,l.jsx)("button",{onClick:()=>Z(!S),className:"mt-3 w-full flex items-center justify-center gap-1.5 text-xs text-forest/55 hover:text-forest py-2 transition-colors",children:S?(0,l.jsxs)(l.Fragment,{children:["Show fewer ",(0,l.jsx)(f.Z,{className:"w-3 h-3"})]}):(0,l.jsxs)(l.Fragment,{children:["Show all ",A.length," searches ",(0,l.jsx)(x.Z,{className:"w-3 h-3"})]})})]}),(0,l.jsxs)(n.E.section,{className:"mt-10",initial:{opacity:0,y:16},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6},children:[(0,l.jsx)("span",{className:"nm-eyebrow block mb-2",children:"Account"}),(0,l.jsx)("h2",{className:"font-serif text-h2 text-forest mb-5",children:"Your data"}),(0,l.jsxs)("div",{className:"rounded-card border border-stone bg-cardSurface shadow-soft p-5",children:[(0,l.jsx)("p",{className:"text-sm text-forest/70",children:(null==j?void 0:null===(r=j.user)||void 0===r?void 0:r.email)?(0,l.jsxs)(l.Fragment,{children:["Signed in as ",(0,l.jsx)("strong",{className:"text-forest",children:j.user.email})]}):(0,l.jsx)(l.Fragment,{children:"Signed in to NestMatch"})}),(0,l.jsxs)("p",{className:"text-xs text-forest/55 mt-1.5 leading-relaxed",children:["You can delete your account and personal data at any time. This permanently removes your saved areas, search history, and feedback. Some anonymised consent records are kept for legal record-keeping. See our"," ",(0,l.jsx)(a.default,{href:"/privacy",className:"underline underline-offset-2 hover:text-forest",children:"Privacy Policy"}),"."]}),O?(0,l.jsxs)("div",{className:"mt-4 rounded-card border border-error/30 bg-error/5 p-4",children:[(0,l.jsx)("p",{className:"text-sm font-medium text-forest",children:"Are you sure?"}),(0,l.jsxs)("p",{className:"text-xs text-forest/60 mt-1 leading-relaxed",children:["This permanently deletes your account and personal data. To confirm, type ",(0,l.jsx)("strong",{children:"DELETE"})," below."]}),(0,l.jsx)("input",{type:"text",value:R,onChange:e=>U(e.target.value),placeholder:"Type DELETE",className:"mt-3 w-full rounded-theme border border-stone/60 bg-cream px-3 py-2 text-sm text-forest placeholder:text-forest/35 focus:outline-none focus:border-error/60 focus:ring-1 focus:ring-error/30"}),q&&(0,l.jsx)("p",{className:"mt-2 text-xs text-error",children:q}),(0,l.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,l.jsx)("button",{type:"button",onClick:W,disabled:V||"DELETE"!==R.trim(),className:"flex-1 rounded-pill bg-error px-4 py-2 text-sm font-medium text-cream transition-colors hover:bg-error/90 disabled:opacity-40 disabled:cursor-not-allowed",children:V?"Deleting…":"Permanently delete"}),(0,l.jsx)("button",{type:"button",onClick:()=>{F(!1),U(""),H(null)},disabled:V,className:"flex-1 rounded-pill border border-stone/60 px-4 py-2 text-sm font-medium text-forest/70 transition-colors hover:border-sage/70 hover:text-forest",children:"Cancel"})]})]}):(0,l.jsxs)("button",{type:"button",onClick:()=>F(!0),className:"mt-4 inline-flex items-center gap-2 rounded-pill border border-error/40 px-4 py-2 text-sm font-medium text-error transition-colors hover:bg-error/10",children:[(0,l.jsx)(h.Z,{className:"w-4 h-4","aria-hidden":!0}),"Delete my data"]})]})]}),(0,l.jsx)("div",{className:"h-12"})]})})}},265:function(e,t,r){"use strict";r.d(t,{n:function(){return o}});var l=r(2265),s=r(80605);let n={likes:[],dislikes:[],bySlug:new Map,loading:!0,error:null};function a(e,t){let r=new Map;for(let t of e)r.set(t.slug,"like");for(let e of t)r.set(e.slug,"dislike");return r}function i(e){return[...e].sort((e,t)=>
1{var r,l,s,n;let a=null!==(r=e.orderIndex)&&void 0!==r?r:Number.POSITIVE_INFINITY,i=null!==(l=t.orderIndex)&&void 0!==l?l:Number.POSITIVE_INFINITY;if(a!==i)return a-i;let o=null!==(s=e.matchScore)&&void 0!==s?s:-1,c=null!==(n=t.matchScore)&&void 0!==n?n:-1;return o!==c?c-o:e.createdAt<t.createdAt?1:-1})}function o(){var e;let{data:t,status:r}=(0,s.useSession)(),o=!!(null==t?void 0:null===(e=t.user)||void 0===e?void 0:e.id),[c,d]=(0,l.useState)(n),u=(0,l.useRef)(c);u.current=c,(0,l.useEffect)(()=>{if("loading"===r)return;if(!o){d({likes:[],dislikes:[],bySlug:new Map,loading:!1,error:null});return}let e=!1;return d(e=>({...e,loading:!0,error:null})),fetch("/api/feedback",{credentials:"include"}).then(e=>e.ok?e.json():Promise.reject(Error("HTTP ".concat(e.status)))).then(t=>{var r,l;if(e)return;let s=i(null!==(r=t.likes)&&void 0!==r?r:[]),n=null!==(l=t.dislikes)&&void 0!==l?l:[];d({likes:s,dislikes:n,bySlug:a(s,n),loading:!1,error:null})}).catch(t=>{e||d(e=>({...e,loading:!1,error:String((null==t?void 0:t.message)||t)}))}),()=>{e=!0}},[o,r]);let h=(0,l.useCallback)(()=>!!o||((0,s.signIn)(void 0,{callbackUrl:window.location.href}),!1),[o]),m=(0,l.useCallback)(async(e,t,r)=>{var l,s,n,o,c,m,f,x,g,p,y,b,v,k,j,w,N,S,Z,I;if(!e||!h())return;let E=u.current;if((null!==(l=E.bySlug.get(e))&&void 0!==l?l:null)===t)return;let T=E.likes.filter(t=>t.slug!==e),M=E.dislikes.filter(t=>t.slug!==e);if("like"===t||"dislike"===t){let l=null!==(s=E.likes.find(t=>t.slug===e))&&void 0!==s?s:E.dislikes.find(t=>t.slug===e),a={slug:e,feedback:t,matchScore:null!==(o=null!==(n=null==r?void 0:r.matchScore)&&void 0!==n?n:null==l?void 0:l.matchScore)&&void 0!==o?o:null,searchId:null!==(m=null!==(c=null==r?void 0:r.searchId)&&void 0!==c?c:null==l?void 0:l.searchId)&&void 0!==m?m:null,orderIndex:"like"===t&&null!==(f=null==l?void 0:l.orderIndex)&&void 0!==f?f:null,createdAt:null!==(x=null==l?void 0:l.createdAt)&&void 0!==x?x:new Date().toISOString(),updatedAt:new Date().toISOString(),name:null!==(p=null!==(g=null==r?void 0:r.name)&&void 0!==g?g:null==l?void 0:l.name)&&void 0!==p?p:null,regionLabel:null!==(b=null!==(y=null==r?void 0:r.regionLabel)&&void 0!==y?y:null==l?void 0:l.regionLabel)&&void 0!==b?b:null,districtBorough:null!==(k=null!==(v=null==r?void 0:r.districtBorough)&&void 0!==v?v:null==l?void 0:l.districtBorough)&&void 0!==k?k:null,countyUnitary:null!==(w=null!==(j=null==r?void 0:r.countyUnitary)&&void 0!==j?j:null==l?void 0:l.countyUnitary)&&void 0!==w?w:null,localType:null!==(S=null!==(N=null==r?void 0:r.localType)&&void 0!==N?N:null==l?void 0:l.localType)&&void 0!==S?S:null,latitude:null!==(Z=null==l?void 0:l.latitude)&&void 0!==Z?Z:null,longitude:null!==(I=null==l?void 0:l.longitude)&&void 0!==I?I:null};"like"===t?T=i([...T,a]):M=[a,...M]}d({likes:T,dislikes:M,bySlug:a(T,M),loading:!1,error:null});try{let l=await fetch("/api/feedback",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:e,feedback:t,matchScore:null==r?void 0:r.matchScore,searchId:null==r?void 0:r.searchId})});if(!l.ok)throw Error("HTTP ".concat(l.status))}catch(e){d({likes:E.likes,dislikes:E.dislikes,bySlug:E.bySlug,loading:!1,error:String((null==e?void 0:e.message)||e)})}},[h]),f=(0,l.useCallback)((e,t)=>{let r=u.current.bySlug.get(e);return m(e,"like"===r?null:"like",t)},[m]),x=(0,l.useCallback)((e,t)=>{let r=u.current.bySlug.get(e);return m(e,"dislike"===r?null:"dislike",t)},[m]),g=(0,l.useCallback)(async e=>{let t=u.current;if(!o){h();return}let r=new Map(t.likes.map(e=>[e.slug,e])),l=[];e.forEach((e,t)=>{let s=r.get(e);s&&(l.push({...s,orderIndex:t+1}),r.delete(e))});let s=l.length;for(let e of r.values())l.push({...e,orderIndex:++s});d({likes:l,dislikes:t.dislikes,bySlug:a(l,t.dislikes),loading:!1,error:null});try{let t=await fetch("/api/feedback/reorder",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({orderedSlugs:e})});if(!t.ok)throw Error("HTTP ".concat(t.status))}catch(e){d({likes:t.likes,dislikes:t.dislikes,bySlug:t.bySlug,loading:!1,error:String((null==e?void 0:e.message)||e)})}},[o,h]);return{isAuthed:o,sessionStatus:r,likes:c.likes,dislikes:c.dislikes,bySlug:c.bySlug,loading:c.loading,error:c.error,toggleLike:f,toggleDislike:x,reorderLikes:g,requireAuth:h}}}},function(e){e.O(0,[3307,2972,605,6279,2971,7227,1744],function(){return e(e.s=34789)}),_N_E=e.O()}]);

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.