1import{a as m,G as l}from"./164ad2e3.B-RZxMRs.js";import{D as y,E as f,A as C,G as k,H as P}from"./4c290a1e.BmtxTAo1.js";import{n as a}from"./6f1b819b.7mys1FO9.js";import{g as h}from"./3ca8ef7e.q59PwdKd.js";import"./2c1ab0fe.BqEHHmaW.js";import"./app.BDuyPyLD.js";import"./65f3d4da.CQOrKSzr.js";import"./60a453ce.X8MjBCGm.js";import"./0a7dffce.CgLOt3SL.js";import"./bb728e1c.Doa1ZBzp.js";import"./cadec7c0.rdedROJ0.js";import"./6a2fc6d6.CTzMGEgY.js";import"./ccdf3592.cBYYqcV0.js";import"./e477f96c.C_2-eava.js";import"./cf29e63b.eFXGTmBk.js";import"./5587f402.81s2RTsk.js";import"./bff2ff9b.GVp2gOEw.js";import"./acc74f72.DY5IDAM_.js";import"./2255f8fa.DFtz4LvH.js";import"./b8733b27.Cj4Fquet.js";import"./e39bc11c.DZpKGgh6.js";import"./08a3b809.DCZlUlSb.js";import"./8599b02a.CJ9ls5uQ.js";import"./ac5a19ff.Dij39hJb.js";function W(o){return{resolvePickupLocality:t=>L(t,o),announcePickupLocality:t=>A(t,o)}}async function L(o,t){const i=await h(t);return g(o,i.current.call,t)}async function g(o,t,{shop:i,source:n,i18n:d}){const p=C(),s={locale:d.locale,requestToken:p,shopId:k(i.id),sourceId:n.sourceId||"",checkoutSessionIdentifier:n.checkoutSessionIdentifier||""},{data:u}=await t.search(o.postal_code,{...s,countryCode:o.address_country,location:void 0},l),c=(await Promise.all(u.slice(0,5).map(e=>t.fetchAddress(e.addressId,{...s,completionService:e.completionService,extendedFields:!1})))).filter(e=>e.countryCode===o.address_country&&a(e.postalCode)===a(o.postal_code)&&(!o.address_region||e.zoneCode===o.address_region)&&e.coordinates&&Number.isFinite(e.coordinates.latitude)&&Number.isFinite(e.coordinates.longitude)&&Math.abs(e.coordinates.latitude)<=90&&Math.abs(e.coordinates.longitude)<=180);if(new Set(c.map(({coordinates:e})=>JSON.stringify(e))).size!==1)return;const r=c[0];return P({countryCode:r.countryCode,zoneCode:r.zoneCode,postalCode:r.postalCode,city:r.city,coordinates:r.coordinates})}function A(o,t){const i=y(o.countryCode?t.checkout.address.countryDetails.get(o.countryCode):void 0,t.i18n);m({content:f(o,i,["company","firstName","lastName","phone","countryCode","zoneCode"]),role:"status"})}export{A as announcePickupLocality,W as createPickupLocalityServices,L as lookupPickupLocality,g as resolvePickupLocality};
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.