1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[966],{32907:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/account",function(){return n(62815)}])},62815:function(e,t,n){"use strict";n.r(t),n.d(t,{ACCOUNT_CONNECTION_ERROR_TEST_ID:function(){return tn},default:function(){return to}});var r=n(52322),i=n(56580),o=n(38726),s=n(5632),a=n(2784),l=n(85787),c=n(94004),d=n(5288),u=n(97421),h=n(50370);let p=(0,i.connect)(e=>({me:e.app.me.data}))(e=>{let{me:t}=e,[n,i]=(0,a.useState)(null);return((0,a.useEffect)(()=>{n&&((0,h.vQ)(n).catch(e=>console.log(e)),setTimeout(()=>i(null),3e3))},[n]),null==t?void 0:t.referral_code)?(0,r.jsx)(c.rY,{$enabled:!0,"data-testid":"referral-code-container",children:(0,r.jsxs)(l.S,{children:[(0,r.jsx)(d.Z,{accessor:"account.referral_code_instructions_header",tag:c.le}),(0,r.jsx)(d.Z,{accessor:"account.referral_code_instructions",tag:l.f6}),(0,r.jsxs)(l._A,{children:[(0,r.jsxs)(l.xw,{children:[(0,r.jsx)(d.Z,{tag:"p",accessor:"account.referral_code_header"}),(0,r.jsx)(l.k6,{children:t.referral_code})]}),(0,r.jsxs)(l.qt,{children:[(0,r.jsx)(u.Db,{"data-css-override":"StyledPrimaryButton",size:"small",onClick:()=>i(t.referral_code),children:"Copy"}),(0,h.vQ)(n)&&(0,r.jsx)(l.If,{children:"Copied!"})]})]})]})}):null});var x=n(43580),f=n(96337),b=n(8373),m=n(44483),g=n(34843),_=n(23643),v=n(3776),j=n(15066);let y={fetchMeFavoriteLocations:j.default.fetchMeFavoriteLocations},C=(0,i.connect)(e=>({meFavoriteLocations:e.app.me.favoriteLocations}),y),w=(0,o.qC)(x.Zz,C)(e=>{let{meFavoriteLocations:t,fetchMeFavoriteLocations:n}=e;return(0,a.useEffect)(()=>{n()},[]),(0,r.jsx)(m.R,{featureFlag:v.y8.ACCOUNT__FAVORITE_LOCATIONS_ENABLED,children:(0,r.jsxs)(c.rY,{"data-testid":"favorite-location-container",$enabled:!0,children:[(0,r.jsx)(l.S,{children:(0,r.jsx)(c.le,{children:"Favorite Location"})}),t&&t.length?t.map(e=>(0,r.jsx)(g.b,{location:e,favorites:!0,editFavoriteLocation:!0},e.id)):(0,r.jsx)(_.u.Container,{trigger:e=>(0,r.jsx)(f.UN,{onClick:e,$bold:!0,children:(0,r.jsx)(d.Z,{accessor:"account.add_favorite_location_button",tag:l.f6})}),children:e=>(0,r.jsx)(b.j,{onToggle:e})})]})})});var E=n(81334),R=n(47141),S=n(73695),Z=n(92240),k=n(20051);let I=()=>{var e;let t=(0,S.JR)(),n=(0,i.useSelector)(Z.F5),o="disabled"!==t.accounts.favorite_location,s=(0,k.A5)(null==n?void 0:null===(e=n.organization)||void 0===e?void 0:e.loyalty_driver_id),a=t.accounts.punchh_referral_code_field&&s.includes(R.ZV.REFERRAL_CODE);return a||o?(0,r.jsxs)(c.Sn,{"data-testid":"account-information-container",children:[(0,r.jsx)(c.k$,{"data-testid":"account-information-header-container",$enabled:!0,children:(0,r.jsx)(c.jc,{children:"Account Information"})}),a&&(0,r.jsx)(p,{}),(0,r.jsx)(E.Ot,{}),(0,r.jsx)(w,{})]}):null};var P=n(63602),O=n(65413),D=n(29126),A=n(34183),T=n(92122),$=n(2111),M=n(75470);let L=e=>{var t,n,i,o,s;let{close:a}=e,l=(0,M.I0)(),{data:c,loading:d}=(0,M.v9)(e=>e.app.me),u=(0,M.v9)(e=>e.app.organization.external_auth),h="disabled"!==(0,M.v9)(e=>e.app.cmsConfig.webConfig).accounts.zip_code&&(null==c?void 0:c.zip_code)!==null,p=u.updatable_fields.user,x=u.readonly_fields.user,b={first_name:null!==(t=null==c?void 0:c.first_name)&&void 0!==t?t:"",last_name:null!==(n=null==c?void 0:c.last_name)&&void 0!==n?n:"",email:null!==(i=null==c?void 0:c.email)&&void 0!==i?i:"",phone:null!==(o=null==c?void 0:c.phone)&&void 0!==o?o:"",zip_code:null!==(s=null==c?void 0:c.zip_code)&&void 0!==s?s:""},m=(0,O.Ry)({first_name:(0,O.Z_)().required($.xz.REQUIRED),last_name:(0,O.Z_)().required($.xz.REQUIRED),email:(0,O.Z_)().email($.xz.EMAIL).required($.xz.REQUIRED),phone:(0,O.Z_)().required($.xz.REQUIRED).matches($.mL.PHONE,$.r7.PHONE),zip_code:(0,O.Vo)(()=>h?(0,O.Z_)().required($.xz.REQUIRED).matches($.mL.ZIP_CODE_USA_AND_POSTAL_CODE_CANADA,{message:$.r7.ZIP_CODE_USA_AND_POSTAL_CODE_CANADA}):(0,O.Z_)().optional())}),g=e=>x.includes(e)||!p.includes(e);return(0,r.jsx)(P.J9,{validateOnBlur:!0,validateOnChange:!1,onSubmit:(e,t)=>{let{resetForm:n}=t;l(j.default.updateMe(e)),n(),a()},initialValues:b,validationSchema:m,children:e=>{let{dirty:t,isValid:n}=e;return(0,r.jsxs)(T.l,{"data-testid":"contact-info-form",children:[(0,r.jsx)(A.Ll,{children:(0,r.jsx)(T.I,{label:"",id:"first_name",name:"first_name",placeholder:"First Name",type:"text",disabled:g("first_name")}
1)}),(0,r.jsx)(A.Ll,{children:(0,r.jsx)(T.I,{label:"",id:"last_name",name:"last_name",placeholder:"Last Name",type:"text",disabled:g("last_name")})}),(0,r.jsx)(A.Ll,{children:(0,r.jsx)(T.I,{label:"",id:"email",name:"email",placeholder:"Email",type:"text",disabled:g("email")})}),(0,r.jsx)(A.Ll,{children:(0,r.jsx)(T.I,{label:"",id:"phone",name:"phone",type:"tel",placeholder:"Phone Number",disabled:g("phone")})}),h&&(null==c?void 0:c.zip_code)!==null?(0,r.jsx)(A.Ll,{children:(0,r.jsx)(T.I,{label:"",id:"zip_code",name:"zip_code",type:"text",placeholder:"Zip Code",maxLength:10,disabled:g("zip_code")})}):null,(0,r.jsxs)(N,{children:[(0,r.jsx)(f.Mo,{children:(0,r.jsx)(f.UN,{onClick:a,"aria-label":"Hide personal info form",children:"Cancel"})}),(0,r.jsx)(D.Z,{type:"submit",theme:"secondary",$submitting:d,handleClick:()=>null,$minWidth:150,disabled:!t||!n,"aria-label":"Submit Updated Contact Info",children:d?"Loading":"Submit"})]})]})}})},N=(0,x.ZP)(f.VX).withConfig({componentId:"sc-d63088af-0"})(["margin-left:auto;"]);var z=n(26508);let U=()=>{let e=(0,i.useDispatch)(),[t,n]=(0,a.useState)(!1),o=(0,M.v9)(e=>e.app.me.data),s="disabled"!==(0,M.v9)(e=>e.app.cmsConfig.webConfig).accounts.zip_code;return(0,a.useEffect)(()=>{o||e(j.default.fetchMe())},[o]),(0,r.jsxs)(c.Sn,{children:[(0,r.jsx)(c.k$,{$enabled:!0,children:(0,r.jsx)(d.Z,{accessor:"account.contact_info_header",tag:c.jc})}),t?(0,r.jsx)(c.rY,{$enabled:!0,children:(0,r.jsx)(L,{close:()=>n(!1)})}):(0,r.jsx)(f.$3,{children:(0,r.jsxs)(f.Ji,{children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("p",{children:[null==o?void 0:o.first_name," ",null==o?void 0:o.last_name]}),(null==o?void 0:o.email)&&(0,r.jsx)("p",{children:o.email}),(null==o?void 0:o.phone)&&(0,r.jsx)("p",{children:(0,k.ni)(o.phone)}),s&&(null==o?void 0:o.zip_code)&&(0,r.jsx)("p",{children:o.zip_code})]}),(0,r.jsx)(f.UN,{onClick:()=>{n(!0),(0,z.d4)(z.m1.account,z.cE.editContactInfo)},$bold:!0,"aria-label":"Click to edit personal info",children:(0,r.jsx)(d.Z,{accessor:"account.contact_info_edit_button"})})]})})]})};var F=n(95782),V=n(96748),W=n(81854),q=n(36525);let H=x.ZP.div.withConfig({componentId:"sc-6c12e5b7-0"})(["border:1px solid ",";border-radius:","px;display:flex;flex-direction:column;background:",";position:relative;bottom:","px;right:0;z-index:",";"],e=>{let{isActive:t,theme:n}=e;return t?n.global.primary_active_color:n.location_card.border_color},e=>{let{theme:t}=e;return t.location_card.border_radius},e=>{let{theme:t}=e;return t.location_card.background_color},q._.GUTTER/2,q.kl.STORE_CARD_MENU),G=x.ZP.button.withConfig({componentId:"sc-6c12e5b7-1"})(["background:none;border:none;cursor:pointer;font-family:",";padding:","px ","px;"," text-decoration:none;&:not(:first-child){border-top:1px solid ",";}"],e=>{let{theme:t}=e;return t.primary_font.bold.font_family},q._.GUTTER/2,q._.GUTTER,W.x,e=>{let{theme:t}=e;return t.location_card.border_color}),B=e=>{let{address:t}=e,n=(0,i.useDispatch)();return(0,r.jsxs)(H,{children:[!t.default&&(0,r.jsx)(G,{onClick:()=>{var e;return n(j.default.defaultAddress(null!==(e=null==t?void 0:t.id)&&void 0!==e?e:0))},children:(0,r.jsx)(d.Z,{accessor:"account.addresses_default_button"})}),(0,r.jsx)(G,{onClick:()=>{var e;return n(j.default.deleteAddress(null!==(e=null==t?void 0:t.id)&&void 0!==e?e:0))},children:(0,r.jsx)(d.Z,{accessor:"account.addresses_delete_button"})})]})};var Y=n(8782),Q=n(46956),K=n(30686);let X=x.ZP.p.withConfig({componentId:"sc-7300380c-0"})(e=>{let{theme:t}=e;return{fontSize:"12px",marginTop:"20px",...(0,Q.l)(t.text.primary_font,["color"],{color:e=>e?(0,K.F)(Y.DZ)("0.1",e):"inherit"})}}),J=x.ZP.div.withConfig({componentId:"sc-7300380c-1"})(["padding:0 ","px;position:relative;&:not(:last-child){","}"],q._.GUTTER,e=>{let{theme:t}=e;return"\n border-bottom: 1px solid ".concat(t.checkout.border_color,";\n ")}),ee=x.ZP.div.withConfig({componentId:"sc-7300380c-2"})(["position:absolute;top:-4px;right:","px;display:flex;flex-direction:column;"],q._.GUTTER/2);var et=n(124);let en={fetchAddresses:j.default.fetchAddresses,toggleStoredAddressesMenu:j.default.toggleStoredAddressesMenu,setActiveStoredAddress:j.default.setActiveStoredAddress},er=(0,i.connect)(e=>({myAddresses:e.app.me.myAddresses}),en),ei=(0,o.qC)(x.Zz,er)(e=>{var t;let{myAddresses:n,fetchAddresses:i,toggleStoredAddressesMenu:o,setActiveStoredAddress:s,theme:l}=e;return(null===(t=l.accounts)||void 0===t?void 0:t.stored_addresses)?((0,a.useEffect)(()=>(i(),()=>{o(!1),s(null)}),[]),(null==n?void 0:n.length)<1)?null:(0,r.jsxs)(c.Sn,{children:[(0,r.jsx)(c.k$,{$enabled:!0,children:(0,r.jsx)(d.Z,{tag:c.jc,accessor:"account.addresses_header",html:!0})}),n.map(e=>(0,r.jsx)(a.Fragment,{children:(0,r.jsxs)(J,{children:[(0,r.jsxs)("p",{children:[e.default&&(0,r.jsx)(V.D,{}),e.street_address,(0,r.jsx)("br",{}),e.street_address_2&&(0,r.jsxs)(r.Fragment,{children:[e.street_address_2,(0,r.jsx)("br",{})]}),(0,r.jsx)("span",{title:"".concat(e.id),children:e.city}),", ",e.state," ",null==e?void 0:e.zip_code]}),e.special_instructions&&(0,r.jsx)(d.Z,{tag:X,accessor:"account.addresses_special_instructions_text",html:!0,dataObj:{specialInstructions:e.special_instructions}}),(0,r.jsx)(ee,{children:(0,r.jsxs)(F.fC,{children:[(0,r.jsx)(eo,{children:(0,r.jsx)(et.Z.Ellipsis,{title:"Edit favorite location"})}),(0,r.jsx)(F.VY,{children:(0,r.jsx)(B,{address:e})})]})})]})},e.id))]}):null}),eo=(0,x.ZP)(F.xz).withConfig({componentId:"sc-38d9365b-0"})(["appearance:none;background:none;border:none;cursor:pointer;"]);var es=n(63955),ea=e=>{let{updateMe:t}=e,{register:n,handleSubmit:i,reset:o,watch:s}=(0,es.cI)(),[l,c]=(0,a.useState)(!1),{current_password:u,password:h,password_confirmation:p}=s();return(0,a.useEffect)(()=>
1{c(""!=="".concat(u).concat(h).concat(p))},[u,h,p]),(0,r.jsxs)(f.Gq,{onSubmit:i(e=>{t(e),o()}),children:[(0,r.jsxs)(f.fb,{children:[(0,r.jsx)(f.Ll,{children:(0,r.jsx)(f.yt,{...n("current_password"),type:"password",placeholder:"Current Password",autoComplete:"current-password",className:"input"})}),(0,r.jsx)(f.Ll,{children:(0,r.jsx)(f.yt,{...n("password"),type:"password",placeholder:"New Password",autoComplete:"new-password",className:"input"})}),(0,r.jsx)(f.Ll,{children:(0,r.jsx)(f.yt,{...n("password_confirmation"),type:"password",placeholder:"Confirm New Password",autoComplete:"confirm-new-password",className:"input"})})]}),(0,r.jsxs)(f.VX,{children:[l&&(0,r.jsx)(f.Mo,{children:(0,r.jsx)(f.UN,{type:"button",onClick:()=>{o(),c(!1)},"aria-label":"Clear password form",children:"Clear"})}),(0,r.jsx)(D.Z,{type:"submit",theme:"secondary",$submitting:!1,handleClick:()=>null,$minWidth:150,"aria-label":"Submit Password Form",children:(0,r.jsx)(d.Z,{accessor:"account.change_password_button"})})]})]})};let el={updateMe:j.default.updateMe};var ec=(0,i.connect)(e=>({me:e.app.me.data}),el)(e=>{let{me:t,updateMe:n}=e;return(0,r.jsxs)(c.Sn,{children:[(0,r.jsx)(c.k$,{$enabled:!0,children:(0,r.jsx)(d.Z,{accessor:"account.change_password_header",tag:c.jc})}),(0,r.jsx)(c.rY,{$enabled:!0,children:t&&(0,r.jsx)(ea,{me:t,updateMe:n})})]})}),ed=n(22601);let eu=(0,O.Ry)({birthday:(0,O.Z_)().required($.xz.REQUIRED)}),eh=e=>{var t;let n=(0,i.useDispatch)(),{loading:o,data:s}=(0,i.useSelector)(e=>e.app.me),{readonly_fields:a}=(0,i.useSelector)(e=>e.app.organization.external_auth),l=a.user,c=e=>{n(j.default.updateMe({birthday:e.birthday}))};return(0,r.jsx)(P.J9,{validateOnBlur:!0,validateOnChange:!1,onSubmit:(t,n)=>{let{resetForm:r}=n;c(t),r(),e.onCancel()},initialValues:{birthday:null!==(t=s.birthday)&&void 0!==t?t:""},validationSchema:eu,children:t=>{let{dirty:n,isValid:i}=t;return(0,r.jsxs)(T.l,{children:[(0,r.jsx)(A.Ll,{children:(0,r.jsx)(T.I,{"data-testid":"birthday-input",autoFocus:!0,id:"birthday",name:"birthday",type:"date",label:"",width:"50%",disabled:l.includes("birthday")})}),(0,r.jsxs)(f.Dk,{children:[(0,r.jsx)(f.Mo,{children:(0,r.jsx)(ep,{onClick:e.onCancel,"aria-label":"Hide birthday form",children:"Cancel"})}),(0,r.jsx)(D.Z,{type:"submit",theme:"secondary",disabled:!n||!i,$submitting:o,handleClick:()=>null,$minWidth:150,"aria-label":"Submit Birthday",children:o?"Loading":"Submit"})]})]})}})},ep=(0,x.ZP)(f.UN).withConfig({componentId:"sc-f33df9c1-0"})(["margin:'0px';"]);var ex=n(23314),ef=n(16251);let eb=()=>{let[e,t]=(0,a.useState)(!1),[n,i]=(0,a.useState)(!1),o=(0,M.v9)(e=>e.app.me.data),s=(0,M.v9)(e=>e.app.cmsConfig.webConfig.accounts.birthday);return((0,a.useEffect)(()=>{i("disabled"===s)},[s]),n)?null:(0,r.jsxs)(c.Sn,{children:[(0,r.jsx)(c.k$,{$enabled:!0,children:(0,r.jsx)(d.Z,{accessor:"account.birthday_header",tag:c.jc})}),(null==o?void 0:o.birthday)&&(0,r.jsx)(f.$3,{children:(0,r.jsx)(f.Ji,{children:(0,r.jsx)("div",{children:(0,r.jsx)("p",{children:(0,ef.p6)((0,ed.zonedTimeToUtc)(o.birthday,(0,ef.QK)()),ex.z.MONTH_DAY_YEAR)})})})}),!(null==o?void 0:o.birthday)&&!e&&(0,r.jsx)(f.UN,{onClick:()=>t(!0),$bold:!0,children:(0,r.jsx)(f.$3,{children:(0,r.jsx)(d.Z,{accessor:"account.birthday_instructions"})})}),!(null==o?void 0:o.birthday)&&e&&(0,r.jsx)(c.rY,{$enabled:!0,"data-testid":"birthday-form-step-content",children:(0,r.jsx)(eh,{onCancel:()=>{t(!1)}})})]})};var em=n(62907),eg=n(95011),e_=n(29652),ev=n(53908),ej=n(78754),ey=n(48994),eC=n(40024);let ew=x.ZP.div.withConfig({componentId:"sc-82f8a80a-0"})(["display:flex;align-items:center;padding:4px 32px 24px 32px;"]),eE=x.ZP.div.withConfig({componentId:"sc-82f8a80a-1"})(["font-weight:bold;display:flex;padding:44px 10px 0px 0px;justify-content:center;align-items:flex-start;align-self:stretch;font-size:16px;"]),eR=(0,x.ZP)(eE).withConfig({componentId:"sc-82f8a80a-2"})(["padding-bottom:24px;"]),eS=x.ZP.div.withConfig({componentId:"sc-82f8a80a-3"})(["text-align:center;"]),eZ=(0,x.ZP)(_.u.Footer).withConfig({componentId:"sc-82f8a80a-4"})(["border:none;flex-direction:column;padding-bottom:24px;"]),ek=(0,x.ZP)(u.KM).withConfig({componentId:"sc-82f8a80a-5"})(["background-color:#da1e28;color:white;width:100%;"]),eI=(0,x.ZP)(u.KM).withConfig({componentId:"sc-82f8a80a-6"})(["color:white;width:100%;"]);var eP=n(97549),eO=n(38801),eD=n(17609),eA=()=>{let[e,t]=(0,a.useState)(!1),[n,o]=(0,a.useState)(!1),s=(0,i.useDispatch)(),{displayErrorToast:l}=(0,eO.xP)(),c=async()=>{let e;e=(0,eP.P$)(window.location.host);
1let t=(0,eC.Pc)({origin:e}),n=(0,eD.XN)({origin:e,token:t});return await n.delete("/v1/ordering/loyalty/me/delete").res()},d=async()=>{try{let e=await c();t(!1),e.ok?(o(!0),s(ey.Z.logout())):s(l("Sorry, something went wrong. We were not able to delete your account."))}catch(e){s(l("Sorry, something went wrong. We were not able to delete your account.")),t(!1)}};return(0,r.jsxs)("div",{children:[(0,r.jsx)(u.KM,{onClick:()=>t(!0),children:"Delete Account"}),e&&(0,r.jsx)(_.u.Container,{onCancel:()=>t(!1),requestVisibility:e,children:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eE,{children:"Are You Sure You Want To Delete?"}),(0,r.jsx)(ew,{children:(0,r.jsx)(eS,{children:"By confirming, you agree to delete your account, which will result in all data and account details being lost."})}),(0,r.jsxs)(eZ,{children:[(0,r.jsx)(ek,{onClick:d,children:"Confirm & Delete"}),(0,r.jsx)(_.u.Cancel,{onClick:()=>t(!1),children:"Cancel"})]})]})}),n&&(0,r.jsx)(_.u.Container,{onCancel:()=>o(!1),requestVisibility:n,children:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eR,{children:"Account Has Been Deleted"}),(0,r.jsx)(eZ,{children:(0,r.jsx)(eI,{onClick:()=>o(!1),children:"OK"})})]})})]})},eT=n(47661),e$=n(55830),eM=n(62350),eL=n(41291),eN=n(20496);let ez="stored-cards",eU=()=>{let e=(0,M.v9)(e=>{var t;return null===(t=e.app.me.data)||void 0===t?void 0:t.id}),t=(0,eD.d9)({origin:(0,eP.P$)(window.location.host)});return(0,eT.a)({queryKey:[ez,e],queryFn:()=>(0,eC.Gu)({client:t}),enabled:!!e,refetchOnWindowFocus:!1,onError:e=>{eN.Tb(e,"error",{eventName:eL.RZ.FETCH_SAVED_CARDS_FAILURE})}})},eF=()=>{let e=(0,e$.NL)(),t=(0,M.v9)(e=>e.app.me.data),{dispatch:n,displayErrorToast:r,displayToast:i}=(0,eO.xP)(),o=(0,eD.d9)({origin:(0,eP.P$)(window.location.host)});return(0,eM.D)(e=>(0,eC.yo)(e,{client:o}),{onSuccess:()=>{e.invalidateQueries([ez,null==t?void 0:t.id]),n(i("Card removed successfully."))},onError:async e=>{eN.Tb(e),n(r((await (0,h.Xr)("Failed to remove card. Please try again.",e)).message))}})};var eV=n(89432),eW=n(93719);let eq=e=>e.global.error_color||q.DM.ERROR_RED,eH=(0,x.ZP)(c.k$).withConfig({componentId:"sc-b2f71b06-0"})(["display:flex;align-items:center;gap:8px;justify-content:left;"]),eG=(0,x.ZP)(eW.$).withConfig({componentId:"sc-b2f71b06-1"})(["position:relative;"]),eB=x.ZP.div.withConfig({componentId:"sc-b2f71b06-2"})({padding:"".concat(q._.GUTTER,"px"),p:{margin:"".concat(q._.GUTTER/4,"px 0"),fontSize:"16px"}}),eY=x.ZP.div.withConfig({componentId:"sc-b2f71b06-3"})(e=>{var t;let{theme:n}=e;return{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"".concat(q._.GUTTER/2,"px 0"),borderBottom:"1px solid ".concat((0,Y.$n)(.2,null!==(t=n.forms.border_color)&&void 0!==t?t:"#a7a7a7")),"&:last-child":{borderBottom:"none"}}}),eQ=x.ZP.div.withConfig({componentId:"sc-b2f71b06-4"})({display:"flex",alignItems:"center",gap:"12px"}),eK=x.ZP.div.withConfig({componentId:"sc-b2f71b06-5"})({display:"flex",flexDirection:"column"}),eX=x.ZP.span.withConfig({componentId:"sc-b2f71b06-6"})({fontSize:"13px",fontWeight:500,lineHeight:"19.5px"}),eJ=x.ZP.span.withConfig({componentId:"sc-b2f71b06-7"})(e=>{let{theme:t}=e;return{display:"inline-block",background:(0,Y.$n)(.46,eq(t)),color:eq(t),fontSize:"10px",fontWeight:700,lineHeight:"15px",padding:"2px 4px",borderRadius:"4px",marginLeft:"8px"}}),e0=x.ZP.span.withConfig({componentId:"sc-b2f71b06-8"})(e=>{let{$expired:t,theme:n}=e;return{color:t?eq(n):(0,Q.l)(n.checkout.secondary_font).color,fontSize:"11px",fontWeight:500,lineHeight:"16.5px"}}),e1=(0,x.ZP)(u.Db).withConfig({componentId:"sc-b2f71b06-9"})(e=>{var t;let{theme:n}=e;return{fontSize:"11px",fontWeight:600,lineHeight:"16.5px",color:eq(n),background:"none",padding:"6px 8px",borderColor:eq(n),height:"33px","&:hover":{background:eq(n),color:(0,h._T)(eq(n))?q.DM.WHITE:null!==(t=n.text.primary_font.color)&&void 0!==t?t:"",borderColor:eq(n)}}}),e2=(0,x.ZP)(eV.iC).withConfig({componentId:"sc-b2f71b06-10"})(()=>({padding:"0 ".concat(q._.GUTTER,"px"),textAlign:"left"})),e8=x.ZP.p.withConfig({componentId:"sc-b2f71b06-11"})(()=>({margin:0,fontSize:"14px",lineHeight:"21px",padding:"16px 0"})),e6=(0,x.ZP)(u.Db).withConfig({componentId:"sc-b2f71b06-12"})(e=>{var t;let{theme:n}=e;return{width:"100%",background:"transparent",color:n.buttons.primary_button_background_color,borderColor:n.buttons.primary_button_background_color,"&:hover":{background:n.buttons.primary_button_background_color,color:(0,h._T)(n.buttons.primary_button_background_color)?q.DM.WHITE:null!==(t=n.text.primary_font.color)&&void 0!==t?t:""},"&:disabled":{opacity:.7,border:"solid 1px ".concat(n.buttons.primary_button_background_color)}}}),e3=(0,x.ZP)(u.Db).withConfig({componentId:"sc-b2f71b06-13"})(e=>{var t;let{theme:n}=e;return{width:"100%",background:eq(n),borderColor:eq(n),color:(0,h._T)(eq(n))?q.DM.WHITE:null!==(t=n.text.primary_font.color)&&void 0!==t?t:"","&:hover":{background:eq(n)},"&:disabled":{opacity:.7}}});var e7=n(53168);let e9=e=>{let{isOpen:t,cardType:n,cardSuffix:i,isLoading:o,onKeep:s,onRemove:a}=e;return(0,r.jsxs)(e7.Z,{modalOpen:t,name:eL.zr.REMOVE_SAVED_CARD,title:"Remove this card?",toggleModal:e=>{e||s()},children:[(0,r.jsx)(e2,{children:(0,r.jsxs)(e8,{children:[(0,r.jsxs)("b",{children:[n," â¢â¢â¢â¢ ",i]})," ","will be removed from your account."]})}),(0,r.jsxs)(eV.vy,{children:[(0,r.jsx)(e6,{type:"button",onClick:s,disabled:o,children:"Keep card"}),(0,r.jsx)(e3,{type:"button",onClick:a,disabled:o,children:o?"Removing...":"Remove card"})]})]})};var e5=n(86586),e4=n(79455),te=n(98122);let tt=()=>{var e,t;let{data:n,isInitialLoading:i,isError:o,error:s,refetch:l}=eU(),d=eF(),[u,h]=(0,a.useState)(null);return o&&(0,e4.eE)(s)?(0,r.jsxs)(e5.Sn,{children:[(0,r.jsx)(eH,{$enabled:!0,children:(0,r.jsx)(c.jc,{children:"Saved payment methods"})}),(0,r.jsx)(em.Gz,{"data-testid":"wallet-connection-error",onRetry:()=>void l()})]}):i||n&&0!==n.length?(0,r.jsxs)(e5.Sn,{children:[(0,r.jsxs)(eH,{$enabled:!0,children:[(0,r.jsx)(c.jc,{children:"Saved payment methods"}),i&&(0,r.jsx)(eG,{role:"status","aria-label":"Loading saved cards"})]}),(0,r.jsx)(eB,{children:null==n?void 0:n.map(e=>{var t,n,i,o,s;let a=e.is_expired||function(e){if(!e)return!1;let[t,n]=e.split("-");if(!t||!n)return!1;let r=new Date;return new Date(Number(t),Number(n),1)<r}(e.expires);return(0,r.jsxs)(eY,{children:[(0,r.jsxs)(eQ,{children:[(0,r.jsx)(c._K,{icon:(0,te.Pg)(null!==(t=e.card_type)&&void 0!==t?t:""),type:"placeholder"}),(0,r.jsxs)(eK,{children:[(0,r.jsxs)(eX,{"aria-label":"".concat(null!==(n=e.card_type)&&void 0!==n?n:"Card"," ending in ").concat(null!==(i=e.suffix)&&void 0!==i?i:""),children:[e.card_type," ",(0,r.jsx)("span",{"aria-hidden":"true",children:"â¢â¢â¢â¢"})," ",e.suffix," ",a&&(0,r.jsx)(eJ,{children:"Expired"})]}),(0,r.jsxs)(e0,{$expired:a,children:[a?"Expired":"Expires"," ",function(e){if(!e)return"";let[t,n]=e.split("-");return n&&t?"".concat(n,"/").concat(t):e}(e.expires)]})]})]}),e.is_removable&&(0,r.jsx)(e1,{"aria-label":"Remove ".concat(null!==(o=e.card_type)&&void 0!==o?o:"card"," ending in ").concat(null!==(s=e.suffix)&&void 0!==s?s:""),onClick:()=>{var t,n;return h({id:e.id,card_type:null!==(t=e.card_type)&&void 0!==t?t:"Card",suffix:null!==(n=e.suffix)&&void 0!==n?n:"****"})},children:"Remove"})]},e.id)})}),(0,r.jsx)(e9,{isOpen:!!u,cardType:null!==(e=null==u?void 0:u.card_type)&&void 0!==e?e:"",cardSuffix:null!==(t=null==u?void 0:u.suffix)&&void 0!==t?t:"",isLoading:d.isLoading,onKeep:()=>h(null),onRemove:()=>{u&&d.mutate(u.id,{onSettled:()=>h(null)})}})]}):null},tn="account-connection-error",tr={logout:ey.Z.logout,fetchMe:j.default.fetchMe},ti=(0,i.connect)(e=>({authLoading:e.app.auth.loading,showConnectionError:e.app.me.meConnectionError&&!e.app.me.data,retryingProfile:e.app.me.loading}),tr);var to=(0,o.qC)(ti,s.withRouter)(e=>{let{logout:t,authLoading:n,fetchMe:i,showConnectionError:o,retryingProfile:s}=e;return(0,r.jsx)(e_.Q,{children:(0,r.jsx)(eg.Z,{$backgroundOverride:!0,children:(0,r.jsx)(f.t9,{children:(0,r.jsxs)(ev.hX,{children:[(0,r.jsxs)(f.Pw,{className:ej.Y.LOYALTY.PAGE_HEADER,children:[(0,r.jsx)(d.Z,{tag:"h2",accessor:"account.header",html:!0}),(0,r.jsx)(u.Db,{"data-css-override":"StyledPrimaryButton","aria-label":"Click to Sign Out",onClick:()=>t(),$buttonTheme:"knockout",$submitting:n,children:(0,r.jsx)(d.Z,{accessor:"account.sign_out_button"})})]}),o?(0,r.jsx)(em.Gz,{"data-testid":tn,isRetrying:s,onRetry:i}):(0,r.jsxs)(f.aN,{children:[(0,r.jsx)(U,{}),(0,r.jsx)(tt,{}),(0,r.jsx)(I,{}),(0,r.jsx)(ei,{}),(0,r.jsx)(eb,{}),(0,r.jsx)(ec,{}),(0,r.jsx)(eA,{})]})]})})})})})},29126:function(e,t,n){"use strict";var r=n(52322),i=n(97421);t.Z=e=>{let{children:t,theme:n,type:o,$submitting:s,handleClick:a,$minWidth:l,disabled:c}=e;return(0,r.jsx)(i.Db,{"data-css-override":"StyledPrimaryButton",$buttonTheme:n,type:o,$submitting:s,$minWidth:l,onClick:a,disabled:c,
1children:t})}},41969:function(e,t,n){"use strict";n.d(t,{f:function(){return s}});var r=n(7896),i=n(2784),o=n(72714);let s=(0,i.forwardRef)((e,t)=>(0,i.createElement)(o.WV.span,(0,r.Z)({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}})))},15612:function(e,t,n){"use strict";n.d(t,{u:function(){return c}});var r=n(41690),i=n(86239),o=n(81880),s=n(86651),a=n(87980);async function l(){try{a.X&&s.fF.log("Flushing events..."),await (0,i.yl)(2e3),a.X&&s.fF.log("Done flushing events")}catch(e){a.X&&s.fF.log("Error while flushing events:\n",e)}}async function c(e){let{req:t,res:n,err:s}=e,a=n?.statusCode||e.statusCode;if(a&&a<500||!e.pathname)return Promise.resolve();(0,r.$e)(e=>{if(t){let n=function(e){let t=e.headers||{},n=("string"==typeof t["x-forwarded-host"]?t["x-forwarded-host"]:void 0)||("string"==typeof t.host?t.host:void 0),r=("string"==typeof t["x-forwarded-proto"]?t["x-forwarded-proto"]:void 0)||e.protocol||(e.socket?.encrypted?"https":"http"),i=e.url||"",o=function({url:e,protocol:t,host:n}){return e?.startsWith("http")?e:e&&n?`${t}://${n}${e}`:void 0}({url:i,host:n,protocol:r}),s=e.body||void 0,a=e.cookies;return{url:o,method:e.method,query_string:function(e){if(e)try{let t=new URL(e,"http://s.io").search.slice(1);return t.length?t:void 0}catch{return}}(i),headers:function(e){let t=Object.create(null);try{Object.entries(e).forEach(([e,n])=>{"string"==typeof n&&(t[e]=n)})}catch{}return t}(t),cookies:a,data:s}}(t);e.setSDKProcessingMetadata({normalizedRequest:n})}(0,i.Tb)(s||`_error.js called with falsy error (${s})`,{mechanism:{type:"instrument",handled:!1,data:{function:"_error.getInitialProps"}}})}),function(e){let t=o.GLOBAL_OBJ[Symbol.for("@vercel/request-context")],n=t?.get?.();n?.waitUntil&&n.waitUntil(e)}(l())}},62350:function(e,t,n){"use strict";n.d(t,{D:function(){return h}});var r=n(2784),i=n(36370),o=n(96278),s=n(3709),a=n(22436);class l extends a.l{constructor(e,t){super(),this.client=e,this.setOptions(t),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var t;let n=this.options;this.options=this.client.defaultMutationOptions(e),(0,i.VS)(n,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this}),null==(t=this.currentMutation)||t.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var e;null==(e=this.currentMutation)||e.removeObserver(this)}}onMutationUpdate(e){this.updateResult();let t={listeners:!0};"success"===e.type?t.onSuccess=!0:"error"===e.type&&(t.onError=!0),this.notify(t)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(e,t){return this.mutateOptions=t,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:void 0!==e?e:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){let e=this.currentMutation?this.currentMutation.state:(0,o.R)(),t={...e,isLoading:"loading"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset};this.currentResult=t}notify(e){s.V.batch(()=>{if(this.mutateOptions&&this.hasListeners()){var t,n,r,i,o,s,a,l;e.onSuccess?(null==(t=(n=this.mutateOptions).onSuccess)||t.call(n,this.currentResult.data,this.currentResult.variables,this.currentResult.context),null==(r=(i=this.mutateOptions).onSettled)||r.call(i,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)):e.onError&&(null==(o=(s=this.mutateOptions).onError)||o.call(s,this.currentResult.error,this.currentResult.variables,this.currentResult.context),null==(a=(l=this.mutateOptions).onSettled)||a.call(l,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context))}
1e.listeners&&this.listeners.forEach(({listener:e})=>{e(this.currentResult)})})}}var c=n(29930),d=n(55830),u=n(99189);function h(e,t,n){let o=(0,i.lV)(e,t,n),a=(0,d.NL)({context:o.context}),[h]=r.useState(()=>new l(a,o));r.useEffect(()=>{h.setOptions(o)},[h,o]);let x=(0,c.$)(r.useCallback(e=>h.subscribe(s.V.batchCalls(e)),[h]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),f=r.useCallback((e,t)=>{h.mutate(e,t).catch(p)},[h]);if(x.error&&(0,u.L)(h.options.useErrorBoundary,[x.error]))throw x.error;return{...x,mutate:f,mutateAsync:x.mutate}}function p(){}}},function(e){e.O(0,[688,462,553,270,593,623,412,955,807,11,762,999,888,774,179],function(){return e(e.s=32907)}),_N_E=e.O()}]); 2//# sourceMappingURL=account-e98e8be2a029c21a.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.