1import{a as ne,b as ae,c as Ke,d as re,e as le,f as se,g as ce,h as de}from"./chunk-HSXZMYXG.js";import{a as E}from"./chunk-EWUBXXJI.js";import{Ka as me,La as v,Ma as P,Ra as je,Yb as Ze,_b as oe,dc as Ye,ec as x,ob as ie,qb as Je,rb as qe,xa as N}from"./chunk-C37Y3VJ4.js";import{$e as U,Aa as ye,Bb as F,Cf as Qe,D as he,Fb as W,Gb as V,Gf as C,Hb as G,Ic as Oe,Jc as q,Ka as o,Kb as Le,Nb as l,Oc as Me,P as w,Pb as s,Tf as S,Ua as b,Uc as k,Ue as ke,Uf as We,Ve as $e,Wc as pe,We as ze,Xe as Ve,Zc as Ee,_c as Z,a as y,bd as He,ca as be,cd as $,ea as I,eb as we,ed as Y,fb as Ie,fc as c,gb as T,gc as d,ia as _e,ib as L,l as ge,ld as Fe,le as X,ma as m,md as K,me as ee,nb as u,ob as n,pa as De,pb as a,qa as Ce,qb as _,te as Ae,u as ve,ud as Ne,va as Se,vc as J,vd as Pe,ve as Be,wa as j,we as te,xb as Te,xd as z,xe as Re,xf as Ge,y as fe,yc as xe,yf as Ue,zb as D}from"./chunk-RTYCSUAA.js";var Xe=(()=>{class r{static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275cmp=b({type:r,selectors:[["app-main-device-hub"]],decls:3,vars:0,consts:[["inputHeadingName","nav.deviceHub"],[1,"container"]],template:function(t,i){t&1&&(_(0,"app-lp-header",0),n(1,"main",1),_(2,"router-outlet"),a())},dependencies:[x,Ye,$e],encapsulation:2})}}return r})();var O=(()=>{class r{constructor(){this.httpClient=m(Me),this.logger=m(Ge),this.environment=m(Ue),this.baseUrl=`${this.environment.config.restUrl}/deviceHub`}getDeviceHubDevices({organizationId:e,siteId:t,locationId:i,deviceStatus:p,androidIdSearchTerm:g}){let h=new q;return e!==null&&(h=h.set("organizationId",JSON.stringify(e))),t!==null&&(h=h.set("siteId",JSON.stringify(t))),i!==null&&(h=h.set("locationId",JSON.stringify(i))),p&&(h=h.set("deviceStatus",p)),g&&(h=h.set("androidIdSearchTerm",g)),this.httpClient.get(`${this.baseUrl}/devices`,{params:h}).pipe(w(1),I({next:()=>this.logger.info("GET Device Hub Devices"),error:f=>this.logger.error(`Could Not GET Device Hub Devices: ${f.status} ${f.statusText} ${f.message}`)}),fe(f=>f.map(H=>({tableData:H}))))}exportDeviceHubDevices({organizationId:e,siteId:t,locationId:i,deviceStatus:p,androidIdSearchTerm:g}){let h=new Oe().set("Accept","text/csv"),f=new q;return e!==null&&(f=f.set("organizationId",JSON.stringify(e))),t!==null&&(f=f.set("siteId",JSON.stringify(t))),i!==null&&(f=f.set("locationId",JSON.stringify(i))),p&&(f=f.set("deviceStatus",p)),g&&(f=f.set("androidIdSearchTerm",g)),this.httpClient.get(`${this.baseUrl}/devices/export`,{headers:h,params:f,responseType:"blob"}).pipe(w(1),I({next:()=>this.logger.info("Download Device Hub Devices"),error:H=>this.logger.error(`Could Not Download Device Hub Devices: ${H.status} ${H.statusText} ${H.message}`)}))}getDeviceById(e){return this.httpClient.get(`${this.baseUrl}/devices/${e}`).pipe(w(1),I({next:()=>this.logger.info("GET Device Hub Device by ID"),error:t=>this.logger.error(`Could Not GET Device Hub Device by ID: ${t.status} ${t.statusText} ${t.message}`)}))}getDeviceLogs(e,{limitOffset:t,limitCount:i,logDateTimeStart:p,logDateTimeEnd:g,logAreas:h,logTypes:f,messageQueryString:H},ue=null){let lt=`logDateTimeStart=${encodeURIComponent(p)}&logDateTimeEnd=${encodeURIComponent(g)}`,M=new q().set("limitOffset",JSON.stringify(t)).set("limitCount",JSON.stringify(i));return h.forEach(A=>M=M.append("logArea",A)),f.forEach(A=>M=M.append("logType",A)),H&&(M=M.set("messageQueryString",H)),ue&&(M=M.set("androidId",ue)),this.httpClient.get(`${this.baseUrl}/devices/${e}/logs?${lt}`,{params:M}).pipe(w(1),I({next:()=>this.logger.info("GET Device Hub Device Log"),error:A=>this.logger.error(`Could Not GET Device Hub Device Log: ${A.status} ${A.statusText} ${A.message}`)}))}getDeviceLogAreas(){return this.httpClient.get(`${this.baseUrl}/logAreas`).pipe(w(1),I({next:()=>this.logger.info("GET Device Hub Log Areas"),error:e=>this.logger.error(`Could Not GET Device Hub Log Areas: ${e.status} ${e.statusText} ${e.message}`)}))}getDeviceLogTypes(){return this.httpClient.get(`${this.baseUrl}/logTypes`).pipe(w(1),I({next:()=>this.logger.info("GET Device Hub Log Types"),error:e=>this.logger.error(`Could Not GET Device Hub Log Types: ${e.status} ${e.statusText} ${e.message}`)}))}getDeviceLogAreasAndTypes(){return he([this.getDeviceLogAreas(),this.getDeviceLogTypes()]).pipe(w(1),I({next:()=>this.logger.info("GET Device Log Areas and Types"),error:e=>this.logger.error(`Could not GET Device Log Areas and Types: ${e.status} ${e.statusText} ${e.message}`)}))}getDeviceLogConfig(e){return this.httpClient.get(`${this.baseUrl}/devices/${e}/logs/config`).pipe(w(1),I({next:()=>this.logger.info("GET Device Hub Log Config"),error:t=>this.logger.error(`Could Not GET Device Hub Log Config: ${t.status} ${t.statusText} ${t.message}`)}))}putDeviceLogConfig(e,t){return this.httpClient.put(`${this.baseUrl}/devices/${e}/logs/config`,{logIntensity:t}).pipe(w(1),I({next:()=>this.logger.info("PUT Device Hub Log Config"),error:i=>this.logger.error(`Could Not PUT Device Hub Log Config: ${i.status} ${i.statusText} ${i.message}`)}))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275prov=_e({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var tt=(()=>
1{class r{constructor(){this.formBuilder=m(Pe),this.organizationOptions=[],this.siteOptions=[],this.locationOptions=[],this.deviceStatusOptions=[{name:"global.all",value:""},{name:`deviceStatus.${E.ONLINE.toString()}`,value:E.ONLINE.toString()},{name:`deviceStatus.${E.OFFLINE.toString()}`,value:E.OFFLINE.toString()},{name:`deviceStatus.${E.AWAITING_INSTALL.toString()}`,value:E.AWAITING_INSTALL.toString()},{name:`deviceStatus.${E.NOT_IN_USE.toString()}`,value:E.NOT_IN_USE.toString()}],this.filterSelected=new j}ngOnInit(){this.buildForm()}get organizationId(){return this.filterForm.controls.organizationId}get siteId(){return this.filterForm.controls.siteId}get locationId(){return this.filterForm.controls.locationId}get deviceStatus(){return this.filterForm.controls.deviceStatus}get androidIdSearchTerm(){return this.filterForm.controls.androidIdSearchTerm}buildForm(){this.filterForm=this.formBuilder.group({organizationId:new $(null),siteId:new $(null),locationId:new $(null),deviceStatus:new $(""),androidIdSearchTerm:new $("")}),this.filterSelected.emit(y({},this.filterForm.value))}onOrganizationSelected(e){this.organizationId.setValue(e||null),this.siteId.setValue(null),this.locationId.setValue(null),this.filterSelected.emit(y({},this.filterForm.value))}onSiteSelected(e){this.siteId.setValue(e?e.siteId:null),this.locationId.setValue(null),this.filterSelected.emit(y({},this.filterForm.value))}onLocationSelected(e){this.locationId.setValue(e?e.locationId:null),this.filterSelected.emit(y({},this.filterForm.value))}onDeviceStatusSelected(e){this.deviceStatus.setValue(e.value),this.filterSelected.emit(y({},this.filterForm.value))}onAndroidSearchClicked(){this.filterSelected.emit(y({},this.filterForm.value))}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275cmp=b({type:r,selectors:[["app-device-hub-device-list-filters"]],outputs:{filterSelected:"filterSelected"},decls:12,vars:6,consts:[[1,"form",3,"formGroup"],[3,"organizationSelection","allOrganizationsSelected","siteSelection","locationSelection","enableAllSitesAndLocations"],["label","global.deviceStatus","propertyName","device-status",3,"optionSelected","options"],[1,"filter"],["for","search-term",1,"filter__label"],[1,"android-id-search__box"],["type","search","name","android-id-search-term","id","android-id-search-term","formControlName","androidIdSearchTerm",1,"form-control","android-id-search__input"],[1,"android-id-search__btn","btn","btn-primary",3,"click"],[1,"material-symbols-rounded"]],template:function(t,i){t&1&&(n(0,"form",0)(1,"app-lp-osl-selector",1),D("organizationSelection",function(g){return i.onOrganizationSelected(g)})("allOrganizationsSelected",function(g){return i.onOrganizationSelected(g)})("siteSelection",function(g){return i.onSiteSelected(g)})("locationSelection",function(g){return i.onLocationSelected(g)}),a(),n(2,"app-lp-dropdown-menu",2),D("optionSelected",function(g){return i.onDeviceStatusSelected(g)}),a(),n(3,"div",3)(4,"label",4),l(5),c(6,"translate"),a(),n(7,"div",5),_(8,"input",6),n(9,"button",7),D("click",function(){return i.onAndroidSearchClicked()}),n(10,"mat-icon",8),l(11," search "),a()()()()()),t&2&&(u("formGroup",i.filterForm),o(),u("enableAllSitesAndLocations",!0),o(),u("options",i.deviceStatusOptions),o(3),s(" ",d(6,4,"deviceHub.androidId")," "))},dependencies:[x,je,Ze,ee,X,S,z,Y,k,Ee,Z,K,Fe,C],styles:[".form[_ngcontent-%COMP%]{align-items:flex-end;display:flex;flex-wrap:wrap;margin-bottom:1rem}.filter[_ngcontent-%COMP%]{margin:.5rem .5rem 0;min-width:10rem;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.android-id-search__box[_ngcontent-%COMP%]{display:flex;width:20rem}.android-id-search__input[_ngcontent-%COMP%]{border-radius:.25rem 0 0 .25rem}.android-id-search__btn[_ngcontent-%COMP%]{border-radius:0 .25rem .25rem 0}.filter__label[_ngcontent-%COMP%]{color:#3a3a3a;display:block;font-size:.75rem;margin-bottom:.25rem}"]})}}return r})();function dt(r,R){r&1&&(n(0,"p",5),l(1),c(2,"translate"),a()),r&2&&(o(),s(" ",d(2,1,"global.error.failedCSVDownload")," "))}var it=(()=>{class r{constructor(){this.localeDateTime=m(N),this.service=m(O),this.router=m(ze),this.churnZero=m(Qe),this.filters=null,this.selectedData=null,this.downloadingDevices=!1,this.showDownloadError=!1,this.headers=[new v("global.site","siteName"),new v("global.location","locationName",{dataDisplay:e=>e,dataClasses:(e,{tableData:t})=>t.locationStatus!=="ACTIVE"?["data--italic"]:[]}),new v("global.locationStatus","locationStatus",{dataDisplay:e=>e,dataClasses:e=>e==="ACTIVE"?["data--active"]:["data--inactive"]}),new v("global.device","deviceName"),new v("global.deviceType","deviceType",{dataDisplay:e=>re(e)}),new v("global.softwareVersion","softwareVersion",{dataDisplay:e=>e||"-"}),new v("deviceHub.ipAddress","ipAddress",{dataDisplay:e=>e||"-"}),new v("deviceHub.androidId","androidId",{dataDisplay:e=>e||"-"}),new v("deviceHub.flows","flowDesc",{dataDisplay:e=>e||"-"}),new v("deviceHub.scaleMode","scaleMode",{dataDisplay:e=>se(e)}),new v("global.instantWin","instantWinEnabled",{dataDisplay:e=>e?"global.on":"global.off",dataClasses:e=>de(e)}),new v("global.status","trackerStatus",{dataDisplay:e=>e,dataClasses:e=>ce(e)}),new v("global.connection","connectionType",{dataDisplay:e=>le(e)}),new v("global.mode","trainingModeEnabled",{dataDisplay:e=>e?"global.training":"global.tracking"}),new v("deviceHub.lastPing","lastPingDateTime",{dataDisplay:e=>e?this.localeDateTime.toLocaleDateTime(e):"-"}),new v("deviceMonitor.lastTransaction","lastTransactionDateTime",{dataDisplay:e=>e?this.localeDateTime.toLocaleDateTime(e):"-"})],this.lastIcons=[new me("view_list",()=>!0,({tableData:e})=>this.router.navigate(["device-hub/device-logs",e.deviceId],{queryParams:{androidId:e.androidId}}),()=>["icon--medium","material-symbols-outlined","icon--clickable"],"deviceHub.deviceLogs"),new me("settings",()=>!0,({tableData:e})=>this.deviceParameterModal.open(e.deviceId),()=>["icon--medium","icon--clickable"],"deviceHub.setupParameters")]}setFilters(e){this.filters=e,this.filters.organizationId?this.getDevices():this.setTableRows()}getDevices(){this.table.loading=!0,this.showDownloadError=!1,this.service.getDeviceHubDevices(this.filters).subscribe({next:e=>this.setTableRows(e),error:()=>this.setTableRows()})}downloadDevices(){this.downloadingDevices=!0,this.showDownloadError=!1,this.service.exportDeviceHubDevices(this.filters).subscribe({next:e=>this.churnZero.download(e,"","devices.csv"),error:()=>{this.showDownloadError=!0,this.downloadingDevices=!1},complete:()=>this.downloadingDevices=!1})}setTableRows(e=[]){this.table.rows=e,this.table.filteredRows=e,this.table.loading=!1}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275cmp=b({type:r,selectors:[["app-device-hub-device-list"]],viewQuery:function(t,i){if(t&1&&W(P,7)(oe,5),t&2){let p;V(p=G())&&(i.table=p.first),V(p=G())&&(i.deviceParameterModal=p.first)}},decls:13,vars:13,consts:[[3,"filterSelected"],[1,"main__table"],[1,"main__table__header"],[1,"main__table__title"],[1,"main__table__button"],[1,"error"],["type","button",1,"btn","btn-primary","btn-sm",3,"click","disabled"],[3,"headers","lastIcons","noDataMessage"]],template:function(t,i){t&1&&(n(0,"app-device-hub-device-list-filters",0),D("filterSelected",function(g){return i.setFilters(g)}),a(),n(1,"section",1)(2,"div",2)(3,"h2",3),l(4),c(5,"translate"),a(),n(6,"div",4),T(7,dt,3,3,"p",5),n(8,"button",6),D("click",function(){return i.downloadDevices()}),l(9),c(10,"translate"),a()()(),_(11,"app-lp-table",7),a(),_(12,"app-lp-device-parameter-modal")),t&2&&(o(4),s(" ",d(5,9,"global.devices")," "),o(3),L(i.showDownloadError?7:-1),o(),Le("loading",i.downloadingDevices),u("disabled",i.downloadingDevices||i.table.loading),o(),s(" ",d(10,11,"global.downloadCSV")," "),o(2),u("headers",i.headers)("lastIcons",i.lastIcons)("noDataMessage",i.filters!=null&&i.filters.organizationId?"global.noData":"deviceHub.noOrgSelected"))},dependencies:[x,P,oe,tt,S,C],styles:[".main__table[_ngcontent-%COMP%]{margin:.5rem}.main__table__header[_ngcontent-%COMP%]{align-items:center;display:flex;justify-content:space-between;margin-bottom:.75rem}.main__table__title[_ngcontent-%COMP%]{color:#3a3a3a;font-size:1.125rem;font-weight:700;margin:0}.main__table__button[_ngcontent-%COMP%]{align-items:center;display:flex}.loading[_ngcontent-%COMP%]{cursor:wait}.error[_ngcontent-%COMP%]{color:#ef0b3e;font-size:.875rem;font-weight:700;margin:0 .75rem;text-align:right}"]})}}return r})();function mt(r,R){if(r&1){let e=Te();n(0,"form",2),D("ngSubmit",function(){De(e);let i=F();return Ce(i.onSubmit())}),_(1,"app-lp-date-range-input",3)(2,"app-lp-single-select",4)(3,"app-lp-multi-select-chip-grid",5)(4,"app-lp-multi-select-chip-grid",6)(5,"app-lp-text-input",7),n(6,"div",8)(7,"button",9),l(8),c(9,"translate"),a()()()}if(r&2){let e=F();u("formGroup",e.deviceLogForm),o(),u("dateRangeFormGroup",e.dateRange)("max",e.maxEndDate),o(),u("singleSelectFormControl",e.time)("options",e.timeOptions),o(),u("options",e.logAreas)("allOption",e.allLogAreasOption),o(),u("options",e.logTypes)("allOption",e.allLogTypesOption),o(),u("textInputFormControl",e.messageQueryString),o(3),s(" ",d(9,11,"global.applyFilters")," ")}}function ut(r,R){r&1&&(n(0,"p",1),l(1),c(2,"translate"),a()),r&2&&(o(),s(" ",d(2,1,"global.error.unknown")," "))}var ot=(()=>
1{class r{constructor(){this.deviceHubService=m(O),this.localeDateTime=m(N),this.formBuilder=m(Ne),this.now=U.now(),this.defaultStartDate=U.now().startOf("day"),this.defaultEndDate=U.now().endOf("day"),this.maxEndDate=this.defaultEndDate.plus({day:1}),this.timeOptions=this.setTimeOptions(),this.deviceLogForm=null,this.logAreasAndTypesError=!1,this.allLogAreasOption=this.formBuilder.nonNullable.group({name:this.formBuilder.nonNullable.control("global.all"),value:this.formBuilder.nonNullable.control(Ke.ALL_AREAS),selected:this.formBuilder.nonNullable.control(!0),index:this.formBuilder.nonNullable.control(0)}),this.allLogTypesOption=this.formBuilder.nonNullable.group({name:this.formBuilder.nonNullable.control("global.all"),value:this.formBuilder.nonNullable.control(ae.ALL_TYPES),selected:this.formBuilder.nonNullable.control(!0),index:this.formBuilder.nonNullable.control(0)}),this.deviceLogFormSubmitted=new j,this.unsubscribe=new ge}get dateRange(){return this.deviceLogForm.controls.dateRange}get time(){return this.deviceLogForm.controls.time}get logAreas(){return this.deviceLogForm.controls.logAreas}get logTypes(){return this.deviceLogForm.controls.logTypes}get messageQueryString(){return this.deviceLogForm.controls.messageQueryString}ngOnInit(){this.getDeviceLogAreasAndTypes()}getDeviceLogAreasAndTypes(){this.logAreasAndTypesError=!1,this.deviceHubService.getDeviceLogAreasAndTypes().subscribe({next:([e,t])=>this.buildForm(e,t),error:()=>{this.buildForm([],[]),this.logAreasAndTypesError=!0}})}buildForm(e,t){this.deviceLogForm=this.formBuilder.group({dateRange:this.formBuilder.nonNullable.group({startDate:this.formBuilder.nonNullable.control(this.defaultStartDate,[pe.required]),endDate:this.formBuilder.nonNullable.control(this.defaultEndDate,[pe.required])}),time:this.formBuilder.nonNullable.control(""),logAreas:this.formBuilder.nonNullable.array(this.buildArrayForms(e)),logTypes:this.formBuilder.nonNullable.array(this.buildArrayForms(t)),messageQueryString:this.formBuilder.nonNullable.control("")}),this.setFormSubscription(),this.onSubmit()}buildArrayForms(e){return e.map((t,i)=>this.formBuilder.nonNullable.group({name:this.formBuilder.nonNullable.control(t),value:this.formBuilder.nonNullable.control(t),selected:this.formBuilder.nonNullable.control(!0),index:this.formBuilder.nonNullable.control(i)}))}setFormSubscription(){this.dateRange.valueChanges.pipe(be(this.unsubscribe)).subscribe(({endDate:e})=>{e!==null&&e?.toISODate()===this.dateRange.value.startDate?.toISODate()?this.time.enable():(this.time.setValue(""),this.time.disable())})}setTimeOptions(){let e=new Array(24).fill("").map((t,i)=>{let p=U.fromObject({hour:i}).toISOTime();return{name:this.localeDateTime.toLocaleTime(p),value:i.toString(),selected:!1}});return[{name:"global.allDay",value:"",selected:!0},...e]}getSelectedFormArrayValues(e,t){return e?[]:t.value.filter(({selected:i})=>i).map(({value:i})=>i)}onSubmit(){let{messageQueryString:e,time:t,dateRange:i}=this.deviceLogForm.getRawValue();this.deviceLogFormSubmitted.emit({logDateTimeStart:t!==""?i.startDate.set({hour:Number(t)}).startOf("hour").toISO({includeOffset:!1}):i.startDate.startOf("day").toISO({includeOffset:!1}),logDateTimeEnd:t!==""?i.endDate.set({hour:Number(t)}).endOf("hour").toISO({includeOffset:!1}):i.endDate.endOf("day").toISO({includeOffset:!1}),logAreas:this.getSelectedFormArrayValues(this.allLogAreasOption.getRawValue().selected,this.logAreas),logTypes:this.getSelectedFormArrayValues(this.allLogTypesOption.getRawValue().selected,this.logTypes),messageQueryString:e})}ngOnDestroy(){this.unsubscribe.next(),this.unsubscribe.complete()}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275cmp=b({type:r,selectors:[["app-device-hub-device-logs-filters"]],outputs:{deviceLogFormSubmitted:"deviceLogFormSubmitted"},decls:2,vars:2,consts:[[1,"filters",3,"formGroup"],[1,"lp-error"],[1,"filters",3,"ngSubmit","formGroup"],[3,"dateRangeFormGroup","max"],["label","global.hour","ngDefaultControl","",3,"singleSelectFormControl","options"],["label","deviceHub.appArea","placeholder","global.search",3,"options","allOption"],["label","deviceHub.logType","placeholder","global.search",3,"options","allOption"],["ngDefaultControl","","label","deviceHub.searchDescription",3,"textInputFormControl"],[1,"filters__button"],["mat-flat-button","","type","submit","color","primary"]],template:function(t,i){t&1&&(T(0,mt,10,13,"form",0),T(1,ut,3,3,"p",1)),t&2&&(L(i.deviceLogForm!==null?0:-1),o(),L(i.logAreasAndTypesError?1:-1))},dependencies:[x,We,Je,ie,qe,te,Ae,S,z,Y,k,Z,K,C],styles:[".filters[_ngcontent-%COMP%]{align-items:flex-end;display:flex;flex-wrap:wrap;column-gap:1rem;margin:.5rem}.filters__button[_ngcontent-%COMP%]{margin-bottom:1.5rem}.lp-error[_ngcontent-%COMP%]{margin:0 .75rem}"]})}}return r})();
1function gt(r,R){if(r&1&&(n(0,"p",5),Ie("animation-leave"),we("animation-enter"),l(1),c(2,"translate"),a()),r&2){let e=F(2);u("ngClass",e.successMessage?"level__form--saved":"level__form--not-saved"),o(),s(" ",d(2,2,e.successMessage||e.failureMessage)," ")}}function vt(r,R){if(r&1&&(n(0,"section",0)(1,"h2",1),l(2),c(3,"translate"),a(),n(4,"p",2),l(5),c(6,"translate"),a(),n(7,"div",3),_(8,"app-lp-single-select",4),T(9,gt,3,4,"p",5),a()()),r&2){let e=F();o(2),s(" ",d(3,5,"deviceHub.deviceLogs.level")," "),o(3),s(" ",d(6,7,"deviceHub.deviceLogs.level.description")," "),o(3),u("singleSelectFormControl",e.logIntensity)("options",e.logIntensityOptions),o(),L(e.successMessage||e.failureMessage?9:-1)}}var nt=(()=>{class r{constructor(){this.deviceHubService=m(O),this.destroyRef=m(Se),this.deviceId=null,this.logIntensity=null,this.logIntensityOptions=[{name:"global.high",value:ne.HIGH},{name:"global.medium",value:ne.MEDIUM},{name:"global.low",value:ne.LOW}],this.successMessage=null,this.failureMessage=null}ngOnChanges({deviceId:e}){e?.currentValue&&this.getDeviceLogConfig()}getDeviceLogConfig(){this.deviceHubService.getDeviceLogConfig(this.deviceId).subscribe({next:({logIntensity:e})=>this.createLogIntensityFormControl(e),error:()=>this.createLogIntensityFormControl()})}createLogIntensityFormControl(e=null){this.logIntensity=new He(e),this.setLogIntensityChangeSubscription()}setLogIntensityChangeSubscription(){this.logIntensity.valueChanges.pipe(Re(this.destroyRef)).subscribe(()=>this.updateLogIntensity())}updateLogIntensity(){this.successMessage=null,this.failureMessage=null,this.deviceHubService.putDeviceLogConfig(this.deviceId,this.logIntensity?.value).subscribe({next:()=>this.successMessage="global.saved!",error:()=>this.failureMessage="global.updateFailure",complete:()=>setTimeout(()=>this.successMessage=null,5e3)})}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275cmp=b({type:r,selectors:[["app-device-hub-device-logs-level"]],inputs:{deviceId:"deviceId"},features:[ye],decls:1,vars:1,consts:[[1,"level"],[1,"level__header"],[1,"level__description"],[1,"level__form"],["label","deviceHub.deviceLogs.level","ngDefaultControl","",3,"singleSelectFormControl","options"],[3,"ngClass"]],template:function(t,i){t&1&&T(0,vt,10,9,"section",0),t&2&&L(i.logIntensity?0:-1)},dependencies:[J,S,z,k,ie,C],styles:[".level[_ngcontent-%COMP%]{background-color:#fff;border-radius:.15rem;box-shadow:0 2px 3px 2px #97999b33;color:#3a3a3a;margin:.5rem .5rem 1rem;max-width:30rem;padding:.5rem;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.level__header[_ngcontent-%COMP%]{color:#3a3a3a;font-size:1.125rem;font-weight:700;margin:.5rem .5rem .25rem}.level__description[_ngcontent-%COMP%]{font-size:.875rem;margin:0 .5rem}.level__form[_ngcontent-%COMP%]{align-items:center;display:flex;gap:1rem;margin:1rem .5rem 0}.level__form--saved[_ngcontent-%COMP%]{color:#390;font-size:.875rem}.level__form--not-saved[_ngcontent-%COMP%]{color:#ef0b3e;font-size:.875rem}.animation-enter[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_fade-in .5s ease-out 1;-webkit-animation:_ngcontent-%COMP%_fade-in .5s ease-out 1}.animation-leave[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_fade-out .5s ease-in 1;-webkit-animation:_ngcontent-%COMP%_fade-out .5s ease-in 1}@keyframes _ngcontent-%COMP%_fade-in{0%{opacity:0}to{opacity:1}}@keyframes _ngcontent-%COMP%_fade-out{0%{opacity:1}to{opacity:0}}@-webkit-keyframes _ngcontent-%COMP%_fade-in{0%{opacity:0}to{opacity:1}}@-webkit-keyframes _ngcontent-%COMP%_fade-out{0%{opacity:1}to{opacity:0}}"]})}}return r})();function ft(r,R){if(r&1&&(n(0,"section",0)(1,"h2",1),l(2),a(),n(3,"div")(4,"div",2)(5,"div",3)(6,"p",4),l(7),c(8,"translate"),a(),n(9,"p",5),l(10),a()(),n(11,"div",3)(12,"p",4),l(13),c(14,"translate"),a(),n(15,"p",5),l(16),a()(),n(17,"div",3)(18,"p",4),l(19),c(20,"translate"),a(),n(21,"p",5),l(22),a()(),n(23,"div",3)(24,"p",4),l(25),c(26,"translate"),a(),n(27,"p",6),l(28),a()()(),n(29,"div",2)(30,"div",3)(31,"p",4),l(32),c(33,"translate"),a(),n(34,"p",5),l(35),a()(),n(36,"div",3)(37,"p",4),l(38),c(39,"translate"),a(),n(40,"p",5),l(41),a()(),n(42,"div",3)(43,"p",4),l(44),c(45,"translate"),a(),n(46,"p",5),l(47),a()(),n(48,"div",3)(49,"p",4),l(50),c(51,"translate"),a(),n(52,"p",5),l(53),a()()(),n(54,"div",2)(55,"div",3)(56,"p",4),l(57),c(58,"translate"),a(),n(59,"p",5),l(60),c(61,"translate"),a()(),n(62,"div",3)(63,"p",4),l(64),c(65,"translate"),a(),n(66,"p",6),l(67),c(68,"translate"),a()(),n(69,"div",3)(70,"p",4),l(71),c(72,"translate"),a(),n(73,"p",5),l(74),a()(),n(75,"div",3)(76,"p",4),l(77),c(78,"translate"),a(),n(79,"p",6),l(80),a()(),n(81,"div",3)(82,"p",4),l(83),c(84,"translate"),a(),n(85,"p",5),l(86),c(87,"translate"),a()()(),n(88,"div",2)(89,"div",3)(90,"p",4),l(91),c(92,"translate"),a(),n(93,"p",5),l(94),a()()(),n(95,"div",2)(96,"div",3)(97,"p",4),l(98),c(99,"translate"),a(),n(100,"p",5),l(101),a()(),n(102,"div",3)(103,"p",4),l(104),c(105,"translate"),a(),n(106,"p",5),l(107),a()()()()()),r&2){let e=R,t=F();o(2),s(" ",e.deviceName," "),o(5),s(" ",d(8,36,"global.organization")," "),o(3),s(" ",e.organizationName," "),o(3),s(" ",d(14,38,"global.site")," "),o(3),s(" ",e.siteName," "),o(3),s(" ",d(20,40,"global.location")," "),o(3),s(" ",e.locationName," "),o(3),s(" ",d(26,42,"global.locationStatus")," "),o(2),u("ngClass",t.getLocationStatusClass(e.locationStatus)),o(),s(" ",e.locationStatus," "),o(4),s(" ",d(33,44,"global.deviceType")," "),o(3),s(" ",t.getDeviceTypeName(e.deviceType)," "),o(3),s(" ",d(39,46,"global.softwareVersion")," "),o(3),s(" ",e.softwareVersion||"-"," "),o(3),s(" ",d(45,48,"deviceHub.ipAddress")," "),o(3),s(" ",e.ipAddress||"-"," "),o(3),s(" ",d(51,50,"deviceHub.androidId")," "),o(3),s(" ",e.androidId||"-"," "),o(4),s(" ",d(58,52,"deviceHub.scaleMode")," "),o(3),s(" ",d(61,54,t.getScaleModeName(e.scaleMode))," "),o(4),s(" ",d(65,56,"global.instantWin")," "),o(2),u("ngClass",t.getInstantWinColor(e.instantWinEnabled)),o(),s(" ",d(68,58,e.instantWinEnabled?"global.on":"global.off")," "),o(4),s(" ",d(72,60,"global.connection")," "),o(3),s(" ",t.getConnectionTypeName(e.connectionType)," "),o(3),s(" ",d(78,62,"global.status")," "),o(2),u("ngClass",t.getStatusColor(e.trackerStatus)),o(),s(" ",e.trackerStatus," "),o(3),s(" ",d(84,64,"global.mode")," "),o(3),s(" ",d(87,66,e.trainingModeEnabled?"global.training":"global.tracking")," "),o(5),s(" ",d(92,68,"deviceHub.flows")," "),o(3),s(" ",e.flowDesc||"-"," "),o(4),s(" ",d(99,70,"deviceHub.lastPing")," "),o(3),s(" ",t.toLocaleDateTime(e.lastPingDateTime)," "),o(3),s(" ",d(105,72,"deviceMonitor.lastTransaction")," "),o(3),s(" ",t.toLocaleDateTime(e.lastTransactionDateTime)," ")}}var at=(()=>
1{class r{constructor(){this.deviceHubService=m(O),this.localeDateTime=m(N),this.deviceId=null,this.deviceObservable=ve(null),this.getDeviceTypeName=re,this.getConnectionTypeName=le,this.getScaleModeName=se,this.getStatusColor=ce,this.getInstantWinColor=de}ngOnInit(){this.getDeviceById()}getDeviceById(){this.deviceObservable=this.deviceHubService.getDeviceById(Number(this.deviceId))}toLocaleDateTime(e){return e?this.localeDateTime.toLocaleDateTime(e):"-"}getLocationStatusClass(e){return e==="ACTIVE"?"overview__detail__value--active":"overview__detail__value--inactive"}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275cmp=b({type:r,selectors:[["app-device-hub-device-logs-overview"]],inputs:{deviceId:"deviceId"},decls:2,vars:3,consts:[[1,"overview"],[1,"overview__header"],[1,"overview__details"],[1,"overview__detail"],[1,"overview__detail__title"],[1,"overview__detail__value"],[1,"overview__detail__value",3,"ngClass"]],template:function(t,i){if(t&1&&(T(0,ft,108,74,"section",0),c(1,"async")),t&2){let p;L((p=d(1,1,i.deviceObservable))?0:-1,p)}},dependencies:[J,S,xe,C],styles:[".overview[_ngcontent-%COMP%]{background-color:#fff;border-radius:.15rem;box-shadow:0 2px 3px 2px #97999b33;color:#3a3a3a;margin:.5rem .5rem 1rem;max-width:58rem;padding:.5rem;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.overview__header[_ngcontent-%COMP%]{font-size:1.125rem;font-weight:700;margin:.5rem}.overview__details[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap}.overview__detail[_ngcontent-%COMP%]{margin:.5rem}.overview__detail__title[_ngcontent-%COMP%]{font-size:.75rem;margin-bottom:.25rem}.overview__detail__value[_ngcontent-%COMP%]{font-size:.875rem;font-weight:700;margin:0}.overview__detail__value--active[_ngcontent-%COMP%]{background-color:#a2ce4d;border-radius:.125rem;color:#1a4d00;font-size:.75rem;padding:.125rem .375rem;text-transform:uppercase;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.overview__detail__value--inactive[_ngcontent-%COMP%]{background-color:#eaebeb;border-radius:.125rem;color:#3a3a3a;font-size:.75rem;padding:.125rem .375rem;text-transform:uppercase;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.data--success[_ngcontent-%COMP%]{color:#390}.data--failure[_ngcontent-%COMP%]{color:#ef0b3e}.data--neutral[_ngcontent-%COMP%]{color:#97999b}"]})}}return r})();var rt=(()=>{class r{constructor(){this.deviceHubService=m(O),this.localeDateTime=m(N),this.route=m(ke),this.deviceId=this.route.snapshot.paramMap.get("deviceId"),this.androidId=this.route.snapshot.queryParamMap.get("androidId"),this.deviceLogFilters={logDateTimeStart:"",logDateTimeEnd:"",logAreas:[],logTypes:[],messageQueryString:"",limitOffset:0,limitCount:25},this.headers=[new v("deviceHub.appArea","logArea"),new v("deviceHub.logType","logType",{dataDisplay:e=>e,dataClasses:e=>this.getLogTypeColor(e)}),new v("global.description","message"),new v("global.time","logDateTime",{dataDisplay:e=>this.localeDateTime.toLocaleDateTime(e)})],this.getLogTypeColor=e=>{let{CONFIG:t,DEBUG:i,ERROR:p,CRITICAL_ERROR:g,INFO:h,USER_INTERACTION:f}=ae;switch(e){case p:return["data--failure","data--bold"];case g:return["data--failure","data--bold"];case f:return["data--success","data--bold"];case h:return["data--bold"];case t:return["data--bold"];case i:return["data--bold"];default:return["data--bold"]}}}setDeviceLogFilters(e){this.table.page=1,this.deviceLogFilters=y(y({},this.deviceLogFilters),e),this.getDeviceLogs()}getDeviceLogs(){let{limitCount:e}=this.deviceLogFilters;this.table.loading=!0,this.deviceLogFilters.limitOffset=(this.table.page-1)*e,this.deviceHubService.getDeviceLogs(Number(this.deviceId),this.deviceLogFilters,this.androidId).subscribe({next:({unlimitedRowCount:t,results:i})=>{this.table.totalPages=Math.ceil(t/e),this.setTableRows(i.map(p=>({tableData:p})))},error:()=>this.setTableRows()})}setTableRows(e=[]){this.table.rows=e,this.table.filteredRows=e,this.table.loading=!1}static{this.\u0275fac=function(t){return new(t||r)}}static{this.\u0275cmp=b({type:r,selectors:[["app-device-hub-device-logs"]],viewQuery:function(t,i){if(t&1&&W(P,7),t&2){let p;V(p=G())&&(i.table=p.first)}},decls:16,vars:12,consts:[["routerLink","/device-hub/devices",1,"main__link"],["mat-mini-fab","","color","primary"],[1,"main__cards"],[3,"deviceId"],[3,"deviceLogFormSubmitted"],[1,"main__table"],[1,"main__table__header"],[3,"pageNumber","headers","allSortDisabled","backendPagination","rowsPerPage"]],template:function(t,i){t&1&&(n(0,"a",0)(1,"button",1)(2,"mat-icon"),l(3," arrow_back "),a()(),n(4,"span"),l(5),c(6,"translate"),a()(),n(7,"div",2),_(8,"app-device-hub-device-logs-overview",3)(9,"app-device-hub-device-logs-level",3),a(),n(10,"app-device-hub-device-logs-filters",4),D("deviceLogFormSubmitted",function(g){return i.setDeviceLogFilters(g)}),a(),n(11,"section",5)(12,"h2",6),l(13),c(14,"translate"),a(),n(15,"app-lp-table",7),D("pageNumber",function(){return i.getDeviceLogs()}),a()()),t&2&&(o(5),s(" ",d(6,8,"global.back")," "),o(3),u("deviceId",i.deviceId),o(),u("deviceId",i.deviceId),o(4),s(" ",d(14,10,"deviceHub.deviceLogs")," "),o(2),u("headers",i.headers)("allSortDisabled",!0)("backendPagination",!0)("rowsPerPage",i.deviceLogFilters.limitCount))},dependencies:[Ve,te,Be,ee,X,x,P,S,ot,nt,at,C],styles:[".main__link[_ngcontent-%COMP%]{align-items:center;display:flex;gap:.625rem;margin:.5rem;text-decoration:none}.main__link[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{height:2rem;width:2rem}.main__cards[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap}.main__table[_ngcontent-%COMP%]{margin:.75rem}.main__table__header[_ngcontent-%COMP%]{color:#3a3a3a;font-size:1.125rem;font-weight:700}"]})}}return r})();var go=[{path:"",component:Xe,children:[{path:"",redirectTo:"devices",pathMatch:"full"},{path:"devices",component:it},{path:"device-logs/:deviceId",component:rt}]}];export{go as DEVICE_HUB_ROUTES};
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.