1!function(){try{var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=(new t.Error).stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="87108bbb-5ba5-4e51-a314-1613decdc029",t._sentryDebugIdIdentifier="sentry-dbid-87108bbb-5ba5-4e51-a314-1613decdc029")}catch(t){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6309],{20355:function(t){t.exports=function(t,e){var n=e.prototype,i=n.format;n.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return i.bind(this)(t);var r=this.$utils(),s=(t||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(t){switch(t){case"Q":return Math.ceil((e.$M+1)/3);case"Do":return n.ordinal(e.$D);case"gggg":return e.weekYear();case"GGGG":return e.isoWeekYear();case"wo":return n.ordinal(e.week(),"W");case"w":case"ww":return r.s(e.week(),"w"===t?1:2,"0");case"W":case"WW":return r.s(e.isoWeek(),"W"===t?1:2,"0");case"k":case"kk":return r.s(String(0===e.$H?24:e.$H),"k"===t?1:2,"0");case"X":return Math.floor(e.$d.getTime()/1e3);case"x":return e.$d.getTime();case"z":return"["+e.offsetName()+"]";case"zzz":return"["+e.offsetName("long")+"]";default:return t}});return i.bind(this)(s)}}},64301:function(t){t.exports=function(){"use strict";var t={year:0,month:1,day:2,hour:3,minute:4,second:5},e={};return function(n,i,r){var s,o=function(t,n,i){void 0===i&&(i={});var r,s,o,a,c=new Date(t);return(void 0===(r=i)&&(r={}),(a=e[o=n+"|"+(s=r.timeZoneName||"short")])||(a=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:s}
1),e[o]=a),a).formatToParts(c)},a=function(e,n){for(var i=o(e,n),s=[],a=0;a<i.length;a+=1){var c=i[a],h=c.type,u=c.value,l=t[h];l>=0&&(s[l]=parseInt(u,10))}var d=s[3],p=s[0]+"-"+s[1]+"-"+s[2]+" "+(24===d?0:d)+":"+s[4]+":"+s[5]+":000",f=+e;return(r.utc(p).valueOf()-(f-=f%1e3))/6e4},c=i.prototype;c.tz=function(t,e){void 0===t&&(t=s);var n=this.utcOffset(),i=this.toDate(),o=i.toLocaleString("en-US",{timeZone:t}),a=Math.round((i-new Date(o))/1e3/60),c=r(o,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(-(15*Math.round(i.getTimezoneOffset()/15))-a,!0);if(e){var h=c.utcOffset();c=c.add(n-h,"minute")}return c.$x.$timezone=t,c},c.offsetName=function(t){var e=this.$x.$timezone||r.tz.guess(),n=o(this.valueOf(),e,{timeZoneName:t}).find(function(t){return"timezonename"===t.type.toLowerCase()});return n&&n.value};var h=c.startOf;c.startOf=function(t,e){if(!this.$x||!this.$x.$timezone)return h.call(this,t,e);var n=r(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return h.call(n,t,e).tz(this.$x.$timezone,!0)},r.tz=function(t,e,n){var i=n&&e,o=n||e||s,c=a(+r(),o);if("string"!=typeof t)return r(t).tz(o);var h=function(t,e,n){var i=t-60*e*1e3,r=a(i,n);if(e===r)return[i,e];var s=a(i-=60*(r-e)*1e3,n);return r===s?[i,r]:[t-60*Math.min(r,s)*1e3,Math.max(r,s)]}(r.utc(t,i).valueOf(),c,o),u=h[0],l=h[1],d=r(u).utcOffset(l);return d.$x.$timezone=o,d},r.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},r.tz.setDefault=function(t){s=t}}}()},66315:function(t){t.exports=function(t,e,n){t=t||{};var i=e.prototype,r={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function s(t,e,n,r){return i.fromToBase(t,e,n,r)}n.en.relativeTime=r,i.fromToBase=function(e,i,s,o,a){for(var c,h,u,l=s.$locale().relativeTime||r,d=t.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],p=d.length,f=0;f<p;f+=1){var g=d[f];g.d&&(c=o?n(e).diff(s,g.d,!0):s.diff(e,g.d,!0));var m=(t.rounding||Math.round)(Math.abs(c));if(u=c>0,m<=g.r||!g.r){m<=1&&f>0&&(g=d[f-1]);var v=l[g.l];a&&(m=a(""+m)),h="string"==typeof v?v.replace("%d",m):v(m,i,g.l,u);break}}if(i)return h;var b=u?l.future:l.past;return"function"==typeof b?b(h):b.replace("%s",h)},i.to=function(t,e){return s(t,e,this,!0)},i.from=function(t,e){return s(t,e,this)};var o=function(t){return t.$u?n.utc():n()};i.toNow=function(t){return this.to(o(this),t)},i.fromNow=function(t){return this.from(o(this),t)}}},71576:function(t){t.exports=function(){"use strict";var t="minute",e=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(i,r,s){var o=r.prototype;s.utc=function(t){var e={date:t,utc:!0,args:arguments};return new r(e)},o.utc=function(e){var n=s(this.toDate(),{locale:this.$L,utc:!0});return e?n.add(this.utcOffset(),t):n},o.local=function(){return s(this.toDate(),{locale:this.$L,utc:!1})};var a=o.parse;o.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),a.call(this,t)};var c=o.init;o.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else c.call(this)};var h=o.utcOffset;o.utcOffset=function(i,r){var s=this.$utils().u;if(s(i))return this.$u?0:s(this.$offset)?h.call(this):this.$offset;if("string"==typeof i&&null===(i=function(t){void 0===t&&(t="");var i=t.match(e);if(!i)return null;var r=(""+i[0]).match(n)||["-",0,0],s=r[0],o=60*r[1]+ +r[2];return 0===o?0:"+"===s?o:-o}(i)))return this;var o=16>=Math.abs(i)?60*i:i,a=this;if(r)return a.$offset=o,a.$u=0===i,a;if(0!==i){var c=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(a=this.local().add(o+c,t)).$offset=o,a.$x.$localOffset=c}else a=this.utc();return a};var u=o.format;o.format=function(t){var e=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return u.call(this,e)},o.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var l=o.toDate;o.toDate=function(t){return"s"===t&&this.$offset?s(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():l.call(this)};var d=o.diff;o.diff=function(t,e,n){if(t&&this.$u===t.$u)return d.call(this,t,e,n);
1var i=this.local(),r=s(t).local();return d.call(i,r,e,n)}}}()},81795:t=>{window,t.exports=function(){var t=[function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var s=function(){function t(t){void 0===t&&(t="="),this._paddingCharacter=t}return t.prototype.encodedLength=function(t){return this._paddingCharacter?(t+2)/3*4|0:(8*t+5)/6|0},t.prototype.encode=function(t){for(var e="",n=0;n<t.length-2;n+=3){var i=t[n]<<16|t[n+1]<<8|t[n+2];e+=this._encodeByte(i>>>18&63),e+=this._encodeByte(i>>>12&63),e+=this._encodeByte(i>>>6&63),e+=this._encodeByte(i>>>0&63)}var r=t.length-n;if(r>0){var i=t[n]<<16|(2===r?t[n+1]<<8:0);e+=this._encodeByte(i>>>18&63),e+=this._encodeByte(i>>>12&63),2===r?e+=this._encodeByte(i>>>6&63):e+=this._paddingCharacter||"",e+=this._paddingCharacter||""}return e},t.prototype.maxDecodedLength=function(t){return this._paddingCharacter?t/4*3|0:(6*t+7)/8|0},t.prototype.decodedLength=function(t){return this.maxDecodedLength(t.length-this._getPaddingLength(t))},t.prototype.decode=function(t){if(0===t.length)return new Uint8Array(0);for(var e=this._getPaddingLength(t),n=t.length-e,i=new Uint8Array(this.maxDecodedLength(n)),r=0,s=0,o=0,a=0,c=0,h=0,u=0;s<n-4;s+=4)a=this._decodeChar(t.charCodeAt(s+0)),c=this._decodeChar(t.charCodeAt(s+1)),h=this._decodeChar(t.charCodeAt(s+2)),u=this._decodeChar(t.charCodeAt(s+3)),i[r++]=a<<2|c>>>4,i[r++]=c<<4|h>>>2,i[r++]=h<<6|u,o|=256&a,o|=256&c,o|=256&h,o|=256&u;if(s<n-1&&(a=this._decodeChar(t.charCodeAt(s)),c=this._decodeChar(t.charCodeAt(s+1)),i[r++]=a<<2|c>>>4,o|=256&a,o|=256&c),s<n-2&&(h=this._decodeChar(t.charCodeAt(s+2)),i[r++]=c<<4|h>>>2,o|=256&h),s<n-3&&(u=this._decodeChar(t.charCodeAt(s+3)),i[r++]=h<<6|u,o|=256&u),0!==o)throw Error("Base64Coder: incorrect characters for decoding");return i},t.prototype._encodeByte=function(t){var e=t;return e+=65,e+=25-t>>>8&6,e+=51-t>>>8&-75,e+=61-t>>>8&-15,String.fromCharCode(e+=62-t>>>8&3)},t.prototype._decodeChar=function(t){return 256+((42-t&t-44)>>>8&-256+t-43+62)+((46-t&t-48)>>>8&-256+t-47+63)+((47-t&t-58)>>>8&-256+t-48+52)+((64-t&t-91)>>>8&-256+t-65+0)+((96-t&t-123)>>>8&-256+t-97+26)},t.prototype._getPaddingLength=function(t){var e=0;if(this._paddingCharacter){for(var n=t.length-1;n>=0&&t[n]===this._paddingCharacter;n--)e++;if(t.length<4||e>2)throw Error("Base64Coder: incorrect padding")}return e},t}();e.Coder=s;var o=new s;e.encode=function(t){return o.encode(t)},e.decode=function(t){return o.decode(t)};var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype._encodeByte=function(t){var e=t;return e+=65,e+=25-t>>>8&6,e+=51-t>>>8&-75,e+=61-t>>>8&-13,String.fromCharCode(e+=62-t>>>8&49)},e.prototype._decodeChar=function(t){return 256+((44-t&t-46)>>>8&-256+t-45+62)+((94-t&t-96)>>>8&-256+t-95+63)+((47-t&t-58)>>>8&-256+t-48+52)+((64-t&t-91)>>>8&-256+t-65+0)+((96-t&t-123)>>>8&-256+t-97+26)},e}(s);e.URLSafeCoder=a;var c=new a;e.encodeURLSafe=function(t){return c.encode(t)},e.decodeURLSafe=function(t){return c.decode(t)},e.encodedLength=function(t){return o.encodedLength(t)},e.maxDecodedLength=function(t){return o.maxDecodedLength(t)},e.decodedLength=function(t){return o.decodedLength(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i="utf8: invalid string",r="utf8: invalid source encoding";function s(t){for(var e=0,n=0;n<t.length;n++){var r=t.charCodeAt(n);if(r<128)e+=1;else if(r<2048)e+=2;else if(r<55296)e+=3;else if(r<=57343){if(n>=t.length-1)throw Error(i);n++,e+=4}else throw Error(i)}return e}e.encode=function(t){for(var e=new Uint8Array(s(t)),n=0,i=0;i<t.length;i++){var r=t.charCodeAt(i);r<128?e[n++]=r:(r<2048?e[n++]=192|r>>6:(r<55296?e[n++]=224|r>>12:(i++,r=((1023&r)<<10|1023&t.charCodeAt(i))+65536,e[n++]=240|r>>18,e[n++]=128|r>>12&63),e[n++]=128|r>>6&63),e[n++]=128|63&r)}return e},e.encodedLength=s,e.decode=function(t){for(var e=[],n=0;n<t.length;n++){var i=t[n];if(128&i){var s=void 0;if(i<224){if(n>=t.length)throw Error(r);var o=t[++n];if((192&o)!=128)throw Error(r);i=(31&i)<<6|63&o,s=128}else if(i<240){if(n>=t.length-1)throw Error(r);var o=t[++n],a=t[++n];if((192&o)!=128||(192&a)!=128)throw Error(r);i=(15&i)<<12|(63&o)<<6|63&a,s=2048}else if(i<248){if(n>=t.length-2)throw Error(r);var o=t[++n],a=t[++n],c=t[++n];if((192&o)!=128||(192&a)!=128||(192&c)!=128)throw Error(r);i=(15&i)<<18|(63&o)<<12|(63&a)<<6|63&c,s=65536}else throw Error(r);if(i<s||i>=55296&&i<=57343)throw Error(r);if(i>
1=65536){if(i>1114111)throw Error(r);i-=65536,e.push(String.fromCharCode(55296|i>>10)),i=56320|1023&i}}e.push(String.fromCharCode(i))}return e.join("")}},function(t,e,n){t.exports=n(3).default},function(t,e,n){"use strict";n.r(e);class i{constructor(t,e){this.lastId=0,this.prefix=t,this.name=e}create(t){this.lastId++;var e=this.lastId,n=this.prefix+e,i=this.name+"["+e+"]",r=!1,s=function(){r||(t.apply(null,arguments),r=!0)};return this[e]=s,{number:e,id:n,name:i,callback:s}}remove(t){delete this[t.number]}}var r,s,o,a,c,h,u=new i("_pusher_script_","Pusher.ScriptReceivers"),l="8.3.0",d={endpoint:"/pusher/user-auth",transport:"ajax"},p={endpoint:"/pusher/auth",transport:"ajax"};class f{constructor(t){this.options=t,this.receivers=t.receivers||u,this.loading={}}load(t,e,n){var i=this;if(i.loading[t]&&i.loading[t].length>0)i.loading[t].push(n);else{i.loading[t]=[n];var r=t8.createScriptRequest(i.getPath(t,e)),s=i.receivers.create(function(e){if(i.receivers.remove(s),i.loading[t]){var n=i.loading[t];delete i.loading[t];for(var o=function(t){t||r.cleanup()},a=0;a<n.length;a++)n[a](e,o)}});r.send(s)}}getRoot(t){var e=t8.getDocument().location.protocol;return(t&&t.useTLS||"https:"===e?this.options.cdn_https:this.options.cdn_http).replace(/\/*$/,"")+"/"+this.options.version}getPath(t,e){return this.getRoot(e)+"/"+t+this.options.suffix+".js"}}var g=new i("_pusher_dependencies","Pusher.DependenciesReceivers"),m=new f({cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",version:l,suffix:"",receivers:g});let v={authenticationEndpoint:{path:"/docs/channels/server_api/authenticating_users"},authorizationEndpoint:{path:"/docs/channels/server_api/authorizing-users/"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}};var b=function(t){let e,n=v[t];return n&&(n.fullUrl?e=n.fullUrl:n.path&&(e="https://pusher.com"+n.path),e)?`See: ${e}`:""};(r=a||(a={})).UserAuthentication="user-authentication",r.ChannelAuthorization="channel-authorization";class y extends Error{constructor(t){super(t),Object.setPrototypeOf(this,new.target.prototype)}}class w extends Error{constructor(t){super(t),Object.setPrototypeOf(this,new.target.prototype)}}class S extends Error{constructor(t){super(t),Object.setPrototypeOf(this,new.target.prototype)}}class _ extends Error{constructor(t){super(t),Object.setPrototypeOf(this,new.target.prototype)}}class k extends Error{constructor(t){super(t),Object.setPrototypeOf(this,new.target.prototype)}}class C extends Error{constructor(t){super(t),Object.setPrototypeOf(this,new.target.prototype)}}class T extends Error{constructor(t){super(t),Object.setPrototypeOf(this,new.target.prototype)}}class P extends Error{constructor(t){super(t),Object.setPrototypeOf(this,new.target.prototype)}}class O extends Error{constructor(t,e){super(e),this.status=t,Object.setPrototypeOf(this,new.target.prototype)}}for(var x=function(t,e,n,i,r){let s=t8.createXHR();for(var o in s.open("POST",n.endpoint,!0),s.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),n.headers)s.setRequestHeader(o,n.headers[o]);if(null!=n.headersProvider){let t=n.headersProvider();for(var o in t)s.setRequestHeader(o,t[o])}return s.onreadystatechange=function(){if(4===s.readyState)if(200===s.status){let t,e=!1;try{t=JSON.parse(s.responseText),e=!0}catch(t){r(new O(200,`JSON returned from ${i.toString()}
1 endpoint was invalid, yet status code was 200. Data was: ${s.responseText}`),null)}e&&r(null,t)}else{let t="";switch(i){case a.UserAuthentication:t=b("authenticationEndpoint");break;case a.ChannelAuthorization:t=`Clients must be authorized to join private or presence channels. ${b("authorizationEndpoint")}`}r(new O(s.status,`Unable to retrieve auth string from ${i.toString()} endpoint - received status: ${s.status} from ${n.endpoint}. ${t}`),null)}},s.send(e),s},E=String.fromCharCode,L="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",D={},A=0,R=L.length;A<R;A++)D[L.charAt(A)]=A;var I=function(t){var e=t.charCodeAt(0);return e<128?t:e<2048?E(192|e>>>6)+E(128|63&e):E(224|e>>>12&15)+E(128|e>>>6&63)+E(128|63&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[L.charAt(n>>>18),L.charAt(n>>>12&63),e>=2?"=":L.charAt(n>>>6&63),e>=1?"=":L.charAt(63&n)].join("")},M=window.btoa||function(t){return t.replace(/[\s\S]{1,3}/g,$)};class N{constructor(t,e,n,i){this.clear=e,this.timer=t(()=>{this.timer&&(this.timer=i(this.timer))},n)}isRunning(){return null!==this.timer}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}var j=N;function z(t){window.clearTimeout(t)}function H(t){window.clearInterval(t)}class U extends j{constructor(t,e){super(setTimeout,z,t,function(t){return e(),null})}}class q extends j{constructor(t,e){super(setInterval,H,t,function(t){return e(),t})}}var B={now:()=>Date.now?Date.now():new Date().valueOf(),defer:t=>new U(0,t),method(t){var e=Array.prototype.slice.call(arguments,1);return function(n){return n[t].apply(n,e.concat(arguments))}}};function F(t,...e){for(var n=0;n<e.length;n++){var i=e[n];for(var r in i)i[r]&&i[r].constructor&&i[r].constructor===Object?t[r]=F(t[r]||{},i[r]):t[r]=i[r]}return t}function X(){for(var t=["Pusher"],e=0;e<arguments.length;e++)"string"==typeof arguments[e]?t.push(arguments[e]):t.push(tt(arguments[e]));return t.join(" : ")}function W(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 J(t,e){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(t[n],n,t)}function Y(t){var e=[];return J(t,function(t,n){e.push(n)}),e}function G(t,e,n){for(var i=0;i<t.length;i++)e.call(n||window,t[i],i,t)}function Z(t,e){for(var n=[],i=0;i<t.length;i++)n.push(e(t[i],i,t,n));return n}function Q(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 V(t,e){var n={};return J(t,function(i,r){(e&&e(i,r,t,n)||i)&&(n[r]=i)}),n}function K(t,e){for(var n=0;n<t.length;n++)if(e(t[n],n,t))return!0;return!1}function tt(t){try{return JSON.stringify(t)}catch(i){var e,n;return JSON.stringify((e=[],n=[],function t(i,r){var s,o,a;switch(typeof i){case"object":if(!i)return null;for(s=0;s<e.length;s+=1)if(e[s]===i)return{$ref:n[s]};if(e.push(i),n.push(r),"[object Array]"===Object.prototype.toString.apply(i))for(s=0,a=[];s<i.length;s+=1)a[s]=t(i[s],r+"["+s+"]");else for(o in a={},i)Object.prototype.hasOwnProperty.call(i,o)&&(a[o]=t(i[o],r+"["+JSON.stringify(o)+"]"));return a;case"number":case"string":case"boolean":return i}}(t,"$")))}}class te{constructor(){this.globalLog=t=>{window.console&&window.console.log&&window.console.log(t)}}debug(...t){this.log(this.globalLog,t)}warn(...t){this.log(this.globalLogWarn,t)}error(...t){this.log(this.globalLogError,t)}globalLogWarn(t){window.console&&window.console.warn?window.console.warn(t):this.globalLog(t)}globalLogError(t){window.console&&window.console.error?window.console.error(t):this.globalLogWarn(t)}log(t){var e=X.apply(this,arguments);eh.log?eh.log(e):eh.logToConsole&&t.bind(this)(e)}}var tn=new te,ti=function(t,e,n,i,r){(void 0!==n.headers||null!=n.headersProvider)&&tn.warn(`To send headers with the ${i.toString()} request, you must use AJAX, rather than JSONP.`);var s=t.nextAuthCallbackID.toString();t.nextAuthCallbackID++;var o=t.getDocument(),a=o.createElement("script");t.auth_callbacks[s]=function(t){r(null,t)},a.src=n.endpoint+"?callback="+encodeURIComponent("Pusher.auth_callbacks['"+s+"']")+"&"+e;var c=o.getElementsByTagName("head")[0]||o.documentElement;c.insertBefore(a,c.firstChild)};class tr{constructor(t){this.src=t}send(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 i=document.getElementsByTagName("head")[0];i.insertBefore(e.script,i.firstChild),e.errorScript&&i.insertBefore(e.errorScript,e.script.nextSibling)}cleanup(){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}}class ts{constructor(t,e){this.url=t,this.data=e}send(t){if(!this.request){var e,n,i,r,s=Z((e=V(this.data,function(t){return void 0!==t}),n=function(t){return"object"==typeof t&&(t=tt(t)),encodeURIComponent(M(t.toString().replace(/[^\x00-\x7F]/g,I))
1)},i={},J(e,function(t,e){i[e]=n(t)}),r=[],J(i,function(t,e){r.push([e,t])}),r),B.method("join","=")).join("&"),o=this.url+"/"+t.number+"?"+s;this.request=t8.createScriptRequest(o),this.request.send(t)}}cleanup(){this.request&&this.request.cleanup()}}function to(t,e,n){return t+(e.useTLS?"s":"")+"://"+(e.useTLS?e.hostTLS:e.hostNonTLS)+n}function ta(t,e){return"/app/"+t+"?protocol=7&client=js&version="+l+(e?"&"+e:"")}class tc{constructor(){this._callbacks={}}get(t){return this._callbacks["_"+t]}add(t,e,n){var i="_"+t;this._callbacks[i]=this._callbacks[i]||[],this._callbacks[i].push({fn:e,context:n})}remove(t,e,n){if(!t&&!e&&!n){this._callbacks={};return}var i=t?["_"+t]:Y(this._callbacks);e||n?this.removeCallback(i,e,n):this.removeAllCallbacks(i)}removeCallback(t,e,n){G(t,function(t){this._callbacks[t]=Q(this._callbacks[t]||[],function(t){return e&&e!==t.fn||n&&n!==t.context}),0===this._callbacks[t].length&&delete this._callbacks[t]},this)}removeAllCallbacks(t){G(t,function(t){delete this._callbacks[t]},this)}}class th{constructor(t){this.callbacks=new tc,this.global_callbacks=[],this.failThrough=t}bind(t,e,n){return this.callbacks.add(t,e,n),this}bind_global(t){return this.global_callbacks.push(t),this}unbind(t,e,n){return this.callbacks.remove(t,e,n),this}unbind_global(t){return t?this.global_callbacks=Q(this.global_callbacks||[],e=>e!==t):this.global_callbacks=[],this}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(t,e,n){for(var i=0;i<this.global_callbacks.length;i++)this.global_callbacks[i](t,e);var r=this.callbacks.get(t),s=[];if(n?s.push(e,n):e&&s.push(e),r&&r.length>0)for(var i=0;i<r.length;i++)r[i].fn.apply(r[i].context||window,s);else this.failThrough&&this.failThrough(t,e);return this}}class tu extends th{constructor(t,e,n,i,r){super(),this.initialize=t8.transportConnectionInitializer,this.hooks=t,this.name=e,this.priority=n,this.key=i,this.options=r,this.state="new",this.timeline=r.timeline,this.activityTimeout=r.activityTimeout,this.id=this.timeline.generateUniqueID()}handlesActivityChecks(){return!!this.hooks.handlesActivityChecks}supportsPing(){return!!this.hooks.supportsPing}connect(){if(this.socket||"initialized"!==this.state)return!1;var t=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(t,this.options)}catch(t){return B.defer(()=>{this.onError(t),this.changeState("closed")}),!1}return this.bindListeners(),tn.debug("Connecting",{transport:this.name,url:t}),this.changeState("connecting"),!0}close(){return!!this.socket&&(this.socket.close(),!0)}send(t){return"open"===this.state&&(B.defer(()=>{this.socket&&this.socket.send(t)}),!0)}ping(){"open"===this.state&&this.supportsPing()&&this.socket.ping()}onOpen(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0}onError(t){this.emit("error",{type:"WebSocketError",error:t}),this.timeline.error(this.buildTimelineMessage({error:t.toString()}))}onClose(t){t?this.changeState("closed",{code:t.code,reason:t.reason,wasClean:t.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(t){this.emit("message",t)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=t=>{this.onError(t)},this.socket.onclose=t=>{this.onClose(t)},this.socket.onmessage=t=>{this.onMessage(t)},this.supportsPing()&&(this.socket.onactivity=()=>{this.onActivity()})}unbindListeners(){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))}changeState(t,e){this.state=t,this.timeline.info(this.buildTimelineMessage({state:t,params:e})),this.emit(t,e)}buildTimelineMessage(t){return F({cid:this.id},t)}}class tl{constructor(t){this.hooks=t}isSupported(t){return this.hooks.isSupported(t)}createConnection(t,e,n,i){return new tu(this.hooks,t,e,n,i)}}var td=new tl({urls:{getInitial:function(t,e){var n=(e.httpPath||"")+ta(t,"flash=false");return to("ws",e,n)}},handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!t8.getWebSocketAPI()},isSupported:function(){return!!t8.getWebSocketAPI()},getSocket:function(t){return t8.createWebSocket(t)}}),tp={urls:{getInitial:function(t,e){var n=(e.httpPath||"/pusher")+ta(t);return to("http",e,n)}},handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},tf=F({getSocket:function(t){return t8.HTTPFactory.createStreamingSocket(t)}},tp),tg=F({getSocket:function(t){return t8.HTTPFactory.createPollingSocket(t)}},tp),tm={isSupported:function(){return t8.isXHRSupported()}},tv={ws:td,xhr_streaming:new tl(F({},tf,tm)),xhr_polling:new tl(F({},tg,tm))},tb=new tl({file:"sockjs",urls:{getInitial:function(t,e){return to("http",e,e.httpPath||"/pusher")},getPath:function(t,e){return ta(t)}},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:m.getPath("sockjs",{useTLS:e.useTLS}),ignore_null_origin:e.ignoreNullOrigin})},beforeOpen:function(t,e){t.send(JSON.stringify({path:e}))}}),ty={isSupported:function(t){return t8.isXDRSupported(t.useTLS)}},tw=new tl(F({},tf,ty)),tS=new tl(F({},tg,ty));tv.xdr_streaming=tw,tv.xdr_polling=tS,tv.sockjs=tb;class t_ extends th{constructor(){super();var t=this;void 0!==window.addEventListener&&(window.addEventListener("online",function(){t.emit("online")},!1),window.addEventListener("offline",function(){t.emit("offline")},!1))}isOnline(){return void 0===window.navigator.onLine||window.navigator.onLine}}var tk=new t_;class tC{constructor(t,e,n){this.manager=t,this.transport=e,this.minPingDelay=n.minPingDelay,this.maxPingDelay=n.maxPingDelay,this.pingDelay=void 0}createConnection(t,e,n,i){i=F({},i,{activityTimeout:this.pingDelay});var r=this.transport.createConnection(t,e,n,i),s=null,o=function(){r.unbind("open",o),r.bind("closed",a),s=B.now()},a=t=>{if(r.unbind("closed",a),1002===t.code||1003===t.code)this.manager.reportDeath();else if(!t.wasClean&&s){var e=B.now()-s;e<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(e/2,this.minPingDelay))}};return r.bind("open",o),r}isSupported(t){return this.manager.isAlive()&&this.transport.isSupported(t)}}let tT={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 i={event:e.event,channel:e.channel,data:n};return e.user_id&&(i.user_id=e.user_id),i}catch(e){throw{type:"MessageParseError",error:e,data:t.data}}},encodeMessage:function(t){return JSON.stringify(t)},processHandshake:function(t){var e=tT.decodeMessage(t);if("pusher:connection_established"===e.event){if(!e.data.activity_timeout)throw"No activity timeout specified in handshake";
1return{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){if(t.code<4e3)if(t.code>=1002&&t.code<=1004)return"backoff";else return null;if(4e3===t.code)return"tls_only";if(t.code<4100)return"refused";if(t.code<4200)return"backoff";if(t.code<4300)return"retry";else return"refused"},getCloseError:function(t){return 1e3!==t.code&&1001!==t.code?{type:"PusherError",data:{code:t.code,message:t.reason||t.message}}:null}};class tP extends th{constructor(t,e){super(),this.id=t,this.transport=e,this.activityTimeout=e.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(t){return this.transport.send(t)}send_event(t,e,n){var i={event:t,data:e};return n&&(i.channel=n),tn.debug("Event sent",i),this.send(tT.encodeMessage(i))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var t={message:t=>{var e;try{e=tT.decodeMessage(t)}catch(e){this.emit("error",{type:"MessageParseError",error:e,data:t.data})}if(void 0!==e){switch(tn.debug("Event recd",e),e.event){case"pusher:error":this.emit
vendor: 4,345 bytes, line 1
1("error",{type:"PusherError",data:e.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong")}this.emit("message",e)}},activity:()=>{this.emit("activity")},error:t=>{this.emit("error",t)},closed:t=>{e(),t&&t.code&&this.handleCloseEvent(t),this.transport=null,this.emit("closed")}},e=()=>{J(t,(t,e)=>{this.transport.unbind(e,t)})};J(t,(t,e)=>{this.transport.bind(e,t)})}handleCloseEvent(t){var e=tT.getCloseAction(t),n=tT.getCloseError(t);n&&this.emit("error",n),e&&this.emit(e,{action:e,error:n})}}class tO{constructor(t,e){this.transport=t,this.callback=e,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=t=>{var e;this.unbindListeners();try{e=tT.processHandshake(t)}catch(t){this.finish("error",{error:t}),this.transport.close();return}"connected"===e.action?this.finish("connected",{connection:new tP(e.id,this.transport),activityTimeout:e.activityTimeout}):(this.finish(e.action,{error:e.error}),this.transport.close())},this.onClosed=t=>{this.unbindListeners();var e=tT.getCloseAction(t)||"backoff",n=tT.getCloseError(t);this.finish(e,{error:n})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)}unbindListeners(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)}finish(t,e){this.callback(F({transport:this.transport,action:t},e))}}class tx{constructor(t,e){this.timeline=t,this.options=e||{}}send(t,e){this.timeline.isEmpty()||this.timeline.send(t8.TimelineTransport.getAgent(this,t),e)}}class tE extends th{constructor(t,e){super(function(e,n){tn.debug("No callbacks on "+t+" for "+e)}),this.name=t,this.pusher=e,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(t,e){return e(null,{auth:""})}trigger(t,e){if(0!==t.indexOf("client-"))throw new y("Event '"+t+"' does not start with 'client-'");if(!this.subscribed){var n=b("triggeringClientEvents");tn.warn(`Client event triggered before channel 'subscription_succeeded' event . ${n}`)}return this.pusher.send_event(t,e,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(t){var e=t.event,n=t.data;"pusher_internal:subscription_succeeded"===e?this.handleSubscriptionSucceededEvent(t):"pusher_internal:subscription_count"===e?this.handleSubscriptionCountEvent(t):0!==e.indexOf("pusher_internal:")&&this.emit(e,n,{})}handleSubscriptionSucceededEvent(t){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",t.data)}handleSubscriptionCountEvent(t){t.data.subscription_count&&(this.subscriptionCount=t.data.subscription_count),this.emit("pusher:subscription_count",t.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(t,e)=>{t?(this.subscriptionPending=!1,tn.error(t.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:t.message},t instanceof O?{status:t.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:e.auth,channel_data:e.channel_data,channel:this.name})}))}unsubscribe(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})}cancelSubscription(){this.subscriptionCancelled=!0}reinstateSubscription(){this.subscriptionCancelled=!1}}class tL extends tE{authorize(t,e){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:t},e)}}class tD{constructor(){this.reset()}get(t){return Object.prototype.hasOwnProperty.call(this.members,t)?{id:t,info:this.members[t]}:null}each(t){J(this.members,(e,n)=>{t(this.get(n))})}setMyID(t){this.myID=t}onSubscription(t){this.members=t.presence.hash,this.count=t.presence.count,this.me=this.get(this.myID)}addMember(t){return null===this.get(t.user_id)&&this.count++,this.members[t.user_id]=t.user_info,this.get(t.user_id)}removeMember(t){var e=this.get(t.user_id);return e&&(delete this.members[t.user_id],this.count--),e}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}class tA extends tL{constructor(t,e){super(t,e),this.members=new tD}authorize(t,e){super.authorize(t,(t,n)=>{var i,r,s,o;return i=this,r=void 0,s=void 0,o=function*(){if(!t)if(null!=n.channel_data){var i=JSON.parse(n.channel_data);
1this.members.setMyID(i.user_id)}else if(yield this.pusher.user.signinDonePromise,null!=this.pusher.user.user_data)this.members.setMyID(this.pusher.user.user_data.id);else{let t=b("authorizationEndpoint");tn.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${t}, or the user should be signed in.`),e("Invalid auth response");return}e(t,n)},new(s||(s=Promise))(function(t,e){function n(t){try{c(o.next(t))}catch(t){e(t)}}function a(t){try{c(o.throw(t))}catch(t){e(t)}}function c(e){var i;e.done?t(e.value):((i=e.value)instanceof s?i:new s(function(t){t(i)})).then(n,a)}c((o=o.apply(i,r||[])).next())})})}handleEvent(t){var e=t.event;if(0===e.indexOf("pusher_internal:"))this.handleInternalEvent(t);else{var n=t.data,i={};t.user_id&&(i.user_id=t.user_id),this.emit(e,n,i)}}handleInternalEvent(t){var e=t.event,n=t.data;switch(e){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(t);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(t);break;case"pusher_internal:member_added":var i=this.members.addMember(n);this.emit("pusher:member_added",i);break;case"pusher_internal:member_removed":var r=this.members.removeMember(n);r&&this.emit("pusher:member_removed",r)}}handleSubscriptionSucceededEvent(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))}disconnect(){this.members.reset(),super.disconnect()}}var tR=n(1),tI=n(0);class t$ extends tL{constructor(t,e,n){super(t,e),this.key=null,this.nacl=n}authorize(t,e){super.authorize(t,(t,n)=>{if(t)return void e(t,n);let i=n.shared_secret;if(!i)return void e(Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);this.key=Object(tI.decode)(i),delete n.shared_secret,e(null,n)})}trigger(t,e){throw new C("Client events are not currently supported for encrypted channels")}handleEvent(t){var e=t.event,n=t.data;if(0===e.indexOf("pusher_internal:")||0===e.indexOf("pusher:"))return void super.handleEvent(t);this.handleEncryptedEvent(e,n)}handleEncryptedEvent(t,e){if(!this.key)return void tn.debug("Received encrypted event before key has been retrieved from the authEndpoint");if(!e.ciphertext||!e.nonce)return void tn.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+e);let n=Object(tI.decode)(e.ciphertext);if(n.length<this.nacl.secretbox.overheadLength)return void tn.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${n.length}`);let i=Object(tI.decode)(e.nonce);if(i.length<this.nacl.secretbox.nonceLength)return void tn.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${i.length}`);let r=this.nacl.secretbox.open(n,i,this.key);if(null===r){tn.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."),this.authorize(this.pusher.connection.socket_id,(e,s)=>e?void tn.error(`Failed to make a request to the authEndpoint: ${s}. Unable to fetch new key, so dropping encrypted event`):null===(r=this.nacl.secretbox.open(n,i,this.key))?void tn.error("Failed to decrypt event with new key. Dropping encrypted event"):void this.emit(t,this.getDataToEmit(r)));return}this.emit(t,this.getDataToEmit(r))}getDataToEmit(t){let e=Object(tR.decode)(t);try{return JSON.parse(e)}catch(t){return e}}}class tM extends th{constructor(t,e){super(),this.state="initialized",this.connection=null,this.key=t,this.options=e,this.timeline=this.options.timeline,this.usingTLS=this.options.useTLS,this.errorCallbacks=this.buildErrorCallbacks(),this.connectionCallbacks=this.buildConnectionCallbacks(this.errorCallbacks),this.handshakeCallbacks=this.buildHandshakeCallbacks(this.errorCallbacks);var n=t8.getNetwork();n.bind("online",()=>{this.timeline.info({netinfo:"online"}),("connecting"===this.state||"unavailable"===this.state)&&this.retryIn(0)}),n.bind("offline",()=>{this.timeline.info({netinfo:"offline"}),this.connection&&this.sendActivityCheck()}),this.updateStrategy()}connect(){if(!this.connection&&!this.runner){if(!this.strategy.isSupported())return void this.updateState("failed");this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}}send(t){return!!this.connection&&this.connection.send(t)}send_event(t,e,n){return!!this.connection&&this.connection.send_event(t,e,n)}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var t=(e,n)=>{e?this.runner=this.strategy.connect(0,t):"error"===n.action?(this.emit
vendor: 7,447 bytes, line 1
1("error",{type:"HandshakeError",error:n.error}),this.timeline.error({handshakeError:n.error})):(this.abortConnecting(),this.handshakeCallbacks[n.action](n))};this.runner=this.strategy.connect(0,t)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection&&this.abandonConnection().close()}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(t){this.timeline.info({action:"retry",delay:t}),t>0&&this.emit("connecting_in",Math.round(t/1e3)),this.retryTimer=new U(t||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new U(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new U(this.options.pongTimeout,()=>{this.timeline.error({pong_timed_out:this.options.pongTimeout}),this.retryIn(0)})}resetActivityCheck(){this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new U(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(t){return F({},t,{message:t=>{this.resetActivityCheck(),this.emit("message",t)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:t=>{this.emit("error",t)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(t){return F({},t,{connected:t=>{this.activityTimeout=Math.min(this.options.activityTimeout,t.activityTimeout,t.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(t.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let t=t=>e=>{e.error&&this.emit("error",{type:"WebSocketError",error:e.error}),t(e)};return{tls_only:t(()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)}),refused:t(()=>{this.disconnect()}),backoff:t(()=>{this.retryIn(1e3)}),retry:t(()=>{this.retryIn(0)})}}setConnection(t){for(var e in this.connection=t,this.connectionCallbacks)this.connection.bind(e,this.connectionCallbacks[e]);this.resetActivityCheck()}abandonConnection(){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}}updateState(t,e){var n=this.state;if(this.state=t,n!==t){var i=t;"connected"===i&&(i+=" with new socket ID "+e.socket_id),tn.debug("State changed",n+" -> "+i),this.timeline.info({state:t,params:e}),this.emit("state_change",{previous:n,current:t}),this.emit(t,e)}}shouldRetry(){return"connecting"===this.state||"connected"===this.state}}class tN{constructor(){this.channels={}}add(t,e){return this.channels[t]||(this.channels[t]=function(t,e){if(0===t.indexOf("private-encrypted-")){if(e.config.nacl)return tj.createEncryptedChannel(t,e,e.config.nacl);let n=b("encryptedChannelSupport");throw new C(`Tried to subscribe to a private-encrypted- channel but no nacl implementation available. ${n}`)}if(0===t.indexOf("private-"))return tj.createPrivateChannel(t,e);if(0===t.indexOf("presence-"))return tj.createPresenceChannel(t,e);if(0!==t.indexOf("#"))return tj.createChannel(t,e);throw new w('Cannot create a channel with name "'+t+'".')}(t,e)),this.channels[t]}all(){var t,e;return t=this.channels,e=[],J(t,function(t){e.push(t)}),e}find(t){return this.channels[t]}remove(t){var e=this.channels[t];return delete this.channels[t],e}disconnect(){J(this.channels,function(t){t.disconnect()})}}var tj={createChannels:()=>new tN,createConnectionManager:(t,e)=>new tM(t,e),createChannel:(t,e)=>new tE(t,e),createPrivateChannel:(t,e)=>new tL(t,e),createPresenceChannel:(t,e)=>new tA(t,e),createEncryptedChannel:(t,e,n)=>new t$(t,e,n),createTimelineSender:(t,e)=>new tx(t,e),createHandshake:(t,e)=>new tO(t,e),createAssistantToTheTransportManager:(t,e,n)=>new tC(t,e,n)};class tz{constructor(t){this.options=t||{},this.livesLeft=this.options.lives||1/0}getAssistant(t){return tj.createAssistantToTheTransportManager(this,t,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class tH{constructor(t,e){this.strategies=t,this.loop=!!e.loop,this.failFast=!!e.failFast,this.timeout=e.timeout,this.timeoutLimit=e.timeoutLimit}isSupported(){return K(this.strategies,B.method("isSupported"))}connect(t,e){var n=this.strategies,i=0,r=this.timeout,s=null,o=(a,c)=>{c?e(null,c):(i+=1,this.loop&&(i%=n.length),i<n.length?(r&&(r*=2,this.timeoutLimit&&(r=Math.min(r,this.timeoutLimit))),s=this.tryStrategy(n[i],t,{timeout:r,failFast:this.failFast},o)):e(!0))};return s=this.tryStrategy(n[i],t,{timeout:r,failFast:this.failFast},o),{abort:function(){s.abort()},forceMinPriority:function(e){t=e,s&&s.forceMinPriority(e)}}}tryStrategy(t,e,n,i){var r=null,s=null;return n.timeout>0&&(r=new U(n.timeout,function(){s.abort(),i(!0)})),s=t.connect(e,function(t,e){(!(t&&r&&r.isRunning())||n.failFast)&&(r&&r.ensureAborted(),i(t,e))}),{abort:function(){r&&r.ensureAborted(),s.abort()},forceMinPriority:function(t){s.forceMinPriority(t)}}}}class tU{constructor(t){this.strategies=t}isSupported(){return K(this.strategies,B.method("isSupported"))}connect(t,e){var n,i,r,s;return n=this.strategies,i=t,r=function(t,n){return function(i,r){if(n[t].error=i,i){(function(t){for(var e,n=0;n<t.length;n++){if(e=t[n],!e.error)return!1}return!0})(n)&&e(!0);return}G(n,function(t){t.forceMinPriority(r.transport.priority)}),e(null,r)}},s=Z(n,function(t,e,n,s){return t.connect(i,r(e,s))}),{abort:function(){G(s,tq)},forceMinPriority:function(t){G(s,function(e){e.forceMinPriority(t)})}}}}function tq(t){t.error||t.aborted||(t.abort(),t.aborted=!0)}class tB{constructor(t,e,n){this.strategy=t,this.transports=e,this.ttl=n.ttl||18e5,this.usingTLS=n.useTLS,this.timeline=n.timeline}isSupported(){return this.strategy.isSupported()}connect(t,e){var n=this.usingTLS,i=function(t){var e=t8.getLocalStorage();if(e)try{var n=e[tF(t)];if(n)return JSON.parse(n)}catch(e){tX(t)}return null}(n),r=i&&i.cacheSkipCount?i.cacheSkipCount:0,s=[this.strategy];if(i&&i.timestamp+this.ttl>=B.now()){var o=this.transports[i.transport];o&&(["ws","wss"].includes(i.transport)||r>3?(this.timeline.info({cached:!0,transport:i.transport,latency:i.latency}),s.push(new tH([o],{timeout:2*i.latency+1e3,failFast:!0}))):r++)}var a=B.now(),c=s.pop().connect(t,function i(o,h){o?(tX(n),s.length>0?(a=B.now(),c=s.pop().connect(t,i)):e(o)):(function(t,e,n,i){var r=t8.getLocalStorage();if(r)try{r[tF(t)]=tt({timestamp:B.now(),transport:e,latency:n,cacheSkipCount:i})}catch(t){}}(n,h.transport.name,B.now()-a,r),e(null,h))});return{abort:function(){c.abort()},forceMinPriority:function(e){t=e,c&&c.forceMinPriority(e)}}}}function tF(t){return"pusherTransport"+(t?"TLS":"NonTLS")}function tX(t){var e=t8.getLocalStorage();if(e)try{delete e[tF(t)]}catch(t){}}class tW{constructor(t,{delay:e}){this.strategy=t,this.options={delay:e}}isSupported(){return this.strategy.isSupported()}
1connect(t,e){var n,i=this.strategy,r=new U(this.options.delay,function(){n=i.connect(t,e)});return{abort:function(){r.ensureAborted(),n&&n.abort()},forceMinPriority:function(e){t=e,n&&n.forceMinPriority(e)}}}}class tJ{constructor(t,e,n){this.test=t,this.trueBranch=e,this.falseBranch=n}isSupported(){return(this.test()?this.trueBranch:this.falseBranch).isSupported()}connect(t,e){return(this.test()?this.trueBranch:this.falseBranch).connect(t,e)}}class tY{constructor(t){this.strategy=t}isSupported(){return this.strategy.isSupported()}connect(t,e){var n=this.strategy.connect(t,function(t,i){i&&n.abort(),e(t,i)});return n}}function tG(t){return function(){return t.isSupported()}}var tZ={getRequest:function(t){var e=new window.XDomainRequest;return e.ontimeout=function(){t.emit("error",new S),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()}};class tQ extends th{constructor(t,e,n){super(),this.hooks=t,this.method=e,this.url=n}start(t){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},t8.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)}close(){this.unloader&&(t8.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(t,e){for(;;){var n=this.advanceBuffer(e);if(n)this.emit("chunk",{status:t,data:n});else break}this.isBufferTooLong(e)&&this.emit("buffer_too_long")}advanceBuffer(t){var e=t.slice(this.position),n=e.indexOf("\n");return -1!==n?(this.position+=n+1,e.slice(0,n)):null}isBufferTooLong(t){return this.position===t.length&&t.length>262144}}(s=c||(c={}))[s.CONNECTING=0]="CONNECTING",s[s.OPEN=1]="OPEN",s[s.CLOSED=3]="CLOSED";var tV=c,tK=1;class t0{constructor(t,e){this.hooks=t,this.session=t2(1e3)+"/"+function(t){for(var e=[],n=0;n<8;n++)e.push(t2(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=tV.CONNECTING,this.openStream()}send(t){return this.sendRaw(JSON.stringify([t]))}ping(){this.hooks.sendHeartbeat(this)}close(t,e){this.onClose(t,e,!0)}sendRaw(t){if(this.readyState!==tV.OPEN)return!1;try{var e,n;return t8.createSocketRequest("POST",t1((e=this.location,n=this.session,e.base+"/"+n+"/xhr_send"))).start(t),!0}catch(t){return!1}}reconnect(){this.closeStream(),this.openStream()}onClose(t,e,n){this.closeStream(),this.readyState=tV.CLOSED,this.onclose&&this.onclose({code:t,reason:e,wasClean:n})}onChunk(t){if(200===t.status){var e;switch(this.readyState===tV.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 n=0;n<e.length;n++)this.onEvent(e[n]);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)}}}onOpen(t){var e,n,i;this.readyState===tV.CONNECTING?(t&&t.hostname&&(this.location.base=(e=this.location.base,n=t.hostname,(i=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(e))[1]+n+i[3])),this.readyState=tV.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(t){this.readyState===tV.OPEN&&this.onmessage&&this.onmessage({data:t})}onActivity(){this.onactivity&&this.onactivity()}onError(t){this.onerror&&this.onerror(t)}openStream(){this.stream=t8.createSocketRequest("POST",t1(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",t=>{this.onChunk(t)}),this.stream.bind("finished",t=>{this.hooks.onFinished(this,t)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(t){B.defer(()=>{this.onError(t),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function t1(t){var e=-1===t.indexOf("?")?"?":"&";return t+e+"t="+ +new Date+"&n="+tK++}function t2(t){return t8.randomInt(t)}var t6={getReceiveURL:function(t,e){return t.base+"/"+e+"/xhr_streaming"+t.queryString}
1,onHeartbeat:function(t){t.sendRaw("[]")},sendHeartbeat:function(t){t.sendRaw("[]")},onFinished:function(t,e){t.onClose(1006,"Connection interrupted ("+e+")",!1)}},t3={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)}},t5={getRequest:function(t){var e=new(t8.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()}},t4={createStreamingSocket(t){return this.createSocket(t6,t)},createPollingSocket(t){return this.createSocket(t3,t)},createSocket:(t,e)=>new t0(t,e),createXHR(t,e){return this.createRequest(t5,t,e)},createRequest:(t,e,n)=>new tQ(t,e,n)};t4.createXDR=function(t,e){return this.createRequest(tZ,t,e)};var t8={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:u,DependenciesReceivers:g,getDefaultStrategy:function(t,e,n){var i,r={};function s(e,i,s,o,a){var c=n(t,e,i,s,o,a);return r[e]=c,c}var o=Object.assign({},e,{hostNonTLS:t.wsHost+":"+t.wsPort,hostTLS:t.wsHost+":"+t.wssPort,httpPath:t.wsPath}),a=Object.assign({},o,{useTLS:!0}),c=Object.assign({},e,{hostNonTLS:t.httpHost+":"+t.httpPort,hostTLS:t.httpHost+":"+t.httpsPort,httpPath:t.httpPath}),h={loop:!0,timeout:15e3,timeoutLimit:6e4},u=new tz({minPingDelay:1e4,maxPingDelay:t.activityTimeout}),l=new tz({lives:2,minPingDelay:1e4,maxPingDelay:t.activityTimeout}),d=s("ws","ws",3,o,u),p=s("wss","ws",3,a,u),f=s("sockjs","sockjs",1,c),g=s("xhr_streaming","xhr_streaming",1,c,l),m=s("xdr_streaming","xdr_streaming",1,c,l),v=s("xhr_polling","xhr_polling",1,c),b=s("xdr_polling","xdr_polling",1,c),y=new tH([d],h),w=new tH([p],h),S=new tH([f],h),_=new tH([new tJ(tG(g),g,m)],h),k=new tH([new tJ(tG(v),v,b)],h),C=new tH([new tJ(tG(_),new tU([_,new tW(k,{delay:4e3})]),k)],h),T=new tJ(tG(C),C,S);return i=new tU(e.useTLS?[y,new tW(T,{delay:2e3})]:[y,new tW(w,{delay:2e3}),new tW(T,{delay:5e3})]),new tB(new tY(new tJ(tG(d),i,T)),r,{ttl:18e5,timeline:e.timeline,useTLS:e.useTLS})},Transports:tv,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"),m.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:t4,TimelineTransport:{name:"jsonp",getAgent:function(t,e){return function(n,i){var r="http"+(e?"s":"")+"://"+(t.host||t.options.host)+t.options.path,s=t8.createJSONPRequest(r,n),o=t8.ScriptReceivers.create(function(e,n){u.remove(o),s.cleanup(),n&&n.host&&(t.host=n.host),i&&i(e,n)});s.send(o)}}},getXHRAPI:()=>window.XMLHttpRequest,getWebSocketAPI:()=>window.WebSocket||window.MozWebSocket,setup(t){window.Pusher=t;var e=()=>{this.onDocumentBody(t.ready)};window.JSON?e():m.load("json2",{},e)},getDocument:()=>document,getProtocol(){return this.getDocument().location.protocol},getAuthorizers:()=>({ajax:x,jsonp:ti}),onDocumentBody(t){document.body?t():setTimeout(()=>{this.onDocumentBody(t)},0)},createJSONPRequest:(t,e)=>new ts(t,e),createScriptRequest:t=>new tr(t),getLocalStorage(){try{return window.localStorage}catch(t){return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){return new(this.getXHRAPI())},createMicrosoftXHR:()=>new ActiveXObject("Microsoft.XMLHTTP"),getNetwork:()=>tk,createWebSocket(t){return new(this.getWebSocketAPI())(t)},createSocketRequest(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(){var t=this.getXHRAPI();return!!t&&void 0!==new t().withCredentials},isXDRSupported(t){var e=this.getProtocol();return!!window.XDomainRequest&&e===(t?"https:":"http:")},addUnloadListener(t){void 0!==window.addEventListener?window.addEventListener("unload",t,!1):void 0!==window.attachEvent&&window.attachEvent("onunload",t)},removeUnloadListener(t){void 0!==window.addEventListener?window.removeEventListener("unload",t,!1):void 0!==window.detachEvent&&window.detachEvent("onunload",t)},randomInt:t=>Math.floor((window.crypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0]/0x100000000*t)};(o=h||(h={}))[o.ERROR=3]="ERROR",o[o.INFO=6]="INFO",o[o.DEBUG=7]="DEBUG";var t9=h;class t7{constructor(t,e,n){this.key=t,this.session=e,this.events=[],this.options=n||{},this.sent=0,this.uniqueID=0}log(t,e){t<=this.options.level&&(this.events.push(F({},e,{timestamp:B.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}
1error(t){this.log(t9.ERROR,t)}info(t){this.log(t9.INFO,t)}debug(t){this.log(t9.DEBUG,t)}isEmpty(){return 0===this.events.length}send(t,e){var n=F({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(n,(t,n)=>{!t&&this.sent++,e&&e(t,n)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class et{constructor(t,e,n,i){this.name=t,this.priority=e,this.transport=n,this.options=i||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(t,e){if(!this.isSupported())return ee(new P,e);if(this.priority<t)return ee(new _,e);var n=!1,i=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),r=null,s=function(){i.unbind("initialized",s),i.connect()},o=function(){r=tj.createHandshake(i,function(t){n=!0,h(),e(null,t)})},a=function(t){h(),e(t)},c=function(){h(),e(new k(tt(i)))},h=function(){i.unbind("initialized",s),i.unbind("open",o),i.unbind("error",a),i.unbind("closed",c)};return i.bind("initialized",s),i.bind("open",o),i.bind("error",a),i.bind("closed",c),i.initialize(),{abort:()=>{n||(h(),r?r.close():i.close())},forceMinPriority:t=>{!n&&this.priority<t&&(r?r.close():i.close())}}}}function ee(t,e){return B.defer(function(){e(t)}),{abort:function(){},forceMinPriority:function(){}}}let{Transports:en}=t8;var ei=function(t,e,n,i,r,s){var o,a=en[n];if(!a)throw new T(n);return t.enabledTransports&&-1===W(t.enabledTransports,e)||t.disabledTransports&&-1!==W(t.disabledTransports,e)?o=er:(r=Object.assign({ignoreNullOrigin:t.ignoreNullOrigin},r),o=new et(e,i,s?s.getAssistant(a):a,r)),o},er={isSupported:function(){return!1},connect:function(t,e){var n=B.defer(function(){e(new P)});return{abort:function(){n.ensureAborted()},forceMinPriority:function(){}}}};class es extends th{constructor(t){super(function(t,e){tn.debug(`No callbacks on watchlist events for ${t}`)}),this.pusher=t,this.bindWatchlistInternalEvent()}handleEvent(t){t.data.events.forEach(t=>{this.emit(t.name,t)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",t=>{"pusher_internal:watchlist_events"===t.event&&this.handleEvent(t)})}}var eo=function(){let t,e;return{promise:new Promise((n,i)=>{t=n,e=i}),resolve:t,reject:e}};class ea extends th{constructor(t){super(function(t,e){tn.debug("No callbacks on user for "+t)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(t,e)=>{if(t){tn.warn(`Error during signin: ${t}`),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:e.auth,user_data:e.user_data})},this.pusher=t,this.pusher.connection.bind("state_change",({previous:t,current:e})=>{"connected"!==t&&"connected"===e&&this._signin(),"connected"===t&&"connected"!==e&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new es(t),this.pusher.connection.bind("message",t=>{"pusher:signin_success"===t.event&&this._onSigninSuccess(t.data),this.serverToUserChannel&&this.serverToUserChannel.name===t.channel&&this.serverToUserChannel.handleEvent(t)})}signin(){this.signin_requested||(this.signin_requested=!0,this._signin())}_signin(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),"connected"===this.pusher.connection.state&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))}_onSigninSuccess(t){try{this.user_data=JSON.parse(t.user_data)}catch(e){tn.error(`Failed parsing user data after signin: ${t.user_data}`),this._cleanup();return}if("string"!=typeof this.user_data.id||""===this.user_data.id){tn.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){let t=t=>{t.subscriptionPending&&t.subscriptionCancelled?t.reinstateSubscription():t.subscriptionPending||"connected"!==this.pusher.connection.state||t.subscribe()};this.serverToUserChannel=new tE(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((t,e)=>{0!==t.indexOf("pusher_internal:")&&0!==t.indexOf("pusher:")&&this.emit
1(t,e)}),t(this.serverToUserChannel)}_cleanup(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()}_newSigninPromiseIfNeeded(){if(!this.signin_requested||this.signinDonePromise&&!this.signinDonePromise.done)return;let{promise:t,resolve:e,reject:n}=eo();t.done=!1;let i=()=>{t.done=!0};t.then(i).catch(i),this.signinDonePromise=t,this._signinDoneResolve=e}}class ec{static ready(){ec.isReady=!0;for(var t=0,e=ec.instances.length;t<e;t++)ec.instances[t].connect()}static getClientFeatures(){return Y(V({ws:t8.Transports.ws},function(t){return t.isSupported({})}))}constructor(t,e){(function(t){if(null==t)throw"You must pass your app key when you instantiate Pusher."})(t),function(t){if(null==t)throw"You must pass an options object";if(null==t.cluster)throw"Options object must provide a cluster";"disableStats"in t&&tn.warn("The disableStats option is deprecated in favor of enableStats")}(e),this.key=t,this.config=function(t,e){var n,i,r,s;let o={activityTimeout:t.activityTimeout||12e4,cluster:t.cluster,httpPath:t.httpPath||"/pusher",httpPort:t.httpPort||80,httpsPort:t.httpsPort||443,pongTimeout:t.pongTimeout||3e4,statsHost:t.statsHost||"stats.pusher.com",unavailableTimeout:t.unavailableTimeout||1e4,wsPath:t.wsPath||"",wsPort:t.wsPort||80,wssPort:t.wssPort||443,enableStats:"enableStats"in(n=t)?n.enableStats:"disableStats"in n&&!n.disableStats,httpHost:(i=t).httpHost?i.httpHost:i.cluster?`sockjs-${i.cluster}.pusher.com`:"sockjs.pusher.com",useTLS:function(t){if("https:"===t8.getProtocol());else if(!1===t.forceTLS)return!1;return!0}(t),wsHost:(r=t).wsHost?r.wsHost:(s=r.cluster,`ws-${s}.pusher.com`),userAuthenticator:function(t){let e=Object.assign(Object.assign({},d),t.userAuthentication);if("customHandler"in e&&null!=e.customHandler)return e.customHandler;if(void 0===t8.getAuthorizers()[e.transport])throw`'${e.transport}' is not a recognized auth transport`;return(t,n)=>{let i=((t,e)=>{var n="socket_id="+encodeURIComponent(t.socketId);for(var i in e.params)n+="&"+encodeURIComponent(i)+"="+encodeURIComponent(e.params[i]);if(null!=e.paramsProvider){let t=e.paramsProvider();for(var i in t)n+="&"+encodeURIComponent(i)+"="+encodeURIComponent(t[i])}return n})(t,e);t8.getAuthorizers()[e.transport](t8,i,e,a.UserAuthentication,n)}}(t),channelAuthorizer:function(t,e){let n,i=("channelAuthorization"in t?n=Object.assign(Object.assign({},p),t.channelAuthorization):(n={transport:t.authTransport||"ajax",endpoint:t.authEndpoint||"/pusher/auth"},"auth"in t&&("params"in t.auth&&(n.params=t.auth.params),"headers"in t.auth&&(n.headers=t.auth.headers)),"authorizer"in t&&(n.customHandler=((t,e,n)=>{let i={authTransport:e.transport,authEndpoint:e.endpoint,auth:{params:e.params,headers:e.headers}};return(e,r)=>{n(t.channel(e.channelName),i).authorize(e.socketId,r)}})(e,n,t.authorizer))),n);if("customHandler"in i&&null!=i.customHandler)return i.customHandler;if(void 0===t8.getAuthorizers()[i.transport])throw`'${i.transport}' is not a recognized auth transport`;return(t,e)=>{let n=((t,e)=>{var n="socket_id="+encodeURIComponent(t.socketId);for(var i in n+="&channel_name="+encodeURIComponent(t.channelName),e.params)n+="&"+encodeURIComponent(i)+"="+encodeURIComponent(e.params[i]);if(null!=e.paramsProvider){let t=e.paramsProvider();for(var i in t)n+="&"+encodeURIComponent(i)+"="+encodeURIComponent(t[i])}return n})(t,i);t8.getAuthorizers()[i.transport](t8,n,i,a.ChannelAuthorization,e)}}(t,e)};return"disabledTransports"in t&&(o.disabledTransports=t.disabledTransports),"enabledTransports"in t&&(o.enabledTransports=t.enabledTransports),"ignoreNullOrigin"in t&&(o.ignoreNullOrigin=t.ignoreNullOrigin),"timelineParams"in t&&(o.timelineParams=t.timelineParams),"nacl"in t&&(o.nacl=t.nacl),o}(e,this),this.channels=tj.createChannels(),this.global_emitter=new th,this.sessionID=t8.randomInt(1e9),this.timeline=new t7(this.key,this.sessionID,{cluster:this.config.cluster,features:ec.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:t9.INFO,version:l}),this.config.enableStats&&(this.timelineSender=tj.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+t8.TimelineTransport.name}));var n=t=>t8.getDefaultStrategy(this.config,t,ei);this.connection=tj.createConnectionManager(this.key,{getStrategy:n,timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind("connected",()=>{this.subscribeAll(),this.timelineSender&&this.timelineSender.send(this.connection.isUsingTLS())}),this.connection.bind("message",t=>{var e=0===t.event.indexOf("pusher_internal:");if(t.channel){var n=this.channel(t.channel);n&&n.handleEvent(t)}e||this.global_emitter.emit(t.event,t.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",t=>{tn.warn(t)}),ec.instances.push(this),this.timeline.info({instances:ec.instances.length}),this.user=new ea(this),ec.isReady&&this.connect()}channel(t){return this.channels.find(t)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var t=this.connection.isUsingTLS(),e=this.timelineSender;this.timelineSenderTimer=new q(6e4,function(){e.send(t)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(t,e,n){return this.global_emitter.bind(t,e,n),this}unbind(t,e,n){return this.global_emitter.unbind(t,e,n),this}bind_global(t){return this.global_emitter.bind_global(t),this}unbind_global(t){return this.global_emitter.unbind_global(t),this}unbind_all(t){return this.global_emitter.unbind_all(),this}subscribeAll(){var t;for(t in this.channels.channels)this.channels.channels.hasOwnProperty(t)&&this.subscribe(t)}subscribe(t){var e=this.channels.add(t,this);return e.subscriptionPending&&e.subscriptionCancelled?e.reinstateSubscription():e.subscriptionPending||"connected"!==this.connection.state||e.subscribe(),e}
1unsubscribe(t){var e=this.channels.find(t);e&&e.subscriptionPending?e.cancelSubscription():(e=this.channels.remove(t))&&e.subscribed&&e.unsubscribe()}send_event(t,e,n){return this.connection.send_event(t,e,n)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}ec.instances=[],ec.isReady=!1,ec.logToConsole=!1,ec.Runtime=t8,ec.ScriptReceivers=t8.ScriptReceivers,ec.DependenciesReceivers=t8.DependenciesReceivers,ec.auth_callbacks=t8.auth_callbacks;var eh=e.default=ec;t8.setup(ec)}],e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},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||4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,(function(e){return t[e]}).bind(null,r));return i},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(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.