1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5883,5835,1276],{98482:function(e,t,r){Promise.resolve().then(r.bind(r,82087)),Promise.resolve().then(r.bind(r,26110)),Promise.resolve().then(r.t.bind(r,72972,23)),Promise.resolve().then(r.bind(r,81523)),Promise.resolve().then(r.bind(r,70049))},82087:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return w}});var n=r(57437),a=r(2265),o=r(99376),i=r(30166),l=r(41346),s=r(99204),u=r(44490),c=r(91472),d=r(1996),g=r(3548),m=r(18855),f=r(78555),p=r(75835);function h(e){let{selectedReign:t,onReignClick:r,className:o=""}=e,[i,l]=(0,a.useState)(!0);return i?(0,n.jsxs)("div",{id:"map-reign-colour-key",className:"pointer-events-auto max-w-[min(100%,20rem)] rounded-lg bg-white/95 dark:bg-gray-800/95 border border-gray-200 dark:border-gray-700 shadow-lg p-3 ".concat(o),role:"group","aria-label":"Map colour key",children:[(0,n.jsxs)("div",{className:"flex items-start justify-between gap-2 mb-1",children:[(0,n.jsx)("h2",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:"Colour key"}),(0,n.jsx)("button",{type:"button",onClick:()=>l(!1),className:"shrink-0 -mt-0.5 -mr-1 flex items-center justify-center w-8 h-8 rounded text-gray-500 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-primary","aria-label":"Collapse colour key","aria-expanded":!0,"aria-controls":"map-reign-colour-key",children:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":!0,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]}),(0,n.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-2",children:"Colours show royal reign, not visit status."}),(0,n.jsx)("div",{className:"flex flex-wrap gap-x-3 gap-y-1.5 text-xs text-gray-600 dark:text-gray-400",children:p.Zq.map(e=>{let{reign:a,label:o,hex:i}=e,l=t===a,s=!t||l;return(0,n.jsxs)("button",{type:"button",onClick:()=>r(a),"aria-pressed":l,"aria-label":l?"Showing only ".concat(o,". Click to show all reigns."):"Show only ".concat(o),className:"inline-flex items-center gap-1.5 rounded px-1 py-0.5 -mx-1 -my-0.5 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-1 dark:focus:ring-offset-gray-800 ".concat(s?"opacity-100 cursor-pointer hover:bg-gray-200/50 dark:hover:bg-gray-700/50":"opacity-50 cursor-pointer hover:opacity-70"),children:[(0,n.jsx)("span",{className:"inline-block w-3 h-3 rounded-full border border-black/10 dark:border-white/20 shrink-0",style:{backgroundColor:i},"aria-hidden":!0}),o]},a)})})]}):(0,n.jsx)("div",{className:"pointer-events-auto ".concat(o),children:(0,n.jsx)("button",{type:"button",onClick:()=>l(!0),className:"px-3 py-2 rounded-lg bg-white/95 dark:bg-gray-800/95 border border-gray-200 dark:border-gray-700 shadow-lg text-sm font-medium text-gray-800 dark:text-gray-200 hover:bg-white dark:hover:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-1 dark:focus:ring-offset-gray-900 min-h-[40px]","aria-expanded":!1,"aria-controls":"map-reign-colour-key",children:"Colour key"})})}let x=(0,i.default)(()=>Promise.all([r.e(2953),r.e(1689),r.e(4212),r.e(6492),r.e(4840),r.e(3864)]).then(r.bind(r,23864)),{loadableGenerated:{webpack:()=>[23864]},ssr:!1,loading:()=>(0,n.jsx)("div",{className:"flex-1 min-h-0 flex items-center justify-center bg-gray-100 dark:bg-gray-800",children:(0,n.jsx)("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Loading mapâ¦"})})}),b=[54,-2],y=[{value:"",label:"All reigns"},{value:"Queen Victoria",label:"Queen Victoria (VR)"},{value:"King Edward VII",label:"King Edward VII (E VII R)"},{value:"King George V",label:"King George V (GR)"},{value:"King Edward VIII",label:"King Edward VIII (E VIII R)"},{value:"King George VI",label:"King George VI (G VI R)"},{value:"Queen Elizabeth II",label:"Queen Elizabeth II (E II R)"},{value:"King Charles III",label:"King Charles III (CR)"},{value:"Scottish Crown",label:"Scottish Crown"},{value:"Unknown",label:"Unknown"}];function v(){let e=(0,o.useRouter)(),t=(0,o.usePathname)(),r=(0,o.useSearchParams)(),{setMapHandle:i,flyTo:p,getBounds:v}=(0,u.y)(6),w=(0,c.Hk)(),k=(0,d.d)(),[j,N]=(0,a.useState)({center:b,zoom:6}),_=j.center,I=j.zoom,[C,S]=(0,a.useState)([]),[E,P]=(0,a.useState)(!0),[R,F]=(0,a.useState)(!1),[L,V]=(0,a.useState)(null),[z,M]=(0,a.useState)(!1),[K,A]=(0,a.useState)(""),[U,G]=(0,a.useState)(""),[Z,O]=(0,a.useState)(""),[B,T]=(0,a.useState)(""),[Q,q]=(0,a.useState)(""),[D,W]=(0,a.useState)(""),[H,$]=(0,a.useState)(""),[J,Y]=(0,a.useState)(""),[X,ee]=(0,a.useState)(!1),[et,er]=(0,a.useState)(null),en=(0,a.useRef)(!1),ea=(0,a.useRef)(null),eo=(0,a.useRef)(null),ei=(0,a.useRef)(null),el=(0,a.useRef)(0),es=(0,a.useRef)(0);(0,a.useEffect)(()=>{let e=window.setTimeout(()=>q(U),400);return()=>window.clearTimeout(e)},[U]),(0,a.useEffect)(()=>{let e=window.setTimeout(()=>W(Z),400);return()=>window.clearTimeout(e)},[Z]),(0,a.useEffect)(()=>{let e=window.setTimeout(()=>$(B),400);return()=>window.clearTimeout(e)},[B]),(0,a.useEffect)(()=>()=>{var e;null===(e=ei.current)||void 0===e||e.abort()},[]);let eu=(0,a.useCallback)(()=>{let e=J.trim();if(!e)return;let t=++es.current;er(null),ee(!0);let r=new URLSearchParams({q:e,format:"json",limit:"1",addressdetails:"0"});fetch("https://nominatim.openstreetmap.org/search?".concat(r.toString()),{headers:{"Accept-Language":"en","User-Agent":"PostboxMap/1.0 (https://postboxmap.com)"}}).then(e=>e.json()).then(e=>{if(t!==es.current)return;let r=null==e?void 0:e[0];if((null==r?void 0:r.lat)!=null&&(null==r?void 0:r.lon)!=null){let e=parseFloat(r.lat),t=parseFloat(r.lon);if(Number.isFinite(e)&&Number.isFinite(t)){p(e,t,14),er(null);return}}er("Place not found. Try a different address or name.")}).catch(()=>{t===es.current&&er("Search failed. Please try again.")}).finally(()=>{t===es.current&&ee(!1)})},[J,p]);(0,a.useLayoutEffect)(()=>{var r,n,a,o;let i=new URLSearchParams(window.location.search),l=(null!==(r=i.get("reign"))&&void 0!==r?r:"").trim(),u=(null!==(n=i.get("type"))&&void 0!==n?n:"").trim(),c=(null!==(a=i.get("subtype"))&&void 0!==a?a:"").trim(),d=(null!==(o=i.get("q"))&&void 0!==o?o:"").trim();A(l),G(u),O(c),T(d);let g=function(e){let t=e.get("lat"),r=e.get("lng"),n=e.get("zoom");if(null==t||null==r||null==n)return null;let a=parseFloat(t),o=parseFloat(r),i=parseInt(n,10);return!Number.isFinite(a)||!Number.isFinite(o)||!Number.isFinite(i)||a<49||a>61||o<-9||o>2||i<3||i>19?null:{center:[a,o],zoom:i}}(i),p=g;if(!p){let e=(0,m.b3)();e&&(p={center:[e.lat,e.lng],zoom:e.zoom})}p&&N({center:p.center,zoom:p.zoom});let h=p?"".concat(p.center[0]-.02,",").concat(p.center[1]-.02,",").concat(p.center[0]+.02,",").concat(p.center[1]+.02):"49.8,-8.5,60.9,1.8";if(ea.current=h,!(null!=g)&&p){let r=new URLSearchParams(window.location.search);r.set("lat",(0,f.UC)(p.center[0])),r.set("lng",(0,f.UC)(p.center[1])),r.set("zoom",String(p.zoom)),e.replace("".concat(t,"?").concat(r.toString()),{scroll:!1})}if(P(!0),ea.current=h,!p){let e={bounds:h};
1l&&(e.reign=l),u&&(e.type=u),c&&(e.subtype=c),d&&(e.q=d),s.x1.getPostboxesForMap({...e,bounds:h}).then(e=>{eo.current=h.split(",").map(e=>{let t=parseFloat(e.trim());return Number.isFinite(t)?t.toFixed(2):e.trim()}).join(","),S(Array.isArray(e)?e:[])}).catch(()=>S([])).finally(()=>{P(!1),F(!0)})}},[]);let ec=(0,a.useCallback)(async e=>{if(!e)return;let t=e.split(",").map(e=>{let t=parseFloat(e.trim());return Number.isFinite(t)?t.toFixed(2):e.trim()}).join(","),r=[K,Q.trim(),D.trim(),H.trim()].join("|"),n="".concat(t,"::").concat(r);if(eo.current===n)return;ei.current&&(ei.current.abort(),ei.current=null);let a=new AbortController;ei.current=a;let o=!R;try{o&&P(!0);let t={bounds:e};K&&(t.reign=K),Q.trim()&&(t.type=Q.trim()),D.trim()&&(t.subtype=D.trim()),H.trim()&&(t.q=H.trim());let r=await s.x1.getPostboxesForMap({...t,bounds:e},a.signal);if(a.signal.aborted)return;eo.current=n,S(Array.isArray(r)?r:[])}catch(e){if((null==e?void 0:e.name)==="CanceledError"||(null==e?void 0:e.name)==="AbortError"||(null==e?void 0:e.code)==="ERR_CANCELED")return;console.error("Failed to load map data:",e),S([])}finally{ei.current===a&&(ei.current=null),o&&P(!1),F(!0)}},[K,Q,D,H,R]),ed=(0,a.useCallback)(()=>{var e;let t=null!==(e=v())&&void 0!==e?e:ea.current;t&&ec(t)},[ec,v]),eg=(0,a.useCallback)(()=>{!en.current&&(en.current=!0,(K||U.trim()||Z.trim()||B.trim())&&ed())},[ed,K,U,Z,B]),em=(0,a.useCallback)((n,a)=>{ea.current=n,ec(n);let o=n.split(",").map(e=>parseFloat(e.trim()));if(4===o.length&&o.every(e=>Number.isFinite(e))){let[n,i,l,s]=o,u=(n+l)/2,c=(i+s)/2,d=Math.round(a);(0,m.NN)({lat:u,lng:c,zoom:d});let g=new URLSearchParams(r.toString());g.set("lat",(0,f.UC)(u)),g.set("lng",(0,f.UC)(c)),g.set("zoom",String(d)),e.replace("".concat(t,"?").concat(g.toString()),{scroll:!1})}},[ec,r,t,e]);(0,a.useEffect)(()=>{if(!en.current)return;let e=requestAnimationFrame(()=>{ed()});return()=>cancelAnimationFrame(e)},[K,Q,D,H,ed]);let ef=""!==K||""!==U.trim()||""!==Z.trim()||""!==B.trim(),ep=w||k,[eh,ex]=(0,a.useState)(!1),[eb,ey]=(0,a.useState)(!1),ev=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(!eh)return;let e=e=>{"Escape"===e.key&&ex(!1)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[eh]),(0,a.useEffect)(()=>{if(!eb)return;let e=e=>{"Escape"===e.key&&ey(!1)},t=e=>{ev.current&&!ev.current.contains(e.target)&&ey(!1)};return window.addEventListener("keydown",e),window.addEventListener("mousedown",t),()=>{window.removeEventListener("keydown",e),window.removeEventListener("mousedown",t)}},[eb]),(0,a.useEffect)(()=>{g.MR.mapView()},[]);let ew=(0,a.useRef)(!1);(0,a.useEffect)(()=>{B.trim()?ew.current||(ew.current=!0,g.MR.mapSearchAddress()):ew.current=!1},[B]);let ek=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex gap-2 w-full sm:w-auto sm:min-w-[220px]",children:[(0,n.jsx)("input",{type:"text",value:J,onChange:e=>{Y(e.target.value),er(null)},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),eu())},placeholder:"Search address or placeâ¦",className:"flex-1 min-w-0 px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 text-sm focus:ring-2 focus:ring-primary focus:border-transparent","aria-label":"Search address or place to move map",disabled:X}),(0,n.jsx)("button",{type:"button",onClick:()=>{eu(),ep&&ex(!1)},disabled:X||!J.trim(),className:"shrink-0 px-3 py-2 bg-primary text-white rounded-lg hover:bg-primary-hover disabled:opacity-50 text-sm font-medium min-h-[40px]","aria-label":"Go to place",children:X?"â¦":"Go"})]}),(0,n.jsx)("select",{value:K,onChange:e=>A(e.target.value),className:"w-full sm:w-auto min-w-[140px] px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 text-sm focus:ring-2 focus:ring-primary focus:border-transparent","aria-label":"Filter by reign",children:y.map(e=>(0,n.jsx)("option",{value:e.value,children:e.label},e.value||"all"))}),(0,n.jsx)("input",{type:"text",value:U,onChange:e=>G(e.target.value),placeholder:"Form",className:"w-full sm:w-auto min-w-[100px] px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 text-sm focus:ring-2 focus:ring-primary focus:border-transparent","aria-label":"Filter by form"}),(0,n.jsx)("input",{type:"text",value:Z,onChange:e=>O(e.target.value),placeholder:"Subtype (design variant)",className:"w-full sm:w-auto min-w-[100px] px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 text-sm focus:ring-2 focus:ring-primary focus:border-transparent","aria-label":"Filter by subtype or design variant"}),(0,n.jsx)("input",{type:"text",value:B,onChange:e=>T(e.target.value),placeholder:"Town, place, or Reg No",className:"w-full sm:w-auto min-w-[120px] px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 text-sm focus:ring-2 focus:ring-primary focus:border-transparent","aria-label":"Filter by town, place, or Reg No"}),ef&&(0,n.jsx)(l.zx,{type:"button",variant:"ghost",size:"sm",onClick:()=>{A(""),G(""),O(""),T("")},className:"sm:ml-1",children:"Clear filters"})]});return(0,n.jsxs)("div",{className:"h-screen w-full max-w-full min-w-0 flex flex-col overflow-hidden",style:{touchAction:"pan-x pan-y"},children:[(0,n.jsx)("h1",{className:"sr-only",children:"Interactive map of UK postboxes"}),!ep&&(0,n.jsx)("div",{ref:ev,className:"shrink-0 z-[1000] bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 px-3 py-2 safe-area-pad flex justify-end",style:{paddingTop:"max(0.5rem, env(safe-area-inset-top))"},children:(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsxs)("button",{type:"button",onClick:()=>ey(e=>!e),className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-gray-100 dark:bg-gray-700 border border-gray-200 dark:border-gray-600 hover:bg-gray-200 dark:hover:bg-gray-600 min-h-[40px]","aria-expanded":eb,"aria-label":ef?"Filters (".concat([K,U,Z,B].filter(
1Boolean).length," active)"):"Open filters",children:[(0,n.jsx)("svg",{className:"w-5 h-5 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":!0,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})}),(0,n.jsx)("span",{className:"font-medium text-gray-800 dark:text-gray-200",children:"Filters"}),ef&&(0,n.jsx)("span",{className:"min-w-[20px] h-5 px-1.5 flex items-center justify-center rounded-full bg-primary text-white text-xs font-medium","aria-hidden":!0,children:[K,U,Z,B].filter(Boolean).length})]}),eb&&(0,n.jsxs)("div",{className:"absolute right-0 top-full mt-2 w-[min(90vw,640px)] rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 shadow-lg p-4 z-[1001]",role:"dialog","aria-label":"Map filters",children:[(0,n.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:ek}),(0,n.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-3",children:et?(0,n.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:et}):E?(0,n.jsx)("span",{children:"Loadingâ¦"}):(0,n.jsx)("span",{children:"Reign donuts; pan or zoom to load more. Use locate button for your position."})})]})]})}),(0,n.jsxs)("div",{className:"flex-1 min-h-0 relative",children:[E&&!R&&(0,n.jsxs)("div",{className:"absolute inset-0 z-[500] flex flex-col items-center justify-center bg-gray-200/90 dark:bg-gray-800/90 rounded-lg","aria-live":"polite","aria-busy":"true",children:[(0,n.jsx)("span",{className:"w-8 h-8 border-2 border-primary border-t-transparent rounded-full animate-spin mb-3","aria-hidden":!0}),(0,n.jsx)("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-200",children:"Loading mapâ¦"})]}),E&&R&&(0,n.jsx)("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 z-[400] px-3 py-1.5 rounded-full bg-black/60 text-white text-xs font-medium shadow-lg","aria-live":"polite",children:"Updating mapâ¦"}),(0,n.jsx)(x,{postboxes:C,initialCenter:_,initialZoom:I,showLocateControl:!0,onMarkerClick:e=>{let t=e.location.split(",").map(Number);2===t.length&&t.every(Number.isFinite)&&p(t[0],t[1],17);let r=++el.current;V(null),M(!0),s.x1.getPostbox(e.id).then(e=>{r===el.current&&V(e)}).catch(()=>{r===el.current&&V(e)}).finally(()=>{r===el.current&&M(!1)})},onMapHandleReady:i,onMapReady:eg,onBoundsChange:em,fillContainer:!0}),(0,n.jsx)("div",{className:"absolute z-10 pointer-events-none",style:{bottom:"max(0.75rem, env(safe-area-inset-bottom))",left:"max(0.75rem, env(safe-area-inset-left))"},children:(0,n.jsx)(h,{selectedReign:K,onReignClick:e=>A(t=>t===e?"":e)})}),(L||z)&&(0,n.jsx)("div",{className:"absolute left-2 right-2 sm:right-4 sm:left-auto bg-white dark:bg-gray-800 p-4 rounded-lg shadow-lg max-w-sm z-10",style:{to
1p:"0.5rem"},children:z?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Loading postbox detailsâ¦"}),(0,n.jsx)(l.zx,{type:"button",variant:"ghost",size:"sm",onClick:()=>{V(null),M(!1)},className:"mt-2",children:"Cancel"})]}):L?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("h3",{className:"font-bold text-lg mb-2",children:L.name}),(0,n.jsxs)("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-1",children:[(0,n.jsx)("strong",{children:"Reign:"})," ",L.reign_name]}),"display_name"in L&&null!=L.display_name&&(0,n.jsxs)("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-3",children:[(0,n.jsx)("strong",{children:"Added by:"})," ",L.display_name]}),(0,n.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2 mt-2",children:[(0,n.jsx)(l.zx,{className:"flex-1",onClick:()=>{g.MR.postboxClickFromMap(String(L.id)),e.push("/postbox/".concat(L.id))},children:"View postbox"}),(0,n.jsx)("button",{onClick:()=>{V(null),M(!1)},className:"px-4 py-3 bg-gray-200 dark:bg-gray-700 rounded text-base font-medium min-h-[44px]",children:"Close"})]})]}):null}),ep&&(0,n.jsxs)("button",{type:"button",onClick:()=>ex(!0),className:"absolute top-4 left-4 z-10 flex items-center gap-2 px-4 py-3 rounded-xl bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 shadow-lg hover:bg-gray-50 dark:hover:bg-gray-700 min-h-[48px] tap-target",style:{top:"max(1rem, env(safe-area-inset-top))",left:"max(1rem, env(safe-area-inset-left))"},"aria-label":ef?"Filters (".concat([K,U,Z,B].filter(Boolean).length," active)"):"Open filters",children:[(0,n.jsx)("svg",{className:"w-5 h-5 text-gray-600 dark:text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":!0,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})}),(0,n.jsx)("span",{className:"font-medium text-gray-800 dark:text-gray-200",children:"Filters"}),ef&&(0,n.jsx)("span",{className:"min-w-[20px] h-5 px-1.5 flex items-center justify-center rounded-full bg-primary text-white text-xs font-medium","aria-hidden":!0,children:[K,U,Z,B].filter(Boolean).length})]}),ep&&eh&&(0,n.jsxs)("div",{className:"fixed inset-0 z-[1100] flex flex-col bg-white dark:bg-gray-900",style:{paddingTop:"env(safe-area-inset-top)",paddingBottom:"env(safe-area-inset-bottom)",paddingLeft:"env(safe-area-inset-left)",paddingRight:"env(safe-area-inset-right)"},role:"dialog","aria-modal":"true","aria-label":"Map filters",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between shrink-0 h-14 px-4 border-b border-gray-200 dark:border-gray-800",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Map filters"}),(0,n.jsx)("button",{type:"button",onClick:()=>ex(!1),className:"flex items-center justify-center w-10 h-10 rounded-full text-gray-500 hover:bg-gray-100 dark:hover:bg-gray-800 tap-target","aria-label":"Close filters",children:(0,n.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,n.jsx)("div",{className:"flex-1 overflow-auto overscroll-contain px-4 py-4",children:(0,n.jsxs)("div",{className:"flex flex-col gap-4 max-w-lg",children:[(0,n.jsx)("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Filter postboxes by reign, form, subtype, place, or Reg No. Search for an address to move the map."}),(0,n.jsx)("div",{className:"flex flex-col gap-3",children:ek}),(E||et)&&(0,n.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:et?(0,n.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:et}):(0,n.jsx)("span",{children:"Loadingâ¦"})}),(0,n.jsx)("button",{type:"button",onClick:()=>ex(!1),className:"w-full py-3 rounded-xl bg-primary text-white font-medium hover:bg-primary-hover min-h-[48px] tap-target",children:"Done"})]})})]})]})]})}function w(){return(0,n.jsx)(a.Suspense,{fallback:(0,n.jsx)("div",{className:"h-screen w-full flex items-center justify-center bg-gray-100 dark:bg-gray-800",children:(0,n.jsx)("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Loading mapâ¦"})}),children:(0,n.jsx)(v,{})})}},3548:function(e,t,r){"use strict";
1r.d(t,{L9:function(){return s},MR:function(){return u},Y6:function(){return i},Z0:function(){return l},tM:function(){return o}});var n=r(83125);let a=void 0!==r(40257)?"G-5CH9HN08M6":"";function o(e){if(a&&window.gtag){if(e){var t,r;window.gtag("config",a,{user_id:e.id,send_page_view:!1,...i()});let n=(null!==(t=e.role)&&void 0!==t?t:"user").slice(0,36);window.gtag("set","user_properties",{logged_in:"yes",account_role:n,moderator_level:String(Math.min(99,Math.max(0,null!==(r=e.moderator_level)&&void 0!==r?r:0))),email_verified:e.is_verified?"yes":"no"})}else window.gtag("config",a,{user_id:null,send_page_view:!1,...i()}),window.gtag("set","user_properties",{logged_in:"no",account_role:"",moderator_level:"0",email_verified:"no"})}}function i(){return{app_mode:(0,n.Rb)()}}function l(e,t){a&&window.gtag&&window.gtag("config",a,{page_path:e,page_title:t,...i()})}function s(e,t){a&&window.gtag&&window.gtag("event",e,{...i(),...t})}let u={mapView:()=>s("map_view"),mapLocateMe:()=>s("map_locate_me"),mapSearchAddress:()=>s("map_search_address"),addPostboxStart:()=>s("add_postbox_start"),addPostboxSubmit:()=>s("add_postbox_submit",{method:"form"}),addPostboxSuccess:()=>s("add_postbox_success"),correctionSubmit:e=>s("correction_submit",{field:e}),postboxView:(e,t)=>s("postbox_view",{postbox_id:e,reign_name:null==t?void 0:t.reign_name,postbox_type_name:null==t?void 0:t.postbox_type_name,subtype:null==t?void 0:t.subtype,in_service:null==t?void 0:t.in_service,country_name:null==t?void 0:t.country_name}),search:e=>s("search",{search_category:function(e){let t=e.trim();return/^[A-Z]{1,2}\d[\dA-Z]?\s*\d[A-Z]{2}$/i.test(t)?"postcode":/^\d{2,}[A-Z]?$/i.test(t)?"registration":t?"place_or_name":"filter"}(e)}),login:e=>s("login",{method:e}),signUp:e=>s("sign_up",{method:e}),share:e=>s("share",{method:e}),sectionView:e=>s("section_view",{section:e}),loginStart:()=>s("login_start"),signUpStart:()=>s("sign_up_start"),forgotPasswordStart:()=>s("forgot_password_start"),correctionStart:()=>s("correction_start"),postboxClickFromMap:e=>s("postbox_click_from_map",{postbox_id:e}),softPromptShown:e=>s("soft_prompt_shown",{prompt_kind:e}),softPromptSnooze:(e,t)=>s("soft_prompt_snooze",{prompt_kind:e,action:t}),softPromptDismissForever:e=>s("soft_prompt_dismiss_forever",{prompt_kind:e})}},17803:function(e,t,r){"use strict";r.d(t,{AppExperienceProvider:function(){return s},l:function(){return u}});var n=r(57437),a=r(2265);let o="app-experience-enabled",i="app-experience-popup-dismissed",l=(0,a.createContext)(null);function s(e){let{children:t}=e,[r,s]=(0,a.useState)(!1),[u,c]=(0,a.useState)(!1),[d,g]=(0,a.useState)(!1);(0,a.useEffect)(()=>{g(!0)},[]),(0,a.useEffect)(()=>{d&&(s(function(){try{return"1"===localStorage.getItem(o)}catch(e){return!1}}()),c(function(){try{return"1"===localStorage.getItem(i)}catch(e){return!1}}()))},[d]);let m=(0,a.useCallback)(e=>{try{e?localStorage.setItem(o,"1"):localStorage.removeItem(o)}catch(e){}s(e)},[]),f=(0,a.useCallback)(e=>{try{e?localStorage.setItem(i,"1"):localStorage.removeItem(i)}catch(e){}c(e)},[]);return(0,n.jsx)(l.Provider,{value:{preferAppExperience:r,setPreferAppExperience:m,popupDismissed:u,setPopupDismissed:f},children:t})}function u(){return(0,a.useContext)(l)||{preferAppExperience:!1,setPreferAppExperience:()=>{},popupDismissed:!1,setPopupDismissed:()=>{}}}},78555:function(e,t,r){"use strict";function n(e){return Number.isFinite(e)?parseFloat(e.toFixed(6)).toString():""}function a(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:", ";return"".concat(n(e)).concat(r).concat(n(t))}function o(e){if(null==e||"string"!=typeof e)return"";let t=e.trim();if(!t)return"";let r=t.split(",").map(e=>e.trim()).filter(e=>e.length>0);if(2!==r.length)return t;let a=Number(r[0]),o=Number(r[1]);return Number.isFinite(a)&&Number.isFinite(o)?"".concat(n(a),",").concat(n(o)):t}r.d(t,{$m:function(){return o},UC:function(){return n},lc:function(){return a}})},68039:function(e,t,r){"use strict";r.d(t,{L6:function(){return s},ZS:function(){return l}});var n=r(63921),a=r(83125);let o="/api/auth/google-callback";function i(e){return e.replace(/\/$/,"")}function l(e){return e.hasClientId&&e.clientReady&&!e.isNativeShell}function s(e){var t;let{flow:r,useRedirect:l="link"!==r,redirectPath:s="/dashboard"}=e;
1if("link"===r)return{useOneTap:!1,itp_support:!0,theme:"filled_blue",size:"medium",text:"continue_with",shape:"rectangular"};let u={useOneTap:!0,auto_select:"signin"===r,itp_support:!0,theme:"filled_blue",size:"large",text:"signup"===r?"signup_with":"continue_with",shape:"rectangular",width:"320",context:"signup"===r?"signup":"signin"};return l&&("undefined"!=typeof document&&(document.cookie="".concat("pwa_google_redirect","=").concat(encodeURIComponent(s),"; path=/; max-age=300; SameSite=Lax"),(0,a.LC)()),u.ux_mode="redirect",u.login_uri=(null===(t=window.location)||void 0===t?void 0:t.origin)?"".concat(i(window.location.origin)).concat(o):"https://postboxmap.co.uk/api/auth/google-callback".trim()||"".concat(i(n._O)).concat(o)),u}},18855:function(e,t,r){"use strict";r.d(t,{Bb:function(){return c},NN:function(){return u},b3:function(){return s}});let n="postboxmap_last_map_view",a="postboxmap_last_map_view";function o(e,t,r){return Number.isFinite(e)&&Number.isFinite(t)&&Number.isFinite(r)&&e>=49&&e<=61&&t>=-9&&t<=2&&r>=3&&r<=19}function i(e){if(!e)return null;try{let t=JSON.parse(e);if(null==t||"object"!=typeof t)return null;let{lat:r,lng:n,zoom:a}=t;if(!o(Number(r),Number(n),Number(a)))return null;return{lat:Number(r),lng:Number(n),zoom:Math.round(Number(a))}}catch(e){return null}}function l(e){if("undefined"==typeof document)return null;let t="".concat(e,"="),r=document.cookie.split(";");for(let e=0;e<r.length;e++){let n=r[e].trim();if(n.startsWith(t))return decodeURIComponent(n.slice(t.length))}return null}function s(){try{var e;let t=localStorage.getItem(n),r=l(a);return null!==(e=i(t))&&void 0!==e?e:i(r)}catch(e){return i(l(a))}}function u(e,t){if("undefined"!=typeof document&&"hidden"===document.visibilityState&&!(null==t?void 0:t.force))return;let r=Number(e.lat),i=Number(e.lng),l=Math.round(Number(e.zoom));if(!o(r,i,l))return;let s=JSON.stringify({lat:r,lng:i,zoom:l});try{localStorage.setItem(n,s)}catch(e){}try{"undefined"!=typeof document&&(document.cookie="".concat(a,"=").concat(encodeURIComponent(s),"; path=/; max-age=").concat(31536e3,"; SameSite=Lax"))}catch(e){}}function c(e,t){if(!Number.isFinite(e)||!Number.isFinite(t))return!1;let r=s();return!!(r&&function(e,t,r,n){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.02;return Math.abs(e-r)<=a&&Math.abs(t-n)<=a}(r.lat,r.lng,e,t))&&(!function(){try{localStorage.removeItem(n)}catch(e){}try{"undefined"!=typeof document&&(document.cookie="".concat(a,"=; path=/; max-age=0; SameSite=Lax"))}catch(e){}}(),!0)}},75835:function(e,t,r){"use strict";r.d(t,{Zq:function(){return o},f8:function(){return a},oy:function(){return n}});let n={"Queen Victoria":"red","King Edward VII":"yellow","King George V":"green","King Edward VIII":"gold","King George VI":"violet","Queen Elizabeth II":"blue","King Charles III":"orange","Scottish Crown":"green",Unknown:"grey"},a={"Queen Victoria":"#dc2626","King Edward VII":"#eab308","King George V":"#22c55e","King Edward VIII":"#ca8a04","King George VI":"#8b5cf6","Queen Elizabeth II":"#2563eb","King Charles III":"#ea580c","Scottish Crown":"#0f766e",Unknown:"#6b7280"},o=[{reign:"Queen Victoria",label:"Queen Victoria",hex:a["Queen Victoria"]},{reign:"King Edward VII",label:"Edward VII",hex:a["King Edward VII"]},{reign:"King George V",label:"George V",hex:a["King George V"]},{reign:"King Edward VIII",label:"Edward VIII",hex:a["King Edward VIII"]},{reign:"King George VI",label:"George VI",hex:a["King George VI"]},{reign:"Queen Elizabeth II",label:"Elizabeth II",hex:a["Queen Elizabeth II"]},{reign:"King Charles III",label:"Charles III",hex:a["King Charles III"]},{reign:"Scottish Crown",label:"Scottish Crown",hex:a["Scottish Crown"]},{reign:"Unknown",label:"Unknown",hex:a.Unknown}]},1072:function(e,t,r){"use strict";r.d(t,{NativeShellHintProvider:function(){return i},P:function(){return l}});var n=r(57437),a=r(2265);let o=(0,a.createContext)(!1);function i(e){let{initialIsNative:t,children:r}=e;return(0,n.jsx)(o.Provider,{value:t,children:r})}function l(){return(0,a.useContext)(o)}},1996:function(e,t,r){"use strict";r.d(t,{d:function(){return a}});var n=r(2265);
1function a(){let[e,t]=(0,n.useState)(!0);return(0,n.useEffect)(()=>{let e=window.matchMedia("(max-width: ".concat(767,"px)")),r=()=>t(e.matches);return r(),e.addEventListener("change",r),()=>e.removeEventListener("change",r)},[]),e}},91472:function(e,t,r){"use strict";r.d(t,{DE:function(){return d},Hk:function(){return u},J7:function(){return m},mK:function(){return g},wB:function(){return c}});var n=r(2265),a=r(17803),o=r(1996),i=r(83125),l=r(68039),s=r(1072);function u(){let e=(0,s.P)(),[t,r]=(0,n.useState)(e),l=(0,o.d)(),{preferAppExperience:u}=(0,a.l)();return(0,n.useEffect)(()=>{r((0,i.xP)())},[]),t||e||l&&u}function c(){let e=(0,s.P)(),[t,r]=(0,n.useState)(e);return(0,n.useEffect)(()=>{r((0,i.xP)())},[]),t||e}function d(){let e=(0,s.P)(),[t,r]=(0,n.useState)(e);return(0,n.useEffect)(()=>{if((0,i.cz)()){r(!0);return}let e=!1,t=0,n=()=>{if(!e){if((0,i.cz)()||t>=30){r(!0);return}t+=1,window.setTimeout(n,50)}};return n(),()=>{e=!0}},[]),t}function g(){let e=(0,s.P)(),[t,r]=(0,n.useState)(e),a=d();return(0,n.useEffect)(()=>{a&&r((0,i.cz)())},[a]),t||e}function m(e){let t=g(),r=d();return(0,l.ZS)({hasClientId:e,clientReady:r,isNativeShell:t})}},44490:function(e,t,r){"use strict";r.d(t,{y:function(){return a}});var n=r(2265);function a(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6,t=(0,n.useRef)(null),r=(0,n.useCallback)(e=>{t.current=e},[]),a=(0,n.useCallback)(function(e,r){var n;let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16;null===(n=t.current)||void 0===n||n.flyTo(e,r,a)},[]),o=(0,n.useCallback)(function(e,r){var n;let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:14;null===(n=t.current)||void 0===n||n.setView(e,r,a)},[]),i=(0,n.useCallback)(()=>{var e,r;return null!==(r=null===(e=t.current)||void 0===e?void 0:e.getBounds())&&void 0!==r?r:null},[]),l=(0,n.useCallback)(()=>{var r,n;return null!==(n=null===(r=t.current)||void 0===r?void 0:r.getZoom())&&void 0!==n?n:e},[e]);
1return{setMapHandle:r,flyTo:a,setView:o,locateUser:(0,n.useCallback)(e=>{let r=t.current;if(r)r.locateUser(e);else{var n;null==e||null===(n=e.onError)||void 0===n||n.call(e,{code:3,message:"Map not ready. Please try again."})}},[]),getBounds:i,getZoom:l}}},39763:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(2265),a={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let o=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),i=(e,t)=>{let r=(0,n.forwardRef)((r,i)=>{let{color:l="currentColor",size:s=24,strokeWidth:u=2,absoluteStrokeWidth:c,className:d="",children:g,...m}=r;return(0,n.createElement)("svg",{ref:i,...a,width:s,height:s,stroke:l,strokeWidth:c?24*Number(u)/Number(s):u,className:["lucide","lucide-".concat(o(e)),d].join(" "),...m},[...t.map(e=>{let[t,r]=e;return(0,n.createElement)(t,r)}),...Array.isArray(g)?g:[g]])});return r.displayName="".concat(e),r}},32660:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(39763).Z)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},76858:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(39763).Z)("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},30401:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(39763).Z)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},10407:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=(0,r(39763).Z)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},30166:function(e,t,r){"use strict";r.d(t,{default:function(){return a.a}});var n=r(55775),a=r.n(n)},27648:function(e,t,r){"use strict";r.d(t,{default:function(){return a.a}});var n=r(72972),a=r.n(n)},99376:function(e,t,r){"use strict";var n=r(35475);r.o(n,"useParams")&&r.d(t,{useParams:function(){return n.useParams}}),r.o(n,"usePathname")&&r.d(t,{usePathname:function(){return n.usePathname}}),r.o(n,"useRouter")&&r.d(t,{useRouter:function(){return n.useRouter}}),r.o(n,"useSearchParams")&&r.d(t,{useSearchParams:function(){return n.useSearchParams}})},55775:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let n=r(47043);r(57437),r(2265);let a=n._(r(15602));function o(e,t){var r;let n={loading:e=>{let{error:t,isLoading:r,pastDelay:n}=e;return null}};"function"==typeof e&&(n.loader=e);let o={...n,...t};return(0,a.default)({...o,modules:null==(r=o.loadableGenerated)?void 0:r.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},81523:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return a}});let n=r(18993);function a(e){let{reason:t,children:r}=e;if("undefined"==typeof window)throw new n.BailoutToCSRError(t);return r}},15602:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return u}});let n=r(57437),a=r(2265),o=r(81523),i=r(70049);function l(e){return{default:e&&"default"in e?e.default:e}}let s={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},u=function(e){let t={...s,...e},r=(0,a.lazy)(()=>t.loader().then(l)),u=t.loading;function c(e){let l=u?(0,n.jsx)(u,{isLoading:!0,pastDelay:!0,error:null}):null,s=t.ssr?(0,n.jsxs)(n.Fragment,{children:["undefined"==typeof window?(0,n.jsx)(i.PreloadCss,{moduleIds:t.modules}):null,(0,n.jsx)(r,{...e})]}):(0,n.jsx)(o.BailoutToCSR,{reason:"next/dynamic",children:(0,n.jsx)(r,{...e})});return(0,n.jsx)(a.Suspense,{fallback:l,children:s})}return c.displayName="LoadableComponent",c}},70049:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadCss",{enumerable:!0,get:function(){return o}});let n=r(57437),a=r(20544);function o(e){let{moduleIds:t}=e;if("undefined"!=typeof window)return null;let r=(0,a.getExpectedRequestStore)("next/dynamic css"),o=[];if(r.reactLoadableManifest&&t){let e=r.reactLoadableManifest;for(let r of t){if(!e[r])continue;let t=e[r].files.filter(e=>e.endsWith(".css"));o.push(...t)}}return 0===o.length?null:(0,n.jsx)(n.Fragment,{children:o.map(e=>(0,n.jsx)("link",{precedence:"dynamic",rel:"stylesheet",href:r.assetPrefix+"/_next/"+encodeURI(e),as:"style"},e))})}}},function(e){e.O(0,[2972,6137,3464,9204,1346,2971,2117,1744],function(){return e(e.s=98482)}),_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.