1import{a as Ie}from"./chunk-2EN6LHMF.js";import{a as Le,b as Me}from"./chunk-KQHIYMA5.js";import{a as z,b as Be,c as Pe}from"./chunk-QWGXMLW5.js";import{a as we}from"./chunk-OEV6Z5SQ.js";import{a as ke}from"./chunk-J4LBBLXH.js";import{b as Ee,c as S}from"./chunk-X5DGY6DB.js";import{c as Oe}from"./chunk-IRUUDLGX.js";import{a as Ve}from"./chunk-W2F6WWIK.js";import{$a as De,A as _e,Aa as Ne,B as ye,E as Ae,G as Se,H as xe,K as Ce,M as Fe,_a as Te,c as ce,d as me,f as a,g as pe,h as he,i as ue,v as fe,x as ge,y as be,z as ve}from"./chunk-WB4ZKX5G.js";import{Cd as Y,Dd as j,f as de,k as ae,lb as le,q as G,wc as I}from"./chunk-3IFILS7V.js";import{$b as L,Ac as T,Ba as B,Bc as D,Bd as V,Cc as l,Cd as ne,Dc as n,Ec as d,Fc as m,Fd as u,Gd as f,Ib as s,J as H,Jc as te,Kc as ie,Oa as g,Pa as b,Pc as x,Vb as N,W as w,Wa as F,Xc as v,Zc as p,_b as P,a as O,ac as ee,hd as M,jd as re,md as h,nd as A,od as se,pd as J,qd as oe,rd as R,sd as q,td as $,ua as k,ud as Z,vc as _,vd as E,xc as y,zc as K}from"./chunk-7U63JCID.js";var Re=class r{static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275mod=L({type:r})}static{this.\u0275inj=B({imports:[G,Ce,De,Fe,j,Ie]})}};var qe=class r{static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275mod=L({type:r})}static{this.\u0275inj=B({imports:[G,j,Me]})}};var $e=class{constructor(e,t,i,o,c,C,ft,gt){this.page=e;this.checkoutDeliveryService=t;this.globalMessageService=i;this.userAddressService=o;this.el=c;this.launchDialogService=C;this.vcr=ft;this.winRef=gt;this.isShowNewAddressForm=!1;this.isAdditionalOrder=!1;this.subscription=new O;this.autoDetectSelectedAddresses=!0;this.billingAddressSize=0;this.deliveryAddressSize=0}init(){this.addresses$=this.userAddressService.getAddresses(),this.isAddressLoading$=this.userAddressService.getAddressesLoading(),this.selectedAddress$=this.checkoutDeliveryService.getDeliveryAddress().pipe(k(e=>{e?.id&&this.winRef.localStorage.setItem("selectedAddressPK",e.id)})),this.selectedBillingAddress$=this.checkoutDeliveryService.getBillingAddress(),this.checkoutDeliveryService.getDeliveryAddress().subscribe(e=>{!this.isAdditionalOrder&&this.autoDetectSelectedAddresses&&(this.selectedAddress=e),this.shippingAddressDropdown=!1}),this.checkoutDeliveryService.getBillingAddress().subscribe(e=>{!this.isAdditionalOrder&&this.autoDetectSelectedAddresses&&(this.selectedBillingAddress=e),this.billingAddressDropdown=!1}),this.subscription.add(this.checkoutDeliveryService.getAddressVerificationResults().subscribe(e=>{e.decision==="ACCEPT"?this.addAddress(this.deliveryAddress):e.decision==="REJECT"&&(e.errors.errors.some(t=>t.subject==="titleCode")?this.globalMessageService.add({key:"addressForm.titleRequired"},I.MSG_TYPE_ERROR):this.globalMessageService.add({key:"addressForm.invalidAddress"},I.MSG_TYPE_ERROR)),this.checkoutDeliveryService.clearAddressVerificationResults()})),this.subscription.add(this.checkoutDeliveryService.getBillingAddressVerificationResults().subscribe(e=>{e.decision==="ACCEPT"?this.addAddress(this.billingAddress):e.decision==="REJECT"&&(e.errors.errors.some(t=>t.subject==="titleCode")?this.globalMessageService.add({key:"addressForm.titleRequired"},I.MSG_TYPE_ERROR):this.globalMessageService.add({key:"addressForm.invalidAddress"},I.MSG_TYPE_ERROR)),this.checkoutDeliveryService.clearBillingAddressVerificationResults()})),this.addresses$.subscribe(e=>{this.addressTotal=(e?.deliveryAddresses?.addresses?.length||0)+(e?.paymentAddresses?.addresses?.length||0)||0})}focusOnWrongInput(e=".invalid-feedback"){let t=this.winRef.document.querySelector(e);t&&setTimeout(()=>t.scrollIntoView({behavior:"smooth",block:"center"}),0)}openConfirmDeleteAddresslModal(e,t){this.addressIdToDelete=t;let i={content:e},o=this.launchDialogService.openDialog(Ne.STATIC_MODAL,null,this.vcr,i);o&&o.pipe(w(1)).subscribe()}addAddress(e){}clearBillingFormAttributes(e){e.controls.billingAddress.value||(e.controls.vergiDairesi.setValue(""),e.controls.companyName.setValue(""),e.controls.tcVergiNo.setValue(""),e.controls.corporate.setValue(!1)),e.controls.billingAddress.value&&!e.controls.corporate.value&&(e.controls.vergiDairesi.setValue(""),e.controls.companyName.setValue(""),e.controls.corporate.setValue(!1))}isValidOtherForms(){return!0}};
1var W=class r{constructor(e){this.control=e}onInput(e){let i=e.target.value.replace(/[^A-Za-zÄüÅöçıİÄÃÅÃÃ0-9 .'\-]/g,"")}static{this.\u0275fac=function(t){return new(t||r)(N(pe))}}static{this.\u0275dir=ee({type:r,selectors:[["","appCompanyName",""]],hostBindings:function(t,i){t&1&&v("input",function(c){return i.onInput(c)})},standalone:!1})}};var X=(r,e)=>[r,e],Ke=(r,e,t)=>[r,e,t],Q=(r,e)=>e.code;function Je(r,e){if(r&1){let t=x();n(0,"div",28)(1,"input",29),v("change",function(){let o=g(t).$implicit,c=p(3);return b(c.changeSelectedAddressType(o))}),d(),n(2,"label",30),h(3),u(4,"cxTranslate"),d()()}if(r&2){let t=e.$implicit,i=p(3);s(),l("id",E("address-",t))("checked",i.addressFormType===t),s(),l("for",E("address-",t)),s(),A(f(4,6,"addressForm."+t+"Address"))}}function Ze(r,e){if(r&1&&(n(0,"div",5)(1,"label"),h(2),u(3,"cxTranslate"),d(),T(4,Je,5,8,"div",28,K),d()),r&2){let t=p(2);s(2),A(f(3,1,"addressForm.whichAddress")),s(2),D(ne(3,Ke,t.delivery,t.billing,t.deliverybilling))}}function Qe(r,e){if(r&1&&(n(0,"option",19),h(1),d()),r&2){let t=e.$implicit;l("ngValue",t.code),s(),A(t.name)}}function Xe(r,e){if(r&1&&(n(0,"option",19),h(1),d()),r&2){let t=e.$implicit;l("ngValue",t.code),s(),A(t.name)}}function et(r,e){if(r&1&&(n(0,"option",19),h(1),d()),r&2){let t=e.$implicit;l("ngValue",t.code),s(),A(t.name)}}function tt(r,e){if(r&1){let t=x();_(0,Ze,6,7,"div",5),n(1,"div",6)(2,"div",7),m(3,"input",8),u(4,"cxTranslate"),m(5,"cx-form-errors",9),d(),n(6,"div",7),m(7,"input",10),u(8,"cxTranslate"),m(9,"cx-form-errors",11),d()(),n(10,"div",5),m(11,"input",12),u(12,"cxTranslate"),m(13,"cx-form-errors",13),d(),n(14,"div",6)(15,"div",7),m(16,"input",14)(17,"cx-form-errors",15),d(),n(18,"div",16)(19,"select",17,0),$("ngModelChange",function(o){g(t);let c=p();return q(c.selectedProvince,o)||(c.selectedProvince=o),b(o)}),v("change",function(){g(t);let o=M(20),c=p();return b(c.provinceSelected(o.value,"shipping"))}),n(21,"option",18),h(22),u(23,"cxTranslate"),d(),T(24,Qe,2,2,"option",19,Q),u(26,"async"),d(),m(27,"cx-form-errors",20),d()(),n(28,"div",6)(29,"div",21)(30,"select",17,1),$("ngModelChange",function(o){g(t);let c=p();return q(c.selectedDistrict,o)||(c.selectedDistrict=o),b(o)}),v("change",function(){g(t);let o=M(31),c=p();return b(c.districtSelected(o.value,"shipping"))}),n(32,"option",22),h(33),u(34,"cxTranslate"),d(),T(35,Xe,2,2,"option",19,Q),u(37,"async"),d(),m(38,"cx-form-errors",23),d(),n(39,"div",24)(40,"select",17,2),$("ngModelChange",function(o){g(t);let c=p();return q(c.selectedNeighborhood,o)||(c.selectedNeighborhood=o),b(o)}),v("change",function(){g(t);let o=M(41),c=p();return b(c.neighborhoodSelected(o.value))}),n(42,"option",22),h(43),u(44,"cxTranslate"),d(),T(45,et,2,2,"option",19,Q),u(47,"async"),d(),m(48,"cx-form-errors",25),d()(),n(49,"div",5),m(50,"input",26),u(51,"cxTranslate"),m(52,"cx-form-errors",27),d()}if(r&2){let t=p();y(t.isChangeableAddressFormType?0:-1),s(3),l("placeholder",f(4,22,"addressForm.firstName.placeholder")),s(2),l("control",t.addressForm.get("firstName")),s(2),l("placeholder",f(8,24,"addressForm.lastName.placeholder")),s(2),l("control",t.addressForm.get("lastName")),s(2),l("placeholder",f(12,26,"addressForm.title")),s(2),l("control",t.addressForm.get("addressTitle")),s(3),l("showMaskTyped",!0)("dropSpecialCharacters",!0)("validation",!1),s(),l("control",t.addressForm.get("phone")),s(2),R("ngModel",t.selectedProvince),s(3),A(f(23,28,"addressForm.chooseProvince")),s(2),D(f(26,30,t.provinces$)),s(3),l("control",t.addressForm.get("provinceSelect.code")),s(3),R("ngModel",t.selectedDistrict),s(3),A(f(34,32,"addressForm.chooseDistrict")),s(2),D(f(37,34,t.districts$)),s(3),l("control",t.addressForm.get("districtSelect.code")),s(2),R("ngModel",t.selectedNeighborhood),s(3),A(f(44,36,"addressForm.chooseNeighborhood")),s(2),D(f(47,38,t.neighborhoods$)),s(3),l("control",t.addressForm.get("neighborhoodSelect.code")),s(2),l("placeholder",f(51,40,"addressForm.address1")),s(2),l("control",t.addressForm.get("line1"))}}function it(r,e){if(r&1){let t=x();n(0,"div",28)(1,"input",29),v("change",function(){let o=g(t).$implicit,c=p(2);return b(c.changeSelectedBillType(o))}),d(),n(2,"label",30),h(3),u(4,"cxTranslate"),d()()}if(r&2){let t=e.$implicit,i=p(2);s(),l("id",E("address-",t))("checked",i.selectedBillType===t),s(),l("for",E("address-",t)),s(),A(f(4,6,"addressForm."+t))}}function rt(r,e){if(r&1){let t=x();n(0,"div",5)(1,"div",31)(2,"input",32),v("change",function(o){g(t);let c=p(2);return b(c.onChangeTcNoValue(o.target.checked))}),d(),n(3,"label",33),h(4,"Fatura i\xE7in TC Kimlik numaram\u0131 beyan etmek istiyorum."),d()()(),n(5,"div",5),m(6,"input",34),u(7,"cxTranslate"),m(8,"cx-form-errors",35),n(9,"small",36),m(10,"i",37),n(11,"b"),h(12,"TC
1Kimlik numaras\u0131na ait e-fatura m\xFCkellefi \u015Fah\u0131s firman\u0131z var ise faturan\u0131z firman\u0131z ad\u0131na olu\u015Facakt\u0131r."),d()()()}if(r&2){let t=p(2);s(2),l("checked",t.changeTcNoValue),s(4),l("placeholder",f(7,3,"addressForm.tcNo")),s(2),l("control",t.addressForm.get("tcNo"))}}function st(r,e){if(r&1&&(n(0,"div",5),m(1,"input",38),u(2,"cxTranslate"),m(3,"cx-form-errors",39),n(4,"small",36),m(5,"i",37),n(6,"b"),h(7,"\u015Eah\u0131s firmas\u0131 ise firma sahibinin Ad\u0131 Soyad\u0131 yaz\u0131lmal\u0131d\u0131r."),d()()(),n(8,"div",6)(9,"div",7),m(10,"input",40),u(11,"cxTranslate"),m(12,"cx-form-errors",41),n(13,"small",36),m(14,"i",37),n(15,"b"),h(16,"\u015Eah\u0131s firmas\u0131 iseniz TC Kimlik No girmeniz gerekmektedir."),d()()(),n(17,"div",7),m(18,"input",42),u(19,"cxTranslate"),m(20,"cx-form-errors",43),d()()),r&2){let t=p(2);s(),l("placeholder",f(2,8,"addressForm.companyName.title")),s(2),l("control",t.addressForm.get("companyName")),s(7),l("placeholder",Z(f(11,10,"addressForm.vatNo"))),s(2),l("control",t.addressForm.get("tcVergiNo")),s(6),l("placeholder",Z(f(19,12,"addressForm.vatOffice"))),s(2),l("control",t.addressForm.get("vergiDairesi"))}}function ot(r,e){if(r&1&&(n(0,"div",5)(1,"label"),h(2),u(3,"cxTranslate"),d(),T(4,it,5,8,"div",28,K),d(),_(6,rt,13,5),_(7,st,21,14)),r&2){let t=p();s(2),A(f(3,3,"addressForm.billingType")),s(2),D(V(5,X,t.INDIVIDUAL_BILL_TYPE,t.CORPORATE_BILL_TYPE)),s(2),y(t.selectedBillType===t.INDIVIDUAL_BILL_TYPE?6:-1),s(),y(t.selectedBillType===t.CORPORATE_BILL_TYPE?7:-1)}}function nt(r,e){r&1&&(n(0,"div",4)(1,"div",31),m(2,"input",44),n(3,"label",45),h(4,"Bunu ge\xE7erli adresim yap"),d()()())}
1var Ge=class r{constructor(e,t,i,o){this.fb=e;this.userAddressService=t;this.baseSiteService=i;this.userService=o;this.isChangeableAddressFormType=!0;this.disableDefault=!1;this.submitAddress=new F;this.delivery=z;this.billing=Be;this.deliverybilling=Pe;this.BASE_SITE_MARKET="market";this.INDIVIDUAL_BILL_TYPE="individual";this.CORPORATE_BILL_TYPE="corporate";this.selectedBillType=this.INDIVIDUAL_BILL_TYPE;this.NO_SELECTION="-1";this.selectedProvince=this.NO_SELECTION;this.selectedDistrict=this.NO_SELECTION;this.selectedNeighborhood=this.NO_SELECTION;this.isSameBillingAddress=!1;this.isInitAddress=!1;this.changeTcNoValue=!1;this.subscription=new O;this.defaultTcNo=S.UNDECLARED_TC_NO;this.addressForm=this.createAddressForm()}ngOnInit(){this.setFormAddressType(this.addressFormType),this.subscription.add(this.baseSiteService.getActive().subscribe(e=>{this.baseSite=e})),this.addressFormType!==this.delivery&&this.setValidatorsForIndividual(),this.setProvince(),this.setInitialAddress(),this.hasErrorMesage===!0&&(this.addressForm.updateValueAndValidity(),this.addressForm.markAllAsTouched())}setProvince(){this.isBillingFormType()?(this.userAddressService.loadBillingProvinces(),this.provinces$=this.userAddressService.getBillingProvinces()):(this.userAddressService.loadProvinces(),this.provinces$=this.userAddressService.getProvinces()),this.provincesSub?.unsubscribe(),this.provincesSub=this.provinces$.pipe(H(e=>e.length>0)).subscribe(e=>{this.addressForm.controls.provinceSelect.enable(),this.selectedProvince===this.NO_SELECTION&&this.addressData&&Object.keys(this.addressData).length!==0&&(this.selectedProvince=this.addressData.location.city.code),e?.find(t=>t.code===this.selectedProvince)||(this.selectedProvince=this.NO_SELECTION,this.selectedDistrict=this.NO_SELECTION,this.selectedNeighborhood=this.NO_SELECTION)})}isBillingFormType(){return this.addressFormType===this.billing}provinceSelected(e,t,i){if(e===this.NO_SELECTION)return;typeof e=="string"&&(this.addressForm.controls.districtSelect.enable(),this.provinces$.subscribe(c=>{e=c.find(C=>C.code===this.selectedProvince)}).unsubscribe()),this.isBillingFormType()?this.districts$=this.userAddressService.getBillingDistricts():this.districts$=this.userAddressService.getDistricts(),this.districtsSub?.unsubscribe(),this.districtsSub=this.districts$.subscribe(c=>{this.selectedDistrict===this.NO_SELECTION&&this.addressData&&Object.keys(this.addressData).length!==0&&(this.selectedDistrict=this.addressData.location.district.code),c?.find(C=>C.code===this.selectedDistrict)||(this.selectedDistrict=this.NO_SELECTION,this.selectedNeighborhood=this.NO_SELECTION)});let o=this.addressForm.controls;delete e.subLocations,o.country.controls.isocode.setValue("tr"),i||(o.districtSelect.reset(),o.neighborhoodSelect.reset()),o.location.patchValue(e),o.provinceSelect.patchValue(e),o.town.setValue(e.name),this.isBillingFormType()?this.userAddressService.loadBillingDistricts(e.code):this.userAddressService.loadDistricts(e.code)}districtSelected(e,t,i){typeof e=="string"&&(this.addressForm.controls.neighborhoodSelect.enable(),this.districts$.subscribe(c=>{e=c?.find(C=>C.code===this.selectedDistrict)}).unsubscribe()),this.isBillingFormType()?this.neighborhoods$=this.userAddressService.getBillingNeighborhoods():this.neighborhoods$=this.userAddressService.getNeighborhoods(),this.neighborhoodsSub?.unsubscribe(),this.neighborhoodsSub=this.neighborhoods$.pipe(H(c=>c.length>0)).subscribe(c=>{this.selectedNeighborhood===this.NO_SELECTION&&this.addressData&&Object.keys(this.addressData).length!==0&&(this.selectedNeighborhood=this.addressData.location.code),c.find(C=>C.code===this.selectedNeighborhood)||(this.selectedNeighborhood=this.NO_SELECTION)}),e.store=null;let o=this.addressForm.controls;delete e.subLocations,o.location.patchValue(e),o.district.patchValue(e.name),o.districtSelect.patchValue(e),i||o.neighborhoodSelect.reset(),this.isBillingFormType()?this.userAddressService.loadBillingNeighborhoods(e.code):this.userAddressService.loadNeighborhoods(e.code)}neighborhoodSelected(e){typeof e=="string"&&this.neighborhoods$.subscribe(t=>{e=t.find(i=>i.code===this.selectedNeighborhood)}).unsubscribe(),this.addressForm.patchValue({neighborhoodSelect:e,location:e})}setInitialAddress(){if(this.addressData&&Object.keys(this.addressData).length!==0){this.isInitAddress=!0,this.districts$=this.userAddressService.getDistricts(),this.neighborhoods$=this.userAddressService.getNeighborhoods(),this.addressForm.patchValue(this.addressData),this.addressData.billingAddress&&this.addressData.shippingAddress?this.addressFormType=this.deliverybilling:this.addressData.billingAddress?this.addressFormType=this.billing:this.addressFormType=this.delivery,this.defaultTcNo!==this.addressData?.tcVergiNo&&(this.changeTcNoValue=!0),!this.addressData.corporate&&this.addressData.tcVergiNo&&(this.addressForm.controls.tcNo.patchValue(this.addressData.tcVergiNo||""),this.addressForm.controls.tcVergiNo.setValue("")),this.isSameBillingAddress=this.addressData.billingAddress&&this.addressData.shippingAddress,(this.addressFormType!==this.delivery||this.hasExtraBillingForm)&&this.changeSelectedBillType(this.addressData.corporate?this.CORPORATE_BILL_TYPE:this.INDIVIDUAL_BILL_TYPE);let e=this.addressForm.controls;if(this.baseSite===this.BASE_SITE_MARKET&&this.addressFormType!==this.billing){e.provinceSelect.reset(),e.districtSelect.reset(),e.neighborhoodSelect.reset(),this.districts$=null,this.neighborhoods$=null,this.setProvince();let t=this.addressData.location.city,i=this.addressData.location.district,o=this.addressData.location;this.provinceSelected(t,null,!0),this.districtSelected(i,null,!0),this.neighborhoodSelected(o),this.selectedProvince=this.addressData.location.city.code,this.selectedDistrict=this.addressData.location.district.code,this.selectedNeighborhood=this.addressData.location.code}else this.userAddressService.loadInitialProvince(this.addressFormType,this.addressData.location.city),this.selectedProvince=this.addressData.location.city.code,this.userAddressService.loadInitialDistrict(this.addressFormType,this.addressData.location.district),this.selectedDistrict=this.addressData.location.district.code,e.provinceSelect.patchValue(this.addressData.location.city),e.districtSelect.patchValue(this.addressData.location.district),e.neighborhoodSelect.patchValue(this.addressData.location),e.country.controls.isocode.setValue(this.addressData.location.country.code),this.isSameAsShippingAddress||(this.provinceSelected(this.addressData.location.city,null,!0),this.districtSelected(this.addressData.location.district,null,!0),this.addressData.location.type==="NEIGHBOURHOOD"&&(this.neighborhoodSelected(this.addressData.location),this.userAddressService.loadInitialNeighborhood(this.addressFormType,this.addressData.location),this.selectedNeighborhood=this.addressData.location.code))}else this.addressForm.controls.provinceSelect.disable(),this.addressForm.controls.districtSelect.disable(),this.addressForm.controls.neighborhoodSelect.disable(),this.userService.get().pipe(w(1),k(e=>{e&&this.addressForm.patchValue({firstName:e.firstName,lastName:e.lastName,phone:e.phoneNumber})})).subscribe()}changeSameBillingAddress(){this.isSameBillingAddress=!this.isSameBillingAddress,this.addressForm.controls.billingAddress.setValue(this.isSameBillingAddress),this.isSameBillingAddress?this.selectedBillType===this.CORPORATE_BILL_TYPE?this.setValidatorsForCorporate():this.setValidatorsForIndividual():(this.clearValidatorsOfCorporate(),this.clearValidatorsOfIndividual()
1)}changeSelectedBillType(e){this.selectedBillType=e,e===this.CORPORATE_BILL_TYPE?(this.addressForm.controls.corporate.setValue(!0),this.setValidatorsForCorporate(),this.clearValidatorsOfIndividual()):(this.addressForm.controls.corporate.setValue(!1),this.clearValidatorsOfCorporate(),this.setValidatorsForIndividual())}setValidatorsForIndividual(){this.addressForm.controls.tcNo.setValidators([a.required,a.maxLength(11),a.minLength(11),S.tcNoValidator])}clearValidatorsOfIndividual(){this.addressForm.controls.tcNo.clearValidators(),this.addressForm.controls.tcNo.updateValueAndValidity()}setValidatorsForCorporate(){this.addressForm.controls.vergiDairesi.setValidators([a.required,a.maxLength(120)]),this.addressForm.controls.companyName.setValidators([a.required,a.maxLength(120),S.companyValidator]),this.addressForm.controls.tcVergiNo.setValidators([a.required,a.maxLength(11),a.minLength(10),S.tcVergiNoValidator]),this.addressForm.controls.tcVergiNo.updateValueAndValidity()}clearValidatorsOfCorporate(){this.addressForm.controls.vergiDairesi.clearValidators(),this.addressForm.controls.vergiDairesi.updateValueAndValidity(),this.addressForm.controls.companyName.clearValidators(),this.addressForm.controls.companyName.updateValueAndValidity(),this.addressForm.controls.tcVergiNo.clearValidators(),this.addressForm.controls.tcVergiNo.updateValueAndValidity()}changeSelectedAddressType(e){if(this.addressForm.markAsUntouched(),this.addressFormType=e,this.baseSite===this.BASE_SITE_MARKET){let t=this.addressForm.controls;this.isInitAddress||(this.addressForm.get("provinceSelect.code").setValue(this.NO_SELECTION),this.addressForm.get("provinceSelect.code").updateValueAndValidity(),this.addressForm.get("provinceSelect.code").clearValidators(),this.addressForm.get("districtSelect.code").setValue(this.NO_SELECTION),this.addressForm.get("districtSelect.code").updateValueAndValidity(),this.addressForm.get("districtSelect.code").clearValidators(),this.addressForm.get("neighborhoodSelect.code").setValue(this.NO_SELECTION),this.addressForm.get("neighborhoodSelect.code").updateValueAndValidity(),this.addressForm.get("neighborhoodSelect.code").clearValidators(),t.provinceSelect.disable(),t.districtSelect.disable(),t.neighborhoodSelect.disable()),this.setProvince()}this.setFormAddressType(e),e===this.delivery?(this.addressForm.controls.corporate.setValue(!1),this.clearValidatorsOfCorporate(),this.clearValidatorsOfIndividual()):this.addressFormType===this.billing&&this.setValidatorsForIndividual(),this.defaultAddress&&this.setFormAddressType()}setFormAddressType(e=this.addressFormType){this.addressForm.patchValue({shippingAddress:e.includes(this.delivery),billingAddress:e.includes(this.billing)})}reset(){let e=this.addressForm.controls.companyName.value,t=this.addressForm.controls.corporate.value,i=this.addressForm.controls.vergiDairesi.value,o=this.addressForm.controls.tcVergiNo.value;this.createAddressForm(),this.addressForm.patchValue({companyName:e,corporate:t,vergiDairesi:i,tcVergiNo:o}),this.selectedDistrict=this.NO_SELECTION,this.selectedNeighborhood=this.NO_SELECTION,this.selectedProvince=this.NO_SELECTION}isValid(){let e=this.addressForm.controls;return this.isSameAsShippingAddress?this.selectedBillType===this.INDIVIDUAL_BILL_TYPE?e.tcVergiNo.valid:e.tcVergiNo.valid&&e.companyName.valid&&e.vergiDairesi.valid:this.addressForm.valid}createAddressForm(){return this.fb.group({id:[""],firstName:["",[a.required,a.maxLength(40),S.nameValidator]],lastName:["",[a.required,a.maxLength(40),S.nameValidator]],addressTitle:["",[a.required,a.maxLength(25),S.nameValidator]],phone:["",[S.phoneNumberValidator]],provinceSelect:this.fb.group({code:["",[a.required,a.min(1)]],displayOrder:["",a.required],name:["",a.required],store:[""],type:["",a.required],expressDelivery:[!1]}),districtSelect:this.fb.group({code:["",[a.required,a.min(1)]],displayOrder:["",a.required],name:["",a.required],store:[""],type:["",a.required],expressDelivery:[!1]}),neighborhoodSelect:this.fb.group({code:["",[a.required,a.min(1)]],displayOrder:["",a.required],name:["",a.required],store:[""],type:["",a.required],country:[""],city:[""],district:[""]}),line1:["",[a.required,a.minLength(10),a.maxLength(120),S.noWhitespaceValidator,S.addressValidator]],tcNo:[{value:this.defaultTcNo,disabled:!0},[a.maxLength(11),a.minLength(11),S.tcNoValidator]],billingAddress:[!1],companyName:[""],corporate:"",defaultAddress:[!1],defaultShippingAddress:[!1],defaultBillingAddress:[!1],district:["",a.required],country:this.fb.group({isocode:[null,a.required]}),location:this.fb.group({code:["",a.required],displayOrder:["",a.required],name:["",a.required],store:[""],type:["",a.required],expressDelivery:[!1]}),shippingAddress:[!0],tcVergiNo:this.fb.control("",{updateOn:"blur"}),town:["",a.required],vergiDairesi:[""]})}onChangeTcNoValue(e){let t=this.addressForm.get("tcNo"),i=t.value===this.defaultTcNo;e?t.enable():t.disable(),!e&&!i?t.patchValue(this.defaultTcNo):i&&t.patchValue(this.addressData?.tcVergiNo||"")}ngOnDestroy(){this.provincesSub?.unsubscribe(),this.districtsSub?.unsubscribe(),this.neighborhoodsSub?.unsubscribe(),this.subscription.unsubscribe()}static{this.\u0275fac=function(t){return new(t||r)(N(xe),N(Oe),N(le),N(Ve))}}static{this.\u0275cmp=P({type:r,selectors:[["ozd-address-form"]],inputs:{addressData:"addressData",addressFormType:"addressFormType",defaultAddress:"defaultAddress",isChangeableAddressFormType:"isChangeableAddressFormType",isSameAsShippingAddress:"isSameAsShippingAddress",hasErrorMesage:"hasErrorMesage",hasExtraBillingForm:"hasExtraBillingForm",disableDefault:"disableDefault"},outputs:{submitAddress:"submitAddress"},standalone:!1,decls:4,vars:10,consts:[["provinceSelect",""],["districtSelect",""],["neighborhoodSelect",""],["focusInvalidInput","",3,"formGroup"],[1,"form-group","default-address-form"],[1,"form-group"],[1,"form-row"],[1,"col-6"],["type","text","required","","formControlName","firstName","maxlength","40",1,"form-control",3,"placeholder"],["prefix","addressForm.firstName",3,"control"],["type","text","required","","formControlName","lastName","maxlength","40",1,"form-control",3,"placeholder"],["prefix","addressForm.lastName",3,"control"],["type","text","required","","formControlName","addressTitle",1,"form-control",3,"placeholder"],["prefix","addressForm.addressTitle",3,"control"],["type","text","formControlName","phone","mask","(000) 000 00 00","prefix","0 ","placeholder","(___) ___ ____","autocomplete","off","required","",1,"form-control",3,"showMaskTyped","dropSpecialCharacters","validation"],["prefix","formErrors.phoneNumber",3,"control"],["formGroupName","provinceSelect",1,"col-6"],["formControlName","code",1,"form-control",3,"ngModelChange","change","ngModel"],["value","-1","selected",""],[3,"ngValue"],["prefix","addressForm.provinceSelect.code",3,"control"],["formGroupName","districtSelect",1,"col-6"],["value","-1","selected","","disabled",""],["prefix","addressForm.districtSelect.code",3,"control"],["formGroupName","neighborhoodSelect",1,"col-6"],["prefix","addressForm.neighborhoodSelect.code",3,"control"],["type","text","required","","formControlName","line1",1,"form-control",3,"placeholder"],["prefix","addressForm.line1",3,"control"],[1,"custom-control","custom-radio","custom-control-inline"],["type","radio",1,"custom-control-input",3,"change","id","checked"],[1,"custom-control-label",3,"for"],[1,"custom-control","custom-checkbox"],["type","checkbox","id","change-tcno-value",1,"custom-control-input",3,"change","checked"],["for","change-tcno-value",1,"custom-control-label"],["type","text","formControlName","tcNo","appNumberOnly","","maxlength","11",1,"form-control",3,"placeholder"],["prefix","formErrors.tcNo",3,"control"],[1,"form-text","text-info"],[1,"fa","fa-info-circle"],["appCompanyName","","type","text","formControlName","companyName",1,"form-control",3,"placeholder"],["prefix","addressForm.companyName",3,"control"],["formControlName","tcVergiNo","maxlength","11","appNumberOnly","",1,"form-control",3,"placeholder"],["prefix","addressForm.tcVergiNo",3,"control"],["appCompanyName","","type","text","formControlName","vergiDairesi",1,"form-control",3,"placeholder"],["prefix","addressForm.vergiDairesi",3,"control"],["type","checkbox","id","set-default-address","formControlName","defaultShippingAddress",1,"custom-control-input"],["for","set-default-address",1,"custom-control-label"]],template:function(t,i){t&1&&(te(0,3),_(1,tt,53,42),_(2,ot,8,8),_(3,nt,5,0,"div",4),ie()),t&2&&(l("formGroup",i.addressForm),s(),y(i.isSameAsShippingAddress?-1:1),s(),y(V(4,X,i.billing,i.deliverybilling).includes(i.addressFormType)?2:-1),s(),y(V(7,X,i.delivery,i.deliverybilling).includes(i.addressFormType)?3:-1))},dependencies:[_e,ye,me,ce,ve,he,ue,Ae,Se,be,ge,fe,Te,we,W,ke,Ee,ae,Y],styles:[`.santorini-updated[_ngcontent-%COMP%]{--cx-color-background: #f4f4f4;--cx-color-text: #14293a;--cx-color-inverse: #ffffff;--cx-color-transparent: transparent;--cx-color-primary: #055f9f;--cx-color-secondary: #556b82;--cx-color-success: #256f3a;--cx-color-info: #0064d8;--cx-color-warning: #b44f00;--cx-color-danger: #aa0808;--cx-color-light: #f1f1f1;--cx-color-dark: #77818b;--cx-color-primary-accent: #0f4880;--cx-color-success-accent: #f0fbe4;--cx-color-danger-accent: #fff1f1;--cx-color-warning-accent: #fff5df;--cx-color-info-accent: #deeffe;--cx-color-medium: #d3d6db;--cx-color-background-dark: #212738;--cx-color-visual-focus: #1f3a93;--cx-color-background-focus: rgba(80, 176, 244, .1);--cx-color-border-focus: rgba(166, 204, 232, .6);--cx-page-width-max: 1140px;--cx-font-weight-light: 300;--cx-font-weight-normal: 400;--cx-font-weight-semi: 600;--cx-font-weight-bold: 700;--cx-text-transform: capitalize;--cx-direction: ltr;--cx-transition-duration: .5s;--cx-animation-duration: 1s;--cx-border-radius: 1em;--cx-buttons-border-radius: 2rem;--cx-buttons-border-width: 3px;--cx-border-style: solid}.form-control[_ngcontent-%COMP%]{height:40px;font-size:.9rem;padding:.5rem}.form-control[_ngcontent-%COMP%]::placeholder{font-size:.7rem}.default-address-form[_ngcontent-%COMP%]{display:none;margin-bottom:-19px;width:250px} 2 3 4 5 6 7 8 9`]})}};var dt=(r,e)=>({hidden:r,"no-selectable":e});function at(r,e){if(r&1){let t=x();n(0,"div",2),m(1,"input",11),n(2,"label",12),v("click",function(){g(t);let o=p();return b(o.onSelected())}),d()()}if(r&2){let t=p();s(),l("id",t.inputName)("checked",t.selectedAddress&&t.selectedAddress.id===t.card.id)}}function lt(r,e){if(r&1){let t=x();n(0,"button",13),v("click",function(){g(t);let o=p();return b(o.editForm.emit({address:o.card,type:o.addressType}))}),h(1),u(2,"cxTranslate"),d()}r&2&&(s(),A(f(2,1,"checkoutAddress.editAddress")))}function ct(r,e){if(r&1){let t=x();n(0,"button",14),v("click",function(){g(t);let o=p();return b(o.onDeleteAddress(o.card))}),h(1),u(2,"cxTranslate"),d()}r&2&&(s(),A(f(2,1,"checkoutAddress.deleteAddress")))}function mt(r,e){r&1&&m(0,"i",8)}function pt(r,e){if(r&1&&(n(0,"span"),h(1),d()),r&2){let t=p();s(),oe("",t.card.location.name," / ",t.card.location.district.name," / ",t.card.location.city.name)}}function ht(r,e){if(r&1){let t=x();n(0,"button",15),v("click",function(){g(t);let o=p();return b(o.onAddressDropdownClick.emit())}),m(1,"i",16),d()}}function ut(r,e){if(r&1){let t=x();n(0,"div",10)(1,"button",17),v("click",function(){g(t);let o=p();return b(o.onDefaultShippingAddress(o.card))}),h(2,"Ge\xE7erli Adresim Yap"),d()()}}
9var Ye=class r{constructor(){this.delivery=z;this.isActiveEditAddress=!0;this.isActiveDeleteAddress=!0;this.addressType=this.delivery;this.onAddressSelected=new F;this.editForm=new F;this.deleteAddress=new F;this.onAddressDropdownClick=new F;this.setDefaultShippingAddress=new F}onSelected(){this.selectedAddress.id!==this.card.id&&this.onAddressSelected.emit(this.card)}onDefaultShippingAddress(e){e.defaultShippingAddress=!0,this.setDefaultShippingAddress.emit(e)}onDeleteAddress(e){this.deleteAddress.emit({addressId:e.id})}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275cmp=P({type:r,selectors:[["ozd-address-item"]],inputs:{card:"card",selectedAddress:"selectedAddress",inputName:"inputName",addressDropdown:"addressDropdown",isShowDropDown:"isShowDropDown",isAdditionalOrder:"isAdditionalOrder",isShowRadioButton:"isShowRadioButton",isActiveEditAddress:"isActiveEditAddress",isActiveDeleteAddress:"isActiveDeleteAddress",index:"index",addressType:"addressType",location:"location"},outputs:{onAddressSelected:"onAddressSelected",editForm:"editForm",deleteAddress:"deleteAddress",onAddressDropdownClick:"onAddressDropdownClick",setDefaultShippingAddress:"setDefaultShippingAddress"},standalone:!1,decls:22,vars:23,consts:[[1,"address-item",3,"ngClass"],[1,"address-buttons"],[1,"custom-control","custom-radio"],[1,"action-button"],["type","button",1,"btn","btn-xs","btn-link"],["type","button",1,"btn","btn-xs","btn-link","text-underline"],[1,"address-body"],[1,"address-info",3,"click"],[1,"fas","fa-star"],["type","button",1,"btn","btn-link","btn-down"],[1,"address-default"],["type","radio","value","makeDefaultAddress",1,"custom-control-input",3,"id","checked"],["for","customRadio1",1,"custom-control-label",3,"click"],["type","button",1,"btn","btn-xs","btn-link",3,"click"],["type","button",1,"btn","btn-xs","btn-link","text-underline",3,"click"],["type","button",1,"btn","btn-link","btn-down",3,"click"],[1,"fas","fa-chevron-down"],[1,"btn","btn-link","btn-sm","text-info",3,"click"]],template:function(t,i){t&1&&(n(0,"div",0)(1,"div",1),_(2,at,3,2,"div",2),n(3,"div",3),_(4,lt,3,3,"button",4),_(5,ct,3,3,"button",5),d()(),n(6,"div",6)(7,"div",7),v("click",function(){return i.onSelected()}),n(8,"h4"),h(9),_(10,mt,1,0,"i",8),d(),n(11,"span"),h(12),d(),n(13,"span"),h(14),u(15,"cxTranslate"),u(16,"phoneFormat"),d(),n(17,"span"),h(18),d(),_(19,pt,2,3,"span"),d(),_(20,ht,2,0,"button",9),d(),_(21,ut,3,0,"div",10),d()),t&2&&(re("no-radio-button",!i.isShowRadioButton),l("ngClass",V(20,dt,(i.selectedAddress&&i.selectedAddress.id!==i.card.id||i.index>0)&&!i.addressDropdown,!(i.selectedAddress&&i.selectedAddress.id===i.card.id&&i.isShowDropDown))),s(2),y(i.isShowRadioButton?2:-1),s(2),y(i.isActiveEditAddress?4:-1),s(),y(i.isActiveDeleteAddress?5:-1),s(4),se("",i.card.addressTitle," "),s(),y(i.card.defaultShippingAddress&&i.addressType===i.delivery?10:-1),s(2),J("",i.card.firstName," ",i.card.lastName),s(2),J("",f(15,16,"checkoutAddress.telep
9hone"),": ",f(16,18,i.card.phone)),s(4),A(i.card.line1),s(),y(i.card!=null&&i.card.location?19:-1),s(),y(i.selectedAddress&&i.selectedAddress.id===i.card.id&&i.isShowDropDown?20:-1),s(),y(!i.card.defaultShippingAddress&&i.addressType===i.delivery&&i.location==="address-book"?21:-1))},dependencies:[de,Y,Le],styles:[`.santorini-updated[_ngcontent-%COMP%]{--cx-color-background: #f4f4f4;--cx-color-text: #14293a;--cx-color-inverse: #ffffff;--cx-color-transparent: transparent;--cx-color-primary: #055f9f;--cx-color-secondary: #556b82;--cx-color-success: #256f3a;--cx-color-info: #0064d8;--cx-color-warning: #b44f00;--cx-color-danger: #aa0808;--cx-color-light: #f1f1f1;--cx-color-dark: #77818b;--cx-color-primary-accent: #0f4880;--cx-color-success-accent: #f0fbe4;--cx-color-danger-accent: #fff1f1;--cx-color-warning-accent: #fff5df;--cx-color-info-accent: #deeffe;--cx-color-medium: #d3d6db;--cx-color-background-dark: #212738;--cx-color-visual-focus: #1f3a93;--cx-color-background-focus: rgba(80, 176, 244, .1);--cx-color-border-focus: rgba(166, 204, 232, .6);--cx-page-width-max: 1140px;--cx-font-weight-light: 300;--cx-font-weight-normal: 400;--cx-font-weight-semi: 600;--cx-font-weight-bold: 700;--cx-text-transform: capitalize;--cx-direction: ltr;--cx-transition-duration: .5s;--cx-animation-duration: 1s;--cx-border-radius: 1em;--cx-buttons-border-radius: 2rem;--cx-buttons-border-width: 3px;--cx-border-style: solid}.address-item[_ngcontent-%COMP%]{background-color:#f8f8f8;border:1px solid #c9c9c9;padding:.5rem 1rem .5rem 2rem;position:relative;border-radius:.25rem}.address-item.hidden[_ngcontent-%COMP%]{display:none}.address-item[_ngcontent-%COMP%] .address-buttons[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;position:absolute;top:.25rem;right:0;left:.5rem;z-index:10;padding-bottom:.5rem}.address-item[_ngcontent-%COMP%] .address-body[_ngcontent-%COMP%]{display:flex;align-items:center}.address-item[_ngcontent-%COMP%] .address-body[_ngcontent-%COMP%] .btn-link[_ngcontent-%COMP%]{width:auto;max-height:50px}.address-item[_ngcontent-%COMP%] .address-info[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex-grow:1;max-width:calc(100% - 50px)}.address-item[_ngcontent-%COMP%] .address-info[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-weight:400;line-height:1}.address-item[_ngcontent-%COMP%] .address-info[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{letter-spacing:-.01rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media(max-width:991.98px){.address-item[_ngcontent-%COMP%] .address-info[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{white-space:unset}}.address-item[_ngcontent-%COMP%] .address-default[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;display:none}.address-item.no-radio-button[_ngcontent-%COMP%]{padding-left:1rem}.address-item.no-radio-button[_ngcontent-%COMP%] .address-buttons[_ngcontent-%COMP%]{justify-content:flex-end}.text-underline[_ngcontent-%COMP%]{text-decoration:underline;color:var(--cx-color-primary)}.fa-star[_ngcontent-%COMP%]{display:none;color:#ffb00c;margin-left:.5rem} 10 11 12 13 14 15 16 17`],changeDetection:0})}};export{$e as a,Ge as b,Ye as c,Re as d,qe as e};
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.