@voicenter-team/events-sdk 0.0.60 → 0.0.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@
4
4
  * @author Feross Aboukhadijeh <https://feross.org>
5
5
  * @license MIT
6
6
  */var Ur=function(t){return t!=null&&(Qe(t)||Dr(t)||!!t._isBuffer)};function Qe(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Dr(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Qe(t.slice(0,0))}(function(){var t=Lr,e=Ue.utf8,r=Ur,n=Ue.bin,o=function(i,u){i.constructor==String?u&&u.encoding==="binary"?i=n.stringToBytes(i):i=e.stringToBytes(i):r(i)?i=Array.prototype.slice.call(i,0):!Array.isArray(i)&&i.constructor!==Uint8Array&&(i=i.toString());for(var h=t.bytesToWords(i),d=i.length*8,c=1732584193,l=-271733879,p=-1732584194,a=271733878,s=0;s<h.length;s++)h[s]=(h[s]<<8|h[s]>>>24)&16711935|(h[s]<<24|h[s]>>>8)&4278255360;h[d>>>5]|=128<<d%32,h[(d+64>>>9<<4)+14]=d;for(var f=o._ff,y=o._gg,g=o._hh,w=o._ii,s=0;s<h.length;s+=16){var B=c,_=l,k=p,S=a;c=f(c,l,p,a,h[s+0],7,-680876936),a=f(a,c,l,p,h[s+1],12,-389564586),p=f(p,a,c,l,h[s+2],17,606105819),l=f(l,p,a,c,h[s+3],22,-1044525330),c=f(c,l,p,a,h[s+4],7,-176418897),a=f(a,c,l,p,h[s+5],12,1200080426),p=f(p,a,c,l,h[s+6],17,-1473231341),l=f(l,p,a,c,h[s+7],22,-45705983),c=f(c,l,p,a,h[s+8],7,1770035416),a=f(a,c,l,p,h[s+9],12,-1958414417),p=f(p,a,c,l,h[s+10],17,-42063),l=f(l,p,a,c,h[s+11],22,-1990404162),c=f(c,l,p,a,h[s+12],7,1804603682),a=f(a,c,l,p,h[s+13],12,-40341101),p=f(p,a,c,l,h[s+14],17,-1502002290),l=f(l,p,a,c,h[s+15],22,1236535329),c=y(c,l,p,a,h[s+1],5,-165796510),a=y(a,c,l,p,h[s+6],9,-1069501632),p=y(p,a,c,l,h[s+11],14,643717713),l=y(l,p,a,c,h[s+0],20,-373897302),c=y(c,l,p,a,h[s+5],5,-701558691),a=y(a,c,l,p,h[s+10],9,38016083),p=y(p,a,c,l,h[s+15],14,-660478335),l=y(l,p,a,c,h[s+4],20,-405537848),c=y(c,l,p,a,h[s+9],5,568446438),a=y(a,c,l,p,h[s+14],9,-1019803690),p=y(p,a,c,l,h[s+3],14,-187363961),l=y(l,p,a,c,h[s+8],20,1163531501),c=y(c,l,p,a,h[s+13],5,-1444681467),a=y(a,c,l,p,h[s+2],9,-51403784),p=y(p,a,c,l,h[s+7],14,1735328473),l=y(l,p,a,c,h[s+12],20,-1926607734),c=g(c,l,p,a,h[s+5],4,-378558),a=g(a,c,l,p,h[s+8],11,-2022574463),p=g(p,a,c,l,h[s+11],16,1839030562),l=g(l,p,a,c,h[s+14],23,-35309556),c=g(c,l,p,a,h[s+1],4,-1530992060),a=g(a,c,l,p,h[s+4],11,1272893353),p=g(p,a,c,l,h[s+7],16,-155497632),l=g(l,p,a,c,h[s+10],23,-1094730640),c=g(c,l,p,a,h[s+13],4,681279174),a=g(a,c,l,p,h[s+0],11,-358537222),p=g(p,a,c,l,h[s+3],16,-722521979),l=g(l,p,a,c,h[s+6],23,76029189),c=g(c,l,p,a,h[s+9],4,-640364487),a=g(a,c,l,p,h[s+12],11,-421815835),p=g(p,a,c,l,h[s+15],16,530742520),l=g(l,p,a,c,h[s+2],23,-995338651),c=w(c,l,p,a,h[s+0],6,-198630844),a=w(a,c,l,p,h[s+7],10,1126891415),p=w(p,a,c,l,h[s+14],15,-1416354905),l=w(l,p,a,c,h[s+5],21,-57434055),c=w(c,l,p,a,h[s+12],6,1700485571),a=w(a,c,l,p,h[s+3],10,-1894986606),p=w(p,a,c,l,h[s+10],15,-1051523),l=w(l,p,a,c,h[s+1],21,-2054922799),c=w(c,l,p,a,h[s+8],6,1873313359),a=w(a,c,l,p,h[s+15],10,-30611744),p=w(p,a,c,l,h[s+6],15,-1560198380),l=w(l,p,a,c,h[s+13],21,1309151649),c=w(c,l,p,a,h[s+4],6,-145523070),a=w(a,c,l,p,h[s+11],10,-1120210379),p=w(p,a,c,l,h[s+2],15,718787259),l=w(l,p,a,c,h[s+9],21,-343485551),c=c+B>>>0,l=l+_>>>0,p=p+k>>>0,a=a+S>>>0}return t.endian([c,l,p,a])};o._ff=function(i,u,h,d,c,l,p){var a=i+(u&h|~u&d)+(c>>>0)+p;return(a<<l|a>>>32-l)+u},o._gg=function(i,u,h,d,c,l,p){var a=i+(u&d|h&~d)+(c>>>0)+p;return(a<<l|a>>>32-l)+u},o._hh=function(i,u,h,d,c,l,p){var a=i+(u^h^d)+(c>>>0)+p;return(a<<l|a>>>32-l)+u},o._ii=function(i,u,h,d,c,l,p){var a=i+(h^(u|~d))+(c>>>0)+p;return(a<<l|a>>>32-l)+u},o._blocksize=16,o._digestsize=16,Ge.exports=function(i,u){if(i==null)throw new Error("Illegal argument "+i);var h=t.wordsToBytes(o(i,u));return u&&u.asBytes?h:u&&u.asString?n.bytesToString(h):t.bytesToHex(h)}})();var Pr=Ge.exports;const Fr=_r(Pr);var vt=(t=>(t.MAIN="main",t.NEXT="next",t))(vt||{}),st=(t=>(t.USER="User",t.TOKEN="Token",t))(st||{});class It{static async getSessionStorageDataByKey(e,r=!0){if(typeof chrome<"u"&&typeof chrome.storage<"u"){const n=await chrome.storage.session.get(e);if(n[e])return r?JSON.parse(n[e]):n[e]}if(typeof window<"u"&&typeof window.sessionStorage<"u"&&typeof window.sessionStorage.getItem=="function"){const n=window.sessionStorage.getItem(e);if(n)return r?JSON.parse(n):n}}static async updateSessionStorageKey(e,r){typeof chrome<"u"&&typeof chrome.storage<"u"&&await chrome.storage.session.set({[e]:JSON.stringify(r)}),typeof window<"u"&&typeof window.sessionStorage<"u"&&typeof window.sessionStorage.setItem=="function"&&window.sessionStorage.setItem(e,JSON.stringify(r))}static clearSessionStorage(){typeof chrome<"u"&&typeof chrome.storage<"u"&&chrome.storage.session.clear(),typeof window<"u"&&typeof window.sessionStorage<"u"&&typeof window.sessionStorage.clear=="function"&&window.sessionStorage.clear()}}var jr=Object.defineProperty,Mr=(t,e,r)=>e in t?jr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,V=(t,e,r)=>(Mr(t,typeof e!="symbol"?e+"":e,r),r);function qr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function zr(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}),r}var pe={exports:{}},Xr=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Wr=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],Ze=function(t){var e=t,r=t.indexOf("["),n=t.indexOf("]");r!=-1&&n!=-1&&(t=t.substring(0,r)+t.substring(r,n).replace(/:/g,";")+t.substring(n,t.length));for(var o=Xr.exec(t||""),i={},u=14;u--;)i[Wr[u]]=o[u]||"";return r!=-1&&n!=-1&&(i.source=e,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=Kr(i,i.path),i.queryKey=Hr(i,i.query),i};function Kr(t,e){var r=/\/{2,9}/g,n=e.replace(r,"/").split("/");return(e.substr(0,1)=="/"||e.length===0)&&n.splice(0,1),e.substr(e.length-1,1)=="/"&&n.splice(n.length-1,1),n}function Hr(t,e){var r={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,o,i){o&&(r[o]=i)}),r}var ue={exports:{}},le={exports:{}},Bt=1e3,_t=Bt*60,Lt=_t*60,Ut=Lt*24,Jr=Ut*365.25,Vr=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return $r(t);if(r==="number"&&isNaN(t)===!1)return e.long?Yr(t):Gr(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function $r(t){if(t=String(t),!(t.length>100)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Jr;case"days":case"day":case"d":return r*Ut;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Lt;case"minutes":case"minute":case"mins":case"min":case"m":return r*_t;case"seconds":case"second":case"secs":case"sec":case"s":return r*Bt;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function Gr(t){return t>=Ut?Math.round(t/Ut)+"d":t>=Lt?Math.round(t/Lt)+"h":t>=_t?Math.round(t/_t)+"m":t>=Bt?Math.round(t/Bt)+"s":t+"ms"}function Yr(t){return Pt(t,Ut,"day")||Pt(t,Lt,"hour")||Pt(t,_t,"minute")||Pt(t,Bt,"second")||t+" ms"}function Pt(t,e,r){if(!(t<e))return t<e*1.5?Math.floor(t/e)+" "+r:Math.ceil(t/e)+" "+r+"s"}(function(t,e){e=t.exports=n.debug=n.default=n,e.coerce=d,e.disable=u,e.enable=i,e.enabled=h,e.humanize=Vr,e.instances=[],e.names=[],e.skips=[],e.formatters={};function r(c){var l=0,p;for(p in c)l=(l<<5)-l+c.charCodeAt(p),l|=0;return e.colors[Math.abs(l)%e.colors.length]}function n(c){var l;function p(){if(p.enabled){var a=p,s=+new Date,f=s-(l||s);a.diff=f,a.prev=l,a.curr=s,l=s;for(var y=new Array(arguments.length),g=0;g<y.length;g++)y[g]=arguments[g];y[0]=e.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");var w=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,function(_,k){if(_==="%%")return _;w++;var S=e.formatters[k];if(typeof S=="function"){var m=y[w];_=S.call(a,m),y.splice(w,1),w--}return _}),e.formatArgs.call(a,y);var B=p.log||e.log||console.log.bind(console);B.apply(a,y)}}return p.namespace=c,p.enabled=e.enabled(c),p.useColors=e.useColors(),p.color=r(c),p.destroy=o,typeof e.init=="function"&&e.init(p),e.instances.push(p),p}function o(){var c=e.instances.indexOf(this);return c!==-1?(e.instances.splice(c,1),!0):!1}function i(c){e.save(c),e.names=[],e.skips=[];var l,p=(typeof c=="string"?c:"").split(/[\s,]+/),a=p.length;for(l=0;l<a;l++)p[l]&&(c=p[l].replace(/\*/g,".*?"),c[0]==="-"?e.skips.push(new RegExp("^"+c.substr(1)+"$")):e.names.push(new RegExp("^"+c+"$")));for(l=0;l<e.instances.length;l++){var s=e.instances[l];s.enabled=e.enabled(s.namespace)}}function u(){e.enable("")}function h(c){if(c[c.length-1]==="*")return!0;var l,p;for(l=0,p=e.skips.length;l<p;l++)if(e.skips[l].test(c))return!1;for(l=0,p=e.names.length;l<p;l++)if(e.names[l].test(c))return!0;return!1}function d(c){return c instanceof Error?c.stack||c.message:c}})(le,le.exports);var Qr=le.exports;(function(t,e){e=t.exports=Qr,e.log=o,e.formatArgs=n,e.save=i,e.load=u,e.useColors=r,e.storage=typeof chrome<"u"&&typeof chrome.storage<"u"?chrome.storage.local:h(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&window.process.type==="renderer"?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}e.formatters.j=function(d){try{return JSON.stringify(d)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}};function n(d){var c=this.useColors;if(d[0]=(c?"%c":"")+this.namespace+(c?" %c":" ")+d[0]+(c?"%c ":" ")+"+"+e.humanize(this.diff),!!c){var l="color: "+this.color;d.splice(1,0,l,"color: inherit");var p=0,a=0;d[0].replace(/%[a-zA-Z%]/g,function(s){s!=="%%"&&(p++,s==="%c"&&(a=p))}),d.splice(a,0,l)}}function o(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function i(d){try{d==null?e.storage.removeItem("debug"):e.storage.debug=d}catch{}}function u(){var d;try{d=e.storage.debug}catch{}return!d&&typeof process<"u"&&"env"in process&&(d=process.env.DEBUG),d}e.enable(u());function h(){try{return window.localStorage}catch{}}})(ue,ue.exports);var lt=ue.exports,Zr=Ze,De=lt("socket.io-client:url"),tn=en;function en(t,e){var r=t;e=e||typeof location<"u"&&location,t==null&&(t=e.protocol+"//"+e.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=e.protocol+t:t=e.host+t),/^(https?|wss?):\/\//.test(t)||(De("protocol-less url %s",t),typeof e<"u"?t=e.protocol+"//"+t:t="https://"+t),De("parse %s",t),r=Zr(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";var n=r.host.indexOf(":")!==-1,o=n?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port,r.href=r.protocol+"://"+o+(e&&e.port===r.port?"":":"+r.port),r}var Kt={},tr={exports:{}};(function(t){t.exports=e;function e(n){if(n)return r(n)}function r(n){for(var o in e.prototype)n[o]=e.prototype[o];return n}e.prototype.on=e.prototype.addEventListener=function(n,o){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(o),this},e.prototype.once=function(n,o){function i(){this.off(n,i),o.apply(this,arguments)}return i.fn=o,this.on(n,i),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(n,o){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+n];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var u,h=0;h<i.length;h++)if(u=i[h],u===o||u.fn===o){i.splice(h,1);break}return i.length===0&&delete this._callbacks["$"+n],this},e.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var o=new Array(arguments.length-1),i=this._callbacks["$"+n],u=1;u<arguments.length;u++)o[u-1]=arguments[u];if(i){i=i.slice(0);for(var u=0,h=i.length;u<h;++u)i[u].apply(this,o)}return this},e.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]},e.prototype.hasListeners=function(n){return!!this.listeners(n).length}})(tr);var St=tr.exports,Ht={},rn={}.toString,be=Array.isArray||function(t){return rn.call(t)=="[object Array]"},er=an,nn=typeof Buffer=="function"&&typeof Buffer.isBuffer=="function",on=typeof ArrayBuffer=="function",sn=function(t){return typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer};function an(t){return nn&&Buffer.isBuffer(t)||on&&(t instanceof ArrayBuffer||sn(t))}var ke=be,rr=er,nr=Object.prototype.toString,cn=typeof Blob=="function"||typeof Blob<"u"&&nr.call(Blob)==="[object BlobConstructor]",hn=typeof File=="function"||typeof File<"u"&&nr.call(File)==="[object FileConstructor]";Ht.deconstructPacket=function(t){var e=[],r=t.data,n=t;return n.data=fe(r,e),n.attachments=e.length,{packet:n,buffers:e}};function fe(t,e){if(!t)return t;if(rr(t)){var r={_placeholder:!0,num:e.length};return e.push(t),r}else if(ke(t)){for(var n=new Array(t.length),o=0;o<t.length;o++)n[o]=fe(t[o],e);return n}else if(typeof t=="object"&&!(t instanceof Date)){var n={};for(var i in t)n[i]=fe(t[i],e);return n}return t}Ht.reconstructPacket=function(t,e){return t.data=de(t.data,e),t.attachments=void 0,t};function de(t,e){if(!t)return t;if(t&&t._placeholder===!0){var r=typeof t.num=="number"&&t.num>=0&&t.num<e.length;if(r)return e[t.num];throw new Error("illegal attachments")}else if(ke(t))for(var n=0;n<t.length;n++)t[n]=de(t[n],e);else if(typeof t=="object")for(var o in t)t[o]=de(t[o],e);return t}Ht.removeBlobs=function(t,e){function r(i,u,h){if(!i)return i;if(cn&&i instanceof Blob||hn&&i instanceof File){n++;var d=new FileReader;d.onload=function(){h?h[u]=this.result:o=this.result,--n||e(o)},d.readAsArrayBuffer(i)}else if(ke(i))for(var c=0;c<i.length;c++)r(i[c],c,i);else if(typeof i=="object"&&!rr(i))for(var l in i)r(i[l],l,i)}var n=0,o=t;r(o),n||e(o)};(function(t){var e=lt("socket.io-parser"),r=St,n=Ht,o=be,i=er;t.protocol=4,t.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],t.CONNECT=0,t.DISCONNECT=1,t.EVENT=2,t.ACK=3,t.ERROR=4,t.BINARY_EVENT=5,t.BINARY_ACK=6,t.Encoder=u,t.Decoder=p;function u(){}var h=t.ERROR+'"encode error"';u.prototype.encode=function(g,w){if(e("encoding packet %j",g),t.BINARY_EVENT===g.type||t.BINARY_ACK===g.type)l(g,w);else{var B=d(g);w([B])}};function d(g){var w=""+g.type;if((t.BINARY_EVENT===g.type||t.BINARY_ACK===g.type)&&(w+=g.attachments+"-"),g.nsp&&g.nsp!=="/"&&(w+=g.nsp+","),g.id!=null&&(w+=g.id),g.data!=null){var B=c(g.data);if(B!==!1)w+=B;else return h}return e("encoded %j as %s",g,w),w}function c(g){try{return JSON.stringify(g)}catch{return!1}}function l(g,w){function B(_){var k=n.deconstructPacket(_),S=d(k.packet),m=k.buffers;m.unshift(S),w(m)}n.removeBlobs(g,B)}function p(){this.reconstructor=null}r(p.prototype),p.prototype.add=function(g){var w;if(typeof g=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");w=a(g),t.BINARY_EVENT===w.type||t.BINARY_ACK===w.type?(this.reconstructor=new f(w),this.reconstructor.reconPack.attachments===0&&this.emit("decoded",w)):this.emit("decoded",w)}else if(i(g)||g.base64)if(this.reconstructor)w=this.reconstructor.takeBinaryData(g),w&&(this.reconstructor=null,this.emit("decoded",w));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+g)};function a(g){var w=0,B={type:Number(g.charAt(0))};if(t.types[B.type]==null)return y("unknown packet type "+B.type);if(t.BINARY_EVENT===B.type||t.BINARY_ACK===B.type){for(var _=w+1;g.charAt(++w)!=="-"&&w!=g.length;);var k=g.substring(_,w);if(k!=Number(k)||g.charAt(w)!=="-")throw new Error("Illegal attachments");B.attachments=Number(k)}if(g.charAt(w+1)==="/"){for(var _=w+1;++w;){var S=g.charAt(w);if(S===","||w===g.length)break}B.nsp=g.substring(_,w)}else B.nsp="/";var m=g.charAt(w+1);if(m!==""&&Number(m)==m){for(var _=w+1;++w;){var S=g.charAt(w);if(S==null||Number(S)!=S){--w;break}if(w===g.length)break}B.id=Number(g.substring(_,w+1))}if(g.charAt(++w)){var C=s(g.substr(w)),E=C!==!1&&(B.type===t.ERROR||o(C));if(E)B.data=C;else return y("invalid payload")}return e("decoded %s as %j",g,B),B}function s(g){try{return JSON.parse(g)}catch{return!1}}p.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()};function f(g){this.reconPack=g,this.buffers=[]}f.prototype.takeBinaryData=function(g){if(this.buffers.push(g),this.buffers.length===this.reconPack.attachments){var w=n.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),w}return null},f.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]};function y(g){return{type:t.ERROR,data:"parser error: "+g}}})(Kt);var Ce={exports:{}},Jt={},ye={exports:{}};try{ye.exports=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{ye.exports=!1}var pn=ye.exports,we=function(){return typeof self<"u"?self:typeof window<"u"?window:Function("return this")()}(),un=pn,ln=we,Se=function(t){var e=t.xdomain,r=t.xscheme,n=t.enablesXDR;try{if(typeof XMLHttpRequest<"u"&&(!e||un))return new XMLHttpRequest}catch{}try{if(typeof XDomainRequest<"u"&&!r&&n)return new XDomainRequest}catch{}if(!e)try{return new ln[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}},Ee={exports:{}},bt={},fn=Object.keys||function(t){var e=[],r=Object.prototype.hasOwnProperty;for(var n in t)r.call(t,n)&&e.push(n);return e},dn=be,or=Object.prototype.toString,yn=typeof Blob=="function"||typeof Blob<"u"&&or.call(Blob)==="[object BlobConstructor]",gn=typeof File=="function"||typeof File<"u"&&or.call(File)==="[object FileConstructor]",sr=Mt;function Mt(t){if(!t||typeof t!="object")return!1;if(dn(t)){for(var e=0,r=t.length;e<r;e++)if(Mt(t[e]))return!0;return!1}if(typeof Buffer=="function"&&Buffer.isBuffer&&Buffer.isBuffer(t)||typeof ArrayBuffer=="function"&&t instanceof ArrayBuffer||yn&&t instanceof Blob||gn&&t instanceof File)return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return Mt(t.toJSON(),!0);for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&Mt(t[n]))return!0;return!1}var mn=function(t,e,r){var n=t.byteLength;if(e=e||0,r=r||n,t.slice)return t.slice(e,r);if(e<0&&(e+=n),r<0&&(r+=n),r>n&&(r=n),e>=n||e>=r||n===0)return new ArrayBuffer(0);for(var o=new Uint8Array(t),i=new Uint8Array(r-e),u=e,h=0;u<r;u++,h++)i[h]=o[u];return i.buffer},vn=bn;function bn(t,e,r){var n=!1;return r=r||kn,o.count=t,t===0?e():o;function o(i,u){if(o.count<=0)throw new Error("after called too many times");--o.count,i?(n=!0,e(i),e=r):o.count===0&&!n&&e(null,u)}}function kn(){}/*! https://mths.be/utf8js v2.1.2 by @mathias */var yt=String.fromCharCode;function ir(t){for(var e=[],r=0,n=t.length,o,i;r<n;)o=t.charCodeAt(r++),o>=55296&&o<=56319&&r<n?(i=t.charCodeAt(r++),(i&64512)==56320?e.push(((o&1023)<<10)+(i&1023)+65536):(e.push(o),r--)):e.push(o);return e}function Cn(t){for(var e=t.length,r=-1,n,o="";++r<e;)n=t[r],n>65535&&(n-=65536,o+=yt(n>>>10&1023|55296),n=56320|n&1023),o+=yt(n);return o}function ar(t,e){if(t>=55296&&t<=57343){if(e)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function ne(t,e){return yt(t>>e&63|128)}function wn(t,e){if(!(t&4294967168))return yt(t);var r="";return t&4294965248?t&4294901760?t&4292870144||(r=yt(t>>18&7|240),r+=ne(t,12),r+=ne(t,6)):(ar(t,e)||(t=65533),r=yt(t>>12&15|224),r+=ne(t,6)):r=yt(t>>6&31|192),r+=yt(t&63|128),r}function Sn(t,e){e=e||{};for(var r=e.strict!==!1,n=ir(t),o=n.length,i=-1,u,h="";++i<o;)u=n[i],h+=wn(u,r);return h}function kt(){if(gt>=zt)throw Error("Invalid byte index");var t=qt[gt]&255;if(gt++,(t&192)==128)return t&63;throw Error("Invalid continuation byte")}function En(t){var e,r,n,o,i;if(gt>zt)throw Error("Invalid byte index");if(gt==zt)return!1;if(e=qt[gt]&255,gt++,!(e&128))return e;if((e&224)==192){if(r=kt(),i=(e&31)<<6|r,i>=128)return i;throw Error("Invalid continuation byte")}if((e&240)==224){if(r=kt(),n=kt(),i=(e&15)<<12|r<<6|n,i>=2048)return ar(i,t)?i:65533;throw Error("Invalid continuation byte")}if((e&248)==240&&(r=kt(),n=kt(),o=kt(),i=(e&7)<<18|r<<12|n<<6|o,i>=65536&&i<=1114111))return i;throw Error("Invalid UTF-8 detected")}var qt,zt,gt;function An(t,e){e=e||{};var r=e.strict!==!1;qt=ir(t),zt=qt.length,gt=0;for(var n=[],o;(o=En(r))!==!1;)n.push(o);return Cn(n)}var Tn={version:"2.1.2",encode:Sn,decode:An},oe={},Pe;function Nn(){return Pe||(Pe=1,function(t){oe.encode=function(e){var r=new Uint8Array(e),n,o=r.length,i="";for(n=0;n<o;n+=3)i+=t[r[n]>>2],i+=t[(r[n]&3)<<4|r[n+1]>>4],i+=t[(r[n+1]&15)<<2|r[n+2]>>6],i+=t[r[n+2]&63];return o%3===2?i=i.substring(0,i.length-1)+"=":o%3===1&&(i=i.substring(0,i.length-2)+"=="),i},oe.decode=function(e){var r=e.length*.75,n=e.length,o,i=0,u,h,d,c;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);var l=new ArrayBuffer(r),p=new Uint8Array(l);for(o=0;o<n;o+=4)u=t.indexOf(e[o]),h=t.indexOf(e[o+1]),d=t.indexOf(e[o+2]),c=t.indexOf(e[o+3]),p[i++]=u<<2|h>>4,p[i++]=(h&15)<<4|d>>2,p[i++]=(d&3)<<6|c&63;return l}}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")),oe}var se,Fe;function On(){if(Fe)return se;Fe=1;var t=typeof t<"u"?t:typeof WebKitBlobBuilder<"u"?WebKitBlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:!1,e=function(){try{var h=new Blob(["hi"]);return h.size===2}catch{return!1}}(),r=e&&function(){try{var h=new Blob([new Uint8Array([1,2])]);return h.size===2}catch{return!1}}(),n=t&&t.prototype.append&&t.prototype.getBlob;function o(h){return h.map(function(d){if(d.buffer instanceof ArrayBuffer){var c=d.buffer;if(d.byteLength!==c.byteLength){var l=new Uint8Array(d.byteLength);l.set(new Uint8Array(c,d.byteOffset,d.byteLength)),c=l.buffer}return c}return d})}function i(h,d){d=d||{};var c=new t;return o(h).forEach(function(l){c.append(l)}),d.type?c.getBlob(d.type):c.getBlob()}function u(h,d){return new Blob(o(h),d||{})}return typeof Blob<"u"&&(i.prototype=Blob.prototype,u.prototype=Blob.prototype),se=function(){return e?r?Blob:u:n?i:void 0}(),se}(function(t){var e=fn,r=sr,n=mn,o=vn,i=Tn,u;typeof ArrayBuffer<"u"&&(u=Nn());var h=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),d=typeof navigator<"u"&&/PhantomJS/i.test(navigator.userAgent),c=h||d;t.protocol=3;var l=t.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},p=e(l),a={type:"error",data:"parser error"},s=On();t.encodePacket=function(k,S,m,C){typeof S=="function"&&(C=S,S=!1),typeof m=="function"&&(C=m,m=null);var E=k.data===void 0?void 0:k.data.buffer||k.data;if(typeof ArrayBuffer<"u"&&E instanceof ArrayBuffer)return y(k,S,C);if(typeof s<"u"&&E instanceof s)return w(k,S,C);if(E&&E.base64)return f(k,C);var v=l[k.type];return k.data!==void 0&&(v+=m?i.encode(String(k.data),{strict:!1}):String(k.data)),C(""+v)};function f(k,S){var m="b"+t.packets[k.type]+k.data.data;return S(m)}function y(k,S,m){if(!S)return t.encodeBase64Packet(k,m);var C=k.data,E=new Uint8Array(C),v=new Uint8Array(1+C.byteLength);v[0]=l[k.type];for(var b=0;b<E.length;b++)v[b+1]=E[b];return m(v.buffer)}function g(k,S,m){if(!S)return t.encodeBase64Packet(k,m);var C=new FileReader;return C.onload=function(){t.encodePacket({type:k.type,data:C.result},S,!0,m)},C.readAsArrayBuffer(k.data)}function w(k,S,m){if(!S)return t.encodeBase64Packet(k,m);if(c)return g(k,S,m);var C=new Uint8Array(1);C[0]=l[k.type];var E=new s([C.buffer,k.data]);return m(E)}t.encodeBase64Packet=function(k,S){var m="b"+t.packets[k.type];if(typeof s<"u"&&k.data instanceof s){var C=new FileReader;return C.onload=function(){var O=C.result.split(",")[1];S(m+O)},C.readAsDataURL(k.data)}var E;try{E=String.fromCharCode.apply(null,new Uint8Array(k.data))}catch{for(var v=new Uint8Array(k.data),b=new Array(v.length),T=0;T<v.length;T++)b[T]=v[T];E=String.fromCharCode.apply(null,b)}return m+=btoa(E),S(m)},t.decodePacket=function(k,S,m){if(k===void 0)return a;if(typeof k=="string"){if(k.charAt(0)==="b")return t.decodeBase64Packet(k.substr(1),S);if(m&&(k=B(k),k===!1))return a;var E=k.charAt(0);return Number(E)!=E||!p[E]?a:k.length>1?{type:p[E],data:k.substring(1)}:{type:p[E]}}var C=new Uint8Array(k),E=C[0],v=n(k,1);return s&&S==="blob"&&(v=new s([v])),{type:p[E],data:v}};function B(k){try{k=i.decode(k,{strict:!1})}catch{return!1}return k}t.decodeBase64Packet=function(k,S){var m=p[k.charAt(0)];if(!u)return{type:m,data:{base64:!0,data:k.substr(1)}};var C=u.decode(k.substr(1));return S==="blob"&&s&&(C=new s([C])),{type:m,data:C}},t.encodePayload=function(k,S,m){typeof S=="function"&&(m=S,S=null);var C=r(k);if(S&&C)return s&&!c?t.encodePayloadAsBlob(k,m):t.encodePayloadAsArrayBuffer(k,m);if(!k.length)return m("0:");function E(b){return b.length+":"+b}function v(b,T){t.encodePacket(b,C?S:!1,!1,function(O){T(null,E(O))})}_(k,v,function(b,T){return m(T.join(""))})};function _(k,S,m){for(var C=new Array(k.length),E=o(k.length,m),v=function(T,O,x){S(O,function(A,q){C[T]=q,x(A,C)})},b=0;b<k.length;b++)v(b,k[b],E)}t.decodePayload=function(k,S,m){if(typeof k!="string")return t.decodePayloadAsBinary(k,S,m);typeof S=="function"&&(m=S,S=null);var C;if(k==="")return m(a,0,1);for(var E="",v,b,T=0,O=k.length;T<O;T++){var x=k.charAt(T);if(x!==":"){E+=x;continue}if(E===""||E!=(v=Number(E))||(b=k.substr(T+1,v),E!=b.length))return m(a,0,1);if(b.length){if(C=t.decodePacket(b,S,!1),a.type===C.type&&a.data===C.data)return m(a,0,1);var A=m(C,T+v,O);if(A===!1)return}T+=v,E=""}if(E!=="")return m(a,0,1)},t.encodePayloadAsArrayBuffer=function(k,S){if(!k.length)return S(new ArrayBuffer(0));function m(C,E){t.encodePacket(C,!0,!0,function(v){return E(null,v)})}_(k,m,function(C,E){var v=E.reduce(function(O,x){var A;return typeof x=="string"?A=x.length:A=x.byteLength,O+A.toString().length+A+2},0),b=new Uint8Array(v),T=0;return E.forEach(function(O){var x=typeof O=="string",A=O;if(x){for(var q=new Uint8Array(O.length),j=0;j<O.length;j++)q[j]=O.charCodeAt(j);A=q.buffer}x?b[T++]=0:b[T++]=1;for(var $=A.byteLength.toString(),j=0;j<$.length;j++)b[T++]=parseInt($[j]);b[T++]=255;for(var q=new Uint8Array(A),j=0;j<q.length;j++)b[T++]=q[j]}),S(b.buffer)})},t.encodePayloadAsBlob=function(k,S){function m(C,E){t.encodePacket(C,!0,!0,function(v){var b=new Uint8Array(1);if(b[0]=1,typeof v=="string"){for(var T=new Uint8Array(v.length),O=0;O<v.length;O++)T[O]=v.charCodeAt(O);v=T.buffer,b[0]=0}for(var x=v instanceof ArrayBuffer?v.byteLength:v.size,A=x.toString(),q=new Uint8Array(A.length+1),O=0;O<A.length;O++)q[O]=parseInt(A[O]);if(q[A.length]=255,s){var j=new s([b.buffer,q.buffer,v]);E(null,j)}})}_(k,m,function(C,E){return S(new s(E))})},t.decodePayloadAsBinary=function(k,S,m){typeof S=="function"&&(m=S,S=null);for(var C=k,E=[];C.byteLength>0;){for(var v=new Uint8Array(C),b=v[0]===0,T="",O=1;v[O]!==255;O++){if(T.length>310)return m(a,0,1);T+=v[O]}C=n(C,2+T.length),T=parseInt(T);var x=n(C,0,T);if(b)try{x=String.fromCharCode.apply(null,new Uint8Array(x))}catch{var A=new Uint8Array(x);x="";for(var O=0;O<A.length;O++)x+=String.fromCharCode(A[O])}E.push(x),C=n(C,T)}var q=E.length;E.forEach(function(j,$){m(t.decodePacket(j,S,!0),$,q)})}})(bt);var ie,je;function Ae(){if(je)return ie;je=1;var t=bt,e=St;ie=r;function r(n){this.path=n.path,this.hostname=n.hostname,this.port=n.port,this.secure=n.secure,this.query=n.query,this.timestampParam=n.timestampParam,this.timestampRequests=n.timestampRequests,this.readyState="",this.agent=n.agent||!1,this.socket=n.socket,this.enablesXDR=n.enablesXDR,this.withCredentials=n.withCredentials,this.pfx=n.pfx,this.key=n.key,this.passphrase=n.passphrase,this.cert=n.cert,this.ca=n.ca,this.ciphers=n.ciphers,this.rejectUnauthorized=n.rejectUnauthorized,this.forceNode=n.forceNode,this.isReactNative=n.isReactNative,this.extraHeaders=n.extraHeaders,this.localAddress=n.localAddress}return e(r.prototype),r.prototype.onError=function(n,o){var i=new Error(n);return i.type="TransportError",i.description=o,this.emit("error",i),this},r.prototype.open=function(){return(this.readyState==="closed"||this.readyState==="")&&(this.readyState="opening",this.doOpen()),this},r.prototype.close=function(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this},r.prototype.send=function(n){if(this.readyState==="open")this.write(n);else throw new Error("Transport not open")},r.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},r.prototype.onData=function(n){var o=t.decodePacket(n,this.socket.binaryType);this.onPacket(o)},r.prototype.onPacket=function(n){this.emit("packet",n)},r.prototype.onClose=function(){this.readyState="closed",this.emit("close")},ie}var Et={};Et.encode=function(t){var e="";for(var r in t)t.hasOwnProperty(r)&&(e.length&&(e+="&"),e+=encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return e};Et.decode=function(t){for(var e={},r=t.split("&"),n=0,o=r.length;n<o;n++){var i=r[n].split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e};var Vt=function(t,e){var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t},cr="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Xt=64,hr={},Me=0,mt=0,qe;function ge(t){var e="";do e=cr[t%Xt]+e,t=Math.floor(t/Xt);while(t>0);return e}function xn(t){var e=0;for(mt=0;mt<t.length;mt++)e=e*Xt+hr[t.charAt(mt)];return e}function Te(){var t=ge(+new Date);return t!==qe?(Me=0,qe=t):t+"."+ge(Me++)}for(;mt<Xt;mt++)hr[cr[mt]]=mt;Te.encode=ge;Te.decode=xn;var pr=Te,ur=Ae(),Rn=Et,lr=bt,In=Vt,Bn=pr,ht=lt("engine.io-client:polling"),fr=pt,_n=function(){var t=Se,e=new t({xdomain:!1});return e.responseType!=null}();function pt(t){var e=t&&t.forceBase64;(!_n||e)&&(this.supportsBinary=!1),ur.call(this,t)}In(pt,ur);pt.prototype.name="polling";pt.prototype.doOpen=function(){this.poll()};pt.prototype.pause=function(t){var e=this;this.readyState="pausing";function r(){ht("paused"),e.readyState="paused",t()}if(this.polling||!this.writable){var n=0;this.polling&&(ht("we are currently polling - waiting to pause"),n++,this.once("pollComplete",function(){ht("pre-pause polling complete"),--n||r()})),this.writable||(ht("we are currently writing - waiting to pause"),n++,this.once("drain",function(){ht("pre-pause writing complete"),--n||r()}))}else r()};pt.prototype.poll=function(){ht("polling"),this.polling=!0,this.doPoll(),this.emit("poll")};pt.prototype.onData=function(t){var e=this;ht("polling got data %s",t);var r=function(n,o,i){if(e.readyState==="opening"&&n.type==="open"&&e.onOpen(),n.type==="close")return e.onClose(),!1;e.onPacket(n)};lr.decodePayload(t,this.socket.binaryType,r),this.readyState!=="closed"&&(this.polling=!1,this.emit("pollComplete"),this.readyState==="open"?this.poll():ht('ignoring poll - transport state "%s"',this.readyState))};pt.prototype.doClose=function(){var t=this;function e(){ht("writing close packet"),t.write([{type:"close"}])}this.readyState==="open"?(ht("transport open - closing"),e()):(ht("transport not open - deferring close"),this.once("open",e))};pt.prototype.write=function(t){var e=this;this.writable=!1;var r=function(){e.writable=!0,e.emit("drain")};lr.encodePayload(t,this.supportsBinary,function(n){e.doWrite(n,r)})};pt.prototype.uri=function(){var t=this.query||{},e=this.secure?"https":"http",r="";this.timestampRequests!==!1&&(t[this.timestampParam]=Bn()),!this.supportsBinary&&!t.sid&&(t.b64=1),t=Rn.encode(t),this.port&&(e==="https"&&Number(this.port)!==443||e==="http"&&Number(this.port)!==80)&&(r=":"+this.port),t.length&&(t="?"+t);var n=this.hostname.indexOf(":")!==-1;return e+"://"+(n?"["+this.hostname+"]":this.hostname)+r+this.path+t};var Ln=Se,dr=fr,Un=St,Dn=Vt,me=lt("engine.io-client:polling-xhr"),Pn=we;Ee.exports=At;Ee.exports.Request=Y;function ze(){}function At(t){if(dr.call(this,t),this.requestTimeout=t.requestTimeout,this.extraHeaders=t.extraHeaders,typeof location<"u"){var e=location.protocol==="https:",r=location.port;r||(r=e?443:80),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port,this.xs=t.secure!==e}}Dn(At,dr);At.prototype.supportsBinary=!0;At.prototype.request=function(t){return t=t||{},t.uri=this.uri(),t.xd=this.xd,t.xs=this.xs,t.agent=this.agent||!1,t.supportsBinary=this.supportsBinary,t.enablesXDR=this.enablesXDR,t.withCredentials=this.withCredentials,t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized,t.requestTimeout=this.requestTimeout,t.extraHeaders=this.extraHeaders,new Y(t)};At.prototype.doWrite=function(t,e){var r=typeof t!="string"&&t!==void 0,n=this.request({method:"POST",data:t,isBinary:r}),o=this;n.on("success",e),n.on("error",function(i){o.onError("xhr post error",i)}),this.sendXhr=n};At.prototype.doPoll=function(){me("xhr poll");var t=this.request(),e=this;t.on("data",function(r){e.onData(r)}),t.on("error",function(r){e.onError("xhr poll error",r)}),this.pollXhr=t};function Y(t){this.method=t.method||"GET",this.uri=t.uri,this.xd=!!t.xd,this.xs=!!t.xs,this.async=t.async!==!1,this.data=t.data!==void 0?t.data:null,this.agent=t.agent,this.isBinary=t.isBinary,this.supportsBinary=t.supportsBinary,this.enablesXDR=t.enablesXDR,this.withCredentials=t.withCredentials,this.requestTimeout=t.requestTimeout,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.extraHeaders=t.extraHeaders,this.create()}Un(Y.prototype);Y.prototype.create=function(){var t={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized;var e=this.xhr=new Ln(t),r=this;try{me("xhr open %s: %s",this.method,this.uri),e.open(this.method,this.uri,this.async);try{if(this.extraHeaders){e.setDisableHeaderCheck&&e.setDisableHeaderCheck(!0);for(var n in this.extraHeaders)this.extraHeaders.hasOwnProperty(n)&&e.setRequestHeader(n,this.extraHeaders[n])}}catch{}if(this.method==="POST")try{this.isBinary?e.setRequestHeader("Content-type","application/octet-stream"):e.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{e.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in e&&(e.withCredentials=this.withCredentials),this.requestTimeout&&(e.timeout=this.requestTimeout),this.hasXDR()?(e.onload=function(){r.onLoad()},e.onerror=function(){r.onError(e.responseText)}):e.onreadystatechange=function(){if(e.readyState===2)try{var o=e.getResponseHeader("Content-Type");(r.supportsBinary&&o==="application/octet-stream"||o==="application/octet-stream; charset=UTF-8")&&(e.responseType="arraybuffer")}catch{}e.readyState===4&&(e.status===200||e.status===1223?r.onLoad():setTimeout(function(){r.onError(typeof e.status=="number"?e.status:0)},0))},me("xhr data %s",this.data),e.send(this.data)}catch(o){setTimeout(function(){r.onError(o)},0);return}typeof document<"u"&&(this.index=Y.requestsCount++,Y.requests[this.index]=this)};Y.prototype.onSuccess=function(){this.emit("success"),this.cleanup()};Y.prototype.onData=function(t){this.emit("data",t),this.onSuccess()};Y.prototype.onError=function(t){this.emit("error",t),this.cleanup(!0)};Y.prototype.cleanup=function(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=ze:this.xhr.onreadystatechange=ze,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Y.requests[this.index],this.xhr=null}};Y.prototype.onLoad=function(){var t;try{var e;try{e=this.xhr.getResponseHeader("Content-Type")}catch{}e==="application/octet-stream"||e==="application/octet-stream; charset=UTF-8"?t=this.xhr.response||this.xhr.responseText:t=this.xhr.responseText}catch(r){this.onError(r)}t!=null&&this.onData(t)};Y.prototype.hasXDR=function(){return typeof XDomainRequest<"u"&&!this.xs&&this.enablesXDR};Y.prototype.abort=function(){this.cleanup()};Y.requestsCount=0;Y.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Xe);else if(typeof addEventListener=="function"){var Fn="onpagehide"in Pn?"pagehide":"unload";addEventListener(Fn,Xe,!1)}}function Xe(){for(var t in Y.requests)Y.requests.hasOwnProperty(t)&&Y.requests[t].abort()}var jn=Ee.exports,Ne=fr,Mn=Vt,We=we,qn=Tt,zn=/\n/g,Xn=/\\n/g,Ft;function Wn(){}function Tt(t){Ne.call(this,t),this.query=this.query||{},Ft||(Ft=We.___eio=We.___eio||[]),this.index=Ft.length;var e=this;Ft.push(function(r){e.onData(r)}),this.query.j=this.index,typeof addEventListener=="function"&&addEventListener("beforeunload",function(){e.script&&(e.script.onerror=Wn)},!1)}Mn(Tt,Ne);Tt.prototype.supportsBinary=!1;Tt.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),Ne.prototype.doClose.call(this)};Tt.prototype.doPoll=function(){var t=this,e=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),e.async=!0,e.src=this.uri(),e.onerror=function(o){t.onError("jsonp poll error",o)};var r=document.getElementsByTagName("script")[0];r?r.parentNode.insertBefore(e,r):(document.head||document.body).appendChild(e),this.script=e;var n=typeof navigator<"u"&&/gecko/i.test(navigator.userAgent);n&&setTimeout(function(){var o=document.createElement("iframe");document.body.appendChild(o),document.body.removeChild(o)},100)};Tt.prototype.doWrite=function(t,e){var r=this;if(!this.form){var n=document.createElement("form"),o=document.createElement("textarea"),i=this.iframeId="eio_iframe_"+this.index,u;n.className="socketio",n.style.position="absolute",n.style.top="-1000px",n.style.left="-1000px",n.target=i,n.method="POST",n.setAttribute("accept-charset","utf-8"),o.name="d",n.appendChild(o),document.body.appendChild(n),this.form=n,this.area=o}this.form.action=this.uri();function h(){d(),e()}function d(){if(r.iframe)try{r.form.removeChild(r.iframe)}catch(l){r.onError("jsonp polling iframe removal error",l)}try{var c='<iframe src="javascript:0" name="'+r.iframeId+'">';u=document.createElement(c)}catch{u=document.createElement("iframe"),u.name=r.iframeId,u.src="javascript:0"}u.id=r.iframeId,r.form.appendChild(u),r.iframe=u}d(),t=t.replace(Xn,`\\
7
- `),this.area.value=t.replace(zn,"\\n");try{this.form.submit()}catch{}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){r.iframe.readyState==="complete"&&h()}:this.iframe.onload=h};const Kn={},Hn=Object.freeze(Object.defineProperty({__proto__:null,default:Kn},Symbol.toStringTag,{value:"Module"})),Jn=zr(Hn);var Oe=Ae(),Vn=bt,$n=Et,Gn=Vt,Yn=pr,Qn=lt("engine.io-client:websocket"),Wt,xe;typeof WebSocket<"u"?Wt=WebSocket:typeof self<"u"&&(Wt=self.WebSocket||self.MozWebSocket);if(typeof window>"u")try{xe=Jn}catch{}var wt=Wt||xe,Zn=it;function it(t){var e=t&&t.forceBase64;e&&(this.supportsBinary=!1),this.perMessageDeflate=t.perMessageDeflate,this.usingBrowserWebSocket=Wt&&!t.forceNode,this.protocols=t.protocols,this.usingBrowserWebSocket||(wt=xe),Oe.call(this,t)}Gn(it,Oe);it.prototype.name="websocket";it.prototype.supportsBinary=!0;it.prototype.doOpen=function(){if(this.check()){var t=this.uri(),e=this.protocols,r={};this.isReactNative||(r.agent=this.agent,r.perMessageDeflate=this.perMessageDeflate,r.pfx=this.pfx,r.key=this.key,r.passphrase=this.passphrase,r.cert=this.cert,r.ca=this.ca,r.ciphers=this.ciphers,r.rejectUnauthorized=this.rejectUnauthorized),this.extraHeaders&&(r.headers=this.extraHeaders),this.localAddress&&(r.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket&&!this.isReactNative?e?new wt(t,e):new wt(t):new wt(t,e,r)}catch(n){return this.emit("error",n)}this.ws.binaryType===void 0&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}};it.prototype.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.onOpen()},this.ws.onclose=function(){t.onClose()},this.ws.onmessage=function(e){t.onData(e.data)},this.ws.onerror=function(e){t.onError("websocket error",e)}};it.prototype.write=function(t){var e=this;this.writable=!1;for(var r=t.length,n=0,o=r;n<o;n++)(function(u){Vn.encodePacket(u,e.supportsBinary,function(h){if(!e.usingBrowserWebSocket){var d={};if(u.options&&(d.compress=u.options.compress),e.perMessageDeflate){var c=typeof h=="string"?Buffer.byteLength(h):h.length;c<e.perMessageDeflate.threshold&&(d.compress=!1)}}try{e.usingBrowserWebSocket?e.ws.send(h):e.ws.send(h,d)}catch{Qn("websocket closed before onclose event")}--r||i()})})(t[n]);function i(){e.emit("flush"),setTimeout(function(){e.writable=!0,e.emit("drain")},0)}};it.prototype.onClose=function(){Oe.prototype.onClose.call(this)};it.prototype.doClose=function(){typeof this.ws<"u"&&this.ws.close()};it.prototype.uri=function(){var t=this.query||{},e=this.secure?"wss":"ws",r="";this.port&&(e==="wss"&&Number(this.port)!==443||e==="ws"&&Number(this.port)!==80)&&(r=":"+this.port),this.timestampRequests&&(t[this.timestampParam]=Yn()),this.supportsBinary||(t.b64=1),t=$n.encode(t),t.length&&(t="?"+t);var n=this.hostname.indexOf(":")!==-1;return e+"://"+(n?"["+this.hostname+"]":this.hostname)+r+this.path+t};it.prototype.check=function(){return!!wt&&!("__initialize"in wt&&this.name===it.prototype.name)};var to=Se,eo=jn,ro=qn,no=Zn;Jt.polling=oo;Jt.websocket=no;function oo(t){var e,r=!1,n=!1,o=t.jsonp!==!1;if(typeof location<"u"){var i=location.protocol==="https:",u=location.port;u||(u=i?443:80),r=t.hostname!==location.hostname||u!==t.port,n=t.secure!==i}if(t.xdomain=r,t.xscheme=n,e=new to(t),"open"in e&&!t.forceJSONP)return new eo(t);if(!o)throw new Error("JSONP disabled");return new ro(t)}var so=[].indexOf,yr=function(t,e){if(so)return t.indexOf(e);for(var r=0;r<t.length;++r)if(t[r]===e)return r;return-1},io=Jt,ao=St,G=lt("engine.io-client:socket"),co=yr,gr=bt,Ke=Ze,ho=Et,po=W;function W(t,e){if(!(this instanceof W))return new W(t,e);e=e||{},t&&typeof t=="object"&&(e=t,t=null),t?(t=Ke(t),e.hostname=t.host,e.secure=t.protocol==="https"||t.protocol==="wss",e.port=t.port,t.query&&(e.query=t.query)):e.host&&(e.hostname=Ke(e.host).host),this.secure=e.secure!=null?e.secure:typeof location<"u"&&location.protocol==="https:",e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.agent=e.agent||!1,this.hostname=e.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=e.port||(typeof location<"u"&&location.port?location.port:this.secure?443:80),this.query=e.query||{},typeof this.query=="string"&&(this.query=ho.decode(this.query)),this.upgrade=e.upgrade!==!1,this.path=(e.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!e.forceJSONP,this.jsonp=e.jsonp!==!1,this.forceBase64=!!e.forceBase64,this.enablesXDR=!!e.enablesXDR,this.withCredentials=e.withCredentials!==!1,this.timestampParam=e.timestampParam||"t",this.timestampRequests=e.timestampRequests,this.transports=e.transports||["polling","websocket"],this.transportOptions=e.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=e.policyPort||843,this.rememberUpgrade=e.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=e.onlyBinaryUpgrades,this.perMessageDeflate=e.perMessageDeflate!==!1?e.perMessageDeflate||{}:!1,this.perMessageDeflate===!0&&(this.perMessageDeflate={}),this.perMessageDeflate&&this.perMessageDeflate.threshold==null&&(this.perMessageDeflate.threshold=1024),this.pfx=e.pfx||void 0,this.key=e.key||void 0,this.passphrase=e.passphrase||void 0,this.cert=e.cert||void 0,this.ca=e.ca||void 0,this.ciphers=e.ciphers||void 0,this.rejectUnauthorized=e.rejectUnauthorized===void 0?!0:e.rejectUnauthorized,this.forceNode=!!e.forceNode,this.isReactNative=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",(typeof self>"u"||this.isReactNative)&&(e.extraHeaders&&Object.keys(e.extraHeaders).length>0&&(this.extraHeaders=e.extraHeaders),e.localAddress&&(this.localAddress=e.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}W.priorWebsocketSuccess=!1;ao(W.prototype);W.protocol=gr.protocol;W.Socket=W;W.Transport=Ae();W.transports=Jt;W.parser=bt;W.prototype.createTransport=function(t){G('creating transport "%s"',t);var e=uo(this.query);e.EIO=gr.protocol,e.transport=t;var r=this.transportOptions[t]||{};this.id&&(e.sid=this.id);var n=new io[t]({query:e,socket:this,agent:r.agent||this.agent,hostname:r.hostname||this.hostname,port:r.port||this.port,secure:r.secure||this.secure,path:r.path||this.path,forceJSONP:r.forceJSONP||this.forceJSONP,jsonp:r.jsonp||this.jsonp,forceBase64:r.forceBase64||this.forceBase64,enablesXDR:r.enablesXDR||this.enablesXDR,withCredentials:r.withCredentials||this.withCredentials,timestampRequests:r.timestampRequests||this.timestampRequests,timestampParam:r.timestampParam||this.timestampParam,policyPort:r.policyPort||this.policyPort,pfx:r.pfx||this.pfx,key:r.key||this.key,passphrase:r.passphrase||this.passphrase,cert:r.cert||this.cert,ca:r.ca||this.ca,ciphers:r.ciphers||this.ciphers,rejectUnauthorized:r.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:r.perMessageDeflate||this.perMessageDeflate,extraHeaders:r.extraHeaders||this.extraHeaders,forceNode:r.forceNode||this.forceNode,localAddress:r.localAddress||this.localAddress,requestTimeout:r.requestTimeout||this.requestTimeout,protocols:r.protocols||void 0,isReactNative:this.isReactNative});return n};function uo(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}W.prototype.open=function(){var t;if(this.rememberUpgrade&&W.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){var e=this;setTimeout(function(){e.emit("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)};W.prototype.setTransport=function(t){G("setting transport %s",t.name);var e=this;this.transport&&(G("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=t,t.on("drain",function(){e.onDrain()}).on("packet",function(r){e.onPacket(r)}).on("error",function(r){e.onError(r)}).on("close",function(){e.onClose("transport close")})};W.prototype.probe=function(t){G('probing transport "%s"',t);var e=this.createTransport(t,{probe:1}),r=!1,n=this;W.priorWebsocketSuccess=!1;function o(){if(n.onlyBinaryUpgrades){var p=!this.supportsBinary&&n.transport.supportsBinary;r=r||p}r||(G('probe transport "%s" opened',t),e.send([{type:"ping",data:"probe"}]),e.once("packet",function(a){if(!r)if(a.type==="pong"&&a.data==="probe"){if(G('probe transport "%s" pong',t),n.upgrading=!0,n.emit("upgrading",e),!e)return;W.priorWebsocketSuccess=e.name==="websocket",G('pausing current transport "%s"',n.transport.name),n.transport.pause(function(){r||n.readyState!=="closed"&&(G("changing transport and sending upgrade packet"),l(),n.setTransport(e),e.send([{type:"upgrade"}]),n.emit("upgrade",e),e=null,n.upgrading=!1,n.flush())})}else{G('probe transport "%s" failed',t);var s=new Error("probe error");s.transport=e.name,n.emit("upgradeError",s)}}))}function i(){r||(r=!0,l(),e.close(),e=null)}function u(p){var a=new Error("probe error: "+p);a.transport=e.name,i(),G('probe transport "%s" failed because of error: %s',t,p),n.emit("upgradeError",a)}function h(){u("transport closed")}function d(){u("socket closed")}function c(p){e&&p.name!==e.name&&(G('"%s" works - aborting "%s"',p.name,e.name),i())}function l(){e.removeListener("open",o),e.removeListener("error",u),e.removeListener("close",h),n.removeListener("close",d),n.removeListener("upgrading",c)}e.once("open",o),e.once("error",u),e.once("close",h),this.once("close",d),this.once("upgrading",c),e.open()};W.prototype.onOpen=function(){if(G("socket open"),this.readyState="open",W.priorWebsocketSuccess=this.transport.name==="websocket",this.emit("open"),this.flush(),this.readyState==="open"&&this.upgrade&&this.transport.pause){G("starting upgrade probes");for(var t=0,e=this.upgrades.length;t<e;t++)this.probe(this.upgrades[t])}};W.prototype.onPacket=function(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(G('socket receive: type "%s", data "%s"',t.type,t.data),this.emit("packet",t),this.emit("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var e=new Error("server error");e.code=t.data,this.onError(e);break;case"message":this.emit("data",t.data),this.emit("message",t.data);break}else G('packet received with socket readyState "%s"',this.readyState)};W.prototype.onHandshake=function(t){this.emit("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.onOpen(),this.readyState!=="closed"&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))};W.prototype.onHeartbeat=function(t){clearTimeout(this.pingTimeoutTimer);var e=this;e.pingTimeoutTimer=setTimeout(function(){e.readyState!=="closed"&&e.onClose("ping timeout")},t||e.pingInterval+e.pingTimeout)};W.prototype.setPing=function(){var t=this;clearTimeout(t.pingIntervalTimer),t.pingIntervalTimer=setTimeout(function(){G("writing ping packet - expecting pong within %sms",t.pingTimeout),t.ping(),t.onHeartbeat(t.pingTimeout)},t.pingInterval)};W.prototype.ping=function(){var t=this;this.sendPacket("ping",function(){t.emit("ping")})};W.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emit("drain"):this.flush()};W.prototype.flush=function(){this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(G("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))};W.prototype.write=W.prototype.send=function(t,e,r){return this.sendPacket("message",t,e,r),this};W.prototype.sendPacket=function(t,e,r,n){if(typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r=null),!(this.readyState==="closing"||this.readyState==="closed")){r=r||{},r.compress=r.compress!==!1;var o={type:t,data:e,options:r};this.emit("packetCreate",o),this.writeBuffer.push(o),n&&this.once("flush",n),this.flush()}};W.prototype.close=function(){if(this.readyState==="opening"||this.readyState==="open"){this.readyState="closing";var t=this;this.writeBuffer.length?this.once("drain",function(){this.upgrading?n():e()}):this.upgrading?n():e()}function e(){t.onClose("forced close"),G("socket closing - telling transport to close"),t.transport.close()}function r(){t.removeListener("upgrade",r),t.removeListener("upgradeError",r),e()}function n(){t.once("upgrade",r),t.once("upgradeError",r)}return this};W.prototype.onError=function(t){G("socket error %j",t),W.priorWebsocketSuccess=!1,this.emit("error",t),this.onClose("transport error",t)};W.prototype.onClose=function(t,e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){G('socket close with reason: "%s"',t);var r=this;clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",t,e),r.writeBuffer=[],r.prevBufferLen=0}};W.prototype.filterUpgrades=function(t){for(var e=[],r=0,n=t.length;r<n;r++)~co(this.transports,t[r])&&e.push(t[r]);return e};Ce.exports=po;Ce.exports.parser=bt;var lo=Ce.exports,mr={exports:{}},fo=yo;function yo(t,e){var r=[];e=e||0;for(var n=e||0;n<t.length;n++)r[n-e]=t[n];return r}var vr=go;function go(t,e,r){return t.on(e,r),{destroy:function(){t.removeListener(e,r)}}}var He=[].slice,br=function(t,e){if(typeof e=="string"&&(e=t[e]),typeof e!="function")throw new Error("bind() requires a function");var r=He.call(arguments,2);return function(){return e.apply(t,r.concat(He.call(arguments)))}};(function(t,e){var r=Kt,n=St,o=fo,i=vr,u=br,h=lt("socket.io-client:socket"),d=Et,c=sr;t.exports=a;var l={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},p=n.prototype.emit;function a(s,f,y){this.io=s,this.nsp=f,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,this.flags={},y&&y.query&&(this.query=y.query),this.io.autoConnect&&this.open()}n(a.prototype),a.prototype.subEvents=function(){if(!this.subs){var s=this.io;this.subs=[i(s,"open",u(this,"onopen")),i(s,"packet",u(this,"onpacket")),i(s,"close",u(this,"onclose"))]}},a.prototype.open=a.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.reconnecting||this.io.open(),this.io.readyState==="open"&&this.onopen(),this.emit("connecting"),this)},a.prototype.send=function(){var s=o(arguments);return s.unshift("message"),this.emit.apply(this,s),this},a.prototype.emit=function(s){if(l.hasOwnProperty(s))return p.apply(this,arguments),this;var f=o(arguments),y={type:(this.flags.binary!==void 0?this.flags.binary:c(f))?r.BINARY_EVENT:r.EVENT,data:f};return y.options={},y.options.compress=!this.flags||this.flags.compress!==!1,typeof f[f.length-1]=="function"&&(h("emitting packet with ack id %d",this.ids),this.acks[this.ids]=f.pop(),y.id=this.ids++),this.connected?this.packet(y):this.sendBuffer.push(y),this.flags={},this},a.prototype.packet=function(s){s.nsp=this.nsp,this.io.packet(s)},a.prototype.onopen=function(){if(h("transport is open - connecting"),this.nsp!=="/")if(this.query){var s=typeof this.query=="object"?d.encode(this.query):this.query;h("sending connect packet with query %s",s),this.packet({type:r.CONNECT,query:s})}else this.packet({type:r.CONNECT})},a.prototype.onclose=function(s){h("close (%s)",s),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",s)},a.prototype.onpacket=function(s){var f=s.nsp===this.nsp,y=s.type===r.ERROR&&s.nsp==="/";if(!(!f&&!y))switch(s.type){case r.CONNECT:this.onconnect();break;case r.EVENT:this.onevent(s);break;case r.BINARY_EVENT:this.onevent(s);break;case r.ACK:this.onack(s);break;case r.BINARY_ACK:this.onack(s);break;case r.DISCONNECT:this.ondisconnect();break;case r.ERROR:this.emit("error",s.data);break}},a.prototype.onevent=function(s){var f=s.data||[];h("emitting event %j",f),s.id!=null&&(h("attaching ack callback to event"),f.push(this.ack(s.id))),this.connected?p.apply(this,f):this.receiveBuffer.push(f)},a.prototype.ack=function(s){var f=this,y=!1;return function(){if(!y){y=!0;var g=o(arguments);h("sending ack %j",g),f.packet({type:c(g)?r.BINARY_ACK:r.ACK,id:s,data:g})}}},a.prototype.onack=function(s){var f=this.acks[s.id];typeof f=="function"?(h("calling ack %s with %j",s.id,s.data),f.apply(this,s.data),delete this.acks[s.id]):h("bad ack %s",s.id)},a.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emitBuffered(),this.emit("connect")},a.prototype.emitBuffered=function(){var s;for(s=0;s<this.receiveBuffer.length;s++)p.apply(this,this.receiveBuffer[s]);for(this.receiveBuffer=[],s=0;s<this.sendBuffer.length;s++)this.packet(this.sendBuffer[s]);this.sendBuffer=[]},a.prototype.ondisconnect=function(){h("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},a.prototype.destroy=function(){if(this.subs){for(var s=0;s<this.subs.length;s++)this.subs[s].destroy();this.subs=null}this.io.destroy(this)},a.prototype.close=a.prototype.disconnect=function(){return this.connected&&(h("performing disconnect (%s)",this.nsp),this.packet({type:r.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},a.prototype.compress=function(s){return this.flags.compress=s,this},a.prototype.binary=function(s){return this.flags.binary=s,this}})(mr);var kr=mr.exports,mo=Nt;function Nt(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Nt.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),r=Math.floor(e*this.jitter*t);t=Math.floor(e*10)&1?t+r:t-r}return Math.min(t,this.max)|0};Nt.prototype.reset=function(){this.attempts=0};Nt.prototype.setMin=function(t){this.ms=t};Nt.prototype.setMax=function(t){this.max=t};Nt.prototype.setJitter=function(t){this.jitter=t};var vo=lo,bo=kr,ko=St,Co=Kt,ft=vr,Ct=br,Z=lt("socket.io-client:manager"),Cr=yr,wo=mo,wr=Object.prototype.hasOwnProperty,Je=K;function K(t,e){if(!(this instanceof K))return new K(t,e);t&&typeof t=="object"&&(e=t,t=void 0),e=e||{},e.path=e.path||"/socket.io",this.nsps={},this.subs=[],this.opts=e,this.reconnection(e.reconnection!==!1),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor(e.randomizationFactor||.5),this.backoff=new wo({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(e.timeout==null?2e4:e.timeout),this.readyState="closed",this.uri=t,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var r=e.parser||Co;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this.autoConnect=e.autoConnect!==!1,this.autoConnect&&this.open()}K.prototype.emitAll=function(){this.emit.apply(this,arguments);for(var t in this.nsps)wr.call(this.nsps,t)&&this.nsps[t].emit.apply(this.nsps[t],arguments)};K.prototype.updateSocketIds=function(){for(var t in this.nsps)wr.call(this.nsps,t)&&(this.nsps[t].id=this.generateId(t))};K.prototype.generateId=function(t){return(t==="/"?"":t+"#")+this.engine.id};ko(K.prototype);K.prototype.reconnection=function(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection};K.prototype.reconnectionAttempts=function(t){return arguments.length?(this._reconnectionAttempts=t,this):this._reconnectionAttempts};K.prototype.reconnectionDelay=function(t){return arguments.length?(this._reconnectionDelay=t,this.backoff&&this.backoff.setMin(t),this):this._reconnectionDelay};K.prototype.randomizationFactor=function(t){return arguments.length?(this._randomizationFactor=t,this.backoff&&this.backoff.setJitter(t),this):this._randomizationFactor};K.prototype.reconnectionDelayMax=function(t){return arguments.length?(this._reconnectionDelayMax=t,this.backoff&&this.backoff.setMax(t),this):this._reconnectionDelayMax};K.prototype.timeout=function(t){return arguments.length?(this._timeout=t,this):this._timeout};K.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()};K.prototype.open=K.prototype.connect=function(t,e){if(Z("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;Z("opening %s",this.uri),this.engine=vo(this.uri,this.opts);var r=this.engine,n=this;this.readyState="opening",this.skipReconnect=!1;var o=ft(r,"open",function(){n.onopen(),t&&t()}),i=ft(r,"error",function(d){if(Z("connect_error"),n.cleanup(),n.readyState="closed",n.emitAll("connect_error",d),t){var c=new Error("Connection error");c.data=d,t(c)}else n.maybeReconnectOnOpen()});if(this._timeout!==!1){var u=this._timeout;Z("connect attempt will timeout after %d",u),u===0&&o.destroy();var h=setTimeout(function(){Z("connect attempt timed out after %d",u),o.destroy(),r.close(),r.emit("error","timeout"),n.emitAll("connect_timeout",u)},u);this.subs.push({destroy:function(){clearTimeout(h)}})}return this.subs.push(o),this.subs.push(i),this};K.prototype.onopen=function(){Z("open"),this.cleanup(),this.readyState="open",this.emit("open");var t=this.engine;this.subs.push(ft(t,"data",Ct(this,"ondata"))),this.subs.push(ft(t,"ping",Ct(this,"onping"))),this.subs.push(ft(t,"pong",Ct(this,"onpong"))),this.subs.push(ft(t,"error",Ct(this,"onerror"))),this.subs.push(ft(t,"close",Ct(this,"onclose"))),this.subs.push(ft(this.decoder,"decoded",Ct(this,"ondecoded")))};K.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")};K.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)};K.prototype.ondata=function(t){this.decoder.add(t)};K.prototype.ondecoded=function(t){this.emit("packet",t)};K.prototype.onerror=function(t){Z("error",t),this.emitAll("error",t)};K.prototype.socket=function(t,e){var r=this.nsps[t];if(!r){r=new bo(this,t,e),this.nsps[t]=r;var n=this;r.on("connecting",o),r.on("connect",function(){r.id=n.generateId(t)}),this.autoConnect&&o()}function o(){~Cr(n.connecting,r)||n.connecting.push(r)}return r};K.prototype.destroy=function(t){var e=Cr(this.connecting,t);~e&&this.connecting.splice(e,1),!this.connecting.length&&this.close()};K.prototype.packet=function(t){Z("writing packet %j",t);var e=this;t.query&&t.type===0&&(t.nsp+="?"+t.query),e.encoding?e.packetBuffer.push(t):(e.encoding=!0,this.encoder.encode(t,function(r){for(var n=0;n<r.length;n++)e.engine.write(r[n],t.options);e.encoding=!1,e.processPacketQueue()}))};K.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var t=this.packetBuffer.shift();this.packet(t)}};K.prototype.cleanup=function(){Z("cleanup");for(var t=this.subs.length,e=0;e<t;e++){var r=this.subs.shift();r.destroy()}this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()};K.prototype.close=K.prototype.disconnect=function(){Z("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,this.readyState==="opening"&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()};K.prototype.onclose=function(t){Z("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",t),this._reconnection&&!this.skipReconnect&&this.reconnect()};K.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var t=this;if(this.backoff.attempts>=this._reconnectionAttempts)Z("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var e=this.backoff.duration();Z("will wait %dms before reconnect attempt",e),this.reconnecting=!0;var r=setTimeout(function(){t.skipReconnect||(Z("attempting reconnect"),t.emitAll("reconnect_attempt",t.backoff.attempts),t.emitAll("reconnecting",t.backoff.attempts),!t.skipReconnect&&t.open(function(n){n?(Z("reconnect attempt error"),t.reconnecting=!1,t.reconnect(),t.emitAll("reconnect_error",n.data)):(Z("reconnect success"),t.onreconnect())}))},e);this.subs.push({destroy:function(){clearTimeout(r)}})}};K.prototype.onreconnect=function(){var t=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",t)};(function(t,e){var r=tn,n=Kt,o=Je,i=lt("socket.io-client");t.exports=e=h;var u=e.managers={};function h(d,c){typeof d=="object"&&(c=d,d=void 0),c=c||{};var l=r(d),p=l.source,a=l.id,s=l.path,f=u[a]&&s in u[a].nsps,y=c.forceNew||c["force new connection"]||c.multiplex===!1||f,g;return y?(i("ignoring socket cache for %s",p),g=o(p,c)):(u[a]||(i("new io instance for %s",p),u[a]=o(p,c)),g=u[a]),l.query&&!c.query&&(c.query=l.query),g.socket(l.path,c)}e.protocol=n.protocol,e.connect=h,e.Manager=Je,e.Socket=kr})(pe,pe.exports);var So=pe.exports;const Eo=qr(So);let jt;const Ao=new Uint8Array(16);function To(){if(!jt&&(jt=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!jt))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return jt(Ao)}const Q=[];for(let t=0;t<256;++t)Q.push((t+256).toString(16).slice(1));function No(t,e=0){return Q[t[e+0]]+Q[t[e+1]]+Q[t[e+2]]+Q[t[e+3]]+"-"+Q[t[e+4]]+Q[t[e+5]]+"-"+Q[t[e+6]]+Q[t[e+7]]+"-"+Q[t[e+8]]+Q[t[e+9]]+"-"+Q[t[e+10]]+Q[t[e+11]]+Q[t[e+12]]+Q[t[e+13]]+Q[t[e+14]]+Q[t[e+15]]}const Oo=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ve={randomUUID:Oo};function xo(t,e,r){if(Ve.randomUUID&&!e&&!t)return Ve.randomUUID();t=t||{};const n=t.random||(t.rng||To)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(let o=0;o<16;++o)e[r+o]=n[o];return e}return No(n)}function Ro(t,e){const r=e.map(o=>JSON.stringify(o)).join(" "),n=new Date().toISOString();return JSON.stringify({level:t,time:n,message:r})}function Io(t,e){const r=JSON.parse(t);return e.forEach(n=>delete r[n]),r}function Bo(t){if(typeof t=="object"&&t!==null)return t;try{return JSON.parse(t)}catch{return{extraData:t}}}function _o(t){const e=/\(([^)]+)\)/,r=t.match(e);if(r&&r[1]){const n=r[1].split(";");for(let o of n)if(o=o.trim(),o.startsWith("Windows")||o.startsWith("Macintosh")||o.startsWith("Linux"))return o}return"Unknown"}function $e(t){return(...e)=>new Promise((r,n)=>{try{const o=t(...e);r(o)}catch(o){n(o)}})}const Lo={reconnection:!0,reconnectionDelay:5e3,reconnectionAttempts:10,upgrade:!1,transports:["websocket"],debug:!1},ae={logToConsole:!0,overloadGlobalConsole:!1,socketEmitInterval:6e4},at={CREATE:"Create",READ:"Read",UPDATE:"Update",DELETE:"Delete",CONVERT:"Convert",DOWNLOAD:"Download",UPLOAD:"Upload",ENCRYPT:"Encrypt",DECRYPT:"Decrypt",FILTER:"Filter",INPUT:"Input",OUTPUT:"Output",PLUGIN:"Plugin",LOGIN:"Login",LOGOUT:"Logout",REFRESH:"Refresh",CHECK:"Check",WEBHOOK:"Webhook",WSCONNECT:"WSConnect"},Uo={Create:1,Read:2,Update:3,Delete:4,Convert:5,Download:6,Upload:7,Encrypt:8,Decrypt:9,Filter:10,Input:11,Output:12,Plugin:13,Login:14,Logout:15,Refresh:16,Check:17,Webhook:18,WSConnect:19},ct={INFO:"info",WARNING:"warning",MODIFY:"modify",ERROR:"error",VIEW:"view"},tt={INFO:"info",WARNING:"warning",ERROR:"error",DEBUG:"debug"};let rt=console;class Do{constructor(e){V(this,"logToConsole"),V(this,"overloadGlobalConsole"),V(this,"system"),V(this,"socketEmitInterval"),V(this,"storageId"),V(this,"emitInProgress"),V(this,"queue"),V(this,"processing"),V(this,"storageInitialized"),V(this,"interval"),V(this,"logIndex"),V(this,"socket"),V(this,"staticObject",{}),V(this,"localObject",{}),V(this,"isGetItemAsync"),V(this,"isSetItemAsync"),V(this,"getItem"),V(this,"setItem"),V(this,"parseLog"),V(this,"_logMethod"),V(this,"_warnMethod"),V(this,"_errorMethod"),V(this,"_debugMethod");const{loggerOptions:r}=e;if(!r.system)throw new Error("Config property 'system' should be provided!");this.isGetItemAsync=r.isGetItemAsync||!1,this.isSetItemAsync=r.isSetItemAsync||!1,this.setupStorageFunctions(r.getItem,r.setItem,r.parseLog),this.system=r.system,this.socketEmitInterval=r.socketEmitInterval||ae.socketEmitInterval,this.logToConsole=r.logToConsole!==void 0?r.logToConsole:ae.logToConsole,this.overloadGlobalConsole=r.overloadGlobalConsole!==void 0?r.overloadGlobalConsole:ae.overloadGlobalConsole,this.storageId=this.getStorageName(),this.queue=[],this.processing=!1,this.storageInitialized=!1,this.emitInProgress=!1,this.logIndex=0,this.init(e)}setupStorageFunctions(e,r,n){this.getItem=e&&typeof e=="function"?this.isGetItemAsync?e:$e(e):this.defaultGetItemFunction,this.setItem=r&&typeof r=="function"?this.isSetItemAsync?r:$e(r):this.defaultSetItemFunction,this.parseLog=n&&typeof n=="function"?n:Ro}init(e){const{socket:r,url:n,socketOptions:o={}}=e;this._logMethod=rt.log.bind(rt),this._warnMethod=rt.warn.bind(rt),this._errorMethod=rt.error.bind(rt),this._debugMethod=rt.debug.bind(rt),this.initStorage().then(()=>{if(r)this.socket=r;else if(n)this.socket=this.createConnection(n,o);else throw new Error("Must provide either a 'socket' or a 'url' for socket connection");this.interval=setInterval(async()=>{await this.emitLogs()},this.socketEmitInterval),this.overloadGlobalConsole&&this._overloadConsole()})}createConnection(e,r={}){const n={...Lo,...r};return Eo(e,n)}async emitLogs(){if(!this.emitInProgress)try{const e=await this.getItem(this.storageId),r=JSON.parse(e||"{}"),n={...this.localObject,...r};if(!Object.keys(n).length)return;const o=[];this.emitInProgress=!0;const i=Object.keys(n);if(!i.length)return;if(!this.socket||!this.socket.connected)throw new Error("Socket is disconnected");for(const d of i){const c=Bo(n[d]),l={...this.staticObject,...c},p=this.populateSendingLog(l);await this.socket.emit("Log",JSON.stringify(p)),o.push(d)}const u=await this.getItem(this.storageId);if(!u)return;const h=Io(u,o);this.localObject={},await this.setItem(this.storageId,JSON.stringify(h))}catch(e){this._errorMethod(e)}finally{this.emitInProgress=!1}}populateSendingLog(e){const r={...e},n=r.ActionName;return n&&(r.ActionID=Uo[n]),r}setupStaticFields(e){this.staticObject={...e}}populateMetaData(){const e=new Date;let r;typeof window<"u"&&typeof window.document<"u"?r=window==null?void 0:window.navigator.userAgent:typeof self<"u"&&self.navigator&&(r=self.navigator.userAgent);let n;return r&&(n=_o(r)),{System:this.system,DateTime:e,UserAgent:r,OSVersion:n}}disconnectSocket(){!this.socket||!this.interval||(this.socket.disconnect(),clearInterval(this.interval))}_overloadConsole(){rt=Object.assign(rt,{log:e=>{this.log(e)},warn:e=>{this.warn(e)},error:e=>{this.error(e)},debug:e=>{this.debug(e)}})}async initStorage(){const e=await this.getItem(this.storageId);(!e||typeof e!="string")&&(await this.setItem(this.storageId,JSON.stringify({})),this.storageInitialized=!0)}async resetStorage(){await this.setItem(this.storageId,JSON.stringify({}))}getStorageName(){const e=xo();return this.system.toString().toUpperCase()+e+Date.now()}async processLog(...e){try{if(e.length<2)return;const r=e[0],n=e[1],o=this.formItemKey(r);if(!this.storageInitialized){this.localObject={...this.localObject,[o]:n};return}const i=await this.getItem(this.storageId);if(!i)return;const u=JSON.parse(i);u[o]=JSON.stringify(n),await this.setItem(this.storageId,JSON.stringify(u))}catch(r){this._errorMethod(r)}}async processQueue(){if(this.processing||this.queue.length===0)return;const e=this.queue.shift();e&&(this.processing=!0,await this.processLog(...e).finally(()=>{this.processing=!1,this.processQueue()}))}log(e){const r={...this.populateMetaData(),...e},n=["INFO",r];this.queue.push(n),this.logToConsole&&this._logMethod.apply(rt,[r]),this.processQueue()}warn(e){const r=["WARN",e];this.queue.push(r),this.logToConsole&&this._warnMethod.apply(rt,[e]),this.processQueue()}error(e){const r=["ERROR",e];this.queue.push(r),this.logToConsole&&this._errorMethod.apply(rt,[e]),this.processQueue()}debug(e){const r=["DEBUG",e];this.queue.push(r),this.logToConsole&&this._debugMethod.apply(rt,[e]),this.processQueue()}async defaultGetItemFunction(e){return localStorage.getItem(e)}async defaultSetItemFunction(e,r){try{localStorage.setItem(e,r)}catch(n){this._errorMethod(n)}}formItemKey(e){const r=new Date().toISOString();return this.logIndex++,`${e}-${this.system}-${r}-${this.logIndex}`}}class Po{constructor(e){H(this,"delay",1e3);H(this,"lastLoginTimestamp");H(this,"token");H(this,"storageKey");this.eventsSdkClass=e,this.eventsSdkClass=e,this.storageKey=""}async login(e){const r={token:e.token,email:e.email,password:e.password};if(this.storageKey=Fr(JSON.stringify({...e,loggerSocketConnection:null})),this.lastLoginTimestamp&&this.lastLoginTimestamp+this.delay>new Date().getTime())return;this.updateLastLoginTimestamp();const n=await this.checkLoginStatus(this.storageKey);return n||(It.clearSessionStorage(),await this.userLoginFunction(r,this.storageKey,e.loginType))}updateLastLoginTimestamp(){this.lastLoginTimestamp=new Date().getTime()}async checkLoginStatus(e){const r=await It.getSessionStorageDataByKey(e);if(r)return r}async userLoginFunction(e,r,n){let o,i,u;return this.eventsSdkClass.options.isNewStack?(o=await this.externalLogin(this.eventsSdkClass.options.loginUrl,e,n),i=await this.getSettings(o.Data.AccessToken),u={...o.Data,...i}):(o=await this.externalLogin(this.eventsSdkClass.options.loginUrl,e,n),u={...o.Data.Socket}),await It.updateSessionStorageKey(r,u),u}onLoginResponse(e){if(!this.eventsSdkClass.options.isNewStack&&this.eventsSdkClass.options.servers&&(this.eventsSdkClass.servers=[...this.eventsSdkClass.options.servers],this.eventsSdkClass.server=this.eventsSdkClass.servers.reduce((r,n)=>r.Priority>n.Priority?r:n)),this.eventsSdkClass.options.isNewStack&&this.eventsSdkClass.options.servers&&(this.eventsSdkClass.servers=[...this.eventsSdkClass.options.servers],this.eventsSdkClass.server=this.eventsSdkClass.servers.reduce((r,n)=>r.Priority>n.Priority?r:n)),e.MonitorList&&e.MonitorList.length&&(this.eventsSdkClass.servers=[...e.MonitorList],this.eventsSdkClass.server=this.eventsSdkClass.servers.reduce((r,n)=>r.Priority>n.Priority?r:n)),!this.eventsSdkClass.options.isNewStack&&!this.eventsSdkClass.servers.length&&e.URLList&&(this.eventsSdkClass.URLList=e.URLList),!this.eventsSdkClass.options.isNewStack&&!this.eventsSdkClass.URLList.length&&!this.eventsSdkClass.servers.length)throw new Error("Socket servers not defined");if(this.eventsSdkClass.options.isNewStack&&!this.eventsSdkClass.servers.length)throw new Error("Socket servers not defined");this.eventsSdkClass.server&&this.eventsSdkClass.socketIoClass.getSocketIoFunction(`v=${this.eventsSdkClass.server.Version}`),!this.eventsSdkClass.server&&this.eventsSdkClass.URLList.length&&this.eventsSdkClass.socketIoClass.getSocketIoFunction(`v=${e.Version}`),e.IdentityCode&&(this.token=e.IdentityCode,this.eventsSdkClass.connect(vt.MAIN)),e.Token&&(this.token=e.Token,this.eventsSdkClass.connect(vt.MAIN)),e.RefreshToken&&e.IdentityCodeExpiry&&this.eventsSdkClass.options.loginType===st.USER&&(this.eventsSdkClass.options.refreshToken=e.RefreshToken,this.eventsSdkClass.options.tokenExpiry=e.IdentityCodeExpiry,this.handleTokenExpiry()),e.RefreshToken&&e.TokenExpiry&&this.normalizeLoginType(this.eventsSdkClass.options.loginType)===st.USER&&(this.eventsSdkClass.options.refreshToken=e.RefreshToken,this.eventsSdkClass.options.tokenExpiry=e.TokenExpiry,this.handleTokenExpiry())}handleTokenExpiry(){if(!this.eventsSdkClass.options.refreshTokenUrl)throw new Error("refreshTokenUrl not provided");let e;if(this.eventsSdkClass.options.tokenExpiry)e=new Date(this.eventsSdkClass.options.tokenExpiry);else return;const r=e.getTime()-new Date().getTime()-5e3,n=Math.min(r,2147483647);setTimeout(async()=>{if(this.eventsSdkClass.options.refreshToken){this.eventsSdkClass.socketIoClass.closeAllConnections();let o,i;if(this.eventsSdkClass.options.isNewStack){const u=await this.refreshToken(this.eventsSdkClass.options.refreshTokenUrl,this.eventsSdkClass.options.refreshToken);o=await this.getSettings(u.Data.AccessToken),i={...u.Data,...o}}else i={...(await this.refreshToken(this.eventsSdkClass.options.refreshTokenUrl,this.eventsSdkClass.options.refreshToken)).Data.Socket};this.onLoginResponse(i),await It.updateSessionStorageKey(this.storageKey,i)}},n)}async externalLogin(e,{password:r,token:n,email:o},i){if(!e)throw new Error("loginUrl not provided");let u;this.eventsSdkClass.options.isNewStack?i===st.TOKEN?u=JSON.stringify({identityType:st.TOKEN,token:n}):u=JSON.stringify({identityType:st.USER,username:o,password:r}):this.eventsSdkClass.options.loginType===st.TOKEN?(u=JSON.stringify({token:n}),e=`${e}/${st.TOKEN}`):(u=JSON.stringify({email:o,pin:r}),e=`${e}/${st.USER}`);try{const h=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:u});if(!h.ok&&h.status===400)throw new Error("Bad body request. Login type or isNewStack values not correct or not provided");if(!h.ok&&h.status===401)throw new Error("Unauthorized. Invalid token provided");if(!h.ok&&h.status===403)throw new Error("Forbidden. Identity token not provided or not valid");const d=await h.json();if(d.error)throw new Error(d.error);return d}catch(h){throw this.eventsSdkClass.loggerClass.log({Message:`External login request error with the login type ${st} ${i===st.TOKEN?{token:n}:{email:o,pin:r}}`,ActionName:at.WSCONNECT,isShowClient:!1,Status:"External login error",StatusCode:400,Level:tt.ERROR,LogType:ct.ERROR}),h}}async getSettings(e){try{if(!this.eventsSdkClass.options.getSettingsUrl)throw new Error("getSettingsUrl not provided");const r=await fetch(this.eventsSdkClass.options.getSettingsUrl,{headers:{Authorization:`Bearer ${e}`}});if(!r.ok&&r.status===401)throw new Error("Unauthorized. Access token not provided or not valid");return r.json()}catch(r){throw this.eventsSdkClass.loggerClass.log({Message:`Get settings error with token ${e}, error: ${r}`,ActionName:at.WSCONNECT,isShowClient:!1,Status:"Get settings error",StatusCode:400,Level:tt.ERROR,LogType:ct.ERROR}),r}}async refreshToken(e,r){try{return(await fetch(e,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`}})).json()}catch(n){throw this.eventsSdkClass.loggerClass.log({Message:`Refresh token error with old refresh token ${r}, url: ${e}, error: ${n}`,ActionName:at.WSCONNECT,isShowClient:!1,Status:"Get settings error",StatusCode:400,Level:tt.ERROR,LogType:ct.ERROR}),n}}normalizeLoginType(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}}const Fo={loginUrl:"https://loginapi.voicenter.co.il/monitorAPI/Login",refreshTokenUrl:"https://loginapi.voicenter.co.il/monitorAPI/RefreshIdentityToken",isNewStack:!1,forceNew:!0,reconnectionDelay:1e4,reconnectionDelayMax:1e4,maxReconnectAttempts:5,timeout:1e4,keepAliveTimeout:6e4,idleInterval:6e4*5,protocol:"https",transports:["websocket"],upgrade:!1,serverFetchStrategy:"static",serverType:0,useLogger:!0,loggerServer:"https://socketlog.voicenter.co",loggerConfig:{logToConsole:!0,overloadGlobalConsole:!1,system:"events-sdk",socketEmitInterval:1e4},loggerConnectOptions:{reconnection:!0,reconnectionDelay:5e3,reconnectionAttempts:10,perMessageDeflate:void 0,upgrade:!1,transports:["websocket"],debug:!1}};function jo(){return window&&(typeof window.navigator>"u"||typeof window.navigator.userAgent>"u")&&(window.navigator.userAgent="react-native"),function t(e,r,n){function o(h,d){if(!r[h]){if(!e[h]){var c=typeof require=="function"&&require;if(!d&&c)return c(h,!0);if(i)return i(h,!0);throw new Error("Cannot find module '"+h+"'")}var l=r[h]={exports:{}};e[h][0].call(l.exports,function(p){var a=e[h][1][p];return o(a||p)},l,l.exports,t,e,r,n)}return r[h].exports}for(var i=typeof require=="function"&&require,u=0;u<n.length;u++)o(n[u]);return o}({1:[function(t,e){e.exports=t("./lib/")},{"./lib/":2}],2:[function(t,e,r){function n(c,l){typeof c=="object"&&(l=c,c=void 0),l=l||{};var p,a=o(c),s=a.source,f=a.id;return l.forceNew||l["force new connection"]||l.multiplex===!1?(h("ignoring socket cache for %s",s),p=u(s,l)):(d[f]||(h("new io instance for %s",s),d[f]=u(s,l)),p=d[f]),p.socket(a.path)}var o=t("./url"),i=t("socket.io-parser"),u=t("./manager"),h=t("debug")("socket.io-client");e.exports=r=n;var d=r.managers={};r.protocol=i.protocol,r.connect=n,r.Manager=t("./manager"),r.Socket=t("./socket")},{"./manager":3,"./socket":5,"./url":6,debug:10,"socket.io-parser":44}],3:[function(t,e){function r(a,s){return this instanceof r?(a&&typeof a=="object"&&(s=a,a=void 0),s=s||{},s.path=s.path||"/socket.io",this.nsps={},this.subs=[],this.opts=s,this.reconnection(s.reconnection!==!1),this.reconnectionAttempts(s.reconnectionAttempts||1/0),this.reconnectionDelay(s.reconnectionDelay||1e3),this.reconnectionDelayMax(s.reconnectionDelayMax||5e3),this.randomizationFactor(s.randomizationFactor||.5),this.backoff=new p({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(s.timeout==null?2e4:s.timeout),this.readyState="closed",this.uri=a,this.connected=[],this.encoding=!1,this.packetBuffer=[],this.encoder=new u.Encoder,this.decoder=new u.Decoder,this.autoConnect=s.autoConnect!==!1,void(this.autoConnect&&this.open())):new r(a,s)}var n=(t("./url"),t("engine.io-client")),o=t("./socket"),i=t("component-emitter"),u=t("socket.io-parser"),h=t("./on"),d=t("component-bind"),c=(t("object-component"),t("debug")("socket.io-client:manager")),l=t("indexof"),p=t("backo2");e.exports=r,r.prototype.emitAll=function(){this.emit.apply(this,arguments);for(var a in this.nsps)this.nsps[a].emit.apply(this.nsps[a],arguments)},r.prototype.updateSocketIds=function(){for(var a in this.nsps)this.nsps[a].id=this.engine.id},i(r.prototype),r.prototype.reconnection=function(a){return arguments.length?(this._reconnection=!!a,this):this._reconnection},r.prototype.reconnectionAttempts=function(a){return arguments.length?(this._reconnectionAttempts=a,this):this._reconnectionAttempts},r.prototype.reconnectionDelay=function(a){return arguments.length?(this._reconnectionDelay=a,this.backoff&&this.backoff.setMin(a),this):this._reconnectionDelay},r.prototype.randomizationFactor=function(a){return arguments.length?(this._randomizationFactor=a,this.backoff&&this.backoff.setJitter(a),this):this._randomizationFactor},r.prototype.reconnectionDelayMax=function(a){return arguments.length?(this._reconnectionDelayMax=a,this.backoff&&this.backoff.setMax(a),this):this._reconnectionDelayMax},r.prototype.timeout=function(a){return arguments.length?(this._timeout=a,this):this._timeout},r.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()},r.prototype.open=r.prototype.connect=function(a){if(c("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;c("opening %s",this.uri),this.engine=n(this.uri,this.opts);var s=this.engine,f=this;this.readyState="opening",this.skipReconnect=!1;var y=h(s,"open",function(){f.onopen(),a&&a()}),g=h(s,"error",function(_){if(c("connect_error"),f.cleanup(),f.readyState="closed",f.emitAll("connect_error",_),a){var k=new Error("Connection error");k.data=_,a(k)}else f.maybeReconnectOnOpen()});if(this._timeout!==!1){var w=this._timeout;c("connect attempt will timeout after %d",w);var B=setTimeout(function(){c("connect attempt timed out after %d",w),y.destroy(),s.close(),s.emit("error","timeout"),f.emitAll("connect_timeout",w)},w);this.subs.push({destroy:function(){clearTimeout(B)}})}return this.subs.push(y),this.subs.push(g),this},r.prototype.onopen=function(){c("open"),this.cleanup(),this.readyState="open",this.emit("open");var a=this.engine;this.subs.push(h(a,"data",d(this,"ondata"))),this.subs.push(h(this.decoder,"decoded",d(this,"ondecoded"))),this.subs.push(h(a,"error",d(this,"onerror"))),this.subs.push(h(a,"close",d(this,"onclose")))},r.prototype.ondata=function(a){this.decoder.add(a)},r.prototype.ondecoded=function(a){this.emit("packet",a)},r.prototype.onerror=function(a){c("error",a),this.emitAll("error",a)},r.prototype.socket=function(a){var s=this.nsps[a];if(!s){s=new o(this,a),this.nsps[a]=s;var f=this;s.on("connect",function(){s.id=f.engine.id,~l(f.connected,s)||f.connected.push(s)})}return s},r.prototype.destroy=function(a){var s=l(this.connected,a);~s&&this.connected.splice(s,1),this.connected.length||this.close()},r.prototype.packet=function(a){c("writing packet %j",a);var s=this;s.encoding?s.packetBuffer.push(a):(s.encoding=!0,this.encoder.encode(a,function(f){for(var y=0;y<f.length;y++)s.engine.write(f[y]);s.encoding=!1,s.processPacketQueue()}))},r.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var a=this.packetBuffer.shift();this.packet(a)}},r.prototype.cleanup=function(){for(var a;a=this.subs.shift();)a.destroy();this.packetBuffer=[],this.encoding=!1,this.decoder.destroy()},r.prototype.close=r.prototype.disconnect=function(){this.skipReconnect=!0,this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},r.prototype.onclose=function(a){c("close"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",a),this._reconnection&&!this.skipReconnect&&this.reconnect()},r.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var a=this;if(this.backoff.attempts>=this._reconnectionAttempts)c("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var s=this.backoff.duration();c("will wait %dms before reconnect attempt",s),this.reconnecting=!0;var f=setTimeout(function(){a.skipReconnect||(c("attempting reconnect"),a.emitAll("reconnect_attempt",a.backoff.attempts),a.emitAll("reconnecting",a.backoff.attempts),a.skipReconnect||a.open(function(y){y?(c("reconnect attempt error"),a.reconnecting=!1,a.reconnect(),a.emitAll("reconnect_error",y.data)):(c("reconnect success"),a.onreconnect())}))},s);this.subs.push({destroy:function(){clearTimeout(f)}})}},r.prototype.onreconnect=function(){var a=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",a)}},{"./on":4,"./socket":5,"./url":6,backo2:7,"component-bind":8,"component-emitter":9,debug:10,"engine.io-client":11,indexof:40,"object-component":41,"socket.io-parser":44}],4:[function(t,e){function r(n,o,i){return n.on(o,i),{destroy:function(){n.removeListener(o,i)}}}e.exports=r},{}],5:[function(t,e,r){function n(s,f){this.io=s,this.nsp=f,this.json=this,this.ids=0,this.acks={},this.io.autoConnect&&this.open(),this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0}var o=t("socket.io-parser"),i=t("component-emitter"),u=t("to-array"),h=t("./on"),d=t("component-bind"),c=t("debug")("socket.io-client:socket"),l=t("has-binary");e.exports=n;var p={connect:1,connect_error:1,connect_timeout:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1},a=i.prototype.emit;i(n.prototype),n.prototype.subEvents=function(){if(!this.subs){var s=this.io;this.subs=[h(s,"open",d(this,"onopen")),h(s,"packet",d(this,"onpacket")),h(s,"close",d(this,"onclose"))]}},n.prototype.open=n.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),this.io.readyState=="open"&&this.onopen(),this)},n.prototype.send=function(){var s=u(arguments);return s.unshift("message"),this.emit.apply(this,s),this},n.prototype.emit=function(s){if(p.hasOwnProperty(s))return a.apply(this,arguments),this;var f=u(arguments),y=o.EVENT;l(f)&&(y=o.BINARY_EVENT);var g={type:y,data:f};return typeof f[f.length-1]=="function"&&(c("emitting packet with ack id %d",this.ids),this.acks[this.ids]=f.pop(),g.id=this.ids++),this.connected?this.packet(g):this.sendBuffer.push(g),this},n.prototype.packet=function(s){s.nsp=this.nsp,this.io.packet(s)},n.prototype.onopen=function(){c("transport is open - connecting"),this.nsp!="/"&&this.packet({type:o.CONNECT})},n.prototype.onclose=function(s){c("close (%s)",s),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",s)},n.prototype.onpacket=function(s){if(s.nsp==this.nsp)switch(s.type){case o.CONNECT:this.onconnect();break;case o.EVENT:this.onevent(s);break;case o.BINARY_EVENT:this.onevent(s);break;case o.ACK:this.onack(s);break;case o.BINARY_ACK:this.onack(s);break;case o.DISCONNECT:this.ondisconnect();break;case o.ERROR:this.emit("error",s.data)}},n.prototype.onevent=function(s){var f=s.data||[];c("emitting event %j",f),s.id!=null&&(c("attaching ack callback to event"),f.push(this.ack(s.id))),this.connected?a.apply(this,f):this.receiveBuffer.push(f)},n.prototype.ack=function(s){var f=this,y=!1;return function(){if(!y){y=!0;var g=u(arguments);c("sending ack %j",g);var w=l(g)?o.BINARY_ACK:o.ACK;f.packet({type:w,id:s,data:g})}}},n.prototype.onack=function(s){c("calling ack %s with %j",s.id,s.data);var f=this.acks[s.id];f.apply(this,s.data),delete this.acks[s.id]},n.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},n.prototype.emitBuffered=function(){var s;for(s=0;s<this.receiveBuffer.length;s++)a.apply(this,this.receiveBuffer[s]);for(this.receiveBuffer=[],s=0;s<this.sendBuffer.length;s++)this.packet(this.sendBuffer[s]);this.sendBuffer=[]},n.prototype.ondisconnect=function(){c("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},n.prototype.destroy=function(){if(this.subs){for(var s=0;s<this.subs.length;s++)this.subs[s].destroy();this.subs=null}this.io.destroy(this)},n.prototype.close=n.prototype.disconnect=function(){return this.connected&&(c("performing disconnect (%s)",this.nsp),this.packet({type:o.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}},{"./on":4,"component-bind":8,"component-emitter":9,debug:10,"has-binary":36,"socket.io-parser":44,"to-array":48}],6:[function(t,e){(function(r){function n(u,c){var d=u,c=c||r.location;return u==null&&(u=c.protocol+"//"+c.host),typeof u=="string"&&(u.charAt(0)=="/"&&(u=u.charAt(1)=="/"?c.protocol+u:c.hostname+u),/^(https?|wss?):\/\//.test(u)||(i("protocol-less url %s",u),u=typeof c<"u"?c.protocol+"//"+u:"https://"+u),i("parse %s",u),d=o(u)),d.port||(/^(http|ws)$/.test(d.protocol)?d.port="80":/^(http|ws)s$/.test(d.protocol)&&(d.port="443")),d.path=d.path||"/",d.id=d.protocol+"://"+d.host+":"+d.port,d.href=d.protocol+"://"+d.host+(c&&c.port==d.port?"":":"+d.port),d}var o=t("parseuri"),i=t("debug")("socket.io-client:url");e.exports=n}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{debug:10,parseuri:42}],7:[function(t,e){function r(n){n=n||{},this.ms=n.min||100,this.max=n.max||1e4,this.factor=n.factor||2,this.jitter=n.jitter>0&&n.jitter<=1?n.jitter:0,this.attempts=0}e.exports=r,r.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var o=Math.random(),i=Math.floor(o*this.jitter*n);n=1&Math.floor(10*o)?n+i:n-i}return 0|Math.min(n,this.max)},r.prototype.reset=function(){this.attempts=0},r.prototype.setMin=function(n){this.ms=n},r.prototype.setMax=function(n){this.max=n},r.prototype.setJitter=function(n){this.jitter=n}},{}],8:[function(t,e){var r=[].slice;e.exports=function(n,o){if(typeof o=="string"&&(o=n[o]),typeof o!="function")throw new Error("bind() requires a function");var i=r.call(arguments,2);return function(){return o.apply(n,i.concat(r.call(arguments)))}}},{}],9:[function(t,e){function r(o){return o?n(o):void 0}function n(o){for(var i in r.prototype)o[i]=r.prototype[i];return o}e.exports=r,r.prototype.on=r.prototype.addEventListener=function(o,i){return this._callbacks=this._callbacks||{},(this._callbacks[o]=this._callbacks[o]||[]).push(i),this},r.prototype.once=function(o,i){function u(){h.off(o,u),i.apply(this,arguments)}var h=this;return this._callbacks=this._callbacks||{},u.fn=i,this.on(o,u),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(o,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var u=this._callbacks[o];if(!u)return this;if(arguments.length==1)return delete this._callbacks[o],this;for(var h,d=0;d<u.length;d++)if(h=u[d],h===i||h.fn===i){u.splice(d,1);break}return this},r.prototype.emit=function(o){this._callbacks=this._callbacks||{};var i=[].slice.call(arguments,1),u=this._callbacks[o];if(u){u=u.slice(0);for(var h=0,d=u.length;d>h;++h)u[h].apply(this,i)}return this},r.prototype.listeners=function(o){return this._callbacks=this._callbacks||{},this._callbacks[o]||[]},r.prototype.hasListeners=function(o){return!!this.listeners(o).length}},{}],10:[function(t,e){function r(o){return r.enabled(o)?function(i){i=n(i);var u=new Date,h=u-(r[o]||u);r[o]=u,i=o+" "+i+" +"+r.humanize(h),window.console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}:function(){}}function n(o){return o instanceof Error?o.stack||o.message:o}e.exports=r,r.names=[],r.skips=[],r.enable=function(o){try{localStorage.debug=o}catch{}for(var i=(o||"").split(/[\s,]+/),u=i.length,h=0;u>h;h++)o=i[h].replace("*",".*?"),o[0]==="-"?r.skips.push(new RegExp("^"+o.substr(1)+"$")):r.names.push(new RegExp("^"+o+"$"))},r.disable=function(){r.enable("")},r.humanize=function(o){var i=1e3,u=6e4,h=60*u;return o>=h?(o/h).toFixed(1)+"h":o>=u?(o/u).toFixed(1)+"m":o>=i?(o/i|0)+"s":o+"ms"},r.enabled=function(o){for(var i=0,u=r.skips.length;u>i;i++)if(r.skips[i].test(o))return!1;for(var i=0,u=r.names.length;u>i;i++)if(r.names[i].test(o))return!0;return!1};try{window.localStorage&&r.enable(localStorage.debug)}catch{}},{}],11:[function(t,e){e.exports=t("./lib/")},{"./lib/":12}],12:[function(t,e){e.exports=t("./socket"),e.exports.parser=t("engine.io-parser")},{"./socket":13,"engine.io-parser":25}],13:[function(t,e){(function(r){function n(s,f){if(!(this instanceof n))return new n(s,f);if(f=f||{},s&&typeof s=="object"&&(f=s,s=null),s&&(s=l(s),f.host=s.host,f.secure=s.protocol=="https"||s.protocol=="wss",f.port=s.port,s.query&&(f.query=s.query)),this.secure=f.secure!=null?f.secure:r.location&&location.protocol=="https:",f.host){var y=f.host.split(":");f.hostname=y.shift(),y.length?f.port=y.pop():f.port||(f.port=this.secure?"443":"80")}this.agent=f.agent||!1,this.hostname=f.hostname||(r.location?location.hostname:"localhost"),this.port=f.port||(r.location&&location.port?location.port:this.secure?443:80),this.query=f.query||{},typeof this.query=="string"&&(this.query=a.decode(this.query)),this.upgrade=f.upgrade!==!1,this.path=(f.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!f.forceJSONP,this.jsonp=f.jsonp!==!1,this.forceBase64=!!f.forceBase64,this.enablesXDR=!!f.enablesXDR,this.timestampParam=f.timestampParam||"t",this.timestampRequests=f.timestampRequests,this.transports=f.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.callbackBuffer=[],this.policyPort=f.policyPort||843,this.rememberUpgrade=f.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=f.onlyBinaryUpgrades,this.pfx=f.pfx||null,this.key=f.key||null,this.passphrase=f.passphrase||null,this.cert=f.cert||null,this.ca=f.ca||null,this.ciphers=f.ciphers||null,this.rejectUnauthorized=f.rejectUnauthorized||null,this.open()}function o(s){var f={};for(var y in s)s.hasOwnProperty(y)&&(f[y]=s[y]);return f}var i=t("./transports"),u=t("component-emitter"),h=t("debug")("engine.io-client:socket"),d=t("indexof"),c=t("engine.io-parser"),l=t("parseuri"),p=t("parsejson"),a=t("parseqs");e.exports=n,n.priorWebsocketSuccess=!1,u(n.prototype),n.protocol=c.protocol,n.Socket=n,n.Transport=t("./transport"),n.transports=t("./transports"),n.parser=t("engine.io-parser"),n.prototype.createTransport=function(s){h('creating transport "%s"',s);var f=o(this.query);f.EIO=c.protocol,f.transport=s,this.id&&(f.sid=this.id);var y=new i[s]({agent:this.agent,hostname:this.hostname,port:this.port,secure:this.secure,path:this.path,query:f,forceJSONP:this.forceJSONP,jsonp:this.jsonp,forceBase64:this.forceBase64,enablesXDR:this.enablesXDR,timestampRequests:this.timestampRequests,timestampParam:this.timestampParam,policyPort:this.policyPort,socket:this,pfx:this.pfx,key:this.key,passphrase:this.passphrase,cert:this.cert,ca:this.ca,ciphers:this.ciphers,rejectUnauthorized:this.rejectUnauthorized});return y},n.prototype.open=function(){var f;if(this.rememberUpgrade&&n.priorWebsocketSuccess&&this.transports.indexOf("websocket")!=-1)f="websocket";else{if(this.transports.length==0){var s=this;return void setTimeout(function(){s.emit("error","No transports available")},0)}f=this.transports[0]}this.readyState="opening";var f;try{f=this.createTransport(f)}catch{return this.transports.shift(),void this.open()}f.open(),this.setTransport(f)},n.prototype.setTransport=function(s){h("setting transport %s",s.name);var f=this;this.transport&&(h("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=s,s.on("drain",function(){f.onDrain()}).on("packet",function(y){f.onPacket(y)}).on("error",function(y){f.onError(y)}).on("close",function(){f.onClose("transport close")})},n.prototype.probe=function(s){function f(){if(C.onlyBinaryUpgrades){var E=!this.supportsBinary&&C.transport.supportsBinary;m=m||E}m||(h('probe transport "%s" opened',s),S.send([{type:"ping",data:"probe"}]),S.once("packet",function(v){if(!m)if(v.type=="pong"&&v.data=="probe"){if(h('probe transport "%s" pong',s),C.upgrading=!0,C.emit("upgrading",S),!S)return;n.priorWebsocketSuccess=S.name=="websocket",h('pausing current transport "%s"',C.transport.name),C.transport.pause(function(){m||C.readyState!="closed"&&(h("changing transport and sending upgrade packet"),k(),C.setTransport(S),S.send([{type:"upgrade"}]),C.emit("upgrade",S),S=null,C.upgrading=!1,C.flush())})}else{h('probe transport "%s" failed',s);var b=new Error("probe error");b.transport=S.name,C.emit("upgradeError",b)}}))}function y(){m||(m=!0,k(),S.close(),S=null)}function g(E){var v=new Error("probe error: "+E);v.transport=S.name,y(),h('probe transport "%s" failed because of error: %s',s,E),C.emit("upgradeError",v)}function w(){g("transport closed")}function B(){g("socket closed")}function _(E){S&&E.name!=S.name&&(h('"%s" works - aborting "%s"',E.name,S.name),y())}function k(){S.removeListener("open",f),S.removeListener("error",g),S.removeListener("close",w),C.removeListener("close",B),C.removeListener("upgrading",_)}h('probing transport "%s"',s);var S=this.createTransport(s,{probe:1}),m=!1,C=this;n.priorWebsocketSuccess=!1,S.once("open",f),S.once("error",g),S.once("close",w),this.once("close",B),this.once("upgrading",_),S.open()},n.prototype.onOpen=function(){if(h("socket open"),this.readyState="open",n.priorWebsocketSuccess=this.transport.name=="websocket",this.emit("open"),this.flush(),this.readyState=="open"&&this.upgrade&&this.transport.pause){h("starting upgrade probes");for(var s=0,f=this.upgrades.length;f>s;s++)this.probe(this.upgrades[s])}},n.prototype.onPacket=function(s){if(this.readyState=="opening"||this.readyState=="open")switch(h('socket receive: type "%s", data "%s"',s.type,s.data),this.emit("packet",s),this.emit("heartbeat"),s.type){case"open":this.onHandshake(p(s.data));break;case"pong":this.setPing();break;case"error":var f=new Error("server error");f.code=s.data,this.emit("error",f);break;case"message":this.emit("data",s.data),this.emit("message",s.data)}else h('packet received with socket readyState "%s"',this.readyState)},n.prototype.onHandshake=function(s){this.emit("handshake",s),this.id=s.sid,this.transport.query.sid=s.sid,this.upgrades=this.filterUpgrades(s.upgrades),this.pingInterval=s.pingInterval,this.pingTimeout=s.pingTimeout,this.onOpen(),this.readyState!="closed"&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},n.prototype.onHeartbeat=function(s){clearTimeout(this.pingTimeoutTimer);var f=this;f.pingTimeoutTimer=setTimeout(function(){f.readyState!="closed"&&f.onClose("ping timeout")},s||f.pingInterval+f.pingTimeout)},n.prototype.setPing=function(){var s=this;clearTimeout(s.pingIntervalTimer),s.pingIntervalTimer=setTimeout(function(){h("writing ping packet - expecting pong within %sms",s.pingTimeout),s.ping(),s.onHeartbeat(s.pingTimeout)},s.pingInterval)},n.prototype.ping=function(){this.sendPacket("ping")},n.prototype.onDrain=function(){for(var s=0;s<this.prevBufferLen;s++)this.callbackBuffer[s]&&this.callbackBuffer[s]();this.writeBuffer.splice(0,this.prevBufferLen),this.callbackBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length==0?this.emit("drain"):this.flush()},n.prototype.flush=function(){this.readyState!="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(h("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},n.prototype.write=n.prototype.send=function(s,f){return this.sendPacket("message",s,f),this},n.prototype.sendPacket=function(s,f,y){if(this.readyState!="closing"&&this.readyState!="closed"){var g={type:s,data:f};this.emit("packetCreate",g),this.writeBuffer.push(g),this.callbackBuffer.push(y),this.flush()}},n.prototype.close=function(){function s(){g.onClose("forced close"),h("socket closing - telling transport to close"),g.transport.close()}function f(){g.removeListener("upgrade",f),g.removeListener("upgradeError",f),s()}function y(){g.once("upgrade",f),g.once("upgradeError",f)}if(this.readyState=="opening"||this.readyState=="open"){this.readyState="closing";var g=this;this.writeBuffer.length?this.once("drain",function(){this.upgrading?y():s()}):this.upgrading?y():s()}return this},n.prototype.onError=function(s){h("socket error %j",s),n.priorWebsocketSuccess=!1,this.emit("error",s),this.onClose("transport error",s)},n.prototype.onClose=function(s,f){if(this.readyState=="opening"||this.readyState=="open"||this.readyState=="closing"){h('socket close with reason: "%s"',s);var y=this;clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),setTimeout(function(){y.writeBuffer=[],y.callbackBuffer=[],y.prevBufferLen=0},0),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",s,f)}},n.prototype.filterUpgrades=function(s){for(var f=[],y=0,g=s.length;g>y;y++)~d(this.transports,s[y])&&f.push(s[y]);return f}}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{"./transport":14,"./transports":15,"component-emitter":9,debug:22,"engine.io-parser":25,indexof:40,parsejson:32,parseqs:33,parseuri:34}],14:[function(t,e){function r(i){this.path=i.path,this.hostname=i.hostname,this.port=i.port,this.secure=i.secure,this.query=i.query,this.timestampParam=i.timestampParam,this.timestampRequests=i.timestampRequests,this.readyState="",this.agent=i.agent||!1,this.socket=i.socket,this.enablesXDR=i.enablesXDR,this.pfx=i.pfx,this.key=i.key,this.passphrase=i.passphrase,this.cert=i.cert,this.ca=i.ca,this.ciphers=i.ciphers,this.rejectUnauthorized=i.rejectUnauthorized}var n=t("engine.io-parser"),o=t("component-emitter");e.exports=r,o(r.prototype),r.timestamps=0,r.prototype.onError=function(i,u){var h=new Error(i);return h.type="TransportError",h.description=u,this.emit("error",h),this},r.prototype.open=function(){return(this.readyState=="closed"||this.readyState=="")&&(this.readyState="opening",this.doOpen()),this},r.prototype.close=function(){return(this.readyState=="opening"||this.readyState=="open")&&(this.doClose(),this.onClose()),this},r.prototype.send=function(i){if(this.readyState!="open")throw new Error("Transport not open");this.write(i)},r.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},r.prototype.onData=function(i){var u=n.decodePacket(i,this.socket.binaryType);this.onPacket(u)},r.prototype.onPacket=function(i){this.emit("packet",i)},r.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},{"component-emitter":9,"engine.io-parser":25}],15:[function(t,e,r){(function(n){function o(c){var l,p=!1,a=!1,s=c.jsonp!==!1;if(n.location){var f=location.protocol=="https:",y=location.port;y||(y=f?443:80),p=c.hostname!=location.hostname||y!=c.port,a=c.secure!=f}if(c.xdomain=p,c.xscheme=a,l=new i(c),"open"in l&&!c.forceJSONP)return new u(c);if(!s)throw new Error("JSONP disabled");return new h(c)}var i=t("xmlhttprequest"),u=t("./polling-xhr"),h=t("./polling-jsonp"),d=t("./websocket");r.polling=o,r.websocket=d}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{"./polling-jsonp":16,"./polling-xhr":17,"./websocket":19,xmlhttprequest:20}],16:[function(t,e){(function(r){function n(){}function o(l){i.call(this,l),this.query=this.query||{},h||(r.___eio||(r.___eio=[]),h=r.___eio),this.index=h.length;var p=this;h.push(function(a){p.onData(a)}),this.query.j=this.index,r.document&&r.addEventListener&&r.addEventListener("beforeunload",function(){p.script&&(p.script.onerror=n)},!1)}var i=t("./polling"),u=t("component-inherit");e.exports=o;var h,d=/\n/g,c=/\\n/g;u(o,i),o.prototype.supportsBinary=!1,o.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),i.prototype.doClose.call(this)},o.prototype.doPoll=function(){var l=this,p=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),p.async=!0,p.src=this.uri(),p.onerror=function(f){l.onError("jsonp poll error",f)};var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(p,a),this.script=p;var s=typeof navigator<"u"&&/gecko/i.test(navigator.userAgent);s&&setTimeout(function(){var f=document.createElement("iframe");document.body.appendChild(f),document.body.removeChild(f)},100)},o.prototype.doWrite=function(l,p){function a(){s(),p()}function s(){if(f.iframe)try{f.form.removeChild(f.iframe)}catch(k){f.onError("jsonp polling iframe removal error",k)}try{var _='<iframe src="javascript:0" name="'+f.iframeId+'">';y=document.createElement(_)}catch{y=document.createElement("iframe"),y.name=f.iframeId,y.src="javascript:0"}y.id=f.iframeId,f.form.appendChild(y),f.iframe=y}var f=this;if(!this.form){var y,g=document.createElement("form"),w=document.createElement("textarea"),B=this.iframeId="eio_iframe_"+this.index;g.className="socketio",g.style.position="absolute",g.style.top="-1000px",g.style.left="-1000px",g.target=B,g.method="POST",g.setAttribute("accept-charset","utf-8"),w.name="d",g.appendChild(w),document.body.appendChild(g),this.form=g,this.area=w}this.form.action=this.uri(),s(),l=l.replace(c,`\\
7
+ `),this.area.value=t.replace(zn,"\\n");try{this.form.submit()}catch{}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){r.iframe.readyState==="complete"&&h()}:this.iframe.onload=h};const Kn={},Hn=Object.freeze(Object.defineProperty({__proto__:null,default:Kn},Symbol.toStringTag,{value:"Module"})),Jn=zr(Hn);var Oe=Ae(),Vn=bt,$n=Et,Gn=Vt,Yn=pr,Qn=lt("engine.io-client:websocket"),Wt,xe;typeof WebSocket<"u"?Wt=WebSocket:typeof self<"u"&&(Wt=self.WebSocket||self.MozWebSocket);if(typeof window>"u")try{xe=Jn}catch{}var wt=Wt||xe,Zn=it;function it(t){var e=t&&t.forceBase64;e&&(this.supportsBinary=!1),this.perMessageDeflate=t.perMessageDeflate,this.usingBrowserWebSocket=Wt&&!t.forceNode,this.protocols=t.protocols,this.usingBrowserWebSocket||(wt=xe),Oe.call(this,t)}Gn(it,Oe);it.prototype.name="websocket";it.prototype.supportsBinary=!0;it.prototype.doOpen=function(){if(this.check()){var t=this.uri(),e=this.protocols,r={};this.isReactNative||(r.agent=this.agent,r.perMessageDeflate=this.perMessageDeflate,r.pfx=this.pfx,r.key=this.key,r.passphrase=this.passphrase,r.cert=this.cert,r.ca=this.ca,r.ciphers=this.ciphers,r.rejectUnauthorized=this.rejectUnauthorized),this.extraHeaders&&(r.headers=this.extraHeaders),this.localAddress&&(r.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket&&!this.isReactNative?e?new wt(t,e):new wt(t):new wt(t,e,r)}catch(n){return this.emit("error",n)}this.ws.binaryType===void 0&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}};it.prototype.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.onOpen()},this.ws.onclose=function(){t.onClose()},this.ws.onmessage=function(e){t.onData(e.data)},this.ws.onerror=function(e){t.onError("websocket error",e)}};it.prototype.write=function(t){var e=this;this.writable=!1;for(var r=t.length,n=0,o=r;n<o;n++)(function(u){Vn.encodePacket(u,e.supportsBinary,function(h){if(!e.usingBrowserWebSocket){var d={};if(u.options&&(d.compress=u.options.compress),e.perMessageDeflate){var c=typeof h=="string"?Buffer.byteLength(h):h.length;c<e.perMessageDeflate.threshold&&(d.compress=!1)}}try{e.usingBrowserWebSocket?e.ws.send(h):e.ws.send(h,d)}catch{Qn("websocket closed before onclose event")}--r||i()})})(t[n]);function i(){e.emit("flush"),setTimeout(function(){e.writable=!0,e.emit("drain")},0)}};it.prototype.onClose=function(){Oe.prototype.onClose.call(this)};it.prototype.doClose=function(){typeof this.ws<"u"&&this.ws.close()};it.prototype.uri=function(){var t=this.query||{},e=this.secure?"wss":"ws",r="";this.port&&(e==="wss"&&Number(this.port)!==443||e==="ws"&&Number(this.port)!==80)&&(r=":"+this.port),this.timestampRequests&&(t[this.timestampParam]=Yn()),this.supportsBinary||(t.b64=1),t=$n.encode(t),t.length&&(t="?"+t);var n=this.hostname.indexOf(":")!==-1;return e+"://"+(n?"["+this.hostname+"]":this.hostname)+r+this.path+t};it.prototype.check=function(){return!!wt&&!("__initialize"in wt&&this.name===it.prototype.name)};var to=Se,eo=jn,ro=qn,no=Zn;Jt.polling=oo;Jt.websocket=no;function oo(t){var e,r=!1,n=!1,o=t.jsonp!==!1;if(typeof location<"u"){var i=location.protocol==="https:",u=location.port;u||(u=i?443:80),r=t.hostname!==location.hostname||u!==t.port,n=t.secure!==i}if(t.xdomain=r,t.xscheme=n,e=new to(t),"open"in e&&!t.forceJSONP)return new eo(t);if(!o)throw new Error("JSONP disabled");return new ro(t)}var so=[].indexOf,yr=function(t,e){if(so)return t.indexOf(e);for(var r=0;r<t.length;++r)if(t[r]===e)return r;return-1},io=Jt,ao=St,G=lt("engine.io-client:socket"),co=yr,gr=bt,Ke=Ze,ho=Et,po=W;function W(t,e){if(!(this instanceof W))return new W(t,e);e=e||{},t&&typeof t=="object"&&(e=t,t=null),t?(t=Ke(t),e.hostname=t.host,e.secure=t.protocol==="https"||t.protocol==="wss",e.port=t.port,t.query&&(e.query=t.query)):e.host&&(e.hostname=Ke(e.host).host),this.secure=e.secure!=null?e.secure:typeof location<"u"&&location.protocol==="https:",e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.agent=e.agent||!1,this.hostname=e.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=e.port||(typeof location<"u"&&location.port?location.port:this.secure?443:80),this.query=e.query||{},typeof this.query=="string"&&(this.query=ho.decode(this.query)),this.upgrade=e.upgrade!==!1,this.path=(e.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!e.forceJSONP,this.jsonp=e.jsonp!==!1,this.forceBase64=!!e.forceBase64,this.enablesXDR=!!e.enablesXDR,this.withCredentials=e.withCredentials!==!1,this.timestampParam=e.timestampParam||"t",this.timestampRequests=e.timestampRequests,this.transports=e.transports||["polling","websocket"],this.transportOptions=e.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=e.policyPort||843,this.rememberUpgrade=e.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=e.onlyBinaryUpgrades,this.perMessageDeflate=e.perMessageDeflate!==!1?e.perMessageDeflate||{}:!1,this.perMessageDeflate===!0&&(this.perMessageDeflate={}),this.perMessageDeflate&&this.perMessageDeflate.threshold==null&&(this.perMessageDeflate.threshold=1024),this.pfx=e.pfx||void 0,this.key=e.key||void 0,this.passphrase=e.passphrase||void 0,this.cert=e.cert||void 0,this.ca=e.ca||void 0,this.ciphers=e.ciphers||void 0,this.rejectUnauthorized=e.rejectUnauthorized===void 0?!0:e.rejectUnauthorized,this.forceNode=!!e.forceNode,this.isReactNative=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",(typeof self>"u"||this.isReactNative)&&(e.extraHeaders&&Object.keys(e.extraHeaders).length>0&&(this.extraHeaders=e.extraHeaders),e.localAddress&&(this.localAddress=e.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}W.priorWebsocketSuccess=!1;ao(W.prototype);W.protocol=gr.protocol;W.Socket=W;W.Transport=Ae();W.transports=Jt;W.parser=bt;W.prototype.createTransport=function(t){G('creating transport "%s"',t);var e=uo(this.query);e.EIO=gr.protocol,e.transport=t;var r=this.transportOptions[t]||{};this.id&&(e.sid=this.id);var n=new io[t]({query:e,socket:this,agent:r.agent||this.agent,hostname:r.hostname||this.hostname,port:r.port||this.port,secure:r.secure||this.secure,path:r.path||this.path,forceJSONP:r.forceJSONP||this.forceJSONP,jsonp:r.jsonp||this.jsonp,forceBase64:r.forceBase64||this.forceBase64,enablesXDR:r.enablesXDR||this.enablesXDR,withCredentials:r.withCredentials||this.withCredentials,timestampRequests:r.timestampRequests||this.timestampRequests,timestampParam:r.timestampParam||this.timestampParam,policyPort:r.policyPort||this.policyPort,pfx:r.pfx||this.pfx,key:r.key||this.key,passphrase:r.passphrase||this.passphrase,cert:r.cert||this.cert,ca:r.ca||this.ca,ciphers:r.ciphers||this.ciphers,rejectUnauthorized:r.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:r.perMessageDeflate||this.perMessageDeflate,extraHeaders:r.extraHeaders||this.extraHeaders,forceNode:r.forceNode||this.forceNode,localAddress:r.localAddress||this.localAddress,requestTimeout:r.requestTimeout||this.requestTimeout,protocols:r.protocols||void 0,isReactNative:this.isReactNative});return n};function uo(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}W.prototype.open=function(){var t;if(this.rememberUpgrade&&W.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){var e=this;setTimeout(function(){e.emit("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)};W.prototype.setTransport=function(t){G("setting transport %s",t.name);var e=this;this.transport&&(G("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=t,t.on("drain",function(){e.onDrain()}).on("packet",function(r){e.onPacket(r)}).on("error",function(r){e.onError(r)}).on("close",function(){e.onClose("transport close")})};W.prototype.probe=function(t){G('probing transport "%s"',t);var e=this.createTransport(t,{probe:1}),r=!1,n=this;W.priorWebsocketSuccess=!1;function o(){if(n.onlyBinaryUpgrades){var p=!this.supportsBinary&&n.transport.supportsBinary;r=r||p}r||(G('probe transport "%s" opened',t),e.send([{type:"ping",data:"probe"}]),e.once("packet",function(a){if(!r)if(a.type==="pong"&&a.data==="probe"){if(G('probe transport "%s" pong',t),n.upgrading=!0,n.emit("upgrading",e),!e)return;W.priorWebsocketSuccess=e.name==="websocket",G('pausing current transport "%s"',n.transport.name),n.transport.pause(function(){r||n.readyState!=="closed"&&(G("changing transport and sending upgrade packet"),l(),n.setTransport(e),e.send([{type:"upgrade"}]),n.emit("upgrade",e),e=null,n.upgrading=!1,n.flush())})}else{G('probe transport "%s" failed',t);var s=new Error("probe error");s.transport=e.name,n.emit("upgradeError",s)}}))}function i(){r||(r=!0,l(),e.close(),e=null)}function u(p){var a=new Error("probe error: "+p);a.transport=e.name,i(),G('probe transport "%s" failed because of error: %s',t,p),n.emit("upgradeError",a)}function h(){u("transport closed")}function d(){u("socket closed")}function c(p){e&&p.name!==e.name&&(G('"%s" works - aborting "%s"',p.name,e.name),i())}function l(){e.removeListener("open",o),e.removeListener("error",u),e.removeListener("close",h),n.removeListener("close",d),n.removeListener("upgrading",c)}e.once("open",o),e.once("error",u),e.once("close",h),this.once("close",d),this.once("upgrading",c),e.open()};W.prototype.onOpen=function(){if(G("socket open"),this.readyState="open",W.priorWebsocketSuccess=this.transport.name==="websocket",this.emit("open"),this.flush(),this.readyState==="open"&&this.upgrade&&this.transport.pause){G("starting upgrade probes");for(var t=0,e=this.upgrades.length;t<e;t++)this.probe(this.upgrades[t])}};W.prototype.onPacket=function(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(G('socket receive: type "%s", data "%s"',t.type,t.data),this.emit("packet",t),this.emit("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var e=new Error("server error");e.code=t.data,this.onError(e);break;case"message":this.emit("data",t.data),this.emit("message",t.data);break}else G('packet received with socket readyState "%s"',this.readyState)};W.prototype.onHandshake=function(t){this.emit("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.onOpen(),this.readyState!=="closed"&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))};W.prototype.onHeartbeat=function(t){clearTimeout(this.pingTimeoutTimer);var e=this;e.pingTimeoutTimer=setTimeout(function(){e.readyState!=="closed"&&e.onClose("ping timeout")},t||e.pingInterval+e.pingTimeout)};W.prototype.setPing=function(){var t=this;clearTimeout(t.pingIntervalTimer),t.pingIntervalTimer=setTimeout(function(){G("writing ping packet - expecting pong within %sms",t.pingTimeout),t.ping(),t.onHeartbeat(t.pingTimeout)},t.pingInterval)};W.prototype.ping=function(){var t=this;this.sendPacket("ping",function(){t.emit("ping")})};W.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emit("drain"):this.flush()};W.prototype.flush=function(){this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(G("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))};W.prototype.write=W.prototype.send=function(t,e,r){return this.sendPacket("message",t,e,r),this};W.prototype.sendPacket=function(t,e,r,n){if(typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r=null),!(this.readyState==="closing"||this.readyState==="closed")){r=r||{},r.compress=r.compress!==!1;var o={type:t,data:e,options:r};this.emit("packetCreate",o),this.writeBuffer.push(o),n&&this.once("flush",n),this.flush()}};W.prototype.close=function(){if(this.readyState==="opening"||this.readyState==="open"){this.readyState="closing";var t=this;this.writeBuffer.length?this.once("drain",function(){this.upgrading?n():e()}):this.upgrading?n():e()}function e(){t.onClose("forced close"),G("socket closing - telling transport to close"),t.transport.close()}function r(){t.removeListener("upgrade",r),t.removeListener("upgradeError",r),e()}function n(){t.once("upgrade",r),t.once("upgradeError",r)}return this};W.prototype.onError=function(t){G("socket error %j",t),W.priorWebsocketSuccess=!1,this.emit("error",t),this.onClose("transport error",t)};W.prototype.onClose=function(t,e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){G('socket close with reason: "%s"',t);var r=this;clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",t,e),r.writeBuffer=[],r.prevBufferLen=0}};W.prototype.filterUpgrades=function(t){for(var e=[],r=0,n=t.length;r<n;r++)~co(this.transports,t[r])&&e.push(t[r]);return e};Ce.exports=po;Ce.exports.parser=bt;var lo=Ce.exports,mr={exports:{}},fo=yo;function yo(t,e){var r=[];e=e||0;for(var n=e||0;n<t.length;n++)r[n-e]=t[n];return r}var vr=go;function go(t,e,r){return t.on(e,r),{destroy:function(){t.removeListener(e,r)}}}var He=[].slice,br=function(t,e){if(typeof e=="string"&&(e=t[e]),typeof e!="function")throw new Error("bind() requires a function");var r=He.call(arguments,2);return function(){return e.apply(t,r.concat(He.call(arguments)))}};(function(t,e){var r=Kt,n=St,o=fo,i=vr,u=br,h=lt("socket.io-client:socket"),d=Et,c=sr;t.exports=a;var l={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},p=n.prototype.emit;function a(s,f,y){this.io=s,this.nsp=f,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,this.flags={},y&&y.query&&(this.query=y.query),this.io.autoConnect&&this.open()}n(a.prototype),a.prototype.subEvents=function(){if(!this.subs){var s=this.io;this.subs=[i(s,"open",u(this,"onopen")),i(s,"packet",u(this,"onpacket")),i(s,"close",u(this,"onclose"))]}},a.prototype.open=a.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.reconnecting||this.io.open(),this.io.readyState==="open"&&this.onopen(),this.emit("connecting"),this)},a.prototype.send=function(){var s=o(arguments);return s.unshift("message"),this.emit.apply(this,s),this},a.prototype.emit=function(s){if(l.hasOwnProperty(s))return p.apply(this,arguments),this;var f=o(arguments),y={type:(this.flags.binary!==void 0?this.flags.binary:c(f))?r.BINARY_EVENT:r.EVENT,data:f};return y.options={},y.options.compress=!this.flags||this.flags.compress!==!1,typeof f[f.length-1]=="function"&&(h("emitting packet with ack id %d",this.ids),this.acks[this.ids]=f.pop(),y.id=this.ids++),this.connected?this.packet(y):this.sendBuffer.push(y),this.flags={},this},a.prototype.packet=function(s){s.nsp=this.nsp,this.io.packet(s)},a.prototype.onopen=function(){if(h("transport is open - connecting"),this.nsp!=="/")if(this.query){var s=typeof this.query=="object"?d.encode(this.query):this.query;h("sending connect packet with query %s",s),this.packet({type:r.CONNECT,query:s})}else this.packet({type:r.CONNECT})},a.prototype.onclose=function(s){h("close (%s)",s),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",s)},a.prototype.onpacket=function(s){var f=s.nsp===this.nsp,y=s.type===r.ERROR&&s.nsp==="/";if(!(!f&&!y))switch(s.type){case r.CONNECT:this.onconnect();break;case r.EVENT:this.onevent(s);break;case r.BINARY_EVENT:this.onevent(s);break;case r.ACK:this.onack(s);break;case r.BINARY_ACK:this.onack(s);break;case r.DISCONNECT:this.ondisconnect();break;case r.ERROR:this.emit("error",s.data);break}},a.prototype.onevent=function(s){var f=s.data||[];h("emitting event %j",f),s.id!=null&&(h("attaching ack callback to event"),f.push(this.ack(s.id))),this.connected?p.apply(this,f):this.receiveBuffer.push(f)},a.prototype.ack=function(s){var f=this,y=!1;return function(){if(!y){y=!0;var g=o(arguments);h("sending ack %j",g),f.packet({type:c(g)?r.BINARY_ACK:r.ACK,id:s,data:g})}}},a.prototype.onack=function(s){var f=this.acks[s.id];typeof f=="function"?(h("calling ack %s with %j",s.id,s.data),f.apply(this,s.data),delete this.acks[s.id]):h("bad ack %s",s.id)},a.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emitBuffered(),this.emit("connect")},a.prototype.emitBuffered=function(){var s;for(s=0;s<this.receiveBuffer.length;s++)p.apply(this,this.receiveBuffer[s]);for(this.receiveBuffer=[],s=0;s<this.sendBuffer.length;s++)this.packet(this.sendBuffer[s]);this.sendBuffer=[]},a.prototype.ondisconnect=function(){h("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},a.prototype.destroy=function(){if(this.subs){for(var s=0;s<this.subs.length;s++)this.subs[s].destroy();this.subs=null}this.io.destroy(this)},a.prototype.close=a.prototype.disconnect=function(){return this.connected&&(h("performing disconnect (%s)",this.nsp),this.packet({type:r.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},a.prototype.compress=function(s){return this.flags.compress=s,this},a.prototype.binary=function(s){return this.flags.binary=s,this}})(mr);var kr=mr.exports,mo=Nt;function Nt(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Nt.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),r=Math.floor(e*this.jitter*t);t=Math.floor(e*10)&1?t+r:t-r}return Math.min(t,this.max)|0};Nt.prototype.reset=function(){this.attempts=0};Nt.prototype.setMin=function(t){this.ms=t};Nt.prototype.setMax=function(t){this.max=t};Nt.prototype.setJitter=function(t){this.jitter=t};var vo=lo,bo=kr,ko=St,Co=Kt,ft=vr,Ct=br,Z=lt("socket.io-client:manager"),Cr=yr,wo=mo,wr=Object.prototype.hasOwnProperty,Je=K;function K(t,e){if(!(this instanceof K))return new K(t,e);t&&typeof t=="object"&&(e=t,t=void 0),e=e||{},e.path=e.path||"/socket.io",this.nsps={},this.subs=[],this.opts=e,this.reconnection(e.reconnection!==!1),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor(e.randomizationFactor||.5),this.backoff=new wo({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(e.timeout==null?2e4:e.timeout),this.readyState="closed",this.uri=t,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var r=e.parser||Co;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this.autoConnect=e.autoConnect!==!1,this.autoConnect&&this.open()}K.prototype.emitAll=function(){this.emit.apply(this,arguments);for(var t in this.nsps)wr.call(this.nsps,t)&&this.nsps[t].emit.apply(this.nsps[t],arguments)};K.prototype.updateSocketIds=function(){for(var t in this.nsps)wr.call(this.nsps,t)&&(this.nsps[t].id=this.generateId(t))};K.prototype.generateId=function(t){return(t==="/"?"":t+"#")+this.engine.id};ko(K.prototype);K.prototype.reconnection=function(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection};K.prototype.reconnectionAttempts=function(t){return arguments.length?(this._reconnectionAttempts=t,this):this._reconnectionAttempts};K.prototype.reconnectionDelay=function(t){return arguments.length?(this._reconnectionDelay=t,this.backoff&&this.backoff.setMin(t),this):this._reconnectionDelay};K.prototype.randomizationFactor=function(t){return arguments.length?(this._randomizationFactor=t,this.backoff&&this.backoff.setJitter(t),this):this._randomizationFactor};K.prototype.reconnectionDelayMax=function(t){return arguments.length?(this._reconnectionDelayMax=t,this.backoff&&this.backoff.setMax(t),this):this._reconnectionDelayMax};K.prototype.timeout=function(t){return arguments.length?(this._timeout=t,this):this._timeout};K.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()};K.prototype.open=K.prototype.connect=function(t,e){if(Z("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;Z("opening %s",this.uri),this.engine=vo(this.uri,this.opts);var r=this.engine,n=this;this.readyState="opening",this.skipReconnect=!1;var o=ft(r,"open",function(){n.onopen(),t&&t()}),i=ft(r,"error",function(d){if(Z("connect_error"),n.cleanup(),n.readyState="closed",n.emitAll("connect_error",d),t){var c=new Error("Connection error");c.data=d,t(c)}else n.maybeReconnectOnOpen()});if(this._timeout!==!1){var u=this._timeout;Z("connect attempt will timeout after %d",u),u===0&&o.destroy();var h=setTimeout(function(){Z("connect attempt timed out after %d",u),o.destroy(),r.close(),r.emit("error","timeout"),n.emitAll("connect_timeout",u)},u);this.subs.push({destroy:function(){clearTimeout(h)}})}return this.subs.push(o),this.subs.push(i),this};K.prototype.onopen=function(){Z("open"),this.cleanup(),this.readyState="open",this.emit("open");var t=this.engine;this.subs.push(ft(t,"data",Ct(this,"ondata"))),this.subs.push(ft(t,"ping",Ct(this,"onping"))),this.subs.push(ft(t,"pong",Ct(this,"onpong"))),this.subs.push(ft(t,"error",Ct(this,"onerror"))),this.subs.push(ft(t,"close",Ct(this,"onclose"))),this.subs.push(ft(this.decoder,"decoded",Ct(this,"ondecoded")))};K.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")};K.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)};K.prototype.ondata=function(t){this.decoder.add(t)};K.prototype.ondecoded=function(t){this.emit("packet",t)};K.prototype.onerror=function(t){Z("error",t),this.emitAll("error",t)};K.prototype.socket=function(t,e){var r=this.nsps[t];if(!r){r=new bo(this,t,e),this.nsps[t]=r;var n=this;r.on("connecting",o),r.on("connect",function(){r.id=n.generateId(t)}),this.autoConnect&&o()}function o(){~Cr(n.connecting,r)||n.connecting.push(r)}return r};K.prototype.destroy=function(t){var e=Cr(this.connecting,t);~e&&this.connecting.splice(e,1),!this.connecting.length&&this.close()};K.prototype.packet=function(t){Z("writing packet %j",t);var e=this;t.query&&t.type===0&&(t.nsp+="?"+t.query),e.encoding?e.packetBuffer.push(t):(e.encoding=!0,this.encoder.encode(t,function(r){for(var n=0;n<r.length;n++)e.engine.write(r[n],t.options);e.encoding=!1,e.processPacketQueue()}))};K.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var t=this.packetBuffer.shift();this.packet(t)}};K.prototype.cleanup=function(){Z("cleanup");for(var t=this.subs.length,e=0;e<t;e++){var r=this.subs.shift();r.destroy()}this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()};K.prototype.close=K.prototype.disconnect=function(){Z("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,this.readyState==="opening"&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()};K.prototype.onclose=function(t){Z("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",t),this._reconnection&&!this.skipReconnect&&this.reconnect()};K.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var t=this;if(this.backoff.attempts>=this._reconnectionAttempts)Z("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var e=this.backoff.duration();Z("will wait %dms before reconnect attempt",e),this.reconnecting=!0;var r=setTimeout(function(){t.skipReconnect||(Z("attempting reconnect"),t.emitAll("reconnect_attempt",t.backoff.attempts),t.emitAll("reconnecting",t.backoff.attempts),!t.skipReconnect&&t.open(function(n){n?(Z("reconnect attempt error"),t.reconnecting=!1,t.reconnect(),t.emitAll("reconnect_error",n.data)):(Z("reconnect success"),t.onreconnect())}))},e);this.subs.push({destroy:function(){clearTimeout(r)}})}};K.prototype.onreconnect=function(){var t=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",t)};(function(t,e){var r=tn,n=Kt,o=Je,i=lt("socket.io-client");t.exports=e=h;var u=e.managers={};function h(d,c){typeof d=="object"&&(c=d,d=void 0),c=c||{};var l=r(d),p=l.source,a=l.id,s=l.path,f=u[a]&&s in u[a].nsps,y=c.forceNew||c["force new connection"]||c.multiplex===!1||f,g;return y?(i("ignoring socket cache for %s",p),g=o(p,c)):(u[a]||(i("new io instance for %s",p),u[a]=o(p,c)),g=u[a]),l.query&&!c.query&&(c.query=l.query),g.socket(l.path,c)}e.protocol=n.protocol,e.connect=h,e.Manager=Je,e.Socket=kr})(pe,pe.exports);var So=pe.exports;const Eo=qr(So);let jt;const Ao=new Uint8Array(16);function To(){if(!jt&&(jt=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!jt))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return jt(Ao)}const Q=[];for(let t=0;t<256;++t)Q.push((t+256).toString(16).slice(1));function No(t,e=0){return Q[t[e+0]]+Q[t[e+1]]+Q[t[e+2]]+Q[t[e+3]]+"-"+Q[t[e+4]]+Q[t[e+5]]+"-"+Q[t[e+6]]+Q[t[e+7]]+"-"+Q[t[e+8]]+Q[t[e+9]]+"-"+Q[t[e+10]]+Q[t[e+11]]+Q[t[e+12]]+Q[t[e+13]]+Q[t[e+14]]+Q[t[e+15]]}const Oo=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ve={randomUUID:Oo};function xo(t,e,r){if(Ve.randomUUID&&!e&&!t)return Ve.randomUUID();t=t||{};const n=t.random||(t.rng||To)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(let o=0;o<16;++o)e[r+o]=n[o];return e}return No(n)}function Ro(t,e){const r=e.map(o=>JSON.stringify(o)).join(" "),n=new Date().toISOString();return JSON.stringify({level:t,time:n,message:r})}function Io(t,e){const r=JSON.parse(t);return e.forEach(n=>delete r[n]),r}function Bo(t){if(typeof t=="object"&&t!==null)return t;try{return JSON.parse(t)}catch{return{extraData:t}}}function _o(t){const e=/\(([^)]+)\)/,r=t.match(e);if(r&&r[1]){const n=r[1].split(";");for(let o of n)if(o=o.trim(),o.startsWith("Windows")||o.startsWith("Macintosh")||o.startsWith("Linux"))return o}return"Unknown"}function $e(t){return(...e)=>new Promise((r,n)=>{try{const o=t(...e);r(o)}catch(o){n(o)}})}const Lo={reconnection:!0,reconnectionDelay:5e3,reconnectionAttempts:10,upgrade:!1,transports:["websocket"],debug:!1},ae={logToConsole:!0,overloadGlobalConsole:!1,socketEmitInterval:6e4},at={CREATE:"Create",READ:"Read",UPDATE:"Update",DELETE:"Delete",CONVERT:"Convert",DOWNLOAD:"Download",UPLOAD:"Upload",ENCRYPT:"Encrypt",DECRYPT:"Decrypt",FILTER:"Filter",INPUT:"Input",OUTPUT:"Output",PLUGIN:"Plugin",LOGIN:"Login",LOGOUT:"Logout",REFRESH:"Refresh",CHECK:"Check",WEBHOOK:"Webhook",WSCONNECT:"WSConnect"},Uo={Create:1,Read:2,Update:3,Delete:4,Convert:5,Download:6,Upload:7,Encrypt:8,Decrypt:9,Filter:10,Input:11,Output:12,Plugin:13,Login:14,Logout:15,Refresh:16,Check:17,Webhook:18,WSConnect:19},ct={INFO:"info",WARNING:"warning",MODIFY:"modify",ERROR:"error",VIEW:"view"},tt={INFO:"info",WARNING:"warning",ERROR:"error",DEBUG:"debug"};let rt=console;class Do{constructor(e){V(this,"logToConsole"),V(this,"overloadGlobalConsole"),V(this,"system"),V(this,"socketEmitInterval"),V(this,"storageId"),V(this,"emitInProgress"),V(this,"queue"),V(this,"processing"),V(this,"storageInitialized"),V(this,"interval"),V(this,"logIndex"),V(this,"socket"),V(this,"staticObject",{}),V(this,"localObject",{}),V(this,"isGetItemAsync"),V(this,"isSetItemAsync"),V(this,"getItem"),V(this,"setItem"),V(this,"parseLog"),V(this,"_logMethod"),V(this,"_warnMethod"),V(this,"_errorMethod"),V(this,"_debugMethod");const{loggerOptions:r}=e;if(!r.system)throw new Error("Config property 'system' should be provided!");this.isGetItemAsync=r.isGetItemAsync||!1,this.isSetItemAsync=r.isSetItemAsync||!1,this.setupStorageFunctions(r.getItem,r.setItem,r.parseLog),this.system=r.system,this.socketEmitInterval=r.socketEmitInterval||ae.socketEmitInterval,this.logToConsole=r.logToConsole!==void 0?r.logToConsole:ae.logToConsole,this.overloadGlobalConsole=r.overloadGlobalConsole!==void 0?r.overloadGlobalConsole:ae.overloadGlobalConsole,this.storageId=this.getStorageName(),this.queue=[],this.processing=!1,this.storageInitialized=!1,this.emitInProgress=!1,this.logIndex=0,this.init(e)}setupStorageFunctions(e,r,n){this.getItem=e&&typeof e=="function"?this.isGetItemAsync?e:$e(e):this.defaultGetItemFunction,this.setItem=r&&typeof r=="function"?this.isSetItemAsync?r:$e(r):this.defaultSetItemFunction,this.parseLog=n&&typeof n=="function"?n:Ro}init(e){const{socket:r,url:n,socketOptions:o={}}=e;this._logMethod=rt.log.bind(rt),this._warnMethod=rt.warn.bind(rt),this._errorMethod=rt.error.bind(rt),this._debugMethod=rt.debug.bind(rt),this.initStorage().then(()=>{if(r)this.socket=r;else if(n)this.socket=this.createConnection(n,o);else throw new Error("Must provide either a 'socket' or a 'url' for socket connection");this.interval=setInterval(async()=>{await this.emitLogs()},this.socketEmitInterval),this.overloadGlobalConsole&&this._overloadConsole()})}createConnection(e,r={}){const n={...Lo,...r};return Eo(e,n)}async emitLogs(){if(!this.emitInProgress)try{const e=await this.getItem(this.storageId),r=JSON.parse(e||"{}"),n={...this.localObject,...r};if(!Object.keys(n).length)return;const o=[];this.emitInProgress=!0;const i=Object.keys(n);if(!i.length)return;if(!this.socket||!this.socket.connected)throw new Error("Socket is disconnected");for(const d of i){const c=Bo(n[d]),l={...this.staticObject,...c},p=this.populateSendingLog(l);await this.socket.emit("Log",JSON.stringify(p)),o.push(d)}const u=await this.getItem(this.storageId);if(!u)return;const h=Io(u,o);this.localObject={},await this.setItem(this.storageId,JSON.stringify(h))}catch(e){this._errorMethod(e)}finally{this.emitInProgress=!1}}populateSendingLog(e){const r={...e},n=r.ActionName;return n&&(r.ActionID=Uo[n]),r}setupStaticFields(e){this.staticObject={...e}}populateMetaData(){const e=new Date;let r;typeof window<"u"&&typeof window.document<"u"?r=window==null?void 0:window.navigator.userAgent:typeof self<"u"&&self.navigator&&(r=self.navigator.userAgent);let n;return r&&(n=_o(r)),{System:this.system,DateTime:e,UserAgent:r,OSVersion:n}}disconnectSocket(){!this.socket||!this.interval||(this.socket.disconnect(),clearInterval(this.interval))}_overloadConsole(){rt=Object.assign(rt,{log:e=>{this.log(e)},warn:e=>{this.warn(e)},error:e=>{this.error(e)},debug:e=>{this.debug(e)}})}async initStorage(){const e=await this.getItem(this.storageId);(!e||typeof e!="string")&&(await this.setItem(this.storageId,JSON.stringify({})),this.storageInitialized=!0)}async resetStorage(){await this.setItem(this.storageId,JSON.stringify({}))}getStorageName(){const e=xo();return this.system.toString().toUpperCase()+e+Date.now()}async processLog(...e){try{if(e.length<2)return;const r=e[0],n=e[1],o=this.formItemKey(r);if(!this.storageInitialized){this.localObject={...this.localObject,[o]:n};return}const i=await this.getItem(this.storageId);if(!i)return;const u=JSON.parse(i);u[o]=JSON.stringify(n),await this.setItem(this.storageId,JSON.stringify(u))}catch(r){this._errorMethod(r)}}async processQueue(){if(this.processing||this.queue.length===0)return;const e=this.queue.shift();e&&(this.processing=!0,await this.processLog(...e).finally(()=>{this.processing=!1,this.processQueue()}))}log(e){const r={...this.populateMetaData(),...e},n=["INFO",r];this.queue.push(n),this.logToConsole&&this._logMethod.apply(rt,[r]),this.processQueue()}warn(e){const r=["WARN",e];this.queue.push(r),this.logToConsole&&this._warnMethod.apply(rt,[e]),this.processQueue()}error(e){const r=["ERROR",e];this.queue.push(r),this.logToConsole&&this._errorMethod.apply(rt,[e]),this.processQueue()}debug(e){const r=["DEBUG",e];this.queue.push(r),this.logToConsole&&this._debugMethod.apply(rt,[e]),this.processQueue()}async defaultGetItemFunction(e){return localStorage.getItem(e)}async defaultSetItemFunction(e,r){try{localStorage.setItem(e,r)}catch(n){this._errorMethod(n)}}formItemKey(e){const r=new Date().toISOString();return this.logIndex++,`${e}-${this.system}-${r}-${this.logIndex}`}}class Po{constructor(e){H(this,"delay",1e3);H(this,"lastLoginTimestamp");H(this,"token");H(this,"storageKey");this.eventsSdkClass=e,this.eventsSdkClass=e,this.storageKey=""}async login(e){const r={token:e.token,email:e.email,password:e.password};if(this.storageKey=Fr(JSON.stringify({...e,loggerSocketConnection:null})),this.lastLoginTimestamp&&this.lastLoginTimestamp+this.delay>new Date().getTime())return;this.updateLastLoginTimestamp();const n=await this.checkLoginStatus(this.storageKey);return n||(It.clearSessionStorage(),await this.userLoginFunction(r,this.storageKey,e.loginType))}updateLastLoginTimestamp(){this.lastLoginTimestamp=new Date().getTime()}async checkLoginStatus(e){const r=await It.getSessionStorageDataByKey(e);if(r)return r}async userLoginFunction(e,r,n){let o,i,u;return this.eventsSdkClass.options.isNewStack?(o=await this.externalLogin(this.eventsSdkClass.options.loginUrl,e,n),i=await this.getSettings(o.Data.AccessToken),u={...o.Data,...i}):(o=await this.externalLogin(this.eventsSdkClass.options.loginUrl,e,n),u={...o.Data.Socket}),await It.updateSessionStorageKey(r,u),u}onLoginResponse(e){if(!this.eventsSdkClass.options.isNewStack&&this.eventsSdkClass.options.servers&&(this.eventsSdkClass.servers=[...this.eventsSdkClass.options.servers],this.eventsSdkClass.server=this.eventsSdkClass.servers.reduce((r,n)=>r.Priority>n.Priority?r:n)),this.eventsSdkClass.options.isNewStack&&this.eventsSdkClass.options.servers&&(this.eventsSdkClass.servers=[...this.eventsSdkClass.options.servers],this.eventsSdkClass.server=this.eventsSdkClass.servers.reduce((r,n)=>r.Priority>n.Priority?r:n)),e.MonitorList&&e.MonitorList.length&&(this.eventsSdkClass.servers=[...e.MonitorList],this.eventsSdkClass.server=this.eventsSdkClass.servers.reduce((r,n)=>r.Priority>n.Priority?r:n)),!this.eventsSdkClass.options.isNewStack&&!this.eventsSdkClass.servers.length&&e.URLList&&(this.eventsSdkClass.URLList=e.URLList),!this.eventsSdkClass.options.isNewStack&&!this.eventsSdkClass.URLList.length&&!this.eventsSdkClass.servers.length)throw new Error("Socket servers not defined");if(this.eventsSdkClass.options.isNewStack&&!this.eventsSdkClass.servers.length)throw new Error("Socket servers not defined");this.eventsSdkClass.server&&this.eventsSdkClass.socketIoClass.getSocketIoFunction(`v=${this.eventsSdkClass.server.Version}`),!this.eventsSdkClass.server&&this.eventsSdkClass.URLList.length&&this.eventsSdkClass.socketIoClass.getSocketIoFunction(`v=${e.Version}`),e.IdentityCode&&(this.token=e.IdentityCode,this.eventsSdkClass.connect(vt.MAIN)),e.Token&&(this.token=e.Token,this.eventsSdkClass.connect(vt.MAIN)),e.RefreshToken&&e.IdentityCodeExpiry&&this.eventsSdkClass.options.loginType===st.USER&&(this.eventsSdkClass.options.refreshToken=e.RefreshToken,this.eventsSdkClass.options.tokenExpiry=e.IdentityCodeExpiry,this.handleTokenExpiry()),e.RefreshToken&&e.TokenExpiry&&this.normalizeLoginType(this.eventsSdkClass.options.loginType)===st.USER&&(this.eventsSdkClass.options.refreshToken=e.RefreshToken,this.eventsSdkClass.options.tokenExpiry=e.TokenExpiry,this.handleTokenExpiry())}handleTokenExpiry(){if(!this.eventsSdkClass.options.refreshTokenUrl)throw new Error("refreshTokenUrl not provided");let e;if(this.eventsSdkClass.options.tokenExpiry)e=new Date(this.eventsSdkClass.options.tokenExpiry);else return;const r=e.getTime()-new Date().getTime()-5e3,n=Math.min(r,2147483647);setTimeout(async()=>{if(this.eventsSdkClass.options.refreshToken){this.eventsSdkClass.socketIoClass.closeAllConnections();let o,i;if(this.eventsSdkClass.options.isNewStack){const u=await this.refreshToken(this.eventsSdkClass.options.refreshTokenUrl,this.eventsSdkClass.options.refreshToken);o=await this.getSettings(u.Data.AccessToken),i={...u.Data,...o}}else i={...(await this.refreshToken(this.eventsSdkClass.options.refreshTokenUrl,this.eventsSdkClass.options.refreshToken)).Data.Socket};this.onLoginResponse(i),await It.updateSessionStorageKey(this.storageKey,i)}},n)}async externalLogin(e,{password:r,token:n,email:o},i){if(!e)throw new Error("loginUrl not provided");let u;this.eventsSdkClass.options.isNewStack?i===st.TOKEN?u=JSON.stringify({identityType:st.TOKEN,token:n}):u=JSON.stringify({identityType:st.USER,username:o,password:r}):this.eventsSdkClass.options.loginType===st.TOKEN?(u=JSON.stringify({token:n}),e=`${e}/${st.TOKEN}`):(u=JSON.stringify({email:o,pin:r}),e=`${e}/${st.USER}`);try{const h=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:u});if(!h.ok&&h.status===400)throw new Error("Bad body request. Login type or isNewStack values not correct or not provided");if(!h.ok&&h.status===401)throw new Error("Unauthorized. Invalid token provided");if(!h.ok&&h.status===403)throw new Error("Forbidden. Identity token not provided or not valid");const d=await h.json();if(d.error)throw new Error(d.error);return d}catch(h){throw this.eventsSdkClass.loggerClass.log({Message:`External login request error with the login type ${st} ${i===st.TOKEN?{token:n}:{email:o,pin:r}}`,ActionName:at.WSCONNECT,isShowClient:!1,Status:"External login error",StatusCode:400,Level:tt.ERROR,LogType:ct.ERROR}),h}}async getSettings(e){try{if(!this.eventsSdkClass.options.getSettingsUrl)throw new Error("getSettingsUrl not provided");const r=await fetch(this.eventsSdkClass.options.getSettingsUrl,{headers:{Authorization:`Bearer ${e}`}});if(!r.ok&&r.status===401)throw new Error("Unauthorized. Access token not provided or not valid");return r.json()}catch(r){throw this.eventsSdkClass.loggerClass.log({Message:`Get settings error with token ${e}, error: ${r}`,ActionName:at.WSCONNECT,isShowClient:!1,Status:"Get settings error",StatusCode:400,Level:tt.ERROR,LogType:ct.ERROR}),r}}async refreshToken(e,r){try{return(await fetch(e,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`}})).json()}catch(n){throw this.eventsSdkClass.loggerClass.log({Message:`Refresh token error with old refresh token ${r}, url: ${e}, error: ${n}`,ActionName:at.WSCONNECT,isShowClient:!1,Status:"Get settings error",StatusCode:400,Level:tt.ERROR,LogType:ct.ERROR}),n}}normalizeLoginType(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}}const Fo={loginUrl:"https://loginapi.voicenter.co.il/monitorAPI/Login",refreshTokenUrl:"https://loginapi.voicenter.co.il/monitorAPI/RefreshIdentityToken",isNewStack:!1,forceNew:!0,reconnectionDelay:1e4,reconnectionDelayMax:1e4,maxReconnectAttempts:5,timeout:1e4,keepAliveTimeout:6e4,idleInterval:6e4*5,protocol:"https",transports:["websocket"],upgrade:!1,serverFetchStrategy:"static",serverType:0,useLogger:!0,loggerServer:"https://socketlog.voicenter.co",loggerConfig:{logToConsole:!0,overloadGlobalConsole:!1,system:"events-sdk",socketEmitInterval:1e4},loggerConnectOptions:{reconnection:!0,reconnectionDelay:5e3,reconnectionAttempts:10,perMessageDeflate:void 0,upgrade:!1,transports:["websocket"],debug:!1}};function jo(){return typeof window<"u"&&(typeof window.navigator>"u"||typeof window.navigator.userAgent>"u")&&(window.navigator.userAgent="react-native"),function t(e,r,n){function o(h,d){if(!r[h]){if(!e[h]){var c=typeof require=="function"&&require;if(!d&&c)return c(h,!0);if(i)return i(h,!0);throw new Error("Cannot find module '"+h+"'")}var l=r[h]={exports:{}};e[h][0].call(l.exports,function(p){var a=e[h][1][p];return o(a||p)},l,l.exports,t,e,r,n)}return r[h].exports}for(var i=typeof require=="function"&&require,u=0;u<n.length;u++)o(n[u]);return o}({1:[function(t,e){e.exports=t("./lib/")},{"./lib/":2}],2:[function(t,e,r){function n(c,l){typeof c=="object"&&(l=c,c=void 0),l=l||{};var p,a=o(c),s=a.source,f=a.id;return l.forceNew||l["force new connection"]||l.multiplex===!1?(h("ignoring socket cache for %s",s),p=u(s,l)):(d[f]||(h("new io instance for %s",s),d[f]=u(s,l)),p=d[f]),p.socket(a.path)}var o=t("./url"),i=t("socket.io-parser"),u=t("./manager"),h=t("debug")("socket.io-client");e.exports=r=n;var d=r.managers={};r.protocol=i.protocol,r.connect=n,r.Manager=t("./manager"),r.Socket=t("./socket")},{"./manager":3,"./socket":5,"./url":6,debug:10,"socket.io-parser":44}],3:[function(t,e){function r(a,s){return this instanceof r?(a&&typeof a=="object"&&(s=a,a=void 0),s=s||{},s.path=s.path||"/socket.io",this.nsps={},this.subs=[],this.opts=s,this.reconnection(s.reconnection!==!1),this.reconnectionAttempts(s.reconnectionAttempts||1/0),this.reconnectionDelay(s.reconnectionDelay||1e3),this.reconnectionDelayMax(s.reconnectionDelayMax||5e3),this.randomizationFactor(s.randomizationFactor||.5),this.backoff=new p({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(s.timeout==null?2e4:s.timeout),this.readyState="closed",this.uri=a,this.connected=[],this.encoding=!1,this.packetBuffer=[],this.encoder=new u.Encoder,this.decoder=new u.Decoder,this.autoConnect=s.autoConnect!==!1,void(this.autoConnect&&this.open())):new r(a,s)}var n=(t("./url"),t("engine.io-client")),o=t("./socket"),i=t("component-emitter"),u=t("socket.io-parser"),h=t("./on"),d=t("component-bind"),c=(t("object-component"),t("debug")("socket.io-client:manager")),l=t("indexof"),p=t("backo2");e.exports=r,r.prototype.emitAll=function(){this.emit.apply(this,arguments);for(var a in this.nsps)this.nsps[a].emit.apply(this.nsps[a],arguments)},r.prototype.updateSocketIds=function(){for(var a in this.nsps)this.nsps[a].id=this.engine.id},i(r.prototype),r.prototype.reconnection=function(a){return arguments.length?(this._reconnection=!!a,this):this._reconnection},r.prototype.reconnectionAttempts=function(a){return arguments.length?(this._reconnectionAttempts=a,this):this._reconnectionAttempts},r.prototype.reconnectionDelay=function(a){return arguments.length?(this._reconnectionDelay=a,this.backoff&&this.backoff.setMin(a),this):this._reconnectionDelay},r.prototype.randomizationFactor=function(a){return arguments.length?(this._randomizationFactor=a,this.backoff&&this.backoff.setJitter(a),this):this._randomizationFactor},r.prototype.reconnectionDelayMax=function(a){return arguments.length?(this._reconnectionDelayMax=a,this.backoff&&this.backoff.setMax(a),this):this._reconnectionDelayMax},r.prototype.timeout=function(a){return arguments.length?(this._timeout=a,this):this._timeout},r.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()},r.prototype.open=r.prototype.connect=function(a){if(c("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;c("opening %s",this.uri),this.engine=n(this.uri,this.opts);var s=this.engine,f=this;this.readyState="opening",this.skipReconnect=!1;var y=h(s,"open",function(){f.onopen(),a&&a()}),g=h(s,"error",function(_){if(c("connect_error"),f.cleanup(),f.readyState="closed",f.emitAll("connect_error",_),a){var k=new Error("Connection error");k.data=_,a(k)}else f.maybeReconnectOnOpen()});if(this._timeout!==!1){var w=this._timeout;c("connect attempt will timeout after %d",w);var B=setTimeout(function(){c("connect attempt timed out after %d",w),y.destroy(),s.close(),s.emit("error","timeout"),f.emitAll("connect_timeout",w)},w);this.subs.push({destroy:function(){clearTimeout(B)}})}return this.subs.push(y),this.subs.push(g),this},r.prototype.onopen=function(){c("open"),this.cleanup(),this.readyState="open",this.emit("open");var a=this.engine;this.subs.push(h(a,"data",d(this,"ondata"))),this.subs.push(h(this.decoder,"decoded",d(this,"ondecoded"))),this.subs.push(h(a,"error",d(this,"onerror"))),this.subs.push(h(a,"close",d(this,"onclose")))},r.prototype.ondata=function(a){this.decoder.add(a)},r.prototype.ondecoded=function(a){this.emit("packet",a)},r.prototype.onerror=function(a){c("error",a),this.emitAll("error",a)},r.prototype.socket=function(a){var s=this.nsps[a];if(!s){s=new o(this,a),this.nsps[a]=s;var f=this;s.on("connect",function(){s.id=f.engine.id,~l(f.connected,s)||f.connected.push(s)})}return s},r.prototype.destroy=function(a){var s=l(this.connected,a);~s&&this.connected.splice(s,1),this.connected.length||this.close()},r.prototype.packet=function(a){c("writing packet %j",a);var s=this;s.encoding?s.packetBuffer.push(a):(s.encoding=!0,this.encoder.encode(a,function(f){for(var y=0;y<f.length;y++)s.engine.write(f[y]);s.encoding=!1,s.processPacketQueue()}))},r.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var a=this.packetBuffer.shift();this.packet(a)}},r.prototype.cleanup=function(){for(var a;a=this.subs.shift();)a.destroy();this.packetBuffer=[],this.encoding=!1,this.decoder.destroy()},r.prototype.close=r.prototype.disconnect=function(){this.skipReconnect=!0,this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},r.prototype.onclose=function(a){c("close"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",a),this._reconnection&&!this.skipReconnect&&this.reconnect()},r.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var a=this;if(this.backoff.attempts>=this._reconnectionAttempts)c("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var s=this.backoff.duration();c("will wait %dms before reconnect attempt",s),this.reconnecting=!0;var f=setTimeout(function(){a.skipReconnect||(c("attempting reconnect"),a.emitAll("reconnect_attempt",a.backoff.attempts),a.emitAll("reconnecting",a.backoff.attempts),a.skipReconnect||a.open(function(y){y?(c("reconnect attempt error"),a.reconnecting=!1,a.reconnect(),a.emitAll("reconnect_error",y.data)):(c("reconnect success"),a.onreconnect())}))},s);this.subs.push({destroy:function(){clearTimeout(f)}})}},r.prototype.onreconnect=function(){var a=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",a)}},{"./on":4,"./socket":5,"./url":6,backo2:7,"component-bind":8,"component-emitter":9,debug:10,"engine.io-client":11,indexof:40,"object-component":41,"socket.io-parser":44}],4:[function(t,e){function r(n,o,i){return n.on(o,i),{destroy:function(){n.removeListener(o,i)}}}e.exports=r},{}],5:[function(t,e,r){function n(s,f){this.io=s,this.nsp=f,this.json=this,this.ids=0,this.acks={},this.io.autoConnect&&this.open(),this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0}var o=t("socket.io-parser"),i=t("component-emitter"),u=t("to-array"),h=t("./on"),d=t("component-bind"),c=t("debug")("socket.io-client:socket"),l=t("has-binary");e.exports=n;var p={connect:1,connect_error:1,connect_timeout:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1},a=i.prototype.emit;i(n.prototype),n.prototype.subEvents=function(){if(!this.subs){var s=this.io;this.subs=[h(s,"open",d(this,"onopen")),h(s,"packet",d(this,"onpacket")),h(s,"close",d(this,"onclose"))]}},n.prototype.open=n.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),this.io.readyState=="open"&&this.onopen(),this)},n.prototype.send=function(){var s=u(arguments);return s.unshift("message"),this.emit.apply(this,s),this},n.prototype.emit=function(s){if(p.hasOwnProperty(s))return a.apply(this,arguments),this;var f=u(arguments),y=o.EVENT;l(f)&&(y=o.BINARY_EVENT);var g={type:y,data:f};return typeof f[f.length-1]=="function"&&(c("emitting packet with ack id %d",this.ids),this.acks[this.ids]=f.pop(),g.id=this.ids++),this.connected?this.packet(g):this.sendBuffer.push(g),this},n.prototype.packet=function(s){s.nsp=this.nsp,this.io.packet(s)},n.prototype.onopen=function(){c("transport is open - connecting"),this.nsp!="/"&&this.packet({type:o.CONNECT})},n.prototype.onclose=function(s){c("close (%s)",s),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",s)},n.prototype.onpacket=function(s){if(s.nsp==this.nsp)switch(s.type){case o.CONNECT:this.onconnect();break;case o.EVENT:this.onevent(s);break;case o.BINARY_EVENT:this.onevent(s);break;case o.ACK:this.onack(s);break;case o.BINARY_ACK:this.onack(s);break;case o.DISCONNECT:this.ondisconnect();break;case o.ERROR:this.emit("error",s.data)}},n.prototype.onevent=function(s){var f=s.data||[];c("emitting event %j",f),s.id!=null&&(c("attaching ack callback to event"),f.push(this.ack(s.id))),this.connected?a.apply(this,f):this.receiveBuffer.push(f)},n.prototype.ack=function(s){var f=this,y=!1;return function(){if(!y){y=!0;var g=u(arguments);c("sending ack %j",g);var w=l(g)?o.BINARY_ACK:o.ACK;f.packet({type:w,id:s,data:g})}}},n.prototype.onack=function(s){c("calling ack %s with %j",s.id,s.data);var f=this.acks[s.id];f.apply(this,s.data),delete this.acks[s.id]},n.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},n.prototype.emitBuffered=function(){var s;for(s=0;s<this.receiveBuffer.length;s++)a.apply(this,this.receiveBuffer[s]);for(this.receiveBuffer=[],s=0;s<this.sendBuffer.length;s++)this.packet(this.sendBuffer[s]);this.sendBuffer=[]},n.prototype.ondisconnect=function(){c("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},n.prototype.destroy=function(){if(this.subs){for(var s=0;s<this.subs.length;s++)this.subs[s].destroy();this.subs=null}this.io.destroy(this)},n.prototype.close=n.prototype.disconnect=function(){return this.connected&&(c("performing disconnect (%s)",this.nsp),this.packet({type:o.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}},{"./on":4,"component-bind":8,"component-emitter":9,debug:10,"has-binary":36,"socket.io-parser":44,"to-array":48}],6:[function(t,e){(function(r){function n(u,c){var d=u,c=c||r.location;return u==null&&(u=c.protocol+"//"+c.host),typeof u=="string"&&(u.charAt(0)=="/"&&(u=u.charAt(1)=="/"?c.protocol+u:c.hostname+u),/^(https?|wss?):\/\//.test(u)||(i("protocol-less url %s",u),u=typeof c<"u"?c.protocol+"//"+u:"https://"+u),i("parse %s",u),d=o(u)),d.port||(/^(http|ws)$/.test(d.protocol)?d.port="80":/^(http|ws)s$/.test(d.protocol)&&(d.port="443")),d.path=d.path||"/",d.id=d.protocol+"://"+d.host+":"+d.port,d.href=d.protocol+"://"+d.host+(c&&c.port==d.port?"":":"+d.port),d}var o=t("parseuri"),i=t("debug")("socket.io-client:url");e.exports=n}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{debug:10,parseuri:42}],7:[function(t,e){function r(n){n=n||{},this.ms=n.min||100,this.max=n.max||1e4,this.factor=n.factor||2,this.jitter=n.jitter>0&&n.jitter<=1?n.jitter:0,this.attempts=0}e.exports=r,r.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var o=Math.random(),i=Math.floor(o*this.jitter*n);n=1&Math.floor(10*o)?n+i:n-i}return 0|Math.min(n,this.max)},r.prototype.reset=function(){this.attempts=0},r.prototype.setMin=function(n){this.ms=n},r.prototype.setMax=function(n){this.max=n},r.prototype.setJitter=function(n){this.jitter=n}},{}],8:[function(t,e){var r=[].slice;e.exports=function(n,o){if(typeof o=="string"&&(o=n[o]),typeof o!="function")throw new Error("bind() requires a function");var i=r.call(arguments,2);return function(){return o.apply(n,i.concat(r.call(arguments)))}}},{}],9:[function(t,e){function r(o){return o?n(o):void 0}function n(o){for(var i in r.prototype)o[i]=r.prototype[i];return o}e.exports=r,r.prototype.on=r.prototype.addEventListener=function(o,i){return this._callbacks=this._callbacks||{},(this._callbacks[o]=this._callbacks[o]||[]).push(i),this},r.prototype.once=function(o,i){function u(){h.off(o,u),i.apply(this,arguments)}var h=this;return this._callbacks=this._callbacks||{},u.fn=i,this.on(o,u),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(o,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var u=this._callbacks[o];if(!u)return this;if(arguments.length==1)return delete this._callbacks[o],this;for(var h,d=0;d<u.length;d++)if(h=u[d],h===i||h.fn===i){u.splice(d,1);break}return this},r.prototype.emit=function(o){this._callbacks=this._callbacks||{};var i=[].slice.call(arguments,1),u=this._callbacks[o];if(u){u=u.slice(0);for(var h=0,d=u.length;d>h;++h)u[h].apply(this,i)}return this},r.prototype.listeners=function(o){return this._callbacks=this._callbacks||{},this._callbacks[o]||[]},r.prototype.hasListeners=function(o){return!!this.listeners(o).length}},{}],10:[function(t,e){function r(o){return r.enabled(o)?function(i){i=n(i);var u=new Date,h=u-(r[o]||u);r[o]=u,i=o+" "+i+" +"+r.humanize(h),window.console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}:function(){}}function n(o){return o instanceof Error?o.stack||o.message:o}e.exports=r,r.names=[],r.skips=[],r.enable=function(o){try{localStorage.debug=o}catch{}for(var i=(o||"").split(/[\s,]+/),u=i.length,h=0;u>h;h++)o=i[h].replace("*",".*?"),o[0]==="-"?r.skips.push(new RegExp("^"+o.substr(1)+"$")):r.names.push(new RegExp("^"+o+"$"))},r.disable=function(){r.enable("")},r.humanize=function(o){var i=1e3,u=6e4,h=60*u;return o>=h?(o/h).toFixed(1)+"h":o>=u?(o/u).toFixed(1)+"m":o>=i?(o/i|0)+"s":o+"ms"},r.enabled=function(o){for(var i=0,u=r.skips.length;u>i;i++)if(r.skips[i].test(o))return!1;for(var i=0,u=r.names.length;u>i;i++)if(r.names[i].test(o))return!0;return!1};try{window.localStorage&&r.enable(localStorage.debug)}catch{}},{}],11:[function(t,e){e.exports=t("./lib/")},{"./lib/":12}],12:[function(t,e){e.exports=t("./socket"),e.exports.parser=t("engine.io-parser")},{"./socket":13,"engine.io-parser":25}],13:[function(t,e){(function(r){function n(s,f){if(!(this instanceof n))return new n(s,f);if(f=f||{},s&&typeof s=="object"&&(f=s,s=null),s&&(s=l(s),f.host=s.host,f.secure=s.protocol=="https"||s.protocol=="wss",f.port=s.port,s.query&&(f.query=s.query)),this.secure=f.secure!=null?f.secure:r.location&&location.protocol=="https:",f.host){var y=f.host.split(":");f.hostname=y.shift(),y.length?f.port=y.pop():f.port||(f.port=this.secure?"443":"80")}this.agent=f.agent||!1,this.hostname=f.hostname||(r.location?location.hostname:"localhost"),this.port=f.port||(r.location&&location.port?location.port:this.secure?443:80),this.query=f.query||{},typeof this.query=="string"&&(this.query=a.decode(this.query)),this.upgrade=f.upgrade!==!1,this.path=(f.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!f.forceJSONP,this.jsonp=f.jsonp!==!1,this.forceBase64=!!f.forceBase64,this.enablesXDR=!!f.enablesXDR,this.timestampParam=f.timestampParam||"t",this.timestampRequests=f.timestampRequests,this.transports=f.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.callbackBuffer=[],this.policyPort=f.policyPort||843,this.rememberUpgrade=f.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=f.onlyBinaryUpgrades,this.pfx=f.pfx||null,this.key=f.key||null,this.passphrase=f.passphrase||null,this.cert=f.cert||null,this.ca=f.ca||null,this.ciphers=f.ciphers||null,this.rejectUnauthorized=f.rejectUnauthorized||null,this.open()}function o(s){var f={};for(var y in s)s.hasOwnProperty(y)&&(f[y]=s[y]);return f}var i=t("./transports"),u=t("component-emitter"),h=t("debug")("engine.io-client:socket"),d=t("indexof"),c=t("engine.io-parser"),l=t("parseuri"),p=t("parsejson"),a=t("parseqs");e.exports=n,n.priorWebsocketSuccess=!1,u(n.prototype),n.protocol=c.protocol,n.Socket=n,n.Transport=t("./transport"),n.transports=t("./transports"),n.parser=t("engine.io-parser"),n.prototype.createTransport=function(s){h('creating transport "%s"',s);var f=o(this.query);f.EIO=c.protocol,f.transport=s,this.id&&(f.sid=this.id);var y=new i[s]({agent:this.agent,hostname:this.hostname,port:this.port,secure:this.secure,path:this.path,query:f,forceJSONP:this.forceJSONP,jsonp:this.jsonp,forceBase64:this.forceBase64,enablesXDR:this.enablesXDR,timestampRequests:this.timestampRequests,timestampParam:this.timestampParam,policyPort:this.policyPort,socket:this,pfx:this.pfx,key:this.key,passphrase:this.passphrase,cert:this.cert,ca:this.ca,ciphers:this.ciphers,rejectUnauthorized:this.rejectUnauthorized});return y},n.prototype.open=function(){var f;if(this.rememberUpgrade&&n.priorWebsocketSuccess&&this.transports.indexOf("websocket")!=-1)f="websocket";else{if(this.transports.length==0){var s=this;return void setTimeout(function(){s.emit("error","No transports available")},0)}f=this.transports[0]}this.readyState="opening";var f;try{f=this.createTransport(f)}catch{return this.transports.shift(),void this.open()}f.open(),this.setTransport(f)},n.prototype.setTransport=function(s){h("setting transport %s",s.name);var f=this;this.transport&&(h("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=s,s.on("drain",function(){f.onDrain()}).on("packet",function(y){f.onPacket(y)}).on("error",function(y){f.onError(y)}).on("close",function(){f.onClose("transport close")})},n.prototype.probe=function(s){function f(){if(C.onlyBinaryUpgrades){var E=!this.supportsBinary&&C.transport.supportsBinary;m=m||E}m||(h('probe transport "%s" opened',s),S.send([{type:"ping",data:"probe"}]),S.once("packet",function(v){if(!m)if(v.type=="pong"&&v.data=="probe"){if(h('probe transport "%s" pong',s),C.upgrading=!0,C.emit("upgrading",S),!S)return;n.priorWebsocketSuccess=S.name=="websocket",h('pausing current transport "%s"',C.transport.name),C.transport.pause(function(){m||C.readyState!="closed"&&(h("changing transport and sending upgrade packet"),k(),C.setTransport(S),S.send([{type:"upgrade"}]),C.emit("upgrade",S),S=null,C.upgrading=!1,C.flush())})}else{h('probe transport "%s" failed',s);var b=new Error("probe error");b.transport=S.name,C.emit("upgradeError",b)}}))}function y(){m||(m=!0,k(),S.close(),S=null)}function g(E){var v=new Error("probe error: "+E);v.transport=S.name,y(),h('probe transport "%s" failed because of error: %s',s,E),C.emit("upgradeError",v)}function w(){g("transport closed")}function B(){g("socket closed")}function _(E){S&&E.name!=S.name&&(h('"%s" works - aborting "%s"',E.name,S.name),y())}function k(){S.removeListener("open",f),S.removeListener("error",g),S.removeListener("close",w),C.removeListener("close",B),C.removeListener("upgrading",_)}h('probing transport "%s"',s);var S=this.createTransport(s,{probe:1}),m=!1,C=this;n.priorWebsocketSuccess=!1,S.once("open",f),S.once("error",g),S.once("close",w),this.once("close",B),this.once("upgrading",_),S.open()},n.prototype.onOpen=function(){if(h("socket open"),this.readyState="open",n.priorWebsocketSuccess=this.transport.name=="websocket",this.emit("open"),this.flush(),this.readyState=="open"&&this.upgrade&&this.transport.pause){h("starting upgrade probes");for(var s=0,f=this.upgrades.length;f>s;s++)this.probe(this.upgrades[s])}},n.prototype.onPacket=function(s){if(this.readyState=="opening"||this.readyState=="open")switch(h('socket receive: type "%s", data "%s"',s.type,s.data),this.emit("packet",s),this.emit("heartbeat"),s.type){case"open":this.onHandshake(p(s.data));break;case"pong":this.setPing();break;case"error":var f=new Error("server error");f.code=s.data,this.emit("error",f);break;case"message":this.emit("data",s.data),this.emit("message",s.data)}else h('packet received with socket readyState "%s"',this.readyState)},n.prototype.onHandshake=function(s){this.emit("handshake",s),this.id=s.sid,this.transport.query.sid=s.sid,this.upgrades=this.filterUpgrades(s.upgrades),this.pingInterval=s.pingInterval,this.pingTimeout=s.pingTimeout,this.onOpen(),this.readyState!="closed"&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},n.prototype.onHeartbeat=function(s){clearTimeout(this.pingTimeoutTimer);var f=this;f.pingTimeoutTimer=setTimeout(function(){f.readyState!="closed"&&f.onClose("ping timeout")},s||f.pingInterval+f.pingTimeout)},n.prototype.setPing=function(){var s=this;clearTimeout(s.pingIntervalTimer),s.pingIntervalTimer=setTimeout(function(){h("writing ping packet - expecting pong within %sms",s.pingTimeout),s.ping(),s.onHeartbeat(s.pingTimeout)},s.pingInterval)},n.prototype.ping=function(){this.sendPacket("ping")},n.prototype.onDrain=function(){for(var s=0;s<this.prevBufferLen;s++)this.callbackBuffer[s]&&this.callbackBuffer[s]();this.writeBuffer.splice(0,this.prevBufferLen),this.callbackBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length==0?this.emit("drain"):this.flush()},n.prototype.flush=function(){this.readyState!="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(h("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},n.prototype.write=n.prototype.send=function(s,f){return this.sendPacket("message",s,f),this},n.prototype.sendPacket=function(s,f,y){if(this.readyState!="closing"&&this.readyState!="closed"){var g={type:s,data:f};this.emit("packetCreate",g),this.writeBuffer.push(g),this.callbackBuffer.push(y),this.flush()}},n.prototype.close=function(){function s(){g.onClose("forced close"),h("socket closing - telling transport to close"),g.transport.close()}function f(){g.removeListener("upgrade",f),g.removeListener("upgradeError",f),s()}function y(){g.once("upgrade",f),g.once("upgradeError",f)}if(this.readyState=="opening"||this.readyState=="open"){this.readyState="closing";var g=this;this.writeBuffer.length?this.once("drain",function(){this.upgrading?y():s()}):this.upgrading?y():s()}return this},n.prototype.onError=function(s){h("socket error %j",s),n.priorWebsocketSuccess=!1,this.emit("error",s),this.onClose("transport error",s)},n.prototype.onClose=function(s,f){if(this.readyState=="opening"||this.readyState=="open"||this.readyState=="closing"){h('socket close with reason: "%s"',s);var y=this;clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),setTimeout(function(){y.writeBuffer=[],y.callbackBuffer=[],y.prevBufferLen=0},0),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",s,f)}},n.prototype.filterUpgrades=function(s){for(var f=[],y=0,g=s.length;g>y;y++)~d(this.transports,s[y])&&f.push(s[y]);return f}}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{"./transport":14,"./transports":15,"component-emitter":9,debug:22,"engine.io-parser":25,indexof:40,parsejson:32,parseqs:33,parseuri:34}],14:[function(t,e){function r(i){this.path=i.path,this.hostname=i.hostname,this.port=i.port,this.secure=i.secure,this.query=i.query,this.timestampParam=i.timestampParam,this.timestampRequests=i.timestampRequests,this.readyState="",this.agent=i.agent||!1,this.socket=i.socket,this.enablesXDR=i.enablesXDR,this.pfx=i.pfx,this.key=i.key,this.passphrase=i.passphrase,this.cert=i.cert,this.ca=i.ca,this.ciphers=i.ciphers,this.rejectUnauthorized=i.rejectUnauthorized}var n=t("engine.io-parser"),o=t("component-emitter");e.exports=r,o(r.prototype),r.timestamps=0,r.prototype.onError=function(i,u){var h=new Error(i);return h.type="TransportError",h.description=u,this.emit("error",h),this},r.prototype.open=function(){return(this.readyState=="closed"||this.readyState=="")&&(this.readyState="opening",this.doOpen()),this},r.prototype.close=function(){return(this.readyState=="opening"||this.readyState=="open")&&(this.doClose(),this.onClose()),this},r.prototype.send=function(i){if(this.readyState!="open")throw new Error("Transport not open");this.write(i)},r.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},r.prototype.onData=function(i){var u=n.decodePacket(i,this.socket.binaryType);this.onPacket(u)},r.prototype.onPacket=function(i){this.emit("packet",i)},r.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},{"component-emitter":9,"engine.io-parser":25}],15:[function(t,e,r){(function(n){function o(c){var l,p=!1,a=!1,s=c.jsonp!==!1;if(n.location){var f=location.protocol=="https:",y=location.port;y||(y=f?443:80),p=c.hostname!=location.hostname||y!=c.port,a=c.secure!=f}if(c.xdomain=p,c.xscheme=a,l=new i(c),"open"in l&&!c.forceJSONP)return new u(c);if(!s)throw new Error("JSONP disabled");return new h(c)}var i=t("xmlhttprequest"),u=t("./polling-xhr"),h=t("./polling-jsonp"),d=t("./websocket");r.polling=o,r.websocket=d}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{"./polling-jsonp":16,"./polling-xhr":17,"./websocket":19,xmlhttprequest:20}],16:[function(t,e){(function(r){function n(){}function o(l){i.call(this,l),this.query=this.query||{},h||(r.___eio||(r.___eio=[]),h=r.___eio),this.index=h.length;var p=this;h.push(function(a){p.onData(a)}),this.query.j=this.index,r.document&&r.addEventListener&&r.addEventListener("beforeunload",function(){p.script&&(p.script.onerror=n)},!1)}var i=t("./polling"),u=t("component-inherit");e.exports=o;var h,d=/\n/g,c=/\\n/g;u(o,i),o.prototype.supportsBinary=!1,o.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),i.prototype.doClose.call(this)},o.prototype.doPoll=function(){var l=this,p=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),p.async=!0,p.src=this.uri(),p.onerror=function(f){l.onError("jsonp poll error",f)};var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(p,a),this.script=p;var s=typeof navigator<"u"&&/gecko/i.test(navigator.userAgent);s&&setTimeout(function(){var f=document.createElement("iframe");document.body.appendChild(f),document.body.removeChild(f)},100)},o.prototype.doWrite=function(l,p){function a(){s(),p()}function s(){if(f.iframe)try{f.form.removeChild(f.iframe)}catch(k){f.onError("jsonp polling iframe removal error",k)}try{var _='<iframe src="javascript:0" name="'+f.iframeId+'">';y=document.createElement(_)}catch{y=document.createElement("iframe"),y.name=f.iframeId,y.src="javascript:0"}y.id=f.iframeId,f.form.appendChild(y),f.iframe=y}var f=this;if(!this.form){var y,g=document.createElement("form"),w=document.createElement("textarea"),B=this.iframeId="eio_iframe_"+this.index;g.className="socketio",g.style.position="absolute",g.style.top="-1000px",g.style.left="-1000px",g.target=B,g.method="POST",g.setAttribute("accept-charset","utf-8"),w.name="d",g.appendChild(w),document.body.appendChild(g),this.form=g,this.area=w}this.form.action=this.uri(),s(),l=l.replace(c,`\\
8
8
  `),this.area.value=l.replace(d,"\\n");try{this.form.submit()}catch{}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){f.iframe.readyState=="complete"&&a()}:this.iframe.onload=a}}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{"./polling":18,"component-inherit":21}],17:[function(t,e){(function(r){function n(){}function o(a){if(d.call(this,a),r.location){var s=location.protocol=="https:",f=location.port;f||(f=s?443:80),this.xd=a.hostname!=r.location.hostname||f!=a.port,this.xs=a.secure!=s}}function i(a){this.method=a.method||"GET",this.uri=a.uri,this.xd=!!a.xd,this.xs=!!a.xs,this.async=a.async!==!1,this.data=a.data!=null?a.data:null,this.agent=a.agent,this.isBinary=a.isBinary,this.supportsBinary=a.supportsBinary,this.enablesXDR=a.enablesXDR,this.pfx=a.pfx,this.key=a.key,this.passphrase=a.passphrase,this.cert=a.cert,this.ca=a.ca,this.ciphers=a.ciphers,this.rejectUnauthorized=a.rejectUnauthorized,this.create()}function u(){for(var a in i.requests)i.requests.hasOwnProperty(a)&&i.requests[a].abort()}var h=t("xmlhttprequest"),d=t("./polling"),c=t("component-emitter"),l=t("component-inherit"),p=t("debug")("engine.io-client:polling-xhr");e.exports=o,e.exports.Request=i,l(o,d),o.prototype.supportsBinary=!0,o.prototype.request=function(a){return a=a||{},a.uri=this.uri(),a.xd=this.xd,a.xs=this.xs,a.agent=this.agent||!1,a.supportsBinary=this.supportsBinary,a.enablesXDR=this.enablesXDR,a.pfx=this.pfx,a.key=this.key,a.passphrase=this.passphrase,a.cert=this.cert,a.ca=this.ca,a.ciphers=this.ciphers,a.rejectUnauthorized=this.rejectUnauthorized,new i(a)},o.prototype.doWrite=function(a,s){var f=typeof a!="string"&&a!==void 0,y=this.request({method:"POST",data:a,isBinary:f}),g=this;y.on("success",s),y.on("error",function(w){g.onError("xhr post error",w)}),this.sendXhr=y},o.prototype.doPoll=function(){p("xhr poll");var a=this.request(),s=this;a.on("data",function(f){s.onData(f)}),a.on("error",function(f){s.onError("xhr poll error",f)}),this.pollXhr=a},c(i.prototype),i.prototype.create=function(){var a={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};a.pfx=this.pfx,a.key=this.key,a.passphrase=this.passphrase,a.cert=this.cert,a.ca=this.ca,a.ciphers=this.ciphers,a.rejectUnauthorized=this.rejectUnauthorized;var s=this.xhr=new h(a),f=this;try{if(p("xhr open %s: %s",this.method,this.uri),s.open(this.method,this.uri,this.async),this.supportsBinary&&(s.responseType="arraybuffer"),this.method=="POST")try{this.isBinary?s.setRequestHeader("Content-type","application/octet-stream"):s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}"withCredentials"in s&&(s.withCredentials=!0),this.hasXDR()?(s.onload=function(){f.onLoad()},s.onerror=function(){f.onError(s.responseText)}):s.onreadystatechange=function(){s.readyState==4&&(s.status==200||s.status==1223?f.onLoad():setTimeout(function(){f.onError(s.status)},0))},p("xhr data %s",this.data),s.send(this.data)}catch(y){return void setTimeout(function(){f.onError(y)},0)}r.document&&(this.index=i.requestsCount++,i.requests[this.index]=this)},i.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},i.prototype.onData=function(a){this.emit("data",a),this.onSuccess()},i.prototype.onError=function(a){this.emit("error",a),this.cleanup(!0)},i.prototype.cleanup=function(a){if(typeof this.xhr<"u"&&this.xhr!==null){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=n:this.xhr.onreadystatechange=n,a)try{this.xhr.abort()}catch{}r.document&&delete i.requests[this.index],this.xhr=null}},i.prototype.onLoad=function(){var a;try{var s;try{s=this.xhr.getResponseHeader("Content-Type").split(";")[0]}catch{}a=s==="application/octet-stream"?this.xhr.response:this.supportsBinary?"ok":this.xhr.responseText}catch(f){this.onError(f)}a!=null&&this.onData(a)},i.prototype.hasXDR=function(){return typeof r.XDomainRequest<"u"&&!this.xs&&this.enablesXDR},i.prototype.abort=function(){this.cleanup()},r.document&&(i.requestsCount=0,i.requests={},r.attachEvent?r.attachEvent("onunload",u):r.addEventListener&&r.addEventListener("beforeunload",u,!1))}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{"./polling":18,"component-emitter":9,"component-inherit":21,debug:22,xmlhttprequest:20}],18:[function(t,e){function r(c){var l=c&&c.forceBase64;(!d||l)&&(this.supportsBinary=!1),n.call(this,c)}var n=t("../transport"),o=t("parseqs"),i=t("engine.io-parser"),u=t("component-inherit"),h=t("debug")("engine.io-client:polling");e.exports=r;var d=function(){var c=t("xmlhttprequest"),l=new c({xdomain:!1});return l.responseType!=null}();u(r,n),r.prototype.name="polling",r.prototype.doOpen=function(){this.poll()},r.prototype.pause=function(c){function l(){h("paused"),p.readyState="paused",c()}var p=this;if(this.readyState="pausing",this.polling||!this.writable){var a=0;this.polling&&(h("we are currently polling - waiting to pause"),a++,this.once("pollComplete",function(){h("pre-pause polling complete"),--a||l()})),this.writable||(h("we are currently writing - waiting to pause"),a++,this.once("drain",function(){h("pre-pause writing complete"),--a||l()}))}else l()},r.prototype.poll=function(){h("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},r.prototype.onData=function(c){var l=this;h("polling got data %s",c);var p=function(a){return l.readyState=="opening"&&l.onOpen(),a.type=="close"?(l.onClose(),!1):void l.onPacket(a)};i.decodePayload(c,this.socket.binaryType,p),this.readyState!="closed"&&(this.polling=!1,this.emit("pollComplete"),this.readyState=="open"?this.poll():h('ignoring poll - transport state "%s"',this.readyState))},r.prototype.doClose=function(){function c(){h("writing close packet"),l.write([{type:"close"}])}var l=this;this.readyState=="open"?(h("transport open - closing"),c()):(h("transport not open - deferring close"),this.once("open",c))},r.prototype.write=function(c){var p=this;this.writable=!1;var l=function(){p.writable=!0,p.emit("drain")},p=this;i.encodePayload(c,this.supportsBinary,function(a){p.doWrite(a,l)})},r.prototype.uri=function(){var c=this.query||{},l=this.secure?"https":"http",p="";return this.timestampRequests!==!1&&(c[this.timestampParam]=+new Date+"-"+n.timestamps++),this.supportsBinary||c.sid||(c.b64=1),c=o.encode(c),this.port&&(l=="https"&&this.port!=443||l=="http"&&this.port!=80)&&(p=":"+this.port),c.length&&(c="?"+c),l+"://"+this.hostname+p+this.path+c}},{"../transport":14,"component-inherit":21,debug:22,"engine.io-parser":25,parseqs:33,xmlhttprequest:20}],19:[function(t,e){function r(c){var l=c&&c.forceBase64;l&&(this.supportsBinary=!1),n.call(this,c)}var n=t("../transport"),o=t("engine.io-parser"),i=t("parseqs"),u=t("component-inherit"),h=t("debug")("engine.io-client:websocket"),d=t("ws");e.exports=r,u(r,n),r.prototype.name="websocket",r.prototype.supportsBinary=!0,r.prototype.doOpen=function(){if(this.check()){var c=this.uri(),l=void 0,p={agent:this.agent};p.pfx=this.pfx,p.key=this.key,p.passphrase=this.passphrase,p.cert=this.cert,p.ca=this.ca,p.ciphers=this.ciphers,p.rejectUnauthorized=this.rejectUnauthorized,this.ws=new d(c,l,p),this.ws.binaryType===void 0&&(this.supportsBinary=!1),this.ws.binaryType="arraybuffer",this.addEventListeners()}},r.prototype.addEventListeners=function(){var c=this;this.ws.onopen=function(){c.onOpen()},this.ws.onclose=function(){c.onClose()},this.ws.onmessage=function(l){c.onData(l.data)},this.ws.onerror=function(l){c.onError("websocket error",l)}},typeof navigator<"u"&&/iPad|iPhone|iPod/i.test(navigator.userAgent)&&(r.prototype.onData=function(c){var l=this;setTimeout(function(){n.prototype.onData.call(l,c)},0)}),r.prototype.write=function(c){function l(){p.writable=!0,p.emit("drain")}var p=this;this.writable=!1;for(var a=0,s=c.length;s>a;a++)o.encodePacket(c[a],this.supportsBinary,function(f){try{p.ws.send(f)}catch{h("websocket closed before onclose event")}});setTimeout(l,0)},r.prototype.onClose=function(){n.prototype.onClose.call(this)},r.prototype.doClose=function(){typeof this.ws<"u"&&this.ws.close()},r.prototype.uri=function(){var c=this.query||{},l=this.secure?"wss":"ws",p="";return this.port&&(l=="wss"&&this.port!=443||l=="ws"&&this.port!=80)&&(p=":"+this.port),this.timestampRequests&&(c[this.timestampParam]=+new Date),this.supportsBinary||(c.b64=1),c=i.encode(c),c.length&&(c="?"+c),l+"://"+this.hostname+p+this.path+c},r.prototype.check=function(){return!(!d||"__initialize"in d&&this.name===r.prototype.name)}},{"../transport":14,"component-inherit":21,debug:22,"engine.io-parser":25,parseqs:33,ws:35}],20:[function(t,e){var r=t("has-cors");e.exports=function(n){var o=n.xdomain,i=n.xscheme,u=n.enablesXDR;try{if(typeof XMLHttpRequest<"u"&&(!o||r))return new XMLHttpRequest}catch{}try{if(typeof XDomainRequest<"u"&&!i&&u)return new XDomainRequest}catch{}if(!o)try{return new ActiveXObject("Microsoft.XMLHTTP")}catch{}}},{"has-cors":38}],21:[function(t,e){e.exports=function(r,n){var o=function(){};o.prototype=n.prototype,r.prototype=new o,r.prototype.constructor=r}},{}],22:[function(t,e,r){function n(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function o(){var d=arguments,c=this.useColors;if(d[0]=(c?"%c":"")+this.namespace+(c?" %c":" ")+d[0]+(c?"%c ":" ")+"+"+r.humanize(this.diff),!c)return d;var l="color: "+this.color;d=[d[0],l,"color: inherit"].concat(Array.prototype.slice.call(d,1));var p=0,a=0;return d[0].replace(/%[a-z%]/g,function(s){s!=="%%"&&(p++,s==="%c"&&(a=p))}),d.splice(a,0,l),d}function i(){return typeof console=="object"&&typeof console.log=="function"&&Function.prototype.apply.call(console.log,console,arguments)}function u(d){try{d==null?localStorage.removeItem("debug"):localStorage.debug=d}catch{}}function h(){var d;try{d=localStorage.debug}catch{}return d}r=e.exports=t("./debug"),r.log=i,r.formatArgs=o,r.save=u,r.load=h,r.useColors=n,r.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],r.formatters.j=function(d){return JSON.stringify(d)},r.enable(h())},{"./debug":23}],23:[function(t,e,r){function n(){return r.colors[l++%r.colors.length]}function o(p){function a(){}function s(){var y=s,g=+new Date,w=g-(c||g);y.diff=w,y.prev=c,y.curr=g,c=g,y.useColors==null&&(y.useColors=r.useColors()),y.color==null&&y.useColors&&(y.color=n());var B=Array.prototype.slice.call(arguments);B[0]=r.coerce(B[0]),typeof B[0]!="string"&&(B=["%o"].concat(B));var _=0;B[0]=B[0].replace(/%([a-z%])/g,function(S,m){if(S==="%%")return S;_++;var C=r.formatters[m];if(typeof C=="function"){var E=B[_];S=C.call(y,E),B.splice(_,1),_--}return S}),typeof r.formatArgs=="function"&&(B=r.formatArgs.apply(y,B));var k=s.log||r.log||console.log.bind(console);k.apply(y,B)}a.enabled=!1,s.enabled=!0;var f=r.enabled(p)?s:a;return f.namespace=p,f}function i(p){r.save(p);for(var a=(p||"").split(/[\s,]+/),s=a.length,f=0;s>f;f++)a[f]&&(p=a[f].replace(/\*/g,".*?"),p[0]==="-"?r.skips.push(new RegExp("^"+p.substr(1)+"$")):r.names.push(new RegExp("^"+p+"$")))}function u(){r.enable("")}function h(p){var a,s;for(a=0,s=r.skips.length;s>a;a++)if(r.skips[a].test(p))return!1;for(a=0,s=r.names.length;s>a;a++)if(r.names[a].test(p))return!0;return!1}function d(p){return p instanceof Error?p.stack||p.message:p}r=e.exports=o,r.coerce=d,r.disable=u,r.enable=i,r.enabled=h,r.humanize=t("ms"),r.names=[],r.skips=[],r.formatters={};var c,l=0},{ms:24}],24:[function(t,e){function r(p){var a=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(p);if(a){var s=parseFloat(a[1]),f=(a[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"y":return s*l;case"days":case"day":case"d":return s*c;case"hours":case"hour":case"h":return s*d;case"minutes":case"minute":case"m":return s*h;case"seconds":case"second":case"s":return s*u;case"ms":return s}}}function n(p){return p>=c?Math.round(p/c)+"d":p>=d?Math.round(p/d)+"h":p>=h?Math.round(p/h)+"m":p>=u?Math.round(p/u)+"s":p+"ms"}function o(p){return i(p,c,"day")||i(p,d,"hour")||i(p,h,"minute")||i(p,u,"second")||p+" ms"}function i(p,a,s){return a>p?void 0:1.5*a>p?Math.floor(p/a)+" "+s:Math.ceil(p/a)+" "+s+"s"}var u=1e3,h=60*u,d=60*h,c=24*d,l=365.25*c;e.exports=function(p,a){return a=a||{},typeof p=="string"?r(p):a.long?o(p):n(p)}},{}],25:[function(t,e,r){(function(n){function o(m,C){var E="b"+r.packets[m.type]+m.data.data;return C(E)}function i(m,C,E){if(!C)return r.encodeBase64Packet(m,E);var v=m.data,b=new Uint8Array(v),T=new Uint8Array(1+v.byteLength);T[0]=B[m.type];for(var O=0;O<b.length;O++)T[O+1]=b[O];return E(T.buffer)}function u(m,C,E){if(!C)return r.encodeBase64Packet(m,E);var v=new FileReader;return v.onload=function(){m.data=v.result,r.encodePacket(m,C,!0,E)},v.readAsArrayBuffer(m.data)}function h(m,C,E){if(!C)return r.encodeBase64Packet(m,E);if(w)return u(m,C,E);var v=new Uint8Array(1);v[0]=B[m.type];var b=new S([v.buffer,m.data]);return E(b)}function d(m,C,E){for(var v=new Array(m.length),b=s(m.length,E),T=function(x,A,q){C(A,function(j,$){v[x]=$,q(j,v)})},O=0;O<m.length;O++)T(O,m[O],b)}var c=t("./keys"),l=t("has-binary"),p=t("arraybuffer.slice"),a=t("base64-arraybuffer"),s=t("after"),f=t("utf8"),y=navigator.userAgent.match(/Android/i),g=/PhantomJS/i.test(navigator.userAgent),w=y||g;r.protocol=3;var B=r.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},_=c(B),k={type:"error",data:"parser error"},S=t("blob");r.encodePacket=function(m,C,E,v){typeof C=="function"&&(v=C,C=!1),typeof E=="function"&&(v=E,E=null);var b=m.data===void 0?void 0:m.data.buffer||m.data;if(n.ArrayBuffer&&b instanceof ArrayBuffer)return i(m,C,v);if(S&&b instanceof n.Blob)return h(m,C,v);if(b&&b.base64)return o(m,v);var T=B[m.type];return m.data!==void 0&&(T+=E?f.encode(String(m.data)):String(m.data)),v(""+T)},r.encodeBase64Packet=function(m,C){var E="b"+r.packets[m.type];if(S&&m.data instanceof S){var v=new FileReader;return v.onload=function(){var A=v.result.split(",")[1];C(E+A)},v.readAsDataURL(m.data)}var b;try{b=String.fromCharCode.apply(null,new Uint8Array(m.data))}catch{for(var T=new Uint8Array(m.data),O=new Array(T.length),x=0;x<T.length;x++)O[x]=T[x];b=String.fromCharCode.apply(null,O)}return E+=n.btoa(b),C(E)},r.decodePacket=function(m,C,E){if(typeof m=="string"||m===void 0){if(m.charAt(0)=="b")return r.decodeBase64Packet(m.substr(1),C);if(E)try{m=f.decode(m)}catch{return k}var b=m.charAt(0);return Number(b)==b&&_[b]?m.length>1?{type:_[b],data:m.substring(1)}:{type:_[b]}:k}var v=new Uint8Array(m),b=v[0],T=p(m,1);return S&&C==="blob"&&(T=new S([T])),{type:_[b],data:T}},r.decodeBase64Packet=function(m,C){var E=_[m.charAt(0)];if(!n.ArrayBuffer)return{type:E,data:{base64:!0,data:m.substr(1)}};var v=a.decode(m.substr(1));return C==="blob"&&S&&(v=new S([v])),{type:E,data:v}},r.encodePayload=function(m,C,E){function v(O){return O.length+":"+O}function b(O,x){r.encodePacket(O,T?C:!1,!0,function(A){x(null,v(A))})}typeof C=="function"&&(E=C,C=null);var T=l(m);return C&&T?S&&!w?r.encodePayloadAsBlob(m,E):r.encodePayloadAsArrayBuffer(m,E):m.length?void d(m,b,function(O,x){return E(x.join(""))}):E("0:")},r.decodePayload=function(m,C,E){if(typeof m!="string")return r.decodePayloadAsBinary(m,C,E);typeof C=="function"&&(E=C,C=null);var v;if(m=="")return E(k,0,1);for(var b,T,O="",x=0,A=m.length;A>x;x++){var q=m.charAt(x);if(q!=":")O+=q;else{if(O==""||O!=(b=Number(O))||(T=m.substr(x+1,b),O!=T.length))return E(k,0,1);if(T.length){if(v=r.decodePacket(T,C,!0),k.type==v.type&&k.data==v.data)return E(k,0,1);var j=E(v,x+b,A);if(j===!1)return}x+=b,O=""}}return O!=""?E(k,0,1):void 0},r.encodePayloadAsArrayBuffer=function(m,C){function E(v,b){r.encodePacket(v,!0,!0,function(T){return b(null,T)})}return m.length?void d(m,E,function(v,b){var T=b.reduce(function(A,q){var j;return j=typeof q=="string"?q.length:q.byteLength,A+j.toString().length+j+2},0),O=new Uint8Array(T),x=0;return b.forEach(function(A){var q=typeof A=="string",j=A;if(q){for(var $=new Uint8Array(A.length),X=0;X<A.length;X++)$[X]=A.charCodeAt(X);j=$.buffer}O[x++]=q?0:1;for(var et=j.byteLength.toString(),X=0;X<et.length;X++)O[x++]=parseInt(et[X]);O[x++]=255;for(var $=new Uint8Array(j),X=0;X<$.length;X++)O[x++]=$[X]}),C(O.buffer)}):C(new ArrayBuffer(0))},r.encodePayloadAsBlob=function(m,C){function E(v,b){r.encodePacket(v,!0,!0,function(T){var O=new Uint8Array(1);if(O[0]=1,typeof T=="string"){for(var x=new Uint8Array(T.length),A=0;A<T.length;A++)x[A]=T.charCodeAt(A);T=x.buffer,O[0]=0}for(var q=T instanceof ArrayBuffer?T.byteLength:T.size,j=q.toString(),$=new Uint8Array(j.length+1),A=0;A<j.length;A++)$[A]=parseInt(j[A]);if($[j.length]=255,S){var X=new S([O.buffer,$.buffer,T]);b(null,X)}})}d(m,E,function(v,b){return C(new S(b))})},r.decodePayloadAsBinary=function(m,C,E){typeof C=="function"&&(E=C,C=null);for(var v=m,b=[],T=!1;v.byteLength>0;){for(var O=new Uint8Array(v),x=O[0]===0,A="",q=1;O[q]!=255;q++){if(A.length>310){T=!0;break}A+=O[q]}if(T)return E(k,0,1);v=p(v,2+A.length),A=parseInt(A);var j=p(v,0,A);if(x)try{j=String.fromCharCode.apply(null,new Uint8Array(j))}catch{var $=new Uint8Array(j);j="";for(var q=0;q<$.length;q++)j+=String.fromCharCode($[q])}b.push(j),v=p(v,A)}var X=b.length;b.forEach(function(et,Ot){E(r.decodePacket(et,C,!0),Ot,X)})}}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{"./keys":26,after:27,"arraybuffer.slice":28,"base64-arraybuffer":29,blob:30,"has-binary":36,utf8:31}],26:[function(t,e){e.exports=Object.keys||function(r){var n=[],o=Object.prototype.hasOwnProperty;for(var i in r)o.call(r,i)&&n.push(i);return n}},{}],27:[function(t,e){function r(o,i,u){function h(c,l){if(h.count<=0)throw new Error("after called too many times");--h.count,c?(d=!0,i(c),i=u):h.count!==0||d||i(null,l)}var d=!1;return u=u||n,h.count=o,o===0?i():h}function n(){}e.exports=r},{}],28:[function(t,e){e.exports=function(r,n,o){var i=r.byteLength;if(n=n||0,o=o||i,r.slice)return r.slice(n,o);if(0>n&&(n+=i),0>o&&(o+=i),o>i&&(o=i),n>=i||n>=o||i===0)return new ArrayBuffer(0);for(var u=new Uint8Array(r),h=new Uint8Array(o-n),d=n,c=0;o>d;d++,c++)h[c]=u[d];return h.buffer}},{}],29:[function(t,e,r){(function(n){r.encode=function(o){var i,u=new Uint8Array(o),h=u.length,d="";for(i=0;h>i;i+=3)d+=n[u[i]>>2],d+=n[(3&u[i])<<4|u[i+1]>>4],d+=n[(15&u[i+1])<<2|u[i+2]>>6],d+=n[63&u[i+2]];return h%3===2?d=d.substring(0,d.length-1)+"=":h%3===1&&(d=d.substring(0,d.length-2)+"=="),d},r.decode=function(o){var i,u,h,d,c,l=.75*o.length,p=o.length,a=0;o[o.length-1]==="="&&(l--,o[o.length-2]==="="&&l--);var s=new ArrayBuffer(l),f=new Uint8Array(s);for(i=0;p>i;i+=4)u=n.indexOf(o[i]),h=n.indexOf(o[i+1]),d=n.indexOf(o[i+2]),c=n.indexOf(o[i+3]),f[a++]=u<<2|h>>4,f[a++]=(15&h)<<4|d>>2,f[a++]=(3&d)<<6|63&c;return s}})("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")},{}],30:[function(t,e){(function(r){function n(l){for(var p=0;p<l.length;p++){var a=l[p];if(a.buffer instanceof ArrayBuffer){var s=a.buffer;if(a.byteLength!==s.byteLength){var f=new Uint8Array(a.byteLength);f.set(new Uint8Array(s,a.byteOffset,a.byteLength)),s=f.buffer}l[p]=s}}}function o(l,p){p=p||{};var a=new u;n(l);for(var s=0;s<l.length;s++)a.append(l[s]);return p.type?a.getBlob(p.type):a.getBlob()}function i(l,p){return n(l),new Blob(l,p||{})}var u=r.BlobBuilder||r.WebKitBlobBuilder||r.MSBlobBuilder||r.MozBlobBuilder,h=function(){try{var l=new Blob(["hi"]);return l.size===2}catch{return!1}}(),d=h&&function(){try{var l=new Blob([new Uint8Array([1,2])]);return l.size===2}catch{return!1}}(),c=u&&u.prototype.append&&u.prototype.getBlob;e.exports=function(){return h?d?r.Blob:i:c?o:void 0}()}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{}],31:[function(t,e,r){(function(n){(function(o){function i(v){for(var b,T,O=[],x=0,A=v.length;A>x;)b=v.charCodeAt(x++),b>=55296&&56319>=b&&A>x?(T=v.charCodeAt(x++),(64512&T)==56320?O.push(((1023&b)<<10)+(1023&T)+65536):(O.push(b),x--)):O.push(b);return O}function u(v){for(var b,T=v.length,O=-1,x="";++O<T;)b=v[O],b>65535&&(b-=65536,x+=k(b>>>10&1023|55296),b=56320|1023&b),x+=k(b);return x}function h(v){if(v>=55296&&57343>=v)throw Error("Lone surrogate U+"+v.toString(16).toUpperCase()+" is not a scalar value")}function d(v,b){return k(v>>b&63|128)}function c(v){if(!(4294967168&v))return k(v);var b="";return 4294965248&v?4294901760&v?!(4292870144&v)&&(b=k(v>>18&7|240),b+=d(v,12),b+=d(v,6)):(h(v),b=k(v>>12&15|224),b+=d(v,6)):b=k(v>>6&31|192),b+=k(63&v|128)}function l(v){for(var b,T=i(v),O=T.length,x=-1,A="";++x<O;)b=T[x],A+=c(b);return A}function p(){if(_>=B)throw Error("Invalid byte index");var v=255&w[_];if(_++,(192&v)==128)return 63&v;throw Error("Invalid continuation byte")}function a(){var v,b,T,O,x;if(_>B)throw Error("Invalid byte index");if(_==B)return!1;if(v=255&w[_],_++,(128&v)==0)return v;if((224&v)==192){var b=p();if(x=(31&v)<<6|b,x>=128)return x;throw Error("Invalid continuation byte")}if((240&v)==224){if(b=p(),T=p(),x=(15&v)<<12|b<<6|T,x>=2048)return h(x),x;throw Error("Invalid continuation byte")}if((248&v)==240&&(b=p(),T=p(),O=p(),x=(15&v)<<18|b<<12|T<<6|O,x>=65536&&1114111>=x))return x;throw Error("Invalid UTF-8 detected")}function s(v){w=i(v),B=w.length,_=0;for(var b,T=[];(b=a())!==!1;)T.push(b);return u(T)}var f=typeof r=="object"&&r,y=typeof e=="object"&&e&&e.exports==f&&e,g=typeof n=="object"&&n;(g.global===g||g.window===g)&&(o=g);var w,B,_,k=String.fromCharCode,S={version:"2.0.0",encode:l,decode:s};if(f&&!f.nodeType)if(y)y.exports=S;else{var m={},C=m.hasOwnProperty;for(var E in S)C.call(S,E)&&(f[E]=S[E])}else o.utf8=S})(this)}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{}],32:[function(t,e){(function(r){var n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,i=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,u=/(?:^|:|,)(?:\s*\[)+/g,h=/^\s+/,d=/\s+$/;e.exports=function(c){return typeof c=="string"&&c?(c=c.replace(h,"").replace(d,""),r.JSON&&JSON.parse?JSON.parse(c):n.test(c.replace(o,"@").replace(i,"]").replace(u,""))?new Function("return "+c)():void 0):null}}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{}],33:[function(t,e,r){r.encode=function(n){var o="";for(var i in n)n.hasOwnProperty(i)&&(o.length&&(o+="&"),o+=encodeURIComponent(i)+"="+encodeURIComponent(n[i]));return o},r.decode=function(n){for(var o={},i=n.split("&"),u=0,h=i.length;h>u;u++){var d=i[u].split("=");o[decodeURIComponent(d[0])]=decodeURIComponent(d[1])}return o}},{}],34:[function(t,e){var r=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,n=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];e.exports=function(o){var i=o,u=o.indexOf("["),h=o.indexOf("]");u!=-1&&h!=-1&&(o=o.substring(0,u)+o.substring(u,h).replace(/:/g,";")+o.substring(h,o.length));for(var d=r.exec(o||""),c={},l=14;l--;)c[n[l]]=d[l]||"";return u!=-1&&h!=-1&&(c.source=i,c.host=c.host.substring(1,c.host.length-1).replace(/;/g,":"),c.authority=c.authority.replace("[","").replace("]","").replace(/;/g,":"),c.ipv6uri=!0),c}},{}],35:[function(t,e){function r(i,u){return u?new o(i,u):new o(i)}var n=function(){return self}(),o=n.WebSocket||n.MozWebSocket;e.exports=o?r:null,o&&(r.prototype=o.prototype)},{}],36:[function(t,e){(function(r){function n(i){function u(h){if(!h)return!1;if(r.Buffer&&r.Buffer.isBuffer(h)||r.ArrayBuffer&&h instanceof ArrayBuffer||r.Blob&&h instanceof Blob||r.File&&h instanceof File)return!0;if(o(h)){for(var d=0;d<h.length;d++)if(u(h[d]))return!0}else if(h&&typeof h=="object"){h.toJSON&&(h=h.toJSON());for(var c in h)if(Object.prototype.hasOwnProperty.call(h,c)&&u(h[c]))return!0}return!1}return u(i)}var o=t("isarray");e.exports=n}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{isarray:37}],37:[function(t,e){e.exports=Array.isArray||function(r){return Object.prototype.toString.call(r)=="[object Array]"}},{}],38:[function(t,e){var r=t("global");try{e.exports="XMLHttpRequest"in r&&"withCredentials"in new r.XMLHttpRequest}catch{e.exports=!1}},{global:39}],39:[function(t,e){e.exports=function(){return this}()},{}],40:[function(t,e){var r=[].indexOf;e.exports=function(n,o){if(r)return n.indexOf(o);for(var i=0;i<n.length;++i)if(n[i]===o)return i;return-1}},{}],41:[function(t,e,r){var n=Object.prototype.hasOwnProperty;r.keys=Object.keys||function(o){var i=[];for(var u in o)n.call(o,u)&&i.push(u);return i},r.values=function(o){var i=[];for(var u in o)n.call(o,u)&&i.push(o[u]);return i},r.merge=function(o,i){for(var u in i)n.call(i,u)&&(o[u]=i[u]);return o},r.length=function(o){return r.keys(o).length},r.isEmpty=function(o){return r.length(o)==0}},{}],42:[function(t,e){var r=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,n=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];e.exports=function(o){for(var i=r.exec(o||""),u={},h=14;h--;)u[n[h]]=i[h]||"";return u}},{}],43:[function(t,e,r){(function(n){var o=t("isarray"),i=t("./is-buffer");r.deconstructPacket=function(u){function h(p){if(!p)return p;if(i(p)){var a={_placeholder:!0,num:d.length};return d.push(p),a}if(o(p)){for(var s=new Array(p.length),f=0;f<p.length;f++)s[f]=h(p[f]);return s}if(typeof p=="object"&&!(p instanceof Date)){var s={};for(var y in p)s[y]=h(p[y]);return s}return p}var d=[],c=u.data,l=u;return l.data=h(c),l.attachments=d.length,{packet:l,buffers:d}},r.reconstructPacket=function(u,h){function d(c){if(c&&c._placeholder){var l=h[c.num];return l}if(o(c)){for(var p=0;p<c.length;p++)c[p]=d(c[p]);return c}if(c&&typeof c=="object"){for(var a in c)c[a]=d(c[a]);return c}return c}return u.data=d(u.data),u.attachments=void 0,u},r.removeBlobs=function(u,h){function d(p,a,s){if(!p)return p;if(n.Blob&&p instanceof Blob||n.File&&p instanceof File){c++;var f=new FileReader;f.onload=function(){s?s[a]=this.result:l=this.result,--c||h(l)},f.readAsArrayBuffer(p)}else if(o(p))for(var y=0;y<p.length;y++)d(p[y],y,p);else if(p&&typeof p=="object"&&!i(p))for(var g in p)d(p[g],g,p)}var c=0,l=u;d(l),c||h(l)}}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{"./is-buffer":45,isarray:46}],44:[function(t,e,r){function n(){}function o(y){var g="",w=!1;return g+=y.type,(r.BINARY_EVENT==y.type||r.BINARY_ACK==y.type)&&(g+=y.attachments,g+="-"),y.nsp&&y.nsp!="/"&&(w=!0,g+=y.nsp),y.id!=null&&(w&&(g+=",",w=!1),g+=y.id),y.data!=null&&(w&&(g+=","),g+=p.stringify(y.data)),l("encoded %j as %s",y,g),g}function i(y,g){function w(B){var _=s.deconstructPacket(B),k=o(_.packet),S=_.buffers;S.unshift(k),g(S)}s.removeBlobs(y,w)}function u(){this.reconstructor=null}function h(y){var g={},w=0;if(g.type=Number(y.charAt(0)),r.types[g.type]==null)return c();if(r.BINARY_EVENT==g.type||r.BINARY_ACK==g.type){for(var B="";y.charAt(++w)!="-"&&(B+=y.charAt(w),w!=y.length););if(B!=Number(B)||y.charAt(w)!="-")throw new Error("Illegal attachments");g.attachments=Number(B)}if(y.charAt(w+1)=="/")for(g.nsp="";++w;){var _=y.charAt(w);if(_==","||(g.nsp+=_,w==y.length))break}else g.nsp="/";var k=y.charAt(w+1);if(k!==""&&Number(k)==k){for(g.id="";++w;){var _=y.charAt(w);if(_==null||Number(_)!=_){--w;break}if(g.id+=y.charAt(w),w==y.length)break}g.id=Number(g.id)}if(y.charAt(++w))try{g.data=p.parse(y.substr(w))}catch{return c()}return l("decoded %s as %j",y,g),g}function d(y){this.reconPack=y,this.buffers=[]}function c(){return{type:r.ERROR,data:"parser error"}}var l=t("debug")("socket.io-parser"),p=t("json3"),a=(t("isarray"),t("component-emitter")),s=t("./binary"),f=t("./is-buffer");r.protocol=4,r.types=["CONNECT","DISCONNECT","EVENT","BINARY_EVENT","ACK","BINARY_ACK","ERROR"],r.CONNECT=0,r.DISCONNECT=1,r.EVENT=2,r.ACK=3,r.ERROR=4,r.BINARY_EVENT=5,r.BINARY_ACK=6,r.Encoder=n,r.Decoder=u,n.prototype.encode=function(y,g){if(l("encoding packet %j",y),r.BINARY_EVENT==y.type||r.BINARY_ACK==y.type)i(y,g);else{var w=o(y);g([w])}},a(u.prototype),u.prototype.add=function(y){var g;if(typeof y=="string")g=h(y),r.BINARY_EVENT==g.type||r.BINARY_ACK==g.type?(this.reconstructor=new d(g),this.reconstructor.reconPack.attachments===0&&this.emit("decoded",g)):this.emit("decoded",g);else{if(!f(y)&&!y.base64)throw new Error("Unknown type: "+y);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");g=this.reconstructor.takeBinaryData(y),g&&(this.reconstructor=null,this.emit("decoded",g))}},u.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},d.prototype.takeBinaryData=function(y){if(this.buffers.push(y),this.buffers.length==this.reconPack.attachments){var g=s.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),g}return null},d.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},{"./binary":43,"./is-buffer":45,"component-emitter":9,debug:10,isarray:46,json3:47}],45:[function(t,e){(function(r){function n(o){return r.Buffer&&r.Buffer.isBuffer(o)||r.ArrayBuffer&&o instanceof ArrayBuffer}e.exports=n}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{}],46:[function(t,e){e.exports=t(37)},{}],47:[function(t,e,r){(function(n){function o(R){if(o[R]!==h)return o[R];var U;if(R=="bug-string-char-index")U=!1;else if(R=="json")U=o("json-stringify")&&o("json-parse");else{var I,F='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if(R=="json-stringify"){var N=l.stringify,D=typeof N=="function"&&p;if(D){(I=function(){return 1}).toJSON=I;try{D=N(0)==="0"&&N(new Number)==="0"&&N(new String)=='""'&&N(d)===h&&N(h)===h&&N()===h&&N(I)==="1"&&N([I])=="[1]"&&N([h])=="[null]"&&N(null)=="null"&&N([h,d,null])=="[null,null,null]"&&N({a:[I,!0,!1,null,`\0\b
9
9
  \f\r `]})==F&&N(null,I)==="1"&&N([1,2],null,1)==`[
10
10
  1,