import{Xa as d,Ya as y,cb as h,mb as g}from"./chunk-73GUXIT2.js";import{s as u}from"./chunk-ALDBR463.js";import{Ia as c,Na as l,p as m}from"./chunk-V6BPA3D7.js";var I=(()=>{class i{constructor(s){this.store=s,this.AddressRelationType=d,this.showAddressToggleSource=new m(!0),this.showAddressToggle$=this.showAddressToggleSource.asObservable()}setShowAddressToggle(s){this.showAddressToggleSource.next(s)}getShowAddressToggle(){return this.showAddressToggle$}createValidAddress(s){let{county:t,locality:r,street:e,building:n,apartment:o,staircase:a,zipCode:p}=s;return{apartment:o||"",building:n||"",county:{name:t.name?t.name:"",type:t.type,siruta:t.id,mnemonic:t.mnemonic?t.mnemonic:""},locality:{name:r.name,type:r.type,siruta:r.id,uatSiruta:r.id,uniqueNameOnCounty:r.uniqueNameOnCounty?r.uniqueNameOnCounty:""},street:{name:e?.name?e.name:"",streetId:e?.id?e.id:"",type:e?.type?e.type:"",zipCode:e?.zipCode?e.zipCode:"",selectableType:e?.streetType?.selectable?e.streetType?.selectable:""},streetNo:e?.number?e.number:"",staircase:a||"",zipCode:p||""}}setPortInDeliveryAddress(s,t,r,e){this.store.dispatch(g({addressType:d.DELIVERY,showSkeletons:!0})),this.store.dispatch(h({addressToSave:{address:s,type:d.DELIVERY,party:{type:y.Person,phone:t,name:r,email:e}}}))}checkIfAddressExistInList(s,t,r,e,n){let o=s.find(a=>a.address.street?.streetId===t);return o&&o.party?.name===r&&o.party.email===e&&o.party.phone===n}static{this.\u0275fac=function(t){return new(t||i)(l(u))}}static{this.\u0275prov=c({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();export{I as a};