platypush/platypush/backend/http/webapp/dist/static/js/app-legacy.3e3e09b7.js

2 lines
59 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(function(){var e={5250:function(e,t,n){"use strict";n.d(t,{$:function(){return i}});var s=n(9652),i=(0,s.Z)()},5736:function(e,t,n){"use strict";n(6992),n(8674),n(9601),n(7727);var s=n(9963),i=n(6252);function r(e,t,n,s,r,a){var o=(0,i.up)("Events"),c=(0,i.up)("Notifications"),l=(0,i.up)("VoiceAssistant"),u=(0,i.up)("Pushbullet"),d=(0,i.up)("Ntfy"),f=(0,i.up)("router-view");return(0,i.wg)(),(0,i.iD)(i.HY,null,[a.hasWebsocket?((0,i.wg)(),(0,i.j4)(o,{key:0,ref:"events","ws-port":r.config["backend.http"].websocket_port},null,8,["ws-port"])):(0,i.kq)("",!0),(0,i.Wm)(c,{ref:"notifications"},null,512),a.hasAssistant?((0,i.wg)(),(0,i.j4)(l,{key:1,ref:"voice-assistant"},null,512)):(0,i.kq)("",!0),a.hasPushbullet?((0,i.wg)(),(0,i.j4)(u,{key:2,ref:"pushbullet"},null,512)):(0,i.kq)("",!0),a.hasNtfy?((0,i.wg)(),(0,i.j4)(d,{key:3,ref:"ntfy"},null,512)):(0,i.kq)("",!0),(0,i.Wm)(f)],64)}var a=n(8534),o=(n(5666),n(9254),{class:"notifications"});function c(e,t,n,s,r,a){var c=(0,i.up)("Notification");return(0,i.wg)(),(0,i.iD)("div",o,[((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(e.notifications,(function(e,t,n){return(0,i.wg)(),(0,i.j4)(c,{key:n,id:t,text:e.text,html:e.html,title:e.title,link:e.link,image:e.image,warning:e.warning,error:e.error,onClicked:a.destroy},null,8,["id","text","html","title","link","image","warning","error","onClicked"])})),128))])}n(9653);var l=n(3577),u=["textContent"],d={class:"body"},f={key:0,class:"image col-3"},p={class:"row"},h=["src"],m={key:3,class:"fa fa-exclamation"},g={key:4,class:"fa fa-times"},v=["textContent"],w=["innerHTML"],b=["textContent"],y=["innerHTML"];function k(e,t,n,s,r,a){return(0,i.wg)(),(0,i.iD)("div",{class:(0,l.C_)(["notification fade-in",{warning:n.warning,error:n.error}]),onClick:t[0]||(t[0]=function(){return a.clicked&&a.clicked.apply(a,arguments)})},[n.title?((0,i.wg)(),(0,i.iD)("div",{key:0,class:"title",textContent:(0,l.zw)(n.title)},null,8,u)):(0,i.kq)("",!0),(0,i._)("div",d,[n.image||n.warning||n.error?((0,i.wg)(),(0,i.iD)("div",f,[(0,i._)("div",p,[n.image&&n.image.src?((0,i.wg)(),(0,i.iD)("img",{key:0,src:n.image.src,alt:""},null,8,h)):n.image&&n.image.icon?((0,i.wg)(),(0,i.iD)("i",{key:1,class:(0,l.C_)(["fa","fa-"+n.image.icon]),style:(0,l.j5)(n.image.color?"--color: "+n.image.color:"")},null,6)):n.image&&n.image.iconClass?((0,i.wg)(),(0,i.iD)("i",{key:2,class:(0,l.C_)(n.image.iconClass),style:(0,l.j5)(n.image.color?"--color: "+n.image.color:"")},null,6)):n.warning?((0,i.wg)(),(0,i.iD)("i",m)):n.error?((0,i.wg)(),(0,i.iD)("i",g)):(0,i.kq)("",!0)])])):(0,i.kq)("",!0),n.text&&n.image?((0,i.wg)(),(0,i.iD)("div",{key:1,class:"text col-9",textContent:(0,l.zw)(n.text)},null,8,v)):(0,i.kq)("",!0),n.html&&n.image?((0,i.wg)(),(0,i.iD)("div",{key:2,class:"text col-9",innerHTML:n.html},null,8,w)):(0,i.kq)("",!0),n.text&&!n.image?((0,i.wg)(),(0,i.iD)("div",{key:3,class:"text row horizontal-center",textContent:(0,l.zw)(n.text)},null,8,b)):(0,i.kq)("",!0),n.html&&!n.image?((0,i.wg)(),(0,i.iD)("div",{key:4,class:"text row horizontal-center",innerHTML:n.html},null,8,y)):(0,i.kq)("",!0)])],2)}var x={name:"Notification",props:["id","text","html","title","image","link","error","warning"],methods:{clicked:function(){this.link&&window.open(this.link,"_blank"),this.$emit("clicked",this.id)}}},_=n(3744);const C=(0,_.Z)(x,[["render",k],["__scopeId","data-v-7646705e"]]);var D=C,I={name:"Notifications",components:{Notification:D},props:{duration:{type:Number,default:1e4}},data:function(){return{index:0,notifications:{},timeouts:{}}},methods:{create:function(e){var t=this.index++;this.notifications[t]=e,null==e.duration&&(e.duration=this.duration);var n=e.duration?parseInt(e.duration):0;n&&(this.timeouts[t]=setTimeout(this.destroy.bind(null,t),n))},destroy:function(e){delete this.notifications[e],delete this.timeouts[e]}}};const S=(0,_.Z)(I,[["render",c],["__scopeId","data-v-6dc8bebc"]]);var T=S,Z=n(6813);function U(e,t,n,s,r,a){return(0,i.wg)(),(0,i.iD)("div")}var R=n(6347),P=n(9584),M=(n(2479),n(2222),n(7941),n(5250)),N={name:"Events",props:{wsPort:{type:Number,default:8009}},data:function(){return{ws:null,initialized:!1,pending:!1,opened:!1,timeout:null,reconnectMsecs:3e4,handlers:{},handlerNameToEventTypes:{}}},methods:{onWebsocketTimeout:function(){console.log("Websocket reconnection timed out, retrying"),this.pending=!1,this.ws&&this.ws.close(),this.onClose()},onMessage:function(e){var t=[];if(e=e.data,"string"===typeof e)try{e=JSON.parse(e)}catch(r){console.warn("Received invalid non-JSON event"),console.warn(e)}if(console.debug(e),"event"===e.type){null in this.handlers&&t.push(this.handlers[null]),e.args.type in this.handlers&&t.push.apply(t,(0,P.Z)(Object.values(this.handlers[e.args.type])));for(var n=0,s=t;n<s.length;n++){var i=s[n];i&&(i instanceof Array?i=i[0]:i instanceof Object&&!(i instanceof Function)&&(i=Object.values(i)[0]),i(e.args))}}},onOpen:function(){this.opened&&(console.log("There's already an opened websocket connection, closing the newly opened one"),this.ws&&(this.ws.onclose=function(){},this.ws.close())),console.log("Websocket connection successful"),this.opened=!0,this.pending&&(this.pending=!1),this.timeout&&(clearTimeout(this.timeout),this.timeout=void 0)},onError:function(e){console.error("Websocket error"),console.error(e)},onClose:function(e){e&&console.log("Websocket closed - code: "+e.code+" - reason: "+e.reason),this.opened=!1,this.pending||(this.pending=!0,this.init())},init:function(){try{var e="https:"===location.protocol?"wss":"ws",t="".concat(e,"://").concat(location.hostname,":").concat(this.wsPort);this.ws=new WebSocket(t)}catch(n){return console.error("Websocket initialization error"),void console.error(n)}this.pending=!0,this.timeout=setTimeout(this.onWebsocketTimeout,this.reconnectMsecs),this.ws.onmessage=this.onMessage,this.ws.onopen=this.onOpen,this.ws.onerror=this.onError,this.ws.onclose=this.onClose,this.initialized=!0},subscribe:function(e){var t,n=this,s=e.handler,i=e.events.length?e.events:[null],r=e.handlerName,a=(0,R.Z)(i);try{for(a.s();!(t=a.n()).done;){var o=t.value;o in this.handlers||(this.handlers[o]={}),r in this.handlerNameToEventTypes||(this.handlerNameToEventTypes[r]=i),this.handlers[o][r]=s}}catch(c){a.e(c)}finally{a.f()}return function(){n.unsubscribe(r)}},unsubscribe:function(e){var t=this.handlerNameToEventTypes[e];if(t){var n,s=(0,R.Z)(t);try{for(s.s();!(n=s.n()).done;){var i,r=n.value;null!==(i=this.handlers[r])&&void 0!==i&&i[e]&&(delete this.handlers[r][e],Object.keys(this.handlers[r]).length||delete this.handlers[r])}}catch(a){s.e(a)}finally{s.f()}delete this.handlerNameToEventTypes[e]}}},created:function(){M.$.on("subscribe",this.subscribe),M.$.on("unsubscribe",this.unsubscribe),this.init()}};const q=(0,_.Z)(N,[["render",U]]);var O=q,j={class:"assistant-modal"},$={class:"icon"},E={key:0,class:"fa fa-bell"},z={key:1,class:"fa fa-volume-up"},W={key:2,class:"fa fa-comment-dots"},L={key:3,class:"fa fa-microphone"},A={class:"text"},V={key:0,class:"listening"},H=(0,i._)("span",null,"Assistant listening",-1),F=[H],B={key:1,class:"speech-recognized"},Y=["textContent"],K={key:2,class:"responding"},G=["textContent"];function J(e,t,n,s,r,a){var o=(0,i.up)("Modal");return(0,i.wg)(),(0,i.iD)("div",j,[(0,i.Wm)(o,{ref:"assistantModal"},{default:(0,i.w5)((function(){return[(0,i._)("div",$,[r.state.alerting?((0,i.wg)(),(0,i.iD)("i",E)):r.state.responding?((0,i.wg)(),(0,i.iD)("i",z)):r.state.speechRecognized?((0,i.wg)(),(0,i.iD)("i",W)):((0,i.wg)(),(0,i.iD)("i",L))]),(0,i._)("div",A,[r.state.listening?((0,i.wg)(),(0,i.iD)("div",V,F)):r.state.speechRecognized?((0,i.wg)(),(0,i.iD)("div",B,[(0,i._)("span",{textContent:(0,l.zw)(r.phrase)},null,8,Y)])):r.state.responding?((0,i.wg)(),(0,i.iD)("div",K,[(0,i._)("span",{textContent:(0,l.zw)(r.responseText)},null,8,G)])):(0,i.kq)("",!0)])]})),_:1},512)])}var X=n(8453),Q={name:"VoiceAssistant",components:{Modal:X.Z},mixins:[Z.Z],data:function(){return{responseText:"",phrase:"",hideTimeout:void 0,state:{listening:!1,speechRecognized:!1,responding:!1,alerting:!1}}},methods:{reset:function(){this.state.listening=!1,this.state.speechRecognized=!1,this.state.responding=!1,this.state.alerting=!1,this.phrase="",this.responseText=""},conversationStart:function(){this.reset(),this.state.listening=!0,this.$refs.assistantModal.show(),this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=void 0)},conversationEnd:function(){var e=this,t=this;this.hideTimeout=setTimeout((function(){e.reset(),t.$refs.assistantModal.close(),t.hideTimeout=void 0}),4e3)},speechRecognized:function(e){this.reset(),this.state.speechRecognized=!0,this.phrase=e.phrase,this.$refs.assistantModal.show()},response:function(e){this.reset(),this.state.responding=!0,this.responseText=e.response_text,this.$refs.assistantModal.show()},alertOn:function(){this.reset(),this.state.alerting=!0,this.$refs.assistantModal.show()},alertOff:function(){this.reset(),this.state.alerting=!1,this.$refs.assistantModal.close()},registerHandlers:function(){this.subscribe(this.conversationStart,null,"platypush.message.event.assistant.ConversationStartEvent"),this.subscribe(this.alertOn,null,"platypush.message.event.assistant.AlertStartedEvent"),this.subscribe(this.alertOff,null,"platypush.message.event.assistant.AlertEndEvent"),this.subscribe(this.speechRecognized,null,"platypush.message.event.assistant.SpeechRecognizedEvent"),this.subscribe(this.response,null,"platypush.message.event.assistant.ResponseEvent"),this.subscribe(this.conversationEnd,null,"platypush.message.event.assistant.ConversationEndEvent","platypush.message.event.assistant.NoResponseEvent","platypush.message.event.assistant.ConversationTimeoutEvent")}},mounted:function(){this.registerHandlers()}};const ee=(0,_.Z)(Q,[["render",J]]);var te=ee;function ne(e,t,n,s,r,a){return(0,i.wg)(),(0,i.iD)("div")}var se={name:"Ntfy",mixins:[Z.Z],methods:{onMessage:function(e){this.notify({title:e.title,text:e.message,image:{icon:"bell"}})}},mounted:function(){this.subscribe(this.onMessage,null,"platypush.message.event.ntfy.NotificationEvent")}};const ie=(0,_.Z)(se,[["render",ne]]);var re=ie;function ae(e,t,n,s,r,a){return(0,i.wg)(),(0,i.iD)("div")}var oe={name:"Pushbullet",mixins:[Z.Z],methods:{onMessage:function(e){"mirror"===e.push_type&&this.notify({title:e.title,text:e.body,image:{src:e.icon?"data:image/png;base64, "+e.icon:void 0,icon:e.icon?void 0:"bell"}})}},mounted:function(){this.subscribe(this.onMessage,null,"platypush.message.event.pushbullet.PushbulletEvent")}};const ce=(0,_.Z)(oe,[["render",ae]]);var le=ce,ue={name:"App",mixins:[Z.Z],components:{Pushbullet:le,Ntfy:re,Notifications:T,Events:O,VoiceAssistant:te},data:function(){return{config:{},userAuthenticated:!1}},computed:{hasWebsocket:function(){return this.userAuthenticated&&"backend.http"in this.config},hasAssistant:function(){return this.hasWebsocket},hasPushbullet:function(){return this.hasWebsocket&&("pushbullet"in this.config||"backend.pushbullet"in this.config)},hasNtfy:function(){return this.hasWebsocket&&"ntfy"in this.config}},methods:{onNotification:function(e){this.$refs.notifications.create(e)},initConfig:function(){var e=this;return(0,a.Z)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.request("config.get",{},6e4,!1);case 2:e.config=t.sent,e.userAuthenticated=!0;case 4:case"end":return t.stop()}}),t)})))()}},created:function(){this.initConfig()},mounted:function(){M.$.on("notification-create",this.onNotification)}};const de=(0,_.Z)(ue,[["render",r]]);var fe=de,pe=n(2201);function he(e,t,n,s,r,a){var o=(0,i.up)("Loading"),c=(0,i.up)("Widget"),u=(0,i.up)("Row");return(0,i.wg)(),(0,i.iD)(i.HY,null,[r.loading?((0,i.wg)(),(0,i.j4)(o,{key:0})):(0,i.kq)("",!0),(0,i._)("div",{id:"dashboard",class:(0,l.C_)(["col-12",a.classes]),style:(0,l.j5)(r.style)},[((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(r.rows,(function(e,t){return(0,i.wg)(),(0,i.j4)(u,{key:t,class:(0,l.C_)(e.class),style:(0,l.j5)(e.style)},{default:(0,i.w5)((function(){return[((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(e.widgets,(function(e,t){return(0,i.wg)(),(0,i.j4)(i.Ob,{key:t},[(0,i.Wm)(c,{style:(0,l.j5)(e.style),class:(0,l.C_)(e.class)},{default:(0,i.w5)((function(){return[((0,i.wg)(),(0,i.j4)((0,i.LL)(e.component),(0,l.vs)((0,i.F4)(a.getWidgetProps(e))),null,16))]})),_:2},1032,["style","class"])],1024)})),128))]})),_:2},1032,["class","style"])})),128))],6)],64)}var me=n(4648),ge=(n(1249),n(1539),n(8783),n(3948),n(8309),n(6977),n(1232));function ve(e,t,n,s,r,a){return(0,i.wg)(),(0,i.iD)("div",{class:(0,l.C_)(["row",a.classes]),style:(0,l.j5)(n.style)},[(0,i.WI)(e.$slots,"default",{},void 0,!0)],6)}var we={name:"Row",props:{class:{type:String,required:!1,default:""},style:{type:String,required:!1,default:""}},computed:{classes:function(){return this.class}}};const be=(0,_.Z)(we,[["render",ve],["__scopeId","data-v-1b4663f2"]]);var ye=be;function ke(e,t,n,s,r,a){return(0,i.wg)(),(0,i.iD)("div",{style:(0,l.j5)(n.style),class:(0,l.C_)(a.classes)},[(0,i.WI)(e.$slots,"default",{},void 0,!0)],6)}n(4916),n(3123);var xe={name:"Widget",props:{style:{type:String,required:!1,default:""},class:{type:String,required:!1,default:""}},computed:{classes:function(){var e;return(null!==(e=this.class)&&void 0!==e&&e.length?this.class.split(" "):["col-3"]).concat(["widget","column"])}}};const _e=(0,_.Z)(xe,[["render",ke],["__scopeId","data-v-5df52982"]]);var Ce=_e,De={name:"Dashboard",mixins:[Z.Z],components:{Widget:Ce,Loading:ge.Z,Row:ye},props:{refreshSeconds:{type:Number,required:!1,default:0}},data:function(){return{rows:[],loading:!1,style:void 0,class:void 0}},computed:{classes:function(){return this.class}},methods:{getWidgetProps:function(e){var t=(0,me.Z)({},e.props);return t.class&&delete t.class,t},parseTemplate:function(e,t){var s,r,a=(new DOMParser).parseFromString(t,"text/xml").childNodes[0],o=this;this.style=null===(s=a.attributes.style)||void 0===s?void 0:s.nodeValue,this.class=null===(r=a.attributes.class)||void 0===r?void 0:r.nodeValue,this.rows=(0,P.Z)(a.getElementsByTagName("Row")).map((function(e){var t,s;return{style:null===(t=e.attributes.style)||void 0===t?void 0:t.nodeValue,class:null===(s=e.attributes.class)||void 0===s?void 0:s.nodeValue,widgets:(0,P.Z)(e.children).map((function(e){var t,s,r=(0,i.RC)((function(){return n(6725)("./".concat(e.nodeName,"/Index"))})),a=null===(t=e.attributes.style)||void 0===t?void 0:t.nodeValue,c=null===(s=e.attributes.class)||void 0===s?void 0:s.nodeValue,l=(0,P.Z)(e.attributes).reduce((function(e,t){return"style"!==t.nodeName&&(e[t.nodeName]=t.nodeValue),e}),{content:e.innerHTML}),u={component:r,style:a,class:c,props:l||{}};return o.$options.components[e.nodeName]=r,u}))}})),this.loading=!1},refreshDashboard:function(){var e=this;return(0,a.Z)(regeneratorRuntime.mark((function t(){var n,s;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,e.widgets=[],n=e.$route.params.name,t.next=5,e.request("config.get_dashboard",{name:n});case 5:s=t.sent,s||e.error("Dashboard ".concat(n," not found")),e.parseTemplate(n,s);case 8:case"end":return t.stop()}}),t)})))()}},mounted:function(){if(this.refreshDashboard(),this.refreshSeconds){var e=this;setInterval((function(){e.refreshDashboard()}),parseInt((1e3*this.refreshSeconds).toFixed(0)))}}};const Ie=(0,_.Z)(De,[["render",he],["__scopeId","data-v-cefcfdfc"]]);var Se=Ie;function Te(e,t,n,s,r,a){return(0,i.wg)(),(0,i.iD)("h1",null,"Object not found")}var Ze={name:"NotFound"};const Ue=(0,_.Z)(Ze,[["render",Te]]);var Re=Ue,Pe=function(e){return(0,i.dD)("data-v-16cef6aa"),e=e(),(0,i.Cn)(),e},Me={class:"login-container"},Ne={class:"login",method:"POST"},qe=(0,i.uE)('<div class="header" data-v-16cef6aa><span class="logo" data-v-16cef6aa></span><span class="text" data-v-16cef6aa>Platypush</span></div><div class="row" data-v-16cef6aa><label data-v-16cef6aa><input type="text" name="username" placeholder="Username" data-v-16cef6aa></label></div><div class="row" data-v-16cef6aa><label data-v-16cef6aa><input type="password" name="password" placeholder="Password" data-v-16cef6aa></label></div>',3),Oe={key:0,class:"row"},je=Pe((function(){return(0,i._)("label",null,[(0,i._)("input",{type:"password",name:"confirm_password",placeholder:"Confirm password"})],-1)})),$e=[je],Ee={class:"row buttons"},ze=["value"],We=Pe((function(){return(0,i._)("div",{class:"row pull-right"},[(0,i._)("label",{class:"checkbox"},[(0,i._)("input",{type:"checkbox",name:"remember"}),(0,i.Uk)("  Keep me logged in on this device   ")])],-1)}));function Le(e,t,n,s,r,a){return(0,i.wg)(),(0,i.iD)("div",Me,[(0,i._)("form",Ne,[qe,a._register?((0,i.wg)(),(0,i.iD)("div",Oe,$e)):(0,i.kq)("",!0),(0,i._)("div",Ee,[(0,i._)("input",{type:"submit",class:"btn btn-primary",value:a._register?"Register":"Login"},null,8,ze)]),We])])}var Ae={name:"Login",mixins:[Z.Z],props:{register:{type:Boolean,required:!1,default:!1}},computed:{_register:function(){return this.parseBoolean(this.register)}}};const Ve=(0,_.Z)(Ae,[["render",Le],["__scopeId","data-v-16cef6aa"]]);var He=Ve;function Fe(e,t,n,s,r,a){var o=(0,i.up)("Login");return(0,i.wg)(),(0,i.j4)(o,{register:!0})}var Be={name:"Register",mixins:[He],components:{Login:He},props:{register:{type:Boolean,required:!1,default:!0}}};const Ye=(0,_.Z)(Be,[["render",Fe]]);var Ke=Ye,Ge={key:2,class:"canvas"},Je={class:"panel"},Xe={key:3,class:"canvas"};function Qe(e,t,n,s,r,a){var o=(0,i.up)("Loading"),c=(0,i.up)("Nav"),u=(0,i.up)("Settings");return(0,i.wg)(),(0,i.iD)("main",null,[r.loading?((0,i.wg)(),(0,i.j4)(o,{key:0})):((0,i.wg)(),(0,i.j4)(c,{key:1,panels:r.components,"selected-panel":r.selectedPanel,hostname:r.hostname,onSelect:t[0]||(t[0]=function(e){return r.selectedPanel=e})},null,8,["panels","selected-panel","hostname"])),"settings"===r.selectedPanel?((0,i.wg)(),(0,i.iD)("div",Ge,[(0,i._)("div",Je,[(0,i.Wm)(u)])])):((0,i.wg)(),(0,i.iD)("div",Xe,[((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(r.components,(function(e,t){return(0,i.wg)(),(0,i.iD)("div",{class:(0,l.C_)(["panel",{hidden:t!==r.selectedPanel}]),key:t},[t===r.selectedPanel?((0,i.wg)(),(0,i.j4)((0,i.LL)(e.component),{key:0,config:e.config,"plugin-name":t},null,8,["config","plugin-name"])):(0,i.kq)("",!0)],2)})),128))]))])}var et=n(6084),tt=(n(4723),n(4747),n(9720),n(9600),n(7042),function(e){return(0,i.dD)("data-v-69a507f4"),e=e(),(0,i.Cn)(),e}),nt=tt((function(){return(0,i._)("i",{class:"fas fa-bars"},null,-1)})),st=["textContent"],it={class:"plugins"},rt=["title","onClick"],at=["href"],ot={class:"icon"},ct=["src"],lt={key:2,class:"fas fa-puzzle-piece"},ut=["textContent"],dt={class:"footer"},ft={href:"/#settings"},pt=tt((function(){return(0,i._)("span",{class:"icon"},[(0,i._)("i",{class:"fa fa-cog"})],-1)})),ht={key:0,class:"name"},mt={href:"/logout"},gt=tt((function(){return(0,i._)("span",{class:"icon"},[(0,i._)("i",{class:"fas fa-sign-out-alt"})],-1)})),vt={key:0,class:"name"};function wt(e,t,n,s,r,a){return(0,i.wg)(),(0,i.iD)("nav",{class:(0,l.C_)({collapsed:r.collapsed})},[(0,i._)("div",{class:"toggler",onClick:t[0]||(t[0]=function(e){return r.collapsed=!r.collapsed})},[nt,n.hostname?((0,i.wg)(),(0,i.iD)("span",{key:0,class:"hostname",textContent:(0,l.zw)(n.hostname)},null,8,st)):(0,i.kq)("",!0)]),(0,i._)("ul",it,[((0,i.wg)(!0),(0,i.iD)(i.HY,null,(0,i.Ko)(a.panelNames,(function(e){var t,s;return(0,i.wg)(),(0,i.iD)("li",{key:e,class:(0,l.C_)(["entry",{selected:e===n.selectedPanel}]),title:e,onClick:function(t){return a.onItemClick(e)}},[(0,i._)("a",{href:"/#".concat(e)},[(0,i._)("span",ot,[null!==(t=r.icons[e])&&void 0!==t&&t.class?((0,i.wg)(),(0,i.iD)("i",{key:0,class:(0,l.C_)(r.icons[e].class)},null,2)):null!==(s=r.icons[e])&&void 0!==s&&s.imgUrl?((0,i.wg)(),(0,i.iD)("img",{key:1,src:r.icons[e].imgUrl,alt:"name"},null,8,ct)):((0,i.wg)(),(0,i.iD)("i",lt))]),r.collapsed?(0,i.kq)("",!0):((0,i.wg)(),(0,i.iD)("span",{key:0,class:"name",textContent:(0,l.zw)("entities"==e?"Home":e)},null,8,ut))],8,at)],10,rt)})),128))]),(0,i._)("ul",dt,[(0,i._)("li",{class:(0,l.C_)({selected:"settings"===n.selectedPanel}),title:"Settings",onClick:t[1]||(t[1]=function(e){return a.onItemClick("settings")})},[(0,i._)("a",ft,[pt,r.collapsed?(0,i.kq)("",!0):((0,i.wg)(),(0,i.iD)("span",ht,"Settings"))])],2),(0,i._)("li",{title:"Logout",onClick:t[2]||(t[2]=function(e){return a.onItemClick("logout")})},[(0,i._)("a",mt,[gt,r.collapsed?(0,i.kq)("",!0):((0,i.wg)(),(0,i.iD)("span",vt,"Logout"))])])])],2)}n(2707);var bt=n(1359),yt={name:"Nav",emits:["select"],mixins:[Z.Z],props:{panels:{type:Object,required:!0},selectedPanel:{type:String},hostname:{type:String}},computed:{panelNames:function(){var e=Object.keys(this.panels),t=e.indexOf("entities");return t>=0?["entities"].concat(e.slice(0,t).concat(e.slice(t+1)).sort()):e.sort()}},methods:{onItemClick:function(e){this.$emit("select",e),this.collapsed=!0}},data:function(){return{collapsed:!0,icons:bt,host:null}}};const kt=(0,_.Z)(yt,[["render",wt],["__scopeId","data-v-69a507f4"]]);var xt=kt,_t=n(5392),Ct={name:"Panel",mixins:[Z.Z],components:{Settings:_t["default"],Nav:xt,Loading:ge.Z},data:function(){return{loading:!1,plugins:{},backends:{},procedures:{},components:{},hostname:void 0,selectedPanel:void 0}},methods:{initSelectedPanel:function(){var e=this.$route.hash.match("#?([a-zA-Z0-9.]+)[?]?(.*)"),t=e?e[1]:"entities";null!==t&&void 0!==t&&t.length&&(this.selectedPanel=t)},initPanels:function(){var e=this;this.components={},Object.entries(this.plugins).forEach(function(){var t=(0,a.Z)(regeneratorRuntime.mark((function t(s){var r,o,c,l,u,d;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return r=(0,et.Z)(s,2),o=r[0],c=r[1],l=o.split(".").map((function(e){return e[0].toUpperCase()+e.slice(1)})).join(""),u=null,t.prev=3,t.next=6,n(3379)("./".concat(l,"/Index"));case 6:u=t.sent,t.next=12;break;case 9:return t.prev=9,t.t0=t["catch"](3),t.abrupt("return");case 12:d=(0,i.RC)((0,a.Z)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",u);case 1:case"end":return e.stop()}}),e)})))),e.$options.components[o]=d,e.components[o]={component:d,pluginName:o,config:c};case 15:case"end":return t.stop()}}),t,null,[[3,9]])})));return function(e){return t.apply(this,arguments)}}())},parseConfig:function(){var e=this;return(0,a.Z)(regeneratorRuntime.mark((function t(){var n,s;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Promise.all([e.request("config.get_plugins"),e.request("config.get_backends"),e.request("config.get_procedures"),e.request("config.get_device_id")]);case 2:n=t.sent,s=(0,et.Z)(n,4),e.plugins=s[0],e.backends=s[1],e.procedures=s[2],e.hostname=s[3],e.initializeDefaultViews();case 9:case"end":return t.stop()}}),t)})))()},initializeDefaultViews:function(){this.plugins.execute={},this.plugins.entities={}}},mounted:function(){var e=this;return(0,a.Z)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,t.prev=1,t.next=4,e.parseConfig();case 4:e.initPanels(),e.initSelectedPanel();case 6:return t.prev=6,e.loading=!1,t.finish(6);case 9:case"end":return t.stop()}}),t,null,[[1,,6,9]])})))()}};const Dt=(0,_.Z)(Ct,[["render",Qe],["__scopeId","data-v-344b6d1a"]]);var It=Dt,St={key:1,class:"canvas"};function Tt(e,t,n,s,r,a){var o=(0,i.up)("Loading");return(0,i.wg)(),(0,i.iD)("main",null,[r.loading?((0,i.wg)(),(0,i.j4)(o,{key:0})):((0,i.wg)(),(0,i.iD)("div",St,[((0,i.wg)(),(0,i.j4)((0,i.LL)(r.component),{config:r.config,"plugin-name":a.pluginName},null,8,["config","plugin-name"]))]))])}n(9714);var Zt={name:"Panel",mixins:[Z.Z],components:{Settings:_t["default"],Nav:xt,Loading:ge.Z},data:function(){return{loading:!1,config:{},plugins:{},backends:{},procedures:{},component:void 0,hostname:void 0,selectedPanel:void 0}},computed:{pluginName:function(){return this.$route.params.plugin}},methods:{initPanel:function(){var e=this;return(0,a.Z)(regeneratorRuntime.mark((function t(){var s,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return s=e.pluginName.split(".").map((function(e){return e[0].toUpperCase()+e.slice(1)})).join(""),r=null,t.prev=2,t.next=5,n(3379)("./".concat(s,"/Index"));case 5:r=t.sent,t.next=13;break;case 8:return t.prev=8,t.t0=t["catch"](2),console.error(t.t0),e.notify({error:!0,title:"Cannot load plugin ".concat(e.pluginName),text:t.t0.toString()}),t.abrupt("return");case 13:e.component=(0,i.RC)((0,a.Z)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",r);case 1:case"end":return e.stop()}}),e)})))),e.$options.components[name]=e.component;case 15:case"end":return t.stop()}}),t,null,[[2,8]])})))()},initConfig:function(){var e=this;return(0,a.Z)(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.request("config.get");case 2:return n=t.sent,e.config=n[e.pluginName]||{},t.next=6,e.request("config.get_device_id");case 6:e.hostname=t.sent;case 7:case"end":return t.stop()}}),t)})))()}},mounted:function(){var e=this;return(0,a.Z)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,t.prev=1,t.next=4,e.initConfig();case 4:return t.next=6,e.initPanel();case 6:return t.prev=6,e.loading=!1,t.finish(6);case 9:case"end":return t.stop()}}),t,null,[[1,,6,9]])})))()}};const Ut=(0,_.Z)(Zt,[["render",Tt],["__scopeId","data-v-67571c94"]]);var Rt=Ut,Pt=[{path:"/",name:"Panel",component:It},{path:"/dashboard/:name",name:"Dashboard",component:Se},{path:"/plugin/:plugin",name:"Plugin",component:Rt},{path:"/login",name:"Login",component:He},{path:"/register",name:"Register",component:Ke},{path:"/:catchAll(.*)",component:Re}],Mt=(0,pe.p7)({history:(0,pe.PO)(),routes:Pt}),Nt=Mt,qt=(0,s.ri)(fe);qt.config.globalProperties._config=window.config,qt.use(Nt).mount("#app")},6813:function(e,t,n){"use strict";n.d(t,{Z:function(){return N}});n(1539);var s=n(9669),i=n.n(s),r={name:"Api",methods:{execute:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6e4,s=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r={};return"target"in e&&e["target"]||(e["target"]="localhost"),"type"in e&&e["type"]||(e["type"]="request"),n&&(r.timeout=n),new Promise((function(n,a){i().post("/execute",e,r).then((function(e){var s;if(e=e.data.response,null!==(s=e.errors)&&void 0!==s&&s.length){var i,r=(null===(i=e.errors)||void 0===i?void 0:i[0])||e;t.notify({text:r,error:!0}),a(r)}else n(e.output)})).catch((function(e){s&&t.notify({text:e,error:!0}),a(e)}))}))},request:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:6e4,s=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return this.execute({type:"request",action:e,args:t},n,s)}}};const a=r;var o=a,c=n(6084),l=(n(4916),n(3123),{name:"Cookies",methods:{getCookies:function(){return document.cookie.split(/;\s*/).reduce((function(e,t){var n=t.split("="),s=(0,c.Z)(n,2),i=s[0],r=s[1];return e[i]=r,e}),{})}}});const u=l;var d=u,f=(n(2222),{name:"DateTime",methods:{formatDate:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"string"===typeof e&&(e=new Date(Date.parse(e))),e.toDateString().substring(0,t?15:10)},formatTime:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return"string"===typeof e&&(e=new Date(Date.parse(e))),e.toTimeString().substring(0,t?8:5)},formatDateTime:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return"string"===typeof e&&(e=new Date(Date.parse(e))),"".concat(this.formatDate(e,t),", ").concat(this.formatTime(e,n))}}});const p=f;var h=p,m=n(9584),g=(n(7714),n(2801),n(1174),n(1249),n(3948),n(5250)),v={name:"Events",computed:{_eventsReady:function(){var e;return null===(e=this.$root.$refs.events)||void 0===e?void 0:e.initialized}},methods:{subscribe:function(e,t){for(var n=this,s=arguments.length,i=new Array(s>2?s-2:0),r=2;r<s;r++)i[r-2]=arguments[r];var a=function(){g.$.emit("subscribe",{events:i,handler:e,handlerName:t||n.generateId()})};if(!this._eventsReady){var o=this,c=this.$watch((function(){return o._eventsReady}),(function(e){e&&(a(),c())}));return c}a()},unsubscribe:function(e){g.$.emit("unsubscribe",e)},generateId:function(){return btoa((0,m.Z)(Array(11).keys()).map((function(){return String.fromCharCode(Math.round(255*Math.random()))})))}}};const w=v;var b=w,y={name:"Notification",methods:{notify:function(e){g.$.emit("notification-create",e)},warn:function(e){this.notify({text:e,warning:!0})},error:function(e){throw this.notify({text:e,error:!0}),e}}};const k=y;var x=k,_={name:"Screen",methods:{isMobile:function(){return window.matchMedia("only screen and (max-width: 760px)").matches},isTablet:function(){return!this.isMobile()&&window.matchMedia("only screen and (max-width: 960px)").matches},isDesktop:function(){return window.matchMedia("only screen and (min-width: 1152px)").matches}}};const C=_;var D=C,I=(n(7042),n(9600),{name:"Text",methods:{capitalize:function(e){return null!==e&&void 0!==e&&e.length?e.charAt(0).toUpperCase()+e.slice(1):e},prettify:function(e){var t=this;return e.split("_").map((function(e){return t.capitalize(e)})).join(" ")}}});const S=I;var T=S,Z=(n(6977),{name:"Types",methods:{parseBoolean:function(e){return"string"===typeof e?(e=e.toLowerCase(),"true"===e||"false"!==e&&!!parseInt(e)):!!e},convertSize:function(e){"string"===typeof e&&(e=parseInt(e));var t=null,n=["B","KB","MB","GB","TB"];return n.forEach((function(s,i){e<=1024&&null==t?t=s:e>1024&&(i===n.length-1?t=s:e/=1024)})),"".concat(e.toFixed(2)," ").concat(t)}}});const U=Z;var R=U,P={name:"Utils",mixins:[o,d,x,b,h,D,T,R]};const M=P;var N=M},1232:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var s=n(6252),i={class:"loading"},r={class:"icon"};function a(e,t){return(0,s.wg)(),(0,s.iD)("div",i,[(0,s._)("div",r,[((0,s.wg)(),(0,s.iD)(s.HY,null,(0,s.Ko)(4,(function(e){return(0,s._)("div",{key:e})})),64))])])}var o=n(3744);const c={},l=(0,o.Z)(c,[["render",a],["__scopeId","data-v-4d9c871b"]]);var u=l},8453:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var s=n(6252),i=n(3577),r=["id"],a=["textContent"],o={class:"body"};function c(e,t,n,c,l,u){return(0,s.wg)(),(0,s.iD)("div",{class:(0,i.C_)(["modal-container fade-in",{hidden:!l.isVisible}]),id:n.id,style:(0,i.j5)({"--z-index":u.zIndex}),onClick:t[2]||(t[2]=function(){return u.close&&u.close.apply(u,arguments)})},[(0,s._)("div",{class:(0,i.C_)(["modal",e.$attrs.class])},[(0,s._)("div",{class:"content",style:(0,i.j5)({"--width":n.width,"--height":n.height}),onClick:t[1]||(t[1]=function(e){return e.stopPropagation()})},[n.title?((0,s.wg)(),(0,s.iD)("div",{key:0,class:"header",textContent:(0,i.zw)(n.title)},null,8,a)):(0,s.kq)("",!0),(0,s._)("div",o,[(0,s.WI)(e.$slots,"default",{onModalClose:t[0]||(t[0]=function(){return u.close&&u.close.apply(u,arguments)})},void 0,!0)])],4)],2)],14,r)}var l=n(6347),u=(n(9653),{name:"Modal",emits:["close","open"],props:{id:{type:String},title:{type:String},width:{type:[Number,String]},height:{type:[Number,String]},visible:{type:Boolean,default:!1},timeout:{type:[Number,String]},level:{type:Number,default:1}},data:function(){return{timeoutId:void 0,prevVisible:this.visible,isVisible:this.visible}},computed:{zIndex:function(){return 500+this.level}},methods:{close:function(){this.prevVisible=this.isVisible,this.isVisible=!1},hide:function(){this.close()},show:function(){this.prevVisible=this.isVisible,this.isVisible=!0},toggle:function(){this.isVisible?this.close():this.show()}},mounted:function(){var e=this,t=this,n=function(e){e?t.$emit("open"):t.$emit("close"),t.isVisible=e};this.$watch((function(){return e.visible}),n),this.$watch((function(){return e.isVisible}),n)},updated:function(){if(this.prevVisible=this.isVisible,this.isVisible){var e,t=parseInt(getComputedStyle(this.$el).zIndex),n=[],s=(0,l.Z)(document.querySelectorAll(".modal-container:not(.hidden)"));try{for(s.s();!(e=s.n()).done;){var i=e.value,r=parseInt(getComputedStyle(i).zIndex);r>t?(t=r,n=[i]):r===t&&n.push(i)}}catch(o){s.e(o)}finally{s.f()}(n.indexOf(this.$el)<0||n.length>1)&&(this.$el.style.zIndex=t+1)}if(this.isVisible&&this.timeout&&!this.timeoutId){var a=function(e){return function(){e.close(),e.timeoutId=void 0}};this.timeoutId=setTimeout(a(this),0+this.timeout)}}}),d=n(3744);const f=(0,d.Z)(u,[["render",c],["__scopeId","data-v-7d1f6e8b"]]);var p=f},5771:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var s=n(6252),i=n(9963),r=n(3577),a={class:"dropdown-container",ref:"container"},o=["title"],c=["textContent"],l=["id"];function u(e,t,n,u,d,f){return(0,s.wg)(),(0,s.iD)("div",a,[(0,s._)("button",{title:n.title,ref:"button",onClick:t[0]||(t[0]=(0,i.iM)((function(e){return f.toggle(e)}),["stop"]))},[n.iconClass?((0,s.wg)(),(0,s.iD)("i",{key:0,class:(0,r.C_)(["icon",n.iconClass])},null,2)):(0,s.kq)("",!0),n.text?((0,s.wg)(),(0,s.iD)("span",{key:1,class:"text",textContent:(0,r.zw)(n.text)},null,8,c)):(0,s.kq)("",!0)],8,o),(0,s._)("div",{class:(0,r.C_)(["dropdown fade-in",{hidden:!d.visible}]),id:n.id,ref:"dropdown"},[(0,s.WI)(e.$slots,"default",{},void 0,!0)],10,l)],512)}var d={name:"Dropdown",emits:["click"],props:{id:{type:String},items:{type:Array,default:function(){return[]}},iconClass:{type:String,default:"fa fa-ellipsis-h"},text:{type:String},title:{type:String},keepOpenOnItemClick:{type:Boolean,default:!1}},data:function(){return{visible:!1}},methods:{documentClickHndl:function(e){if(this.visible){var t=e.target;while(t){if(!this.$refs.dropdown)break;if(t===this.$refs.dropdown.element)return;t=t.parentElement}this.close()}},close:function(){this.visible=!1,document.removeEventListener("click",this.documentClickHndl)},open:function(){var e=this;document.addEventListener("click",this.documentClickHndl),this.visible=!0,setTimeout((function(){var t=e.$refs.dropdown;t.style.left=0,t.style.top=parseFloat(getComputedStyle(e.$refs.button).height)+"px",t.getBoundingClientRect().left>window.innerWidth/2&&(t.style.left=-t.clientWidth+parseFloat(getComputedStyle(e.$refs.button).width)+"px"),t.getBoundingClientRect().top>window.innerHeight/2&&(t.style.top=-t.clientHeight+parseFloat(getComputedStyle(e.$refs.button).height)+"px")}),10)},toggle:function(e){e.stopPropagation(),this.$emit("click"),this.visible?this.close():this.open()}}},f=n(3744);const p=(0,f.Z)(d,[["render",u],["__scopeId","data-v-21bf0316"]]);var h=p},9015:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var s=n(6252),i=n(3577),r={key:0,class:"col-1 icon"},a=["textContent"];function o(e,t,n,o,c,l){var u,d,f=(0,s.up)("Icon");return(0,s.wg)(),(0,s.iD)("div",{class:(0,i.C_)(["row item",n.itemClass]),onClick:t[0]||(t[0]=function(){return l.clicked&&l.clicked.apply(l,arguments)})},[null!==(u=n.iconClass)&&void 0!==u&&u.length||null!==(d=n.iconUrl)&&void 0!==d&&d.length?((0,s.wg)(),(0,s.iD)("div",r,[(0,s.Wm)(f,{class:(0,i.C_)(n.iconClass),url:n.iconUrl},null,8,["class","url"])])):(0,s.kq)("",!0),(0,s._)("div",{class:(0,i.C_)(["text",{"col-11":null!=n.iconClass}]),textContent:(0,i.zw)(n.text)},null,10,a)],2)}var c=n(1478),l={name:"DropdownItem",components:{Icon:c.Z},props:{iconClass:{type:String},iconUrl:{type:String},text:{type:String},disabled:{type:Boolean,default:!1},itemClass:{type:String}},methods:{clicked:function(e){if(this.disabled)return!1;this.$parent.$emit("click",e),this.$parent.keepOpenOnItemClick||(this.$parent.visible=!1)}}},u=n(3744);const d=(0,u.Z)(l,[["render",o],["__scopeId","data-v-0a3cac88"]]);var f=d},1478:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var s=n(6252),i=n(3577),r={class:"icon-container"},a=["src","alt"];function o(e,t,n,o,c,l){var u,d;return(0,s.wg)(),(0,s.iD)("div",r,[null!==(u=n.url)&&void 0!==u&&u.length?((0,s.wg)(),(0,s.iD)("img",{key:0,class:"icon",src:n.url,alt:n.alt},null,8,a)):null!==(d=l.className)&&void 0!==d&&d.length?((0,s.wg)(),(0,s.iD)("i",{key:1,class:(0,i.C_)(["icon",l.className]),style:(0,i.j5)({color:n.color})},null,6)):(0,s.kq)("",!0)])}var c={props:{class:{type:String},url:{type:String},color:{type:String,default:""},alt:{type:String,default:""}},computed:{className:function(){return this.class}}},l=n(3744);const u=(0,l.Z)(c,[["render",o],["__scopeId","data-v-706a3bd1"]]);var d=u},5392:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return Ie}});var s=n(6252),i={class:"settings-container"},r={class:"col-8"},a=["selected"],o=["selected"],c={class:"col-4 pull-right"},l=(0,s._)("i",{class:"fa fa-plus"},null,-1),u=[l];function d(e,t,n,l,d,f){var p=(0,s.up)("Users"),h=(0,s.up)("Token");return(0,s.wg)(),(0,s.iD)("div",i,[(0,s._)("header",null,[(0,s._)("div",r,[(0,s._)("select",{title:"View",onChange:t[0]||(t[0]=function(e){return d.selectedView=e.target.value})},[(0,s._)("option",{value:"users",selected:"users"===d.selectedView},"Users",8,a),(0,s._)("option",{value:"token",selected:"token"===d.selectedView},"Generate Token",8,o)],32)]),(0,s._)("div",c,["users"===d.selectedView?((0,s.wg)(),(0,s.iD)("button",{key:0,title:"Add User",onClick:t[1]||(t[1]=function(t){return e.$refs.usersView.$refs.addUserModal.show()})},u)):(0,s.kq)("",!0)])]),(0,s._)("main",null,["users"===d.selectedView?((0,s.wg)(),(0,s.j4)(p,{key:0,"session-token":d.sessionToken,"current-user":d.currentUser,ref:"usersView"},null,8,["session-token","current-user"])):"token"===d.selectedView?((0,s.wg)(),(0,s.j4)(h,{key:1,"session-token":d.sessionToken,"current-user":d.currentUser,ref:"tokenView"},null,8,["session-token","current-user"])):(0,s.kq)("",!0)])])}var f=n(8534),p=(n(5666),n(3577)),h=n(9963),m={class:"token-container"},g={class:"token-container"},v=(0,s.Uk)(" This is your generated token. Treat it carefully and do not share it with untrusted parties."),w=(0,s._)("br",null,null,-1),b=(0,s.Uk)(" Also, make sure to save it - it WILL NOT be displayed again. "),y=["textContent"],k={class:"body"},x={class:"description"},_=(0,s.Uk)("Generate a JWT authentication token that can be used for API calls to the "),C=(0,s.Uk)("/execute"),D=(0,s.Uk)(" endpoint."),I=(0,s._)("br",null,null,-1),S=(0,s._)("p",null,"You can include the token in your requests in any of the following ways:",-1),T=(0,s.Uk)("Specify it on the "),Z=(0,s.Uk)("Authorization: Bearer"),U=(0,s.Uk)(" header;"),R=(0,s.Uk)("Specify it on the "),P=(0,s.Uk)("X-Token"),M=(0,s.Uk)(" header;"),N=(0,s.Uk)("Specify it as a URL parameter: "),q=(0,s.Uk)("http://site:8008/execute?token=..."),O=(0,s.Uk)(";"),j=(0,s.Uk)("Specify it on the body of your JSON request: "),$=(0,s.Uk)('{"type":"request", "action", "...", "token":"..."}'),E=(0,s.Uk)("."),z=(0,s.Uk)(" Confirm your credentials in order to generate a new token. "),W={class:"form-container"},L=(0,s.Uk)(" Username "),A=["value"],V=(0,s._)("label",null,[(0,s.Uk)(" Password "),(0,s._)("input",{type:"password",name:"password"})],-1),H=(0,s._)("label",null,[(0,s.Uk)(" Token validity in days "),(0,s._)("input",{type:"text",name:"validityDays"}),(0,s._)("span",{class:"note"},[(0,s.Uk)(" Decimal values are also supported (e.g. "),(0,s._)("i",null,"0.5"),(0,s.Uk)(" to identify 6 hours). An empty or zero value means that the token has no expiry date. ")])],-1),F=(0,s._)("input",{type:"submit",value:"Generate token"},null,-1);function B(e,t,n,i,r,a){var o=(0,s.up)("Loading"),c=(0,s.up)("Modal"),l=(0,s.up)("tt");return(0,s.wg)(),(0,s.iD)("div",m,[r.loading?((0,s.wg)(),(0,s.j4)(o,{key:0})):(0,s.kq)("",!0),(0,s.Wm)(c,{ref:"tokenModal"},{default:(0,s.w5)((function(){return[(0,s._)("div",g,[(0,s._)("label",null,[v,w,b,(0,s._)("textarea",{class:"token",textContent:(0,p.zw)(r.token),onFocus:t[0]||(t[0]=function(){return a.onTokenSelect&&a.onTokenSelect.apply(a,arguments)})},null,40,y)])])]})),_:1},512),(0,s._)("div",k,[(0,s._)("div",x,[(0,s._)("p",null,[_,(0,s.Wm)(l,null,{default:(0,s.w5)((function(){return[C]})),_:1}),D]),I,S,(0,s._)("ul",null,[(0,s._)("li",null,[T,(0,s.Wm)(l,null,{default:(0,s.w5)((function(){return[Z]})),_:1}),U]),(0,s._)("li",null,[R,(0,s.Wm)(l,null,{default:(0,s.w5)((function(){return[P]})),_:1}),M]),(0,s._)("li",null,[N,(0,s.Wm)(l,null,{default:(0,s.w5)((function(){return[q]})),_:1}),O]),(0,s._)("li",null,[j,(0,s.Wm)(l,null,{default:(0,s.w5)((function(){return[$]})),_:1}),E])]),z]),(0,s._)("div",W,[(0,s._)("form",{onSubmit:t[1]||(t[1]=(0,h.iM)((function(){return a.generateToken&&a.generateToken.apply(a,arguments)}),["prevent"])),ref:"generateTokenForm"},[(0,s._)("label",null,[L,(0,s._)("input",{type:"text",name:"username",value:n.currentUser.username,disabled:""},null,8,A)]),V,H,F],544)])])])}n(1539),n(9714);var Y=n(9669),K=n.n(Y),G=n(1232),J=n(6813),X=n(8453),Q={name:"Token",components:{Modal:X.Z,Loading:G.Z},mixins:[J.Z],props:{currentUser:{type:Object,required:!0}},data:function(){return{loading:!1,token:null}},methods:{generateToken:function(e){var t=this;return(0,f.Z)(regeneratorRuntime.mark((function n(){var s,i,r,a,o;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return i=t.currentUser.username,r=e.target.password.value,a=null!==(s=e.target.validityDays)&&void 0!==s&&s.length?parseInt(e.target.validityDays.value):0,a||(a=null),t.loading=!0,n.prev=5,n.next=8,K().post("/auth",{username:i,password:r,expiry_days:a});case 8:t.token=n.sent.data.token,null!==(o=t.token)&&void 0!==o&&o.length&&t.$refs.tokenModal.show(),n.next=16;break;case 12:n.prev=12,n.t0=n["catch"](5),console.error(n.t0.toString()),t.notify({text:n.t0.toString(),error:!0});case 16:return n.prev=16,t.loading=!1,n.finish(16);case 19:case"end":return n.stop()}}),n,null,[[5,12,16,19]])})))()},onTokenSelect:function(e){e.target.select(),document.execCommand("copy"),this.notify({text:"Token copied to clipboard",image:{iconClass:"fa fa-check"}})}}},ee=n(3744);const te=(0,ee.Z)(Q,[["render",B]]);var ne=te,se=["disabled"],ie=["disabled"],re=["disabled"],ae=["disabled"],oe=["value"],ce=["disabled"],le=["disabled"],ue=["disabled"],de=["disabled"],fe={class:"body"},pe={class:"users-list"},he=["onClick"],me=["textContent"],ge={class:"actions pull-right col-4"};function ve(e,t,n,i,r,a){var o=(0,s.up)("Loading"),c=(0,s.up)("Modal"),l=(0,s.up)("DropdownItem"),u=(0,s.up)("Dropdown");return(0,s.wg)(),(0,s.iD)(s.HY,null,[r.loading?((0,s.wg)(),(0,s.j4)(o,{key:0})):(0,s.kq)("",!0),(0,s.Wm)(c,{ref:"addUserModal",title:"Add User"},{default:(0,s.w5)((function(){return[(0,s._)("form",{action:"#",method:"POST",ref:"addUserForm",onSubmit:t[0]||(t[0]=function(){return a.createUser&&a.createUser.apply(a,arguments)})},[(0,s._)("label",null,[(0,s._)("input",{type:"text",name:"username",placeholder:"Username",disabled:r.commandRunning},null,8,se)]),(0,s._)("label",null,[(0,s._)("input",{type:"password",name:"password",placeholder:"Password",disabled:r.commandRunning},null,8,ie)]),(0,s._)("label",null,[(0,s._)("input",{type:"password",name:"confirm_password",placeholder:"Confirm password",disabled:r.commandRunning},null,8,re)]),(0,s._)("input",{type:"submit",value:"Create User",disabled:r.commandRunning},null,8,ae)],544)]})),_:1},512),(0,s.Wm)(c,{ref:"changePasswordModal",title:"Change Password"},{default:(0,s.w5)((function(){return[(0,s._)("form",{action:"#",method:"POST",ref:"changePasswordForm",onSubmit:t[1]||(t[1]=function(){return a.changePassword&&a.changePassword.apply(a,arguments)})},[(0,s._)("label",null,[(0,s._)("input",{type:"text",name:"username",placeholder:"Username",value:r.selectedUser,disabled:"disabled"},null,8,oe)]),(0,s._)("label",null,[(0,s._)("input",{type:"password",name:"password",placeholder:"Current password",disabled:r.commandRunning},null,8,ce)]),(0,s._)("label",null,[(0,s._)("input",{type:"password",name:"new_password",placeholder:"New password",disabled:r.commandRunning},null,8,le)]),(0,s._)("label",null,[(0,s._)("input",{type:"password",name:"confirm_new_password",placeholder:"Confirm new password",disabled:r.commandRunning},null,8,ue)]),(0,s._)("input",{type:"submit",value:"Change Password",disabled:r.commandRunning},null,8,de)],544)]})),_:1},512),(0,s._)("div",fe,[(0,s._)("ul",pe,[((0,s.wg)(!0),(0,s.iD)(s.HY,null,(0,s.Ko)(r.users,(function(t){return(0,s.wg)(),(0,s.iD)("li",{key:t.user_id,class:"item user",onClick:function(e){return r.selectedUser=t.username}},[(0,s._)("div",{class:"name col-8",textContent:(0,p.zw)(t.username)},null,8,me),(0,s._)("div",ge,[(0,s.Wm)(u,{title:"User Actions","icon-class":"fa fa-cog"},{default:(0,s.w5)((function(){return[(0,s.Wm)(l,{text:"Change Password",disabled:r.commandRunning,"icon-class":"fa fa-key",onClick:function(n){r.selectedUser=t.username,e.$refs.changePasswordModal.show()}},null,8,["disabled","onClick"]),(0,s.Wm)(l,{text:"Delete User",disabled:r.commandRunning,"icon-class":"fa fa-trash",onClick:function(e){return a.deleteUser(t)}},null,8,["disabled","onClick"])]})),_:2},1024)])],8,he)})),128))])])],64)}var we=n(9584),be=(n(8309),n(5771)),ye=n(9015),ke={name:"Users",components:{DropdownItem:ye.Z,Loading:G.Z,Modal:X.Z,Dropdown:be.Z},mixins:[J.Z],props:{sessionToken:{type:String,required:!0},currentUser:{type:Object,required:!0}},data:function(){return{users:[],commandRunning:!1,loading:!1,selectedUser:null}},methods:{refresh:function(){var e=this;return(0,f.Z)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loading=!0,t.prev=1,t.next=4,e.request("user.get_users");case 4:e.users=t.sent;case 5:return t.prev=5,e.loading=!1,t.finish(5);case 8:case"end":return t.stop()}}),t,null,[[1,,5,8]])})))()},createUser:function(e){var t=this;return(0,f.Z)(regeneratorRuntime.mark((function n(){var s;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(e.preventDefault(),s=(0,we.Z)(t.$refs.addUserForm.querySelectorAll("input[name]")).reduce((function(e,t){return e[t.name]=t.value,e}),{}),s.password===s.confirm_password){n.next=5;break}return t.notify({title:"Unable to create user",text:"Please check that the passwords match",error:!0,image:{iconClass:"fas fa-times"}}),n.abrupt("return");case 5:return t.commandRunning=!0,n.prev=6,n.next=9,t.request("user.create_user",{username:s.username,password:s.password,session_token:t.sessionToken});case 9:return n.prev=9,t.commandRunning=!1,n.finish(9);case 12:return t.notify({text:"User "+s.username+" created",image:{iconClass:"fas fa-check"}}),t.$refs.addUserModal.close(),n.next=16,t.refresh();case 16:case"end":return n.stop()}}),n,null,[[6,,9,12]])})))()},changePassword:function(e){var t=this;return(0,f.Z)(regeneratorRuntime.mark((function n(){var s,i;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(e.preventDefault(),s=(0,we.Z)(t.$refs.changePasswordForm.querySelectorAll("input[name]")).reduce((function(e,t){return e[t.name]=t.value,e}),{}),s.new_password===s.confirm_new_password){n.next=5;break}return t.notify({title:"Unable to update password",text:"Please check that the passwords match",error:!0,image:{iconClass:"fas fa-times"}}),n.abrupt("return");case 5:return t.commandRunning=!0,i=!1,n.prev=7,n.next=10,t.request("user.update_password",{username:s.username,old_password:s.password,new_password:s.new_password});case 10:i=n.sent;case 11:return n.prev=11,t.commandRunning=!1,n.finish(11);case 14:i?(t.$refs.changePasswordModal.close(),t.notify({text:"Password successfully updated",image:{iconClass:"fas fa-check"}})):t.notify({title:"Unable to update password",text:"The current password is incorrect",error:!0,image:{iconClass:"fas fa-times"}});case 15:case"end":return n.stop()}}),n,null,[[7,,11,14]])})))()},deleteUser:function(e){var t=this;return(0,f.Z)(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(confirm("Are you sure that you want to remove the user "+e.username+"?")){n.next=2;break}return n.abrupt("return");case 2:return t.commandRunning=!0,n.prev=3,n.next=6,t.request("user.delete_user",{username:e.username,session_token:t.sessionToken});case 6:return n.prev=6,t.commandRunning=!1,n.finish(6);case 9:return t.notify({text:"User "+e.username+" removed",image:{iconClass:"fas fa-check"}}),n.next=12,t.refresh();case 12:case"end":return n.stop()}}),n,null,[[3,,6,9]])})))()}},mounted:function(){this.refresh()}};const xe=(0,ee.Z)(ke,[["render",ve]]);var _e=xe,Ce={name:"Settings",components:{Users:_e,Token:ne},mixins:[J.Z],data:function(){return{selectedView:"users",currentUser:null,sessionToken:null}},methods:{refresh:function(){var e=this;return(0,f.Z)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.sessionToken=e.getCookies()["session_token"],t.next=3,e.request("user.get_user_by_session",{session_token:e.sessionToken});case 3:e.currentUser=t.sent;case 4:case"end":return t.stop()}}),t)})))()}},mounted:function(){this.refresh()}};const De=(0,ee.Z)(Ce,[["render",d]]);var Ie=De},3379:function(e,t,n){var s={"./Camera/Index":[5528,5528],"./CameraAndroidIpcam/Index":[6739,6739],"./CameraCv/Index":[8184,5528,8184],"./CameraFfmpeg/Index":[5111,5528,5111],"./CameraGstreamer/Index":[699,5528,699],"./CameraIrMlx90640/Index":[9895,5528,9895],"./CameraPi/Index":[4548,5528,4548],"./Entities/Index":[914,9892],"./Execute/Index":[7643,7643],"./Light/Index":[1406,3490,3803,1406],"./LightHue/Index":[3674,3490,3803,1406,3674],"./Media/Index":[4196,3803,8337,7029,779,4196],"./MediaMplayer/Index":[6509,3803,8337,7029,779,4196,6509],"./MediaMpv/Index":[5895,3803,8337,7029,779,4196,5895],"./MediaOmxplayer/Index":[9633,3803,8337,7029,779,4196,9633],"./MediaVlc/Index":[767,3803,8337,7029,779,4196,767],"./Music/Index":[5781,3803,8337,7029,6833],"./MusicMpd/Index":[2957,3803,8337,7029,6833,2957],"./MusicSnapcast/Index":[2790,3490,3803,2790],"./MusicSpotify/Index":[7196,3803,8337,7029,6833,7196],"./Rtorrent/Index":[2820,8337,779,6162,2820],"./Settings/Index":[5392],"./Sound/Index":[5193,5193],"./Switches/Index":[4276,4276],"./Switches/LightHue/Index":[2844,3490,6590,2844],"./Switches/Smartthings/Index":[9196,3490,6590,9196],"./Switches/SwitchTplink/Index":[3785,3490,6590,3785],"./Switches/SwitchWemo/Index":[5210,3490,6590,5210],"./Switches/Switchbot/Index":[9694,3490,6590,9694],"./Switches/SwitchbotBluetooth/Index":[9694,3490,6590,9694],"./Switches/ZigbeeMqtt/Index":[5466,3490,6590,5466],"./Switches/Zwave/Index":[7262,3490,6590,7262],"./Switches/ZwaveMqtt/Index":[2380,3490,6590,2380],"./Torrent/Index":[9299,8337,779,6162,9299],"./Tts/Index":[2466,4021,2466],"./TtsGoogle/Index":[1938,4021,1938],"./TvSamsungWs/Index":[615,615],"./ZigbeeMqtt/Index":[4604,3490,3803,4604],"./Zwave/Index":[8586,3490,3803,4658,6027],"./ZwaveMqtt/Index":[2362,3490,3803,4658,2362]};function i(e){if(!n.o(s,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=s[e],i=t[0];return Promise.all(t.slice(1).map(n.e)).then((function(){return n(i)}))}i.keys=function(){return Object.keys(s)},i.id=3379,e.exports=i},6725:function(e,t,n){var s={"./Calendar/Index":[345,345],"./Camera/Index":[2346,2346],"./Component/Index":[5824,3490,3803,5824],"./DateTime/Index":[1595,9575,1595],"./DateTimeWeather/Index":[5779,1798,9575,5779],"./ImageCarousel/Index":[6003,1798,9575,6003],"./Music/Index":[6013,6013],"./Plugin/Index":[4826,4826],"./RssNews/Index":[7420,7420],"./Weather/Index":[1798,1798]};function i(e){if(!n.o(s,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=s[e],i=t[0];return Promise.all(t.slice(1).map(n.e)).then((function(){return n(i)}))}i.keys=function(){return Object.keys(s)},i.id=6725,e.exports=i},1359:function(e){"use strict";e.exports=JSON.parse('{"camera.android.ipcam":{"class":"fab fa-android"},"camera.cv":{"class":"fas fa-camera"},"camera.ffmpeg":{"class":"fas fa-camera"},"camera.gstreamer":{"class":"fas fa-camera"},"camera.ir.mlx90640":{"class":"fas fa-sun"},"camera.pi":{"class":"fas fa-camera"},"entities":{"class":"fa fa-home"},"execute":{"class":"fa fa-play"},"light.hue":{"class":"fas fa-lightbulb"},"media.jellyfin":{"imgUrl":"/icons/jellyfin.svg"},"media.kodi":{"imgUrl":"/icons/kodi.svg"},"media.omxplayer":{"class":"fa fa-film"},"media.mplayer":{"class":"fa fa-film"},"media.mpv":{"class":"fa fa-film"},"media.plex":{"imgUrl":"/icons/plex.svg"},"media.vlc":{"class":"fa fa-film"},"music.mpd":{"class":"fas fa-music"},"music.snapcast":{"class":"fa fa-volume-up"},"music.spotify":{"class":"fab fa-spotify"},"torrent":{"class":"fa fa-magnet"},"rtorrent":{"class":"fa fa-magnet"},"smartthings":{"imgUrl":"/icons/smartthings.png"},"switches":{"class":"fas fa-toggle-on"},"switch.switchbot":{"class":"fas fa-toggle-on"},"switch.tplink":{"class":"fas fa-toggle-on"},"switchbot":{"class":"fas fa-toggle-on"},"sound":{"class":"fa fa-microphone"},"tts":{"class":"far fa-comment"},"tts.google":{"class":"fas fa-comment"},"tv.samsung.ws":{"class":"fas fa-tv"},"zigbee.mqtt":{"imgUrl":"/icons/zigbee.svg"},"zwave":{"imgUrl":"/icons/z-wave.png"},"zwave.mqtt":{"imgUrl":"/icons/z-wave.png"}}')}},t={};function n(s){var i=t[s];if(void 0!==i)return i.exports;var r=t[s]={exports:{}};return e[s](r,r.exports,n),r.exports}n.m=e,function(){var e=[];n.O=function(t,s,i,r){if(!s){var a=1/0;for(u=0;u<e.length;u++){s=e[u][0],i=e[u][1],r=e[u][2];for(var o=!0,c=0;c<s.length;c++)(!1&r||a>=r)&&Object.keys(n.O).every((function(e){return n.O[e](s[c])}))?s.splice(c--,1):(o=!1,r<a&&(a=r));if(o){e.splice(u--,1);var l=i();void 0!==l&&(t=l)}}return t}r=r||0;for(var u=e.length;u>0&&e[u-1][2]>r;u--)e[u]=e[u-1];e[u]=[s,i,r]}}(),function(){n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,{a:t}),t}}(),function(){var e,t=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__};n.t=function(s,i){if(1&i&&(s=this(s)),8&i)return s;if("object"===typeof s&&s){if(4&i&&s.__esModule)return s;if(16&i&&"function"===typeof s.then)return s}var r=Object.create(null);n.r(r);var a={};e=e||[null,t({}),t([]),t(t)];for(var o=2&i&&s;"object"==typeof o&&!~e.indexOf(o);o=t(o))Object.getOwnPropertyNames(o).forEach((function(e){a[e]=function(){return s[e]}}));return a["default"]=function(){return s},n.d(r,a),r}}(),function(){n.d=function(e,t){for(var s in t)n.o(t,s)&&!n.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})}}(),function(){n.f={},n.e=function(e){return Promise.all(Object.keys(n.f).reduce((function(t,s){return n.f[s](e,t),t}),[]))}}(),function(){n.u=function(e){return"static/js/"+e+"-legacy."+{65:"a4e6662a",345:"dcb6e74e",518:"e665a841",615:"fba0e1b5",699:"cb1ccfbb",767:"f33d812b",779:"b22c1cc7",1155:"179db4ca",1406:"531be9a8",1595:"69aea4ae",1798:"b42f39d9",1938:"e350f72d",2346:"4845c2ae",2362:"6b95b958",2380:"0d05fcbd",2466:"b6981a49",2790:"2afcb92a",2820:"869be689",2844:"b3683bc2",2957:"a0d5f651",3490:"d482e29b",3499:"90eae609",3674:"1f20942d",3785:"5ec00494",3803:"9202f4bf",4021:"a3380d38",4196:"b3577e2e",4276:"18787ca7",4548:"e2883bdd",4604:"2f44612f",4658:"2b32d64d",4826:"f73c82f0",4981:"c4835180",5111:"262ea3c5",5193:"d8c2e027",5207:"b6625280",5210:"e39ce8e4",5466:"ba464f70",5528:"5b7db199",5779:"8c634228",5824:"a1aaa126",5895:"e1ce8e90",6003:"f3446996",6013:"b02eb716",6027:"1e7fc2ce",6162:"bf13f6e2",6509:"ab6d64c3",6590:"a024a679",6739:"c665b953",6833:"00db1080",7029:"66663032",7196:"a47a2493",7262:"13af887b",7420:"a57de4be",7643:"5b846090",8184:"702db0b7",8337:"fcf13df8",8729:"19ca396b",9196:"1cf345e1",9299:"adb4a75b",9575:"fb8eab70",9633:"8a00fadb",9694:"a11c42e2",9892:"4cf77440",9895:"acee9428"}[e]+".js"}}(),function(){n.miniCssF=function(e){return"static/css/"+e+"."+{65:"d6cbc229",345:"0d938275",518:"44f63b6e",615:"be187f79",779:"459f0f41",1155:"3c072b53",1406:"3c45f7ef",1798:"5047113b",2346:"f042c092",2380:"7e6cb2ed",2790:"8a938bab",2844:"fa1de455",3490:"3516cb6e",3785:"5ed5a4df",3803:"071120e4",4021:"0331be37",4196:"f1fcf8f5",4276:"07502cf2",4604:"34b220bc",4658:"0aa0c9b4",4826:"437fa334",4981:"8830c3ce",5193:"7f3c2173",5207:"831746a7",5210:"435161f9",5466:"fb0c1b5f",5528:"a4270756",5779:"b285a776",5824:"f9f7ad29",6003:"0868fde4",6013:"2141ef7f",6162:"f3d46bda",6590:"778aa4c7",6739:"649d4b27",6833:"c53bec53",7029:"13387da1",7262:"7ac2a7a5",7420:"e42d1496",7643:"e25374a8",8729:"f98d84da",9196:"18347c3c",9575:"eba29f96",9694:"509f8cb5",9892:"68b29dbb"}[e]+".css"}}(),function(){n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()}(),function(){n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(),function(){var e={},t="platypush:";n.l=function(s,i,r,a){if(e[s])e[s].push(i);else{var o,c;if(void 0!==r)for(var l=document.getElementsByTagName("script"),u=0;u<l.length;u++){var d=l[u];if(d.getAttribute("src")==s||d.getAttribute("data-webpack")==t+r){o=d;break}}o||(c=!0,o=document.createElement("script"),o.charset="utf-8",o.timeout=120,n.nc&&o.setAttribute("nonce",n.nc),o.setAttribute("data-webpack",t+r),o.src=s),e[s]=[i];var f=function(t,n){o.onerror=o.onload=null,clearTimeout(p);var i=e[s];if(delete e[s],o.parentNode&&o.parentNode.removeChild(o),i&&i.forEach((function(e){return e(n)})),t)return t(n)},p=setTimeout(f.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=f.bind(null,o.onerror),o.onload=f.bind(null,o.onload),c&&document.head.appendChild(o)}}}(),function(){n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}}(),function(){n.p="/"}(),function(){var e=function(e,t,n,s){var i=document.createElement("link");i.rel="stylesheet",i.type="text/css";var r=function(r){if(i.onerror=i.onload=null,"load"===r.type)n();else{var a=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.href||t,c=new Error("Loading CSS chunk "+e+" failed.\n("+o+")");c.code="CSS_CHUNK_LOAD_FAILED",c.type=a,c.request=o,i.parentNode.removeChild(i),s(c)}};return i.onerror=i.onload=r,i.href=t,document.head.appendChild(i),i},t=function(e,t){for(var n=document.getElementsByTagName("link"),s=0;s<n.length;s++){var i=n[s],r=i.getAttribute("data-href")||i.getAttribute("href");if("stylesheet"===i.rel&&(r===e||r===t))return i}var a=document.getElementsByTagName("style");for(s=0;s<a.length;s++){i=a[s],r=i.getAttribute("data-href");if(r===e||r===t)return i}},s=function(s){return new Promise((function(i,r){var a=n.miniCssF(s),o=n.p+a;if(t(a,o))return i();e(s,o,i,r)}))},i={2143:0};n.f.miniCss=function(e,t){var n={65:1,345:1,518:1,615:1,779:1,1155:1,1406:1,1798:1,2346:1,2380:1,2790:1,2844:1,3490:1,3785:1,3803:1,4021:1,4196:1,4276:1,4604:1,4658:1,4826:1,4981:1,5193:1,5207:1,5210:1,5466:1,5528:1,5779:1,5824:1,6003:1,6013:1,6162:1,6590:1,6739:1,6833:1,7029:1,7262:1,7420:1,7643:1,8729:1,9196:1,9575:1,9694:1,9892:1};i[e]?t.push(i[e]):0!==i[e]&&n[e]&&t.push(i[e]=s(e).then((function(){i[e]=0}),(function(t){throw delete i[e],t})))}}(),function(){var e={2143:0};n.f.j=function(t,s){var i=n.o(e,t)?e[t]:void 0;if(0!==i)if(i)s.push(i[2]);else if(/^((34|65)90|3803|4021|4981|6162|8729|9575)$/.test(t))e[t]=0;else{var r=new Promise((function(n,s){i=e[t]=[n,s]}));s.push(i[2]=r);var a=n.p+n.u(t),o=new Error,c=function(s){if(n.o(e,t)&&(i=e[t],0!==i&&(e[t]=void 0),i)){var r=s&&("load"===s.type?"missing":s.type),a=s&&s.target&&s.target.src;o.message="Loading chunk "+t+" failed.\n("+r+": "+a+")",o.name="ChunkLoadError",o.type=r,o.request=a,i[1](o)}};n.l(a,c,"chunk-"+t,t)}},n.O.j=function(t){return 0===e[t]};var t=function(t,s){var i,r,a=s[0],o=s[1],c=s[2],l=0;if(a.some((function(t){return 0!==e[t]}))){for(i in o)n.o(o,i)&&(n.m[i]=o[i]);if(c)var u=c(n)}for(t&&t(s);l<a.length;l++)r=a[l],n.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return n.O(u)},s=self["webpackChunkplatypush"]=self["webpackChunkplatypush"]||[];s.forEach(t.bind(null,0)),s.push=t.bind(null,s.push.bind(s))}();var s=n.O(void 0,[4998],(function(){return n(5736)}));s=n.O(s)})();
//# sourceMappingURL=app-legacy.3e3e09b7.js.map