1import{a as m}from"./hydrate.ByRIsqvd.js";import{z as l,A as y,x as f,B as C,G as k,D as P}from"./addresses-is-address-empty.-MuOhIyI.js";import{n as a}from"./web-mcp-runtime.1uGx4Kpb.js";import{g as h}from"./hooks-useSuppressShopPayModalOnLoad.CI5bzdLE.js";import"./esnext-vendor.D7ldIee_.js";import"./app.A60-IfPs.js";import"./constants.DowbVE6J.js";import"./hooks-useReplaceShopPayInHistory.Cz4PqGkk.js";import"./checkout-updaters-helpers.DKDxNKY0.js";import"./context-browser.CzQjCL-z.js";import"./shop-pay-ProgressIntercepts.wTCQvlrM.js";import"./shared-shop-theme.BJKdwdMa.js";import"./consent-manager-shared.B29itG0S.js";import"./mobile-checkout-sdk-MobileCheckoutSdkClient.CVSnUTrf.js";import"./apple-pay-errors.CcNuwNMC.js";import"./receipt-mapper-load-recovery.CtThaHn4.js";import"./receipt-eager-mappers.C1dYRU4X.js";import"./shared-report-graphql-error.CaKFFhiw.js";import"./shop-pay-normalizeBuyerDetails.BcEhgoK7.js";import"./context-CheckoutSheetProtocolClient.CNLSBD5p.js";import"./utilities-shopCashMoney.B9eyOzz9.js";import"./graphql-PaymentSessionMutation.CK_JkOwG.js";function K(o){return{resolvePickupLocality:t=>L(t,o),announcePickupLocality:t=>z(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=f(),s={locale:d.locale,requestToken:p,shopId:C(i.id),sourceId:n.sourceId||"",checkoutSessionIdentifier:n.checkoutSessionIdentifier||""},{data:u}=await t.search(o.postal_code,{...s,countryCode:o.address_country,location:void 0},k),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 z(o,t){const i=l(o.countryCode?t.checkout.address.countryDetails.get(o.countryCode):void 0,t.i18n);m({content:y(o,i,["company","firstName","lastName","phone","countryCode","zoneCode"]),role:"status"})}export{z as announcePickupLocality,K 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.