1!function(){"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function i(e,i,a){return i&&t(e.prototype,i),a&&t(e,a),e}(self.webpackChunkmovilitas_cloud_ui2_0=self.webpackChunkmovilitas_cloud_ui2_0||[]).push([[4486],{94486:function(t,a,o){o.r(a),o.d(a,{WarehouseModule:function(){return De}});var s=o(38583),r=o(27354),n=o(14028),c=o(16550),l=o(20282),u=o(37716),d=o(5256),h=function(){function t(){e(this,t),this.navLinks=[{path:"/application/warehouse",label:"warehouses"},{path:"operators",label:"operators"},{path:"customers",label:"customers"},{path:"settings",label:"settings"}]}return i(t,[{key:"ngOnInit",value:function(){}}]),t}();h.\u0275fac=function(e){return new(e||h)},h.\u0275cmp=u.Xpm({type:h,selectors:[["app-warehouse"]],decls:3,vars:2,consts:[[3,"navName","navLinks"]],template:function(e,t){1&e&&(u.TgZ(0,"div"),u._UZ(1,"app-tabbed-menu",0),u._UZ(2,"router-outlet"),u.qZA()),2&e&&(u.xp6(1),u.Q6J("navName","warehouse")("navLinks",t.navLinks))},directives:[d.q,c.lC],encapsulation:2});var m=o(3679),g=o(11995),p=o(9824),f=o(5477),v=o(29790),b=o(76889),Z=o(45094),w=o(92124),x=function(){function t(i,a,o,s){e(this,t),this.router=i,this.commonService=a,this.serverService=o,this.storageService=s,this._businessChannels=new b.x,this._warehouses=new b.x,this._availableOperators=new b.x,this._operators=new b.x,this._settings=new b.x,this._customer=new b.x,this._isWarehousesLoading=new b.x,this._isCustomerLoading=new b.x,this._isUsersLoading=new b.x,this._isOperatorsLoading=new b.x,this.pricelist$=new Z.X({})}return i(t,[{key:"initializeWarehouseLocations",value:function(){var e=this;return this.storageService.get("selectedCloudCustomer").then(function(t){e.customerID=t.id}).then(function(){e.customerID?Promise.all([e.getWarehouseLocations(),e.getPricelist()]):e.router.navigate(["/"])})}},{key:"initializeOperators",value:function(){var e=this;return this.storageService.get("selectedCloudCustomer").then(function(t){e.customerID=t.id}).then(function(){e.customerID?Promise.all([e.getWarehouseLocations(),e.getPricelist(),e.getOperators().then(function(){return e.getAvailableOperators()})]):e.router.navigate(["/"])})}},{key:"initializeCustomers",value:function(){var e=this;return this.storageService.get("selectedCloudCustomer").then(function(t){e.customerID=t.id}).then(function(){e.customerID?e.getCustomers():e.router.navigate(["/"])})}},{key:"initializeSettings",value:function(){var e=this;return this.storageService.get("selectedCloudCustomer").then(function(t){e.customerID=t.id}).then(function(){e.customerID?Promise.all([e.getSettings(),e.getBusinessChannels()]):e.router.navigate(["/"])})}},{key:"getPricelist",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"eur";return this.commonService.getPricelist().then(function(){e.commonService.pricelist$.subscribe(function(i){var a=i.filter(function(e){return"serializedwarehouse"===e.tag})[0],o=a.prices.filter(function(e){return e.currency===t})[0],s=a.children.filter(function(e){return"serializedwarehouse-operator"===e.tag})[0],r=a.children.filter(function(e){return"serializedwarehouse-warehouse"===e.tag})[0];Array.isArray(s.prices)&&(s.prices=s.prices.filter(function(e){return e.currency===t})[0]),Array.isArray(r.prices)&&(r.prices=r.prices.filter(function(e){return e.currency===t})[0]),e.pricelist$.next({app:o,operator:s,location:r})})})}},{key:"getAvailableOperators",value:function(){var e=this;return this._isUsersLoading.next(!0),this.serverService.get("/customers/available_users/"+this.customerID,{user_types:["Administrators","Users","Moderators","Analyzers"],application_tag:"Warehouse"}).toPromise().then(function(t){e._availableOperators.next(t.data),e._isUsersLoading.next(!1)})}},{key:"getSettings",value:function(){var e=this;return this.serverService.get("/warehouse/settings/"+this.customerID).toPromise().then(function(t){e._settings.next(t.data),null==t.data.attp_channel||void 0===t.data.attp_channel||""===t.data.attp_channel||24!==t.data.attp_channel.length?e.selectedBusinessChannel="":e.selectedBusinessChannel=t.data.attp_channel})}},{key:"getBusinessChannels",value:function(){var e=this,t={business_channel:this.selectedBusinessChannel};return this.serverService.get("/customer_listeners/"+this.customerID,t).toProm
1ise().then(function(t){e._businessChannels.next(t.data)})}},{key:"getWarehouseLocations",value:function(){var e=this;return this._isWarehousesLoading.next(!0),this.serverService.get("/warehouse/get_locations/"+this.customerID).toPromise().then(function(t){e._warehouses.next(t.data),e._isWarehousesLoading.next(!1)})}},{key:"getOperators",value:function(){var e=this;return this._isOperatorsLoading.next(!0),this.serverService.get("/warehouse/get_operators/"+this.customerID).toPromise().then(function(t){e._operators.next(t.data),e._isOperatorsLoading.next(!1)})}},{key:"getCustomers",value:function(){var e=this;return this._isCustomerLoading.next(!0),this.serverService.get("/warehouse/get_customers/"+this.customerID).toPromise().then(function(t){e._customer.next(t.data),e._isCustomerLoading.next(!1)})}},{key:"subscribeToBusinessChannels",value:function(){return this._businessChannels.asObservable()}},{key:"subscribeToWarehouses",value:function(){return this._warehouses.asObservable()}},{key:"subscribeToAvailableOperators",value:function(){return this._availableOperators.asObservable()}},{key:"subscribeToOperators",value:function(){return this._operators.asObservable()}},{key:"subscribeToSettings",value:function(){return this._settings.asObservable()}},{key:"subscribeToCustomerCustomers",value:function(){return this._customer.asObservable()}},{key:"subscribeToWarehousesLoading",value:function(){return this._isWarehousesLoading.asObservable()}},{key:"subscribeToUsersLoading",value:function(){return this._isUsersLoading.asObservable()}},{key:"subscribeToOperatorsLoading",value:function(){return this._isOperatorsLoading.asObservable()}},{key:"subscribeToCustomerLoading",value:function(){return this._isCustomerLoading.asObservable()}}]),t}();x.\u0275fac=function(e){return new(e||x)(u.LFG(c.F0),u.LFG(g.v),u.LFG(p.N),u.LFG(w.V))},x.\u0275prov=u.Yz7({token:x,factory:x.\u0275fac,providedIn:"root"});var _=o(70591),T=o(35618),A=o(93738),L=o(12522),C=o(51095),y=o(76627),S=o(1769),q=o(4885),k=o(38550),U=o(11436),N=o(98295),I=o(83166),J=o(77746),W=["WarehousesTable"];function O(e,t){1&e&&(u.TgZ(0,"div",11),u._UZ(1,"mat-spinner"),u.qZA())}function Y(e,t){if(1&e&&u._uU(0),2&e){var i=t.value;u.hij(" ",i," ")}}function M(e,t){1&e&&(u._uU(0),u.ALo(1,"translate")),2&e&&u.hij(" ",u.lcZ(1,1,"action")," ")}function Q(e,t){if(1&e){var i=u.EpF();u.TgZ(0,"button",18),u.NdJ("click",function(){var e=u.CHM(i).row;return u.oxw(2).deleteWarehouse(e)}),u.ALo(1,"translate"),u.TgZ(2,"mat-icon",19),u._uU(3,"delete_forever"),u.qZA(),u.qZA()}2&e&&u.s9C("matTooltip",u.lcZ(1,1,"delete-warehouse"))}var F=function(e,t){return{emptyMessage:e,totalMessage:t}};function H(e,t){if(1&e){var i=u.EpF();u.TgZ(0,"ngx-datatable",12,13),u.NdJ("select",function(e){return u.CHM(i),u.oxw().selectWarehouse(e)}),u.ALo(2,"translate"),u.ALo(3,"translate"),u.TgZ(4,"ngx-datatable-column",14),u.ALo(5,"translate"),u.YNc(6,Y,1,1,"ng-template",15),u.qZA(),u.TgZ(7,"ngx-datatable-column",16),u.YNc(8,M,2,3,"ng-template",17),u.YNc(9,Q,4,3,"ng-template",15),u.qZA(),u.qZA()}if(2&e){var a=u.oxw();u.Q6J("rows",a.warehouses)("columnMode","force")("headerHeight",50)("footerHeight",50)("rowHeight","auto")("messages",u.WLB(27,F,u.lcZ(2,21,"no-warehouses"),u.lcZ(3,23,"total")))("limit",10)("selected",a.selected)("reorderable",!1)("selectCheck",a.checkSelectable)("selectionType","single")("scrollbarV",!1)("draggable",!1)("loadingIndicator",a.isWarehousesLoading),u.xp6(4),u.s9C("name",u.lcZ(5,25,"warehouse-name")),u.Q6J("minWidth","auto")("maxWidth","auto"),u.xp6(3),u.Q6J("minWidth","auto")("maxWidth","auto")("headerClass","align-table-content-right")("cellClass","align-table-content-right")}}function G(e,t){1&e&&(u.TgZ(0,"div",11),u._UZ(1,"mat-spinner"),u.qZA())}function P(e,t){if(1&e){var i=u.EpF();u.TgZ(0,"form",20),u.TgZ(1,"div"),u.TgZ(2,"mat-form-field",21),u._UZ(3,"input",22),u.ALo(4,"translate"),u.qZA(),u.qZA(),u.TgZ(5,"div"),u.TgZ(6,"mat-form-field",21),u.TgZ(7,"span",23),u._uU(8,"urn:epc:id:sgln:\xa0"),u.qZA(),u._UZ(9,"input",24),u.ALo(10,"translate"),u.qZA(),u.qZA(),u.TgZ(11,"div"),u.TgZ(12,"mat-form-field",21),u.TgZ(13,"span",23),u._uU(14,"urn:epc:id:sgln:\xa0"),u.qZA(),u._UZ(15,"input",25),u.ALo(16,"translate"),u.qZA(),u.qZA(),u.TgZ(17,"mat-list-item",26),u.TgZ(18,"button",27),u.NdJ("click",function(){return u.CHM(i),u.oxw().selectAction()}),u._uU(19),u.ALo(20,"translate"),u.qZA(),u.qZA(),u.qZA()}if(2&e){var a=u.oxw();u.Q6J("formGroup",a.warehouseFormGroup),u.xp6(3),u.s9C("placeholder",u.lcZ(4,6,"warehouse-name")),u.xp6(6),u.s9C("placeholder",u.lcZ(10,8,"sgln-number")),u.xp6(6),u.s9C("placeholder",u.lcZ(16,10,"owner-sgln-number")),u.xp6(3),u.Q6J("disabled",!a.warehouseFormGroup.valid),u.xp6(1),u.hij(" ",u.lcZ(20,12,a.buttonTitle)," ")}}var D=function(){function t(i,a,o,s,r,n,c){var l=this;
1e(this,t),this.commonService=i,this.formBuilder=a,this.serverService=o,this.dialogsService=s,this.translate=r,this.warehouseService=n,this.windowService=c,this.savedSelection=[],this.filteredBusinessChannels=[],this.selected=[],this.countries=[],this.isChannelSourceArvato=!1,this.isTableRecalculated=!1,this.isPageLoaded=!1,this.cardTitle="create-warehouse",this.buttonTitle="create",this.businessChannelSelectPlaceholder="select-nmvs-bc",this.isPageLoadedSubscription=n.subscribeToWarehousesLoading().subscribe(function(e){l.isWarehousesLoading=e,e||(l.isPageLoaded=!0)})}return i(t,[{key:"ngOnInit",value:function(){var e=this;this.createForm(),this.warehousesSubscription=this.warehouseService.subscribeToWarehouses().subscribe(function(t){e.warehouses=t,e.isTableRecalculated=!0,0!==e.savedSelection.length&&(e.selected=e.warehouses.filter(function(t){return t.location_id===e.savedSelection[0].location_id}),e.selectWarehouse(e.selected))}),this.prices=this.warehouseService.pricelist$.subscribe(function(t){return e.price=t}),this.warehouseService.initializeWarehouseLocations(),this.windowSubscription=this.windowService.width$.subscribe(function(){e.warehouses&&(e.isTableRecalculated=!1,setTimeout(function(){e.isTableRecalculated=!0},0))})}},{key:"ngOnDestroy",value:function(){this.warehousesSubscription.unsubscribe(),this.prices.unsubscribe(),this.isPageLoadedSubscription.unsubscribe(),this.windowSubscription.unsubscribe()}},{key:"selectWarehouse",value:function(e){void 0!==this.selected[Object.keys(this.selected)[0]]?(this.buttonTitle="update",this.cardTitle="update-location",this.savedSelection=this.selected,e.selected?this.setReceivedFormValues(e.selected[0]):this.setReceivedFormValues(e[0])):this.initAddNewWarehouse()}},{key:"deleteWarehouse",value:function(e){var t=this,i={location_id:e.location_id};this.dialogsService.createModal("delete-warehouse",this.translate.instant("confirm-delete-multiple-component",{component:e.location_name}),"yes",!0,"no").subscribe(function(e){e?t.serverService.delete("/warehouse/location/"+t.warehouseService.customerID,i).subscribe(function(e){t.commonService.showUserNotification(e.message,"ok"),t.warehouseService.getWarehouseLocations(),t.initAddNewWarehouse()}):t.initAddNewWarehouse()},function(e){console.error(e)})}},{key:"checkSelectable",value:function(e){return-1===this.selected.indexOf(e)}},{key:"initAddNewWarehouse",value:function(){this.isChannelSourceArvato=!1,this.warehouseFormGroup.reset(),this.buttonTitle="create",this.cardTitle="create-location",this.selected=[],this.table.recalculate()}},{key:"createForm",value:function(){this.warehouseFormGroup=this.formBuilder.group({location_name:["",m.kI.required],location_gln:[""],location_owner_gln:[""]})}},{key:"setReceivedFormValues",value:function(e){this.selectedWarehouseID=e.location_id,this.warehouseFormGroup.controls.location_name.setValue(e.location_name),e.location_gln&&this.warehouseFormGroup.controls.location_gln.setValue(e.location_gln.replace(/^(urn:epc:id:sgln:)+/,"")),void 0!==e.location_owner_gln&&this.warehouseFormGroup.controls.location_owner_gln.setValue(e.location_owner_gln.replace(/^(urn:epc:id:sgln:)+/,""))}},{key:"manageWarehouse",value:function(){var e,t=this,i=this.warehouseFormGroup.value;null!==i.location_gln&&(i.location_gln="urn:epc:id:sgln:"+i.location_gln.replace(/^(urn:epc:id:sgln:)+/,"")),null!==i.location_owner_gln&&(i.location_owner_gln="urn:epc:id:sgln:"+i.location_owner_gln.replace(/^(urn:epc:id:sgln:)+/,"")),"update"===this.buttonTitle?(i.location_id=this.selectedWarehouseID,e=this.serverService.put("/warehouse/location/"+this.warehouseService.customerID,i)):(this.savedSelection=[],e=this.serverService.post("/warehouse/location/"+this.warehouseService.customerID,i)),e.subscribe(function(e){t.commonService.showUserNotification(e.message,"ok"),t.warehouseService.getWarehouseLocations(),0===t.savedSelection.length&&t.initAddNewWarehouse()})}},{key:"selectAction",value:function(){var e=this,t='\n <div class="max-width-400">\n '.concat(this.translate.instant("pricelist-create-warehouse"),"\n ").concat(this.price.location.prices.price,"\n ").concat(this.price.location.prices.currency.toUpperCase(),"\n / month\n </div>\n ");"update"!==this.buttonTitle?this.dialogsService.createModal("please-confirm",t,"ok",!0,"cancel").subscribe(function(t){t&&e.manageWarehouse()}):this.manageWarehouse()}}]),t}();D.\u0275fac=function(e){return new(e||D)(u.Y36(g.v),u.Y36(m.qu),u.Y36(p.N),u.Y36(f.H),u.Y36(v.sK),u.Y36(x),u.Y36(_.u))},D.\u0275cmp=u.Xpm({type:D,selectors:[["app-warehouse-locations"]],viewQuery:function(e,t){var i;(1&e&&u.Gf(W,5),2&e)&&(u.iGM(i=u.CRH())&&(t.table=i.first))},decls:24,vars:13,consts:[["fxLayout","row","fxLayout.lt-lg","column","fxLayoutGap","10px",1,"content","m-t"],[1,"min-w-50"],[1,"panel","p-a-0"],["fxLayoutAlign","space-between center","color","accent",1,"panel-title"],["mat-raised-button","","color","primary",1,"list-button","pull-right",3,"click"],["fxLayout","row","fxLayoutAlign","center center","class","m-a-lg p-a-lg",4,"ngIf"],["class","material ngx-hide-shadow","id","selectableTable",3,"rows","columnMode","headerHeight","footerHeight","rowHeight","messages","limit","selected","reorderable","selectCheck","selectionType","scrollbarV","draggable","loadingIndicator","select",4,"ngIf"],[1,"full-width"],["color","accent",1,"panel-title"],[1,"p-a-md"],[3,"formGroup",4,"ngIf"],["fxLayout","row","fxLayoutAlign","center center",1,"m-a-lg","p-a-lg"],["id","selectableTable",1,"material","ngx-hide-shadow",3,"rows","columnMode","headerHeight","footerHeight","rowHeight","messages","limit","selected","reorderable","selectCheck","selectionType","scrollbarV","draggable","loadingIndicator","select"],["WarehousesTable",""],["prop","location_name",3,"name","minWidth","maxWidth"],["ngx-datatable-cell-template",""],[3,"minWidth","maxWidth","headerClass","cellClass"],["ngx-datatable-header-template",""],["mat-icon-button","","matTooltipPosition","above","color","warn",1,"material-table-btn",3,"matTooltip","click"],["aria-label","'delete-location' | translate"],[3,"formGroup"],["color","accent",1,"full-width"],["type","text","matInput","","formControlName","location_name","required","",1,"form-control",3,"placeholder"],["matPrefix",""],["type","text","matInput","","formControlName","location_gln",1,"form-control",3,"placeholder"],["type","text","matInput","","formControlName","location_owner_gln",1,"form-control",3,"placeholder"],[1,"text-center"],["mat-raised-button","","color","primary","type","button",1,"text-uppercase","p-x-lg","m-x-auto","d-inline-block","m-t","m-b",3,"disabled","click"]],template:function(e,t){1&e&&(u.TgZ(0,"div",0),u.TgZ(1,"div",1),u.TgZ(2,"mat-card",2),u.TgZ(3,"mat-toolbar",3),u._uU(4),u.ALo(5,"translate"),u.TgZ(6,"button",4),u.NdJ("click",function(){return t.initAddNewWarehouse()}),u._uU(7),u.ALo(8,"translate"),u.TgZ(9,"mat-icon"),u._uU(10,"add"),u.qZA(),u.qZA(),u.qZA(),u._UZ(11,"mat-divider"),u.TgZ(12,"mat-card-content"),u.YNc(13,O,2,0,"div",5),u.YNc(14,H,10,30,"ngx-datatable",6),u.qZA(),u.qZA(),u.qZA(),u.TgZ(15,"div",7),u.TgZ(16,"mat-card",2),u.TgZ(17,"mat-toolbar",8),u._uU(18),u.ALo(19,"translate"),u.qZA(),u._UZ(20,"mat-divider"),u.TgZ(21,"mat-card-content",9),u.YNc(22,G,2,0,"div",5),u.YNc(23,P,21,14,"form",10),u.qZA(),u.qZA(),u.qZA(),u.qZA()),2&e&&(u.xp6(4),u.hij(" ",u.lcZ(5,7,"warehouses")," "),u.xp6(3),u.hij(" ",u.lcZ(8,9,"add-new"),"\xa0\xa0 "),u.xp6(6),u.Q6J("ngIf",!t.isPageLoaded),u.xp6(1),u.Q6J("ngIf",t.isPageLoaded&&t.isTableRecalculated),u.xp6(4),u.Oqu(u.lcZ(19,11,t.cardTitle)),u.xp6(4),u.Q6J("ngIf",!t.isPageLoaded),u.xp6(1),u.Q6J("ngIf",t.isPageLoaded))},directives:[T.xw,T.SQ,A.a8,L.Ye,T.Wh,C.lW,y.Hw,S.d,A.dn,s.O5,q.$g,k.nE,k.UC,k.vq,k.tk,U.gM,m._Y,m.JL,m.sg,N.KE,I.Nt,m.Fj,m.JJ,m.u,m.Q7,N.qo,J.Tg],pipes:[v.X$],encapsulation:2});var j=o(64762),R=o(41964),V=o(37540),E=o(99922),$=o(11600),B=o(67441),z=o(72458),X=o(36020),K=["UsersTable"],ee=["OperatorsTable"];function te(e,t){1&e&&(u.TgZ(0,"div",11),u._UZ(1,"mat-spinner"),u.qZA())}function ie(e,t){if(1&e){var i=u.EpF();u.TgZ(0,"mat-form-field",12),u.TgZ(1,"input",13),u.NdJ("ngModelChange",function(e){return u.CHM(i),u.oxw(2).filters.available=e}),u.qZA(),u.qZA()}if(2&e){var a=u.oxw(2);u.xp6(1),u.Q6J("ngModel",a.filters.available)}}function ae(e,t){if(1&e&&u._uU(0),2&e){var i=t.value;u.hij(" ",i," ")}}function oe(e,t){1&e&&(u._uU(0),u.ALo(1,"translate")),2&e&&u.hij(" ",u.lcZ(1,1,"action")," ")}function se(e,t){if(1&e){var i=u.EpF();u.TgZ(0,"button",20),u.NdJ("click",function(){var e=u.CHM(i).row;return u.oxw(3).assignUser(e)}),u.ALo(1,"translate"),u.TgZ(2,"mat-icon",21),u._uU(3,"person_add"),u.qZA(),u.qZA()}2&e&&u.s9C("matTooltip",u.lcZ(1,1,"assign-operator"))}var re=function(e,t){return{emptyMessage:e,totalMessage:t}};function ne(e,t){if(1&e&&(u.TgZ(0,"ngx-datatable",14,15),u.ALo(2,"filter"),u.ALo(3,"translate"),u.ALo(4,"translate"),u.TgZ(5,"ngx-datatable-column",16),u.ALo(6,"translate"),u.YNc(7,ae,1,1,"ng-template",17),u.qZA(),u.TgZ(8,"ngx-datatable-column",18),u.YNc(9,oe,2,3,"ng-template",19),u.YNc(10,se,4,3,"ng-template",17),u.qZA(),u.qZA()),2&e){var i=u.oxw(2);u.Q6J("rows",u.Dn7(2,18,i.users,"email",i.filters.available))("columnMode","force")("headerHeight",50)("footerHeight",50)("rowHeight","auto")("messages",u.WLB(28,re,u.lcZ(3,22,"no-operators-available"),u.lcZ(4,24,"total")))("limit",10)("scrollbarV",!1)("draggable",!1)("reorderable",!1)("loadingIndicator",i.isUsersLoading),u.xp6(
15),u.s9C("name",u.lcZ(6,26,"operator")),u.Q6J("minWidth","auto")("maxWidth","auto"),u.xp6(3),u.Q6J("minWidth","auto")("maxWidth","auto")("headerClass","align-table-content-right")("cellClass","align-table-content-right")}}function ce(e,t){1&e&&(u.TgZ(0,"div",11),u._UZ(1,"mat-spinner"),u.qZA())}function le(e,t){if(1&e){var i=u.EpF();u.TgZ(0,"mat-form-field",12),u.TgZ(1,"input",13),u.NdJ("ngModelChange",function(e){return u.CHM(i),u.oxw(2).filters.active=e}),u.qZA(),u.qZA()}if(2&e){var a=u.oxw(2);u.xp6(1),u.Q6J("ngModel",a.filters.active)}}function ue(e,t){if(1&e&&(u.TgZ(0,"span"),u._uU(1),u.qZA()),2&e){var i=t.value;u.xp6(1),u.Oqu(i)}}function de(e,t){if(1&e&&(u.TgZ(0,"mat-option",30),u._uU(1),u.qZA()),2&e){var i=t.$implicit;u.Q6J("value",i.location_id),u.xp6(1),u.hij(" ",i.location_name," ")}}function he(e,t){if(1&e){var i=u.EpF();u.TgZ(0,"mat-form-field",26),u.TgZ(1,"mat-select",27),u.NdJ("selectionChange",function(e){var t=u.CHM(i).row;return u.oxw(3).locationChange(t._id,e.value)}),u.ALo(2,"translate"),u.TgZ(3,"mat-option",28),u._uU(4),u.ALo(5,"translate"),u.qZA(),u.YNc(6,de,2,2,"mat-option",29),u.qZA(),u.qZA()}if(2&e){var a=t.row,o=u.oxw(3);u.xp6(1),u.s9C("placeholder",u.lcZ(2,4,"select-location")),u.Q6J("value",null==a.hierarchy_scope?null:a.hierarchy_scope.equipment_id),u.xp6(3),u.hij(" ",u.lcZ(5,6,"no-location-is-selected")," "),u.xp6(2),u.Q6J("ngForOf",o.warehouses)}}function me(e,t){1&e&&(u._uU(0),u.ALo(1,"translate")),2&e&&u.hij(" ",u.lcZ(1,1,"action")," ")}function ge(e,t){if(1&e){var i=u.EpF();u.TgZ(0,"button",31),u.NdJ("click",function(){var e=u.CHM(i).row;return u.oxw(3).removeUser(e)}),u.ALo(1,"translate"),u.TgZ(2,"mat-icon",32),u._uU(3,"delete_forever"),u.qZA(),u.qZA()}2&e&&u.s9C("matTooltip",u.lcZ(1,1,"remove-operator"))}function pe(e,t){if(1&e&&(u.TgZ(0,"ngx-datatable",14,22),u.ALo(2,"filter"),u.ALo(3,"translate"),u.ALo(4,"translate"),u.TgZ(5,"ngx-datatable-column",23),u.ALo(6,"translate"),u.YNc(7,ue,2,1,"ng-template",17),u.qZA(),u.TgZ(8,"ngx-datatable-column",24),u.ALo(9,"translate"),u.YNc(10,he,7,8,"ng-template",17),u.qZA(),u.TgZ(11,"ngx-datatable-column",25),u.YNc(12,me,2,3,"ng-template",19),u.YNc(13,ge,4,3,"ng-template",17),u.qZA(),u.qZA()),2&e){var i=u.oxw(2);u.Q6J("rows",u.Dn7(2,20,i.operators,"id",i.filters.active))("columnMode","force")("headerHeight",50)("footerHeight",50)("rowHeight","auto")("messages",u.WLB(32,re,u.lcZ(3,24,"no-operators"),u.lcZ(4,26,"total")))("limit",10)("scrollbarV",!1)("draggable",!1)("reorderable",!1)("loadingIndicator",i.isOperatorsLoading),u.xp6(5),u.s9C("name",u.lcZ(6,28,"active-operator")),u.Q6J("minWidth","auto")("maxWidth","auto"),u.xp6(3),u.s9C("name",u.lcZ(9,30,"operator-location")),u.Q6J("minWidth","auto")("maxWidth","auto"),u.xp6(3),u.Q6J("minWidth","auto")("maxWidth","auto")("headerClass","align-table-content-right")}}function fe(e,t){if(1&e&&(u.TgZ(0,"div",1),u.TgZ(1,"div",2),u.TgZ(2,"mat-card",3),u.TgZ(3,"mat-toolbar",4),u._uU(4),u.ALo(5,"translate"),u.qZA(),u._UZ(6,"mat-divider"),u.TgZ(7,"mat-card-content",5),u.YNc(8,te,2,0,"div",6),u.YNc(9,ie,2,1,"mat-form-field",7),u.YNc(10,ne,11,31,"ngx-datatable",8),u.qZA(),u.qZA(),u.qZA(),u.TgZ(11,"div",9),u.TgZ(12,"mat-card",3),u.TgZ(13,"mat-toolbar",10),u._uU(14),u.ALo(15,"translate"),u.qZA(),u._UZ(16,"mat-divider"),u.TgZ(17,"mat-card-content",5),u.YNc(18,ce,2,0,"div",6),u.YNc(19,le,2,1,"mat-form-field",7),u.YNc(20,pe,14,35,"ngx-datatable",8),u.qZA(),u.qZA(),u.qZA(),u.qZA()),2&e){var i=u.oxw();u.xp6(4),u.hij(" ",u.lcZ(5,8,"available-operators")," "),u.xp6(4),u.Q6J("ngIf",!i.isUsersLoaded),u.xp6(1),u.Q6J("ngIf",i.isUsersLoaded),u.xp6(1),u.Q6J("ngIf",i.isUsersLoaded&&i.isTableRecalculated),u.xp6(4),u.Oqu(u.lcZ(15,10,"active-operators")),u.xp6(4),u.Q6J("ngIf",!i.isOperatorsLoaded),u.xp6(1),u.Q6J("ngIf",i.isOperatorsLoaded),u.xp6(1),u.Q6J("ngIf",i.isOperatorsLoaded&&i.isTableRecalculated)}}var ve=function(){function t(i,a,o,s,r,n,c,l){var u=this;e(this,t),this.commonService=i,this.dialogsService=a,this.serverService=o,this.translate=s,this.warehouseService=r,this.windowService=n,this.billing=c,this.storage=l,this.isPageLoaded=!1,this.isOperatorsLoading=!1,this.isOperatorsLoaded=!1,this.isUsersLoading=!1,this.isUsersLoaded=!1,this.isTableRecalculated=!1,this.filters={available:"",active:""},this.isOperatorsLoadedSubscription=r.subscribeToOperatorsLoading().subscribe(function(e){u.isOperatorsLoading=e,e||(u.isOperatorsLoaded=!0)}),this.isUsersLoadedSubscription=r.subscribeToUsersLoading().subscribe(function(e){u.isUsersLoading=e,e||(u.isUsersLoaded=!0)})}return i(t,[{key:"ngOnInit",value:function(){return(0,j.mG)(this,void 0,void 0,regeneratorRuntime.mark(function e(){var t=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.storage.get("selectedCloudCustomer");case 2:this.customer=e.sent,this.operatorsSubscription=this.warehouseService.subscribeToOperators().subscribe(function(e){return t.operators=e}),this.warehousesSubscription=this.warehouseService.subscribeToWarehouses().subscribe(function(e){return t.warehouses=e.sort(function(e,t){return e.location_name.localeCompare(t.location_name)})}),this.usersSubscription=this.warehouseService.subscribeToAvailableOperators().subscribe(function(e){return t.createUsersTable(e)}),this.warehouseService.initializeOperators().then(function(){t.isPageLoaded=!0,t.isTableRecalculated=!0}),this.windowSubscription=this.windowService.width$.subscribe(function(){t.operators&&t.users&&(t.isTableRecalculated=!1,setTimeout(function(){return t.isTableRecalculated=!0},0))}),this.billing.updateCurrencyNameAndSymbol(this.customer.id);case 9:case"end":return e.stop()}},e,this)}))}},{key:"ngOnDestroy",value:function(){this.operatorsSubscription.unsubscribe(),this.warehousesSubscription.unsubscribe(),this.usersSubscription.unsubscribe(),this.isOperatorsLoadedSubscription.unsubscribe(),this.isUsersLoadedSubscription.unsubscribe(),this.windowSubscription.unsubscribe()}},{key:"createUsersTable",value:function(e){var t=this;this.users=e.filter(function(e){return!t.operators.some(function(t){return e.email===t.id})})}},{key:"assignUser",value:function(e){var t=this;this.billing.addSubscription({tag:"serializedwarehouse-operator",message:"pricelist-assign-operator-no-disclaimer"}).pipe((0,V.w)(function(i){return i?t.serverService.post("/warehouse/assign_operator/".concat(t.warehouseService.customerID),{user_id:e._id}):(0,R.of)(!1)}),(0,E.b)(function(e){return e&&t.commonService.showUserNotification(e.message,"ok")})).subscribe(function(e){e&&t.warehouseService.getOperators().then(function(){return t.warehouseService.getAvailableOperators()})})}},{key:"removeUser",value:function(e){var t=this;this.dialogsService.createModal("remove-operator",this.translate.instant("confirm-remove")+e.id+"?","yes",!0,"no").subscribe(function(i){i&&t.serverService.delete("/warehouse/remove_operator/"+t.warehouseService.customerID,{operator_id:e._id}).subscribe(function(e){t.commonService.showUserNotification(e.message,"ok"),t.warehouseService.getOperators().then(function(){return t.warehouseService.getAvailableOperators()})})},function(e){console.error(e)})}},{key:"locationChange",value:function(e,t){var i=this,a={operator_id:e,location_id:t};this.serverService.post("/warehouse/assign_operator_location/"+this.warehouseService.customerID,a).subscribe(function(e){i.commonService.showUserNotification(e.message,"ok"),i.warehouseService.getOperators().then(function(){return i.warehouseService.getAvailableOperators()})})}}]),t}();ve.\u0275fac=function(e){return new(e||ve)(u.Y36(g.v),u.Y36(f.H),u.Y36(p.N),u.Y36(v.sK),u.Y36(x),u.Y36(_.u),u.Y36($.j),u.Y36(w.V))},ve.\u0275cmp=u.Xpm({type:ve,selectors:[["app-warehouse-operators"]],viewQuery:function(e,t){var i;(1&e&&(u.Gf(K,5),u.Gf(ee,5)),2&e)&&(u.iGM(i=u.CRH())&&(t.usersTable=i.first),u.iGM(i=u.CRH())&&(t.operatorsTable=i.first))},decls:1,vars:1,consts:[["class","content m-t","fxLayout","row","fxLayout.lt-lg","column","fxLayoutGap","10px",4,"ngIf"],["fxLayout","row","fxLayout.lt-lg","column","fxLayoutGap","10px",1,"content","m-t"],[1,"min-w-50"],[1,"panel","p-a-0"],["fxLayoutAlign","space-between center","color","accent",1,"panel-title"],["fxLayout","column"],["fxLayout","row","fxLayoutAlign","center center","class","m-a-lg p-a-lg",4,"ngIf"],["class","m-x m-t",4,"ngIf"],["class","material ngx-hide-shadow","id","usersTable",3,"rows","columnMode","headerHeight","footerHeight","rowHeight","messages","limit","scrollbarV","draggable","reorderable","loadingIndicator",4,"ngIf"],[1,"full-width"],["color","accent",1,"panel-title"],["fxLayout","row","fxLayoutAlign","center center",1,"m-a-lg","p-a-lg"],[1,"m-x","m-t"],["type","text","matInput","","placeholder","Search operators",3,"ngModel","ngModelChange"],["id","usersTable",1,"material","ngx-hide-shadow",3,"rows","columnMode","headerHeight","footerHeight","rowHeight","messages","limit","scrollbarV","draggable","reorderable","loadingIndicator"],["UsersTable",""],["prop","email",3,"name","minWidth","maxWidth"],["ngx-datatable-cell-template",""],[3,"minWidth","maxWidth","headerClass","cellClass"],["ngx-datatable-header-template",""],["mat-icon-button","","matTooltipPosition","above","color","primary",1,"material-table-btn",3,"matTooltip","click"],["aria-label","Assign"],["OperatorsTable",""],["cellClass","flex-center-content","prop","id",3,"name","minWidth","maxWidth"],["prop","id",3,"name","minWidth","maxWidth"],["cellClass","align-table-content-right",3,"minWidth","maxWidth","headerClass"],["color","accent","floatLabel","never",1,"full-width"],[3,"placeholder","value","selectionChange"],["value",""],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["mat-icon-button","","matTooltipPosition","above","color","warn",3,"matTooltip","click"],["aria-label","Remove"]],template:function(e,t){1&e&&u.YNc(0,fe,21,12,"div",0),2&e&&u.Q6J("ngIf",t.isPageLoaded)}
1,directives:[s.O5,T.xw,T.SQ,A.a8,L.Ye,T.Wh,S.d,A.dn,q.$g,N.KE,I.Nt,m.Fj,m.JJ,m.On,k.nE,k.UC,k.vq,k.tk,C.lW,U.gM,y.Hw,B.gD,z.ey,s.sg],pipes:[v.X$,X.g],encapsulation:2});var be=o(95190),Ze=["CustomersTable"];function we(e,t){1&e&&(u.TgZ(0,"div",14),u._UZ(1,"mat-spinner"),u.qZA())}function xe(e,t){if(1&e&&u._uU(0),2&e){var i=t.row;u.hij(" ",i.customer_name," ")}}function _e(e,t){1&e&&(u._uU(0),u.ALo(1,"translate")),2&e&&u.hij(" ",u.lcZ(1,1,"action")," ")}function Te(e,t){if(1&e){var i=u.EpF();u.TgZ(0,"div",21),u.TgZ(1,"button",22),u.NdJ("click",function(){var e=u.CHM(i).row;return u.oxw(2).deleteCustomer(e)}),u.ALo(2,"translate"),u.TgZ(3,"mat-icon",23),u._uU(4,"delete_forever"),u.qZA(),u.qZA(),u.qZA()}2&e&&(u.xp6(1),u.s9C("matTooltip",u.lcZ(2,1,"delete-customer")))}var Ae=function(e,t){return{emptyMessage:e,totalMessage:t}};function Le(e,t){if(1&e){var i=u.EpF();u.TgZ(0,"ngx-datatable",15,16),u.NdJ("select",function(e){return u.CHM(i),u.oxw().selectCustomer(e)}),u.ALo(2,"translate"),u.ALo(3,"translate"),u.TgZ(4,"ngx-datatable-column",17),u.ALo(5,"translate"),u.YNc(6,xe,1,1,"ng-template",18),u.qZA(),u.TgZ(7,"ngx-datatable-column",19),u.YNc(8,_e,2,3,"ng-template",20),u.YNc(9,Te,5,3,"ng-template",18),u.qZA(),u.qZA()}if(2&e){var a=u.oxw();u.Q6J("rows",a.customer)("columnMode","force")("headerHeight",50)("footerHeight",50)("rowHeight","auto")("messages",u.WLB(27,Ae,u.lcZ(2,21,"no-customers"),u.lcZ(3,23,"total")))("limit",10)("selected",a.selected)("reorderable",!1)("selectCheck",a.checkSelectable)("selectionType","single")("scrollbarV",!1)("draggable",!1)("loadingIndicator",a.isCustomerLoading),u.xp6(4),u.s9C("name",u.lcZ(5,25,"customer-name")),u.Q6J("minWidth","auto")("maxWidth","auto"),u.xp6(3),u.Q6J("minWidth","auto")("maxWidth","auto")("headerClass","align-table-content-right")("cellClass","align-table-content-right")}}function Ce(e,t){1&e&&(u.TgZ(0,"div",14),u._UZ(1,"mat-spinner"),u.qZA())}function ye(e,t){if(1&e&&(u.TgZ(0,"form",24),u.TgZ(1,"div"),u.TgZ(2,"mat-form-field",25),u._UZ(3,"input",26),u.ALo(4,"translate"),u.qZA(),u.qZA(),u.TgZ(5,"div"),u.TgZ(6,"mat-form-field",25),u.TgZ(7,"span",27),u._uU(8,"urn:epc:id:sgln:\xa0"),u.qZA(),u._UZ(9,"input",28),u.ALo(10,"translate"),u.qZA(),u.qZA(),u.qZA()),2&e){var i=u.oxw();u.Q6J("formGroup",i.customerFormGroup),u.xp6(3),u.s9C("placeholder",u.lcZ(4,3,"name")),u.xp6(6),u.s9C("placeholder",u.lcZ(10,5,"sgln-number"))}}function Se(e,t){if(1&e){var i=u.EpF();u.TgZ(0,"mat-list-item",29),u.TgZ(1,"button",30),u.NdJ("click",function(){return u.CHM(i),u.oxw().manageCustomer()}),u._uU(2),u.ALo(3,"translate"),u.qZA(),u.qZA()}if(2&e){var a=u.oxw();u.xp6(1),u.Q6J("disabled",!a.customerFormGroup.valid),u.xp6(1),u.hij(" ",u.lcZ(3,2,a.buttonTitle)," ")}}function qe(e,t){if(1&e){var i=u.EpF();u.TgZ(0,"button",48),u.NdJ("click",function(){u.CHM(i);var e=u.oxw().$implicit;return u.oxw(2).updateSite(e.site_id,e.site_name,e.site_gln_number)}),u.ALo(1,"translate"),u.TgZ(2,"mat-icon",49),u._uU(3,"check"),u.qZA(),u.qZA()}2&e&&u.s9C("matTooltip",u.lcZ(1,1,"update-site"))}function ke(e,t){if(1&e){var i=u.EpF();u.TgZ(0,"div",42),u.TgZ(1,"div",33),u.TgZ(2,"mat-form-field",8),u.TgZ(3,"input",43,44),u.NdJ("ngModelChange",function(e){return u.CHM(i).$implicit.site_name=e}),u.qZA(),u.qZA(),u.qZA(),u.TgZ(5,"div",33),u.TgZ(6,"mat-form-field",8),u.TgZ(7,"span",27),u._uU(8,"urn:epc:id:sgln:\xa0"),u.qZA(),u.TgZ(9,"input",43,44),u.NdJ("ngModelChange",function(e){return u.CHM(i).$implicit.site_gln_number=e})("ngModelChange",function(){var e=u.CHM(i).index;return u.oxw(2).siteChanged(e)}),u.qZA(),u.qZA(),u.qZA(),u.TgZ(11,"div",34),u.TgZ(12,"button",45),u.NdJ("click",function(){var e=u.CHM(i).$implicit;return u.oxw(2).removeSite(e.site_id,e.site_name)}),u.ALo(13,"translate"),u.TgZ(14,"mat-icon",46),u._uU(15,"delete_outline"),u.qZA(),u.qZA(),u.YNc(16,qe,4,3,"button",47),u.qZA(),u.qZA()}if(2&e){var a=t.$implicit;u.xp6(3),u.Q6J("ngModel",a.site_name),u.xp6(6),u.Q6J("ngModel",a.site_gln_number),u.xp6(3),u.s9C("matTooltip",u.lcZ(13,4,"remove-warehouse-site")),u.xp6(4),u.Q6J("ngIf",a.changed)}}function Ue(e,t){if(1&e){var i=u.EpF();u.TgZ(0,"mat-card",2),u.TgZ(1,"mat-toolbar",9),u._uU(2),u.ALo(3,"translate"),u.qZA(),u._UZ(4,"mat-divider"),u.TgZ(5,"mat-card-content",10),u.TgZ(6,"div",31),u.TgZ(7,"div",32),u.TgZ(8,"div",33),u.TgZ(9,"b"),u._uU(10),u.ALo(11,"translate"),u.qZA(),u.qZA(),u.TgZ(12,"div",33),u.TgZ(13,"b"),u._uU(14),u.ALo(15,"translate"),u.qZA(),u.qZA(),u._UZ(16,"div",34),u.qZA(),u.YNc(17,ke,17,6,"div",35),u.TgZ(18,"div",36),u.TgZ(19,"form",37),u.TgZ(20,"div",33),u.TgZ(21,"mat-form-field",8),u._UZ(22,"input",38),u.qZA(),u.qZA(),u.TgZ(23,"div",33),u.TgZ(24,"mat-form-field",8),u.TgZ(25,"span",27),u._uU(26,"urn:epc:id:sgln:\xa0"),u.qZA(),u._UZ(27,"input",39),u.qZA(),u.qZA(),u.TgZ(28,"div",34),u.TgZ(29,"button",40),u.NdJ("click",function(){return u.CHM(i),u.oxw().addSite()}),u.ALo(30,"translate"),u.TgZ(31,"mat-icon",41),u._uU(32,"add"),u.qZA(),u.qZA(),u.qZA(),u.qZA(),u.qZA(),u.qZA(),u.qZA(),u.qZA()}if(2&e){var a=u.oxw();u.xp6(2),u.hij(" ",u.lcZ(3,7,"customer-sites")," "),u.xp6(8),u.hij("",u.lcZ(11,9,"location-name")," "),u.xp6(4),u.hij("",u.lcZ(15,11,"sgln-number")," "),u.xp6(3),u.Q6J("ngForOf",a.sitesList),u.xp6(2),u.Q6J("formGroup",a.sitesFormGroup),u.xp6(10),u.s9C("matTooltip",u.lcZ(30,13,"add-site")),u.Q6J("disabled",!a.sitesFormGroup.valid)}}var Ne=function(){function t(i,a,o,s,r,n,c){var l=this;
1e(this,t),this.commonService=i,this.formBuilder=a,this.serverService=o,this.dialogsService=s,this.translate=r,this.warehouseService=n,this.windowService=c,this.isCustomerLoading=!1,this.isCustomerLoaded=!1,this.isPageLoaded=!1,this.isTraceLinkChannelMissing=!1,this.isTableRecalculated=!1,this.countries=[],this.traceLinkChannels=[],this.sitesList=[],this.selected=[],this.savedSelection=[],this.cardTitle="create-customer",this.buttonTitle="create",this.isPageLoadedSubscription=n.subscribeToCustomerLoading().subscribe(function(e){l.isCustomerLoading=e,l.isTableRecalculated=!0,e||(l.isCustomerLoaded=!0)})}return i(t,[{key:"ngOnInit",value:function(){var e=this;this.createForm(),this.customerSubscription=this.warehouseService.subscribeToCustomerCustomers().subscribe(function(t){e.customer=t,0!==e.savedSelection.length&&(e.selected=e.customer.filter(function(t){return t.customer_id===e.savedSelection[0].customer_id}),e.selectCustomer(e.selected))}),this.warehouseService.initializeCustomers(),this.windowSubscription=this.windowService.width$.subscribe(function(){e.customer&&(e.isTableRecalculated=!1,setTimeout(function(){e.isTableRecalculated=!0},0))})}},{key:"ngOnDestroy",value:function(){this.customerSubscription.unsubscribe(),this.isPageLoadedSubscription.unsubscribe(),this.windowSubscription.unsubscribe()}},{key:"initAddNewCustomer",value:function(){this.customerFormGroup.reset(),this.buttonTitle="create",this.cardTitle="create-customer",this.selected=[],this.table.recalculate()}},{key:"checkSelectable",value:function(e){return-1===this.selected.indexOf(e)}},{key:"selectCustomer",value:function(e){void 0!==this.selected[Object.keys(this.selected)[0]]?(this.buttonTitle="update",this.cardTitle="update-customer",this.savedSelection=this.selected,e.selected?this.setReceivedFormValues(e.selected[0]):this.setReceivedFormValues(e[0])):this.initAddNewCustomer()}},{key:"createForm",value:function(){this.customerFormGroup=this.formBuilder.group({customer_name:["",m.kI.required],customer_gln:["",[m.kI.required,be.u.valdiateGLN]]}),this.sitesFormGroup=this.formBuilder.group({site_name:["",m.kI.required],site_gln_number:["",[m.kI.required,be.u.valdiateGLN]]})}},{key:"setReceivedFormValues",value:function(e){this.customerID=e.customer_id,this.sitesList=e.customer_sites.map(function(e){return Object.assign(Object.assign({},e),{site_gln_number:e.site_gln_number.replace(/^(urn:epc:id:sgln:)+/,""),changed:!1})}),this.customerFormGroup.controls.customer_name.setValue(e.customer_name),this.customerFormGroup.controls.customer_gln.setValue(e.customer_gln.replace(/^(urn:epc:id:sgln:)+/,""))}},{key:"deleteCustomer",value:function(e){var t=this,i={customer_delete_id:e.customer_id};this.dialogsService.createModal("delete-customer",this.translate.instant("confirm-delete")+e.customer_name+"?","yes",!0,"no").subscribe(function(e){e?t.serverService.delete("/warehouse/customer/"+t.warehouseService.customerID,i).subscribe(function(e){t.commonService.showUserNotification(e.message,"ok"),t.warehouseService.getCustomers(),t.savedSelection=[],t.initAddNewCustomer()}):t.initAddNewCustomer()},function(e){console.error(e)})}},{key:"manageCustomer",value:function(){var e,t=this,i=this.customerFormGroup.value;i.customer_gln="urn:epc:id:sgln:"+i.customer_gln.replace(/^(urn:epc:id:sgln:)+/,""),"update"===this.buttonTitle?(i.customer_update_id=this.customerID,e=this.serverService.put("/warehouse/customer/"+this.warehouseService.customerID,i)):(this.savedSelection=[],e=this.serverService.post("/warehouse/customer/"+this.warehouseService.customerID,i)),e.subscribe(function(e){t.commonService.showUserNotification(e.message,"ok"),t.warehouseService.getCustomers(),0===t.savedSelection.length&&t.initAddNewCustomer()})}},{key:"removeSite",value:function(e,t){var i=this,a={warehouse_customer_id:this.customerID,site_id:e};this.dialogsService.createModal("delete-location",this.translate.instant("confirm-delete")+t+"?","yes",!0,"no").subscribe(function(e){e?i.serverService.delete("/warehouse/customer_site/"+i.warehouseService.customerID,a).subscribe(function(e){i.commonService.showUserNotification(e.message,"ok"),i.warehouseService.getCustomers()}):i.initAddNewCustomer()},function(e){console.error(e)})}},{key:"updateSite",value:function(e,t,i){var a=this,o={site_id:e,site_name:t,site_gln:"urn:epc:id:sgln:"+i.replace(/^(urn:epc:id:sgln:)+/,"")};this.serverService.put("/warehouse/customer_site/"+this.warehouseService.customerID,o).subscribe(function(e){a.commonService.showUserNotification(e.message,"ok"),a.warehouseService.getCustomers()})}},{key:"siteChanged",value:function(e){this.sitesList[e].changed=!0}},{key:"addSite",value:function(){var e=this,t=this.sitesFormGroup.value;t.site_gln="urn:epc:id:sgln:"+t.site_gln_number.replace(/^(urn:epc:id:sgln:)+/,""),t.warehouse_customer_id=this.customerID,this.serverService.post("/warehouse/customer_site/"+this.warehouseService.customerID,t).subscribe(function(t){e.commonService.showUserNotification(t.message,"ok"),e.warehouseService.getCustomers(),e.sitesFormGroup.reset()})}}]),t}();function Ie(e,t){1&e&&(u.TgZ(0,"span"),u._uU(1),u.ALo(2,"translate"),u.qZA()),2&e&&(u.xp6(1),u.Oqu(u.lcZ(2,1,"attp-not-connected")))}function Je(e,t){1&e&&u._UZ(0,"br")}function We(e,t){1&e&&(u.TgZ(0,"span"),u._uU(1),u.ALo(2,"translate"),u.qZA()),2&e&&(u.xp6(1),u.Oqu(u.lcZ(2,1,"rfc-not-connected")))}function Oe(e,t){if(1&e&&(u.TgZ(0,"div",7),u.YNc(1,Ie,3,3,"span",8),u.YNc(2,Je,1,0,"br",8),u.YNc(3,We,3,3,"span",8),u.qZA()),2&e){var i=u.oxw();u.xp6(1),u.Q6J("ngIf",!(null!=i.settings&&i.settings.attp_channel)),u.xp6(1),u.Q6J("ngIf",!(null!=i.settings&&i.settings.attp_channel)),u.xp6(1),u.Q6J("ngIf",!(null!=i.settings&&i.settings.rfc_channel))}}function Ye(e,t){1&e&&(u.TgZ(0,"div",9),u._UZ(1,"mat-spinner"),u.qZA())}function Me(e,t){if(1&e&&(u.TgZ(0,"mat-option",17),u._uU(1),u.qZA()),2&e){var i=t.$
1implicit;u.Q6J("value",i._id),u.xp6(1),u.hij(" ",i.title," ")}}function Qe(e,t){if(1&e&&(u.TgZ(0,"mat-option",17),u._uU(1),u.qZA()),2&e){var i=t.$implicit;u.Q6J("value",i._id),u.xp6(1),u.hij(" ",i.title," ")}}function Fe(e,t){if(1&e){var i=u.EpF();u.TgZ(0,"div",10),u.TgZ(1,"mat-form-field",11),u.TgZ(2,"mat-select",12),u.NdJ("ngModelChange",function(e){return u.CHM(i),u.oxw().settings.attp_channel=e}),u.ALo(3,"translate"),u.TgZ(4,"mat-option",13),u._uU(5),u.ALo(6,"translate"),u.qZA(),u.YNc(7,Me,2,2,"mat-option",14),u.qZA(),u.qZA(),u.TgZ(8,"mat-form-field",11),u.TgZ(9,"mat-select",12),u.NdJ("ngModelChange",function(e){return u.CHM(i),u.oxw().settings.rfc_channel=e}),u.ALo(10,"translate"),u.TgZ(11,"mat-option",13),u._uU(12),u.ALo(13,"translate"),u.qZA(),u.YNc(14,Qe,2,2,"mat-option",14),u.qZA(),u.qZA(),u.TgZ(15,"mat-list-item",15),u.TgZ(16,"button",16),u.NdJ("click",function(){return u.CHM(i),u.oxw().saveWarehouseSettings()}),u._uU(17),u.ALo(18,"translate"),u.qZA(),u.qZA(),u.qZA()}if(2&e){var a=u.oxw();u.xp6(2),u.s9C("placeholder",u.lcZ(3,9,"business-channel-attp")),u.Q6J("ngModel",a.settings.attp_channel),u.xp6(3),u.hij(" ",u.lcZ(6,11,"select-channel")," "),u.xp6(2),u.Q6J("ngForOf",a.attpChannels),u.xp6(2),u.s9C("placeholder",u.lcZ(10,13,"business-channel-rfc")),u.Q6J("ngModel",a.settings.rfc_channel),u.xp6(3),u.hij(" ",u.lcZ(13,15,"select-channel")," "),u.xp6(2),u.Q6J("ngForOf",a.rfcChannels),u.xp6(3),u.hij(" ",u.lcZ(18,17,"save-settings")," ")}}Ne.\u0275fac=function(e){return new(e||Ne)(u.Y36(g.v),u.Y36(m.qu),u.Y36(p.N),u.Y36(f.H),u.Y36(v.sK),u.Y36(x),u.Y36(_.u))},Ne.\u0275cmp=u.Xpm({type:Ne,selectors:[["app-warehouse-customers"]],viewQuery:function(e,t){var i;(1&e&&u.Gf(Ze,5),2&e)&&(u.iGM(i=u.CRH())&&(t.table=i.first))},decls:28,vars:15,consts:[["fxLayout","row","fxLayout.lt-lg","column","fxLayoutGap","10px",1,"content","m-t"],[1,"min-w-50"],[1,"panel","p-a-0"],["fxLayoutAlign","space-between center","color","accent",1,"panel-title"],["mat-raised-button","","color","primary",1,"list-button","pull-right",3,"click"],["fxLayout","row","fxLayoutAlign","center center","class","m-a-lg p-a-lg",4,"ngIf"],["class","material ngx-hide-shadow","id","selectableTable",3,"rows","columnMode","headerHeight","footerHeight","rowHeight","messages","limit","selected","reorderable","selectCheck","selectionType","scrollbarV","draggable","loadingIndicator","select",4,"ngIf"],["fxLayout","column","fxLayoutGap","10px",1,"full-width"],[1,"full-width"],["color","accent",1,"panel-title"],[1,"p-a-md"],[3,"formGroup",4,"ngIf"],["class","text-center",4,"ngIf"],["class","panel p-a-0",4,"ngIf"],["fxLayout","row","fxLayoutAlign","center center",1,"m-a-lg","p-a-lg"],["id","selectableTable",1,"material","ngx-hide-shadow",3,"rows","columnMode","headerHeight","footerHeight","rowHeight","messages","limit","selected","reorderable","selectCheck","selectionType","scrollbarV","draggable","loadingIndicator","select"],["CustomersTable",""],["prop","name","cellClass","flex-center-content",3,"name","minWidth","maxWidth"],["ngx-datatable-cell-template",""],[3,"minWidth","maxWidth","headerClass","cellClass"],["ngx-datatable-header-template",""],["fxLayout","row","fxLayoutAlign","end center","fxLayoutGap","10px"],["mat-icon-button","","matTooltipPosition","above","color","warn",1,"material-table-btn",3,"matTooltip","click"],["aria-label","'delete-customer' | translate"],[3,"formGroup"],["color","accent",1,"full-width"],["type","text","matInput","","formControlName","customer_name","required","",1,"form-control",3,"placeholder"],["matPrefix",""],["type","text","matInput","","formControlName","customer_gln",1,"form-control",3,"placeholder"],[1,"text-center"],["mat-raised-button","","color","primary","type","button",1,"text-uppercase","p-x-lg","m-x-auto","d-inline-block","m-t","m-b",3,"disabled","click"],["fxLayout","column","fxLayoutGap","10px",1,"manage-component"],["fxLayout","row",1,"title-component","full-width"],["fxFlex","40"],["fxFlex","20"],["class","input-component full-width","fxLayout","row","fxLayoutGap","10px",4,"ngFor","ngForOf"],[1,"input-component","full-width"],["fxLayout","row","fxLayoutGap","10px",3,"formGroup"],["matInput","","formControlName","site_name"],["matInput","","formControlName","site_gln_number"],["mat-mini-fab","","color","primary","matTooltipPosition","above",3,"disabled","matTooltip","click"],["aria-label","Add more"],["fxLayout","row","fxLayoutGap","10px",1,"input-component","full-width"],["matInput","","required","",3,"ngModel","ngModelChange"],["number","ngModel"],["mat-mini-fab","","matTooltipPosition","above","color","warn",3,"matTooltip","click"],["aria-label","'remove-warehouse-site' | translate"],["class","m-l","mat-mini-fab","","matTooltipPosition","above","color","primary",3,"matTooltip","click",4,"ngIf"],["mat-mini-fab","","matTooltipPosition","above","color","primary",1,"m-l",3,"matTooltip","click"],["aria-label","'update-site' | translate"]],template:function(e,t){1&e&&(u.TgZ(0,"div",0),u.TgZ(1,"div",1),u.TgZ(2,"mat-card",2),u.TgZ(3,"mat-toolbar",3),u._uU(4),u.ALo(5,"translate"),u.TgZ(6,"button",4),u.NdJ("click",function(){return t.initAddNewCustomer()}),u._uU(7),u.ALo(8,"translate"),u.TgZ(9,"mat-icon"),u._uU(10,"add"),u.qZA(),u.qZA(),u.qZA(),u._UZ(11,"mat-divider"),u.TgZ(12,"mat-card-content"),u.YNc(13,we,2,0,"div",5),u.YNc(14,Le,10,30,"ngx-datatable",6),u.qZA(),u.qZA(),u.qZA(),u.TgZ(15,"div",7),u.TgZ(16,"div",8),u.TgZ(17,"mat-card",2),u.TgZ(18,"mat-toolbar",9),u._uU(19),u.ALo(20,"translate"),u.qZA(),u._UZ(21,"mat-divider"),u.TgZ(22,"mat-card-content",10),u.YNc(23,Ce,2,0,"div",5),u.YNc(24,ye,11,7,"form",11),u.YNc(25,Se,4,4,"mat-list-item",12),u.qZA(),u.qZA(),u.qZA(),u.TgZ(26,"div",8),u.YNc(27,Ue,33,15,"mat-card",13),u.qZA(),u.qZA(),u.qZA()),2&e&&(u.xp6(4),u.hij(" ",u.lcZ(5,9,"customers")," "),u.xp6(3),u.hij(" ",u.lcZ(8,11,"add-new"),"\xa0\xa0 "),u.xp6(6),u.Q6J("ngIf",!t.isCustomerLoaded),u.xp6(1),u.Q6J("ngIf",t.isCustomerLoaded&&t.isTableRecalculated),u.xp6(5),u.Oqu(u.lcZ(20,13,t.cardTitle)),u.xp6(4),u.Q6J("ngIf",!t.isCustomerLoaded),u.xp6(1),u.Q6J("ngIf",t.isCustomerLoaded),u.xp6(1),u.Q6J("ngIf",t.isCustomerLoaded),u.xp6(2),u.Q6J("ngIf","update"===t.buttonTitle))},directives:[T.xw,T.SQ,A.a8,L.Ye,T.Wh,C.lW,y.Hw,S.d,A.dn,s.O5,q.$g,k.nE,k.UC,k.vq,k.tk,U.gM,m._Y,m.JL,m.sg,N.KE,I.Nt,m.Fj,m.JJ,m.u,m.Q7,N.qo,J.Tg,T.yH,s.sg,m.On],pipes:[v.X$],encapsulation:2});var He=function(){function t(i,a,o){e(this,t),this.commonService=i,this.serverService=a,this.warehouseService=o,this.isPageLoaded=!1}return i(t,[{key:"ngOnInit",value:function(){var e=this;this.businessChannelsSubscription=this.warehouseService.subscribeToBusinessChannels().subscribe(function(t){e.attpChannels=t.filter(function(e){return"sap-attp"===e.channel.tag.toLowerCase()}).sort(function(e,t){return e.title.localeCompare(t.title)}),e.rfcChannels=t.filter(function(e){return"sap-rfc"===e.channel.tag.toLowerCase()}).sort(function(e,t){return e.title.localeCompare(t.title)})}
1),this.settingsSubscription=this.warehouseService.subscribeToSettings().subscribe(function(t){e.settings=t,e.isPageLoaded=!0}),this.warehouseService.initializeSettings()}},{key:"ngOnDestroy",value:function(){this.settingsSubscription.unsubscribe(),this.businessChannelsSubscription.unsubscribe()}},{key:"saveWarehouseSettings",value:function(){var e=this,t={business_channel_attp_id:this.settings.attp_channel,business_channel_rfc_id:this.settings.rfc_channel};this.serverService.post("/warehouse/settings/"+this.warehouseService.customerID,t).subscribe(function(t){e.commonService.showUserNotification(t.message,"ok"),e.warehouseService.getSettings()})}}]),t}();He.\u0275fac=function(e){return new(e||He)(u.Y36(g.v),u.Y36(p.N),u.Y36(x))},He.\u0275cmp=u.Xpm({type:He,selectors:[["app-warehouse-settings"]],decls:11,vars:6,consts:[["class","alert-toolbar p-a m-t",4,"ngIf"],["fxLayout","row","fxLayout.lt-lg","column","fxLayoutGap","10px",1,"content","m-t"],[1,"min-w-50"],[1,"panel","p-a-0"],["fxLayoutAlign","space-between center","color","accent",1,"panel-title"],["fxLayout","row","fxLayoutAlign","center center","class","m-a-lg p-a-lg",4,"ngIf"],["class","p-x-lg p-y m-y",4,"ngIf"],[1,"alert-toolbar","p-a","m-t"],[4,"ngIf"],["fxLayout","row","fxLayoutAlign","center center",1,"m-a-lg","p-a-lg"],[1,"p-x-lg","p-y","m-y"],["color","accent",1,"full-width"],[3,"placeholder","ngModel","ngModelChange"],["value",""],[3,"value",4,"ngFor","ngForOf"],[1,"text-center"],["mat-raised-button","","color","primary","type","button",1,"text-uppercase","p-x-lg","m-x-auto","d-inline-block","m-t","m-b",3,"click"],[3,"value"]],template:function(e,t){1&e&&(u.YNc(0,Oe,4,3,"div",0),u.TgZ(1,"div",1),u.TgZ(2,"div",2),u.TgZ(3,"mat-card",3),u.TgZ(4,"mat-toolbar",4),u._uU(5),u.ALo(6,"translate"),u.qZA(),u._UZ(7,"mat-divider"),u.TgZ(8,"mat-card-content"),u.YNc(9,Ye,2,0,"div",5),u.YNc(10,Fe,19,19,"div",6),u.qZA(),u.qZA(),u.qZA(),u.qZA()),2&e&&(u.Q6J("ngIf",(!(null!=t.settings&&t.settings.attp_channel)||!(null!=t.settings&&t.settings.rfc_channel))&&t.isPageLoaded),u.xp6(5),u.hij(" ",u.lcZ(6,4,"settings")," "),u.xp6(4),u.Q6J("ngIf",!t.isPageLoaded),u.xp6(1),u.Q6J("ngIf",t.isPageLoaded))},directives:[s.O5,T.xw,T.SQ,A.a8,L.Ye,T.Wh,S.d,A.dn,q.$g,N.KE,B.gD,m.JJ,m.On,z.ey,s.sg,J.Tg,C.lW],pipes:[v.X$],encapsulation:2});var Ge=[{path:"",component:h,data:{breadcrumb:!1},children:[{path:"",component:D,data:{breadcrumb:"Warehouse Locations",permission:["moderator","hierarchy"]},canActivate:[l.kl]},{path:"operators",component:ve,data:{breadcrumb:"Operators",permission:["moderator","hierarchy"]},canActivate:[l.kl]},{path:"customers",component:Ne,data:{breadcrumb:"Customers",permission:["moderator","hierarchy"]},canActivate:[l.kl]},{path:"settings",component:He,data:{breadcrumb:"Settings",permission:["moderator","hierarchy"]},canActivate:[l.kl]}]}],Pe=function t(){e(this,t)};Pe.\u0275fac=function(e){return new(e||Pe)},Pe.\u0275mod=u.oAB({type:Pe}),Pe.\u0275inj=u.cJS({imports:[[c.Bz.forChild(Ge)],c.Bz]});var De=function t(){e(this,t)};De.\u0275fac=function(e){return new(e||De)},De.\u0275mod=u.oAB({type:De}),De.\u0275inj=u.cJS({imports:[[s.ez,r.V,n.m,Pe]]})}}])}();
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.