1"use strict";(self.webpackChunkgoodnessme_app=self.webpackChunkgoodnessme_app||[]).push([[342],{95303:function(n,e,i){i.d(e,{y:function(){return w}});var l=i(67294),r=i(74780),s=i(56348),t=i(34999),d=i(31312),a=i(85893),o=function(n){var e=n.title,i=(0,d.dF)().logoutCustomer;return(0,a.jsxs)(r.Ug,{justifyContent:"space-between",spacing:6,children:[(0,a.jsx)(r.X6,{as:"h2",size:"h4",children:e}),(0,a.jsx)(s.c,{below:"sm",children:(0,a.jsx)(t.zx,{py:"8px",px:"46px",variant:"outline",mt:4,onClick:i,children:"Sign Out"})}),(0,a.jsx)(s.di,{below:"sm",children:(0,a.jsx)(t.zx,{py:"8px",px:"46px",m:0,variant:"link",onClick:i,border:"none",color:"brand.avocado",children:"Sign Out"})})]})},u=(0,l.memo)(o),c=i(23343),x=i(99028),h=function(n){var e=n.location,r=(0,c.l)().helpers.ErrorBoundary,s=(0,x.G)().isBase,t=(0,l.lazy)((function(){return i.e(4262).then(i.bind(i,44262))})),d=(0,l.lazy)((function(){return i.e(6589).then(i.bind(i,46589))}));return(0,a.jsx)(r,{children:(0,a.jsx)(l.Suspense,{fallback:null,children:s?(0,a.jsx)(d,{location:e}):(0,a.jsx)(t,{})})})},v=(0,l.memo)(h),m=i(12963),p=i(57660),j=i(67473),f=i(62893),g=i(61933),b=function(){var n=(0,f.jt)().customer,e=(0,c.l)().helpers.capitalise,i=(0,g.t)(),l=i.loyaltyTierName,s=i.customerPoints,t=null!=n&&n.firstName?", "+e(null==n?void 0:n.firstName):"";return(0,a.jsxs)(r.Ug,{mt:[6,8],bg:"brand.lavender",justifyContent:"space-between",maxH:[28,44],overflow:"hidden",children:[(0,a.jsxs)(r.gC,{py:[4.5,4.5,9],pl:[5,5,12],alignItems:"flex-start",spacing:1,children:[(0,a.jsxs)(r.xv,{fontWeight:[400,700],fontSize:["md","xl"],children:["Welcome",t]}),(0,a.jsxs)(r.xv,{fontSize:["md","xl"],fontWeight:[700,400],children:["Youâre a GoodnessMe ",l,"!"]}),(0,a.jsxs)(r.xv,{fontSize:["md","xl"],display:["none","none","block"],children:["You have ",s," points"]})]}),(0,a.jsx)(r.xu,{children:(0,a.jsx)(p.Ee,{src:j.Z,w:[34,60],mr:[1,1,12]})})]})},y=(0,l.memo)(b),I=function(n){var e=n.content,i=n.subtitle,l=n.location,t=n.title,d=n.children,o=n.showRewardsBanner,c=void 0!==o&&o,x=(0,(0,m.r0)().getContent)({content:e});return(0,a.jsx)(r.W2,{pt:[16,16,27],pb:22,children:(0,a.jsxs)(r.kC,{flexDirection:["column","row"],gap:0,children:[(0,a.jsxs)(r.xu,{w:["100%",66],pr:[0,8],children:[(0,a.jsx)(s.c,{below:"sm",children:(0,a.jsx)(r.X6,{as:"h1",size:"h4",mb:9,children:t})}),(0,a.jsx)(s.di,{below:"sm",children:(0,a.jsx)(r.xu,{pb:6,children:(0,a.jsx)(u,{title:i})})}),(0,a.jsx)(v,{location:l})]}),(0,a.jsxs)(r.xu,{w:["100%","70%"],pl:[0,8],children:[(0,a.jsx)(s.c,{below:"sm",children:(0,a.jsx)(u,{title:i})}),c&&(0,a.jsx)(y,{}),(0,a.jsx)(r.xu,{my:6,sx:{p:{fontSize:"sm",lineHeight:"21px"}},children:x}),d]})]})})},w=(0,l.memo)(I)},52499:function(n,e,i){i.d(e,{O:function(){return o},t:function(){return u}});var l=i(63366),r=i(71562),s=i(23343),t=i(18205),d=i(85893),a=["location"],o=function(n){return function(e){var i=e.location,o=(0,l.Z)(e,a),u=(0,s.l)().helpers.isBrowser,c=(0,s.y)(),x=c.getStorage,h=c.removeStorage,v=(0,t.qt)().settings,m=v.keys,p=v.params,j=v.routes,f=x(m.customer);if(null==f||!f.accessToken||new Date(null==f?void 0:f.expiresAt)<=new Date){if(h(m.customer),u){var g=j.LOGIN_REGISTER+((null==i?void 0:i.pathname)!==j.DASHBOARD?"?"+p.continue+"="+(null==i?void 0:i.pathname):"");(0,r.c4)(g,{replace:!0})}return null}return(0,d.jsx)(n,Object.assign({},o,{location:i}))}},u=function(n){return function(e){var i=Object.assign({},e),l=(0,s.l)().helpers,a=l.getUrlParameter,o=l.isBrowser,u=(0,s.y)().getStorage,c=(0,t.qt)().settings,x=c.keys,h=c.params,v=c.routes,m=u(x.customer);if(null!=m&&m.accessToken&&new Date(null==m?void 0:m.expiresAt)>=new Date&&o){var p=a(h.continue),j=!!a(h.checkout)?v.CHECKOUT:p||v.DASHBOARD;(0,r.c4)(j,{replace:!0})}return(0,d.jsx)(n,Object.assign({},i))}}},60660:function(n,e,i){i.r(e),i.d(e,{Head:function(){return S.F},default:function(){return D}});var l=i(63366),r=i(52499),s=i(62893),t=i(15861),d=i(64687),a=i.n(d),o=i(67294),u=i(31312),c=i(74780),x=i(85601),h=i(47260),v=i(34999),m=i(85893),p=function(n){var e,i,l,r,s,t,d,a,o,u,p=n.address,j=n.handleChange,f=n.handleSubmit,g=n.handleCancel,b=n.loading,y=n.errors;return(0,m.jsxs)(c.xu,{border:"1px solid",borderColor:"brand.avocado",p:8,w:"full",spacing:4,children:[(0,m.jsx)(c.xv,{variant:"caps",mb:6,children:"Edit Address"}),(0,m.jsx)(c.xu,{as:"form",onSubmit:f,children:(0,m.jsxs)(c.gC,{width:"full",spacing:"6",children:[(0,m.jsxs)(c.Kq,{direction:["column","row"],width:"full",spacing:"4",children:[(0,m.jsxs)(x.NI,{id:"firstName",isInvalid:null==y?void 0:y.firstName,isRequired:!0,children:[(0,m.jsx)(x.lX,{children:"First name"}),(0,m.jsx)(h.II,{type:"text",name:"firstName",value:null==p?void 0:p.firstName,onChange:j,maxLength:255}),(0,m.jsx)(x.J1,{children:null==y||null===(e=y.firstName)||void 0===e?void 0:e.message})]}),(0,m.jsxs)(x.NI,{id:"lastName",isInvalid:null==y?void 0:y.lastName,isRequired:!0,children:[(0,m.jsx)(x.lX,{children:"Last name"}),(0,m.jsx)(h.II,{type:"text",name:"lastName",value:null==p?void 0:p.lastName,onChange:j,maxLength:255}),(0,m.jsx)(x.J1,{children:null==y||null===(i=y.lastName)||void 0===i?void 0:i.message})]})]}),(0,m.jsxs)(c.Kq,{direction:["column","row"],width:"full",spacing:"4",children:[(0,m.jsxs)(x.NI,{id:"company",isInvalid:null==y?void 0:y.company,children:[(0,m.jsx)(x.lX,{children:"Company"}),(0,m.jsx)(h.II,{type:"text",name:"company",value:null==p?void 0:p.company,onChange:j}),(0,m.jsx)(x.J1,{children:null==y||null===(l=y.company)||void 0===l?void 0:l.message})]}),(0,m.jsxs)(x.NI,{id:"phone",isInvalid:null==y?void 0:y.phone,children:[(0,m.jsx)(x.lX,{children:"Phone"}),(0,m.jsx)(h.II,{type:"text",name:"phone",value:null==p?void 0:p.phone,onChange:j}),(0,m.jsx)(x.J1,{children:null==y||null===(r=y.phone)||void 0===r?void 0:r.message})]})]}),(0,m.jsxs)(x.NI,{id:"address1",isInvalid:null==y?void 0:y.address1,isRequired:!0,children:[(0,m.jsx)(x.lX,{children:"Address 1"}),(0,m.jsx)(h.II,{type:"text",name:"address1",value:null==p?void 0:p.address1,onChange:j,maxLength:255}),(0,m.jsx)(x.J1,{children:null==y||null===(s=y.address1)||void 0===s?void 0:s.message})]}),(0,m.jsxs)(x.NI,{id:"address2",isInvalid:null==y?void 0:y.address2,children:[(0,m.jsx)(x.lX,{children:"Address 2"}),(0,m.jsx)(h.II,{type:"text",name:"address2",value:null==p?void 0:p.address2,onChange:j,maxLength:255}),(0,m.jsx)(x.J1,{children:null==y||null===(t=y.address2)||void 0===t?void 0:t.message})]}),(0,m.jsxs)(c.Kq,{direction:["column","row"],width:"full",spacing:"4",children:[(0,m.jsxs)(x.NI,{id:"city",isInvalid:null==y?void 0:y.city,isRequired:!0,children:[(0,m.jsx)(x.lX,{children:"City"}),(0,m.jsx)(h.II,{type:"text",name:"city",value:null==p?void 0:p.city,onChange:j,maxLength:255}),(0,m.jsx)(x.J1,{children:null==y||null===(d=y.city)||void 0===d?void 0:d.message})]}),(0,m.jsxs)(x.NI,{id:"province",isInvalid:null==y?void 0:y.province,isRequired:!0,children:[(0,m.jsx)(x.lX,{children:"State"}),(0,m.jsx)(h.II,{type:"text",name:"province",value:null==p?void 0:p.province,onChange:j,maxLength:255}),(0,m.jsx)(x.J1,{children:null==y||null===(a=y.province)||void 0===a?void 0:a.message})]}),(0,m.jsxs)(x.NI,{id:"zip",isInvalid:null==y?void 0:y.zip,isRequired:!0,children:[(0,m.jsx)(x.lX,{children:"ZIP"}),(0,m.jsx)(h.II,{type:"number",name:"zip",value:null==p?void 0:p.zip,onChange:j,maxLength:255}),(0,m.jsx)(x.J1,{children:null==y||null===(o=y.zip)||void 0===o?void 0:o.message})]})]}),(0,m.jsxs)(x.NI,{id:"country",isInvalid:null==y?void 0:y.country,isRequired:!0,children:[(0,m.jsx)(x.lX,{children:"Country"}),(0,m.jsx)(h.II,{type:"text",name:"country",value:null==p?void 0:p.country,onChange:j,maxLength:255}),(0,m.jsx)(x.J1,{children:null==y||null===(u=y.country)||void 0===u?void 0:u.message})]}),(0,m.jsxs)(c.Ug,{width:"full",children:[(0,m.jsx)(v.zx,{type:"submit",disabled:b,isLoading:b,children:"Save"}),(0,m.jsx)(v.zx,{disabled:b,onClick:function(){return g()},variant:"outline",children:"Cancel"})]}),(null==y?void 0:y.message)&&(0,m.jsx)(x.NI,{id:"error",isInvalid:!0,children:(0,m.jsx)(x.J1,{children:y.message})})]})})]})},j=(0,o.memo)(p),f=i(80177),g=i(58570),b=function(n){var e,i=n.address,l=n.primaryAddress,r=void 0!==l&&l,s=n.handleDefault,t=n.handleDelete,d=n.handleEdit,a=n.loading,o=(0,g.b)(g.f.ACCOUNT);return i&&(0,m.jsx)(c.xu,{py:"6",pr:"8",bg:"brand.offWhite",children:(0,m.jsxs)(c.Kq,{direction:["column","row"],width:"full",children:[(0,m.jsxs)(c.xu,{width:"full",children:[(0,m.jsx)(c.xv,{fontWeight:700,fontSize:"xl",children:null==i?void 0:i.name}),(0,m.jsx)(c.xv,{fontSize:"md",mt:2,children:null==i||null===(e=i.formatted)||void 0===e?void 0:e.join(", ")}),(0,m.jsx)(c.xv,{children:null==i?void 0:i.phone})]}),(0,m.jsxs)(c.Kq,{children:[!(null!=i&&i.default)&&(0,m.jsx)(v.zx,{variant:"outline",onClick:function(){return s(null==i?void 0:i.id)},isLoading:a,children:null==o?void 0:o.accountAdressMakePrimary}),!r&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(v.zx,{variant:"outline",onClick:function(){return d(null==i?void 0:i.id)},isLoading:a,children:null==o?void 0:o.accountAddressEdit}),!(null!=i&&i.default)&&(0,m.jsx)(v.zx,{variant:"outline",onClick:function(){return t(null==i?void 0:i.id)},isLoading:a,children:"Delete"})]})]})]})},null==i?void 0:i.id)},y=(0,o.memo)(b),I=function(n){var e,i=n.addresses,l=n.loading,r=n.handleDefault,s=n.handleDelete,t=n.handleEdit;return null!=i&&i.length?(0,m.jsxs)(m.Fragment,{children:[null==i||null===(e=i.filter((function(n){return null==n?void 0:n.default})))||void 0===e?void 0:e.map((function(n){var e;return(0,m.jsxs)(c.xu,{border:"1px solid",borderColor:"brand.avocado",p:8,w:"full",spacing:1,mb:4,children:[(0,m.jsx)(c.xv,{variant:"caps",mb:4,children:"Primary Address"}),(0,m.jsx)(y,{loading:l,address:n,primaryAddress:!0})]},null==n||null===(e=n.id)||void 0===e?void 0:e.toString())})),(0,m.jsxs)(c.xu,{border:"1px solid",borderColor:"brand.avocado",p:8,w:"full",spacing:4,children:[(0,m.jsx)(c.xv,{variant:"caps",mb:6,children:"Other Addresses"}),(0,m.jsx)(c.Kq,{direction:"column",width:"full",spacing:4,children:null==i?void 0:i.map((function(n){var e;return(0,m.jsx)(y,{address:n,loading:l,handleDelete:s,handleEdit:t,handleDefault:r},null==n||null===(e=n.id)||void 0===e?void 0:e.toString())}))})]})]}):l?(0,m.jsx)(c.xu,{children:(0,m.jsx)(f.$,{})}):(0,m.jsx)(c.X6,{as:"p",size:"h4",fontWeight:700,mt:6,children:"No addresses"})}
1,w=function(n){var e,i=n.customer,l=(0,u.G4)(i),r=l.addresses,s=l.address,d=l.setAddress,o=l.updateAddress,c=l.deleteAddress,x=l.defaultAddress,h=l.initialData,v=l.loading,p=l.saving,f=l.errors,g=function(){var n=(0,t.Z)(a().mark((function n(e){return a().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(e.preventDefault(),"update"!==(null==s?void 0:s.action)){n.next=4;break}return n.next=4,o(null==s?void 0:s.id,s);case 4:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}(),b=function(){var n=(0,t.Z)(a().mark((function n(e){return a().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,c(e);case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}(),y=function(){var n=(0,t.Z)(a().mark((function n(e){return a().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,x(e);case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}();return(0,m.jsx)(m.Fragment,{children:null!=s&&null!==(e=s.action)&&void 0!==e&&e.length?(0,m.jsx)(j,{address:s,handleChange:function(n){var e=n.target,i=e.type,l=e.name,r=e.value,s=e.checked;return d((function(n){var e;return Object.assign({},n,((e={})[l]="checkbox"===i?s:r,e))}))},handleSubmit:g,handleCancel:function(){return d(Object.assign({},h))},loading:v||p,errors:f}):(0,m.jsx)(I,{addresses:r,loading:v||p,handleDelete:b,handleEdit:function(n){return d(Object.assign({action:"update"},null==r?void 0:r.filter((function(e){return(null==e?void 0:e.id)===n}))[0]))},handleDefault:y})})},C=(0,o.memo)(w),N=i(95303),k=function(n){var e=n.location,i=n.page,l=(0,s.jt)().customer;return(0,m.jsx)(N.y,{title:null==i?void 0:i.title,content:null==i?void 0:i.content,location:e,subtitle:null==i?void 0:i.subtitle,children:(null==l?void 0:l.id)&&(0,m.jsx)(C,{customer:l})})},z=(0,o.memo)(k),S=i(66027),A=["data"],D=(0,r.O)((function(n){var e=n.data,i=(0,l.Z)(n,A);return(0,m.jsx)(z,Object.assign({},i,e))}))},67473:function(n,e,i){e.Z=i.p+"static/food-box-c670a261cf63ec729303d8165da75c36.png"}}]); 2//# sourceMappingURL=component---src-pages-account-addresses-tsx-13976bd1b718ed277b48.js.map
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.