vue-express-mongo-boilerplate
Version:
Express NodeJS application server boilerplate with Mongo and VueJS
2 lines • 203 kB
JavaScript
webpackJsonp([0],[,,,,,,,,,,,,,,,,function(t,e,s){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var s=0;s<e.length;s++){var i=e[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,s,i){return s&&t(e.prototype,s),i&&t(e,i),e}}(),r=s(20),o=i(r),c=s(529),l=i(c),u=s(79),d=i(u),f=s(77),p=i(f);window.gql=d.default;var h=(0,f.createNetworkInterface)({uri:"/graphql",opts:{credentials:"same-origin"}}),m=new p.default({networkInterface:h}),v=function(){function t(e,s,i){n(this,t),s?this.socket=s.$socket:this.socket=(0,l.default)(i),this.namespace=e,this.axios=o.default.create({baseURL:"/api/"+e+"/",responseType:"json"})}return a(t,[{key:"rest",value:function(t,e){var s=this;return new Promise(function(i,n){s.axios.request(t,{method:"post",data:e}).then(function(t){t.data&&t.data.data?i(t.data.data):n(t)}).catch(function(t){t.response&&t.response.data&&t.response.data.error?(console.error("REST request error!",t.response.data.error),n(t.response.data.error)):n(t)})})}},{key:"emit",value:function(t,e){var s=this;return new Promise(function(i,n){s.socket.emit("/"+s.namespace+"/"+t,e,function(t){t&&200==t.status?i(t.data):(console.error("Socket emit error!",t.error),n(t.error))})})}},{key:"query",value:function(t,e,s){return m.query({query:t,variables:e,fragments:s,forceFetch:!0}).then(function(t){return t.data}).catch(function(t){var e=t;throw t.graphQLErrors&&t.graphQLErrors.length>0&&(e=t.graphQLErrors[0]),e})}},{key:"watchQuery",value:function(t,e,s,i){return m.watchQuery({query:t,variables:e,fragments:s,pollInterval:i,forceFetch:!0})}},{key:"mutate",value:function(t,e,s){return m.mutate({mutation:t,variables:e,fragments:s}).then(function(t){return t.data}).catch(function(t){var e=t;throw t.graphQLErrors&&t.graphQLErrors.length>0&&(e=t.graphQLErrors[0]),e})}}]),t}();e.default=v},function(t,e,s){(function(t){function i(t,s){var i="b"+e.packets[t.type]+t.data.data;return s(i)}function n(t,s,i){if(!s)return e.encodeBase64Packet(t,i);var n=t.data,a=new Uint8Array(n),r=new Uint8Array(1+n.byteLength);r[0]=b[t.type];for(var o=0;o<a.length;o++)r[o+1]=a[o];return i(r.buffer)}function a(t,s,i){if(!s)return e.encodeBase64Packet(t,i);var n=new FileReader;return n.onload=function(){t.data=n.result,e.encodePacket(t,s,!0,i)},n.readAsArrayBuffer(t.data)}function r(t,s,i){if(!s)return e.encodeBase64Packet(t,i);if(g)return a(t,s,i);var n=new Uint8Array(1);n[0]=b[t.type];var r=new _([n.buffer,t.data]);return i(r)}function o(t){try{t=h.decode(t)}catch(t){return!1}return t}function c(t,e,s){for(var i=new Array(t.length),n=p(t.length,s),a=function(t,s,n){e(s,function(e,s){i[t]=s,n(e,i)})},r=0;r<t.length;r++)a(r,t[r],n)}var l,u=s(348),d=s(100),f=s(278),p=s(264),h=s(573);t&&t.ArrayBuffer&&(l=s(334));var m="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),v="undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),g=m||v;e.protocol=3;var b=e.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},y=u(b),C={type:"error",data:"parser error"},_=s(335);e.encodePacket=function(e,s,a,o){"function"==typeof s&&(o=s,s=!1),"function"==typeof a&&(o=a,a=null);var c=void 0===e.data?void 0:e.data.buffer||e.data;if(t.ArrayBuffer&&c instanceof ArrayBuffer)return n(e,s,o);if(_&&c instanceof t.Blob)return r(e,s,o);if(c&&c.base64)return i(e,o);var l=b[e.type];return void 0!==e.data&&(l+=a?h.encode(String(e.data)):String(e.data)),o(""+l)},e.encodeBase64Packet=function(s,i){var n="b"+e.packets[s.type];if(_&&s.data instanceof t.Blob){var a=new FileReader;return a.onload=function(){var t=a.result.split(",")[1];i(n+t)},a.readAsDataURL(s.data)}var r;try{r=String.fromCharCode.apply(null,new Uint8Array(s.data))}catch(t){for(var o=new Uint8Array(s.data),c=new Array(o.length),l=0;l<o.length;l++)c[l]=o[l];r=String.fromCharCode.apply(null,c)}return n+=t.btoa(r),i(n)},e.decodePacket=function(t,s,i){if(void 0===t)return C;if("string"==typeof t){if("b"==t.charAt(0))return e.decodeBase64Packet(t.substr(1),s);if(i&&(t=o(t),t===!1))return C;var n=t.charAt(0);return Number(n)==n&&y[n]?t.length>1?{type:y[n],data:t.substring(1)}:{type:y[n]}:C}var a=new Uint8Array(t),n=a[0],r=f(t,1);return _&&"blob"===s&&(r=new _([r])),{type:y[n],data:r}},e.decodeBase64Packet=function(t,e){var s=y[t.charAt(0)];if(!l)return{type:s,data:{base64:!0,data:t.substr(1)}};var i=l.decode(t.substr(1));return"blob"===e&&_&&(i=new _([i])),{type:s,data:i}},e.encodePayload=function(t,s,i){function n(t){return t.length+":"+t}function a(t,i){e.encodePacket(t,!!r&&s,!0,function(t){i(null,n(t))})}"function"==typeof s&&(i=s,s=null);var r=d(t);return s&&r?_&&!g?e.encodePayloadAsBlob(t,i):e.encodePayloadAsArrayBuffer(t,i):t.length?void c(t,a,function(t,e){return i(e.join(""))}):i("0:")},e.decodePayload=function(t,s,i){if("string"!=typeof t)return e.decodePayloadAsBinary(t,s,i);"function"==typeof s&&(i=s,s=null);var n;if(""==t)return i(C,0,1);for(var a,r,o="",c=0,l=t.length;c<l;c++){var u=t.charAt(c);if(":"!=u)o+=u;else{if(""==o||o!=(a=Number(o)))return i(C,0,1);if(r=t.substr(c+1,a),o!=r.length)return i(C,0,1);if(r.length){if(n=e.decodePacket(r,s,!0),C.type==n.type&&C.data==n.data)return i(C,0,1);var d=i(n,c+a,l);if(!1===d)return}c+=a,o=""}}return""!=o?i(C,0,1):void 0},e.encodePayloadAsArrayBuffer=function(t,s){function i(t,s){e.encodePacket(t,!0,!0,function(t){return s(null,t)})}return t.length?void c(t,i,function(t,e){var i=e.reduce(function(t,e){var s;return s="string"==typeof e?e.length:e.byteLength,t+s.toString().length+s+2},0),n=new Uint8Array(i),a=0;return e.forEach(function(t){var e="string"==typeof t,s=t;if(e){for(var i=new Uint8Array(t.length),r=0;r<t.length;r++)i[r]=t.charCodeAt(r);s=i.buffer}e?n[a++]=0:n[a++]=1;for(var o=s.byteLength.toString(),r=0;r<o.length;r++)n[a++]=parseInt(o[r]);n[a++]=255;for(var i=new Uint8Array(s),r=0;r<i.length;r++)n[a++]=i[r]}),s(n.buffer)}):s(new ArrayBuffer(0))},e.encodePayloadAsBlob=function(t,s){function i(t,s){e.encodePacket(t,!0,!0,function(t){var e=new Uint8Array(1);if(e[0]=1,"string"==typeof t){for(var i=new Uint8Array(t.length),n=0;n<t.length;n++)i[n]=t.charCodeAt(n);t=i.buffer,e[0]=0}for(var a=t instanceof ArrayBuffer?t.byteLength:t.size,r=a.toString(),o=new Uint8Array(r.length+1),n=0;n<r.length;n++)o[n]=parseInt(r[n]);if(o[r.length]=255,_){var c=new _([e.buffer,o.buffer,t]);s(null,c)}})}c(t,i,function(t,e){return s(new _(e))})},e.decodePayloadAsBinary=function(t,s,i){"function"==typeof s&&(i=s,s=null);for(var n=t,a=[],r=!1;n.byteLength>0;){for(var o=new Uint8Array(n),c=0===o[0],l="",u=1;255!=o[u];u++){if(l.length>310){r=!0;break}l+=o[u]}if(r)return i(C,0,1);n=f(n,2+l.length),l=parseInt(l);var d=f(n,0,l);if(c)try{d=String.fromCharCode.apply(null,new Uint8Array(d))}catch(t){var p=new Uint8Array(d);d="";for(var u=0;u<p.length;u++)d+=String.fromCharCode(p[u])}a.push(d),n=f(n,l)}var h=a.length;a.forEach(function(t,n){i(e.decodePacket(t,s,!0),n,h)})}}).call(e,s(1))},,,,,,,function(t,e,s){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),s(535);var n=s(539),a=i(n);a.default.options={debug:!1,newestOnTop:!0,timeOut:5e3},e.default=a.default},function(t,e,s){function i(t){if(t)return n(t)}function n(t){for(var e in i.prototype)t[e]=i.prototype[e];return t}t.exports=i,i.prototype.on=i.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},i.prototype.once=function(t,e){function s(){this.off(t,s),e.apply(this,arguments)}return s.fn=e,this.on(t,s),this},i.prototype.off=i.prototype.removeListener=i.prototype.removeAllListeners=i.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var s=this._callbacks["$"+t];if(!s)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var i,n=0;n<s.length;n++)if(i=s[n],i===e||i.fn===e){s.splice(n,1);break}return this},i.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),s=this._callbacks["$"+t];if(s){s=s.slice(0);for(var i=0,n=s.length;i<n;++i)s[i].apply(this,e)}return this},i.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},i.prototype.hasListeners=function(t){return!!this.listeners(t).length}},,,,,,,,,,function(t,e){t.exports=function(t,e){var s=function(){};s.prototype=e.prototype,t.prototype=new s,t.prototype.constructor=t}},function(t,e,s){(function(i){function n(){return"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function a(){var t=arguments,s=this.useColors;if(t[0]=(s?"%c":"")+this.namespace+(s?" %c":" ")+t[0]+(s?"%c ":" ")+"+"+e.humanize(this.diff),!s)return t;var i="color: "+this.color;t=[t[0],i,"color: inherit"].concat(Array.prototype.slice.call(t,1));var n=0,a=0;return t[0].replace(/%[a-z%]/g,function(t){"%%"!==t&&(n++,"%c"===t&&(a=n))}),t.splice(a,0,i),t}function r(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function o(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch(t){}}function c(){try{return e.storage.debug}catch(t){}if("undefined"!=typeof i&&"env"in i)return{NODE_ENV:"production"}.DEBUG}function l(){try{return window.localStorage}catch(t){}}e=t.exports=s(347),e.log=r,e.formatArgs=a,e.save=o,e.load=c,e.useColors=n,e.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:l(),e.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],e.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},e.enable(c())}).call(e,s(49))},,,,,,,,,,,,,,function(t,e,s){(function(i){function n(){return"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function a(){var t=arguments,s=this.useColors;if(t[0]=(s?"%c":"")+this.namespace+(s?" %c":" ")+t[0]+(s?"%c ":" ")+"+"+e.humanize(this.diff),!s)return t;var i="color: "+this.color;t=[t[0],i,"color: inherit"].concat(Array.prototype.slice.call(t,1));var n=0,a=0;return t[0].replace(/%[a-z%]/g,function(t){"%%"!==t&&(n++,"%c"===t&&(a=n))}),t.splice(a,0,i),t}function r(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function o(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch(t){}}function c(){try{return e.storage.debug}catch(t){}if("undefined"!=typeof i&&"env"in i)return{NODE_ENV:"production"}.DEBUG}function l(){try{return window.localStorage}catch(t){}}e=t.exports=s(531),e.log=r,e.formatArgs=a,e.save=o,e.load=c,e.useColors=n,e.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:l(),e.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],e.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},e.enable(c())}).call(e,s(49))},,,,,,,function(t,e,s){function i(t){this.path=t.path,this.hostname=t.hostname,this.port=t.port,this.secure=t.secure,this.query=t.query,this.timestampParam=t.timestampParam,this.timestampRequests=t.timestampRequests,this.readyState="",this.agent=t.agent||!1,this.socket=t.socket,this.enablesXDR=t.enablesXDR,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.forceNode=t.forceNode,this.extraHeaders=t.extraHeaders,this.localAddress=t.localAddress}var n=s(17),a=s(25);t.exports=i,a(i.prototype),i.prototype.onError=function(t,e){var s=new Error(t);return s.type="TransportError",s.description=e,this.emit("error",s),this},i.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},i.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},i.prototype.send=function(t){if("open"!==this.readyState)throw new Error("Transport not open");this.write(t)},i.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},i.prototype.onData=function(t){var e=n.decodePacket(t,this.socket.binaryType);this.onPacket(e)},i.prototype.onPacket=function(t){this.emit("packet",t)},i.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},function(t,e,s){(function(e){var i=s(371);t.exports=function(t){var s=t.xdomain,n=t.xscheme,a=t.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!s||i))return new XMLHttpRequest}catch(t){}try{if("undefined"!=typeof XDomainRequest&&!n&&a)return new XDomainRequest}catch(t){}if(!s)try{return new(e[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}}).call(e,s(1))},,,,,,,,,,,,,,,,,function(t,e){e.encode=function(t){var e="";for(var s in t)t.hasOwnProperty(s)&&(e.length&&(e+="&"),e+=encodeURIComponent(s)+"="+encodeURIComponent(t[s]));return e},e.decode=function(t){for(var e={},s=t.split("&"),i=0,n=s.length;i<n;i++){var a=s[i].split("=");e[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return e}},function(t,e,s){function i(){}function n(t){var s="",i=!1;return s+=t.type,e.BINARY_EVENT!=t.type&&e.BINARY_ACK!=t.type||(s+=t.attachments,s+="-"),t.nsp&&"/"!=t.nsp&&(i=!0,s+=t.nsp),null!=t.id&&(i&&(s+=",",i=!1),s+=t.id),null!=t.data&&(i&&(s+=","),s+=f.stringify(t.data)),d("encoded %j as %s",t,s),s}function a(t,e){function s(t){var s=h.deconstructPacket(t),i=n(s.packet),a=s.buffers;a.unshift(i),e(a)}h.removeBlobs(t,s)}function r(){this.reconstructor=null}function o(t){var s={},i=0;if(s.type=Number(t.charAt(0)),null==e.types[s.type])return u();if(e.BINARY_EVENT==s.type||e.BINARY_ACK==s.type){for(var n="";"-"!=t.charAt(++i)&&(n+=t.charAt(i),i!=t.length););if(n!=Number(n)||"-"!=t.charAt(i))throw new Error("Illegal attachments");s.attachments=Number(n)}if("/"==t.charAt(i+1))for(s.nsp="";++i;){var a=t.charAt(i);if(","==a)break;if(s.nsp+=a,i==t.length)break}else s.nsp="/";var r=t.charAt(i+1);if(""!==r&&Number(r)==r){for(s.id="";++i;){var a=t.charAt(i);if(null==a||Number(a)!=a){--i;break}if(s.id+=t.charAt(i),i==t.length)break}s.id=Number(s.id)}return t.charAt(++i)&&(s=c(s,t.substr(i))),d("decoded %s as %j",t,s),s}function c(t,e){try{t.data=f.parse(e)}catch(t){return u()}return t}function l(t){this.reconPack=t,this.buffers=[]}function u(t){return{type:e.ERROR,data:"parser error"}}var d=s(338)("socket.io-parser"),f=s(393),p=s(533),h=s(532),m=s(256);e.protocol=4,e.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],e.CONNECT=0,e.DISCONNECT=1,e.EVENT=2,e.ACK=3,e.ERROR=4,e.BINARY_EVENT=5,e.BINARY_ACK=6,e.Encoder=i,e.Decoder=r,i.prototype.encode=function(t,s){if(d("encoding packet %j",t),e.BINARY_EVENT==t.type||e.BINARY_ACK==t.type)a(t,s);else{var i=n(t);s([i])}},p(r.prototype),r.prototype.add=function(t){var s;if("string"==typeof t)s=o(t),e.BINARY_EVENT==s.type||e.BINARY_ACK==s.type?(this.reconstructor=new l(s),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",s)):this.emit("decoded",s);else{if(!m(t)&&!t.base64)throw new Error("Unknown type: "+t);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");s=this.reconstructor.takeBinaryData(t),s&&(this.reconstructor=null,this.emit("decoded",s))}},r.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},l.prototype.takeBinaryData=function(t){if(this.buffers.push(t),this.buffers.length==this.reconPack.attachments){var e=h.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null},l.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},,,,,,,,,,,,,,,,,function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.LOAD="LOAD",e.ADD="ADD",e.SELECT="SELECT",e.CLEAR_SELECT="CLEAR_SELECT",e.UPDATE="UPDATE",e.REMOVE="REMOVE"},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.LOAD="LOAD",e.LOAD_MORE="LOAD_MORE",e.ADD="ADD",e.UPDATE="UPDATE",e.REMOVE="REMOVE",e.FETCHING="FETCHING",e.NO_MORE_ITEMS="NO_MORE_ITEMS",e.CLEAR="CLEAR",e.CHANGE_SORT="CHANGE_SORT",e.CHANGE_VIEWMODE="CHANGE_VIEWMODE",e.VOTE="VOTE",e.UNVOTE="UNVOTE"},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.SEARCH="SEARCH",e.ADD_NOTIFICATION="ADD_NOTIFICATION",e.ADD_MESSAGE="ADD_MESSAGE",e.SET_USER="SET_SESSION_USER"},function(t,e){var s=[].slice;t.exports=function(t,e){if("string"==typeof e&&(e=t[e]),"function"!=typeof e)throw new Error("bind() requires a function");var i=s.call(arguments,2);return function(){return e.apply(t,i.concat(s.call(arguments)))}}},function(t,e,s){(function(t){function i(e){var s,i=!1,o=!1,c=!1!==e.jsonp;if(t.location){var l="https:"===location.protocol,u=location.port;u||(u=l?443:80),i=e.hostname!==location.hostname||u!==e.port,o=e.secure!==l}if(e.xdomain=i,e.xscheme=o,s=new n(e),"open"in s&&!e.forceJSONP)return new a(e);if(!c)throw new Error("JSONP disabled");return new r(e)}var n=s(58),a=s(345),r=s(344),o=s(346);e.polling=i,e.websocket=o}).call(e,s(1))},function(t,e,s){function i(t){var e=t&&t.forceBase64;u&&!e||(this.supportsBinary=!1),n.call(this,t)}var n=s(57),a=s(75),r=s(17),o=s(35),c=s(260),l=s(36)("engine.io-client:polling");t.exports=i;var u=function(){var t=s(58),e=new t({xdomain:!1});return null!=e.responseType}();o(i,n),i.prototype.name="polling",i.prototype.doOpen=function(){this.poll()},i.prototype.pause=function(t){function e(){l("paused"),s.readyState="paused",t()}var s=this;if(this.readyState="pausing",this.polling||!this.writable){var i=0;this.polling&&(l("we are currently polling - waiting to pause"),i++,this.once("pollComplete",function(){l("pre-pause polling complete"),--i||e()})),this.writable||(l("we are currently writing - waiting to pause"),i++,this.once("drain",function(){l("pre-pause writing complete"),--i||e()}))}else e()},i.prototype.poll=function(){l("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},i.prototype.onData=function(t){var e=this;l("polling got data %s",t);var s=function(t,s,i){return"opening"===e.readyState&&e.onOpen(),"close"===t.type?(e.onClose(),!1):void e.onPacket(t)};r.decodePayload(t,this.socket.binaryType,s),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():l('ignoring poll - transport state "%s"',this.readyState))},i.prototype.doClose=function(){function t(){l("writing close packet"),e.write([{type:"close"}])}var e=this;"open"===this.readyState?(l("transport open - closing"),t()):(l("transport not open - deferring close"),this.once("open",t))},i.prototype.write=function(t){var e=this;this.writable=!1;var s=function(){e.writable=!0,e.emit("drain")};r.encodePayload(t,this.supportsBinary,function(t){e.doWrite(t,s)})},i.prototype.uri=function(){var t=this.query||{},e=this.secure?"https":"http",s="";!1!==this.timestampRequests&&(t[this.timestampParam]=c()),this.supportsBinary||t.sid||(t.b64=1),t=a.encode(t),this.port&&("https"===e&&443!==Number(this.port)||"http"===e&&80!==Number(this.port))&&(s=":"+this.port),t.length&&(t="?"+t);var i=this.hostname.indexOf(":")!==-1;return e+"://"+(i?"["+this.hostname+"]":this.hostname)+s+this.path+t}},,function(t,e,s){(function(e){function i(t){function s(t){if(!t)return!1;if(e.Buffer&&e.Buffer.isBuffer&&e.Buffer.isBuffer(t)||e.ArrayBuffer&&t instanceof ArrayBuffer||e.Blob&&t instanceof Blob||e.File&&t instanceof File)return!0;if(n(t)){for(var i=0;i<t.length;i++)if(s(t[i]))return!0}else if(t&&"object"==typeof t){t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON());for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a)&&s(t[a]))return!0}return!1}return s(t)}var n=s(104);t.exports=i}).call(e,s(1))},,,function(t,e){var s=[].indexOf;t.exports=function(t,e){if(s)return t.indexOf(e);for(var i=0;i<t.length;++i)if(t[i]===e)return i;return-1}},function(t,e){t.exports=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e){function s(t){if(t=String(t),!(t.length>1e4)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var s=parseFloat(e[1]),i=(e[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return s*u;case"days":case"day":case"d":return s*l;case"hours":case"hour":case"hrs":case"hr":case"h":return s*c;case"minutes":case"minute":case"mins":case"min":case"m":return s*o;case"seconds":case"second":case"secs":case"sec":case"s":return s*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}function i(t){return t>=l?Math.round(t/l)+"d":t>=c?Math.round(t/c)+"h":t>=o?Math.round(t/o)+"m":t>=r?Math.round(t/r)+"s":t+"ms"}function n(t){return a(t,l,"day")||a(t,c,"hour")||a(t,o,"minute")||a(t,r,"second")||t+" ms"}function a(t,e,s){if(!(t<e))return t<1.5*e?Math.floor(t/e)+" "+s:Math.ceil(t/e)+" "+s+"s"}var r=1e3,o=60*r,c=60*o,l=24*c,u=365.25*l;t.exports=function(t,e){e=e||{};var a=typeof t;if("string"===a&&t.length>0)return s(t);if("number"===a&&isNaN(t)===!1)return e.long?n(t):i(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},function(t,e){var s=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,i=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.exports=function(t){var e=t,n=t.indexOf("["),a=t.indexOf("]");n!=-1&&a!=-1&&(t=t.substring(0,n)+t.substring(n,a).replace(/:/g,";")+t.substring(a,t.length));for(var r=s.exec(t||""),o={},c=14;c--;)o[i[c]]=r[c]||"";return n!=-1&&a!=-1&&(o.source=e,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o}},,,,function(t,e,s){function i(t,e){return this instanceof i?(t&&"object"==typeof t&&(e=t,t=void 0),e=e||{},e.path=e.path||"/socket.io",this.nsps={},this.subs=[],this.opts=e,this.reconnection(e.reconnection!==!1),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor(e.randomizationFactor||.5),this.backoff=new f({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==e.timeout?2e4:e.timeout),this.readyState="closed",this.uri=t,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[],this.encoder=new o.Encoder,this.decoder=new o.Decoder,this.autoConnect=e.autoConnect!==!1,void(this.autoConnect&&this.open())):new i(t,e)}var n=s(341),a=s(255),r=s(25),o=s(76),c=s(254),l=s(96),u=s(50)("socket.io-client:manager"),d=s(103),f=s(333),p=Object.prototype.hasOwnProperty;t.exports=i,i.prototype.emitAll=function(){this.emit.apply(this,arguments);for(var t in this.nsps)p.call(this.nsps,t)&&this.nsps[t].emit.apply(this.nsps[t],arguments)},i.prototype.updateSocketIds=function(){for(var t in this.nsps)p.call(this.nsps,t)&&(this.nsps[t].id=this.engine.id)},r(i.prototype),i.prototype.reconnection=function(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection},i.prototype.reconnectionAttempts=function(t){return arguments.length?(this._reconnectionAttempts=t,this):this._reconnectionAttempts},i.prototype.reconnectionDelay=function(t){return arguments.length?(this._reconnectionDelay=t,this.backoff&&this.backoff.setMin(t),this):this._reconnectionDelay},i.prototype.randomizationFactor=function(t){return arguments.length?(this._randomizationFactor=t,this.backoff&&this.backoff.setJitter(t),this):this._randomizationFactor},i.prototype.reconnectionDelayMax=function(t){return arguments.length?(this._reconnectionDelayMax=t,this.backoff&&this.backoff.setMax(t),this):this._reconnectionDelayMax},i.prototype.timeout=function(t){return arguments.length?(this._timeout=t,this):this._timeout},i.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},i.prototype.open=i.prototype.connect=function(t,e){if(u("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;u("opening %s",this.uri),this.engine=n(this.uri,this.opts);var s=this.engine,i=this;this.readyState="opening",this.skipReconnect=!1;var a=c(s,"open",function(){i.onopen(),t&&t()}),r=c(s,"error",function(e){if(u("connect_error"),i.cleanup(),i.readyState="closed",i.emitAll("connect_error",e),t){var s=new Error("Connection error");s.data=e,t(s)}else i.maybeReconnectOnOpen()});if(!1!==this._timeout){var o=this._timeout;u("connect attempt will timeout after %d",o);var l=setTimeout(function(){u("connect attempt timed out after %d",o),a.destroy(),s.close(),s.emit("error","timeout"),i.emitAll("connect_timeout",o)},o);this.subs.push({destroy:function(){clearTimeout(l)}})}return this.subs.push(a),this.subs.push(r),this},i.prototype.onopen=function(){u("open"),this.cleanup(),this.readyState="open",this.emit("open");var t=this.engine;this.subs.push(c(t,"data",l(this,"ondata"))),this.subs.push(c(t,"ping",l(this,"onping"))),this.subs.push(c(t,"pong",l(this,"onpong"))),this.subs.push(c(t,"error",l(this,"onerror"))),this.subs.push(c(t,"close",l(this,"onclose"))),this.subs.push(c(this.decoder,"decoded",l(this,"ondecoded")))},i.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},i.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},i.prototype.ondata=function(t){this.decoder.add(t)},i.prototype.ondecoded=function(t){this.emit("packet",t)},i.prototype.onerror=function(t){u("error",t),this.emitAll("error",t)},i.prototype.socket=function(t,e){function s(){~d(n.connecting,i)||n.connecting.push(i)}var i=this.nsps[t];if(!i){i=new a(this,t,e),this.nsps[t]=i;var n=this;i.on("connecting",s),i.on("connect",function(){i.id=n.engine.id}),this.autoConnect&&s()}return i},i.prototype.destroy=function(t){var e=d(this.connecting,t);~e&&this.connecting.splice(e,1),this.connecting.length||this.close()},i.prototype.packet=function(t){u("writing packet %j",t);var e=this;t.query&&0===t.type&&(t.nsp+="?"+t.query),e.encoding?e.packetBuffer.push(t):(e.encoding=!0,this.encoder.encode(t,function(s){for(var i=0;i<s.length;i++)e.engine.write(s[i],t.options);e.encoding=!1,e.processPacketQueue()}))},i.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var t=this.packetBuffer.shift();this.packet(t)}},i.prototype.cleanup=function(){u("cleanup");for(var t=this.subs.length,e=0;e<t;e++){var s=this.subs.shift();s.destroy()}this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},i.prototype.close=i.prototype.disconnect=function(){u("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,"opening"===this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},i.prototype.onclose=function(t){u("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",t),this._reconnection&&!this.skipReconnect&&this.reconnect()},i.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var t=this;if(this.backoff.attempts>=this._reconnectionAttempts)u("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var e=this.backoff.duration();u("will wait %dms before reconnect attempt",e),this.reconnecting=!0;var s=setTimeout(function(){t.skipReconnect||(u("attempting reconnect"),t.emitAll("reconnect_attempt",t.backoff.attempts),t.emitAll("reconnecting",t.backoff.attempts),t.skipReconnect||t.open(function(e){e?(u("reconnect attempt error"),t.reconnecting=!1,t.reconnect(),t.emitAll("reconnect_error",e.data)):(u("reconnect success"),t.onreconnect())}))},e);this.subs.push({destroy:function(){clearTimeout(s)}})}},i.prototype.onreconnect=function(){var t=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",t)}},function(t,e){function s(t,e,s){return t.on(e,s),{destroy:function(){t.removeListener(e,s)}}}t.exports=s},function(t,e,s){function i(t,e,s){this.io=t,this.nsp=e,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,s&&s.query&&(this.query=s.query),this.io.autoConnect&&this.open()}var n=s(76),a=s(25),r=s(538),o=s(254),c=s(96),l=s(50)("socket.io-client:socket"),u=s(100);t.exports=e=i;var d={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},f=a.prototype.emit;a(i.prototype),i.prototype.subEvents=function(){if(!this.subs){var t=this.io;this.subs=[o(t,"open",c(this,"onopen")),o(t,"packet",c(this,"onpacket")),o(t,"close",c(this,"onclose"))]}},i.prototype.open=i.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting"),this)},i.prototype.send=function(){var t=r(arguments);return t.unshift("message"),this.emit.apply(this,t),this},i.prototype.emit=function(t){if(d.hasOwnProperty(t))return f.apply(this,arguments),this;var e=r(arguments),s=n.EVENT;u(e)&&(s=n.BINARY_EVENT);var i={type:s,data:e};return i.options={},i.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof e[e.length-1]&&(l("emitting packet with ack id %d",this.ids),this.acks[this.ids]=e.pop(),i.id=this.ids++),this.connected?this.packet(i):this.sendBuffer.push(i),delete this.flags,this},i.prototype.packet=function(t){t.nsp=this.nsp,this.io.packet(t)},i.prototype.onopen=function(){l("transport is open - connecting"),"/"!==this.nsp&&(this.query?this.packet({type:n.CONNECT,query:this.query}):this.packet({type:n.CONNECT}))},i.prototype.onclose=function(t){l("close (%s)",t),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",t)},i.prototype.onpacket=function(t){if(t.nsp===this.nsp)switch(t.type){case n.CONNECT:this.onconnect();break;case n.EVENT:this.onevent(t);break;case n.BINARY_EVENT:this.onevent(t);break;case n.ACK:this.onack(t);break;case n.BINARY_ACK:this.onack(t);break;case n.DISCONNECT:this.ondisconnect();break;case n.ERROR:this.emit("error",t.data)}},i.prototype.onevent=function(t){var e=t.data||[];l("emitting event %j",e),null!=t.id&&(l("attaching ack callback to event"),e.push(this.ack(t.id))),this.connected?f.apply(this,e):this.receiveBuffer.push(e)},i.prototype.ack=function(t){var e=this,s=!1;return function(){if(!s){s=!0;var i=r(arguments);l("sending ack %j",i);var a=u(i)?n.BINARY_ACK:n.ACK;e.packet({type:a,id:t,data:i})}}},i.prototype.onack=function(t){var e=this.acks[t.id];"function"==typeof e?(l("calling ack %s with %j",t.id,t.data),e.apply(this,t.data),delete this.acks[t.id]):l("bad ack %s",t.id)},i.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},i.prototype.emitBuffered=function(){var t;for(t=0;t<this.receiveBuffer.length;t++)f.apply(this,this.receiveBuffer[t]);
for(this.receiveBuffer=[],t=0;t<this.sendBuffer.length;t++)this.packet(this.sendBuffer[t]);this.sendBuffer=[]},i.prototype.ondisconnect=function(){l("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},i.prototype.destroy=function(){if(this.subs){for(var t=0;t<this.subs.length;t++)this.subs[t].destroy();this.subs=null}this.io.destroy(this)},i.prototype.close=i.prototype.disconnect=function(){return this.connected&&(l("performing disconnect (%s)",this.nsp),this.packet({type:n.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},i.prototype.compress=function(t){return this.flags=this.flags||{},this.flags.compress=t,this}},function(t,e,s){(function(e){function s(t){return e.Buffer&&e.Buffer.isBuffer(t)||e.ArrayBuffer&&t instanceof ArrayBuffer}t.exports=s}).call(e,s(1))},,,,function(t,e,s){"use strict";function i(t){var e="";do e=o[t%c]+e,t=Math.floor(t/c);while(t>0);return e}function n(t){var e=0;for(d=0;d<t.length;d++)e=e*c+l[t.charAt(d)];return e}function a(){var t=i(+new Date);return t!==r?(u=0,r=t):t+"."+i(u++)}for(var r,o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),c=64,l={},u=0,d=0;d<c;d++)l[o[d]]=d;a.encode=i,a.decode=n,t.exports=a},function(t,e,s){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}var n=s(2),a=i(n),r=s(20),o=i(r),c=s(296),l=i(c),u=s(297),d=i(u),f=s(21),p=i(f),h=s(82),m=i(h),v=s(299),g=i(v),b=s(540),y=i(b);s(349),o.default.defaults.headers.post["Content-Type"]="application/json",a.default.use(l.default),a.default.use(p.default),a.default.use(m.default),a.default.use(d.default,function(t){var e=s(298).default;new a.default({el:"#app",components:{App:y.default},router:e,store:g.default,render:function(t){return t("app")}})})},,,function(t,e){function s(t,e,s){function n(t,i){if(n.count<=0)throw new Error("after called too many times");--n.count,t?(a=!0,e(t),e=s):0!==n.count||a||e(null,i)}var a=!1;return s=s||i,n.count=t,0===t?e():n}function i(){}t.exports=s},,,,,,,,,,,,,,function(t,e){t.exports=function(t,e,s){var i=t.byteLength;if(e=e||0,s=s||i,t.slice)return t.slice(e,s);if(e<0&&(e+=i),s<0&&(s+=i),s>i&&(s=i),e>=i||e>=s||0===i)return new ArrayBuffer(0);for(var n=new Uint8Array(t),a=new Uint8Array(s-e),r=e,o=0;r<s;r++,o++)a[o]=n[r];return a.buffer}},,,,,,,,,,,,,,,,,,function(t,e,s){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=s(0),a=i(n),r={prettyJSON:function(t){if(t)return t=JSON.stringify(t,void 0,4),t=t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),t.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,function(t){var e="number";return/^"/.test(t)?e=/:$/.test(t)?"key":"string":/true|false/.test(t)?e="boolean":/null/.test(t)&&(e="null"),'<span class="'+e+'">'+t+"</span>"})},ago:function(t){return(0,a.default)(t).fromNow()},truncate:function(t,e){return t&&t.length>e?t.substr(0,e-1)+"…":t}};e.default={filters:r,install:function(t){var e=Object.keys(r);e.forEach(function(e){return t.filter(e,r[e])})}}},function(t,e,s){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function n(t,e){arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};c.default.use(f.default).use(u.default).init((0,r.defaultsDeep)({},{fallbackLng:"en",whitelist:["en","hu"],ns:["app"],defaultNS:"app",load:"languageOnly",saveMissing:!0,saveMissingTo:"all",backend:{loadPath:"/locales/resources.json?lng={{lng}}&ns={{ns}}",addPath:"/locales/add/{{lng}}/{{ns}}",allowMultiLoading:!0,crossDomain:!1},detection:{order:["querystring","cookie","htmlTag","navigator"]}}),function(s,i){t.prototype.$lng=c.default.language,t.prototype._=function(t,e){return i(t,e)},h.default.locale(c.default.language),console.log("I18Next initialized! Language: "+c.default.language),(0,r.isFunction)(e)&&e(c.default,i)}),t.filter("i18n",function(t,e){return c.default.t(t,e)}),t.directive("i18n",{bind:function(t,e,s){t.innerHTML=c.default.t(e.expression)}}),t.prototype.$i18n=c.default,t.prototype._=function(t,e){return c.default.t(t,e)}}Object.defineProperty(e,"__esModule",{value:!0});var a=s(2),r=(i(a),s(10)),o=s(80),c=i(o),l=s(379),u=i(l),d=s(383),f=i(d),p=s(0),h=i(p);e.default={install:n}},function(t,e,s){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=s(2),a=i(n),r=s(81),o=i(r),c=s(553),l=i(c),u=s(551),d=i(u),f=s(552),p=i(f),h=s(554),m=i(h),v=s(555),g=i(v);a.default.use(o.default),e.default=new o.default({mode:"hash",routes:[{path:"/",component:l.default},{path:"/devices",component:p.default},{path:"/posts",component:m.default},{path:"/counter",component:d.default},{path:"/profile",component:g.default}]})},function(t,e,s){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=s(2),a=i(n),r=s(5),o=i(r),c=s(316),l=i(c),u=s(306),d=i(u),f=s(310),p=i(f),h=s(302),m=i(h),v=s(313),g=i(v);a.default.use(o.default),e.default=new o.default.Store({modules:{session:l.default,counter:m.default,devices:d.default,posts:p.default,profile:g.default}})},function(t,e,s){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.changedValue=e.decrement=e.increment=e.getValue=void 0;var n=s(2),a=(i(n),s(16)),r=i(a),o=new r.default("counter",void 0);e.getValue=function(t){o.emit("find").then(function(e){console.log("Counter current value: ",e),t.commit("CHANGED_VALUE",e)})},e.increment=function(t){var e=t.commit;o.emit("increment").then(function(t){e("CHANGED_VALUE",t)})},e.decrement=function(t){var e=t.commit;o.emit("decrement").then(function(t){e("CHANGED_VALUE",t)})},e.changedValue=function(t,e){var s=t.commit;s("CHANGED_VALUE",e)}},function(t,e,s){"use strict";function i(t){return t.count}Object.defineProperty(e,"__esModule",{value:!0}),e.count=i},function(t,e,s){"use strict";function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e.default=t,e}function n(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}Object.defineProperty(e,"__esModule",{value:!0});var a=s(301),r=i(a),o=s(300),c=i(o),l={count:0},u=n({},"CHANGED_VALUE",function(t,e){t.count=e});e.default={namespaced:!0,state:l,getters:r,actions:c,mutations:u}},function(t,e,s){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}var n=s(2),a=i(n),r=s(0),o=i(r),c=s(307),l=s(21),u=s(10),d=a.default.prototype._;t.exports={id:"devices",title:d("Devices"),table:{multiSelect:!0,columns:[{title:d("ID"),field:"code",align:"left",formatter:function(t,e){return e?e.code:""}},{title:d("Type"),field:"type",formatter:function(t){var e=(0,u.find)(c.deviceTypes,function(e){return e.id==t});return e?e.name:t}},{title:d("Address"),field:"address"},{title:d("Name"),field:"name"},{title:d("Status"),field:"status",formatter:function(t,e,s){return t?"<i class='fa fa-check'/>":"<i class='fa fa-ban'/>"},align:"center"},{title:d("LastCommunication"),field:"lastCommunication",formatter:function(t){return(0,o.default)(t).fromNow()}}],rowClasses:function(t){return{inactive:!t.status}}},form:{fields:[{type:"text",label:d("ID"),model:"code",readonly:!0,disabled:!0,multi:!1,get:function(t){return t.code?t.code:d("willBeGenerated")}},{type:"select",label:d("Type"),model:"type",required:!0,values:c.deviceTypes,default:"rasperry",validator:l.validators.required},{type:"text",label:d("Name"),model:"name",featured:!0,required:!0,placeholder:d("DeviceName"),validator:l.validators.string},{type:"text",label:d("Description"),model:"description",featured:!1,required:!1,validator:l.validators.string},{type:"text",label:d("Address"),model:"address",placeholder:d("AddressOfDevice"),validator:l.validators.string},{type:"label",label:d("LastCommunication"),model:"lastCommunication",get:function(t){return t&&t.lastCommunication?(0,o.default)(t.lastCommunication).fromNow():"-"}},{type:"switch",label:d("Status"),model:"status",multi:!0,default:1,textOn:d("Active"),textOff:d("Inactive"),valueOn:1,valueOff:0}]},options:{searchable:!0,enableNewButton:!0,enabledSaveButton:!0,enableDeleteButton:!0,enableCloneButton:!1,validateAfterLoad:!1,validateAfterChanged:!1,validateBeforeSave:!0},events:{onSelect:null,onNewItem:null,onCloneItem:null,onSaveItem:null,onDeleteItem:null,onChangeItem:null,onValidated:function(t,e,s){e.length>0&&console.warn("Validation error in page! Errors:",e,", Model:",t)}},resources:{addCaption:d("AddNewDevice"),saveCaption:d("Save"),cloneCaption:d("Clone"),deleteCaption:d("Delete")}}},function(t,e,s){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.removed=e.removeRow=e.updated=e.updateRow=e.created=e.saveRow=e.downloadRows=e.clearSelection=e.selectRow=e.NAMESPACE=void 0;var n=s(2),a=(i(n),s(24)),r=i(a),o=s(93),c=s(20),l=i(c),u=e.NAMESPACE="/api/devices",d=(e.selectRow=function(t,e,s){var i=t.commit;i(o.SELECT,e,s)},e.clearSelection=function(t){var e=t.commit;e(o.CLEAR_SELECT)},e.downloadRows=function(t){var e=t.commit;l.default.get(u).then(function(t){var s=t.data;200==s.status&&s.data?e(o.LOAD,s.data):console.error("Request error!",s.error)}).catch(function(t){console.error("Request error!",t.statusText)})},e.saveRow=function(t,e){var s=t.commit;l.default.post(u,e).then(function(t){var e=t.data;200==e.status&&e.data&&d({commit:s},e.data,!0)}).catch(function(t){t.data.error&&r.default.error(t.data.error.message)})},e.created=function(t,e,s){var i=t.commit;i(o.ADD,e),s&&i(o.SELECT,e,!1)});e.updateRow=function(t,e){var s=t.commit;l.default.put(u+"/"+e.code,e).then(function(t){var e=t.data;e.data&&s(o.UPDATE,e.data)}).catch(function(t){t.data.error&&r.default.error(t.data.error.message)})},e.updated=function(t,e){var s=t.commit;s(o.UPDATE,e)},e.removeRow=function(t,e){var s=t.commit;l.default.delete(u+"/"+e.code).then(function(t){s(o.REMOVE,e)}).catch(function(t){t.data.error&&r.default.error(t.data.error.message)})},e.removed=function(t,e){var s=t.commit;s(o.REMOVE,e)}},function(t,e,s){"use strict";function i(t){return t.rows}function n(t){return t.selected}Object.defineProperty(e,"__esModule",{value:!0}),e.devices=i,e.selected=n},function(t,e,s){"use strict";function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e.default=t,e}function n(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function a(t){if(Array.isArray(t)){for(var e=0,s=Array(t.length);e<t.length;e++)s[e]=t[e];return s}return Array.from(t)}Object.defineProperty(e,"__esModule",{value:!0});var r,o=s(93),c=s(10),l=s(305),u=i(l),d=s(304),f=i(d),p={rows:[],selected:[]},h=(r={},n(r,o.LOAD,function(t,e){var s;t.rows.splice(0),(s=t.rows).push.apply(s,a(e))}),n(r,o.ADD,function(t,e){var s=(0,c.find)(t.rows,function(t){return t.code==e.code});s||t.rows.push(e)}),n(r,o.SELECT,function(t,e,s){if((0,c.isArray)(e)){var i;t.selected.splice(0),(i=t.selected).push.apply(i,a(e))}else s===!0?t.selected.indexOf(e)!=-1?t.selected=t.selected.filter(function(t){return t!=e}):t.selected.push(e):(t.selected.splice(0),t.selected.push(e))}),n(r,o.CLEAR_SELECT,function(t){t.selected.splice(0)}),n(r,o.UPDATE,function(t,e){(0,c.each)(t.rows,function(t){t.code==e.code&&(0,c.assign)(t,e)})}),n(r,o.REMOVE,function(t,e){t.rows=t.rows.filter(function(t){return t.code!=e.code})}),r);e.default={namespaced:!0,state:p,getters:u,actions:f,mutations:h}},function(t,e,s){"use strict";t.exports={deviceTypes:[{id:"rasperry",name:"Raspberry"},{id:"odroid",name:"ODroid"},{id:"nanopi",name:"NanoPI"},{id:"pc",name:"PC"}]}},function(t,e,s){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.removed=e.updated=e.created=e.unVote=e.vote=e.removeRow=e.updateRow=e.saveRow=e.changeViewMode=e.changeSort=e.loadMoreRows=e.getRows=e.NAMESPACE=void 0;var n=s(2),a=(i(n),s(24)),r=i(a),o=s(16),c=i(o),l=s(94),u=(e.NAMESPACE="/api/posts",new c.default("posts")),d=e.getRows=function(t,e){var s=t.commit,i=t.state;return s(l.FETCHING,!0),u.rest("find",{filter:i.viewMode,sort:i.sort,limit:10,offset:i.offset}).then(function(t){0==t.length?s(l.NO_MORE_ITEMS):s(e?l.LOAD_MORE:l.LOAD,t)}).catch(function(t){r.default.error(t.message)}).then(function(){s(l.FETCHING,!1)})},f=(e.loadMoreRows=function(t){return d(t,!0)},e.changeSort=function(t,e){t.commit(l.CHANGE_SORT,e),d(t)},e.changeViewMode=function(t,e){t.commit(l.CHANGE_VIEWMODE,e),d(t)},e.saveRow=function(t,e){u.rest("create",e).then(function(e){f(t,e)}).catch(function(t){r.default.error(t.message)})},e.updateRow=function(t,e){u.rest("update",e).then(function(e){p(t,e)}).catch(function(t){r.default.error(t.message)})},e.removeRow=function(t,e){u.rest("remove",{code:e.code}).then(function(e){h(t,e)}).catch(function(t){r.default.error(t.message)})},e.vote=function(t,e){u.rest("vote",{code:e.code}).then(function(e){p(t,e)}).catch(function(t){r.default.error(t.message)})},e.unVote=function(t,e){u.rest("unvote",{code:e.code}).then(function(e){p(t,e)}).catch(function(t){r.default.error(t.message)})},e.created=function(t,e){var s=t.commit;s(l.ADD,e)}),p=e.updated=function(t,e){var s=t.commit;s(l.UPDATE,e)},h=e.removed=function(t,e){var s=t.commit;s(l.REMOVE,e)}},function(t,e,s){"use strict";function i(t){return t.rows}function n(t){return t.hasMore}function a(t){return t.fetching}function r(t){return t.sort}function o(t){return t.viewMode}Object.defineProperty(e,"__esModule",{value:!0}),e.posts=i,e.hasMore=n,e.fetching=a,e.sort=r,e.viewMode=o},function(t,e,s){"use strict";function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e.default=t,e}function n(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function a(t){if(Array.isArray(t)){for(var e=0,s=Array(t.length);e<t.length;e++)s[e]=t[e];return s}return Array.from(t)}Object.defineProperty(e,"__esModule",{value:!0});var r,o=s(94),c=s(10),l=s(309),u=i(l),d=s(308),f=i(d),p={rows:[],offset:0,hasMore:!0,fetching:!1,sort:"-votes",viewMode:"all"},h=(r={},n(r,o.LOAD,function(t,e){var s;t.rows.splice(0),(s=t.rows).push.apply(s,a(e)),t.offset=t.rows.length}),n(r,o.LOAD_MORE,function(t,e){var s;(s=t.rows).push.apply(s,a(e)),t.offset=t.rows.length}),n(r,o.CLEAR,function(t){t.offset=0,t.hasMore=!0}),n(r,o.FETCHING,function(t,e){t.fetching=e}),n(r,o.CHANGE_SORT,function(t,e){t.sort=e,h[o.CLEAR](t)}),n(r,o.CHANGE_VIEWMODE,function(t,e){t.viewMode=e,h[o.CLEAR](t)}),n(r,o.NO_MORE_ITEMS,function(t){t.hasMore=!1}),n(r,o.ADD,function(t,e){var s=(0,c.find)(t.rows,function(t){return t.code==e.code});s||t.rows.unshift(e)}),n(r,o.UPDATE,function(t,e){(0,c.each)(t.rows,function(t){t.code==e.code&&(0,c.assign)(t,e)})}),n(r,o.REMOVE,function(t,e){t.rows=t.rows.filter(function(t){return t.code!=e.code})}),r);e.default={namespaced:!0,state:p,getters:u,actions:f,mutations:h}},function(t,e,s){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.getProfile=e.NAMESPACE=void 0;var n=s(2),a=(i(n),s(24)),r=i(a),o=s(16),c=i(o),l=(e.NAMESPACE="/api/profile",new c.default("profile"));e.getProfile=function(t){var e=t.commit;l.rest("get").then(function(t){e("UPDATE",t)}).catch(function(t){r.default.error(t.message)})}},function(t,e,s){"use strict";function i(t){return t.profile}Object.defineProperty(e,"__esModule",{value:!0}),e.profile=i},function(t,e,s){"use strict";function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e.default=t,e}function n(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}Object.defineProperty(e,"__esModule",{value:!0});var a=s(312),r=i(a),o=s(311),c=i(o),l={profile:{}},u=n({},"UPDATE",function(t,e){t.profile=e});e.default={namespaced:!0,state:l,getters:r,actions:c,mutations:u}},function(t,e,s){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.searching=e.addNotification=e.addMessage=e.getSessionUser=e.NAMESPACE=void 0;var n=s(2),a=(i(n),s(20)),r=i(a),o=s(95),c=e.NAMESPACE="/api/session";e.getSessionUser=function(t){var e=t.commit;r.default.get(c+"/me").then(function(t){var s=t.data;200==s.status?e(o.SET_USER,s.data):console.error("Request error!",s.error)}).catch(function(t){console.error("Request error!",t.statusText)})},e.addMessage=function(t,e){var s=t.commit;s(o.ADD_MESSAGE,e)},e.addNotification=function(t,e){var s=t.commit;s(o.ADD_NOTIFICATION,e)},e.searching=function(t,e){var s=t.commit;s(o.SEARCH,e)}},function(t,e,s){"use strict";function i(t){return t.user}function n(t){return t.notifications}function a(t){return t.messages}function r(t){return t.searchText}Object.defineProperty(e,"__esModule",{value:!0}),e.me=i,e.notifications=n,e.messages=a,e.searchText=r},function(t,e,s){"use strict";function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e.default=t,e}function n(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}Object.defineProperty(e,"__esModule",{value:!0});var a,r=s(95),o=s(315),c=i(o),l=s(314),u=i(l),d={user:null,notifications:[{id:1,text:"Something happened!",time:1,user:null}],messages:[],searchText:""},f=(a={},n(a,r.ADD_MESSAGE,function(t,e){t.messages.splice(0),t.messages.push(e)}),n(a,r.ADD_NOTIFICATION,function(t,e){t.notifications.splice(0),t.notifications.push(e)}),n(a,r.SET_USER,function(t,e){t.user=e