1"use strict";(self.webpackChunkToolArena_FrontEnd=self.webpackChunkToolArena_FrontEnd||[]).push([[81],{13081:(z,S,_)=>{_.d(S,{m:()=>$});var v=_(83273),C=_(97449);class G{constructor(){this.id=0,this.regions=[]}}class N{constructor(){this.id=0,this.labelType=C.T.Days,this.info=[]}}class P{}var e=_(94650),b=_(13437),k=_(80018),n=_(43493),I=_(15093),M=_(88150),u=_(58679),h=_(23556),x=_(2154),f=_(44288),d=_(11220),s=_(41175),m=_(61564),T=_(42466),A=_(36895),w=_(24006),J=_(23077),ee=_(5262),ie=_(6207),U=_(63416),te=_(8397),ne=_(97498),re=_(8494);const ae=["warehouseModal"],se=["paginationComponent"],le=["translateConfirm"];function ce(i,o){1&i&&(e.TgZ(0,"span",14),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&i&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"stockmanagement.warehouses.modal.title.add")))}function de(i,o){1&i&&(e.TgZ(0,"span",14),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&i&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"stockmanagement.warehouses.modal.title.edit")))}function pe(i,o){1&i&&(e.TgZ(0,"div",15),e._UZ(1,"app-loader",16),e.qZA()),2&i&&(e.xp6(1),e.Q6J("type",1))}function _e(i,o){if(1&i){const t=e.EpF();e.TgZ(0,"li",44)(1,"a",45),e.NdJ("click",function(){const p=e.CHM(t).$implicit,y=e.oxw(4);return e.KtG(y.selectedCulture=p.culture)}),e._uU(2),e.qZA()()}if(2&i){const t=o.$implicit;e.xp6(2),e.Oqu(t.cultureName)}}function ge(i,o){if(1&i&&(e.TgZ(0,"ul",42),e.YNc(1,_e,3,1,"li",43),e.qZA()),2&i){const t=e.oxw(3);e.xp6(1),e.Q6J("ngForOf",t.languageList)}}function me(i,o){if(1&i){const t=e.EpF();e.TgZ(0,"div",34)(1,"button",35)(2,"div",36)(3,"span",37),e._uU(4),e.ALo(5,"cultureToLanguage"),e.qZA(),e._UZ(6,"i",38),e.qZA(),e.YNc(7,ge,2,1,"ul",39),e.qZA(),e.TgZ(8,"span",40)(9,"img",41),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(2);return e.KtG(a.onTranslate())}),e.qZA()()()}if(2&i){const t=e.oxw(2);e.xp6(4),e.Oqu(e.lcZ(5,1,t.selectedCulture))}}const j=function(i){return{"has-error":i}};function ue(i,o){if(1&i){const t=e.EpF();e.TgZ(0,"div",22)(1,"input",67),e.NdJ("ngModelChange",function(a){e.CHM(t);const p=e.oxw().$implicit;return e.KtG(p.deliveryLabel=a)}),e.qZA()()}if(2&i){const t=e.oxw().$implicit,r=e.oxw(5);e.xp6(1),e.Q6J("ngClass",e.VKq(2,j,r.confirmed&&r.isEmpty(t.deliveryLabel,t.culture)))("ngModel",t.deliveryLabel)}}function he(i,o){if(1&i&&(e.TgZ(0,"div"),e.YNc(1,ue,2,4,"div",66),e.qZA()),2&i){const t=o.$implicit,r=e.oxw(5);e.xp6(1),e.Q6J("ngIf",t.culture==r.selectedCulture)}}function fe(i,o){1&i&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&i&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"stockmanagement.deliverylabels.days"),""))}function Q(i,o){1&i&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&i&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"stockmanagement.deliverylabels.weeks"),""))}function c(i,o){if(1&i&&(e.TgZ(0,"option",68),e.YNc(1,fe,3,3,"span",33),e.YNc(2,Q,3,3,"span",33),e.qZA()),2&i){const t=o.$implicit,r=e.oxw(5);e.Q6J("value",t),e.xp6(1),e.Q6J("ngIf",t==r.deliveryLabelType.Days),e.xp6(1),e.Q6J("ngIf",t==r.deliveryLabelType.Weeks)}}const g=function(i,o){return{"new-row":i,"prev-row":o}},l=function(i){return{"switch-text-inactive":i}};function Z(i,o){if(1&i){const t=e.EpF();e.ynx(0),e.TgZ(1,"tr",47)(2,"td",50),e._uU(3),e.ALo(4,"country"),e.qZA(),e.TgZ(5,"td",50),e.YNc(6,he,2,1,"div",49),e.qZA(),e.TgZ(7,"td",50)(8,"div",51)(9,"div",52)(10,"div",53)(11,"i",54),e.NdJ("click",function(){const p=e.CHM(t).$implicit,y=e.oxw(4);return e.KtG(y.quantityChanged(p,!1))}),e.qZA(),e.TgZ(12,"input",55),e.NdJ("ngModelChange",function(a){const y=e.CHM(t).$implicit;return e.KtG(y.labelValue=a)}),e.qZA(),e.TgZ(13,"i",56),e.NdJ("click",function(){const p=e.CHM(t).$implicit,y=e.oxw(4);return e.KtG(y.quantityChanged(p,!0))}),e.qZA()()()(),e.TgZ(14,"div",57)(15,"div",22)(16,"select",58),e.NdJ("ngModelChange",function(a){const y=e.CHM(t).$implicit;return e.KtG(y.labelType=a)}),e.YNc(17,c,3,3,"option",59),e.qZA()()()(),e.TgZ(18,"td",60)(19,"label",61)(20,"input",62),e.NdJ("ngModelChange",function(a){const y=e.CHM(t).$implicit;return e.KtG(y.isPreferred=a)}),e.qZA(),e._UZ(21,"span",63),e.qZA(),e._uU(22,"\xa0"),e.TgZ(23,"label",64),e._uU(24),e.ALo(25,"translate"),e.qZA()(),e.TgZ(26,"td",60)(27,"i",65),e.NdJ("click",function(){const p=e.CH
1M(t).$implicit,y=e.oxw(4);return e.KtG(y.deleteRegion(p.countryId))}),e.ALo(28,"translate"),e.qZA()()(),e.BQk()}if(2&i){const t=o.$implicit,r=e.oxw(4);e.xp6(2),e.Q6J("ngClass",e.WLB(24,g,t.countryId==r.lastAddedCountry,t.countryId==r.previousCountry)),e.xp6(1),e.hij(" ",e.Dn7(4,16,t.countryId,"name",r.selectedCulture)," "),e.xp6(2),e.Q6J("ngClass",e.WLB(27,g,t.countryId==r.lastAddedCountry,t.countryId==r.previousCountry)),e.xp6(1),e.Q6J("ngForOf",t.info),e.xp6(1),e.Q6J("ngClass",e.WLB(30,g,t.countryId==r.lastAddedCountry,t.countryId==r.previousCountry)),e.xp6(5),e.Q6J("ngClass",e.VKq(33,j,r.confirmed&&!r.isValidNumber(t.labelValue)))("ngModel",t.labelValue),e.xp6(4),e.Q6J("ngClass",e.VKq(35,j,r.confirmed&&null==t.labelType))("ngModel",t.labelType),e.xp6(1),e.Q6J("ngForOf",r.deliveryLabelTypes),e.xp6(1),e.Q6J("ngClass",e.WLB(37,g,t.countryId==r.lastAddedCountry,t.countryId==r.previousCountry)),e.xp6(2),e.Q6J("ngModel",t.isPreferred),e.xp6(3),e.Q6J("ngClass",e.VKq(40,l,!t.isPreferred)),e.xp6(1),e.hij(" ",e.lcZ(25,20,"stockmanagement.warehouses.modal.preferred"),""),e.xp6(2),e.Q6J("ngClass",e.WLB(42,g,t.countryId==r.lastAddedCountry,t.countryId==r.previousCountry)),e.xp6(1),e.Q6J("tooltip",e.lcZ(28,22,"stockmanagement.warehouses.tooltip.remove"))}}function O(i,o){if(1&i&&(e.ynx(0),e.YNc(1,Z,29,45,"ng-container",49),e.BQk()),2&i){const t=e.oxw(3);e.xp6(1),e.Q6J("ngForOf",t.shownRegions)}}function W(i,o){1&i&&(e.ynx(0),e.TgZ(1,"tr",69),e._UZ(2,"td")(3,"td")(4,"td")(5,"td")(6,"td"),e.qZA(),e.BQk())}function L(i,o){if(1&i&&(e.TgZ(0,"table",46)(1,"thead")(2,"tr",47)(3,"td"),e._uU(4),e.ALo(5,"translate"),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.ALo(8,"translate"),e.qZA(),e.TgZ(9,"td"),e._uU(10),e.ALo(11,"translate"),e.qZA(),e.TgZ(12,"td"),e._uU(13),e.ALo(14,"translate"),e.qZA(),e.TgZ(15,"td"),e._uU(16),e.ALo(17,"translate"),e.qZA()()(),e.TgZ(18,"tbody",48),e.YNc(19,O,2,1,"ng-container",33),e.YNc(20,W,7,0,"ng-container",33),e.qZA()()),2&i){const t=e.oxw(2);e.xp6(4),e.hij(" ",e.lcZ(5,7,"stockmanagement.warehouses.modal.country")," "),e.xp6(3),e.hij(" ",e.lcZ(8,9,"stockmanagement.warehouses.deliverylabel")," "),e.xp6(3),e.hij(" ",e.lcZ(11,11,"stockmanagement.warehouses.edideliverylabel")," "),e.xp6(3),e.hij(" ",e.lcZ(14,13,"stockmanagement.warehouses.modal.status")," "),e.xp6(3),e.hij(" ",e.lcZ(17,15,"stockmanagement.warehouses.actions")," "),e.xp6(3),e.Q6J("ngIf",t.warehouse&&t.shownRegions&&t.shownRegions.length>0),e.xp6(1),e.Q6J("ngIf",!t.warehouse||!t.shownRegions||t.shownRegions.length<1)}}function Y(i,o){if(1&i){const t=e.EpF();e.TgZ(0,"div")(1,"app-pagination",70,71),e.NdJ("onPaginationChange",function(a){e.CHM(t);const p=e.oxw(2);return e.KtG(p.onPaginationChange(a))}),e.qZA()()}if(2&i){const t=e.oxw(2);e.xp6(1),e.Q6J("totalItems",t.warehouse.regions.length)}}function Ze(i,o){if(1&i){const t=e.EpF();e.TgZ(0,"div",9)(1,"div",17)(2,"span",18),e._uU(3),e.ALo(4,"translate"),e.qZA()(),e.TgZ(5,"div",19)(6,"div",20)(7,"label",21),e._uU(8),e.ALo(9,"translate"),e.qZA(),e.TgZ(10,"div",22)(11,"input",23),e.NdJ("ngModelChange",function(a){e.CHM(t);const p=e.oxw();return e.KtG(p.warehouse.name=a)}),e.qZA()()(),e.TgZ(12,"div",20)(13,"label",21),e._uU(14),e.ALo(15,"translate"),e.qZA(),e.TgZ(16,"app-autocomplete-country-selection",24),e.NdJ("selectedCountryID",function(a){e.CHM(t);const p=e.oxw();return e.KtG(p.selectedCountry(a,!0))}),e.ALo(17,"country"),e.ALo(18,"translate"),e.qZA()()(),e.TgZ(19,"div",25)(20,"label",21),e._uU(21),e.ALo(22,"translate"),e.qZA()(),e.TgZ(23,"div",19)(24,"div",26)(25,"app-autocomplete-country-selection",27),e.NdJ("selectedCountryID",function(a){e.CHM(t);const p=e.oxw();return e.KtG(p.selectedCountry(a))}),e.ALo(26,"country"),e.ALo(27,"translate"),e.qZA()(),e.TgZ(28,"div",26)(29,"button",28),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.addRegion())}),e._uU(30),e.ALo(31,"translate"),e.qZA()()(),e.YNc(32,me,10,3,"div",29),e.TgZ(33,"div",30)(34,"div",25)(35,"div",31),e.YNc(36,L,21,17,"table",32),e.YNc(37,Y,3,1,"div",33),e.qZA()()()()}if(2&i){const t=e.oxw();e.xp6(3),e.Oqu(e.lcZ(4,16,"stockmanagement.warehouses.modal.message")),e.xp6(
15),e.Oqu(e.lcZ(9,18,"stockmanagement.warehouses.modal.name")),e.xp6(3),e.Q6J("ngModel",t.warehouse.name)("ngClass",e.VKq(36,j,t.confirmed&&t.isEmpty(t.warehouse.name))),e.xp6(3),e.Oqu(e.lcZ(15,20,"stockmanagement.warehouses.modal.location")),e.xp6(2),e.Q6J("selectedCountry",e.xi3(17,22,t.warehouse.countryId,"name"))("placeholder",e.lcZ(18,25,"stockmanagement.warehouses.modal.location"))("selectedHasError",t.confirmed&&!t.isValidNumber(t.warehouse.countryId)),e.xp6(5),e.Oqu(e.lcZ(22,27,"stockmanagement.warehouses.modal.country")),e.xp6(4),e.Q6J("selectedCountry",e.xi3(26,29,t.newCountry,"name"))("placeholder",e.lcZ(27,32,"customerregistration.placeholder.country")),e.xp6(4),e.Q6J("disabled",!t.newCountry||t.isRepeated(t.newCountry)),e.xp6(1),e.Oqu(e.lcZ(31,34,"stockmanagement.warehouses.modal.addregion")),e.xp6(2),e.Q6J("ngIf",t.warehouse&&t.shownRegions&&t.shownRegions.length>0),e.xp6(4),e.Q6J("ngIf",!t.isBusy&&t.warehouse&&t.shownRegions&&t.shownRegions.length>0),e.xp6(1),e.Q6J("ngIf",!t.isBusy&&t.warehouse&&t.warehouse.regions&&t.warehouse.regions.length>0)}}const Me=function(){return{backdrop:"static"}};class F extends v.V{constructor(o,t,r,a,p){super(),this.notificationService=o,this.partnerService=t,this.translationService=r,this.translateService=a,this.jsonService=p,this.modalClosed=new e.vpe,this.deliveryLabelType=C.T}ngOnInit(){this.loadLanguageList(),this.mapDeliveryLabelTypeEnumToArray()}cancel(){this.warehouseModal.hide(),this.warehouse=null,null!=this.callback&&this.callback(b.X.Canceled)}showModal(o){this.warehouse=null,this.confirmed=!1,this.selectedCulture=this.translateService.currentLang,this.newCountry=null,this.previousCountry=null,this.lastAddedCountry=null,this.SetLoading(!0),setTimeout(()=>{this.warehouse=JSON.parse(JSON.stringify(o)),this.warehouse.regions&&this.warehouse.regions.length>0&&this.warehouse.regions.forEach(r=>r.labelValue=r.labelValue?r.labelValue:null),this.addMissingLang().then(r=>{this.SetLoading(!1)}),this.shownRegions=[]},0);let t=new Promise((r,a)=>{this.callback=r});return this.warehouseModal.show(),t}confirm(){this.confirmed=!0,this.canConfirm()&&(this.SetLoading(!0),0==this.warehouse.id?this.warehouse.partnerId?this.partnerService.createPartnerWarehouse(this.warehouse).then(o=>{o?(this.warehouseModal.hide(),this.callback(b.X.Confirmed)):this.SetError("create failed"),this.SetLoading(!1),this.warehouse=null}).catch(o=>{this.SetError(o.errorMessage),this.SetLoading(!1)}):this.warehouse.resellerId&&this.partnerService.createResellerWarehouse(this.warehouse).then(o=>{o?(this.warehouseModal.hide(),this.callback(b.X.Confirmed)):this.SetError("create failed"),this.SetLoading(!1),this.warehouse=null}).catch(o=>{this.SetError(o.errorMessage),this.SetLoading(!1)}):this.warehouse.partnerId?this.partnerService.updatePartnerWarehouse(this.warehouse).then(o=>{o?(this.warehouseModal.hide(),this.callback(b.X.Confirmed)):this.SetError("update failed"),this.SetLoading(!1)}).catch(o=>{this.SetError(o.errorMessage),this.SetLoading(!1)}):this.warehouse.resellerId&&this.partnerService.updateResellerWarehouse(this.warehouse).then(o=>{o?(this.warehouseModal.hide(),this.callback(b.X.Confirmed)):this.SetError("update failed"),this.SetLoading(!1)}).catch(o=>{this.SetError(o.errorMessage),this.SetLoading(!1)}))}canConfirm(){if(this.isEmpty(this.warehouse.name)||!this.isValidNumber(this.warehouse.countryId))return!1;if(this.warehouse.regions&&this.warehouse.regions.length>0)for(let o of this.warehouse.regions){if(this.warehouse.regions.filter(a=>a.countryId==o.countryId).length>1||!o.info||!o.labelValue)return!1;let r=o.info.find(a=>this.isEmpty(a.deliveryLabel,a.culture));if(null!=r)return this.selectedCulture=r.culture,!1}return!0}isEmpty(o,t=null){return null==t?null==o||o.trim().length<1:(null==o||o.trim().length<1)&&("en-DE"==t||"de-DE"==t)}isValidNumber(o){return!isNaN(Number(o))&&o>0}addRegion(){if(!this.isRepeated(this.newCountry)){let o=new N;this.languageList.forEach(t=>{let r=new P;r.culture=t.culture,o.countryId=this.newCountry,o.info.push(r)}),this.warehouse.regions.push(o),this.lastAddedCountry=this.newCountry,setTimeout(()=>{this.paginationComponent.currentPage=Math.ceil(this.warehouse.regions.length/this.paginationComponent.itemsPerPage);let t=(this.paginationComponent.currentPage-1)*this.paginationComponent.itemsPerPage;this.shownRegions=this.warehouse.regions.slice(t,t+this.paginationComponent.itemsPerPage);let r=this.shownRegions.findIndex(a=>a.countryId==this.lastAddedCountry);this.previousCountry=0==r?null:this.shownRegions[r-1].countryId},50)}}deleteRegion(o){let t=this.warehouse.regions.findIndex(r=>r.countryId==o);this.warehouse.regions.splice(t,1),this.shownRegions=[],this.paginationComponent&&this.paginationComponent.itemsPerPage?(this.paginationComponent.currentPage=1,this.shownRegions=this.warehouse.regions.slice(0,this.paginationComponent.itemsPerPage)):this.shownRegions=this.warehouse.regions}
1loadLanguageList(){this.translationService.getLanguages().then(o=>{this.languageList=o}).catch(o=>{this.SetError(o.errorMessage),this.notificationService.showPushNotification(M.T.Common.LoadLanguageError())})}getCultureName(o){let t=this.languageList.find(r=>r.culture==o);return t?t.cultureName:""}selectedCountry(o,t=!1){t?this.warehouse.countryId=o:this.newCountry=o}isRepeated(o){return null!=this.warehouse.regions.find(t=>t.countryId==o)}onPaginationChange(o){let t=Number(o.offset)+Number(o.itemsPerPage);this.shownRegions=this.warehouse.regions.slice(o.offset,t)}mapDeliveryLabelTypeEnumToArray(){this.deliveryLabelTypes=[],Object.keys(C.T).map(t=>this.deliveryLabelTypes.push(C.T[t])),this.deliveryLabelTypes=this.deliveryLabelTypes.filter(t=>!isNaN(Number(t)))}quantityChanged(o,t){o.labelValue&&(o.labelValue=t?o.labelValue+1:o.labelValue-1),(!o.labelValue||o.labelValue<1)&&(o.labelValue=1)}onTranslate(){let o=this.languageList.find(t=>t.culture==this.selectedCulture)?.cultureName;this.warehouseModal.hide(),this.translateConfirm.showChildModal(o).then(t=>{if(this.warehouseModal.show(),t.status==b.X.Confirmed){this.SetLoading(!0);let r=this.languageList.find(y=>y.cultureName==t.fromLangName)?.culture,a=t.toLangName,p=new x.vN;p.toLang=a,p.jsonObject=this.getValueForTranslate(r),this.translate(r,p).then(y=>{y?this.setValueForTranslate(o,y).finally(()=>{this.SetLoading(!1)}):this.SetLoading(!1)}).catch(y=>{this.SetLoading(!1)})}else this.SetLoading(!1)}).catch(t=>{this.warehouseModal.show()})}getValueForTranslate(o){let t=[];return this.warehouse.regions.forEach(r=>{let a=r.info.find(p=>p.culture==o);a&&t.push({countryId:r.countryId,deliveryLabel:a.deliveryLabel})}),JSON.stringify(t)}translate(o,t){return new Promise((r,a)=>{this.SetLoading(!0),this.jsonService.translateTreeJson(o,t).then(p=>{r(p)}).catch(p=>{this.notificationService.showPushNotification(M.T.Common.SaveError()),console.error(p),this.SetLoading(!1),a(p)})})}setValueForTranslate(o,t){return new Promise((r,a)=>{if(t&&t){let p=[];t.forEach(y=>{p.push(y.toLang),JSON.parse(y.translatedJson).forEach(ve=>{if(-1!=this.warehouse.regions.findIndex(X=>X.countryId==ve.countryId)){var Ce=this.warehouse.regions.find(X=>X.countryId==ve.countryId).info.find(X=>X.culture==y.toLang);Ce&&(Ce.deliveryLabel=ve.deliveryLabel)}})}),r(!0),this.notificationService.showPushNotification(new s.P(m.j.success,"notifications.common.save.success.title","pagemanagement.modaldialog.translate.translatedlang",JSON.parse(`{"fromLang":"${o}","toLang": "${p.join(",")}"}`)))}else r(!0)})}addMissingLang(){return new Promise((o,t)=>{this.warehouse.regions.forEach(r=>{let a=r.info.map(y=>y.culture);this.languageList.filter(y=>!a.includes(y.culture))?.forEach(y=>{let R=new P;R.culture=y.culture,R.warehouseRegionId=r.id,R.deliveryLabel=null,r.info.push({...R})})}),o(!0)})}}F.\u0275fac=function(o){return new(o||F)(e.Y36(n.g),e.Y36(I.b),e.Y36(u.D),e.Y36(T.sK),e.Y36(d.Sk))},F.\u0275cmp=e.Xpm({type:F,selectors:[["app-warehouse-modal"]],viewQuery:function(o,t){if(1&o&&(e.Gf(ae,5),e.Gf(se,5),e.Gf(le,5)),2&o){let r;e.iGM(r=e.CRH())&&(t.warehouseModal=r.first),e.iGM(r=e.CRH())&&(t.paginationComponent=r.first),e.iGM(r=e.CRH())&&(t.translateConfirm=r.first)}},outputs:{modalClosed:"modalClosed"},features:[e.qOj],decls:20,vars:13,consts:[["bsModal","","tabindex","-1","role","dialog","aria-hidden","true",1,"modal","fade",3,"config"],["warehouseModal","bs-modal"],[1,"modal-dialog","modal
1-lg"],[1,"modal-content"],[1,"modal-body"],[1,"col-xs-12","TA-info-box",2,"margin-bottom","20px"],["class","TA-sub-header-title",4,"ngIf"],["class","col-xs-12 TA-padding-0","style","margin-bottom: 20px;",4,"ngIf"],["class","row",4,"ngIf"],[1,"row"],[1,"modal-footer"],["type","button","aria-label","Cancel",1,"btn","btn-default","TA-cancel-btn",3,"click"],["type","button","aria-label","Confirm",1,"btn","btn-warning","set-border-none",3,"disabled","click"],["translateConfirm",""],[1,"TA-sub-header-title"],[1,"col-xs-12","TA-padding-0",2,"margin-bottom","20px"],[2,"justify-content","center","display","flex",3,"type"],[1,"col-xs-12",2,"margin-bottom","20px"],[1,"TA-sub-header-title",2,"font-weight","400 !important"],[1,"col-md-12","TA-padding-0"],[1,"col-md-6"],[1,"form-label"],[1,"form-group"],[1,"form-control",3,"ngModel","ngClass","ngModelChange"],["name","autocomplete-country",3,"selectedCountry","placeholder","selectedHasError","selectedCountryID"],[1,"col-md-12"],[1,"col-md-4"],["name","autocomplete-country",3,"selectedCountry","placeholder","selectedCountryID"],[1,"btn","btn-warning","set-border-none","thin-btn",3,"disabled","click"],["class","col-md-12","style","margin: 20px 0 10px;",4,"ngIf"],[1,"col-md-12","TA-padding-0",2,"margin","0 0 20px"],[1,"table-responsive"],["class","table TA-table",4,"ngIf"],[4,"ngIf"],[1,"col-md-12",2,"margin","20px 0 10px"],["dropdown","",1,"dropdown","TA-basic-dropdown"],["dropdownToggle",""],[1,"TA-basic-dropdown-placeholder"],[1,"fa","fa-regular","fa-angle-down","pull-right","dropdwon-caret"],["role","menu","class","dropdown-menu TA-basic-dropdown-menu",4,"dropdownMenu"],[1,"pull-right","translate-btn"],["src","../../../../../assets/icons/cms_icons/ce_icn_toolbar_translate.svg","onerror","this.onerror=null;src='/../../assets/image-not-found.svg';","alt","Image",3,"click"],["role","menu",1,"dropdown-menu","TA-basic-dropdown-menu"],["class","TA-basic-dropdown-menu-item","role","menuitem",4,"ngFor","ngForOf"],["role","menuitem",1,"TA-basic-dropdown-menu-item"],["role","button",3,"click"],[1,"table","TA-table"],[2,"border-collapse","collapse","border","none"],[1,"table-body-warehouse"],[4,"ngFor","ngForOf"],[3,"ngClass"],[1,"col-md-6","TA-padding-0",2,"width","100px"],[1,"TA-number-field"],[1,"input-group","input-group-sm",2,"height","34px"],[1,"fa","fa-regular","fa-minus","icon",3,"click"],["type","text","placeholder","1","min","1","OnlyNumber","true",1,"form-control","short","input-border","input-field",3,"ngClass","ngModel","ngModelChange"],[1,"fa","fa-regular","fa-plus","icon",3,"click"],[1,"col-md-6","TA-padding-0","pull-right",2,"width","90px"],[1,"form-control","input-sm",2,"height","34px !important",3,"ngClass","ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[2,"text-align","center",3,"ngClass"],[1,"TA-switch","scaled","vertical",2,"margin","0 !important"],["type","checkbox",3,"ngModel","ngModelChange"],[1,"TA-slider","round","scaled"],[1,"switch-text",3,"ngClass"],["role","button",1,"fa","fa-solid","fa-minus-circle","action-button",3,"tooltip","click"],["class","form-group",4,"ngIf"],[1,"form-control",3,"ngClass","ngModel","ngModelChange"],[3,"value"],[2,"border-collapse","collapse","border","none","height","40px"],[3,"totalItems","onPaginationChange"],["paginationComponent",""]],template:function(o,t){1&o&&(e.TgZ(0,"div",0,1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5),e.YNc(6,ce,3,3,"span",6),e.YNc(7,de,3,3,"span",6),e.qZA(),e.YNc(8,pe,2,1,"div",7),e.YNc(9,Ze,38,38,"div",8),e.TgZ(10,"div",9)(11,"div",10)(12,"button",11),e.NdJ("click",function(){return t.cancel()}),e._uU(13),e.ALo(14,"translate"),e.qZA(),e.TgZ(15,"button",12),e.NdJ("click",function(){return t.confirm()}),e._uU(16),e.ALo(17,"translate"),e.qZA()()()()()()(),e._UZ(18,"app-translate-confirm-dialog",null,13)),2&o&&(e.Q6J("config",e.DdM(12,Me)),e.xp6(6),e.Q6J("ngIf",t.warehouse&&0==t.warehouse.id),e.xp6(1),e.Q6J("ngIf",t.warehouse&&t.warehouse.id>0),e.xp6(1),e.Q6J("ngIf",t.isBusy&&!t.hasError),e.xp6(1),e.Q6J("ngIf",!t.isBusy&&!t.hasError&&t.warehouse),e.xp6(4),e.hij(" ",e.lcZ(14,8,"dialog.cancel")," "),e.xp6(2),e.Q6J("disabled",t.isBusy),e.xp6(1),e.hij(" ",e.lcZ(17,10,"dialog.confirm")," "))},dependencies:[A.mk,A.sg,A.O5,w.YN,w.Kr,w.Fj,w.Wl,w.EJ,w.JJ,k.oB,w.On,h.Q,J.Hz,J.Mq,J.TO,ee.p,ie.s,U.R,f.e,te.i9,T.X$,ne.z,re.O],styles:[".set-border-none[_ngcontent-%COMP%]{border:none!important}.header[_ngcontent-%COMP%]{color:#154baa}.required-field[_ngcontent-%COMP%]{color:red}.has-error[_ngcontent-%COMP%]{border:1px solid red!important;background:rgba(253,213,162,.4588235294)}.action-button[_ngcontent-%COMP%]{font-size:1.25em;margin:0 5px;color:var(--default-icon-color)}.checkbox-size[_ngcontent-%COMP%]{width:1.3em;height:1.3em;margin:auto}.thin-btn[_ngcontent-%COMP%]{padding:5px 10px!important;height:auto!important}.switch-text[_ngcontent-%COMP%]{vertical-align:middle;font-size:.9em;margin:0!important}.switch-text-inactive[_ngcontent-%COMP%]{color:var(--neutral-lightgray1)}.new-row[_ngcontent-%COMP%]{border-color:#000!important}.prev-row[_ngcontent-%COMP%]{border-bottom-color:#000!important}.TA-number-field[_ngcontent-%COMP%]{height:34px!important}.TA-number-field[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]{border-color:var(--neutral-lightgray1)!important}.TA-number-field[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{padding:.4em}.table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{vertical-align:middle!important}.table-body-warehouse[_ngcontent-%COMP%] .form-group[_ngcontent-%COMP%]{margin:0!important}.translate-btn[_ngcontent-%COMP%]{cursor:pointer}.translate-btn[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:2.5rem;width:auto}"]});var xe=_(91178),Te=_(15201);const Ae=["deliveryLabelModal"];function we(i,o){1&i&&(e.TgZ(0,"div",13),e._UZ(1,"app-loader",14),e.qZA()),2&i&&(e.xp6(1),e.Q6J("type",1))}function Ie(i,o){1&i&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&i&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"stockmanagement.deliverylabels.days"),""))}function Le(i,o){1&i&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&i&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"stockmanagement.deliverylabels.weeks"),""))}function ke(i,o){if(1&i&&(e.TgZ(0,"option",28),e.YNc(1,Ie,3,3,"span",29),e.YNc(2,Le,3,3,"span",29),e.qZA()),2&i){const t=o.$implicit,r=e.oxw(2);e.Q6J("value",t),e.xp6(1),e.Q6J("ngIf",t==r.deliveryLabelType.Days),e.xp6(1),e.Q6J("ngIf",t==r.deliveryLabelType.Weeks)}}function Se(i,o){1&i&&(e.TgZ(0,"span",35),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&i&&(e.xp6(1),e.Oqu(e.l
1cZ(2,1,"stockmanagement.deliverylabels.active")))}function Oe(i,o){1&i&&(e.TgZ(0,"span",35),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&i&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"stockmanagement.deliverylabels.disabled")))}function Ee(i,o){if(1&i){const t=e.EpF();e.TgZ(0,"diV",18)(1,"div",30)(2,"label",31)(3,"input",32),e.NdJ("ngModelChange",function(a){e.CHM(t);const p=e.oxw(2);return e.KtG(p.deliveryLabel.isActive=a)}),e.qZA(),e._UZ(4,"span",33),e.qZA(),e._uU(5," \xa0"),e.YNc(6,Se,3,3,"span",34),e.YNc(7,Oe,3,3,"span",34),e.qZA()()}if(2&i){const t=e.oxw(2);e.xp6(3),e.Q6J("ngModel",t.deliveryLabel.isActive)("checked",t.deliveryLabel.isActive),e.xp6(3),e.Q6J("ngIf",t.deliveryLabel.isActive),e.xp6(1),e.Q6J("ngIf",!t.deliveryLabel.isActive)}}const ye=function(i){return{"has-error":i}};function Ne(i,o){if(1&i){const t=e.EpF();e.TgZ(0,"div",9)(1,"div",15)(2,"div",16)(3,"label",17),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div",18)(7,"div",19)(8,"div",20)(9,"i",21),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.quantityChanged(!1))}),e.qZA(),e.TgZ(10,"input",22),e.NdJ("ngModelChange",function(a){e.CHM(t);const p=e.oxw();return e.KtG(p.deliveryLabel.value=a)}),e.qZA(),e.TgZ(11,"i",23),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.quantityChanged(!0))}),e.qZA()()()(),e.TgZ(12,"div",18)(13,"div",24)(14,"select",25),e.NdJ("ngModelChange",function(a){e.CHM(t);const p=e.oxw();return e.KtG(p.deliveryLabel.type=a)}),e.YNc(15,ke,3,3,"option",26),e.qZA()()(),e.YNc(16,Ee,8,4,"diV",27),e.qZA()()}if(2&i){const t=e.oxw();e.xp6(4),e.Oqu(e.lcZ(5,7,"stockmanagement.deliverylabels.customvalue")),e.xp6(6),e.Q6J("ngClass",e.VKq(9,ye,t.confirmed&&t.isEmpty(t.deliveryLabel.value)))("ngModel",t.deliveryLabel.value),e.xp6(4),e.Q6J("ngClass",e.VKq(11,ye,t.confirmed&&null==t.deliveryLabel.type))("ngModel",t.deliveryLabel.type),e.xp6(1),e.Q6J("ngForOf",t.deliveryLabelTypes),e.xp6(1),e.Q6J("ngIf",t.deliveryLabel.id>0)}}const Pe=function(){return{backdrop:"static"}};class H extends v.V{constructor(o){super(),this.partnerService=o,this.modalClosed=new e.vpe,this.deliveryLabelType=C.T}ngOnInit(){this.mapDeliveryLabelTypeEnumToArray()}cancel(){this.deliveryLabelModal.hide(),null!=this.callback&&this.callback(b.X.Canceled)}showModal(o){this.confirmed=!1,this.deliveryLabel={...o};let t=new Promise((r,a)=>{this.callback=r});return this.deliveryLabelModal.show(),t}confirm(){this.confirmed=!0,this.canConfirm()&&(this.SetLoading(!0),0==this.deliveryLabel.id?this.deliveryLabel.partnerId?this.partnerService.createPartnerDeliveryLabel(this.deliveryLabel).then(o=>{o?(this.deliveryLabelModal.hide(),this.callback(b.X.Confirmed)):this.SetError("create failed"),this.SetLoading(!1)}).catch(o=>{this.SetError(o.errorMessage),this.SetLoading(!1)}):this.deliveryLabel.resellerId&&this.partnerService.createResellerDeliveryLabel(this.deliveryLabel).then(o=>{o?(this.deliveryLabelModal.hide(),this.callback(b.X.Confirmed)):this.SetError("create failed"),this.SetLoading(!1)}).catch(o=>{this.SetError(o.errorMessage),this.SetLoading(!1)}):this.deliveryLabel.partnerId?this.partnerService.updatePartnerDeliveryLabel(this.deliveryLabel).then(o=>{o?(this.deliveryLabelModal.hide(),this.callback(b.X.Confirmed)):this.SetError("update failed"),this.SetLoading(!1)}).catch(o=>{this.SetError(o.errorMessage),this.SetLoading(!1)}):this.deliveryLabel.resellerId&&this.partnerService.updateResellerDeliveryLabel(this.deliveryLabel).then(o=>{o?(this.deliveryLabelModal.hide(),this.callback(b.X.Confirmed)):this.SetError("update failed"),this.SetLoading(!1)}).catch(o=>{this.SetError(o.errorMessage),this.SetLoading(!1)}))}canConfirm(){return this.deliveryLabel.value&&!isNaN(Number(this.deliveryLabel.value))&&Number(this.deliveryLabel.value)>0&&null!=this.deliveryLabel.type}isEmpty(o){return null==o||isNaN(Number(o))||Number(this.deliveryLabel.value)<1}mapDeliveryLabelTypeEnumToArray(){this.deliveryLabelTypes=[],Object.keys(C.T).map(t=>this.deliveryLabelTypes.push(C.T[t])),this.deliveryLabelTypes=this.deliveryLabelTypes.filter(t=>!isNaN(Number(t)))}quantityChanged(o){this.deliveryLabel.value&&(this.deliveryLabel.value=o?this.deliveryLabel.value+1:this.deliveryLabel.value-1),(!this.deliveryLabel.value||this.deliveryLabel.value<1)&&(this.deliveryLabel.value=1)}}H.\u0275fac=function(o){return new(o||H)(e.Y36(I.b))},H.\u0275cmp=e.Xpm({type:H,selectors:[["app-delivery-label-modal"]],viewQuery:function(o,t){if(1&o&&e.Gf(Ae,5),2&o){let r;e.iGM(r=e.CRH())&&(t.deliveryLabelModal=r.first)}},outputs:{modalClosed:"modalClosed"},features:[e.qOj],decls:19,vars:14,consts:[["bsModal","","tabindex","-1","role","dialog","aria-hidden","true",1,"modal","fade",3,"config"],["deliveryLabelModal","bs-modal"],[1,"modal-dialog","modal
1-md"],[1,"modal-content"],[1,"modal-body"],[1,"col-xs-12","TA-info-box",2,"margin-bottom","20px"],[1,"TA-sub-header-title"],["class","col-xs-12 TA-padding-0","style","margin-bottom: 20px;",4,"ngIf"],["class","row",4,"ngIf"],[1,"row"],[1,"modal-footer"],["type","button","aria-label","Cancel",1,"btn","btn-default","TA-cancel-btn",3,"click"],["type","button","aria-label","Confirm",1,"btn","btn-warning","set-border-none",3,"disabled","click"],[1,"col-xs-12","TA-padding-0",2,"margin-bottom","20px"],[2,"justify-content","center","display","flex",3,"type"],[1,"col-md-12","TA-padding-0"],[1,"col-md-12"],[1,"form-label"],[1,"col-md-4"],[1,"TA-number-field"],[1,"input-group","input-group-sm",2,"height","30px"],[1,"fa","fa-regular","fa-minus","icon",3,"click"],["type","text","placeholder","1","min","1","OnlyNumber","true",1,"form-control","short","input-border","input-field",3,"ngClass","ngModel","ngModelChange"],[1,"fa","fa-regular","fa-plus","icon",3,"click"],[1,"form-group"],[1,"form-control","input-sm",3,"ngClass","ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],["class","col-md-4",4,"ngIf"],[3,"value"],[4,"ngIf"],[2,"display","flex"],[1,"checkbox-container"],["type","checkbox",1,"form-control",3,"ngModel","checked","ngModelChange"],[1,"checkmark"],["class","check-label",4,"ngIf"],[1,"check-label"]],template:function(o,t){1&o&&(e.TgZ(0,"div",0,1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5)(6,"span",6),e._uU(7),e.ALo(8,"translate"),e.qZA()(),e.YNc(9,we,2,1,"div",7),e.YNc(10,Ne,17,13,"div",8),e.TgZ(11,"div",9)(12,"div",10)(13,"button",11),e.NdJ("click",function(){return t.cancel()}),e._uU(14),e.ALo(15,"translate"),e.qZA(),e.TgZ(16,"button",12),e.NdJ("click",function(){return t.confirm()}),e._uU(17),e.ALo(18,"translate"),e.qZA()()()()()()()),2&o&&(e.Q6J("config",e.DdM(13,Pe)),e.xp6(7),e.Oqu(e.l
1cZ(8,7,"stockmanagement.deliverylabels.title")),e.xp6(2),e.Q6J("ngIf",t.isBusy&&!t.hasError),e.xp6(1),e.Q6J("ngIf",!t.isBusy&&!t.hasError&&t.deliveryLabel),e.xp6(4),e.hij(" ",e.lcZ(15,9,"dialog.cancel")," "),e.xp6(2),e.Q6J("disabled",t.isBusy),e.xp6(1),e.hij(" ",e.lcZ(18,11,"dialog.confirm")," "))},dependencies:[A.mk,A.sg,A.O5,w.YN,w.Kr,w.Fj,w.Wl,w.EJ,w.JJ,k.oB,w.On,ee.p,U.R,T.X$],styles:['.set-border-none[_ngcontent-%COMP%]{border:none!important}.header[_ngcontent-%COMP%]{color:#154baa}.required-field[_ngcontent-%COMP%]{color:red}.has-error[_ngcontent-%COMP%]{border:1px solid red!important;background:rgba(253,213,162,.4588235294)}.TA-number-field[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{padding:.3em .9em!important}.TA-number-field[_ngcontent-%COMP%] .post-addon[_ngcontent-%COMP%]{width:40%;height:100%}.TA-number-field[_ngcontent-%COMP%] .post-addon[_ngcontent-%COMP%] .btn-warning[_ngcontent-%COMP%]{width:100%;height:100%;margin-left:1px}.checkbox-container[_ngcontent-%COMP%]{cursor:pointer;font-size:20px;-webkit-user-select:none;user-select:none;position:absolute;top:3px}.checkbox-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{opacity:0;cursor:pointer;height:0;width:0;margin:0!important}.checkmark[_ngcontent-%COMP%]{position:absolute;height:.9em;width:.9em;background-color:#fff;border:thin solid #9c9c9c}.checkbox-container[_ngcontent-%COMP%]:hover input[_ngcontent-%COMP%] ~ .checkmark[_ngcontent-%COMP%]{border:thin solid #404040}.checkbox-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:checked ~ .checkmark[_ngcontent-%COMP%]{background-color:#fff;border:thin solid #6e6e6e}.checkmark[_ngcontent-%COMP%]:after{content:"";position:absolute;display:none}.checkbox-container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:checked ~ .checkmark[_ngcontent-%COMP%]:after{display:block}.checkbox-container[_ngcontent-%COMP%] .checkmark[_ngcontent-%COMP%]:after{left:.3em;top:.05em;width:.25em;height:.6em;border:solid #6e6e6e;border-width:0 .1em .1em 0;transform:rotate(45deg)}.check-label[_ngcontent-%COMP%]{font-weight:400;color:var(--neutral-gray1);margin-left:2em}']});var E=_(92340),oe=_(14576),D=_(77185);const qe=["importGenericModal"];function Je(i,o){if(1&i&&(e.TgZ(0,"span",13),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&i){const t=e.oxw();e.xp6(1),e.Oqu(e.lcZ(2,1,t.title))}}function Ue(i,o){1&i&&(e.TgZ(0,"div",14)(1,"div",15),e._uU(2),e.ALo(3,"translate"),e.qZA()()),2&i&&(e.xp6(2),e.hij("",e.lcZ(3,1,"resellermanagement.generalerror")," "))}function Qe(i,o){1&i&&(e.TgZ(0,"div",16),e._UZ(1,"app-loader",17),e.qZA()),2&i&&(e.xp6(1),e.Q6J("type",1))}function je(i,o){if(1&i&&(e.TgZ(0,"span",28),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&i){const t=e.oxw(2);e.xp6(1),e.Oqu(e.lcZ(2,1,t.message))}}const De=function(i){return{error:i}};function Re(i,o){if(1&i&&(e.TgZ(0,"span",29),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&i){const t=e.oxw(2);e.Q6J("ngClass",e.VKq(4,De,t.confirmed)),e.xp6(1),e.Oqu(e.lcZ(2,2,"resellermanagement.resellerprofile.pricelists.nofiles"))}}function Ge(i,o){if(1&i&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&i){const t=e.oxw(2);e.xp6(1),e.Oqu(t.file.name)}}function We(i,o){if(1&i&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&i){const t=e.oxw(4);e.xp6(1),e.AsE("",e.lcZ(2,2,"resellermanagement.csverror.data"),"\xa0",t.fileErrorRow,"")}}function Ye(i,o){if(1&i&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&i){const t=e.oxw(4);e.xp6(1),e.AsE("",e.lcZ(2,2,"resellermanagement.csverror.supplier"),"\xa0",t.fileErrorRow,"")}}function Fe(i,o){if(1&i&&(e.ynx(0),e.YNc(1,We,3,4,"span",26),e.YNc(2,Ye,3,4,"span",26),e.BQk()),2&i){const t=e.oxw(3);e.xp6(1),e.Q6J("ngIf",!t.fileErrorEntry),e.xp6(1),e.Q6J("ngIf","Supplier"==t.fileErrorEntry)}}function He(i,o){if(1&i&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&i){const t=e.oxw(4);e.xp6(1),e.AsE("",e.lcZ(2,2,"resellermanagement.csverror.data"),"\xa0",t.fileErrorRow,"")}}function Be(i,o){if(1&i&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&i){const t=e.oxw(4);e.xp6(1),e.AsE("",e.lcZ(2,2,"resellermanagement.csverror.supplier"),"\xa0",t.f
1ileErrorRow,"")}}function Ke(i,o){if(1&i&&(e.ynx(0),e.YNc(1,He,3,4,"span",26),e.YNc(2,Be,3,4,"span",26),e.BQk()),2&i){const t=e.oxw(3);e.xp6(1),e.Q6J("ngIf",!t.fileErrorEntry),e.xp6(1),e.Q6J("ngIf","Supplier"==t.fileErrorEntry)}}function Ve(i,o){if(1&i&&(e.TgZ(0,"div",30)(1,"div",15),e._uU(2),e.ALo(3,"translate"),e.YNc(4,Fe,3,2,"ng-container",26),e.YNc(5,Ke,3,2,"ng-container",26),e.qZA()()),2&i){const t=e.oxw(2);e.xp6(2),e.hij(" ",e.lcZ(3,3,"resellermanagement.hascsverror")," "),e.xp6(2),e.Q6J("ngIf",t.fileErrorType&&t.fileErrorRow&&"InvalidCSVData"==t.fileErrorType),e.xp6(1),e.Q6J("ngIf",t.fileErrorType&&t.fileErrorRow&&"InvalidSupplier"==t.fileErrorType)}}function $e(i,o){if(1&i){const t=e.EpF();e.TgZ(0,"div",18)(1,"div",19),e.YNc(2,je,3,3,"span",20),e.qZA(),e.TgZ(3,"div",19)(4,"input",21,22),e.NdJ("click",function(){e.CHM(t);const a=e.MAs(5);return e.KtG(a.value=null)})("change",function(a){e.CHM(t);const p=e.oxw();return e.KtG(p.onFileSelected(a.target.files))}),e.qZA(),e.TgZ(6,"button",23),e.NdJ("click",function(){e.CHM(t);const a=e.MAs(5);return e.KtG(a.click())}),e._uU(7),e.ALo(8,"translate"),e.qZA(),e.TgZ(9,"span",24),e.YNc(10,Re,3,6,"span",25),e.YNc(11,Ge,2,1,"span",26),e.qZA()(),e.YNc(12,Ve,6,5,"div",27),e.qZA()}if(2&i){const t=e.oxw();
1e.xp6(2),e.Q6J("ngIf",t.message),e.xp6(5),e.Oqu(e.lcZ(8,5,"resellermanagement.resellerprofile.pricelists.browse")),e.xp6(3),e.Q6J("ngIf",!t.fileUploaded),e.xp6(1),e.Q6J("ngIf",t.fileUploaded),e.xp6(1),e.Q6J("ngIf",t.hasFileError)}}const Xe=function(){return{backdrop:"static"}};class B extends v.V{constructor(o,t){super(),this.notificationService=o,this.partnerService=t,this.modalClosed=new e.vpe,this.fileUploaded=!1,this.hasFileError=!1}ngOnInit(){}cancel(){this.importGenericModal.hide(),null!=this.callback&&this.callback(b.X.Canceled)}showModal(o,t,r){this.hasError=!1,this.hasFileError=!1,this.fileErrorEntry=null,this.fileErrorRow=null,this.fileErrorType=null,this.isBusy=!1,this.confirmed=!1,this.file=null,this.fileUploaded=!1,this.contractType=o,this.contractId=t,this.importType=r;let a=new Promise((p,y)=>{this.callback=p});return this.importGenericModal.show(),a}confirm(){this.confirmed=!0,null!=this.file&&(this.SetLoading(!0),this.contractType==D.R.Partner&&this.importType==oe.Y.WarehouseStock?this.partnerService.importPartnerWarehouseStock(this.file,this.contractId).then(o=>{o?(this.importGenericModal.hide(),this.callback(b.X.Confirmed)):this.SetError("creation failed"),this.SetLoading(!1)}).catch(o=>{if(o&&o.error&&o.error.Errors){let t=o.error.Errors[0];if("InvalidCSVHeader"==t||"EmptyCSV"==t)this.hasFileError=!0,this.fileErrorEntry=null,this.fileErrorRow=null,this.fileErrorType=null;else if("InvalidCSVData"==t.split("-")[0]){this.hasFileError=!0;let r=t.split("-");this.fileErrorType=r[0],this.fileErrorRow=r[1],this.fileErrorEntry=r.length>2?r[2]:null}else if("InvalidSupplier"==t.split("-")[0]){this.hasFileError=!0;let r=t.split("-");this.fileErrorType=r[0],this.fileErrorRow=r[1],this.fileErrorEntry="Supplier"}}else this.SetError(o.errorMessage);this.SetLoading(!1)}):this.contractType==D.R.Reseller&&this.importType==oe.Y.WarehouseStock&&this.partnerService.importResellerWarehouseStock(this.file,this.contractId).then(o=>{o?(this.importGenericModal.hide(),this.callback(b.X.Confirmed)):this.SetError("creation failed"),this.SetLoading(!1)}).catch(o=>{if(o&&o.error&&o.error.Errors){let t=o.error.Errors[0];if("InvalidCSVHeader"==t||"EmptyCSV"==t)this.hasFileError=!0,this.fileErrorEntry=null,this.fileErrorRow=null,this.fileErrorType=null;else if("InvalidCSVData"==t.split("-")[0]){this.hasFileError=!0;let r=t.split("-");this.fileErrorType=r[0],this.fileErrorRow=r[1],this.fileErrorEntry=r.length>2?r[2]:null}else if("InvalidSupplier"==t.split("-")[0]){this.hasFileError=!0;let r=t.split("-");this.fileErrorType=r[0],this.fileErrorRow=r[1],this.fileErrorEntry="Supplier"}}else this.SetError(o.errorMessage);this.SetLoading(!1)}))}onFileSelected(o){if(this.hasFileError=!1,this.fileErrorEntry=null,this.fileErrorRow=null,this.fileErrorType=null,this.file=null,this.fileUploaded=!1,o&&1==o.length){let t=o[0];"application/vnd.ms-excel"!==t.type&&"text/csv"!==t.type||".csv"!=t.name.substr(t.name.length-4)?this.notificationService.showPushNotification(M.T.ResellerManagement.FileUploadFailed()):(this.file=t,this.fileUploaded=!0)}}}B.\u0275fac=function(o){return new(o||B)(e.Y36(n.g),e.Y36(I.b))},B.\u0275cmp=e.Xpm({type:B,selectors:[["app-import-generic-modal"]],viewQuery:function(o,t){if(1&o&&e.Gf(qe,5),2&o){let r;e.iGM(r=e.CRH())&&(t.importGenericModal=r.first)}},inputs:{title:"title",message:"message"},outputs:{modalClosed:"modalClosed"},features:[e.qOj],decls:17,vars:13,consts:[["bsModal","","tabindex","-1","role","dialog","aria-hidden","true",1,"modal","fade",3,"config"],["importGenericModal","bs-modal"],[1,"modal-dialog","modal
1-md"],[1,"modal-content"],[1,"modal-body"],[1,"col-xs-12","TA-info-box",2,"margin-bottom","20px"],["class","TA-sub-header-title",4,"ngIf"],["class","col-xs-12 TA-padding-0",4,"ngIf"],["class","col-xs-12 TA-padding-0","style","margin-bottom: 20px;",4,"ngIf"],["class","row",4,"ngIf"],[1,"modal-footer"],["type","button","aria-label","Cancel",1,"btn","btn-default","TA-cancel-btn",3,"click"],["type","button","aria-label","Confirm",1,"btn","btn-warning","set-border-none",3,"disabled","click"],[1,"TA-sub-header-title"],[1,"col-xs-12","TA-padding-0"],["role","alert",1,"alert","alert-danger"],[1,"col-xs-12","TA-padding-0",2,"margin-bottom","20px"],[2,"justify-content","center","display","flex",3,"type"],[1,"row"],[1,"col-xs-12"],["class","header",4,"ngIf"],["type","file",2,"display","none",3,"click","change"],["fileInput",""],[1,"btn","set-border-none","browse-btn",3,"click"],[1,"browse-text"],[3,"ngClass",4,"ngIf"],[4,"ngIf"],["class","col-xs-12","style","margin: 10px 0;",4,"ngIf"],[1,"header"],[3,"ngClass"],[1,"col-xs-12",2,"margin","10px 0"]],template:function(o,t){1&o&&(e.TgZ(0,"div",0,1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5),e.YNc(6,Je,3,3,"span",6),e.qZA(),e.YNc(7,Ue,4,3,"div",7),e.YNc(8,Qe,2,1,"div",8),e.YNc(9,$e,13,7,"div",9),e.qZA(),e.TgZ(10,"div",10)(11,"button",11),e.NdJ("click",function(){return t.cancel()}),e._uU(12),e.ALo(13,"translate"),e.qZA(),e.TgZ(14,"button",12),e.NdJ("click",function(){return t.confirm()}),e._uU(15),e.ALo(16,"translate"),e.qZA()()()()()),2&o&&(e.Q6J("config",e.DdM(12,Xe)),e.xp6(6),e.Q6J("ngIf",t.title),e.xp6(1),e.Q6J("ngIf",t.hasError),e.xp6(1),e.Q6J("ngIf",t.isBusy&&!t.hasError),e.xp6(1),e.Q6J("ngIf",!t.isBusy&&!t.hasError),e.xp6(3),e.hij(" ",e.lcZ(13,8,"dialog.cancel")," "),e.xp6(2),e.Q6J("disabled",t.hasError||t.hasFileError||t.isBusy),e.xp6(1),e.hij(" ",e.lcZ(16,10,"dialog.confirm")," "))},dependencies:[A.mk,A.O5,k.oB,U.R,T.X$],styles:[".browse-btn[_ngcontent-%COMP%]{color:#000;font-size:13px;margin-right:10px}.browse-btn[_ngcontent-%COMP%]:focus{outline:none}.browse-text[_ngcontent-%COMP%]{color:#000;font-size:13px}.has-error[_ngcontent-%COMP%]{border:1px solid red!important;background:rgba(253,213,162,.4588235294)}.error[_ngcontent-%COMP%]{color:red}"]});var ze=_(1049),et=_(76524);const tt=["suppliersModal"];function nt(i,o){1&i&&(e.TgZ(0,"div",13),e._UZ(1,"app-loader",14),e.qZA()),2&i&&(e.xp6(1),e.Q6J("type",1))}function ot(i,o){if(1&i&&(e.ynx(0),e.TgZ(1,"tr",16)(2,"td")(3,"div",19),e._UZ(4,"img",20),e.ALo(5,"brandLogo"),e.qZA()(),e.TgZ(6,"td")(7,"span"),e._uU(8),e.qZA()(),e.TgZ(9,"td")(10,"span"),e._uU(11),e.qZA()()(),e.BQk()),2&i){const t=o.$implicit;e.xp6(4),e.Q6J("src",e.lcZ(5,4,t.logoURL),e.LSH)("alt",t.altTag),e.xp6(4),e.Oqu(t.partnerName),e.xp6(3),e.Oqu(t.supplierNumber)}}function it(i,o){if(1&i&&(e.TgZ(0,"table",15)(1,"thead")(2,"tr",16)(3,"td",17),e._uU(4),e.ALo(5,"translate"),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.ALo(8,"translate"),e.qZA()()(),e.TgZ(9,"tbody"),e.YNc(10,ot,12,6,"ng-container",18),e.qZA()()),2&i){const t=e.oxw();e.xp6(4),e.hij(" ",e.lcZ(5,3,"resellermanagement.suppliers.brand")," "),e.xp6(3),e.hij(" ",e.lcZ(8,5,"resellermanagement.suppliers.supplier")," "),e.xp6(3),e.Q6J("ngForOf",t.brands)}}const rt=function(){return{backdrop:"static"}};class K extends v.V{constructor(){super(),this.modalClosed=new e.vpe,this.brands=[]}ngOnInit(){}confirm(){this.suppliersModal.hide(),this.callback(b.X.Confirmed)}cancel(){this.suppliersModal.hide(),null!=this.callback&&this.callback(b.X.Canceled)}showModal(o){this.brands=o&&o.length>0?o:[];let t=new Promise((r,a)=>{this.callback=r});return this.suppliersModal.show(),t}}K.\u0275fac=function(o){return new(o||K)},K.\u0275cmp=e.Xpm({type:K,selectors:[["app-suppliers-modal"]],viewQuery:function(o,t){if(1&o&&e.Gf(tt,5),2&o){let r;e.iGM(r=e.CRH())&&(t.suppliersModal=r.first)}},outputs:{modalClosed:"modalClosed"},features:[e.qOj],decls:17,vars:10,consts:[["bsModal","","tabindex","-1","role","dialog","aria-hidden","true",1,"modal","fade",3,"config"],["suppliersModal","bs-modal"],[1,"modal-dialog","modal
1-md"],[1,"modal-content"],[1,"modal-body"],[1,"col-xs-12","TA-info-box",2,"margin-bottom","20px"],[1,"TA-sub-header-title"],["class","col-xs-12 TA-padding-0","style","margin-bottom: 20px;",4,"ngIf"],[1,"col-md-12","TA-padding-0"],["class","table TA-table","style","margin: 0 0 20",4,"ngIf"],[1,"row"],[1,"modal-footer"],["type","button","aria-label","Cancel",1,"btn","btn-default","TA-cancel-btn","cancel-btn",3,"click"],[1,"col-xs-12","TA-padding-0",2,"margin-bottom","20px"],[2,"justify-content","center","display","flex",3,"type"],[1,"table","TA-table",2,"margin","0 0 20"],[2,"border-collapse","collapse","border","none"],["colspan","2"],[4,"ngFor","ngForOf"],[1,"col-xs-12"],["onerror","this.onerror=null;src='/../../assets/image-not-found.svg';",1,"brand-img",3,"src","alt"]],template:function(o,t){1&o&&(e.TgZ(0,"div",0,1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5)(6,"span",6),e._uU(7),e.ALo(8,"translate"),e.qZA()(),e.YNc(9,nt,2,1,"div",7),e.TgZ(10,"div",8),e.YNc(11,it,11,7,"table",9),e.qZA(),e.TgZ(12,"div",10)(13,"div",11)(14,"button",12),e.NdJ("click",function(){return t.cancel()}),e._uU(15),e.ALo(16,"translate"),e.qZA()()()()()()()),2&o&&(e.Q6J("config",e.DdM(9,rt)),e.xp6(7),e.Oqu(e.l
1cZ(8,5,"resellermanagement.suppliers.title")),e.xp6(2),e.Q6J("ngIf",t.isBusy&&!t.hasError),e.xp6(2),e.Q6J("ngIf",!t.isBusy&&t.brands&&t.brands.length>0),e.xp6(4),e.hij(" ",e.lcZ(16,7,"dialog.close")," "))},dependencies:[A.sg,A.O5,k.oB,U.R,T.X$,et.k],styles:[".brand-img[_ngcontent-%COMP%]{max-height:50px;max-width:90%;height:auto;width:auto;margin:auto;display:block}.cancel-btn[_ngcontent-%COMP%]{border:1px solid!important;border-color:var(--secondary-blue3)!important}"]});var at=_(93663),q=_(32831);const st=["warehouseModal"],lt=["deliveryLabelModal"],ct=["importGenericModal"],dt=["deleteModal"],pt=["paginationComponent"],_t=["importsHistory"],gt=["suppliersModal"];function mt(i,o){1&i&&(e.TgZ(0,"div",13)(1,"h1",14),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.TgZ(4,"span"),e._uU(5),e.ALo(6,"translate"),e.qZA()()),2&i&&(e.xp6(2),e.hij(" ",e.lcZ(3,2,"stockmanagement.warehouselogistics"),""),e.xp6(3),e.Oqu(e.lcZ(6,4,"stockmanagement.message")))}const ut=function(i){return{"tab-heading-2":i}},V=function(i){return{active:i}};function ht(i,o){if(1&i){const t=e.EpF();e.TgZ(0,"div",15)(1,"ul",16)(2,"li",17),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.infoTab=1)}),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.TgZ(5,"li",17),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.infoTab=2)}),e._uU(6),e.ALo(7,"translate"),e.qZA(),e.TgZ(8,"li",17),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.infoTab=3)}),e._uU(9),e.ALo(10,"translate"),e.qZA()()()}if(2&i){const t=e.oxw();e.xp6(1),e.Q6J("ngClass",e.VKq(13,ut,t.resellerId>0)),e.xp6(1),e.Q6J("ngClass",e.VKq(15,V,1==t.infoTab)),e.xp6(1),e.hij(" ",e.lcZ(4,7,"stockmanagement.warehouses.title")," "),e.xp6(2),e.Q6J("ngClass",e.VKq(17,V,2==t.infoTab)),e.xp6(1),e.hij(" ",e.lcZ(7,9,"stockmanagement.imports.title")," "),e.xp6(2),e.Q6J("ngClass",e.VKq(19,V,3==t.infoTab)),e.xp6(1),e.hij(" ",e.lcZ(10,11,"stockmanagement.deliverylabels.title")," ")}}function ft(i,o){1&i&&(e.TgZ(0,"div",20),e._UZ(1,"app-loader",21),e.qZA()),2&i&&(e.xp6(1),e.Q6J("type",2)("message","loadermessage.dealerwarehouse"))}function bt(i,o){if(1&i&&(e.ynx(0),e.YNc(1,ft,2,2,"div",19),e.BQk()),2&i){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.loadingWarehouses)}}function vt(i,o){if(1&i&&(e.TgZ(0,"div")(1,"span",35),e._uU(2),e.qZA(),e._uU(3),e.ALo(4,"country"),e.qZA()),2&i){const t=o.$implicit,r=e.oxw(6);e.xp6(2),e.hij("",r.getWarehouseDefaultLabel(t),":"),e.xp6(1),e.hij(" ",e.xi3(4,2,t.countryId,"name")," ")}}function xt(i,o){if(1&i&&(e.ynx(0),e.YNc(1,vt,5,5,"div",31),e.BQk()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",t.regions)}}function yt(i,o){if(1&i){const t=e.EpF();e.TgZ(0,"i",36),e.NdJ("click",function(){e.CHM(t);const a=e.oxw().$implicit,p=e.oxw(4);return e.KtG(p.deleteWarehouse(a.id))}),e.ALo(1,"translate"),e.qZA()}2&i&&e.Q6J("tooltip",e.lcZ(1,1,"stockmanagement.warehouses.tooltip.delete"))}function Ct(i,o){if(1&i){const t=e.EpF();e.TgZ(0,"a",37),e.NdJ("click",function(){e.CHM(t);const a=e.oxw().$implicit,p=e.oxw(4);return e.KtG(p.activateWarehouse(a))}),e._uU(1),e.ALo(2,"translate"),e.qZA()}2&i&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"stockmanagement.warehouses.activate")))}function Zt(i,o){if(1&i){const t=e.EpF();e.ynx(0),e.TgZ(1,"tr",28)(2,"td"),e._uU(3),e.qZA(),e.TgZ(4,"td"),e._uU(5),e.qZA(),e.TgZ(6,"td"),e.YNc(7,xt,2,1,"ng-container",6),e.qZA(),e.TgZ(8,"td")(9,"i",32),e.NdJ("click",function(){const p=e.CHM(t).$implicit,y=e.oxw(4);return e.KtG(y.updateWarehouse(p))}),e.ALo(10,"translate"),e.qZA(),e.YNc(11,yt,2,3,"i",33),e.YNc(12,Ct,3,3,"a",34),e.qZA()(),e.BQk()}if(2&i){const t=o.$implicit,r=e.oxw(4);e.xp6(3),e.hij(" ",t.number," "),e.xp6(2),e.hij(" ",t.name," "),e.xp6(2),e.Q6J("ngIf",t.regions&&t.regions.length>0),e.xp6(2),e.Q6J("tooltip",e.lcZ(10,6,"stockmanagement.warehouses.tooltip.edit")),e.xp6(2),e.Q6J("ngIf",t.isActive),e.xp6(1),e.Q6J("ngIf",r.admin&&!t.isActive)}}function Mt(i,o){if(1&i&&(e.TgZ(0,"table",27)(1,"thead")(2,"tr",28)(3,"td",29),e._uU(4),e.ALo(5,"translate"),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.ALo(8,"translate"),e.qZA(),e.TgZ(9,"td"),e._uU(10),e.ALo(11,"translate"),e.qZA(),e.TgZ(12,"td",30),e._uU(13),e.ALo(14,"translate"),e.qZA()()(),e.TgZ(15,"tbody"),e.YNc(16,Zt,13,8,"ng-container",31),e.qZA()()),2&i){const t=e.oxw(3);e.xp6(4),e.hij(" ",e.lcZ(5,5,"stockmanagement.warehouses.id")," "),e.xp6(3),e.hij(" ",e.lcZ(8,7,"stockmanagement.warehouses.name")," "),e.xp6(3),e.hij(" ",e.lcZ(11,9,"stockmanagement.warehouses.deliverylabel")," "),e.xp6(3),e.hij(" ",e.lcZ(14,11,"stockmanagement.warehouses.actions")," "),e.xp6(3),e.Q6J("ngForOf",t.shownWarehouses)}}function Tt(i,o){1&i&&(e.TgZ(0,"table",27)(1,"thead")(2,"tr",28)(3,"td",29),e._uU(4),e.ALo(5,"translate"),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.ALo(8,"translate"),e.qZA(),e.TgZ(9,"td"),e._uU(10),e.ALo(11,"translate"),e.qZA(),e.TgZ(12,"td",30),e._uU(13),e.ALo(14,"translate"),e.qZA()()(),e.TgZ(15,"tbody"),e.ynx(16),e.TgZ(17,"tr",38),e._UZ(18,"td")(19,"td")(20,"td")(21,"td"),e.qZA(),e.BQk(),e.qZA()()),2&i&&(e.xp6(4),e.hij(" ",e.lcZ(5,4,"stockmanagement.warehouses.id")," "),e.xp6(3),e.hij(" ",e.lcZ(8,6,"stockmanagement.warehouses.name")," "),e.xp6(3),e.hij(" ",e.lcZ(11,8,"stockmanagement.warehouses.deliverylabel")," "),e.xp6(3),e.hij(" ",e.lcZ(14,10,"stockmanagement.warehouses.actions")," "))}function At(i,o){if(1&i){const t=e.EpF();e.TgZ(0,"div")(1,"app-pagination",39),e.NdJ("onPaginationChange",function(a){e.CHM(t);const p=e.oxw(3);return e.KtG(p.onPaginationChangeForWarehouses(a))}),e.qZA()()}if(2&i){const t=e.oxw(3);e.xp6(1),e.Q6J("totalItems",t.warehouses.length)}}function wt(i,o){if(1&i){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",22)(2,"button",23),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(2);return e.KtG(a.addWarehouse())}),e._UZ(3,"img",24),e._uU(4),e.ALo(5,"translate"),e.qZA()(),e.TgZ(6,"div",22)(7,"div",25),e.YNc(8,Mt,17,13,"table",26),e.YNc(9,Tt,22,12,"table",26),e.YNc(10,At,2,1,"div",6),e.qZA()(),e.BQk()}if(2&i){const t=e.oxw(2);e.xp6(4),e.hij("\xa0",e.lcZ(5,4,"stockmanagement.warehouses.add"),""),e.xp6(4),e.Q6J("ngIf",!t.isBusy&&t.shownWarehouses&&t.shownWarehouses.length>0),e.xp6(1),e.Q6J("ngIf",!t.shownWarehouses||0==t.shownWarehouses.length),e.xp6(1),e.Q6J("ngIf",!t.isBusy&&t.warehouses&&t.warehouses.length>0)}}function It(i,o){if(1&i&&(e.TgZ(0,"div")(1,"div",18),e.YNc(2,bt,2,1,"ng-container",6),e.YNc(3,wt,11,6,"ng-container",6),e.qZA()()),2&i){const t=e.oxw();e.xp6(2),e.Q6J("ngIf",t.loadingWarehouses),e.xp6(1),e.Q6J("ngIf",!t.loadingWarehouses)}}function Lt(i,o){1&i&&(e.TgZ(0,"div",20),e._UZ(1,"app-loader",21),e.qZA()),2&i&&(e.xp6(1),e.Q6J("type",2)("message","loadermessage.dealerstockimports"))}function kt(i,o){if(1&i&&(e.ynx(0),e.YNc(1,Lt,2,2,"div",19),e.BQk()),2&i){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.loadingImport)}}function St(i,o){1&i&&(e.TgZ(0,"div",22),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&i&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"stockmanagement.imports.requirewarehouse")," "))}function Ot(i,o){if(1&i){const t=e.EpF();e.TgZ(0,"div",2)(1,"div",50),e._uU(2),e.ALo(3,"translate"),e.qZA(),e.TgZ(4,"div",53)(5,"button",51),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(4);return e.KtG(a.showSuppliers())}),e._uU(6),e.ALo(7,"translate"),e.qZA()()()}2&i&&(e.xp6(2),e.hij(" ",e.lcZ(3,2,"resellermanagement.suppliers.header")," "),e.xp6(4),e.hij(" ",e.lcZ(7,4,"resellermanagement.suppliers.suppliersbutton")," "))}function Et(i,o){if(1&i){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",0)(2,"div",22)(3,"div",22)(4,"span"),e._uU(5),e.ALo(6,"translate"),e.qZA(),e.TgZ(7,"a",41),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(3);return e.KtG(a.downloadTemplate())}),e.TgZ(8,"strong"),e._uU(9),e.ALo(10,"translate"),e.qZA()(),e.TgZ(11,"span"),e._uU(12),e.ALo(13,"translate"),e.qZA()()(),e.TgZ(14,"div",42)(15,"div",43)(16,"div",44)(17,"button",45),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(3);return e.KtG(a.downloadTemplate())}),e._UZ(18,"i",46),e.qZA(),e.TgZ(19,"div",47),e._uU(20),e.ALo(21,"translate"),e.qZA()()(),e.TgZ(22,"div",43)(23,"div",44)(24,"button",45),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(3);return e.KtG(a.uploadFile())}),e._UZ(25,"i",48),e.qZA(),e.TgZ(26,"div",47),e._uU(27),e.ALo(28,"translate"),e.qZA()()()(),e.TgZ(29,"div",49)(30,"div",50)(31,"button",51),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(3);return e.KtG(a.showHistory())}),e._uU(32),e.ALo(33,"translate"),e.qZA()(),e.YNc(34,Ot,8,6,"div",52),e.qZA()(),e.BQk()}if(2&i){const t=e.oxw(3);e.xp6(5),e.hij("",e.lcZ(6,7,"stockmanagement.imports.message1")," "),e.xp6(4),e.Oqu(e.l
1cZ(10,9,"stockmanagement.imports.template")),e.xp6(3),e.Oqu(e.lcZ(13,11,"stockmanagement.imports.message2")),e.xp6(8),e.hij(" ",e.lcZ(21,13,"stockmanagement.imports.downloadtemplate")," "),e.xp6(7),e.hij(" ",e.lcZ(28,15,"stockmanagement.imports.uploadstock")," "),e.xp6(5),e.hij(" ",e.lcZ(33,17,"resellermanagement.listprices.history")," "),e.xp6(2),e.Q6J("ngIf",t.resellerId&&t.resellerBrands&&t.resellerBrands.length>0)}}function Nt(i,o){if(1&i&&(e.ynx(0),e.YNc(1,St,3,3,"div",40),e.YNc(2,Et,35,19,"ng-container",6),e.BQk()),2&i){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",!t.hasWarehouses),e.xp6(1),e.Q6J("ngIf",t.hasWarehouses)}}function Pt(i,o){if(1&i&&(e.TgZ(0,"div")(1,"div",18),e.YNc(2,kt,2,1,"ng-container",6),e.YNc(3,Nt,3,2,"ng-container",6),e.qZA()()),2&i){const t=e.oxw();e.xp6(2),e.Q6J("ngIf",t.loadingImport),e.xp6(1),e.Q6J("ngIf",!t.loadingImport)}}function qt(i,o){1&i&&(e.TgZ(0,"div",20),e._UZ(1,"app-loader",21),e.qZA()),2&i&&(e.xp6(1),e.Q6J("type",2)("message","loadermessage.dealerdeliverylabels"))}function Jt(i,o){if(1&i&&(e.ynx(0),e.YNc(1,qt,2,2,"div",19),e.BQk()),2&i){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.loadingDeliveryLabels)}}function Ut(i,o){if(1&i){const t=e.EpF();e.TgZ(0,"div",55)(1,"ul",56)(2,"li",17),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(3);return e.KtG(a.changeTab(a.instanceFilterEnum.Global))}),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.TgZ(5,"li",17),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(3);return e.KtG(a.changeTab(a.instanceFilterEnum.Region))}),e._uU(6),e.ALo(7,"translate"),e.qZA()()()}if(2&i){const t=e.oxw(3);e.xp6(2),e.Q6J("ngClass",e.VKq(8,V,t.instanceFilter==t.instanceFilterEnum.Global)),e.xp6(1),e.hij(" ",e.lcZ(4,4,"downloadcentre.global")," "),e.xp6(2),e.Q6J("ngClass",e.VKq(10,V,t.instanceFilter==t.instanceFilterEnum.Region)),e.xp6(1),e.hij(" ",e.lcZ(7,6,"downloadcentre.region")," ")}}function Qt(i,o){1&i&&(e.TgZ(0,"div",22),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&i&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"stockmanagement.deliverylabels.requirewarehouse")," "))}function jt(i,o){1&i&&(e.ynx(0),e._uU(1,"\xa0"),e.BQk())}function Dt(i,o){if(1&i){const t=e.EpF();e.ynx(0),e.TgZ(1,"button",59),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(4);return e.KtG(a.addDeliveryLabel())}),e._UZ(2,"i",60),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.BQk()}2&i&&(e.xp6(3),e.hij("\xa0",e.lcZ(4,1,"stockmanagement.deliverylabels.add"),""))}function Rt(i,o){1&i&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&i&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"stockmanagement.deliverylabels.days")," "))}function Gt(i,o){1&i&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&i&&(e.xp6(1),e.hij(" ",e.lcZ(2,1,"stockmanagement.deliverylabels.weeks")," "))}function Wt(i,o){1&i&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&i&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"stockmanagement.deliverylabels.active")))}function Yt(i,o){1&i&&(e.TgZ(0,"span"),e._uU(1),e.ALo(2,"translate"),e.qZA()),2&i&&(e.xp6(1),e.Oqu(e.lcZ(2,1,"stockmanagement.deliverylabels.disabled")))}const be=function(i){return{disabled:i}};function Ft(i,o){if(1&i){const t=e.EpF();e.ynx(0),e.TgZ(1,"i",63),e.NdJ("click",function(){e.CHM(t);const a=e.oxw().$implicit,p=e.oxw(6);return e.KtG(p.copyDeliveryLabel(a.id))}),e.ALo(2,"translate"),e.qZA(),e.BQk()}if(2&i){const t=e.oxw(7);e.xp6(1),e.Q6J("tooltip",e.lcZ(2,2,"stockmanagement.warehouses.tooltip.copy"))("ngClass",e.VKq(4,be,!t.isGlobalInstance&&t.instanceFilter!=t.instanceFilterEnum.Global))}}function Ht(i,o){if(1&i){const t=e.EpF();e.ynx(0),e.TgZ(1,"tr",28)(2,"td"),e._uU(3),e.qZA(),e.TgZ(4,"td"),e._uU(5),e.YNc(6,Rt,3,3,"span",6),e.YNc(7,Gt,3,3,"span",6),e.qZA(),e.TgZ(8,"td"),e.YNc(9,Wt,3,3,"span",6),e.YNc(10,Yt,3,3,"span",6),e.qZA(),e.TgZ(11,"td")(12,"i",61),e.NdJ("click",function(){const p=e.CHM(t).$implicit,y=e.oxw(6);return e.KtG(y.updateDeliveryLabel(p))}),e.ALo(13,"translate"),e.qZA(),e.TgZ(14,"i",62),e.NdJ("click",function(){const p=e.CHM(t).$implicit,y=e.oxw(6);return e.KtG(y.deleteDeliveryLabel(p.id))}),e.ALo(15,"translate"),e.qZA(),e.YNc(16,Ft,3,6,"ng-container",6),e.qZA()(),e.BQk()}if(2&i){const t=o.$implicit,r=e.oxw(6);e.xp6(3),e.hij(" ",t.number," "),e.xp6(2),e.hij(" ",t.value,"\xa0"),e.xp6(1),e.Q6J("ngIf",t.type==r.deliveryLabelType.Days),e.xp6(1),e.Q6J("ngIf",t.type==r.deliveryLabelType.Weeks),e.xp6(2),e.Q6J("ngIf",t.isActive),e.xp6(1),e.Q6J("ngIf",!t.isActive),e.xp6(2),e.Q6J("tooltip",e.lcZ(13,11,"stockmanagement.warehouses.tooltip.edit"))("ngClass",e.VKq(15,be,!r.isGlobalInstance&&r.instanceFilter!=r.instanceFilterEnum.Region)),e.xp6(2),e.Q6J("tooltip",e.lcZ(15,13,"stockmanagement.warehouses.tooltip.delete"))("ngClass",e.VKq(17,be,!r.isGlobalInstance&&r.instanceFilter!=r.instanceFilterEnum.Region)),e.xp6(2),e.Q6J("ngIf",!r.isGlobalInstance)}}function Bt(i,o){if(1&i&&(e.ynx(0),e.YNc(1,Ht,17,19,"ng-container",31),e.BQk()),2&i){const t=e.oxw(5);e.xp6(1),e.Q6J("ngForOf",t.shownDeliveryLabels)}}function Kt(i,o){1&i&&(e.ynx(0),e.TgZ(1,"tr",64),e._UZ(2,"td")(3,"td")(4,"td")(5,"td"),e.qZA(),e.BQk())}function Vt(i,o){if(1&i&&(e.TgZ(0,"table",27)(1,"thead")(2,"tr",28)(3,"td",29),e._uU(4),e.ALo(5,"translate"),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.ALo(8,"translate"),e.qZA(),e.TgZ(9,"td"),e._uU(10),e.ALo(11,"translate"),e.qZA(),e.TgZ(12,"td",30),e._uU(13),e.ALo(14,"translate"),e.qZA()()(),e.TgZ(15,"tbody"),e.YNc(16,Bt,2,1,"ng-container",6),e.YNc(17,Kt,6,0,"ng-container",6),e.qZA()()),2&i){const t=e.oxw(4);e.xp6(4),e.hij(" ",e.lcZ(5,6,"stockmanagement.deliverylabels.id")," "),e.xp6(3),e.hij(" ",e.lcZ(8,8,"stockmanagement.deliverylabels.value")," "),e.xp6(3),e.hij(" ",e.lcZ(11,10,"stockmanagement.deliverylabels.state")," "),e.xp6(3),e.hij(" ",e.lcZ(14,12,"stockmanagement.deliverylabels.actions")," "),e.xp6(3),e.Q6J("ngIf",t.shownDeliveryLabels&&t.shownDeliveryLabels.length>0),e.xp6(1),e.Q6J("ngIf",!t.shownDeliveryLabels||t.shownDeliveryLabels.length<1)}}function $t(i,o){if(1&i){const t=e.EpF();e.TgZ(0,"div")(1,"app-pagination",39),e.NdJ("onPaginationChange",function(a){e.CHM(t);const p=e.oxw(4);return e.KtG(p.onPaginationChangeForDeliveryLabels(a))}),e.qZA()()}if(2&i){const t=e.oxw(4);e.xp6(1),e.Q6J("totalItems",t.deliveryLabels.length)}}function Xt(i,o){if(1&i){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",22)(2,"span"),e._uU(3),e.ALo(4,"translate"),e.qZA(),e.TgZ(5,"a",41),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(3);return e.KtG(a.infoTab=2)}),e.TgZ(6,"strong"),e._uU(7),e.ALo(8,"translate"),e.qZA()(),e.TgZ(9,"span"),e.YNc(10,jt,2,0,"ng-container",6),e._uU(11),e.ALo(12,"translate"),e.qZA()(),e.TgZ(13,"div",57),e.YNc(14,Dt,5,3,"ng-container",6),e.qZA(),e.TgZ(15,"div",22)(16,"div",58),e.YNc(17,Vt,18,14,"table",26),e.YNc(18,$t,2,1,"div",6),e.qZA()(),e.BQk()}if(2&i){const t=e.oxw(3);e.xp6(3),e.hij("",e.lcZ(4,7,"stockmanagement.deliverylabels.message1")," "),e.xp6(4),e.Oqu(e.l
1cZ(8,9,"stockmanagement.deliverylabels.list")),e.xp6(3),e.Q6J("ngIf","de-DE"==t.culture),e.xp6(1),e.hij(" ",e.lcZ(12,11,"stockmanagement.deliverylabels.message2")," "),e.xp6(3),e.Q6J("ngIf",t.isGlobalInstance||!t.isGlobalInstance&&t.instanceFilter==t.instanceFilterEnum.Region),e.xp6(3),e.Q6J("ngIf",!t.isBusy),e.xp6(1),e.Q6J("ngIf",!t.isBusy&&t.deliveryLabels&&t.deliveryLabels.length>0)}}function zt(i,o){if(1&i&&(e.ynx(0),e.YNc(1,Ut,8,12,"div",54),e.YNc(2,Qt,3,3,"div",40),e.YNc(3,Xt,19,13,"ng-container",6),e.BQk()),2&i){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",!t.isGlobalInstance),e.xp6(1),e.Q6J("ngIf",!t.hasWarehouses&&(!t.shownDeliveryLabels||t.shownDeliveryLabels.length<1)),e.xp6(1),e.Q6J("ngIf",t.hasWarehouses||t.shownDeliveryLabels&&t.shownDeliveryLabels.length>0)}}function en(i,o){if(1&i&&(e.TgZ(0,"div")(1,"div",18),e.YNc(2,Jt,2,1,"ng-container",6),e.YNc(3,zt,4,3,"ng-container",6),e.qZA()()),2&i){const t=e.oxw();e.xp6(2),e.Q6J("ngIf",t.loadingDeliveryLabels),e.xp6(1),e.Q6J("ngIf",!t.loadingDeliveryLabels)}}class $ extends v.V{constructor(o,t,r,a){super(),this.partnerService=o,this.translateService=t,this.contentService=r,this.notificationService=a,this.partnerId=0,this.resellerId=0,this.admin=!1,this.tabNumber=0,this.hideHeader=!1,this.warehouses=[],this.shownWarehouses=[],this.deliveryLabels=[],this.allDeliveryLabels=[],this.shownDeliveryLabels=[],this.deliveryLabelType=C.T,this.resellerBrands=[],this.loadingWarehouses=!1,this.loadingDeliveryLabels=!1,this.loadingImport=!1,this.hasWarehouses=!1,this.isGlobalInstance=!0,this.instanceId=E.N.regionId,this.globalInstanceId=E.N.regionId,this.instanceFilter=q._.All,this.instanceFilterEnum=q._}ngOnInit(){this.culture=this.translateService.currentLang,this.translateSubscription=this.translateService.onLangChange.subscribe(o=>this.onLanguageChanged.call(this,o)),this.infoTab=this.admin&&this.tabNumber>0?this.tabNumber:1,this.partnerId=Number(this.partnerId),this.resellerId=Number(this.resellerId),this.getRegions().then(()=>{this.initialize()}).catch(o=>{this.initialize()})}initialize(){this.getWarehoues(),this.getDeliveryLabels(),this.resellerId&&this.getResellerBrands()}ngOnDestroy(){this.translateSubscription&&this.translateSubscription.unsubscribe()}changeTab(o=q._.All){this.deliveryLabels=[],this.shownDeliveryLabels=[],this.SetLoading(!0),this.instanceFilter=o,this.loadDeliveryLabel(this.allDeliveryLabels,this.instanceFilter==q._.Global?this.globalInstanceId:E.N.regionId),this.onPaginationChangeForDeliveryLabels({offset:0,itemsPerPage:E.N.defaultItemsPerPage}),this.SetLoading(!1)}getRegions(){return this.SetLoading(!0),new Promise((o,t)=>{this.contentService.getRegions().then(r=>{this.SetLoading(!1),r&&(this.isGlobalInstance=r.find(a=>a.id==E.N.regionId)?.isGlobal,this.globalInstanceId=r.find(a=>a.isGlobal)?.id,this.isGlobalInstance||(this.instanceFilter=q._.Global)),o(!0)}).catch(r=>{this.SetLoading(!1),this.SetError(r.errorMessage),o(!0)})})}onLanguageChanged(o){this.culture!=o.lang&&(this.culture=o.lang)}getWarehoues(){this.hasWarehouses=!1,this.warehouses=[],this.shownWarehouses=[],this.loadingWarehouses=!0,this.partnerId?this.partnerService.getPartnerWarehouses(this.partnerId).then(o=>{this.loadingWarehouses=!1,o&&o.length>0&&(this.warehouses=this.admin?o:o.filter(t=>t.isActive),this.warehouses.sort((t,r)=>r.id-t.id),this.hasWarehouses=null!=o.find(t=>t.isActive))}).catch(o=>{this.loadingWarehouses=!1,console.log(o)}):this.resellerId&&this.partnerService.getResellerWarehouses(this.resellerId).then(o=>{this.loadingWarehouses=!1,o&&o.length>0&&(this.warehouses=this.admin?o:o.filter(t=>t.isActive),this.warehouses.sort((t,r)=>r.id-t.id),this.hasWarehouses=null!=o.find(t=>t.isActive))}).catch(o=>{this.loadingWarehouses=!1,console.log(o)})}getResellerBrands(){this.loadingImport=!0,this.partnerService.getResellerBrands(this.resellerId).then(o=>{this.loadingImport=!1,o&&o.length>0&&(this.resellerBrands=o)}).catch(o=>{this.loadingImport=!1,console.log(o)})}addWarehouse(){let o=new G;o.partnerId=this.partnerId?this.partnerId:null,o.resellerId=this.resellerId?this.resellerId:null,this.warehouseModal.showModal(o).then(t=>{t==b.X.Confirmed&&this.getWarehoues()}).catch(t=>console.log(t))}updateWarehouse(o){this.warehouseModal.showModal(JSON.parse(JSON.stringify(o))).then(t=>{t==b.X.Confirmed&&this.getWarehoues()}).catch(t=>console.log(t))}deleteWarehouse(o){this.deleteModal.title="dialog.delete",this.deleteModal.message="dialog.deletemodaltext",this.deleteModal.showconfirmBtn=!0,this.deleteModal.showcancelBtn=!0,this.deleteModal.dialogSeverity=xe.l.Warning,this.deleteModal.showChildModal().then(t=>{t==b.X.Confirmed&&(this.loadingWarehouses=!0,this.partnerId?this.partner
1Service.deletePartnerWarehouse(o,this.partnerId).then(r=>{this.getWarehoues()}).catch(r=>{this.SetError(r.errorMessage),this.loadingWarehouses=!1}):this.resellerId&&this.partnerService.deleteResellerWarehouse(o,this.resellerId).then(r=>{this.getWarehoues()}).catch(r=>{this.SetError(r.errorMessage),this.loadingWarehouses=!1}))})}loadDeliveryLabel(o=[],t){this.deliveryLabels=o.filter(r=>r.instanceId==t).sort((r,a)=>a.id-r.id)}getDeliveryLabels(){this.deliveryLabels=[],this.shownDeliveryLabels=[],this.loadingDeliveryLabels=!0;let o=this.instanceFilter==q._.Global?this.globalInstanceId:E.N.regionId;this.partnerId?this.partnerService.getPartnerDeliveryLabels(this.partnerId,!0).then(t=>{this.loadingDeliveryLabels=!1,t&&t.length>0&&(this.allDeliveryLabels=t.sort((r,a)=>a.id-r.id),this.loadDeliveryLabel(t,o))}).catch(t=>{this.loadingDeliveryLabels=!1,console.log(t)}):this.resellerId&&this.partnerService.getResellerDeliveryLabels(this.resellerId,!0).then(t=>{this.loadingDeliveryLabels=!1,t&&t.length>0&&this.loadDeliveryLabel(t,o)}).catch(t=>{this.loadingDeliveryLabels=!1,console.log(t)})}addDeliveryLabel(){let o=new C.Z;o.partnerId=this.partnerId?this.partnerId:null,o.resellerId=this.resellerId?this.resellerId:null,o.type=C.T.Days,this.deliveryLabelModal.showModal(o).then(t=>{t==b.X.Confirmed&&this.getDeliveryLabels()}).catch(t=>console.log(t))}updateDeliveryLabel(o){this.deliveryLabelModal.showModal(o).then(t=>{t==b.X.Confirmed&&this.getDeliveryLabels()}).catch(t=>console.log(t))}copyDeliveryLabel(o){let t=this.deliveryLabels.find(a=>a.id==o),r=new C.Z;r.partnerId=this.partnerId?this.partnerId:null,r.resellerId=this.resellerId?this.resellerId:null,r.type=t.type,r.value=t.value,r.id=0,r.isActive=t.isActive,r.instanceId=E.N.regionId,r.number=t.number,this.partnerId?this.partnerService.createPartnerDeliveryLabel(r).then(a=>{this.instanceFilter=q._.Region,this.getDeliveryLabels()}).catch(a=>{this.SetError(a.errorMessage),this.loadingDeliveryLabels=!1}):this.resellerId&&this.partnerService.createResellerDeliveryLabel(r).then(a=>{this.instanceFilter=q._.Region,this.getDeliveryLabels()}).catch(a=>{this.SetError(a.errorMessage),this.loadingDeliveryLabels=!1})}deleteDeliveryLabel(o){this.deleteModal.title="dialog.delete",this.deleteModal.message="dialog.deletemodaltext",this.deleteModal.showconfirmBtn=!0,this.deleteModal.showcancelBtn=!0,this.deleteModal.dialogSeverity=xe.l.Warning,this.deleteModal.showChildModal().then(t=>{t==b.X.Confirmed&&(this.loadingDeliveryLabels=!0,this.partnerId?this.partnerService.deletePartnerDeliveryLabel(o,this.partnerId).then(r=>{this.getDeliveryLabels()}).catch(r=>{this.SetError(r.errorMessage),this.loadingDeliveryLabels=!1}):this.resellerId&&this.partnerService.deleteResellerDeliveryLabel(o,this.resellerId).then(r=>{this.getDeliveryLabels()}).catch(r=>{this.SetError(r.errorMessage),this.loadingDeliveryLabels=!1}))})}downloadTemplate(){if(this.IsBrowser()){let o=this.partnerId?E.N.PartnerAssetsCDNBaseUri+"Stock/Template/StockTemplate.csv":this.resellerId?E.N.PartnerAssetsCDNBaseUri+"Stock/Template/ResellerStockTemplate.csv":null;if(o){let t=document.createElement("a");t.setAttribute("type","hidden"),t.href=o,document.body.appendChild(t),t.click(),t.remove()}}}uploadFile(){this.importGenericModal.title="stockmanagement.imports.modal.title",this.importGenericModal.message="stockmanagement.imports.modal.note",this.importGenericModal.showModal(this.partnerId>0?D.R.Partner:D.R.Reseller,this.partnerId>0?this.partnerId:this.resellerId,oe.Y.WarehouseStock).then(r=>{r==b.X.Confirmed&&this.notificationService.showPushNotification(M.T.Common.SaveSuccess())}).catch(r=>{this.notificationService.showPushNotification(M.T.Common.SaveError())})}getWarehouseDefaultLabel(o){if(o&&o.info&&o.info.length>0){let t=o.info.find(r=>r.culture==this.translateService.currentLang);if(t)return t.deliveryLabel}return""}onPaginationChangeForWarehouses(o){let t=Number(o.offset)+Number(o.itemsPerPage);this.shownWarehouses=this.warehouses.slice(o.offset,t)}onPaginationChangeForDeliveryLabels(o){let t=Number(o.offset)+Number(o.itemsPerPage);this.shownDeliveryLabels=this.deliveryLabels.slice(o.offset,t)}showSuppliers(){this.resellerBrands&&this.resellerBrands.length>0&&this.suppliersModal.showModal(this.resellerBrands)}showHistory(){this.importsHistoryModal.showModal(this.partnerId>0?D.R.Partner:D.R.Reseller,this.partnerId>0?this.partnerId:this.resellerId,[oe.Y.WarehouseStock])}activateWarehouse(o){this.loadingWarehouses=!0,this.partnerId?(o.isActive=!0,this.partner
1Service.updatePartnerWarehouse(o).then(t=>{t?this.getWarehoues():this.SetError("update failed"),this.loadingWarehouses=!1}).catch(t=>{this.SetError(t.errorMessage),this.loadingWarehouses=!1})):this.resellerId&&(o.isActive=!0,this.partnerService.updateResellerWarehouse(o).then(t=>{t?this.getWarehoues():this.SetError("update failed"),this.loadingWarehouses=!1}).catch(t=>{this.SetError(t.errorMessage),this.loadingWarehouses=!1}))}}$.\u0275fac=function(o){return new(o||$)(e.Y36(I.b),e.Y36(T.sK),e.Y36(at.O),e.Y36(n.g))},$.\u0275cmp=e.Xpm({type:$,selectors:[["app-stock-management"]],viewQuery:function(o,t){if(1&o&&(e.Gf(st,5),e.Gf(lt,5),e.Gf(ct,5),e.Gf(dt,5),e.Gf(pt,5),e.Gf(_t,5),e.Gf(gt,5)),2&o){let r;e.iGM(r=e.CRH())&&(t.warehouseModal=r.first),e.iGM(r=e.CRH())&&(t.deliveryLabelModal=r.first),e.iGM(r=e.CRH())&&(t.importGenericModal=r.first),e.iGM(r=e.CRH())&&(t.deleteModal=r.first),e.iGM(r=e.CRH())&&(t.paginationComponent=r.first),e.iGM(r=e.CRH())&&(t.importsHistoryModal=r.first),e.iGM(r=e.CRH())&&(t.suppliersModal=r.first)}},inputs:{partnerId:"partnerId",resellerId:"resellerId",admin:"admin",tabNumber:"tabNumber",hideHeader:"hideHeader"},features:[e.qOj],decls:23,vars:5,consts:[[1,"row"],["class","col-md-12 TA-page-header","style","padding: 0 15px 0 15px !important;",4,"ngIf"],[1,"col-md-12","TA-padding-0"],["class","col-xs-12 TA-margin-bottom-10px",4,"ngIf"],[1,"col-xs-12"],[1,"col-xs-12","TA-padding-0"],[4,"ngIf"],["warehouseModal",""],["deliveryLabelModal",""],["importGenericModal",""],["deleteModal",""],["importsHistory",""],["suppliersModal",""],[1,"col-md-12","TA-page-header",2,"padding","0 15px 0 15px !important"],[1,"TA-header-title"],[1,"col-xs-12","TA-margin-bottom-10px"],[1,"TA-tab-heading",3,"ngClass"],[3,"ngClass","click"],[1,"tab-pane","row"],["style","position: relative; min-height: 250px;",4,"ngIf"],[2,"position","relative","min-height","250px"],[3,"type","message"],[1,"col-md-12"],[1,"btn","btn-warning","pull-right",2,"margin","0 0 10px",3,"click"],["src","../../../assets/icons/icons-settings/fa-solid-warehouse.svg",1,"btn-img"],[1,"table-responsive","warehouse-table"],["class","table TA-table",4,"ngIf"],[1,"table","TA-table"],[2,"border-collapse","collapse","border","none"],[1,"id-col"],[1,"action-col"],[4,"ngFor","ngForOf"],["role","button",1,"fa","fa-solid","fa-pen-to-square","action-button",3,"tooltip","click"],["class","fa fa-regular fa-trash-can action-button","role","button",3,"tooltip","click",4,"ngIf"],["role","button",3,"click",4,"ngIf"],[2,"font-weight","600"],["role","button",1,"fa","fa-regular","fa-trash-can","action-button",3,"tooltip","click"],["role","button",3,"click"],[2,"border-collapse","collapse","border","none","height","2.5em"],[3,"totalItems","onPaginationChange"],["class","col-md-12",4,"ngIf"],["role","button",1,"TA-link",3,"click"],[1,"col-lg-4","col-md-6","adjust-width-1"],[1,"col-md-6"],[1,"element-container",2,"text-align","center"],[1,"btn","btn-circle",3,"click"],[1,"fa","fa-regular","fa-download","btn-circle-icon"],[1,"container-text","col-md-12"],[1,"fa","fa-regular","fa-upload","btn-circle-icon"],[1,"col-lg-8","col-md-6","adjust-width-2","supplier-info-container"],[1,"col-md-12",2,"margin-top","10px"],["type","button","aria-label","Cancel",1,"btn","btn-default","TA-cancel-btn",3,"click"],["class","col-md-12 TA-padding-0",4,"ngIf"],[1,"col-md-12",2,"margin-top","0px"],["class","tabset-height col-xs-12",4,"ngIf"],[1,"tabset-height","col-xs-12"],[1,"TA-tab-heading"],[1,"col-md-12",2,"margin-bottom","15px"],[1,"table-responsive","delivery-label-table"],[1,"btn","btn-warning","pull-right",3,"click"],["aria-hidden","true",1,"fa","fa-regular","fa-note-sticky"],["role","button",1,"fa","fa-solid","fa-pen-to-square","action-button",3,"tooltip","ngClass","click"],["role","button",1,"fa","fa-regular","fa-trash-can","action-button",3,"tooltip","ngClass","click"],["role","button",1,"fa","fa-regular","fa-clone","action-button",3,"tooltip","ngClass","click"],[2,"border-collapse","collapse","border","none","height","40px"]],template:function(o,t){1&o&&(e.TgZ(0,"div")(1,"div",0),e.YNc(2,mt,7,6,"div",1),e.TgZ(3,"div")(4,"div",2),e.YNc(5,ht,11,21,"div",3),e.TgZ(6,"div",4)(7,"div",5),e.YNc(8,It,4,2,"div",6),e.YNc(9,Pt,4,2,"div",6),e.YNc(10,en,4,2,"div",6),e.qZA()()()()()(),e._UZ(11,"app-warehouse-modal",null,7)(13,"app-delivery-label-modal",null,8)(15,"app-import-generic-modal",null,9)(17,"app-modaldialog",null,10)(19,"app-imports-history-modal",null,11)(21,"app-suppliers-modal",null,12)),2&o&&(e.xp6(2),e.Q6J("ngIf",!t.admin&&!t.hideHeader),e.xp6(3),e.Q6J("ngIf",!t.admin),e.xp6(3),e.Q6J("ngIf",1==t.infoTab),e.xp6(1),e.Q6J("ngIf",2==t.
1infoTab),e.xp6(1),e.Q6J("ngIf",3==t.infoTab))},dependencies:[A.mk,A.sg,A.O5,Te.s,h.Q,ze.L,U.R,te.i9,F,H,B,K,T.X$,ne.z],styles:['a[_ngcontent-%COMP%]{text-decoration:none;color:#164969}.disabled[_ngcontent-%COMP%]{pointer-events:none!important;opacity:.3!important}.partner-info-box-container[_ngcontent-%COMP%]{margin:0 0 20px}.tab-container[_ngcontent-%COMP%]{padding:17px}.table-box[_ngcontent-%COMP%]{padding:15px;padding-top:0!important}.action-button[_ngcontent-%COMP%]{font-size:1.25em;margin:0 5px;color:var(--default-icon-color)}.warehouse-table[_ngcontent-%COMP%]{width:100%}.warehouse-table[_ngcontent-%COMP%] .action-col[_ngcontent-%COMP%]{width:80px;text-align:center}.warehouse-table[_ngcontent-%COMP%] .id-col[_ngcontent-%COMP%]{width:80px}.delivery-label-table[_ngcontent-%COMP%]{width:100%}.delivery-label-table[_ngcontent-%COMP%] .action-col[_ngcontent-%COMP%]{width:100px;text-align:center}.delivery-label-table[_ngcontent-%COMP%] .id-col[_ngcontent-%COMP%]{width:80px}.element-container[_ngcontent-%COMP%]{border-style:solid;border:1px solid #707070;border-radius:3px;height:200px;margin:10px 0;background:#ffffff!important}.btn-circle[_ngcontent-%COMP%]{width:70px;height:70px;border-radius:35px;background:var(--secondary-blue3);border:none;margin-top:1.3em;font-size:30px;font-weight:100;color:#fff}.btn-circle[_ngcontent-%COMP%]:hover{background:var(--secondary-blue2)}.btn-circle[_ngcontent-%COMP%]:active{background:var(--primary-blue)}.btn-circle-icon[_ngcontent-%COMP%]{font-family:"Font Awesome 6 Pro"}.btn-circle-icon[_ngcontent-%COMP%]:hover{color:#fff}.btn-circle-icon[_ngcontent-%COMP%]:active{color:var(--secondary-blue2)}.container-text[_ngcontent-%COMP%]{font-size:16px;margin-top:35px;line-height:18px}.thin-btn[_ngcontent-%COMP%]{padding:5px 10px}.TA-tab-heading[_ngcontent-%COMP%]{margin-bottom:0!important}.primary-blue[_ngcontent-%COMP%]{color:var(--primary-blue)}@media (max-width: 1199px){.warehouse-table[_ngcontent-%COMP%], .delivery-label-table[_ngcontent-%COMP%]{width:100%}}@media (min-width: 1200px) and (max-width: 1599px){.adjust-width-1[_ngcontent-%COMP%]{width:42%!important}.adjust-width-2[_ngcontent-%COMP%]{width:58%!important}}.btn-img[_ngcontent-%COMP%]{height:14px;width:auto;margin-bottom:4px}.TA-cancel-btn[_ngcontent-%COMP%]:hover{background-color:var(--secondary-blue3)!important;color:#fff!important}.TA-cancel-btn[_ngcontent-%COMP%]:active{color:#fff!important;background-color:var(--primary-blue)!important}.supplier-info-container[_ngcontent-%COMP%]{border-left:1px solid #dddee2;height:270px}.tab-heading-2[_ngcontent-%COMP%]{background-color:var(--neutral-lightgray2)!important}']})},1049:(z,S,_)=>{_.d(S,{L:()=>Q});var v=_(80018),C=_(83273),G=_(13437),N=_(15093),P=_(68120),e=_(63832),b=_(14576),k=_(68796),n=_(94650),I=_(36895),M=_(8397),u=_(42466),h=_(73080);const x=["importsHistoryModal"];function f(c,g){1&c&&(n.TgZ(0,"div",12)(1,"p"),n._uU(2),n.ALo(3,"translate"),n.qZA()()),2&c&&(n.xp6(2),n.Oqu(n.lcZ(3,1,"importshistorymodal.empty")))}function d(c,g){1&c&&(n.TgZ(0,"td"),n._uU(1),n.ALo(2,"translate"),n.qZA()),2&c&&(n.xp6(1),n.Oqu(n.lcZ(2,1,"importshistorymodal.state")))}function s(c,g){1&c&&(n.TgZ(0,"td"),n._uU(1),n.ALo(2,"translate"),n.qZA()),2&c&&(n.xp6(1),n.Oqu(n.lcZ(2,1,"importshistorymodal.actions")))}function m(c,g){1&c&&(n.TgZ(0,"span"),n._UZ(1,"i",19),n._uU(2),n.ALo(3,"translate"),n.qZA()),2&c&&(n.xp6(2),n.hij("\xa0",n.lcZ(3,1,"importshistorymodal.states.triggered")," "))}function T(c,g){1&c&&(n.TgZ(0,"span",20),n._UZ(1,"i",21),n._uU(2),n.ALo(3,"translate"),n.qZA()),2&c&&(n.xp6(2),n.hij("\xa0",n.lcZ(3,1,"importshistorymodal.states.running")," "))}function A(c,g){1&c&&(n.TgZ(0,"span",20),n._UZ(1,"i",22),n._uU(2),n.ALo(3,"translate"),n.qZA()),2&c&&(n.xp6(2),n.hij("\xa0",n.lcZ(3,1,"importshistorymodal.states.success")," "))}function w(c,g){1&c&&(n.TgZ(0,"span",20),n._UZ(1,"i",23),n._uU(2),n.ALo(3,"translate"),n.qZA()),2&c&&(n.xp6(2),n.hij("\xa0",n.lcZ(3,1,"importshistorymodal.states.failed")," "))}function J(c,g){if(1&c&&(n.TgZ(0,"td"),n.YNc(1,m,4,3,"span",9),n.YNc(2,T,4,3,"span",18),n.YNc(3,A,4,3,"span",18),n.YNc(4,w,4,3,"span",18),n.qZA()),2&c){const l=n.oxw().$implicit,Z=n.oxw(3);n.xp6(1),n.Q6J("ngIf",l.state==Z.importState.Triggered),n.xp6(1),n.Q6J("ngIf",l.state==Z.importState.Running),n.xp6(1),n.Q6J("ngIf",l.state==Z.importState.Success),n.xp6(1),n.Q6J("ngIf",l.state==Z.importState.Failed)}}function ee(c,g){if(1&c){const l=n.EpF();
1n.TgZ(0,"i",26),n.NdJ("click",function(){n.CHM(l);const O=n.oxw(2).$implicit,W=n.oxw(3);return n.KtG(W.showSummary(O))}),n.ALo(1,"translate"),n.qZA()}2&c&&n.s9C("tooltip",n.lcZ(1,1,"importshistorymodal.popover.show"))}function ie(c,g){1&c&&(n._UZ(0,"i",27),n.ALo(1,"translate")),2&c&&n.s9C("tooltip",n.lcZ(1,1,"importshistorymodal.popover.nosummary"))}function U(c,g){if(1&c&&(n.TgZ(0,"td"),n.YNc(1,ee,2,3,"i",24),n.YNc(2,ie,2,3,"i",25),n.qZA()),2&c){const l=n.oxw().$implicit,Z=n.oxw(3);n.xp6(1),n.Q6J("ngIf",1==Z.checkSummary(l.summary)),n.xp6(1),n.Q6J("ngIf",0==Z.checkSummary(l.summary))}}function te(c,g){if(1&c&&(n.TgZ(0,"tr",16)(1,"td"),n._uU(2),n.qZA(),n.TgZ(3,"td"),n._uU(4),n.ALo(5,"utctolocal"),n.qZA(),n.YNc(6,J,5,4,"td",9),n.YNc(7,U,3,2,"td",9),n.qZA()),2&c){const l=g.$implicit,Z=n.oxw(3);n.xp6(2),n.hij("Import-ID ",l.id,""),n.xp6(2),n.Oqu(n.xi3(5,4,l.createdAt,Z.culture)),n.xp6(2),n.Q6J("ngIf",Z.showState),n.xp6(1),n.Q6J("ngIf",Z.showActions)}}function ne(c,g){if(1&c&&(n.TgZ(0,"div")(1,"div",14)(2,"table",15)(3,"thead")(4,"tr",16)(5,"td"),n._uU(6),n.ALo(7,"translate"),n.qZA(),n.TgZ(8,"td"),n._uU(9),n.ALo(10,"translate"),n.qZA(),n.YNc(11,d,3,3,"td",9),n.YNc(12,s,3,3,"td",9),n.qZA()(),n.TgZ(13,"tbody"),n.YNc(14,te,8,7,"tr",17),n.qZA()()()()),2&c){const l=n.oxw(2);n.xp6(6),n.Oqu(n.lcZ(7,5,"importshistorymodal.message")),n.xp6(3),n.Oqu(n.lcZ(10,7,"importshistorymodal.date")),n.xp6(2),n.Q6J("ngIf",l.showState),n.xp6(1),n.Q6J("ngIf",l.showActions),n.xp6(2),n.Q6J("ngForOf",l.mappingImports)}}function re(c,g){if(1&c&&(n.ynx(0),n.TgZ(1,"div",13),n.YNc(2,ne,15,9,"div",9),n.qZA(),n.BQk()),2&c){const l=n.oxw();n.xp6(2),n.Q6J("ngIf",!l.isBusy)}}function ae(c,g){1&c&&(n.TgZ(0,"span"),n._UZ(1,"i",19),n._uU(2),n.ALo(3,"translate"),n.qZA()),2&c&&(n.xp6(2),n.hij("\xa0",n.lcZ(3,1,"resellermanagement.customermanagement.pricelist.state.pending")," "))}function se(c,g){1&c&&(n.TgZ(0,"span",20),n._UZ(1,"i",21),n._uU(2),n.ALo(3,"translate"),n.qZA()),2&c&&(n.xp6(2),n.hij("\xa0",n.lcZ(3,1,"resellermanagement.customermanagement.pricelist.state.running")," "))}function le(c,g){1&c&&(n.TgZ(0,"span",20),n._UZ(1,"i",22),n._uU(2),n.ALo(3,"translate"),n.qZA()),2&c&&(n.xp6(2),n.hij("\xa0",n.lcZ(3,1,"resellermanagement.customermanagement.pricelist.state.succeeded")," "))}function ce(c,g){1&c&&(n.TgZ(0,"span",20),n._UZ(1,"i",23),n._uU(2),n.ALo(3,"translate"),n.qZA()),2&c&&(n.xp6(2),n.hij("\xa0",n.lcZ(3,1,"resellermanagement.customermanagement.pricelist.state.failed")," "))}function de(c,g){if(1&c&&(n.TgZ(0,"tr")(1,"td")(2,"strong"),n._uU(3),n.ALo(4,"translate"),n.qZA()(),n.TgZ(5,"td",31),n._uU(6),n.qZA()()),2&c){const l=n.oxw(4);n.xp6(3),n.Oqu(n.lcZ(4,2,"resellermanagement.resellerprofile.pricelists.deleted")),n.xp6(3),n.hij(" ",l.summary.Summary[0].Deleted," ")}}function pe(c,g){if(1&c&&(n.TgZ(0,"tr"),n._UZ(1,"td"),n.TgZ(2,"td",33),n._uU(3),n.qZA(),n.TgZ(4,"td",34),n._uU(5),n.qZA()()),2&c){const l=g.$implicit,Z=n.oxw(5);n.xp6(3),n.hij("",Z.getBrandName(l.Id)," "),n.xp6(2),n.Oqu(l.Count)}}function _e(c,g){if(1&c&&(n.ynx(0),n.YNc(1,pe,6,2,"tr",32),n.BQk()),2&c){const l=n.oxw(4);n.xp6(1),n.Q6J("ngForOf",l.summary.Summary[0].Brands)}}function ge(c,g){if(1&c&&(n.TgZ(0,"div",14)(1,"table",29)(2,"tr")(3,"td",30)(4,"strong"),n._uU(5),n.ALo(6,"translate"),n.qZA()(),n.TgZ(7,"td",31),n.YNc(8,ae,4,3,"span",9),n.YNc(9,se,4,3,"span",18),n.YNc(10,le,4,3,"span",18),n.YNc(11,ce,4,3,"span",18),n.qZA()(),n.TgZ(12,"tr")(13,"td")(14,"strong"),n._uU(15),n.ALo(16,"translate"),n.qZA()(),n.TgZ(17,"td",31),n._uU(18),n.qZA()(),n.TgZ(19,"tr")(20,"td")(21,"strong"),n._uU(22),n.ALo(23,"translate"),n.qZA()(),n.TgZ(24,"td",31),n._uU(25),n.qZA()(),n.YNc(26,de,7,4,"tr",9),n.TgZ(27,"tr")(28,"td")(29,"strong"),n._uU(30),n.ALo(31,"translate"),n.qZA()(),n.TgZ(32,"td",31),n._uU(33),n.qZA()(),n.TgZ(34,"tr")(35,"td")(36,"strong"),n._uU(37),n.ALo(38,"translate"),n.qZA()(),n._UZ(39,"td",31),n.qZA(),n.YNc(40,_e,2,1,"ng-container",9),n.qZA()()),2&c){const l=n.oxw(3);n.xp6(5),n.Oqu(n.lcZ(6,14,"resellermanagement.resellerprofile.pricelists.state")),n.xp6(3),n.Q6J("ngIf",l.summary.State==l.priceListState.Triggered),n.xp6(1),n.Q6J("ngIf",l.summary.State==l.priceListState.Running),n.xp6(1),n.Q6J("ngIf",l.summary.State==l.priceListState.Success),n.xp6(1),n.Q6J("ngIf",l.summary.State==l.priceListState.Failed),n.xp6(4),n.Oqu(n.lcZ(16,16,"resellermanagement.resellerprofile.pricelists.detected")),n.xp6(3),n.hij(" ",l.summary.Summary[0].Detected," "),n.xp6(4),n.Oqu(n.lcZ(23,18,"resellermanagement.resellerprofile.pricelists.matched")),n.xp6(3),n.hij(" ",l.summary.Summary[0].Matched," "),n.xp6(1),n.Q6J("ngIf",l.summary.Summary[0].Deleted&&l.summary.Summary[0].Deleted>0),n.xp6(4),n.Oqu(n.lcZ(31,20,"resellermanagement.resellerprofile.pricelists.unmatched")),n.xp6(3),n.hij(" ",l.summary.Summary[0].Unmatched," "),n.xp6(4),n.Oqu(n.lcZ(38,22,"resellermanagement.resellerprofile.pricelists.brands")),n.xp6(3),n.Q6J("ngIf",l.brands&&l.brands.length>0&&l.summary.Summary[0].Brands&&l.summary.Summary[0].Brands.length>0)}}function me(c,g){if(1&c&&(n.TgZ(0,"div"),n.YNc(1,ge,41,24,"div",28),n.qZA()),2&c){const l=n.oxw(2);n.xp6(1),n.Q6J("ngIf",l.selectedImportType==l.entityTypes.Pricelist)}}function j(c,g){if(1&c&&(n.ynx(0),n.TgZ(1,"div",13),n.YNc(2,me,2,1,"div",9),n.qZA(),n.BQk()),2&c){const l=n.oxw();n.xp6(2),n.Q6J("ngIf",!l.isBusy&&l.summary&&l.summary.Summary&&l.summary.Summary.length>0)}}function ue(c,g){if(1&c){const l=n.EpF();
1n.TgZ(0,"button",35),n.NdJ("click",function(){n.CHM(l);const O=n.oxw();return n.KtG(O.closeModal())}),n._uU(1),n.ALo(2,"translate"),n.qZA()}2&c&&(n.xp6(1),n.hij(" ",n.lcZ(2,1,"dialog.close")," "))}function he(c,g){if(1&c){const l=n.EpF();n.TgZ(0,"button",35),n.NdJ("click",function(){n.CHM(l);const O=n.oxw();return n.KtG(O.closeSummary())}),n._uU(1),n.ALo(2,"translate"),n.qZA()}2&c&&(n.xp6(1),n.hij(" ",n.lcZ(2,1,"dialog.back")," "))}const fe=function(){return{backdrop:"static"}};class Q extends C.V{constructor(g,l){super(),this.importservice=g,this.partnerService=l,this.imports=[],this.mappingImports=[],this.step=1,this.priceListState=P.H,this.entityTypes=b.Y,this.showActions=!1,this.showState=!1,this.importState=k.S,this.imports=[]}ngOnInit(){}showModal(g,l,Z,O){let W=new Promise((L,Y)=>{this.callback=L});return Z&&Z.length>0&&l&&(this.SetLoading(!0),Promise.all([this.importservice.getUserImports(Z,O),Z.indexOf(b.Y.Price)>-1?this.partnerService.getAllBrands():Promise.resolve([])]).then(L=>{L&&2==L.length&&(L[0]&&(console.log("imports: ",L[0]),this.imports=L[0].filter(Y=>Y.contractType==g&&Y.contractId==l),this.showActions=!1,this.step=1,this.mappingImports=[],this.imports&&this.imports.length>0&&(this.mappingImports=this.imports.reverse()),this.spliceMappingImports(),this.toggleActionColumn(),this.toggleStateColumn()),L[1]&&(this.brands=L[1]),this.SetLoading(!1),this.importsHistoryModal.show())}).catch(L=>{this.SetLoading(!1),this.SetError(L.message)})),W}spliceMappingImports(){0!=this.mappingImports.length&&this.mappingImports.length>=20&&(this.mappingImports=this.mappingImports.slice(0,20))}toggleActionColumn(){let g=[b.Y.Price];this.showActions=null!=this.mappingImports.find(l=>g.indexOf(l.entityType)>-1)}toggleStateColumn(){let g=[b.Y.WarehouseStock];this.showState=null!=this.mappingImports.find(l=>g.indexOf(l.entityType)>-1)}closeModal(){this.mappingImports=[],this.imports=[],this.importsHistoryModal.hide(),null!=this.callback&&this.callback(G.X.Canceled)}showSummary(g){this.selectedImportType=g.entityType;let l=JSON.parse(g.summary);l&&null!=l&&(this.summary=l,this.step=2)}checkSummary(g){if(!g)return!1;let l=JSON.parse(g);return l&&l.Summary&&l.Summary.length>0}closeSummary(){this.step=1,this.summary=null,this.selectedImportType=null}getBrandName(g){if(this.brands&&this.brands.length>0){let l=this.brands.find(Z=>Z.id==g);return l?l.name:g}return g}}Q.\u0275fac=function(g){return new(g||Q)(n.Y36(e.Y),n.Y36(N.b))},Q.\u0275cmp=n.Xpm({type:Q,selectors:[["app-imports-history-modal"]],viewQuery:function(g,l){if(1&g&&n.Gf(x,5),2&g){let Z;n.iGM(Z=n.CRH())&&(l.importsHistoryModal=Z.first)}},inputs:{brands:"brands"},features:[n.qOj],decls:16,vars:10,consts:[["bsModal","","tabindex","-1","role","dialog","aria-hidden","true",1,"modal","fade",3,"config"],["importsHistoryModal","bs-modal"],[1,"modal-dialog","modal
1-lg"],[1,"modal-content"],[1,"modal-body"],[1,"col-xs-12","TA-info-box",2,"margin-bottom","15px"],[1,"TA-sub-header-title"],[1,"row"],["class","col-md-12",4,"ngIf"],[4,"ngIf"],[1,"modal-footer"],["type","button","class","btn btn-warning","aria-label","Cancel",3,"click",4,"ngIf"],[1,"col-md-12"],[1,"col-xs-12"],[1,"col-xs-12","TA-padding-0","table-responsive"],[1,"table","TA-table","table-striped"],[2,"border-collapse","collapse","border","none"],["style","border-collapse: collapse; border: none;",4,"ngFor","ngForOf"],["class","state-td",4,"ngIf"],[1,"fa","fa-regular","fa-clock"],[1,"state-td"],[1,"fa","fa-regular","fa-spinner"],[1,"fa","fa-solid","fa-check-circle","green"],[1,"fa","fa-solid","fa-times-circle","red"],["class","fa fa-regular fa-file action-icon","style","cursor: pointer;",3,"tooltip","click",4,"ngIf"],["class","fa fa-regular fa-file action-icon disable",3,"tooltip",4,"ngIf"],[1,"fa","fa-regular","fa-file","action-icon",2,"cursor","pointer",3,"tooltip","click"],[1,"fa","fa-regular","fa-file","action-icon","disable",3,"tooltip"],["class","col-xs-12 TA-padding-0 table-responsive",4,"ngIf"],[1,"table","table-bordered","feedback-table"],[2,"width","50%"],["colspan","2"],[4,"ngFor","ngForOf"],[2,"border-right","none !important"],[2,"border-left","none !important"],["type","button","aria-label","Cancel",1,"btn","btn-warning",3,"click"]],template:function(g,l){1&g&&(n.TgZ(0,"div",0,1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5)(6,"span",6),n._uU(7),n.ALo(8,"translate"),n.qZA()(),n.TgZ(9,"div",7),n.YNc(10,f,4,3,"div",8),n.YNc(11,re,3,1,"ng-container",9),n.YNc(12,j,3,1,"ng-container",9),n.qZA()(),n.TgZ(13,"div",10),n.YNc(14,ue,3,3,"button",11),n.YNc(15,he,3,3,"button",11),n.qZA()()()()),2&g&&(n.Q6J("config",n.DdM(9,fe)),n.xp6(7),n.Oqu(n.lcZ(8,7,"importshistorymodal.title")),n.xp6(3),n.Q6J("ngIf",!l.mappingImports||0==l.mappingImports.length),n.xp6(1),n.Q6J("ngIf",1==l.step&&l.mappingImports&&l.mappingImports.length>0),n.xp6(1),n.Q6J("ngIf",2==l.step),n.xp6(2),n.Q6J("ngIf",1==l.step),n.xp6(1),n.Q6J("ngIf",2==l.step))},dependencies:[I.sg,I.O5,M.i9,v.oB,u.X$,h.$],styles:[".fa-circle-left[_ngcontent-%COMP%]{font-size:3em;color:var(--default-icon-color);margin-right:.5em;cursor:pointer;vertical-align:middle}.image-td[_ngcontent-%COMP%]{margin:auto;height:auto}.image-td[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:75%!important;max-height:100%!important;display:block!important;margin-bottom:0!important;margin-right:auto!important;margin-left:auto!important}.image-td[_ngcontent-%COMP%] .child-flex-center[_ngcontent-%COMP%]{flex:1;flex-direction:column;justify-content:center;display:flex}.action-icon[_ngcontent-%COMP%]{color:var(--default-icon-color);cursor:pointer;margin-right:.3em}.disable[_ngcontent-%COMP%]{color:var(--neutral-lightgray1)!important}.feedback-table[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{padding:5px 10px}.green[_ngcontent-%COMP%]{color:var(--success-green)}.red[_ngcontent-%COMP%]{color:var(--error-red)}.state-td[_ngcontent-%COMP%]{display:flex;align-items:center}.state-td[_ngcontent-%COMP%] .fa[_ngcontent-%COMP%]{font-size:large}"]})},77185:(z,S,_)=>{_.d(S,{R:()=>v});var v=(()=>{return(C=v||(v={}))[C.Partner=0]="Partner",C[C.Reseller=1]="Reseller",C[C.Customer=2]="Customer",v;var C})()},68120:(z,S,_)=>{_.d(S,{H:()=>v});var v=(()=>{return(C=v||(v={}))[C.None=0]="None",C[C.Triggered=1]="Triggered",C[C.Running=2]="Running",C[C.Failed=3]="Failed",C[C.Success=4]="Success",v;var C})()},63832:(z,S,_)=>{_.d(S,{Y:()=>I});var v=_(72683),C=_(24190),G=_(30839),N=(()=>{return(M=N||(N={}))[M.None=0]="None",M[M.Started=1]="Started",M[M.Running=2]="Running",M[M.Canceled=3]="Canceled",M[M.Error=4]="Error",M[M.Finished=5]="Finished",M[M.Pending=6]="Pending",N;var M})(),P=_(92340),e=_(63150),b=_(24850),k=_(94650),n=_(80529);class I{constructor(u,h){this.identityService=h,this.importEndpoint=P.N.ProductImportService+"/api/Frontend/",this.mediaImportEndpoint=P.N.ProductService+"/api/TempFiles/",this.monitoringImportEndpoint=P.N.ProductImportService+"/api/Import/",this.httpContext=u}createNewImport(u){let h=this.importEndpoint;return new Promise((f,d)=>{this.httpContext.post(h,u).pipe((0,b.U)(s=>s)).subscribe(s=>{f(s)},s=>{let m=v.Z.getResponseErrorObject(s);d(m.errorMessage)})})}startImport(u){let h=this.importEndpoint+"start/"+u;return new Promise((f,d)=>{this.httpContext.put(h,null).subscribe(()=>{f(null)},s=>{let m=v.Z.getResponseErrorObject(s);d(m.errorMessage)})})}uploadProductFiles(u,h,x){let f=new G.t,d=new e.bA({});return d.authToken="Bearer "+this.identityService.identity.AccessToken,d.onBeforeUploadItem=s=>{s.withCredentials=!1,s.url=this.importEndpoint+"upload/"+u+"/"+x},h.forEach(s=>{d.addToQueue([s.file])}),d.onCompleteItem=(s,m,T)=>{if(200==T){let A=h.find(J=>J.name==s._file.name),w=JSON.parse(m);A.guid=w.guid,f.next(A)}},d.onCompleteAll=()=>{f.complete()},d.onErrorItem=s=>{f.error(s)},d.uploadAll(),0==h.length&&f.complete(),f.asObservable()}addProductImportData(u){let h=this.importEndpoint+"AddProductImportData";return new Promise((f,d)=>{this.httpContext.post(h,u).pipe((0,b.U)(s=>s)).subscribe(s=>{f(s)},s=>{let m=v.Z.getResponseErrorObject(s);d(m.errorMessage)})})}
1retryImportItems(u){let h=this.importEndpoint+"retry";return new Promise((f,d)=>{this.httpContext.post(h,u).pipe((0,b.U)(s=>s)).subscribe(s=>{f(s)},s=>{let m=v.Z.getResponseErrorObject(s);d(m.errorMessage)})})}getHistoricalImports(u){let h=this.importEndpoint+"contract/"+u;return new Promise((f,d)=>{this.httpContext.get(h).pipe((0,b.U)(s=>s)).subscribe(s=>{f(s)},s=>{let m=v.Z.getResponseErrorObject(s);d(m.errorMessage)})})}getCurrentImport(u){let h=this.importEndpoint+u;return new Promise((f,d)=>{this.httpContext.get(h).pipe((0,b.U)(s=>s)).subscribe(s=>{f(s)},s=>{let m=v.Z.getResponseErrorObject(s);d(m.errorMessage)})})}getProductImportData(u){let h=this.importEndpoint+"GetAllImportData";return new Promise((f,d)=>{this.httpContext.post(h,u).pipe((0,b.U)(s=>s)).subscribe(s=>{f(s)},s=>{let m=v.Z.getResponseErrorObject(s);d(m.errorMessage)})})}getUploadedProductImportData(){let u=this.importEndpoint+"GetAllImportDataByState/"+N.None;return new Promise((x,f)=>{this.httpContext.get(u).pipe((0,b.U)(d=>d)).subscribe(d=>{x(d)},d=>{let s=v.Z.getResponseErrorObject(d);f(s.errorMessage)})})}importProductFiles(u,h){let x=this.importEndpoint+"StartProductImport?overrideproducts="+h;return new Promise((d,s)=>{this.httpContext.post(x,u).pipe((0,b.U)(m=>m)).subscribe(m=>{d(m)},m=>{let T=v.Z.getResponseErrorObject(m);s(T.errorMessage)})})}deleteProductFiles(u){let h=this.importEndpoint+"RemoveProductList";return new Promise((f,d)=>{this.httpContext.put(h,u).subscribe(s=>{f(s)},s=>{let m=v.Z.getResponseErrorObject(s);d(m.errorMessage)})})}RemoveProductFilesByPartnerId(){let u=this.importEndpoint+"RemoveByPartnerId";return new Promise((x,f)=>{this.httpContext.delete(u).subscribe(d=>{x(d)},d=>{let s=v.Z.getResponseErrorObject(d);f(s.errorMessage)})})}cancelProductImport(){let u=this.importEndpoint+"CancelProductImport";return new Promise((x,f)=>{this.httpContext.get(u).subscribe(d=>{x(d)},d=>{let s=v.Z.getResponseErrorObject(d);f(s.errorMessage)})})}getPendingProducts(){let u=this.mediaImportEndpoint+"GetPendingProductsForPartnerId";return new Promise((x,f)=>{this.httpContext.get(u).pipe((0,b.U)(d=>d)).subscribe(d=>{x(d)},d=>{let s=v.Z.getResponseErrorObject(d);f(s.errorMessage)})})}generateTempProductGuid(){let u=this.mediaImportEndpoint+"Tempid";return new Promise((x,f)=>{this.httpContext.get(u).pipe((0,b.U)(d=>d)).subscribe(d=>{x(d)},d=>{let s=v.Z.getResponseErrorObject(d);f(s.errorMessage)})})}uploadProduct(u,h){let x=this.importEndpoint+"Upload/"+u;return new Promise((d,s)=>{this.httpContext.post(x,h).pipe((0,b.U)(m=>m)).subscribe(m=>{d(m)},m=>{let T=v.Z.getResponseErrorObject(m);s(T.errorMessage)})})}deletePendingProducts(u){let h=this.mediaImportEndpoint+"RemoveByPartnerId";return new Promise((f,d)=>{this.httpContext.post(h,u).subscribe(s=>{f(s)},s=>{let m=v.Z.getResponseErrorObject(s);d(m.errorMessage)})})}getImports(u){let h=this.monitoringImportEndpoint+"Get";return new Promise((f,d)=>{this.httpContext.post(h,u).pipe((0,b.U)(s=>s)).subscribe(s=>{f(s)},s=>{let m=v.Z.getResponseErrorObject(s);d(m.errorMessage)})})}getImportSummary(u){let h=this.monitoringImportEndpoint+"GetSummary/"+u;return new Promise((f,d)=>{this.httpContext.get(h).pipe((0,b.U)(s=>s)).subscribe(s=>{f(s)},s=>{let m=v.Z.getResponseErrorObject(s);d(m.errorMessage)})})}retriggerImport(u){let h=this.monitoringImportEndpoint+"Retrigger/"+u;return new Promise((f,d)=>{this.httpContext.get(h).pipe((0,b.U)(s=>s)).subscribe(s=>{f(s)},s=>{let m=v.Z.getResponseErrorObject(s);d(m.errorMessage)})})}getImportItems(u,h){let x=this.monitoringImportEndpoint+"Get/"+u;return new Promise((d,s)=>{this.httpContext.post(x,h).pipe((0,b.U)(m=>m)).subscribe(m=>{d(m)},m=>{let T=v.Z.getResponseErrorObject(m);s(T.errorMessage)})})}getUserImports(u,h){let x;return x=h?this.monitoringImportEndpoint+"Get/user?isAdmin="+h:this.monitoringImportEndpoint+"Get/user",new Promise((d,s)=>{this.httpContext.post(x,u).pipe((0,b.U)(m=>m)).subscribe(m=>{d(m)},m=>{let T=v.Z.getResponseErrorObject(m);s(T.errorMessage)})})}}I.\u0275fac=function(u){return new(u||I)(k.LFG(n.eN),k.LFG(C.P))},I.\u0275prov=k.Yz7({token:I,factory:I.\u0275fac,providedIn:"root"})}}]);
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.