1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./rrh-ad-unit.component-q0nKftLV.js","./main.1.45.0.js","../css/main.1.45.0.css","./DefaultPropsProvider-C2syA4QN.js","../css/rrh-ad-unit-DG19D4iQ.css","./surfside-ad-unit.component-Dr88s3Ut.js","./jane-dm-cart-topper-row.component-BlWJYkdS.js","./sponsored-label.component-D_E-27fX.js","./Typography-C-divtet.js","../css/sponsored-label-NSPu1sFS.css","./slider.component-BqfYuRbu.js","./product-interaction-context-CgFTGeYC.js","./ecommerce-search-provider-B-RJ2BJM.js","./search-config-BhBQGKEp.js","./index-D_ibIeF5.js","./config-BQfsxwia.js","./inheritsLoose-Cagl8Uqp.js","./assertThisInitialized-PUtynf78.js","./index-BzcYWA6j.js","./use-store-CbMJqTO8.js","./use-add-to-checkout-lvc8nSru.js","./use-product-variants-8pehLRot.js","./index-Bru-Ui9l.js","./search-api.service-r7bhVHZf.js","./createSvgIcon-BKM72nfj.js","./Close-DmkQrzuU.js","./utils-DvjLjrK8.js","./product-dialog.component-CqxxQqi1.js","./useMediaQuery-Ll-jLsY2.js","./getThemeProps-Hzf5EfZS.js","./Dialog-C1imcgja.js","./Paper-DpdCpDyz.js","./Toolbar-Chet2LTv.js","./DialogContent-1FO7MY8V.js","./CircularProgress-d2-jiF45.js","../css/product-dialog-Brg_aGUu.css","../css/slider-DudPeNie.css","../css/jane-dm-cart-topper-row-C93is3Ik.css","./featured-brand-slider.component-DYf0Hrao.js","../css/featured-brand-slider-CSMonyOK.css"])))=>i.map(i=>d[i]); 2var e=Object.defineProperty,r=Object.defineProperties,t=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,s=(r,t,o)=>t in r?e(r,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[t]=o,i=(e,r)=>{for(var t in r||(r={}))a.call(r,t)&&s(e,t,r[t]);if(o)for(var t of o(r))n.call(r,t)&&s(e,t,r[t]);return e},l=(e,o)=>r(e,t(o)),d=(e,r)=>{var t={};for(var s in e)a.call(e,s)&&r.indexOf(s)<0&&(t[s]=e[s]);if(null!=e&&o)for(var s of o(e))r.indexOf(s)<0&&n.call(e,s)&&(t[s]=e[s]);return t},c=(e,r,t)=>new Promise(((o,a)=>{var n=e=>{try{i(t.next(e))}catch(r){a(r)}},s=e=>{try{i(t.throw(e))}catch(r){a(r)}},i=e=>e.done?o(e.value):Promise.resolve(e.value).then(n,s);i((t=t.apply(e,r)).next())}));import{r as u,d as m,e as p,j as h,f as y,y as f,u as v,i as g,R as x,a9 as b,a4 as j,c5 as C,k as N,m as w,p as S,T as _,S as k,U as E,V as A,c6 as I,c7 as D,c8 as T,w as P,a as L,b as M,g as O,c9 as R,ca as z,cb as F,cc as K,cd as B,X as V,ce as H,cf as $,cg as Y,ch as q,ci as W,I as G,n as U,B as Z,cj as J,ck as Q,cl as X,cm as ee,cn as re,_ as te,co as oe,cp as ae,cq as ne,Y as se,v as ie}from"./main.1.45.0.js";import{u as le,f as de,B as ce,F as ue}from"./button.component-XeC76gV5.js";import{a as me,g as pe,u as he,s as ye,b as fe,d as ve,r as ge,c as xe}from"./DefaultPropsProvider-C2syA4QN.js";import{I as be,h as je,P as Ce,N as Ne,u as we,f as Se,i as _e}from"./loyalty-enrollment-form.component-j-q3BYWu.js";import{T as ke}from"./text-field.component-7Oz7seAU.js";import{G as Ee}from"./Grid-tNXov3EZ.js";import{S as Ae}from"./select-field.component-BeMdbuL2.js";import{c as Ie,d as De}from"./config-BQfsxwia.js";import{A as Te,p as Pe,L as Le}from"./LocationOn-D_rD8dys.js";import{i as Me,c as Oe,t as Re}
vendor: 6,320 bytes, line 2
2from"./wp-api.service-WJfG6Hu9.js";import{c as ze,l as Fe,u as Ke,b as Be,m as Ve,f as He,r as $e,g as Ye}from"./createSvgIcon-BKM72nfj.js";import{B as qe}from"./Box-B7KeZM7t.js";import{T as We}from"./Typography-C-divtet.js";import{P as Ge}from"./Paper-DpdCpDyz.js";import{D as Ue}from"./Divider-CYqPJc_P.js";import{O as Ze,C as Je,P as Qe,b as Xe,E as er,a as rr,A as tr}from"./price-summary.component-rlE_tPHR.js";import{C as or}from"./CircularProgress-d2-jiF45.js";import"./lazysizes-DuioMqv2.js";import{S as ar}from"./Stack-OSSMca52.js";import{F as nr}from"./TextField-DuBg8nH-.js";import{F as sr}from"./FormControlLabel-C7OT43qt.js";import{S as ir,C as lr}from"./Checkbox-CLrJ0rDN.js";import{u as dr,d as cr,k as ur}from"./use-store-CbMJqTO8.js";import{E as mr}from"./checkout-loading.component-BvBVy-6H.js";import{c as pr}from"./Close-DmkQrzuU.js";import{L as hr}from"./loyalty-login-prompt.component-B7GqSOSV.js";import{S as yr}from"./Skeleton-aIUMGYlj.js";import{u as fr}from"./useMediaQuery-Ll-jLsY2.js";import{a as vr,D as gr}from"./Dialog-C1imcgja.js";import{g as xr,D as br}from"./DialogContent-1FO7MY8V.js";import"./utils-DvjLjrK8.js";import"./inheritsLoose-Cagl8Uqp.js";import"./Button-D9wQSZ3k.js";import"./Slide-B1dyqnE5.js";import"./index-BzcYWA6j.js";import"./useSlot-uG0WYWb0.js";import"./Close-BPe70H7B.js";import"./MenuItem-BB1eqUrL.js";import"./dividerClasses-D_-b5-a1.js";import"./Popper-DSOX66pA.js";import"./clsx-BeLtu-UY.js";import"./order-type.constants-DqXOEDFp.js";import"./Avatar-C6euOOx9.js";import"./LocalOffer-CaV4pcPm.js";import"./quantity-select.component-CrJ8Jj29.js";import"./use-update-quantity-DWlC3Jwr.js";import"./useThemeProps-CilF4Ygb.js";import"./getThemeProps-Hzf5EfZS.js";import"./assertThisInitialized-PUtynf78.js";import"./chip.component-Dao3K2Ky.js";const jr=[{label:"Alabama",id:"AL"},{label:"Alaska",id:"AK"},{label:"Arizona",id:"AZ"},{label:"Arkansas",id:"AR"},{label:"California",id:"CA"},{label:"Colorado",id:"CO"},{label:"Connecticut",id:"CT"},{label:"District of Columbia",id:"DC"},{label:"Delaware",id:"DE"},{label:"Florida",id:"FL"},{label:"Georgia",id:"GA"},{label:"Hawaii",id:"HI"},{label:"Idaho",id:"ID"},{label:"Illinois",id:"IL"},{label:"Indiana",id:"IN"},{label:"Iowa",id:"IA"},{label:"Kansas",id:"KS"},{label:"Kentucky",id:"KY"},{label:"Louisiana",id:"LA"},{label:"Maine",id:"ME"},{label:"Maryland",id:"MD"},{label:"Massachusetts",id:"MA"},{label:"Michigan",id:"MI"},{label:"Minnesota",id:"MN"},{label:"Mississippi",id:"MS"},{label:"Missouri",id:"MO"},{label:"Montana",id:"MT"},{label:"Nebraska",id:"NE"},{label:"Nevada",id:"NV"},{label:"New Hampshire",id:"NH"},{label:"New Jersey",id:"NJ"},{label:"New Mexico",id:"NM"},{label:"New York",id:"NY"},{label:"North Carolina",id:"NC"},{label:"North Dakota",id:"ND"},{label:"Ohio",id:"OH"},{label:"Oklahoma",id:"OK"},{label:"Oregon",id:"OR"},{label:"Pennsylvania",id:"PA"},{label:"Rhode Island",id:"RI"},{label:"South Carolina",id:"SC"},{label:"South Dakota",id:"SD"},{label:"Tennessee",id:"TN"},{label:"Texas",id:"TX"},{label:"Utah",id:"UT"},{label:"Vermont",id:"VT"},{label:"Virginia",id:"VA"},{label:"Washington",id:"WA"},{label:"West Virginia",id:"WV"},{label:"Wisconsin",id:"WI"},{label:"Wyoming",id:"WY"}];function Cr(e){return me("MuiDialogActions",e)}pe("MuiDialogActions",["root","spacing"]);const Nr=["className","disableSpacing"],wr=ye("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:t}=e;return[r.root,!t.disableSpacing&&r.spacing]}})((({ownerState:e})=>p({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},!e.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}}))),Sr=u.forwardRef((function(e,r){const t=he({props:e,name:"MuiDialogActions"}),{className:o,disableSpacing:a=!1}=t,n=m(t,Nr),s=p({},t,{disableSpacing:a}),i=(e=>{const{classes:r,disableSpacing:t}=e;return ve({root:["root",!t&&"spacing"]},Cr,r)})(s);return h.jsx(wr,p({className:fe(i.root,o),ownerState:s,ref:r},n))})),_r=["className","id"],kr=ye(We,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(e,r)=>r.root})({padding:"16px 24px",flex:"0 0 auto"}),Er=u.forwardRef((function(e,r){const t=he({props:e,name:"MuiDialogTitle"}),{className:o,id:a}=t,n=m(t,_r),s=t,i=(e=>{const{classes:r}=e;return ve({root:["root"]},xr,r)})(s),{titleId:l=a}=u.useContext(vr);return h.jsx(kr,p({component:"h2",className:fe(i.root,o),ownerState:s,ref:r,variant:"h6",id:null!=a?a:l},n))}));function Ar(e){return me("MuiFormGroup",e)}pe("MuiFormGroup",["root","row","error"]);const Ir=["className","row"],Dr=ye("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:t}=e;return[r.root,t.row&&r.row]}})((({ownerState:e})=>p({display:"flex",flexDirection:"column",flexWrap:"wrap"},e.row&&{flexDirection:"row"}))),Tr=u.forwardRef((function(e,r){const t=he({props:e,name:"MuiFormGroup"}),{className:o,row:a=!1}=t,n=m(t,Ir),s=le(),i=de({props:t,muiFormControl:s,states:["error"]}),l=p({},t,{row:a,error:i.error}),d=(e=>{const{classes:r,row:t,error:o}=e;return ve({root:["root",t&&"row",o&&"error"]},Ar,r)})(l);return h.jsx(Dr,p({className:fe(d.root,o),ownerState:l,ref:r},n))})),Pr=ze(h.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),Lr=ze(h.jsx("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked"),Mr=ye("span",{shouldForwardProp:ge})({position:"relative",display:"flex"}),Or=ye(Pr)({transform:"scale(1)"}),Rr=ye(Lr)((({theme:e,ownerState:r})=>p({left:0,position:"absolute",transform:"scale(0)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeIn,duration:e.transitions.duration.shortest})},r.checked&&{transform:"scale(1)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.shortest})})));function zr(e){const{checked:r=!1,classes:t={},fontSize:o}=e,a=p({},e,{checked:r});return h.jsxs(Mr,{className:t.root,ownerState:a,children:[h.jsx(Or,{fontSize:o,className:t.background,ownerState:a}),h.jsx(Rr,{fontSize:o,className:t.dot,ownerState:a})]})}const Fr=u.createContext(void 0);
2function Kr(e){return me("MuiRadio",e)}const Br=pe("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),Vr=["checked","checkedIcon","color","icon","name","onChange","size","className"],Hr=ye(ir,{shouldForwardProp:e=>ge(e)||"classes"===e,name:"MuiRadio",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:t}=e;return[r.root,"medium"!==t.size&&r[`size${y(t.size)}`],r[`color${y(t.color)}`]]}})((({theme:e,ownerState:r})=>p({color:(e.vars||e).palette.text.secondary},!r.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${"default"===r.color?e.vars.palette.action.activeChannel:e.vars.palette[r.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:f.alpha("default"===r.color?e.palette.action.active:e.palette[r.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"default"!==r.color&&{[`&.${Br.checked}`]:{color:(e.vars||e).palette[r.color].main}},{[`&.${Br.disabled}`]:{color:(e.vars||e).palette.action.disabled}})));const $r=h.jsx(zr,{checked:!0}),Yr=h.jsx(zr,{}),qr=u.forwardRef((function(e,r){var t,o;const a=he({props:e,name:"MuiRadio"}),{checked:n,checkedIcon:s=$r,color:i="primary",icon:l=Yr,name:d,onChange:c,size:f="medium",className:v}=a,g=m(a,Vr),x=p({},a,{color:i,size:f}),b=(e=>{const{classes:r,color:t,size:o}=e,a={root:["root",`color${y(t)}`,"medium"!==o&&`size${y(o)}`]};return p({},r,ve(a,Kr,r))})(x),j=u.useContext(Fr);let C=n;const N=Fe(c,j&&j.onChange);let w=d;var S,_;return j&&(void 0===C&&(S=j.value,C="object"==typeof(_=a.value)&&null!==_?S===_:String(S)===String(_)),void 0===w&&(w=j.name)),h.jsx(Hr,p({type:"radio",icon:u.cloneElement(l,{fontSize:null!=(t=Yr.props.fontSize)?t:f}),checkedIcon:u.cloneElement(s,{fontSize:null!=(o=$r.props.fontSize)?o:f}),ownerState:x,classes:b,name:w,checked:C,onChange:N,ref:r,className:fe(b.root,v)},g))}));function Wr(e){return me("MuiRadioGroup",e)}pe("MuiRadioGroup",["root","row","error"]);const Gr=["actions","children","className","defaultValue","name","onChange","value"],Ur=u.forwardRef((function(e,r){const{actions:t,children:o,className:a,defaultValue:n,name:s,onChange:i,value:l}=e,d=m(e,Gr),c=u.useRef(null),y=(e=>{const{classes:r,row:t,error:o}=e;return ve({root:["root",t&&"row",o&&"error"]},Wr,r)})(e),[f,v]=Ke({controlled:l,default:n,name:"RadioGroup"});u.useImperativeHandle(t,(()=>({focus:()=>{let e=c.current.querySelector("input:not(:disabled):checked");e||(e=c.current.querySelector("input:not(:disabled)")),e&&e.focus()}})),[]);const g=Be(r,c),x=Ve(s),b=u.useMemo((()=>({name:x,onChange(e){v(e.target.value),i&&i(e,e.target.value)},value:f})),[x,i,v,f]);return h.jsx(Fr.Provider,{value:b,children:h.jsx(Tr,p({role:"radiogroup",ref:g,className:fe(y.root,a)},d,{children:o}))})})),Zr={container:"ecommerce-checkout-module__container___Ngaig",contentSection:"ecommerce-checkout-module__contentSection___v-Ixr",emptyMessage:"ecommerce-checkout-module__emptyMessage___pTE1C",stickyElement:"ecommerce-checkout-module__stickyElement___6NQHN"},Jr=u.forwardRef((function(e,r){const t=e,{onChange:o}=t,a=d(t,["onChange"]);return h.jsx(be,l(i({},a),{mask:"m/d/Y",eager:!0,lazy:!1,blocks:{m:{mask:je.MaskedRange,placeholderChar:"m",from:1,to:12,maxLength:2,autofix:"pad"},d:{mask:je.MaskedRange,placeholderChar:"d",from:1,to:31,maxLength:2,autofix:"pad"},Y:{mask:je.MaskedRange,placeholderChar:"y",from:1900,to:2999,maxLength:4,autofix:!1}},definitions:{"#":/[1-9]/},inputRef:r,onAccept:r=>o({target:{name:e.name,value:r}})}))}));function Qr({formik:e,onContactFieldBlur:r}){const t=v((e=>e.checkout.orderType));return h.jsxs(Ee,{container:!0,spacing:2,children:[h.jsx(Ee,{item:!0,xs:6,children:h.jsx(ke,{id:"firstName",name:"firstName",label:"First Name",autoComplete:"KIOSK"===t?"off":"given-name",value:e.values.firstName,onChange:e.handleChange,error:e.touched.firstName&&Boolean(e.errors.firstName),helperText:e.touched.firstName&&e.errors.firstName})}),h.jsx(Ee,{item:!0,xs:6,children:h.jsx(ke,{id:"lastName",name:"lastName",label:"Last Name",autoComplete:"KIOSK"===t?"off":"family-name",value:e.values.lastName,onChange:e.handleChange,error:e.touched.lastName&&Boolean(e.errors.lastName),helperText:e.touched.lastName&&e.errors.lastName})}),h.jsx(Ee,{item:!0,xs:12,children:h.jsx(ke,{id:"phone",name:"phone",label:"Phone Number",autoComplete:"K
2IOSK"===t?"off":"tel",InputProps:{inputComponent:Ce},value:e.values.phone,onChange:e.handleChange,onBlur:r,error:e.touched.phone&&Boolean(e.errors.phone),helperText:e.touched.phone&&e.errors.phone})}),h.jsx(Ee,{item:!0,xs:12,children:h.jsx(ke,{id:"email",name:"email",label:"Email",autoComplete:"KIOSK"===t?"off":"email",value:e.values.email,onChange:e.handleChange,onBlur:r,error:e.touched.email&&Boolean(e.errors.email),helperText:e.touched.email&&e.errors.email})}),h.jsx(Ee,{item:!0,xs:12,children:h.jsx(ke,{id:"birthdate",name:"birthdate",label:"Birth date",autoComplete:"KIOSK"===t?"off":"bday",placeholder:"mm/dd/yyyy",InputLabelProps:{shrink:!0},InputProps:{inputComponent:Jr},value:e.values.birthdate,onChange:e.handleChange,error:e.touched.birthdate&&Boolean(e.errors.birthdate),helperText:e.touched.birthdate&&e.errors.birthdate})})]})}function Xr(e){const r=jr.map((e=>e.id));return h.jsx(Ae,i({options:r},e))}Jr.displayName="DateField",Xr.displayName="StateSelect";const et="address-search-module__autocompleteField___LCIyP";function rt(e){var r=e,{onSuccess:t,onSelect:o,businessId:a}=r,n=d(r,["onSuccess","onSelect","businessId"]);const s=g(),[m,p]=x.useState(null),[y,f]=x.useState(""),[v,C]=x.useState([]),N=u.useRef(!1),w=u.useRef(null),S=u.useRef(null),_=u.useRef(null);"undefined"==typeof window||N.current||(document.querySelector("#joint-google-maps")||b(`https://maps.googleapis.com/maps/api/js?key=${Ie.googleMapsApiKey}&libraries=places`,document.querySelector("head"),"joint-google-maps"),N.current=!0);const k=x.useMemo((()=>He(((e,r)=>{w.current.getPlacePredictions(e,r)}),800)),[]);return h.jsx(Te,{id:"delivery-location-search",className:xe(et,"joint-delivery-location-search",n.className),getOptionLabel:e=>"string"==typeof e?e:e.structured_formatting.main_text,filterOptions:e=>e,options:v,autoComplete:!0,includeInputInList:!0,value:m,noOptionsText:"No locations",onChange:(e,r)=>{if(C(r?[r,...v]:v),!r)return p(null),void(null==o||o(""));!S.current&&window.google&&(S.current=new window.google.maps.places.PlacesService(document.createElement("div"))),S.current&&_.current&&S.current.getDetails({placeId:r.place_id,fields:["address_components","formatted_address","geometry"],sessionToken:_.current},((e,i)=>c(null,null,(function*(){var i;if(!e)return;const{geometry:{location:l}}=e;try{let n=[];a&&(n=yield Me(l.lat(),l.lng(),[a])),0===n.length?(p(null),null==o||o(""),s(j({type:"error",message:"We do not currently deliver to this address."}))):(p(r),null==o||o(e),t(n))}catch(d){console.log(d),null==(i=n.onError)||i.call(n,d.message)}}))))},onInputChange:(e,r,t)=>{if(f(r),!w.current&&window.google&&(w.current=new window.google.maps.places.AutocompleteService,_.current||(_.current=new window.google.maps.places.AutocompleteSessionToken)),!w.current||!_.current)return;const o=y.trim();""===o||o.length<3||m&&o===m.structured_formatting.main_text?C(m?[m]:[]):k({input:o,types:["address"],sessionToken:_.current},(e=>{{let r=[];m&&(r=[m]),e&&(r=[...r,...e]),C(r)}}))},renderInput:e=>h.jsx(ke,l(i({},e),{id:"street1",name:"street1",label:"Search your address",autoComplete:n.autoComplete,fullWidth:!0,helperText:n.helperText,error:n.error,onChange:n.formik.handleChange})),renderOption:(e,r)=>{const t=r.structured_formatting.main_text_matched_substrings||[],o=Pe(r.structured_formatting.main_text,t.map((e=>[e.offset,e.offset+e.length])));return h.jsx("li",l(i({},e),{children:h.jsxs(Ee,{container:!0,alignItems:"center",children:[h.jsx(Ee,{item:!0,sx:{display:"flex",width:44},children:h.jsx(Le,{sx:{color:"text.secondary"}})}),h.jsxs(Ee,{item:!0,sx:{width:"calc(100% - 44px)",wordWrap:"break-word"},children:[o.map(((e,r)=>h.jsx(qe,{component:"span",sx:{fontWeight:e.highlight?"bold":"regular"},children:e.text},r))),h.jsx(We,{variant:"body2",color:"text.secondary",children:r.structured_formatting.secondary_text})]})]})}))}})}function tt(e){var r=e,{formik:t}=r;d(r,["formik"]);const o=v((e=>e.checkout.orderType)),a=v((e=>e.checkout.businessId));return h.jsxs(Ee,{container:!0,spacing:2,children:[h.jsx(Ee,{item:!0,xs:12,children:h.jsx(rt,{businessId:a,onSuccess:()=>{},onSelect:e=>{C(e,t)},error:t.touched.street1&&Boolean(t.errors.street1),helperText:t.touched.street1&&t.errors.street1?t.errors.street1:"",formik:t,autoComplete:"K
2IOSK"===o?"off":"street-address"})}),h.jsx(Ee,{item:!0,xs:12,children:h.jsx(ke,{id:"street2",name:"street2",autoComplete:"KIOSK"===o?"off":"on",label:"Apartment, Suite, etc",value:t.values.street2,onChange:t.handleChange,error:t.touched.street2&&Boolean(t.errors.street2),helperText:t.touched.street2&&t.errors.street2})}),h.jsx(Ee,{item:!0,xs:6,children:h.jsx(ke,{id:"city",name:"city",label:"City",autoComplete:"KIOSK"===o?"off":"address-level2",value:t.values.city,onChange:t.handleChange,error:t.touched.city&&Boolean(t.errors.city),helperText:t.touched.city&&t.errors.city})}),h.jsx(Ee,{item:!0,xs:6,children:h.jsx(Xr,{id:"state",name:"state",label:"State",autoComplete:"KIOSK"===o?"off":"address-level1",value:t.values.state,onChange:t.handleChange,error:t.touched.state&&Boolean(t.errors.state),helpertext:t.touched.state&&t.errors.state})}),h.jsx(Ee,{item:!0,xs:6,children:h.jsx(ke,{id:"zip",name:"zip",label:"Zip Code",autoComplete:"KIOSK"===o?"off":"postal-code",value:t.values.zip,onChange:t.handleChange,error:t.touched.zip&&Boolean(t.errors.zip),helperText:t.touched.zip&&t.errors.zip})})]})}function ot(e){var r=e,{id:t,title:o}=r,a=d(r,["id","title"]);return h.jsxs(Ge,{className:xe("joint-checkout-section j-m-2"),id:t,children:[o&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:xe("joint-checkout-section-title j-p-2"),children:h.jsx(We,{variant:"h5",component:"div",className:"j-font-bold",children:o})}),h.jsx(Ue,{})]}),h.jsx("div",{className:xe("joint-checkout-section-panel",!a.noPadding&&"j-p-2"),children:a.children})]})}const at=x.forwardRef((function(e,r){const t=e,{onChange:o}=t,a=d(t,["onChange"]);return h.jsx(be,l(i({},a),{mask:"m/Y",eager:!0,lazy:!1,blocks:{m:{mask:je.MaskedRange,placeholderChar:"m",from:1,to:12,maxLength:2,autofix:"pad"},Y:{mask:je.MaskedRange,placeholderChar:"y",from:1900,to:2999,maxLength:4,autofix:!1}},definitions:{"#":/[1-9]/},inputRef:r,onAccept:r=>o({target:{name:e.name,value:r}})}))}));function nt(e){var r=e,{formik:t}=r;d(r,["formik"]);const o=v((e=>e.checkout.orderType));return h.jsxs(Ee,{container:!0,spacing:2,children:[h.jsx(Ee,{item:!0,xs:12,children:h.jsx(ke,{id:"medicalCardNumber",name:"medicalCardNumber",label:"Medical Card Number",autoComplete:"KIOSK"===o?"off":"on",value:t.values.medicalCardNumber,onChange:t.handleChange,error:t.touched.medicalCardNumber&&Boolean(t.errors.medicalCardNumber),helperText:t.touched.medicalCardNumber&&t.errors.medicalCardNumber})}),h.jsx(Ee,{item:!0,xs:12,children:h.jsx(Xr,{id:"medicalCardState",name:"medicalCardState",label:"Medical Card State",autoComplete:"KIOSK"===o?"off":"address-level1",value:t.values.medicalCardState,onChange:t.handleChange,error:t.touched.medicalCardState&&Boolean(t.errors.medicalCardState),helpertext:t.touched.medicalCardState&&t.errors.medicalCardState})}),h.jsx(Ee,{item:!0,xs:12,children:h.jsx(ke,{id:"medicalCardExpirationDate",name:"medicalCardExpirationDate",label:"Expiration Date",autoComplete:"KIOSK"===o?"off":"on",placeholder:"mm/yyyy",InputLabelProps:{shrink:!0},value:t.values.medicalCardExpirationDate,InputProps:{inputComponent:at},onChange:t.handleChange,error:t.touched.medicalCardExpirationDate&&Boolean(t.errors.medicalCardExpirationDate),helperText:t.touched.medicalCardExpirationDate&&t.errors.medicalCardExpirationDate})})]})}function st(e){var r=e,{formik:t}=r;d(r,["formik"]);const o=v((e=>e.checkout.orderType));return h.jsxs(Ee,{container:!0,spacing:2,children:[h.jsx(Ee,{item:!0,xs:12,children:h.jsx(ke,{id:"driversLicenseNumber",name:"driversLicenseNumber",label:"Driver's License Number",autoComplete:"KIOSK"===o?"off":"on",value:t.values.driversLicenseNumber,onChange:t.handleChange,error:t.touched.driversLicenseNumber&&Boolean(t.errors.driversLicenseNumber),helperText:t.touched.driversLicenseNumber&&t.errors.driversLicenseNumber})}),h.jsx(Ee,{item:!0,xs:12,children:h.jsx(Xr,{id:"driversLicenseState",name:"driversLicenseState",label:"Driver's License State",autoComplete:"KIOSK"===o?"off":"address-level1",value:t.values.driversLicenseState,onChange:t.handleChange,error:t.touched.driversLicenseState&&Boolean(t.errors.driversLicenseState),helpertext:t.touched.driversLicenseState&&t.errors.driversLicenseState})}),h.jsx(Ee,{item:!0,xs:12,children:h.jsx(ke,{id:"driversLicenseExpirationDate",name:"driversLicenseExpirationDate",label:"Expiration Date",autoComplete:"K
2IOSK"===o?"off":"on",placeholder:"mm/dd/yyyy",InputLabelProps:{shrink:!0},value:t.values.driversLicenseExpirationDate,InputProps:{inputComponent:Jr},onChange:t.handleChange,error:t.touched.driversLicenseExpirationDate&&Boolean(t.errors.driversLicenseExpirationDate),helperText:t.touched.driversLicenseExpirationDate&&t.errors.driversLicenseExpirationDate})})]})}function it(e){var r=e,{formik:t}=r;d(r,["formik"]);return h.jsx(Ee,{container:!0,spacing:2,children:h.jsx(Ee,{item:!0,xs:12,children:h.jsx(Ze,{formik:t})})})}at.displayName="ExpirationDateField";const lt="order-summary-module__contentSection___meoIm",dt="order-summary-module__summaryContainer___4PUai",ct="order-summary-module__button___NZgP4",ut="order-summary-module__disclaimerText___N680z",mt=e=>{var r,t;const o=v((e=>e.checkout)),a=N(String(o.businessId)),n=w(o.orderType,null==a?void 0:a.order_settings);return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:xe(lt,"joint-checkout-business-info"),children:h.jsx(Je,{hideOrderOption:!0})}),h.jsx(Ue,{}),h.jsx("div",{className:xe(lt,"joint-checkout-price-summary"),children:h.jsxs("div",{className:dt,children:[h.jsx(We,{variant:"h5",component:"div",className:xe("joint-cart-price-summary-title j-font-bold j-mb-1"),children:"Order Summary"}),h.jsx(Qe,{isCheckoutPage:!0}),o.priceSummary&&h.jsx(h.Fragment,{children:h.jsxs("div",{className:"j-pt-2",children:[h.jsx(ce,{className:xe(ct,"joint-checkout-button"),onClick:()=>{e.formik.submitForm()},variant:"contained",color:"primary",size:"large",disabled:e.formik.isSubmitting||Boolean(o.error),children:e.formik.isSubmitting||"validating"===o.loadingState?h.jsx(or,{size:24,color:"secondary"}):`Place your order - ${S((null==(r=o.priceSummary)?void 0:r.total)||0)}`}),h.jsx(We,{variant:"body2",component:"div",className:ut,children:null!=(t=null==n?void 0:n.checkoutDisclaimer)?t:"*Due to regulations, cannabis purchases are limited. Your cart may not accurately reflect limitations. Orders will be verified during checkout."}),h.jsx(We,{variant:"body2",component:"div",className:ut,children:"Taxes calculated are estimates only. Actual tax amounts will be calculated at the time of payment."}),h.jsx(We,{variant:"body2",component:"div",className:ut,children:'By clicking "Place your order" you agree to receive automated text messages for order updates. Message and data rates may apply.'})]})})]})})]})},pt="aeropay-label-module__container___x8R7Z",ht="aeropay-label-module__logo___CnRiv",yt="aeropay-label-module__title___E7ZPv",ft="aeropay-label-module__description___ymcKX";function vt(){return h.jsxs("div",{className:xe(pt,"j-aeropay-label j-p-2"),children:[h.jsxs(ar,{direction:"row",alignItems:"center",justifyContent:"fle",spacing:1,children:[h.jsx("img",i({src:"https://rank-really-high.s3.amazonaws.com/partner-logos/aeropay-logo.webp",alt:"Aeropay logo",className:xe(ht,"lazyload aux-preload aeropay-pay-logo j-image"),width:100},{"data-sizes":"auto","data-src":"https://rank-really-high.s3.amazonaws.com/partner-logos/aeropay-logo.webp"})),h.jsx(Ue,{orientation:"vertical",flexItem:!0}),h.jsx(We,{variant:"body1",component:"div",className:yt,children:"Pay by bank"})]}),h.jsx(We,{variant:"body2",component:"div",className:ft,children:"Securely link your bank account one time, and enable one-click payments for all future purchases."})]})}const gt="cova-pay-label-module__title___s0wai",xt="cova-pay-label-module__description___pA8pb";function bt(){return h.jsxs("div",{className:"j-cova-pay-label j-p-2",children:[h.jsxs(ar,{direction:"row",alignItems:"center",spacing:1,children:[h.jsx(We,{variant:"body1",component:"div",className:gt,children:"Cova Pay"}),h.jsx(Ue,{orientation:"vertical",flexItem:!0}),h.jsx(We,{variant:"body1",component:"div",children:"Pay by card"})]}),h.jsx(We,{variant:"body2",component:"div",className:xt,children:"Pay securely with your credit or debit card via Cova Pay."})]})}const jt="stronghold-label-module__container___FkdD9",Ct="stronghold-label-module__logo___Gb106",Nt="stronghold-label-module__title___Z-3QM",wt="stronghold-label-module__description___zJFbg";function St(){return h.jsxs("div",{className:xe(jt,"joint-stronghold-label j-p-2"),children:[h.jsxs(ar,{direction:"row",alignItems:"center",spacing:1,children:[h.jsx("img",i({src:"https://rank-really-high.s3.amazonaws.com/partner-logos/stronghold-logo.svg",alt:"Stronghold logo",className:xe(Ct,"lazyload aux-preload stronghold-logo j-image"),width:100},{"data-sizes":"auto","data-src":"https://rank-really-high.s3.amazonaws.com/partner-logos/stronghold-logo.svg"})),h.jsx(Ue,{orientation:"vertical",flexItem:!0}),h.jsx(We,{variant:"body1",component:"div",className:Nt,children:"Pay by bank"})]}),h.jsx(We,{variant:"body2",component:"div",className:wt,children:"Securely link your bank account one time, and enable one-click payments for all future purchases."})]})}const _t="payment-type-form-module__highlightOption___knqqY",kt="payment-type-form-module__radioGroup___uSv0w",Et="payment-type-form-module__formControl
2Label___2EZdT",At="payment-type-form-module__orDivider___GJWVr",It="payment-type-form-module__orText___orw4t",Dt={AEROPAY:{name:"Aeropay",value:"AEROPAY",customLabel:h.jsx(vt,{}),className:_t,group:"express",order:1},COVA_PAY_CANADA:{name:"Cova Pay",value:"COVA_PAY_CANADA",customLabel:h.jsx(bt,{}),className:_t,group:"express",order:1},CASH:{name:"Cash",value:"CASH",customLabel:null,group:"other",order:2},DEBIT_CARD:{name:"Debit Card",value:"DEBIT_CARD",customLabel:null,group:"other",order:3},CHECK:{name:"Check",value:"CHECK",customLabel:null,group:"other",order:4},CREDIT_CARD:{name:"Credit Card",value:"CREDIT_CARD",customLabel:null,group:"other",order:5},PHONE:{name:"Phone",value:"PHONE",customLabel:null,group:"other",order:6},STRONGHOLD:{name:"Stronghold",value:"STRONGHOLD",customLabel:h.jsx(St,{}),group:"express",order:0}},Tt=e=>h.jsx(sr,{value:e.value,label:e.customLabel||e.name,control:h.jsx(qr,{size:"small"}),className:xe(e.className,Et),id:`payment-type-${e.value.toLowerCase()}`},e.value);function Pt(e){var r=e,{formik:t}=r,o=d(r,["formik"]);const a=u.useMemo((()=>o.paymentOptions.filter((e=>e in Dt)).map((e=>Dt[e])).sort(((e,r)=>e.order-r.order))),[o.paymentOptions]);u.useEffect((()=>{!t.values.paymentType&&a.length>0&&t.setFieldValue("paymentType",a[0].value)}),[t,a]);const n=a.filter((e=>"express"===e.group)),s=a.filter((e=>"express"!==e.group));return h.jsx("div",{className:"joint-payment-type-form",children:h.jsxs(ue,{className:xe("joint-radio-group",kt),component:"fieldset",children:[h.jsxs(Ur,l(i({"aria-label":"Payment Method",name:"paymentType",value:t.values.paymentType,onChange:t.handleChange},o),{children:[n.length>0&&(c=n,h.jsx("div",{className:"joint-express-checkout",children:c.map((e=>Tt(e)))})),n.length>0&&s.length>0&&h.jsx("div",{className:At,children:h.jsx(Ue,{children:h.jsx(We,{variant:"body2",className:It,children:"OR"})})}),s.length>0&&s.map((e=>Tt(e)))]})),h.jsx(nr,{error:t.touched.paymentType&&Boolean(t.errors.paymentType),id:"payment-type-helper-text",children:t.touched.paymentType&&t.errors.paymentType})]})});var c}const Lt=(e=new Date,r=1)=>new Date(e.getTime()+24*r*60*60*1e3),Mt=new Map,Ot=e=>{const r=e.toISOString();if(Mt.has(r))return Mt.get(r);const t=e.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"});return Mt.set(r,t),t},Rt=(e,r,t=!1)=>({name:`${t?"ASAP ":""}${Ot(e)} - ${Ot(r)}`,value:e.toLocaleString()}),zt=(e,r,t)=>{const o=new Date(e);o.setHours(0,0,0,0);const a=Re(r.open),n=Re(r.close),s=n<=a,i=s?n+1440:n,l=[];let d=a;for(;d<i;){const e=new Date(o);e.setMinutes(d);const r=Math.min(d+t,i),a=new Date(o);s&&r>=1440?(a.setDate(a.getDate()+1),a.setMinutes(r-1440)):a.setMinutes(r),r<=i&&l.push(Rt(e,a)),d+=t}return l},Ft=(e,r,t)=>{const o=r.getTime()+6e4*t;return e.filter((e=>new Date(e.value).getTime()>=o))},Kt=(e,r,t,o)=>{try{const a=new Date(Math.max(r.getTime()+6e4*t,new Date(e.value).getTime())),n=new Date(a.getTime()+6e4*o);return Rt(a,n,!0)}catch(a){return console.error("Error creating ASAP slot:",a),null}},Bt=(e,r,t)=>{if(!e)return null;if(r.useCustomHours&&r.customHours){const o=r.customHours[t];if(o){const t=i({},o);t.open<e.open&&(t.open=e.open);const a=Re(t.close),n=Re(e.close),s=n<=Re(e.open)?n+1440:n;if((a<=Re(t.open)?a+1440:a)>s&&(t.close=e.close),Re(t.open)<Re(t.close))return t;console.warn(`Custom hours for ${r.orderType} on ${o.day} are outside of business hours. Using default business hours.`)}}return e};function Vt(e){var r,t,o=e,{formik:a,orderTypeSettings:n}=o;d(o,["formik","orderTypeSettings"]);const s=dr(cr),i=Oe(null==s?void 0:s.timezone),l=i.getDay(),c=null==s?void 0:s.hours,u=null==c?void 0:c[l],[m,p]=x.useState(0);let[y]=x.useState(((e,r)=>{var t,o,a;if(!e)return[];try{const n=r.afterHours&&r.orderAheadDays||0,s=[],i=Oe(e.timezone),l=r.timeSlotLengthMinutes||30,d=r.nextAvailableTimeMinutes||0;for(let c=0;c<=n;c++){const n=Lt(i,c),u=n.getDay(),m=null==(t=e.hours)?void 0:t[u];
2if(!m||m.isClosed)continue;const p=Bt(m,r,u);if(!p||p.isClosed)continue;const h=zt(n,p,l);if(!h.length)continue;const y=Ft(h,i,d);if(!y.length)continue;if(a=i,(o=n).getFullYear()===a.getFullYear()&&o.getMonth()===a.getMonth()&&o.getDate()===a.getDate()&&i<new Date(h[h.length-1].value)&&r.asap){const e=Kt(h[0],i,d,l);e&&y.unshift(e)}const f={weekday:"long",month:"short",day:"numeric"};let v;v=u===i.getDay()?"Today":u===(i.getDay()+1)%7?"Tomorrow":n.toLocaleDateString("en-US",f),s.push({dayLabel:v,dayOptions:y})}return s}catch(n){return console.error("Error getting available time slots:",n),[]}})(s,n));const f=()=>((e,r,t)=>{if(!r||r.isClosed)return!1;const o=e.getDay(),a=Bt(r,t,o);if(!(null==a?void 0:a.open)||!(null==a?void 0:a.close))return!1;const n=60*e.getHours()+e.getMinutes(),s=Re(a.open),i=Re(a.close);if(i<=s){const e=n<720;return n>=s&&!e||n<=i&&e}return n>=s&&n<=i})(i,u,n);return f()||n.afterHours||(y=[]),h.jsx(Ee,{container:!0,spacing:2,children:y.length>0?h.jsxs(h.Fragment,{children:[h.jsx(Ee,{item:!0,xs:12,children:h.jsx(Ae,{id:"scheduledDay",name:"scheduledDay",label:"Day",value:(null==(r=y[m])?void 0:r.dayLabel)||"",onChange:e=>{const r=e.target.value,t=y.findIndex((e=>e.dayLabel===r));p(t)},error:a.touched.scheduledAt&&Boolean(a.errors.scheduledAt),helpertext:a.touched.scheduledAt&&a.errors.scheduledAt,options:y.map((e=>e.dayLabel))})}),h.jsx(Ee,{item:!0,xs:12,children:h.jsx(Ae,{id:"scheduledAt",name:"scheduledAt",label:"Time",value:a.values.scheduledAt,onChange:a.handleChange,error:a.touched.scheduledAt&&Boolean(a.errors.scheduledAt),helpertext:a.touched.scheduledAt&&a.errors.scheduledAt,options:(null==(t=y[m])?void 0:t.dayOptions)||[]})})]}):h.jsxs(Ee,{item:!0,xs:12,children:[f()?h.jsx(We,{variant:"body1",component:"div",children:"There are currently no time slots available. Please come back tomorrow when the store opens to place your order."}):h.jsx(h.Fragment,{children:n.afterHoursMessage?h.jsx(We,{variant:"body1",component:"div",children:n.afterHoursMessage}):h.jsx(We,{variant:"body1",component:"div",children:"The Store is currently closed. Please come back when the store opens to place your Order"})}),a.touched.scheduledAt&&Boolean(a.errors.scheduledAt)&&h.jsx(nr,{error:!0,children:a.errors.scheduledAt})]})})}const Ht="https://checkoutshopper-live.adyen.com/checkoutshopper/sdk/5.49.4",$t="cova-pay-mount";function Yt(e,r){return getComputedStyle(document.documentElement).getPropertyValue(e).trim()||r}const qt=["en-CA","fr-CA"],Wt=!0,Gt=!0,Ut=!0,Zt=!0,Jt=!0,Qt="partial",Xt=!0,eo=!0,ro=!0,to=!1,oo="",ao=!0,no="en-CA";function so(e,r,t){return c(this,null,(function*(){return new Promise(((o,a)=>c(null,null,(function*(){var n,s,i;if(!e.priceSummary||!e.id)return a(new Error("An error occurred during the purchase process."));let l;try{l=yield(d={orderReference:e.id,amount:r,returnUrl:window.location.href},_.post(`${k()}/payments/cova-pay/session`,d).then((e=>E(e))).catch(A))}catch(T){return a(T instanceof Error?T:new Error("Error creating Cova Pay session."))}var d;if(!((null==l?void 0:l.sessionId)&&l.providerSessionId&&l.sessionData&&l.adyenClientKey&&l.adyenEnvironment))return a(new Error("Cova Pay session is missing required data."));const c=window.AdyenCheckout;if(!c)return a(new Error("Adyen Web SDK is not loaded."));const u=document.createElement("dialog");u.className="joint-cova-pay-dialog",function(e){const r=document.createElement("span");r.style.color=e,document.body.appendChild(r);const t=getComputedStyle(r).color;r.remove();const o=t.match(/[\d.]+/g);if(!o||o.length<3)return!1;const[a,n,s]=o.map(Number);return(.299*a+.587*n+.114*s)/255>.6}("var(--joint-theme-primary-contrast-text)")&&u.classList.add("joint-cova-pay-dialog--pay-icon-light");const m=document.createElement("div");m.className="joint-cova-pay-dialog__header";const p=document.createElement("h2");p.className="joint-cova-pay-dialog__title",p.textContent="Pay by card";const h=document.createElement("button");h.type="button",h.className="joint-cova-pay-dialog__close",h.setAttribute("aria-label","Close"),h.textContent="â",m.appendChild(p),m.appendChild(h);const y=document.createElement("div");
2y.id=$t,y.className="joint-cova-pay-dialog__mount",u.appendChild(m),u.appendChild(y),document.body.appendChild(u);let f=!1;const v=()=>{u.open&&u.close(),u.parentNode&&u.parentNode.removeChild(u)},g=e=>{f||(f=!0,v(),a(e))};h.addEventListener("click",(()=>g(new Error("Cova Pay payment was cancelled.")))),u.addEventListener("cancel",(e=>{e.preventDefault(),g(new Error("Cova Pay payment was cancelled."))}));const x=Math.round(100*r),b=function(e){const r=null!=e?e:{},t="none"===r.billingAddressMode||"partial"===r.billingAddressMode||"full"===r.billingAddressMode?r.billingAddressMode:Qt,o="string"==typeof r.locale&&qt.includes(r.locale)?r.locale:no;return{showPayButton:"boolean"==typeof r.showPayButton?r.showPayButton:Wt,hasHolderName:"boolean"==typeof r.hasHolderName?r.hasHolderName:Gt,holderNameRequired:"boolean"==typeof r.holderNameRequired?r.holderNameRequired:Ut,positionHolderNameOnTop:"boolean"==typeof r.positionHolderNameOnTop?r.positionHolderNameOnTop:Zt,billingAddressRequired:"boolean"==typeof r.billingAddressRequired?r.billingAddressRequired:Jt,billingAddressMode:t,prefillHolderName:"boolean"==typeof r.prefillHolderName?r.prefillHolderName:Xt,prefillBillingAddress:"boolean"==typeof r.prefillBillingAddress?r.prefillBillingAddress:eo,shopperEmail:"boolean"==typeof r.shopperEmail?r.shopperEmail:ro,enableStoreDetails:"boolean"==typeof r.enableStoreDetails?r.enableStoreDetails:to,disclaimerMessage:"string"==typeof r.disclaimerMessage?r.disclaimerMessage:oo,showFormInstructions:"boolean"==typeof r.showFormInstructions?r.showFormInstructions:ao,locale:o}}(l.adyenFormOptions),j=(null==(n=t.firstName)?void 0:n.trim())||"",C=(null==(s=t.lastName)?void 0:s.trim())||"",N=(null==(i=t.email)?void 0:i.trim())||"",w=b.prefillHolderName?[j,C].filter(Boolean).join(" "):"",S=b.prefillBillingAddress&&e.address?{postalCode:e.address.zip||"",country:"CA"}:void 0,I=b.shopperEmail&&N||void 0,D=(e,r,t)=>{N&&(e.shopperEmail=N),j&&C&&(e.shopperName={firstName:j,lastName:C}),t.resolve(e)};try{if((yield c({session:{id:l.providerSessionId,sessionData:l.sessionData},environment:l.adyenEnvironment,clientKey:l.adyenClientKey,locale:b.locale,amount:{value:x,currency:"CAD"},beforeSubmit:D,onPaymentCompleted:e=>{return"Authorised"===e.resultCode||"Received"===e.resultCode?(r=l.sessionId,void(f||(f=!0,v(),o(r)))):g(new Error(`Cova Pay payment was not completed (${e.resultCode}).`));var r},onError:e=>g(e)})).create("card",{showPayButton:b.showPayButton,amount:{value:x,currency:"CAD"},hasHolderName:b.hasHolderName,holderNameRequired:b.holderNameRequired,positionHolderNameOnTop:b.positionHolderNameOnTop,billingAddressRequired:b.billingAddressRequired,billingAddressMode:b.billingAddressMode,showFormInstructions:b.showFormInstructions,data:{holderName:w||void 0,billingAddress:S,shopperEmail:I},styles:{base:{color:Yt("--joint-theme-text-primary","#111827"),fontSize:"16px",fontWeight:"400",fontFamily:Yt("--joint-theme-font","Inter, sans-serif")},placeholder:{color:Yt("--joint-theme-text-secondary","#9ca3af")},error:{color:Yt("--joint-theme-error","#b91c1c")}}}).mount(`#${$t}`),b.disclaimerMessage){const e=document.createElement("div");e.className="joint-cova-pay-disclaimer",e.textContent=b.disclaimerMessage,y.appendChild(e)}u.showModal()}catch(T){g(T instanceof Error?T:new Error("Error initializing Cova Pay."))}}))))}))}function io(e,r,t){return c(this,null,(function*(){return new Promise(((o,a)=>c(null,null,(function*(){if(!e.priceSummary)return a(new Error("An error occurred during the purchase process."));try{const s=yield function(e){return _.post(`${k()}/payments/customers`,{paymentMethod:"stronghold",email:e.email,mobile:e.phone,firstName:e.firstName,lastName:e.lastName,externalCustomerId:e.email,country:"US"}).then(E).catch(A)}(t),l=yield(n=s.customerId,_.post(`${k()}/payments/customers/token`,{paymentMethod:"stronghold",customerId:n}).then(E).catch(A)),d=window.Stronghold.Pay(i({publishableKey:r.publishable_key,environment:"development"===De?"sandbox":"live"},r.integration_id&&{integrationId:r.integration_id}));let c=!1;d.addPaymentSource(l.token,{onSuccess:r=>{if(c)return;c=!0;const t=Math.round(100*e.priceSummary.total);d.charge(l.token,{charge:{amount:t,paymentSourceId:r.id},authorizeOnly:!0,onSuccess:e=>{o(e.id)},onError:e=>{a(new Error((null==e?void 0:e.message)||"Error processing Stronghold charge."))}})},onError:e=>{a(new Error((null==e?void 0:e.message)||"Error linking bank account with Stronghold."))},onExit:()=>{a(new Error("Bank linking was cancelled."))}})}catch(s){a(s instanceof Error?s:new Error("Error processing payment with Stronghold."))}var n}))))}
2))}const lo="purchase-overlay-module__backdrop___QmxRo",co="purchase-overlay-module__container___Uar26",uo="purchase-overlay-module__spinner___ahb-f",mo="purchase-overlay-module__title___3w3I1",po="purchase-overlay-module__message___TXKbK";function ho({open:e}){return u.useEffect((()=>(e?(document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden"):(document.body.style.overflow="",document.documentElement.style.overflow=""),()=>{document.body.style.overflow="",document.documentElement.style.overflow=""})),[e]),e?h.jsx(pr,{open:e,className:`${lo} joint-purchase-overlay`,sx:{position:"fixed",zIndex:e=>e.zIndex.drawer+1,color:"#fff"},children:h.jsxs(qe,{className:`${co} joint-purchase-overlay-content`,children:[h.jsx(or,{size:60,thickness:4,className:`${uo} joint-purchase-spinner`,color:"primary"}),h.jsx(We,{variant:"h6",component:"h2",className:`${mo} joint-purchase-title`,children:"Processing your order..."}),h.jsx(We,{variant:"body2",className:`${po} joint-purchase-message`,children:"Please wait while we complete your purchase"})]})}):null}const yo={[I.NONE]:null,[I.APPLIED]:{severity:"success",message:e=>`Promo code applied: ${e}`},[I.INELIGIBLE]:{severity:"warning",message:()=>"Your cart is ineligible for this promotion. The promo code has been applied but no discount was given."},[I.INVALID]:{severity:"error",message:e=>`We couldn't find a promotion with the code ${e}.`}};function fo({formik:e}){var r,t,o;const a=g(),n=v((e=>e.checkout)),[s,i]=u.useState(!1),[l,d]=u.useState(!1),m=yo[null!=(r=n.promoCodeStatus)?r:I.NONE];return h.jsx(qe,{sx:{width:"100%",pt:2,pl:2},children:h.jsxs(Ee,{container:!0,spacing:2,children:[m&&h.jsx(Ne,{severity:m.severity,sx:{mt:0,mb:2},onClose:()=>c(null,null,(function*(){if(!n.id)return;d(!0);const r=D(e.values.birthdate);try{yield a(T({checkoutId:n.id,promoCode:"",silent:!0,customer:{firstName:e.values.firstName,lastName:e.values.lastName,phone:e.values.phone,birthdate:r,email:e.values.email,medicalCard:{expirationDate:e.values.medicalCardExpirationDate,number:e.values.medicalCardNumber,state:e.values.medicalCardState}},address:{street1:e.values.street1,street2:e.values.street2,city:e.values.city,state:e.values.state,zip:e.values.zip}})).unwrap(),e.setFieldValue("promoCode",""),yield a(P(n.id))}catch(t){console.error("Failed to remove promo code:",t)}finally{d(!1)}})),children:m.message(null!=(t=n.promoCode)?t:"")}),h.jsxs(Ee,{container:!0,spacing:2,children:[h.jsx(Ee,{item:!0,xs:12,sm:8,children:h.jsx(ke,{id:"promoCode",name:"promoCode",label:"Promo Code",value:e.values.promoCode,onChange:r=>{const t=r.target.value.toUpperCase();e.setFieldValue("promoCode",t)},error:e.touched.promoCode&&Boolean(e.errors.promoCode),fullWidth:!0})}),h.jsx(Ee,{item:!0,xs:12,sm:4,children:h.jsx(ce,{variant:"outlined",onClick:r=>c(null,null,(function*(){var t;if(r.preventDefault(),r.stopPropagation(),!n.id||!(null==(t=e.values.promoCode)?void 0:t.trim()))return;i(!0);const o=D(e.values.birthdate);try{yield a(T({checkoutId:n.id,promoCode:e.values.promoCode.trim(),silent:!0,customer:{firstName:e.values.firstName,lastName:e.values.lastName,phone:e.values.phone,birthdate:o,email:e.values.email,medicalCard:{expirationDate:e.values.medicalCardExpirationDate,number:e.values.medicalCardNumber,state:e.values.medicalCardState}},address:{street1:e.values.street1,street2:e.values.street2,city:e.values.city,state:e.values.state,zip:e.values.zip}})).unwrap(),yield a(P(n.id))}catch(s){console.error("Failed to apply promo code:",s)}finally{i(!1)}})),disabled:s||l||!(null==(o=e.values.promoCode)?void 0:o.trim()),type:"button",fullWidth:!0,sx:{height:"56px"},children:s?"Applying...":"Apply"})})]})]})})}var vo,go={};function xo(){if(vo)return go;vo=1;var e=L();Object.defineProperty(go,"__esModule",{value:!0}),go.default=void 0;var r=e($e()),t=M();return go.default=(0,r.default)((0,t.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"RadioButtonUnchecked"),go}const bo=O(xo()),jo="checkout";function Co({formik:e}){var r,t,o,a,n,s,l,d,m;const p=g(),{loyaltyEnabled:y,rewardRedemptionEnabled:f}=we(jo),x=v((e=>e.checkout)),b=v((e=>e.customer.loyalty)),[j,C]=u.useState(null),[N,w]=u.useState(!1),_="connected"===b.connectionStatus,k=_&&!!b.wallet,E=(null!=(t=null==(r=b.wallet)?void 0:r.discountTemplates)?t:[]).filter((e=>!e.inStoreRedemption)),A=null!=(o=x.loyaltyRewardIds)?o:[],I=new Set(A),L=A.length>0,M=Number(null!=(n=null==(a=x.priceSummary)?void 0:a.rewards)?n:0),O
2=R(null==(s=x.priceSummary)?void 0:s.discountBreakdown),G=E.filter((e=>I.has(e.id)&&z(e,O))).length,U=null!==j||N,Z=F(x.items),J=Number(null!=(d=null==(l=b.wallet)?void 0:l.loyaltyPoints)?d:0),Q=E.filter((e=>I.has(e.id))).reduce(((e,r)=>{var t;return e+Number(null!=(t=r.pointsDeduction)?t:0)}),0),X=new Map(E.map((e=>{var r;return[e.id,K(e,{cartSpend:Z,pointsBalance:J,pointsCommitted:I.has(e.id)?Q-Number(null!=(r=e.pointsDeduction)?r:0):Q})]}))),ee=E.filter((e=>{var r;return I.has(e.id)&&!(null==(r=X.get(e.id))?void 0:r.eligible)})),re=!L||M>0?"":1===ee.length?`${B(ee[0])}: ${null==(m=X.get(ee[0].id))?void 0:m.reason}`:ee.length>1?`${ee.length} of your rewards can't be used on this cart. See the reasons below.`:"These rewards gave no credit on your current cart.",te=E.filter((e=>{var r;return null==(r=X.get(e.id))?void 0:r.eligible})).length,oe=y&&f&&k&&E.length>0,ae=u.useRef(!1);u.useEffect((()=>{oe&&!ae.current&&(ae.current=!0,V({surface:jo,rewardCount:E.length,eligibleRewardCount:te,pointsBalance:J,rewardRedemptionEnabled:f}))}),[oe,E.length,te,J,f]);const ne=re?A.join(","):"",se=u.useRef("");if(u.useEffect((()=>{oe&&ne!==se.current&&(se.current=ne,ne&&H({surface:jo,rewardIds:A,reason:re}))}),[oe,ne]),!y||!f)return null;if(_&&!k&&"loading"===b.walletStatus)return h.jsxs(qe,{sx:{width:"100%",pt:2},children:[h.jsx(yr,{variant:"text",height:28,width:"60%"}),h.jsx(yr,{variant:"text",height:28,width:"40%"})]});if(!k)return h.jsx(qe,{sx:{width:"100%",pt:2},children:h.jsx(We,{variant:"body2",color:"text.secondary",children:"Sign in to your rewards account to redeem an offer."})});if(0===E.length)return h.jsx(qe,{sx:{width:"100%",pt:2},children:h.jsx(We,{variant:"body2",color:"text.secondary",children:"You have no rewards available to redeem right now."})});const ie=r=>c(null,null,(function*(){if(!x.id)return null;const t=yield p(T(i({checkoutId:x.id,loyaltyRewardIds:r,silent:!0},{customer:{firstName:e.values.firstName,lastName:e.values.lastName,phone:e.values.phone,birthdate:D(e.values.birthdate),email:e.values.email,medicalCard:{expirationDate:e.values.medicalCardExpirationDate,number:e.values.medicalCardNumber,state:e.values.medicalCardState}},address:{street1:e.values.street1,street2:e.values.street2,city:e.values.city,state:e.values.state,zip:e.values.zip}}))).unwrap();return e.setFieldValue("loyaltyRewardIds",r),yield p(P(x.id)),t})),le=e=>{return I.has(e.id)?(r=e.id,c(null,null,(function*(){if(x.id&&!U){C({id:r,action:"remove"});try{yield ie(A.filter((e=>e!==r))),Y({surface:jo,rewardId:r,scope:"single",trigger:"user"})}catch(e){console.error("Failed to remove loyalty reward:",e)}finally{C(null)}}}))):(e=>c(null,null,(function*(){var r,t;if(!x.id||U||I.has(e.id))return;const o=[...A,e.id];C({id:e.id,action:"apply"});try{const a=yield ie(o),n=null==(r=null==a?void 0:a.priceSummary)?void 0:r.discountBreakdown;q({surface:jo,rewardId:e.id,rewardName:e.name,pointsCost:Number(null!=(t=e.pointsDeduction)?t:0),value:W(e,n),appliedCount:o.length,isCredited:z(e,R(n))})}catch(a){console.error("Failed to apply loyalty reward:",a)}finally{C(null)}})))(e);var r},de=(e="user")=>c(null,null,(function*(){if(x.id&&!U){w(!0);try{yield ie([]),Y({surface:jo,scope:"all",trigger:e})}catch(r){console.error("Failed to remove loyalty rewards:",r)}finally{w(!1)}}}));return h.jsxs(qe,{sx:{width:"100%",pt:2},children:[re&&h.jsx(Ne,{severity:"warning",sx:{mt:0,mb:2},onClose:()=>de("no_credit_notice"),children:re}),L&&M>0&&h.jsxs(Ne,{severity:"success",sx:{mt:0,mb:2},onClose:()=>de("user"),children:[G>1?`${G} rewards applied`:"Reward applied",". You saved"," ",S(M),"."]}),h.jsx(ar,{spacing:1.5,children:E.map((e=>{var r;const t=I.has(e.id),o=t&&z(e,O),a=(null==j?void 0:j.id)===e.id,n=X.get(e.id),s=null==(r=null==n?void 0:n.eligible)||r,i=$(e),l=s?"":null==n?void 0:n.reason,d=t||s||a,c=a?h.jsx(or,{size:"1.25rem","data-testid":`reward-pending-${e.id}`,sx:{color:"action.active"}}):null;return h.jsx(sr,{disabled:!d||U,control:h.jsx(lr,{size:"small",checked:a?"apply"===(null==j?void 0:j.action):t,onChange:()=>le(e),icon:null!=c?c:h.jsx(bo,{fontSize:"small","data-testid":`reward-unapplied-${e.id}`,sx:d?void 0:{color:"action.disabled"}}),checkedIcon:null!=c?c:o?h.jsx(Xe,{fontSize:"small","data-testid":`reward-credited-${e.id}`,sx:{color:"success.main"}}):h.jsx(er,{fontSize:"small","data-testid":`reward-applied-nocredit-${e.id}`,sx:{color:"warning.main"}})}),label:h.jsxs(qe,{sx:{minWidth:0},children:[h.jsxs(We,{variant:"h6",component:"div",noWrap:!0,children:[e.name,i&&` - ${i}`]}),e.pointsDeduction>0&&h.jsxs(We,{variant:"caption",color:"text.secondary",display:"block",children:[Se(e.pointsDeduction)," pts"]}),l&&h.jsx(We,{variant:"caption",className:"j-error",display:"block",children:l})]}),sx:{width:"100%",mr:0,ml:0,borderRadius:1,"& .MuiCheckbox-root":{ml:"-9px"},"& .MuiCheckbox-root.Mui-focusVisible, & .MuiCheckbox-root:has(input:focus-visible)":{outline:"2px s
2olid",outlineColor:"primary.main",outlineOffset:"-3px",borderRadius:"50%"},"&&":{color:"inherit"},transition:"background-color 150ms","&:hover":{backgroundColor:"color-mix(in srgb, currentColor 13%, transparent)"},"&.Mui-disabled:hover":{backgroundColor:"transparent"},"& .MuiFormControlLabel-label":{minWidth:0},"&.Mui-disabled .MuiTypography-root:not(.j-error)":{color:"text.disabled"}}},e.id)}))})]})}const No=x.lazy((()=>te((()=>import("./rrh-ad-unit.component-q0nKftLV.js")),__vite__mapDeps([0,1,2,3,4]),import.meta.url))),wo=x.lazy((()=>te((()=>import("./surfside-ad-unit.component-Dr88s3Ut.js")),__vite__mapDeps([5,1,2]),import.meta.url))),So=x.lazy((()=>te((()=>import("./jane-dm-cart-topper-row.component-BlWJYkdS.js")),__vite__mapDeps([6,1,2,7,3,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37]),import.meta.url))),_o=x.lazy((()=>te((()=>import("./featured-brand-slider.component-DYf0Hrao.js")),__vite__mapDeps([38,1,2,3,13,14,15,10,11,12,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,8,36,39]),import.meta.url))),ko=e=>{const r=null!=e?e:"";return r.startsWith("+1")?r.substring(2):r};function Eo(){var e;const r=g(),[t,o]=u.useState(null),a=v((e=>e.checkout)),n=v((e=>e.customer.loyalty)),s=dr(ur),d=dr(cr),[m,p]=u.useState(null),y=u.useContext(G),f=u.useRef(null),x=u.useRef(null),[C,N]=u.useState(!1),[S,_]=u.useState(""),k=U(),{loyaltyEnabled:E,rewardRedemptionEnabled:A}=we("checkout"),I=Ye(),L=fr(I.breakpoints.up("md"));u.useEffect((()=>{"idle"===a.loadingState&&a.shouldValidate&&a.id&&a.items.length>0&&r(P(a.id))}),[a.id,a.loadingState,a.shouldValidate]),u.useEffect((()=>{if(a.businessId&&a.orderType){const e=w(a.orderType,window.jointEcommerce.stores[a.businessId].order_settings);e?(R.setFieldValue("allowScheduling",null==e?void 0:e.scheduled),p(e)):(p(null),o(`Sorry, there was an issue loading your ${Z(a.orderType)} order. Please change your order type in your cart to proceed with checkout.`))}}),[a.businessId,a.orderType]),u.useEffect((()=>{(null==m?void 0:m.paymentTypes.includes("AEROPAY"))&&(document.querySelector("#aeropay-js")||b("https://sdk.aeropay.com/ap/aeropay.js",document.querySelector("head"),"aeropay-js")),(null==m?void 0:m.paymentTypes.includes("COVA_PAY_CANADA"))&&function(){if(document.querySelector("#adyen-web-js")||b(`${Ht}/adyen.js`,document.querySelector("head"),"adyen-web-js"),!document.querySelector("#adyen-web-css")){const e=document.createElement("link");e.id="adyen-web-css",e.rel="stylesheet",e.href=`${Ht}/adyen.css`,document.head.appendChild(e)}}(),(null==m?void 0:m.paymentTypes.includes("STRONGHOLD"))&&(document.querySelector("#stronghold-js")||b("https://api.strongholdpay.com/v2/js",document.querySelector("head"),"stronghold-js"))}),[m]),u.useEffect((()=>{var e,r,t,o,s,d,c;const u=a.customer,m="connected"===n.connectionStatus?n.contact:null;(u||m)&&R.setValues(l(i({},R.values),{firstName:(null==u?void 0:u.firstName)||R.values.firstName||(null==m?void 0:m.firstName)||"",lastName:(null==u?void 0:u.lastName)||R.values.lastName||(null==m?void 0:m.lastName)||"",email:(null==u?void 0:u.email)||R.values.email||(null==m?void 0:m.email)||"",phone:ko(null==u?void 0:u.phone)||R.values.phone||ko(null==m?void 0:m.mobilePhone)||"",street1:(null==(e=a.address)?void 0:e.street1)||R.values.street1,street2:(null==(r=a.address)?void 0:r.street2)||R.values.street2,city:(null==(t=a.address)?void 0:t.city)||R.values.city,state:(null==(o=a.address)?void 0:o.state)||R.values.state,zip:(null==(s=a.address)?void 0:s.zip)||R.values.zip,birthdate:(null==u?void 0:u.birthdate)?J(u.birthdate):R.values.birthdate,promoCode:null!=(c=null!=(d=a.promoCode)?d:R.values.promoCode)?c:null}))}),[a.customer,a.address,a.promoCode,n.contact,n.connectionStatus]),u.useEffect((()=>{var e,t,o,s,i;if("connected"!==n.connectionStatus||!n.contact)return;if(!a.id||"idle"!==a.loadingState)return;if((null==(e=a.customer)?void 0:e.firstName)||(null==(t=a.customer)?void 0:t.lastName)||(null==(o=a.customer)?void 0:o.email))return;if(f.current===a.id)return;const{firstName:l,lastName:d,email:c,mobilePhone:u}=n.contact;
2(l||d||c||u)&&(f.current=a.id,r(T({checkoutId:a.id,silent:!0,customer:{firstName:null!=l?l:"",lastName:null!=d?d:"",email:null!=c?c:"",phone:null!=u?u:"",birthdate:null!=(i=null==(s=a.customer)?void 0:s.birthdate)?i:""}})))}),[r,a.id,a.loadingState,a.customer,n.connectionStatus,n.contact]),u.useEffect((()=>{a.id&&"idle"===a.loadingState&&!a.shouldValidate&&a.priceSummary&&0!==a.items.length&&x.current!==a.id&&(x.current=a.id,Q({event:"begin_checkout",data:{cart_total:a.priceSummary.total,cart_items:a.items.reduce(((e,r)=>e+Number(r.quantity)),0)}}))}),[a.id,a.loadingState,a.shouldValidate,a.priceSummary,a.items]);const M=(e,r={})=>{ee(y.alpineIq,{email:r.email?null:e.email,phone:r.phone?null:e.phone,firstName:e.firstName,lastName:e.lastName}).then((e=>{e&&re({source:"checkout"})}))},O=e=>c(null,null,(function*(){var t,n,s;const i=yield r(oe(e));if(o(null),oe.fulfilled.match(i)){if("KIOSK"!==a.orderType&&(null==(t=i.payload.customer)?void 0:t.id)&&i.payload.customer.id!==ae()&&ne(i.payload.customer.id),(null==(s=null==(n=y.janeAds)?void 0:n.credentials)?void 0:s.store_id)&&i.payload.items&&i.payload.items.length>0)try{yield se(i.payload)}catch(l){console.error("Failed to track order with Jane DM:",l)}const e=ie();i.payload.posOrderId&&e.searchParams.set("orderId",i.payload.posOrderId),a.businessId&&e.searchParams.set("businessId",a.businessId.toString()),window.location.href=e.toString()}else oe.rejected.match(i)&&o(i.payload)})),R=_e({initialValues:{firstName:"",lastName:"",phone:"",email:"",birthdate:"",orderType:a.orderType,menuType:a.menuType,medicalCardNumber:"",medicalCardExpirationDate:"",medicalCardState:"",address:"",street1:"",street2:"",city:"",state:"",zip:"",paymentType:"",allowScheduling:(null==m?void 0:m.scheduled)||!1,scheduledAt:"",driversLicenseNumber:"",driversLicenseExpirationDate:"",driversLicenseState:"",promoCode:null},validationSchema:X(m),enableReinitialize:!0,onSubmit:(e,t)=>c(null,[e,t],(function*(e,{setSubmitting:t}){var n,s,d,u;const p=D(e.birthdate);if(a.id&&p){if(a.error)return r(j({type:"error",message:"There are errors in your cart. Please clear errors before proceeding."})),void t(!1);try{const r={fees:a.fees,checkoutId:a.id,customer:{firstName:e.firstName,lastName:e.lastName,phone:e.phone,birthdate:p,email:e.email},address:{street1:e.street1,street2:e.street2,city:e.city,state:e.state,zip:e.zip},orderType:e.orderType,menuType:a.menuType,scheduledAt:e.scheduledAt,paymentMethod:e.paymentType,promoCode:e.promoCode};if("MEDICAL"===a.menuType&&(r.customer.medicalCard={expirationDate:e.medicalCardExpirationDate,number:e.medicalCardNumber,state:e.medicalCardState}),"DELIVERY"===a.orderType&&(null==m?void 0:m.requireDriversLicense)){const t=D(e.driversLicenseExpirationDate);r.customer.driversLicense={expirationDate:t||e.driversLicenseExpirationDate,licenseNumber:e.driversLicenseNumber,state:e.driversLicenseState}}switch(M(e),R.values.paymentType){case"AEROPAY":if(!(null==(s=null==(n=y.aeropay)?void 0:n.credentials)?void 0:s.location_uuid))throw new Error("Error completing purchase with Aeropay. Please choose a different payment option or try again later.");try{const e=yield function(e,r){return c(this,null,(function*(){return new Promise(((t,o)=>c(null,null,(function*(){if(!e.priceSummary)return o(new Error("An error occurred during the purchase process."));window.AeroPay.init({env:"production"}),window.AeroPay.button({forceIframe:!0,location:r.location_uuid,type:"userAuthorize",onSuccess:e=>c(null,null,(function*(){return t(e.id)})),onEvent:e=>c(null,null,(function*(){if("AeroPayClose"===JSON.parse(e.data).msgType)return o(new Error("Transaction closed or cancelled."))})),onError:e=>c(null,null,(function*(){if(e.error)return o(new Error(e.error))}))}).launch(`${e.priceSummary.total}`)}))))}))}(a,y.aeropay.credentials);yield O(i(i({},r),{paymentConfirmationId:e}))}catch(h){throw _("There was an error processing your purchase. Your Aeropay transaction has been cancelled."),N(!0),h}break;case"STRONGHOLD":if(!(null==(u=null==(d=y.stronghold)?void 0:d.credentials)?void 0:u.publishable_key))throw new Error("Error completing purchase with Stronghold. Please choose a different payment option or try again later.");try{const e=yield io(a,y.stronghold.credentials,r.customer);yield O(l(i({},r),{paymentConfirmationId:e}))}catch(h){throw _("There was an error processing your purchase. Your Stronghold transaction has been cancelled."),N(!0),h}break;case"COVA_PAY_CANADA":if(!a.businessId||!a.priceSummary)throw new Error("Error completing purchase with Cova Pay. Please try again later.");try{const e=yield so(a,a.priceSummary.total,r.customer);yield O(l(i({},r),{paymentConfirmationId:e}))}catch(h){throw _("There was an error processing your purchase. Your Cova Pay transaction has been cancelled."),N(!0),h}break;default:yield O(r)}}catch(h){"AEROPAY"===R.values.paymentType?o("There was an error processing your purchase. Your Aeropay transaction has been cancelled."):"STRONGHOLD"===R.values.paymentType?o("There was an error processing your purchase. Your Stronghold transaction has been cancelled."):o(h.message),t(!1)}}}))}),z=E?h.jsx("div",{className:"joint-checkout-loyalty-login j-m-2",children:h.jsx(hr,{storeName:(null==d?void 0:d.display_name)||(null==d?void 0:d.name),surface:"checkout",initialPhone:R.values.phone||n.phoneNumber||"",initialFirstName:R.values.firstName,initialLastName:R.values.lastName,initialEmail:R.values.email,onLogin:()=>{var e,r,t,o;R.setFieldValue("firstName",(null==(e=n.contact)?void 0:e.firstName)||""),R.setFieldValue("lastName",(null==(r=n.contact)?void 0:r.lastName)||""),R.setFieldValue("email",(null==(t=n.contact)?void 0:t.email)||""),R.setFieldValue("phone",(null==(o=n.contact)?void 0:o.mobilePhone)||"")},onEnrollment:e=>{R.setFieldValue("firstName",e.firstName||""),R.setFieldValue("lastName",e.lastName||""),R.setFieldValue("email",e.email||""),R.setFieldValue("phone",e.phone||"")}})}):null;return a.id&&!m&&t?h.jsx("div",{className:Zr.container,children:h.jsx("div",{className:xe(Zr.contentSection,Zr.emptyMessage),children:h.jsx(We,{variant:"subtitle1",component:"div",children:t})})}):m?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:xe(Zr.container,"joint-checkout-form-container"),style:{position:"relative"},children:[(a.id||"purchasing"===a.loadingState)&&((null==(e=a.items)?void 0:e.length)>0||"purchasing"===a.loadingState)?h.jsx("form",{id:"joint-checkout-form",autoComplete:"K
2IOSK"===a.orderType?"off":"on",children:h.jsxs(Ee,{container:!0,spacing:0,children:[h.jsxs(Ee,{item:!0,xs:12,md:6,children:[!L&&z,h.jsx(ot,{title:"Customer",id:"customer-section",children:h.jsx(Qr,{formik:R,onContactFieldBlur:()=>{R.validateForm().then((e=>M(R.values,e)))}})}),"KIOSK"!==a.orderType&&h.jsx(ot,{title:"Order Type",id:"order-type-section",children:h.jsx(it,{formik:R})}),"DELIVERY"!==a.orderType&&(null==m?void 0:m.scheduled)&&h.jsx(ot,{title:"Pickup Time",id:"pickup-time-section",children:h.jsx(Vt,{formik:R,orderTypeSettings:m})}),"DELIVERY"===a.orderType&&h.jsx(ot,{title:"Delivery Address",id:"delivery-address-section",children:h.jsx(tt,{formik:R})}),"MEDICAL"===a.menuType&&h.jsx(ot,{title:"Medical",id:"medical-section",children:h.jsx(nt,{formik:R})}),"DELIVERY"===a.orderType&&(null==m?void 0:m.requireDriversLicense)&&h.jsx(ot,{title:"Driver's License",id:"drivers-license-section",children:h.jsx(st,{formik:R})}),h.jsx(ot,{title:"Promo Code",id:"promo-code-section",children:h.jsx(fo,{formik:R})}),E&&A&&h.jsx(ot,{title:"Rewards",id:"loyalty-reward-section",children:h.jsx(Co,{formik:R})}),h.jsx(ot,{title:"Payment Method",id:"payment-method-section",children:h.jsx(Pt,{formik:R,paymentOptions:(null==m?void 0:m.paymentTypes)||[]})}),h.jsx(ot,{title:"Summary",id:"cart-summary-section",children:h.jsx(rr,{})})]}),h.jsx(Ee,{item:!0,xs:12,md:6,children:h.jsxs("div",{className:xe(Zr.stickyElement,"joint-checkout-sticky-summary"),children:[L&&z,h.jsxs(ot,{noPadding:!0,id:"purchase-summary-section",children:[(t||a.error||a.warning)&&h.jsxs("div",{className:"joint-checkout-error-container",style:{padding:"8px 16px 0"},children:[a.error&&h.jsx(Ne,{severity:"error",sx:{mb:1},children:a.error}),t&&h.jsx(Ne,{severity:"error",sx:{mb:1},onClose:()=>o(null),children:t}),a.warning&&h.jsx(Ne,{severity:"warning",sx:{mb:1},children:a.warning})]}),h.jsx(mt,{formik:R})]})]})})]})}):h.jsx(mr,{}),h.jsxs("div",{className:"joint-checkout-recommendations j-p-2",children:[y.janeAds&&h.jsx(u.Suspense,{fallback:null,children:h.jsx("div",{className:xe("joint-checkout-slider joint-checkout-checkout-recommendations"),children:h.jsx(So,{title:"Add to your order",className:Zr.cartSlider})})}),y.rrhAdvertising&&h.jsx(u.Suspense,{fallback:null,children:h.jsx("div",{className:"joint-checkout-ad j-py-2",children:h.jsx(No,{formatId:"129508",className:"joint-checkout-ad j-align-center"})})}),(null==k?void 0:k.surfside)&&h.jsx(u.Suspense,{fallback:null,children:h.jsx("div",{className:"joint-checkout-ad j-py-2",children:h.jsx(wo,{unit:"checkout_unit",className:"joint-checkout-ad j-align-center"})})}),s&&h.jsx(u.Suspense,{fallback:null,children:h.jsx("div",{className:xe("j-mb-2 joint-checkout-slider joint-checkout-featured-slider"),children:h.jsx(_o,{className:Zr.cartSlider,titleProps:{variant:"h5"}})})})]}),h.jsx(ho,{open:"purchasing"===a.loadingState})]}),h.jsxs(gr,{open:C,onClose:()=>N(!1),"aria-labelledby":"error-title","aria-describedby":"error-description",children:[h.jsx(Er,{id:"error-title",children:"Purchase Error"}),h.jsx(br,{id:"error-description",children:S}),h.jsx(Sr,{children:h.jsx(ce,{onClick:()=>{N(!1),R.setSubmitting(!1)},color:"primary",variant:"contained",children:"Try Again"})})]}),h.jsx(tr,{})]}):null}export{Eo as EcommerceCheckout,Eo as default};
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.