2023-02-03 11:35:07 +01:00

2 lines
156 KiB
JavaScript

/*! For license information please see LICENSES */
(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{10:function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var r=n(69);var o=n(71),c=n(70);function h(t,i){return Object(r.a)(t)||function(t,i){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,r,o=[],c=!0,h=!1;try{for(e=e.call(t);!(c=(n=e.next()).done)&&(o.push(n.value),!i||o.length!==i);c=!0);}catch(t){h=!0,r=t}finally{try{c||null==e.return||e.return()}finally{if(h)throw r}}return o}}(t,i)||Object(o.a)(t,i)||Object(c.a)()}},134:function(t,e,n){"use strict";e.a=function(t,e){return e=e||{},new Promise((function(n,r){var s=new XMLHttpRequest,o=[],u=[],i={},a=function(){return{ok:2==(s.status/100|0),statusText:s.statusText,status:s.status,url:s.responseURL,text:function(){return Promise.resolve(s.responseText)},json:function(){return Promise.resolve(s.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([s.response]))},clone:a,headers:{keys:function(){return o},entries:function(){return u},get:function(t){return i[t.toLowerCase()]},has:function(t){return t.toLowerCase()in i}}}};for(var c in s.open(e.method||"get",t,!0),s.onload=function(){s.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(t,e,n){o.push(e=e.toLowerCase()),u.push([e,n]),i[e]=i[e]?i[e]+","+n:n})),n(a())},s.onerror=r,s.withCredentials="include"==e.credentials,e.headers)s.setRequestHeader(c,e.headers[c]);s.send(e.body||null)}))}},135:function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.d(e,"a",(function(){return r}))},136:function(t,e,n){"use strict";function r(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}n.d(e,"a",(function(){return o}))},138:function(t,e,n){"use strict";var r=function(t){return function(t){return!!t&&"object"==typeof t}(t)&&!function(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||function(t){return t.$$typeof===o}(t)}(t)};var o="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function c(t,e){return!1!==e.clone&&e.isMergeableObject(t)?y((n=t,Array.isArray(n)?[]:{}),t,e):t;var n}function h(t,source,e){return t.concat(source).map((function(element){return c(element,e)}))}function f(t){return Object.keys(t).concat(function(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter((function(symbol){return t.propertyIsEnumerable(symbol)})):[]}(t))}function l(object,t){try{return t in object}catch(t){return!1}}function d(t,source,e){var n={};return e.isMergeableObject(t)&&f(t).forEach((function(r){n[r]=c(t[r],e)})),f(source).forEach((function(r){(function(t,e){return l(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))})(t,r)||(l(t,r)&&e.isMergeableObject(source[r])?n[r]=function(t,e){if(!e.customMerge)return y;var n=e.customMerge(t);return"function"==typeof n?n:y}(r,e)(t[r],source[r],e):n[r]=c(source[r],e))})),n}function y(t,source,e){(e=e||{}).arrayMerge=e.arrayMerge||h,e.isMergeableObject=e.isMergeableObject||r,e.cloneUnlessOtherwiseSpecified=c;var n=Array.isArray(source);return n===Array.isArray(t)?n?e.arrayMerge(t,source,e):d(t,source,e):c(source,e)}y.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce((function(t,n){return y(t,n,e)}),{})};var v=y;t.exports=v},139:function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var r=n(17);n(13),n(67),n(68);function o(t){return null!==t&&"object"===Object(r.a)(t)}function c(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".",r=arguments.length>3?arguments[3]:void 0;if(!o(e))return c(t,{},n,r);var h=Object.assign({},e);for(var f in t)if("__proto__"!==f&&"constructor"!==f){var l=t[f];null!=l&&(r&&r(h,f,l,n)||(Array.isArray(l)&&Array.isArray(h[f])?h[f]=h[f].concat(l):o(l)&&o(h[f])?h[f]=c(l,h[f],(n?"".concat(n,"."):"")+f.toString(),r):h[f]=l))}return h}function h(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.reduce((function(p,e){return c(p,e,"",t)}),{})}}var f=h();f.fn=h((function(t,e,n,r){if(void 0!==t[e]&&"function"==typeof n)return t[e]=n(t[e]),!0})),f.arrayFn=h((function(t,e,n,r){if(Array.isArray(t[e])&&"function"==typeof n)return t[e]=n(t[e]),!0})),f.extend=h},140:function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function c(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function h(){return h=Object.assign||function(t){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var e in source)Object.prototype.hasOwnProperty.call(source,e)&&(t[e]=source[e])}return t},h.apply(this,arguments)}function f(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},l(t)}function d(t,p){return d=Object.setPrototypeOf||function(t,p){return t.__proto__=p,t},d(t,p)}function y(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function v(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=l(t);if(e){var o=l(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return y(this,n)}}n.d(e,"a",(function(){return j}));var m=function(){function t(){r(this,t)}return c(t,[{key:"listenForWhisper",value:function(t,e){return this.listen(".client-"+t,e)}},{key:"notification",value:function(t){return this.listen(".Illuminate\\Notifications\\Events\\BroadcastNotificationCreated",t)}},{key:"stopListeningForWhisper",value:function(t,e){return this.stopListening(".client-"+t,e)}}]),t}(),w=function(){function t(e){r(this,t),this.setNamespace(e)}return c(t,[{key:"format",value:function(t){return"."===t.charAt(0)||"\\"===t.charAt(0)?t.substr(1):(this.namespace&&(t=this.namespace+"."+t),t.replace(/\./g,"\\"))}},{key:"setNamespace",value:function(t){this.namespace=t}}]),t}(),k=function(t){f(n,t);var e=v(n);function n(t,o,c){var h;return r(this,n),(h=e.call(this)).name=o,h.pusher=t,h.options=c,h.eventFormatter=new w(h.options.namespace),h.subscribe(),h}return c(n,[{key:"subscribe",value:function(){this.subscription=this.pusher.subscribe(this.name)}},{key:"unsubscribe",value:function(){this.pusher.unsubscribe(this.name)}},{key:"listen",value:function(t,e){return this.on(this.eventFormatter.format(t),e),this}},{key:"listenToAll",value:function(t){var e=this;return this.subscription.bind_global((function(n,data){if(!n.startsWith("pusher:")){var r=e.options.namespace.replace(/\./g,"\\"),o=n.startsWith(r)?n.substring(r.length+1):"."+n;t(o,data)}})),this}},{key:"stopListening",value:function(t,e){return e?this.subscription.unbind(this.eventFormatter.format(t),e):this.subscription.unbind(this.eventFormatter.format(t)),this}},{key:"stopListeningToAll",value:function(t){return t?this.subscription.unbind_global(t):this.subscription.unbind_global(),this}},{key:"subscribed",value:function(t){return this.on("pusher:subscription_succeeded",(function(){t()})),this}},{key:"error",value:function(t){return this.on("pusher:subscription_error",(function(e){t(e)})),this}},{key:"on",value:function(t,e){return this.subscription.bind(t,e),this}}]),n}(m),_=function(t){f(n,t);var e=v(n);function n(){return r(this,n),e.apply(this,arguments)}return c(n,[{key:"whisper",value:function(t,data){return this.pusher.channels.channels[this.name].trigger("client-".concat(t),data),this}}]),n}(k),S=function(t){f(n,t);var e=v(n);function n(){return r(this,n),e.apply(this,arguments)}return c(n,[{key:"whisper",value:function(t,data){return this.pusher.channels.channels[this.name].trigger("client-".concat(t),data),this}}]),n}(k),E=function(t){f(n,t);var e=v(n);function n(){return r(this,n),e.apply(this,arguments)}return c(n,[{key:"here",value:function(t){return this.on("pusher:subscription_succeeded",(function(data){t(Object.keys(data.members).map((function(t){return data.members[t]})))})),this}},{key:"joining",value:function(t){return this.on("pusher:member_added",(function(e){t(e.info)})),this}},{key:"leaving",value:function(t){return this.on("pusher:member_removed",(function(e){t(e.info)})),this}},{key:"whisper",value:function(t,data){return this.pusher.channels.channels[this.name].trigger("client-".concat(t),data),this}}]),n}(k),A=function(t){f(n,t);var e=v(n);function n(t,o,c){var h;return r(this,n),(h=e.call(this)).events={},h.listeners={},h.name=o,h.socket=t,h.options=c,h.eventFormatter=new w(h.options.namespace),h.subscribe(),h}return c(n,[{key:"subscribe",value:function(){this.socket.emit("subscribe",{channel:this.name,auth:this.options.auth||{}})}},{key:"unsubscribe",value:function(){this.unbind(),this.socket.emit("unsubscribe",{channel:this.name,auth:this.options.auth||{}})}},{key:"listen",value:function(t,e){return this.on(this.eventFormatter.format(t),e),this}},{key:"stopListening",value:function(t,e){return this.unbindEvent(this.eventFormatter.format(t),e),this}},{key:"subscribed",value:function(t){return this.on("connect",(function(e){t(e)})),this}},{key:"error",value:function(t){return this}},{key:"on",value:function(t,e){var n=this;return this.listeners[t]=this.listeners[t]||[],this.events[t]||(this.events[t]=function(e,data){n.name===e&&n.listeners[t]&&n.listeners[t].forEach((function(t){return t(data)}))},this.socket.on(t,this.events[t])),this.listeners[t].push(e),this}},{key:"unbind",value:function(){var t=this;Object.keys(this.events).forEach((function(e){t.unbindEvent(e)}))}},{key:"unbindEvent",value:function(t,e){this.listeners[t]=this.listeners[t]||[],e&&(this.listeners[t]=this.listeners[t].filter((function(t){return t!==e}))),e&&0!==this.listeners[t].length||(this.events[t]&&(this.socket.removeListener(t,this.events[t]),delete this.events[t]),delete this.listeners[t])}}]),n}(m),T=function(t){f(n,t);var e=v(n);function n(){return r(this,n),e.apply(this,arguments)}return c(n,[{key:"whisper",value:function(t,data){return this.socket.emit("client event",{channel:this.name,event:"client-".concat(t),data:data}),this}}]),n}(A),x=function(t){f(n,t);var e=v(n);function n(){return r(this,n),e.apply(this,arguments)}return c(n,[{key:"here",value:function(t){return this.on("presence:subscribed",(function(e){t(e.map((function(t){return t.user_info})))})),this}},{key:"joining",value:function(t){return this.on("presence:joining",(function(e){return t(e.user_info)})),this}},{key:"leaving",value:function(t){return this.on("presence:leaving",(function(e){return t(e.user_info)})),this}}]),n}(T),O=function(t){f(n,t);var e=v(n);function n(){return r(this,n),e.apply(this,arguments)}return c(n,[{key:"subscribe",value:function(){}},{key:"unsubscribe",value:function(){}},{key:"listen",value:function(t,e){return this}},{key:"stopListening",value:function(t,e){return this}},{key:"subscribed",value:function(t){return this}},{key:"error",value:function(t){return this}},{key:"on",value:function(t,e){return this}}]),n}(m),P=function(t){f(n,t);var e=v(n);function n(){return r(this,n),e.apply(this,arguments)}return c(n,[{key:"whisper",value:function(t,data){return this}}]),n}(O),C=function(t){f(n,t);var e=v(n);function n(){return r(this,n),e.apply(this,arguments)}return c(n,[{key:"here",value:function(t){return this}},{key:"joining",value:function(t){return this}},{key:"leaving",value:function(t){return this}},{key:"whisper",value:function(t,data){return this}}]),n}(O),R=function(){function t(e){r(this,t),this._defaultOptions={auth:{headers:{}},authEndpoint:"/broadcasting/auth",broadcaster:"pusher",csrfToken:null,host:null,key:null,namespace:"App.Events"},this.setOptions(e),this.connect()}return c(t,[{key:"setOptions",value:function(t){return this.options=h(this._defaultOptions,t),this.csrfToken()&&(this.options.auth.headers["X-CSRF-TOKEN"]=this.csrfToken()),t}},{key:"csrfToken",value:function(){var t;return"undefined"!=typeof window&&window.Laravel&&window.Laravel.csrfToken?window.Laravel.csrfToken:this.options.csrfToken?this.options.csrfToken:"undefined"!=typeof document&&"function"==typeof document.querySelector&&(t=document.querySelector('meta[name="csrf-token"]'))?t.getAttribute("content"):null}}]),t}(),U=function(t){f(n,t);var e=v(n);function n(){var t;return r(this,n),(t=e.apply(this,arguments)).channels={},t}return c(n,[{key:"connect",value:function(){void 0!==this.options.client?this.pusher=this.options.client:this.pusher=new Pusher(this.options.key,this.options)}},{key:"listen",value:function(t,e,n){return this.channel(t).listen(e,n)}},{key:"channel",value:function(t){return this.channels[t]||(this.channels[t]=new k(this.pusher,t,this.options)),this.channels[t]}},{key:"privateChannel",value:function(t){return this.channels["private-"+t]||(this.channels["private-"+t]=new _(this.pusher,"private-"+t,this.options)),this.channels["private-"+t]}},{key:"encryptedPrivateChannel",value:function(t){return this.channels["private-encrypted-"+t]||(this.channels["private-encrypted-"+t]=new S(this.pusher,"private-encrypted-"+t,this.options)),this.channels["private-encrypted-"+t]}},{key:"presenceChannel",value:function(t){return this.channels["presence-"+t]||(this.channels["presence-"+t]=new E(this.pusher,"presence-"+t,this.options)),this.channels["presence-"+t]}},{key:"leave",value:function(t){var e=this;[t,"private-"+t,"presence-"+t].forEach((function(t,n){e.leaveChannel(t)}))}},{key:"leaveChannel",value:function(t){this.channels[t]&&(this.channels[t].unsubscribe(),delete this.channels[t])}},{key:"socketId",value:function(){return this.pusher.connection.socket_id}},{key:"disconnect",value:function(){this.pusher.disconnect()}}]),n}(R),L=function(t){f(n,t);var e=v(n);function n(){var t;return r(this,n),(t=e.apply(this,arguments)).channels={},t}return c(n,[{key:"connect",value:function(){var t=this,e=this.getSocketIO();return this.socket=e(this.options.host,this.options),this.socket.on("reconnect",(function(){Object.values(t.channels).forEach((function(t){t.subscribe()}))})),this.socket}},{key:"getSocketIO",value:function(){if(void 0!==this.options.client)return this.options.client;if("undefined"!=typeof io)return io;throw new Error("Socket.io client not found. Should be globally available or passed via options.client")}},{key:"listen",value:function(t,e,n){return this.channel(t).listen(e,n)}},{key:"channel",value:function(t){return this.channels[t]||(this.channels[t]=new A(this.socket,t,this.options)),this.channels[t]}},{key:"privateChannel",value:function(t){return this.channels["private-"+t]||(this.channels["private-"+t]=new T(this.socket,"private-"+t,this.options)),this.channels["private-"+t]}},{key:"presenceChannel",value:function(t){return this.channels["presence-"+t]||(this.channels["presence-"+t]=new x(this.socket,"presence-"+t,this.options)),this.channels["presence-"+t]}},{key:"leave",value:function(t){var e=this;[t,"private-"+t,"presence-"+t].forEach((function(t){e.leaveChannel(t)}))}},{key:"leaveChannel",value:function(t){this.channels[t]&&(this.channels[t].unsubscribe(),delete this.channels[t])}},{key:"socketId",value:function(){return this.socket.id}},{key:"disconnect",value:function(){this.socket.disconnect()}}]),n}(R),I=function(t){f(n,t);var e=v(n);function n(){var t;return r(this,n),(t=e.apply(this,arguments)).channels={},t}return c(n,[{key:"connect",value:function(){}},{key:"listen",value:function(t,e,n){return new O}},{key:"channel",value:function(t){return new O}},{key:"privateChannel",value:function(t){return new P}},{key:"presenceChannel",value:function(t){return new C}},{key:"leave",value:function(t){}},{key:"leaveChannel",value:function(t){}},{key:"socketId",value:function(){return"fake-socket-id"}},{key:"disconnect",value:function(){}}]),n}(R),j=function(){function t(e){r(this,t),this.options=e,this.connect(),this.options.withoutInterceptors||this.registerInterceptors()}return c(t,[{key:"channel",value:function(t){return this.connector.channel(t)}},{key:"connect",value:function(){"pusher"==this.options.broadcaster?this.connector=new U(this.options):"socket.io"==this.options.broadcaster?this.connector=new L(this.options):"null"==this.options.broadcaster?this.connector=new I(this.options):"function"==typeof this.options.broadcaster&&(this.connector=new this.options.broadcaster(this.options))}},{key:"disconnect",value:function(){this.connector.disconnect()}},{key:"join",value:function(t){return this.connector.presenceChannel(t)}},{key:"leave",value:function(t){this.connector.leave(t)}},{key:"leaveChannel",value:function(t){this.connector.leaveChannel(t)}},{key:"listen",value:function(t,e,n){return this.connector.listen(t,e,n)}},{key:"private",value:function(t){return this.connector.privateChannel(t)}},{key:"encryptedPrivate",value:function(t){return this.connector.encryptedPrivateChannel(t)}},{key:"socketId",value:function(){return this.connector.socketId()}},{key:"registerInterceptors",value:function(){"function"==typeof Vue&&Vue.http&&this.registerVueRequestInterceptor(),"function"==typeof axios&&this.registerAxiosRequestInterceptor(),"function"==typeof jQuery&&this.registerjQueryAjaxSetup()}},{key:"registerVueRequestInterceptor",value:function(){var t=this;Vue.http.interceptors.push((function(e,n){t.socketId()&&e.headers.set("X-Socket-ID",t.socketId()),n()}))}},{key:"registerAxiosRequestInterceptor",value:function(){var t=this;axios.interceptors.request.use((function(e){return t.socketId()&&(e.headers["X-Socket-Id"]=t.socketId()),e}))}},{key:"registerjQueryAjaxSetup",value:function(){var t=this;void 0!==jQuery.ajax&&jQuery.ajaxPrefilter((function(e,n,r){t.socketId()&&r.setRequestHeader("X-Socket-Id",t.socketId())}))}}]),t}()},16:function(t,e,n){"use strict";function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,"a",(function(){return r}))},17:function(t,e,n){"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}n.d(e,"a",(function(){return r}))},206:function(t,e,n){(function(e){var n;window,n=function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(object,t){return Object.prototype.hasOwnProperty.call(object,t)},n.p="",n(n.s=2)}([function(t,e,n){!function(t){"use strict";var e=function(t){var i,e=new Float64Array(16);if(t)for(i=0;i<t.length;i++)e[i]=t[i];return e},r=function(){throw new Error("no PRNG")},o=new Uint8Array(16),c=new Uint8Array(32);c[0]=9;var h=e(),f=e([1]),l=e([56129,1]),d=e([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),y=e([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),v=e([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),m=e([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),w=e([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function k(t,i,e,n){t[i]=e>>24&255,t[i+1]=e>>16&255,t[i+2]=e>>8&255,t[i+3]=255&e,t[i+4]=n>>24&255,t[i+5]=n>>16&255,t[i+6]=n>>8&255,t[i+7]=255&n}function _(t,e,n,r,o){var i,c=0;for(i=0;i<o;i++)c|=t[e+i]^n[r+i];return(1&c-1>>>8)-1}function S(t,e,n,r){return _(t,e,n,r,16)}function E(t,e,n,r){return _(t,e,n,r,32)}function A(t,e,n,r){!function(t,p,e,n){for(var u,r=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,o=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,c=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,h=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,f=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,l=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,d=255&p[0]|(255&p[1])<<8|(255&p[2])<<16|(255&p[3])<<24,y=255&p[4]|(255&p[5])<<8|(255&p[6])<<16|(255&p[7])<<24,v=255&p[8]|(255&p[9])<<8|(255&p[10])<<16|(255&p[11])<<24,m=255&p[12]|(255&p[13])<<8|(255&p[14])<<16|(255&p[15])<<24,w=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,k=255&e[16]|(255&e[17])<<8|(255&e[18])<<16|(255&e[19])<<24,_=255&e[20]|(255&e[21])<<8|(255&e[22])<<16|(255&e[23])<<24,S=255&e[24]|(255&e[25])<<8|(255&e[26])<<16|(255&e[27])<<24,E=255&e[28]|(255&e[29])<<8|(255&e[30])<<16|(255&e[31])<<24,A=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,T=r,x=o,O=c,P=h,C=f,R=l,U=d,L=y,I=v,j=m,M=w,B=k,N=_,D=S,$=E,H=A,i=0;i<20;i+=2)T^=(u=(N^=(u=(I^=(u=(C^=(u=T+N|0)<<7|u>>>25)+T|0)<<9|u>>>23)+C|0)<<13|u>>>19)+I|0)<<18|u>>>14,R^=(u=(x^=(u=(D^=(u=(j^=(u=R+x|0)<<7|u>>>25)+R|0)<<9|u>>>23)+j|0)<<13|u>>>19)+D|0)<<18|u>>>14,M^=(u=(U^=(u=(O^=(u=($^=(u=M+U|0)<<7|u>>>25)+M|0)<<9|u>>>23)+$|0)<<13|u>>>19)+O|0)<<18|u>>>14,H^=(u=(B^=(u=(L^=(u=(P^=(u=H+B|0)<<7|u>>>25)+H|0)<<9|u>>>23)+P|0)<<13|u>>>19)+L|0)<<18|u>>>14,T^=(u=(P^=(u=(O^=(u=(x^=(u=T+P|0)<<7|u>>>25)+T|0)<<9|u>>>23)+x|0)<<13|u>>>19)+O|0)<<18|u>>>14,R^=(u=(C^=(u=(L^=(u=(U^=(u=R+C|0)<<7|u>>>25)+R|0)<<9|u>>>23)+U|0)<<13|u>>>19)+L|0)<<18|u>>>14,M^=(u=(j^=(u=(I^=(u=(B^=(u=M+j|0)<<7|u>>>25)+M|0)<<9|u>>>23)+B|0)<<13|u>>>19)+I|0)<<18|u>>>14,H^=(u=($^=(u=(D^=(u=(N^=(u=H+$|0)<<7|u>>>25)+H|0)<<9|u>>>23)+N|0)<<13|u>>>19)+D|0)<<18|u>>>14;T=T+r|0,x=x+o|0,O=O+c|0,P=P+h|0,C=C+f|0,R=R+l|0,U=U+d|0,L=L+y|0,I=I+v|0,j=j+m|0,M=M+w|0,B=B+k|0,N=N+_|0,D=D+S|0,$=$+E|0,H=H+A|0,t[0]=T>>>0&255,t[1]=T>>>8&255,t[2]=T>>>16&255,t[3]=T>>>24&255,t[4]=x>>>0&255,t[5]=x>>>8&255,t[6]=x>>>16&255,t[7]=x>>>24&255,t[8]=O>>>0&255,t[9]=O>>>8&255,t[10]=O>>>16&255,t[11]=O>>>24&255,t[12]=P>>>0&255,t[13]=P>>>8&255,t[14]=P>>>16&255,t[15]=P>>>24&255,t[16]=C>>>0&255,t[17]=C>>>8&255,t[18]=C>>>16&255,t[19]=C>>>24&255,t[20]=R>>>0&255,t[21]=R>>>8&255,t[22]=R>>>16&255,t[23]=R>>>24&255,t[24]=U>>>0&255,t[25]=U>>>8&255,t[26]=U>>>16&255,t[27]=U>>>24&255,t[28]=L>>>0&255,t[29]=L>>>8&255,t[30]=L>>>16&255,t[31]=L>>>24&255,t[32]=I>>>0&255,t[33]=I>>>8&255,t[34]=I>>>16&255,t[35]=I>>>24&255,t[36]=j>>>0&255,t[37]=j>>>8&255,t[38]=j>>>16&255,t[39]=j>>>24&255,t[40]=M>>>0&255,t[41]=M>>>8&255,t[42]=M>>>16&255,t[43]=M>>>24&255,t[44]=B>>>0&255,t[45]=B>>>8&255,t[46]=B>>>16&255,t[47]=B>>>24&255,t[48]=N>>>0&255,t[49]=N>>>8&255,t[50]=N>>>16&255,t[51]=N>>>24&255,t[52]=D>>>0&255,t[53]=D>>>8&255,t[54]=D>>>16&255,t[55]=D>>>24&255,t[56]=$>>>0&255,t[57]=$>>>8&255,t[58]=$>>>16&255,t[59]=$>>>24&255,t[60]=H>>>0&255,t[61]=H>>>8&255,t[62]=H>>>16&255,t[63]=H>>>24&255}(t,e,n,r)}function T(t,e,n,r){!function(t,p,e,n){for(var u,r=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,o=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,c=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,h=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,f=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,l=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,d=255&p[0]|(255&p[1])<<8|(255&p[2])<<16|(255&p[3])<<24,y=255&p[4]|(255&p[5])<<8|(255&p[6])<<16|(255&p[7])<<24,v=255&p[8]|(255&p[9])<<8|(255&p[10])<<16|(255&p[11])<<24,m=255&p[12]|(255&p[13])<<8|(255&p[14])<<16|(255&p[15])<<24,w=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,k=255&e[16]|(255&e[17])<<8|(255&e[18])<<16|(255&e[19])<<24,_=255&e[20]|(255&e[21])<<8|(255&e[22])<<16|(255&e[23])<<24,S=255&e[24]|(255&e[25])<<8|(255&e[26])<<16|(255&e[27])<<24,E=255&e[28]|(255&e[29])<<8|(255&e[30])<<16|(255&e[31])<<24,A=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,i=0;i<20;i+=2)r^=(u=(_^=(u=(v^=(u=(f^=(u=r+_|0)<<7|u>>>25)+r|0)<<9|u>>>23)+f|0)<<13|u>>>19)+v|0)<<18|u>>>14,l^=(u=(o^=(u=(S^=(u=(m^=(u=l+o|0)<<7|u>>>25)+l|0)<<9|u>>>23)+m|0)<<13|u>>>19)+S|0)<<18|u>>>14,w^=(u=(d^=(u=(c^=(u=(E^=(u=w+d|0)<<7|u>>>25)+w|0)<<9|u>>>23)+E|0)<<13|u>>>19)+c|0)<<18|u>>>14,A^=(u=(k^=(u=(y^=(u=(h^=(u=A+k|0)<<7|u>>>25)+A|0)<<9|u>>>23)+h|0)<<13|u>>>19)+y|0)<<18|u>>>14,r^=(u=(h^=(u=(c^=(u=(o^=(u=r+h|0)<<7|u>>>25)+r|0)<<9|u>>>23)+o|0)<<13|u>>>19)+c|0)<<18|u>>>14,l^=(u=(f^=(u=(y^=(u=(d^=(u=l+f|0)<<7|u>>>25)+l|0)<<9|u>>>23)+d|0)<<13|u>>>19)+y|0)<<18|u>>>14,w^=(u=(m^=(u=(v^=(u=(k^=(u=w+m|0)<<7|u>>>25)+w|0)<<9|u>>>23)+k|0)<<13|u>>>19)+v|0)<<18|u>>>14,A^=(u=(E^=(u=(S^=(u=(_^=(u=A+E|0)<<7|u>>>25)+A|0)<<9|u>>>23)+_|0)<<13|u>>>19)+S|0)<<18|u>>>14;t[0]=r>>>0&255,t[1]=r>>>8&255,t[2]=r>>>16&255,t[3]=r>>>24&255,t[4]=l>>>0&255,t[5]=l>>>8&255,t[6]=l>>>16&255,t[7]=l>>>24&255,t[8]=w>>>0&255,t[9]=w>>>8&255,t[10]=w>>>16&255,t[11]=w>>>24&255,t[12]=A>>>0&255,t[13]=A>>>8&255,t[14]=A>>>16&255,t[15]=A>>>24&255,t[16]=d>>>0&255,t[17]=d>>>8&255,t[18]=d>>>16&255,t[19]=d>>>24&255,t[20]=y>>>0&255,t[21]=y>>>8&255,t[22]=y>>>16&255,t[23]=y>>>24&255,t[24]=v>>>0&255,t[25]=v>>>8&255,t[26]=v>>>16&255,t[27]=v>>>24&255,t[28]=m>>>0&255,t[29]=m>>>8&255,t[30]=m>>>16&255,t[31]=m>>>24&255}(t,e,n,r)}var x=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function O(t,e,n,r,b,o,c){var u,i,h=new Uint8Array(16),f=new Uint8Array(64);for(i=0;i<16;i++)h[i]=0;for(i=0;i<8;i++)h[i]=o[i];for(;b>=64;){for(A(f,h,c,x),i=0;i<64;i++)t[e+i]=n[r+i]^f[i];for(u=1,i=8;i<16;i++)u=u+(255&h[i])|0,h[i]=255&u,u>>>=8;b-=64,e+=64,r+=64}if(b>0)for(A(f,h,c,x),i=0;i<b;i++)t[e+i]=n[r+i]^f[i];return 0}function P(t,e,b,n,r){var u,i,o=new Uint8Array(16),c=new Uint8Array(64);for(i=0;i<16;i++)o[i]=0;for(i=0;i<8;i++)o[i]=n[i];for(;b>=64;){for(A(c,o,r,x),i=0;i<64;i++)t[e+i]=c[i];for(u=1,i=8;i<16;i++)u=u+(255&o[i])|0,o[i]=255&u,u>>>=8;b-=64,e+=64}if(b>0)for(A(c,o,r,x),i=0;i<b;i++)t[e+i]=c[i];return 0}function C(t,e,n,r,o){var s=new Uint8Array(32);T(s,r,o,x);for(var c=new Uint8Array(8),i=0;i<8;i++)c[i]=r[i+16];return P(t,e,n,c,s)}function R(t,e,n,r,o,c,h){var s=new Uint8Array(32);T(s,c,h,x);for(var f=new Uint8Array(8),i=0;i<8;i++)f[i]=c[i+16];return O(t,e,n,r,o,f,s)}var U=function(t){var e,n,r,o,c,h,f,l;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,e=255&t[0]|(255&t[1])<<8,this.r[0]=8191&e,n=255&t[2]|(255&t[3])<<8,this.r[1]=8191&(e>>>13|n<<3),r=255&t[4]|(255&t[5])<<8,this.r[2]=7939&(n>>>10|r<<6),o=255&t[6]|(255&t[7])<<8,this.r[3]=8191&(r>>>7|o<<9),c=255&t[8]|(255&t[9])<<8,this.r[4]=255&(o>>>4|c<<12),this.r[5]=c>>>1&8190,h=255&t[10]|(255&t[11])<<8,this.r[6]=8191&(c>>>14|h<<2),f=255&t[12]|(255&t[13])<<8,this.r[7]=8065&(h>>>11|f<<5),l=255&t[14]|(255&t[15])<<8,this.r[8]=8191&(f>>>8|l<<8),this.r[9]=l>>>5&127,this.pad[0]=255&t[16]|(255&t[17])<<8,this.pad[1]=255&t[18]|(255&t[19])<<8,this.pad[2]=255&t[20]|(255&t[21])<<8,this.pad[3]=255&t[22]|(255&t[23])<<8,this.pad[4]=255&t[24]|(255&t[25])<<8,this.pad[5]=255&t[26]|(255&t[27])<<8,this.pad[6]=255&t[28]|(255&t[29])<<8,this.pad[7]=255&t[30]|(255&t[31])<<8};function L(t,e,n,r,o,c){var s=new U(c);return s.update(n,r,o),s.finish(t,e),0}function I(t,e,n,r,o,c){var h=new Uint8Array(16);return L(h,0,n,r,o,c),S(t,e,h,0)}function j(t,e,n,r,o){var i;if(n<32)return-1;for(R(t,0,e,0,n,r,o),L(t,16,t,32,n-32,t),i=0;i<16;i++)t[i]=0;return 0}function M(t,e,n,r,o){var i,c=new Uint8Array(32);if(n<32)return-1;if(C(c,0,32,r,o),0!==I(e,16,e,32,n-32,c))return-1;for(R(t,0,e,0,n,r,o),i=0;i<32;i++)t[i]=0;return 0}function B(t,a){var i;for(i=0;i<16;i++)t[i]=0|a[i]}function N(t){var i,e,n=1;for(i=0;i<16;i++)e=t[i]+n+65535,n=Math.floor(e/65536),t[i]=e-65536*n;t[0]+=n-1+37*(n-1)}function D(p,q,b){for(var t,e=~(b-1),i=0;i<16;i++)t=e&(p[i]^q[i]),p[i]^=t,q[i]^=t}function $(t,n){var i,r,b,o=e(),c=e();for(i=0;i<16;i++)c[i]=n[i];for(N(c),N(c),N(c),r=0;r<2;r++){for(o[0]=c[0]-65517,i=1;i<15;i++)o[i]=c[i]-65535-(o[i-1]>>16&1),o[i-1]&=65535;o[15]=c[15]-32767-(o[14]>>16&1),b=o[15]>>16&1,o[14]&=65535,D(c,o,1-b)}for(i=0;i<16;i++)t[2*i]=255&c[i],t[2*i+1]=c[i]>>8}function H(a,b){var t=new Uint8Array(32),e=new Uint8Array(32);return $(t,a),$(e,b),E(t,0,e,0)}function z(a){var t=new Uint8Array(32);return $(t,a),1&t[0]}function Y(t,e){var i;for(i=0;i<16;i++)t[i]=e[2*i]+(e[2*i+1]<<8);t[15]&=32767}function F(t,a,b){for(var i=0;i<16;i++)t[i]=a[i]+b[i]}function X(t,a,b){for(var i=0;i<16;i++)t[i]=a[i]-b[i]}function J(t,a,b){var e,n,r=0,o=0,c=0,h=0,f=0,l=0,d=0,y=0,v=0,m=0,w=0,k=0,_=0,S=0,E=0,A=0,T=0,x=0,O=0,P=0,C=0,R=0,U=0,L=0,I=0,j=0,M=0,B=0,N=0,D=0,$=0,H=b[0],z=b[1],Y=b[2],F=b[3],X=b[4],J=b[5],W=b[6],K=b[7],V=b[8],G=b[9],Z=b[10],Q=b[11],tt=b[12],et=b[13],nt=b[14],ot=b[15];r+=(e=a[0])*H,o+=e*z,c+=e*Y,h+=e*F,f+=e*X,l+=e*J,d+=e*W,y+=e*K,v+=e*V,m+=e*G,w+=e*Z,k+=e*Q,_+=e*tt,S+=e*et,E+=e*nt,A+=e*ot,o+=(e=a[1])*H,c+=e*z,h+=e*Y,f+=e*F,l+=e*X,d+=e*J,y+=e*W,v+=e*K,m+=e*V,w+=e*G,k+=e*Z,_+=e*Q,S+=e*tt,E+=e*et,A+=e*nt,T+=e*ot,c+=(e=a[2])*H,h+=e*z,f+=e*Y,l+=e*F,d+=e*X,y+=e*J,v+=e*W,m+=e*K,w+=e*V,k+=e*G,_+=e*Z,S+=e*Q,E+=e*tt,A+=e*et,T+=e*nt,x+=e*ot,h+=(e=a[3])*H,f+=e*z,l+=e*Y,d+=e*F,y+=e*X,v+=e*J,m+=e*W,w+=e*K,k+=e*V,_+=e*G,S+=e*Z,E+=e*Q,A+=e*tt,T+=e*et,x+=e*nt,O+=e*ot,f+=(e=a[4])*H,l+=e*z,d+=e*Y,y+=e*F,v+=e*X,m+=e*J,w+=e*W,k+=e*K,_+=e*V,S+=e*G,E+=e*Z,A+=e*Q,T+=e*tt,x+=e*et,O+=e*nt,P+=e*ot,l+=(e=a[5])*H,d+=e*z,y+=e*Y,v+=e*F,m+=e*X,w+=e*J,k+=e*W,_+=e*K,S+=e*V,E+=e*G,A+=e*Z,T+=e*Q,x+=e*tt,O+=e*et,P+=e*nt,C+=e*ot,d+=(e=a[6])*H,y+=e*z,v+=e*Y,m+=e*F,w+=e*X,k+=e*J,_+=e*W,S+=e*K,E+=e*V,A+=e*G,T+=e*Z,x+=e*Q,O+=e*tt,P+=e*et,C+=e*nt,R+=e*ot,y+=(e=a[7])*H,v+=e*z,m+=e*Y,w+=e*F,k+=e*X,_+=e*J,S+=e*W,E+=e*K,A+=e*V,T+=e*G,x+=e*Z,O+=e*Q,P+=e*tt,C+=e*et,R+=e*nt,U+=e*ot,v+=(e=a[8])*H,m+=e*z,w+=e*Y,k+=e*F,_+=e*X,S+=e*J,E+=e*W,A+=e*K,T+=e*V,x+=e*G,O+=e*Z,P+=e*Q,C+=e*tt,R+=e*et,U+=e*nt,L+=e*ot,m+=(e=a[9])*H,w+=e*z,k+=e*Y,_+=e*F,S+=e*X,E+=e*J,A+=e*W,T+=e*K,x+=e*V,O+=e*G,P+=e*Z,C+=e*Q,R+=e*tt,U+=e*et,L+=e*nt,I+=e*ot,w+=(e=a[10])*H,k+=e*z,_+=e*Y,S+=e*F,E+=e*X,A+=e*J,T+=e*W,x+=e*K,O+=e*V,P+=e*G,C+=e*Z,R+=e*Q,U+=e*tt,L+=e*et,I+=e*nt,j+=e*ot,k+=(e=a[11])*H,_+=e*z,S+=e*Y,E+=e*F,A+=e*X,T+=e*J,x+=e*W,O+=e*K,P+=e*V,C+=e*G,R+=e*Z,U+=e*Q,L+=e*tt,I+=e*et,j+=e*nt,M+=e*ot,_+=(e=a[12])*H,S+=e*z,E+=e*Y,A+=e*F,T+=e*X,x+=e*J,O+=e*W,P+=e*K,C+=e*V,R+=e*G,U+=e*Z,L+=e*Q,I+=e*tt,j+=e*et,M+=e*nt,B+=e*ot,S+=(e=a[13])*H,E+=e*z,A+=e*Y,T+=e*F,x+=e*X,O+=e*J,P+=e*W,C+=e*K,R+=e*V,U+=e*G,L+=e*Z,I+=e*Q,j+=e*tt,M+=e*et,B+=e*nt,N+=e*ot,E+=(e=a[14])*H,A+=e*z,T+=e*Y,x+=e*F,O+=e*X,P+=e*J,C+=e*W,R+=e*K,U+=e*V,L+=e*G,I+=e*Z,j+=e*Q,M+=e*tt,B+=e*et,N+=e*nt,D+=e*ot,A+=(e=a[15])*H,o+=38*(x+=e*Y),c+=38*(O+=e*F),h+=38*(P+=e*X),f+=38*(C+=e*J),l+=38*(R+=e*W),d+=38*(U+=e*K),y+=38*(L+=e*V),v+=38*(I+=e*G),m+=38*(j+=e*Z),w+=38*(M+=e*Q),k+=38*(B+=e*tt),_+=38*(N+=e*et),S+=38*(D+=e*nt),E+=38*($+=e*ot),r=(e=(r+=38*(T+=e*z))+(n=1)+65535)-65536*(n=Math.floor(e/65536)),o=(e=o+n+65535)-65536*(n=Math.floor(e/65536)),c=(e=c+n+65535)-65536*(n=Math.floor(e/65536)),h=(e=h+n+65535)-65536*(n=Math.floor(e/65536)),f=(e=f+n+65535)-65536*(n=Math.floor(e/65536)),l=(e=l+n+65535)-65536*(n=Math.floor(e/65536)),d=(e=d+n+65535)-65536*(n=Math.floor(e/65536)),y=(e=y+n+65535)-65536*(n=Math.floor(e/65536)),v=(e=v+n+65535)-65536*(n=Math.floor(e/65536)),m=(e=m+n+65535)-65536*(n=Math.floor(e/65536)),w=(e=w+n+65535)-65536*(n=Math.floor(e/65536)),k=(e=k+n+65535)-65536*(n=Math.floor(e/65536)),_=(e=_+n+65535)-65536*(n=Math.floor(e/65536)),S=(e=S+n+65535)-65536*(n=Math.floor(e/65536)),E=(e=E+n+65535)-65536*(n=Math.floor(e/65536)),A=(e=A+n+65535)-65536*(n=Math.floor(e/65536)),r=(e=(r+=n-1+37*(n-1))+(n=1)+65535)-65536*(n=Math.floor(e/65536)),o=(e=o+n+65535)-65536*(n=Math.floor(e/65536)),c=(e=c+n+65535)-65536*(n=Math.floor(e/65536)),h=(e=h+n+65535)-65536*(n=Math.floor(e/65536)),f=(e=f+n+65535)-65536*(n=Math.floor(e/65536)),l=(e=l+n+65535)-65536*(n=Math.floor(e/65536)),d=(e=d+n+65535)-65536*(n=Math.floor(e/65536)),y=(e=y+n+65535)-65536*(n=Math.floor(e/65536)),v=(e=v+n+65535)-65536*(n=Math.floor(e/65536)),m=(e=m+n+65535)-65536*(n=Math.floor(e/65536)),w=(e=w+n+65535)-65536*(n=Math.floor(e/65536)),k=(e=k+n+65535)-65536*(n=Math.floor(e/65536)),_=(e=_+n+65535)-65536*(n=Math.floor(e/65536)),S=(e=S+n+65535)-65536*(n=Math.floor(e/65536)),E=(e=E+n+65535)-65536*(n=Math.floor(e/65536)),A=(e=A+n+65535)-65536*(n=Math.floor(e/65536)),r+=n-1+37*(n-1),t[0]=r,t[1]=o,t[2]=c,t[3]=h,t[4]=f,t[5]=l,t[6]=d,t[7]=y,t[8]=v,t[9]=m,t[10]=w,t[11]=k,t[12]=_,t[13]=S,t[14]=E,t[15]=A}function W(t,a){J(t,a,a)}function K(t,i){var a,n=e();for(a=0;a<16;a++)n[a]=i[a];for(a=253;a>=0;a--)W(n,n),2!==a&&4!==a&&J(n,n,i);for(a=0;a<16;a++)t[a]=n[a]}function V(t,i){var a,n=e();for(a=0;a<16;a++)n[a]=i[a];for(a=250;a>=0;a--)W(n,n),1!==a&&J(n,n,i);for(a=0;a<16;a++)t[a]=n[a]}function G(q,t,p){var n,i,r=new Uint8Array(32),o=new Float64Array(80),a=e(),b=e(),c=e(),h=e(),f=e(),d=e();for(i=0;i<31;i++)r[i]=t[i];for(r[31]=127&t[31]|64,r[0]&=248,Y(o,p),i=0;i<16;i++)b[i]=o[i],h[i]=a[i]=c[i]=0;for(a[0]=h[0]=1,i=254;i>=0;--i)D(a,b,n=r[i>>>3]>>>(7&i)&1),D(c,h,n),F(f,a,c),X(a,a,c),F(c,b,h),X(b,b,h),W(h,f),W(d,a),J(a,c,a),J(c,b,f),F(f,a,c),X(a,a,c),W(b,a),X(c,h,d),J(a,c,l),F(a,a,h),J(c,c,a),J(a,h,d),J(h,b,o),W(b,f),D(a,b,n),D(c,h,n);for(i=0;i<16;i++)o[i+16]=a[i],o[i+32]=c[i],o[i+48]=b[i],o[i+64]=h[i];var y=o.subarray(32),v=o.subarray(16);return K(y,y),J(v,v,y),$(q,v),0}function Z(q,t){return G(q,t,c)}function Q(t,e){return r(e,32),Z(t,e)}function tt(t,e,n){var s=new Uint8Array(32);return G(s,n,e),T(t,o,s,x)}U.prototype.blocks=function(t,e,n){for(var r,o,c,h,f,l,d,y,v,m,w,k,_,S,E,A,T,x,O,P=this.fin?0:2048,C=this.h[0],h1=this.h[1],h2=this.h[2],h3=this.h[3],h4=this.h[4],h5=this.h[5],h6=this.h[6],R=this.h[7],U=this.h[8],L=this.h[9],I=this.r[0],j=this.r[1],M=this.r[2],B=this.r[3],N=this.r[4],D=this.r[5],$=this.r[6],H=this.r[7],z=this.r[8],Y=this.r[9];n>=16;)m=v=0,m+=(C+=8191&(r=255&t[e+0]|(255&t[e+1])<<8))*I,m+=(h1+=8191&(r>>>13|(o=255&t[e+2]|(255&t[e+3])<<8)<<3))*(5*Y),m+=(h2+=8191&(o>>>10|(c=255&t[e+4]|(255&t[e+5])<<8)<<6))*(5*z),m+=(h3+=8191&(c>>>7|(h=255&t[e+6]|(255&t[e+7])<<8)<<9))*(5*H),v=(m+=(h4+=8191&(h>>>4|(f=255&t[e+8]|(255&t[e+9])<<8)<<12))*(5*$))>>>13,m&=8191,m+=(h5+=f>>>1&8191)*(5*D),m+=(h6+=8191&(f>>>14|(l=255&t[e+10]|(255&t[e+11])<<8)<<2))*(5*N),m+=(R+=8191&(l>>>11|(d=255&t[e+12]|(255&t[e+13])<<8)<<5))*(5*B),m+=(U+=8191&(d>>>8|(y=255&t[e+14]|(255&t[e+15])<<8)<<8))*(5*M),w=v+=(m+=(L+=y>>>5|P)*(5*j))>>>13,w+=C*j,w+=h1*I,w+=h2*(5*Y),w+=h3*(5*z),v=(w+=h4*(5*H))>>>13,w&=8191,w+=h5*(5*$),w+=h6*(5*D),w+=R*(5*N),w+=U*(5*B),v+=(w+=L*(5*M))>>>13,w&=8191,k=v,k+=C*M,k+=h1*j,k+=h2*I,k+=h3*(5*Y),v=(k+=h4*(5*z))>>>13,k&=8191,k+=h5*(5*H),k+=h6*(5*$),k+=R*(5*D),k+=U*(5*N),_=v+=(k+=L*(5*B))>>>13,_+=C*B,_+=h1*M,_+=h2*j,_+=h3*I,v=(_+=h4*(5*Y))>>>13,_&=8191,_+=h5*(5*z),_+=h6*(5*H),_+=R*(5*$),_+=U*(5*D),S=v+=(_+=L*(5*N))>>>13,S+=C*N,S+=h1*B,S+=h2*M,S+=h3*j,v=(S+=h4*I)>>>13,S&=8191,S+=h5*(5*Y),S+=h6*(5*z),S+=R*(5*H),S+=U*(5*$),E=v+=(S+=L*(5*D))>>>13,E+=C*D,E+=h1*N,E+=h2*B,E+=h3*M,v=(E+=h4*j)>>>13,E&=8191,E+=h5*I,E+=h6*(5*Y),E+=R*(5*z),E+=U*(5*H),A=v+=(E+=L*(5*$))>>>13,A+=C*$,A+=h1*D,A+=h2*N,A+=h3*B,v=(A+=h4*M)>>>13,A&=8191,A+=h5*j,A+=h6*I,A+=R*(5*Y),A+=U*(5*z),T=v+=(A+=L*(5*H))>>>13,T+=C*H,T+=h1*$,T+=h2*D,T+=h3*N,v=(T+=h4*B)>>>13,T&=8191,T+=h5*M,T+=h6*j,T+=R*I,T+=U*(5*Y),x=v+=(T+=L*(5*z))>>>13,x+=C*z,x+=h1*H,x+=h2*$,x+=h3*D,v=(x+=h4*N)>>>13,x&=8191,x+=h5*B,x+=h6*M,x+=R*j,x+=U*I,O=v+=(x+=L*(5*Y))>>>13,O+=C*Y,O+=h1*z,O+=h2*H,O+=h3*$,v=(O+=h4*D)>>>13,O&=8191,O+=h5*N,O+=h6*B,O+=R*M,O+=U*j,C=m=8191&(v=(v=((v+=(O+=L*I)>>>13)<<2)+v|0)+(m&=8191)|0),h1=w+=v>>>=13,h2=k&=8191,h3=_&=8191,h4=S&=8191,h5=E&=8191,h6=A&=8191,R=T&=8191,U=x&=8191,L=O&=8191,e+=16,n-=16;this.h[0]=C,this.h[1]=h1,this.h[2]=h2,this.h[3]=h3,this.h[4]=h4,this.h[5]=h5,this.h[6]=h6,this.h[7]=R,this.h[8]=U,this.h[9]=L},U.prototype.finish=function(t,e){var n,mask,r,i,g=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=n,n=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,g[0]=this.h[0]+5,n=g[0]>>>13,g[0]&=8191,i=1;i<10;i++)g[i]=this.h[i]+n,n=g[i]>>>13,g[i]&=8191;for(g[9]-=8192,mask=(1^n)-1,i=0;i<10;i++)g[i]&=mask;for(mask=~mask,i=0;i<10;i++)this.h[i]=this.h[i]&mask|g[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),r=this.h[0]+this.pad[0],this.h[0]=65535&r,i=1;i<8;i++)r=(this.h[i]+this.pad[i]|0)+(r>>>16)|0,this.h[i]=65535&r;t[e+0]=this.h[0]>>>0&255,t[e+1]=this.h[0]>>>8&255,t[e+2]=this.h[1]>>>0&255,t[e+3]=this.h[1]>>>8&255,t[e+4]=this.h[2]>>>0&255,t[e+5]=this.h[2]>>>8&255,t[e+6]=this.h[3]>>>0&255,t[e+7]=this.h[3]>>>8&255,t[e+8]=this.h[4]>>>0&255,t[e+9]=this.h[4]>>>8&255,t[e+10]=this.h[5]>>>0&255,t[e+11]=this.h[5]>>>8&255,t[e+12]=this.h[6]>>>0&255,t[e+13]=this.h[6]>>>8&255,t[e+14]=this.h[7]>>>0&255,t[e+15]=this.h[7]>>>8&255},U.prototype.update=function(t,e,n){var i,r;if(this.leftover){for((r=16-this.leftover)>n&&(r=n),i=0;i<r;i++)this.buffer[this.leftover+i]=t[e+i];if(n-=r,e+=r,this.leftover+=r,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(n>=16&&(r=n-n%16,this.blocks(t,e,r),e+=r,n-=r),n){for(i=0;i<n;i++)this.buffer[this.leftover+i]=t[e+i];this.leftover+=n}};var et=j,nt=M,ot=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function it(t,e,n,r){for(var o,c,h,f,l,d,y,v,m,w,k,_,S,E,A,T,th,x,i,O,P,C,a,b,R,U,L=new Int32Array(16),I=new Int32Array(16),j=t[0],M=t[1],B=t[2],N=t[3],D=t[4],$=t[5],H=t[6],z=t[7],Y=e[0],F=e[1],X=e[2],J=e[3],W=e[4],K=e[5],V=e[6],G=e[7],Z=0;r>=128;){for(i=0;i<16;i++)O=8*i+Z,L[i]=n[O+0]<<24|n[O+1]<<16|n[O+2]<<8|n[O+3],I[i]=n[O+4]<<24|n[O+5]<<16|n[O+6]<<8|n[O+7];for(i=0;i<80;i++)if(o=j,c=M,h=B,f=N,l=D,d=$,y=H,m=Y,w=F,k=X,_=J,S=W,E=K,A=V,a=65535&(C=G),b=C>>>16,R=65535&(P=z),U=P>>>16,a+=65535&(C=(W>>>14|D<<18)^(W>>>18|D<<14)^(D>>>9|W<<23)),b+=C>>>16,R+=65535&(P=(D>>>14|W<<18)^(D>>>18|W<<14)^(W>>>9|D<<23)),U+=P>>>16,a+=65535&(C=W&K^~W&V),b+=C>>>16,R+=65535&(P=D&$^~D&H),U+=P>>>16,a+=65535&(C=ot[2*i+1]),b+=C>>>16,R+=65535&(P=ot[2*i]),U+=P>>>16,P=L[i%16],b+=(C=I[i%16])>>>16,R+=65535&P,U+=P>>>16,R+=(b+=(a+=65535&C)>>>16)>>>16,a=65535&(C=x=65535&a|b<<16),b=C>>>16,R=65535&(P=th=65535&R|(U+=R>>>16)<<16),U=P>>>16,a+=65535&(C=(Y>>>28|j<<4)^(j>>>2|Y<<30)^(j>>>7|Y<<25)),b+=C>>>16,R+=65535&(P=(j>>>28|Y<<4)^(Y>>>2|j<<30)^(Y>>>7|j<<25)),U+=P>>>16,b+=(C=Y&F^Y&X^F&X)>>>16,R+=65535&(P=j&M^j&B^M&B),U+=P>>>16,v=65535&(R+=(b+=(a+=65535&C)>>>16)>>>16)|(U+=R>>>16)<<16,T=65535&a|b<<16,a=65535&(C=_),b=C>>>16,R=65535&(P=f),U=P>>>16,b+=(C=x)>>>16,R+=65535&(P=th),U+=P>>>16,M=o,B=c,N=h,D=f=65535&(R+=(b+=(a+=65535&C)>>>16)>>>16)|(U+=R>>>16)<<16,$=l,H=d,z=y,j=v,F=m,X=w,J=k,W=_=65535&a|b<<16,K=S,V=E,G=A,Y=T,i%16==15)for(O=0;O<16;O++)P=L[O],a=65535&(C=I[O]),b=C>>>16,R=65535&P,U=P>>>16,P=L[(O+9)%16],a+=65535&(C=I[(O+9)%16]),b+=C>>>16,R+=65535&P,U+=P>>>16,th=L[(O+1)%16],a+=65535&(C=((x=I[(O+1)%16])>>>1|th<<31)^(x>>>8|th<<24)^(x>>>7|th<<25)),b+=C>>>16,R+=65535&(P=(th>>>1|x<<31)^(th>>>8|x<<24)^th>>>7),U+=P>>>16,th=L[(O+14)%16],b+=(C=((x=I[(O+14)%16])>>>19|th<<13)^(th>>>29|x<<3)^(x>>>6|th<<26))>>>16,R+=65535&(P=(th>>>19|x<<13)^(x>>>29|th<<3)^th>>>6),U+=P>>>16,U+=(R+=(b+=(a+=65535&C)>>>16)>>>16)>>>16,L[O]=65535&R|U<<16,I[O]=65535&a|b<<16;a=65535&(C=Y),b=C>>>16,R=65535&(P=j),U=P>>>16,P=t[0],b+=(C=e[0])>>>16,R+=65535&P,U+=P>>>16,U+=(R+=(b+=(a+=65535&C)>>>16)>>>16)>>>16,t[0]=j=65535&R|U<<16,e[0]=Y=65535&a|b<<16,a=65535&(C=F),b=C>>>16,R=65535&(P=M),U=P>>>16,P=t[1],b+=(C=e[1])>>>16,R+=65535&P,U+=P>>>16,U+=(R+=(b+=(a+=65535&C)>>>16)>>>16)>>>16,t[1]=M=65535&R|U<<16,e[1]=F=65535&a|b<<16,a=65535&(C=X),b=C>>>16,R=65535&(P=B),U=P>>>16,P=t[2],b+=(C=e[2])>>>16,R+=65535&P,U+=P>>>16,U+=(R+=(b+=(a+=65535&C)>>>16)>>>16)>>>16,t[2]=B=65535&R|U<<16,e[2]=X=65535&a|b<<16,a=65535&(C=J),b=C>>>16,R=65535&(P=N),U=P>>>16,P=t[3],b+=(C=e[3])>>>16,R+=65535&P,U+=P>>>16,U+=(R+=(b+=(a+=65535&C)>>>16)>>>16)>>>16,t[3]=N=65535&R|U<<16,e[3]=J=65535&a|b<<16,a=65535&(C=W),b=C>>>16,R=65535&(P=D),U=P>>>16,P=t[4],b+=(C=e[4])>>>16,R+=65535&P,U+=P>>>16,U+=(R+=(b+=(a+=65535&C)>>>16)>>>16)>>>16,t[4]=D=65535&R|U<<16,e[4]=W=65535&a|b<<16,a=65535&(C=K),b=C>>>16,R=65535&(P=$),U=P>>>16,P=t[5],b+=(C=e[5])>>>16,R+=65535&P,U+=P>>>16,U+=(R+=(b+=(a+=65535&C)>>>16)>>>16)>>>16,t[5]=$=65535&R|U<<16,e[5]=K=65535&a|b<<16,a=65535&(C=V),b=C>>>16,R=65535&(P=H),U=P>>>16,P=t[6],b+=(C=e[6])>>>16,R+=65535&P,U+=P>>>16,U+=(R+=(b+=(a+=65535&C)>>>16)>>>16)>>>16,t[6]=H=65535&R|U<<16,e[6]=V=65535&a|b<<16,a=65535&(C=G),b=C>>>16,R=65535&(P=z),U=P>>>16,P=t[7],b+=(C=e[7])>>>16,R+=65535&P,U+=P>>>16,U+=(R+=(b+=(a+=65535&C)>>>16)>>>16)>>>16,t[7]=z=65535&R|U<<16,e[7]=G=65535&a|b<<16,Z+=128,r-=128}return r}function st(t,e,n){var i,r=new Int32Array(8),o=new Int32Array(8),c=new Uint8Array(256),b=n;for(r[0]=1779033703,r[1]=3144134277,r[2]=1013904242,r[3]=2773480762,r[4]=1359893119,r[5]=2600822924,r[6]=528734635,r[7]=1541459225,o[0]=4089235720,o[1]=2227873595,o[2]=4271175723,o[3]=1595750129,o[4]=2917565137,o[5]=725511199,o[6]=4215389547,o[7]=327033209,it(r,o,e,n),n%=128,i=0;i<n;i++)c[i]=e[b-n+i];for(c[n]=128,c[(n=256-128*(n<112?1:0))-9]=0,k(c,n-8,b/536870912|0,b<<3),it(r,o,c,n),i=0;i<8;i++)k(t,8*i,r[i],o[i]);return 0}function at(p,q){var a=e(),b=e(),t=e(),n=e(),r=e(),o=e(),g=e(),c=e(),h=e();X(a,p[1],p[0]),X(h,q[1],q[0]),J(a,a,h),F(b,p[0],p[1]),F(h,q[0],q[1]),J(b,b,h),J(t,p[3],q[3]),J(t,t,y),J(n,p[2],q[2]),F(n,n,n),X(r,b,a),X(o,n,t),F(g,n,t),F(c,b,a),J(p[0],r,o),J(p[1],c,g),J(p[2],g,o),J(p[3],r,c)}function ct(p,q,b){var i;for(i=0;i<4;i++)D(p[i],q[i],b)}function ut(t,p){var n=e(),r=e(),o=e();K(o,p[2]),J(n,p[0],o),J(r,p[1],o),$(t,r),t[31]^=z(n)<<7}function ht(p,q,s){var b,i;for(B(p[0],h),B(p[1],f),B(p[2],f),B(p[3],h),i=255;i>=0;--i)ct(p,q,b=s[i/8|0]>>(7&i)&1),at(q,p),at(p,p),ct(p,q,b)}function ft(p,s){var q=[e(),e(),e(),e()];B(q[0],v),B(q[1],m),B(q[2],f),J(q[3],v,m),ht(p,q,s)}function lt(t,n,o){var i,c=new Uint8Array(64),p=[e(),e(),e(),e()];for(o||r(n,32),st(c,n,32),c[0]&=248,c[31]&=127,c[31]|=64,ft(p,c),ut(t,p),i=0;i<32;i++)n[i+32]=t[i];return 0}var pt=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function yt(t,e){var n,i,r,o;for(i=63;i>=32;--i){for(n=0,r=i-32,o=i-12;r<o;++r)e[r]+=n-16*e[i]*pt[r-(i-32)],n=e[r]+128>>8,e[r]-=256*n;e[r]+=n,e[i]=0}for(n=0,r=0;r<32;r++)e[r]+=n-(e[31]>>4)*pt[r],n=e[r]>>8,e[r]&=255;for(r=0;r<32;r++)e[r]-=n*pt[r];for(i=0;i<32;i++)e[i+1]+=e[i]>>8,t[i]=255&e[i]}function gt(t){var i,e=new Float64Array(64);for(i=0;i<64;i++)e[i]=t[i];for(i=0;i<64;i++)t[i]=0;yt(t,e)}function vt(t,n,r,o){var i,c,h=new Uint8Array(64),f=new Uint8Array(64),l=new Uint8Array(64),d=new Float64Array(64),p=[e(),e(),e(),e()];st(h,o,32),h[0]&=248,h[31]&=127,h[31]|=64;var y=r+64;for(i=0;i<r;i++)t[64+i]=n[i];for(i=0;i<32;i++)t[32+i]=h[32+i];for(st(l,t.subarray(32),r+32),gt(l),ft(p,l),ut(t,p),i=32;i<64;i++)t[i]=o[i];for(st(f,t,r+64),gt(f),i=0;i<64;i++)d[i]=0;for(i=0;i<32;i++)d[i]=l[i];for(i=0;i<32;i++)for(c=0;c<32;c++)d[i+c]+=f[i]*h[c];return yt(t.subarray(32),d),y}function bt(t,n,r,o){var i,c=new Uint8Array(32),l=new Uint8Array(64),p=[e(),e(),e(),e()],q=[e(),e(),e(),e()];if(r<64)return-1;if(function(t,p){var n=e(),r=e(),o=e(),c=e(),l=e(),y=e(),v=e();return B(t[2],f),Y(t[1],p),W(o,t[1]),J(c,o,d),X(o,o,t[2]),F(c,t[2],c),W(l,c),W(y,l),J(v,y,l),J(n,v,o),J(n,n,c),V(n,n),J(n,n,o),J(n,n,c),J(n,n,c),J(t[0],n,c),W(r,t[0]),J(r,r,c),H(r,o)&&J(t[0],t[0],w),W(r,t[0]),J(r,r,c),H(r,o)?-1:(z(t[0])===p[31]>>7&&X(t[0],h,t[0]),J(t[3],t[0],t[1]),0)}(q,o))return-1;for(i=0;i<r;i++)t[i]=n[i];for(i=0;i<32;i++)t[i+32]=o[i];if(st(l,t,r),gt(l),ht(p,q,l),ft(q,n.subarray(32)),at(p,q),ut(c,p),r-=64,E(n,0,c,0)){for(i=0;i<r;i++)t[i]=0;return-1}for(i=0;i<r;i++)t[i]=n[i+64];return r}var mt,wt=16,kt=64,_t=32,St=64;function Et(t,e){if(32!==t.length)throw new Error("bad key size");if(24!==e.length)throw new Error("bad nonce size")}function At(){for(var i=0;i<arguments.length;i++)if(!(arguments[i]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function Tt(t){for(var i=0;i<t.length;i++)t[i]=0}t.lowlevel={crypto_core_hsalsa20:T,crypto_stream_xor:R,crypto_stream:C,crypto_stream_salsa20_xor:O,crypto_stream_salsa20:P,crypto_onetimeauth:L,crypto_onetimeauth_verify:I,crypto_verify_16:S,crypto_verify_32:E,crypto_secretbox:j,crypto_secretbox_open:M,crypto_scalarmult:G,crypto_scalarmult_base:Z,crypto_box_beforenm:tt,crypto_box_afternm:et,crypto_box:function(t,e,n,r,o,c){var h=new Uint8Array(32);return tt(h,o,c),et(t,e,n,r,h)},crypto_box_open:function(t,e,n,r,o,c){var h=new Uint8Array(32);return tt(h,o,c),nt(t,e,n,r,h)},crypto_box_keypair:Q,crypto_hash:st,crypto_sign:vt,crypto_sign_keypair:lt,crypto_sign_open:bt,crypto_secretbox_KEYBYTES:32,crypto_secretbox_NONCEBYTES:24,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:wt,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:32,crypto_box_SECRETKEYBYTES:32,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:24,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:kt,crypto_sign_PUBLICKEYBYTES:_t,crypto_sign_SECRETKEYBYTES:St,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:e,D:d,L:pt,pack25519:$,unpack25519:Y,M:J,A:F,S:W,Z:X,pow2523:V,add:at,set25519:B,modL:yt,scalarmult:ht,scalarbase:ft},t.randomBytes=function(t){var b=new Uint8Array(t);return r(b,t),b},t.secretbox=function(t,e,n){At(t,e,n),Et(n,e);for(var r=new Uint8Array(32+t.length),o=new Uint8Array(r.length),i=0;i<t.length;i++)r[i+32]=t[i];return j(o,r,r.length,e,n),o.subarray(wt)},t.secretbox.open=function(t,e,n){At(t,e,n),Et(n,e);for(var r=new Uint8Array(wt+t.length),o=new Uint8Array(r.length),i=0;i<t.length;i++)r[i+wt]=t[i];return r.length<32||0!==M(o,r,r.length,e,n)?null:o.subarray(32)},t.secretbox.keyLength=32,t.secretbox.nonceLength=24,t.secretbox.overheadLength=wt,t.scalarMult=function(t,p){if(At(t,p),32!==t.length)throw new Error("bad n size");if(32!==p.length)throw new Error("bad p size");var q=new Uint8Array(32);return G(q,t,p),q},t.scalarMult.base=function(t){if(At(t),32!==t.length)throw new Error("bad n size");var q=new Uint8Array(32);return Z(q,t),q},t.scalarMult.scalarLength=32,t.scalarMult.groupElementLength=32,t.box=function(e,n,r,o){var c=t.box.before(r,o);return t.secretbox(e,n,c)},t.box.before=function(t,e){At(t,e),function(t,e){if(32!==t.length)throw new Error("bad public key size");if(32!==e.length)throw new Error("bad secret key size")}(t,e);var n=new Uint8Array(32);return tt(n,t,e),n},t.box.after=t.secretbox,t.box.open=function(e,n,r,o){var c=t.box.before(r,o);return t.secretbox.open(e,n,c)},t.box.open.after=t.secretbox.open,t.box.keyPair=function(){var t=new Uint8Array(32),e=new Uint8Array(32);return Q(t,e),{publicKey:t,secretKey:e}},t.box.keyPair.fromSecretKey=function(t){if(At(t),32!==t.length)throw new Error("bad secret key size");var e=new Uint8Array(32);return Z(e,t),{publicKey:e,secretKey:new Uint8Array(t)}},t.box.publicKeyLength=32,t.box.secretKeyLength=32,t.box.sharedKeyLength=32,t.box.nonceLength=24,t.box.overheadLength=t.secretbox.overheadLength,t.sign=function(t,e){if(At(t,e),e.length!==St)throw new Error("bad secret key size");var n=new Uint8Array(kt+t.length);return vt(n,t,t.length,e),n},t.sign.open=function(t,e){if(At(t,e),e.length!==_t)throw new Error("bad public key size");var n=new Uint8Array(t.length),r=bt(n,t,t.length,e);if(r<0)return null;for(var o=new Uint8Array(r),i=0;i<o.length;i++)o[i]=n[i];return o},t.sign.detached=function(e,n){for(var r=t.sign(e,n),o=new Uint8Array(kt),i=0;i<o.length;i++)o[i]=r[i];return o},t.sign.detached.verify=function(t,e,n){if(At(t,e,n),e.length!==kt)throw new Error("bad signature size");if(n.length!==_t)throw new Error("bad public key size");var i,r=new Uint8Array(kt+t.length),o=new Uint8Array(kt+t.length);for(i=0;i<kt;i++)r[i]=e[i];for(i=0;i<t.length;i++)r[i+kt]=t[i];return bt(o,r,r.length,n)>=0},t.sign.keyPair=function(){var t=new Uint8Array(_t),e=new Uint8Array(St);return lt(t,e),{publicKey:t,secretKey:e}},t.sign.keyPair.fromSecretKey=function(t){if(At(t),t.length!==St)throw new Error("bad secret key size");for(var e=new Uint8Array(_t),i=0;i<e.length;i++)e[i]=t[32+i];return{publicKey:e,secretKey:new Uint8Array(t)}},t.sign.keyPair.fromSeed=function(t){if(At(t),32!==t.length)throw new Error("bad seed size");for(var e=new Uint8Array(_t),n=new Uint8Array(St),i=0;i<32;i++)n[i]=t[i];return lt(e,n,!0),{publicKey:e,secretKey:n}},t.sign.publicKeyLength=_t,t.sign.secretKeyLength=St,t.sign.seedLength=32,t.sign.signatureLength=kt,t.hash=function(t){At(t);var e=new Uint8Array(64);return st(e,t,t.length),e},t.hash.hashLength=64,t.verify=function(t,e){return At(t,e),0!==t.length&&0!==e.length&&t.length===e.length&&0===_(t,0,e,0,t.length)},t.setPRNG=function(t){r=t},(mt="undefined"!=typeof self?self.crypto||self.msCrypto:null)&&mt.getRandomValues?t.setPRNG((function(t,e){var i,n=new Uint8Array(e);for(i=0;i<e;i+=65536)mt.getRandomValues(n.subarray(i,i+Math.min(e-i,65536)));for(i=0;i<e;i++)t[i]=n[i];Tt(n)})):(mt=n(3))&&mt.randomBytes&&t.setPRNG((function(t,e){var i,n=mt.randomBytes(e);for(i=0;i<e;i++)t[i]=n[i];Tt(n)}))}(t.exports?t.exports:self.nacl=self.nacl||{})},function(t,n,r){!function(e,n){"use strict";t.exports?t.exports=n():(e.nacl||(e.nacl={}),e.nacl.util=n())}(this,(function(){"use strict";var t={};function n(s){if(!/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(s))throw new TypeError("invalid encoding")}return t.decodeUTF8=function(s){if("string"!=typeof s)throw new TypeError("expected string");var i,t=unescape(encodeURIComponent(s)),b=new Uint8Array(t.length);for(i=0;i<t.length;i++)b[i]=t.charCodeAt(i);return b},t.encodeUTF8=function(t){var i,s=[];for(i=0;i<t.length;i++)s.push(String.fromCharCode(t[i]));return decodeURIComponent(escape(s.join("")))},"undefined"==typeof atob?void 0!==e.from?(t.encodeBase64=function(t){return e.from(t).toString("base64")},t.decodeBase64=function(s){return n(s),new Uint8Array(Array.prototype.slice.call(e.from(s,"base64"),0))}):(t.encodeBase64=function(t){return new e(t).toString("base64")},t.decodeBase64=function(s){return n(s),new Uint8Array(Array.prototype.slice.call(new e(s,"base64"),0))}):(t.encodeBase64=function(t){var i,s=[],e=t.length;for(i=0;i<e;i++)s.push(String.fromCharCode(t[i]));return btoa(s.join(""))},t.decodeBase64=function(s){n(s);var i,t=atob(s),b=new Uint8Array(t.length);for(i=0;i<t.length;i++)b[i]=t.charCodeAt(i);return b}),t}))},function(t,e,n){t.exports=n(4).default},function(t,e){},function(t,e,n){"use strict";n.r(e);for(var r=function(){function t(t,e){this.lastId=0,this.prefix=t,this.name=e}return t.prototype.create=function(t){this.lastId++;var e=this.lastId,n=this.prefix+e,r=this.name+"["+e+"]",o=!1,c=function(){o||(t.apply(null,arguments),o=!0)};return this[e]=c,{number:e,id:n,name:r,callback:c}},t.prototype.remove=function(t){delete this[t.number]},t}(),o=new r("_pusher_script_","Pusher.ScriptReceivers"),c={VERSION:"5.1.1",PROTOCOL:7,host:"ws.pusherapp.com",ws_port:80,wss_port:443,ws_path:"",sockjs_host:"sockjs.pusher.com",sockjs_http_port:80,sockjs_https_port:443,sockjs_path:"/pusher",stats_host:"stats.pusher.com",channel_auth_endpoint:"/pusher/auth",channel_auth_transport:"ajax",activity_timeout:12e4,pong_timeout:3e4,unavailable_timeout:1e4,cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},h=function(){function t(t){this.options=t,this.receivers=t.receivers||o,this.loading={}}return t.prototype.load=function(t,e,n){var r=this;if(r.loading[t]&&r.loading[t].length>0)r.loading[t].push(n);else{r.loading[t]=[n];var o=je.createScriptRequest(r.getPath(t,e)),c=r.receivers.create((function(e){if(r.receivers.remove(c),r.loading[t]){var n=r.loading[t];delete r.loading[t];for(var h=function(t){t||o.cleanup()},i=0;i<n.length;i++)n[i](e,h)}}));o.send(c)}},t.prototype.getRoot=function(t){var e=je.getDocument().location.protocol;return(t&&t.useTLS||"https:"===e?this.options.cdn_https:this.options.cdn_http).replace(/\/*$/,"")+"/"+this.options.version},t.prototype.getPath=function(t,e){return this.getRoot(e)+"/"+t+this.options.suffix+".js"},t}(),f=new r("_pusher_dependencies","Pusher.DependenciesReceivers"),l=new h({cdn_http:c.cdn_http,cdn_https:c.cdn_https,version:c.VERSION,suffix:c.dependency_suffix,receivers:f}),d=String.fromCharCode,y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",v={},m=0,w=y.length;m<w;m++)v[y.charAt(m)]=m;var k,_=function(t){var e=t.charCodeAt(0);return e<128?t:e<2048?d(192|e>>>6)+d(128|63&e):d(224|e>>>12&15)+d(128|e>>>6&63)+d(128|63&e)},S=function(u){return u.replace(/[^\x00-\x7F]/g,_)},E=function(t){var e=[0,2,1][t.length%3],n=t.charCodeAt(0)<<16|(t.length>1?t.charCodeAt(1):0)<<8|(t.length>2?t.charCodeAt(2):0);return[y.charAt(n>>>18),y.charAt(n>>>12&63),e>=2?"=":y.charAt(n>>>6&63),e>=1?"=":y.charAt(63&n)].join("")},A=window.btoa||function(b){return b.replace(/[\s\S]{1,3}/g,E)},T=function(){function t(t,e,n,r){var o=this;this.clear=e,this.timer=t((function(){o.timer&&(o.timer=r(o.timer))}),n)}return t.prototype.isRunning=function(){return null!==this.timer},t.prototype.ensureAborted=function(){this.timer&&(this.clear(this.timer),this.timer=null)},t}(),x=(k=function(t,b){return k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,b){t.__proto__=b}||function(t,b){for(var p in b)b.hasOwnProperty(p)&&(t[p]=b[p])},k(t,b)},function(t,b){function e(){this.constructor=t}k(t,b),t.prototype=null===b?Object.create(b):(e.prototype=b.prototype,new e)});function O(t){window.clearTimeout(t)}function P(t){window.clearInterval(t)}var C=function(t){function e(e,n){return t.call(this,setTimeout,O,e,(function(t){return n(),null}))||this}return x(e,t),e}(T),R=function(t){function e(e,n){return t.call(this,setInterval,P,e,(function(t){return n(),t}))||this}return x(e,t),e}(T),U={now:function(){return Date.now?Date.now():(new Date).valueOf()},defer:function(t){return new C(0,t)},method:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=Array.prototype.slice.call(arguments,1);return function(object){return object[t].apply(object,r.concat(arguments))}}},L=U;function I(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var i=0;i<e.length;i++){var r=e[i];for(var o in r)r[o]&&r[o].constructor&&r[o].constructor===Object?t[o]=I(t[o]||{},r[o]):t[o]=r[o]}return t}function j(){for(var t=["Pusher"],i=0;i<arguments.length;i++)"string"==typeof arguments[i]?t.push(arguments[i]):t.push(F(arguments[i]));return t.join(" : ")}function M(t,e){var n=Array.prototype.indexOf;if(null===t)return-1;if(n&&t.indexOf===n)return t.indexOf(e);for(var i=0,r=t.length;i<r;i++)if(t[i]===e)return i;return-1}function B(object,t){for(var e in object)Object.prototype.hasOwnProperty.call(object,e)&&t(object[e],e,object)}function N(object){var t=[];return B(object,(function(e,n){t.push(n)})),t}function D(t,e,n){for(var i=0;i<t.length;i++)e.call(n||window,t[i],i,t)}function map(t,e){for(var n=[],i=0;i<t.length;i++)n.push(e(t[i],i,t,n));return n}function filter(t,e){e=e||function(t){return!!t};for(var n=[],i=0;i<t.length;i++)e(t[i],i,t,n)&&n.push(t[i]);return n}function $(object,t){var e={};return B(object,(function(n,r){(t&&t(n,r,object,e)||Boolean(n))&&(e[r]=n)})),e}function H(t,e){for(var i=0;i<t.length;i++)if(e(t[i],i,t))return!0;return!1}function z(data){return t=function(t){return"object"==typeof t&&(t=F(t)),encodeURIComponent((s=t.toString(),A(S(s))));var s},e={},B(data,(function(n,r){e[r]=t(n)})),e;var t,e}function Y(data){var object,t,e=$(data,(function(t){return void 0!==t}));return map((object=z(e),t=[],B(object,(function(e,n){t.push([n,e])})),t),L.method("join","=")).join("&")}function F(source){try{return JSON.stringify(source)}catch(n){return JSON.stringify((t=[],e=[],function n(r,path){var i,o,c;switch(typeof r){case"object":if(!r)return null;for(i=0;i<t.length;i+=1)if(t[i]===r)return{$ref:e[i]};if(t.push(r),e.push(path),"[object Array]"===Object.prototype.toString.apply(r))for(c=[],i=0;i<r.length;i+=1)c[i]=n(r[i],path+"["+i+"]");else for(o in c={},r)Object.prototype.hasOwnProperty.call(r,o)&&(c[o]=n(r[o],path+"["+JSON.stringify(o)+"]"));return c;case"number":case"string":case"boolean":return r}}(source,"$")))}var t,e}var X=function(){function t(){this.globalLog=function(t){window.console&&window.console.log&&window.console.log(t)}}return t.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.log(this.globalLog,t)},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.log(this.globalLogWarn,t)},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.log(this.globalLogError,t)},t.prototype.globalLogWarn=function(t){window.console&&window.console.warn?window.console.warn(t):this.globalLog(t)},t.prototype.globalLogError=function(t){window.console&&window.console.error?window.console.error(t):this.globalLogWarn(t)},t.prototype.log=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=j.apply(this,arguments);if(Ye.log)Ye.log(r);else if(Ye.logToConsole){var o=t.bind(this);o(r)}},t}(),J=new X,W={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/authenticating_users"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"}}},K=function(t){var e,n=W.urls[t];return n?(n.fullUrl?e=n.fullUrl:n.path&&(e=W.baseUrl+n.path),e?"See: "+e:""):""},V=function(t,e,n){var r,o=this;for(var c in(r=je.createXHR()).open("POST",o.options.authEndpoint,!0),r.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),this.authOptions.headers)r.setRequestHeader(c,this.authOptions.headers[c]);return r.onreadystatechange=function(){if(4===r.readyState)if(200===r.status){var data,t=!1;try{data=JSON.parse(r.responseText),t=!0}catch(t){n(!0,"JSON returned from auth endpoint was invalid, yet status code was 200. Data was: "+r.responseText)}t&&n(!1,data)}else{var e=K("authenticationEndpoint");J.error("Unable to retrieve auth string from auth endpoint - received status "+r.status+" from "+o.options.authEndpoint+". Clients must be authenticated to join private or presence channels. "+e),n(!0,r.status)}},r.send(this.composeQuery(e)),r},G=function(t,e,n){void 0!==this.authOptions.headers&&J.warn("To send headers with the auth request, you must use AJAX, rather than JSONP.");var r=t.nextAuthCallbackID.toString();t.nextAuthCallbackID++;var o=t.getDocument(),script=o.createElement("script");t.auth_callbacks[r]=function(data){n(!1,data)};var c="Pusher.auth_callbacks['"+r+"']";script.src=this.options.authEndpoint+"?callback="+encodeURIComponent(c)+"&"+this.composeQuery(e);var head=o.getElementsByTagName("head")[0]||o.documentElement;head.insertBefore(script,head.firstChild)},Z=function(){function t(t){this.src=t}return t.prototype.send=function(t){var e=this,n="Error loading "+e.src;e.script=document.createElement("script"),e.script.id=t.id,e.script.src=e.src,e.script.type="text/javascript",e.script.charset="UTF-8",e.script.addEventListener?(e.script.onerror=function(){t.callback(n)},e.script.onload=function(){t.callback(null)}):e.script.onreadystatechange=function(){"loaded"!==e.script.readyState&&"complete"!==e.script.readyState||t.callback(null)},void 0===e.script.async&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(e.errorScript=document.createElement("script"),e.errorScript.id=t.id+"_error",e.errorScript.text=t.name+"('"+n+"');",e.script.async=e.errorScript.async=!1):e.script.async=!0;var head=document.getElementsByTagName("head")[0];head.insertBefore(e.script,head.firstChild),e.errorScript&&head.insertBefore(e.errorScript,e.script.nextSibling)},t.prototype.cleanup=function(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null},t}(),Q=function(){function t(t,data){this.url=t,this.data=data}return t.prototype.send=function(t){if(!this.request){var e=Y(this.data),n=this.url+"/"+t.number+"?"+e;this.request=je.createScriptRequest(n),this.request.send(t)}},t.prototype.cleanup=function(){this.request&&this.request.cleanup()},t}(),tt={name:"jsonp",getAgent:function(t,e){return function(data,n){var r="http"+(e?"s":"")+"://"+(t.host||t.options.host)+t.options.path,c=je.createJSONPRequest(r,data),h=je.ScriptReceivers.create((function(e,r){o.remove(h),c.cleanup(),r&&r.host&&(t.host=r.host),n&&n(e,r)}));c.send(h)}}};function et(t,e,path){return t+(e.useTLS?"s":"")+"://"+(e.useTLS?e.hostTLS:e.hostNonTLS)+path}function nt(t,e){return"/app/"+t+"?protocol="+c.PROTOCOL+"&client=js&version="+c.VERSION+(e?"&"+e:"")}var ot={getInitial:function(t,e){return et("ws",e,(e.httpPath||"")+nt(t,"flash=false"))}},it={getInitial:function(t,e){return et("http",e,(e.httpPath||"/pusher")+nt(t))}},st={getInitial:function(t,e){return et("http",e,e.httpPath||"/pusher")},getPath:function(t,e){return nt(t)}},at=function(){function t(){this._callbacks={}}return t.prototype.get=function(t){return this._callbacks[ct(t)]},t.prototype.add=function(t,e,n){var r=ct(t);this._callbacks[r]=this._callbacks[r]||[],this._callbacks[r].push({fn:e,context:n})},t.prototype.remove=function(t,e,n){if(t||e||n){var r=t?[ct(t)]:N(this._callbacks);e||n?this.removeCallback(r,e,n):this.removeAllCallbacks(r)}else this._callbacks={}},t.prototype.removeCallback=function(t,e,n){D(t,(function(t){this._callbacks[t]=filter(this._callbacks[t]||[],(function(t){return e&&e!==t.fn||n&&n!==t.context})),0===this._callbacks[t].length&&delete this._callbacks[t]}),this)},t.prototype.removeAllCallbacks=function(t){D(t,(function(t){delete this._callbacks[t]}),this)},t}();function ct(t){return"_"+t}var ut=function(){function t(t){this.callbacks=new at,this.global_callbacks=[],this.failThrough=t}return t.prototype.bind=function(t,e,n){return this.callbacks.add(t,e,n),this},t.prototype.bind_global=function(t){return this.global_callbacks.push(t),this},t.prototype.unbind=function(t,e,n){return this.callbacks.remove(t,e,n),this},t.prototype.unbind_global=function(t){return t?(this.global_callbacks=filter(this.global_callbacks||[],(function(e){return e!==t})),this):(this.global_callbacks=[],this)},t.prototype.unbind_all=function(){return this.unbind(),this.unbind_global(),this},t.prototype.emit=function(t,data,e){for(var i=0;i<this.global_callbacks.length;i++)this.global_callbacks[i](t,data);var n=this.callbacks.get(t),r=[];if(e?r.push(data,e):data&&r.push(data),n&&n.length>0)for(i=0;i<n.length;i++)n[i].fn.apply(n[i].context||window,r);else this.failThrough&&this.failThrough(t,data);return this},t}(),ht=function(){var t=function(e,b){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,b){t.__proto__=b}||function(t,b){for(var p in b)b.hasOwnProperty(p)&&(t[p]=b[p])},t(e,b)};return function(e,b){function n(){this.constructor=e}t(e,b),e.prototype=null===b?Object.create(b):(n.prototype=b.prototype,new n)}}(),ft=function(t){function e(e,n,r,o,c){var h=t.call(this)||this;return h.initialize=je.transportConnectionInitializer,h.hooks=e,h.name=n,h.priority=r,h.key=o,h.options=c,h.state="new",h.timeline=c.timeline,h.activityTimeout=c.activityTimeout,h.id=h.timeline.generateUniqueID(),h}return ht(e,t),e.prototype.handlesActivityChecks=function(){return Boolean(this.hooks.handlesActivityChecks)},e.prototype.supportsPing=function(){return Boolean(this.hooks.supportsPing)},e.prototype.connect=function(){var t=this;if(this.socket||"initialized"!==this.state)return!1;var e=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(e,this.options)}catch(e){return L.defer((function(){t.onError(e),t.changeState("closed")})),!1}return this.bindListeners(),J.debug("Connecting",{transport:this.name,url:e}),this.changeState("connecting"),!0},e.prototype.close=function(){return!!this.socket&&(this.socket.close(),!0)},e.prototype.send=function(data){var t=this;return"open"===this.state&&(L.defer((function(){t.socket&&t.socket.send(data)})),!0)},e.prototype.ping=function(){"open"===this.state&&this.supportsPing()&&this.socket.ping()},e.prototype.onOpen=function(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0},e.prototype.onError=function(t){this.emit("error",{type:"WebSocketError",error:t}),this.timeline.error(this.buildTimelineMessage({error:t.toString()}))},e.prototype.onClose=function(t){t?this.changeState("closed",{code:t.code,reason:t.reason,wasClean:t.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0},e.prototype.onMessage=function(t){this.emit("message",t)},e.prototype.onActivity=function(){this.emit("activity")},e.prototype.bindListeners=function(){var t=this;this.socket.onopen=function(){t.onOpen()},this.socket.onerror=function(e){t.onError(e)},this.socket.onclose=function(e){t.onClose(e)},this.socket.onmessage=function(e){t.onMessage(e)},this.supportsPing()&&(this.socket.onactivity=function(){t.onActivity()})},e.prototype.unbindListeners=function(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))},e.prototype.changeState=function(t,e){this.state=t,this.timeline.info(this.buildTimelineMessage({state:t,params:e})),this.emit(t,e)},e.prototype.buildTimelineMessage=function(t){return I({cid:this.id},t)},e}(ut),lt=ft,pt=function(){function t(t){this.hooks=t}return t.prototype.isSupported=function(t){return this.hooks.isSupported(t)},t.prototype.createConnection=function(t,e,n,r){return new lt(this.hooks,t,e,n,r)},t}(),yt=new pt({urls:ot,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return Boolean(je.getWebSocketAPI())},isSupported:function(){return Boolean(je.getWebSocketAPI())},getSocket:function(t){return je.createWebSocket(t)}}),gt={urls:it,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},vt=I({getSocket:function(t){return je.HTTPFactory.createStreamingSocket(t)}},gt),bt=I({getSocket:function(t){return je.HTTPFactory.createPollingSocket(t)}},gt),mt={isSupported:function(){return je.isXHRSupported()}},wt={ws:yt,xhr_streaming:new pt(I({},vt,mt)),xhr_polling:new pt(I({},bt,mt))},kt=new pt({file:"sockjs",urls:st,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return void 0!==window.SockJS},getSocket:function(t,e){return new window.SockJS(t,null,{js_path:l.getPath("sockjs",{useTLS:e.useTLS}),ignore_null_origin:e.ignoreNullOrigin})},beforeOpen:function(t,path){t.send(JSON.stringify({path:path}))}}),_t={isSupported:function(t){return je.isXDRSupported(t.useTLS)}},St=new pt(I({},vt,_t)),Et=new pt(I({},bt,_t));wt.xdr_streaming=St,wt.xdr_polling=Et,wt.sockjs=kt;var At=wt,Tt=function(){var t=function(e,b){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,b){t.__proto__=b}||function(t,b){for(var p in b)b.hasOwnProperty(p)&&(t[p]=b[p])},t(e,b)};return function(e,b){function n(){this.constructor=e}t(e,b),e.prototype=null===b?Object.create(b):(n.prototype=b.prototype,new n)}}(),xt=new(function(t){function e(){var e=t.call(this)||this,n=e;return void 0!==window.addEventListener&&(window.addEventListener("online",(function(){n.emit("online")}),!1),window.addEventListener("offline",(function(){n.emit("offline")}),!1)),e}return Tt(e,t),e.prototype.isOnline=function(){return void 0===window.navigator.onLine||window.navigator.onLine},e}(ut)),Ot=function(){function t(t,e,n){this.manager=t,this.transport=e,this.minPingDelay=n.minPingDelay,this.maxPingDelay=n.maxPingDelay,this.pingDelay=void 0}return t.prototype.createConnection=function(t,e,n,r){var o=this;r=I({},r,{activityTimeout:this.pingDelay});var c=this.transport.createConnection(t,e,n,r),h=null,f=function(){c.unbind("open",f),c.bind("closed",l),h=L.now()},l=function(t){if(c.unbind("closed",l),1002===t.code||1003===t.code)o.manager.reportDeath();else if(!t.wasClean&&h){var e=L.now()-h;e<2*o.maxPingDelay&&(o.manager.reportDeath(),o.pingDelay=Math.max(e/2,o.minPingDelay))}};return c.bind("open",f),c},t.prototype.isSupported=function(t){return this.manager.isAlive()&&this.transport.isSupported(t)},t}(),Pt={decodeMessage:function(t){try{var e=JSON.parse(t.data),n=e.data;if("string"==typeof n)try{n=JSON.parse(e.data)}catch(t){}var r={event:e.event,channel:e.channel,data:n};return e.user_id&&(r.user_id=e.user_id),r}catch(e){throw{type:"MessageParseError",error:e,data:t.data}}},encodeMessage:function(t){return JSON.stringify(t)},processHandshake:function(t){var e=Pt.decodeMessage(t);if("pusher:connection_established"===e.event){if(!e.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:e.data.socket_id,activityTimeout:1e3*e.data.activity_timeout}}if("pusher:error"===e.event)return{action:this.getCloseAction(e.data),error:this.getCloseError(e.data)};throw"Invalid handshake"},getCloseAction:function(t){return t.code<4e3?t.code>=1002&&t.code<=1004?"backoff":null:4e3===t.code?"tls_only":t.code<4100?"refused":t.code<4200?"backoff":t.code<4300?"retry":"refused"},getCloseError:function(t){return 1e3!==t.code&&1001!==t.code?{type:"PusherError",data:{code:t.code,message:t.reason||t.message}}:null}},Ct=Pt,Rt=function(){var t=function(e,b){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,b){t.__proto__=b}||function(t,b){for(var p in b)b.hasOwnProperty(p)&&(t[p]=b[p])},t(e,b)};return function(e,b){function n(){this.constructor=e}t(e,b),e.prototype=null===b?Object.create(b):(n.prototype=b.prototype,new n)}}(),Ut=function(t){function e(e,n){var r=t.call(this)||this;return r.id=e,r.transport=n,r.activityTimeout=n.activityTimeout,r.bindListeners(),r}return Rt(e,t),e.prototype.handlesActivityChecks=function(){return this.transport.handlesActivityChecks()},e.prototype.send=function(data){return this.transport.send(data)},e.prototype.send_event=function(t,data,e){var n={event:t,data:data};return e&&(n.channel=e),J.debug("Event sent",n),this.send(Ct.encodeMessage(n))},e.prototype.ping=function(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})},e.prototype.close=function(){this.transport.close()},e.prototype.bindListeners=function(){var t=this,e={message:function(e){var n;try{n=Ct.decodeMessage(e)}catch(n){t.emit("error",{type:"MessageParseError",error:n,data:e.data})}if(void 0!==n){switch(J.debug("Event recd",n),n.event){case"pusher:error":t.emit("error",{type:"PusherError",data:n.data});break;case"pusher:ping":t.emit("ping");break;case"pusher:pong":t.emit("pong")}t.emit("message",n)}},activity:function(){t.emit("activity")},error:function(e){t.emit("error",{type:"WebSocketError",error:e})},closed:function(e){n(),e&&e.code&&t.handleCloseEvent(e),t.transport=null,t.emit("closed")}},n=function(){B(e,(function(e,n){t.transport.unbind(n,e)}))};B(e,(function(e,n){t.transport.bind(n,e)}))},e.prototype.handleCloseEvent=function(t){var e=Ct.getCloseAction(t),n=Ct.getCloseError(t);n&&this.emit("error",n),e&&this.emit(e,{action:e,error:n})},e}(ut),Lt=function(){function t(t,e){this.transport=t,this.callback=e,this.bindListeners()}return t.prototype.close=function(){this.unbindListeners(),this.transport.close()},t.prototype.bindListeners=function(){var t=this;this.onMessage=function(e){var n;t.unbindListeners();try{n=Ct.processHandshake(e)}catch(e){return t.finish("error",{error:e}),void t.transport.close()}"connected"===n.action?t.finish("connected",{connection:new Ut(n.id,t.transport),activityTimeout:n.activityTimeout}):(t.finish(n.action,{error:n.error}),t.transport.close())},this.onClosed=function(e){t.unbindListeners();var n=Ct.getCloseAction(e)||"backoff",r=Ct.getCloseError(e);t.finish(n,{error:r})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)},t.prototype.unbindListeners=function(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)},t.prototype.finish=function(t,e){this.callback(I({transport:this.transport,action:t},e))},t}(),It=function(){function t(t,e){this.channel=t;var n=e.authTransport;if(void 0===je.getAuthorizers()[n])throw"'"+n+"' is not a recognized auth transport";this.type=n,this.options=e,this.authOptions=(e||{}).auth||{}}return t.prototype.composeQuery=function(t){var e="socket_id="+encodeURIComponent(t)+"&channel_name="+encodeURIComponent(this.channel.name);for(var i in this.authOptions.params)e+="&"+encodeURIComponent(i)+"="+encodeURIComponent(this.authOptions.params[i]);return e},t.prototype.authorize=function(e,n){t.authorizers=t.authorizers||je.getAuthorizers(),t.authorizers[this.type].call(this,je,e,n)},t}(),jt=function(){function t(t,e){this.timeline=t,this.options=e||{}}return t.prototype.send=function(t,e){this.timeline.isEmpty()||this.timeline.send(je.TimelineTransport.getAgent(this,t),e)},t}(),Mt=function(){var t=function(e,b){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,b){t.__proto__=b}||function(t,b){for(var p in b)b.hasOwnProperty(p)&&(t[p]=b[p])},t(e,b)};return function(e,b){function n(){this.constructor=e}t(e,b),e.prototype=null===b?Object.create(b):(n.prototype=b.prototype,new n)}}(),Bt=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return Mt(e,t),e}(Error),Nt=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return Mt(e,t),e}(Error),Dt=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return Mt(e,t),e}(Error),qt=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return Mt(e,t),e}(Error),$t=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return Mt(e,t),e}(Error),Ht=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return Mt(e,t),e}(Error),zt=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.setPrototypeOf(r,n.prototype),r}return Mt(e,t),e}(Error),Yt=function(){var t=function(e,b){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,b){t.__proto__=b}||function(t,b){for(var p in b)b.hasOwnProperty(p)&&(t[p]=b[p])},t(e,b)};return function(e,b){function n(){this.constructor=e}t(e,b),e.prototype=null===b?Object.create(b):(n.prototype=b.prototype,new n)}}(),Ft=function(t){function e(e,n){var r=t.call(this,(function(t,data){J.debug("No callbacks on "+e+" for "+t)}))||this;return r.name=e,r.pusher=n,r.subscribed=!1,r.subscriptionPending=!1,r.subscriptionCancelled=!1,r}return Yt(e,t),e.prototype.authorize=function(t,e){return e(!1,{auth:""})},e.prototype.trigger=function(t,data){if(0!==t.indexOf("client-"))throw new Bt("Event '"+t+"' does not start with 'client-'");if(!this.subscribed){var e=K("triggeringClientEvents");J.warn("Client event triggered before channel 'subscription_succeeded' event . "+e)}return this.pusher.send_event(t,data,this.name)},e.prototype.disconnect=function(){this.subscribed=!1,this.subscriptionPending=!1},e.prototype.handleEvent=function(t){var e=t.event,data=t.data;"pusher_internal:subscription_succeeded"===e?this.handleSubscriptionSucceededEvent(t):0!==e.indexOf("pusher_internal:")&&this.emit(e,data,{})},e.prototype.handleSubscriptionSucceededEvent=function(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",t.data)},e.prototype.subscribe=function(){var t=this;this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(function(e,data){e?(J.error(data),t.emit("pusher:subscription_error",data)):(data=data,t.pusher.send_event("pusher:subscribe",{auth:data.auth,channel_data:data.channel_data,channel:t.name}))})))},e.prototype.unsubscribe=function(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})},e.prototype.cancelSubscription=function(){this.subscriptionCancelled=!0},e.prototype.reinstateSubscription=function(){this.subscriptionCancelled=!1},e}(ut),Xt=function(){var t=function(e,b){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,b){t.__proto__=b}||function(t,b){for(var p in b)b.hasOwnProperty(p)&&(t[p]=b[p])},t(e,b)};return function(e,b){function n(){this.constructor=e}t(e,b),e.prototype=null===b?Object.create(b):(n.prototype=b.prototype,new n)}}(),Jt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Xt(e,t),e.prototype.authorize=function(t,e){return ae.createAuthorizer(this,this.pusher.config).authorize(t,e)},e}(Ft),Wt=Jt,Kt=function(){function t(){this.reset()}return t.prototype.get=function(t){return Object.prototype.hasOwnProperty.call(this.members,t)?{id:t,info:this.members[t]}:null},t.prototype.each=function(t){var e=this;B(this.members,(function(n,r){t(e.get(r))}))},t.prototype.setMyID=function(t){this.myID=t},t.prototype.onSubscription=function(t){this.members=t.presence.hash,this.count=t.presence.count,this.me=this.get(this.myID)},t.prototype.addMember=function(t){return null===this.get(t.user_id)&&this.count++,this.members[t.user_id]=t.user_info,this.get(t.user_id)},t.prototype.removeMember=function(t){var e=this.get(t.user_id);return e&&(delete this.members[t.user_id],this.count--),e},t.prototype.reset=function(){this.members={},this.count=0,this.myID=null,this.me=null},t}(),Vt=function(){var t=function(e,b){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,b){t.__proto__=b}||function(t,b){for(var p in b)b.hasOwnProperty(p)&&(t[p]=b[p])},t(e,b)};return function(e,b){function n(){this.constructor=e}t(e,b),e.prototype=null===b?Object.create(b):(n.prototype=b.prototype,new n)}}(),Gt=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.members=new Kt,r}return Vt(e,t),e.prototype.authorize=function(e,n){var r=this;t.prototype.authorize.call(this,e,(function(t,e){if(!t){if(void 0===(e=e).channel_data){var o=K("authenticationEndpoint");return J.error("Invalid auth response for channel '"+r.name+"',expected 'channel_data' field. "+o),void n("Invalid auth response")}var c=JSON.parse(e.channel_data);r.members.setMyID(c.user_id)}n(t,e)}))},e.prototype.handleEvent=function(t){var e=t.event;if(0===e.indexOf("pusher_internal:"))this.handleInternalEvent(t);else{var data=t.data,n={};t.user_id&&(n.user_id=t.user_id),this.emit(e,data,n)}},e.prototype.handleInternalEvent=function(t){var e=t.event,data=t.data;switch(e){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(t);break;case"pusher_internal:member_added":var n=this.members.addMember(data);this.emit("pusher:member_added",n);break;case"pusher_internal:member_removed":var r=this.members.removeMember(data);r&&this.emit("pusher:member_removed",r)}},e.prototype.handleSubscriptionSucceededEvent=function(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(t.data),this.emit("pusher:subscription_succeeded",this.members))},e.prototype.disconnect=function(){this.members.reset(),t.prototype.disconnect.call(this)},e}(Wt),Zt=n(0),Qt=n(1),te=function(){var t=function(e,b){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,b){t.__proto__=b}||function(t,b){for(var p in b)b.hasOwnProperty(p)&&(t[p]=b[p])},t(e,b)};return function(e,b){function n(){this.constructor=e}t(e,b),e.prototype=null===b?Object.create(b):(n.prototype=b.prototype,new n)}}(),ee=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.key=null,e}return te(e,t),e.prototype.authorize=function(e,n){var r=this;t.prototype.authorize.call(this,e,(function(t,e){if(t)n(!0,e);else{var o=e.shared_secret;if(o)r.key=Object(Qt.decodeBase64)(o),delete e.shared_secret,n(!1,e);else{var c="No shared_secret key in auth payload for encrypted channel: "+r.name;n(!0,c)}}}))},e.prototype.trigger=function(t,data){throw new $t("Client events are not currently supported for encrypted channels")},e.prototype.handleEvent=function(e){var n=e.event,data=e.data;0!==n.indexOf("pusher_internal:")&&0!==n.indexOf("pusher:")?this.handleEncryptedEvent(n,data):t.prototype.handleEvent.call(this,e)},e.prototype.handleEncryptedEvent=function(t,data){var e=this;if(this.key)if(data.ciphertext&&data.nonce){var n=Object(Qt.decodeBase64)(data.ciphertext);if(n.length<Zt.secretbox.overheadLength)J.error("Expected encrypted event ciphertext length to be "+Zt.secretbox.overheadLength+", got: "+n.length);else{var r=Object(Qt.decodeBase64)(data.nonce);if(r.length<Zt.secretbox.nonceLength)J.error("Expected encrypted event nonce length to be "+Zt.secretbox.nonceLength+", got: "+r.length);else{var o=Zt.secretbox.open(n,r,this.key);if(null===o)return J.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."),void this.authorize(this.pusher.connection.socket_id,(function(c,h){c?J.error("Failed to make a request to the authEndpoint: "+h+". Unable to fetch new key, so dropping encrypted event"):null!==(o=Zt.secretbox.open(n,r,e.key))?e.emitJSON(t,Object(Qt.encodeUTF8)(o)):J.error("Failed to decrypt event with new key. Dropping encrypted event")}));this.emitJSON(t,Object(Qt.encodeUTF8)(o))}}}else J.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+data);else J.debug("Received encrypted event before key has been retrieved from the authEndpoint")},e.prototype.emitJSON=function(t,data){try{this.emit(t,JSON.parse(data))}catch(e){this.emit(t,data)}return this},e}(Wt),ne=ee,re=function(){var t=function(e,b){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,b){t.__proto__=b}||function(t,b){for(var p in b)b.hasOwnProperty(p)&&(t[p]=b[p])},t(e,b)};return function(e,b){function n(){this.constructor=e}t(e,b),e.prototype=null===b?Object.create(b):(n.prototype=b.prototype,new n)}}(),oe=function(t){function e(e,n){var r=t.call(this)||this;r.key=e,r.options=n||{},r.state="initialized",r.connection=null,r.usingTLS=!!n.useTLS,r.timeline=r.options.timeline,r.errorCallbacks=r.buildErrorCallbacks(),r.connectionCallbacks=r.buildConnectionCallbacks(r.errorCallbacks),r.handshakeCallbacks=r.buildHandshakeCallbacks(r.errorCallbacks);var o=je.getNetwork();return o.bind("online",(function(){r.timeline.info({netinfo:"online"}),"connecting"!==r.state&&"unavailable"!==r.state||r.retryIn(0)})),o.bind("offline",(function(){r.timeline.info({netinfo:"offline"}),r.connection&&r.sendActivityCheck()})),r.updateStrategy(),r}return re(e,t),e.prototype.connect=function(){this.connection||this.runner||(this.strategy.isSupported()?(this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()):this.updateState("failed"))},e.prototype.send=function(data){return!!this.connection&&this.connection.send(data)},e.prototype.send_event=function(t,data,e){return!!this.connection&&this.connection.send_event(t,data,e)},e.prototype.disconnect=function(){this.disconnectInternally(),this.updateState("disconnected")},e.prototype.isUsingTLS=function(){return this.usingTLS},e.prototype.startConnecting=function(){var t=this,e=function(n,r){n?t.runner=t.strategy.connect(0,e):"error"===r.action?(t.emit("error",{type:"HandshakeError",error:r.error}),t.timeline.error({handshakeError:r.error})):(t.abortConnecting(),t.handshakeCallbacks[r.action](r))};this.runner=this.strategy.connect(0,e)},e.prototype.abortConnecting=function(){this.runner&&(this.runner.abort(),this.runner=null)},e.prototype.disconnectInternally=function(){this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection&&this.abandonConnection().close()},e.prototype.updateStrategy=function(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})},e.prototype.retryIn=function(t){var e=this;this.timeline.info({action:"retry",delay:t}),t>0&&this.emit("connecting_in",Math.round(t/1e3)),this.retryTimer=new C(t||0,(function(){e.disconnectInternally(),e.connect()}))},e.prototype.clearRetryTimer=function(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)},e.prototype.setUnavailableTimer=function(){var t=this;this.unavailableTimer=new C(this.options.unavailableTimeout,(function(){t.updateState("unavailable")}))},e.prototype.clearUnavailableTimer=function(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()},e.prototype.sendActivityCheck=function(){var t=this;this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new C(this.options.pongTimeout,(function(){t.timeline.error({pong_timed_out:t.options.pongTimeout}),t.retryIn(0)}))},e.prototype.resetActivityCheck=function(){var t=this;this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new C(this.activityTimeout,(function(){t.sendActivityCheck()})))},e.prototype.stopActivityCheck=function(){this.activityTimer&&this.activityTimer.ensureAborted()},e.prototype.buildConnectionCallbacks=function(t){var e=this;return I({},t,{message:function(t){e.resetActivityCheck(),e.emit("message",t)},ping:function(){e.send_event("pusher:pong",{})},activity:function(){e.resetActivityCheck()},error:function(t){e.emit("error",{type:"WebSocketError",error:t})},closed:function(){e.abandonConnection(),e.shouldRetry()&&e.retryIn(1e3)}})},e.prototype.buildHandshakeCallbacks=function(t){var e=this;return I({},t,{connected:function(t){e.activityTimeout=Math.min(e.options.activityTimeout,t.activityTimeout,t.connection.activityTimeout||1/0),e.clearUnavailableTimer(),e.setConnection(t.connection),e.socket_id=e.connection.id,e.updateState("connected",{socket_id:e.socket_id})}})},e.prototype.buildErrorCallbacks=function(){var t=this,e=function(e){return function(n){n.error&&t.emit("error",{type:"WebSocketError",error:n.error}),e(n)}};return{tls_only:e((function(){t.usingTLS=!0,t.updateStrategy(),t.retryIn(0)})),refused:e((function(){t.disconnect()})),backoff:e((function(){t.retryIn(1e3)})),retry:e((function(){t.retryIn(0)}))}},e.prototype.setConnection=function(t){for(var e in this.connection=t,this.connectionCallbacks)this.connection.bind(e,this.connectionCallbacks[e]);this.resetActivityCheck()},e.prototype.abandonConnection=function(){if(this.connection){for(var t in this.stopActivityCheck(),this.connectionCallbacks)this.connection.unbind(t,this.connectionCallbacks[t]);var e=this.connection;return this.connection=null,e}},e.prototype.updateState=function(t,data){var e=this.state;if(this.state=t,e!==t){var n=t;"connected"===n&&(n+=" with new socket ID "+data.socket_id),J.debug("State changed",e+" -> "+n),this.timeline.info({state:t,params:data}),this.emit("state_change",{previous:e,current:t}),this.emit(t,data)}},e.prototype.shouldRetry=function(){return"connecting"===this.state||"connected"===this.state},e}(ut),ie=function(){function t(){this.channels={}}return t.prototype.add=function(t,e){return this.channels[t]||(this.channels[t]=function(t,e){return 0===t.indexOf("private-encrypted-")?ae.createEncryptedChannel(t,e):0===t.indexOf("private-")?ae.createPrivateChannel(t,e):0===t.indexOf("presence-")?ae.createPresenceChannel(t,e):ae.createChannel(t,e)}(t,e)),this.channels[t]},t.prototype.all=function(){return function(object){var t=[];return B(object,(function(e){t.push(e)})),t}(this.channels)},t.prototype.find=function(t){return this.channels[t]},t.prototype.remove=function(t){var e=this.channels[t];return delete this.channels[t],e},t.prototype.disconnect=function(){B(this.channels,(function(t){t.disconnect()}))},t}(),se=ie,ae={createChannels:function(){return new se},createConnectionManager:function(t,e){return new oe(t,e)},createChannel:function(t,e){return new Ft(t,e)},createPrivateChannel:function(t,e){return new Wt(t,e)},createPresenceChannel:function(t,e){return new Gt(t,e)},createEncryptedChannel:function(t,e){return new ne(t,e)},createTimelineSender:function(t,e){return new jt(t,e)},createAuthorizer:function(t,e){return e.authorizer?e.authorizer(t,e):new It(t,e)},createHandshake:function(t,e){return new Lt(t,e)},createAssistantToTheTransportManager:function(t,e,n){return new Ot(t,e,n)}},ce=function(){function t(t){this.options=t||{},this.livesLeft=this.options.lives||1/0}return t.prototype.getAssistant=function(t){return ae.createAssistantToTheTransportManager(this,t,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})},t.prototype.isAlive=function(){return this.livesLeft>0},t.prototype.reportDeath=function(){this.livesLeft-=1},t}(),ue=function(){function t(t,e){this.strategies=t,this.loop=Boolean(e.loop),this.failFast=Boolean(e.failFast),this.timeout=e.timeout,this.timeoutLimit=e.timeoutLimit}return t.prototype.isSupported=function(){return H(this.strategies,L.method("isSupported"))},t.prototype.connect=function(t,e){var n=this,r=this.strategies,o=0,c=this.timeout,h=null,f=function(l,d){d?e(null,d):(o+=1,n.loop&&(o%=r.length),o<r.length?(c&&(c*=2,n.timeoutLimit&&(c=Math.min(c,n.timeoutLimit))),h=n.tryStrategy(r[o],t,{timeout:c,failFast:n.failFast},f)):e(!0))};return h=this.tryStrategy(r[o],t,{timeout:c,failFast:this.failFast},f),{abort:function(){h.abort()},forceMinPriority:function(p){t=p,h&&h.forceMinPriority(p)}}},t.prototype.tryStrategy=function(t,e,n,r){var o=null,c=null;return n.timeout>0&&(o=new C(n.timeout,(function(){c.abort(),r(!0)}))),c=t.connect(e,(function(t,e){t&&o&&o.isRunning()&&!n.failFast||(o&&o.ensureAborted(),r(t,e))})),{abort:function(){o&&o.ensureAborted(),c.abort()},forceMinPriority:function(p){c.forceMinPriority(p)}}},t}(),he=function(){function t(t){this.strategies=t}return t.prototype.isSupported=function(){return H(this.strategies,L.method("isSupported"))},t.prototype.connect=function(t,e){return function(t,e,n){var r=map(t,(function(t,i,r,o){return t.connect(e,n(i,o))}));return{abort:function(){D(r,fe)},forceMinPriority:function(p){D(r,(function(t){t.forceMinPriority(p)}))}}}(this.strategies,t,(function(i,t){return function(n,r){t[i].error=n,n?function(t){return function(t,e){for(var i=0;i<t.length;i++)if(!e(t[i],i,t))return!1;return!0}(t,(function(t){return Boolean(t.error)}))}(t)&&e(!0):(D(t,(function(t){t.forceMinPriority(r.transport.priority)})),e(null,r))}}))},t}();function fe(t){t.error||t.aborted||(t.abort(),t.aborted=!0)}var le=function(){function t(t,e,n){this.strategy=t,this.transports=e,this.ttl=n.ttl||18e5,this.usingTLS=n.useTLS,this.timeline=n.timeline}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,e){var n=this.usingTLS,r=function(t){var e=je.getLocalStorage();if(e)try{var n=e[de(t)];if(n)return JSON.parse(n)}catch(e){ye(t)}return null}(n),o=[this.strategy];if(r&&r.timestamp+this.ttl>=L.now()){var c=this.transports[r.transport];c&&(this.timeline.info({cached:!0,transport:r.transport,latency:r.latency}),o.push(new ue([c],{timeout:2*r.latency+1e3,failFast:!0})))}var h=L.now(),f=o.pop().connect(t,(function r(c,l){c?(ye(n),o.length>0?(h=L.now(),f=o.pop().connect(t,r)):e(c)):(function(t,e,n){var r=je.getLocalStorage();if(r)try{r[de(t)]=F({timestamp:L.now(),transport:e,latency:n})}catch(t){}}(n,l.transport.name,L.now()-h),e(null,l))}));return{abort:function(){f.abort()},forceMinPriority:function(p){t=p,f&&f.forceMinPriority(p)}}},t}(),pe=le;function de(t){return"pusherTransport"+(t?"TLS":"NonTLS")}function ye(t){var e=je.getLocalStorage();if(e)try{delete e[de(t)]}catch(t){}}var ge=function(){function t(t,e){var n=e.delay;this.strategy=t,this.options={delay:n}}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,e){var n,r=this.strategy,o=new C(this.options.delay,(function(){n=r.connect(t,e)}));return{abort:function(){o.ensureAborted(),n&&n.abort()},forceMinPriority:function(p){t=p,n&&n.forceMinPriority(p)}}},t}(),ve=function(){function t(t,e,n){this.test=t,this.trueBranch=e,this.falseBranch=n}return t.prototype.isSupported=function(){return(this.test()?this.trueBranch:this.falseBranch).isSupported()},t.prototype.connect=function(t,e){return(this.test()?this.trueBranch:this.falseBranch).connect(t,e)},t}(),be=function(){function t(t){this.strategy=t}return t.prototype.isSupported=function(){return this.strategy.isSupported()},t.prototype.connect=function(t,e){var n=this.strategy.connect(t,(function(t,r){r&&n.abort(),e(t,r)}));return n},t}();function me(t){return function(){return t.isSupported()}}var we,ke=function(t,e){var n={};function r(r,o,c,h,f){var l=e(t,r,o,c,h,f);return n[r]=l,l}var o,c={hostNonTLS:t.wsHost+":"+t.wsPort,hostTLS:t.wsHost+":"+t.wssPort,httpPath:t.wsPath},h=I({},c,{useTLS:!0}),f={hostNonTLS:t.httpHost+":"+t.httpPort,hostTLS:t.httpHost+":"+t.httpsPort,httpPath:t.httpPath},l={loop:!0,timeout:15e3,timeoutLimit:6e4},d=new ce({lives:2,minPingDelay:1e4,maxPingDelay:t.activity_timeout}),y=new ce({lives:2,minPingDelay:1e4,maxPingDelay:t.activity_timeout}),v=r("ws","ws",3,c,d),m=r("wss","ws",3,h,d),w=r("sockjs","sockjs",1,f),k=r("xhr_streaming","xhr_streaming",1,f,y),_=r("xdr_streaming","xdr_streaming",1,f,y),S=r("xhr_polling","xhr_polling",1,f),E=r("xdr_polling","xdr_polling",1,f),A=new ue([v],l),T=new ue([m],l),x=new ue([w],l),O=new ue([new ve(me(k),k,_)],l),P=new ue([new ve(me(S),S,E)],l),C=new ue([new ve(me(O),new he([O,new ge(P,{delay:4e3})]),P)],l),R=new ve(me(C),C,x);return o=t.useTLS?new he([A,new ge(R,{delay:2e3})]):new he([A,new ge(T,{delay:2e3}),new ge(R,{delay:5e3})]),new pe(new be(new ve(me(v),o,R)),n,{ttl:18e5,timeline:t.timeline,useTLS:t.useTLS})},_e={getRequest:function(t){var e=new window.XDomainRequest;return e.ontimeout=function(){t.emit("error",new Nt),t.close()},e.onerror=function(e){t.emit("error",e),t.close()},e.onprogress=function(){e.responseText&&e.responseText.length>0&&t.onChunk(200,e.responseText)},e.onload=function(){e.responseText&&e.responseText.length>0&&t.onChunk(200,e.responseText),t.emit("finished",200),t.close()},e},abortRequest:function(t){t.ontimeout=t.onerror=t.onprogress=t.onload=null,t.abort()}},Se=function(){var t=function(e,b){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,b){t.__proto__=b}||function(t,b){for(var p in b)b.hasOwnProperty(p)&&(t[p]=b[p])},t(e,b)};return function(e,b){function n(){this.constructor=e}t(e,b),e.prototype=null===b?Object.create(b):(n.prototype=b.prototype,new n)}}(),Ee=function(t){function e(e,n,r){var o=t.call(this)||this;return o.hooks=e,o.method=n,o.url=r,o}return Se(e,t),e.prototype.start=function(t){var e=this;this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=function(){e.close()},je.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(t)},e.prototype.close=function(){this.unloader&&(je.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)},e.prototype.onChunk=function(t,data){for(;;){var e=this.advanceBuffer(data);if(!e)break;this.emit("chunk",{status:t,data:e})}this.isBufferTooLong(data)&&this.emit("buffer_too_long")},e.prototype.advanceBuffer=function(t){var e=t.slice(this.position),n=e.indexOf("\n");return-1!==n?(this.position+=n+1,e.slice(0,n)):null},e.prototype.isBufferTooLong=function(t){return this.position===t.length&&t.length>262144},e}(ut);!function(t){t[t.CONNECTING=0]="CONNECTING",t[t.OPEN=1]="OPEN",t[t.CLOSED=3]="CLOSED"}(we||(we={}));var Ae=we,Te=1;function xe(t){var e=-1===t.indexOf("?")?"?":"&";return t+e+"t="+ +new Date+"&n="+Te++}function Oe(t){return Math.floor(Math.random()*t)}var Pe,Ce=function(){function t(t,e){this.hooks=t,this.session=Oe(1e3)+"/"+function(t){for(var e=[],i=0;i<t;i++)e.push(Oe(32).toString(32));return e.join("")}(8),this.location=function(t){var e=/([^\?]*)\/*(\??.*)/.exec(t);return{base:e[1],queryString:e[2]}}(e),this.readyState=Ae.CONNECTING,this.openStream()}return t.prototype.send=function(t){return this.sendRaw(JSON.stringify([t]))},t.prototype.ping=function(){this.hooks.sendHeartbeat(this)},t.prototype.close=function(code,t){this.onClose(code,t,!0)},t.prototype.sendRaw=function(t){if(this.readyState!==Ae.OPEN)return!1;try{return je.createSocketRequest("POST",xe((e=this.location,n=this.session,e.base+"/"+n+"/xhr_send"))).start(t),!0}catch(t){return!1}var e,n},t.prototype.reconnect=function(){this.closeStream(),this.openStream()},t.prototype.onClose=function(code,t,e){this.closeStream(),this.readyState=Ae.CLOSED,this.onclose&&this.onclose({code:code,reason:t,wasClean:e})},t.prototype.onChunk=function(t){var e;if(200===t.status)switch(this.readyState===Ae.OPEN&&this.onActivity(),t.data.slice(0,1)){case"o":e=JSON.parse(t.data.slice(1)||"{}"),this.onOpen(e);break;case"a":e=JSON.parse(t.data.slice(1)||"[]");for(var i=0;i<e.length;i++)this.onEvent(e[i]);break;case"m":e=JSON.parse(t.data.slice(1)||"null"),this.onEvent(e);break;case"h":this.hooks.onHeartbeat(this);break;case"c":e=JSON.parse(t.data.slice(1)||"[]"),this.onClose(e[0],e[1],!0)}},t.prototype.onOpen=function(t){var e,n,r;this.readyState===Ae.CONNECTING?(t&&t.hostname&&(this.location.base=(e=this.location.base,n=t.hostname,(r=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(e))[1]+n+r[3])),this.readyState=Ae.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)},t.prototype.onEvent=function(t){this.readyState===Ae.OPEN&&this.onmessage&&this.onmessage({data:t})},t.prototype.onActivity=function(){this.onactivity&&this.onactivity()},t.prototype.onError=function(t){this.onerror&&this.onerror(t)},t.prototype.openStream=function(){var t=this;this.stream=je.createSocketRequest("POST",xe(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",(function(e){t.onChunk(e)})),this.stream.bind("finished",(function(e){t.hooks.onFinished(t,e)})),this.stream.bind("buffer_too_long",(function(){t.reconnect()}));try{this.stream.start()}catch(e){L.defer((function(){t.onError(e),t.onClose(1006,"Could not start streaming",!1)}))}},t.prototype.closeStream=function(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)},t}(),Re={getReceiveURL:function(t,e){return t.base+"/"+e+"/xhr_streaming"+t.queryString},onHeartbeat:function(t){t.sendRaw("[]")},sendHeartbeat:function(t){t.sendRaw("[]")},onFinished:function(t,e){t.onClose(1006,"Connection interrupted ("+e+")",!1)}},Ue={getReceiveURL:function(t,e){return t.base+"/"+e+"/xhr"+t.queryString},onHeartbeat:function(){},sendHeartbeat:function(t){t.sendRaw("[]")},onFinished:function(t,e){200===e?t.reconnect():t.onClose(1006,"Connection interrupted ("+e+")",!1)}},Le={getRequest:function(t){var e=new(je.getXHRAPI());return e.onreadystatechange=e.onprogress=function(){switch(e.readyState){case 3:e.responseText&&e.responseText.length>0&&t.onChunk(e.status,e.responseText);break;case 4:e.responseText&&e.responseText.length>0&&t.onChunk(e.status,e.responseText),t.emit("finished",e.status),t.close()}},e},abortRequest:function(t){t.onreadystatechange=null,t.abort()}},Ie={createStreamingSocket:function(t){return this.createSocket(Re,t)},createPollingSocket:function(t){return this.createSocket(Ue,t)},createSocket:function(t,e){return new Ce(t,e)},createXHR:function(t,e){return this.createRequest(Le,t,e)},createRequest:function(t,e,n){return new Ee(t,e,n)},createXDR:function(t,e){return this.createRequest(_e,t,e)}},je={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:o,DependenciesReceivers:f,getDefaultStrategy:ke,Transports:At,transportConnectionInitializer:function(){var t=this;t.timeline.info(t.buildTimelineMessage({transport:t.name+(t.options.useTLS?"s":"")})),t.hooks.isInitialized()?t.changeState("initialized"):t.hooks.file?(t.changeState("initializing"),l.load(t.hooks.file,{useTLS:t.options.useTLS},(function(e,n){t.hooks.isInitialized()?(t.changeState("initialized"),n(!0)):(e&&t.onError(e),t.onClose(),n(!1))}))):t.onClose()},HTTPFactory:Ie,TimelineTransport:tt,getXHRAPI:function(){return window.XMLHttpRequest},getWebSocketAPI:function(){return window.WebSocket||window.MozWebSocket},setup:function(t){var e=this;window.Pusher=t;var n=function(){e.onDocumentBody(t.ready)};window.JSON?n():l.load("json2",{},n)},getDocument:function(){return document},getProtocol:function(){return this.getDocument().location.protocol},getAuthorizers:function(){return{ajax:V,jsonp:G}},onDocumentBody:function(t){var e=this;document.body?t():setTimeout((function(){e.onDocumentBody(t)}),0)},createJSONPRequest:function(t,data){return new Q(t,data)},createScriptRequest:function(t){return new Z(t)},getLocalStorage:function(){try{return window.localStorage}catch(t){return}},createXHR:function(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest:function(){return new(this.getXHRAPI())},createMicrosoftXHR:function(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork:function(){return xt},createWebSocket:function(t){return new(this.getWebSocketAPI())(t)},createSocketRequest:function(t,e){if(this.isXHRSupported())return this.HTTPFactory.createXHR(t,e);if(this.isXDRSupported(0===e.indexOf("https:")))return this.HTTPFactory.createXDR(t,e);throw"Cross-origin HTTP requests are not supported"},isXHRSupported:function(){var t=this.getXHRAPI();return Boolean(t)&&void 0!==(new t).withCredentials},isXDRSupported:function(t){var e=t?"https:":"http:",n=this.getProtocol();return Boolean(window.XDomainRequest)&&n===e},addUnloadListener:function(t){void 0!==window.addEventListener?window.addEventListener("unload",t,!1):void 0!==window.attachEvent&&window.attachEvent("onunload",t)},removeUnloadListener:function(t){void 0!==window.addEventListener?window.removeEventListener("unload",t,!1):void 0!==window.detachEvent&&window.detachEvent("onunload",t)}};!function(t){t[t.ERROR=3]="ERROR",t[t.INFO=6]="INFO",t[t.DEBUG=7]="DEBUG"}(Pe||(Pe={}));var Me=Pe,Be=function(){function t(t,e,n){this.key=t,this.session=e,this.events=[],this.options=n||{},this.sent=0,this.uniqueID=0}return t.prototype.log=function(t,e){t<=this.options.level&&(this.events.push(I({},e,{timestamp:L.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())},t.prototype.error=function(t){this.log(Me.ERROR,t)},t.prototype.info=function(t){this.log(Me.INFO,t)},t.prototype.debug=function(t){this.log(Me.DEBUG,t)},t.prototype.isEmpty=function(){return 0===this.events.length},t.prototype.send=function(t,e){var n=this,data=I({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],t(data,(function(t,r){t||n.sent++,e&&e(t,r)})),!0},t.prototype.generateUniqueID=function(){return this.uniqueID++,this.uniqueID},t}(),Ne=function(){function t(t,e,n,r){this.name=t,this.priority=e,this.transport=n,this.options=r||{}}return t.prototype.isSupported=function(){return this.transport.isSupported({useTLS:this.options.useTLS})},t.prototype.connect=function(t,e){var n=this;if(!this.isSupported())return De(new zt,e);if(this.priority<t)return De(new Dt,e);var r=!1,o=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),c=null,h=function(){o.unbind("initialized",h),o.connect()},f=function(){c=ae.createHandshake(o,(function(t){r=!0,y(),e(null,t)}))},l=function(t){y(),e(t)},d=function(){var t;y(),t=F(o),e(new qt(t))},y=function(){o.unbind("initialized",h),o.unbind("open",f),o.unbind("error",l),o.unbind("closed",d)};return o.bind("initialized",h),o.bind("open",f),o.bind("error",l),o.bind("closed",d),o.initialize(),{abort:function(){r||(y(),c?c.close():o.close())},forceMinPriority:function(p){r||n.priority<p&&(c?c.close():o.close())}}},t}();function De(t,e){return L.defer((function(){e(t)})),{abort:function(){},forceMinPriority:function(){}}}var qe=je.Transports,$e=function(t,e,n,r,o,c){var h=qe[n];if(!h)throw new Ht(n);return t.enabledTransports&&-1===M(t.enabledTransports,e)||t.disabledTransports&&-1!==M(t.disabledTransports,e)?He:new Ne(e,r,c?c.getAssistant(h):h,I({key:t.key,useTLS:t.useTLS,timeline:t.timeline,ignoreNullOrigin:t.ignoreNullOrigin},o))},He={isSupported:function(){return!1},connect:function(t,e){var n=L.defer((function(){e(new zt)}));return{abort:function(){n.ensureAborted()},forceMinPriority:function(){}}}},ze=function(){function t(e,n){var r,o=this;if(function(t){if(null==t)throw"You must pass your app key when you instantiate Pusher."}(e),!(n=n||{}).cluster&&!n.wsHost&&!n.httpHost){var h=K("javascriptQuickStart");J.warn("You should always specify a cluster when connecting. "+h)}"disableStats"in n&&(J.warn("The disableStats option is deprecated in favor of enableStats"),"enableStats"in n||(n.enableStats=!n.disableStats)),this.key=e,this.config=I({wsHost:c.host,wsPort:c.ws_port,wssPort:c.wss_port,wsPath:c.ws_path,httpHost:c.sockjs_host,httpPort:c.sockjs_http_port,httpsPort:c.sockjs_https_port,httpPath:c.sockjs_path,statsHost:c.stats_host,authEndpoint:c.channel_auth_endpoint,authTransport:c.channel_auth_transport,activity_timeout:c.activity_timeout,pong_timeout:c.pong_timeout,unavailable_timeout:c.unavailable_timeout},n.cluster?{wsHost:"ws-"+(r=n.cluster)+".pusher.com",httpHost:"sockjs-"+r+".pusher.com"}:{},n),this.channels=ae.createChannels(),this.global_emitter=new ut,this.sessionID=Math.floor(1e9*Math.random()),this.timeline=new Be(this.key,this.sessionID,{cluster:this.config.cluster,features:t.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:Me.INFO,version:c.VERSION}),this.config.enableStats&&(this.timelineSender=ae.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+je.TimelineTransport.name})),this.connection=ae.createConnectionManager(this.key,I({getStrategy:function(t){var e=I({},o.config,t);return je.getDefaultStrategy(e,$e)},timeline:this.timeline,activityTimeout:this.config.activity_timeout,pongTimeout:this.config.pong_timeout,unavailableTimeout:this.config.unavailable_timeout},this.config,{useTLS:this.shouldUseTLS()})),this.connection.bind("connected",(function(){o.subscribeAll(),o.timelineSender&&o.timelineSender.send(o.connection.isUsingTLS())})),this.connection.bind("message",(function(t){var e=0===t.event.indexOf("pusher_internal:");if(t.channel){var n=o.channel(t.channel);n&&n.handleEvent(t)}e||o.global_emitter.emit(t.event,t.data)})),this.connection.bind("connecting",(function(){o.channels.disconnect()})),this.connection.bind("disconnected",(function(){o.channels.disconnect()})),this.connection.bind("error",(function(t){J.warn(t)})),t.instances.push(this),this.timeline.info({instances:t.instances.length}),t.isReady&&this.connect()}return t.ready=function(){t.isReady=!0;for(var i=0,e=t.instances.length;i<e;i++)t.instances[i].connect()},t.getClientFeatures=function(){return N($({ws:je.Transports.ws},(function(t){return t.isSupported({})})))},t.prototype.channel=function(t){return this.channels.find(t)},t.prototype.allChannels=function(){return this.channels.all()},t.prototype.connect=function(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var t=this.connection.isUsingTLS(),e=this.timelineSender;this.timelineSenderTimer=new R(6e4,(function(){e.send(t)}))}},t.prototype.disconnect=function(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)},t.prototype.bind=function(t,e,n){return this.global_emitter.bind(t,e,n),this},t.prototype.unbind=function(t,e,n){return this.global_emitter.unbind(t,e,n),this},t.prototype.bind_global=function(t){return this.global_emitter.bind_global(t),this},t.prototype.unbind_global=function(t){return this.global_emitter.unbind_global(t),this},t.prototype.unbind_all=function(t){return this.global_emitter.unbind_all(),this},t.prototype.subscribeAll=function(){var t;for(t in this.channels.channels)this.channels.channels.hasOwnProperty(t)&&this.subscribe(t)},t.prototype.subscribe=function(t){var e=this.channels.add(t,this);return e.subscriptionPending&&e.subscriptionCancelled?e.reinstateSubscription():e.subscriptionPending||"connected"!==this.connection.state||e.subscribe(),e},t.prototype.unsubscribe=function(t){var e=this.channels.find(t);e&&e.subscriptionPending?e.cancelSubscription():(e=this.channels.remove(t))&&"connected"===this.connection.state&&e.unsubscribe()},t.prototype.send_event=function(t,data,e){return this.connection.send_event(t,data,e)},t.prototype.shouldUseTLS=function(){return"https:"===je.getProtocol()||!0===this.config.forceTLS||Boolean(this.config.encrypted)},t.instances=[],t.isReady=!1,t.logToConsole=!1,t.Runtime=je,t.ScriptReceivers=je.ScriptReceivers,t.DependenciesReceivers=je.DependenciesReceivers,t.auth_callbacks=je.auth_callbacks,t}(),Ye=e.default=ze;je.setup(ze)}])},t.exports=n()}).call(this,n(207).Buffer)},207:function(t,e,n){"use strict";(function(t){var r=n(208),o=n(209),c=n(210);function h(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function f(t,e){if(h()<e)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=l.prototype:(null===t&&(t=new l(e)),t.length=e),t}function l(t,e,n){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return v(this,t)}return d(this,t,e,n)}function d(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);l.TYPED_ARRAY_SUPPORT?(t=e).__proto__=l.prototype:t=m(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!l.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|k(e,n),o=(t=f(t,r)).write(e,n);o!==r&&(t=t.slice(0,o));return t}(t,e,n):function(t,e){if(l.isBuffer(e)){var n=0|w(e.length);return 0===(t=f(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?f(t,0):m(t,e);if("Buffer"===e.type&&c(e.data))return m(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function y(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function v(t,e){if(y(e),t=f(t,e<0?0:0|w(e)),!l.TYPED_ARRAY_SUPPORT)for(var i=0;i<e;++i)t[i]=0;return t}function m(t,e){var n=e.length<0?0:0|w(e.length);t=f(t,n);for(var i=0;i<n;i+=1)t[i]=255&e[i];return t}function w(t){if(t>=h())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+h().toString(16)+" bytes");return 0|t}function k(t,e){if(l.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(t).length;default:if(r)return K(t).length;e=(""+e).toLowerCase(),r=!0}}function _(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return B(this,e,n);case"utf8":case"utf-8":return L(this,e,n);case"ascii":return j(this,e,n);case"latin1":case"binary":return M(this,e,n);case"base64":return U(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function S(b,t,e){var i=b[t];b[t]=b[e],b[e]=i}function E(t,e,n,r,o){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof e&&(e=l.from(e,r)),l.isBuffer(e))return 0===e.length?-1:A(t,e,n,r,o);if("number"==typeof e)return e&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):A(t,[e],n,r,o);throw new TypeError("val must be string, number or Buffer")}function A(t,e,n,r,o){var i,c=1,h=t.length,f=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;c=2,h/=2,f/=2,n/=2}function l(t,i){return 1===c?t[i]:t.readUInt16BE(i*c)}if(o){var d=-1;for(i=n;i<h;i++)if(l(t,i)===l(e,-1===d?0:i-d)){if(-1===d&&(d=i),i-d+1===f)return d*c}else-1!==d&&(i-=i-d),d=-1}else for(n+f>h&&(n=h-f),i=n;i>=0;i--){for(var y=!0,v=0;v<f;v++)if(l(t,i+v)!==l(e,v)){y=!1;break}if(y)return i}return-1}function T(t,e,n,r){n=Number(n)||0;var o=t.length-n;r?(r=Number(r))>o&&(r=o):r=o;var c=e.length;if(c%2!=0)throw new TypeError("Invalid hex string");r>c/2&&(r=c/2);for(var i=0;i<r;++i){var h=parseInt(e.substr(2*i,2),16);if(isNaN(h))return i;t[n+i]=h}return i}function x(t,e,n,r){return G(K(e,t.length-n),t,n,r)}function O(t,e,n,r){return G(function(t){for(var e=[],i=0;i<t.length;++i)e.push(255&t.charCodeAt(i));return e}(e),t,n,r)}function P(t,e,n,r){return O(t,e,n,r)}function C(t,e,n,r){return G(V(e),t,n,r)}function R(t,e,n,r){return G(function(t,e){for(var n,r,o,c=[],i=0;i<t.length&&!((e-=2)<0);++i)r=(n=t.charCodeAt(i))>>8,o=n%256,c.push(o),c.push(r);return c}(e,t.length-n),t,n,r)}function U(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function L(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,c,h,f,l=t[i],d=null,y=l>239?4:l>223?3:l>191?2:1;if(i+y<=n)switch(y){case 1:l<128&&(d=l);break;case 2:128==(192&(o=t[i+1]))&&(f=(31&l)<<6|63&o)>127&&(d=f);break;case 3:o=t[i+1],c=t[i+2],128==(192&o)&&128==(192&c)&&(f=(15&l)<<12|(63&o)<<6|63&c)>2047&&(f<55296||f>57343)&&(d=f);break;case 4:o=t[i+1],c=t[i+2],h=t[i+3],128==(192&o)&&128==(192&c)&&128==(192&h)&&(f=(15&l)<<18|(63&o)<<12|(63&c)<<6|63&h)>65535&&f<1114112&&(d=f)}null===d?(d=65533,y=1):d>65535&&(d-=65536,r.push(d>>>10&1023|55296),d=56320|1023&d),r.push(d),i+=y}return function(t){var e=t.length;if(e<=I)return String.fromCharCode.apply(String,t);var n="",i=0;for(;i<e;)n+=String.fromCharCode.apply(String,t.slice(i,i+=I));return n}(r)}e.Buffer=l,e.SlowBuffer=function(t){+t!=t&&(t=0);return l.alloc(+t)},e.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=h(),l.poolSize=8192,l._augment=function(t){return t.__proto__=l.prototype,t},l.from=function(t,e,n){return d(null,t,e,n)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(t,e,n){return function(t,e,n,r){return y(e),e<=0?f(t,e):void 0!==n?"string"==typeof r?f(t,e).fill(n,r):f(t,e).fill(n):f(t,e)}(null,t,e,n)},l.allocUnsafe=function(t){return v(null,t)},l.allocUnsafeSlow=function(t){return v(null,t)},l.isBuffer=function(b){return!(null==b||!b._isBuffer)},l.compare=function(a,b){if(!l.isBuffer(a)||!l.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var t=a.length,e=b.length,i=0,n=Math.min(t,e);i<n;++i)if(a[i]!==b[i]){t=a[i],e=b[i];break}return t<e?-1:e<t?1:0},l.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(t,e){if(!c(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return l.alloc(0);var i;if(void 0===e)for(e=0,i=0;i<t.length;++i)e+=t[i].length;var n=l.allocUnsafe(e),r=0;for(i=0;i<t.length;++i){var o=t[i];if(!l.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,r),r+=o.length}return n},l.byteLength=k,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var i=0;i<t;i+=2)S(this,i,i+1);return this},l.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var i=0;i<t;i+=4)S(this,i,i+3),S(this,i+1,i+2);return this},l.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var i=0;i<t;i+=8)S(this,i,i+7),S(this,i+1,i+6),S(this,i+2,i+5),S(this,i+3,i+4);return this},l.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?L(this,0,t):_.apply(this,arguments)},l.prototype.equals=function(b){if(!l.isBuffer(b))throw new TypeError("Argument must be a Buffer");return this===b||0===l.compare(this,b)},l.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},l.prototype.compare=function(t,e,n,r,o){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),e<0||n>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&e>=n)return 0;if(r>=o)return-1;if(e>=n)return 1;if(this===t)return 0;for(var c=(o>>>=0)-(r>>>=0),h=(n>>>=0)-(e>>>=0),f=Math.min(c,h),d=this.slice(r,o),y=t.slice(e,n),i=0;i<f;++i)if(d[i]!==y[i]){c=d[i],h=y[i];break}return c<h?-1:h<c?1:0},l.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},l.prototype.indexOf=function(t,e,n){return E(this,t,e,n,!0)},l.prototype.lastIndexOf=function(t,e,n){return E(this,t,e,n,!1)},l.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-e;if((void 0===n||n>o)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var c=!1;;)switch(r){case"hex":return T(this,t,e,n);case"utf8":case"utf-8":return x(this,t,e,n);case"ascii":return O(this,t,e,n);case"latin1":case"binary":return P(this,t,e,n);case"base64":return C(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,e,n);default:if(c)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),c=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function j(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function M(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function B(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=e;i<n;++i)o+=W(t[i]);return o}function N(t,e,n){for(var r=t.slice(e,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function D(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function $(t,e,n,r,o,c){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<c)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function H(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function z(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function Y(t,e,n,r,o,c){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function F(t,e,n,r,c){return c||Y(t,0,n,4),o.write(t,e,n,r,23,4),n+4}function X(t,e,n,r,c){return c||Y(t,0,n,8),o.write(t,e,n,r,52,8),n+8}l.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),l.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=l.prototype;else{var o=e-t;n=new l(o,void 0);for(var i=0;i<o;++i)n[i]=this[i+t]}return n},l.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||D(t,e,this.length);for(var r=this[t],o=1,i=0;++i<e&&(o*=256);)r+=this[t+i]*o;return r},l.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||D(t,e,this.length);for(var r=this[t+--e],o=1;e>0&&(o*=256);)r+=this[t+--e]*o;return r},l.prototype.readUInt8=function(t,e){return e||D(t,1,this.length),this[t]},l.prototype.readUInt16LE=function(t,e){return e||D(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUInt16BE=function(t,e){return e||D(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUInt32LE=function(t,e){return e||D(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUInt32BE=function(t,e){return e||D(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||D(t,e,this.length);for(var r=this[t],o=1,i=0;++i<e&&(o*=256);)r+=this[t+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*e)),r},l.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||D(t,e,this.length);for(var i=e,r=1,o=this[t+--i];i>0&&(r*=256);)o+=this[t+--i]*r;return o>=(r*=128)&&(o-=Math.pow(2,8*e)),o},l.prototype.readInt8=function(t,e){return e||D(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){e||D(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(t,e){e||D(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(t,e){return e||D(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return e||D(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return e||D(t,4,this.length),o.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return e||D(t,4,this.length),o.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return e||D(t,8,this.length),o.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return e||D(t,8,this.length),o.read(this,t,!1,52,8)},l.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||$(this,t,e,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[e]=255&t;++i<n&&(o*=256);)this[e+i]=t/o&255;return e+n},l.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||$(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},l.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||$(this,t,e,1,255,0),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},l.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||$(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):H(this,t,e,!0),e+2},l.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||$(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):H(this,t,e,!1),e+2},l.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||$(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):z(this,t,e,!0),e+4},l.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||$(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):z(this,t,e,!1),e+4},l.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var o=Math.pow(2,8*n-1);$(this,t,e,n,o-1,-o)}var i=0,c=1,sub=0;for(this[e]=255&t;++i<n&&(c*=256);)t<0&&0===sub&&0!==this[e+i-1]&&(sub=1),this[e+i]=(t/c>>0)-sub&255;return e+n},l.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var o=Math.pow(2,8*n-1);$(this,t,e,n,o-1,-o)}var i=n-1,c=1,sub=0;for(this[e+i]=255&t;--i>=0&&(c*=256);)t<0&&0===sub&&0!==this[e+i+1]&&(sub=1),this[e+i]=(t/c>>0)-sub&255;return e+n},l.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||$(this,t,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||$(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):H(this,t,e,!0),e+2},l.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||$(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):H(this,t,e,!1),e+2},l.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||$(this,t,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):z(this,t,e,!0),e+4},l.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||$(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):z(this,t,e,!1),e+4},l.prototype.writeFloatLE=function(t,e,n){return F(this,t,e,!0,n)},l.prototype.writeFloatBE=function(t,e,n){return F(this,t,e,!1,n)},l.prototype.writeDoubleLE=function(t,e,n){return X(this,t,e,!0,n)},l.prototype.writeDoubleBE=function(t,e,n){return X(this,t,e,!1,n)},l.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,o=r-n;if(this===t&&n<e&&e<r)for(i=o-1;i>=0;--i)t[i+e]=this[i+n];else if(o<1e3||!l.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},l.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var code=t.charCodeAt(0);code<256&&(t=code)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var i;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(i=e;i<n;++i)this[i]=t;else{var o=l.isBuffer(t)?t:K(new l(t,r).toString()),c=o.length;for(i=0;i<n-e;++i)this[i+e]=o[i%c]}return this};var J=/[^+\/0-9A-Za-z-_]/g;function W(t){return t<16?"0"+t.toString(16):t.toString(16)}function K(t,e){var n;e=e||1/0;for(var r=t.length,o=null,c=[],i=0;i<r;++i){if((n=t.charCodeAt(i))>55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&c.push(239,191,189);continue}if(i+1===r){(e-=3)>-1&&c.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&c.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(e-=3)>-1&&c.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;c.push(n)}else if(n<2048){if((e-=2)<0)break;c.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;c.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;c.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return c}function V(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(J,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function G(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(21))},208:function(t,e,n){"use strict";e.byteLength=function(t){var e=f(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,i,n=f(t),r=n[0],h=n[1],l=new c(function(t,e,n){return 3*(e+n)/4-n}(0,r,h)),d=0,y=h>0?r-4:r;for(i=0;i<y;i+=4)e=o[t.charCodeAt(i)]<<18|o[t.charCodeAt(i+1)]<<12|o[t.charCodeAt(i+2)]<<6|o[t.charCodeAt(i+3)],l[d++]=e>>16&255,l[d++]=e>>8&255,l[d++]=255&e;2===h&&(e=o[t.charCodeAt(i)]<<2|o[t.charCodeAt(i+1)]>>4,l[d++]=255&e);1===h&&(e=o[t.charCodeAt(i)]<<10|o[t.charCodeAt(i+1)]<<4|o[t.charCodeAt(i+2)]>>2,l[d++]=e>>8&255,l[d++]=255&e);return l},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,c=[],h=16383,i=0,f=n-o;i<f;i+=h)c.push(l(t,i,i+h>f?f:i+h));1===o?(e=t[n-1],c.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],c.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return c.join("")};for(var r=[],o=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,h=code.length;i<h;++i)r[i]=code[i],o[code.charCodeAt(i)]=i;function f(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function l(t,e,n){for(var o,c,output=[],i=e;i<n;i+=3)o=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(255&t[i+2]),output.push(r[(c=o)>>18&63]+r[c>>12&63]+r[c>>6&63]+r[63&c]);return output.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},209:function(t,e){e.read=function(t,e,n,r,o){var c,h,f=8*o-r-1,l=(1<<f)-1,d=l>>1,y=-7,i=n?o-1:0,v=n?-1:1,s=t[e+i];for(i+=v,c=s&(1<<-y)-1,s>>=-y,y+=f;y>0;c=256*c+t[e+i],i+=v,y-=8);for(h=c&(1<<-y)-1,c>>=-y,y+=r;y>0;h=256*h+t[e+i],i+=v,y-=8);if(0===c)c=1-d;else{if(c===l)return h?NaN:1/0*(s?-1:1);h+=Math.pow(2,r),c-=d}return(s?-1:1)*h*Math.pow(2,c-r)},e.write=function(t,e,n,r,o,c){var h,f,l,d=8*c-o-1,y=(1<<d)-1,v=y>>1,rt=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,i=r?0:c-1,m=r?1:-1,s=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(f=isNaN(e)?1:0,h=y):(h=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-h))<1&&(h--,l*=2),(e+=h+v>=1?rt/l:rt*Math.pow(2,1-v))*l>=2&&(h++,l/=2),h+v>=y?(f=0,h=y):h+v>=1?(f=(e*l-1)*Math.pow(2,o),h+=v):(f=e*Math.pow(2,v-1)*Math.pow(2,o),h=0));o>=8;t[n+i]=255&f,i+=m,f/=256,o-=8);for(h=h<<o|f,d+=o;d>0;t[n+i]=255&h,i+=m,h/=256,d-=8);t[n+i-m]|=128*s}},210:function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},4:function(t,e,n){"use strict";function r(t,e,n,r,o,c,h){try{var f=t[c](h),l=f.value}catch(t){return void n(t)}f.done?e(l):Promise.resolve(l).then(r,o)}function o(t){return function(){var e=this,n=arguments;return new Promise((function(o,c){var h=t.apply(e,n);function f(t){r(h,o,c,f,l,"next",t)}function l(t){r(h,o,c,f,l,"throw",t)}f(void 0)}))}}n.d(e,"a",(function(){return o}))},40:function(t,e,n){"use strict";n.d(e,"a",(function(){return T})),n.d(e,"b",(function(){return O})),n.d(e,"c",(function(){return M})),n.d(e,"d",(function(){return x}));var r=n(72),o=n(42),c=n(93),h=n(94),f=n(55);const l=t=>null==t,d=t=>!l(t),y=(t,a,b)=>w(a,t)===w(b,t);function v(u){return u&&u.length&&new RegExp(["^\\/([a-zA-Z0-9@\\-%_~.:]","[/a-zA-Z0-9@\\-%_~.:]*)?","([?][^#]*)?(#[^#]*)?$"].join("")).test(u)}function m(t,e,n){return t.matched.some((t=>Object.values(t.components).some((component=>component.options&&component.options[e]===n))))}function w(path="",t){let e=path.split("?")[0];return t&&t.base&&(e=e.replace(t.base,"/")),"/"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),e=e.replace(/\/+/g,"/"),e}function k(t){return"string"==typeof t?t:JSON.stringify(t)}function _(t){if("string"==typeof t)try{return JSON.parse(t)}catch(t){}return t}function S(t,e){if(!e||!t||"object"!=typeof t)return t;if(e in t)return t[e];const n=Array.isArray(e)?e:(e+"").split(".");let r=t;for(;n.length&&r;)r=r[n.shift()];return r}function E(t,e){return t&&e&&"string"==typeof t&&!t.startsWith(e)?e+" "+t:t}class A{constructor(t,e){this.ctx=t,this.options=e,this._initState()}setUniversal(t,e){return l(e)?this.removeUniversal(t):(this.setCookie(t,e),this.setLocalStorage(t,e),this.setState(t,e),e)}getUniversal(t){let e;return l(e)&&(e=this.getCookie(t)),l(e)&&(e=this.getLocalStorage(t)),l(e)&&(e=this.getState(t)),e}syncUniversal(t,e){let n=this.getUniversal(t);return l(n)&&d(e)&&(n=e),d(n)&&this.setUniversal(t,n),n}removeUniversal(t){this.removeState(t),this.removeLocalStorage(t),this.removeCookie(t)}_initState(){if(o.set(this,"_state",{}),this._useVuex=this.options.vuex&&!!this.ctx.store,this._useVuex){const t={namespaced:!0,state:()=>this.options.initialState,mutations:{SET(t,e){o.set(t,e.key,e.value)}}};this.ctx.store.registerModule(this.options.vuex.namespace,t,{preserveState:Boolean(this.ctx.store.state[this.options.vuex.namespace])}),this.state=this.ctx.store.state[this.options.vuex.namespace]}else o.set(this,"state",{}),console.warn("[AUTH] The Vuex Store is not activated. This might cause issues in auth module behavior, like redirects not working properly.To activate it, see https://nuxtjs.org/docs/2.x/directory-structure/store")}setState(t,e){return"_"===t[0]?o.set(this._state,t,e):this._useVuex?this.ctx.store.commit(this.options.vuex.namespace+"/SET",{key:t,value:e}):o.set(this.state,t,e),e}getState(t){return"_"!==t[0]?this.state[t]:this._state[t]}watchState(t,e){if(this._useVuex)return this.ctx.store.watch((e=>S(e[this.options.vuex.namespace],t)),e)}removeState(t){this.setState(t,void 0)}setLocalStorage(t,e){if(l(e))return this.removeLocalStorage(t);if(!this.isLocalStorageEnabled())return;const n=this.getPrefix()+t;try{localStorage.setItem(n,k(e))}catch(t){if(!this.options.ignoreExceptions)throw t}return e}getLocalStorage(t){if(!this.isLocalStorageEnabled())return;const e=this.getPrefix()+t;return _(localStorage.getItem(e))}removeLocalStorage(t){if(!this.isLocalStorageEnabled())return;const e=this.getPrefix()+t;localStorage.removeItem(e)}getCookies(){if(!this.isCookiesEnabled())return;const t=document.cookie;return c.parse(t||"")||{}}setCookie(t,e,n={}){if(!this.options.cookie)return;if(!this.isCookiesEnabled())return;const r=(void 0!==n.prefix?n.prefix:this.options.cookie.prefix)+t,o=Object.assign({},this.options.cookie.options,n),h=k(e);l(e)&&(o.maxAge=-1),"number"==typeof o.expires&&(o.expires=new Date(Date.now()+864e5*o.expires));const f=c.serialize(r,h,o);return document.cookie=f,e}getCookie(t){if(!this.options.cookie)return;if(!this.isCookiesEnabled())return;const e=this.options.cookie.prefix+t,n=this.getCookies();return _(n[e]?decodeURIComponent(n[e]):void 0)}removeCookie(t,e){this.setCookie(t,void 0,e)}getPrefix(){if(!this.options.localStorage)throw new Error("Cannot get prefix; localStorage is off");return this.options.localStorage.prefix}isLocalStorageEnabled(){if(!this.options.localStorage)return!1;const t="test";try{return localStorage.setItem(t,t),localStorage.removeItem(t),!0}catch(t){return this.options.ignoreExceptions||console.warn("[AUTH] Local storage is enabled in config, but browser doesn't support it"),!1}}isCookiesEnabled(){return!!this.options.cookie&&(!!window.navigator.cookieEnabled||(console.warn("[AUTH] Cookies is enabled in config, but browser doesn't support it"),!1))}}class T{constructor(t,e){this.strategies={},this._errorListeners=[],this._redirectListeners=[],this.ctx=t,this.options=e;const n=new A(t,{...e,initialState:{user:null,loggedIn:!1}});this.$storage=n,this.$state=n.state}get state(){return this._stateWarnShown||(this._stateWarnShown=!0,console.warn("[AUTH] $auth.state is deprecated. Please use $auth.$state or top level props like $auth.loggedIn")),this.$state}get strategy(){return this.getStrategy()}getStrategy(t=!0){if(t){if(!this.$state.strategy)throw new Error("No strategy is set!");if(!this.strategies[this.$state.strategy])throw new Error("Strategy not supported: "+this.$state.strategy)}return this.strategies[this.$state.strategy]}get user(){return this.$state.user}get loggedIn(){return this.$state.loggedIn}get busy(){return this.$storage.getState("busy")}async init(){if(this.options.resetOnError&&this.onError(((...t)=>{("function"!=typeof this.options.resetOnError||this.options.resetOnError(...t))&&this.reset()})),this.$storage.syncUniversal("strategy",this.options.defaultStrategy),!this.getStrategy(!1)&&(this.$storage.setUniversal("strategy",this.options.defaultStrategy),!this.getStrategy(!1)))return Promise.resolve();try{await this.mounted()}catch(t){this.callOnError(t)}finally{this.options.watchLoggedIn&&this.$storage.watchState("loggedIn",(t=>{m(this.ctx.route,"auth",!1)||this.redirect(t?"home":"logout")}))}}getState(t){return this._getStateWarnShown||(this._getStateWarnShown=!0,console.warn("[AUTH] $auth.getState is deprecated. Please use $auth.$storage.getState() or top level props like $auth.loggedIn")),this.$storage.getState(t)}registerStrategy(t,e){this.strategies[t]=e}setStrategy(t){if(t===this.$storage.getUniversal("strategy"))return Promise.resolve();if(!this.strategies[t])throw new Error(`Strategy ${t} is not defined!`);return this.reset(),this.$storage.setUniversal("strategy",t),this.mounted()}mounted(...t){return this.getStrategy().mounted?Promise.resolve(this.getStrategy().mounted(...t)).catch((t=>(this.callOnError(t,{method:"mounted"}),Promise.reject(t)))):this.fetchUserOnce()}loginWith(t,...e){return this.setStrategy(t).then((()=>this.login(...e)))}login(...t){return this.getStrategy().login?this.wrapLogin(this.getStrategy().login(...t)).catch((t=>(this.callOnError(t,{method:"login"}),Promise.reject(t)))):Promise.resolve()}fetchUser(...t){return this.getStrategy().fetchUser?Promise.resolve(this.getStrategy().fetchUser(...t)).catch((t=>(this.callOnError(t,{method:"fetchUser"}),Promise.reject(t)))):Promise.resolve()}logout(...t){return this.getStrategy().logout?Promise.resolve(this.getStrategy().logout(...t)).catch((t=>(this.callOnError(t,{method:"logout"}),Promise.reject(t)))):(this.reset(),Promise.resolve())}setUserToken(t,e){return this.getStrategy().setUserToken?Promise.resolve(this.getStrategy().setUserToken(t,e)).catch((t=>(this.callOnError(t,{method:"setUserToken"}),Promise.reject(t)))):(this.getStrategy().token.set(t),Promise.resolve())}reset(...t){return this.getStrategy().reset||(this.setUser(!1),this.getStrategy().token.reset(),this.getStrategy().refreshToken.reset()),this.getStrategy().reset(...t)}refreshTokens(){return this.getStrategy().refreshController?Promise.resolve(this.getStrategy().refreshController.handleRefresh()).catch((t=>(this.callOnError(t,{method:"refreshTokens"}),Promise.reject(t)))):Promise.resolve()}check(...t){return this.getStrategy().check?this.getStrategy().check(...t):{valid:!0}}fetchUserOnce(...t){return this.$state.user?Promise.resolve():this.fetchUser(...t)}setUser(t){this.$storage.setState("user",t);let e={valid:Boolean(t)};e.valid&&(e=this.check()),this.$storage.setState("loggedIn",e.valid)}request(t,e={}){const n="object"==typeof e?Object.assign({},e,t):t;if(""===n.baseURL&&(n.baseURL=r(this.ctx.req)),this.ctx.app.$axios)return this.ctx.app.$axios.request(n).catch((t=>(this.callOnError(t,{method:"request"}),Promise.reject(t))));console.error("[AUTH] add the @nuxtjs/axios module to nuxt.config file")}requestWith(t,e,n){const r=this.getStrategy().token.get(),o=Object.assign({},n,e),c=this.strategies[t].options.token.name||"Authorization";return o.headers||(o.headers={}),!o.headers[c]&&d(r)&&r&&"string"==typeof r&&(o.headers[c]=r),this.request(o)}wrapLogin(t){return this.$storage.setState("busy",!0),this.error=null,Promise.resolve(t).then((t=>(this.$storage.setState("busy",!1),t))).catch((t=>(this.$storage.setState("busy",!1),Promise.reject(t))))}onError(t){this._errorListeners.push(t)}callOnError(t,e={}){this.error=t;for(const n of this._errorListeners)n(t,e)}redirect(t,e=!1){if(!this.options.redirect)return;const n=this.options.fullPathRedirect?this.ctx.route.fullPath:this.ctx.route.path;let r=this.options.redirect[t];if(r){if(this.options.rewriteRedirects&&("login"===t&&v(n)&&!y(this.ctx,r,n)&&this.$storage.setUniversal("redirect",n),"home"===t)){const t=this.$storage.getUniversal("redirect");this.$storage.setUniversal("redirect",null),v(t)&&(r=t)}r=this.callOnRedirect(r,n)||r,y(this.ctx,r,n)||(e?(v(r)&&!r.includes(this.ctx.base)&&(r=w("/"+this.ctx.base+"/"+r)),window.location.replace(r)):this.ctx.redirect(r,this.ctx.query))}}onRedirect(t){this._redirectListeners.push(t)}callOnRedirect(t,e){for(const n of this._redirectListeners)t=n(t,e)||t;return t}hasScope(t){const e=this.$state.user&&S(this.$state.user,this.options.scopeKey);return!!e&&(Array.isArray(e)?e.includes(t):Boolean(S(e,t)))}}const x=async t=>{if(m(t.route,"auth",!1))return;const e=function(t,e=[]){return[].concat(...t.matched.map((function(t,n){return Object.keys(t.components).map((function(r){return e.push(n),t.components[r]}))})))}(t.route,[]);if(!e.length)return;const{login:n,callback:r}=t.$auth.options.redirect,o=m(t.route,"auth","guest"),c=e=>w(t.route.path,t)===w(e,t);if(t.$auth.$state.loggedIn){const{tokenExpired:e,refreshTokenExpired:r,isRefreshable:h}=t.$auth.check(!0);if((!n||c(n)||o)&&t.$auth.redirect("home"),r)t.$auth.reset();else if(e)if(h)try{await t.$auth.refreshTokens()}catch(e){t.$auth.reset()}else t.$auth.reset()}else o||r&&c(r)||t.$auth.redirect("login")};Error;class O extends Error{constructor(){super("Both token and refresh token have expired. Your request was aborted."),this.name="ExpiredAuthSessionError"}}var P,C;(C=P||(P={})).UNKNOWN="UNKNOWN",C.VALID="VALID",C.EXPIRED="EXPIRED";class R{constructor(t,e){this._status=this._calculate(t,e)}unknown(){return P.UNKNOWN===this._status}valid(){return P.VALID===this._status}expired(){return P.EXPIRED===this._status}_calculate(t,e){const n=Date.now();try{if(!t||!e)return P.UNKNOWN}catch(t){return P.UNKNOWN}return n<(e-=500)?P.VALID:P.EXPIRED}}class U{constructor(t,e){this.scheme=t,this.axios=e,this.interceptor=null}setHeader(t){this.scheme.options.token.global&&this.axios.setHeader(this.scheme.options.token.name,t)}clearHeader(){this.scheme.options.token.global&&this.axios.setHeader(this.scheme.options.token.name,!1)}initializeRequestInterceptor(t){this.interceptor=this.axios.interceptors.request.use((async e=>{if(!this._needToken(e)||e.url===t)return e;const{valid:n,tokenExpired:r,refreshTokenExpired:o,isRefreshable:c}=this.scheme.check(!0);let h=n;if(o)throw this.scheme.reset(),new O;if(r){if(!c)throw this.scheme.reset(),new O;h=await this.scheme.refreshTokens().then((()=>!0)).catch((()=>{throw this.scheme.reset(),new O}))}const f=this.scheme.token.get();if(!h){if(!f&&this._requestHasAuthorizationHeader(e))throw new O;return e}return this._getUpdatedRequestConfig(e,f)}))}reset(){this.axios.interceptors.request.eject(this.interceptor),this.interceptor=null}_needToken(t){const e=this.scheme.options;return e.token.global||Object.values(e.endpoints).some((e=>"object"==typeof e?e.url===t.url:e===t.url))}_getUpdatedRequestConfig(t,e){return"string"==typeof e&&(t.headers[this.scheme.options.token.name]=e),t}_requestHasAuthorizationHeader(t){return!!t.headers.common[this.scheme.options.token.name]}}class L{constructor(t,e){this.scheme=t,this.$storage=e}get(){const t=this.scheme.options.token.prefix+this.scheme.name;return this.$storage.getUniversal(t)}set(t){const e=E(t,this.scheme.options.token.type);return this._setToken(e),this._updateExpiration(e),"string"==typeof e&&this.scheme.requestHandler.setHeader(e),e}sync(){const t=this._syncToken();return this._syncExpiration(),"string"==typeof t&&this.scheme.requestHandler.setHeader(t),t}reset(){this.scheme.requestHandler.clearHeader(),this._setToken(!1),this._setExpiration(!1)}status(){return new R(this.get(),this._getExpiration())}_getExpiration(){const t=this.scheme.options.token.expirationPrefix+this.scheme.name;return this.$storage.getUniversal(t)}_setExpiration(t){const e=this.scheme.options.token.expirationPrefix+this.scheme.name;return this.$storage.setUniversal(e,t)}_syncExpiration(){const t=this.scheme.options.token.expirationPrefix+this.scheme.name;return this.$storage.syncUniversal(t)}_updateExpiration(t){let e;const n=Date.now(),r=1e3*Number(this.scheme.options.token.maxAge),o=r?n+r:0;try{e=1e3*f(t+"").exp||o}catch(t){if(e=o,!t||"InvalidTokenError"!==t.name)throw t}return this._setExpiration(e||!1)}_setToken(t){const e=this.scheme.options.token.prefix+this.scheme.name;return this.$storage.setUniversal(e,t)}_syncToken(){const t=this.scheme.options.token.prefix+this.scheme.name;return this.$storage.syncUniversal(t)}}class I{constructor(t,...e){this.$auth=t,this.options=e.reduce(((p,t)=>h(p,t)),{})}get name(){return this.options.name}}const j={name:"local",endpoints:{login:{url:"/api/auth/login",method:"post"},logout:{url:"/api/auth/logout",method:"post"},user:{url:"/api/auth/user",method:"get"}},token:{property:"token",type:"Bearer",name:"Authorization",maxAge:1800,global:!0,required:!0,prefix:"_token.",expirationPrefix:"_token_expiration."},user:{property:"user",autoFetch:!0},clientId:!1,grantType:!1,scope:!1};class M extends I{constructor(t,e,...n){super(t,e,...n,j),this.token=new L(this,this.$auth.$storage),this.requestHandler=new U(this,this.$auth.ctx.$axios)}check(t=!1){const e={valid:!1,tokenExpired:!1};if(!this.token.sync())return e;if(!t)return e.valid=!0,e;return this.token.status().expired()?(e.tokenExpired=!0,e):(e.valid=!0,e)}mounted({tokenCallback:t=(()=>this.$auth.reset()),refreshTokenCallback:e}={}){const{tokenExpired:n,refreshTokenExpired:r}=this.check(!0);return r&&"function"==typeof e?e():n&&"function"==typeof t&&t(),this.initializeRequestInterceptor(),this.$auth.fetchUserOnce()}async login(t,{reset:e=!0}={}){if(!this.options.endpoints.login)return;e&&this.$auth.reset({resetInterceptor:!1}),this.options.clientId&&(t.data.client_id=this.options.clientId),this.options.grantType&&(t.data.grant_type=this.options.grantType),this.options.scope&&(t.data.scope=this.options.scope);const n=await this.$auth.request(t,this.options.endpoints.login);return this.updateTokens(n),this.requestHandler.interceptor||this.initializeRequestInterceptor(),this.options.user.autoFetch&&await this.fetchUser(),n}setUserToken(t){return this.token.set(t),this.fetchUser()}fetchUser(t){return this.check().valid?this.options.endpoints.user?this.$auth.requestWith(this.name,t,this.options.endpoints.user).then((t=>{const e=S(t.data,this.options.user.property);if(!e){const t=new Error(`User Data response does not contain field ${this.options.user.property}`);return Promise.reject(t)}return this.$auth.setUser(e),t})).catch((t=>(this.$auth.callOnError(t,{method:"fetchUser"}),Promise.reject(t)))):(this.$auth.setUser({}),Promise.resolve()):Promise.resolve()}async logout(t={}){return this.options.endpoints.logout&&await this.$auth.requestWith(this.name,t,this.options.endpoints.logout).catch((()=>{})),this.$auth.reset()}reset({resetInterceptor:t=!0}={}){this.$auth.setUser(!1),this.token.reset(),t&&this.requestHandler.reset()}updateTokens(t){const e=!this.options.token.required||S(t.data,this.options.token.property);this.token.set(e)}initializeRequestInterceptor(){this.requestHandler.initializeRequestInterceptor()}}},41:function(t,e,n){"use strict";var r={name:"NoSsr",functional:!0,props:{placeholder:String,placeholderTag:{type:String,default:"div"}},render:function(t,e){var n=e.parent,r=e.slots,o=e.props,c=r(),h=c.default;void 0===h&&(h=[]);var f=c.placeholder;return n._isMounted?h:(n.$once("hook:mounted",(function(){n.$forceUpdate()})),o.placeholderTag&&(o.placeholder||f)?t(o.placeholderTag,{class:["no-ssr-placeholder"]},o.placeholder||f):h.length>0?h.map((function(){return t(!1)})):t(!1))}};t.exports=r},55:function(t,e,n){"use strict";function r(t){this.message=t}r.prototype=new Error,r.prototype.name="InvalidCharacterError";var o="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new r("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,o,a=0,i=0,c="";o=e.charAt(i++);~o&&(n=a%4?64*n+o:o,a++%4)?c+=String.fromCharCode(255&n>>(-2*a&6)):0)o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(o);return c};function c(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw"Illegal base64url string!"}try{return function(t){return decodeURIComponent(o(t).replace(/(.)/g,(function(t,e){var n=e.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(e)}catch(t){return o(e)}}function h(t){this.message=t}function f(t,e){if("string"!=typeof t)throw new h("Invalid token specified");var n=!0===(e=e||{}).header?0:1;try{return JSON.parse(c(t.split(".")[n]))}catch(t){throw new h("Invalid token specified: "+t.message)}}h.prototype=new Error,h.prototype.name="InvalidTokenError";const a=f;a.default=f,a.InvalidTokenError=h,t.exports=a},69:function(t,e,n){"use strict";function r(t){if(Array.isArray(t))return t}n.d(e,"a",(function(){return r}))},70:function(t,e,n){"use strict";function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}n.d(e,"a",(function(){return r}))},71:function(t,e,n){"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function o(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}n.d(e,"a",(function(){return o}))},72:function(t,e,n){"use strict";var r=function(t,e=!0){const n=e&&t.headers?t.headers["x-forwarded-proto"]:void 0,r="string"==typeof n?n.includes("https"):void 0;if(r)return!0;const o=t.connection?t.connection.encrypted:void 0,c=void 0!==o?!0===o:void 0;return!!c||void 0===r&&void 0===c&&void 0};const o="undefined"!=typeof location?location:{origin:"",pathname:"/"};t.exports=function(t,e){return t?encodeURI("http"+(r(t)?"s":"")+"://"+(t.headers["x-forwarded-host"]||t.headers.host)+(e?t.url:"")):o.origin+(e?o.pathname:"")}},74:function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var content=function(t,e){var content=t[1]||"",n=t[3];if(!n)return content;if(e&&"function"==typeof btoa){var r=(c=n,h=btoa(unescape(encodeURIComponent(JSON.stringify(c)))),data="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(h),"/*# ".concat(data," */")),o=n.sources.map((function(source){return"/*# sourceURL=".concat(n.sourceRoot||"").concat(source," */")}));return[content].concat(o).concat([r]).join("\n")}var c,h,data;return[content].join("\n")}(e,t);return e[2]?"@media ".concat(e[2]," {").concat(content,"}"):content})).join("")},e.i=function(t,n,r){"string"==typeof t&&(t=[[null,t,""]]);var o={};if(r)for(var i=0;i<this.length;i++){var c=this[i][0];null!=c&&(o[c]=!0)}for(var h=0;h<t.length;h++){var f=[].concat(t[h]);r&&o[f[0]]||(n&&(f[2]?f[2]="".concat(n," and ").concat(f[2]):f[2]=n),e.push(f))}},e}},75:function(t,e,n){"use strict";function r(t,e){for(var n=[],r={},i=0;i<e.length;i++){var o=e[i],c=o[0],h={id:t+":"+i,css:o[1],media:o[2],sourceMap:o[3]};r[c]?r[c].parts.push(h):n.push(r[c]={id:c,parts:[h]})}return n}n.r(e),n.d(e,"default",(function(){return w}));var o="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!o)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var c={},head=o&&(document.head||document.getElementsByTagName("head")[0]),h=null,f=0,l=!1,d=function(){},y=null,v="data-vue-ssr-id",m="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function w(t,e,n,o){l=n,y=o||{};var h=r(t,e);return k(h),function(e){for(var n=[],i=0;i<h.length;i++){var o=h[i];(f=c[o.id]).refs--,n.push(f)}e?k(h=r(t,e)):h=[];for(i=0;i<n.length;i++){var f;if(0===(f=n[i]).refs){for(var l=0;l<f.parts.length;l++)f.parts[l]();delete c[f.id]}}}}function k(t){for(var i=0;i<t.length;i++){var e=t[i],n=c[e.id];if(n){n.refs++;for(var r=0;r<n.parts.length;r++)n.parts[r](e.parts[r]);for(;r<e.parts.length;r++)n.parts.push(S(e.parts[r]));n.parts.length>e.parts.length&&(n.parts.length=e.parts.length)}else{var o=[];for(r=0;r<e.parts.length;r++)o.push(S(e.parts[r]));c[e.id]={id:e.id,refs:1,parts:o}}}}function _(){var t=document.createElement("style");return t.type="text/css",head.appendChild(t),t}function S(t){var e,n,r=document.querySelector("style["+v+'~="'+t.id+'"]');if(r){if(l)return d;r.parentNode.removeChild(r)}if(m){var o=f++;r=h||(h=_()),e=T.bind(null,r,o,!1),n=T.bind(null,r,o,!0)}else r=_(),e=x.bind(null,r),n=function(){r.parentNode.removeChild(r)};return e(t),function(r){if(r){if(r.css===t.css&&r.media===t.media&&r.sourceMap===t.sourceMap)return;e(t=r)}else n()}}var E,A=(E=[],function(t,e){return E[t]=e,E.filter(Boolean).join("\n")});function T(t,e,n,r){var o=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=A(e,o);else{var c=document.createTextNode(o),h=t.childNodes;h[e]&&t.removeChild(h[e]),h.length?t.insertBefore(c,h[e]):t.appendChild(c)}}function x(t,e){var n=e.css,r=e.media,o=e.sourceMap;if(r&&t.setAttribute("media",r),y.ssrId&&t.setAttribute(v,e.id),o&&(n+="\n/*# sourceURL="+o.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */"),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}},91:function(t,e,n){"use strict";var r={name:"ClientOnly",functional:!0,props:{placeholder:String,placeholderTag:{type:String,default:"div"}},render:function(t,e){var n=e.parent,r=e.slots,o=e.props,c=r(),h=c.default;void 0===h&&(h=[]);var f=c.placeholder;return n._isMounted?h:(n.$once("hook:mounted",(function(){n.$forceUpdate()})),o.placeholderTag&&(o.placeholder||f)?t(o.placeholderTag,{class:["client-only-placeholder"]},o.placeholder||f):h.length>0?h.map((function(){return t(!1)})):t(!1))}};t.exports=r},94:function(t,e,n){"use strict";function r(t){return null!==t&&"object"==typeof t}function o(t,e,n=".",c){if(!r(e))return o(t,{},n,c);const h=Object.assign({},e);for(const e in t){if("__proto__"===e||"constructor"===e)continue;const f=t[e];null!=f&&(c&&c(h,e,f,n)||(Array.isArray(f)&&Array.isArray(h[e])?h[e]=h[e].concat(f):r(f)&&r(h[e])?h[e]=o(f,h[e],(n?`${n}.`:"")+e.toString(),c):h[e]=f))}return h}function c(t){return(...e)=>e.reduce(((p,e)=>o(p,e,"",t)),{})}const h=c();h.fn=c(((t,e,n,r)=>{if(void 0!==t[e]&&"function"==typeof n)return t[e]=n(t[e]),!0})),h.arrayFn=c(((t,e,n,r)=>{if(Array.isArray(t[e])&&"function"==typeof n)return t[e]=n(t[e]),!0})),h.extend=c,t.exports=h},95:function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var r=n(69);var o=n(71),c=n(70);function h(t){return Object(r.a)(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Object(o.a)(t)||Object(c.a)()}}}]);