1import{b_ as i,R as a,b as o,h as n,i as u,N as p,H as h,r as S}from"./storefrontApp.CsApItsi.min.js";import{W as d}from"./chunk-webapi_http_api.C3s8IQv.js";import{S as l}from"./chunk-storefront_settings_constants.DIF02Gz.js";import"./chunk-vendor-di.Bh23gdA.js";import"./chunk-vendor-lit.NvY0u02.js";import"./chunk-vendor-lodash.CWHFt7Z.js";import"./chunk-vendor-rxjs.Dp7kflo.js";import"./chunk-vendor-phoenix.cdKS79L.js";class A{checkoutData(){return"/user/sso/checkout-data"}checkUser(){return"/user/sso/check"}}class m extends d{constructor(t){super(t),this.httpApi=t,this.#t=new A}static{this.moduleName=i.httpApi}#t;getCheckoutData(){const s={url:this.#t.checkoutData(),method:a.get};return this.fetch(s)}checkUser(t){const e={url:this.#t.checkUser(),method:a.post,data:{email:t}};return this.fetch(e)}}class k extends o{#t;#s;constructor({httpApi:t,settingsApi:s}){super(),this.#t=new m(t),this.#s=s}async getCheckoutData(){try{const{response:t}=this.#t.getCheckoutData(),s=await t;if(s.status===n.ok){const e=s.data.shippingAddress;e&&(e.countryId=Number(e.countryId));const r=s.data.billingAddress;return r&&(r.countryId=Number(r.countryId)),s.data}return null}catch(t){return console.error(t),null}}async checkUser(t){try{const{response:s}=this.#t.checkUser(t),e=await s;return e.status===n.ok&&e.data.exists}catch(s){return console.error(s),!1}}}class g extends u{constructor(t){super(),this.moduleName=i.api,this.#t=t}#t;async getCheckoutData(){return this.#t.getCheckoutData()}async checkUser(t){return this.#t.checkUser(t)}}class C extends p{static{this.featureName=i.feature}async init(){const t=this.getApiSync(h),s=await this.getApi(l.api),e=new k({httpApi:t,settingsApi:s}),r=new g(e);return{cores:[{type:S.api,instance:[r]}]}}}export{C as SSOInitializer};
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.