From b02f2a025c12e2f23ae25971f1e30e3d95fa2734 Mon Sep 17 00:00:00 2001 From: Nadzeya Mikhailava Date: Wed, 23 Oct 2024 14:09:59 +0300 Subject: [PATCH] publish: v.2.0.1 [fix] initial assignment of selected device is fixed generated from commit c5a16824501c8c3d8eb6e1a7682afa5d499ce00f --- index.html | 2 +- js/1.7e58bf6e.js | 1 - js/1.d2f147b9.js | 1 + js/{app.37e2f630.js => app.f2f2cde0.js} | 2 +- package.json | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) delete mode 100644 js/1.7e58bf6e.js create mode 100644 js/1.d2f147b9.js rename js/{app.37e2f630.js => app.f2f2cde0.js} (99%) diff --git a/index.html b/index.html index 69686e9a..542a6e0e 100644 --- a/index.html +++ b/index.html @@ -4,4 +4,4 @@ gtag('js', new Date()); gtag('config', 'UA-93342359-3'); - }
\ No newline at end of file + }
\ No newline at end of file diff --git a/js/1.7e58bf6e.js b/js/1.7e58bf6e.js deleted file mode 100644 index a9489d19..00000000 --- a/js/1.7e58bf6e.js +++ /dev/null @@ -1 +0,0 @@ -(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[1],{"1f9f":function(e,t,s){},"2b48":function(e,t,s){"use strict";s("f273")},"323c":function(e,t,s){},4038:function(e,t,s){},"40ca":function(e,t,s){},4678:function(e,t,s){var i={"./af":"2bfb","./af.js":"2bfb","./ar":"8e73","./ar-dz":"a356","./ar-dz.js":"a356","./ar-kw":"423e","./ar-kw.js":"423e","./ar-ly":"1cfd","./ar-ly.js":"1cfd","./ar-ma":"0a84","./ar-ma.js":"0a84","./ar-ps":"4c98","./ar-ps.js":"4c98","./ar-sa":"8230","./ar-sa.js":"8230","./ar-tn":"6d83","./ar-tn.js":"6d83","./ar.js":"8e73","./az":"485c","./az.js":"485c","./be":"1fc1","./be.js":"1fc1","./bg":"84aa","./bg.js":"84aa","./bm":"a7fa","./bm.js":"a7fa","./bn":"9043","./bn-bd":"9686","./bn-bd.js":"9686","./bn.js":"9043","./bo":"d26a","./bo.js":"d26a","./br":"6887","./br.js":"6887","./bs":"2554","./bs.js":"2554","./ca":"d716","./ca.js":"d716","./cs":"3c0d","./cs.js":"3c0d","./cv":"03ec","./cv.js":"03ec","./cy":"9797","./cy.js":"9797","./da":"0f14","./da.js":"0f14","./de":"b469","./de-at":"b3eb","./de-at.js":"b3eb","./de-ch":"bb71","./de-ch.js":"bb71","./de.js":"b469","./dv":"598a","./dv.js":"598a","./el":"8d47","./el.js":"8d47","./en-au":"0e6b","./en-au.js":"0e6b","./en-ca":"3886","./en-ca.js":"3886","./en-gb":"39a6","./en-gb.js":"39a6","./en-ie":"e1d3","./en-ie.js":"e1d3","./en-il":"7333","./en-il.js":"7333","./en-in":"ec2e","./en-in.js":"ec2e","./en-nz":"6f50","./en-nz.js":"6f50","./en-sg":"b7e9","./en-sg.js":"b7e9","./eo":"65db","./eo.js":"65db","./es":"898b","./es-do":"0a3c","./es-do.js":"0a3c","./es-mx":"b5b7","./es-mx.js":"b5b7","./es-us":"55c9","./es-us.js":"55c9","./es.js":"898b","./et":"ec18","./et.js":"ec18","./eu":"0ff2","./eu.js":"0ff2","./fa":"8df48","./fa.js":"8df48","./fi":"81e9","./fi.js":"81e9","./fil":"d69a","./fil.js":"d69a","./fo":"0721","./fo.js":"0721","./fr":"9f26","./fr-ca":"d9f8","./fr-ca.js":"d9f8","./fr-ch":"0e49","./fr-ch.js":"0e49","./fr.js":"9f26","./fy":"7118","./fy.js":"7118","./ga":"5120","./ga.js":"5120","./gd":"f6b46","./gd.js":"f6b46","./gl":"8840","./gl.js":"8840","./gom-deva":"aaf2","./gom-deva.js":"aaf2","./gom-latn":"0caa","./gom-latn.js":"0caa","./gu":"e0c5","./gu.js":"e0c5","./he":"c7aa","./he.js":"c7aa","./hi":"dc4d","./hi.js":"dc4d","./hr":"4ba9","./hr.js":"4ba9","./hu":"5b14","./hu.js":"5b14","./hy-am":"d6b6","./hy-am.js":"d6b6","./id":"5038","./id.js":"5038","./is":"0558","./is.js":"0558","./it":"6e98","./it-ch":"6f12","./it-ch.js":"6f12","./it.js":"6e98","./ja":"079e","./ja.js":"079e","./jv":"b540","./jv.js":"b540","./ka":"201b","./ka.js":"201b","./kk":"6d79","./kk.js":"6d79","./km":"e81d","./km.js":"e81d","./kn":"3e92","./kn.js":"3e92","./ko":"22f8","./ko.js":"22f8","./ku":"2421","./ku-kmr":"7558","./ku-kmr.js":"7558","./ku.js":"2421","./ky":"9609","./ky.js":"9609","./lb":"440c","./lb.js":"440c","./lo":"b29d","./lo.js":"b29d","./lt":"26f9","./lt.js":"26f9","./lv":"b97c","./lv.js":"b97c","./me":"293c","./me.js":"293c","./mi":"688b","./mi.js":"688b","./mk":"6909","./mk.js":"6909","./ml":"02fb","./ml.js":"02fb","./mn":"958b","./mn.js":"958b","./mr":"39bd","./mr.js":"39bd","./ms":"ebe4","./ms-my":"6403","./ms-my.js":"6403","./ms.js":"ebe4","./mt":"1b45","./mt.js":"1b45","./my":"8689","./my.js":"8689","./nb":"6ce3","./nb.js":"6ce3","./ne":"3a39","./ne.js":"3a39","./nl":"facd","./nl-be":"db29","./nl-be.js":"db29","./nl.js":"facd","./nn":"b84c","./nn.js":"b84c","./oc-lnc":"167b","./oc-lnc.js":"167b","./pa-in":"f3ff","./pa-in.js":"f3ff","./pl":"8d57","./pl.js":"8d57","./pt":"f260","./pt-br":"d2d4","./pt-br.js":"d2d4","./pt.js":"f260","./ro":"972c","./ro.js":"972c","./ru":"957c","./ru.js":"957c","./sd":"6784","./sd.js":"6784","./se":"ffff","./se.js":"ffff","./si":"eda5","./si.js":"eda5","./sk":"7be6","./sk.js":"7be6","./sl":"8155","./sl.js":"8155","./sq":"c8f3","./sq.js":"c8f3","./sr":"cf1e","./sr-cyrl":"13e9","./sr-cyrl.js":"13e9","./sr.js":"cf1e","./ss":"52bd","./ss.js":"52bd","./sv":"5fbd","./sv.js":"5fbd","./sw":"74dc","./sw.js":"74dc","./ta":"3de5","./ta.js":"3de5","./te":"5cbb","./te.js":"5cbb","./tet":"576c","./tet.js":"576c","./tg":"3b1b","./tg.js":"3b1b","./th":"10e8","./th.js":"10e8","./tk":"5aff","./tk.js":"5aff","./tl-ph":"0f38","./tl-ph.js":"0f38","./tlh":"cf75","./tlh.js":"cf75","./tr":"0e81","./tr.js":"0e81","./tzl":"cf51","./tzl.js":"cf51","./tzm":"c109","./tzm-latn":"b53d","./tzm-latn.js":"b53d","./tzm.js":"c109","./ug-cn":"6117","./ug-cn.js":"6117","./uk":"ada2","./uk.js":"ada2","./ur":"5294","./ur.js":"5294","./uz":"2e8c","./uz-latn":"010e","./uz-latn.js":"010e","./uz.js":"2e8c","./vi":"2921","./vi.js":"2921","./x-pseudo":"fd7e","./x-pseudo.js":"fd7e","./yo":"7f33","./yo.js":"7f33","./zh-cn":"5c3a","./zh-cn.js":"5c3a","./zh-hk":"49ab","./zh-hk.js":"49ab","./zh-mo":"3a6c","./zh-mo.js":"3a6c","./zh-tw":"90ea","./zh-tw.js":"90ea"};function a(e){var t=n(e);return s(t)}function n(e){if(!s.o(i,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return i[e]}a.keys=function(){return Object.keys(i)},a.resolve=n,e.exports=a,a.id="4678"},"5b5b":function(e,t,s){"use strict";s("4038")},"5b6f":function(e,t,s){},"81e1":function(e,t,s){"use strict";s("1f9f")},"82ba":function(e,t,s){"use strict";s("ed24")},"84c3":function(e,t,s){"use strict";s("ef69")},"9f7d":function(e,t,s){"use strict";s("e61d")},aa78:function(e,t,s){},b240:function(e,t,s){"use strict";s("323c")},d1d6:function(e,t,s){"use strict";s("aa78")},e61d:function(e,t,s){},e796:function(e,t,s){"use strict";s("5b6f")},ed24:function(e,t,s){},ef69:function(e,t,s){},f241:function(e,t,s){"use strict";s.r(t);var i=function(){var e=this,t=e._self._c;return t("q-layout",{ref:"layout",attrs:{view:"hHh LpR lFf"},on:{click:function(t){return t.stopPropagation(),e.layoutCkickHandler.apply(null,arguments)}}},[e.isInit&&e.needShowList?t("q-drawer",{attrs:{persistent:"",id:"left-drawer",side:"left","no-swipe-open":e.$q.platform.is.desktop,"no-swipe-close":e.$q.platform.is.desktop,breakpoint:576,overlay:!e.devicesListSettings.pinned},model:{value:e.devicesListSettings.opened,callback:function(t){e.$set(e.devicesListSettings,"opened",t)},expression:"devicesListSettings.opened"}},[t("device-list",{directives:[{name:"show",rawName:"v-show",value:e.devices.length,expression:"devices.length"}],attrs:{selectedDeviceId:e.selectedDevice.id,isFollowed:e.selectedDevice.follow,activeDevicesID:e.activeDevicesID,devices:e.devices,devicesColors:e.devicesColors,devicesListPinned:e.devicesListSettings.pinned},on:{"select-device":e.selectDeviceInListHandler,"follow-selected-device":e.followSelectedDeviceHandler,"device-in-devices-list-ckick":e.deviceInListClickHandler,"click-hide":function(t){return e.devicesListOpenedHandler(!1)},"devices-list-pinned":e.devicesListPinnedHandler,"update-color":e.updateColorHandler}})],1):e._e(),e.needShowTelemetry?t("q-drawer",{attrs:{"no-swipe-open":"","no-swipe-close":"",side:"right","content-class":{"bg-grey-9":e.telemetrySettings.inverted}},model:{value:e.telemetrySettings.opened,callback:function(t){e.$set(e.telemetrySettings,"opened",t)},expression:"telemetrySettings.opened"}},[t("div",{staticStyle:{position:"relative",height:"100vh",overflow:"hidden"}},[t("q-item",[t("q-item-section",{attrs:{avatar:""}},[t("q-btn",{attrs:{flat:"",round:"",small:"",icon:"mdi-chevron-right",color:e.telemetrySettings.inverted?"white":""},on:{click:e.telemetryButtonClickHandler}})],1),t("q-item-section",[t("q-item-label",{staticClass:"ellipsis text-bold q-pa-none",class:{"text-white":e.telemetrySettings.inverted},staticStyle:{"font-size":"1.3rem"},attrs:{header:""}},[e._v("\n Telemetry\n ")])],1),t("q-item-section",{attrs:{side:""}},[t("q-btn",{staticClass:"text-grey",attrs:{round:"",flat:"",icon:"mdi-image-filter-black-white",color:e.telemetrySettings.inverted?"white":"grey"},on:{click:e.telemetryInvertedHandler}},[t("q-tooltip",[e._v("Inverted")])],1)],1)],1),e.deviceIdForTelemetry?t("q-item",{staticStyle:{"border-top":"1px solid #ddd","min-height":"71px"}},[t("div",{staticClass:"text-center absolute-top-left bg-grey-4 text-bold text-grey-9",staticStyle:{"font-size":"10px","min-width":"55px",padding:"0 3px","z-index":"1","border-radius":"0 0 3px 0"}},[e._v("\n #"+e._s(e.deviceForTelemetry.id)+"\n ")]),t("q-item-section",{class:{"text-grey-4":e.telemetrySettings.inverted},attrs:{side:""}},[t("q-icon",{attrs:{size:"1.7rem",name:"mdi-developer-board"}})],1),t("q-item-section",[t("q-item-label",{staticClass:"ellipsis q-pa-none",class:{"text-grey-4":e.telemetrySettings.inverted},attrs:{header:""}},[e._v(e._s(e.deviceForTelemetry.name||"")+"\n "),t("q-tooltip",[e._v(e._s(e.deviceForTelemetry.name||""))])],1),t("q-item-label",{staticClass:"ellipsis",class:{"text-grey-4":e.telemetrySettings.inverted},attrs:{caption:""}},[t("q-icon",{attrs:{name:"mdi-label-outline"}}),e._v(" "+e._s(e.deviceForTelemetry.configuration&&e.deviceForTelemetry.configuration.ident?e.deviceForTelemetry.configuration.ident:"")+"\n ")],1),e.deviceForTelemetry.configuration&&e.deviceForTelemetry.configuration.phone?t("q-item-label",{class:{"text-grey-4":e.telemetrySettings.inverted},attrs:{caption:""}},[t("q-icon",{attrs:{name:"mdi-phone"}}),e._v(" "+e._s(e.deviceForTelemetry.configuration&&e.deviceForTelemetry.configuration.phone?e.deviceForTelemetry.configuration.phone:"")+"\n ")],1):e._e()],1)],1):t("q-item",[t("q-item-label",{staticClass:"ellipsis text-bold",class:{"text-white":e.telemetrySettings.inverted},staticStyle:{width:"100%","text-align":"center"},attrs:{header:""}},[e._v("\n No selected device\n ")])],1),e.deviceIdForTelemetry?t("q-item",[t("q-item-section",[t("q-input",{staticClass:"q-mb-xs",attrs:{dense:"",outlined:"","hide-bottom-space":"",type:"text",label:"Search",value:e.telemetrySearch,dark:e.telemetrySettings.inverted,color:e.telemetrySettings.inverted?"white":"grey"},on:{input:t=>{e.telemetrySearch=t.toLowerCase()}}})],1)],1):e._e(),e.deviceIdForTelemetry?t("q-telemetry",{staticClass:"scroll",staticStyle:{height:"calc(100% - 128px)"},attrs:{propHistoryFlag:e.telemetryConfig.propHistoryFlag,device:e.deviceForTelemetry,inverted:e.telemetrySettings.inverted,search:e.telemetrySearch}}):e._e()],1)]):e._e(),t("q-page-container",[t("q-page",[e.devices.length&&e.needShowList?t("q-btn",{staticClass:"floated menu white-background",attrs:{small:"",round:"",flat:"",color:"bg-grey-9",size:"md",icon:"mdi-menu"},on:{click:function(t){return t.stopPropagation(),e.devicesListOpenedHandler(!e.devicesListSettings.opened)}}}):e._e(),t("div",{staticClass:"floated label"},[t("img",{staticStyle:{height:"40px","margin-top":"3px",display:"inline-block"},attrs:{src:"track-it-logo.png",alt:"Track it!"}}),t("div",{staticClass:"q-toolbar-title",staticStyle:{color:"rgb(51, 51, 51)",display:"inline-block"}},[e._v("\n Track it! "),t("sup",[e._v(e._s(e.version))]),t("div",{staticClass:"q-toolbar-subtitle"},[e._v("\n Find yourself\n ")])])]),e.errors.length?t("q-btn",{staticClass:"floated notifications white-background",attrs:{small:"",flat:"",round:"",color:"bg-grey-9",size:"md",icon:"mdi-bell"},on:{click:e.clearNotificationCounter}},[e.newNotificationCounter?t("q-chip",{staticClass:"absolute-top-right q-pa-xs text-white",staticStyle:{"font-size":".6rem"},attrs:{color:"red"}},[e._v(e._s(e.newNotificationCounter))]):e._e(),t("q-menu",{ref:"popoverError",attrs:{fit:""}},[t("q-list",{staticClass:"scroll",staticStyle:{"max-height":"200px"},attrs:{"no-border":"",link:"",separator:""}},e._l(e.errors,(function(s,i){return t("q-item",{key:i,staticStyle:{cursor:"default"}},[t("q-item-section",[t("q-item-label",[e._v(e._s(s))])],1)],1)})),1)],1)],1):e._e(),e.devices.length?t("div",{staticClass:"floated date"},[t("date-range-modal",{attrs:{date:e.date,theme:e.dateTheme},on:{save:t=>e.date=[...t],reinit:e.initDate}})],1):e._e(),!e.activeDevicesID.length&&e.devices.length?t("div",{staticClass:"floated no-devices"},[t("span",{staticClass:"no-devices__message"},[e._v("You have no selected devices")]),t("div",{staticStyle:{"margin-top":"15px"}},[t("q-btn",{staticStyle:{"pointer-events":"auto"},attrs:{icon:"mdi-menu",color:"black",size:"md"},on:{click:function(t){return t.stopPropagation(),e.devicesListOpenedHandler(!e.devicesListSettings.opened)}}},[e._v("\n select devices\n ")])],1)]):!e.devices.length&&e.hasDevicesInit?t("div",{staticClass:"floated no-devices"},[t("span",{staticClass:"no-devices__message"},[e._v("You have no devices")]),t("div",{staticClass:"q-mt-sm text-bg-grey-9",staticStyle:{"font-size":"1.3rem"}},[e._v("\n Create one on\n "),t("q-btn",{staticStyle:{"pointer-events":"auto"},attrs:{dense:"",color:"red-5",label:"flespi.io"},on:{click:function(t){return e.openURL("https://flespi.io")}}})],1)]):e._e(),e.$q.platform.is.desktop?t("a",{attrs:{href:"https://github.com/flespi-software/TrackIt/",target:"_blank"}},[t("q-btn",{staticClass:"floated white-background",class:[e.needShowTelemetry?"github":"telemetry"],attrs:{flat:"",round:"",color:"bg-grey-9"}},[t("img",{staticStyle:{height:"30px"},attrs:{src:"GitHub-Mark-32px.png",alt:"GitHub"}}),t("q-tooltip",[e._v("Show on GitHub")])],1)],1):e._e(),e.needShowTelemetry?t("q-btn",{staticClass:"floated telemetry white-background",attrs:{small:"",round:"",flat:"",size:"md",icon:"mdi-list-box-outline"},on:{click:e.telemetryButtonClickHandler}},[t("q-tooltip",[e._v("Device telemetry")])],1):e._e(),t("q-btn",{staticClass:"floated options white-background",attrs:{small:"",round:"",flat:"",size:"md",icon:"mdi-dots-vertical",color:"bg-grey-9"}},[t("q-menu",{ref:"popover-menu"},[t("q-list",{staticClass:"scroll",staticStyle:{"min-width":"200px"},attrs:{link:"",separator:""}},[e.needHideMessagesInMenu?e._e():t("q-item",{attrs:{dense:""}},[t("q-toggle",{attrs:{disabled:!e.devices.length,icon:"mdi-mail",label:"Messages"},on:{input:e.paramsChangeHandler},model:{value:e.params.needShowMessages,callback:function(t){e.$set(e.params,"needShowMessages",t)},expression:"params.needShowMessages"}},[t("q-tooltip",[e._v("Show messages grid")])],1)],1),e.needHidePlayerInMenu?e._e():t("q-item",{attrs:{dense:""}},[t("q-toggle",{attrs:{disable:!e.devices.length,icon:"mdi-play",label:"Player"},on:{input:e.paramsChangeHandler},model:{value:e.params.needShowPlayer,callback:function(t){e.$set(e.params,"needShowPlayer",t)},expression:"params.needShowPlayer"}},[t("q-tooltip",[e._v("Show track player")])],1)],1),e.needHideNamesInMenu?e._e():t("q-item",{attrs:{dense:""}},[t("q-toggle",{attrs:{disabled:!e.devices.length,icon:"mdi-map-marker-radius-outline",label:"Names"},on:{input:e.paramsChangeHandler},model:{value:e.params.needShowNamesOnMap,callback:function(t){e.$set(e.params,"needShowNamesOnMap",t)},expression:"params.needShowNamesOnMap"}},[t("q-tooltip",[e._v("Display cars' names on the map")])],1)],1),e.needHideInvalidInMenu?e._e():t("q-item",{attrs:{dense:""}},[t("q-toggle",{attrs:{disabled:!e.devices.length,icon:"mdi-map-marker-off",label:"Drow invalid"},on:{input:e.paramsChangeHandler},model:{value:e.params.needShowInvalidPositionMessages,callback:function(t){e.$set(e.params,"needShowInvalidPositionMessages",t)},expression:"params.needShowInvalidPositionMessages"}},[t("q-tooltip",[e._v("Use messages with position.valid=false to display cars' positions on the map")])],1)],1),t("q-item",{staticClass:"within-iframe-hide",attrs:{clickable:""},on:{click:e.exitHandler}},[t("q-item-section",{staticClass:"q-pl-md",attrs:{avatar:""}},[t("q-icon",{attrs:{name:"mdi-exit-to-app"}})],1),t("q-item-section",[t("q-item-label",[e._v("Exit")])],1)],1)],1)],1)],1),t("map-component",{attrs:{activeDevices:e.activeDevices,devicesColors:e.computedDevicesColors,selectedDeviceId:e.selectedDevice.id,isSelectedDeviceFollowed:e.selectedDevice.follow,params:e.params,date:e.date},on:{"change-need-show-messages":t=>{e.params.needShowMessages=t},"update-telemetry-device-id":e.updateTelemetryDeviceId,"queue-created":e.queueCreatedHandler,"update-color":e.updateColorHandler}})],1)],1)],1)},a=[],n=(s("14d9"),s("8c77"),s("2b0e")),r=s("2f62"),o=function(){var e=this,t=e._self._c;return t("div",{staticClass:"q-v-date-range-picker",staticStyle:{"min-width":"180px"}},[t("q-btn",{attrs:{color:e.theme.bgColor,flat:"",dense:"",icon:"mdi-chevron-left"},on:{click:e.prevHandler}},[t("q-tooltip",[e._v("Previous time range")])],1),t("q-btn",{staticClass:"q-pa-none",staticStyle:{"min-width":"124px","font-size":".8rem","line-height":".8rem"},attrs:{flat:"",color:e.theme.bgColor},on:{click:e.dateRangeToggle}},[t("div",[t("div",[e._v(e._s(e.formatDate(e.dateModel[0])))]),t("div",{staticStyle:{"font-size":".5rem"}},[e._v("|")]),t("div",[e._v(e._s(e.formatDate(e.dateModel[1])))])]),t("q-tooltip",[e._v("Change time")])],1),t("q-btn",{attrs:{color:e.theme.bgColor,flat:"",dense:"",icon:"mdi-chevron-right"},on:{click:e.nextHandler}},[t("q-tooltip",[e._v("Next time range")])],1),t("q-dialog",{ref:"dateRangePickerModal",attrs:{"content-class":"modal-date-range"}},[t("q-card",[t("q-card-section",{staticClass:"scroll q-pa-none",class:{[`bg-${e.theme.bgColor}`]:!0,"text-white":!!e.theme.bgColor}},[t("div",{staticClass:"flex flex-center",staticStyle:{"max-width":"330px"}},[t("div",{staticClass:"fit text-center q-my-sm"},[t("q-btn-toggle",{attrs:{options:e.dateRangeModeOptions,color:e.theme.bgColor,"text-color":"grey","toggle-text-color":e.theme.color,flat:""},model:{value:e.mode,callback:function(t){e.mode=t},expression:"mode"}})],1),t("date-range-picker",{staticClass:"q-ma-sm",attrs:{mode:e.mode,theme:e.theme},on:{"change:mode":e.changeModeDateTimeRangeHandler,error:t=>e.saveDisabled=t},model:{value:e.dateModel,callback:function(t){e.dateModel=t},expression:"dateModel"}})],1)]),t("q-card-actions",{class:{[`bg-${e.theme.bgColor}`]:!0,"text-white":!!e.theme.bgColor},attrs:{align:"between"}},[t("q-btn",{attrs:{flat:"",color:e.theme.color,dense:"",icon:"mdi-map-clock-outline"},on:{click:function(t){e.$emit("reinit"),e.dateRangeModalClose()}}},[t("q-tooltip",[e._v("Reinit time by devices positions")])],1),t("div",[t("q-btn",{attrs:{flat:"",color:e.theme.color},on:{click:e.dateRangeModalClose}},[e._v("close")]),t("q-btn",{attrs:{flat:"",color:e.theme.color,disable:e.saveDisabled},on:{click:e.dateRangeModalSave}},[e._v("save")])],1)],1)],1)],1)],1)},l=[],c=s("bd4c"),d=s("a99f"),h={props:["theme","date"],data(){return{dateModel:this.date,mode:0,saveDisabled:!1,dateRangeModeOptions:[{label:"Day",value:0},{label:"Range",value:3},{label:"Manual",value:4}]}},methods:{dateRangeToggle(){this.$refs.dateRangePickerModal.toggle()},dateRangeModalClose(){this.$refs.dateRangePickerModal.hide()},changeModeDateTimeRangeHandler(e){this.mode=e},dateRangeModalSave(){let[e,t]=this.dateModel;t+=999,this.$emit("save",[e,t]),this.dateRangeModalClose()},formatDate(e){return c["a"].formatDate(e,"DD/MM/YYYY HH:mm:ss")},prevHandler(){const e=Math.floor(this.dateModel[1])-Math.floor(this.dateModel[0]),t=Math.floor(this.dateModel[0])-1,s=t-e;this.dateModel=[s,t],this.$emit("save",this.dateModel)},nextHandler(){const e=Math.floor(this.dateModel[1])-Math.floor(this.dateModel[0]),t=Math.floor(this.dateModel[1])+1,s=t+e;this.dateModel=[t,s],this.$emit("save",this.dateModel)}},watch:{date(e){this.dateModel=e}},components:{DateRangePicker:d["a"]}},m=h,p=(s("2b48"),s("2877")),g=s("9c40"),u=s("05c0"),v=s("24e8"),f=s("f09f"),y=s("a370"),k=s("6a67"),b=s("4b7e"),_=s("eebe"),w=s.n(_),S=Object(p["a"])(m,o,l,!1,null,null,null),$=S.exports;w()(S,"components",{QBtn:g["a"],QTooltip:u["a"],QDialog:v["a"],QCard:f["a"],QCardSection:y["a"],QBtnToggle:k["a"],QCardActions:b["a"]});var D=s("5ee7"),M=function(){var e=this,t=e._self._c;return t("div",{staticClass:"map-wrapper absolute-top-left absolute-bottom-right"},[t("div",{style:{height:e.mapHeight},attrs:{id:"map"}},[t("q-resize-observer",{on:{resize:e.onResize}})],1),Object.keys(e.messages).length&&e.activeDevicesID.length?t("queue",{ref:"queue",attrs:{activeDevicesID:e.activeDevicesID,needShowMessages:e.params.needShowMessages,needShowPlayer:e.params.needShowPlayer,messages:e.allMessages,selectedDeviceId:e.selectedDeviceId,telemetryDeviceId:e.telemetryDeviceId,date:e.date,player:e.player},on:{"player-value":t=>e.playProcess(t,"value"),"player-play":t=>e.playProcess(t,"play"),"player-pause":t=>e.playProcess(t,"pause"),"player-stop":t=>e.playProcess(t,"stop"),"player-speed":e.playerSpeedChangeHandler,"player-mode":e.playerModeChange,"change-need-show-messages":t=>{e.$emit("change-need-show-messages",t)},"queue-created":e.queueCreatedHandler,"update-color":e.updateColorHandler,"view-on-map":e.viewOnMapHandler}}):e._e(),t("color-modal",{ref:"colorModal",model:{value:e.color,callback:function(t){e.color=t},expression:"color"}})],1)},C=[],x=s("e11e"),I=(s("d88e"),s("6cc5"),s("7998"),s("9ae0"),s("790e"),s("3c65"),function(e){e.Polyline.include({_snakingTimestamp:0,_snakingRings:0,_snakingTailRings:0,_snakingVertices:0,_snakingTailVertices:0,_snakingDistance:0,_snakingTailDistance:0,_snakingIn:!1,_snakingOut:!1,_snakingPaused:!1,_snakingPauseTime:0,snakeIn:function(){if(!this._snakingIn&&!this._snakingOut&&"performance"in window&&"now"in window.performance&&this._map)return this._snakingIn=!0,this._snakingTime=performance.now(),this._snakingVertices=this._snakingRings=this._snakingDistance=0,this._snakeLatLngs||(this._snakeLatLngs=e.LineUtil.isFlat(this._latlngs)?[this._latlngs]:this._latlngs),this._latlngs=[[this._snakeLatLngs[0][0],this._snakeLatLngs[0][0]]],this._update(),this._snake(),this.fire("snakestart"),this.fire("snakeInStart"),this},snakeOut:function(){if(!this._snakingOut&&"performance"in window&&"now"in window.performance&&this._map){if(this._snakingOut=!0,this._snakingTime=performance.now(),this._snakingTailVertices=this._snakingTailRings=this._snakingTailDistance=0,this._snakeLatLngs||(this._snakeLatLngs=e.LineUtil.isFlat(this._latlngs)?[this._latlngs]:this._latlngs),!this._snakingIn){const e=[],t=Object.keys(this._snakeLatLngs);t.forEach((()=>{e.push([]),this._snakeLatLngs[e.length-1].forEach((function(t){e[e.length-1].push([t.lat,t.lng])}))})),this._latlngs=e}return this._update(),this._snakingIn||this._snake(),this.fire("snakeOutStart"),this}},_snake:function(){if(!this._map)return;if(this._snakingPaused)return;const t=performance.now();let s=t-this._snakingTime;s=0===s?.001:s;const i=s*this.options.snakingSpeed/1e3;return this._snakingTime=t,this._snakingIn&&this._latlngs[this._snakingRings].pop(),this._snakingOut&&this._latlngs[this._snakingTailRings].shift(),this._snakingIn&&this._snakeHeadForward(i),this._snakingOut&&this._snakeTailForward(i),this.setLatLngs(this._latlngs),(this._snakingIn||this._snakingOut)&&(this.fire("snake"),e.Util.requestAnimFrame(this._snake,this)),this},_snakeHeadForward:function(e){let t=this._map.latLngToContainerPoint(this._snakeLatLngs[this._snakingRings][this._snakingVertices]),s=this._map.latLngToContainerPoint(this._snakeLatLngs[this._snakingRings][this._snakingVertices+1]),i=t.distanceTo(s);while(this._snakingDistance+e>i){if(this._snakingVertices++,this._latlngs[this._snakingRings].push(this._snakeLatLngs[this._snakingRings][this._snakingVertices]),this._snakingVertices>=this._snakeLatLngs[this._snakingRings].length-1){if(this._snakingRings>=this._snakeLatLngs.length-1)return this._snakeInEnd();this._snakingVertices=0,this._snakingRings++,this._latlngs[this._snakingRings]=[this._snakeLatLngs[this._snakingRings][this._snakingVertices]]}this._snakingDistance-=i,t=this._map.latLngToContainerPoint(this._snakeLatLngs[this._snakingRings][this._snakingVertices]),s=this._map.latLngToContainerPoint(this._snakeLatLngs[this._snakingRings][this._snakingVertices+1]),i=t.distanceTo(s)}this._snakingDistance+=e;const a=this._snakingDistance/i,n=s.multiplyBy(a).add(t.multiplyBy(1-a)),r=this._map.containerPointToLatLng(n);return this._latlngs[this._snakingRings].push(r),this.options.followHead&&this._map.setView(r),this},_snakeTailForward:function(e){let t=this._map.latLngToContainerPoint(this._snakeLatLngs[this._snakingTailRings][this._snakingTailVertices]),s=this._map.latLngToContainerPoint(this._snakeLatLngs[this._snakingTailRings][this._snakingTailVertices+1]),i=t.distanceTo(s);while(this._snakingTailDistance+e>i){if(this._snakingTailVertices++,this._latlngs[this._snakingTailRings].shift(),this._snakingTailVertices>=this._snakeLatLngs[this._snakingTailRings].length-1){if(this._snakingTailRings>=this._snakeLatLngs.length-1)return this._snakeOutEnd();this._snakingTailVertices=0,this._latlngs[this._snakingTailRings]=[],this._snakingTailRings++,this._latlngs[this._snakingTailRings].shift()}this._snakingTailDistance-=i,t=this._map.latLngToContainerPoint(this._snakeLatLngs[this._snakingTailRings][this._snakingTailVertices]),s=this._map.latLngToContainerPoint(this._snakeLatLngs[this._snakingTailRings][this._snakingTailVertices+1]),i=t.distanceTo(s)}this._snakingTailDistance+=e;const a=this._snakingTailDistance/i,n=s.multiplyBy(a).add(t.multiplyBy(1-a)),r=this._map.containerPointToLatLng(n);return this._latlngs[this._snakingTailRings].unshift(r),this},_snakeInEnd:function(){return this._snakingIn=!1,this._snakingOut||this.setLatLngs(this._snakeLatLngs),this.fire("snakeend"),this.fire("snakeInEnd"),this},_snakeOutEnd:function(){return this._snakingOut=!1,this.fire("snakeOutEnd"),this},snakeReset:function(){return this._snakingIn=this._snakingOut=!1,this._snakeLatLngs&&this.setLatLngs(this._snakeLatLngs),this},snakePause:function(){this._snakingPaused=!0,this._snakingPauseTime=performance.now()},snakeUnpause:function(){if(!this._snakingPaused)return;this._snakingPaused=!1;const t=performance.now(),s=t-this._snakingPauseTime;this._snakingPauseTime=0,this._snakingTime+=s,e.Util.requestAnimFrame(this._snake,this)}}),e.Polyline.mergeOptions({snakingSpeed:200,followHead:!1}),e.LayerGroup.include({_snakingLayers:[],_snakingLayersDone:0,_snakingTailLayersDone:0,_snakingIn:!1,_snakingOut:!1,_snakeTimeoutsId:[],snakeIn:function(){if("performance"in window&&"now"in window.performance&&this._map&&!this._snakingIn&&!this._snakingOut){if(this._snakingIn=!0,this._snakingLayersDone=0,0===this._snakingLayers.length&&this._initSnakingLayers(),this.options.snakeRemoveLayers)this.clearLayers();else for(const t in this._snakingLayers)this._snakingLayers[t]instanceof e.Polyline&&this.removeLayer(this._snakingLayers[t]);return this.fire("snakestart"),this.fire("snakeInStart"),this._snakeHeadNext()}},snakeOut:function(){if("performance"in window&&"now"in window.performance&&this._map&&!this._snakingOut)return this._snakingOut=!0,this._snakingTailLayersDone=0,this.fire("snakeOutStart"),this._snakeTailNext()},_initSnakingLayers:function(){const e=Object.keys(this._layers);for(const t in e){const s=e[t];this._snakingLayers.push(this._layers[s])}return this},_snakeHeadNext:function(){if(!this._snakingIn)return this;if(this._snakingLayersDone>=this._snakingLayers.length)return this.fire("snakeend"),this.fire("snakeInEnd"),void(this._snakingIn=!1);const e=this._snakingLayers[this._snakingLayersDone];return this._snakingLayersDone++,this.getLayer(e)||this.addLayer(e),"snakeIn"in e?(e.once("snakeInEnd",(function(){this._snakeTimeoutsId.push(setTimeout(this._snakeHeadNext.bind(this),this.options.snakingPause))}),this),e.snakeIn()):this._snakeTimeoutsId.push(setTimeout(this._snakeHeadNext.bind(this),this.options.snakingPause)),this.fire("snake"),this},_snakeTailNext:function(){if(!this._snakingOut)return this;if(this.options.snakeRemoveLayers&&this.removeLayer(this._snakingLayers[this._snakingTailLayersDone-1]),this._snakingTailLayersDone>=this._snakingLayers.length)return this.fire("snakeOutEnd"),void(this._snakingOut=!1);const e=this._snakingLayers[this._snakingTailLayersDone];return this._snakingTailLayersDone++,"snakeOut"in e?(e.once("snakeOutEnd",(function(){this._snakeTimeoutsId.push(setTimeout(this._snakeTailNext.bind(this),this.options.snakingPause))}),this),e.snakeOut()):this._snakeTimeoutsId.push(setTimeout(this._snakeTailNext.bind(this),this.options.snakingPause)),this.fire("snake"),this},snakeReset:function(){this._snakingIn=!1,this._snakingOut=!1,0===this._snakingLayers.length&&this._initSnakingLayers();for(const e in this._snakeTimeoutsId)clearTimeout(e);this._snakeTimeoutsId=[];for(const t in this._snakingLayers)this._snakingLayers[t]instanceof e.Polyline&&this._snakingLayers[t].snakeReset(),this.getLayer(this._snakingLayers[t])||this.addLayer(this._snakingLayers[t]);return this}}),e.LayerGroup.mergeOptions({snakingPause:200,snakeRemoveLayers:!0})}),L=function(){var e=this,t=e._self._c;return t("div",{staticClass:"absolute-bottom-left absolute-bottom-right",attrs:{id:"queue"}},[t("q-tab-panels",{staticStyle:{background:"rgba(0, 0, 0, .5)"},attrs:{animated:""},model:{value:e.selected,callback:function(t){e.selected=t},expression:"selected"}},e._l(e.activeDevicesID,(function(s){return t("q-tab-panel",{key:`tab-panel-${s}`,staticClass:"no-padding no-scroll",attrs:{name:s.toString()}},[t("queue-item",{key:`tab-pane-${s}`,attrs:{id:s,messages:e.messages[s],date:e.date,needShowMessages:e.needShowMessages,needShowPlayer:e.needShowPlayer,player:e.player},on:{"player-value":e.playHandler,"player-play":t=>e.$emit("player-play",t),"player-pause":t=>e.$emit("player-pause",t),"player-stop":e.stopHandler,"player-speed":t=>e.$emit("player-speed",t),"player-mode":t=>e.$emit("player-mode",t),"change-need-show-messages":t=>{e.$emit("change-need-show-messages",t)},"view-on-map":t=>{e.$emit("view-on-map",t)}}})],1)})),1)],1)},q=[],T=function(){var e=this,t=e._self._c;return t("div",{style:[{height:e.height}]},[e.needShowMessages?t("div",{staticClass:"table__wrapper",style:{height:e.needShowPlayer?`calc(100% - ${e.playerHeight}px)`:"100%"}},[t("messages",{staticStyle:{height:"100%"},attrs:{messages:e.messages,activeDeviceId:e.id,limit:0,date:e.date,activeMessagesIds:e.activeMessagesIndexes},on:{view:e.viewMessageHandler,"view-on-map":e.viewOnMapHandler}})],1):e._e(),t("div",[t("q-resize-observer",{ref:"playerResize",on:{resize:e.onResizePlayer}}),e.needShowPlayer?t("player",{ref:"player",attrs:{min:e.timeRange.min,max:e.timeRange.max,status:e.player.status,speed:e.player.speed,mode:e.player.mode,needShowMessages:e.needShowMessages},on:{"player-next":e.playerNextHandler,"player-prev":e.playerPrevHandler,"player-play":e.playerPlayHandler,"player-pause":e.playerPauseHandler,"player-stop":e.playerStopHandler,"player-speed":e.playerSpeedHandler,"switch-show-messages":e.switchShowMessages,"switch-player-mode":e.switchPlayerMode},model:{value:e.playerValue,callback:function(t){e.playerValue=t},expression:"playerValue"}}):e._e()],1)])},j=[],H=function(){var e=this,t=e._self._c;return t("div",[t("virtual-scroll-list",{ref:"scrollList",attrs:{cols:e.cols,actions:e.actions,items:e.messages,dateRange:e.dateRange,viewConfig:e.viewConfig,theme:e.theme,title:"Messages",loading:e.isLoading,autoscroll:e.needAutoscroll,scrollOffset:"10%",item:e.listItem,itemprops:e.getItemsProps},on:{"action-to-bottom":e.actionToBottomHandler,"update-cols":e.updateColsHandler,"scroll-bottom":e.scrollBottomHandler,action:e.actionHandler}},[t("div",{staticClass:"no-messages text-center",attrs:{slot:"empty"},slot:"empty"},[t("div",{staticClass:"text-white",staticStyle:{"font-size":"3rem"}},[t("div",[e._v("No messages")]),t("div",{staticStyle:{"font-size":"1.5rem"}},[e._v("and the last position is unknown")])])])]),t("message-viewer",{ref:"messageViewer",attrs:{message:"undefined"!==typeof e.selectedMessage?e.selectedMessage:{},inverted:""},on:{close:e.closeHandler}})],1)},P=[],O=s("de45"),N=function(){var e=this,t=e._self._c;return t("q-dialog",{ref:"modal",on:{hide:function(t){return e.$emit("close")}}},[t("q-card",{class:{"bg-grey-9":void 0!==e.inverted},style:{minWidth:e.$q.platform.is.mobile?"100%":"30vw"}},[t("q-card-section",{staticClass:"scroll q-pa-none",style:{height:e.$q.platform.is.mobile?"calc(100% - 52px)":""}},[t("div",{staticClass:"layout-padding q-pa-md"},e._l(e.message,(function(s,i,a){return t("div",{key:a,staticClass:"row items-center"},[t("div",{staticClass:"text-weight-bold"},[t("span",{staticClass:"message-viewer__copy text-green cursor-pointer"},[t("q-icon",{attrs:{name:"mdi-content-copy"},nativeOn:{click:function(t){return e.copy(`${i}: ${s}`)}}})],1),t("span",{staticClass:"message-viewer__name text-white"},[e._v(e._s(i)+": ")]),t("span",{staticClass:"message-viewer__value text-green"},[e._v(e._s(e.getValue(i,s)))])])])})),0)]),t("q-separator",{attrs:{color:"white"}}),t("q-card-actions",{staticClass:"bg-grey-9 text-white",attrs:{align:"right"}},[t("q-btn",{attrs:{flat:""},on:{click:function(t){return e.copy(e.message)}}},[e._v("Copy full message")]),t("q-btn",{attrs:{flat:""},on:{click:function(t){return e.$refs.modal.hide()}}},[e._v("Close")])],1)],1)],1)},z=[],F=s("cdde"),R={name:"MessageViewer",data(){return{date:c["a"]}},props:{message:{type:Object,required:!0},inverted:{type:Boolean}},methods:{show(){this.$refs.modal.show()},getValue(e,t){return"timestamp"===e?c["a"].formatDate(1e3*t,"DD/MM/YYYY HH:mm:ss"):t},copy(e){Object(F["a"])(JSON.stringify(e)).then((e=>{this.$q.notify({color:"positive",icon:"content_copy",message:"Successfully copied",timeout:1e3})}),(e=>{this.$q.notify({color:"negative",icon:"content_copy",message:"Error coping",timeout:1e3})}))}}},V=R,B=s("0016"),E=s("eb85"),Q=Object(p["a"])(V,N,z,!1,null,null,null),A=Q.exports;w()(Q,"components",{QDialog:v["a"],QCard:f["a"],QCardSection:y["a"],QIcon:B["a"],QSeparator:E["a"],QCardActions:b["a"],QBtn:g["a"]});var U=function(){var e=this,t=e._self._c;return t("div",{staticClass:"cursor-pointer",class:{"missed-items":e.item["x-flespi-status"],"bg-white-opasity":e.selected,"item--telemetry-inited":e.item["x-flespi-inited-by-telemetry"],"item--invalid-position":!1===e.item["position.valid"]},style:{height:`${e.itemHeight}px`,width:`${e.rowWidth}px`,borderBottom:e.item.delimiter?"solid 1px #f40":"",color:e.selected?"#333":""},on:{click:function(t){return e.itemClickHandler(e.index,e.item)}}},[e._l(e.cols,(function(s,i){return["etc"===s.__dest?t("span",{key:s.name+i,staticClass:"list__item item_etc",class:{[`item_${i}`]:!0,"item--active":e.menuCellActive&&e.menuCellActive.row===e.index&&e.menuCellActive.col===i}},[e._v(e._s(e.values.etc.value||"*Empty*"))]):t("span",{key:s.name+i,staticClass:"list__item",class:{[`item_${i}`]:!0,"item--active":e.menuCellActive&&e.menuCellActive.row===e.index&&e.menuCellActive.col===i},attrs:{title:e.values[s.name].value}},[e._v("\n "+e._s(e.values[s.name].value)+"\n ")])]}))],2)},Y=[],W={props:["item","index","actions","cols","itemHeight","etcVisible","rowWidth","actionsVisible","selected","menuCellActive"],data(){return{date:c["a"]}},computed:{values(){let e={};return e=this.cols.length?this.cols.reduce(((e,t,s,i)=>(e[t.name]={value:this.getValueOfProp(t,this.item)},s===i.length-1&&(e.etc={value:""}),e)),{}):{etc:{value:""}},Object.keys(this.item).forEach((t=>{e[t]||(-1!==t.indexOf("image.bin.")?e.etc.value+=`${t}: `:e.etc.value+=`${t}: ${JSON.stringify(this.item[t])}; `)})),e}},methods:{clickHandler(e,t,s){this.$emit("action",{index:e,type:t,content:s})},itemClickHandler(e,t){this.$emit("item-click",{index:e,content:t})},getValue(e){return"string"===typeof e?e:JSON.stringify(e)},getValueOfProp(e,t){const s=e.name;let i=t[s];return s.match(/timestamp$/)?i=c["a"].formatDate(1e3*i,"DD/MM/YYYY HH:mm:ss"):-1!==s.indexOf("image.bin.")?i="":"string"!==typeof i&&(i=JSON.stringify(i)),i}}},Z=W,G=(s("e796"),Object(p["a"])(Z,U,Y,!1,null,null,null)),J=G.exports;const K={actions:[{icon:"mdi-eye",label:"Show message",classes:"",type:"view"}],viewConfig:{needShowFilter:!1,needShowDate:!1,needShowEtc:!0},theme:{color:"white",bgColor:"grey-9",contentInverted:!0,controlsInverted:!0}};var X={props:["mode","activeDeviceId","limit","messages","date","activeMessagesIds"],data(){const e=document.createElement("style");e.type="text/css";const t=document.head||document.getElementsByTagName("head")[0],s=t.appendChild(e);return{listItem:J,selectedMessage:void 0,dynamicCSS:s,theme:K.theme,viewConfig:K.viewConfig,actions:K.actions,moduleName:this.activeDeviceId,autoscroll:!0}},computed:{storedMessages(){const e=this.$store.state.messages[this.moduleName].messages;return this.scrollControlling(e.length),e},cols:{get(){return this.$store.state.messages[this.moduleName].cols},set(e){this.$store.commit(`messages/${this.moduleName}/updateCols`,e)}},from:{get(){return this.$store.state.messages[this.moduleName].from},set(e){e=e||0,this.$store.commit(`messages/${this.moduleName}/setFrom`,e)}},to:{get(){return this.$store.state.messages[this.moduleName].to},set(e){e=e||0,this.$store.commit(`messages/${this.moduleName}/setTo`,e)}},dateRange(){return[this.$store.state.messages[this.moduleName].from,this.$store.state.messages[this.moduleName].to]},reverse:{get(){return this.$store.state.messages[this.moduleName].reverse||!1},set(e){this.$store.commit(`messages/${this.moduleName}/setReverse`,e)}},currentLimit:{get(){return this.$store.state.messages[this.moduleName].limit},set(e){e=e||0,this.$store.commit(`messages/${this.moduleName}/setLimit`,e)}},selected:{get(){const e=this.$store.state.messages[this.moduleName].selected,t=e.slice(-1)[0];return void 0!==t&&this.scrollToSelected(t),e},set(e){e&&e.length&&(this.autoscroll=!1),this.$store.commit(`messages/${this.moduleName}/setSelected`,e)}},realtimeEnabled(){return this.$store.state.messages[this.moduleName].realtimeEnabled},isLoading(){return this.$store.state.messages[this.moduleName].isLoading},needAutoscroll(){return this.realtimeEnabled&&!this.selected.length&&this.autoscroll}},methods:{getItemsProps(e,t){const s=this.messages[e];t.key=s["x-flespi-message-key"],t.class=[`scroll-list-item--${e}`],t.props.selected=this.selected.includes(e),t.on||(t.on={}),t.on.action=this.actionHandler,t.on["item-click"]=this.viewMessageOnMap,t.dataHandler=(e,t,s)=>(this.autoscroll=!1,this.listItem.methods.getValueOfProp(e.data,t.data))},resetParams(){this.$refs.scrollList.resetParams()},updateColsHandler(e){this.cols=e},viewMessagesHandler({index:e,content:t}){this.selectedMessage=t,this.highlightSelected([e]),this.$refs.messageViewer.show(),this.$emit("view")},viewMessageOnMap({index:e,content:t}){this.selected=[e],this.$emit("view-on-map",t)},closeHandler(){let e=[];this.selectedMessage=void 0,this.activeMessagesIds.length&&(e=[this.activeMessagesIds[this.activeMessagesIds.length-1]]),this.highlightSelected(e)},actionToBottomHandler(){this.autoscroll=!0,this.$refs.scrollList.scrollTo(this.messages.length-1)},scrollBottomHandler(){this.autoscroll=!0},copyMessageHandler({index:e,content:t}){Object(F["a"])(JSON.stringify(t)).then((e=>{this.$q.notify({color:"positive",icon:"content_copy",message:"Message copied",timeout:1e3})}),(e=>{this.$q.notify({color:"negative",icon:"content_copy",message:"Error coping messages",timeout:1e3})}))},actionHandler({index:e,type:t,content:s}){switch(t){case"view":this.viewMessagesHandler({index:e,content:s});break}},unselect(){this.selected.length&&(this.selected=[])},updateDynamicCSS(e){this.dynamicCSS.styleSheet?this.dynamicCSS.styleSheet.cssText=e:this.dynamicCSS.innerText=e},highlightSelected(e){let t,s;if(e.length){const i=e[e.length-1];s=[i],t=`.scroll-list-item--${i} {background-color: rgba(255,255,255,0.7)!important; color: #333;}`}else s=[],t="";this.selected=s,this.updateDynamicCSS(t)},scrollToSelected(e){if("number"===typeof e&&e>=0&&this.$refs.scrollList){const t=this.$refs.scrollList.itemsCount;let s=e-Math.floor(t/2);s<0&&(s=0),this.$refs.scrollList.scrollTo(s)}},messageShow(e){this.selected[0]!==e[e.length-1]&&(this.highlightSelected(e),this.scrollToSelected(e[e.length-1]))},scrollControlling(e){this.selected.length&&this.selected[0]+1e3<=e&&this.$store.dispatch(`messages/${this.moduleName}/unsubscribePooling`)}},watch:{limit(e){this.currentLimit=e},activeMessagesIds(e){this.messageShow(e)}},created(){this.currentLimit=this.limit,this.highlightSelected(this.activeMessagesIds)},destroyed(){this.$store.commit(`messages/${this.moduleName}/clearSelected`),this.dynamicCSS.parentNode.removeChild(this.dynamicCSS)},components:{VirtualScrollList:O["a"],MessageViewer:A}},ee=X,te=(s("9f7d"),Object(p["a"])(ee,H,P,!1,null,null,null)),se=te.exports,ie=function(){var e=this,t=e._self._c;return t("div",{staticClass:"row",staticStyle:{"background-color":"#424242"},style:{height:e.needShowMessages?"auto":"100%"}},[t("div",{staticClass:"col-12 col-md-auto"},[t("q-btn",{attrs:{icon:"mdi-mail",color:e.needShowMessages?"blue":"white",size:e.$q.platform.is.desktop?"1rem":"md",round:"",flat:""},on:{click:function(t){return e.$emit("switch-show-messages")}}},[e.$q.platform.is.desktop?t("q-tooltip",[e._v("Messages")]):e._e()],1),t("q-btn",{attrs:{icon:"time"===e.mode?"mdi-map-clock-outline":"mdi-map-marker-distance",disable:e.max<=e.min||"play"===e.status,color:"white",size:e.$q.platform.is.desktop?"1rem":"md",round:"",flat:""},on:{click:function(t){return e.$emit("switch-player-mode")}}},[e.$q.platform.is.desktop?t("q-tooltip",[e._v("Change mode (Time/Data)")]):e._e()],1),t("q-btn",{staticClass:"text-white",attrs:{disable:e.max<=e.min,size:e.$q.platform.is.desktop?"1rem":"md",flat:""}},[e._v("\n x"+e._s(e.currentSpeed)+"\n "),t("q-menu",{ref:"currentSpeedPopover",staticStyle:{"background-color":"#424242"},attrs:{anchor:"top left"}},[t("div",{staticClass:"column"},e._l([100,70,50,30,10,1],(function(s){return t("q-btn",{key:s,staticClass:"text-white bg-grey-9 no-border-radius full-width",attrs:{size:e.$q.platform.is.desktop?"1rem":"md",flat:""},on:{click:function(t){return e.changeSpeed(s)}}},[e._v("\n x"+e._s(s)+"\n ")])})),1)]),e.$q.platform.is.desktop?t("q-tooltip",[e._v("currentSpeed")]):e._e()],1),t("q-btn",{directives:[{name:"touch-hold",rawName:"v-touch-hold.noMouse",value:e.playRepeatClickHandler,expression:"playRepeatClickHandler",modifiers:{noMouse:!0}}],staticClass:"text-white",attrs:{color:"play"===e.currentStatus?"blue":"white",disable:e.max<=e.min,size:e.$q.platform.is.desktop?"1rem":"md",icon:"play"===e.currentStatus?e.repeatFlag?"mdi-repeat":"mdi-pause":"mdi-play",round:"",flat:""},on:{click:[e.playClickHandler,function(t){return t.ctrlKey?e.playRepeatClickHandler.apply(null,arguments):null}]}},[e.$q.platform.is.desktop?t("q-tooltip",[e._v("Play/Pause (Ctrl+Click to repeat)")]):e._e(),e.$q.platform.is.mobile?t("q-tooltip",[e._v("Play/Pause (Touch hold to repeat)")]):e._e()],1),t("q-btn",{staticClass:"text-white",attrs:{color:"white",disable:e.max<=e.min,size:e.$q.platform.is.desktop?"1rem":"md",icon:"mdi-stop",round:"",flat:""},on:{click:e.stop}},[e.$q.platform.is.desktop?t("q-tooltip",[e._v("Stop")]):e._e()],1)],1),t("div",{staticClass:"col-12 col-md relative-position"},[t("q-btn",{staticClass:"absolute-left text-white",attrs:{disable:e.max<=e.min||"data"===e.mode,icon:"mdi-skip-previous",size:e.$q.platform.is.desktop?"1rem":"md",round:"",flat:""},on:{click:function(t){return e.$emit("player-prev")}}},[e.$q.platform.is.desktop?t("q-tooltip",[e._v("Prev message")]):e._e()],1),t("div",{staticClass:"player"},[t("div",{staticClass:"player__main"},[t("div",{ref:"playerContainer",staticClass:"player__container",staticStyle:{transform:"translate3d(0,0,0)"}},[e.max>e.min&&"time"===e.mode?t("q-range",{attrs:{color:"white",min:e.min,max:e.max,step:1},model:{value:e.range,callback:function(t){e.range=t},expression:"range"}}):e._e(),t("div",{staticClass:"player__line cursor-pointer",class:{disabled:e.max<=e.min||"data"===e.mode},on:{click:e.clickLineHandler}},[t("div",{staticClass:"line line__disabled line__disabled--left",style:{width:100*(e.rangeMin-e.min)/(e.max-e.min)+"%"}}),t("div",{staticClass:"line line__active",style:{left:`${"time"===e.mode?e.current:0}%`,width:100-("time"===e.mode?e.current:0)-(e.max>0?100/e.max*(e.max-e.rangeMax):0)+"%"}}),t("div",{staticClass:"line line__disabled line__disabled--right",style:{width:100/(e.max-e.min)*(e.max-e.rangeMax)+"%"}})]),t("div",{directives:[{name:"touch-pan",rawName:"v-touch-pan.horizontal.mouse",value:e.dragPlayerControl,expression:"dragPlayerControl",modifiers:{horizontal:!0,mouse:!0}}],staticClass:"player__control cursor-pointer",class:{"player__control--mobile":e.$q.platform.is.mobile,"player__control--disabled":e.max<=e.min||"data"===e.mode,disabled:e.max<=e.min||"data"===e.mode},style:{left:`${"time"===e.mode?e.current:0}%`}})],1)])]),t("q-btn",{staticClass:"absolute-right text-white",attrs:{disable:e.max<=e.min||"data"===e.mode,icon:"mdi-skip-next",size:e.$q.platform.is.desktop?"1rem":"md",round:"",flat:""},on:{click:function(t){return e.$emit("player-next")}}},[e.$q.platform.is.desktop?t("q-tooltip",[e._v("Next message")]):e._e()],1)],1)])},ae=[],ne=s("b047c"),re=s.n(ne),oe=s("0f32"),le=s.n(oe),ce={name:"Player",props:["min","max","value","status","speed","mode","needShowMessages"],data(){return{currentStatus:this.status,currentValue:this.value,rangeMin:this.min,rangeMax:this.max,timer:0,currentMode:this.mode,currentSpeed:this.speed,percentsByPixel:0,current:0,repeatFlag:!1}},computed:{range:{get(){return{min:this.rangeMin,max:this.rangeMax}},set(e){this.pause(),this.currentValue<=e.min&&(this.currentValue=e.min),this.currentValue>e.max&&(this.currentValue=e.max,this.end()),this.rangeMin=e.min,this.rangeMax=e.max}}},mounted(){this.$refs.playerContainer&&(this.percentsByPixel=100/this.$refs.playerContainer.offsetWidth)},watch:{currentValue:le()((function(e){this.$emit("input",Math.round(e))}),100,{trailing:!0}),currentSpeed:re()((function(e){this.$refs.currentSpeedPopover.hide(),"play"===this.currentStatus&&(this.pause(),this.$nextTick(this.play))}),100),value(e){const t=(e-this.min)/(this.max-this.min)*100;if(this.checkNeedRedraw(t),e===this.currentValue)return!1;this.currentValue=e},min(e,t){this.rangeMin===t&&(this.rangeMin=e)},max(e,t){this.rangeMax===t&&(this.rangeMax=e)},status(e,t){e!==this.currentStatus&&(this.currentStatus=e,"play"!==e&&"pause"!==e||this.playClickHandler(),"stop"===e&&this.stop())},mode(e){this.currentMode=e,this.current=0,this.currentValue=this.min,this.timer&&clearInterval(this.timer)}},methods:{checkNeedRedraw(e){Math.abs(e-this.current)>=this.percentsByPixel&&(this.current=e)},playRepeatClickHandler(){this.repeatFlag=!this.repeatFlag,"pause"===this.currentStatus&&this.playClickHandler()},playClickHandler(){switch(this.currentStatus){case"stop":case"pause":this.play();break;case"play":this.pause();break}},emit(e){status!==this.currentStatus&&this.$emit(`player-${e}`)},stop(){this.timer&&(clearInterval(this.timer),this.timer=0,"play"===this.currentStatus&&(this.currentStatus="stop",this.currentValue=this.min)),this.emit("stop")},changeCurrent(){const e=this.currentValue+1;if(e>this.rangeMax)return this.pause(),!1;this.currentValue=e},changeSpeed(e){this.currentSpeed=e,this.$emit("player-speed",e)},play(){"pause"!==this.currentStatus&&"stop"!==this.currentStatus||(this.currentStatus="play",this.emit("play")),this.currentValue===this.max&&(this.currentValue=this.min),this.timer=setInterval(this.changeCurrent,1e3/this.currentSpeed)},pause(){if(this.repeatFlag&&this.currentValue===this.max)return setTimeout((()=>{this.currentValue=this.min}),600),!1;this.timer&&(clearInterval(this.timer),this.timer=0,"play"===this.currentStatus&&(this.end(),this.currentStatus="pause",this.emit("pause")))},end(){this.value!==this.currentValue&&setTimeout((()=>{this.$emit("input",this.currentValue)}),100)},getPlayerParams(){const e=this.$refs.playerContainer,t=e.getBoundingClientRect().left,s=e.offsetWidth,i=s/(this.max-this.min);return{left:t,width:s,step:i}},dragPlayerControl(e){if(this.max<=this.min||"data"===this.mode)return!1;const{left:t,step:s}=this.getPlayerParams();let i=this.min+(e.position.left-t)/s;ithis.rangeMax&&(i=this.rangeMax),this.currentValue=e.isFinal?Math.round(i):i},clickLineHandler(e){if(this.max<=this.min||"data"===this.mode)return!1;const t=e.clientX,{left:s,step:i}=this.getPlayerParams(),a=this.min+(t-s)/i;if(this.currentValue!==a){if(athis.rangeMax)return!1;this.currentValue=Math.round(a)}}},beforeDestroy(){this.stop()}},de=ce,he=(s("81e1"),s("4e73")),me=s("7bbf"),pe=s("c1d0"),ge=s("f449"),ue=s("75c3"),ve=Object(p["a"])(de,ie,ae,!1,null,null,null),fe=ve.exports;w()(ve,"components",{QBtn:g["a"],QTooltip:u["a"],QMenu:he["a"],QRange:me["a"],QSlider:pe["a"]}),w()(ve,"directives",{TouchHold:ge["a"],TouchPan:ue["a"]});var ye={name:"QueueItem",props:["id","messages","date","needShowMessages","needShowPlayer","player"],data(){return{playerMode:this.player.mode||"time",playerValue:0,playerStatus:"stop",playerHeight:0,activeMessagesIndexes:[],messagesFlag:this.needShowMessages}},computed:{timeRange(){return this.messages.length?{min:Math.floor(this.messages[0].timestamp),max:Math.floor(this.messages[this.messages.length-1].timestamp)}:{min:0,max:0}},indexesByTimestamp(){return this.messages.reduce(((e,t,s)=>{const i=Math.floor(t.timestamp);return e[i]||(e[i]=[]),e[i].push(s),e}),{})},height(){return this.needShowMessages&&this.needShowPlayer?`calc(22vh + ${this.playerHeight}px)`:this.needShowMessages&&!this.needShowPlayer?"22vh":!this.needShowMessages&&this.needShowPlayer?`${this.playerHeight}px`:"0vh"}},mounted(){this.$refs.playerResize&&this.$refs.playerResize.trigger()},methods:{getCurrentActiveTimestamp(){let e=0;const t=Object.keys(this.indexesByTimestamp);return t.every(((t,s)=>this.playerValue>=t&&(e=t,!0))),e},update(e){"time"===this.playerMode&&(this.$emit("player-value",{id:this.id,messagesIndexes:this.indexesByTimestamp[e]}),this.activeMessagesIndexes=this.indexesByTimestamp[e]||[])},playerNextHandler(){const e=Object.keys(this.indexesByTimestamp),t=e.indexOf(this.getCurrentActiveTimestamp());if(t===e.length-1)return this.$q.notify({message:"That`s last message",color:"info",position:"bottom-left"}),!1;this.playerValue=e[t+1]},playerPrevHandler(){const e=Object.keys(this.indexesByTimestamp),t=e.indexOf(this.getCurrentActiveTimestamp());if(0===t)return this.$q.notify({message:"That`s first message",color:"info",position:"bottom-left"}),!1;this.playerValue=e[t-1]},playerPlayHandler(){this.playerStatus="play",this.playerValue||(this.playerValue=Math.floor(this.messages[0].timestamp)),this.$emit("player-play",{id:this.id})},playerPauseHandler(){this.playerStatus="pause",this.$emit("player-pause",{id:this.id})},playerStopHandler(){this.playerStatus="stop",this.messages.length?this.playerValue=Math.floor(this.messages[0].timestamp):this.playerValue=0,this.$emit("player-stop",{id:this.id})},playerSpeedHandler(e){this.$emit("player-speed",{id:this.id,speed:e})},viewMessageHandler(){this.$refs.player&&"stop"!==this.playerStatus&&this.$refs.player.stop()},viewOnMapHandler(e){this.$emit("view-on-map",e)},switchShowMessages(){this.messagesFlag=!this.messagesFlag,this.$emit("change-need-show-messages",this.messagesFlag)},switchPlayerMode(){this.playerMode="data"===this.playerMode?"time":"data",this.$emit("player-mode",{mode:this.playerMode,id:this.id})},onResizePlayer(e){this.playerHeight=e.height}},watch:{playerValue(e,t){let s=0,i=!0;const a=Object.keys(this.indexesByTimestamp);a.every(((n,r)=>e>=n?(s=n,r===a.length-1&&(i=!1),!0):((t>=n||t\n \n \n \n `,a=`\n
${i}
\n ${s?`
${e}
`:""}\n `;return a}var Re=s("ef44");I(x);var Ve={name:"Map",props:["params","devicesColors","selectedDeviceId","isSelectedDeviceFollowed","activeDevices","delay","date"],data(){return{map:null,flyToZoom:15,isFlying:null,markers:{},tracks:{},telemetryDeviceId:-1,activeDevicesID:[],devicesState:{},selected:null,currentColorModel:"#fff",currentColorId:0,player:{currentMsgIndex:null,speed:10,status:"stop",mode:"time",tailInterval:0}}},computed:{...Object(r["d"])({messages(e){return this.activeDevicesID.reduce(((t,s)=>(t[s]=e.messages[s].messages.reduce(((e,t,s)=>(t["position.latitude"]&&t["position.longitude"]&&(this.params.needShowInvalidPositionMessages||!t.hasOwnProperty("position.valid")||t.hasOwnProperty("position.valid")&&!0===t["position.valid"])&&(Object.defineProperty(t,"x-flespi-message-index",{value:s,enumerable:!1}),e.push(t)),e)),[]),t)),{})},allMessages(e){return this.activeDevicesID.reduce(((t,s)=>(t[s]=e.messages[s].messages,t)),{})},telemetry:e=>e.telemetry}),color:{get(){return this.currentColorModel},set(e){this.updateColorHandler({id:this.currentColorId,color:e}),this.currentColorModel=e}},mapHeight(){let e="100%";return this.activeDevices.length?(this.params.needShowPlayer&&(e="calc(100% - 48px)"),e):e}},methods:{initMap(){if(!this.map){let t=x["tileLayer"]("//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{minZoom:3,noWrap:!0});this.map=x["map"]("map",{center:[51.50853,-.12574],zoom:3,maxBounds:[[90,-180],[-90,180]],layers:[t]}),this.map.addEventListener("zoom",(e=>{e.flyTo||(this.flyToZoom=e.target.getZoom())})),this.map.addEventListener("click",this.mapClickHandler);let s=x["tileLayer"]("//server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",{minZoom:3,noWrap:!0,attribution:"© ArcGIS"}),i=x["tileLayer"]("//{s}.tile.opentopomap.org/{z}/{x}/{y}.png",{minZoom:3,maxZoom:19,attribution:"Map data: © OpenStreetMap contributors, SRTM | Map style: © OpenTopoMap (CC-BY-SA)",noWrap:!0}),a=x["tileLayer"].wms("//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{layers:"semitransparent",transparent:"true",format:"image/png",maxZoom:21,opacity:.5});var e={OpenStreetMap:t,Satellite:s,OpenTopoMap:i};x["control"].layers(e,{"OpenStreetMaps (0.5)":a}).addTo(this.map),x["control"].polylineMeasure({position:"topleft",showBearings:!1,clearMeasurementsOnStop:!1,showUnitControl:!1,showClearControl:!0,measureControlTitleOn:"Turn on ruler",measureControlTitleOff:"Turn off ruler",tooltipTextFinish:"Click to finish line
",tooltipTextDelete:"Press SHIFT-key and click to delete point",tooltipTextMove:"Click and drag to move point
",tooltipTextResume:"
Press CTRL-key and click to resume line",tooltipTextAdd:"Press CTRL-key and click to add point"}).addTo(this.map)}},flyToWithHideTracks(e,t){const s=[];let i=!1;this.map.once("zoomstart",(e=>{this.isFlying=!0;const a=e.target._zoom;a!==t&&(i=!0,Object.keys(this.tracks).forEach((e=>{const t=this.tracks[e];t instanceof x["Polyline"]&&(t.tail&&t.tail instanceof x["Polyline"]&&this.map.hasLayer(t.tail)&&(this.map.removeLayer(t.tail),s.push(t.tail)),t.overview&&t.overview instanceof x["Polyline"]&&this.map.hasLayer(t.overview)&&(this.map.removeLayer(t.overview),s.push(t.overview)),t.overview&&this.map.hasLayer(t.overview)&&(this.map.removeLayer(t),s.push(t)))})))})),this.map.once("zoomend",(e=>{this.isFlying=!1,i&&s.forEach((e=>{this.map.addLayer(e)}))})),this.map.flyTo(e,t)},generateIcon(e,t,s){return x["divIcon"]({className:`my-div-icon icon-${e}`,iconSize:new x["Point"](20,35),html:Fe(t,s,this.params.needShowNamesOnMap)})},getAccuracyParams(e){const t=[e["position.latitude"],e["position.longitude"]],s=e["position.hdop"]||e["position.pdop"]||0,i={stroke:!0,color:"#444",weight:3,opacity:.5,fillOpacity:.15,fillColor:"#444",clickable:!1};return{position:t,accuracy:s,circleStyle:i}},updateMarkerDirection(e,t){if(t){const s=document.querySelector(`.icon-${e} .my-div-icon__inner`);s&&(s.style.transform=`rotate(${t||0}deg)`)}},updateMarker(e,t,s){this.updateMarkerDirection(e,s),this.markers[e].setLatLng(t).update()},initMarker(e,t,s){const i=this.messages[e][this.messages[e].length-1]["position.direction"]?this.messages[e][this.messages[e].length-1]["position.direction"]:0,a=this.tracks[e]&&this.tracks[e].options?this.tracks[e].options.color:this.markers[e]?this.markers[e].color:this.devicesColors[e];this.markers[e]=x["marker"](s,{icon:this.generateIcon(e,t,a),draggable:!1,title:t}),this.markers[e].id=e,this.markers[e].color=a;const{position:n,accuracy:r,circleStyle:o}=this.getAccuracyParams(this.messages[e][this.messages[e].length-1]);this.markers[e].accuracy=x["circle"](n,r,o),this.markers[e].accuracy.addTo(this.map),this.markers[e].addEventListener("add",(t=>{this.updateMarkerDirection(e,i),this.messages[e]&&this.messages[e].length&&(this.selectedDeviceId,parseInt(e))})),this.markers[e].addEventListener("click",(t=>{this.telemetryDeviceId=parseInt(e),this.$emit("update-telemetry-device-id",this.telemetryDeviceId)})),this.markers[e].addEventListener("move",(t=>{"stop"===this.player.status&&this.updateMarkerDirection(e,this.messages[e][this.messages[e].length-1]["position.direction"])})),this.markers[e].addEventListener("contextmenu",(t=>{this.currentColorId=e,this.currentColorModel=this.markers[e].color,this.$refs.colorModal.show()})),this.markers[e].addTo(this.map)},getLatLngArrByDevice(e){return this.messages[e]?this.messages[e].reduce(((e,t)=>(e.push([t["position.latitude"],t["position.longitude"]]),e)),[]):[]},onResize(){this.map&&this.map.invalidateSize()},removeMarker(e){this.markers[e]&&this.markers[e]instanceof x["Marker"]&&(this.removeFlags(e),this.map.removeLayer(this.markers[e].accuracy),this.markers[e].remove(),this.tracks[e].tail&&this.tracks[e].tail instanceof x["Polyline"]&&this.tracks[e].tail.remove(),this.tracks[e].overview&&this.tracks[e].overview instanceof x["Polyline"]&&this.tracks[e].overview.remove(),this.tracks[e].remove()),n["default"].delete(this.markers,e),n["default"].delete(this.tracks,e)},flyToDevice(e){const t=this.activeDevices.filter((t=>t.id===e)),s=t.length?t[0]:null;let i=s&&[];this.messages[e]&&this.messages[e].length&&(i=[this.messages[e][this.messages[e].length-1]["position.latitude"],this.messages[e][this.messages[e].length-1]["position.longitude"]]),i&&i.length?this.flyToWithHideTracks(i,this.flyToZoom):this.$q.notify({message:"No Position!",color:"warning",timeout:this.params.needShowMessages?500:2e3})},centerOnDevice(e,t){const s=this.activeDevices.filter((t=>t.id===e)),i=s.length?s[0]:null;let a=i&&[];this.messages[e]&&this.messages[e].length&&(a=[this.messages[e][this.messages[e].length-1]["position.latitude"],this.messages[e][this.messages[e].length-1]["position.longitude"]]),a.length?this.map.setView(a,t||14,{animation:!1}):this.$q.notify({message:"No Position!",color:"warning",timeout:this.params.needShowMessages?500:2e3})},generateFlag(e){let{id:t,status:s}=e||{},i=t?this.devicesColors[t]:"#e53935",a="map-marker-star-outline";return"start"===s?(i=Ne["a"].getBrand("primary"),a="map-marker-outline"):"stop"===s&&(i=Ne["a"].getBrand("positive"),a="map-marker-check"),x["divIcon"]({className:`my-flag-icon flag-${s}-${t}`,iconSize:new x["Point"](35,35),html:``})},addFlags(e){if(!this.markers[e])return!1;if(this.markers[e].flags||(this.markers[e].flags={start:{},stop:{}}),this.messages[e].length){const t=[this.messages[e][0]["position.latitude"],this.messages[e][0]["position.longitude"]],s=[this.messages[e][this.messages[e].length-1]["position.latitude"],this.messages[e][this.messages[e].length-1]["position.longitude"]];this.markers[e].flags.start=x["marker"](t,{icon:this.generateFlag({id:e,status:"start"})}),this.markers[e].flags.start.addTo(this.map),this.markers[e].flags.stop=x["marker"](s,{icon:this.generateFlag({id:e,status:"stop"})});const i=this.$store.state.messages[e].to<=Date.now();i&&this.markers[e].flags.stop.addTo(this.map)}},removeFlags(e){if(!this.markers[e]||!this.markers[e].flags||!(this.markers[e].flags.start instanceof x["Marker"])||!(this.markers[e].flags.stop instanceof x["Marker"]))return!1;this.markers[e].flags.start.remove(),this.markers[e].flags.stop.remove(),this.markers[e].flags=void 0},async getDeviceData(e){if(e){this.$store.state.messages[e].realtimeEnabled&&await this.$store.dispatch(`messages/${e}/unsubscribePooling`),this.$store.commit(`messages/${e}/clearMessages`);const s=this.date[0],i=this.date[1];if(this.$store.commit(`messages/${e}/setFrom`,s),this.$store.commit(`messages/${e}/setTo`,i),await this.$store.dispatch(`messages/${e}/get`),i>Date.now()){const t=await this.$store.dispatch(`messages/${e}/pollingGet`);t()}if(this.addFlags(e),!this.$store.state.messages[e].messages.length)try{this.devicesState[e].telemetryAccess=!0,await this.$store.dispatch("getInitDataByDeviceId",[e,this.params.needShowInvalidPositionMessages])}catch(t){t.response&&t.response.status&&403===t.response.status&&(this.devicesState[e].telemetryAccess=!1)}if(this.devicesState[e].initStatus=!0,!1===this.devicesState[e].messagesAccess&&!1===this.devicesState[e].telemetryAccess){const t=this.activeDevices.filter((t=>t.id===e))[0];Object.defineProperty(t,"x-flespi-no-access",{value:!0,enumerable:!1})}}},async initDevice(e){this.$q.loading.show(),e&&(this.$store.commit(`messages/${e}/setActive`,e),await this.$store.dispatch(`messages/${e}/getCols`,{actions:!0,etc:!0}),await this.getDeviceData(e)),n["default"].connector.socket.on("offline",(()=>{this.$store.commit(`messages/${e}/setOffline`)})),n["default"].connector.socket.on("connect",(()=>{this.$store.state.messages[e].offline&&(this.$store.commit(`messages/${e}/setReconnected`),this.$store.dispatch(`messages/${e}/getMissedMessages`))})),e===this.selectedDeviceId&&!0===this.devicesState[e].initStatus&&(this.telemetryDeviceId=parseInt(e),this.$emit("update-telemetry-device-id",this.telemetryDeviceId),this.centerOnDevice(e)),this.$q.loading.hide()},viewOnMapHandler(e){if(e["position.latitude"]&&e["position.longitude"]){const t=[e["position.latitude"],e["position.longitude"]],s=this.map.getZoom();this.map.messagePoint&&this.map.messagePoint.remove(),this.map.messagePoint=x["marker"](t,{icon:x["divIcon"]({className:"my-round-marker-wrapper",iconSize:new x["Point"](10,10),html:'
'})}),this.map.messagePoint.addTo(this.map),this.map.setView(t,s>12?s:12,{animation:!1})}else this.$q.notify({message:"No position",color:"warning",position:"bottom-left",icon:"mdi-alert-outline"})},playProcess(e,t){const s="data"===this.player.mode?0:1;switch(t){case"value":s?this.playerTimeValue(e):this.playerDataValue(e);break;case"play":if("play"===this.player.status)return;s?this.playerTimePlay(e):this.playerDataPlay(e);break;case"stop":if("stop"===this.player.status)return;s?this.playerTimeStop(e):this.playerDataStop(e);break;case"pause":if("pause"===this.player.status)return;s?this.playerTimePause(e):this.playerDataPause(e);break}},playerTimeValue({id:e,messagesIndexes:t}){if(!this.messages[e]||!t||"play"!==this.player.status)return!1;let s=0,i=null;const a=t[t.length-1],n=0,r=this.messages[e].slice(n,a+1),o=r.reduce(((e,t,s)=>("number"===typeof t["position.latitude"]&&"number"===typeof t["position.longitude"]&&(i=s,e.push([t["position.latitude"],t["position.longitude"]])),e)),[]);if(t.forEach((a=>{if(this.markers[e]&&this.markers[e]instanceof x["Marker"]){const n=this.messages[e][a],r=n&&"number"===typeof n["position.latitude"]&&"number"===typeof n["position.longitude"];if(this.player.currentMsgIndex=a,r){const i=[n["position.latitude"],n["position.longitude"]];if("play"===this.player.status&&0!==t[0]){let r=1e3/this.player.speed/t.length;if(0!==a){const t=this.messages[e][a-1].timestamp,i=n.timestamp,o=i-t;r=1e3*o/this.player.speed,s=o}r-=50,r?this.markers[e].slideTo(i,{duration:r}):this.markers[e].setLatLng(i).update(),this.updateMarkerDirection(e,n["position.direction"])}else this.markers[e].setLatLng(i).update(),this.updateMarker(e,i,n["position.direction"]);this.markers[e].accuracy.setRadius(this.getAccuracyParams(n).accuracy),this.markers[e].accuracy.setLatLng(i)}else{const t=this.messages[e][i],s=o[o.length-1];this.markers[e].setLatLng(s).update(),this.updateMarker(e,s,t["position.direction"]),this.markers[e].accuracy.setRadius(this.getAccuracyParams(t).accuracy),this.markers[e].accuracy.setLatLng(s)}}})),this.tracks[e]&&this.tracks[e]instanceof x["Polyline"]&&o.length){if(!this.tracks[e].tail||!(this.tracks[e].tail instanceof x["Polyline"]))return this.tracks[e].tail=x["polyline"](o,this.tracks[e].options),this.tracks[e].tail.addTo(this.map),this.tracks[e].tail.addEventListener("click",(t=>this.showMessageByTrackClick(t,e,this.tracks[e].tail))),!0;this.player.tailInterval&&clearTimeout(this.player.tailInterval),this.player.tailInterval=setTimeout((()=>{this.tracks[e].tail&&this.tracks[e].tail.setLatLngs(o)}),700*s/this.player.speed)}},playerTimePlay({id:e}){this.tracks[e]&&this.tracks[e]instanceof x["Polyline"]&&(this.tracks[e].remove(),this.player.status="play")},playerTimeStop({id:e}){if(this.tracks[e]&&this.tracks[e]instanceof x["Polyline"]){this.tracks[e].tail&&(this.tracks[e].tail.remove(),delete this.tracks[e].tail);const t=this.$store.state.messages[e].realtimeEnabled,s=t?this.messages[e].length-1:0,i=this.messages[e][s];this.$nextTick((()=>{this.player.currentMsgIndex=s?null:0})),this.player.status="stop",this.tracks[e].addTo(this.map);const a=[i["position.latitude"],i["position.longitude"]];this.updateMarker(e,a,i["position.direction"])}},playerTimePause({id:e}){this.player.status="pause"},playerDataValue({id:e}){},playerDataPlay({id:e}){if("pause"===this.player.status)return this.tracks[e].overview.snakeUnpause(),void(this.player.status="play");this.player.status="play",this.tracks[e].remove();const t=this.messages[e].map(((e,t)=>({lat:e["position.latitude"],lng:e["position.longitude"],dir:e["position.direction"],index:t})));if(t.length<2)return this.tracks[e].addTo(this.map),this.player.status="stop",void(this.player.currentMsgIndex=null);const s=x["polyline"](t,{snakingSpeed:20*this.player.speed,color:this.tracks[e].options.color});this.tracks[e].overview=s,this.tracks[e].overview.addEventListener("click",(t=>this.showMessageByTrackClick(t,e,this.tracks[e].overview))),s.addTo(this.map).snakeIn(),s.on("snake",(()=>{const i=s.getLatLngs(),a=i.slice(-1)[0],n=a.slice(-1)[0],r=t[i[0].length-1];this.updateMarker(e,n,r.dir),this.player.currentMsgIndex!==r.index&&(this.player.currentMsgIndex=r.index)})),s.on("snakeInEnd",(()=>{this.playerDataStop({id:e})}))},playerDataStop({id:e}){this.player.status="stop",this.tracks[e].overview&&(this.tracks[e].overview.remove(),delete this.tracks[e].overview),this.tracks[e]&&this.tracks[e]instanceof x["Polyline"]&&(this.tracks[e].addTo(this.map),this.tracks[e].addEventListener("click",(t=>this.showMessageByTrackClick(t,e,this.tracks[e]))));const t=this.messages[e].slice(-1)[0];if(this.player.currentMsgIndex=null,t){const s=[t["position.latitude"],t["position.longitude"]];this.updateMarker(e,s,t["position.direction"])}},playerDataPause({id:e}){"stop"!==this.player.status&&(this.player.status="pause",this.tracks[e].overview.snakePause())},playerSpeedChangeHandler({speed:e,id:t}){this.player.speed=e,"data"===this.player.mode&&"stop"!==this.player.status&&this.tracks[t].overview.setStyle({snakingSpeed:20*e})},playerModeChange({id:e,mode:t}){"stop"!==this.player.status&&("data"===t?this.playerTimeStop({id:e}):this.playerDataStop({id:e})),this.player.mode=t},updateColorHandler({id:e,color:t}){this.$emit("update-color",e,t)},updateDeviceColorOnMap(e,t){if(!this.tracks[e]||!(this.tracks[e]instanceof x["Polyline"])||!this.markers[e]||!(this.markers[e]instanceof x["Marker"]))return!1;this.tracks[e].setStyle({color:t}),this.tracks[e].tail&&this.tracks[e].tail.setStyle({color:t}),this.tracks[e].overview&&this.tracks[e].overview.setStyle({color:t}),this.markers[e].color=t,this.markers[e].setIcon(this.generateIcon(e,this.markers[e].options.title,t)),this.messages[e][this.messages[e].length-1]["position.direction"]&&this.updateMarkerDirection(e,this.messages[e][this.messages[e].length-1]["position.direction"])},queueCreatedHandler(){this.$emit("queue-created")},registerModule(e){this.devicesState[e]={messagesAccess:!0},this.$store.registerModule(["messages",e],Object(Oe["a"])({Vue:n["default"],LocalStorage:this.$q.localStorage,name:{name:"messages",lsNamespace:`${this.$store.state.storeName}.cols`},errorHandler:t=>{t.response&&t.response.status&&403===t.response.status?this.devicesState[e].messagesAccess=!1:this.$store.commit("reqFailed",t)}}))},showMessageByTrackClick(e,t,s){e.originalEvent.view.L.DomEvent.stopPropagation(e);const i=this.messages[t],a=x["GeometryUtil"].closest(this.map,s,e.latlng),n=i.reduce(((e,t,s)=>{const n=t["position.latitude"],r=t["position.longitude"],o=i[s+1];if(!o)return e;const l=o["position.latitude"],c=o["position.longitude"],d=n>=a.lat&&l<=a.lat||n<=a.lat&&l>=a.lat,h=r>=a.lng&&c<=a.lng||r<=a.lng&&c>=a.lng;if(d&&h){const t=x["GeometryUtil"].distance(this.map,a,{lat:n,lng:r}),i=x["GeometryUtil"].distance(this.map,a,{lat:l,lng:c}),o=t>i?s+1:s;e.push(o)}return e}),[]),r=i[n.slice(-1)[0]]||{};this.viewOnMapHandler(r),this.$store.commit(`messages/${t}/setSelected`,n)},mapClickHandler(e){this.map.messagePoint&&this.map.messagePoint.remove(),this.activeDevicesID.forEach((e=>{this.$store.commit(`messages/${e}/clearSelected`)}))},updateOrInitDevice(e){if(!this.messages[e]||!this.messages[e].length)return this.markers[e]||(this.markers[e]={},this.markers[e].id=e,this.markers[e].color=this.devicesColors[e],this.tracks[e]={}),!1;if(!(this.markers[e]instanceof x["Marker"])&&!(this.tracks[e]instanceof x["Polyline"])){const t=this.activeDevices.filter((t=>t.id===parseInt(e)))[0].name||`#${e}`,s=[this.messages[e][this.messages[e].length-1]["position.latitude"],this.messages[e][this.messages[e].length-1]["position.longitude"]];if(this.initMarker(e,t,s),this.tracks[e]=x["polyline"](this.getLatLngArrByDevice(e),{weight:4,color:this.markers[e]?this.markers[e].color:this.getColorById(e)}).addTo(this.map),this.tracks[e].addEventListener("click",(t=>this.showMessageByTrackClick(t,e,this.tracks[e]))),Number.parseInt(e)===this.selected)if(this.messages[e].length>1){const t=this.tracks[e].getBounds();this.map.fitBounds(t)}else this.map.setView(s,14,{animation:!1})}if(!this.devicesState[e].messagesAccess)return!1;const t=this.getLatLngArrByDevice(e);if(this.isSelectedDeviceFollowed){const s=this.selectedDeviceId&&this.selectedDeviceId==e&&this.markers[this.selectedDeviceId]&&this.markers[this.selectedDeviceId]instanceof x["Marker"]?this.markers[this.selectedDeviceId].getLatLng():{},i=this.selectedDeviceId&&this.messages[this.selectedDeviceId]&&this.messages[this.selectedDeviceId].length&&s.lat&&s.lat!==this.messages[this.selectedDeviceId][this.messages[this.selectedDeviceId].length-1]["position.latitude"]&&s.lng&&s.lng!==this.messages[this.selectedDeviceId][this.messages[this.selectedDeviceId].length-1]["position.longitude"];if(i){const e=t[t.length-1];e&&this.centerOnDevice(this.selectedDeviceId,this.map.getZoom())}}t.length?(this.markers[e].setLatLng(t[t.length-1]).update(),this.markers[e].accuracy.setRadius(this.getAccuracyParams(this.messages[e][this.messages[e].length-1]).accuracy),this.markers[e].accuracy.setLatLng(t[t.length-1]),this.markers[e].setOpacity(1),this.tracks[e].setLatLngs(t)):(this.removeFlags(e),this.tracks[e].tail&&this.tracks[e].tail instanceof x["Polyline"]&&this.tracks[e].tail.remove(),this.tracks[e].overview&&this.tracks[e].overview instanceof x["Polyline"]&&this.tracks[e].overview.remove(),this.markers[e].accuracy&&this.map.removeLayer(this.markers[e].accuracy),this.map.removeLayer(this.tracks[e]),this.map.removeLayer(this.markers[e]),this.tracks[e]={},this.markers[e]={color:this.markers[e].color||void 0,id:e})},updateStateByMessages(e){if("play"===this.player.status||"pause"===this.player.status)return!1;const t=Object.keys(e),s=Object.keys(this.markers);if(!t.length)return Object.keys(this.markers).forEach((e=>{this.removeMarker(e)})),!1;if(t.length!t.includes(e)))[0];return this.removeMarker(e),!1}t.forEach((e=>this.updateOrInitDevice(e)))},updateStateByTelemetry(e){if(!Object.keys(e.telemetry).length)return!1;const t=e.deviceId;if(!this.devicesState[t].telemetryAccess)return!1;if(!this.messages||!this.messages[t]||!this.messages[t][0])return!1;if(this.messages[t].lenth>1||!this.messages[t][0]["x-flespi-inited-by-telemetry"])return!1;const s=Number.parseFloat(e.telemetry["position.latitude"].value),i=Number.parseFloat(e.telemetry["position.latitude"].ts),a=Number.parseFloat(e.telemetry["position.longitude"].value),n=Number.parseFloat(e.telemetry["position.longitude"].ts);if(Math.round(1e3*i)!==Math.round(1e3*n))return console.error("Wrong telemetry"),!1;if(!this.params.needShowInvalidPositionMessages&&e.telemetry["position.valid"]&&!1===e.telemetry["position.valid"].value&&Math.abs(Number.parseFloat(e.telemetry["position.valid"].ts-i)<.1))return!1;this.messages[t][0]["position.latitude"]=s,this.messages[t][0]["position.longitude"]=a,this.messages[t][0]["timestamp"]=i;const r=["direction","speed","altitude","valid","satellites","hdop","pdop"],o=["number","number","number","boolean","number","number","number"];for(let l=0;l50&&this.devicesState[t].telemetryTail.shift():this.devicesState[t].telemetryTail=[],this.devicesState[t].telemetryTail.push([s,a]),this.markers[t]instanceof x["Marker"]){const n=e.telemetry["position.direction"]&&Math.abs(Number.parseFloat(e.telemetry["position.direction"].ts))-i<.1?Number.parseInt(e.telemetry["position.direction"].value):0;this.updateMarkerDirection(t,n),this.markers[t].setLatLng([s,a]).update()}this.tracks[t]instanceof x["Polyline"]&&this.tracks[t].setLatLngs(this.devicesState[t].telemetryTail),this.isSelectedDeviceFollowed&&this.centerOnDevice(this.selectedDeviceId,this.map.getZoom())}},watch:{messages:{deep:!0,handler(e){this.debouncedUpdateStateByMessages(e)}},telemetry:{deep:!0,handler(e){if(this.devicesState[e.deviceId]&&this.devicesState[e.deviceId].messagesAccess)return!1;this.debouncedUpdateStateByTelemetry(e)}},activeDevices(e){const t=e.map((e=>e.id)),s=Object.keys(this.messages).map((e=>parseInt(e))),i=s.length>t.length?"remove":"add";switch(t.forEach((e=>{this.$store.state.messages[e]||(this.registerModule(e),this.$store.commit(`messages/${e}/setSortBy`,"timestamp"),this.$store.commit(`messages/${e}/setLimit`,0))})),this.activeDevicesID=t,i){case"remove":{const e=s.filter((e=>!t.includes(e)));1===e.length&&e[0]?this.$store.commit(`messages/${e[0]}/clear`):e.length===s.length&&e.forEach((e=>{this.$store.commit(`messages/${e}/clear`)})),e.forEach((e=>this.devicesState[e].initStatus=null));break}case"add":{const e=t.filter((e=>!s.includes(e)));e&&e.forEach((e=>{this.devicesState[e].initStatus=!1,this.initDevice(e)}));break}}this.map&&x["DomUtil"].hasClass(this.map._container,"crosshair-cursor-enabled")&&x["DomUtil"].removeClass(this.map._container,"crosshair-cursor-enabled")},selectedDeviceId(e){e&&this.devicesState[e]&&!0===this.devicesState[e].initStatus&&this.flyToDevice(e)},isSelectedDeviceFollowed(e){!0===e&&this.devicesState[this.selectedDeviceId]&&!0===this.devicesState[this.selectedDeviceId].initStatus&&this.centerOnDevice(this.selectedDeviceId,this.map.getZoom())},devicesColors:{deep:!0,handler(e,t){this.activeDevicesID.forEach((s=>{e[s]!==t[s]&&this.updateDeviceColorOnMap(s,e[s])}))}},"params.needShowNamesOnMap":function(e){Object.keys(this.markers).forEach((e=>{const t=this.activeDevices.filter((t=>t.id===parseInt(e)))[0],s=this.messages[e]&&this.messages[e].length?[this.messages[e][this.messages[e].length-1]["position.latitude"],this.messages[e][this.messages[e].length-1]["position.longitude"]]:[],i=t.name||`#${e}`;this.markers[e]instanceof x["Marker"]&&(this.markers[e].remove(),this.map.removeLayer(this.markers[e].accuracy),this.initMarker(e,i,s))}))},"params.needShowInvalidPositionMessages":function(){this.activeDevicesID.forEach((async e=>{await this.getDeviceData(e),e===this.selectedDeviceId&&this.centerOnDevice(e)}))},date(e,t){t&&(this.player.status="stop",this.player.currentMsgIndex=null,this.activeDevicesID.forEach((async e=>{await this.getDeviceData(e)})))},selected(e){if(!this.isFlying&&this.tracks[e]&&this.tracks[e]instanceof x["Polyline"]){const t=this.tracks[e].getBounds();this.map.fitBounds(t)}this.devicesState[e]&&this.devicesState[e].telemetryTail&&this.devicesState[e].telemetryTail.length>0&&(this.devicesState[e].telemetryTail=[])}},created(){this.debouncedUpdateStateByMessages=Object(ze["a"])(this.updateStateByMessages,100),this.debouncedUpdateStateByTelemetry=Object(ze["a"])(this.updateStateByTelemetry,5),this.activeDevicesID=this.activeDevices.map((e=>e.id)),this.activeDevicesID.forEach((e=>{this.registerModule(e),this.$store.commit(`messages/${e}/setSortBy`,"timestamp"),this.devicesState[e].initStatus=!1,this.initDevice(e)})),n["default"].connector.socket.on("offline",(()=>{this.$store.commit("setSocketOffline",!0)})),n["default"].connector.socket.on("connect",(()=>{this.$store.commit("setSocketOffline",!1)}))},destroyed(){n["default"].connector.socket.off("offline"),n["default"].connector.socket.off("connect"),this.activeDevicesID.forEach((async e=>{this.$store.unregisterModule(["messages",e])}))},mounted(){this.initMap()},components:{Queue:xe,ColorModal:Pe}},Be=Ve,Ee=(s("fdaf"),Object(p["a"])(Be,M,C,!1,null,null,null)),Qe=Ee.exports;w()(Ee,"components",{QResizeObserver:be["a"]});var Ae=function(){var e=this,t=e._self._c;return t("div",{staticStyle:{position:"relative",height:"100vh",overflow:"hidden"}},[t("q-list",{staticClass:"bg-grey-9 text-white",attrs:{dark:""}},[t("q-item",{staticStyle:{"line-height":"58px!important"},style:{height:`${e.listHeaderHeight}px`}},[t("q-item-section",{attrs:{avatar:""}},[t("q-btn",{staticStyle:{"margin-right":"15px"},attrs:{flat:"",round:"",small:"",icon:"mdi-chevron-left"},nativeOn:{click:function(t){return e.$emit("click-hide")}}})],1),t("q-item-section",[t("q-item-label",{staticClass:"text-bold text-white q-pa-none",staticStyle:{"font-size":"1.3rem"},attrs:{header:""}},[e._v("Devices")])],1),t("q-item-section",{attrs:{side:""}},[e.$q.platform.is.desktop?t("q-btn",{staticClass:"text-grey",class:{unpinned:!e.devicesListPinned},attrs:{flat:"",round:"",small:"",icon:e.devicesListPinned?"mdi-pin":"mdi-pin-outline"},on:{click:function(t){return e.$emit("devices-list-pinned",!e.devicesListPinned)}}},[e.devicesListPinned?t("q-tooltip",[e._v("Unpin devices list")]):t("q-tooltip",[e._v("Pin devices list")])],1):e._e()],1)],1),t("div",{ref:"activeDevicesList",staticStyle:{overflow:"auto"},style:{"max-height":`${e.activeDevicesMaxHeight}px`}},[t("q-resize-observer",{on:{resize:e.onResizeActiveDevicesList}}),e._l(e.classifiedDevices.active,(function(s){return t("device",{key:s.id,staticClass:"with-separator",attrs:{isActive:!0,device:s,deviceColor:e.devicesColors[s.id+""],activeDevicesID:e.activeDevicesID,isSelected:e.selectedDeviceId===s.id,isFollowed:e.selectedDeviceId===s.id&&!0===e.isFollowed},on:{"update-color":e.updateColorHandler,"select-device":function(t){return e.$emit("select-device",s.id)},"follow-selected-device":function(t){return e.$emit("follow-selected-device",!e.isFollowed)},"remove-device-from-active-list":e.deviceRemovedHandler,"device-in-devices-list-ckick":function(t){return e.$emit("device-in-devices-list-ckick")}}})}))],2),e.classifiedDevices.inactive.length?t("div",{staticStyle:{overflow:"auto"}},[t("q-item",{staticStyle:{"padding-top":"20px"},style:{height:`${e.devicesFilterHeight}px!important`}},[t("q-item-section",[t("div",{staticClass:"q-px-none"},[t("q-input",{attrs:{dense:"",dark:"",color:"white",outlined:"",label:"Filter","hide-bottom-space":""},model:{value:e.filter,callback:function(t){e.filter=t},expression:"filter"}})],1)])],1),t("VirtualList",{ref:"vlist",style:{height:`${e.inactiveDevicesHeight}px`},attrs:{size:e.deviceItemHeight,remain:e.itemsCount}},e._l(e.filteredInactiveDevices,(function(s){return t("device",{key:s.id,staticClass:"with-separator",attrs:{isActive:!1,device:s,activeDevicesID:e.activeDevicesID,isSelected:e.selectedDeviceId===s.id,isFollowed:e.selectedDeviceId===s.id&&!0===e.isFollowed},on:{"select-device":function(t){return e.$emit("select-device",s.id)},"follow-selected-device":function(t){return e.$emit("follow-selected-device",!e.isFollowed)},"device-in-devices-list-ckick":function(t){return e.$emit("device-in-devices-list-ckick")}}})})),1)],1):t("q-item",{style:{height:`${e.inactiveDevicesHeight+e.devicesFilterHeight}px`}},[t("q-item-label",{staticClass:"ellipsis text-bold",staticStyle:{width:"100%","text-align":"center"},attrs:{header:""}},[e._v("No inactive devices left")])],1)],1)],1)},Ue=[],Ye=function(){var e=this,t=e._self._c;return t("q-item",{directives:[{name:"touch-swipe",rawName:"v-touch-swipe.noMouse",value:e.removeDeviceHandler,expression:"removeDeviceHandler",modifiers:{noMouse:!0}}],staticClass:"device-item__hover",class:[e.isActive&&e.isSelected?"device-item__selected":"",e.device["x-flespi-no-access"]?"no-access-device":""],staticStyle:{"min-height":"71px"},attrs:{highlight:e.$q.platform.is.desktop,clickable:""},on:{click:e.deviceClickHandler}},[e.device["x-flespi-no-access"]?t("q-tooltip",[e._v("Device has no access to messages and telemetry")]):e._e(),t("div",{staticClass:"text-center absolute-top-left bg-grey-3 text-bold text-grey-9",staticStyle:{"font-size":"10px","min-width":"55px","padding-top":"1px","z-index":"1","border-radius":"0 0 3px 0","line-height":"10px"}},[e._v("\n #"+e._s(e.device.id)+"\n ")]),t("q-item-section",{staticStyle:{position:"relative"},attrs:{side:""}},[t("q-icon",{attrs:{size:"1.7rem",name:"mdi-developer-board"}}),e.isActive?t("div",{staticClass:"color-view q-mr-xs",staticStyle:{position:"absolute",top:"29px",right:"8px"},style:{backgroundColor:e.deviceColor?e.deviceColor:"#909090"},on:{click:function(t){return t.stopPropagation(),e.changeColorHandler(e.device.id)}}},[t("q-tooltip",[e._v("Change color")])],1):e._e()],1),t("q-item-section",[t("q-item-label",{staticClass:"ellipsis-2-lines q-pa-none",class:[e.isActive?"text-white":""],attrs:{header:""}},[e._v(e._s(e.device.name||""))])],1),e.isActive?t("q-item-section",{staticClass:"text-center",attrs:{side:""}},[t("q-item-label",[t("q-icon",{class:[e.isSelected?"icon__send-followed":"text-grey-5"],attrs:{size:"1.2rem",name:e.isFollowed?"mdi-crosshairs-gps":"mdi-crosshairs"},nativeOn:{click:function(t){return t.stopPropagation(),e.showOnMapButtonHandler.apply(null,arguments)}}},[e.isFollowed?t("q-tooltip",{model:{value:e.displayTooltip,callback:function(t){e.displayTooltip=t},expression:"displayTooltip"}},[e._v("Stop following device")]):t("q-tooltip",{model:{value:e.displayTooltip,callback:function(t){e.displayTooltip=t},expression:"displayTooltip"}},[e._v("Follow device on map")])],1)],1)],1):e._e(),e.isActive&&e.$q.platform.is.desktop?t("q-item-section",{staticClass:"hiding-cross"},[t("q-item-label",[t("q-icon",{attrs:{name:"mdi-close",size:"1.1rem"},nativeOn:{click:function(t){return t.stopPropagation(),e.removeDeviceHandler.apply(null,arguments)}}},[t("q-tooltip",[e._v("Remove from active devices list")])],1)],1)],1):e._e(),t("color-modal",{ref:"colorModal",model:{value:e.color,callback:function(t){e.color=t},expression:"color"}})],1)},We=[],Ze={props:["device","deviceColor","activeDevicesID","isActive","isSelected","isFollowed"],data(){return{displayTooltip:!1,currentColorModel:"#fff",currentColorId:0}},computed:{color:{get(){return this.currentColorModel},set(e){this.$emit("update-color",{id:this.currentColorId,color:e}),this.currentColorModel=e}}},methods:{deviceClickHandler(){this.isActive?this.isSelected||setTimeout((()=>{this.$emit("select-device",this.device.id)}),500):this.$store.commit("setActiveDevice",this.device.id),this.$emit("device-in-devices-list-ckick",this.isActive)},removeDeviceHandler(e){if(this.isActive){if(e&&e.direction&&"right"!==e.direction)return!1;this.$store.commit("unsetActiveDevice",this.device.id),this.$emit("remove-device-from-active-list")}},changeColorHandler(e){this.currentColorId=e,this.currentColorModel=this.deviceColor,this.$refs.colorModal.show()},showOnMapButtonHandler(){this.isSelected?setTimeout((()=>{this.$emit("follow-selected-device",!this.isFollowed)}),500):setTimeout((()=>{this.$emit("select-device",this.device.id)}),500),setTimeout((()=>{this.displayTooltip=!1}),500)}},components:{ColorModal:Pe}},Ge=Ze,Je=(s("5b5b"),s("66e5")),Ke=s("4074"),Xe=s("0170"),et=s("12c5"),tt=Object(p["a"])(Ge,Ye,We,!1,null,null,null),st=tt.exports;w()(tt,"components",{QItem:Je["a"],QTooltip:u["a"],QItemSection:Ke["a"],QIcon:B["a"],QItemLabel:Xe["a"]}),w()(tt,"directives",{TouchSwipe:et["a"]});var it=s("89c1"),at=s.n(it),nt={name:"DeviceList",data(){return{unsubscribeDevices:()=>{},itemsCount:0,viewportHeight:0,activeDevicesHeight:0,activeDevicesMaxHeight:0,inactiveDevicesHeight:0,listHeaderHeight:60,devicesFilterHeight:70,deviceItemHeight:71,filter:""}},props:["devices","devicesColors","activeDevicesID","selectedDeviceId","isFollowed","devicesListPinned"],components:{Device:st,VirtualList:at.a},computed:{classifiedDevices(){const e={active:[],inactive:[]};return this.devices.forEach((t=>{this.activeDevicesID.includes(t.id)?e.active.push(t):e.inactive.push(t)})),e},filteredInactiveDevices(){const e=this.filter.toLowerCase(),t=this.filter?this.classifiedDevices.inactive.filter((t=>t&&"undefined"!==typeof t.name&&null!==t.name&&t.name.toLowerCase().indexOf(e)>=0||t&&"undefined"!==typeof t.id&&null!==t.id&&(t.id+"").indexOf(e)>=0||t&&t.configuration&&"undefined"!==typeof t.configuration.ident&&null!==t.configuration.ident&&t.configuration.ident.toLowerCase().indexOf(e)>=0)):this.classifiedDevices.inactive;return t.sort(((e,t)=>{if(!e.name)return-1;if(!t.name)return 1;const s=e.name.toLowerCase(),i=t.name.toLowerCase();return s10*this.deviceItemHeight?10*this.deviceItemHeight:t,this.activeDevicesHeight=this.$refs.activeDevicesList?this.$refs.activeDevicesList.clientHeight:0,this.inactiveDevicesHeight=this.viewportHeight-this.listHeaderHeight-this.devicesFilterHeight-this.activeDevicesHeight,this.itemsCount=Math.ceil(this.inactiveDevicesHeight/this.deviceItemHeight)},onResizeActiveDevicesList(e){this.activeDevicesHeight=e.height,this.inactiveDevicesHeight=this.viewportHeight-this.listHeaderHeight-this.devicesFilterHeight-this.activeDevicesHeight,this.itemsCount=Math.ceil(this.inactiveDevicesHeight/this.deviceItemHeight)},deviceRemovedHandler(){this.inactiveDevicesHeight=this.inactiveDevicesHeight+this.deviceItemHeight,this.itemsCount=Math.ceil(this.inactiveDevicesHeight/this.deviceItemHeight)},updateColorHandler(e){this.$emit("update-color",e.id,e.color)}},watch:{activeDevicesID(){this.$refs.vlist&&this.$refs.vlist.forceRender()},"$q.screen.height":{immediate:!0,handler(e){this.onResizeScreen(e)}}}},rt=nt,ot=(s("84c3"),s("1c1c")),lt=s("27f9"),ct=Object(p["a"])(rt,Ae,Ue,!1,null,null,null),dt=ct.exports;w()(ct,"components",{QList:ot["a"],QItem:Je["a"],QItemSection:Ke["a"],QBtn:g["a"],QItemLabel:Xe["a"],QTooltip:u["a"],QResizeObserver:be["a"],QInput:lt["a"]});var ht=s("9224"),mt=s("b06b"),pt={data(){return{selectedDevice:{id:null,follow:!1},devicesColors:{},deviceIdForTelemetry:null,needShowList:!0,needShowTelemetry:!0,needHideNamesInMenu:!1,needHidePlayerInMenu:!1,needHideMessagesInMenu:!1,needHideInvalidInMenu:!1,params:{needShowMessages:!1,needShowInvalidPositionMessages:!1,needShowNamesOnMap:!0,needShowPlayer:!0},devicesListSettings:{opened:!1,pinned:!1},telemetrySettings:{inverted:!0,opened:!1},telemetrySearch:"",telemetryConfig:{propHistoryFlag:!0},version:ht.version,dateTheme:{color:"white",bgColor:"grey-9",modeSwitch:!1},isInit:n["default"].connector.socket.connected(),unsubscribeDevices:()=>{}}},computed:{...Object(r["d"])({token:e=>e.token,devices:e=>e.devices,isLoading:e=>e.isLoading,activeDevicesID(e){return e.activeDevicesID},hasDevicesInit:e=>e.hasDevicesInit,activeDevices:e=>e.devices.filter((t=>e.activeDevicesID.includes(t.id))),lastActiveDevicesUpdate(e){return this.activeDevicesID.reduce(((t,s)=>{const i=e.messages[s].messages.filter((e=>!!e["position.latitude"]&&!!e["position.longitude"]));return i.length?t[s]=Math.floor(1e3*i[i.length-1].timestamp):t[s]=0,t}),{})},errors:e=>e.errors,newNotificationCounter:e=>e.newNotificationCounter,deviceForTelemetry(e){return this.deviceIdForTelemetry?e.devices.filter((e=>e.id===this.deviceIdForTelemetry))[0]:{}}}),computedDevicesColors(){return Object.assign({},this.devicesColors)},date:{get(){return this.$store.state.date},set(e){this.$store.commit("setDate",e)}}},components:{DeviceList:dt,MapComponent:Qe,QTelemetry:D["a"],DateRangeModal:$},methods:{openURL:mt["a"],...Object(r["c"])(["clearToken","clearCurrentRegion","setDevicesInit","unsetDevicesInit","setActiveDevice","clearNotificationCounter","clearErrors"]),...Object(r["b"])(["getLastUpdatePosition","poolDevices"]),exitHandler(e){n["default"].connector.socket.off("error"),this.unsetDevicesInit(),this.clearToken(),this.clearCurrentRegion(),this.$router.push("/login")},layoutCkickHandler(e){this.devicesListSettings.opened&&(e.target.closest("#left-drawer")||this.devicesListSettings.pinned||this.devicesListOpenedHandler(!1))},devicesListPinnedHandler(e){this.devicesListSettings.pinned=e,Object(Re["b"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"devicesListSettings",value:this.devicesListSettings})},updateColorHandler(e,t){this.$set(this.devicesColors,e,t),Object(Re["b"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"colors",value:this.devicesColors})},devicesListOpenedHandler(e){this.devicesListSettings.opened=e,Object(Re["b"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"devicesListSettings",value:this.devicesListSettings})},updateSelectedDevice(e,t){if(this.selectedDevice.id=e,void 0!==t)return this.selectedDevice.follow=t,Object(Re["b"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"selected",value:this.selectedDevice}),!1;const s=Object(Re["a"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"selected"});if(!s||!s.id||s.id!==e||void 0==s.follow)return this.selectedDevice.follow=!1,Object(Re["b"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"selected",value:this.selectedDevice}),!1;this.selectedDevice.follow=s.follow},selectDeviceInListHandler(e){e&&(this.updateTelemetryDeviceId(e),this.updateSelectedDevice(e,!0)),!this.$q.platform.is.mobile&&this.devicesListSettings.pinned||this.devicesListOpenedHandler(!1)},followSelectedDeviceHandler(e){this.updateSelectedDevice(this.selectedDevice.id,e)},deviceInListClickHandler(){!this.$q.platform.is.mobile&&this.devicesListSettings.pinned||this.devicesListOpenedHandler(!1)},paramsChangeHandler(e){Object(Re["b"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"params",value:this.params})},telemetryButtonClickHandler(){this.$set(this.telemetrySettings,"opened",!this.telemetrySettings.opened),Object(Re["b"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"telemetrySettings",value:this.telemetrySettings})},telemetryInvertedHandler(){this.$set(this.telemetrySettings,"inverted",!this.telemetrySettings.inverted),Object(Re["b"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"telemetrySettings",value:this.telemetrySettings})},updateTelemetryDeviceId(e){const t=this.devices.filter((t=>t.id===e));t.length?(this.deviceIdForTelemetry=e,this.updateSelectedDevice(e),this.telemetrySettings.opened&&this.deviceIdForTelemetry&&this.activeDevicesID.includes(this.deviceIdForTelemetry)&&setTimeout((()=>{if(e===this.selectedDevice.id&&this.$q.platform.is.mobile)return!1}),0)):this.deviceIdForTelemetry=null},queueCreatedHandler(){const e=Object(Re["a"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"selected"});e&&e.id&&(this.selectedDevice.id=e.id,this.selectedDevice.follow=!!e.follow&&e.follow)},formatDate(e){return c["a"].formatDate(e,"DD/MM/YYYY")},initUserSelectionsFromLS(){const e=Object(Re["a"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"params"});e&&this.$set(this,"params",Object.assign(this.params,e));const t=Object(Re["a"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"telemetrySettings"});t&&this.$set(this,"telemetrySettings",Object.assign(this.telemetrySettings,t));const s=Object(Re["a"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"devicesListSettings"});s&&this.$set(this,"devicesListSettings",Object.assign(this.devicesListSettings,s));let i=Object(Re["a"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"colors"});i||(i={},Object(Re["b"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"colors",value:i}));const a="0123456789ABCDEF";this.activeDevicesID.forEach((e=>{if(!i[e]){let t=`#${a[Math.floor(5*Math.random())]}`;for(let e=0;e<5;e++)t+=a[Math.floor(15*Math.random())];i[e]=t,Object(Re["b"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"colors",value:i})}})),Object.keys(i).forEach((e=>{this.$set(this.devicesColors,e,i[e])}))},connectProcess(){this.isInit||(n["default"].connector.socket.on("connect",(()=>{this.isInit=!0,this.$q.loading.hide()})),this.$q.loading.show())},initDate(){this.getLastUpdatePosition().then((e=>{this.date=e}))},routeProcess(){const e=this.$route.query.from,t=this.$route.query.to,s=this.$route.query.hidelist||Object(Re["a"])({store:this.$q.sessionStorage,storeName:this.$store.state.storeName,name:"hidelist"}),i=this.$route.query.names||Object(Re["a"])({store:this.$q.sessionStorage,storeName:this.$store.state.storeName,name:"names"}),a=this.$route.query.player||Object(Re["a"])({store:this.$q.sessionStorage,storeName:this.$store.state.storeName,name:"player"}),n=this.$route.query.messages||Object(Re["a"])({store:this.$q.sessionStorage,storeName:this.$store.state.storeName,name:"messages"}),r=this.$route.query.invalid||Object(Re["a"])({store:this.$q.sessionStorage,storeName:this.$store.state.storeName,name:"invalid"}),o=this.$route.query.telemetry||Object(Re["a"])({store:this.$q.sessionStorage,storeName:this.$store.state.storeName,name:"telemetry"}),l=this.$route.params.devices;if(e&&t?this.date=[1e3*e,1e3*t]:this.date[0]||this.date[1]||this.initDate(),s&&(Object(Re["b"])({store:this.$q.sessionStorage,storeName:this.$store.state.storeName,name:"hidelist",value:s}),this.needShowList="true"!==s),o&&(Object(Re["b"])({store:this.$q.sessionStorage,storeName:this.$store.state.storeName,name:"telemetry",value:o}),this.needShowTelemetry="false"!==o),i&&(this.needHideNamesInMenu=!0,Object(Re["b"])({store:this.$q.sessionStorage,storeName:this.$store.state.storeName,name:"names",value:i}),"true"===i?this.$set(this.params,"needShowNamesOnMap",!0):"false"===i&&this.$set(this.params,"needShowNamesOnMap",!1),this.paramsChangeHandler()),a&&(this.needHidePlayerInMenu=!0,Object(Re["b"])({store:this.$q.sessionStorage,storeName:this.$store.state.storeName,name:"player",value:a}),"true"===a?this.$set(this.params,"needShowPlayer",!0):"false"===a&&this.$set(this.params,"needShowPlayer",!1),this.paramsChangeHandler()),n&&(this.needHideMessagesInMenu=!0,Object(Re["b"])({store:this.$q.sessionStorage,storeName:this.$store.state.storeName,name:"messages",value:n}),"true"===n?this.$set(this.params,"needShowMessages",!0):"false"===n&&this.$set(this.params,"needShowMessages",!1),this.paramsChangeHandler()),r&&(this.needHideInvalidInMenu=!0,Object(Re["b"])({store:this.$q.sessionStorage,storeName:this.$store.state.storeName,name:"invalid",value:r}),"true"===r?this.$set(this.params,"needShowInvalidPositionMessages",!0):"false"===r&&this.$set(this.params,"needShowInvalidPositionMessages",!1),this.paramsChangeHandler()),l){const e=l.split(",").map((e=>+e));e.forEach((e=>{this.setActiveDevice(e)}))}},loginProcess(){this.$route.params.token?this.$router.push(`/login/${this.$route.params.token}`):this.$router.push("/login")}},watch:{token(e){e||this.$router.push("/login")},hasDevicesInit(e){e?this.$q.loading.hide():this.$q.loading.show()},activeDevicesID(e){if(e.length){if(!e.includes(this.selectedDevice.id)){const t=e.toSorted(((e,t)=>e-t));let s=t.length-1;const i=t.findIndex((e=>e>this.selectedDevice.id));i>0&&(s=i),this.updateTelemetryDeviceId(t[s])}}else this.deviceIdForTelemetry=null,this.updateSelectedDevice(null,!1)},devices(e,t){e.length||(this.telemetrySettings.opened=!1)}},created(){if(this.$store.state.telemetry||this.$store.registerModule("telemetry",Object(D["b"])(this.$store,n["default"])),this.clearNotificationCounter(),this.clearErrors(),this.routeProcess(),!this.token)return this.loginProcess(),!1;this.connectProcess(),this.poolDevices().then((e=>{this.unsubscribeDevices=e})),this.activeDevicesID.length&&this.$router.push(`/devices/${this.activeDevicesID.join(",")}`),this.initUserSelectionsFromLS()},destroyed(){this.unsubscribeDevices&&this.unsubscribeDevices(),n["default"].connector.socket.off("connect")}},gt=pt,ut=(s("b240"),s("4d5a")),vt=s("9404"),ft=s("09e3"),yt=s("9989"),kt=s("6ac5"),bt=s("65c6"),_t=s("b047"),wt=s("9564"),St=Object(p["a"])(gt,i,a,!1,null,null,null);t["default"]=St.exports;w()(St,"components",{QLayout:ut["a"],QDrawer:vt["a"],QItem:Je["a"],QItemSection:Ke["a"],QBtn:g["a"],QItemLabel:Xe["a"],QTooltip:u["a"],QIcon:B["a"],QInput:lt["a"],QPageContainer:ft["a"],QPage:yt["a"],QToolbarTitle:kt["a"],QToolbar:bt["a"],QChip:_t["a"],QMenu:he["a"],QList:ot["a"],QToggle:wt["a"],QDialog:v["a"]})},f273:function(e,t,s){},fdaf:function(e,t,s){"use strict";s("40ca")}}]); \ No newline at end of file diff --git a/js/1.d2f147b9.js b/js/1.d2f147b9.js new file mode 100644 index 00000000..2100f67f --- /dev/null +++ b/js/1.d2f147b9.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[1],{"1f9f":function(e,t,s){},"238f":function(e,t,s){"use strict";s("7ef8")},"2b48":function(e,t,s){"use strict";s("f273")},4038:function(e,t,s){},4678:function(e,t,s){var i={"./af":"2bfb","./af.js":"2bfb","./ar":"8e73","./ar-dz":"a356","./ar-dz.js":"a356","./ar-kw":"423e","./ar-kw.js":"423e","./ar-ly":"1cfd","./ar-ly.js":"1cfd","./ar-ma":"0a84","./ar-ma.js":"0a84","./ar-ps":"4c98","./ar-ps.js":"4c98","./ar-sa":"8230","./ar-sa.js":"8230","./ar-tn":"6d83","./ar-tn.js":"6d83","./ar.js":"8e73","./az":"485c","./az.js":"485c","./be":"1fc1","./be.js":"1fc1","./bg":"84aa","./bg.js":"84aa","./bm":"a7fa","./bm.js":"a7fa","./bn":"9043","./bn-bd":"9686","./bn-bd.js":"9686","./bn.js":"9043","./bo":"d26a","./bo.js":"d26a","./br":"6887","./br.js":"6887","./bs":"2554","./bs.js":"2554","./ca":"d716","./ca.js":"d716","./cs":"3c0d","./cs.js":"3c0d","./cv":"03ec","./cv.js":"03ec","./cy":"9797","./cy.js":"9797","./da":"0f14","./da.js":"0f14","./de":"b469","./de-at":"b3eb","./de-at.js":"b3eb","./de-ch":"bb71","./de-ch.js":"bb71","./de.js":"b469","./dv":"598a","./dv.js":"598a","./el":"8d47","./el.js":"8d47","./en-au":"0e6b","./en-au.js":"0e6b","./en-ca":"3886","./en-ca.js":"3886","./en-gb":"39a6","./en-gb.js":"39a6","./en-ie":"e1d3","./en-ie.js":"e1d3","./en-il":"7333","./en-il.js":"7333","./en-in":"ec2e","./en-in.js":"ec2e","./en-nz":"6f50","./en-nz.js":"6f50","./en-sg":"b7e9","./en-sg.js":"b7e9","./eo":"65db","./eo.js":"65db","./es":"898b","./es-do":"0a3c","./es-do.js":"0a3c","./es-mx":"b5b7","./es-mx.js":"b5b7","./es-us":"55c9","./es-us.js":"55c9","./es.js":"898b","./et":"ec18","./et.js":"ec18","./eu":"0ff2","./eu.js":"0ff2","./fa":"8df48","./fa.js":"8df48","./fi":"81e9","./fi.js":"81e9","./fil":"d69a","./fil.js":"d69a","./fo":"0721","./fo.js":"0721","./fr":"9f26","./fr-ca":"d9f8","./fr-ca.js":"d9f8","./fr-ch":"0e49","./fr-ch.js":"0e49","./fr.js":"9f26","./fy":"7118","./fy.js":"7118","./ga":"5120","./ga.js":"5120","./gd":"f6b46","./gd.js":"f6b46","./gl":"8840","./gl.js":"8840","./gom-deva":"aaf2","./gom-deva.js":"aaf2","./gom-latn":"0caa","./gom-latn.js":"0caa","./gu":"e0c5","./gu.js":"e0c5","./he":"c7aa","./he.js":"c7aa","./hi":"dc4d","./hi.js":"dc4d","./hr":"4ba9","./hr.js":"4ba9","./hu":"5b14","./hu.js":"5b14","./hy-am":"d6b6","./hy-am.js":"d6b6","./id":"5038","./id.js":"5038","./is":"0558","./is.js":"0558","./it":"6e98","./it-ch":"6f12","./it-ch.js":"6f12","./it.js":"6e98","./ja":"079e","./ja.js":"079e","./jv":"b540","./jv.js":"b540","./ka":"201b","./ka.js":"201b","./kk":"6d79","./kk.js":"6d79","./km":"e81d","./km.js":"e81d","./kn":"3e92","./kn.js":"3e92","./ko":"22f8","./ko.js":"22f8","./ku":"2421","./ku-kmr":"7558","./ku-kmr.js":"7558","./ku.js":"2421","./ky":"9609","./ky.js":"9609","./lb":"440c","./lb.js":"440c","./lo":"b29d","./lo.js":"b29d","./lt":"26f9","./lt.js":"26f9","./lv":"b97c","./lv.js":"b97c","./me":"293c","./me.js":"293c","./mi":"688b","./mi.js":"688b","./mk":"6909","./mk.js":"6909","./ml":"02fb","./ml.js":"02fb","./mn":"958b","./mn.js":"958b","./mr":"39bd","./mr.js":"39bd","./ms":"ebe4","./ms-my":"6403","./ms-my.js":"6403","./ms.js":"ebe4","./mt":"1b45","./mt.js":"1b45","./my":"8689","./my.js":"8689","./nb":"6ce3","./nb.js":"6ce3","./ne":"3a39","./ne.js":"3a39","./nl":"facd","./nl-be":"db29","./nl-be.js":"db29","./nl.js":"facd","./nn":"b84c","./nn.js":"b84c","./oc-lnc":"167b","./oc-lnc.js":"167b","./pa-in":"f3ff","./pa-in.js":"f3ff","./pl":"8d57","./pl.js":"8d57","./pt":"f260","./pt-br":"d2d4","./pt-br.js":"d2d4","./pt.js":"f260","./ro":"972c","./ro.js":"972c","./ru":"957c","./ru.js":"957c","./sd":"6784","./sd.js":"6784","./se":"ffff","./se.js":"ffff","./si":"eda5","./si.js":"eda5","./sk":"7be6","./sk.js":"7be6","./sl":"8155","./sl.js":"8155","./sq":"c8f3","./sq.js":"c8f3","./sr":"cf1e","./sr-cyrl":"13e9","./sr-cyrl.js":"13e9","./sr.js":"cf1e","./ss":"52bd","./ss.js":"52bd","./sv":"5fbd","./sv.js":"5fbd","./sw":"74dc","./sw.js":"74dc","./ta":"3de5","./ta.js":"3de5","./te":"5cbb","./te.js":"5cbb","./tet":"576c","./tet.js":"576c","./tg":"3b1b","./tg.js":"3b1b","./th":"10e8","./th.js":"10e8","./tk":"5aff","./tk.js":"5aff","./tl-ph":"0f38","./tl-ph.js":"0f38","./tlh":"cf75","./tlh.js":"cf75","./tr":"0e81","./tr.js":"0e81","./tzl":"cf51","./tzl.js":"cf51","./tzm":"c109","./tzm-latn":"b53d","./tzm-latn.js":"b53d","./tzm.js":"c109","./ug-cn":"6117","./ug-cn.js":"6117","./uk":"ada2","./uk.js":"ada2","./ur":"5294","./ur.js":"5294","./uz":"2e8c","./uz-latn":"010e","./uz-latn.js":"010e","./uz.js":"2e8c","./vi":"2921","./vi.js":"2921","./x-pseudo":"fd7e","./x-pseudo.js":"fd7e","./yo":"7f33","./yo.js":"7f33","./zh-cn":"5c3a","./zh-cn.js":"5c3a","./zh-hk":"49ab","./zh-hk.js":"49ab","./zh-mo":"3a6c","./zh-mo.js":"3a6c","./zh-tw":"90ea","./zh-tw.js":"90ea"};function a(e){var t=n(e);return s(t)}function n(e){if(!s.o(i,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return i[e]}a.keys=function(){return Object.keys(i)},a.resolve=n,e.exports=a,a.id="4678"},"5b5b":function(e,t,s){"use strict";s("4038")},"5b6f":function(e,t,s){},"6f40":function(e,t,s){"use strict";s("c73e")},"7ef8":function(e,t,s){},"81e1":function(e,t,s){"use strict";s("1f9f")},"82ba":function(e,t,s){"use strict";s("ed24")},"84c3":function(e,t,s){"use strict";s("ef69")},"9f7d":function(e,t,s){"use strict";s("e61d")},aa78:function(e,t,s){},c73e:function(e,t,s){},d1d6:function(e,t,s){"use strict";s("aa78")},e61d:function(e,t,s){},e796:function(e,t,s){"use strict";s("5b6f")},ed24:function(e,t,s){},ef69:function(e,t,s){},f241:function(e,t,s){"use strict";s.r(t);var i=function(){var e=this,t=e._self._c;return t("q-layout",{ref:"layout",attrs:{view:"hHh LpR lFf"},on:{click:function(t){return t.stopPropagation(),e.layoutCkickHandler.apply(null,arguments)}}},[e.isInit&&e.needShowList?t("q-drawer",{attrs:{persistent:"",id:"left-drawer",side:"left","no-swipe-open":e.$q.platform.is.desktop,"no-swipe-close":e.$q.platform.is.desktop,breakpoint:576,overlay:!e.devicesListSettings.pinned},model:{value:e.devicesListSettings.opened,callback:function(t){e.$set(e.devicesListSettings,"opened",t)},expression:"devicesListSettings.opened"}},[t("device-list",{directives:[{name:"show",rawName:"v-show",value:e.devices.length,expression:"devices.length"}],attrs:{selectedDeviceId:e.selectedDevice.id,isFollowed:e.selectedDevice.follow,activeDevicesID:e.activeDevicesID,devices:e.devices,devicesColors:e.devicesColors,devicesListPinned:e.devicesListSettings.pinned},on:{"select-device":e.selectDeviceInListHandler,"follow-selected-device":e.followSelectedDeviceHandler,"device-in-devices-list-ckick":e.deviceInListClickHandler,"click-hide":function(t){return e.devicesListOpenedHandler(!1)},"devices-list-pinned":e.devicesListPinnedHandler,"update-color":e.updateColorHandler}})],1):e._e(),e.needShowTelemetry?t("q-drawer",{attrs:{"no-swipe-open":"","no-swipe-close":"",side:"right","content-class":{"bg-grey-9":e.telemetrySettings.inverted}},model:{value:e.telemetrySettings.opened,callback:function(t){e.$set(e.telemetrySettings,"opened",t)},expression:"telemetrySettings.opened"}},[t("div",{staticStyle:{position:"relative",height:"100vh",overflow:"hidden"}},[t("q-item",[t("q-item-section",{attrs:{avatar:""}},[t("q-btn",{attrs:{flat:"",round:"",small:"",icon:"mdi-chevron-right",color:e.telemetrySettings.inverted?"white":""},on:{click:e.telemetryButtonClickHandler}})],1),t("q-item-section",[t("q-item-label",{staticClass:"ellipsis text-bold q-pa-none",class:{"text-white":e.telemetrySettings.inverted},staticStyle:{"font-size":"1.3rem"},attrs:{header:""}},[e._v("\n Telemetry\n ")])],1),t("q-item-section",{attrs:{side:""}},[t("q-btn",{staticClass:"text-grey",attrs:{round:"",flat:"",icon:"mdi-image-filter-black-white",color:e.telemetrySettings.inverted?"white":"grey"},on:{click:e.telemetryInvertedHandler}},[t("q-tooltip",[e._v("Inverted")])],1)],1)],1),e.deviceIdForTelemetry?t("q-item",{staticStyle:{"border-top":"1px solid #ddd","min-height":"71px"}},[t("div",{staticClass:"text-center absolute-top-left bg-grey-4 text-bold text-grey-9",staticStyle:{"font-size":"10px","min-width":"55px",padding:"0 3px","z-index":"1","border-radius":"0 0 3px 0"}},[e._v("\n #"+e._s(e.deviceForTelemetry.id)+"\n ")]),t("q-item-section",{class:{"text-grey-4":e.telemetrySettings.inverted},attrs:{side:""}},[t("q-icon",{attrs:{size:"1.7rem",name:"mdi-developer-board"}})],1),t("q-item-section",[t("q-item-label",{staticClass:"ellipsis q-pa-none",class:{"text-grey-4":e.telemetrySettings.inverted},attrs:{header:""}},[e._v(e._s(e.deviceForTelemetry.name||"")+"\n "),t("q-tooltip",[e._v(e._s(e.deviceForTelemetry.name||""))])],1),t("q-item-label",{staticClass:"ellipsis",class:{"text-grey-4":e.telemetrySettings.inverted},attrs:{caption:""}},[t("q-icon",{attrs:{name:"mdi-label-outline"}}),e._v(" "+e._s(e.deviceForTelemetry.configuration&&e.deviceForTelemetry.configuration.ident?e.deviceForTelemetry.configuration.ident:"")+"\n ")],1),e.deviceForTelemetry.configuration&&e.deviceForTelemetry.configuration.phone?t("q-item-label",{class:{"text-grey-4":e.telemetrySettings.inverted},attrs:{caption:""}},[t("q-icon",{attrs:{name:"mdi-phone"}}),e._v(" "+e._s(e.deviceForTelemetry.configuration&&e.deviceForTelemetry.configuration.phone?e.deviceForTelemetry.configuration.phone:"")+"\n ")],1):e._e()],1)],1):t("q-item",[t("q-item-label",{staticClass:"ellipsis text-bold",class:{"text-white":e.telemetrySettings.inverted},staticStyle:{width:"100%","text-align":"center"},attrs:{header:""}},[e._v("\n No selected device\n ")])],1),e.deviceIdForTelemetry?t("q-item",[t("q-item-section",[t("q-input",{staticClass:"q-mb-xs",attrs:{dense:"",outlined:"","hide-bottom-space":"",type:"text",label:"Search",value:e.telemetrySearch,dark:e.telemetrySettings.inverted,color:e.telemetrySettings.inverted?"white":"grey"},on:{input:t=>{e.telemetrySearch=t.toLowerCase()}}})],1)],1):e._e(),e.deviceIdForTelemetry?t("q-telemetry",{staticClass:"scroll",staticStyle:{height:"calc(100% - 128px)"},attrs:{propHistoryFlag:e.telemetryConfig.propHistoryFlag,device:e.deviceForTelemetry,inverted:e.telemetrySettings.inverted,search:e.telemetrySearch}}):e._e()],1)]):e._e(),t("q-page-container",[t("q-page",[e.devices.length&&e.needShowList?t("q-btn",{staticClass:"floated menu white-background",attrs:{small:"",round:"",flat:"",color:"bg-grey-9",size:"md",icon:"mdi-menu"},on:{click:function(t){return t.stopPropagation(),e.devicesListOpenedHandler(!e.devicesListSettings.opened)}}}):e._e(),t("div",{staticClass:"floated label"},[t("img",{staticStyle:{height:"40px","margin-top":"3px",display:"inline-block"},attrs:{src:"track-it-logo.png",alt:"Track it!"}}),t("div",{staticClass:"q-toolbar-title",staticStyle:{color:"rgb(51, 51, 51)",display:"inline-block"}},[e._v("\n Track it! "),t("sup",[e._v(e._s(e.version))]),t("div",{staticClass:"q-toolbar-subtitle"},[e._v("\n Find yourself\n ")])])]),e.errors.length?t("q-btn",{staticClass:"floated notifications white-background",attrs:{small:"",flat:"",round:"",color:"bg-grey-9",size:"md",icon:"mdi-bell"},on:{click:e.clearNotificationCounter}},[e.newNotificationCounter?t("q-chip",{staticClass:"absolute-top-right q-pa-xs text-white",staticStyle:{"font-size":".6rem"},attrs:{color:"red"}},[e._v(e._s(e.newNotificationCounter))]):e._e(),t("q-menu",{ref:"popoverError",attrs:{fit:""}},[t("q-list",{staticClass:"scroll",staticStyle:{"max-height":"200px"},attrs:{"no-border":"",link:"",separator:""}},e._l(e.errors,(function(s,i){return t("q-item",{key:i,staticStyle:{cursor:"default"}},[t("q-item-section",[t("q-item-label",[e._v(e._s(s))])],1)],1)})),1)],1)],1):e._e(),e.devices.length?t("div",{staticClass:"floated date"},[t("date-range-modal",{attrs:{date:e.date,theme:e.dateTheme},on:{save:t=>e.date=[...t],reinit:e.initDate}})],1):e._e(),!e.activeDevicesID.length&&e.devices.length?t("div",{staticClass:"floated no-devices"},[t("span",{staticClass:"no-devices__message"},[e._v("You have no selected devices")]),t("div",{staticStyle:{"margin-top":"15px"}},[t("q-btn",{staticStyle:{"pointer-events":"auto"},attrs:{icon:"mdi-menu",color:"black",size:"md"},on:{click:function(t){return t.stopPropagation(),e.devicesListOpenedHandler(!e.devicesListSettings.opened)}}},[e._v("\n select devices\n ")])],1)]):!e.devices.length&&e.hasDevicesInit?t("div",{staticClass:"floated no-devices"},[t("span",{staticClass:"no-devices__message"},[e._v("You have no devices")]),t("div",{staticClass:"q-mt-sm text-bg-grey-9",staticStyle:{"font-size":"1.3rem"}},[e._v("\n Create one on\n "),t("q-btn",{staticStyle:{"pointer-events":"auto"},attrs:{dense:"",color:"red-5",label:"flespi.io"},on:{click:function(t){return e.openURL("https://flespi.io")}}})],1)]):e._e(),e.$q.platform.is.desktop?t("a",{attrs:{href:"https://github.com/flespi-software/TrackIt/",target:"_blank"}},[t("q-btn",{staticClass:"floated white-background",class:[e.needShowTelemetry?"github":"telemetry"],attrs:{flat:"",round:"",color:"bg-grey-9"}},[t("img",{staticStyle:{height:"30px"},attrs:{src:"GitHub-Mark-32px.png",alt:"GitHub"}}),t("q-tooltip",[e._v("Show on GitHub")])],1)],1):e._e(),e.needShowTelemetry?t("q-btn",{staticClass:"floated telemetry white-background",attrs:{small:"",round:"",flat:"",size:"md",icon:"mdi-list-box-outline"},on:{click:e.telemetryButtonClickHandler}},[t("q-tooltip",[e._v("Device telemetry")])],1):e._e(),t("q-btn",{staticClass:"floated options white-background",attrs:{small:"",round:"",flat:"",size:"md",icon:"mdi-dots-vertical",color:"bg-grey-9"}},[t("q-menu",{ref:"popover-menu"},[t("q-list",{staticClass:"scroll",staticStyle:{"min-width":"200px"},attrs:{link:"",separator:""}},[e.needHideMessagesInMenu?e._e():t("q-item",{attrs:{dense:""}},[t("q-toggle",{attrs:{disabled:!e.devices.length,icon:"mdi-mail",label:"Messages"},on:{input:e.paramsChangeHandler},model:{value:e.params.needShowMessages,callback:function(t){e.$set(e.params,"needShowMessages",t)},expression:"params.needShowMessages"}},[t("q-tooltip",[e._v("Show messages grid")])],1)],1),e.needHidePlayerInMenu?e._e():t("q-item",{attrs:{dense:""}},[t("q-toggle",{attrs:{disable:!e.devices.length,icon:"mdi-play",label:"Player"},on:{input:e.paramsChangeHandler},model:{value:e.params.needShowPlayer,callback:function(t){e.$set(e.params,"needShowPlayer",t)},expression:"params.needShowPlayer"}},[t("q-tooltip",[e._v("Show track player")])],1)],1),e.needHideNamesInMenu?e._e():t("q-item",{attrs:{dense:""}},[t("q-toggle",{attrs:{disabled:!e.devices.length,icon:"mdi-map-marker-radius-outline",label:"Names"},on:{input:e.paramsChangeHandler},model:{value:e.params.needShowNamesOnMap,callback:function(t){e.$set(e.params,"needShowNamesOnMap",t)},expression:"params.needShowNamesOnMap"}},[t("q-tooltip",[e._v("Display cars' names on the map")])],1)],1),e.needHideInvalidInMenu?e._e():t("q-item",{attrs:{dense:""}},[t("q-toggle",{attrs:{disabled:!e.devices.length,icon:"mdi-map-marker-off",label:"Drow invalid"},on:{input:e.paramsChangeHandler},model:{value:e.params.needShowInvalidPositionMessages,callback:function(t){e.$set(e.params,"needShowInvalidPositionMessages",t)},expression:"params.needShowInvalidPositionMessages"}},[t("q-tooltip",[e._v("Use messages with position.valid=false to display cars' positions on the map")])],1)],1),t("q-item",{staticClass:"within-iframe-hide",attrs:{clickable:""},on:{click:e.exitHandler}},[t("q-item-section",{staticClass:"q-pl-md",attrs:{avatar:""}},[t("q-icon",{attrs:{name:"mdi-exit-to-app"}})],1),t("q-item-section",[t("q-item-label",[e._v("Exit")])],1)],1)],1)],1)],1),t("map-component",{attrs:{activeDevices:e.activeDevices,devicesColors:e.computedDevicesColors,selectedDeviceId:e.selectedDevice.id,isSelectedDeviceFollowed:e.selectedDevice.follow,params:e.params,date:e.date},on:{"change-need-show-messages":t=>{e.params.needShowMessages=t},"update-telemetry-device-id":e.updateTelemetryDeviceId,"queue-created":e.queueCreatedHandler,"update-color":e.updateColorHandler}})],1)],1)],1)},a=[],n=(s("14d9"),s("8c77"),s("2b0e")),r=s("2f62"),o=function(){var e=this,t=e._self._c;return t("div",{staticClass:"q-v-date-range-picker",staticStyle:{"min-width":"180px"}},[t("q-btn",{attrs:{color:e.theme.bgColor,flat:"",dense:"",icon:"mdi-chevron-left"},on:{click:e.prevHandler}},[t("q-tooltip",[e._v("Previous time range")])],1),t("q-btn",{staticClass:"q-pa-none",staticStyle:{"min-width":"124px","font-size":".8rem","line-height":".8rem"},attrs:{flat:"",color:e.theme.bgColor},on:{click:e.dateRangeToggle}},[t("div",[t("div",[e._v(e._s(e.formatDate(e.dateModel[0])))]),t("div",{staticStyle:{"font-size":".5rem"}},[e._v("|")]),t("div",[e._v(e._s(e.formatDate(e.dateModel[1])))])]),t("q-tooltip",[e._v("Change time")])],1),t("q-btn",{attrs:{color:e.theme.bgColor,flat:"",dense:"",icon:"mdi-chevron-right"},on:{click:e.nextHandler}},[t("q-tooltip",[e._v("Next time range")])],1),t("q-dialog",{ref:"dateRangePickerModal",attrs:{"content-class":"modal-date-range"}},[t("q-card",[t("q-card-section",{staticClass:"scroll q-pa-none",class:{[`bg-${e.theme.bgColor}`]:!0,"text-white":!!e.theme.bgColor}},[t("div",{staticClass:"flex flex-center",staticStyle:{"max-width":"330px"}},[t("div",{staticClass:"fit text-center q-my-sm"},[t("q-btn-toggle",{attrs:{options:e.dateRangeModeOptions,color:e.theme.bgColor,"text-color":"grey","toggle-text-color":e.theme.color,flat:""},model:{value:e.mode,callback:function(t){e.mode=t},expression:"mode"}})],1),t("date-range-picker",{staticClass:"q-ma-sm",attrs:{mode:e.mode,theme:e.theme},on:{"change:mode":e.changeModeDateTimeRangeHandler,error:t=>e.saveDisabled=t},model:{value:e.dateModel,callback:function(t){e.dateModel=t},expression:"dateModel"}})],1)]),t("q-card-actions",{class:{[`bg-${e.theme.bgColor}`]:!0,"text-white":!!e.theme.bgColor},attrs:{align:"between"}},[t("q-btn",{attrs:{flat:"",color:e.theme.color,dense:"",icon:"mdi-map-clock-outline"},on:{click:function(t){e.$emit("reinit"),e.dateRangeModalClose()}}},[t("q-tooltip",[e._v("Reinit time by devices positions")])],1),t("div",[t("q-btn",{attrs:{flat:"",color:e.theme.color},on:{click:e.dateRangeModalClose}},[e._v("close")]),t("q-btn",{attrs:{flat:"",color:e.theme.color,disable:e.saveDisabled},on:{click:e.dateRangeModalSave}},[e._v("save")])],1)],1)],1)],1)],1)},l=[],c=s("bd4c"),d=s("a99f"),h={props:["theme","date"],data(){return{dateModel:this.date,mode:0,saveDisabled:!1,dateRangeModeOptions:[{label:"Day",value:0},{label:"Range",value:3},{label:"Manual",value:4}]}},methods:{dateRangeToggle(){this.$refs.dateRangePickerModal.toggle()},dateRangeModalClose(){this.$refs.dateRangePickerModal.hide()},changeModeDateTimeRangeHandler(e){this.mode=e},dateRangeModalSave(){let[e,t]=this.dateModel;t+=999,this.$emit("save",[e,t]),this.dateRangeModalClose()},formatDate(e){return c["a"].formatDate(e,"DD/MM/YYYY HH:mm:ss")},prevHandler(){const e=Math.floor(this.dateModel[1])-Math.floor(this.dateModel[0]),t=Math.floor(this.dateModel[0])-1,s=t-e;this.dateModel=[s,t],this.$emit("save",this.dateModel)},nextHandler(){const e=Math.floor(this.dateModel[1])-Math.floor(this.dateModel[0]),t=Math.floor(this.dateModel[1])+1,s=t+e;this.dateModel=[t,s],this.$emit("save",this.dateModel)}},watch:{date(e){this.dateModel=e}},components:{DateRangePicker:d["a"]}},m=h,p=(s("2b48"),s("2877")),g=s("9c40"),u=s("05c0"),v=s("24e8"),f=s("f09f"),y=s("a370"),k=s("6a67"),b=s("4b7e"),_=s("eebe"),w=s.n(_),S=Object(p["a"])(m,o,l,!1,null,null,null),D=S.exports;w()(S,"components",{QBtn:g["a"],QTooltip:u["a"],QDialog:v["a"],QCard:f["a"],QCardSection:y["a"],QBtnToggle:k["a"],QCardActions:b["a"]});var $=s("5ee7"),M=function(){var e=this,t=e._self._c;return t("div",{staticClass:"map-wrapper absolute-top-left absolute-bottom-right"},[t("div",{style:{height:e.mapHeight},attrs:{id:"map"}},[t("q-resize-observer",{on:{resize:e.onResize}})],1),Object.keys(e.messages).length&&e.activeDevicesID.length?t("queue",{ref:"queue",attrs:{activeDevicesID:e.activeDevicesID,needShowMessages:e.params.needShowMessages,needShowPlayer:e.params.needShowPlayer,messages:e.allMessages,selectedDeviceId:e.selectedDeviceId,telemetryDeviceId:e.telemetryDeviceId,date:e.date,player:e.player},on:{"player-value":t=>e.playProcess(t,"value"),"player-play":t=>e.playProcess(t,"play"),"player-pause":t=>e.playProcess(t,"pause"),"player-stop":t=>e.playProcess(t,"stop"),"player-speed":e.playerSpeedChangeHandler,"player-mode":e.playerModeChange,"change-need-show-messages":t=>{e.$emit("change-need-show-messages",t)},"queue-created":function(t){return e.$emit("queue-created")},"update-color":e.updateColorHandler,"view-on-map":e.viewOnMapHandler}}):e._e(),t("color-modal",{ref:"colorModal",model:{value:e.color,callback:function(t){e.color=t},expression:"color"}})],1)},C=[],x=s("e11e"),I=(s("d88e"),s("6cc5"),s("7998"),s("9ae0"),s("790e"),s("3c65"),function(e){e.Polyline.include({_snakingTimestamp:0,_snakingRings:0,_snakingTailRings:0,_snakingVertices:0,_snakingTailVertices:0,_snakingDistance:0,_snakingTailDistance:0,_snakingIn:!1,_snakingOut:!1,_snakingPaused:!1,_snakingPauseTime:0,snakeIn:function(){if(!this._snakingIn&&!this._snakingOut&&"performance"in window&&"now"in window.performance&&this._map)return this._snakingIn=!0,this._snakingTime=performance.now(),this._snakingVertices=this._snakingRings=this._snakingDistance=0,this._snakeLatLngs||(this._snakeLatLngs=e.LineUtil.isFlat(this._latlngs)?[this._latlngs]:this._latlngs),this._latlngs=[[this._snakeLatLngs[0][0],this._snakeLatLngs[0][0]]],this._update(),this._snake(),this.fire("snakestart"),this.fire("snakeInStart"),this},snakeOut:function(){if(!this._snakingOut&&"performance"in window&&"now"in window.performance&&this._map){if(this._snakingOut=!0,this._snakingTime=performance.now(),this._snakingTailVertices=this._snakingTailRings=this._snakingTailDistance=0,this._snakeLatLngs||(this._snakeLatLngs=e.LineUtil.isFlat(this._latlngs)?[this._latlngs]:this._latlngs),!this._snakingIn){const e=[],t=Object.keys(this._snakeLatLngs);t.forEach((()=>{e.push([]),this._snakeLatLngs[e.length-1].forEach((function(t){e[e.length-1].push([t.lat,t.lng])}))})),this._latlngs=e}return this._update(),this._snakingIn||this._snake(),this.fire("snakeOutStart"),this}},_snake:function(){if(!this._map)return;if(this._snakingPaused)return;const t=performance.now();let s=t-this._snakingTime;s=0===s?.001:s;const i=s*this.options.snakingSpeed/1e3;return this._snakingTime=t,this._snakingIn&&this._latlngs[this._snakingRings].pop(),this._snakingOut&&this._latlngs[this._snakingTailRings].shift(),this._snakingIn&&this._snakeHeadForward(i),this._snakingOut&&this._snakeTailForward(i),this.setLatLngs(this._latlngs),(this._snakingIn||this._snakingOut)&&(this.fire("snake"),e.Util.requestAnimFrame(this._snake,this)),this},_snakeHeadForward:function(e){let t=this._map.latLngToContainerPoint(this._snakeLatLngs[this._snakingRings][this._snakingVertices]),s=this._map.latLngToContainerPoint(this._snakeLatLngs[this._snakingRings][this._snakingVertices+1]),i=t.distanceTo(s);while(this._snakingDistance+e>i){if(this._snakingVertices++,this._latlngs[this._snakingRings].push(this._snakeLatLngs[this._snakingRings][this._snakingVertices]),this._snakingVertices>=this._snakeLatLngs[this._snakingRings].length-1){if(this._snakingRings>=this._snakeLatLngs.length-1)return this._snakeInEnd();this._snakingVertices=0,this._snakingRings++,this._latlngs[this._snakingRings]=[this._snakeLatLngs[this._snakingRings][this._snakingVertices]]}this._snakingDistance-=i,t=this._map.latLngToContainerPoint(this._snakeLatLngs[this._snakingRings][this._snakingVertices]),s=this._map.latLngToContainerPoint(this._snakeLatLngs[this._snakingRings][this._snakingVertices+1]),i=t.distanceTo(s)}this._snakingDistance+=e;const a=this._snakingDistance/i,n=s.multiplyBy(a).add(t.multiplyBy(1-a)),r=this._map.containerPointToLatLng(n);return this._latlngs[this._snakingRings].push(r),this.options.followHead&&this._map.setView(r),this},_snakeTailForward:function(e){let t=this._map.latLngToContainerPoint(this._snakeLatLngs[this._snakingTailRings][this._snakingTailVertices]),s=this._map.latLngToContainerPoint(this._snakeLatLngs[this._snakingTailRings][this._snakingTailVertices+1]),i=t.distanceTo(s);while(this._snakingTailDistance+e>i){if(this._snakingTailVertices++,this._latlngs[this._snakingTailRings].shift(),this._snakingTailVertices>=this._snakeLatLngs[this._snakingTailRings].length-1){if(this._snakingTailRings>=this._snakeLatLngs.length-1)return this._snakeOutEnd();this._snakingTailVertices=0,this._latlngs[this._snakingTailRings]=[],this._snakingTailRings++,this._latlngs[this._snakingTailRings].shift()}this._snakingTailDistance-=i,t=this._map.latLngToContainerPoint(this._snakeLatLngs[this._snakingTailRings][this._snakingTailVertices]),s=this._map.latLngToContainerPoint(this._snakeLatLngs[this._snakingTailRings][this._snakingTailVertices+1]),i=t.distanceTo(s)}this._snakingTailDistance+=e;const a=this._snakingTailDistance/i,n=s.multiplyBy(a).add(t.multiplyBy(1-a)),r=this._map.containerPointToLatLng(n);return this._latlngs[this._snakingTailRings].unshift(r),this},_snakeInEnd:function(){return this._snakingIn=!1,this._snakingOut||this.setLatLngs(this._snakeLatLngs),this.fire("snakeend"),this.fire("snakeInEnd"),this},_snakeOutEnd:function(){return this._snakingOut=!1,this.fire("snakeOutEnd"),this},snakeReset:function(){return this._snakingIn=this._snakingOut=!1,this._snakeLatLngs&&this.setLatLngs(this._snakeLatLngs),this},snakePause:function(){this._snakingPaused=!0,this._snakingPauseTime=performance.now()},snakeUnpause:function(){if(!this._snakingPaused)return;this._snakingPaused=!1;const t=performance.now(),s=t-this._snakingPauseTime;this._snakingPauseTime=0,this._snakingTime+=s,e.Util.requestAnimFrame(this._snake,this)}}),e.Polyline.mergeOptions({snakingSpeed:200,followHead:!1}),e.LayerGroup.include({_snakingLayers:[],_snakingLayersDone:0,_snakingTailLayersDone:0,_snakingIn:!1,_snakingOut:!1,_snakeTimeoutsId:[],snakeIn:function(){if("performance"in window&&"now"in window.performance&&this._map&&!this._snakingIn&&!this._snakingOut){if(this._snakingIn=!0,this._snakingLayersDone=0,0===this._snakingLayers.length&&this._initSnakingLayers(),this.options.snakeRemoveLayers)this.clearLayers();else for(const t in this._snakingLayers)this._snakingLayers[t]instanceof e.Polyline&&this.removeLayer(this._snakingLayers[t]);return this.fire("snakestart"),this.fire("snakeInStart"),this._snakeHeadNext()}},snakeOut:function(){if("performance"in window&&"now"in window.performance&&this._map&&!this._snakingOut)return this._snakingOut=!0,this._snakingTailLayersDone=0,this.fire("snakeOutStart"),this._snakeTailNext()},_initSnakingLayers:function(){const e=Object.keys(this._layers);for(const t in e){const s=e[t];this._snakingLayers.push(this._layers[s])}return this},_snakeHeadNext:function(){if(!this._snakingIn)return this;if(this._snakingLayersDone>=this._snakingLayers.length)return this.fire("snakeend"),this.fire("snakeInEnd"),void(this._snakingIn=!1);const e=this._snakingLayers[this._snakingLayersDone];return this._snakingLayersDone++,this.getLayer(e)||this.addLayer(e),"snakeIn"in e?(e.once("snakeInEnd",(function(){this._snakeTimeoutsId.push(setTimeout(this._snakeHeadNext.bind(this),this.options.snakingPause))}),this),e.snakeIn()):this._snakeTimeoutsId.push(setTimeout(this._snakeHeadNext.bind(this),this.options.snakingPause)),this.fire("snake"),this},_snakeTailNext:function(){if(!this._snakingOut)return this;if(this.options.snakeRemoveLayers&&this.removeLayer(this._snakingLayers[this._snakingTailLayersDone-1]),this._snakingTailLayersDone>=this._snakingLayers.length)return this.fire("snakeOutEnd"),void(this._snakingOut=!1);const e=this._snakingLayers[this._snakingTailLayersDone];return this._snakingTailLayersDone++,"snakeOut"in e?(e.once("snakeOutEnd",(function(){this._snakeTimeoutsId.push(setTimeout(this._snakeTailNext.bind(this),this.options.snakingPause))}),this),e.snakeOut()):this._snakeTimeoutsId.push(setTimeout(this._snakeTailNext.bind(this),this.options.snakingPause)),this.fire("snake"),this},snakeReset:function(){this._snakingIn=!1,this._snakingOut=!1,0===this._snakingLayers.length&&this._initSnakingLayers();for(const e in this._snakeTimeoutsId)clearTimeout(e);this._snakeTimeoutsId=[];for(const t in this._snakingLayers)this._snakingLayers[t]instanceof e.Polyline&&this._snakingLayers[t].snakeReset(),this.getLayer(this._snakingLayers[t])||this.addLayer(this._snakingLayers[t]);return this}}),e.LayerGroup.mergeOptions({snakingPause:200,snakeRemoveLayers:!0})}),L=function(){var e=this,t=e._self._c;return t("div",{staticClass:"absolute-bottom-left absolute-bottom-right",attrs:{id:"queue"}},[t("q-tab-panels",{staticStyle:{background:"rgba(0, 0, 0, .5)"},attrs:{animated:""},model:{value:e.selected,callback:function(t){e.selected=t},expression:"selected"}},e._l(e.activeDevicesID,(function(s){return t("q-tab-panel",{key:`tab-panel-${s}`,staticClass:"no-padding no-scroll",attrs:{name:s.toString()}},[t("queue-item",{key:`tab-pane-${s}`,attrs:{id:s,messages:e.messages[s],date:e.date,needShowMessages:e.needShowMessages,needShowPlayer:e.needShowPlayer,player:e.player},on:{"player-value":e.playHandler,"player-play":t=>e.$emit("player-play",t),"player-pause":t=>e.$emit("player-pause",t),"player-stop":e.stopHandler,"player-speed":t=>e.$emit("player-speed",t),"player-mode":t=>e.$emit("player-mode",t),"change-need-show-messages":t=>{e.$emit("change-need-show-messages",t)},"view-on-map":t=>{e.$emit("view-on-map",t)}}})],1)})),1)],1)},q=[],T=function(){var e=this,t=e._self._c;return t("div",{style:[{height:e.height}]},[e.needShowMessages?t("div",{staticClass:"table__wrapper",style:{height:e.needShowPlayer?`calc(100% - ${e.playerHeight}px)`:"100%"}},[t("messages",{staticStyle:{height:"100%"},attrs:{messages:e.messages,activeDeviceId:e.id,limit:0,date:e.date,activeMessagesIds:e.activeMessagesIndexes},on:{view:e.viewMessageHandler,"view-on-map":e.viewOnMapHandler}})],1):e._e(),t("div",[t("q-resize-observer",{ref:"playerResize",on:{resize:e.onResizePlayer}}),e.needShowPlayer?t("player",{ref:"player",attrs:{min:e.timeRange.min,max:e.timeRange.max,status:e.player.status,speed:e.player.speed,mode:e.player.mode,needShowMessages:e.needShowMessages},on:{"player-next":e.playerNextHandler,"player-prev":e.playerPrevHandler,"player-play":e.playerPlayHandler,"player-pause":e.playerPauseHandler,"player-stop":e.playerStopHandler,"player-speed":e.playerSpeedHandler,"switch-show-messages":e.switchShowMessages,"switch-player-mode":e.switchPlayerMode},model:{value:e.playerValue,callback:function(t){e.playerValue=t},expression:"playerValue"}}):e._e()],1)])},j=[],H=function(){var e=this,t=e._self._c;return t("div",[t("virtual-scroll-list",{ref:"scrollList",attrs:{cols:e.cols,actions:e.actions,items:e.messages,dateRange:e.dateRange,viewConfig:e.viewConfig,theme:e.theme,title:"Messages",loading:e.isLoading,autoscroll:e.needAutoscroll,scrollOffset:"10%",item:e.listItem,itemprops:e.getItemsProps},on:{"action-to-bottom":e.actionToBottomHandler,"update-cols":e.updateColsHandler,"scroll-bottom":e.scrollBottomHandler,action:e.actionHandler}},[t("div",{staticClass:"no-messages text-center",attrs:{slot:"empty"},slot:"empty"},[t("div",{staticClass:"text-white",staticStyle:{"font-size":"3rem"}},[t("div",[e._v("No messages")]),t("div",{staticStyle:{"font-size":"1.5rem"}},[e._v("and the last position is unknown")])])])]),t("message-viewer",{ref:"messageViewer",attrs:{message:"undefined"!==typeof e.selectedMessage?e.selectedMessage:{},inverted:""},on:{close:e.closeHandler}})],1)},P=[],O=s("de45"),N=function(){var e=this,t=e._self._c;return t("q-dialog",{ref:"modal",on:{hide:function(t){return e.$emit("close")}}},[t("q-card",{class:{"bg-grey-9":void 0!==e.inverted},style:{minWidth:e.$q.platform.is.mobile?"100%":"30vw"}},[t("q-card-section",{staticClass:"scroll q-pa-none",style:{height:e.$q.platform.is.mobile?"calc(100% - 52px)":""}},[t("div",{staticClass:"layout-padding q-pa-md"},e._l(e.message,(function(s,i,a){return t("div",{key:a,staticClass:"row items-center"},[t("div",{staticClass:"text-weight-bold"},[t("span",{staticClass:"message-viewer__copy text-green cursor-pointer"},[t("q-icon",{attrs:{name:"mdi-content-copy"},nativeOn:{click:function(t){return e.copy(`${i}: ${s}`)}}})],1),t("span",{staticClass:"message-viewer__name text-white"},[e._v(e._s(i)+": ")]),t("span",{staticClass:"message-viewer__value text-green"},[e._v(e._s(e.getValue(i,s)))])])])})),0)]),t("q-separator",{attrs:{color:"white"}}),t("q-card-actions",{staticClass:"bg-grey-9 text-white",attrs:{align:"right"}},[t("q-btn",{attrs:{flat:""},on:{click:function(t){return e.copy(e.message)}}},[e._v("Copy full message")]),t("q-btn",{attrs:{flat:""},on:{click:function(t){return e.$refs.modal.hide()}}},[e._v("Close")])],1)],1)],1)},z=[],F=s("cdde"),R={name:"MessageViewer",data(){return{date:c["a"]}},props:{message:{type:Object,required:!0},inverted:{type:Boolean}},methods:{show(){this.$refs.modal.show()},getValue(e,t){return"timestamp"===e?c["a"].formatDate(1e3*t,"DD/MM/YYYY HH:mm:ss"):t},copy(e){Object(F["a"])(JSON.stringify(e)).then((e=>{this.$q.notify({color:"positive",icon:"content_copy",message:"Successfully copied",timeout:1e3})}),(e=>{this.$q.notify({color:"negative",icon:"content_copy",message:"Error coping",timeout:1e3})}))}}},V=R,B=s("0016"),E=s("eb85"),Q=Object(p["a"])(V,N,z,!1,null,null,null),A=Q.exports;w()(Q,"components",{QDialog:v["a"],QCard:f["a"],QCardSection:y["a"],QIcon:B["a"],QSeparator:E["a"],QCardActions:b["a"],QBtn:g["a"]});var U=function(){var e=this,t=e._self._c;return t("div",{staticClass:"cursor-pointer",class:{"missed-items":e.item["x-flespi-status"],"bg-white-opasity":e.selected,"item--telemetry-inited":e.item["x-flespi-inited-by-telemetry"],"item--invalid-position":!1===e.item["position.valid"]},style:{height:`${e.itemHeight}px`,width:`${e.rowWidth}px`,borderBottom:e.item.delimiter?"solid 1px #f40":"",color:e.selected?"#333":""},on:{click:function(t){return e.itemClickHandler(e.index,e.item)}}},[e._l(e.cols,(function(s,i){return["etc"===s.__dest?t("span",{key:s.name+i,staticClass:"list__item item_etc",class:{[`item_${i}`]:!0,"item--active":e.menuCellActive&&e.menuCellActive.row===e.index&&e.menuCellActive.col===i}},[e._v(e._s(e.values.etc.value||"*Empty*"))]):t("span",{key:s.name+i,staticClass:"list__item",class:{[`item_${i}`]:!0,"item--active":e.menuCellActive&&e.menuCellActive.row===e.index&&e.menuCellActive.col===i},attrs:{title:e.values[s.name].value}},[e._v("\n "+e._s(e.values[s.name].value)+"\n ")])]}))],2)},Y=[],W={props:["item","index","actions","cols","itemHeight","etcVisible","rowWidth","actionsVisible","selected","menuCellActive"],data(){return{date:c["a"]}},computed:{values(){let e={};return e=this.cols.length?this.cols.reduce(((e,t,s,i)=>(e[t.name]={value:this.getValueOfProp(t,this.item)},s===i.length-1&&(e.etc={value:""}),e)),{}):{etc:{value:""}},Object.keys(this.item).forEach((t=>{e[t]||(-1!==t.indexOf("image.bin.")?e.etc.value+=`${t}: `:e.etc.value+=`${t}: ${JSON.stringify(this.item[t])}; `)})),e}},methods:{clickHandler(e,t,s){this.$emit("action",{index:e,type:t,content:s})},itemClickHandler(e,t){this.$emit("item-click",{index:e,content:t})},getValue(e){return"string"===typeof e?e:JSON.stringify(e)},getValueOfProp(e,t){const s=e.name;let i=t[s];return s.match(/timestamp$/)?i=c["a"].formatDate(1e3*i,"DD/MM/YYYY HH:mm:ss"):-1!==s.indexOf("image.bin.")?i="":"string"!==typeof i&&(i=JSON.stringify(i)),i}}},Z=W,G=(s("e796"),Object(p["a"])(Z,U,Y,!1,null,null,null)),J=G.exports;const K={actions:[{icon:"mdi-eye",label:"Show message",classes:"",type:"view"}],viewConfig:{needShowFilter:!1,needShowDate:!1,needShowEtc:!0},theme:{color:"white",bgColor:"grey-9",contentInverted:!0,controlsInverted:!0}};var X={props:["mode","activeDeviceId","limit","messages","date","activeMessagesIds"],data(){const e=document.createElement("style");e.type="text/css";const t=document.head||document.getElementsByTagName("head")[0],s=t.appendChild(e);return{listItem:J,selectedMessage:void 0,dynamicCSS:s,theme:K.theme,viewConfig:K.viewConfig,actions:K.actions,moduleName:this.activeDeviceId,autoscroll:!0}},computed:{storedMessages(){const e=this.$store.state.messages[this.moduleName].messages;return this.scrollControlling(e.length),e},cols:{get(){return this.$store.state.messages[this.moduleName].cols},set(e){this.$store.commit(`messages/${this.moduleName}/updateCols`,e)}},from:{get(){return this.$store.state.messages[this.moduleName].from},set(e){e=e||0,this.$store.commit(`messages/${this.moduleName}/setFrom`,e)}},to:{get(){return this.$store.state.messages[this.moduleName].to},set(e){e=e||0,this.$store.commit(`messages/${this.moduleName}/setTo`,e)}},dateRange(){return[this.$store.state.messages[this.moduleName].from,this.$store.state.messages[this.moduleName].to]},reverse:{get(){return this.$store.state.messages[this.moduleName].reverse||!1},set(e){this.$store.commit(`messages/${this.moduleName}/setReverse`,e)}},currentLimit:{get(){return this.$store.state.messages[this.moduleName].limit},set(e){e=e||0,this.$store.commit(`messages/${this.moduleName}/setLimit`,e)}},selected:{get(){const e=this.$store.state.messages[this.moduleName].selected,t=e.slice(-1)[0];return void 0!==t&&this.scrollToSelected(t),e},set(e){e&&e.length&&(this.autoscroll=!1),this.$store.commit(`messages/${this.moduleName}/setSelected`,e)}},realtimeEnabled(){return this.$store.state.messages[this.moduleName].realtimeEnabled},isLoading(){return this.$store.state.messages[this.moduleName].isLoading},needAutoscroll(){return this.realtimeEnabled&&!this.selected.length&&this.autoscroll}},methods:{getItemsProps(e,t){const s=this.messages[e];t.key=s["x-flespi-message-key"],t.class=[`scroll-list-item--${e}`],t.props.selected=this.selected.includes(e),t.on||(t.on={}),t.on.action=this.actionHandler,t.on["item-click"]=this.viewMessageOnMap,t.dataHandler=(e,t,s)=>(this.autoscroll=!1,this.listItem.methods.getValueOfProp(e.data,t.data))},resetParams(){this.$refs.scrollList.resetParams()},updateColsHandler(e){this.cols=e},viewMessagesHandler({index:e,content:t}){this.selectedMessage=t,this.highlightSelected([e]),this.$refs.messageViewer.show(),this.$emit("view")},viewMessageOnMap({index:e,content:t}){this.selected=[e],this.$emit("view-on-map",t)},closeHandler(){let e=[];this.selectedMessage=void 0,this.activeMessagesIds.length&&(e=[this.activeMessagesIds[this.activeMessagesIds.length-1]]),this.highlightSelected(e)},actionToBottomHandler(){this.autoscroll=!0,this.$refs.scrollList.scrollTo(this.messages.length-1)},scrollBottomHandler(){this.autoscroll=!0},copyMessageHandler({index:e,content:t}){Object(F["a"])(JSON.stringify(t)).then((e=>{this.$q.notify({color:"positive",icon:"content_copy",message:"Message copied",timeout:1e3})}),(e=>{this.$q.notify({color:"negative",icon:"content_copy",message:"Error coping messages",timeout:1e3})}))},actionHandler({index:e,type:t,content:s}){switch(t){case"view":this.viewMessagesHandler({index:e,content:s});break}},unselect(){this.selected.length&&(this.selected=[])},updateDynamicCSS(e){this.dynamicCSS.styleSheet?this.dynamicCSS.styleSheet.cssText=e:this.dynamicCSS.innerText=e},highlightSelected(e){let t,s;if(e.length){const i=e[e.length-1];s=[i],t=`.scroll-list-item--${i} {background-color: rgba(255,255,255,0.7)!important; color: #333;}`}else s=[],t="";this.selected=s,this.updateDynamicCSS(t)},scrollToSelected(e){if("number"===typeof e&&e>=0&&this.$refs.scrollList){const t=this.$refs.scrollList.itemsCount;let s=e-Math.floor(t/2);s<0&&(s=0),this.$refs.scrollList.scrollTo(s)}},messageShow(e){this.selected[0]!==e[e.length-1]&&(this.highlightSelected(e),this.scrollToSelected(e[e.length-1]))},scrollControlling(e){this.selected.length&&this.selected[0]+1e3<=e&&this.$store.dispatch(`messages/${this.moduleName}/unsubscribePooling`)}},watch:{limit(e){this.currentLimit=e},activeMessagesIds(e){this.messageShow(e)}},created(){this.currentLimit=this.limit,this.highlightSelected(this.activeMessagesIds)},destroyed(){this.$store.commit(`messages/${this.moduleName}/clearSelected`),this.dynamicCSS.parentNode.removeChild(this.dynamicCSS)},components:{VirtualScrollList:O["a"],MessageViewer:A}},ee=X,te=(s("9f7d"),Object(p["a"])(ee,H,P,!1,null,null,null)),se=te.exports,ie=function(){var e=this,t=e._self._c;return t("div",{staticClass:"row",staticStyle:{"background-color":"#424242"},style:{height:e.needShowMessages?"auto":"100%"}},[t("div",{staticClass:"col-12 col-md-auto"},[t("q-btn",{attrs:{icon:"mdi-mail",color:e.needShowMessages?"blue":"white",size:e.$q.platform.is.desktop?"1rem":"md",round:"",flat:""},on:{click:function(t){return e.$emit("switch-show-messages")}}},[e.$q.platform.is.desktop?t("q-tooltip",[e._v("Messages")]):e._e()],1),t("q-btn",{attrs:{icon:"time"===e.mode?"mdi-map-clock-outline":"mdi-map-marker-distance",disable:e.max<=e.min||"play"===e.status,color:"white",size:e.$q.platform.is.desktop?"1rem":"md",round:"",flat:""},on:{click:function(t){return e.$emit("switch-player-mode")}}},[e.$q.platform.is.desktop?t("q-tooltip",[e._v("Change mode (Time/Data)")]):e._e()],1),t("q-btn",{staticClass:"text-white",attrs:{disable:e.max<=e.min,size:e.$q.platform.is.desktop?"1rem":"md",flat:""}},[e._v("\n x"+e._s(e.currentSpeed)+"\n "),t("q-menu",{ref:"currentSpeedPopover",staticStyle:{"background-color":"#424242"},attrs:{anchor:"top left"}},[t("div",{staticClass:"column"},e._l([100,70,50,30,10,1],(function(s){return t("q-btn",{key:s,staticClass:"text-white bg-grey-9 no-border-radius full-width",attrs:{size:e.$q.platform.is.desktop?"1rem":"md",flat:""},on:{click:function(t){return e.changeSpeed(s)}}},[e._v("\n x"+e._s(s)+"\n ")])})),1)]),e.$q.platform.is.desktop?t("q-tooltip",[e._v("currentSpeed")]):e._e()],1),t("q-btn",{directives:[{name:"touch-hold",rawName:"v-touch-hold.noMouse",value:e.playRepeatClickHandler,expression:"playRepeatClickHandler",modifiers:{noMouse:!0}}],staticClass:"text-white",attrs:{color:"play"===e.currentStatus?"blue":"white",disable:e.max<=e.min,size:e.$q.platform.is.desktop?"1rem":"md",icon:"play"===e.currentStatus?e.repeatFlag?"mdi-repeat":"mdi-pause":"mdi-play",round:"",flat:""},on:{click:[e.playClickHandler,function(t){return t.ctrlKey?e.playRepeatClickHandler.apply(null,arguments):null}]}},[e.$q.platform.is.desktop?t("q-tooltip",[e._v("Play/Pause (Ctrl+Click to repeat)")]):e._e(),e.$q.platform.is.mobile?t("q-tooltip",[e._v("Play/Pause (Touch hold to repeat)")]):e._e()],1),t("q-btn",{staticClass:"text-white",attrs:{color:"white",disable:e.max<=e.min,size:e.$q.platform.is.desktop?"1rem":"md",icon:"mdi-stop",round:"",flat:""},on:{click:e.stop}},[e.$q.platform.is.desktop?t("q-tooltip",[e._v("Stop")]):e._e()],1)],1),t("div",{staticClass:"col-12 col-md relative-position"},[t("q-btn",{staticClass:"absolute-left text-white",attrs:{disable:e.max<=e.min||"data"===e.mode,icon:"mdi-skip-previous",size:e.$q.platform.is.desktop?"1rem":"md",round:"",flat:""},on:{click:function(t){return e.$emit("player-prev")}}},[e.$q.platform.is.desktop?t("q-tooltip",[e._v("Prev message")]):e._e()],1),t("div",{staticClass:"player"},[t("div",{staticClass:"player__main"},[t("div",{ref:"playerContainer",staticClass:"player__container",staticStyle:{transform:"translate3d(0,0,0)"}},[e.max>e.min&&"time"===e.mode?t("q-range",{attrs:{color:"white",min:e.min,max:e.max,step:1},model:{value:e.range,callback:function(t){e.range=t},expression:"range"}}):e._e(),t("div",{staticClass:"player__line cursor-pointer",class:{disabled:e.max<=e.min||"data"===e.mode},on:{click:e.clickLineHandler}},[t("div",{staticClass:"line line__disabled line__disabled--left",style:{width:100*(e.rangeMin-e.min)/(e.max-e.min)+"%"}}),t("div",{staticClass:"line line__active",style:{left:`${"time"===e.mode?e.current:0}%`,width:100-("time"===e.mode?e.current:0)-(e.max>0?100/e.max*(e.max-e.rangeMax):0)+"%"}}),t("div",{staticClass:"line line__disabled line__disabled--right",style:{width:100/(e.max-e.min)*(e.max-e.rangeMax)+"%"}})]),t("div",{directives:[{name:"touch-pan",rawName:"v-touch-pan.horizontal.mouse",value:e.dragPlayerControl,expression:"dragPlayerControl",modifiers:{horizontal:!0,mouse:!0}}],staticClass:"player__control cursor-pointer",class:{"player__control--mobile":e.$q.platform.is.mobile,"player__control--disabled":e.max<=e.min||"data"===e.mode,disabled:e.max<=e.min||"data"===e.mode},style:{left:`${"time"===e.mode?e.current:0}%`}})],1)])]),t("q-btn",{staticClass:"absolute-right text-white",attrs:{disable:e.max<=e.min||"data"===e.mode,icon:"mdi-skip-next",size:e.$q.platform.is.desktop?"1rem":"md",round:"",flat:""},on:{click:function(t){return e.$emit("player-next")}}},[e.$q.platform.is.desktop?t("q-tooltip",[e._v("Next message")]):e._e()],1)],1)])},ae=[],ne=s("b047c"),re=s.n(ne),oe=s("0f32"),le=s.n(oe),ce={name:"Player",props:["min","max","value","status","speed","mode","needShowMessages"],data(){return{currentStatus:this.status,currentValue:this.value,rangeMin:this.min,rangeMax:this.max,timer:0,currentMode:this.mode,currentSpeed:this.speed,percentsByPixel:0,current:0,repeatFlag:!1}},computed:{range:{get(){return{min:this.rangeMin,max:this.rangeMax}},set(e){this.pause(),this.currentValue<=e.min&&(this.currentValue=e.min),this.currentValue>e.max&&(this.currentValue=e.max,this.end()),this.rangeMin=e.min,this.rangeMax=e.max}}},mounted(){this.$refs.playerContainer&&(this.percentsByPixel=100/this.$refs.playerContainer.offsetWidth)},watch:{currentValue:le()((function(e){this.$emit("input",Math.round(e))}),100,{trailing:!0}),currentSpeed:re()((function(e){this.$refs.currentSpeedPopover.hide(),"play"===this.currentStatus&&(this.pause(),this.$nextTick(this.play))}),100),value(e){const t=(e-this.min)/(this.max-this.min)*100;if(this.checkNeedRedraw(t),e===this.currentValue)return!1;this.currentValue=e},min(e,t){this.rangeMin===t&&(this.rangeMin=e)},max(e,t){this.rangeMax===t&&(this.rangeMax=e)},status(e,t){e!==this.currentStatus&&(this.currentStatus=e,"play"!==e&&"pause"!==e||this.playClickHandler(),"stop"===e&&this.stop())},mode(e){this.currentMode=e,this.current=0,this.currentValue=this.min,this.timer&&clearInterval(this.timer)}},methods:{checkNeedRedraw(e){Math.abs(e-this.current)>=this.percentsByPixel&&(this.current=e)},playRepeatClickHandler(){this.repeatFlag=!this.repeatFlag,"pause"===this.currentStatus&&this.playClickHandler()},playClickHandler(){switch(this.currentStatus){case"stop":case"pause":this.play();break;case"play":this.pause();break}},emit(e){status!==this.currentStatus&&this.$emit(`player-${e}`)},stop(){this.timer&&(clearInterval(this.timer),this.timer=0,"play"===this.currentStatus&&(this.currentStatus="stop",this.currentValue=this.min)),this.emit("stop")},changeCurrent(){const e=this.currentValue+1;if(e>this.rangeMax)return this.pause(),!1;this.currentValue=e},changeSpeed(e){this.currentSpeed=e,this.$emit("player-speed",e)},play(){"pause"!==this.currentStatus&&"stop"!==this.currentStatus||(this.currentStatus="play",this.emit("play")),this.currentValue===this.max&&(this.currentValue=this.min),this.timer=setInterval(this.changeCurrent,1e3/this.currentSpeed)},pause(){if(this.repeatFlag&&this.currentValue===this.max)return setTimeout((()=>{this.currentValue=this.min}),600),!1;this.timer&&(clearInterval(this.timer),this.timer=0,"play"===this.currentStatus&&(this.end(),this.currentStatus="pause",this.emit("pause")))},end(){this.value!==this.currentValue&&setTimeout((()=>{this.$emit("input",this.currentValue)}),100)},getPlayerParams(){const e=this.$refs.playerContainer,t=e.getBoundingClientRect().left,s=e.offsetWidth,i=s/(this.max-this.min);return{left:t,width:s,step:i}},dragPlayerControl(e){if(this.max<=this.min||"data"===this.mode)return!1;const{left:t,step:s}=this.getPlayerParams();let i=this.min+(e.position.left-t)/s;ithis.rangeMax&&(i=this.rangeMax),this.currentValue=e.isFinal?Math.round(i):i},clickLineHandler(e){if(this.max<=this.min||"data"===this.mode)return!1;const t=e.clientX,{left:s,step:i}=this.getPlayerParams(),a=this.min+(t-s)/i;if(this.currentValue!==a){if(athis.rangeMax)return!1;this.currentValue=Math.round(a)}}},beforeDestroy(){this.stop()}},de=ce,he=(s("81e1"),s("4e73")),me=s("7bbf"),pe=s("c1d0"),ge=s("f449"),ue=s("75c3"),ve=Object(p["a"])(de,ie,ae,!1,null,null,null),fe=ve.exports;w()(ve,"components",{QBtn:g["a"],QTooltip:u["a"],QMenu:he["a"],QRange:me["a"],QSlider:pe["a"]}),w()(ve,"directives",{TouchHold:ge["a"],TouchPan:ue["a"]});var ye={name:"QueueItem",props:["id","messages","date","needShowMessages","needShowPlayer","player"],data(){return{playerMode:this.player.mode||"time",playerValue:0,playerStatus:"stop",playerHeight:0,activeMessagesIndexes:[],messagesFlag:this.needShowMessages}},computed:{timeRange(){return this.messages.length?{min:Math.floor(this.messages[0].timestamp),max:Math.floor(this.messages[this.messages.length-1].timestamp)}:{min:0,max:0}},indexesByTimestamp(){return this.messages.reduce(((e,t,s)=>{const i=Math.floor(t.timestamp);return e[i]||(e[i]=[]),e[i].push(s),e}),{})},height(){return this.needShowMessages&&this.needShowPlayer?`calc(22vh + ${this.playerHeight}px)`:this.needShowMessages&&!this.needShowPlayer?"22vh":!this.needShowMessages&&this.needShowPlayer?`${this.playerHeight}px`:"0vh"}},mounted(){this.$refs.playerResize&&this.$refs.playerResize.trigger()},methods:{getCurrentActiveTimestamp(){let e=0;const t=Object.keys(this.indexesByTimestamp);return t.every(((t,s)=>this.playerValue>=t&&(e=t,!0))),e},update(e){"time"===this.playerMode&&(this.$emit("player-value",{id:this.id,messagesIndexes:this.indexesByTimestamp[e]}),this.activeMessagesIndexes=this.indexesByTimestamp[e]||[])},playerNextHandler(){const e=Object.keys(this.indexesByTimestamp),t=e.indexOf(this.getCurrentActiveTimestamp());if(t===e.length-1)return this.$q.notify({message:"That`s last message",color:"info",position:"bottom-left"}),!1;this.playerValue=e[t+1]},playerPrevHandler(){const e=Object.keys(this.indexesByTimestamp),t=e.indexOf(this.getCurrentActiveTimestamp());if(0===t)return this.$q.notify({message:"That`s first message",color:"info",position:"bottom-left"}),!1;this.playerValue=e[t-1]},playerPlayHandler(){this.playerStatus="play",this.playerValue||(this.playerValue=Math.floor(this.messages[0].timestamp)),this.$emit("player-play",{id:this.id})},playerPauseHandler(){this.playerStatus="pause",this.$emit("player-pause",{id:this.id})},playerStopHandler(){this.playerStatus="stop",this.messages.length?this.playerValue=Math.floor(this.messages[0].timestamp):this.playerValue=0,this.$emit("player-stop",{id:this.id})},playerSpeedHandler(e){this.$emit("player-speed",{id:this.id,speed:e})},viewMessageHandler(){this.$refs.player&&"stop"!==this.playerStatus&&this.$refs.player.stop()},viewOnMapHandler(e){this.$emit("view-on-map",e)},switchShowMessages(){this.messagesFlag=!this.messagesFlag,this.$emit("change-need-show-messages",this.messagesFlag)},switchPlayerMode(){this.playerMode="data"===this.playerMode?"time":"data",this.$emit("player-mode",{mode:this.playerMode,id:this.id})},onResizePlayer(e){this.playerHeight=e.height}},watch:{playerValue(e,t){let s=0,i=!0;const a=Object.keys(this.indexesByTimestamp);a.every(((n,r)=>e>=n?(s=n,r===a.length-1&&(i=!1),!0):((t>=n||t\n \n \n \n `,a=`\n
${i}
\n ${s?`
${e}
`:""}\n `;return a}var Re=s("ef44");I(x);var Ve={name:"Map",props:["params","devicesColors","selectedDeviceId","isSelectedDeviceFollowed","activeDevices","delay","date"],data(){return{map:null,flyToZoom:15,isFlying:null,markers:{},tracks:{},telemetryDeviceId:-1,activeDevicesID:[],devicesState:{},selected:null,currentColorModel:"#fff",currentColorId:0,player:{currentMsgIndex:null,speed:10,status:"stop",mode:"time",tailInterval:0}}},computed:{...Object(r["d"])({messages(e){return this.activeDevicesID.reduce(((t,s)=>(t[s]=e.messages[s].messages.reduce(((e,t,s)=>(t["position.latitude"]&&t["position.longitude"]&&(this.params.needShowInvalidPositionMessages||!t.hasOwnProperty("position.valid")||t.hasOwnProperty("position.valid")&&!0===t["position.valid"])&&(Object.defineProperty(t,"x-flespi-message-index",{value:s,enumerable:!1}),e.push(t)),e)),[]),t)),{})},allMessages(e){return this.activeDevicesID.reduce(((t,s)=>(t[s]=e.messages[s].messages,t)),{})},telemetry:e=>e.telemetry}),color:{get(){return this.currentColorModel},set(e){this.updateColorHandler({id:this.currentColorId,color:e}),this.currentColorModel=e}},mapHeight(){let e="100%";return this.activeDevices.length?(this.params.needShowPlayer&&(e="calc(100% - 48px)"),e):e}},methods:{initMap(){if(!this.map){let t=x["tileLayer"]("//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{minZoom:3,noWrap:!0});this.map=x["map"]("map",{center:[51.50853,-.12574],zoom:3,maxBounds:[[90,-180],[-90,180]],layers:[t]}),this.map.addEventListener("zoom",(e=>{e.flyTo||(this.flyToZoom=e.target.getZoom())})),this.map.addEventListener("click",this.mapClickHandler);let s=x["tileLayer"]("//server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",{minZoom:3,noWrap:!0,attribution:"© ArcGIS"}),i=x["tileLayer"]("//{s}.tile.opentopomap.org/{z}/{x}/{y}.png",{minZoom:3,maxZoom:19,attribution:"Map data: © OpenStreetMap contributors, SRTM | Map style: © OpenTopoMap (CC-BY-SA)",noWrap:!0}),a=x["tileLayer"].wms("//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{layers:"semitransparent",transparent:"true",format:"image/png",maxZoom:21,opacity:.5});var e={OpenStreetMap:t,Satellite:s,OpenTopoMap:i};x["control"].layers(e,{"OpenStreetMaps (0.5)":a}).addTo(this.map),x["control"].polylineMeasure({position:"topleft",showBearings:!1,clearMeasurementsOnStop:!1,showUnitControl:!1,showClearControl:!0,measureControlTitleOn:"Turn on ruler",measureControlTitleOff:"Turn off ruler",tooltipTextFinish:"Click to finish line
",tooltipTextDelete:"Press SHIFT-key and click to delete point",tooltipTextMove:"Click and drag to move point
",tooltipTextResume:"
Press CTRL-key and click to resume line",tooltipTextAdd:"Press CTRL-key and click to add point"}).addTo(this.map)}},flyToWithHideTracks(e,t){const s=[];let i=!1;this.map.once("zoomstart",(e=>{this.isFlying=!0;const a=e.target._zoom;a!==t&&(i=!0,Object.keys(this.tracks).forEach((e=>{const t=this.tracks[e];t instanceof x["Polyline"]&&(t.tail&&t.tail instanceof x["Polyline"]&&this.map.hasLayer(t.tail)&&(this.map.removeLayer(t.tail),s.push(t.tail)),t.overview&&t.overview instanceof x["Polyline"]&&this.map.hasLayer(t.overview)&&(this.map.removeLayer(t.overview),s.push(t.overview)),t.overview&&this.map.hasLayer(t.overview)&&(this.map.removeLayer(t),s.push(t)))})))})),this.map.once("zoomend",(e=>{this.isFlying=!1,i&&s.forEach((e=>{this.map.addLayer(e)}))})),this.map.flyTo(e,t)},generateIcon(e,t,s){return x["divIcon"]({className:`my-div-icon icon-${e}`,iconSize:new x["Point"](20,35),html:Fe(t,s,this.params.needShowNamesOnMap)})},getAccuracyParams(e){const t=[e["position.latitude"],e["position.longitude"]],s=e["position.hdop"]||e["position.pdop"]||0,i={stroke:!0,color:"#444",weight:3,opacity:.5,fillOpacity:.15,fillColor:"#444",clickable:!1};return{position:t,accuracy:s,circleStyle:i}},updateMarkerDirection(e,t){if(t){const s=document.querySelector(`.icon-${e} .my-div-icon__inner`);s&&(s.style.transform=`rotate(${t||0}deg)`)}},updateMarker(e,t,s){this.updateMarkerDirection(e,s),this.markers[e].setLatLng(t).update()},initMarker(e,t,s){const i=this.messages[e][this.messages[e].length-1]["position.direction"]?this.messages[e][this.messages[e].length-1]["position.direction"]:0,a=this.tracks[e]&&this.tracks[e].options?this.tracks[e].options.color:this.markers[e]?this.markers[e].color:this.devicesColors[e];this.markers[e]=x["marker"](s,{icon:this.generateIcon(e,t,a),draggable:!1,title:t}),this.markers[e].id=e,this.markers[e].color=a;const{position:n,accuracy:r,circleStyle:o}=this.getAccuracyParams(this.messages[e][this.messages[e].length-1]);this.markers[e].accuracy=x["circle"](n,r,o),this.markers[e].accuracy.addTo(this.map),this.markers[e].addEventListener("add",(t=>{this.updateMarkerDirection(e,i),this.messages[e]&&this.messages[e].length&&(this.selectedDeviceId,parseInt(e))})),this.markers[e].addEventListener("click",(t=>{this.telemetryDeviceId=parseInt(e),this.$emit("update-telemetry-device-id",this.telemetryDeviceId)})),this.markers[e].addEventListener("move",(t=>{"stop"===this.player.status&&this.updateMarkerDirection(e,this.messages[e][this.messages[e].length-1]["position.direction"])})),this.markers[e].addEventListener("contextmenu",(t=>{this.currentColorId=e,this.currentColorModel=this.markers[e].color,this.$refs.colorModal.show()})),this.markers[e].addTo(this.map)},getLatLngArrByDevice(e){return this.messages[e]?this.messages[e].reduce(((e,t)=>(e.push([t["position.latitude"],t["position.longitude"]]),e)),[]):[]},onResize(){this.map&&this.map.invalidateSize()},removeMarker(e){this.markers[e]&&this.markers[e]instanceof x["Marker"]&&(this.removeFlags(e),this.map.removeLayer(this.markers[e].accuracy),this.markers[e].remove(),this.tracks[e].tail&&this.tracks[e].tail instanceof x["Polyline"]&&this.tracks[e].tail.remove(),this.tracks[e].overview&&this.tracks[e].overview instanceof x["Polyline"]&&this.tracks[e].overview.remove(),this.tracks[e].remove()),n["default"].delete(this.markers,e),n["default"].delete(this.tracks,e)},flyToDevice(e){const t=this.activeDevices.filter((t=>t.id===e)),s=t.length?t[0]:null;let i=s&&[];this.messages[e]&&this.messages[e].length&&(i=[this.messages[e][this.messages[e].length-1]["position.latitude"],this.messages[e][this.messages[e].length-1]["position.longitude"]]),i&&i.length?this.flyToWithHideTracks(i,this.flyToZoom):this.$q.notify({message:"No Position!",color:"warning",timeout:this.params.needShowMessages?500:2e3})},centerOnDevice(e,t){const s=this.activeDevices.filter((t=>t.id===e)),i=s.length?s[0]:null;let a=i&&[];this.messages[e]&&this.messages[e].length&&(a=[this.messages[e][this.messages[e].length-1]["position.latitude"],this.messages[e][this.messages[e].length-1]["position.longitude"]]),a.length?this.map.setView(a,t||14,{animation:!1}):this.$q.notify({message:"No Position!",color:"warning",timeout:this.params.needShowMessages?500:2e3})},generateFlag(e){let{id:t,status:s}=e||{},i=t?this.devicesColors[t]:"#e53935",a="map-marker-star-outline";return"start"===s?(i=Ne["a"].getBrand("primary"),a="map-marker-outline"):"stop"===s&&(i=Ne["a"].getBrand("positive"),a="map-marker-check"),x["divIcon"]({className:`my-flag-icon flag-${s}-${t}`,iconSize:new x["Point"](35,35),html:``})},addFlags(e){if(!this.markers[e])return!1;if(this.markers[e].flags||(this.markers[e].flags={start:{},stop:{}}),this.messages[e].length){const t=[this.messages[e][0]["position.latitude"],this.messages[e][0]["position.longitude"]],s=[this.messages[e][this.messages[e].length-1]["position.latitude"],this.messages[e][this.messages[e].length-1]["position.longitude"]];this.markers[e].flags.start=x["marker"](t,{icon:this.generateFlag({id:e,status:"start"})}),this.markers[e].flags.start.addTo(this.map),this.markers[e].flags.stop=x["marker"](s,{icon:this.generateFlag({id:e,status:"stop"})});const i=this.$store.state.messages[e].to<=Date.now();i&&this.markers[e].flags.stop.addTo(this.map)}},removeFlags(e){if(!this.markers[e]||!this.markers[e].flags||!(this.markers[e].flags.start instanceof x["Marker"])||!(this.markers[e].flags.stop instanceof x["Marker"]))return!1;this.markers[e].flags.start.remove(),this.markers[e].flags.stop.remove(),this.markers[e].flags=void 0},async getDeviceData(e){if(e){this.$store.state.messages[e].realtimeEnabled&&await this.$store.dispatch(`messages/${e}/unsubscribePooling`),this.$store.commit(`messages/${e}/clearMessages`);const s=this.date[0],i=this.date[1];if(this.$store.commit(`messages/${e}/setFrom`,s),this.$store.commit(`messages/${e}/setTo`,i),await this.$store.dispatch(`messages/${e}/get`),i>Date.now()){const t=await this.$store.dispatch(`messages/${e}/pollingGet`);t()}if(this.addFlags(e),!this.$store.state.messages[e].messages.length)try{this.devicesState[e].telemetryAccess=!0,await this.$store.dispatch("getInitDataByDeviceId",[e,this.params.needShowInvalidPositionMessages])}catch(t){t.response&&t.response.status&&403===t.response.status&&(this.devicesState[e].telemetryAccess=!1)}if(this.devicesState[e].initStatus=!0,!1===this.devicesState[e].messagesAccess&&!1===this.devicesState[e].telemetryAccess){const t=this.activeDevices.filter((t=>t.id===e))[0];Object.defineProperty(t,"x-flespi-no-access",{value:!0,enumerable:!1})}}},async initDevice(e){this.$q.loading.show(),e&&(this.$store.commit(`messages/${e}/setActive`,e),await this.$store.dispatch(`messages/${e}/getCols`,{actions:!0,etc:!0}),await this.getDeviceData(e)),n["default"].connector.socket.on("offline",(()=>{this.$store.commit(`messages/${e}/setOffline`)})),n["default"].connector.socket.on("connect",(()=>{this.$store.state.messages[e].offline&&(this.$store.commit(`messages/${e}/setReconnected`),this.$store.dispatch(`messages/${e}/getMissedMessages`))})),e===this.selectedDeviceId&&!0===this.devicesState[e].initStatus&&(this.telemetryDeviceId=parseInt(e),this.$emit("update-telemetry-device-id",this.telemetryDeviceId),this.centerOnDevice(e)),this.$q.loading.hide()},viewOnMapHandler(e){if(e["position.latitude"]&&e["position.longitude"]){const t=[e["position.latitude"],e["position.longitude"]],s=this.map.getZoom();this.map.messagePoint&&this.map.messagePoint.remove(),this.map.messagePoint=x["marker"](t,{icon:x["divIcon"]({className:"my-round-marker-wrapper",iconSize:new x["Point"](10,10),html:'
'})}),this.map.messagePoint.addTo(this.map),this.map.setView(t,s>12?s:12,{animation:!1})}else this.$q.notify({message:"No position",color:"warning",position:"bottom-left",icon:"mdi-alert-outline"})},playProcess(e,t){const s="data"===this.player.mode?0:1;switch(t){case"value":s?this.playerTimeValue(e):this.playerDataValue(e);break;case"play":if("play"===this.player.status)return;s?this.playerTimePlay(e):this.playerDataPlay(e);break;case"stop":if("stop"===this.player.status)return;s?this.playerTimeStop(e):this.playerDataStop(e);break;case"pause":if("pause"===this.player.status)return;s?this.playerTimePause(e):this.playerDataPause(e);break}},playerTimeValue({id:e,messagesIndexes:t}){if(!this.messages[e]||!t||"play"!==this.player.status)return!1;let s=0,i=null;const a=t[t.length-1],n=0,r=this.messages[e].slice(n,a+1),o=r.reduce(((e,t,s)=>("number"===typeof t["position.latitude"]&&"number"===typeof t["position.longitude"]&&(i=s,e.push([t["position.latitude"],t["position.longitude"]])),e)),[]);if(t.forEach((a=>{if(this.markers[e]&&this.markers[e]instanceof x["Marker"]){const n=this.messages[e][a],r=n&&"number"===typeof n["position.latitude"]&&"number"===typeof n["position.longitude"];if(this.player.currentMsgIndex=a,r){const i=[n["position.latitude"],n["position.longitude"]];if("play"===this.player.status&&0!==t[0]){let r=1e3/this.player.speed/t.length;if(0!==a){const t=this.messages[e][a-1].timestamp,i=n.timestamp,o=i-t;r=1e3*o/this.player.speed,s=o}r-=50,r?this.markers[e].slideTo(i,{duration:r}):this.markers[e].setLatLng(i).update(),this.updateMarkerDirection(e,n["position.direction"])}else this.markers[e].setLatLng(i).update(),this.updateMarker(e,i,n["position.direction"]);this.markers[e].accuracy.setRadius(this.getAccuracyParams(n).accuracy),this.markers[e].accuracy.setLatLng(i)}else{const t=this.messages[e][i],s=o[o.length-1];this.markers[e].setLatLng(s).update(),this.updateMarker(e,s,t["position.direction"]),this.markers[e].accuracy.setRadius(this.getAccuracyParams(t).accuracy),this.markers[e].accuracy.setLatLng(s)}}})),this.tracks[e]&&this.tracks[e]instanceof x["Polyline"]&&o.length){if(!this.tracks[e].tail||!(this.tracks[e].tail instanceof x["Polyline"]))return this.tracks[e].tail=x["polyline"](o,this.tracks[e].options),this.tracks[e].tail.addTo(this.map),this.tracks[e].tail.addEventListener("click",(t=>this.showMessageByTrackClick(t,e,this.tracks[e].tail))),!0;this.player.tailInterval&&clearTimeout(this.player.tailInterval),this.player.tailInterval=setTimeout((()=>{this.tracks[e].tail&&this.tracks[e].tail.setLatLngs(o)}),700*s/this.player.speed)}},playerTimePlay({id:e}){this.tracks[e]&&this.tracks[e]instanceof x["Polyline"]&&(this.tracks[e].remove(),this.player.status="play")},playerTimeStop({id:e}){if(this.tracks[e]&&this.tracks[e]instanceof x["Polyline"]){this.tracks[e].tail&&(this.tracks[e].tail.remove(),delete this.tracks[e].tail);const t=this.$store.state.messages[e].realtimeEnabled,s=t?this.messages[e].length-1:0,i=this.messages[e][s];this.$nextTick((()=>{this.player.currentMsgIndex=s?null:0})),this.player.status="stop",this.tracks[e].addTo(this.map);const a=[i["position.latitude"],i["position.longitude"]];this.updateMarker(e,a,i["position.direction"])}},playerTimePause({id:e}){this.player.status="pause"},playerDataValue({id:e}){},playerDataPlay({id:e}){if("pause"===this.player.status)return this.tracks[e].overview.snakeUnpause(),void(this.player.status="play");this.player.status="play",this.tracks[e].remove();const t=this.messages[e].map(((e,t)=>({lat:e["position.latitude"],lng:e["position.longitude"],dir:e["position.direction"],index:t})));if(t.length<2)return this.tracks[e].addTo(this.map),this.player.status="stop",void(this.player.currentMsgIndex=null);const s=x["polyline"](t,{snakingSpeed:20*this.player.speed,color:this.tracks[e].options.color});this.tracks[e].overview=s,this.tracks[e].overview.addEventListener("click",(t=>this.showMessageByTrackClick(t,e,this.tracks[e].overview))),s.addTo(this.map).snakeIn(),s.on("snake",(()=>{const i=s.getLatLngs(),a=i.slice(-1)[0],n=a.slice(-1)[0],r=t[i[0].length-1];this.updateMarker(e,n,r.dir),this.player.currentMsgIndex!==r.index&&(this.player.currentMsgIndex=r.index)})),s.on("snakeInEnd",(()=>{this.playerDataStop({id:e})}))},playerDataStop({id:e}){this.player.status="stop",this.tracks[e].overview&&(this.tracks[e].overview.remove(),delete this.tracks[e].overview),this.tracks[e]&&this.tracks[e]instanceof x["Polyline"]&&(this.tracks[e].addTo(this.map),this.tracks[e].addEventListener("click",(t=>this.showMessageByTrackClick(t,e,this.tracks[e]))));const t=this.messages[e].slice(-1)[0];if(this.player.currentMsgIndex=null,t){const s=[t["position.latitude"],t["position.longitude"]];this.updateMarker(e,s,t["position.direction"])}},playerDataPause({id:e}){"stop"!==this.player.status&&(this.player.status="pause",this.tracks[e].overview.snakePause())},playerSpeedChangeHandler({speed:e,id:t}){this.player.speed=e,"data"===this.player.mode&&"stop"!==this.player.status&&this.tracks[t].overview.setStyle({snakingSpeed:20*e})},playerModeChange({id:e,mode:t}){"stop"!==this.player.status&&("data"===t?this.playerTimeStop({id:e}):this.playerDataStop({id:e})),this.player.mode=t},updateColorHandler({id:e,color:t}){this.$emit("update-color",e,t)},updateDeviceColorOnMap(e,t){if(!this.tracks[e]||!(this.tracks[e]instanceof x["Polyline"])||!this.markers[e]||!(this.markers[e]instanceof x["Marker"]))return!1;this.tracks[e].setStyle({color:t}),this.tracks[e].tail&&this.tracks[e].tail.setStyle({color:t}),this.tracks[e].overview&&this.tracks[e].overview.setStyle({color:t}),this.markers[e].color=t,this.markers[e].setIcon(this.generateIcon(e,this.markers[e].options.title,t)),this.messages[e][this.messages[e].length-1]["position.direction"]&&this.updateMarkerDirection(e,this.messages[e][this.messages[e].length-1]["position.direction"])},registerModule(e){this.devicesState[e]={messagesAccess:!0},this.$store.registerModule(["messages",e],Object(Oe["a"])({Vue:n["default"],LocalStorage:this.$q.localStorage,name:{name:"messages",lsNamespace:`${this.$store.state.storeName}.cols`},errorHandler:t=>{t.response&&t.response.status&&403===t.response.status?this.devicesState[e].messagesAccess=!1:this.$store.commit("reqFailed",t)}}))},showMessageByTrackClick(e,t,s){e.originalEvent.view.L.DomEvent.stopPropagation(e);const i=this.messages[t],a=x["GeometryUtil"].closest(this.map,s,e.latlng),n=i.reduce(((e,t,s)=>{const n=t["position.latitude"],r=t["position.longitude"],o=i[s+1];if(!o)return e;const l=o["position.latitude"],c=o["position.longitude"],d=n>=a.lat&&l<=a.lat||n<=a.lat&&l>=a.lat,h=r>=a.lng&&c<=a.lng||r<=a.lng&&c>=a.lng;if(d&&h){const t=x["GeometryUtil"].distance(this.map,a,{lat:n,lng:r}),i=x["GeometryUtil"].distance(this.map,a,{lat:l,lng:c}),o=t>i?s+1:s;e.push(o)}return e}),[]),r=i[n.slice(-1)[0]]||{};this.viewOnMapHandler(r),this.$store.commit(`messages/${t}/setSelected`,n)},mapClickHandler(e){this.map.messagePoint&&this.map.messagePoint.remove(),this.activeDevicesID.forEach((e=>{this.$store.commit(`messages/${e}/clearSelected`)}))},updateOrInitDevice(e){if(!this.messages[e]||!this.messages[e].length)return this.markers[e]||(this.markers[e]={},this.markers[e].id=e,this.markers[e].color=this.devicesColors[e],this.tracks[e]={}),!1;if(!(this.markers[e]instanceof x["Marker"])&&!(this.tracks[e]instanceof x["Polyline"])){const t=this.activeDevices.filter((t=>t.id===parseInt(e)))[0].name||`#${e}`,s=[this.messages[e][this.messages[e].length-1]["position.latitude"],this.messages[e][this.messages[e].length-1]["position.longitude"]];if(this.initMarker(e,t,s),this.tracks[e]=x["polyline"](this.getLatLngArrByDevice(e),{weight:4,color:this.markers[e]?this.markers[e].color:this.getColorById(e)}).addTo(this.map),this.tracks[e].addEventListener("click",(t=>this.showMessageByTrackClick(t,e,this.tracks[e]))),Number.parseInt(e)===this.selected)if(this.messages[e].length>1){const t=this.tracks[e].getBounds();this.map.fitBounds(t)}else this.map.setView(s,14,{animation:!1})}if(!this.devicesState[e].messagesAccess)return!1;const t=this.getLatLngArrByDevice(e);if(this.isSelectedDeviceFollowed){const s=this.selectedDeviceId&&this.selectedDeviceId==e&&this.markers[this.selectedDeviceId]&&this.markers[this.selectedDeviceId]instanceof x["Marker"]?this.markers[this.selectedDeviceId].getLatLng():{},i=this.selectedDeviceId&&this.messages[this.selectedDeviceId]&&this.messages[this.selectedDeviceId].length&&s.lat&&s.lat!==this.messages[this.selectedDeviceId][this.messages[this.selectedDeviceId].length-1]["position.latitude"]&&s.lng&&s.lng!==this.messages[this.selectedDeviceId][this.messages[this.selectedDeviceId].length-1]["position.longitude"];if(i){const e=t[t.length-1];e&&this.centerOnDevice(this.selectedDeviceId,this.map.getZoom())}}t.length?(this.markers[e].setLatLng(t[t.length-1]).update(),this.markers[e].accuracy.setRadius(this.getAccuracyParams(this.messages[e][this.messages[e].length-1]).accuracy),this.markers[e].accuracy.setLatLng(t[t.length-1]),this.markers[e].setOpacity(1),this.tracks[e].setLatLngs(t)):(this.removeFlags(e),this.tracks[e].tail&&this.tracks[e].tail instanceof x["Polyline"]&&this.tracks[e].tail.remove(),this.tracks[e].overview&&this.tracks[e].overview instanceof x["Polyline"]&&this.tracks[e].overview.remove(),this.markers[e].accuracy&&this.map.removeLayer(this.markers[e].accuracy),this.map.removeLayer(this.tracks[e]),this.map.removeLayer(this.markers[e]),this.tracks[e]={},this.markers[e]={color:this.markers[e].color||void 0,id:e})},updateStateByMessages(e){if("play"===this.player.status||"pause"===this.player.status)return!1;const t=Object.keys(e),s=Object.keys(this.markers);if(!t.length)return Object.keys(this.markers).forEach((e=>{this.removeMarker(e)})),!1;if(t.length!t.includes(e)))[0];return this.removeMarker(e),!1}t.forEach((e=>this.updateOrInitDevice(e)))},updateStateByTelemetry(e){if(!Object.keys(e.telemetry).length)return!1;const t=e.deviceId;if(!this.devicesState[t].telemetryAccess)return!1;if(!this.messages||!this.messages[t]||!this.messages[t][0])return!1;if(this.messages[t].lenth>1||!this.messages[t][0]["x-flespi-inited-by-telemetry"])return!1;const s=Number.parseFloat(e.telemetry["position.latitude"].value),i=Number.parseFloat(e.telemetry["position.latitude"].ts),a=Number.parseFloat(e.telemetry["position.longitude"].value),n=Number.parseFloat(e.telemetry["position.longitude"].ts);if(Math.round(1e3*i)!==Math.round(1e3*n))return console.error("Wrong telemetry"),!1;if(!this.params.needShowInvalidPositionMessages&&e.telemetry["position.valid"]&&!1===e.telemetry["position.valid"].value&&Math.abs(Number.parseFloat(e.telemetry["position.valid"].ts-i)<.1))return!1;this.messages[t][0]["position.latitude"]=s,this.messages[t][0]["position.longitude"]=a,this.messages[t][0]["timestamp"]=i;const r=["direction","speed","altitude","valid","satellites","hdop","pdop"],o=["number","number","number","boolean","number","number","number"];for(let l=0;l50&&this.devicesState[t].telemetryTail.shift():this.devicesState[t].telemetryTail=[],this.devicesState[t].telemetryTail.push([s,a]),this.markers[t]instanceof x["Marker"]){const n=e.telemetry["position.direction"]&&Math.abs(Number.parseFloat(e.telemetry["position.direction"].ts))-i<.1?Number.parseInt(e.telemetry["position.direction"].value):0;this.updateMarkerDirection(t,n),this.markers[t].setLatLng([s,a]).update()}this.tracks[t]instanceof x["Polyline"]&&this.tracks[t].setLatLngs(this.devicesState[t].telemetryTail),this.isSelectedDeviceFollowed&&this.centerOnDevice(this.selectedDeviceId,this.map.getZoom())}},watch:{messages:{deep:!0,handler(e){this.debouncedUpdateStateByMessages(e)}},telemetry:{deep:!0,handler(e){if(this.devicesState[e.deviceId]&&this.devicesState[e.deviceId].messagesAccess)return!1;this.debouncedUpdateStateByTelemetry(e)}},activeDevices(e){const t=e.map((e=>e.id)),s=Object.keys(this.messages).map((e=>parseInt(e))),i=s.length>t.length?"remove":"add";switch(t.forEach((e=>{this.$store.state.messages[e]||(this.registerModule(e),this.$store.commit(`messages/${e}/setSortBy`,"timestamp"),this.$store.commit(`messages/${e}/setLimit`,0))})),this.activeDevicesID=t,i){case"remove":{const e=s.filter((e=>!t.includes(e)));1===e.length&&e[0]?this.$store.commit(`messages/${e[0]}/clear`):e.length===s.length&&e.forEach((e=>{this.$store.commit(`messages/${e}/clear`)})),e.forEach((e=>this.devicesState[e].initStatus=null));break}case"add":{const e=t.filter((e=>!s.includes(e)));e&&e.forEach((e=>{this.devicesState[e].initStatus=!1,this.initDevice(e)}));break}}this.map&&x["DomUtil"].hasClass(this.map._container,"crosshair-cursor-enabled")&&x["DomUtil"].removeClass(this.map._container,"crosshair-cursor-enabled")},selectedDeviceId(e){e&&this.devicesState[e]&&!0===this.devicesState[e].initStatus&&this.flyToDevice(e)},isSelectedDeviceFollowed(e){!0===e&&this.devicesState[this.selectedDeviceId]&&!0===this.devicesState[this.selectedDeviceId].initStatus&&this.centerOnDevice(this.selectedDeviceId,this.map.getZoom())},devicesColors:{deep:!0,handler(e,t){this.activeDevicesID.forEach((s=>{e[s]!==t[s]&&this.updateDeviceColorOnMap(s,e[s])}))}},"params.needShowNamesOnMap":function(e){Object.keys(this.markers).forEach((e=>{const t=this.activeDevices.filter((t=>t.id===parseInt(e)))[0],s=this.messages[e]&&this.messages[e].length?[this.messages[e][this.messages[e].length-1]["position.latitude"],this.messages[e][this.messages[e].length-1]["position.longitude"]]:[],i=t.name||`#${e}`;this.markers[e]instanceof x["Marker"]&&(this.markers[e].remove(),this.map.removeLayer(this.markers[e].accuracy),this.initMarker(e,i,s))}))},"params.needShowInvalidPositionMessages":function(){this.activeDevicesID.forEach((async e=>{await this.getDeviceData(e),e===this.selectedDeviceId&&this.centerOnDevice(e)}))},date(e,t){t&&(this.player.status="stop",this.player.currentMsgIndex=null,this.activeDevicesID.forEach((async e=>{await this.getDeviceData(e)})))},selected(e){if(!this.isFlying&&this.tracks[e]&&this.tracks[e]instanceof x["Polyline"]){const t=this.tracks[e].getBounds();this.map.fitBounds(t)}this.devicesState[e]&&this.devicesState[e].telemetryTail&&this.devicesState[e].telemetryTail.length>0&&(this.devicesState[e].telemetryTail=[])}},created(){this.debouncedUpdateStateByMessages=Object(ze["a"])(this.updateStateByMessages,100),this.debouncedUpdateStateByTelemetry=Object(ze["a"])(this.updateStateByTelemetry,5),this.activeDevicesID=this.activeDevices.map((e=>e.id)),this.activeDevicesID.forEach((e=>{this.registerModule(e),this.$store.commit(`messages/${e}/setSortBy`,"timestamp"),this.devicesState[e].initStatus=!1,this.initDevice(e)})),n["default"].connector.socket.on("offline",(()=>{this.$store.commit("setSocketOffline",!0)})),n["default"].connector.socket.on("connect",(()=>{this.$store.commit("setSocketOffline",!1)}))},destroyed(){n["default"].connector.socket.off("offline"),n["default"].connector.socket.off("connect"),this.activeDevicesID.forEach((async e=>{this.$store.unregisterModule(["messages",e])}))},mounted(){this.initMap()},components:{Queue:xe,ColorModal:Pe}},Be=Ve,Ee=(s("238f"),Object(p["a"])(Be,M,C,!1,null,null,null)),Qe=Ee.exports;w()(Ee,"components",{QResizeObserver:be["a"]});var Ae=function(){var e=this,t=e._self._c;return t("div",{staticStyle:{position:"relative",height:"100vh",overflow:"hidden"}},[t("q-list",{staticClass:"bg-grey-9 text-white",attrs:{dark:""}},[t("q-item",{staticStyle:{"line-height":"58px!important"},style:{height:`${e.listHeaderHeight}px`}},[t("q-item-section",{attrs:{avatar:""}},[t("q-btn",{staticStyle:{"margin-right":"15px"},attrs:{flat:"",round:"",small:"",icon:"mdi-chevron-left"},nativeOn:{click:function(t){return e.$emit("click-hide")}}})],1),t("q-item-section",[t("q-item-label",{staticClass:"text-bold text-white q-pa-none",staticStyle:{"font-size":"1.3rem"},attrs:{header:""}},[e._v("Devices")])],1),t("q-item-section",{attrs:{side:""}},[e.$q.platform.is.desktop?t("q-btn",{staticClass:"text-grey",class:{unpinned:!e.devicesListPinned},attrs:{flat:"",round:"",small:"",icon:e.devicesListPinned?"mdi-pin":"mdi-pin-outline"},on:{click:function(t){return e.$emit("devices-list-pinned",!e.devicesListPinned)}}},[e.devicesListPinned?t("q-tooltip",[e._v("Unpin devices list")]):t("q-tooltip",[e._v("Pin devices list")])],1):e._e()],1)],1),t("div",{ref:"activeDevicesList",staticStyle:{overflow:"auto"},style:{"max-height":`${e.activeDevicesMaxHeight}px`}},[t("q-resize-observer",{on:{resize:e.onResizeActiveDevicesList}}),e._l(e.classifiedDevices.active,(function(s){return t("device",{key:s.id,staticClass:"with-separator",attrs:{isActive:!0,device:s,deviceColor:e.devicesColors[s.id+""],activeDevicesID:e.activeDevicesID,isSelected:e.selectedDeviceId===s.id,isFollowed:e.selectedDeviceId===s.id&&!0===e.isFollowed},on:{"update-color":e.updateColorHandler,"select-device":function(t){return e.$emit("select-device",s.id)},"follow-selected-device":function(t){return e.$emit("follow-selected-device",!e.isFollowed)},"remove-device-from-active-list":e.deviceRemovedHandler,"device-in-devices-list-ckick":function(t){return e.$emit("device-in-devices-list-ckick")}}})}))],2),e.classifiedDevices.inactive.length?t("div",{staticStyle:{overflow:"auto"}},[t("q-item",{staticStyle:{"padding-top":"20px"},style:{height:`${e.devicesFilterHeight}px!important`}},[t("q-item-section",[t("div",{staticClass:"q-px-none"},[t("q-input",{attrs:{dense:"",dark:"",color:"white",outlined:"",label:"Filter","hide-bottom-space":""},model:{value:e.filter,callback:function(t){e.filter=t},expression:"filter"}})],1)])],1),t("VirtualList",{ref:"vlist",style:{height:`${e.inactiveDevicesHeight}px`},attrs:{size:e.deviceItemHeight,remain:e.itemsCount}},e._l(e.filteredInactiveDevices,(function(s){return t("device",{key:s.id,staticClass:"with-separator",attrs:{isActive:!1,device:s,activeDevicesID:e.activeDevicesID,isSelected:e.selectedDeviceId===s.id,isFollowed:e.selectedDeviceId===s.id&&!0===e.isFollowed},on:{"select-device":function(t){return e.$emit("select-device",s.id)},"follow-selected-device":function(t){return e.$emit("follow-selected-device",!e.isFollowed)},"device-in-devices-list-ckick":function(t){return e.$emit("device-in-devices-list-ckick")}}})})),1)],1):t("q-item",{style:{height:`${e.inactiveDevicesHeight+e.devicesFilterHeight}px`}},[t("q-item-label",{staticClass:"ellipsis text-bold",staticStyle:{width:"100%","text-align":"center"},attrs:{header:""}},[e._v("No inactive devices left")])],1)],1)],1)},Ue=[],Ye=function(){var e=this,t=e._self._c;return t("q-item",{directives:[{name:"touch-swipe",rawName:"v-touch-swipe.noMouse",value:e.removeDeviceHandler,expression:"removeDeviceHandler",modifiers:{noMouse:!0}}],staticClass:"device-item__hover",class:[e.isActive&&e.isSelected?"device-item__selected":"",e.device["x-flespi-no-access"]?"no-access-device":""],staticStyle:{"min-height":"71px"},attrs:{highlight:e.$q.platform.is.desktop,clickable:""},on:{click:e.deviceClickHandler}},[e.device["x-flespi-no-access"]?t("q-tooltip",[e._v("Device has no access to messages and telemetry")]):e._e(),t("div",{staticClass:"text-center absolute-top-left bg-grey-3 text-bold text-grey-9",staticStyle:{"font-size":"10px","min-width":"55px","padding-top":"1px","z-index":"1","border-radius":"0 0 3px 0","line-height":"10px"}},[e._v("\n #"+e._s(e.device.id)+"\n ")]),t("q-item-section",{staticStyle:{position:"relative"},attrs:{side:""}},[t("q-icon",{attrs:{size:"1.7rem",name:"mdi-developer-board"}}),e.isActive?t("div",{staticClass:"color-view q-mr-xs",staticStyle:{position:"absolute",top:"29px",right:"8px"},style:{backgroundColor:e.deviceColor?e.deviceColor:"#909090"},on:{click:function(t){return t.stopPropagation(),e.changeColorHandler(e.device.id)}}},[t("q-tooltip",[e._v("Change color")])],1):e._e()],1),t("q-item-section",[t("q-item-label",{staticClass:"ellipsis-2-lines q-pa-none",class:[e.isActive?"text-white":""],attrs:{header:""}},[e._v(e._s(e.device.name||""))])],1),e.isActive?t("q-item-section",{staticClass:"text-center",attrs:{side:""}},[t("q-item-label",[t("q-icon",{class:[e.isSelected?"icon__send-followed":"text-grey-5"],attrs:{size:"1.2rem",name:e.isFollowed?"mdi-crosshairs-gps":"mdi-crosshairs"},nativeOn:{click:function(t){return t.stopPropagation(),e.showOnMapButtonHandler.apply(null,arguments)}}},[e.isFollowed?t("q-tooltip",{model:{value:e.displayTooltip,callback:function(t){e.displayTooltip=t},expression:"displayTooltip"}},[e._v("Stop following device")]):t("q-tooltip",{model:{value:e.displayTooltip,callback:function(t){e.displayTooltip=t},expression:"displayTooltip"}},[e._v("Follow device on map")])],1)],1)],1):e._e(),e.isActive&&e.$q.platform.is.desktop?t("q-item-section",{staticClass:"hiding-cross"},[t("q-item-label",[t("q-icon",{attrs:{name:"mdi-close",size:"1.1rem"},nativeOn:{click:function(t){return t.stopPropagation(),e.removeDeviceHandler.apply(null,arguments)}}},[t("q-tooltip",[e._v("Remove from active devices list")])],1)],1)],1):e._e(),t("color-modal",{ref:"colorModal",model:{value:e.color,callback:function(t){e.color=t},expression:"color"}})],1)},We=[],Ze={props:["device","deviceColor","activeDevicesID","isActive","isSelected","isFollowed"],data(){return{displayTooltip:!1,currentColorModel:"#fff",currentColorId:0}},computed:{color:{get(){return this.currentColorModel},set(e){this.$emit("update-color",{id:this.currentColorId,color:e}),this.currentColorModel=e}}},methods:{deviceClickHandler(){this.isActive?this.isSelected||setTimeout((()=>{this.$emit("select-device",this.device.id)}),500):this.$store.commit("setActiveDevice",this.device.id),this.$emit("device-in-devices-list-ckick",this.isActive)},removeDeviceHandler(e){if(this.isActive){if(e&&e.direction&&"right"!==e.direction)return!1;this.$store.commit("unsetActiveDevice",this.device.id),this.$emit("remove-device-from-active-list")}},changeColorHandler(e){this.currentColorId=e,this.currentColorModel=this.deviceColor,this.$refs.colorModal.show()},showOnMapButtonHandler(){this.isSelected?setTimeout((()=>{this.$emit("follow-selected-device",!this.isFollowed)}),500):setTimeout((()=>{this.$emit("select-device",this.device.id)}),500),setTimeout((()=>{this.displayTooltip=!1}),500)}},components:{ColorModal:Pe}},Ge=Ze,Je=(s("5b5b"),s("66e5")),Ke=s("4074"),Xe=s("0170"),et=s("12c5"),tt=Object(p["a"])(Ge,Ye,We,!1,null,null,null),st=tt.exports;w()(tt,"components",{QItem:Je["a"],QTooltip:u["a"],QItemSection:Ke["a"],QIcon:B["a"],QItemLabel:Xe["a"]}),w()(tt,"directives",{TouchSwipe:et["a"]});var it=s("89c1"),at=s.n(it),nt={name:"DeviceList",data(){return{unsubscribeDevices:()=>{},itemsCount:0,viewportHeight:0,activeDevicesHeight:0,activeDevicesMaxHeight:0,inactiveDevicesHeight:0,listHeaderHeight:60,devicesFilterHeight:70,deviceItemHeight:71,filter:""}},props:["devices","devicesColors","activeDevicesID","selectedDeviceId","isFollowed","devicesListPinned"],components:{Device:st,VirtualList:at.a},computed:{classifiedDevices(){const e={active:[],inactive:[]};return this.devices.forEach((t=>{this.activeDevicesID.includes(t.id)?e.active.push(t):e.inactive.push(t)})),e},filteredInactiveDevices(){const e=this.filter.toLowerCase(),t=this.filter?this.classifiedDevices.inactive.filter((t=>t&&"undefined"!==typeof t.name&&null!==t.name&&t.name.toLowerCase().indexOf(e)>=0||t&&"undefined"!==typeof t.id&&null!==t.id&&(t.id+"").indexOf(e)>=0||t&&t.configuration&&"undefined"!==typeof t.configuration.ident&&null!==t.configuration.ident&&t.configuration.ident.toLowerCase().indexOf(e)>=0)):this.classifiedDevices.inactive;return t.sort(((e,t)=>{if(!e.name)return-1;if(!t.name)return 1;const s=e.name.toLowerCase(),i=t.name.toLowerCase();return s10*this.deviceItemHeight?10*this.deviceItemHeight:t,this.activeDevicesHeight=this.$refs.activeDevicesList?this.$refs.activeDevicesList.clientHeight:0,this.inactiveDevicesHeight=this.viewportHeight-this.listHeaderHeight-this.devicesFilterHeight-this.activeDevicesHeight,this.itemsCount=Math.ceil(this.inactiveDevicesHeight/this.deviceItemHeight)},onResizeActiveDevicesList(e){this.activeDevicesHeight=e.height,this.inactiveDevicesHeight=this.viewportHeight-this.listHeaderHeight-this.devicesFilterHeight-this.activeDevicesHeight,this.itemsCount=Math.ceil(this.inactiveDevicesHeight/this.deviceItemHeight)},deviceRemovedHandler(){this.inactiveDevicesHeight=this.inactiveDevicesHeight+this.deviceItemHeight,this.itemsCount=Math.ceil(this.inactiveDevicesHeight/this.deviceItemHeight)},updateColorHandler(e){this.$emit("update-color",e.id,e.color)}},watch:{activeDevicesID(){this.$refs.vlist&&this.$refs.vlist.forceRender()},"$q.screen.height":{immediate:!0,handler(e){this.onResizeScreen(e)}}}},rt=nt,ot=(s("84c3"),s("1c1c")),lt=s("27f9"),ct=Object(p["a"])(rt,Ae,Ue,!1,null,null,null),dt=ct.exports;w()(ct,"components",{QList:ot["a"],QItem:Je["a"],QItemSection:Ke["a"],QBtn:g["a"],QItemLabel:Xe["a"],QTooltip:u["a"],QResizeObserver:be["a"],QInput:lt["a"]});var ht=s("9224"),mt=s("b06b"),pt={data(){return{selectedDevice:{id:null,follow:!1},devicesColors:{},deviceIdForTelemetry:null,needShowList:!0,needShowTelemetry:!0,needHideNamesInMenu:!1,needHidePlayerInMenu:!1,needHideMessagesInMenu:!1,needHideInvalidInMenu:!1,params:{needShowMessages:!1,needShowInvalidPositionMessages:!1,needShowNamesOnMap:!0,needShowPlayer:!0},devicesListSettings:{opened:!1,pinned:!1},telemetrySettings:{inverted:!0,opened:!1},telemetrySearch:"",telemetryConfig:{propHistoryFlag:!0},version:ht.version,dateTheme:{color:"white",bgColor:"grey-9",modeSwitch:!1},isInit:n["default"].connector.socket.connected(),unsubscribeDevices:()=>{}}},computed:{...Object(r["d"])({token:e=>e.token,devices:e=>e.devices,isLoading:e=>e.isLoading,activeDevicesID(e){return e.activeDevicesID},hasDevicesInit:e=>e.hasDevicesInit,activeDevices:e=>e.devices.filter((t=>e.activeDevicesID.includes(t.id))),lastActiveDevicesUpdate(e){return this.activeDevicesID.reduce(((t,s)=>{const i=e.messages[s].messages.filter((e=>!!e["position.latitude"]&&!!e["position.longitude"]));return i.length?t[s]=Math.floor(1e3*i[i.length-1].timestamp):t[s]=0,t}),{})},errors:e=>e.errors,newNotificationCounter:e=>e.newNotificationCounter,deviceForTelemetry(e){return this.deviceIdForTelemetry?e.devices.filter((e=>e.id===this.deviceIdForTelemetry))[0]:{}}}),computedDevicesColors(){return Object.assign({},this.devicesColors)},date:{get(){return this.$store.state.date},set(e){this.$store.commit("setDate",e)}}},components:{DeviceList:dt,MapComponent:Qe,QTelemetry:$["a"],DateRangeModal:D},methods:{openURL:mt["a"],...Object(r["c"])(["clearToken","clearCurrentRegion","setDevicesInit","unsetDevicesInit","setActiveDevice","clearNotificationCounter","clearErrors"]),...Object(r["b"])(["getLastUpdatePosition","poolDevices"]),exitHandler(e){n["default"].connector.socket.off("error"),this.unsetDevicesInit(),this.clearToken(),this.clearCurrentRegion(),this.$router.push("/login")},layoutCkickHandler(e){this.devicesListSettings.opened&&(e.target.closest("#left-drawer")||this.devicesListSettings.pinned||this.devicesListOpenedHandler(!1))},devicesListPinnedHandler(e){this.devicesListSettings.pinned=e,Object(Re["b"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"devicesListSettings",value:this.devicesListSettings})},updateColorHandler(e,t){this.$set(this.devicesColors,e,t),Object(Re["b"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"colors",value:this.devicesColors})},devicesListOpenedHandler(e){this.devicesListSettings.opened=e,Object(Re["b"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"devicesListSettings",value:this.devicesListSettings})},updateSelectedDevice(e,t){if(this.selectedDevice.id=e,void 0!==t)return this.selectedDevice.follow=t,Object(Re["b"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"selected",value:this.selectedDevice}),!1;const s=Object(Re["a"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"selected"});if(!s||!s.id||s.id!==e||void 0==s.follow)return this.selectedDevice.follow=!1,Object(Re["b"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"selected",value:this.selectedDevice}),!1;this.selectedDevice.follow=s.follow},selectDeviceInListHandler(e){e&&(this.updateTelemetryDeviceId(e),this.updateSelectedDevice(e,!0)),!this.$q.platform.is.mobile&&this.devicesListSettings.pinned||this.devicesListOpenedHandler(!1)},followSelectedDeviceHandler(e){this.updateSelectedDevice(this.selectedDevice.id,e)},deviceInListClickHandler(){!this.$q.platform.is.mobile&&this.devicesListSettings.pinned||this.devicesListOpenedHandler(!1)},paramsChangeHandler(e){Object(Re["b"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"params",value:this.params})},telemetryButtonClickHandler(){this.$set(this.telemetrySettings,"opened",!this.telemetrySettings.opened),Object(Re["b"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"telemetrySettings",value:this.telemetrySettings})},telemetryInvertedHandler(){this.$set(this.telemetrySettings,"inverted",!this.telemetrySettings.inverted),Object(Re["b"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"telemetrySettings",value:this.telemetrySettings})},updateTelemetryDeviceId(e){const t=this.devices.filter((t=>t.id===e));t.length?(this.deviceIdForTelemetry=e,this.updateSelectedDevice(e),this.telemetrySettings.opened&&this.deviceIdForTelemetry&&this.activeDevicesID.includes(this.deviceIdForTelemetry)&&setTimeout((()=>{if(e===this.selectedDevice.id&&this.$q.platform.is.mobile)return!1}),0)):this.deviceIdForTelemetry=null},queueCreatedHandler(){const e=Object(Re["a"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"selected"});e&&e.id&&this.activeDevicesID.length&&this.activeDevicesID.includes(e.id)?(this.selectedDevice.id=e.id,this.selectedDevice.follow=!!e.follow&&e.follow):this.activeDevicesID.length&&this.updateSelectedDevice(this.activeDevicesID[0],!1)},formatDate(e){return c["a"].formatDate(e,"DD/MM/YYYY")},initUserSelectionsFromLS(){const e=Object(Re["a"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"params"});e&&this.$set(this,"params",Object.assign(this.params,e));const t=Object(Re["a"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"telemetrySettings"});t&&this.$set(this,"telemetrySettings",Object.assign(this.telemetrySettings,t));const s=Object(Re["a"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"devicesListSettings"});s&&this.$set(this,"devicesListSettings",Object.assign(this.devicesListSettings,s));let i=Object(Re["a"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"colors"});i||(i={},Object(Re["b"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"colors",value:i}));const a="0123456789ABCDEF";this.activeDevicesID.forEach((e=>{if(!i[e]){let t=`#${a[Math.floor(5*Math.random())]}`;for(let e=0;e<5;e++)t+=a[Math.floor(15*Math.random())];i[e]=t,Object(Re["b"])({store:this.$q.localStorage,storeName:this.$store.state.storeName,name:"colors",value:i})}})),Object.keys(i).forEach((e=>{this.$set(this.devicesColors,e,i[e])}))},connectProcess(){this.isInit||(n["default"].connector.socket.on("connect",(()=>{this.isInit=!0,this.$q.loading.hide()})),this.$q.loading.show())},initDate(){this.getLastUpdatePosition().then((e=>{this.date=e}))},routeProcess(){const e=this.$route.query.from,t=this.$route.query.to,s=this.$route.query.hidelist||Object(Re["a"])({store:this.$q.sessionStorage,storeName:this.$store.state.storeName,name:"hidelist"}),i=this.$route.query.names||Object(Re["a"])({store:this.$q.sessionStorage,storeName:this.$store.state.storeName,name:"names"}),a=this.$route.query.player||Object(Re["a"])({store:this.$q.sessionStorage,storeName:this.$store.state.storeName,name:"player"}),n=this.$route.query.messages||Object(Re["a"])({store:this.$q.sessionStorage,storeName:this.$store.state.storeName,name:"messages"}),r=this.$route.query.invalid||Object(Re["a"])({store:this.$q.sessionStorage,storeName:this.$store.state.storeName,name:"invalid"}),o=this.$route.query.telemetry||Object(Re["a"])({store:this.$q.sessionStorage,storeName:this.$store.state.storeName,name:"telemetry"}),l=this.$route.params.devices;if(e&&t?this.date=[1e3*e,1e3*t]:this.date[0]||this.date[1]||this.initDate(),s&&(Object(Re["b"])({store:this.$q.sessionStorage,storeName:this.$store.state.storeName,name:"hidelist",value:s}),this.needShowList="true"!==s),o&&(Object(Re["b"])({store:this.$q.sessionStorage,storeName:this.$store.state.storeName,name:"telemetry",value:o}),this.needShowTelemetry="false"!==o),i&&(this.needHideNamesInMenu=!0,Object(Re["b"])({store:this.$q.sessionStorage,storeName:this.$store.state.storeName,name:"names",value:i}),"true"===i?this.$set(this.params,"needShowNamesOnMap",!0):"false"===i&&this.$set(this.params,"needShowNamesOnMap",!1),this.paramsChangeHandler()),a&&(this.needHidePlayerInMenu=!0,Object(Re["b"])({store:this.$q.sessionStorage,storeName:this.$store.state.storeName,name:"player",value:a}),"true"===a?this.$set(this.params,"needShowPlayer",!0):"false"===a&&this.$set(this.params,"needShowPlayer",!1),this.paramsChangeHandler()),n&&(this.needHideMessagesInMenu=!0,Object(Re["b"])({store:this.$q.sessionStorage,storeName:this.$store.state.storeName,name:"messages",value:n}),"true"===n?this.$set(this.params,"needShowMessages",!0):"false"===n&&this.$set(this.params,"needShowMessages",!1),this.paramsChangeHandler()),r&&(this.needHideInvalidInMenu=!0,Object(Re["b"])({store:this.$q.sessionStorage,storeName:this.$store.state.storeName,name:"invalid",value:r}),"true"===r?this.$set(this.params,"needShowInvalidPositionMessages",!0):"false"===r&&this.$set(this.params,"needShowInvalidPositionMessages",!1),this.paramsChangeHandler()),l){const e=l.split(",").map((e=>+e));e.forEach((e=>{this.setActiveDevice(e)}))}},loginProcess(){this.$route.params.token?this.$router.push(`/login/${this.$route.params.token}`):this.$router.push("/login")}},watch:{token(e){e||this.$router.push("/login")},hasDevicesInit(e){e?this.$q.loading.hide():this.$q.loading.show()},activeDevicesID(e){if(e.length){if(!e.includes(this.selectedDevice.id)){const t=e.toSorted(((e,t)=>e-t));let s=t.length-1;const i=t.findIndex((e=>e>this.selectedDevice.id));i>0&&(s=i),this.updateTelemetryDeviceId(t[s])}}else this.deviceIdForTelemetry=null,this.updateSelectedDevice(null,!1)},devices(e,t){e.length||(this.telemetrySettings.opened=!1)}},created(){if(this.$store.state.telemetry||this.$store.registerModule("telemetry",Object($["b"])(this.$store,n["default"])),this.clearNotificationCounter(),this.clearErrors(),this.routeProcess(),!this.token)return this.loginProcess(),!1;this.connectProcess(),this.poolDevices().then((e=>{this.unsubscribeDevices=e})),this.activeDevicesID.length&&this.$router.push(`/devices/${this.activeDevicesID.join(",")}`),this.initUserSelectionsFromLS()},destroyed(){this.unsubscribeDevices&&this.unsubscribeDevices(),n["default"].connector.socket.off("connect")}},gt=pt,ut=(s("6f40"),s("4d5a")),vt=s("9404"),ft=s("09e3"),yt=s("9989"),kt=s("6ac5"),bt=s("65c6"),_t=s("b047"),wt=s("9564"),St=Object(p["a"])(gt,i,a,!1,null,null,null);t["default"]=St.exports;w()(St,"components",{QLayout:ut["a"],QDrawer:vt["a"],QItem:Je["a"],QItemSection:Ke["a"],QBtn:g["a"],QItemLabel:Xe["a"],QTooltip:u["a"],QIcon:B["a"],QInput:lt["a"],QPageContainer:ft["a"],QPage:yt["a"],QToolbarTitle:kt["a"],QToolbar:bt["a"],QChip:_t["a"],QMenu:he["a"],QList:ot["a"],QToggle:wt["a"],QDialog:v["a"]})},f273:function(e,t,s){}}]); \ No newline at end of file diff --git a/js/app.37e2f630.js b/js/app.f2f2cde0.js similarity index 99% rename from js/app.37e2f630.js rename to js/app.f2f2cde0.js index e9dfd312..16672aa0 100644 --- a/js/app.37e2f630.js +++ b/js/app.f2f2cde0.js @@ -1 +1 @@ -(function(e){function t(t){for(var o,a,r=t[0],c=t[1],l=t[2],u=0,d=[];u{this.$store.dispatch("checkConnection")}),5e3)}},oe=ne,ae=(n("8059"),n("2877")),ie=Object(ae["a"])(oe,ee,te,!1,null,null,null),se=ie.exports,re={name:"App",components:{Offline:se}},ce=re,le=Object(ae["a"])(ce,Y,Z,!1,null,null,null),ue=le.exports,de=n("2f62"),fe=(n("14d9"),n("9b02")),pe=n.n(fe);async function ve({state:e,commit:t}){t("reqStart");try{if(e.token){const e=await o["default"].connector.poolDevices((e=>{t("setDevices",e)}),((e,n)=>{t("updateDevices",{type:e,device:n})}));return async()=>{await o["default"].connector.poolDevicesStop(e)}}}catch(n){t("reqFailed",n)}}async function ge({state:e,commit:t}){try{const n=await o["default"].connector.http.external.get(`./icons/favicon-16x16.png?_=${(new Date).getTime()}`);200===n.status&&e.offline&&t("setOfflineFlag",!1)}catch(n){0,e.offline||t("setOfflineFlag",!0)}}async function me({commit:e,state:t},n){let a=(new Date).setHours(0,0,0,0),i=a+86399999.999;if(t.token){const s=n||t.activeDevicesID.join(",");let r;if(s){const t=await o["default"].connector.gw.getDevicesTelemetry(s,"position.latitude,position.longitude"),n=t.data;n.errors&&postMessage.errors.forEach((t=>{e("addError",t.reason)}));const a=Math.max(...n.result.reduce(((e,t)=>(e.push(t.telemetry&&t.telemetry["position.latitude"]?Math.floor(1e3*t.telemetry["position.latitude"].ts):0),e.push(t.telemetry&&t.telemetry["position.longitude"]?Math.floor(1e3*t.telemetry["position.longitude"].ts):0),e)),[]));r=a||Date.now()}else r=Date.now();a=new Date(r).setHours(0,0,0,0),i=a+86399999.999}return[a,i]}async function he({commit:e,state:t},[n,a]){if(!t.token)return;const i=await o["default"].connector.gw.getDevicesTelemetry(n,"position,ident"),s=i.data;s.errors&&postMessage.errors.forEach((t=>{e("addError",t.reason)}));const r=s&&s.result[0]&&s.result[0].telemetry&&s.result[0].telemetry.position&&s.result[0].telemetry.position.value?s.result[0].telemetry.position.value:{},c=Object.keys(r);if(!c.length)return!1;if(!a&&void 0!==r["valid"]&&!1===r["valid"])return!1;const l=c.reduce(((e,t)=>(e["position."+t]=r[t],e)),{});s.result[0].telemetry.position.ts&&(l.timestamp=s.result[0].telemetry.position.ts),s.result[0].telemetry.ident&&s.result[0].telemetry.ident.value&&(l.ident=s.result[0].telemetry.ident.value),Object.defineProperty(l,"x-flespi-inited-by-telemetry",{value:!0,enumerable:!1}),e(`messages/${n}/setHistoryMessages`,[l])}async function be({state:e,commit:t}){try{"undefined"!==typeof e.isLoading&&o["default"].set(e,"isLoading",!0);const n=await o["default"].connector.http.get("/auth/regions");let a=pe()(n,"data.result",[]),i=null;a=a.reduce(((e,t)=>(t.default&&(i=t),e[t.name]=t,e)),{}),i&&t("setCurrentRegion",i),t("setRegions",a)}catch(n){t("reqFailed",n),"undefined"!==typeof e.isLoading&&o["default"].set(e,"isLoading",!1)}}async function ye({state:e,commit:t},{region:n,token:a}){try{"undefined"!==typeof e.isLoading&&o["default"].set(e,"isLoading",!0),e.regions||await be({state:e,commit:t}),n&&t("setCurrentRegion",e.regions[n]),o["default"].prototype.$flespiServer=e.currentRegion.rest,o["default"].prototype.$flespiSocketServer=`wss://${e.currentRegion["mqtt-ws"]}`,o["default"].prototype.$flespiCDN=e.currentRegion.cdn,o["default"].connector.setRegion(e.currentRegion),t("setToken",a)}catch(i){t("reqFailed",i),"undefined"!==typeof e.isLoading&&o["default"].set(e,"isLoading",!1)}}var we={poolDevices:ve,checkConnection:ge,getLastUpdatePosition:me,getInitDataByDeviceId:he,getRegions:be,initConnection:ye},ke=n("8c4f"),De=[{path:"/",component:()=>Promise.all([n.e(0),n.e(1)]).then(n.bind(null,"f241")),children:[{path:"devices/:devices",component:()=>Promise.all([n.e(0),n.e(1)]).then(n.bind(null,"f241"))}]},{path:"/token/:token",component:()=>Promise.all([n.e(0),n.e(2)]).then(n.bind(null,"013f"))},{path:"/login",component:()=>Promise.all([n.e(0),n.e(2)]).then(n.bind(null,"013f"))},{path:"/login/:token",component:()=>Promise.all([n.e(0),n.e(2)]).then(n.bind(null,"013f"))},{path:"/login/:token/devices/:devices",component:()=>Promise.all([n.e(0),n.e(1)]).then(n.bind(null,"f241"))},{path:"*",component:()=>Promise.all([n.e(0),n.e(4)]).then(n.bind(null,"e51e"))}];o["default"].use(ke["a"]);const Oe=new ke["a"]({mode:"hash",base:"",scrollBehavior:()=>({y:0}),routes:De});var Qe=Oe,Ce=n("ef44");function Ie(e){0}function Se(e,{type:t,payload:n}){const{result:a}=n;switch(t){case"postMessage":K["a"].create({message:`Post message to devices with IDs ${a} success`,type:"positive",icon:"alarm_add",timeout:2500,bgColor:"white"});break;default:JSON.stringify(e[t])!==JSON.stringify(a)&&o["default"].set(e,t,a)}}function Ne(e,t){if(JSON.stringify(e.devices)!==JSON.stringify(t.data.result)&&o["default"].set(e,"devices",t.data.result),!e.hasDevicesInit)if(e.activeDevicesID.length)e.activeDevicesID.forEach((n=>{t.data.result.filter((e=>e.id===n)).length||Ae(e,n)})),$e(e);else{$e(e);const n=Object(Ce["a"])({store:G["a"],storeName:e.storeName,name:"active"});n&&n.length&&n.forEach((n=>{t.data.result.filter((e=>e.id===n)).length&&xe(e,n)}))}}function je(e,t){switch(t.type){case"created":e.devices.push(t.device);break;case"updated":e.devices.some(((n,o)=>n.id===t.device.id&&(e.devices[o]=Object.assign(e.devices[o],t.device),!0)));break;case"deleted":e.devices.some(((n,o)=>n.id===t.device.id&&(e.devices.splice(o,1),!0)));break}}function Pe(e,t){if(t.response&&t.response.status)switch(t.response.status){case 0:Te(e,!0),qe(e),o["default"].set(e,"token","");break;case 401:Le(e);break;default:t.response.data&&t.response.data.errors&&t.response.data.errors.length&&t.response.data.errors.forEach((t=>{Re(e,t.reason)}))}else if(t.code&&t.message)switch(t.code){case 2:case 134:case 135:e.token&&Le(e),Re(e,t.message);break}else Re(e,t.message)}function Te(e,t){o["default"].set(e,"offline",t)}function Ee(e,t){let n=t.replace("FlespiToken ","");t&&n.match(/^[a-z0-9]+$/i)?(o["default"].connector.token=`FlespiToken ${n}`,Object(Ce["b"])({store:W["a"],storeName:e.storeName,name:"token",value:n})):(n="",o["default"].connector.token="",Le(e)),o["default"].set(e,"token",n)}function Le(e){Object(Ce["b"])({store:W["a"],storeName:e.storeName,name:"token",value:null}),o["default"].connector.token="",e.socketOffline&&_e(e,!1),o["default"].set(e,"token","")}function xe(e,t){e.activeDevicesID.includes(t)||(e.activeDevicesID.push(t),Object(Ce["b"])({store:G["a"],storeName:e.storeName,name:"active",value:e.activeDevicesID}),e.hasDevicesInit&&Qe.push(`/devices/${e.activeDevicesID.join(",")}`).catch((e=>{})))}function Ae(e,t){const n=e.activeDevicesID.indexOf(t);e.activeDevicesID.splice(n,1),Object(Ce["b"])({store:G["a"],storeName:e.storeName,name:"active",value:e.activeDevicesID}),e.activeDevicesID.length?Qe.push(`/devices/${e.activeDevicesID.join(",")}`).catch((e=>{})):Qe.push("/").catch((e=>{}))}function $e(e){e.hasDevicesInit=!0}function qe(e){e.hasDevicesInit=!1,o["default"].set(e,"devices",[]),o["default"].set(e,"activeDevicesID",[])}function Re(e,t){if(!e.token)return!1;K["a"].create({color:"negative",icon:"warning",message:`${t}`,timeout:1e3}),e.newNotificationCounter++,e.errors.push(t)}function _e(e,t){o["default"].set(e,"socketOffline",t)}function Me(e){o["default"].set(e,"errors",[])}function Fe(e,t){e.regions=t}function Be(e,t){e.currentRegion=t,Object(Ce["b"])({store:W["a"],storeName:e.storeName,name:"region",value:t.name})}function He(e){e.currentRegion=null,Object(Ce["b"])({store:W["a"],storeName:e.storeName,name:"region",value:null})}function Je(e){e.newNotificationCounter=0}function Ve(e,t){e.date=t}var ze={reqStart:Ie,reqSuccessful:Se,reqFailed:Pe,setToken:Ee,clearToken:Le,setActiveDevice:xe,unsetActiveDevice:Ae,setDevicesInit:$e,unsetDevicesInit:qe,setOfflineFlag:Te,updateDevices:je,setDevices:Ne,setSocketOffline:_e,clearNotificationCounter:Je,addError:Re,clearErrors:Me,setRegions:Fe,setCurrentRegion:Be,clearCurrentRegion:He,setDate:Ve},Ke={},Ue={namespaced:!0},Ge={messages:Ue};o["default"].use(de["a"]);const We={token:"",devices:[],activeDevicesID:[],hasDevicesInit:!1,offline:!1,socketOffline:!1,isLoading:!1,newNotificationCounter:0,errors:[],date:[0,0],regions:null,currentRegion:null,storeName:"flespi-trackit-settings"},Xe=new de["a"].Store({state:We,actions:we,mutations:ze,getters:Ke,modules:Ge});var Ye=Xe,Ze=async function(){const e="function"===typeof Ye?await Ye({Vue:o["default"]}):Ye,t="function"===typeof Qe?await Qe({Vue:o["default"],store:e}):Qe;e.$router=t;const n={router:t,store:e,render:e=>e(ue),el:"#q-app"};return{app:n,store:e,router:t}},et=n("a925"),tt={failed:"Action failed",success:"Action was successful"},nt={"en-us":tt};o["default"].use(et["a"]);const ot=new et["a"]({locale:"en-us",fallbackLocale:"en-us",messages:nt});var at=({app:e})=>{e.i18n=ot},it=n("553c"),st=n.n(it),rt=n("9224");let ct="",lt="";-1!==window.location.pathname.indexOf("/trackit")&&(ct=`https://${window.location.host}`,lt=`wss://${window.location.host}`);const ut={protocolVersion:5,wsOptions:{objectMode:!1,perMessageDeflate:!0}},dt=`trackit-${rt["version"]}-${Math.random().toString(16).substr(2,8)}`,ft={socketConfig:{server:lt,clientId:dt,mqttSettings:ut},httpConfig:{server:ct||void 0,flespiApp:dt}};var pt=({Vue:e,store:t})=>{e.prototype.$authHost=ct||"https://flespi.io",e.prototype.$flespiServer=ct||"https://flespi.io",e.prototype.$flespiApp=dt,e.use(st.a,ft),e.connector.socket.on("error",(e=>{t.commit("reqFailed",e)})),window&&window.addEventListener("beforeunload",(()=>{e.connector.socket.close(!0)}))};const vt="";async function gt(){const{app:e,store:t,router:n}=await Ze();let a=!1;const i=e=>{a=!0;const t=Object(e)===e?n.resolve(e).route.fullPath:e;window.location.href=t},s=window.location.href.replace(window.location.origin,""),r=[at,pt];for(let l=0;!1===a&&l","private":true,"scripts":{"lint":"eslint --ext .js,.vue src","dev":"quasar dev -m spa","dev_local":"env NODE_LOCAL=local quasar dev -m spa","build":"quasar build -m spa","deploy":"rm -rf dist && npm run build && rm -rf deploy && mkdir deploy && cp -R dist/spa/* misc LICENSE package.json deploy && cp README.md deploy/README.md && node_modules/git-directory-deploy/bin/git-directory-deploy.sh -ddeploy -bgh-pages -rgit@git.gurtam.net:flespi/frontend/TrackIt.git && rm -rf deploy && git push github gh-pages"},"dependencies":{"@quasar/extras":"^1.5.2","core-js":"^3.14.0","datetimerangepicker":"github:flespi-software/DateTimeRangePicker","flespi-io-js":"github:flespi-software/flespi-io-js","leaflet":"^1.9.4","leaflet-geometryutil":"^0.10.3","leaflet.marker.slideto":"^0.2.0","leaflet.polylinemeasure":"github:ppete2/Leaflet.PolylineMeasure#9908e5a","lodash":"^4.17.21","moment":"^2.29.0","qtelemetry":"github:flespi-software/QTelemetry","quasar":"^1.15.20","qvirtualscroll":"github:flespi-software/QVirtualScroll","vue-draggable-resizable":"^2.3.0","vue-i18n":"^8.15.4","vue-virtual-scroll-list":"^1.4.6","vuedraggable":"^2.24.3"},"devDependencies":{"@quasar/app":"^2.2.10","babel-eslint":"^10.0.1","eslint":"^7.21.0","eslint-config-prettier":"^8.1.0","eslint-plugin-vue":"^7.7.0","eslint-webpack-plugin":"^2.4.0","git-directory-deploy":"^1.5.1"},"browserslist":["last 10 Chrome versions","last 10 Firefox versions","last 4 Edge versions","last 7 Safari versions","last 8 Android versions","last 8 ChromeAndroid versions","last 8 FirefoxAndroid versions","last 10 iOS versions","last 5 Opera versions"],"engines":{"node":">= 10.18.1","npm":">= 6.13.4","yarn":">= 1.21.1"}}')},ebea:function(e,t,n){},ef44:function(e,t,n){"use strict";function o({store:e,storeName:t,name:n}){const o=e.getItem(t);return o&&o[n]}function a({store:e,storeName:t,name:n,value:o}){let a=e.getItem(t);a||(a={}),o?a[n]=o:delete a[n],e.set(t,a)}n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return a}))}}); \ No newline at end of file +(function(e){function t(t){for(var o,a,r=t[0],c=t[1],l=t[2],u=0,d=[];u{this.$store.dispatch("checkConnection")}),5e3)}},oe=ne,ae=(n("8059"),n("2877")),ie=Object(ae["a"])(oe,ee,te,!1,null,null,null),se=ie.exports,re={name:"App",components:{Offline:se}},ce=re,le=Object(ae["a"])(ce,Y,Z,!1,null,null,null),ue=le.exports,de=n("2f62"),fe=(n("14d9"),n("9b02")),pe=n.n(fe);async function ve({state:e,commit:t}){t("reqStart");try{if(e.token){const e=await o["default"].connector.poolDevices((e=>{t("setDevices",e)}),((e,n)=>{t("updateDevices",{type:e,device:n})}));return async()=>{await o["default"].connector.poolDevicesStop(e)}}}catch(n){t("reqFailed",n)}}async function ge({state:e,commit:t}){try{const n=await o["default"].connector.http.external.get(`./icons/favicon-16x16.png?_=${(new Date).getTime()}`);200===n.status&&e.offline&&t("setOfflineFlag",!1)}catch(n){0,e.offline||t("setOfflineFlag",!0)}}async function me({commit:e,state:t},n){let a=(new Date).setHours(0,0,0,0),i=a+86399999.999;if(t.token){const s=n||t.activeDevicesID.join(",");let r;if(s){const t=await o["default"].connector.gw.getDevicesTelemetry(s,"position.latitude,position.longitude"),n=t.data;n.errors&&postMessage.errors.forEach((t=>{e("addError",t.reason)}));const a=Math.max(...n.result.reduce(((e,t)=>(e.push(t.telemetry&&t.telemetry["position.latitude"]?Math.floor(1e3*t.telemetry["position.latitude"].ts):0),e.push(t.telemetry&&t.telemetry["position.longitude"]?Math.floor(1e3*t.telemetry["position.longitude"].ts):0),e)),[]));r=a||Date.now()}else r=Date.now();a=new Date(r).setHours(0,0,0,0),i=a+86399999.999}return[a,i]}async function he({commit:e,state:t},[n,a]){if(!t.token)return;const i=await o["default"].connector.gw.getDevicesTelemetry(n,"position,ident"),s=i.data;s.errors&&postMessage.errors.forEach((t=>{e("addError",t.reason)}));const r=s&&s.result[0]&&s.result[0].telemetry&&s.result[0].telemetry.position&&s.result[0].telemetry.position.value?s.result[0].telemetry.position.value:{},c=Object.keys(r);if(!c.length)return!1;if(!a&&void 0!==r["valid"]&&!1===r["valid"])return!1;const l=c.reduce(((e,t)=>(e["position."+t]=r[t],e)),{});s.result[0].telemetry.position.ts&&(l.timestamp=s.result[0].telemetry.position.ts),s.result[0].telemetry.ident&&s.result[0].telemetry.ident.value&&(l.ident=s.result[0].telemetry.ident.value),Object.defineProperty(l,"x-flespi-inited-by-telemetry",{value:!0,enumerable:!1}),e(`messages/${n}/setHistoryMessages`,[l])}async function be({state:e,commit:t}){try{"undefined"!==typeof e.isLoading&&o["default"].set(e,"isLoading",!0);const n=await o["default"].connector.http.get("/auth/regions");let a=pe()(n,"data.result",[]),i=null;a=a.reduce(((e,t)=>(t.default&&(i=t),e[t.name]=t,e)),{}),i&&t("setCurrentRegion",i),t("setRegions",a)}catch(n){t("reqFailed",n),"undefined"!==typeof e.isLoading&&o["default"].set(e,"isLoading",!1)}}async function ye({state:e,commit:t},{region:n,token:a}){try{"undefined"!==typeof e.isLoading&&o["default"].set(e,"isLoading",!0),e.regions||await be({state:e,commit:t}),n&&t("setCurrentRegion",e.regions[n]),o["default"].prototype.$flespiServer=e.currentRegion.rest,o["default"].prototype.$flespiSocketServer=`wss://${e.currentRegion["mqtt-ws"]}`,o["default"].prototype.$flespiCDN=e.currentRegion.cdn,o["default"].connector.setRegion(e.currentRegion),t("setToken",a)}catch(i){t("reqFailed",i),"undefined"!==typeof e.isLoading&&o["default"].set(e,"isLoading",!1)}}var we={poolDevices:ve,checkConnection:ge,getLastUpdatePosition:me,getInitDataByDeviceId:he,getRegions:be,initConnection:ye},ke=n("8c4f"),De=[{path:"/",component:()=>Promise.all([n.e(0),n.e(1)]).then(n.bind(null,"f241")),children:[{path:"devices/:devices",component:()=>Promise.all([n.e(0),n.e(1)]).then(n.bind(null,"f241"))}]},{path:"/token/:token",component:()=>Promise.all([n.e(0),n.e(2)]).then(n.bind(null,"013f"))},{path:"/login",component:()=>Promise.all([n.e(0),n.e(2)]).then(n.bind(null,"013f"))},{path:"/login/:token",component:()=>Promise.all([n.e(0),n.e(2)]).then(n.bind(null,"013f"))},{path:"/login/:token/devices/:devices",component:()=>Promise.all([n.e(0),n.e(1)]).then(n.bind(null,"f241"))},{path:"*",component:()=>Promise.all([n.e(0),n.e(4)]).then(n.bind(null,"e51e"))}];o["default"].use(ke["a"]);const Oe=new ke["a"]({mode:"hash",base:"",scrollBehavior:()=>({y:0}),routes:De});var Qe=Oe,Ce=n("ef44");function Ie(e){0}function Se(e,{type:t,payload:n}){const{result:a}=n;switch(t){case"postMessage":K["a"].create({message:`Post message to devices with IDs ${a} success`,type:"positive",icon:"alarm_add",timeout:2500,bgColor:"white"});break;default:JSON.stringify(e[t])!==JSON.stringify(a)&&o["default"].set(e,t,a)}}function Ne(e,t){if(JSON.stringify(e.devices)!==JSON.stringify(t.data.result)&&o["default"].set(e,"devices",t.data.result),!e.hasDevicesInit)if(e.activeDevicesID.length)e.activeDevicesID.forEach((n=>{t.data.result.filter((e=>e.id===n)).length||Ae(e,n)})),$e(e);else{$e(e);const n=Object(Ce["a"])({store:G["a"],storeName:e.storeName,name:"active"});n&&n.length&&n.forEach((n=>{t.data.result.filter((e=>e.id===n)).length&&xe(e,n)}))}}function je(e,t){switch(t.type){case"created":e.devices.push(t.device);break;case"updated":e.devices.some(((n,o)=>n.id===t.device.id&&(e.devices[o]=Object.assign(e.devices[o],t.device),!0)));break;case"deleted":e.devices.some(((n,o)=>n.id===t.device.id&&(e.devices.splice(o,1),!0)));break}}function Pe(e,t){if(t.response&&t.response.status)switch(t.response.status){case 0:Te(e,!0),qe(e),o["default"].set(e,"token","");break;case 401:Le(e);break;default:t.response.data&&t.response.data.errors&&t.response.data.errors.length&&t.response.data.errors.forEach((t=>{Re(e,t.reason)}))}else if(t.code&&t.message)switch(t.code){case 2:case 134:case 135:e.token&&Le(e),Re(e,t.message);break}else Re(e,t.message)}function Te(e,t){o["default"].set(e,"offline",t)}function Ee(e,t){let n=t.replace("FlespiToken ","");t&&n.match(/^[a-z0-9]+$/i)?(o["default"].connector.token=`FlespiToken ${n}`,Object(Ce["b"])({store:W["a"],storeName:e.storeName,name:"token",value:n})):(n="",o["default"].connector.token="",Le(e)),o["default"].set(e,"token",n)}function Le(e){Object(Ce["b"])({store:W["a"],storeName:e.storeName,name:"token",value:null}),o["default"].connector.token="",e.socketOffline&&_e(e,!1),o["default"].set(e,"token","")}function xe(e,t){e.activeDevicesID.includes(t)||(e.activeDevicesID.push(t),Object(Ce["b"])({store:G["a"],storeName:e.storeName,name:"active",value:e.activeDevicesID}),e.hasDevicesInit&&Qe.push(`/devices/${e.activeDevicesID.join(",")}`).catch((e=>{})))}function Ae(e,t){const n=e.activeDevicesID.indexOf(t);e.activeDevicesID.splice(n,1),Object(Ce["b"])({store:G["a"],storeName:e.storeName,name:"active",value:e.activeDevicesID}),e.activeDevicesID.length?Qe.push(`/devices/${e.activeDevicesID.join(",")}`).catch((e=>{})):Qe.push("/").catch((e=>{}))}function $e(e){e.hasDevicesInit=!0}function qe(e){e.hasDevicesInit=!1,o["default"].set(e,"devices",[]),o["default"].set(e,"activeDevicesID",[])}function Re(e,t){if(!e.token)return!1;K["a"].create({color:"negative",icon:"warning",message:`${t}`,timeout:1e3}),e.newNotificationCounter++,e.errors.push(t)}function _e(e,t){o["default"].set(e,"socketOffline",t)}function Me(e){o["default"].set(e,"errors",[])}function Fe(e,t){e.regions=t}function Be(e,t){e.currentRegion=t,Object(Ce["b"])({store:W["a"],storeName:e.storeName,name:"region",value:t.name})}function He(e){e.currentRegion=null,Object(Ce["b"])({store:W["a"],storeName:e.storeName,name:"region",value:null})}function Je(e){e.newNotificationCounter=0}function Ve(e,t){e.date=t}var ze={reqStart:Ie,reqSuccessful:Se,reqFailed:Pe,setToken:Ee,clearToken:Le,setActiveDevice:xe,unsetActiveDevice:Ae,setDevicesInit:$e,unsetDevicesInit:qe,setOfflineFlag:Te,updateDevices:je,setDevices:Ne,setSocketOffline:_e,clearNotificationCounter:Je,addError:Re,clearErrors:Me,setRegions:Fe,setCurrentRegion:Be,clearCurrentRegion:He,setDate:Ve},Ke={},Ue={namespaced:!0},Ge={messages:Ue};o["default"].use(de["a"]);const We={token:"",devices:[],activeDevicesID:[],hasDevicesInit:!1,offline:!1,socketOffline:!1,isLoading:!1,newNotificationCounter:0,errors:[],date:[0,0],regions:null,currentRegion:null,storeName:"flespi-trackit-settings"},Xe=new de["a"].Store({state:We,actions:we,mutations:ze,getters:Ke,modules:Ge});var Ye=Xe,Ze=async function(){const e="function"===typeof Ye?await Ye({Vue:o["default"]}):Ye,t="function"===typeof Qe?await Qe({Vue:o["default"],store:e}):Qe;e.$router=t;const n={router:t,store:e,render:e=>e(ue),el:"#q-app"};return{app:n,store:e,router:t}},et=n("a925"),tt={failed:"Action failed",success:"Action was successful"},nt={"en-us":tt};o["default"].use(et["a"]);const ot=new et["a"]({locale:"en-us",fallbackLocale:"en-us",messages:nt});var at=({app:e})=>{e.i18n=ot},it=n("553c"),st=n.n(it),rt=n("9224");let ct="",lt="";-1!==window.location.pathname.indexOf("/trackit")&&(ct=`https://${window.location.host}`,lt=`wss://${window.location.host}`);const ut={protocolVersion:5,wsOptions:{objectMode:!1,perMessageDeflate:!0}},dt=`trackit-${rt["version"]}-${Math.random().toString(16).substr(2,8)}`,ft={socketConfig:{server:lt,clientId:dt,mqttSettings:ut},httpConfig:{server:ct||void 0,flespiApp:dt}};var pt=({Vue:e,store:t})=>{e.prototype.$authHost=ct||"https://flespi.io",e.prototype.$flespiServer=ct||"https://flespi.io",e.prototype.$flespiApp=dt,e.use(st.a,ft),e.connector.socket.on("error",(e=>{t.commit("reqFailed",e)})),window&&window.addEventListener("beforeunload",(()=>{e.connector.socket.close(!0)}))};const vt="";async function gt(){const{app:e,store:t,router:n}=await Ze();let a=!1;const i=e=>{a=!0;const t=Object(e)===e?n.resolve(e).route.fullPath:e;window.location.href=t},s=window.location.href.replace(window.location.origin,""),r=[at,pt];for(let l=0;!1===a&&l","private":true,"scripts":{"lint":"eslint --ext .js,.vue src","dev":"quasar dev -m spa","dev_local":"env NODE_LOCAL=local quasar dev -m spa","build":"quasar build -m spa","deploy":"rm -rf dist && npm run build && rm -rf deploy && mkdir deploy && cp -R dist/spa/* misc LICENSE package.json deploy && cp README.md deploy/README.md && node_modules/git-directory-deploy/bin/git-directory-deploy.sh -ddeploy -bgh-pages -rgit@git.gurtam.net:flespi/frontend/TrackIt.git && rm -rf deploy && git push github gh-pages"},"dependencies":{"@quasar/extras":"^1.5.2","core-js":"^3.14.0","datetimerangepicker":"github:flespi-software/DateTimeRangePicker","flespi-io-js":"github:flespi-software/flespi-io-js","leaflet":"^1.9.4","leaflet-geometryutil":"^0.10.3","leaflet.marker.slideto":"^0.2.0","leaflet.polylinemeasure":"github:ppete2/Leaflet.PolylineMeasure#9908e5a","lodash":"^4.17.21","moment":"^2.29.0","qtelemetry":"github:flespi-software/QTelemetry","quasar":"^1.15.20","qvirtualscroll":"github:flespi-software/QVirtualScroll","vue-draggable-resizable":"^2.3.0","vue-i18n":"^8.15.4","vue-virtual-scroll-list":"^1.4.6","vuedraggable":"^2.24.3"},"devDependencies":{"@quasar/app":"^2.2.10","babel-eslint":"^10.0.1","eslint":"^7.21.0","eslint-config-prettier":"^8.1.0","eslint-plugin-vue":"^7.7.0","eslint-webpack-plugin":"^2.4.0","git-directory-deploy":"^1.5.1"},"browserslist":["last 10 Chrome versions","last 10 Firefox versions","last 4 Edge versions","last 7 Safari versions","last 8 Android versions","last 8 ChromeAndroid versions","last 8 FirefoxAndroid versions","last 10 iOS versions","last 5 Opera versions"],"engines":{"node":">= 10.18.1","npm":">= 6.13.4","yarn":">= 1.21.1"}}')},ebea:function(e,t,n){},ef44:function(e,t,n){"use strict";function o({store:e,storeName:t,name:n}){const o=e.getItem(t);return o&&o[n]}function a({store:e,storeName:t,name:n,value:o}){let a=e.getItem(t);a||(a={}),o?a[n]=o:delete a[n],e.set(t,a)}n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return a}))}}); \ No newline at end of file diff --git a/package.json b/package.json index e9a1e12b..aa1b1de8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "track-it", - "version": "2.0.0", + "version": "2.0.1", "description": "A simple application based on flespi.io and built with Quasar and Leaflet.js. Allows tracking different devices on the map, viewing telemetry messages for these devices.", "productName": "TrackIt!", "capacitorId": "",