1import{e as ae,T as z,q as S,h as D,u as e,n as Ue,A as ee,Y as ue,X as je,i as te,x as qe,S as Z,l as F,a as pe}from"./2c1ab0fe.BqEHHmaW.js";import{ci as re,C as _e,f3 as Pe,f4 as Ve,co as We,bk as Ge,bj as Ye,c as x,y as oe,l as se,bY as Ke,cR as Ce,J as Le,E as Se,I as ie,f5 as Xe,Z as Je,B as G,P as R,n as B,ay as Qe,cp as Ze,ef as ne,a0 as et,h as tt,p as me,_ as ot,H as nt,U as he,b as ge,L as at}from"./164ad2e3.BA-GikTU.js";import{O as I,Q as ce,ez as st,bj as it,ab as rt,eA as ct,E as lt,eB as dt,cg as Ie,cp as ut,bi as we,eC as Ae,a9 as pt,P as Te,G as fe,eD as mt,eE as ht}from"./4c290a1e.FJVsH4yi.js";import{P as xe}from"./f49d4216.DkTq21k4.js";import{A as gt,q as be,r as ft,t as bt}from"./dffdfb34.BGb6nQvv.js";import{F as yt,a as kt}from"./3ca8ef7e.D9Nch_50.js";import{M as vt}from"./74835653.BtNhMTqJ.js";import"./app.D2gvVyTR.js";import{b as _t}from"./efa0389a.CmzfQUTJ.js";import{C as Pt}from"./a422df8c.ggO-AlYl.js";import{u as Ct}from"./31cc568e.Dti0cJak.js";import{P as Lt,m as St,a as It,M as wt}from"./be176b00.CsZeI5eL.js";import{g as At,a as Tt,D as N}from"./8574876b.ChO2GdxN.js";import{a as xt}from"./945a08d6.CbBX260S.js";import"./65f3d4da.BdKZt11Z.js";import"./60a453ce.BClq-svk.js";import"./0a7dffce.BHf0S_6c.js";import"./bb728e1c.uhKc-SJ5.js";import"./0c0ad074.RgO7-3qK.js";import"./5587f402.CiejVPa1.js";import"./53bbdad9.6B8LHIua.js";import"./cb8fcd45.D99hrDC6.js";import"./2fdb3dd3.CC5MqUe3.js";import"./0e67bd3b.IdsrMiz7.js";import"./f1968089.DErP3-mp.js";import"./47b970b2.BwzlBSwQ.js";import"./29034f35.CKhRr7lV.js";import"./55098bf1.CRzNngQq.js";import"./cb5cf153.Cw_O6Mr1.js";import"./e3e348f2.CzOvkbpO.js";import"./ca5e9c49.COugV1Xp.js";import"./ed9f2238.ChGZ5py3.js";import"./0b8657b8.DAkNHzQn.js";import"./79974aab.CiLYzGHS.js";import"./7b0c98ea.B-oVlYQI.js";import"./d22d2b80.CrBDr4H-.js";import"./064f6ac1.CtJPZ5b8.js";import"./ac5a19ff.BHoedVx2.js";import"./8599b02a.DjDpxYLZ.js";import"./3a819064.Xmk2TvaB.js";const Et=Le("AutocompleteSingleAddressField");function Mt({onSearch:t,loading:o,addressAutoFocus:c}){const i=ae(""),{i18n:l,observability:d,shop:{shippingCountries:a}}=I(),{geolocation:p}=re(),{locationAddress:n}=ce(),s=z(()=>st({countryCode:void 0,address:void 0}),[]),r=it(n.fields.countryCode,s.countryCode),{details:h,loading:y}=rt(r.value),f=ct(),m=z(()=>h??p.country,[h,p.country]),k=s.address.value,P=z(()=>a?.length?a:[{value:m.code,label:m.name}],[a,m]),u=y||o,b="location address",C=_e(void 0,Et),w=l.translate("pickup_point.search_button"),v=l.translate("pickup_point.address_label"),E=S(g=>lt(g,m,["company","firstName","lastName","phone","countryCode","zoneCode"]),[m]),M=n.value,q=i.value;D(()=>{r.value&&f("auto-selected",r.value,"pickupPoint")},[]),D(()=>{const g=n.value;i.value=E(g)},[n,E,i]);const T=Pe(n);Nt(n,s);const L=m.zones,$=()=>{L.length||(M.zoneCode=void 0),t(M)},Y=g=>{T({countryCode:g}),s.address.value=void 0,f("user-input",g,"pickupPoint")},A={errors:s,state:{countryCode:n.fields.countryCode,address:i}},H=Ve()?.checkoutProfile.hasOverrides.value;return e(Ce,{target:"cart.deliveryGroups[0].deliveryAddress",children:e(We,{...A,children:e(yt,{children:[e(kt,{children:e(vt,{interactive:!H,children:e(Ge,{name:"countryCode",label:m.labels.country,required:!0,autocomplete:"shipping country-name",readOnly:o,...r,onChange:g=>Y(g),children:P.map(g=>e(Ye,{value:g.value,children:g.label},g.value))})})}
1),e(x,{gap:"small-400",children:[e(oe,{gap:"small-400 base",gridTemplateColumns:"minmax(0, 1fr) minmax(auto, max-content)",gridAutoColumns:"1fr",gridTemplateRows:"minmax(auto, max-content)",gridAutoRows:"minmax(auto, max-content)",children:[e(gt,{addressType:"pickup",autoFocus:c,address:M,error:!!k,country:m,name:b,id:C,label:v,onSelect:g=>{const K=dt(g.countryCode),X=!!(g.countryCode&&!K);X&&d.leaveErrorBreadcrumb("Discarded invalid autocomplete countryCode",{invalidCountryCode:g.countryCode,fallbackCountryCode:r.value});const V=X?{...g,countryCode:r.value}:{...g,countryCode:K};i.value=E(V),T(V)},value:q,onInput:g=>{g?s.address.value=void 0:i.value=""},onChange:g=>i.value=g,field:"address1",allowAllCountries:!0}),e(se,{variant:"primary",disabled:!M.coordinates||!q,onClick:$,loading:u,children:w})]}),k&&e(Ke,{controlID:C,children:k?.message??k})]})]})})})}function Nt(t,o){const{i18n:c,observability:i}=I();Ie(async({reason:l})=>{if(l==="negotiation")return{behavior:"allow"};const d=t.peek(),a=new Map;return d.coordinates||a.set("address",c.translate("field_errors.address_address1_blank")),ut(d.countryCode)||a.set("countryCode",c.translate("field_errors.address_country_blank")),a.size?(i.leaveErrorBreadcrumb("Blocking address errors",{errors:Array.from(a).map(([,p])=>p)}),{behavior:"block",reason:we.InvalidLocalPickupAddress,perform:()=>{Ue(()=>{for(const[p,n]of a)o[p].value=n})}}):{behavior:"allow"}})}var O={Tabs:"qbjone5",TabList:"qbjone7 qbjone6 _1fragem64 _1fragemy6 _1fragem133 _1fragem1y",Tab:"qbjone9 qbjone8 _1fragempu _1fragemrn _1fragemo1 _1fragemtg _1fragemws _1fragem64 _1fragembj _1fragem19 _1fragemyk",TabPanel:"qbjonec qbjoneb _1fragemy6 _1fragem133",tabSelected:"qbjonea",inert:"qbjoned _1fragemz0"};const zt=Le("Tabs"),Ee=je(null);function Rt({tabs:t,selected:o,ariaLabel:c,onChange:i,children:l}){const d=_e(void 0,zt),a=ee(null),p=t.length-1,n=ue.count(l),s=S(f=>{const m=o-1<0?p:o-1,k=o+1>p?0:o+1,u=new Map([["ArrowLeft",m],["Left",m],["ArrowRight",k],["Right",k],["Home",0],["End",p]]).get(f.key);u!=null&&(f.preventDefault(),i(u))},[i,o,p]);D(()=>{const{current:f}=a;if(f!=null)return f.addEventListener("keydown",s,!1),()=>{f.removeEventListener("keydown",s,!1)}},[a,s]),D(()=>{n!==t.length&&console.warn(`<Tabs /> has ${t.length} tabs and ${n} children. A mismatch will cause some content to be unavailable.`)},[n,t.length]);const r=[],h=[];ue.forEach(l,(f,m)=>{const k=t[m];if(k!=null){const{label:P,icon:u}=typeof k=="string"?{label:k,icon:void 0}:k;r.push(e(Bt,{label:P,icon:u,selected:o,onChange:i,id:d,index:m},P))}h.push(e(Dt,{index:m,children:f}))});const y=z(()=>({id:d,selected:o}),[d,o]);return e(Ee.Provider,{value:y,children:e("div",{className:O.Tabs,children:[e("div",{ref:a,role:"tablist","aria-label":c,className:O.TabList,children:r}),h]})})}function Bt({label:t,icon:o,index:c,selected:i,onChange:l,id:d}){if(c==null)throw new Ae("`index` is missing");const a=ee(null),p=ee(!1),n=i===c,s=o==null?t:e(x,{direction:"inline",gap:"small-400",alignItems:"center",children:[e(ie,{type:o}),e("span",{children:t})]}),r=Se(),h=()=>r?-1:n?0:-1;return D(()=>{a.current&&n&&p.current?a.current.focus():p.current=!0},[a,n]),e("button",{type:"button",role:"tab","aria-selected":n,id:`${d}Tab${c}`,"aria-controls":`${d}TabPanel${c}`,onClick:()=>l(c),className:te(O.Tab,n&&O.tabSelected,r&&O.inert),ref:a,tabIndex:h(),"aria-hidden":r?!0:void 0,children:s})}function Dt({index:t,children:o}){const{selected:c,id:i}=Ft(),l=c===t,d=Se();return e("div",{role:"tabpanel",id:`${i}TabPanel${t}`,"aria-labelledby":`${i}Tab${t}`,hidden:!l,className:te(O.TabPanel,d&&O.inert),children:o})}function Ft(){const t=qe(Ee);if(t==null)throw new Ae("No tabs found in context");return t}function Me(){const{shop:t}=I(),{rowsInset:o}=Xe(),{main:{section:c}}=Je();return!t.hasFlagEnabled(pt)||o?be(void 0):be(c?.padding)}const Ot="Ak386",$t="IKBAC",Ht="BONgC",Q={Paginator:Ot,PaginatorCaption:$t,Button:Ht};function Ne({page:t,pageCount:o,currentPageLabel:c,onPageChange:i,firstPage:l=1}){const{i18n:d}=I(),a=S(s=>()=>{i(t+s)},[t,i]),p=t<=l,n=t>=o+l-1;return e("div",{className:Q.Paginator,children:[e("div",{className:Q.Button,children:e(se,{onClick:a(-1),disabled:p,variant:"plain",inlineSize:"fill",accessibilityLabel:d.translate("pickup_point.paginator.previous_accessibility_label"),children:e(ie,{type:"arrow-left"})})}),e(G,{className:Q.PaginatorCaption,accessibilityRole:"status",children:e(R,{children:c})}),e("div",{className:Q.Button,children:e(se,{onClick:a(1),disabled:n,variant:"plain",inlineSize:"fill",accessibilityLabel:d.translate("pickup_point.paginator.next_accessibility_label"),children:e(ie,{type:"arrow-right"})})})]})}function Ut({businessHours:t}){const{i18n:o}=I();return e(x,{gap:"small-400",children:t?e(Z,{children:[e(R,{type:"small",children:e(B,{type:"strong",children:o.translate("pickup_point.business_hours")})}),e(jt,{businessHours:t})]}):e(R,{type:"small",color:"subdued",children:o.translate("pickup_point.no_business_hours")})})}function jt({businessHours:t}){const o=Qe(),{i18n:c}=I(),{geolocation:i}
1=re(),l=z(()=>At(i?.country.code),[i]),d=Tt(l),a={};if(d.forEach(s=>{a[N[s]]=t.filter(r=>r.day===N[s].toUpperCase())}),d.every(s=>{const r=a[N[s]];return r.length===1?r[0].openingTime==="00:00"&&r[0].closingTime==="23:59":!1}))return e(B,{size:"small",color:"subdued",children:c.translate("pickup_point.open_twenty_four_hours")});const n=[];return d.forEach(s=>{if(n.push(e(B,{size:"small",children:[o(N[s].toLowerCase()),":"]},`${N[s]}-day`)),a[N[s]].length===0)n.push(e(B,{size:"small",children:c.translate("pickup_point.location_is_currently_closed")},`${N[s]}-closed`));else{let r="";a[N[s]].forEach(h=>{r=`${r}${r===""?"":", "}${h.openingTime} - ${h.closingTime}`}),n.push(e(B,{size:"small",children:r},`${N[s]}-hours`))}}),e(oe,{gridTemplateColumns:"minmax(auto, max-content) minmax(0, 1fr)",gap:"none base",children:n})}const qt="k0DAZ",Vt="tqSRi",W={LocationName:qt,Capitalized:Vt};function ze({pickupPoint:t,displayExtraDetails:o}){const{i18n:c}=I(),i=Ct(),{pickupLocation:l}=t,d=Ze(l.address,{hiddenFields:["countryCode"]}),a=!l.fromDeliveryOptionGenerator,p=(s,r)=>s===0?c.translate("shipping.free_rate_label"):c.formatCurrency(s,{form:"short",currency:r}),n=t.cost.amount===0?"uppercase":void 0;
1return e(x,{gap:"small-100",children:[e(oe,{gridAutoFlow:"column",gridTemplateColumns:"minmax(0, 75%) minmax(0, 25%)",gridTemplateRows:"minmax(0, 1fr)",gap:"small-400",children:[e(x,{gap:"small-500",children:[e(x,{children:[e(R,{children:i?e(B,{type:"strong",children:e("span",{className:te(W.LocationName,a&&W.Capitalized),children:a?l.name?.toLowerCase():l.name})}):e("span",{className:te(W.LocationName,a&&W.Capitalized),children:a?l.name?.toLowerCase():l.name})}),e(R,{color:i?void 0:"subdued",type:"small",children:e("span",{className:a?W.Capitalized:void 0,children:a?d?.toLowerCase():d})})]}),e(Lt,{pickupLocation:l})]}),e(x,{children:e(R,{textAlign:"end",children:e(B,{letterCase:n,type:"strong",children:p(t.cost.amount,t.cost.currencyCode)})})})]}),o&&e(Ut,{businessHours:l.businessHours})]})}const Wt="ErqSa",Gt={PickupPointList:Wt};function Yt({pickupPoints:t,index:o,displayExtraDetails:c}){const{i18n:i}=I(),l=Me(),{selectedPickupPoint:d,setProposedPickupPoint:a}=ne(),p=S(([v=""])=>{a({pickupPointHandle:v})},[a]),n=d?.handle,s=z(()=>n?[n]:[],[n]),r=6,h=S(v=>{const E=t.findIndex(M=>M.handle===v);return Math.floor(E/r)+1},[t]),[y,f]=F(n?h(n):1),m=S(v=>{f(v)},[]),k=z(()=>t.slice((y-1)*r,y*r),[t,y,r]),P=Math.ceil(t.length/r),u=(y-1)*r+1,b=Math.min(y*r,t.length);D(()=>{n&&f(h(n))},[n,h,o]);const C=t.length===0?i.translate("pickup_point.no_pickup_points_found"):i.translate("pickup_point.paginator.header",{first:u,last:b,count:t.length}),w=t.length===0?i.translate("pickup_point.no_pickup_points_found"):i.translate("pickup_point.paginator.selected_page",{first:u,last:b,count:t.length});return e("div",{className:Gt.PickupPointList,children:e(Pt,{name:"pickup-points-choice-list",values:s,onChange:p,itemPadding:l,children:[e(G,{padding:"small-100",borderWidth:"none none base none",accessibilityRole:"status",children:e(R,{textAlign:"center",children:C})}),k.map(v=>e(_t,{value:v.handle,children:e(ze,{pickupPoint:v,displayExtraDetails:!!(c&&v.handle===n)})},v.handle)),e(G,{borderRadius:"none none base base",children:e(Ne,{page:y,pageCount:P,currentPageLabel:w,onPageChange:m})})]})})}const Kt="/cdn/shopifycloud/checkout-web/assets/c1/assets/buyer-pin.BsPJAGmj.svg",Xt="/cdn/shopifycloud/checkout-web/assets/c1/assets/default-selected-pin.fbcUsoX1.svg",Jt="/cdn/shopifycloud/checkout-web/assets/c1/assets/map-carrier-chronopost.TKRkq9_v.svg",Qt="/cdn/shopifycloud/checkout-web/assets/c1/assets/map-carrier-colissimo.1yFHbzUT.svg",Zt="/cdn/shopifycloud/checkout-web/assets/c1/assets/map-carrier-correos.DHRxeQWp.svg",eo="/cdn/shopifycloud/checkout-web/assets/c1/assets/map-carrier-dhl-germany.3lasOaUi.svg",to="/cdn/shopifycloud/checkout-web/assets/c1/assets/map-carrier-evri.WlT4T36l.svg",oo="/cdn/shopifycloud/checkout-web/assets/c1/assets/map-carrier-mondial-relay.04frVi7X.svg",no="/cdn/shopifycloud/checkout-web/assets/c1/assets/map-carrier-poste-italiane.DfqidTJc.svg",ao="/cdn/shopifycloud/checkout-web/assets/c1/assets/map-carrier-royal-mail.Dc9nPZcO.svg",so="/cdn/shopifycloud/checkout-web/assets/c1/assets/pin-carrier-chronopost.DPQXXY3U.svg",i
1o="/cdn/shopifycloud/checkout-web/assets/c1/assets/pin-carrier-colissimo.C-XQBcDy.svg",ro="/cdn/shopifycloud/checkout-web/assets/c1/assets/pin-carrier-correos.BZokoSyh.svg",co="/cdn/shopifycloud/checkout-web/assets/c1/assets/pin-carrier-dhl-germany.BLjj-dhz.svg",lo="/cdn/shopifycloud/checkout-web/assets/c1/assets/pin-carrier-evri.DReFb6kT.svg",uo="/cdn/shopifycloud/checkout-web/assets/c1/assets/pin-carrier-mondial-relay.DFe24aCF.svg",po="/cdn/shopifycloud/checkout-web/assets/c1/assets/pin-carrier-poste-italiane.DvDScNXR.svg",mo="/cdn/shopifycloud/checkout-web/assets/c1/assets/pin-carrier-royal-mail.DxmaQMQN.svg",le={colissimo:{mapLogo:Qt,pin:io},correos:{mapLogo:Zt,pin:ro},mondial_relay:{mapLogo:oo,pin:uo},chronopost:{mapLogo:Jt,pin:so},hermes_uk:{mapLogo:to,pin:lo},poste_italiane:{mapLogo:no,pin:po},royal_mail:{mapLogo:ao,pin:mo},dhl_germany:{mapLogo:eo,pin:co}};function ho(t){return!!le[t]}function go(t){return le[t]?.mapLogo}function fo(t){return le[t]?.pin}const bo="VVdZM",yo={PickupPointMap:bo},ye=[{horizontal:15,vertical:0},{horizontal:-15,vertical:0},{horizontal:0,vertical:-15},{horizontal:0,vertical:-15}],ke=6378,ve=2/1e3,ko={drag_end:"checkout_pickup_point_map_dragend"};function vo(t,o){const c={latitude:0,longitude:0},i=o.filter(a=>Math.abs(a.latitude-t.latitude)<ve&&Math.abs(a.longitude-t.longitude)<ve).length;if(i===0)return c;const l=Math.min(i,ye.length)-1,d=ye[l];return c.longitude=d.horizontal/1e3/ke*(180/Math.PI)/Math.cos(t.latitude*Math.PI/180),c.latitude+=d.vertical/1e3/ke*(180/Math.PI),c}function _o(t){const{source:o,userEvents:c,shop:{id:i},checkout:{identity:l}}=I(),d=Te().buyerIdentity.value?.customerProfile,a=Po(l);function p(n){c.monorailEvent({schemaId:"local_pickup_checkout/3.1",payload:{checkoutToken:o.checkoutSessionIdentifier||"",eventType:ko[n],shopId:parseInt(fe(i),10),numberLocationsFound:t,userId:d?.id?parseInt(fe(d.id),10):void 0,checkoutSurface:a}})}return{trackPickupPointMapInteraction:p}}function Po(t){return t.current.value==="shopPay"?"shop_pay":"guest_checkout"}function Co({onPickupPointSelect:t}){const{i18n:o}=I(),c=xt(),{pickupPoints:i,selectedPickupPoint:l}=ne(),{trackPickupPointMapInteraction:d}=_o(i.length),a=l?.handle,{locationAddress:p}=ce(),n=p.fields.coordinates.peek(),s=[],r=i.map((u,b)=>{const C=u.pickupLocation,w=a===u.handle,v=ho(C.carrierCode),E=w?k(v,C):P(v,C),T=w?{width:68,height:78}:v?{width:40,height:40}:{width:30,height:30},L={latitude:C.address.coordinates?.latitude||0,longitude:C.address.coordinates?.longitude||0},$=vo(L,s);return s.push(L),{title:C.name,label:C.carrierName,blockInfoWindow:!0,position:{lat:L.latitude+$.latitude,lng:L.longitude+$.longitude},zIndex:w?1001:0,image:E,style:T,id:u.handle,notInBounds:!w&&b>5,clusterable:!w}}),h={lat:n?.latitude??0,lng:n?.longitude??0};r.push({id:"buyer",image:Kt,notInBounds:!1,position:h,style:{width:36,height:36},blockInfoWindow:!0,clusterable:!1,zIndex:1e3});const y=r.find(u=>u.id===a)?.position||h,f={clustererOptions:{averageCenter:!0,clusterClass:"pickup_point_map__cluster",styles:{height:32,width:32,textColor:"#ffffff",textSize:16,textLineHeight:32,fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'"}},mapOptions:{gestureHandling:"greedy",scrollwheel:!0,center:y,boundsPadding:0,panToCenter:!0,maxZoom:19,styles:c?St:It}},m=o.translate("delivery_options.pickup_point_map_title");return e(wt,{className:yo.PickupPointMap,markers:r,title:m,onMarkerSelect:t,options:f,blockSize:286,handleDragEnd:()=>d("drag_end")});function k(u,b){return u?fo(b.carrierCode):Xt}function P(u,b){return u?go(b.carrierCode):b.carrierLogoUrl}}function Lo({negotiating:t}){const{i18n:o,shop:c}=I(),i=Me(),l=c.hasFlagEnabled(mt),[d,a]=F(l?1:0),[,p]=F(null),{selectedPickupPoint:n,pickupPoints:s,setProposedPickupPoint:r}=ne(),h=S(u=>{r({pickupPoint:s[u-1]}),p(s[u-1]?.handle)},[r,s]),y=S(u=>{const b=String(u);r({pickupPointHandle:b}),p(b)},[r,p]),f=n,m=z(()=>s.findIndex(u=>u.handle===f?.handle)+1,[s,f?.handle]);if(t)return e(xe,{text:o.translate("pickup_point.waiting_on_pickup_point_location_notice")});const k=s.length===0?o.translate("pickup_point.no_pickup_points_found"):o.translate("pickup_point.paginator.selected_pickup_point_label",{pickup_point_index:m,count:s.length}),P=s.some(({pickupLocation:u})=>u.businessHours);return e(Rt,{tabs:[{label:o.translate("pickup_point.selector_tab_map"),icon:"map"},{label:o.translate("pickup_point.selector_tab_list"),icon:"list-bulleted"}],selected:d,onChange:a,ariaLabel:o.translate("pickup_point.selector_tabs"),children:[e(G,{children:[e(Co,{onPickupPointSelect:y}),e(Ne,{page:m,pageCount:s.length,currentPageLabel:k,onPageChange:h}),e(et,{}),f&&e(G,{padding:i,children:e(ze,{pickupPoint:f,displayExtraDetails:P})})]}),e(Yt,{pickupPoints:s,index:d,displayExtraDetails:P})]})}function mn({heading:t="auto"}){const{i18n:o}=I(),{geolocation:c}=re(),i=ee(!1),l=o.translate("pickup_point.title"),d=o.translate("pickup_point.or"),[a,p]=F(!1),n=ae(!1),s=n.value,{locationAddress:r}=ce(),h=r.peek(),y=Pe(r),{negotiate:f}=tt(),{pickupPoints:m,setProposedPickupPoint:k}=ne(),P=m.length>0&&!!h.coordinates&&!!h.countryCode,[u,b]=F(P?2:1),[C,w]=F(!P),v=Te(),{value:E}=v.allViolations,{value:M}=v.deliveryNext,q=v.merchandiseLines,T=o.translate("pickup_point.pickup_unavailable_banner_title",{count:q.value?.lines.length??0}),L=o.translate("pickup_point.could_not_resolve_address"),$=M?.status==="unavailable"&&E?.some(({code:_})=>_==="DELIVERY_NO_DELIVERY_STRATEGY_AVAILABLE")?T:void 0,[Y,A]=F($),H=ae(!!(h.coordinates&&h.countryCode)&&m.length===0),g=H.value,K=me("Checkout::PickupPoints::RenderBefore"),X=me("Checkout::PickupPoints::RenderAfter"),V=z(()=>({isLocationFormVisible:u===1}),[u]),U=S(_=>{A(J=>J===_?void 0:J)},[A]);D(()=>(i.current=!0,()=>{i.current=!1}),[]);const j=S(()=>{w(!1),H.value=!0,f({include:["deliveryNext"],fieldsToResolve:["deliveryNext"],silenceViolations:["delivery-method"],onComplete:_=>{switch(_.status){case"success":case"error":if(i.current&&(H.value=!1,_.negotiated.deliveryNext))switch(_.negotiated.deliveryNext.status){case"filled":case"partial":_.negotiated.deliveryNext.lines.length>0?(b(2),n.value=!0,U(T)):(A(T),b(1),n.value=!1);break;case"unavailable":A(T),b(1),n.value=!1;break;default:pe(_.negotiated.deliveryNext)}break;
1case"fetch_failed":case"invalid":case"stale":case"denied":case"throttled":case"tooManyRequests":case"alreadyCompleted":break;default:pe(_)}}})},[n,f,H,T,U]);D(()=>{h.coordinates&&h.countryCode&&C&&(m&&m.length>0?(b(2),n.value=!0):j())},[b,h,j,m,C,n]);const Re=S(_=>{if(!ht(_)){A(L);return}U(L),y({zoneCode:c.zone?.code,countryCode:c.country.code,coordinates:{latitude:_.coords.latitude,longitude:_.coords.longitude}}),j()},[c,y,j,A,U,L]),Be=S(({zoneCode:_,countryCode:J,coordinates:de,address1:Fe,address2:Oe,city:$e,postalCode:He})=>{A(void 0),y({zoneCode:_,countryCode:J,coordinates:de,address1:Fe,address2:Oe,city:$e,postalCode:He}),de?(j(),U(L)):A(L)},[L,y,j,U]);So(m.length>0);const De=S(()=>{A(void 0)},[]);return e(Ce,{target:"cart.deliveryGroups[0].deliveryAddress",children:e(ot,{accessibilityLabel:l,children:e(x,{gap:"small-400",children:[t==="auto"&&e(nt,{level:2,autoFocus:s,children:l}),t==="text"&&e(B,{color:"subdued",children:l}),e(he,{customizations:K,options:V,render:_=>e(x,{padding:"small-500 none none none",gap:"small-100",children:_})}),u===1&&!g&&e(Z,{children:[e(ge,{blockSize:"small-500"}),e(ft,{onSuccess:Re,onLocateStart:De}),e(R,{textAlign:"center",color:"subdued",children:d}),e(Mt,{loading:!1,onSearch:Be,addressAutoFocus:a}),Y&&e(x,{gap:"base",padding:"small-200 none none none",children:e(bt,{heading:Y})})]}
1),u===2&&!g&&e(Z,{children:[e(oe,{gap:"@media (inline-size >= medium) large-500, none",gridTemplateColumns:"@media (inline-size >= medium) 'minmax(0, 1fr) minmax(auto, max-content)', 'minmax(0, 1fr)'",gridAutoColumns:"@media (inline-size >= medium) 'minmax(0, 1fr) minmax(auto, max-content)', 'minmax(0, 1fr)'",justifyContent:"start",justifyItems:"start",alignItems:"start",alignContent:"start",gridTemplateRows:"minmax(auto, max-content)",gridAutoRows:"minmax(auto, max-content)",children:[e(R,{color:"subdued",children:m.length===0?o.translate("pickup_point.no_pickup_points_near_location"):o.translate("pickup_point.number_of_pickup_points_near_location",{count:m.length})}),e(at,{onClick:()=>{b(1),p(!0),n.value=!1,y({zoneCode:h.zoneCode,countryCode:h.countryCode,coordinates:void 0}),k({pickupPoint:void 0})},children:o.translate("pickup_point.change")})]}),e(Lo,{negotiating:g})]}),g&&e(Z,{children:[e(ge,{blockSize:"small-500"}),e(xe,{text:o.translate("pickup_point.waiting_on_pickup_point_location_notice")})]}),e(he,{customizations:X,options:V})]})})})}function So(t){const{observability:o}=I();Ie(async({reason:c})=>c==="negotiation"?{behavior:"allow"}:t?{behavior:"allow"}:(o.leaveErrorBreadcrumb("No pickup points available"),{behavior:"block",reason:we.NoPickupPointsAvailable,perform:()=>{}}))}export{mn 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.