1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[515],{52836:function(e,r,t){var a=t(85893),l=t(67294),s=t(87536),n=t(33742),o=t(21),i=t(10953),d=t(22962),c=t(55402),u=t(89966),m=t(70168),f=t(83390);let FormAddress=e=>{let{disabled:r,onSubmit:t,submitting:x,confirmText:h}=e,p=(0,n.E)(),{alert:v}=(0,i.E)(),[b,j]=(0,l.useState)(null),y=(0,s.cI)({defaultValues:{placeIdentifier:"",postcode:""},mode:"all"}),N=(0,s.cI)({defaultValues:{formattedAddress:"",placeDescription:"",deliveryNote:""},mode:"all"}),w=N.watch("formattedAddress"),g=y.handleSubmit(e=>p.lookupAddress({placeIdentifier:e.placeIdentifier.trim(),postcode:e.postcode.trim(),country:"GB"}).then(e=>{let{address:r}=e;N.setValue("formattedAddress",r.formattedAddress),j(r)}).catch(e=>{var r;let t=(0,o.tf)(e);(null===(r=t.reasons)||void 0===r?void 0:r.length)?(0,d.j)(y,t.reasons):v(t.title,t.detail)})),S=N.handleSubmit(e=>{t({...b,addressId:b.addressId,placeIdentifier:b.placeIdentifier,postcode:b.postcode,placeDescription:e.placeDescription,deliveryNote:e.deliveryNote,country:"GB"}).catch(e=>{var r;let t=(0,o.tf)(e);(null===(r=t.reasons)||void 0===r?void 0:r.length)?(0,d.j)(N,t.reasons):v(t.title,t.detail)})});return(0,a.jsxs)("div",{className:"w-full p-3",children:[(0,a.jsxs)("form",{className:"mb-3 text-right",onSubmit:g,children:[(0,a.jsxs)("div",{className:"mb-1 flex flex-wrap sm:flex-nowrap",children:[(0,a.jsx)(m.Z,{name:"placeIdentifier",control:y.control,autoComplete:"address-line1",label:"Number or name",placeholder:"Number or name",disabled:r||x,className:"w-full",fullWidth:!0,containerClassName:"w-full sm:w-1/2 sm:mr-1"}),(0,a.jsx)(m.Z,{name:"postcode",control:y.control,placeholder:"postcode",label:"Postcode",autoComplete:"postal-code",disabled:r||x,className:"w-full",fullWidth:!0,containerClassName:"w-full sm:w-1/2 sm:ml-1"})]}),(0,a.jsx)(u.zx,{variant:"primary",type:"submit",title:w?"Search again":"Search",containerClassName:"w-full",loading:y.formState.isSubmitting,disabled:r||x})]}),(0,a.jsx)(c.Z,{show:!!w,children:(0,a.jsxs)("form",{onSubmit:S,children:[(0,a.jsxs)("div",{className:"mb-3",children:[(0,a.jsx)(f.Z,{control:N.control,name:"formattedAddress",disabled:!0,className:"w-full"}),(0,a.jsx)(m.Z,{control:N.control,name:"placeDescription",placeholder:"Additional information eg: suite / floor",label:"Additional information",required:!1,fullWidth:!0,disabled:r||x}),(0,a.jsx)(m.Z,{control:N.control,name:"deliveryNote",placeholder:"Delivery instructions (if applicable)",label:"Delivery instructions",required:!1,fullWidth:!0,disabled:r||x})]}),(0,a.jsx)(u.zx,{type:"submit",variant:"primary",title:h||"Add address",containerClassName:"w-full",loading:x})]})})]})};FormAddress.displayName="FormAddress",r.Z=FormAddress},67528:function(e,r,t){var a=t(85893);t(67294);var l=t(21),s=t(89966),n=t(9083);r.Z=e=>{let{requests:r,children:t,reload:o}=e,i=function(e){let r=Object.keys(e).every(r=>{let t=e[r];return t.data||t.error});return Object.keys(e).reduce((t,a)=>{let l=e[a];return r&&(t.data||(t.data={}),t.data[a]=l.data),t.loading=t.loading||l.loading,t.error=t.error||l.error,t},{data:null,error:null,loading:!1})}(r),d=!!i.data&&Object.keys(i.data).every(e=>i.data[e]);if(i.loading&&!d)return(0,a.jsx)("div",{className:"flex flex-grow justify-center items-center p-3",children:(0,a.jsx)(n.Z,{size:"lg",variant:"onBackground"})});if(d)return t(i.data);if(i.error&&!d){let e=(0,l.tf)(i.error);return(0,a.jsxs)("div",{className:"flex flex-col justify-center items-center grow",children:[(0,a.jsxs)("div",{className:"mb-3 text-center",children:[(0,a.jsx)("h2",{className:"text-base text-onBackground",children:e.title}),(0,a.jsx)("h3",{className:"text-base text-onBackground",children:e.detail})]}),(0,a.jsx)(s.zx,{variant:"primary",onPress:o,title:"Press to retry"})]})}return null}},83390:function(e,r,t){t.d(r,{Z:function(){return rhf_controllers_FormTextareaController}});var a=t(85893),l=t(87536),s=t(67294);let n=(0,s.forwardRef)((e,r)=>{let{id:t,name:l,placeholder:n,label:o,value:i,onBlur:d,onChange:c,className:u,disabled:m,error:f}
1=e,x=(0,s.useRef)(null),[h,p]=(0,s.useState)(!1);return(0,s.useImperativeHandle)(r,()=>x.current),(0,a.jsxs)("div",{className:"relative mb-1 flex flex-col items-start ".concat(m?"opacity-50":""),children:[o?(0,a.jsx)("label",{htmlFor:t,className:"block text-xs mb-1 ml-1 transition text-onSurface ".concat(h?"text-primary":f?"text-error":""),children:o}):null,(0,a.jsx)("textarea",{ref:x,name:l,id:t,className:"font-system text-base p-2 bg-surface text-onSurface placeholder-onSurface/50 focus:outline-none rounded-md border-2 border-onSurface/10 transition ".concat(f?"border-error":"focus:border-primary"," ").concat(u||""),placeholder:n||"",value:i,onBlur:()=>{p(!1),d()},onFocus:()=>{p(!0)},onChange:e=>{c(e.target.value)},disabled:m}),(0,a.jsx)("span",{className:"block px-2 text-xs text-error empty-content",children:f||""})]})});var rhf_controllers_FormTextareaController=e=>{let{name:r,disabled:t,control:s,placeholder:o,label:i,className:d,required:c=!0}=e;return(0,a.jsx)(l.Qr,{name:r,control:s,rules:{required:{value:c,message:"Required"}},render:e=>{var r;let{field:l,fieldState:s,formState:c}=e;return(0,a.jsx)(n,{...l,id:l.name,disabled:t||c.isSubmitting,error:null===(r=s.error)||void 0===r?void 0:r.message,placeholder:o,label:i,className:d})}})}},14859:function(e,r,t){t.d(r,{u:function(){return Modal}});var a=t(85893),l=t(18687),s=t(13145),n=t(11163),o=t(67294),i=t(95377);let Modal=e=>{let{show:r,onClose:t,title:d,name:c,headerless:u=!1,containerClassName:m,children:f,afterLeave:x=()=>null}=e,h="#".concat(c||"modal"),p=(0,n.useRouter)(),v=(0,o.useRef)(null),b=(0,o.useRef)(0),j=(0,o.useRef)(!1),y=(0,o.useRef)(!1),cleanURL=()=>{p.asPath.includes(h)&&(j.current=!0,p.back())},releasePopState=()=>{y.current=!1,p.beforePopState(()=>!0)},onCloseHandler=()=>{cleanURL(),releasePopState(),t()};return(0,o.useEffect)(()=>{let restoreScroll=()=>{j.current&&(j.current=!1,window.scrollTo(0,b.current))};return window.addEventListener("hashchange",restoreScroll),()=>{window.removeEventListener("hashchange",restoreScroll)}},[]),(0,o.useEffect)(()=>{r?(b.current=window.scrollY,y.current=!0,p.beforePopState(()=>(onCloseHandler(),!0)),p.push(h)):y.current&&releasePopState()},[r]),(0,a.jsx)(l.u,{show:r,as:o.Fragment,children:(0,a.jsxs)(s.Vq,{as:"div",initialFocus:v,className:"fixed safe-inset-0 z-50 min-w-[350px]",onClose:onCloseHandler,children:[(0,a.jsx)(l.x,{as:o.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,a.jsx)("div",{className:"fixed inset-0 bg-black/30","aria-hidden":"true"})}),(0,a.jsx)("div",{ref:v,className:"fixed flex inset-0 justify-center items-end md:items-center h-full",style:{fontSize:0},children:(0,a.jsx)(s.EM,{as:o.Fragment,children:(0,a.jsx)(l.x,{afterLeave:()=>{cleanURL(),x()},as:o.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 md:translate-y-0",enterTo:"opacity-100 translate-y-0",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 translate-y-4 md:translate-y-0",children:(0,a.jsxs)("div",{className:"text-base shadow w-screen md:w-[450px] max-h-full md:max-h-[90vh] overflow-auto md:rounded bg-surface text-onSurface ".concat(m||""),children:[u?null:(0,a.jsx)("div",{className:"w-full text-center relative sticky top-0 z-50 bg-secondary text-onSecondary ".concat(d?"shadow":""),children:(0,a.jsxs)("div",{className:"flex justify-center items-stretch min-h-[60px]",children:[(0,a.jsx)("div",{className:"w-[50px] shrink-0"}),d?(0,a.jsx)("div",{className:"grow flex justify-center items-center truncate",children:(0,a.jsx)("h2",{className:"font-header text-2xl p-3 truncate",children:d})}):(0,a.jsx)("div",{className:"grow p-3"}),(0,a.jsx)("button",{type:"button",className:"w-[50px] flex items-center justify-center shrink-0",onClick:t,children:(0,a.jsx)(i.Z,{name:"times",size:20})})]})}),(0,a.jsx)(o.Fragment,{children:f})]})})})})]})})}},55402:function(e,r,t){var a=t(85893),l=t(18687),s=t(67294);r.Z=e=>{let{as:r=s.Fragment,show:t,children:n}=e;return(0,a.jsx)(l.u,{as:r,show:t,className:"overflow-hidden",enter:"duration-500",enterFrom:"max-h-0",enterTo:"max-h-screen",leave:"duration-500",leaveFrom:"max-h-screen",leaveTo:"max-h-0",children:n})}}}]);
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.