import{a as s}from"./chunk-G5O35VXY.js";import{Hb as a,J as r,M as c,e as n}from"./chunk-VEXJN5D7.js";var g=(()=>{let i=class i{constructor(t){this.http=t,this.deviceInfo=new n(void 0),this.location=new n(void 0),this.init()}init(){this.initInfo(),this.initLocation()}getDeviceInfo(){let t=`${s.API_URL}/system/device-info`;this.http.get(t).subscribe({next:o=>{this.deviceInfo.next(o)}})}watchDeviceInfo(){this.locationTimer=window.setInterval(()=>{this.getDeviceInfo()},1e4)}initInfo(){this.getDeviceInfo()}watchLocation(){this.locationTimer=window.setInterval(()=>{this.getLocation()},1e4)}getLocation(){navigator.geolocation!=null&&navigator.geolocation.getCurrentPosition(t=>{this.location.next(t)},t=>{},{enableHighAccuracy:!0,timeout:1e4,maximumAge:0})}initLocation(){this.getLocation(),this.watchLocation()}getLogs(){return this.http.get("{{api}}/system/logs/all")}ngOnDestroy(){window.clearInterval(this.locationTimer),window.clearInterval(this.infoTimer)}};i.\u0275fac=function(o){return new(o||i)(c(a))},i.\u0275prov=r({token:i,factory:i.\u0275fac});let e=i;return e})();export{g as a};
