1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[430],{3410:function(e,t,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_sites/[site]/directory",function(){return i(1492)}])},869:function(e,t,i){"use strict";var r=i(5893),n=i(1664),s=i.n(n),l=i(7294),a=i(1163),o=i(4173);let d=(0,r.jsx)(s(),{href:"/donate",className:"ml-8 inline-flex items-center justify-center px-4 py-2 border border-transparent rounded-md shadow-sm text-base font-medium text-white btn-primary",children:"Donate"});t.Z=e=>{let{className:t,title:i,showAbout:n,aboutText:c,showTitle:x,showMap:h,logo:u,showDiscover:m,discoverText:g,showVolunteering:v,volunteeringText:f,showToolkit:p,toolkitText:j,publicContent:b,hideNavCTA:y=null==b?void 0:b.hideNavCTA}=e,[N,k]=(0,l.useState)(!1);(0,o.U)();let w=(0,a.useRouter)(),{query:_}=w,[C,S]=(0,l.useState)(!0);return(0,l.useEffect)(()=>{_.embed&&S(!1)},[_.embed]),(0,r.jsx)("nav",{className:"z-10 w-full relative bg-white shadow ".concat(t||""," ").concat(C?"":"hidden"),children:(0,r.jsx)("div",{className:"relative z-10 h-full",children:(0,r.jsxs)("div",{className:"h-full w-full mx-auto flex justify-between items-center px-2 sm:px-6 lg:px-8 md:justify-start md:space-x-10",children:[(0,r.jsx)("div",{children:(0,r.jsxs)(s(),{href:(null==b?void 0:b.logoLink)||"/",className:"flex",children:[x&&i&&(0,r.jsx)("span",{className:"mr-4 font-extrabold text-2xl",children:i}),(0,r.jsx)("span",{className:"sr-only",children:"Home"}),u&&(0,r.jsx)("img",{className:"h-8 w-auto md:h-12",src:"".concat((null==u?void 0:u.includes("https://"))?u:(null==u?void 0:u[0])==="/"?u:"/"+u),alt:"logo"})]})}),(0,r.jsx)("div",{className:"md:hidden",children:(0,r.jsx)("div",{className:"flex items-center md:ml-12",children:(0,r.jsx)("div",{onClick:()=>k(!0),children:(0,r.jsx)("a",{className:"ml-8 inline-flex items-center justify-center px-2 py-1 border border-transparent rounded-md shadow-sm font-medium text-gray-700 hover:text-royalb hover:border-royalb border-gray-600 text-sm transition-all duration-400 ease-in-out cursor-pointer ",children:"Menu"})})})}),N&&(0,r.jsxs)("div",{className:"z-50 w-screen bg-white fixed top-0 left-0 shadow-xl",children:[(0,r.jsx)(s(),{href:"/",legacyBehavior:!0,children:(0,r.jsx)("img",{className:"absolute left-0 top-0 h-8 mt-10 ml-2 cursor-pointer",src:"/".concat(u),alt:"Home"})}),(0,r.jsxs)("button",{onClick:()=>k(!1),children:[" ",(0,r.jsx)("img",{className:"absolute right-0 top-0 mt-10 mr-4 cursor-pointer h-6",src:"/icons/close.svg",alt:"close menu"})]}),(0,r.jsxs)("ul",{className:"flex flex-col text-lg text-black mt-20 mb-10 justify-center items-center space-y-8",children:[(0,r.jsx)("li",{onClick:()=>k(!1),children:(0,r.jsx)(s(),{href:"/",legacyBehavior:!0,children:(0,r.jsx)("p",{className:" text-gray-700 hover:text-indigo-600 transition duration-150 ease-in-out",children:"Home"})})}),n&&(0,r.jsx)("li",{onClick:()=>k(!1),children:(0,r.jsx)(s(),{href:"/about",legacyBehavior:!0,children:(0,r.jsx)("p",{className:" text-gray-700 hover:text-indigo-600 transition duration-150 ease-in-out",children:c||"About"})})}),m&&(0,r.jsx)("li",{onClick:()=>k(!1),children:(0,r.jsx)(s(),{href:"/discover",legacyBehavior:!0,children:(0,r.jsx)("p",{className:" text-gray-700 hover:text-indigo-600 transition duration-150 ease-in-out",children:g||"Discover Services"})})}),v&&(0,r.jsx)("li",{onClick:()=>k(!1),children:(0,r.jsx)(s(),{href:(null==b?void 0:b.volunteerLink)||"/volunteer",legacyBehavior:!0,children:(0,r.jsx)("p",{className:" text-gray-700 hover:text-indigo-600 transition duration-150 ease-in-out",children:f||"Volunteer"})})}),p&&(0,r.jsx)("li",{onClick:()=>k(!1),children:(0,r.jsx)(s(),{href:(null==b?void 0:b.toolkitLink)||"/toolkit",legacyBehavior:!0,children:(0,r.jsx)("p",{className:" text-gray-700 hover:text-indigo-600 transition duration-150 ease-in-out",children:j||"Toolkit"})})}),(0,r.jsx)("li",{onClick:()=>k(!1),children:(0,r.jsx)(s(),{href:"/map",legacyBehavior:!0,children:(0,r.jsx)("p",{className:" text-gray-700 hover:text-indigo-600 transition duration-150 ease-in-out",children:"Map"})})}),(0,r.jsx)("li",{onClick:()=>k(!1),children:(0,r.jsx)(s(),{href:"/directory",legacyBehavior:!0,children:(0,r.jsx)("p",{className:" text-gray-700 hover:text-indigo-600 transition duration-150 ease-in-out",children:"Directory"})})}),!y&&d&&(0,r.jsx)("li",{onClick:()=>k(!1),children:d})]})]}),(0,r.jsxs)("div",{className:"hidden md:flex-1 md:flex md:items-center md:justify-between",children:[(0,r.jsxs)("div",{className:"flex space-x-10",children:[n&&(0,r.jsx)(s(),{href:"/about",className:"text-base text-gray-700 hover:text-indigo-600 transition duration-150 ease-in-out font-bold",children:c||"About"}),m&&(0,r.jsx)("a",{href:"/discover",className:"text-base text-gray-700 hover:text-indigo-600 transition duration-150 ease-in-out font-bold",children:g||"Discover"}),v&&(0,r.jsx)("a",{href:(null==b?void 0:b.volunteerLink)||"/volunteer",className:"text-base text-gray-700 hover:text-indigo-600 transition duration-150 ease-in-out font-bold",children:f||"Volunteer"}),p&&(0,r.jsx)("a",{href:(null==b?void 0:b.toolkitLink)||"/volunteer",className:"text-base text-gray-700 hover:text-indigo-600 transition duration-150 ease-in-out font-bold",children:j||"Toolkit"}),(0,r.jsx)(s(),{href:"/map",className:"text-base text-gray-700 hover:text-indigo-600 transition duration-150 ease-in-out font-bold",children:"Map"}),(0,r.jsx)(s(),{href:"/directory",className:"text-base text-gray-700 hover:text-indigo-600 transition duration-150 ease-in-out font-bold",children:"Directory"})]}),(0,r.jsx)("div",{className:"flex items-center md:ml-12",children:!y&&d})]})]})})})}},1492:function(e,t,i){"use strict";i.r(t),i.d(t,{__N_SSG:function(){return d}});var r=i(5893),n=i(7294),s=i(1664),l=i.n(s),a=i(8273),o=i(869),d=!0;t.default=e=>{var t;let{helpPage:i}
1=e,[s,d]=(0,n.useState)([]),[c,x]=(0,n.useState)([]),[h,u]=(0,n.useState)([]);(0,n.useEffect)(()=>{if(c){let e=c.flatMap(e=>{var t,i;let r=(null==e?void 0:null===(i=e.services)||void 0===i?void 0:null===(t=i.hits)||void 0===t?void 0:t.hits)||[];return r}).filter(e=>{var t;let i=(null==e?void 0:e._source)||{};return!h||0===h.length||(null===(t=i.offering)||void 0===t?void 0:t.some(e=>h.includes(e)))}).map(e=>({...e._source,_id:e._id}))||[],t=e.reduce((e,t)=>{let i=(null==t?void 0:t.name)||(null==t?void 0:t.orgName)||(null==t?void 0:t.organisationName)||(null==t?void 0:t.organizationName)||"Unknown organisation";return e[i]||(e[i]=[]),e[i].push(t),e},{}),i=Object.entries(t).map(e=>{var t;let[i,r]=e;return{orgId:i,orgName:i,donateLink:(null===(t=r.find(e=>null==e?void 0:e.donateLink))||void 0===t?void 0:t.donateLink)||void 0,services:r}});d(i)}},[h,c]);let m=async()=>{console.log(JSON.stringify({helpPage:i}));let e=await fetch("/api/orgs",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({helpPage:i})}),t=await e.json();console.log({result:t}),t.aggregations&&x(t.aggregations.orgIds.buckets)},g=(0,n.useContext)(a.Z);(0,n.useEffect)(()=>{i&&m()},[i]);let v=e=>e&&e.startsWith("http")?e:"https://".concat(e),f=["bg-green-500","bg-blue-500","bg-yellow-500","bg-red-500","bg-purple-500","bg-pink-500"];console.log({helpPageData:g});let p=e=>{h.includes(e)?u(h.filter(t=>t!==e)):u([...h,e])};return(0,r.jsxs)("div",{children:[(0,r.jsx)(o.Z,{className:"h-10 md:h-16 py-6 ",...g}),(0,r.jsx)("div",{className:"md:p-8 p-2 min-h-screen bg-gradient-to-br from-pink-50 to-indigo-50 border-b border-gray-200",children:(0,r.jsxs)("div",{className:"max-w-7xl px-2 mx-auto",children:[(0,r.jsxs)("div",{className:"space-y-4 py-8",children:[(0,r.jsx)("h1",{className:"text-3xl font-bold",children:"What help is out there?"}),(0,r.jsx)("h2",{children:"Find services provided by the voluntary sector."})]}),(0,r.jsx)("div",{className:"flex flex-wrap",children:null==g?void 0:null===(t=g.categories)||void 0===t?void 0:t.map(e=>(0,r.jsx)("button",{type:"button",style:{scrollSnapAlign:"start"},onClick:()=>p((null==e?void 0:e.value)||e),className:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return t.filter(Boolean).join(" ")}((null==h?void 0:h.includes(e.value||e))?"bg-pink-100 border-pink-400 text-pink-800 border":"text-gray-500 hover:text-gray-700 border border-gray-300 bg-gray-50 hover:bg-gray-200","px-3 py-1 mr-2 mt-2 h-full flex items-center font-medium text-sm rounded-full border whitespace-nowrap"),"aria-current":(null==h?void 0:h.includes((null==e?void 0:e.value)||e))?"page":void 0,children:(null==e?void 0:e.name)||e}))}),(0,r.jsx)("div",{className:"grid md:grid-cols-2 gap-4 py-4",children:s.map((e,t)=>(0,r.jsxs)("div",{className:"border border-gray-200 hover:border-indigo-200 bg-white rounded-md overflow-hidden",children:[(0,r.jsxs)("div",{className:"border-b border-gray-200 pl-2 pr-4 py-2 bg-gray-50 font-bold text-lg",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center",children:[(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)("div",{className:"h-6 w-6 rounded-full ".concat(f[t%f.length])}),(0,r.jsx)("h2",{children:e.orgName})]}),e.donateLink&&(0,r.jsx)("a",{href:v(e.donateLink),target:"_blank",rel:"noopener noreferrer",className:"ml-4 inline-flex items-center justify-center px-4 py-2 border border-transparent rounded-md shadow-sm text-base font-medium text-white btn-primary",children:"Donate"})]}),(0,r.jsx)("div",{className:"flex flex-wrap gap-x-2"})]}),(0,r.jsx)("ul",{className:"p-2 grid ".concat(1===e.services.length?"":"grid-cols-2"," gap-2"),children:e.services.map(e=>(0,r.jsx)(l(),{href:"/profile/".concat(e._id),className:"block",children:(0,r.jsxs)("li",{className:"hover:shadow-md h-full border border-gray-200 rounded-md p-3",children:[(0,r.jsx)("div",{children:e.tag}),(0,r.jsx)("div",{className:"flex flex-wrap py-1",children:e.offering.map(e=>(0,r.jsx)("div",{className:"text-xs bg-indigo-100 rounded-md text-indigo-800 px-2 py-0.5 font-normal mt-1 mr-1",children:e}))}),(0,r.jsx)("p",{className:"mt-2 line-clamp-3 text-sm text-gray-800",children:e.description})]},e._id)}))})]},e.orgId))})]})})]})}}},function(e){e.O(0,[774,888,179],function(){return e(e.s=3410)}),_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.