@voicenter-team/events-sdk 0.0.52 → 0.0.54

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.
@@ -1,45 +1,20 @@
1
- (function(Nt,Kt){typeof exports=="object"&&typeof module<"u"?Kt(exports):typeof define=="function"&&define.amd?define(["exports"],Kt):(Nt=typeof globalThis<"u"?globalThis:Nt||self,Kt(Nt.VoicenterEventsSDK={}))})(this,function(Nt){"use strict";var e0=Object.defineProperty;var n0=(Nt,Kt,on)=>Kt in Nt?e0(Nt,Kt,{enumerable:!0,configurable:!0,writable:!0,value:on}):Nt[Kt]=on;var wt=(Nt,Kt,on)=>(n0(Nt,typeof Kt!="symbol"?Kt+"":Kt,on),on);var Kt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function on(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Ks={exports:{}},Gs={exports:{}};(function(){var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i={rotl:function(n,o){return n<<o|n>>>32-o},rotr:function(n,o){return n<<32-o|n>>>o},endian:function(n){if(n.constructor==Number)return i.rotl(n,8)&16711935|i.rotl(n,24)&4278255360;for(var o=0;o<n.length;o++)n[o]=i.endian(n[o]);return n},randomBytes:function(n){for(var o=[];n>0;n--)o.push(Math.floor(Math.random()*256));return o},bytesToWords:function(n){for(var o=[],u=0,f=0;u<n.length;u++,f+=8)o[f>>>5]|=n[u]<<24-f%32;return o},wordsToBytes:function(n){for(var o=[],u=0;u<n.length*32;u+=8)o.push(n[u>>>5]>>>24-u%32&255);return o},bytesToHex:function(n){for(var o=[],u=0;u<n.length;u++)o.push((n[u]>>>4).toString(16)),o.push((n[u]&15).toString(16));return o.join("")},hexToBytes:function(n){for(var o=[],u=0;u<n.length;u+=2)o.push(parseInt(n.substr(u,2),16));return o},bytesToBase64:function(n){for(var o=[],u=0;u<n.length;u+=3)for(var f=n[u]<<16|n[u+1]<<8|n[u+2],m=0;m<4;m++)u*8+m*6<=n.length*8?o.push(s.charAt(f>>>6*(3-m)&63)):o.push("=");return o.join("")},base64ToBytes:function(n){n=n.replace(/[^A-Z0-9+\/]/ig,"");for(var o=[],u=0,f=0;u<n.length;f=++u%4)f!=0&&o.push((s.indexOf(n.charAt(u-1))&Math.pow(2,-2*f+8)-1)<<f*2|s.indexOf(n.charAt(u))>>>6-f*2);return o}};Gs.exports=i})();var rc=Gs.exports,ni={utf8:{stringToBytes:function(s){return ni.bin.stringToBytes(unescape(encodeURIComponent(s)))},bytesToString:function(s){return decodeURIComponent(escape(ni.bin.bytesToString(s)))}},bin:{stringToBytes:function(s){for(var i=[],n=0;n<s.length;n++)i.push(s.charCodeAt(n)&255);return i},bytesToString:function(s){for(var i=[],n=0;n<s.length;n++)i.push(String.fromCharCode(s[n]));return i.join("")}}},Hs=ni;/*!
1
+ (function($,ot){typeof exports=="object"&&typeof module<"u"?ot(exports):typeof define=="function"&&define.amd?define(["exports"],ot):($=typeof globalThis<"u"?globalThis:$||self,ot($.VoicenterEventsSDK={}))})(this,function($){"use strict";var Ho=Object.defineProperty;var Jo=($,ot,yt)=>ot in $?Ho($,ot,{enumerable:!0,configurable:!0,writable:!0,value:yt}):$[ot]=yt;var H=($,ot,yt)=>(Jo($,typeof ot!="symbol"?ot+"":ot,yt),yt);function ot(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var yt={exports:{}},Le={exports:{}};(function(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e={rotl:function(r,n){return r<<n|r>>>32-n},rotr:function(r,n){return r<<32-n|r>>>n},endian:function(r){if(r.constructor==Number)return e.rotl(r,8)&16711935|e.rotl(r,24)&4278255360;for(var n=0;n<r.length;n++)r[n]=e.endian(r[n]);return r},randomBytes:function(r){for(var n=[];r>0;r--)n.push(Math.floor(Math.random()*256));return n},bytesToWords:function(r){for(var n=[],o=0,i=0;o<r.length;o++,i+=8)n[i>>>5]|=r[o]<<24-i%32;return n},wordsToBytes:function(r){for(var n=[],o=0;o<r.length*32;o+=8)n.push(r[o>>>5]>>>24-o%32&255);return n},bytesToHex:function(r){for(var n=[],o=0;o<r.length;o++)n.push((r[o]>>>4).toString(16)),n.push((r[o]&15).toString(16));return n.join("")},hexToBytes:function(r){for(var n=[],o=0;o<r.length;o+=2)n.push(parseInt(r.substr(o,2),16));return n},bytesToBase64:function(r){for(var n=[],o=0;o<r.length;o+=3)for(var i=r[o]<<16|r[o+1]<<8|r[o+2],u=0;u<4;u++)o*8+u*6<=r.length*8?n.push(t.charAt(i>>>6*(3-u)&63)):n.push("=");return n.join("")},base64ToBytes:function(r){r=r.replace(/[^A-Z0-9+\/]/ig,"");for(var n=[],o=0,i=0;o<r.length;i=++o%4)i!=0&&n.push((t.indexOf(r.charAt(o-1))&Math.pow(2,-2*i+8)-1)<<i*2|t.indexOf(r.charAt(o))>>>6-i*2);return n}};Le.exports=e})();var Ir=Le.exports,Yt={utf8:{stringToBytes:function(t){return Yt.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(Yt.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(t.charCodeAt(r)&255);return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}},Ue=Yt;/*!
2
2
  * Determine if an object is a Buffer
3
3
  *
4
4
  * @author Feross Aboukhadijeh <https://feross.org>
5
5
  * @license MIT
6
- */var ic=function(s){return s!=null&&($s(s)||sc(s)||!!s._isBuffer)};function $s(s){return!!s.constructor&&typeof s.constructor.isBuffer=="function"&&s.constructor.isBuffer(s)}function sc(s){return typeof s.readFloatLE=="function"&&typeof s.slice=="function"&&$s(s.slice(0,0))}(function(){var s=rc,i=Hs.utf8,n=ic,o=Hs.bin,u=function(f,m){f.constructor==String?m&&m.encoding==="binary"?f=o.stringToBytes(f):f=i.stringToBytes(f):n(f)?f=Array.prototype.slice.call(f,0):!Array.isArray(f)&&f.constructor!==Uint8Array&&(f=f.toString());for(var g=s.bytesToWords(f),S=f.length*8,v=1732584193,_=-271733879,y=-1732584194,l=271733878,h=0;h<g.length;h++)g[h]=(g[h]<<8|g[h]>>>24)&16711935|(g[h]<<24|g[h]>>>8)&4278255360;g[S>>>5]|=128<<S%32,g[(S+64>>>9<<4)+14]=S;for(var b=u._ff,A=u._gg,x=u._hh,W=u._ii,h=0;h<g.length;h+=16){var st=v,V=_,ot=y,H=l;v=b(v,_,y,l,g[h+0],7,-680876936),l=b(l,v,_,y,g[h+1],12,-389564586),y=b(y,l,v,_,g[h+2],17,606105819),_=b(_,y,l,v,g[h+3],22,-1044525330),v=b(v,_,y,l,g[h+4],7,-176418897),l=b(l,v,_,y,g[h+5],12,1200080426),y=b(y,l,v,_,g[h+6],17,-1473231341),_=b(_,y,l,v,g[h+7],22,-45705983),v=b(v,_,y,l,g[h+8],7,1770035416),l=b(l,v,_,y,g[h+9],12,-1958414417),y=b(y,l,v,_,g[h+10],17,-42063),_=b(_,y,l,v,g[h+11],22,-1990404162),v=b(v,_,y,l,g[h+12],7,1804603682),l=b(l,v,_,y,g[h+13],12,-40341101),y=b(y,l,v,_,g[h+14],17,-1502002290),_=b(_,y,l,v,g[h+15],22,1236535329),v=A(v,_,y,l,g[h+1],5,-165796510),l=A(l,v,_,y,g[h+6],9,-1069501632),y=A(y,l,v,_,g[h+11],14,643717713),_=A(_,y,l,v,g[h+0],20,-373897302),v=A(v,_,y,l,g[h+5],5,-701558691),l=A(l,v,_,y,g[h+10],9,38016083),y=A(y,l,v,_,g[h+15],14,-660478335),_=A(_,y,l,v,g[h+4],20,-405537848),v=A(v,_,y,l,g[h+9],5,568446438),l=A(l,v,_,y,g[h+14],9,-1019803690),y=A(y,l,v,_,g[h+3],14,-187363961),_=A(_,y,l,v,g[h+8],20,1163531501),v=A(v,_,y,l,g[h+13],5,-1444681467),l=A(l,v,_,y,g[h+2],9,-51403784),y=A(y,l,v,_,g[h+7],14,1735328473),_=A(_,y,l,v,g[h+12],20,-1926607734),v=x(v,_,y,l,g[h+5],4,-378558),l=x(l,v,_,y,g[h+8],11,-2022574463),y=x(y,l,v,_,g[h+11],16,1839030562),_=x(_,y,l,v,g[h+14],23,-35309556),v=x(v,_,y,l,g[h+1],4,-1530992060),l=x(l,v,_,y,g[h+4],11,1272893353),y=x(y,l,v,_,g[h+7],16,-155497632),_=x(_,y,l,v,g[h+10],23,-1094730640),v=x(v,_,y,l,g[h+13],4,681279174),l=x(l,v,_,y,g[h+0],11,-358537222),y=x(y,l,v,_,g[h+3],16,-722521979),_=x(_,y,l,v,g[h+6],23,76029189),v=x(v,_,y,l,g[h+9],4,-640364487),l=x(l,v,_,y,g[h+12],11,-421815835),y=x(y,l,v,_,g[h+15],16,530742520),_=x(_,y,l,v,g[h+2],23,-995338651),v=W(v,_,y,l,g[h+0],6,-198630844),l=W(l,v,_,y,g[h+7],10,1126891415),y=W(y,l,v,_,g[h+14],15,-1416354905),_=W(_,y,l,v,g[h+5],21,-57434055),v=W(v,_,y,l,g[h+12],6,1700485571),l=W(l,v,_,y,g[h+3],10,-1894986606),y=W(y,l,v,_,g[h+10],15,-1051523),_=W(_,y,l,v,g[h+1],21,-2054922799),v=W(v,_,y,l,g[h+8],6,1873313359),l=W(l,v,_,y,g[h+15],10,-30611744),y=W(y,l,v,_,g[h+6],15,-1560198380),_=W(_,y,l,v,g[h+13],21,1309151649),v=W(v,_,y,l,g[h+4],6,-145523070),l=W(l,v,_,y,g[h+11],10,-1120210379),y=W(y,l,v,_,g[h+2],15,718787259),_=W(_,y,l,v,g[h+9],21,-343485551),v=v+st>>>0,_=_+V>>>0,y=y+ot>>>0,l=l+H>>>0}return s.endian([v,_,y,l])};u._ff=function(f,m,g,S,v,_,y){var l=f+(m&g|~m&S)+(v>>>0)+y;return(l<<_|l>>>32-_)+m},u._gg=function(f,m,g,S,v,_,y){var l=f+(m&S|g&~S)+(v>>>0)+y;return(l<<_|l>>>32-_)+m},u._hh=function(f,m,g,S,v,_,y){var l=f+(m^g^S)+(v>>>0)+y;return(l<<_|l>>>32-_)+m},u._ii=function(f,m,g,S,v,_,y){var l=f+(g^(m|~S))+(v>>>0)+y;return(l<<_|l>>>32-_)+m},u._blocksize=16,u._digestsize=16,Ks.exports=function(f,m){if(f==null)throw new Error("Illegal argument "+f);var g=s.wordsToBytes(u(f,m));return m&&m.asBytes?g:m&&m.asString?o.bytesToString(g):s.bytesToHex(g)}})();var oc=Ks.exports;const ac=on(oc);var an=(s=>(s.MAIN="main",s.NEXT="next",s))(an||{}),Fe=(s=>(s.USER="User",s.TOKEN="Token",s))(Fe||{});class Un{static async getSessionStorageDataByKey(i,n=!0){if(typeof chrome<"u"&&typeof chrome.storage<"u"){const o=await chrome.storage.session.get(i);if(o[i])return n?JSON.parse(o[i]):o[i]}if(typeof window<"u"){const o=window.sessionStorage.getItem(i);if(o)return n?JSON.parse(o):o}}static async updateSessionStorageKey(i,n){typeof chrome<"u"&&typeof chrome.storage<"u"&&await chrome.storage.session.set({[i]:JSON.stringify(n)}),typeof window<"u"&&window.sessionStorage.setItem(i,JSON.stringify(n))}static clearSessionStorage(){typeof chrome<"u"&&typeof chrome.storage<"u"&&chrome.storage.session.clear(),typeof window<"u"&&window.sessionStorage.clear()}}var zt=(s=>(s.INFO="INFO",s.WARN="WARN",s.ERROR="ERROR",s))(zt||{});class uc{constructor(i){wt(this,"delay",1e3);wt(this,"lastLoginTimestamp");wt(this,"token");wt(this,"storageKey");this.eventsSdkClass=i,this.eventsSdkClass=i,this.storageKey=""}async login(i){const n={token:i.token,email:i.email,password:i.password};if(this.storageKey=ac(JSON.stringify({...i,loggerSocketConnection:null})),this.lastLoginTimestamp&&this.lastLoginTimestamp+this.delay>new Date().getTime())return;this.updateLastLoginTimestamp(),await this.checkLoginStatus(this.storageKey)||(Un.clearSessionStorage(),await this.userLoginFunction(n,this.storageKey,i.loginType))}updateLastLoginTimestamp(){this.lastLoginTimestamp=new Date().getTime()}async checkLoginStatus(i){const n=await Un.getSessionStorageDataByKey(i);return n?(this.eventsSdkClass.loggerClass.log(zt.INFO,"got data from session",n),this.onLoginResponse(n),!0):!1}async userLoginFunction(i,n,o){let u,f,m;this.eventsSdkClass.options.isNewStack?(u=await this.externalLogin(this.eventsSdkClass.options.loginUrl,i,o),f=await this.getSettings(u.Data.AccessToken),m={...u.Data,...f}):(u=await this.externalLogin(this.eventsSdkClass.options.loginUrl,i,o),m={...u.Data.Socket}),this.onLoginResponse(m),await Un.updateSessionStorageKey(n,m)}onLoginResponse(i){if(!this.eventsSdkClass.options.isNewStack&&this.eventsSdkClass.options.servers&&(this.eventsSdkClass.servers=[...this.eventsSdkClass.options.servers],this.eventsSdkClass.server=this.eventsSdkClass.servers.reduce((n,o)=>n.Priority>o.Priority?n:o)),this.eventsSdkClass.options.isNewStack&&this.eventsSdkClass.options.servers&&(this.eventsSdkClass.servers=[...this.eventsSdkClass.options.servers],this.eventsSdkClass.server=this.eventsSdkClass.servers.reduce((n,o)=>n.Priority>o.Priority?n:o)),i.MonitorList&&i.MonitorList.length&&(this.eventsSdkClass.servers=[...i.MonitorList],this.eventsSdkClass.server=this.eventsSdkClass.servers.reduce((n,o)=>n.Priority>o.Priority?n:o)),!this.eventsSdkClass.options.isNewStack&&!this.eventsSdkClass.servers.length&&i.URLList&&(this.eventsSdkClass.URLList=i.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=${i.Client}`),i.IdentityCode&&(this.token=i.IdentityCode,this.eventsSdkClass.connect(an.MAIN)),i.Token&&(this.token=i.Token,this.eventsSdkClass.connect(an.MAIN)),i.RefreshToken&&i.IdentityCodeExpiry&&this.eventsSdkClass.options.loginType===Fe.USER&&(this.eventsSdkClass.options.refreshToken=i.RefreshToken,this.eventsSdkClass.options.tokenExpiry=i.IdentityCodeExpiry,this.handleTokenExpiry()),i.RefreshToken&&i.TokenExpiry&&this.eventsSdkClass.options.loginType===Fe.USER&&(this.eventsSdkClass.options.refreshToken=i.RefreshToken,this.eventsSdkClass.options.tokenExpiry=i.TokenExpiry,this.handleTokenExpiry())}handleTokenExpiry(){if(!this.eventsSdkClass.options.refreshTokenUrl)throw new Error("refreshTokenUrl not provided");let i;if(this.eventsSdkClass.options.tokenExpiry)i=new Date(this.eventsSdkClass.options.tokenExpiry);else return;const n=i.getTime()-new Date().getTime()-5e3,o=Math.min(n,2147483647);setTimeout(async()=>{if(this.eventsSdkClass.options.refreshToken){this.eventsSdkClass.socketIoClass.closeAllConnections();let u,f;if(this.eventsSdkClass.options.isNewStack){const m=await this.refreshToken(this.eventsSdkClass.options.refreshTokenUrl,this.eventsSdkClass.options.refreshToken);u=await this.getSettings(m.Data.AccessToken),f={...m.Data,...u}}else f={...(await this.refreshToken(this.eventsSdkClass.options.refreshTokenUrl,this.eventsSdkClass.options.refreshToken)).Data.Socket};this.onLoginResponse(f),await Un.updateSessionStorageKey(this.storageKey,f)}},o)}async externalLogin(i,{password:n,token:o,email:u},f){if(!i)throw new Error("loginUrl not provided");let m;this.eventsSdkClass.options.isNewStack?f===Fe.TOKEN?m=JSON.stringify({identityType:Fe.TOKEN,token:o}):m=JSON.stringify({identityType:Fe.USER,username:u,password:n}):this.eventsSdkClass.options.loginType===Fe.TOKEN?(m=JSON.stringify({token:o}),i=`${i}/${Fe.TOKEN}`):(m=JSON.stringify({email:u,pin:n}),i=`${i}/${Fe.USER}`);try{const g=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:m});if(!g.ok&&g.status===400)throw new Error("Bad body request. Login type or isNewStack values not correct or not provided");if(!g.ok&&g.status===401)throw new Error("Unauthorized. Invalid token provided");if(!g.ok&&g.status===403)throw new Error("Forbidden. Identity token not provided or not valid");const S=await g.json();if(S.error)throw new Error(S.error);return S}catch(g){throw this.eventsSdkClass.loggerClass.log(zt.ERROR,`External login ${i}`,g),g}}async getSettings(i){try{if(!this.eventsSdkClass.options.getSettingsUrl)throw new Error("getSettingsUrl not provided");const n=await fetch(this.eventsSdkClass.options.getSettingsUrl,{headers:{Authorization:`Bearer ${i}`}});if(!n.ok&&n.status===401)throw new Error("Unauthorized. Access token not provided or not valid");return n.json()}catch(n){throw this.eventsSdkClass.loggerClass.log(zt.ERROR,`Get settings ${this.eventsSdkClass.options.getSettingsUrl}`,n),n}}async refreshToken(i,n){try{return(await fetch(i,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`}})).json()}catch(o){throw this.eventsSdkClass.loggerClass.log(zt.ERROR,`Refresh token ${i}`,o),o}}}var rr={exports:{}};/**
7
- * @license
8
- * Lodash <https://lodash.com/>
9
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
10
- * Released under MIT license <https://lodash.com/license>
11
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
12
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
13
- */rr.exports,function(s,i){(function(){var n,o="4.17.21",u=200,f="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",m="Expected a function",g="Invalid `variable` option passed into `_.template`",S="__lodash_hash_undefined__",v=500,_="__lodash_placeholder__",y=1,l=2,h=4,b=1,A=2,x=1,W=2,st=4,V=8,ot=16,H=32,D=64,M=128,G=256,L=512,U=30,X="...",Q=800,j=16,B=1,kt=2,Et=3,Rt=1/0,ut=9007199254740991,Xt=17976931348623157e292,Le=NaN,ae=4294967295,pr=ae-1,q=ae>>>1,J=[["ary",M],["bind",x],["bindKey",W],["curry",V],["curryRight",ot],["flip",L],["partial",H],["partialRight",D],["rearg",G]],F="[object Arguments]",et="[object Array]",P="[object AsyncFunction]",Z="[object Boolean]",tt="[object Date]",z="[object DOMException]",at="[object Error]",bt="[object Function]",Jt="[object GeneratorFunction]",Ot="[object Map]",Ee="[object Number]",Fn="[object Null]",ue="[object Object]",mn="[object Promise]",Mn="[object Proxy]",jt="[object RegExp]",Zt="[object Set]",Ne="[object String]",Be="[object Symbol]",qn="[object Undefined]",Me="[object WeakMap]",Wn="[object WeakSet]",Ve="[object ArrayBuffer]",_n="[object DataView]",bi="[object Float32Array]",Si="[object Float64Array]",Ci="[object Int8Array]",ki="[object Int16Array]",Ei="[object Int32Array]",Ai="[object Uint8Array]",Ti="[object Uint8ClampedArray]",xi="[object Uint16Array]",Ri="[object Uint32Array]",Sf=/\b__p \+= '';/g,Cf=/\b(__p \+=) '' \+/g,kf=/(__e\(.*?\)|\b__t\)) \+\n'';/g,xo=/&(?:amp|lt|gt|quot|#39);/g,Ro=/[&<>"']/g,Ef=RegExp(xo.source),Af=RegExp(Ro.source),Tf=/<%-([\s\S]+?)%>/g,xf=/<%([\s\S]+?)%>/g,Oo=/<%=([\s\S]+?)%>/g,Rf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Of=/^\w*$/,If=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Oi=/[\\^$.*+?()[\]{}|]/g,Lf=RegExp(Oi.source),Ii=/^\s+/,Nf=/\s/,Bf=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Uf=/\{\n\/\* \[wrapped with (.+)\] \*/,Df=/,? & /,Pf=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ff=/[()=,{}\[\]\/\s]/,Mf=/\\(\\)?/g,qf=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Io=/\w*$/,Wf=/^[-+]0x[0-9a-f]+$/i,Kf=/^0b[01]+$/i,Gf=/^\[object .+?Constructor\]$/,Hf=/^0o[0-7]+$/i,$f=/^(?:0|[1-9]\d*)$/,zf=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,dr=/($^)/,Xf=/['\n\r\u2028\u2029\\]/g,gr="\\ud800-\\udfff",Jf="\\u0300-\\u036f",Vf="\\ufe20-\\ufe2f",Yf="\\u20d0-\\u20ff",Lo=Jf+Vf+Yf,No="\\u2700-\\u27bf",Bo="a-z\\xdf-\\xf6\\xf8-\\xff",jf="\\xac\\xb1\\xd7\\xf7",Zf="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Qf="\\u2000-\\u206f",th=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Uo="A-Z\\xc0-\\xd6\\xd8-\\xde",Do="\\ufe0e\\ufe0f",Po=jf+Zf+Qf+th,Li="['’]",eh="["+gr+"]",Fo="["+Po+"]",vr="["+Lo+"]",Mo="\\d+",nh="["+No+"]",qo="["+Bo+"]",Wo="[^"+gr+Po+Mo+No+Bo+Uo+"]",Ni="\\ud83c[\\udffb-\\udfff]",rh="(?:"+vr+"|"+Ni+")",Ko="[^"+gr+"]",Bi="(?:\\ud83c[\\udde6-\\uddff]){2}",Ui="[\\ud800-\\udbff][\\udc00-\\udfff]",wn="["+Uo+"]",Go="\\u200d",Ho="(?:"+qo+"|"+Wo+")",ih="(?:"+wn+"|"+Wo+")",$o="(?:"+Li+"(?:d|ll|m|re|s|t|ve))?",zo="(?:"+Li+"(?:D|LL|M|RE|S|T|VE))?",Xo=rh+"?",Jo="["+Do+"]?",sh="(?:"+Go+"(?:"+[Ko,Bi,Ui].join("|")+")"+Jo+Xo+")*",oh="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ah="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Vo=Jo+Xo+sh,uh="(?:"+[nh,Bi,Ui].join("|")+")"+Vo,ch="(?:"+[Ko+vr+"?",vr,Bi,Ui,eh].join("|")+")",fh=RegExp(Li,"g"),hh=RegExp(vr,"g"),Di=RegExp(Ni+"(?="+Ni+")|"+ch+Vo,"g"),lh=RegExp([wn+"?"+qo+"+"+$o+"(?="+[Fo,wn,"$"].join("|")+")",ih+"+"+zo+"(?="+[Fo,wn+Ho,"$"].join("|")+")",wn+"?"+Ho+"+"+$o,wn+"+"+zo,ah,oh,Mo,uh].join("|"),"g"),ph=RegExp("["+Go+gr+Lo+Do+"]"),dh=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,gh=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],vh=-1,xt={};xt[bi]=xt[Si]=xt[Ci]=xt[ki]=xt[Ei]=xt[Ai]=xt[Ti]=xt[xi]=xt[Ri]=!0,xt[F]=xt[et]=xt[Ve]=xt[Z]=xt[_n]=xt[tt]=xt[at]=xt[bt]=xt[Ot]=xt[Ee]=xt[ue]=xt[jt]=xt[Zt]=xt[Ne]=xt[Me]=!1;var Tt={};Tt[F]=Tt[et]=Tt[Ve]=Tt[_n]=Tt[Z]=Tt[tt]=Tt[bi]=Tt[Si]=Tt[Ci]=Tt[ki]=Tt[Ei]=Tt[Ot]=Tt[Ee]=Tt[ue]=Tt[jt]=Tt[Zt]=Tt[Ne]=Tt[Be]=Tt[Ai]=Tt[Ti]=Tt[xi]=Tt[Ri]=!0,Tt[at]=Tt[bt]=Tt[Me]=!1;var yh={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},mh={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},_h={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},wh={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},bh=parseFloat,Sh=parseInt,Yo=typeof Kt=="object"&&Kt&&Kt.Object===Object&&Kt,Ch=typeof self=="object"&&self&&self.Object===Object&&self,Ht=Yo||Ch||Function("return this")(),Pi=i&&!i.nodeType&&i,un=Pi&&!0&&s&&!s.nodeType&&s,jo=un&&un.exports===Pi,Fi=jo&&Yo.process,ve=function(){try{var k=un&&un.require&&un.require("util").types;return k||Fi&&Fi.binding&&Fi.binding("util")}catch{}}(),Zo=ve&&ve.isArrayBuffer,Qo=ve&&ve.isDate,ta=ve&&ve.isMap,ea=ve&&ve.isRegExp,na=ve&&ve.isSet,ra=ve&&ve.isTypedArray;function ce(k,R,T){switch(T.length){case 0:return k.call(R);case 1:return k.call(R,T[0]);case 2:return k.call(R,T[0],T[1]);case 3:return k.call(R,T[0],T[1],T[2])}return k.apply(R,T)}function kh(k,R,T,$){for(var ct=-1,_t=k==null?0:k.length;++ct<_t;){var Ft=k[ct];R($,Ft,T(Ft),k)}return $}function ye(k,R){for(var T=-1,$=k==null?0:k.length;++T<$&&R(k[T],T,k)!==!1;);return k}function Eh(k,R){for(var T=k==null?0:k.length;T--&&R(k[T],T,k)!==!1;);return k}function ia(k,R){for(var T=-1,$=k==null?0:k.length;++T<$;)if(!R(k[T],T,k))return!1;return!0}function Ye(k,R){for(var T=-1,$=k==null?0:k.length,ct=0,_t=[];++T<$;){var Ft=k[T];R(Ft,T,k)&&(_t[ct++]=Ft)}return _t}function yr(k,R){var T=k==null?0:k.length;return!!T&&bn(k,R,0)>-1}function Mi(k,R,T){for(var $=-1,ct=k==null?0:k.length;++$<ct;)if(T(R,k[$]))return!0;return!1}function It(k,R){for(var T=-1,$=k==null?0:k.length,ct=Array($);++T<$;)ct[T]=R(k[T],T,k);return ct}function je(k,R){for(var T=-1,$=R.length,ct=k.length;++T<$;)k[ct+T]=R[T];return k}function qi(k,R,T,$){var ct=-1,_t=k==null?0:k.length;for($&&_t&&(T=k[++ct]);++ct<_t;)T=R(T,k[ct],ct,k);return T}function Ah(k,R,T,$){var ct=k==null?0:k.length;for($&&ct&&(T=k[--ct]);ct--;)T=R(T,k[ct],ct,k);return T}function Wi(k,R){for(var T=-1,$=k==null?0:k.length;++T<$;)if(R(k[T],T,k))return!0;return!1}var Th=Ki("length");function xh(k){return k.split("")}function Rh(k){return k.match(Pf)||[]}function sa(k,R,T){var $;return T(k,function(ct,_t,Ft){if(R(ct,_t,Ft))return $=_t,!1}),$}function mr(k,R,T,$){for(var ct=k.length,_t=T+($?1:-1);$?_t--:++_t<ct;)if(R(k[_t],_t,k))return _t;return-1}function bn(k,R,T){return R===R?Wh(k,R,T):mr(k,oa,T)}function Oh(k,R,T,$){for(var ct=T-1,_t=k.length;++ct<_t;)if($(k[ct],R))return ct;return-1}function oa(k){return k!==k}function aa(k,R){var T=k==null?0:k.length;return T?Hi(k,R)/T:Le}function Ki(k){return function(R){return R==null?n:R[k]}}function Gi(k){return function(R){return k==null?n:k[R]}}function ua(k,R,T,$,ct){return ct(k,function(_t,Ft,At){T=$?($=!1,_t):R(T,_t,Ft,At)}),T}function Ih(k,R){var T=k.length;for(k.sort(R);T--;)k[T]=k[T].value;return k}function Hi(k,R){for(var T,$=-1,ct=k.length;++$<ct;){var _t=R(k[$]);_t!==n&&(T=T===n?_t:T+_t)}return T}function $i(k,R){for(var T=-1,$=Array(k);++T<k;)$[T]=R(T);return $}function Lh(k,R){return It(R,function(T){return[T,k[T]]})}function ca(k){return k&&k.slice(0,pa(k)+1).replace(Ii,"")}function fe(k){return function(R){return k(R)}}function zi(k,R){return It(R,function(T){return k[T]})}function Kn(k,R){return k.has(R)}function fa(k,R){for(var T=-1,$=k.length;++T<$&&bn(R,k[T],0)>-1;);return T}function ha(k,R){for(var T=k.length;T--&&bn(R,k[T],0)>-1;);return T}function Nh(k,R){for(var T=k.length,$=0;T--;)k[T]===R&&++$;return $}var Bh=Gi(yh),Uh=Gi(mh);function Dh(k){return"\\"+wh[k]}function Ph(k,R){return k==null?n:k[R]}function Sn(k){return ph.test(k)}function Fh(k){return dh.test(k)}function Mh(k){for(var R,T=[];!(R=k.next()).done;)T.push(R.value);return T}function Xi(k){var R=-1,T=Array(k.size);return k.forEach(function($,ct){T[++R]=[ct,$]}),T}function la(k,R){return function(T){return k(R(T))}}function Ze(k,R){for(var T=-1,$=k.length,ct=0,_t=[];++T<$;){var Ft=k[T];(Ft===R||Ft===_)&&(k[T]=_,_t[ct++]=T)}return _t}function _r(k){var R=-1,T=Array(k.size);return k.forEach(function($){T[++R]=$}),T}function qh(k){var R=-1,T=Array(k.size);return k.forEach(function($){T[++R]=[$,$]}),T}function Wh(k,R,T){for(var $=T-1,ct=k.length;++$<ct;)if(k[$]===R)return $;return-1}function Kh(k,R,T){for(var $=T+1;$--;)if(k[$]===R)return $;return $}function Cn(k){return Sn(k)?Hh(k):Th(k)}function Ae(k){return Sn(k)?$h(k):xh(k)}function pa(k){for(var R=k.length;R--&&Nf.test(k.charAt(R)););return R}var Gh=Gi(_h);function Hh(k){for(var R=Di.lastIndex=0;Di.test(k);)++R;return R}function $h(k){return k.match(Di)||[]}function zh(k){return k.match(lh)||[]}var Xh=function k(R){R=R==null?Ht:kn.defaults(Ht.Object(),R,kn.pick(Ht,gh));var T=R.Array,$=R.Date,ct=R.Error,_t=R.Function,Ft=R.Math,At=R.Object,Ji=R.RegExp,Jh=R.String,me=R.TypeError,wr=T.prototype,Vh=_t.prototype,En=At.prototype,br=R["__core-js_shared__"],Sr=Vh.toString,Ct=En.hasOwnProperty,Yh=0,da=function(){var t=/[^.]+$/.exec(br&&br.keys&&br.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Cr=En.toString,jh=Sr.call(At),Zh=Ht._,Qh=Ji("^"+Sr.call(Ct).replace(Oi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),kr=jo?R.Buffer:n,Qe=R.Symbol,Er=R.Uint8Array,ga=kr?kr.allocUnsafe:n,Ar=la(At.getPrototypeOf,At),va=At.create,ya=En.propertyIsEnumerable,Tr=wr.splice,ma=Qe?Qe.isConcatSpreadable:n,Gn=Qe?Qe.iterator:n,cn=Qe?Qe.toStringTag:n,xr=function(){try{var t=dn(At,"defineProperty");return t({},"",{}),t}catch{}}(),tl=R.clearTimeout!==Ht.clearTimeout&&R.clearTimeout,el=$&&$.now!==Ht.Date.now&&$.now,nl=R.setTimeout!==Ht.setTimeout&&R.setTimeout,Rr=Ft.ceil,Or=Ft.floor,Vi=At.getOwnPropertySymbols,rl=kr?kr.isBuffer:n,_a=R.isFinite,il=wr.join,sl=la(At.keys,At),Mt=Ft.max,Vt=Ft.min,ol=$.now,al=R.parseInt,wa=Ft.random,ul=wr.reverse,Yi=dn(R,"DataView"),Hn=dn(R,"Map"),ji=dn(R,"Promise"),An=dn(R,"Set"),$n=dn(R,"WeakMap"),zn=dn(At,"create"),Ir=$n&&new $n,Tn={},cl=gn(Yi),fl=gn(Hn),hl=gn(ji),ll=gn(An),pl=gn($n),Lr=Qe?Qe.prototype:n,Xn=Lr?Lr.valueOf:n,ba=Lr?Lr.toString:n;function p(t){if(Bt(t)&&!ft(t)&&!(t instanceof vt)){if(t instanceof _e)return t;if(Ct.call(t,"__wrapped__"))return Su(t)}return new _e(t)}var xn=function(){function t(){}return function(e){if(!Lt(e))return{};if(va)return va(e);t.prototype=e;var r=new t;return t.prototype=n,r}}();function Nr(){}function _e(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=n}p.templateSettings={escape:Tf,evaluate:xf,interpolate:Oo,variable:"",imports:{_:p}},p.prototype=Nr.prototype,p.prototype.constructor=p,_e.prototype=xn(Nr.prototype),_e.prototype.constructor=_e;function vt(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ae,this.__views__=[]}function dl(){var t=new vt(this.__wrapped__);return t.__actions__=re(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=re(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=re(this.__views__),t}function gl(){if(this.__filtered__){var t=new vt(this);t.__dir__=-1,t.__filtered__=!0}else t=this.clone(),t.__dir__*=-1;return t}function vl(){var t=this.__wrapped__.value(),e=this.__dir__,r=ft(t),a=e<0,c=r?t.length:0,d=xp(0,c,this.__views__),w=d.start,C=d.end,E=C-w,O=a?C:w-1,I=this.__iteratees__,N=I.length,K=0,Y=Vt(E,this.__takeCount__);if(!r||!a&&c==E&&Y==E)return $a(t,this.__actions__);var rt=[];t:for(;E--&&K<Y;){O+=e;for(var pt=-1,it=t[O];++pt<N;){var gt=I[pt],mt=gt.iteratee,pe=gt.type,ee=mt(it);if(pe==kt)it=ee;else if(!ee){if(pe==B)continue t;break t}}rt[K++]=it}return rt}vt.prototype=xn(Nr.prototype),vt.prototype.constructor=vt;function fn(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var a=t[e];this.set(a[0],a[1])}}function yl(){this.__data__=zn?zn(null):{},this.size=0}function ml(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function _l(t){var e=this.__data__;if(zn){var r=e[t];return r===S?n:r}return Ct.call(e,t)?e[t]:n}function wl(t){var e=this.__data__;return zn?e[t]!==n:Ct.call(e,t)}function bl(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=zn&&e===n?S:e,this}fn.prototype.clear=yl,fn.prototype.delete=ml,fn.prototype.get=_l,fn.prototype.has=wl,fn.prototype.set=bl;function qe(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var a=t[e];this.set(a[0],a[1])}}function Sl(){this.__data__=[],this.size=0}function Cl(t){var e=this.__data__,r=Br(e,t);if(r<0)return!1;var a=e.length-1;return r==a?e.pop():Tr.call(e,r,1),--this.size,!0}function kl(t){var e=this.__data__,r=Br(e,t);return r<0?n:e[r][1]}function El(t){return Br(this.__data__,t)>-1}function Al(t,e){var r=this.__data__,a=Br(r,t);return a<0?(++this.size,r.push([t,e])):r[a][1]=e,this}qe.prototype.clear=Sl,qe.prototype.delete=Cl,qe.prototype.get=kl,qe.prototype.has=El,qe.prototype.set=Al;function We(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var a=t[e];this.set(a[0],a[1])}}function Tl(){this.size=0,this.__data__={hash:new fn,map:new(Hn||qe),string:new fn}}function xl(t){var e=zr(this,t).delete(t);return this.size-=e?1:0,e}function Rl(t){return zr(this,t).get(t)}function Ol(t){return zr(this,t).has(t)}function Il(t,e){var r=zr(this,t),a=r.size;return r.set(t,e),this.size+=r.size==a?0:1,this}We.prototype.clear=Tl,We.prototype.delete=xl,We.prototype.get=Rl,We.prototype.has=Ol,We.prototype.set=Il;function hn(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new We;++e<r;)this.add(t[e])}function Ll(t){return this.__data__.set(t,S),this}function Nl(t){return this.__data__.has(t)}hn.prototype.add=hn.prototype.push=Ll,hn.prototype.has=Nl;function Te(t){var e=this.__data__=new qe(t);this.size=e.size}function Bl(){this.__data__=new qe,this.size=0}function Ul(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function Dl(t){return this.__data__.get(t)}function Pl(t){return this.__data__.has(t)}function Fl(t,e){var r=this.__data__;if(r instanceof qe){var a=r.__data__;if(!Hn||a.length<u-1)return a.push([t,e]),this.size=++r.size,this;r=this.__data__=new We(a)}return r.set(t,e),this.size=r.size,this}Te.prototype.clear=Bl,Te.prototype.delete=Ul,Te.prototype.get=Dl,Te.prototype.has=Pl,Te.prototype.set=Fl;function Sa(t,e){var r=ft(t),a=!r&&vn(t),c=!r&&!a&&sn(t),d=!r&&!a&&!c&&Ln(t),w=r||a||c||d,C=w?$i(t.length,Jh):[],E=C.length;for(var O in t)(e||Ct.call(t,O))&&!(w&&(O=="length"||c&&(O=="offset"||O=="parent")||d&&(O=="buffer"||O=="byteLength"||O=="byteOffset")||$e(O,E)))&&C.push(O);return C}function Ca(t){var e=t.length;return e?t[us(0,e-1)]:n}function Ml(t,e){return Xr(re(t),ln(e,0,t.length))}function ql(t){return Xr(re(t))}function Zi(t,e,r){(r!==n&&!xe(t[e],r)||r===n&&!(e in t))&&Ke(t,e,r)}function Jn(t,e,r){var a=t[e];(!(Ct.call(t,e)&&xe(a,r))||r===n&&!(e in t))&&Ke(t,e,r)}function Br(t,e){for(var r=t.length;r--;)if(xe(t[r][0],e))return r;return-1}function Wl(t,e,r,a){return tn(t,function(c,d,w){e(a,c,r(c),w)}),a}function ka(t,e){return t&&De(e,Wt(e),t)}function Kl(t,e){return t&&De(e,se(e),t)}function Ke(t,e,r){e=="__proto__"&&xr?xr(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Qi(t,e){for(var r=-1,a=e.length,c=T(a),d=t==null;++r<a;)c[r]=d?n:Ns(t,e[r]);return c}function ln(t,e,r){return t===t&&(r!==n&&(t=t<=r?t:r),e!==n&&(t=t>=e?t:e)),t}function we(t,e,r,a,c,d){var w,C=e&y,E=e&l,O=e&h;if(r&&(w=c?r(t,a,c,d):r(t)),w!==n)return w;if(!Lt(t))return t;var I=ft(t);if(I){if(w=Op(t),!C)return re(t,w)}else{var N=Yt(t),K=N==bt||N==Jt;if(sn(t))return Ja(t,C);if(N==ue||N==F||K&&!c){if(w=E||K?{}:pu(t),!C)return E?_p(t,Kl(w,t)):mp(t,ka(w,t))}else{if(!Tt[N])return c?t:{};w=Ip(t,N,C)}}d||(d=new Te);var Y=d.get(t);if(Y)return Y;d.set(t,w),Ku(t)?t.forEach(function(it){w.add(we(it,e,r,it,t,d))}):qu(t)&&t.forEach(function(it,gt){w.set(gt,we(it,e,r,gt,t,d))});var rt=O?E?_s:ms:E?se:Wt,pt=I?n:rt(t);return ye(pt||t,function(it,gt){pt&&(gt=it,it=t[gt]),Jn(w,gt,we(it,e,r,gt,t,d))}),w}function Gl(t){var e=Wt(t);return function(r){return Ea(r,t,e)}}function Ea(t,e,r){var a=r.length;if(t==null)return!a;for(t=At(t);a--;){var c=r[a],d=e[c],w=t[c];if(w===n&&!(c in t)||!d(w))return!1}return!0}function Aa(t,e,r){if(typeof t!="function")throw new me(m);return er(function(){t.apply(n,r)},e)}function Vn(t,e,r,a){var c=-1,d=yr,w=!0,C=t.length,E=[],O=e.length;if(!C)return E;r&&(e=It(e,fe(r))),a?(d=Mi,w=!1):e.length>=u&&(d=Kn,w=!1,e=new hn(e));t:for(;++c<C;){var I=t[c],N=r==null?I:r(I);if(I=a||I!==0?I:0,w&&N===N){for(var K=O;K--;)if(e[K]===N)continue t;E.push(I)}else d(e,N,a)||E.push(I)}return E}var tn=Qa(Ue),Ta=Qa(es,!0);function Hl(t,e){var r=!0;return tn(t,function(a,c,d){return r=!!e(a,c,d),r}),r}function Ur(t,e,r){for(var a=-1,c=t.length;++a<c;){var d=t[a],w=e(d);if(w!=null&&(C===n?w===w&&!le(w):r(w,C)))var C=w,E=d}return E}function $l(t,e,r,a){var c=t.length;for(r=lt(r),r<0&&(r=-r>c?0:c+r),a=a===n||a>c?c:lt(a),a<0&&(a+=c),a=r>a?0:Hu(a);r<a;)t[r++]=e;return t}function xa(t,e){var r=[];return tn(t,function(a,c,d){e(a,c,d)&&r.push(a)}),r}function $t(t,e,r,a,c){var d=-1,w=t.length;for(r||(r=Np),c||(c=[]);++d<w;){var C=t[d];e>0&&r(C)?e>1?$t(C,e-1,r,a,c):je(c,C):a||(c[c.length]=C)}return c}var ts=tu(),Ra=tu(!0);function Ue(t,e){return t&&ts(t,e,Wt)}function es(t,e){return t&&Ra(t,e,Wt)}function Dr(t,e){return Ye(e,function(r){return ze(t[r])})}function pn(t,e){e=nn(e,t);for(var r=0,a=e.length;t!=null&&r<a;)t=t[Pe(e[r++])];return r&&r==a?t:n}function Oa(t,e,r){var a=e(t);return ft(t)?a:je(a,r(t))}function Qt(t){return t==null?t===n?qn:Fn:cn&&cn in At(t)?Tp(t):qp(t)}function ns(t,e){return t>e}function zl(t,e){return t!=null&&Ct.call(t,e)}function Xl(t,e){return t!=null&&e in At(t)}function Jl(t,e,r){return t>=Vt(e,r)&&t<Mt(e,r)}function rs(t,e,r){for(var a=r?Mi:yr,c=t[0].length,d=t.length,w=d,C=T(d),E=1/0,O=[];w--;){var I=t[w];w&&e&&(I=It(I,fe(e))),E=Vt(I.length,E),C[w]=!r&&(e||c>=120&&I.length>=120)?new hn(w&&I):n}I=t[0];var N=-1,K=C[0];t:for(;++N<c&&O.length<E;){var Y=I[N],rt=e?e(Y):Y;if(Y=r||Y!==0?Y:0,!(K?Kn(K,rt):a(O,rt,r))){for(w=d;--w;){var pt=C[w];if(!(pt?Kn(pt,rt):a(t[w],rt,r)))continue t}K&&K.push(rt),O.push(Y)}}return O}function Vl(t,e,r,a){return Ue(t,function(c,d,w){e(a,r(c),d,w)}),a}function Yn(t,e,r){e=nn(e,t),t=yu(t,e);var a=t==null?t:t[Pe(Se(e))];return a==null?n:ce(a,t,r)}function Ia(t){return Bt(t)&&Qt(t)==F}function Yl(t){return Bt(t)&&Qt(t)==Ve}function jl(t){return Bt(t)&&Qt(t)==tt}function jn(t,e,r,a,c){return t===e?!0:t==null||e==null||!Bt(t)&&!Bt(e)?t!==t&&e!==e:Zl(t,e,r,a,jn,c)}function Zl(t,e,r,a,c,d){var w=ft(t),C=ft(e),E=w?et:Yt(t),O=C?et:Yt(e);E=E==F?ue:E,O=O==F?ue:O;var I=E==ue,N=O==ue,K=E==O;if(K&&sn(t)){if(!sn(e))return!1;w=!0,I=!1}if(K&&!I)return d||(d=new Te),w||Ln(t)?fu(t,e,r,a,c,d):Ep(t,e,E,r,a,c,d);if(!(r&b)){var Y=I&&Ct.call(t,"__wrapped__"),rt=N&&Ct.call(e,"__wrapped__");if(Y||rt){var pt=Y?t.value():t,it=rt?e.value():e;return d||(d=new Te),c(pt,it,r,a,d)}}return K?(d||(d=new Te),Ap(t,e,r,a,c,d)):!1}function Ql(t){return Bt(t)&&Yt(t)==Ot}function is(t,e,r,a){var c=r.length,d=c,w=!a;if(t==null)return!d;for(t=At(t);c--;){var C=r[c];if(w&&C[2]?C[1]!==t[C[0]]:!(C[0]in t))return!1}for(;++c<d;){C=r[c];var E=C[0],O=t[E],I=C[1];if(w&&C[2]){if(O===n&&!(E in t))return!1}else{var N=new Te;if(a)var K=a(O,I,E,t,e,N);if(!(K===n?jn(I,O,b|A,a,N):K))return!1}}return!0}function La(t){if(!Lt(t)||Up(t))return!1;var e=ze(t)?Qh:Gf;return e.test(gn(t))}function tp(t){return Bt(t)&&Qt(t)==jt}function ep(t){return Bt(t)&&Yt(t)==Zt}function np(t){return Bt(t)&&Qr(t.length)&&!!xt[Qt(t)]}function Na(t){return typeof t=="function"?t:t==null?oe:typeof t=="object"?ft(t)?Da(t[0],t[1]):Ua(t):ec(t)}function ss(t){if(!tr(t))return sl(t);var e=[];for(var r in At(t))Ct.call(t,r)&&r!="constructor"&&e.push(r);return e}function rp(t){if(!Lt(t))return Mp(t);var e=tr(t),r=[];for(var a in t)a=="constructor"&&(e||!Ct.call(t,a))||r.push(a);return r}function os(t,e){return t<e}function Ba(t,e){var r=-1,a=ie(t)?T(t.length):[];return tn(t,function(c,d,w){a[++r]=e(c,d,w)}),a}function Ua(t){var e=bs(t);return e.length==1&&e[0][2]?gu(e[0][0],e[0][1]):function(r){return r===t||is(r,t,e)}}function Da(t,e){return Cs(t)&&du(e)?gu(Pe(t),e):function(r){var a=Ns(r,t);return a===n&&a===e?Bs(r,t):jn(e,a,b|A)}}function Pr(t,e,r,a,c){t!==e&&ts(e,function(d,w){if(c||(c=new Te),Lt(d))ip(t,e,w,r,Pr,a,c);else{var C=a?a(Es(t,w),d,w+"",t,e,c):n;C===n&&(C=d),Zi(t,w,C)}},se)}function ip(t,e,r,a,c,d,w){var C=Es(t,r),E=Es(e,r),O=w.get(E);if(O){Zi(t,r,O);return}var I=d?d(C,E,r+"",t,e,w):n,N=I===n;if(N){var K=ft(E),Y=!K&&sn(E),rt=!K&&!Y&&Ln(E);I=E,K||Y||rt?ft(C)?I=C:Ut(C)?I=re(C):Y?(N=!1,I=Ja(E,!0)):rt?(N=!1,I=Va(E,!0)):I=[]:nr(E)||vn(E)?(I=C,vn(C)?I=$u(C):(!Lt(C)||ze(C))&&(I=pu(E))):N=!1}N&&(w.set(E,I),c(I,E,a,d,w),w.delete(E)),Zi(t,r,I)}function Pa(t,e){var r=t.length;if(r)return e+=e<0?r:0,$e(e,r)?t[e]:n}function Fa(t,e,r){e.length?e=It(e,function(d){return ft(d)?function(w){return pn(w,d.length===1?d[0]:d)}:d}):e=[oe];var a=-1;e=It(e,fe(nt()));var c=Ba(t,function(d,w,C){var E=It(e,function(O){return O(d)});return{criteria:E,index:++a,value:d}});return Ih(c,function(d,w){return yp(d,w,r)})}function sp(t,e){return Ma(t,e,function(r,a){return Bs(t,a)})}function Ma(t,e,r){for(var a=-1,c=e.length,d={};++a<c;){var w=e[a],C=pn(t,w);r(C,w)&&Zn(d,nn(w,t),C)}return d}function op(t){return function(e){return pn(e,t)}}function as(t,e,r,a){var c=a?Oh:bn,d=-1,w=e.length,C=t;for(t===e&&(e=re(e)),r&&(C=It(t,fe(r)));++d<w;)for(var E=0,O=e[d],I=r?r(O):O;(E=c(C,I,E,a))>-1;)C!==t&&Tr.call(C,E,1),Tr.call(t,E,1);return t}function qa(t,e){for(var r=t?e.length:0,a=r-1;r--;){var c=e[r];if(r==a||c!==d){var d=c;$e(c)?Tr.call(t,c,1):hs(t,c)}}return t}function us(t,e){return t+Or(wa()*(e-t+1))}function ap(t,e,r,a){for(var c=-1,d=Mt(Rr((e-t)/(r||1)),0),w=T(d);d--;)w[a?d:++c]=t,t+=r;return w}function cs(t,e){var r="";if(!t||e<1||e>ut)return r;do e%2&&(r+=t),e=Or(e/2),e&&(t+=t);while(e);return r}function dt(t,e){return As(vu(t,e,oe),t+"")}function up(t){return Ca(Nn(t))}function cp(t,e){var r=Nn(t);return Xr(r,ln(e,0,r.length))}function Zn(t,e,r,a){if(!Lt(t))return t;e=nn(e,t);for(var c=-1,d=e.length,w=d-1,C=t;C!=null&&++c<d;){var E=Pe(e[c]),O=r;if(E==="__proto__"||E==="constructor"||E==="prototype")return t;if(c!=w){var I=C[E];O=a?a(I,E,C):n,O===n&&(O=Lt(I)?I:$e(e[c+1])?[]:{})}Jn(C,E,O),C=C[E]}return t}var Wa=Ir?function(t,e){return Ir.set(t,e),t}:oe,fp=xr?function(t,e){return xr(t,"toString",{configurable:!0,enumerable:!1,value:Ds(e),writable:!0})}:oe;function hp(t){return Xr(Nn(t))}function be(t,e,r){var a=-1,c=t.length;e<0&&(e=-e>c?0:c+e),r=r>c?c:r,r<0&&(r+=c),c=e>r?0:r-e>>>0,e>>>=0;for(var d=T(c);++a<c;)d[a]=t[a+e];return d}function lp(t,e){var r;return tn(t,function(a,c,d){return r=e(a,c,d),!r}),!!r}function Fr(t,e,r){var a=0,c=t==null?a:t.length;if(typeof e=="number"&&e===e&&c<=q){for(;a<c;){var d=a+c>>>1,w=t[d];w!==null&&!le(w)&&(r?w<=e:w<e)?a=d+1:c=d}return c}return fs(t,e,oe,r)}function fs(t,e,r,a){var c=0,d=t==null?0:t.length;if(d===0)return 0;e=r(e);for(var w=e!==e,C=e===null,E=le(e),O=e===n;c<d;){var I=Or((c+d)/2),N=r(t[I]),K=N!==n,Y=N===null,rt=N===N,pt=le(N);if(w)var it=a||rt;else O?it=rt&&(a||K):C?it=rt&&K&&(a||!Y):E?it=rt&&K&&!Y&&(a||!pt):Y||pt?it=!1:it=a?N<=e:N<e;it?c=I+1:d=I}return Vt(d,pr)}function Ka(t,e){for(var r=-1,a=t.length,c=0,d=[];++r<a;){var w=t[r],C=e?e(w):w;if(!r||!xe(C,E)){var E=C;d[c++]=w===0?0:w}}return d}function Ga(t){return typeof t=="number"?t:le(t)?Le:+t}function he(t){if(typeof t=="string")return t;if(ft(t))return It(t,he)+"";if(le(t))return ba?ba.call(t):"";var e=t+"";return e=="0"&&1/t==-Rt?"-0":e}function en(t,e,r){var a=-1,c=yr,d=t.length,w=!0,C=[],E=C;if(r)w=!1,c=Mi;else if(d>=u){var O=e?null:Cp(t);if(O)return _r(O);w=!1,c=Kn,E=new hn}else E=e?[]:C;t:for(;++a<d;){var I=t[a],N=e?e(I):I;if(I=r||I!==0?I:0,w&&N===N){for(var K=E.length;K--;)if(E[K]===N)continue t;e&&E.push(N),C.push(I)}else c(E,N,r)||(E!==C&&E.push(N),C.push(I))}return C}function hs(t,e){return e=nn(e,t),t=yu(t,e),t==null||delete t[Pe(Se(e))]}function Ha(t,e,r,a){return Zn(t,e,r(pn(t,e)),a)}function Mr(t,e,r,a){for(var c=t.length,d=a?c:-1;(a?d--:++d<c)&&e(t[d],d,t););return r?be(t,a?0:d,a?d+1:c):be(t,a?d+1:0,a?c:d)}function $a(t,e){var r=t;return r instanceof vt&&(r=r.value()),qi(e,function(a,c){return c.func.apply(c.thisArg,je([a],c.args))},r)}function ls(t,e,r){var a=t.length;if(a<2)return a?en(t[0]):[];for(var c=-1,d=T(a);++c<a;)for(var w=t[c],C=-1;++C<a;)C!=c&&(d[c]=Vn(d[c]||w,t[C],e,r));return en($t(d,1),e,r)}function za(t,e,r){for(var a=-1,c=t.length,d=e.length,w={};++a<c;){var C=a<d?e[a]:n;r(w,t[a],C)}return w}function ps(t){return Ut(t)?t:[]}function ds(t){return typeof t=="function"?t:oe}function nn(t,e){return ft(t)?t:Cs(t,e)?[t]:bu(St(t))}var pp=dt;function rn(t,e,r){var a=t.length;return r=r===n?a:r,!e&&r>=a?t:be(t,e,r)}var Xa=tl||function(t){return Ht.clearTimeout(t)};function Ja(t,e){if(e)return t.slice();var r=t.length,a=ga?ga(r):new t.constructor(r);return t.copy(a),a}function gs(t){var e=new t.constructor(t.byteLength);return new Er(e).set(new Er(t)),e}function dp(t,e){var r=e?gs(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}function gp(t){var e=new t.constructor(t.source,Io.exec(t));return e.lastIndex=t.lastIndex,e}function vp(t){return Xn?At(Xn.call(t)):{}}function Va(t,e){var r=e?gs(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Ya(t,e){if(t!==e){var r=t!==n,a=t===null,c=t===t,d=le(t),w=e!==n,C=e===null,E=e===e,O=le(e);if(!C&&!O&&!d&&t>e||d&&w&&E&&!C&&!O||a&&w&&E||!r&&E||!c)return 1;if(!a&&!d&&!O&&t<e||O&&r&&c&&!a&&!d||C&&r&&c||!w&&c||!E)return-1}return 0}function yp(t,e,r){for(var a=-1,c=t.criteria,d=e.criteria,w=c.length,C=r.length;++a<w;){var E=Ya(c[a],d[a]);if(E){if(a>=C)return E;var O=r[a];return E*(O=="desc"?-1:1)}}return t.index-e.index}function ja(t,e,r,a){for(var c=-1,d=t.length,w=r.length,C=-1,E=e.length,O=Mt(d-w,0),I=T(E+O),N=!a;++C<E;)I[C]=e[C];for(;++c<w;)(N||c<d)&&(I[r[c]]=t[c]);for(;O--;)I[C++]=t[c++];return I}function Za(t,e,r,a){for(var c=-1,d=t.length,w=-1,C=r.length,E=-1,O=e.length,I=Mt(d-C,0),N=T(I+O),K=!a;++c<I;)N[c]=t[c];for(var Y=c;++E<O;)N[Y+E]=e[E];for(;++w<C;)(K||c<d)&&(N[Y+r[w]]=t[c++]);return N}function re(t,e){var r=-1,a=t.length;for(e||(e=T(a));++r<a;)e[r]=t[r];return e}function De(t,e,r,a){var c=!r;r||(r={});for(var d=-1,w=e.length;++d<w;){var C=e[d],E=a?a(r[C],t[C],C,r,t):n;E===n&&(E=t[C]),c?Ke(r,C,E):Jn(r,C,E)}return r}function mp(t,e){return De(t,Ss(t),e)}function _p(t,e){return De(t,hu(t),e)}function qr(t,e){return function(r,a){var c=ft(r)?kh:Wl,d=e?e():{};return c(r,t,nt(a,2),d)}}function Rn(t){return dt(function(e,r){var a=-1,c=r.length,d=c>1?r[c-1]:n,w=c>2?r[2]:n;for(d=t.length>3&&typeof d=="function"?(c--,d):n,w&&te(r[0],r[1],w)&&(d=c<3?n:d,c=1),e=At(e);++a<c;){var C=r[a];C&&t(e,C,a,d)}return e})}function Qa(t,e){return function(r,a){if(r==null)return r;if(!ie(r))return t(r,a);for(var c=r.length,d=e?c:-1,w=At(r);(e?d--:++d<c)&&a(w[d],d,w)!==!1;);return r}}function tu(t){return function(e,r,a){for(var c=-1,d=At(e),w=a(e),C=w.length;C--;){var E=w[t?C:++c];if(r(d[E],E,d)===!1)break}return e}}function wp(t,e,r){var a=e&x,c=Qn(t);function d(){var w=this&&this!==Ht&&this instanceof d?c:t;return w.apply(a?r:this,arguments)}return d}function eu(t){return function(e){e=St(e);var r=Sn(e)?Ae(e):n,a=r?r[0]:e.charAt(0),c=r?rn(r,1).join(""):e.slice(1);return a[t]()+c}}function On(t){return function(e){return qi(Qu(Zu(e).replace(fh,"")),t,"")}}function Qn(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var r=xn(t.prototype),a=t.apply(r,e);return Lt(a)?a:r}}function bp(t,e,r){var a=Qn(t);function c(){for(var d=arguments.length,w=T(d),C=d,E=In(c);C--;)w[C]=arguments[C];var O=d<3&&w[0]!==E&&w[d-1]!==E?[]:Ze(w,E);if(d-=O.length,d<r)return ou(t,e,Wr,c.placeholder,n,w,O,n,n,r-d);var I=this&&this!==Ht&&this instanceof c?a:t;return ce(I,this,w)}return c}function nu(t){return function(e,r,a){var c=At(e);if(!ie(e)){var d=nt(r,3);e=Wt(e),r=function(C){return d(c[C],C,c)}}var w=t(e,r,a);return w>-1?c[d?e[w]:w]:n}}function ru(t){return He(function(e){var r=e.length,a=r,c=_e.prototype.thru;for(t&&e.reverse();a--;){var d=e[a];if(typeof d!="function")throw new me(m);if(c&&!w&&$r(d)=="wrapper")var w=new _e([],!0)}for(a=w?a:r;++a<r;){d=e[a];var C=$r(d),E=C=="wrapper"?ws(d):n;E&&ks(E[0])&&E[1]==(M|V|H|G)&&!E[4].length&&E[9]==1?w=w[$r(E[0])].apply(w,E[3]):w=d.length==1&&ks(d)?w[C]():w.thru(d)}return function(){var O=arguments,I=O[0];if(w&&O.length==1&&ft(I))return w.plant(I).value();for(var N=0,K=r?e[N].apply(this,O):I;++N<r;)K=e[N].call(this,K);return K}})}function Wr(t,e,r,a,c,d,w,C,E,O){var I=e&M,N=e&x,K=e&W,Y=e&(V|ot),rt=e&L,pt=K?n:Qn(t);function it(){for(var gt=arguments.length,mt=T(gt),pe=gt;pe--;)mt[pe]=arguments[pe];if(Y)var ee=In(it),de=Nh(mt,ee);if(a&&(mt=ja(mt,a,c,Y)),d&&(mt=Za(mt,d,w,Y)),gt-=de,Y&&gt<O){var Dt=Ze(mt,ee);return ou(t,e,Wr,it.placeholder,r,mt,Dt,C,E,O-gt)}var Re=N?r:this,Je=K?Re[t]:t;return gt=mt.length,C?mt=Wp(mt,C):rt&&gt>1&&mt.reverse(),I&&E<gt&&(mt.length=E),this&&this!==Ht&&this instanceof it&&(Je=pt||Qn(Je)),Je.apply(Re,mt)}return it}function iu(t,e){return function(r,a){return Vl(r,t,e(a),{})}}function Kr(t,e){return function(r,a){var c;if(r===n&&a===n)return e;if(r!==n&&(c=r),a!==n){if(c===n)return a;typeof r=="string"||typeof a=="string"?(r=he(r),a=he(a)):(r=Ga(r),a=Ga(a)),c=t(r,a)}return c}}function vs(t){return He(function(e){return e=It(e,fe(nt())),dt(function(r){var a=this;return t(e,function(c){return ce(c,a,r)})})})}function Gr(t,e){e=e===n?" ":he(e);var r=e.length;if(r<2)return r?cs(e,t):e;var a=cs(e,Rr(t/Cn(e)));return Sn(e)?rn(Ae(a),0,t).join(""):a.slice(0,t)}function Sp(t,e,r,a){var c=e&x,d=Qn(t);function w(){for(var C=-1,E=arguments.length,O=-1,I=a.length,N=T(I+E),K=this&&this!==Ht&&this instanceof w?d:t;++O<I;)N[O]=a[O];for(;E--;)N[O++]=arguments[++C];return ce(K,c?r:this,N)}return w}function su(t){return function(e,r,a){return a&&typeof a!="number"&&te(e,r,a)&&(r=a=n),e=Xe(e),r===n?(r=e,e=0):r=Xe(r),a=a===n?e<r?1:-1:Xe(a),ap(e,r,a,t)}}function Hr(t){return function(e,r){return typeof e=="string"&&typeof r=="string"||(e=Ce(e),r=Ce(r)),t(e,r)}}function ou(t,e,r,a,c,d,w,C,E,O){var I=e&V,N=I?w:n,K=I?n:w,Y=I?d:n,rt=I?n:d;e|=I?H:D,e&=~(I?D:H),e&st||(e&=~(x|W));var pt=[t,e,c,Y,N,rt,K,C,E,O],it=r.apply(n,pt);return ks(t)&&mu(it,pt),it.placeholder=a,_u(it,t,e)}function ys(t){var e=Ft[t];return function(r,a){if(r=Ce(r),a=a==null?0:Vt(lt(a),292),a&&_a(r)){var c=(St(r)+"e").split("e"),d=e(c[0]+"e"+(+c[1]+a));return c=(St(d)+"e").split("e"),+(c[0]+"e"+(+c[1]-a))}return e(r)}}var Cp=An&&1/_r(new An([,-0]))[1]==Rt?function(t){return new An(t)}:Ms;function au(t){return function(e){var r=Yt(e);return r==Ot?Xi(e):r==Zt?qh(e):Lh(e,t(e))}}function Ge(t,e,r,a,c,d,w,C){var E=e&W;if(!E&&typeof t!="function")throw new me(m);var O=a?a.length:0;if(O||(e&=~(H|D),a=c=n),w=w===n?w:Mt(lt(w),0),C=C===n?C:lt(C),O-=c?c.length:0,e&D){var I=a,N=c;a=c=n}var K=E?n:ws(t),Y=[t,e,r,a,c,I,N,d,w,C];if(K&&Fp(Y,K),t=Y[0],e=Y[1],r=Y[2],a=Y[3],c=Y[4],C=Y[9]=Y[9]===n?E?0:t.length:Mt(Y[9]-O,0),!C&&e&(V|ot)&&(e&=~(V|ot)),!e||e==x)var rt=wp(t,e,r);else e==V||e==ot?rt=bp(t,e,C):(e==H||e==(x|H))&&!c.length?rt=Sp(t,e,r,a):rt=Wr.apply(n,Y);var pt=K?Wa:mu;return _u(pt(rt,Y),t,e)}function uu(t,e,r,a){return t===n||xe(t,En[r])&&!Ct.call(a,r)?e:t}function cu(t,e,r,a,c,d){return Lt(t)&&Lt(e)&&(d.set(e,t),Pr(t,e,n,cu,d),d.delete(e)),t}function kp(t){return nr(t)?n:t}function fu(t,e,r,a,c,d){var w=r&b,C=t.length,E=e.length;if(C!=E&&!(w&&E>C))return!1;var O=d.get(t),I=d.get(e);if(O&&I)return O==e&&I==t;var N=-1,K=!0,Y=r&A?new hn:n;for(d.set(t,e),d.set(e,t);++N<C;){var rt=t[N],pt=e[N];if(a)var it=w?a(pt,rt,N,e,t,d):a(rt,pt,N,t,e,d);if(it!==n){if(it)continue;K=!1;break}if(Y){if(!Wi(e,function(gt,mt){if(!Kn(Y,mt)&&(rt===gt||c(rt,gt,r,a,d)))return Y.push(mt)})){K=!1;break}}else if(!(rt===pt||c(rt,pt,r,a,d))){K=!1;break}}return d.delete(t),d.delete(e),K}function Ep(t,e,r,a,c,d,w){switch(r){case _n:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Ve:return!(t.byteLength!=e.byteLength||!d(new Er(t),new Er(e)));case Z:case tt:case Ee:return xe(+t,+e);case at:return t.name==e.name&&t.message==e.message;case jt:case Ne:return t==e+"";case Ot:var C=Xi;case Zt:var E=a&b;if(C||(C=_r),t.size!=e.size&&!E)return!1;var O=w.get(t);if(O)return O==e;a|=A,w.set(t,e);var I=fu(C(t),C(e),a,c,d,w);return w.delete(t),I;case Be:if(Xn)return Xn.call(t)==Xn.call(e)}return!1}function Ap(t,e,r,a,c,d){var w=r&b,C=ms(t),E=C.length,O=ms(e),I=O.length;if(E!=I&&!w)return!1;for(var N=E;N--;){var K=C[N];if(!(w?K in e:Ct.call(e,K)))return!1}var Y=d.get(t),rt=d.get(e);if(Y&&rt)return Y==e&&rt==t;var pt=!0;d.set(t,e),d.set(e,t);for(var it=w;++N<E;){K=C[N];var gt=t[K],mt=e[K];if(a)var pe=w?a(mt,gt,K,e,t,d):a(gt,mt,K,t,e,d);if(!(pe===n?gt===mt||c(gt,mt,r,a,d):pe)){pt=!1;break}it||(it=K=="constructor")}if(pt&&!it){var ee=t.constructor,de=e.constructor;ee!=de&&"constructor"in t&&"constructor"in e&&!(typeof ee=="function"&&ee instanceof ee&&typeof de=="function"&&de instanceof de)&&(pt=!1)}return d.delete(t),d.delete(e),pt}function He(t){return As(vu(t,n,Eu),t+"")}function ms(t){return Oa(t,Wt,Ss)}function _s(t){return Oa(t,se,hu)}var ws=Ir?function(t){return Ir.get(t)}:Ms;function $r(t){for(var e=t.name+"",r=Tn[e],a=Ct.call(Tn,e)?r.length:0;a--;){var c=r[a],d=c.func;if(d==null||d==t)return c.name}return e}function In(t){var e=Ct.call(p,"placeholder")?p:t;return e.placeholder}function nt(){var t=p.iteratee||Ps;return t=t===Ps?Na:t,arguments.length?t(arguments[0],arguments[1]):t}function zr(t,e){var r=t.__data__;return Bp(e)?r[typeof e=="string"?"string":"hash"]:r.map}function bs(t){for(var e=Wt(t),r=e.length;r--;){var a=e[r],c=t[a];e[r]=[a,c,du(c)]}return e}function dn(t,e){var r=Ph(t,e);return La(r)?r:n}function Tp(t){var e=Ct.call(t,cn),r=t[cn];try{t[cn]=n;var a=!0}catch{}var c=Cr.call(t);return a&&(e?t[cn]=r:delete t[cn]),c}var Ss=Vi?function(t){return t==null?[]:(t=At(t),Ye(Vi(t),function(e){return ya.call(t,e)}))}:qs,hu=Vi?function(t){for(var e=[];t;)je(e,Ss(t)),t=Ar(t);return e}:qs,Yt=Qt;(Yi&&Yt(new Yi(new ArrayBuffer(1)))!=_n||Hn&&Yt(new Hn)!=Ot||ji&&Yt(ji.resolve())!=mn||An&&Yt(new An)!=Zt||$n&&Yt(new $n)!=Me)&&(Yt=function(t){var e=Qt(t),r=e==ue?t.constructor:n,a=r?gn(r):"";if(a)switch(a){case cl:return _n;case fl:return Ot;case hl:return mn;case ll:return Zt;case pl:return Me}return e});function xp(t,e,r){for(var a=-1,c=r.length;++a<c;){var d=r[a],w=d.size;switch(d.type){case"drop":t+=w;break;case"dropRight":e-=w;break;case"take":e=Vt(e,t+w);break;case"takeRight":t=Mt(t,e-w);break}}return{start:t,end:e}}function Rp(t){var e=t.match(Uf);return e?e[1].split(Df):[]}function lu(t,e,r){e=nn(e,t);for(var a=-1,c=e.length,d=!1;++a<c;){var w=Pe(e[a]);if(!(d=t!=null&&r(t,w)))break;t=t[w]}return d||++a!=c?d:(c=t==null?0:t.length,!!c&&Qr(c)&&$e(w,c)&&(ft(t)||vn(t)))}function Op(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&Ct.call(t,"index")&&(r.index=t.index,r.input=t.input),r}function pu(t){return typeof t.constructor=="function"&&!tr(t)?xn(Ar(t)):{}}function Ip(t,e,r){var a=t.constructor;switch(e){case Ve:return gs(t);case Z:case tt:return new a(+t);case _n:return dp(t,r);case bi:case Si:case Ci:case ki:case Ei:case Ai:case Ti:case xi:case Ri:return Va(t,r);case Ot:return new a;case Ee:case Ne:return new a(t);case jt:return gp(t);case Zt:return new a;case Be:return vp(t)}}function Lp(t,e){var r=e.length;if(!r)return t;var a=r-1;return e[a]=(r>1?"& ":"")+e[a],e=e.join(r>2?", ":" "),t.replace(Bf,`{
14
- /* [wrapped with `+e+`] */
15
- `)}function Np(t){return ft(t)||vn(t)||!!(ma&&t&&t[ma])}function $e(t,e){var r=typeof t;return e=e??ut,!!e&&(r=="number"||r!="symbol"&&$f.test(t))&&t>-1&&t%1==0&&t<e}function te(t,e,r){if(!Lt(r))return!1;var a=typeof e;return(a=="number"?ie(r)&&$e(e,r.length):a=="string"&&e in r)?xe(r[e],t):!1}function Cs(t,e){if(ft(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||le(t)?!0:Of.test(t)||!Rf.test(t)||e!=null&&t in At(e)}function Bp(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function ks(t){var e=$r(t),r=p[e];if(typeof r!="function"||!(e in vt.prototype))return!1;if(t===r)return!0;var a=ws(r);return!!a&&t===a[0]}function Up(t){return!!da&&da in t}var Dp=br?ze:Ws;function tr(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||En;return t===r}function du(t){return t===t&&!Lt(t)}function gu(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==n||t in At(r))}}function Pp(t){var e=jr(t,function(a){return r.size===v&&r.clear(),a}),r=e.cache;return e}function Fp(t,e){var r=t[1],a=e[1],c=r|a,d=c<(x|W|M),w=a==M&&r==V||a==M&&r==G&&t[7].length<=e[8]||a==(M|G)&&e[7].length<=e[8]&&r==V;if(!(d||w))return t;a&x&&(t[2]=e[2],c|=r&x?0:st);var C=e[3];if(C){var E=t[3];t[3]=E?ja(E,C,e[4]):C,t[4]=E?Ze(t[3],_):e[4]}return C=e[5],C&&(E=t[5],t[5]=E?Za(E,C,e[6]):C,t[6]=E?Ze(t[5],_):e[6]),C=e[7],C&&(t[7]=C),a&M&&(t[8]=t[8]==null?e[8]:Vt(t[8],e[8])),t[9]==null&&(t[9]=e[9]),t[0]=e[0],t[1]=c,t}function Mp(t){var e=[];if(t!=null)for(var r in At(t))e.push(r);return e}function qp(t){return Cr.call(t)}function vu(t,e,r){return e=Mt(e===n?t.length-1:e,0),function(){for(var a=arguments,c=-1,d=Mt(a.length-e,0),w=T(d);++c<d;)w[c]=a[e+c];c=-1;for(var C=T(e+1);++c<e;)C[c]=a[c];return C[e]=r(w),ce(t,this,C)}}function yu(t,e){return e.length<2?t:pn(t,be(e,0,-1))}function Wp(t,e){for(var r=t.length,a=Vt(e.length,r),c=re(t);a--;){var d=e[a];t[a]=$e(d,r)?c[d]:n}return t}function Es(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var mu=wu(Wa),er=nl||function(t,e){return Ht.setTimeout(t,e)},As=wu(fp);function _u(t,e,r){var a=e+"";return As(t,Lp(a,Kp(Rp(a),r)))}function wu(t){var e=0,r=0;return function(){var a=ol(),c=j-(a-r);if(r=a,c>0){if(++e>=Q)return arguments[0]}else e=0;return t.apply(n,arguments)}}function Xr(t,e){var r=-1,a=t.length,c=a-1;for(e=e===n?a:e;++r<e;){var d=us(r,c),w=t[d];t[d]=t[r],t[r]=w}return t.length=e,t}var bu=Pp(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(If,function(r,a,c,d){e.push(c?d.replace(Mf,"$1"):a||r)}),e});function Pe(t){if(typeof t=="string"||le(t))return t;var e=t+"";return e=="0"&&1/t==-Rt?"-0":e}function gn(t){if(t!=null){try{return Sr.call(t)}catch{}try{return t+""}catch{}}return""}function Kp(t,e){return ye(J,function(r){var a="_."+r[0];e&r[1]&&!yr(t,a)&&t.push(a)}),t.sort()}function Su(t){if(t instanceof vt)return t.clone();var e=new _e(t.__wrapped__,t.__chain__);return e.__actions__=re(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}function Gp(t,e,r){(r?te(t,e,r):e===n)?e=1:e=Mt(lt(e),0);var a=t==null?0:t.length;if(!a||e<1)return[];for(var c=0,d=0,w=T(Rr(a/e));c<a;)w[d++]=be(t,c,c+=e);return w}function Hp(t){for(var e=-1,r=t==null?0:t.length,a=0,c=[];++e<r;){var d=t[e];d&&(c[a++]=d)}return c}function $p(){var t=arguments.length;if(!t)return[];for(var e=T(t-1),r=arguments[0],a=t;a--;)e[a-1]=arguments[a];return je(ft(r)?re(r):[r],$t(e,1))}var zp=dt(function(t,e){return Ut(t)?Vn(t,$t(e,1,Ut,!0)):[]}),Xp=dt(function(t,e){var r=Se(e);return Ut(r)&&(r=n),Ut(t)?Vn(t,$t(e,1,Ut,!0),nt(r,2)):[]}),Jp=dt(function(t,e){var r=Se(e);return Ut(r)&&(r=n),Ut(t)?Vn(t,$t(e,1,Ut,!0),n,r):[]});function Vp(t,e,r){var a=t==null?0:t.length;return a?(e=r||e===n?1:lt(e),be(t,e<0?0:e,a)):[]}function Yp(t,e,r){var a=t==null?0:t.length;return a?(e=r||e===n?1:lt(e),e=a-e,be(t,0,e<0?0:e)):[]}function jp(t,e){return t&&t.length?Mr(t,nt(e,3),!0,!0):[]}function Zp(t,e){return t&&t.length?Mr(t,nt(e,3),!0):[]}function Qp(t,e,r,a){var c=t==null?0:t.length;return c?(r&&typeof r!="number"&&te(t,e,r)&&(r=0,a=c),$l(t,e,r,a)):[]}function Cu(t,e,r){var a=t==null?0:t.length;if(!a)return-1;var c=r==null?0:lt(r);return c<0&&(c=Mt(a+c,0)),mr(t,nt(e,3),c)}function ku(t,e,r){var a=t==null?0:t.length;if(!a)return-1;var c=a-1;return r!==n&&(c=lt(r),c=r<0?Mt(a+c,0):Vt(c,a-1)),mr(t,nt(e,3),c,!0)}function Eu(t){var e=t==null?0:t.length;return e?$t(t,1):[]}function td(t){var e=t==null?0:t.length;return e?$t(t,Rt):[]}function ed(t,e){var r=t==null?0:t.length;return r?(e=e===n?1:lt(e),$t(t,e)):[]}function nd(t){for(var e=-1,r=t==null?0:t.length,a={};++e<r;){var c=t[e];a[c[0]]=c[1]}return a}function Au(t){return t&&t.length?t[0]:n}function rd(t,e,r){var a=t==null?0:t.length;if(!a)return-1;var c=r==null?0:lt(r);return c<0&&(c=Mt(a+c,0)),bn(t,e,c)}function id(t){var e=t==null?0:t.length;return e?be(t,0,-1):[]}var sd=dt(function(t){var e=It(t,ps);return e.length&&e[0]===t[0]?rs(e):[]}),od=dt(function(t){var e=Se(t),r=It(t,ps);return e===Se(r)?e=n:r.pop(),r.length&&r[0]===t[0]?rs(r,nt(e,2)):[]}),ad=dt(function(t){var e=Se(t),r=It(t,ps);return e=typeof e=="function"?e:n,e&&r.pop(),r.length&&r[0]===t[0]?rs(r,n,e):[]});function ud(t,e){return t==null?"":il.call(t,e)}function Se(t){var e=t==null?0:t.length;return e?t[e-1]:n}function cd(t,e,r){var a=t==null?0:t.length;if(!a)return-1;var c=a;return r!==n&&(c=lt(r),c=c<0?Mt(a+c,0):Vt(c,a-1)),e===e?Kh(t,e,c):mr(t,oa,c,!0)}function fd(t,e){return t&&t.length?Pa(t,lt(e)):n}var hd=dt(Tu);function Tu(t,e){return t&&t.length&&e&&e.length?as(t,e):t}function ld(t,e,r){return t&&t.length&&e&&e.length?as(t,e,nt(r,2)):t}function pd(t,e,r){return t&&t.length&&e&&e.length?as(t,e,n,r):t}var dd=He(function(t,e){var r=t==null?0:t.length,a=Qi(t,e);return qa(t,It(e,function(c){return $e(c,r)?+c:c}).sort(Ya)),a});function gd(t,e){var r=[];if(!(t&&t.length))return r;var a=-1,c=[],d=t.length;for(e=nt(e,3);++a<d;){var w=t[a];e(w,a,t)&&(r.push(w),c.push(a))}return qa(t,c),r}function Ts(t){return t==null?t:ul.call(t)}function vd(t,e,r){var a=t==null?0:t.length;return a?(r&&typeof r!="number"&&te(t,e,r)?(e=0,r=a):(e=e==null?0:lt(e),r=r===n?a:lt(r)),be(t,e,r)):[]}function yd(t,e){return Fr(t,e)}function md(t,e,r){return fs(t,e,nt(r,2))}function _d(t,e){var r=t==null?0:t.length;if(r){var a=Fr(t,e);if(a<r&&xe(t[a],e))return a}return-1}function wd(t,e){return Fr(t,e,!0)}function bd(t,e,r){return fs(t,e,nt(r,2),!0)}function Sd(t,e){var r=t==null?0:t.length;if(r){var a=Fr(t,e,!0)-1;if(xe(t[a],e))return a}return-1}function Cd(t){return t&&t.length?Ka(t):[]}function kd(t,e){return t&&t.length?Ka(t,nt(e,2)):[]}function Ed(t){var e=t==null?0:t.length;return e?be(t,1,e):[]}function Ad(t,e,r){return t&&t.length?(e=r||e===n?1:lt(e),be(t,0,e<0?0:e)):[]}function Td(t,e,r){var a=t==null?0:t.length;return a?(e=r||e===n?1:lt(e),e=a-e,be(t,e<0?0:e,a)):[]}function xd(t,e){return t&&t.length?Mr(t,nt(e,3),!1,!0):[]}function Rd(t,e){return t&&t.length?Mr(t,nt(e,3)):[]}var Od=dt(function(t){return en($t(t,1,Ut,!0))}),Id=dt(function(t){var e=Se(t);return Ut(e)&&(e=n),en($t(t,1,Ut,!0),nt(e,2))}),Ld=dt(function(t){var e=Se(t);return e=typeof e=="function"?e:n,en($t(t,1,Ut,!0),n,e)});function Nd(t){return t&&t.length?en(t):[]}function Bd(t,e){return t&&t.length?en(t,nt(e,2)):[]}function Ud(t,e){return e=typeof e=="function"?e:n,t&&t.length?en(t,n,e):[]}function xs(t){if(!(t&&t.length))return[];var e=0;return t=Ye(t,function(r){if(Ut(r))return e=Mt(r.length,e),!0}),$i(e,function(r){return It(t,Ki(r))})}function xu(t,e){if(!(t&&t.length))return[];var r=xs(t);return e==null?r:It(r,function(a){return ce(e,n,a)})}var Dd=dt(function(t,e){return Ut(t)?Vn(t,e):[]}),Pd=dt(function(t){return ls(Ye(t,Ut))}),Fd=dt(function(t){var e=Se(t);return Ut(e)&&(e=n),ls(Ye(t,Ut),nt(e,2))}),Md=dt(function(t){var e=Se(t);return e=typeof e=="function"?e:n,ls(Ye(t,Ut),n,e)}),qd=dt(xs);function Wd(t,e){return za(t||[],e||[],Jn)}function Kd(t,e){return za(t||[],e||[],Zn)}var Gd=dt(function(t){var e=t.length,r=e>1?t[e-1]:n;return r=typeof r=="function"?(t.pop(),r):n,xu(t,r)});function Ru(t){var e=p(t);return e.__chain__=!0,e}function Hd(t,e){return e(t),t}function Jr(t,e){return e(t)}var $d=He(function(t){var e=t.length,r=e?t[0]:0,a=this.__wrapped__,c=function(d){return Qi(d,t)};return e>1||this.__actions__.length||!(a instanceof vt)||!$e(r)?this.thru(c):(a=a.slice(r,+r+(e?1:0)),a.__actions__.push({func:Jr,args:[c],thisArg:n}),new _e(a,this.__chain__).thru(function(d){return e&&!d.length&&d.push(n),d}))});function zd(){return Ru(this)}function Xd(){return new _e(this.value(),this.__chain__)}function Jd(){this.__values__===n&&(this.__values__=Gu(this.value()));var t=this.__index__>=this.__values__.length,e=t?n:this.__values__[this.__index__++];return{done:t,value:e}}function Vd(){return this}function Yd(t){for(var e,r=this;r instanceof Nr;){var a=Su(r);a.__index__=0,a.__values__=n,e?c.__wrapped__=a:e=a;var c=a;r=r.__wrapped__}return c.__wrapped__=t,e}function jd(){var t=this.__wrapped__;if(t instanceof vt){var e=t;return this.__actions__.length&&(e=new vt(this)),e=e.reverse(),e.__actions__.push({func:Jr,args:[Ts],thisArg:n}),new _e(e,this.__chain__)}return this.thru(Ts)}function Zd(){return $a(this.__wrapped__,this.__actions__)}var Qd=qr(function(t,e,r){Ct.call(t,r)?++t[r]:Ke(t,r,1)});function tg(t,e,r){var a=ft(t)?ia:Hl;return r&&te(t,e,r)&&(e=n),a(t,nt(e,3))}function eg(t,e){var r=ft(t)?Ye:xa;return r(t,nt(e,3))}var ng=nu(Cu),rg=nu(ku);function ig(t,e){return $t(Vr(t,e),1)}function sg(t,e){return $t(Vr(t,e),Rt)}function og(t,e,r){return r=r===n?1:lt(r),$t(Vr(t,e),r)}function Ou(t,e){var r=ft(t)?ye:tn;return r(t,nt(e,3))}function Iu(t,e){var r=ft(t)?Eh:Ta;return r(t,nt(e,3))}var ag=qr(function(t,e,r){Ct.call(t,r)?t[r].push(e):Ke(t,r,[e])});function ug(t,e,r,a){t=ie(t)?t:Nn(t),r=r&&!a?lt(r):0;var c=t.length;return r<0&&(r=Mt(c+r,0)),ti(t)?r<=c&&t.indexOf(e,r)>-1:!!c&&bn(t,e,r)>-1}var cg=dt(function(t,e,r){var a=-1,c=typeof e=="function",d=ie(t)?T(t.length):[];return tn(t,function(w){d[++a]=c?ce(e,w,r):Yn(w,e,r)}),d}),fg=qr(function(t,e,r){Ke(t,r,e)});function Vr(t,e){var r=ft(t)?It:Ba;return r(t,nt(e,3))}function hg(t,e,r,a){return t==null?[]:(ft(e)||(e=e==null?[]:[e]),r=a?n:r,ft(r)||(r=r==null?[]:[r]),Fa(t,e,r))}var lg=qr(function(t,e,r){t[r?0:1].push(e)},function(){return[[],[]]});function pg(t,e,r){var a=ft(t)?qi:ua,c=arguments.length<3;return a(t,nt(e,4),r,c,tn)}function dg(t,e,r){var a=ft(t)?Ah:ua,c=arguments.length<3;return a(t,nt(e,4),r,c,Ta)}function gg(t,e){var r=ft(t)?Ye:xa;return r(t,Zr(nt(e,3)))}function vg(t){var e=ft(t)?Ca:up;return e(t)}function yg(t,e,r){(r?te(t,e,r):e===n)?e=1:e=lt(e);var a=ft(t)?Ml:cp;return a(t,e)}function mg(t){var e=ft(t)?ql:hp;return e(t)}function _g(t){if(t==null)return 0;if(ie(t))return ti(t)?Cn(t):t.length;var e=Yt(t);return e==Ot||e==Zt?t.size:ss(t).length}function wg(t,e,r){var a=ft(t)?Wi:lp;return r&&te(t,e,r)&&(e=n),a(t,nt(e,3))}var bg=dt(function(t,e){if(t==null)return[];var r=e.length;return r>1&&te(t,e[0],e[1])?e=[]:r>2&&te(e[0],e[1],e[2])&&(e=[e[0]]),Fa(t,$t(e,1),[])}),Yr=el||function(){return Ht.Date.now()};function Sg(t,e){if(typeof e!="function")throw new me(m);return t=lt(t),function(){if(--t<1)return e.apply(this,arguments)}}function Lu(t,e,r){return e=r?n:e,e=t&&e==null?t.length:e,Ge(t,M,n,n,n,n,e)}function Nu(t,e){var r;if(typeof e!="function")throw new me(m);return t=lt(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=n),r}}var Rs=dt(function(t,e,r){var a=x;if(r.length){var c=Ze(r,In(Rs));a|=H}return Ge(t,a,e,r,c)}),Bu=dt(function(t,e,r){var a=x|W;if(r.length){var c=Ze(r,In(Bu));a|=H}return Ge(e,a,t,r,c)});function Uu(t,e,r){e=r?n:e;var a=Ge(t,V,n,n,n,n,n,e);return a.placeholder=Uu.placeholder,a}function Du(t,e,r){e=r?n:e;var a=Ge(t,ot,n,n,n,n,n,e);return a.placeholder=Du.placeholder,a}function Pu(t,e,r){var a,c,d,w,C,E,O=0,I=!1,N=!1,K=!0;if(typeof t!="function")throw new me(m);e=Ce(e)||0,Lt(r)&&(I=!!r.leading,N="maxWait"in r,d=N?Mt(Ce(r.maxWait)||0,e):d,K="trailing"in r?!!r.trailing:K);function Y(Dt){var Re=a,Je=c;return a=c=n,O=Dt,w=t.apply(Je,Re),w}function rt(Dt){return O=Dt,C=er(gt,e),I?Y(Dt):w}function pt(Dt){var Re=Dt-E,Je=Dt-O,nc=e-Re;return N?Vt(nc,d-Je):nc}function it(Dt){var Re=Dt-E,Je=Dt-O;return E===n||Re>=e||Re<0||N&&Je>=d}function gt(){var Dt=Yr();if(it(Dt))return mt(Dt);C=er(gt,pt(Dt))}function mt(Dt){return C=n,K&&a?Y(Dt):(a=c=n,w)}function pe(){C!==n&&Xa(C),O=0,a=E=c=C=n}function ee(){return C===n?w:mt(Yr())}function de(){var Dt=Yr(),Re=it(Dt);if(a=arguments,c=this,E=Dt,Re){if(C===n)return rt(E);if(N)return Xa(C),C=er(gt,e),Y(E)}return C===n&&(C=er(gt,e)),w}return de.cancel=pe,de.flush=ee,de}var Cg=dt(function(t,e){return Aa(t,1,e)}),kg=dt(function(t,e,r){return Aa(t,Ce(e)||0,r)});function Eg(t){return Ge(t,L)}function jr(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new me(m);var r=function(){var a=arguments,c=e?e.apply(this,a):a[0],d=r.cache;if(d.has(c))return d.get(c);var w=t.apply(this,a);return r.cache=d.set(c,w)||d,w};return r.cache=new(jr.Cache||We),r}jr.Cache=We;function Zr(t){if(typeof t!="function")throw new me(m);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function Ag(t){return Nu(2,t)}var Tg=pp(function(t,e){e=e.length==1&&ft(e[0])?It(e[0],fe(nt())):It($t(e,1),fe(nt()));var r=e.length;return dt(function(a){for(var c=-1,d=Vt(a.length,r);++c<d;)a[c]=e[c].call(this,a[c]);return ce(t,this,a)})}),Os=dt(function(t,e){var r=Ze(e,In(Os));return Ge(t,H,n,e,r)}),Fu=dt(function(t,e){var r=Ze(e,In(Fu));return Ge(t,D,n,e,r)}),xg=He(function(t,e){return Ge(t,G,n,n,n,e)});function Rg(t,e){if(typeof t!="function")throw new me(m);return e=e===n?e:lt(e),dt(t,e)}function Og(t,e){if(typeof t!="function")throw new me(m);return e=e==null?0:Mt(lt(e),0),dt(function(r){var a=r[e],c=rn(r,0,e);return a&&je(c,a),ce(t,this,c)})}function Ig(t,e,r){var a=!0,c=!0;if(typeof t!="function")throw new me(m);return Lt(r)&&(a="leading"in r?!!r.leading:a,c="trailing"in r?!!r.trailing:c),Pu(t,e,{leading:a,maxWait:e,trailing:c})}function Lg(t){return Lu(t,1)}function Ng(t,e){return Os(ds(e),t)}function Bg(){if(!arguments.length)return[];var t=arguments[0];return ft(t)?t:[t]}function Ug(t){return we(t,h)}function Dg(t,e){return e=typeof e=="function"?e:n,we(t,h,e)}function Pg(t){return we(t,y|h)}function Fg(t,e){return e=typeof e=="function"?e:n,we(t,y|h,e)}function Mg(t,e){return e==null||Ea(t,e,Wt(e))}function xe(t,e){return t===e||t!==t&&e!==e}var qg=Hr(ns),Wg=Hr(function(t,e){return t>=e}),vn=Ia(function(){return arguments}())?Ia:function(t){return Bt(t)&&Ct.call(t,"callee")&&!ya.call(t,"callee")},ft=T.isArray,Kg=Zo?fe(Zo):Yl;function ie(t){return t!=null&&Qr(t.length)&&!ze(t)}function Ut(t){return Bt(t)&&ie(t)}function Gg(t){return t===!0||t===!1||Bt(t)&&Qt(t)==Z}var sn=rl||Ws,Hg=Qo?fe(Qo):jl;function $g(t){return Bt(t)&&t.nodeType===1&&!nr(t)}function zg(t){if(t==null)return!0;if(ie(t)&&(ft(t)||typeof t=="string"||typeof t.splice=="function"||sn(t)||Ln(t)||vn(t)))return!t.length;var e=Yt(t);if(e==Ot||e==Zt)return!t.size;if(tr(t))return!ss(t).length;for(var r in t)if(Ct.call(t,r))return!1;return!0}function Xg(t,e){return jn(t,e)}function Jg(t,e,r){r=typeof r=="function"?r:n;var a=r?r(t,e):n;return a===n?jn(t,e,n,r):!!a}function Is(t){if(!Bt(t))return!1;var e=Qt(t);return e==at||e==z||typeof t.message=="string"&&typeof t.name=="string"&&!nr(t)}function Vg(t){return typeof t=="number"&&_a(t)}function ze(t){if(!Lt(t))return!1;var e=Qt(t);return e==bt||e==Jt||e==P||e==Mn}function Mu(t){return typeof t=="number"&&t==lt(t)}function Qr(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ut}function Lt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function Bt(t){return t!=null&&typeof t=="object"}var qu=ta?fe(ta):Ql;function Yg(t,e){return t===e||is(t,e,bs(e))}function jg(t,e,r){return r=typeof r=="function"?r:n,is(t,e,bs(e),r)}function Zg(t){return Wu(t)&&t!=+t}function Qg(t){if(Dp(t))throw new ct(f);return La(t)}function tv(t){return t===null}function ev(t){return t==null}function Wu(t){return typeof t=="number"||Bt(t)&&Qt(t)==Ee}function nr(t){if(!Bt(t)||Qt(t)!=ue)return!1;var e=Ar(t);if(e===null)return!0;var r=Ct.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Sr.call(r)==jh}var Ls=ea?fe(ea):tp;function nv(t){return Mu(t)&&t>=-ut&&t<=ut}var Ku=na?fe(na):ep;function ti(t){return typeof t=="string"||!ft(t)&&Bt(t)&&Qt(t)==Ne}function le(t){return typeof t=="symbol"||Bt(t)&&Qt(t)==Be}var Ln=ra?fe(ra):np;function rv(t){return t===n}function iv(t){return Bt(t)&&Yt(t)==Me}function sv(t){return Bt(t)&&Qt(t)==Wn}var ov=Hr(os),av=Hr(function(t,e){return t<=e});function Gu(t){if(!t)return[];if(ie(t))return ti(t)?Ae(t):re(t);if(Gn&&t[Gn])return Mh(t[Gn]());var e=Yt(t),r=e==Ot?Xi:e==Zt?_r:Nn;return r(t)}function Xe(t){if(!t)return t===0?t:0;if(t=Ce(t),t===Rt||t===-Rt){var e=t<0?-1:1;return e*Xt}return t===t?t:0}function lt(t){var e=Xe(t),r=e%1;return e===e?r?e-r:e:0}function Hu(t){return t?ln(lt(t),0,ae):0}function Ce(t){if(typeof t=="number")return t;if(le(t))return Le;if(Lt(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Lt(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=ca(t);var r=Kf.test(t);return r||Hf.test(t)?Sh(t.slice(2),r?2:8):Wf.test(t)?Le:+t}function $u(t){return De(t,se(t))}function uv(t){return t?ln(lt(t),-ut,ut):t===0?t:0}function St(t){return t==null?"":he(t)}var cv=Rn(function(t,e){if(tr(e)||ie(e)){De(e,Wt(e),t);return}for(var r in e)Ct.call(e,r)&&Jn(t,r,e[r])}),zu=Rn(function(t,e){De(e,se(e),t)}),ei=Rn(function(t,e,r,a){De(e,se(e),t,a)}),fv=Rn(function(t,e,r,a){De(e,Wt(e),t,a)}),hv=He(Qi);function lv(t,e){var r=xn(t);return e==null?r:ka(r,e)}var pv=dt(function(t,e){t=At(t);var r=-1,a=e.length,c=a>2?e[2]:n;for(c&&te(e[0],e[1],c)&&(a=1);++r<a;)for(var d=e[r],w=se(d),C=-1,E=w.length;++C<E;){var O=w[C],I=t[O];(I===n||xe(I,En[O])&&!Ct.call(t,O))&&(t[O]=d[O])}return t}),dv=dt(function(t){return t.push(n,cu),ce(Xu,n,t)});function gv(t,e){return sa(t,nt(e,3),Ue)}function vv(t,e){return sa(t,nt(e,3),es)}function yv(t,e){return t==null?t:ts(t,nt(e,3),se)}function mv(t,e){return t==null?t:Ra(t,nt(e,3),se)}function _v(t,e){return t&&Ue(t,nt(e,3))}function wv(t,e){return t&&es(t,nt(e,3))}function bv(t){return t==null?[]:Dr(t,Wt(t))}function Sv(t){return t==null?[]:Dr(t,se(t))}function Ns(t,e,r){var a=t==null?n:pn(t,e);return a===n?r:a}function Cv(t,e){return t!=null&&lu(t,e,zl)}function Bs(t,e){return t!=null&&lu(t,e,Xl)}var kv=iu(function(t,e,r){e!=null&&typeof e.toString!="function"&&(e=Cr.call(e)),t[e]=r},Ds(oe)),Ev=iu(function(t,e,r){e!=null&&typeof e.toString!="function"&&(e=Cr.call(e)),Ct.call(t,e)?t[e].push(r):t[e]=[r]},nt),Av=dt(Yn);function Wt(t){return ie(t)?Sa(t):ss(t)}function se(t){return ie(t)?Sa(t,!0):rp(t)}function Tv(t,e){var r={};return e=nt(e,3),Ue(t,function(a,c,d){Ke(r,e(a,c,d),a)}),r}function xv(t,e){var r={};return e=nt(e,3),Ue(t,function(a,c,d){Ke(r,c,e(a,c,d))}),r}var Rv=Rn(function(t,e,r){Pr(t,e,r)}),Xu=Rn(function(t,e,r,a){Pr(t,e,r,a)}),Ov=He(function(t,e){var r={};if(t==null)return r;var a=!1;e=It(e,function(d){return d=nn(d,t),a||(a=d.length>1),d}),De(t,_s(t),r),a&&(r=we(r,y|l|h,kp));for(var c=e.length;c--;)hs(r,e[c]);return r});function Iv(t,e){return Ju(t,Zr(nt(e)))}var Lv=He(function(t,e){return t==null?{}:sp(t,e)});function Ju(t,e){if(t==null)return{};var r=It(_s(t),function(a){return[a]});return e=nt(e),Ma(t,r,function(a,c){return e(a,c[0])})}function Nv(t,e,r){e=nn(e,t);var a=-1,c=e.length;for(c||(c=1,t=n);++a<c;){var d=t==null?n:t[Pe(e[a])];d===n&&(a=c,d=r),t=ze(d)?d.call(t):d}return t}function Bv(t,e,r){return t==null?t:Zn(t,e,r)}function Uv(t,e,r,a){return a=typeof a=="function"?a:n,t==null?t:Zn(t,e,r,a)}var Vu=au(Wt),Yu=au(se);function Dv(t,e,r){var a=ft(t),c=a||sn(t)||Ln(t);if(e=nt(e,4),r==null){var d=t&&t.constructor;c?r=a?new d:[]:Lt(t)?r=ze(d)?xn(Ar(t)):{}:r={}}return(c?ye:Ue)(t,function(w,C,E){return e(r,w,C,E)}),r}function Pv(t,e){return t==null?!0:hs(t,e)}function Fv(t,e,r){return t==null?t:Ha(t,e,ds(r))}function Mv(t,e,r,a){return a=typeof a=="function"?a:n,t==null?t:Ha(t,e,ds(r),a)}function Nn(t){return t==null?[]:zi(t,Wt(t))}function qv(t){return t==null?[]:zi(t,se(t))}function Wv(t,e,r){return r===n&&(r=e,e=n),r!==n&&(r=Ce(r),r=r===r?r:0),e!==n&&(e=Ce(e),e=e===e?e:0),ln(Ce(t),e,r)}function Kv(t,e,r){return e=Xe(e),r===n?(r=e,e=0):r=Xe(r),t=Ce(t),Jl(t,e,r)}function Gv(t,e,r){if(r&&typeof r!="boolean"&&te(t,e,r)&&(e=r=n),r===n&&(typeof e=="boolean"?(r=e,e=n):typeof t=="boolean"&&(r=t,t=n)),t===n&&e===n?(t=0,e=1):(t=Xe(t),e===n?(e=t,t=0):e=Xe(e)),t>e){var a=t;t=e,e=a}if(r||t%1||e%1){var c=wa();return Vt(t+c*(e-t+bh("1e-"+((c+"").length-1))),e)}return us(t,e)}var Hv=On(function(t,e,r){return e=e.toLowerCase(),t+(r?ju(e):e)});function ju(t){return Us(St(t).toLowerCase())}function Zu(t){return t=St(t),t&&t.replace(zf,Bh).replace(hh,"")}function $v(t,e,r){t=St(t),e=he(e);var a=t.length;r=r===n?a:ln(lt(r),0,a);var c=r;return r-=e.length,r>=0&&t.slice(r,c)==e}function zv(t){return t=St(t),t&&Af.test(t)?t.replace(Ro,Uh):t}function Xv(t){return t=St(t),t&&Lf.test(t)?t.replace(Oi,"\\$&"):t}var Jv=On(function(t,e,r){return t+(r?"-":"")+e.toLowerCase()}),Vv=On(function(t,e,r){return t+(r?" ":"")+e.toLowerCase()}),Yv=eu("toLowerCase");function jv(t,e,r){t=St(t),e=lt(e);var a=e?Cn(t):0;if(!e||a>=e)return t;var c=(e-a)/2;return Gr(Or(c),r)+t+Gr(Rr(c),r)}function Zv(t,e,r){t=St(t),e=lt(e);var a=e?Cn(t):0;return e&&a<e?t+Gr(e-a,r):t}function Qv(t,e,r){t=St(t),e=lt(e);var a=e?Cn(t):0;return e&&a<e?Gr(e-a,r)+t:t}function ty(t,e,r){return r||e==null?e=0:e&&(e=+e),al(St(t).replace(Ii,""),e||0)}function ey(t,e,r){return(r?te(t,e,r):e===n)?e=1:e=lt(e),cs(St(t),e)}function ny(){var t=arguments,e=St(t[0]);return t.length<3?e:e.replace(t[1],t[2])}var ry=On(function(t,e,r){return t+(r?"_":"")+e.toLowerCase()});function iy(t,e,r){return r&&typeof r!="number"&&te(t,e,r)&&(e=r=n),r=r===n?ae:r>>>0,r?(t=St(t),t&&(typeof e=="string"||e!=null&&!Ls(e))&&(e=he(e),!e&&Sn(t))?rn(Ae(t),0,r):t.split(e,r)):[]}var sy=On(function(t,e,r){return t+(r?" ":"")+Us(e)});function oy(t,e,r){return t=St(t),r=r==null?0:ln(lt(r),0,t.length),e=he(e),t.slice(r,r+e.length)==e}function ay(t,e,r){var a=p.templateSettings;r&&te(t,e,r)&&(e=n),t=St(t),e=ei({},e,a,uu);var c=ei({},e.imports,a.imports,uu),d=Wt(c),w=zi(c,d),C,E,O=0,I=e.interpolate||dr,N="__p += '",K=Ji((e.escape||dr).source+"|"+I.source+"|"+(I===Oo?qf:dr).source+"|"+(e.evaluate||dr).source+"|$","g"),Y="//# sourceURL="+(Ct.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++vh+"]")+`
16
- `;t.replace(K,function(it,gt,mt,pe,ee,de){return mt||(mt=pe),N+=t.slice(O,de).replace(Xf,Dh),gt&&(C=!0,N+=`' +
17
- __e(`+gt+`) +
18
- '`),ee&&(E=!0,N+=`';
19
- `+ee+`;
20
- __p += '`),mt&&(N+=`' +
21
- ((__t = (`+mt+`)) == null ? '' : __t) +
22
- '`),O=de+it.length,it}),N+=`';
23
- `;var rt=Ct.call(e,"variable")&&e.variable;if(!rt)N=`with (obj) {
24
- `+N+`
25
- }
26
- `;else if(Ff.test(rt))throw new ct(g);N=(E?N.replace(Sf,""):N).replace(Cf,"$1").replace(kf,"$1;"),N="function("+(rt||"obj")+`) {
27
- `+(rt?"":`obj || (obj = {});
28
- `)+"var __t, __p = ''"+(C?", __e = _.escape":"")+(E?`, __j = Array.prototype.join;
29
- function print() { __p += __j.call(arguments, '') }
30
- `:`;
31
- `)+N+`return __p
32
- }`;var pt=tc(function(){return _t(d,Y+"return "+N).apply(n,w)});if(pt.source=N,Is(pt))throw pt;return pt}function uy(t){return St(t).toLowerCase()}function cy(t){return St(t).toUpperCase()}function fy(t,e,r){if(t=St(t),t&&(r||e===n))return ca(t);if(!t||!(e=he(e)))return t;var a=Ae(t),c=Ae(e),d=fa(a,c),w=ha(a,c)+1;return rn(a,d,w).join("")}function hy(t,e,r){if(t=St(t),t&&(r||e===n))return t.slice(0,pa(t)+1);if(!t||!(e=he(e)))return t;var a=Ae(t),c=ha(a,Ae(e))+1;return rn(a,0,c).join("")}function ly(t,e,r){if(t=St(t),t&&(r||e===n))return t.replace(Ii,"");if(!t||!(e=he(e)))return t;var a=Ae(t),c=fa(a,Ae(e));return rn(a,c).join("")}function py(t,e){var r=U,a=X;if(Lt(e)){var c="separator"in e?e.separator:c;r="length"in e?lt(e.length):r,a="omission"in e?he(e.omission):a}t=St(t);var d=t.length;if(Sn(t)){var w=Ae(t);d=w.length}if(r>=d)return t;var C=r-Cn(a);if(C<1)return a;var E=w?rn(w,0,C).join(""):t.slice(0,C);if(c===n)return E+a;if(w&&(C+=E.length-C),Ls(c)){if(t.slice(C).search(c)){var O,I=E;for(c.global||(c=Ji(c.source,St(Io.exec(c))+"g")),c.lastIndex=0;O=c.exec(I);)var N=O.index;E=E.slice(0,N===n?C:N)}}else if(t.indexOf(he(c),C)!=C){var K=E.lastIndexOf(c);K>-1&&(E=E.slice(0,K))}return E+a}function dy(t){return t=St(t),t&&Ef.test(t)?t.replace(xo,Gh):t}var gy=On(function(t,e,r){return t+(r?" ":"")+e.toUpperCase()}),Us=eu("toUpperCase");function Qu(t,e,r){return t=St(t),e=r?n:e,e===n?Fh(t)?zh(t):Rh(t):t.match(e)||[]}var tc=dt(function(t,e){try{return ce(t,n,e)}catch(r){return Is(r)?r:new ct(r)}}),vy=He(function(t,e){return ye(e,function(r){r=Pe(r),Ke(t,r,Rs(t[r],t))}),t});function yy(t){var e=t==null?0:t.length,r=nt();return t=e?It(t,function(a){if(typeof a[1]!="function")throw new me(m);return[r(a[0]),a[1]]}):[],dt(function(a){for(var c=-1;++c<e;){var d=t[c];if(ce(d[0],this,a))return ce(d[1],this,a)}})}function my(t){return Gl(we(t,y))}function Ds(t){return function(){return t}}function _y(t,e){return t==null||t!==t?e:t}var wy=ru(),by=ru(!0);function oe(t){return t}function Ps(t){return Na(typeof t=="function"?t:we(t,y))}function Sy(t){return Ua(we(t,y))}function Cy(t,e){return Da(t,we(e,y))}var ky=dt(function(t,e){return function(r){return Yn(r,t,e)}}),Ey=dt(function(t,e){return function(r){return Yn(t,r,e)}});function Fs(t,e,r){var a=Wt(e),c=Dr(e,a);r==null&&!(Lt(e)&&(c.length||!a.length))&&(r=e,e=t,t=this,c=Dr(e,Wt(e)));var d=!(Lt(r)&&"chain"in r)||!!r.chain,w=ze(t);return ye(c,function(C){var E=e[C];t[C]=E,w&&(t.prototype[C]=function(){var O=this.__chain__;if(d||O){var I=t(this.__wrapped__),N=I.__actions__=re(this.__actions__);return N.push({func:E,args:arguments,thisArg:t}),I.__chain__=O,I}return E.apply(t,je([this.value()],arguments))})}),t}function Ay(){return Ht._===this&&(Ht._=Zh),this}function Ms(){}function Ty(t){return t=lt(t),dt(function(e){return Pa(e,t)})}var xy=vs(It),Ry=vs(ia),Oy=vs(Wi);function ec(t){return Cs(t)?Ki(Pe(t)):op(t)}function Iy(t){return function(e){return t==null?n:pn(t,e)}}var Ly=su(),Ny=su(!0);function qs(){return[]}function Ws(){return!1}function By(){return{}}function Uy(){return""}function Dy(){return!0}function Py(t,e){if(t=lt(t),t<1||t>ut)return[];var r=ae,a=Vt(t,ae);e=nt(e),t-=ae;for(var c=$i(a,e);++r<t;)e(r);return c}function Fy(t){return ft(t)?It(t,Pe):le(t)?[t]:re(bu(St(t)))}function My(t){var e=++Yh;return St(t)+e}var qy=Kr(function(t,e){return t+e},0),Wy=ys("ceil"),Ky=Kr(function(t,e){return t/e},1),Gy=ys("floor");function Hy(t){return t&&t.length?Ur(t,oe,ns):n}function $y(t,e){return t&&t.length?Ur(t,nt(e,2),ns):n}function zy(t){return aa(t,oe)}function Xy(t,e){return aa(t,nt(e,2))}function Jy(t){return t&&t.length?Ur(t,oe,os):n}function Vy(t,e){return t&&t.length?Ur(t,nt(e,2),os):n}var Yy=Kr(function(t,e){return t*e},1),jy=ys("round"),Zy=Kr(function(t,e){return t-e},0);function Qy(t){return t&&t.length?Hi(t,oe):0}function t0(t,e){return t&&t.length?Hi(t,nt(e,2)):0}return p.after=Sg,p.ary=Lu,p.assign=cv,p.assignIn=zu,p.assignInWith=ei,p.assignWith=fv,p.at=hv,p.before=Nu,p.bind=Rs,p.bindAll=vy,p.bindKey=Bu,p.castArray=Bg,p.chain=Ru,p.chunk=Gp,p.compact=Hp,p.concat=$p,p.cond=yy,p.conforms=my,p.constant=Ds,p.countBy=Qd,p.create=lv,p.curry=Uu,p.curryRight=Du,p.debounce=Pu,p.defaults=pv,p.defaultsDeep=dv,p.defer=Cg,p.delay=kg,p.difference=zp,p.differenceBy=Xp,p.differenceWith=Jp,p.drop=Vp,p.dropRight=Yp,p.dropRightWhile=jp,p.dropWhile=Zp,p.fill=Qp,p.filter=eg,p.flatMap=ig,p.flatMapDeep=sg,p.flatMapDepth=og,p.flatten=Eu,p.flattenDeep=td,p.flattenDepth=ed,p.flip=Eg,p.flow=wy,p.flowRight=by,p.fromPairs=nd,p.functions=bv,p.functionsIn=Sv,p.groupBy=ag,p.initial=id,p.intersection=sd,p.intersectionBy=od,p.intersectionWith=ad,p.invert=kv,p.invertBy=Ev,p.invokeMap=cg,p.iteratee=Ps,p.keyBy=fg,p.keys=Wt,p.keysIn=se,p.map=Vr,p.mapKeys=Tv,p.mapValues=xv,p.matches=Sy,p.matchesProperty=Cy,p.memoize=jr,p.merge=Rv,p.mergeWith=Xu,p.method=ky,p.methodOf=Ey,p.mixin=Fs,p.negate=Zr,p.nthArg=Ty,p.omit=Ov,p.omitBy=Iv,p.once=Ag,p.orderBy=hg,p.over=xy,p.overArgs=Tg,p.overEvery=Ry,p.overSome=Oy,p.partial=Os,p.partialRight=Fu,p.partition=lg,p.pick=Lv,p.pickBy=Ju,p.property=ec,p.propertyOf=Iy,p.pull=hd,p.pullAll=Tu,p.pullAllBy=ld,p.pullAllWith=pd,p.pullAt=dd,p.range=Ly,p.rangeRight=Ny,p.rearg=xg,p.reject=gg,p.remove=gd,p.rest=Rg,p.reverse=Ts,p.sampleSize=yg,p.set=Bv,p.setWith=Uv,p.shuffle=mg,p.slice=vd,p.sortBy=bg,p.sortedUniq=Cd,p.sortedUniqBy=kd,p.split=iy,p.spread=Og,p.tail=Ed,p.take=Ad,p.takeRight=Td,p.takeRightWhile=xd,p.takeWhile=Rd,p.tap=Hd,p.throttle=Ig,p.thru=Jr,p.toArray=Gu,p.toPairs=Vu,p.toPairsIn=Yu,p.toPath=Fy,p.toPlainObject=$u,p.transform=Dv,p.unary=Lg,p.union=Od,p.unionBy=Id,p.unionWith=Ld,p.uniq=Nd,p.uniqBy=Bd,p.uniqWith=Ud,p.unset=Pv,p.unzip=xs,p.unzipWith=xu,p.update=Fv,p.updateWith=Mv,p.values=Nn,p.valuesIn=qv,p.without=Dd,p.words=Qu,p.wrap=Ng,p.xor=Pd,p.xorBy=Fd,p.xorWith=Md,p.zip=qd,p.zipObject=Wd,p.zipObjectDeep=Kd,p.zipWith=Gd,p.entries=Vu,p.entriesIn=Yu,p.extend=zu,p.extendWith=ei,Fs(p,p),p.add=qy,p.attempt=tc,p.camelCase=Hv,p.capitalize=ju,p.ceil=Wy,p.clamp=Wv,p.clone=Ug,p.cloneDeep=Pg,p.cloneDeepWith=Fg,p.cloneWith=Dg,p.conformsTo=Mg,p.deburr=Zu,p.defaultTo=_y,p.divide=Ky,p.endsWith=$v,p.eq=xe,p.escape=zv,p.escapeRegExp=Xv,p.every=tg,p.find=ng,p.findIndex=Cu,p.findKey=gv,p.findLast=rg,p.findLastIndex=ku,p.findLastKey=vv,p.floor=Gy,p.forEach=Ou,p.forEachRight=Iu,p.forIn=yv,p.forInRight=mv,p.forOwn=_v,p.forOwnRight=wv,p.get=Ns,p.gt=qg,p.gte=Wg,p.has=Cv,p.hasIn=Bs,p.head=Au,p.identity=oe,p.includes=ug,p.indexOf=rd,p.inRange=Kv,p.invoke=Av,p.isArguments=vn,p.isArray=ft,p.isArrayBuffer=Kg,p.isArrayLike=ie,p.isArrayLikeObject=Ut,p.isBoolean=Gg,p.isBuffer=sn,p.isDate=Hg,p.isElement=$g,p.isEmpty=zg,p.isEqual=Xg,p.isEqualWith=Jg,p.isError=Is,p.isFinite=Vg,p.isFunction=ze,p.isInteger=Mu,p.isLength=Qr,p.isMap=qu,p.isMatch=Yg,p.isMatchWith=jg,p.isNaN=Zg,p.isNative=Qg,p.isNil=ev,p.isNull=tv,p.isNumber=Wu,p.isObject=Lt,p.isObjectLike=Bt,p.isPlainObject=nr,p.isRegExp=Ls,p.isSafeInteger=nv,p.isSet=Ku,p.isString=ti,p.isSymbol=le,p.isTypedArray=Ln,p.isUndefined=rv,p.isWeakMap=iv,p.isWeakSet=sv,p.join=ud,p.kebabCase=Jv,p.last=Se,p.lastIndexOf=cd,p.lowerCase=Vv,p.lowerFirst=Yv,p.lt=ov,p.lte=av,p.max=Hy,p.maxBy=$y,p.mean=zy,p.meanBy=Xy,p.min=Jy,p.minBy=Vy,p.stubArray=qs,p.stubFalse=Ws,p.stubObject=By,p.stubString=Uy,p.stubTrue=Dy,p.multiply=Yy,p.nth=fd,p.noConflict=Ay,p.noop=Ms,p.now=Yr,p.pad=jv,p.padEnd=Zv,p.padStart=Qv,p.parseInt=ty,p.random=Gv,p.reduce=pg,p.reduceRight=dg,p.repeat=ey,p.replace=ny,p.result=Nv,p.round=jy,p.runInContext=k,p.sample=vg,p.size=_g,p.snakeCase=ry,p.some=wg,p.sortedIndex=yd,p.sortedIndexBy=md,p.sortedIndexOf=_d,p.sortedLastIndex=wd,p.sortedLastIndexBy=bd,p.sortedLastIndexOf=Sd,p.startCase=sy,p.startsWith=oy,p.subtract=Zy,p.sum=Qy,p.sumBy=t0,p.template=ay,p.times=Py,p.toFinite=Xe,p.toInteger=lt,p.toLength=Hu,p.toLower=uy,p.toNumber=Ce,p.toSafeInteger=uv,p.toString=St,p.toUpper=cy,p.trim=fy,p.trimEnd=hy,p.trimStart=ly,p.truncate=py,p.unescape=dy,p.uniqueId=My,p.upperCase=gy,p.upperFirst=Us,p.each=Ou,p.eachRight=Iu,p.first=Au,Fs(p,function(){var t={};return Ue(p,function(e,r){Ct.call(p.prototype,r)||(t[r]=e)}),t}(),{chain:!1}),p.VERSION=o,ye(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){p[t].placeholder=p}),ye(["drop","take"],function(t,e){vt.prototype[t]=function(r){r=r===n?1:Mt(lt(r),0);var a=this.__filtered__&&!e?new vt(this):this.clone();return a.__filtered__?a.__takeCount__=Vt(r,a.__takeCount__):a.__views__.push({size:Vt(r,ae),type:t+(a.__dir__<0?"Right":"")}),a},vt.prototype[t+"Right"]=function(r){return this.reverse()[t](r).reverse()}}),ye(["filter","map","takeWhile"],function(t,e){var r=e+1,a=r==B||r==Et;vt.prototype[t]=function(c){var d=this.clone();return d.__iteratees__.push({iteratee:nt(c,3),type:r}),d.__filtered__=d.__filtered__||a,d}}),ye(["head","last"],function(t,e){var r="take"+(e?"Right":"");vt.prototype[t]=function(){return this[r](1).value()[0]}}),ye(["initial","tail"],function(t,e){var r="drop"+(e?"":"Right");vt.prototype[t]=function(){return this.__filtered__?new vt(this):this[r](1)}}),vt.prototype.compact=function(){return this.filter(oe)},vt.prototype.find=function(t){return this.filter(t).head()},vt.prototype.findLast=function(t){return this.reverse().find(t)},vt.prototype.invokeMap=dt(function(t,e){return typeof t=="function"?new vt(this):this.map(function(r){return Yn(r,t,e)})}),vt.prototype.reject=function(t){return this.filter(Zr(nt(t)))},vt.prototype.slice=function(t,e){t=lt(t);var r=this;return r.__filtered__&&(t>0||e<0)?new vt(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==n&&(e=lt(e),r=e<0?r.dropRight(-e):r.take(e-t)),r)},vt.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},vt.prototype.toArray=function(){return this.take(ae)},Ue(vt.prototype,function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),a=/^(?:head|last)$/.test(e),c=p[a?"take"+(e=="last"?"Right":""):e],d=a||/^find/.test(e);c&&(p.prototype[e]=function(){var w=this.__wrapped__,C=a?[1]:arguments,E=w instanceof vt,O=C[0],I=E||ft(w),N=function(gt){var mt=c.apply(p,je([gt],C));return a&&K?mt[0]:mt};I&&r&&typeof O=="function"&&O.length!=1&&(E=I=!1);var K=this.__chain__,Y=!!this.__actions__.length,rt=d&&!K,pt=E&&!Y;if(!d&&I){w=pt?w:new vt(this);var it=t.apply(w,C);return it.__actions__.push({func:Jr,args:[N],thisArg:n}),new _e(it,K)}return rt&&pt?t.apply(this,C):(it=this.thru(N),rt?a?it.value()[0]:it.value():it)})}),ye(["pop","push","shift","sort","splice","unshift"],function(t){var e=wr[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",a=/^(?:pop|shift)$/.test(t);p.prototype[t]=function(){var c=arguments;if(a&&!this.__chain__){var d=this.value();return e.apply(ft(d)?d:[],c)}return this[r](function(w){return e.apply(ft(w)?w:[],c)})}}),Ue(vt.prototype,function(t,e){var r=p[e];if(r){var a=r.name+"";Ct.call(Tn,a)||(Tn[a]=[]),Tn[a].push({name:e,func:r})}}),Tn[Wr(n,W).name]=[{name:"wrapper",func:n}],vt.prototype.clone=dl,vt.prototype.reverse=gl,vt.prototype.value=vl,p.prototype.at=$d,p.prototype.chain=zd,p.prototype.commit=Xd,p.prototype.next=Jd,p.prototype.plant=Yd,p.prototype.reverse=jd,p.prototype.toJSON=p.prototype.valueOf=p.prototype.value=Zd,p.prototype.first=p.prototype.head,Gn&&(p.prototype[Gn]=Vd),p},kn=Xh();un?((un.exports=kn)._=kn,Pi._=kn):Ht._=kn}).call(Kt)}(rr,rr.exports);var cc=rr.exports;const fc={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:"http://socketlog.voicenter.co",loggerConfig:{logToConsole:!0,overloadGlobalConsole:!1,namespace:"events-sdk",socketEmitInterval:1e4},loggerConnectOptions:{reconnection:!0,reconnectionDelay:5e3,reconnectionAttempts:10,perMessageDeflate:void 0,upgrade:!1,transports:["websocket"],debug:!1}};function hc(){return function s(i,n,o){function u(g,S){if(!n[g]){if(!i[g]){var v=typeof require=="function"&&require;if(!S&&v)return v(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var _=n[g]={exports:{}};i[g][0].call(_.exports,function(y){var l=i[g][1][y];return u(l||y)},_,_.exports,s,i,n,o)}return n[g].exports}for(var f=typeof require=="function"&&require,m=0;m<o.length;m++)u(o[m]);return u}({1:[function(s,i){i.exports=s("./lib/")},{"./lib/":2}],2:[function(s,i,n){function o(v,_){typeof v=="object"&&(_=v,v=void 0),_=_||{};var y,l=u(v),h=l.source,b=l.id;return _.forceNew||_["force new connection"]||_.multiplex===!1?(g("ignoring socket cache for %s",h),y=m(h,_)):(S[b]||(g("new io instance for %s",h),S[b]=m(h,_)),y=S[b]),y.socket(l.path)}var u=s("./url"),f=s("socket.io-parser"),m=s("./manager"),g=s("debug")("socket.io-client");i.exports=n=o;var S=n.managers={};n.protocol=f.protocol,n.connect=o,n.Manager=s("./manager"),n.Socket=s("./socket")},{"./manager":3,"./socket":5,"./url":6,debug:10,"socket.io-parser":44}],3:[function(s,i){function n(l,h){return this instanceof n?(l&&typeof l=="object"&&(h=l,l=void 0),h=h||{},h.path=h.path||"/socket.io",this.nsps={},this.subs=[],this.opts=h,this.reconnection(h.reconnection!==!1),this.reconnectionAttempts(h.reconnectionAttempts||1/0),this.reconnectionDelay(h.reconnectionDelay||1e3),this.reconnectionDelayMax(h.reconnectionDelayMax||5e3),this.randomizationFactor(h.randomizationFactor||.5),this.backoff=new y({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(h.timeout==null?2e4:h.timeout),this.readyState="closed",this.uri=l,this.connected=[],this.encoding=!1,this.packetBuffer=[],this.encoder=new m.Encoder,this.decoder=new m.Decoder,this.autoConnect=h.autoConnect!==!1,void(this.autoConnect&&this.open())):new n(l,h)}var o=(s("./url"),s("engine.io-client")),u=s("./socket"),f=s("component-emitter"),m=s("socket.io-parser"),g=s("./on"),S=s("component-bind"),v=(s("object-component"),s("debug")("socket.io-client:manager")),_=s("indexof"),y=s("backo2");i.exports=n,n.prototype.emitAll=function(){this.emit.apply(this,arguments);for(var l in this.nsps)this.nsps[l].emit.apply(this.nsps[l],arguments)},n.prototype.updateSocketIds=function(){for(var l in this.nsps)this.nsps[l].id=this.engine.id},f(n.prototype),n.prototype.reconnection=function(l){return arguments.length?(this._reconnection=!!l,this):this._reconnection},n.prototype.reconnectionAttempts=function(l){return arguments.length?(this._reconnectionAttempts=l,this):this._reconnectionAttempts},n.prototype.reconnectionDelay=function(l){return arguments.length?(this._reconnectionDelay=l,this.backoff&&this.backoff.setMin(l),this):this._reconnectionDelay},n.prototype.randomizationFactor=function(l){return arguments.length?(this._randomizationFactor=l,this.backoff&&this.backoff.setJitter(l),this):this._randomizationFactor},n.prototype.reconnectionDelayMax=function(l){return arguments.length?(this._reconnectionDelayMax=l,this.backoff&&this.backoff.setMax(l),this):this._reconnectionDelayMax},n.prototype.timeout=function(l){return arguments.length?(this._timeout=l,this):this._timeout},n.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()},n.prototype.open=n.prototype.connect=function(l){if(v("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;v("opening %s",this.uri),this.engine=o(this.uri,this.opts);var h=this.engine,b=this;this.readyState="opening",this.skipReconnect=!1;var A=g(h,"open",function(){b.onopen(),l&&l()}),x=g(h,"error",function(V){if(v("connect_error"),b.cleanup(),b.readyState="closed",b.emitAll("connect_error",V),l){var ot=new Error("Connection error");ot.data=V,l(ot)}else b.maybeReconnectOnOpen()});if(this._timeout!==!1){var W=this._timeout;v("connect attempt will timeout after %d",W);var st=setTimeout(function(){v("connect attempt timed out after %d",W),A.destroy(),h.close(),h.emit("error","timeout"),b.emitAll("connect_timeout",W)},W);this.subs.push({destroy:function(){clearTimeout(st)}})}return this.subs.push(A),this.subs.push(x),this},n.prototype.onopen=function(){v("open"),this.cleanup(),this.readyState="open",this.emit("open");var l=this.engine;this.subs.push(g(l,"data",S(this,"ondata"))),this.subs.push(g(this.decoder,"decoded",S(this,"ondecoded"))),this.subs.push(g(l,"error",S(this,"onerror"))),this.subs.push(g(l,"close",S(this,"onclose")))},n.prototype.ondata=function(l){this.decoder.add(l)},n.prototype.ondecoded=function(l){this.emit("packet",l)},n.prototype.onerror=function(l){v("error",l),this.emitAll("error",l)},n.prototype.socket=function(l){var h=this.nsps[l];if(!h){h=new u(this,l),this.nsps[l]=h;var b=this;h.on("connect",function(){h.id=b.engine.id,~_(b.connected,h)||b.connected.push(h)})}return h},n.prototype.destroy=function(l){var h=_(this.connected,l);~h&&this.connected.splice(h,1),this.connected.length||this.close()},n.prototype.packet=function(l){v("writing packet %j",l);var h=this;h.encoding?h.packetBuffer.push(l):(h.encoding=!0,this.encoder.encode(l,function(b){for(var A=0;A<b.length;A++)h.engine.write(b[A]);h.encoding=!1,h.processPacketQueue()}))},n.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var l=this.packetBuffer.shift();this.packet(l)}},n.prototype.cleanup=function(){for(var l;l=this.subs.shift();)l.destroy();this.packetBuffer=[],this.encoding=!1,this.decoder.destroy()},n.prototype.close=n.prototype.disconnect=function(){this.skipReconnect=!0,this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},n.prototype.onclose=function(l){v("close"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",l),this._reconnection&&!this.skipReconnect&&this.reconnect()},n.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var l=this;if(this.backoff.attempts>=this._reconnectionAttempts)v("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var h=this.backoff.duration();v("will wait %dms before reconnect attempt",h),this.reconnecting=!0;var b=setTimeout(function(){l.skipReconnect||(v("attempting reconnect"),l.emitAll("reconnect_attempt",l.backoff.attempts),l.emitAll("reconnecting",l.backoff.attempts),l.skipReconnect||l.open(function(A){A?(v("reconnect attempt error"),l.reconnecting=!1,l.reconnect(),l.emitAll("reconnect_error",A.data)):(v("reconnect success"),l.onreconnect())}))},h);this.subs.push({destroy:function(){clearTimeout(b)}})}},n.prototype.onreconnect=function(){var l=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",l)}},{"./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(s,i){function n(o,u,f){return o.on(u,f),{destroy:function(){o.removeListener(u,f)}}}i.exports=n},{}],5:[function(s,i,n){function o(h,b){this.io=h,this.nsp=b,this.json=this,this.ids=0,this.acks={},this.io.autoConnect&&this.open(),this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0}var u=s("socket.io-parser"),f=s("component-emitter"),m=s("to-array"),g=s("./on"),S=s("component-bind"),v=s("debug")("socket.io-client:socket"),_=s("has-binary");i.exports=o;var y={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},l=f.prototype.emit;f(o.prototype),o.prototype.subEvents=function(){if(!this.subs){var h=this.io;this.subs=[g(h,"open",S(this,"onopen")),g(h,"packet",S(this,"onpacket")),g(h,"close",S(this,"onclose"))]}},o.prototype.open=o.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),this.io.readyState=="open"&&this.onopen(),this)},o.prototype.send=function(){var h=m(arguments);return h.unshift("message"),this.emit.apply(this,h),this},o.prototype.emit=function(h){if(y.hasOwnProperty(h))return l.apply(this,arguments),this;var b=m(arguments),A=u.EVENT;_(b)&&(A=u.BINARY_EVENT);var x={type:A,data:b};return typeof b[b.length-1]=="function"&&(v("emitting packet with ack id %d",this.ids),this.acks[this.ids]=b.pop(),x.id=this.ids++),this.connected?this.packet(x):this.sendBuffer.push(x),this},o.prototype.packet=function(h){h.nsp=this.nsp,this.io.packet(h)},o.prototype.onopen=function(){v("transport is open - connecting"),this.nsp!="/"&&this.packet({type:u.CONNECT})},o.prototype.onclose=function(h){v("close (%s)",h),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",h)},o.prototype.onpacket=function(h){if(h.nsp==this.nsp)switch(h.type){case u.CONNECT:this.onconnect();break;case u.EVENT:this.onevent(h);break;case u.BINARY_EVENT:this.onevent(h);break;case u.ACK:this.onack(h);break;case u.BINARY_ACK:this.onack(h);break;case u.DISCONNECT:this.ondisconnect();break;case u.ERROR:this.emit("error",h.data)}},o.prototype.onevent=function(h){var b=h.data||[];v("emitting event %j",b),h.id!=null&&(v("attaching ack callback to event"),b.push(this.ack(h.id))),this.connected?l.apply(this,b):this.receiveBuffer.push(b)},o.prototype.ack=function(h){var b=this,A=!1;return function(){if(!A){A=!0;var x=m(arguments);v("sending ack %j",x);var W=_(x)?u.BINARY_ACK:u.ACK;b.packet({type:W,id:h,data:x})}}},o.prototype.onack=function(h){v("calling ack %s with %j",h.id,h.data);var b=this.acks[h.id];b.apply(this,h.data),delete this.acks[h.id]},o.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},o.prototype.emitBuffered=function(){var h;for(h=0;h<this.receiveBuffer.length;h++)l.apply(this,this.receiveBuffer[h]);for(this.receiveBuffer=[],h=0;h<this.sendBuffer.length;h++)this.packet(this.sendBuffer[h]);this.sendBuffer=[]},o.prototype.ondisconnect=function(){v("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},o.prototype.destroy=function(){if(this.subs){for(var h=0;h<this.subs.length;h++)this.subs[h].destroy();this.subs=null}this.io.destroy(this)},o.prototype.close=o.prototype.disconnect=function(){return this.connected&&(v("performing disconnect (%s)",this.nsp),this.packet({type:u.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(s,i){(function(n){function o(m,v){var S=m,v=v||n.location;return m==null&&(m=v.protocol+"//"+v.host),typeof m=="string"&&(m.charAt(0)=="/"&&(m=m.charAt(1)=="/"?v.protocol+m:v.hostname+m),/^(https?|wss?):\/\//.test(m)||(f("protocol-less url %s",m),m=typeof v<"u"?v.protocol+"//"+m:"https://"+m),f("parse %s",m),S=u(m)),S.port||(/^(http|ws)$/.test(S.protocol)?S.port="80":/^(http|ws)s$/.test(S.protocol)&&(S.port="443")),S.path=S.path||"/",S.id=S.protocol+"://"+S.host+":"+S.port,S.href=S.protocol+"://"+S.host+(v&&v.port==S.port?"":":"+S.port),S}var u=s("parseuri"),f=s("debug")("socket.io-client:url");i.exports=o}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{debug:10,parseuri:42}],7:[function(s,i){function n(o){o=o||{},this.ms=o.min||100,this.max=o.max||1e4,this.factor=o.factor||2,this.jitter=o.jitter>0&&o.jitter<=1?o.jitter:0,this.attempts=0}i.exports=n,n.prototype.duration=function(){var o=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var u=Math.random(),f=Math.floor(u*this.jitter*o);o=1&Math.floor(10*u)?o+f:o-f}return 0|Math.min(o,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(o){this.ms=o},n.prototype.setMax=function(o){this.max=o},n.prototype.setJitter=function(o){this.jitter=o}},{}],8:[function(s,i){var n=[].slice;i.exports=function(o,u){if(typeof u=="string"&&(u=o[u]),typeof u!="function")throw new Error("bind() requires a function");var f=n.call(arguments,2);return function(){return u.apply(o,f.concat(n.call(arguments)))}}},{}],9:[function(s,i){function n(u){return u?o(u):void 0}function o(u){for(var f in n.prototype)u[f]=n.prototype[f];return u}i.exports=n,n.prototype.on=n.prototype.addEventListener=function(u,f){return this._callbacks=this._callbacks||{},(this._callbacks[u]=this._callbacks[u]||[]).push(f),this},n.prototype.once=function(u,f){function m(){g.off(u,m),f.apply(this,arguments)}var g=this;return this._callbacks=this._callbacks||{},m.fn=f,this.on(u,m),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(u,f){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var m=this._callbacks[u];if(!m)return this;if(arguments.length==1)return delete this._callbacks[u],this;for(var g,S=0;S<m.length;S++)if(g=m[S],g===f||g.fn===f){m.splice(S,1);break}return this},n.prototype.emit=function(u){this._callbacks=this._callbacks||{};var f=[].slice.call(arguments,1),m=this._callbacks[u];if(m){m=m.slice(0);for(var g=0,S=m.length;S>g;++g)m[g].apply(this,f)}return this},n.prototype.listeners=function(u){return this._callbacks=this._callbacks||{},this._callbacks[u]||[]},n.prototype.hasListeners=function(u){return!!this.listeners(u).length}},{}],10:[function(s,i){function n(u){return n.enabled(u)?function(f){f=o(f);var m=new Date,g=m-(n[u]||m);n[u]=m,f=u+" "+f+" +"+n.humanize(g),window.console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}:function(){}}function o(u){return u instanceof Error?u.stack||u.message:u}i.exports=n,n.names=[],n.skips=[],n.enable=function(u){try{localStorage.debug=u}catch{}for(var f=(u||"").split(/[\s,]+/),m=f.length,g=0;m>g;g++)u=f[g].replace("*",".*?"),u[0]==="-"?n.skips.push(new RegExp("^"+u.substr(1)+"$")):n.names.push(new RegExp("^"+u+"$"))},n.disable=function(){n.enable("")},n.humanize=function(u){var f=1e3,m=6e4,g=60*m;return u>=g?(u/g).toFixed(1)+"h":u>=m?(u/m).toFixed(1)+"m":u>=f?(u/f|0)+"s":u+"ms"},n.enabled=function(u){for(var f=0,m=n.skips.length;m>f;f++)if(n.skips[f].test(u))return!1;for(var f=0,m=n.names.length;m>f;f++)if(n.names[f].test(u))return!0;return!1};try{window.localStorage&&n.enable(localStorage.debug)}catch{}},{}],11:[function(s,i){i.exports=s("./lib/")},{"./lib/":12}],12:[function(s,i){i.exports=s("./socket"),i.exports.parser=s("engine.io-parser")},{"./socket":13,"engine.io-parser":25}],13:[function(s,i){(function(n){function o(h,b){if(!(this instanceof o))return new o(h,b);if(b=b||{},h&&typeof h=="object"&&(b=h,h=null),h&&(h=_(h),b.host=h.host,b.secure=h.protocol=="https"||h.protocol=="wss",b.port=h.port,h.query&&(b.query=h.query)),this.secure=b.secure!=null?b.secure:n.location&&location.protocol=="https:",b.host){var A=b.host.split(":");b.hostname=A.shift(),A.length?b.port=A.pop():b.port||(b.port=this.secure?"443":"80")}this.agent=b.agent||!1,this.hostname=b.hostname||(n.location?location.hostname:"localhost"),this.port=b.port||(n.location&&location.port?location.port:this.secure?443:80),this.query=b.query||{},typeof this.query=="string"&&(this.query=l.decode(this.query)),this.upgrade=b.upgrade!==!1,this.path=(b.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!b.forceJSONP,this.jsonp=b.jsonp!==!1,this.forceBase64=!!b.forceBase64,this.enablesXDR=!!b.enablesXDR,this.timestampParam=b.timestampParam||"t",this.timestampRequests=b.timestampRequests,this.transports=b.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.callbackBuffer=[],this.policyPort=b.policyPort||843,this.rememberUpgrade=b.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=b.onlyBinaryUpgrades,this.pfx=b.pfx||null,this.key=b.key||null,this.passphrase=b.passphrase||null,this.cert=b.cert||null,this.ca=b.ca||null,this.ciphers=b.ciphers||null,this.rejectUnauthorized=b.rejectUnauthorized||null,this.open()}function u(h){var b={};for(var A in h)h.hasOwnProperty(A)&&(b[A]=h[A]);return b}var f=s("./transports"),m=s("component-emitter"),g=s("debug")("engine.io-client:socket"),S=s("indexof"),v=s("engine.io-parser"),_=s("parseuri"),y=s("parsejson"),l=s("parseqs");i.exports=o,o.priorWebsocketSuccess=!1,m(o.prototype),o.protocol=v.protocol,o.Socket=o,o.Transport=s("./transport"),o.transports=s("./transports"),o.parser=s("engine.io-parser"),o.prototype.createTransport=function(h){g('creating transport "%s"',h);var b=u(this.query);b.EIO=v.protocol,b.transport=h,this.id&&(b.sid=this.id);var A=new f[h]({agent:this.agent,hostname:this.hostname,port:this.port,secure:this.secure,path:this.path,query:b,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 A},o.prototype.open=function(){var b;if(this.rememberUpgrade&&o.priorWebsocketSuccess&&this.transports.indexOf("websocket")!=-1)b="websocket";else{if(this.transports.length==0){var h=this;return void setTimeout(function(){h.emit("error","No transports available")},0)}b=this.transports[0]}this.readyState="opening";var b;try{b=this.createTransport(b)}catch{return this.transports.shift(),void this.open()}b.open(),this.setTransport(b)},o.prototype.setTransport=function(h){g("setting transport %s",h.name);var b=this;this.transport&&(g("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=h,h.on("drain",function(){b.onDrain()}).on("packet",function(A){b.onPacket(A)}).on("error",function(A){b.onError(A)}).on("close",function(){b.onClose("transport close")})},o.prototype.probe=function(h){function b(){if(M.onlyBinaryUpgrades){var G=!this.supportsBinary&&M.transport.supportsBinary;D=D||G}D||(g('probe transport "%s" opened',h),H.send([{type:"ping",data:"probe"}]),H.once("packet",function(L){if(!D)if(L.type=="pong"&&L.data=="probe"){if(g('probe transport "%s" pong',h),M.upgrading=!0,M.emit("upgrading",H),!H)return;o.priorWebsocketSuccess=H.name=="websocket",g('pausing current transport "%s"',M.transport.name),M.transport.pause(function(){D||M.readyState!="closed"&&(g("changing transport and sending upgrade packet"),ot(),M.setTransport(H),H.send([{type:"upgrade"}]),M.emit("upgrade",H),H=null,M.upgrading=!1,M.flush())})}else{g('probe transport "%s" failed',h);var U=new Error("probe error");U.transport=H.name,M.emit("upgradeError",U)}}))}function A(){D||(D=!0,ot(),H.close(),H=null)}function x(G){var L=new Error("probe error: "+G);L.transport=H.name,A(),g('probe transport "%s" failed because of error: %s',h,G),M.emit("upgradeError",L)}function W(){x("transport closed")}function st(){x("socket closed")}function V(G){H&&G.name!=H.name&&(g('"%s" works - aborting "%s"',G.name,H.name),A())}function ot(){H.removeListener("open",b),H.removeListener("error",x),H.removeListener("close",W),M.removeListener("close",st),M.removeListener("upgrading",V)}g('probing transport "%s"',h);var H=this.createTransport(h,{probe:1}),D=!1,M=this;o.priorWebsocketSuccess=!1,H.once("open",b),H.once("error",x),H.once("close",W),this.once("close",st),this.once("upgrading",V),H.open()},o.prototype.onOpen=function(){if(g("socket open"),this.readyState="open",o.priorWebsocketSuccess=this.transport.name=="websocket",this.emit("open"),this.flush(),this.readyState=="open"&&this.upgrade&&this.transport.pause){g("starting upgrade probes");for(var h=0,b=this.upgrades.length;b>h;h++)this.probe(this.upgrades[h])}},o.prototype.onPacket=function(h){if(this.readyState=="opening"||this.readyState=="open")switch(g('socket receive: type "%s", data "%s"',h.type,h.data),this.emit("packet",h),this.emit("heartbeat"),h.type){case"open":this.onHandshake(y(h.data));break;case"pong":this.setPing();break;case"error":var b=new Error("server error");b.code=h.data,this.emit("error",b);break;case"message":this.emit("data",h.data),this.emit("message",h.data)}else g('packet received with socket readyState "%s"',this.readyState)},o.prototype.onHandshake=function(h){this.emit("handshake",h),this.id=h.sid,this.transport.query.sid=h.sid,this.upgrades=this.filterUpgrades(h.upgrades),this.pingInterval=h.pingInterval,this.pingTimeout=h.pingTimeout,this.onOpen(),this.readyState!="closed"&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},o.prototype.onHeartbeat=function(h){clearTimeout(this.pingTimeoutTimer);var b=this;b.pingTimeoutTimer=setTimeout(function(){b.readyState!="closed"&&b.onClose("ping timeout")},h||b.pingInterval+b.pingTimeout)},o.prototype.setPing=function(){var h=this;clearTimeout(h.pingIntervalTimer),h.pingIntervalTimer=setTimeout(function(){g("writing ping packet - expecting pong within %sms",h.pingTimeout),h.ping(),h.onHeartbeat(h.pingTimeout)},h.pingInterval)},o.prototype.ping=function(){this.sendPacket("ping")},o.prototype.onDrain=function(){for(var h=0;h<this.prevBufferLen;h++)this.callbackBuffer[h]&&this.callbackBuffer[h]();this.writeBuffer.splice(0,this.prevBufferLen),this.callbackBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length==0?this.emit("drain"):this.flush()},o.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"))},o.prototype.write=o.prototype.send=function(h,b){return this.sendPacket("message",h,b),this},o.prototype.sendPacket=function(h,b,A){if(this.readyState!="closing"&&this.readyState!="closed"){var x={type:h,data:b};this.emit("packetCreate",x),this.writeBuffer.push(x),this.callbackBuffer.push(A),this.flush()}},o.prototype.close=function(){function h(){x.onClose("forced close"),g("socket closing - telling transport to close"),x.transport.close()}function b(){x.removeListener("upgrade",b),x.removeListener("upgradeError",b),h()}function A(){x.once("upgrade",b),x.once("upgradeError",b)}if(this.readyState=="opening"||this.readyState=="open"){this.readyState="closing";var x=this;this.writeBuffer.length?this.once("drain",function(){this.upgrading?A():h()}):this.upgrading?A():h()}return this},o.prototype.onError=function(h){g("socket error %j",h),o.priorWebsocketSuccess=!1,this.emit("error",h),this.onClose("transport error",h)},o.prototype.onClose=function(h,b){if(this.readyState=="opening"||this.readyState=="open"||this.readyState=="closing"){g('socket close with reason: "%s"',h);var A=this;clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),setTimeout(function(){A.writeBuffer=[],A.callbackBuffer=[],A.prevBufferLen=0},0),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",h,b)}},o.prototype.filterUpgrades=function(h){for(var b=[],A=0,x=h.length;x>A;A++)~S(this.transports,h[A])&&b.push(h[A]);return b}}).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(s,i){function n(f){this.path=f.path,this.hostname=f.hostname,this.port=f.port,this.secure=f.secure,this.query=f.query,this.timestampParam=f.timestampParam,this.timestampRequests=f.timestampRequests,this.readyState="",this.agent=f.agent||!1,this.socket=f.socket,this.enablesXDR=f.enablesXDR,this.pfx=f.pfx,this.key=f.key,this.passphrase=f.passphrase,this.cert=f.cert,this.ca=f.ca,this.ciphers=f.ciphers,this.rejectUnauthorized=f.rejectUnauthorized}var o=s("engine.io-parser"),u=s("component-emitter");i.exports=n,u(n.prototype),n.timestamps=0,n.prototype.onError=function(f,m){var g=new Error(f);return g.type="TransportError",g.description=m,this.emit("error",g),this},n.prototype.open=function(){return(this.readyState=="closed"||this.readyState=="")&&(this.readyState="opening",this.doOpen()),this},n.prototype.close=function(){return(this.readyState=="opening"||this.readyState=="open")&&(this.doClose(),this.onClose()),this},n.prototype.send=function(f){if(this.readyState!="open")throw new Error("Transport not open");this.write(f)},n.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},n.prototype.onData=function(f){var m=o.decodePacket(f,this.socket.binaryType);this.onPacket(m)},n.prototype.onPacket=function(f){this.emit("packet",f)},n.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},{"component-emitter":9,"engine.io-parser":25}],15:[function(s,i,n){(function(o){function u(v){var _,y=!1,l=!1,h=v.jsonp!==!1;if(o.location){var b=location.protocol=="https:",A=location.port;A||(A=b?443:80),y=v.hostname!=location.hostname||A!=v.port,l=v.secure!=b}if(v.xdomain=y,v.xscheme=l,_=new f(v),"open"in _&&!v.forceJSONP)return new m(v);if(!h)throw new Error("JSONP disabled");return new g(v)}var f=s("xmlhttprequest"),m=s("./polling-xhr"),g=s("./polling-jsonp"),S=s("./websocket");n.polling=u,n.websocket=S}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{"./polling-jsonp":16,"./polling-xhr":17,"./websocket":19,xmlhttprequest:20}],16:[function(s,i){(function(n){function o(){}function u(_){f.call(this,_),this.query=this.query||{},g||(n.___eio||(n.___eio=[]),g=n.___eio),this.index=g.length;var y=this;g.push(function(l){y.onData(l)}),this.query.j=this.index,n.document&&n.addEventListener&&n.addEventListener("beforeunload",function(){y.script&&(y.script.onerror=o)},!1)}var f=s("./polling"),m=s("component-inherit");i.exports=u;var g,S=/\n/g,v=/\\n/g;m(u,f),u.prototype.supportsBinary=!1,u.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),f.prototype.doClose.call(this)},u.prototype.doPoll=function(){var _=this,y=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),y.async=!0,y.src=this.uri(),y.onerror=function(b){_.onError("jsonp poll error",b)};var l=document.getElementsByTagName("script")[0];l.parentNode.insertBefore(y,l),this.script=y;var h=typeof navigator<"u"&&/gecko/i.test(navigator.userAgent);h&&setTimeout(function(){var b=document.createElement("iframe");document.body.appendChild(b),document.body.removeChild(b)},100)},u.prototype.doWrite=function(_,y){function l(){h(),y()}function h(){if(b.iframe)try{b.form.removeChild(b.iframe)}catch(ot){b.onError("jsonp polling iframe removal error",ot)}try{var V='<iframe src="javascript:0" name="'+b.iframeId+'">';A=document.createElement(V)}catch{A=document.createElement("iframe"),A.name=b.iframeId,A.src="javascript:0"}A.id=b.iframeId,b.form.appendChild(A),b.iframe=A}var b=this;if(!this.form){var A,x=document.createElement("form"),W=document.createElement("textarea"),st=this.iframeId="eio_iframe_"+this.index;x.className="socketio",x.style.position="absolute",x.style.top="-1000px",x.style.left="-1000px",x.target=st,x.method="POST",x.setAttribute("accept-charset","utf-8"),W.name="d",x.appendChild(W),document.body.appendChild(x),this.form=x,this.area=W}this.form.action=this.uri(),h(),_=_.replace(v,`\\
33
- `),this.area.value=_.replace(S,"\\n");try{this.form.submit()}catch{}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){b.iframe.readyState=="complete"&&l()}:this.iframe.onload=l}}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{"./polling":18,"component-inherit":21}],17:[function(s,i){(function(n){function o(){}function u(l){if(S.call(this,l),n.location){var h=location.protocol=="https:",b=location.port;b||(b=h?443:80),this.xd=l.hostname!=n.location.hostname||b!=l.port,this.xs=l.secure!=h}}function f(l){this.method=l.method||"GET",this.uri=l.uri,this.xd=!!l.xd,this.xs=!!l.xs,this.async=l.async!==!1,this.data=l.data!=null?l.data:null,this.agent=l.agent,this.isBinary=l.isBinary,this.supportsBinary=l.supportsBinary,this.enablesXDR=l.enablesXDR,this.pfx=l.pfx,this.key=l.key,this.passphrase=l.passphrase,this.cert=l.cert,this.ca=l.ca,this.ciphers=l.ciphers,this.rejectUnauthorized=l.rejectUnauthorized,this.create()}function m(){for(var l in f.requests)f.requests.hasOwnProperty(l)&&f.requests[l].abort()}var g=s("xmlhttprequest"),S=s("./polling"),v=s("component-emitter"),_=s("component-inherit"),y=s("debug")("engine.io-client:polling-xhr");i.exports=u,i.exports.Request=f,_(u,S),u.prototype.supportsBinary=!0,u.prototype.request=function(l){return l=l||{},l.uri=this.uri(),l.xd=this.xd,l.xs=this.xs,l.agent=this.agent||!1,l.supportsBinary=this.supportsBinary,l.enablesXDR=this.enablesXDR,l.pfx=this.pfx,l.key=this.key,l.passphrase=this.passphrase,l.cert=this.cert,l.ca=this.ca,l.ciphers=this.ciphers,l.rejectUnauthorized=this.rejectUnauthorized,new f(l)},u.prototype.doWrite=function(l,h){var b=typeof l!="string"&&l!==void 0,A=this.request({method:"POST",data:l,isBinary:b}),x=this;A.on("success",h),A.on("error",function(W){x.onError("xhr post error",W)}),this.sendXhr=A},u.prototype.doPoll=function(){y("xhr poll");var l=this.request(),h=this;l.on("data",function(b){h.onData(b)}),l.on("error",function(b){h.onError("xhr poll error",b)}),this.pollXhr=l},v(f.prototype),f.prototype.create=function(){var l={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};l.pfx=this.pfx,l.key=this.key,l.passphrase=this.passphrase,l.cert=this.cert,l.ca=this.ca,l.ciphers=this.ciphers,l.rejectUnauthorized=this.rejectUnauthorized;var h=this.xhr=new g(l),b=this;try{if(y("xhr open %s: %s",this.method,this.uri),h.open(this.method,this.uri,this.async),this.supportsBinary&&(h.responseType="arraybuffer"),this.method=="POST")try{this.isBinary?h.setRequestHeader("Content-type","application/octet-stream"):h.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}"withCredentials"in h&&(h.withCredentials=!0),this.hasXDR()?(h.onload=function(){b.onLoad()},h.onerror=function(){b.onError(h.responseText)}):h.onreadystatechange=function(){h.readyState==4&&(h.status==200||h.status==1223?b.onLoad():setTimeout(function(){b.onError(h.status)},0))},y("xhr data %s",this.data),h.send(this.data)}catch(A){return void setTimeout(function(){b.onError(A)},0)}n.document&&(this.index=f.requestsCount++,f.requests[this.index]=this)},f.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},f.prototype.onData=function(l){this.emit("data",l),this.onSuccess()},f.prototype.onError=function(l){this.emit("error",l),this.cleanup(!0)},f.prototype.cleanup=function(l){if(typeof this.xhr<"u"&&this.xhr!==null){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=o:this.xhr.onreadystatechange=o,l)try{this.xhr.abort()}catch{}n.document&&delete f.requests[this.index],this.xhr=null}},f.prototype.onLoad=function(){var l;try{var h;try{h=this.xhr.getResponseHeader("Content-Type").split(";")[0]}catch{}l=h==="application/octet-stream"?this.xhr.response:this.supportsBinary?"ok":this.xhr.responseText}catch(b){this.onError(b)}l!=null&&this.onData(l)},f.prototype.hasXDR=function(){return typeof n.XDomainRequest<"u"&&!this.xs&&this.enablesXDR},f.prototype.abort=function(){this.cleanup()},n.document&&(f.requestsCount=0,f.requests={},n.attachEvent?n.attachEvent("onunload",m):n.addEventListener&&n.addEventListener("beforeunload",m,!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(s,i){function n(v){var _=v&&v.forceBase64;(!S||_)&&(this.supportsBinary=!1),o.call(this,v)}var o=s("../transport"),u=s("parseqs"),f=s("engine.io-parser"),m=s("component-inherit"),g=s("debug")("engine.io-client:polling");i.exports=n;var S=function(){var v=s("xmlhttprequest"),_=new v({xdomain:!1});return _.responseType!=null}();m(n,o),n.prototype.name="polling",n.prototype.doOpen=function(){this.poll()},n.prototype.pause=function(v){function _(){g("paused"),y.readyState="paused",v()}var y=this;if(this.readyState="pausing",this.polling||!this.writable){var l=0;this.polling&&(g("we are currently polling - waiting to pause"),l++,this.once("pollComplete",function(){g("pre-pause polling complete"),--l||_()})),this.writable||(g("we are currently writing - waiting to pause"),l++,this.once("drain",function(){g("pre-pause writing complete"),--l||_()}))}else _()},n.prototype.poll=function(){g("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},n.prototype.onData=function(v){var _=this;g("polling got data %s",v);var y=function(l){return _.readyState=="opening"&&_.onOpen(),l.type=="close"?(_.onClose(),!1):void _.onPacket(l)};f.decodePayload(v,this.socket.binaryType,y),this.readyState!="closed"&&(this.polling=!1,this.emit("pollComplete"),this.readyState=="open"?this.poll():g('ignoring poll - transport state "%s"',this.readyState))},n.prototype.doClose=function(){function v(){g("writing close packet"),_.write([{type:"close"}])}var _=this;this.readyState=="open"?(g("transport open - closing"),v()):(g("transport not open - deferring close"),this.once("open",v))},n.prototype.write=function(v){var y=this;this.writable=!1;var _=function(){y.writable=!0,y.emit("drain")},y=this;f.encodePayload(v,this.supportsBinary,function(l){y.doWrite(l,_)})},n.prototype.uri=function(){var v=this.query||{},_=this.secure?"https":"http",y="";return this.timestampRequests!==!1&&(v[this.timestampParam]=+new Date+"-"+o.timestamps++),this.supportsBinary||v.sid||(v.b64=1),v=u.encode(v),this.port&&(_=="https"&&this.port!=443||_=="http"&&this.port!=80)&&(y=":"+this.port),v.length&&(v="?"+v),_+"://"+this.hostname+y+this.path+v}},{"../transport":14,"component-inherit":21,debug:22,"engine.io-parser":25,parseqs:33,xmlhttprequest:20}],19:[function(s,i){function n(v){var _=v&&v.forceBase64;_&&(this.supportsBinary=!1),o.call(this,v)}var o=s("../transport"),u=s("engine.io-parser"),f=s("parseqs"),m=s("component-inherit"),g=s("debug")("engine.io-client:websocket"),S=s("ws");i.exports=n,m(n,o),n.prototype.name="websocket",n.prototype.supportsBinary=!0,n.prototype.doOpen=function(){if(this.check()){var v=this.uri(),_=void 0,y={agent:this.agent};y.pfx=this.pfx,y.key=this.key,y.passphrase=this.passphrase,y.cert=this.cert,y.ca=this.ca,y.ciphers=this.ciphers,y.rejectUnauthorized=this.rejectUnauthorized,this.ws=new S(v,_,y),this.ws.binaryType===void 0&&(this.supportsBinary=!1),this.ws.binaryType="arraybuffer",this.addEventListeners()}},n.prototype.addEventListeners=function(){var v=this;this.ws.onopen=function(){v.onOpen()},this.ws.onclose=function(){v.onClose()},this.ws.onmessage=function(_){v.onData(_.data)},this.ws.onerror=function(_){v.onError("websocket error",_)}},typeof navigator<"u"&&/iPad|iPhone|iPod/i.test(navigator.userAgent)&&(n.prototype.onData=function(v){var _=this;setTimeout(function(){o.prototype.onData.call(_,v)},0)}),n.prototype.write=function(v){function _(){y.writable=!0,y.emit("drain")}var y=this;this.writable=!1;for(var l=0,h=v.length;h>l;l++)u.encodePacket(v[l],this.supportsBinary,function(b){try{y.ws.send(b)}catch{g("websocket closed before onclose event")}});setTimeout(_,0)},n.prototype.onClose=function(){o.prototype.onClose.call(this)},n.prototype.doClose=function(){typeof this.ws<"u"&&this.ws.close()},n.prototype.uri=function(){var v=this.query||{},_=this.secure?"wss":"ws",y="";return this.port&&(_=="wss"&&this.port!=443||_=="ws"&&this.port!=80)&&(y=":"+this.port),this.timestampRequests&&(v[this.timestampParam]=+new Date),this.supportsBinary||(v.b64=1),v=f.encode(v),v.length&&(v="?"+v),_+"://"+this.hostname+y+this.path+v},n.prototype.check=function(){return!(!S||"__initialize"in S&&this.name===n.prototype.name)}},{"../transport":14,"component-inherit":21,debug:22,"engine.io-parser":25,parseqs:33,ws:35}],20:[function(s,i){var n=s("has-cors");i.exports=function(o){var u=o.xdomain,f=o.xscheme,m=o.enablesXDR;try{if(typeof XMLHttpRequest<"u"&&(!u||n))return new XMLHttpRequest}catch{}try{if(typeof XDomainRequest<"u"&&!f&&m)return new XDomainRequest}catch{}if(!u)try{return new ActiveXObject("Microsoft.XMLHTTP")}catch{}}},{"has-cors":38}],21:[function(s,i){i.exports=function(n,o){var u=function(){};u.prototype=o.prototype,n.prototype=new u,n.prototype.constructor=n}},{}],22:[function(s,i,n){function o(){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 u(){var S=arguments,v=this.useColors;if(S[0]=(v?"%c":"")+this.namespace+(v?" %c":" ")+S[0]+(v?"%c ":" ")+"+"+n.humanize(this.diff),!v)return S;var _="color: "+this.color;S=[S[0],_,"color: inherit"].concat(Array.prototype.slice.call(S,1));var y=0,l=0;return S[0].replace(/%[a-z%]/g,function(h){h!=="%%"&&(y++,h==="%c"&&(l=y))}),S.splice(l,0,_),S}function f(){return typeof console=="object"&&typeof console.log=="function"&&Function.prototype.apply.call(console.log,console,arguments)}function m(S){try{S==null?localStorage.removeItem("debug"):localStorage.debug=S}catch{}}function g(){var S;try{S=localStorage.debug}catch{}return S}n=i.exports=s("./debug"),n.log=f,n.formatArgs=u,n.save=m,n.load=g,n.useColors=o,n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],n.formatters.j=function(S){return JSON.stringify(S)},n.enable(g())},{"./debug":23}],23:[function(s,i,n){function o(){return n.colors[_++%n.colors.length]}function u(y){function l(){}function h(){var A=h,x=+new Date,W=x-(v||x);A.diff=W,A.prev=v,A.curr=x,v=x,A.useColors==null&&(A.useColors=n.useColors()),A.color==null&&A.useColors&&(A.color=o());var st=Array.prototype.slice.call(arguments);st[0]=n.coerce(st[0]),typeof st[0]!="string"&&(st=["%o"].concat(st));var V=0;st[0]=st[0].replace(/%([a-z%])/g,function(H,D){if(H==="%%")return H;V++;var M=n.formatters[D];if(typeof M=="function"){var G=st[V];H=M.call(A,G),st.splice(V,1),V--}return H}),typeof n.formatArgs=="function"&&(st=n.formatArgs.apply(A,st));var ot=h.log||n.log||console.log.bind(console);ot.apply(A,st)}l.enabled=!1,h.enabled=!0;var b=n.enabled(y)?h:l;return b.namespace=y,b}function f(y){n.save(y);for(var l=(y||"").split(/[\s,]+/),h=l.length,b=0;h>b;b++)l[b]&&(y=l[b].replace(/\*/g,".*?"),y[0]==="-"?n.skips.push(new RegExp("^"+y.substr(1)+"$")):n.names.push(new RegExp("^"+y+"$")))}function m(){n.enable("")}function g(y){var l,h;for(l=0,h=n.skips.length;h>l;l++)if(n.skips[l].test(y))return!1;for(l=0,h=n.names.length;h>l;l++)if(n.names[l].test(y))return!0;return!1}function S(y){return y instanceof Error?y.stack||y.message:y}n=i.exports=u,n.coerce=S,n.disable=m,n.enable=f,n.enabled=g,n.humanize=s("ms"),n.names=[],n.skips=[],n.formatters={};var v,_=0},{ms:24}],24:[function(s,i){function n(y){var l=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(y);if(l){var h=parseFloat(l[1]),b=(l[2]||"ms").toLowerCase();switch(b){case"years":case"year":case"y":return h*_;case"days":case"day":case"d":return h*v;case"hours":case"hour":case"h":return h*S;case"minutes":case"minute":case"m":return h*g;case"seconds":case"second":case"s":return h*m;case"ms":return h}}}function o(y){return y>=v?Math.round(y/v)+"d":y>=S?Math.round(y/S)+"h":y>=g?Math.round(y/g)+"m":y>=m?Math.round(y/m)+"s":y+"ms"}function u(y){return f(y,v,"day")||f(y,S,"hour")||f(y,g,"minute")||f(y,m,"second")||y+" ms"}function f(y,l,h){return l>y?void 0:1.5*l>y?Math.floor(y/l)+" "+h:Math.ceil(y/l)+" "+h+"s"}var m=1e3,g=60*m,S=60*g,v=24*S,_=365.25*v;i.exports=function(y,l){return l=l||{},typeof y=="string"?n(y):l.long?u(y):o(y)}},{}],25:[function(s,i,n){(function(o){function u(D,M){var G="b"+n.packets[D.type]+D.data.data;return M(G)}function f(D,M,G){if(!M)return n.encodeBase64Packet(D,G);var L=D.data,U=new Uint8Array(L),X=new Uint8Array(1+L.byteLength);X[0]=st[D.type];for(var Q=0;Q<U.length;Q++)X[Q+1]=U[Q];return G(X.buffer)}function m(D,M,G){if(!M)return n.encodeBase64Packet(D,G);var L=new FileReader;return L.onload=function(){D.data=L.result,n.encodePacket(D,M,!0,G)},L.readAsArrayBuffer(D.data)}function g(D,M,G){if(!M)return n.encodeBase64Packet(D,G);if(W)return m(D,M,G);var L=new Uint8Array(1);L[0]=st[D.type];var U=new H([L.buffer,D.data]);return G(U)}function S(D,M,G){for(var L=new Array(D.length),U=h(D.length,G),X=function(j,B,kt){M(B,function(Et,Rt){L[j]=Rt,kt(Et,L)})},Q=0;Q<D.length;Q++)X(Q,D[Q],U)}var v=s("./keys"),_=s("has-binary"),y=s("arraybuffer.slice"),l=s("base64-arraybuffer"),h=s("after"),b=s("utf8"),A=navigator.userAgent.match(/Android/i),x=/PhantomJS/i.test(navigator.userAgent),W=A||x;n.protocol=3;var st=n.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},V=v(st),ot={type:"error",data:"parser error"},H=s("blob");n.encodePacket=function(D,M,G,L){typeof M=="function"&&(L=M,M=!1),typeof G=="function"&&(L=G,G=null);var U=D.data===void 0?void 0:D.data.buffer||D.data;if(o.ArrayBuffer&&U instanceof ArrayBuffer)return f(D,M,L);if(H&&U instanceof o.Blob)return g(D,M,L);if(U&&U.base64)return u(D,L);var X=st[D.type];return D.data!==void 0&&(X+=G?b.encode(String(D.data)):String(D.data)),L(""+X)},n.encodeBase64Packet=function(D,M){var G="b"+n.packets[D.type];if(H&&D.data instanceof H){var L=new FileReader;return L.onload=function(){var B=L.result.split(",")[1];M(G+B)},L.readAsDataURL(D.data)}var U;try{U=String.fromCharCode.apply(null,new Uint8Array(D.data))}catch{for(var X=new Uint8Array(D.data),Q=new Array(X.length),j=0;j<X.length;j++)Q[j]=X[j];U=String.fromCharCode.apply(null,Q)}return G+=o.btoa(U),M(G)},n.decodePacket=function(D,M,G){if(typeof D=="string"||D===void 0){if(D.charAt(0)=="b")return n.decodeBase64Packet(D.substr(1),M);if(G)try{D=b.decode(D)}catch{return ot}var U=D.charAt(0);return Number(U)==U&&V[U]?D.length>1?{type:V[U],data:D.substring(1)}:{type:V[U]}:ot}var L=new Uint8Array(D),U=L[0],X=y(D,1);return H&&M==="blob"&&(X=new H([X])),{type:V[U],data:X}},n.decodeBase64Packet=function(D,M){var G=V[D.charAt(0)];if(!o.ArrayBuffer)return{type:G,data:{base64:!0,data:D.substr(1)}};var L=l.decode(D.substr(1));return M==="blob"&&H&&(L=new H([L])),{type:G,data:L}},n.encodePayload=function(D,M,G){function L(Q){return Q.length+":"+Q}function U(Q,j){n.encodePacket(Q,X?M:!1,!0,function(B){j(null,L(B))})}typeof M=="function"&&(G=M,M=null);var X=_(D);return M&&X?H&&!W?n.encodePayloadAsBlob(D,G):n.encodePayloadAsArrayBuffer(D,G):D.length?void S(D,U,function(Q,j){return G(j.join(""))}):G("0:")},n.decodePayload=function(D,M,G){if(typeof D!="string")return n.decodePayloadAsBinary(D,M,G);typeof M=="function"&&(G=M,M=null);var L;if(D=="")return G(ot,0,1);for(var U,X,Q="",j=0,B=D.length;B>j;j++){var kt=D.charAt(j);if(kt!=":")Q+=kt;else{if(Q==""||Q!=(U=Number(Q))||(X=D.substr(j+1,U),Q!=X.length))return G(ot,0,1);if(X.length){if(L=n.decodePacket(X,M,!0),ot.type==L.type&&ot.data==L.data)return G(ot,0,1);var Et=G(L,j+U,B);if(Et===!1)return}j+=U,Q=""}}return Q!=""?G(ot,0,1):void 0},n.encodePayloadAsArrayBuffer=function(D,M){function G(L,U){n.encodePacket(L,!0,!0,function(X){return U(null,X)})}return D.length?void S(D,G,function(L,U){var X=U.reduce(function(B,kt){var Et;return Et=typeof kt=="string"?kt.length:kt.byteLength,B+Et.toString().length+Et+2},0),Q=new Uint8Array(X),j=0;return U.forEach(function(B){var kt=typeof B=="string",Et=B;if(kt){for(var Rt=new Uint8Array(B.length),ut=0;ut<B.length;ut++)Rt[ut]=B.charCodeAt(ut);Et=Rt.buffer}Q[j++]=kt?0:1;for(var Xt=Et.byteLength.toString(),ut=0;ut<Xt.length;ut++)Q[j++]=parseInt(Xt[ut]);Q[j++]=255;for(var Rt=new Uint8Array(Et),ut=0;ut<Rt.length;ut++)Q[j++]=Rt[ut]}),M(Q.buffer)}):M(new ArrayBuffer(0))},n.encodePayloadAsBlob=function(D,M){function G(L,U){n.encodePacket(L,!0,!0,function(X){var Q=new Uint8Array(1);if(Q[0]=1,typeof X=="string"){for(var j=new Uint8Array(X.length),B=0;B<X.length;B++)j[B]=X.charCodeAt(B);X=j.buffer,Q[0]=0}for(var kt=X instanceof ArrayBuffer?X.byteLength:X.size,Et=kt.toString(),Rt=new Uint8Array(Et.length+1),B=0;B<Et.length;B++)Rt[B]=parseInt(Et[B]);if(Rt[Et.length]=255,H){var ut=new H([Q.buffer,Rt.buffer,X]);U(null,ut)}})}S(D,G,function(L,U){return M(new H(U))})},n.decodePayloadAsBinary=function(D,M,G){typeof M=="function"&&(G=M,M=null);for(var L=D,U=[],X=!1;L.byteLength>0;){for(var Q=new Uint8Array(L),j=Q[0]===0,B="",kt=1;Q[kt]!=255;kt++){if(B.length>310){X=!0;break}B+=Q[kt]}if(X)return G(ot,0,1);L=y(L,2+B.length),B=parseInt(B);var Et=y(L,0,B);if(j)try{Et=String.fromCharCode.apply(null,new Uint8Array(Et))}catch{var Rt=new Uint8Array(Et);Et="";for(var kt=0;kt<Rt.length;kt++)Et+=String.fromCharCode(Rt[kt])}U.push(Et),L=y(L,B)}var ut=U.length;U.forEach(function(Xt,Le){G(n.decodePacket(Xt,M,!0),Le,ut)})}}).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(s,i){i.exports=Object.keys||function(n){var o=[],u=Object.prototype.hasOwnProperty;for(var f in n)u.call(n,f)&&o.push(f);return o}},{}],27:[function(s,i){function n(u,f,m){function g(v,_){if(g.count<=0)throw new Error("after called too many times");--g.count,v?(S=!0,f(v),f=m):g.count!==0||S||f(null,_)}var S=!1;return m=m||o,g.count=u,u===0?f():g}function o(){}i.exports=n},{}],28:[function(s,i){i.exports=function(n,o,u){var f=n.byteLength;if(o=o||0,u=u||f,n.slice)return n.slice(o,u);if(0>o&&(o+=f),0>u&&(u+=f),u>f&&(u=f),o>=f||o>=u||f===0)return new ArrayBuffer(0);for(var m=new Uint8Array(n),g=new Uint8Array(u-o),S=o,v=0;u>S;S++,v++)g[v]=m[S];return g.buffer}},{}],29:[function(s,i,n){(function(o){n.encode=function(u){var f,m=new Uint8Array(u),g=m.length,S="";for(f=0;g>f;f+=3)S+=o[m[f]>>2],S+=o[(3&m[f])<<4|m[f+1]>>4],S+=o[(15&m[f+1])<<2|m[f+2]>>6],S+=o[63&m[f+2]];return g%3===2?S=S.substring(0,S.length-1)+"=":g%3===1&&(S=S.substring(0,S.length-2)+"=="),S},n.decode=function(u){var f,m,g,S,v,_=.75*u.length,y=u.length,l=0;u[u.length-1]==="="&&(_--,u[u.length-2]==="="&&_--);var h=new ArrayBuffer(_),b=new Uint8Array(h);for(f=0;y>f;f+=4)m=o.indexOf(u[f]),g=o.indexOf(u[f+1]),S=o.indexOf(u[f+2]),v=o.indexOf(u[f+3]),b[l++]=m<<2|g>>4,b[l++]=(15&g)<<4|S>>2,b[l++]=(3&S)<<6|63&v;return h}})("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")},{}],30:[function(s,i){(function(n){function o(_){for(var y=0;y<_.length;y++){var l=_[y];if(l.buffer instanceof ArrayBuffer){var h=l.buffer;if(l.byteLength!==h.byteLength){var b=new Uint8Array(l.byteLength);b.set(new Uint8Array(h,l.byteOffset,l.byteLength)),h=b.buffer}_[y]=h}}}function u(_,y){y=y||{};var l=new m;o(_);for(var h=0;h<_.length;h++)l.append(_[h]);return y.type?l.getBlob(y.type):l.getBlob()}function f(_,y){return o(_),new Blob(_,y||{})}var m=n.BlobBuilder||n.WebKitBlobBuilder||n.MSBlobBuilder||n.MozBlobBuilder,g=function(){try{var _=new Blob(["hi"]);return _.size===2}catch{return!1}}(),S=g&&function(){try{var _=new Blob([new Uint8Array([1,2])]);return _.size===2}catch{return!1}}(),v=m&&m.prototype.append&&m.prototype.getBlob;i.exports=function(){return g?S?n.Blob:f:v?u:void 0}()}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{}],31:[function(s,i,n){(function(o){(function(u){function f(L){for(var U,X,Q=[],j=0,B=L.length;B>j;)U=L.charCodeAt(j++),U>=55296&&56319>=U&&B>j?(X=L.charCodeAt(j++),(64512&X)==56320?Q.push(((1023&U)<<10)+(1023&X)+65536):(Q.push(U),j--)):Q.push(U);return Q}function m(L){for(var U,X=L.length,Q=-1,j="";++Q<X;)U=L[Q],U>65535&&(U-=65536,j+=ot(U>>>10&1023|55296),U=56320|1023&U),j+=ot(U);return j}function g(L){if(L>=55296&&57343>=L)throw Error("Lone surrogate U+"+L.toString(16).toUpperCase()+" is not a scalar value")}function S(L,U){return ot(L>>U&63|128)}function v(L){if(!(4294967168&L))return ot(L);var U="";return 4294965248&L?4294901760&L?!(4292870144&L)&&(U=ot(L>>18&7|240),U+=S(L,12),U+=S(L,6)):(g(L),U=ot(L>>12&15|224),U+=S(L,6)):U=ot(L>>6&31|192),U+=ot(63&L|128)}function _(L){for(var U,X=f(L),Q=X.length,j=-1,B="";++j<Q;)U=X[j],B+=v(U);return B}function y(){if(V>=st)throw Error("Invalid byte index");var L=255&W[V];if(V++,(192&L)==128)return 63&L;throw Error("Invalid continuation byte")}function l(){var L,U,X,Q,j;if(V>st)throw Error("Invalid byte index");if(V==st)return!1;if(L=255&W[V],V++,(128&L)==0)return L;if((224&L)==192){var U=y();if(j=(31&L)<<6|U,j>=128)return j;throw Error("Invalid continuation byte")}if((240&L)==224){if(U=y(),X=y(),j=(15&L)<<12|U<<6|X,j>=2048)return g(j),j;throw Error("Invalid continuation byte")}if((248&L)==240&&(U=y(),X=y(),Q=y(),j=(15&L)<<18|U<<12|X<<6|Q,j>=65536&&1114111>=j))return j;throw Error("Invalid UTF-8 detected")}function h(L){W=f(L),st=W.length,V=0;for(var U,X=[];(U=l())!==!1;)X.push(U);return m(X)}var b=typeof n=="object"&&n,A=typeof i=="object"&&i&&i.exports==b&&i,x=typeof o=="object"&&o;(x.global===x||x.window===x)&&(u=x);var W,st,V,ot=String.fromCharCode,H={version:"2.0.0",encode:_,decode:h};if(b&&!b.nodeType)if(A)A.exports=H;else{var D={},M=D.hasOwnProperty;for(var G in H)M.call(H,G)&&(b[G]=H[G])}else u.utf8=H})(this)}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{}],32:[function(s,i){(function(n){var o=/^[\],:{}\s]*$/,u=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,f=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,m=/(?:^|:|,)(?:\s*\[)+/g,g=/^\s+/,S=/\s+$/;i.exports=function(v){return typeof v=="string"&&v?(v=v.replace(g,"").replace(S,""),n.JSON&&JSON.parse?JSON.parse(v):o.test(v.replace(u,"@").replace(f,"]").replace(m,""))?new Function("return "+v)():void 0):null}}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{}],33:[function(s,i,n){n.encode=function(o){var u="";for(var f in o)o.hasOwnProperty(f)&&(u.length&&(u+="&"),u+=encodeURIComponent(f)+"="+encodeURIComponent(o[f]));return u},n.decode=function(o){for(var u={},f=o.split("&"),m=0,g=f.length;g>m;m++){var S=f[m].split("=");u[decodeURIComponent(S[0])]=decodeURIComponent(S[1])}return u}},{}],34:[function(s,i){var n=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,o=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];i.exports=function(u){var f=u,m=u.indexOf("["),g=u.indexOf("]");m!=-1&&g!=-1&&(u=u.substring(0,m)+u.substring(m,g).replace(/:/g,";")+u.substring(g,u.length));for(var S=n.exec(u||""),v={},_=14;_--;)v[o[_]]=S[_]||"";return m!=-1&&g!=-1&&(v.source=f,v.host=v.host.substring(1,v.host.length-1).replace(/;/g,":"),v.authority=v.authority.replace("[","").replace("]","").replace(/;/g,":"),v.ipv6uri=!0),v}},{}],35:[function(s,i){function n(f,m){return m?new u(f,m):new u(f)}var o=function(){return self}(),u=o.WebSocket||o.MozWebSocket;i.exports=u?n:null,u&&(n.prototype=u.prototype)},{}],36:[function(s,i){(function(n){function o(f){function m(g){if(!g)return!1;if(n.Buffer&&n.Buffer.isBuffer(g)||n.ArrayBuffer&&g instanceof ArrayBuffer||n.Blob&&g instanceof Blob||n.File&&g instanceof File)return!0;if(u(g)){for(var S=0;S<g.length;S++)if(m(g[S]))return!0}else if(g&&typeof g=="object"){g.toJSON&&(g=g.toJSON());for(var v in g)if(Object.prototype.hasOwnProperty.call(g,v)&&m(g[v]))return!0}return!1}return m(f)}var u=s("isarray");i.exports=o}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{isarray:37}],37:[function(s,i){i.exports=Array.isArray||function(n){return Object.prototype.toString.call(n)=="[object Array]"}},{}],38:[function(s,i){var n=s("global");try{i.exports="XMLHttpRequest"in n&&"withCredentials"in new n.XMLHttpRequest}catch{i.exports=!1}},{global:39}],39:[function(s,i){i.exports=function(){return this}()},{}],40:[function(s,i){var n=[].indexOf;i.exports=function(o,u){if(n)return o.indexOf(u);for(var f=0;f<o.length;++f)if(o[f]===u)return f;return-1}},{}],41:[function(s,i,n){var o=Object.prototype.hasOwnProperty;n.keys=Object.keys||function(u){var f=[];for(var m in u)o.call(u,m)&&f.push(m);return f},n.values=function(u){var f=[];for(var m in u)o.call(u,m)&&f.push(u[m]);return f},n.merge=function(u,f){for(var m in f)o.call(f,m)&&(u[m]=f[m]);return u},n.length=function(u){return n.keys(u).length},n.isEmpty=function(u){return n.length(u)==0}},{}],42:[function(s,i){var n=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,o=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];i.exports=function(u){for(var f=n.exec(u||""),m={},g=14;g--;)m[o[g]]=f[g]||"";return m}},{}],43:[function(s,i,n){(function(o){var u=s("isarray"),f=s("./is-buffer");n.deconstructPacket=function(m){function g(y){if(!y)return y;if(f(y)){var l={_placeholder:!0,num:S.length};return S.push(y),l}if(u(y)){for(var h=new Array(y.length),b=0;b<y.length;b++)h[b]=g(y[b]);return h}if(typeof y=="object"&&!(y instanceof Date)){var h={};for(var A in y)h[A]=g(y[A]);return h}return y}var S=[],v=m.data,_=m;return _.data=g(v),_.attachments=S.length,{packet:_,buffers:S}},n.reconstructPacket=function(m,g){function S(v){if(v&&v._placeholder){var _=g[v.num];return _}if(u(v)){for(var y=0;y<v.length;y++)v[y]=S(v[y]);return v}if(v&&typeof v=="object"){for(var l in v)v[l]=S(v[l]);return v}return v}return m.data=S(m.data),m.attachments=void 0,m},n.removeBlobs=function(m,g){function S(y,l,h){if(!y)return y;if(o.Blob&&y instanceof Blob||o.File&&y instanceof File){v++;var b=new FileReader;b.onload=function(){h?h[l]=this.result:_=this.result,--v||g(_)},b.readAsArrayBuffer(y)}else if(u(y))for(var A=0;A<y.length;A++)S(y[A],A,y);else if(y&&typeof y=="object"&&!f(y))for(var x in y)S(y[x],x,y)}var v=0,_=m;S(_),v||g(_)}}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{"./is-buffer":45,isarray:46}],44:[function(s,i,n){function o(){}function u(A){var x="",W=!1;return x+=A.type,(n.BINARY_EVENT==A.type||n.BINARY_ACK==A.type)&&(x+=A.attachments,x+="-"),A.nsp&&A.nsp!="/"&&(W=!0,x+=A.nsp),A.id!=null&&(W&&(x+=",",W=!1),x+=A.id),A.data!=null&&(W&&(x+=","),x+=y.stringify(A.data)),_("encoded %j as %s",A,x),x}function f(A,x){function W(st){var V=h.deconstructPacket(st),ot=u(V.packet),H=V.buffers;H.unshift(ot),x(H)}h.removeBlobs(A,W)}function m(){this.reconstructor=null}function g(A){var x={},W=0;if(x.type=Number(A.charAt(0)),n.types[x.type]==null)return v();if(n.BINARY_EVENT==x.type||n.BINARY_ACK==x.type){for(var st="";A.charAt(++W)!="-"&&(st+=A.charAt(W),W!=A.length););if(st!=Number(st)||A.charAt(W)!="-")throw new Error("Illegal attachments");x.attachments=Number(st)}if(A.charAt(W+1)=="/")for(x.nsp="";++W;){var V=A.charAt(W);if(V==","||(x.nsp+=V,W==A.length))break}else x.nsp="/";var ot=A.charAt(W+1);if(ot!==""&&Number(ot)==ot){for(x.id="";++W;){var V=A.charAt(W);if(V==null||Number(V)!=V){--W;break}if(x.id+=A.charAt(W),W==A.length)break}x.id=Number(x.id)}if(A.charAt(++W))try{x.data=y.parse(A.substr(W))}catch{return v()}return _("decoded %s as %j",A,x),x}function S(A){this.reconPack=A,this.buffers=[]}function v(){return{type:n.ERROR,data:"parser error"}}var _=s("debug")("socket.io-parser"),y=s("json3"),l=(s("isarray"),s("component-emitter")),h=s("./binary"),b=s("./is-buffer");n.protocol=4,n.types=["CONNECT","DISCONNECT","EVENT","BINARY_EVENT","ACK","BINARY_ACK","ERROR"],n.CONNECT=0,n.DISCONNECT=1,n.EVENT=2,n.ACK=3,n.ERROR=4,n.BINARY_EVENT=5,n.BINARY_ACK=6,n.Encoder=o,n.Decoder=m,o.prototype.encode=function(A,x){if(_("encoding packet %j",A),n.BINARY_EVENT==A.type||n.BINARY_ACK==A.type)f(A,x);else{var W=u(A);x([W])}},l(m.prototype),m.prototype.add=function(A){var x;if(typeof A=="string")x=g(A),n.BINARY_EVENT==x.type||n.BINARY_ACK==x.type?(this.reconstructor=new S(x),this.reconstructor.reconPack.attachments===0&&this.emit("decoded",x)):this.emit("decoded",x);else{if(!b(A)&&!A.base64)throw new Error("Unknown type: "+A);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");x=this.reconstructor.takeBinaryData(A),x&&(this.reconstructor=null,this.emit("decoded",x))}},m.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},S.prototype.takeBinaryData=function(A){if(this.buffers.push(A),this.buffers.length==this.reconPack.attachments){var x=h.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),x}return null},S.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},{"./binary":43,"./is-buffer":45,"component-emitter":9,debug:10,isarray:46,json3:47}],45:[function(s,i){(function(n){function o(u){return n.Buffer&&n.Buffer.isBuffer(u)||n.ArrayBuffer&&u instanceof ArrayBuffer}i.exports=o}).call(this,typeof self<"u"?self:typeof window<"u"?window:{})},{}],46:[function(s,i){i.exports=s(37)},{}],47:[function(s,i,n){(function(o){function u(q){if(u[q]!==g)return u[q];var J;if(q=="bug-string-char-index")J=!1;else if(q=="json")J=u("json-stringify")&&u("json-parse");else{var F,et='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if(q=="json-stringify"){var P=_.stringify,Z=typeof P=="function"&&y;if(Z){(F=function(){return 1}).toJSON=F;try{Z=P(0)==="0"&&P(new Number)==="0"&&P(new String)=='""'&&P(S)===g&&P(g)===g&&P()===g&&P(F)==="1"&&P([F])=="[1]"&&P([g])=="[null]"&&P(null)=="null"&&P([g,S,null])=="[null,null,null]"&&P({a:[F,!0,!1,null,`\0\b
34
- \f\r `]})==et&&P(null,F)==="1"&&P([1,2],null,1)==`[
6
+ */var _r=function(t){return t!=null&&(De(t)||Lr(t)||!!t._isBuffer)};function De(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Lr(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&De(t.slice(0,0))}(function(){var t=Ir,e=Ue.utf8,r=_r,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 I=c,_=l,b=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+I>>>0,l=l+_>>>0,p=p+b>>>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,yt.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 Ur=yt.exports;const Dr=ot(Ur);var bt=(t=>(t.MAIN="main",t.NEXT="next",t))(bt||{}),ct=(t=>(t.USER="User",t.TOKEN="Token",t))(ct||{});class Rt{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"){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"&&window.sessionStorage.setItem(e,JSON.stringify(r))}static clearSessionStorage(){typeof chrome<"u"&&typeof chrome.storage<"u"&&chrome.storage.session.clear(),typeof window<"u"&&window.sessionStorage.clear()}}var Pr=Object.defineProperty,Fr=(t,e,r)=>e in t?Pr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,V=(t,e,r)=>(Fr(t,typeof e!="symbol"?e+"":e,r),r);function jr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Mr(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 Qt={exports:{}},qr=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,zr=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],Pe=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=qr.exec(t||""),i={},u=14;u--;)i[zr[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=Xr(i,i.path),i.queryKey=Kr(i,i.query),i};function Xr(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 Kr(t,e){var r={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,o,i){o&&(r[o]=i)}),r}var Zt={exports:{}},te={exports:{}},Bt=1e3,It=Bt*60,_t=It*60,Lt=_t*24,Wr=Lt*365.25,Hr=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return Jr(t);if(r==="number"&&isNaN(t)===!1)return e.long?$r(t):Vr(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Jr(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*Wr;case"days":case"day":case"d":return r*Lt;case"hours":case"hour":case"hrs":case"hr":case"h":return r*_t;case"minutes":case"minute":case"mins":case"min":case"m":return r*It;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 Vr(t){return t>=Lt?Math.round(t/Lt)+"d":t>=_t?Math.round(t/_t)+"h":t>=It?Math.round(t/It)+"m":t>=Bt?Math.round(t/Bt)+"s":t+"ms"}function $r(t){return Ft(t,Lt,"day")||Ft(t,_t,"hour")||Ft(t,It,"minute")||Ft(t,Bt,"second")||t+" ms"}function Ft(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=Hr,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(_,b){if(_==="%%")return _;w++;var S=e.formatters[b];if(typeof S=="function"){var m=y[w];_=S.call(a,m),y.splice(w,1),w--}return _}),e.formatArgs.call(a,y);var I=p.log||e.log||console.log.bind(console);I.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}})(te,te.exports);var Gr=te.exports;(function(t,e){e=t.exports=Gr,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{}}})(Zt,Zt.exports);var ft=Zt.exports,Yr=Pe,Fe=ft("socket.io-client:url"),Qr=Zr;function Zr(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)||(Fe("protocol-less url %s",t),typeof e<"u"?t=e.protocol+"//"+t:t="https://"+t),Fe("parse %s",t),r=Yr(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 jt={},je={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}})(je);var wt=je.exports,Mt={},tn={}.toString,ee=Array.isArray||function(t){return tn.call(t)=="[object Array]"},Me=on,en=typeof Buffer=="function"&&typeof Buffer.isBuffer=="function",rn=typeof ArrayBuffer=="function",nn=function(t){return typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer};function on(t){return en&&Buffer.isBuffer(t)||rn&&(t instanceof ArrayBuffer||nn(t))}var re=ee,qe=Me,ze=Object.prototype.toString,sn=typeof Blob=="function"||typeof Blob<"u"&&ze.call(Blob)==="[object BlobConstructor]",an=typeof File=="function"||typeof File<"u"&&ze.call(File)==="[object FileConstructor]";Mt.deconstructPacket=function(t){var e=[],r=t.data,n=t;return n.data=ne(r,e),n.attachments=e.length,{packet:n,buffers:e}};function ne(t,e){if(!t)return t;if(qe(t)){var r={_placeholder:!0,num:e.length};return e.push(t),r}else if(re(t)){for(var n=new Array(t.length),o=0;o<t.length;o++)n[o]=ne(t[o],e);return n}else if(typeof t=="object"&&!(t instanceof Date)){var n={};for(var i in t)n[i]=ne(t[i],e);return n}return t}Mt.reconstructPacket=function(t,e){return t.data=oe(t.data,e),t.attachments=void 0,t};function oe(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(re(t))for(var n=0;n<t.length;n++)t[n]=oe(t[n],e);else if(typeof t=="object")for(var o in t)t[o]=oe(t[o],e);return t}Mt.removeBlobs=function(t,e){function r(i,u,h){if(!i)return i;if(sn&&i instanceof Blob||an&&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(re(i))for(var c=0;c<i.length;c++)r(i[c],c,i);else if(typeof i=="object"&&!qe(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=ft("socket.io-parser"),r=wt,n=Mt,o=ee,i=Me;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 I=d(g);w([I])}};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 I=c(g.data);if(I!==!1)w+=I;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 I(_){var b=n.deconstructPacket(_),S=d(b.packet),m=b.buffers;m.unshift(S),w(m)}n.removeBlobs(g,I)}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,I={type:Number(g.charAt(0))};if(t.types[I.type]==null)return y("unknown packet type "+I.type);if(t.BINARY_EVENT===I.type||t.BINARY_ACK===I.type){for(var _=w+1;g.charAt(++w)!=="-"&&w!=g.length;);var b=g.substring(_,w);if(b!=Number(b)||g.charAt(w)!=="-")throw new Error("Illegal attachments");I.attachments=Number(b)}if(g.charAt(w+1)==="/"){for(var _=w+1;++w;){var S=g.charAt(w);if(S===","||w===g.length)break}I.nsp=g.substring(_,w)}else I.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}I.id=Number(g.substring(_,w+1))}if(g.charAt(++w)){var C=s(g.substr(w)),E=C!==!1&&(I.type===t.ERROR||o(C));if(E)I.data=C;else return y("invalid payload")}return e("decoded %s as %j",g,I),I}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}}}(jt);var se={exports:{}},qt={},ie={exports:{}};try{ie.exports=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{ie.exports=!1}var cn=ie.exports,ae=function(){return typeof self<"u"?self:typeof window<"u"?window:Function("return this")()}(),hn=cn,pn=ae,ce=function(t){var e=t.xdomain,r=t.xscheme,n=t.enablesXDR;try{if(typeof XMLHttpRequest<"u"&&(!e||hn))return new XMLHttpRequest}catch{}try{if(typeof XDomainRequest<"u"&&!r&&n)return new XDomainRequest}catch{}if(!e)try{return new pn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}},he={exports:{}},Ct={},un=Object.keys||function(t){var e=[],r=Object.prototype.hasOwnProperty;for(var n in t)r.call(t,n)&&e.push(n);return e},ln=ee,Xe=Object.prototype.toString,fn=typeof Blob=="function"||typeof Blob<"u"&&Xe.call(Blob)==="[object BlobConstructor]",dn=typeof File=="function"||typeof File<"u"&&Xe.call(File)==="[object FileConstructor]",Ke=zt;function zt(t){if(!t||typeof t!="object")return!1;if(ln(t)){for(var e=0,r=t.length;e<r;e++)if(zt(t[e]))return!0;return!1}if(typeof Buffer=="function"&&Buffer.isBuffer&&Buffer.isBuffer(t)||typeof ArrayBuffer=="function"&&t instanceof ArrayBuffer||fn&&t instanceof Blob||dn&&t instanceof File)return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return zt(t.toJSON(),!0);for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&zt(t[n]))return!0;return!1}var yn=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},gn=mn;function mn(t,e,r){var n=!1;return r=r||vn,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 vn(){}/*! https://mths.be/utf8js v2.1.2 by @mathias */var gt=String.fromCharCode;function We(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 kn(t){for(var e=t.length,r=-1,n,o="";++r<e;)n=t[r],n>65535&&(n-=65536,o+=gt(n>>>10&1023|55296),n=56320|n&1023),o+=gt(n);return o}function He(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 pe(t,e){return gt(t>>e&63|128)}function bn(t,e){if(!(t&4294967168))return gt(t);var r="";return t&4294965248?t&4294901760?t&4292870144||(r=gt(t>>18&7|240),r+=pe(t,12),r+=pe(t,6)):(He(t,e)||(t=65533),r=gt(t>>12&15|224),r+=pe(t,6)):r=gt(t>>6&31|192),r+=gt(t&63|128),r}function Cn(t,e){e=e||{};for(var r=e.strict!==!1,n=We(t),o=n.length,i=-1,u,h="";++i<o;)u=n[i],h+=bn(u,r);return h}function St(){if(mt>=Kt)throw Error("Invalid byte index");var t=Xt[mt]&255;if(mt++,(t&192)==128)return t&63;throw Error("Invalid continuation byte")}function wn(t){var e,r,n,o,i;if(mt>Kt)throw Error("Invalid byte index");if(mt==Kt)return!1;if(e=Xt[mt]&255,mt++,!(e&128))return e;if((e&224)==192){if(r=St(),i=(e&31)<<6|r,i>=128)return i;throw Error("Invalid continuation byte")}if((e&240)==224){if(r=St(),n=St(),i=(e&15)<<12|r<<6|n,i>=2048)return He(i,t)?i:65533;throw Error("Invalid continuation byte")}if((e&248)==240&&(r=St(),n=St(),o=St(),i=(e&7)<<18|r<<12|n<<6|o,i>=65536&&i<=1114111))return i;throw Error("Invalid UTF-8 detected")}var Xt,Kt,mt;function Sn(t,e){e=e||{};var r=e.strict!==!1;Xt=We(t),Kt=Xt.length,mt=0;for(var n=[],o;(o=wn(r))!==!1;)n.push(o);return kn(n)}var En={version:"2.1.2",encode:Cn,decode:Sn},ue={},Je;function An(){return Je||(Je=1,function(t){ue.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},ue.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+/")),ue}var le,Ve;function Tn(){if(Ve)return le;Ve=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),le=function(){return e?r?Blob:u:n?i:void 0}(),le}(function(t){var e=un,r=Ke,n=yn,o=gn,i=En,u;typeof ArrayBuffer<"u"&&(u=An());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=Tn();t.encodePacket=function(b,S,m,C){typeof S=="function"&&(C=S,S=!1),typeof m=="function"&&(C=m,m=null);var E=b.data===void 0?void 0:b.data.buffer||b.data;if(typeof ArrayBuffer<"u"&&E instanceof ArrayBuffer)return y(b,S,C);if(typeof s<"u"&&E instanceof s)return w(b,S,C);if(E&&E.base64)return f(b,C);var v=l[b.type];return b.data!==void 0&&(v+=m?i.encode(String(b.data),{strict:!1}):String(b.data)),C(""+v)};function f(b,S){var m="b"+t.packets[b.type]+b.data.data;return S(m)}function y(b,S,m){if(!S)return t.encodeBase64Packet(b,m);var C=b.data,E=new Uint8Array(C),v=new Uint8Array(1+C.byteLength);v[0]=l[b.type];for(var k=0;k<E.length;k++)v[k+1]=E[k];return m(v.buffer)}function g(b,S,m){if(!S)return t.encodeBase64Packet(b,m);var C=new FileReader;return C.onload=function(){t.encodePacket({type:b.type,data:C.result},S,!0,m)},C.readAsArrayBuffer(b.data)}function w(b,S,m){if(!S)return t.encodeBase64Packet(b,m);if(c)return g(b,S,m);var C=new Uint8Array(1);C[0]=l[b.type];var E=new s([C.buffer,b.data]);return m(E)}t.encodeBase64Packet=function(b,S){var m="b"+t.packets[b.type];if(typeof s<"u"&&b.data instanceof s){var C=new FileReader;return C.onload=function(){var x=C.result.split(",")[1];S(m+x)},C.readAsDataURL(b.data)}var E;try{E=String.fromCharCode.apply(null,new Uint8Array(b.data))}catch{for(var v=new Uint8Array(b.data),k=new Array(v.length),T=0;T<v.length;T++)k[T]=v[T];E=String.fromCharCode.apply(null,k)}return m+=btoa(E),S(m)},t.decodePacket=function(b,S,m){if(b===void 0)return a;if(typeof b=="string"){if(b.charAt(0)==="b")return t.decodeBase64Packet(b.substr(1),S);if(m&&(b=I(b),b===!1))return a;var E=b.charAt(0);return Number(E)!=E||!p[E]?a:b.length>1?{type:p[E],data:b.substring(1)}:{type:p[E]}}var C=new Uint8Array(b),E=C[0],v=n(b,1);return s&&S==="blob"&&(v=new s([v])),{type:p[E],data:v}};function I(b){try{b=i.decode(b,{strict:!1})}catch{return!1}return b}t.decodeBase64Packet=function(b,S){var m=p[b.charAt(0)];if(!u)return{type:m,data:{base64:!0,data:b.substr(1)}};var C=u.decode(b.substr(1));return S==="blob"&&s&&(C=new s([C])),{type:m,data:C}},t.encodePayload=function(b,S,m){typeof S=="function"&&(m=S,S=null);var C=r(b);if(S&&C)return s&&!c?t.encodePayloadAsBlob(b,m):t.encodePayloadAsArrayBuffer(b,m);if(!b.length)return m("0:");function E(k){return k.length+":"+k}function v(k,T){t.encodePacket(k,C?S:!1,!1,function(x){T(null,E(x))})}_(b,v,function(k,T){return m(T.join(""))})};function _(b,S,m){for(var C=new Array(b.length),E=o(b.length,m),v=function(T,x,O){S(x,function(A,q){C[T]=q,O(A,C)})},k=0;k<b.length;k++)v(k,b[k],E)}t.decodePayload=function(b,S,m){if(typeof b!="string")return t.decodePayloadAsBinary(b,S,m);typeof S=="function"&&(m=S,S=null);var C;if(b==="")return m(a,0,1);for(var E="",v,k,T=0,x=b.length;T<x;T++){var O=b.charAt(T);if(O!==":"){E+=O;continue}if(E===""||E!=(v=Number(E))||(k=b.substr(T+1,v),E!=k.length))return m(a,0,1);if(k.length){if(C=t.decodePacket(k,S,!1),a.type===C.type&&a.data===C.data)return m(a,0,1);var A=m(C,T+v,x);if(A===!1)return}T+=v,E=""}if(E!=="")return m(a,0,1)},t.encodePayloadAsArrayBuffer=function(b,S){if(!b.length)return S(new ArrayBuffer(0));function m(C,E){t.encodePacket(C,!0,!0,function(v){return E(null,v)})}_(b,m,function(C,E){var v=E.reduce(function(x,O){var A;return typeof O=="string"?A=O.length:A=O.byteLength,x+A.toString().length+A+2},0),k=new Uint8Array(v),T=0;return E.forEach(function(x){var O=typeof x=="string",A=x;if(O){for(var q=new Uint8Array(x.length),j=0;j<x.length;j++)q[j]=x.charCodeAt(j);A=q.buffer}O?k[T++]=0:k[T++]=1;for(var G=A.byteLength.toString(),j=0;j<G.length;j++)k[T++]=parseInt(G[j]);k[T++]=255;for(var q=new Uint8Array(A),j=0;j<q.length;j++)k[T++]=q[j]}),S(k.buffer)})},t.encodePayloadAsBlob=function(b,S){function m(C,E){t.encodePacket(C,!0,!0,function(v){var k=new Uint8Array(1);if(k[0]=1,typeof v=="string"){for(var T=new Uint8Array(v.length),x=0;x<v.length;x++)T[x]=v.charCodeAt(x);v=T.buffer,k[0]=0}for(var O=v instanceof ArrayBuffer?v.byteLength:v.size,A=O.toString(),q=new Uint8Array(A.length+1),x=0;x<A.length;x++)q[x]=parseInt(A[x]);if(q[A.length]=255,s){var j=new s([k.buffer,q.buffer,v]);E(null,j)}})}_(b,m,function(C,E){return S(new s(E))})},t.decodePayloadAsBinary=function(b,S,m){typeof S=="function"&&(m=S,S=null);for(var C=b,E=[];C.byteLength>0;){for(var v=new Uint8Array(C),k=v[0]===0,T="",x=1;v[x]!==255;x++){if(T.length>310)return m(a,0,1);T+=v[x]}C=n(C,2+T.length),T=parseInt(T);var O=n(C,0,T);if(k)try{O=String.fromCharCode.apply(null,new Uint8Array(O))}catch{var A=new Uint8Array(O);O="";for(var x=0;x<A.length;x++)O+=String.fromCharCode(A[x])}E.push(O),C=n(C,T)}var q=E.length;E.forEach(function(j,G){m(t.decodePacket(j,S,!0),G,q)})}})(Ct);var fe,$e;function de(){if($e)return fe;$e=1;var t=Ct,e=wt;fe=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")},fe}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 Wt=function(t,e){var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t},Ge="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Ht=64,Ye={},Qe=0,vt=0,Ze;function ye(t){var e="";do e=Ge[t%Ht]+e,t=Math.floor(t/Ht);while(t>0);return e}function Nn(t){var e=0;for(vt=0;vt<t.length;vt++)e=e*Ht+Ye[t.charAt(vt)];return e}function ge(){var t=ye(+new Date);return t!==Ze?(Qe=0,Ze=t):t+"."+ye(Qe++)}for(;vt<Ht;vt++)Ye[Ge[vt]]=vt;ge.encode=ye,ge.decode=Nn;var tr=ge,er=de(),xn=Et,rr=Ct,On=Wt,Rn=tr,ht=ft("engine.io-client:polling"),nr=lt,Bn=function(){var t=ce,e=new t({xdomain:!1});return e.responseType!=null}();function lt(t){var e=t&&t.forceBase64;(!Bn||e)&&(this.supportsBinary=!1),er.call(this,t)}On(lt,er),lt.prototype.name="polling",lt.prototype.doOpen=function(){this.poll()},lt.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()},lt.prototype.poll=function(){ht("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},lt.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)};rr.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))},lt.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))},lt.prototype.write=function(t){var e=this;this.writable=!1;var r=function(){e.writable=!0,e.emit("drain")};rr.encodePayload(t,this.supportsBinary,function(n){e.doWrite(n,r)})},lt.prototype.uri=function(){var t=this.query||{},e=this.secure?"https":"http",r="";this.timestampRequests!==!1&&(t[this.timestampParam]=Rn()),!this.supportsBinary&&!t.sid&&(t.b64=1),t=xn.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 In=ce,or=nr,_n=wt,Ln=Wt,me=ft("engine.io-client:polling-xhr"),Un=ae;he.exports=At,he.exports.Request=Q;function sr(){}function At(t){if(or.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}}Ln(At,or),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 Q(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 Q(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()}if(_n(Q.prototype),Q.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 In(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=Q.requestsCount++,Q.requests[this.index]=this)},Q.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},Q.prototype.onData=function(t){this.emit("data",t),this.onSuccess()},Q.prototype.onError=function(t){this.emit("error",t),this.cleanup(!0)},Q.prototype.cleanup=function(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=sr:this.xhr.onreadystatechange=sr,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Q.requests[this.index],this.xhr=null}},Q.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)},Q.prototype.hasXDR=function(){return typeof XDomainRequest<"u"&&!this.xs&&this.enablesXDR},Q.prototype.abort=function(){this.cleanup()},Q.requestsCount=0,Q.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ir);else if(typeof addEventListener=="function"){var Dn="onpagehide"in Un?"pagehide":"unload";addEventListener(Dn,ir,!1)}}function ir(){for(var t in Q.requests)Q.requests.hasOwnProperty(t)&&Q.requests[t].abort()}var Pn=he.exports,ve=nr,Fn=Wt,ar=ae,jn=Tt,Mn=/\n/g,qn=/\\n/g,Jt;function zn(){}function Tt(t){ve.call(this,t),this.query=this.query||{},Jt||(Jt=ar.___eio=ar.___eio||[]),this.index=Jt.length;var e=this;Jt.push(function(r){e.onData(r)}),this.query.j=this.index,typeof addEventListener=="function"&&addEventListener("beforeunload",function(){e.script&&(e.script.onerror=zn)},!1)}Fn(Tt,ve),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),ve.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(qn,`\\
7
+ `),this.area.value=t.replace(Mn,"\\n");try{this.form.submit()}catch{}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){r.iframe.readyState==="complete"&&h()}:this.iframe.onload=h};const Xn={},Kn=Object.freeze(Object.defineProperty({__proto__:null,default:Xn},Symbol.toStringTag,{value:"Module"})),Wn=Mr(Kn);var ke=de(),Hn=Ct,Jn=Et,Vn=Wt,$n=tr,Gn=ft("engine.io-client:websocket"),Vt,be;if(typeof WebSocket<"u"?Vt=WebSocket:typeof self<"u"&&(Vt=self.WebSocket||self.MozWebSocket),typeof window>"u")try{be=Wn}catch{}var Nt=Vt||be,Yn=it;function it(t){var e=t&&t.forceBase64;e&&(this.supportsBinary=!1),this.perMessageDeflate=t.perMessageDeflate,this.usingBrowserWebSocket=Vt&&!t.forceNode,this.protocols=t.protocols,this.usingBrowserWebSocket||(Nt=be),ke.call(this,t)}Vn(it,ke),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 Nt(t,e):new Nt(t):new Nt(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){Hn.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{Gn("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(){ke.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]=$n()),this.supportsBinary||(t.b64=1),t=Jn.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!!Nt&&!("__initialize"in Nt&&this.name===it.prototype.name)};var Qn=ce,Zn=Pn,to=jn,eo=Yn;qt.polling=ro,qt.websocket=eo;function ro(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 Qn(t),"open"in e&&!t.forceJSONP)return new Zn(t);if(!o)throw new Error("JSONP disabled");return new to(t)}var no=[].indexOf,cr=function(t,e){if(no)return t.indexOf(e);for(var r=0;r<t.length;++r)if(t[r]===e)return r;return-1},oo=qt,so=wt,Y=ft("engine.io-client:socket"),io=cr,hr=Ct,pr=Pe,ao=Et,co=X;function X(t,e){if(!(this instanceof X))return new X(t,e);e=e||{},t&&typeof t=="object"&&(e=t,t=null),t?(t=pr(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=pr(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=ao.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()}X.priorWebsocketSuccess=!1,so(X.prototype),X.protocol=hr.protocol,X.Socket=X,X.Transport=de(),X.transports=qt,X.parser=Ct,X.prototype.createTransport=function(t){Y('creating transport "%s"',t);var e=ho(this.query);e.EIO=hr.protocol,e.transport=t;var r=this.transportOptions[t]||{};this.id&&(e.sid=this.id);var n=new oo[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 ho(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}X.prototype.open=function(){var t;if(this.rememberUpgrade&&X.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)},X.prototype.setTransport=function(t){Y("setting transport %s",t.name);var e=this;this.transport&&(Y("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")})},X.prototype.probe=function(t){Y('probing transport "%s"',t);var e=this.createTransport(t,{probe:1}),r=!1,n=this;X.priorWebsocketSuccess=!1;function o(){if(n.onlyBinaryUpgrades){var p=!this.supportsBinary&&n.transport.supportsBinary;r=r||p}r||(Y('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(Y('probe transport "%s" pong',t),n.upgrading=!0,n.emit("upgrading",e),!e)return;X.priorWebsocketSuccess=e.name==="websocket",Y('pausing current transport "%s"',n.transport.name),n.transport.pause(function(){r||n.readyState!=="closed"&&(Y("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{Y('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(),Y('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&&(Y('"%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()},X.prototype.onOpen=function(){if(Y("socket open"),this.readyState="open",X.priorWebsocketSuccess=this.transport.name==="websocket",this.emit("open"),this.flush(),this.readyState==="open"&&this.upgrade&&this.transport.pause){Y("starting upgrade probes");for(var t=0,e=this.upgrades.length;t<e;t++)this.probe(this.upgrades[t])}},X.prototype.onPacket=function(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(Y('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 Y('packet received with socket readyState "%s"',this.readyState)},X.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))},X.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)},X.prototype.setPing=function(){var t=this;clearTimeout(t.pingIntervalTimer),t.pingIntervalTimer=setTimeout(function(){Y("writing ping packet - expecting pong within %sms",t.pingTimeout),t.ping(),t.onHeartbeat(t.pingTimeout)},t.pingInterval)},X.prototype.ping=function(){var t=this;this.sendPacket("ping",function(){t.emit("ping")})},X.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emit("drain"):this.flush()},X.prototype.flush=function(){this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(Y("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},X.prototype.write=X.prototype.send=function(t,e,r){return this.sendPacket("message",t,e,r),this},X.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()}},X.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"),Y("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},X.prototype.onError=function(t){Y("socket error %j",t),X.priorWebsocketSuccess=!1,this.emit("error",t),this.onClose("transport error",t)},X.prototype.onClose=function(t,e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){Y('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}},X.prototype.filterUpgrades=function(t){for(var e=[],r=0,n=t.length;r<n;r++)~io(this.transports,t[r])&&e.push(t[r]);return e},se.exports=co,se.exports.parser=Ct;var po=se.exports,ur={exports:{}},uo=lo;function lo(t,e){var r=[];e=e||0;for(var n=e||0;n<t.length;n++)r[n-e]=t[n];return r}var lr=fo;function fo(t,e,r){return t.on(e,r),{destroy:function(){t.removeListener(e,r)}}}var fr=[].slice,dr=function(t,e){if(typeof e=="string"&&(e=t[e]),typeof e!="function")throw new Error("bind() requires a function");var r=fr.call(arguments,2);return function(){return e.apply(t,r.concat(fr.call(arguments)))}};(function(t,e){var r=jt,n=wt,o=uo,i=lr,u=dr,h=ft("socket.io-client:socket"),d=Et,c=Ke;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}})(ur);var yr=ur.exports,yo=xt;function xt(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}xt.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},xt.prototype.reset=function(){this.attempts=0},xt.prototype.setMin=function(t){this.ms=t},xt.prototype.setMax=function(t){this.max=t},xt.prototype.setJitter=function(t){this.jitter=t};var go=po,mo=yr,vo=wt,ko=jt,kt=lr,Ot=dr,tt=ft("socket.io-client:manager"),gr=cr,bo=yo,mr=Object.prototype.hasOwnProperty,vr=W;function W(t,e){if(!(this instanceof W))return new W(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 bo({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||ko;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this.autoConnect=e.autoConnect!==!1,this.autoConnect&&this.open()}W.prototype.emitAll=function(){this.emit.apply(this,arguments);for(var t in this.nsps)mr.call(this.nsps,t)&&this.nsps[t].emit.apply(this.nsps[t],arguments)},W.prototype.updateSocketIds=function(){for(var t in this.nsps)mr.call(this.nsps,t)&&(this.nsps[t].id=this.generateId(t))},W.prototype.generateId=function(t){return(t==="/"?"":t+"#")+this.engine.id},vo(W.prototype),W.prototype.reconnection=function(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection},W.prototype.reconnectionAttempts=function(t){return arguments.length?(this._reconnectionAttempts=t,this):this._reconnectionAttempts},W.prototype.reconnectionDelay=function(t){return arguments.length?(this._reconnectionDelay=t,this.backoff&&this.backoff.setMin(t),this):this._reconnectionDelay},W.prototype.randomizationFactor=function(t){return arguments.length?(this._randomizationFactor=t,this.backoff&&this.backoff.setJitter(t),this):this._randomizationFactor},W.prototype.reconnectionDelayMax=function(t){return arguments.length?(this._reconnectionDelayMax=t,this.backoff&&this.backoff.setMax(t),this):this._reconnectionDelayMax},W.prototype.timeout=function(t){return arguments.length?(this._timeout=t,this):this._timeout},W.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()},W.prototype.open=W.prototype.connect=function(t,e){if(tt("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;tt("opening %s",this.uri),this.engine=go(this.uri,this.opts);var r=this.engine,n=this;this.readyState="opening",this.skipReconnect=!1;var o=kt(r,"open",function(){n.onopen(),t&&t()}),i=kt(r,"error",function(d){if(tt("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;tt("connect attempt will timeout after %d",u),u===0&&o.destroy();var h=setTimeout(function(){tt("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},W.prototype.onopen=function(){tt("open"),this.cleanup(),this.readyState="open",this.emit("open");var t=this.engine;this.subs.push(kt(t,"data",Ot(this,"ondata"))),this.subs.push(kt(t,"ping",Ot(this,"onping"))),this.subs.push(kt(t,"pong",Ot(this,"onpong"))),this.subs.push(kt(t,"error",Ot(this,"onerror"))),this.subs.push(kt(t,"close",Ot(this,"onclose"))),this.subs.push(kt(this.decoder,"decoded",Ot(this,"ondecoded")))},W.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},W.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},W.prototype.ondata=function(t){this.decoder.add(t)},W.prototype.ondecoded=function(t){this.emit("packet",t)},W.prototype.onerror=function(t){tt("error",t),this.emitAll("error",t)},W.prototype.socket=function(t,e){var r=this.nsps[t];if(!r){r=new mo(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(){~gr(n.connecting,r)||n.connecting.push(r)}return r},W.prototype.destroy=function(t){var e=gr(this.connecting,t);~e&&this.connecting.splice(e,1),!this.connecting.length&&this.close()},W.prototype.packet=function(t){tt("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()}))},W.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var t=this.packetBuffer.shift();this.packet(t)}},W.prototype.cleanup=function(){tt("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()},W.prototype.close=W.prototype.disconnect=function(){tt("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,this.readyState==="opening"&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},W.prototype.onclose=function(t){tt("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",t),this._reconnection&&!this.skipReconnect&&this.reconnect()},W.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var t=this;if(this.backoff.attempts>=this._reconnectionAttempts)tt("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var e=this.backoff.duration();tt("will wait %dms before reconnect attempt",e),this.reconnecting=!0;var r=setTimeout(function(){t.skipReconnect||(tt("attempting reconnect"),t.emitAll("reconnect_attempt",t.backoff.attempts),t.emitAll("reconnecting",t.backoff.attempts),!t.skipReconnect&&t.open(function(n){n?(tt("reconnect attempt error"),t.reconnecting=!1,t.reconnect(),t.emitAll("reconnect_error",n.data)):(tt("reconnect success"),t.onreconnect())}))},e);this.subs.push({destroy:function(){clearTimeout(r)}})}},W.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=Qr,n=jt,o=vr,i=ft("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=vr,e.Socket=yr}(Qt,Qt.exports);var Co=Qt.exports;const wo=jr(Co);let $t;const So=new Uint8Array(16);function Eo(){if(!$t&&($t=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!$t))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return $t(So)}const Z=[];for(let t=0;t<256;++t)Z.push((t+256).toString(16).slice(1));function Ao(t,e=0){return Z[t[e+0]]+Z[t[e+1]]+Z[t[e+2]]+Z[t[e+3]]+"-"+Z[t[e+4]]+Z[t[e+5]]+"-"+Z[t[e+6]]+Z[t[e+7]]+"-"+Z[t[e+8]]+Z[t[e+9]]+"-"+Z[t[e+10]]+Z[t[e+11]]+Z[t[e+12]]+Z[t[e+13]]+Z[t[e+14]]+Z[t[e+15]]}const To=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),kr={randomUUID:To};function No(t,e,r){if(kr.randomUUID&&!e&&!t)return kr.randomUUID();t=t||{};const n=t.random||(t.rng||Eo)();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 Ao(n)}function xo(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 Oo(t,e){const r=JSON.parse(t);return e.forEach(n=>delete r[n]),r}function Ro(t){if(typeof t=="object"&&t!==null)return t;try{return JSON.parse(t)}catch{return{extraData:t}}}function Bo(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 br(t){return(...e)=>new Promise((r,n)=>{try{const o=t(...e);r(o)}catch(o){n(o)}})}const Io={reconnection:!0,reconnectionDelay:5e3,reconnectionAttempts:10,upgrade:!1,transports:["websocket"],debug:!1},Ce={logToConsole:!0,overloadGlobalConsole:!1,socketEmitInterval:6e4},pt={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"},_o={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},ut={INFO:"info",WARNING:"warning",MODIFY:"modify",ERROR:"error",VIEW:"view"},et={INFO:"info",WARNING:"warning",ERROR:"error",DEBUG:"debug"};let rt=console;class Lo{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||Ce.socketEmitInterval,this.logToConsole=r.logToConsole!==void 0?r.logToConsole:Ce.logToConsole,this.overloadGlobalConsole=r.overloadGlobalConsole!==void 0?r.overloadGlobalConsole:Ce.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:br(e):this.defaultGetItemFunction,this.setItem=r&&typeof r=="function"?this.isSetItemAsync?r:br(r):this.defaultSetItemFunction,this.parseLog=n&&typeof n=="function"?n:xo}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={...Io,...r};return wo(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=Ro(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=Oo(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=_o[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=Bo(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=No();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 Uo{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=Dr(JSON.stringify({...e,loggerSocketConnection:null})),this.lastLoginTimestamp&&this.lastLoginTimestamp+this.delay>new Date().getTime())return;this.updateLastLoginTimestamp(),await this.checkLoginStatus(this.storageKey)||(Rt.clearSessionStorage(),await this.userLoginFunction(r,this.storageKey,e.loginType))}updateLastLoginTimestamp(){this.lastLoginTimestamp=new Date().getTime()}async checkLoginStatus(e){const r=await Rt.getSessionStorageDataByKey(e);return r?(this.onLoginResponse(r),!0):!1}async userLoginFunction(e,r,n){let o,i,u;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}),this.onLoginResponse(u),await Rt.updateSessionStorageKey(r,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(bt.MAIN)),e.Token&&(this.token=e.Token,this.eventsSdkClass.connect(bt.MAIN)),e.RefreshToken&&e.IdentityCodeExpiry&&this.eventsSdkClass.options.loginType===ct.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)===ct.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 Rt.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===ct.TOKEN?u=JSON.stringify({identityType:ct.TOKEN,token:n}):u=JSON.stringify({identityType:ct.USER,username:o,password:r}):this.eventsSdkClass.options.loginType===ct.TOKEN?(u=JSON.stringify({token:n}),e=`${e}/${ct.TOKEN}`):(u=JSON.stringify({email:o,pin:r}),e=`${e}/${ct.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 ${ct} ${i===ct.TOKEN?{token:n}:{email:o,pin:r}}`,ActionName:pt.WSCONNECT,isShowClient:!1,Status:"External login error",StatusCode:400,Level:et.ERROR,LogType:ut.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:pt.WSCONNECT,isShowClient:!1,Status:"Get settings error",StatusCode:400,Level:et.ERROR,LogType:ut.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:pt.WSCONNECT,isShowClient:!1,Status:"Get settings error",StatusCode:400,Level:et.ERROR,LogType:ut.ERROR}),n}}normalizeLoginType(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}}const Do={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 Po(){return 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 b=new Error("Connection error");b.data=_,a(b)}else f.maybeReconnectOnOpen()});if(this._timeout!==!1){var w=this._timeout;c("connect attempt will timeout after %d",w);var I=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(I)}})}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"),b(),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 k=new Error("probe error");k.transport=S.name,C.emit("upgradeError",k)}}))}function y(){m||(m=!0,b(),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 I(){g("socket closed")}function _(E){S&&E.name!=S.name&&(h('"%s" works - aborting "%s"',E.name,S.name),y())}function b(){S.removeListener("open",f),S.removeListener("error",g),S.removeListener("close",w),C.removeListener("close",I),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",I),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(b){f.onError("jsonp polling iframe removal error",b)}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"),I=this.iframeId="eio_iframe_"+this.index;g.className="socketio",g.style.position="absolute",g.style.top="-1000px",g.style.left="-1000px",g.target=I,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
+ `),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 I=Array.prototype.slice.call(arguments);I[0]=r.coerce(I[0]),typeof I[0]!="string"&&(I=["%o"].concat(I));var _=0;I[0]=I[0].replace(/%([a-z%])/g,function(S,m){if(S==="%%")return S;_++;var C=r.formatters[m];if(typeof C=="function"){var E=I[_];S=C.call(y,E),I.splice(_,1),_--}return S}),typeof r.formatArgs=="function"&&(I=r.formatArgs.apply(y,I));var b=s.log||r.log||console.log.bind(console);b.apply(y,I)}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,k=new Uint8Array(v),T=new Uint8Array(1+v.byteLength);T[0]=I[m.type];for(var x=0;x<k.length;x++)T[x+1]=k[x];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]=I[m.type];var k=new S([v.buffer,m.data]);return E(k)}function d(m,C,E){for(var v=new Array(m.length),k=s(m.length,E),T=function(O,A,q){C(A,function(j,G){v[O]=G,q(j,v)})},x=0;x<m.length;x++)T(x,m[x],k)}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 I=r.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},_=c(I),b={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 k=m.data===void 0?void 0:m.data.buffer||m.data;if(n.ArrayBuffer&&k instanceof ArrayBuffer)return i(m,C,v);if(S&&k instanceof n.Blob)return h(m,C,v);if(k&&k.base64)return o(m,v);var T=I[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 k;try{k=String.fromCharCode.apply(null,new Uint8Array(m.data))}catch{for(var T=new Uint8Array(m.data),x=new Array(T.length),O=0;O<T.length;O++)x[O]=T[O];k=String.fromCharCode.apply(null,x)}return E+=n.btoa(k),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 b}var k=m.charAt(0);return Number(k)==k&&_[k]?m.length>1?{type:_[k],data:m.substring(1)}:{type:_[k]}:b}var v=new Uint8Array(m),k=v[0],T=p(m,1);return S&&C==="blob"&&(T=new S([T])),{type:_[k],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(x){return x.length+":"+x}function k(x,O){r.encodePacket(x,T?C:!1,!0,function(A){O(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,k,function(x,O){return E(O.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(b,0,1);for(var k,T,x="",O=0,A=m.length;A>O;O++){var q=m.charAt(O);if(q!=":")x+=q;else{if(x==""||x!=(k=Number(x))||(T=m.substr(O+1,k),x!=T.length))return E(b,0,1);if(T.length){if(v=r.decodePacket(T,C,!0),b.type==v.type&&b.data==v.data)return E(b,0,1);var j=E(v,O+k,A);if(j===!1)return}O+=k,x=""}}return x!=""?E(b,0,1):void 0},r.encodePayloadAsArrayBuffer=function(m,C){function E(v,k){r.encodePacket(v,!0,!0,function(T){return k(null,T)})}return m.length?void d(m,E,function(v,k){var T=k.reduce(function(A,q){var j;return j=typeof q=="string"?q.length:q.byteLength,A+j.toString().length+j+2},0),x=new Uint8Array(T),O=0;return k.forEach(function(A){var q=typeof A=="string",j=A;if(q){for(var G=new Uint8Array(A.length),K=0;K<A.length;K++)G[K]=A.charCodeAt(K);j=G.buffer}x[O++]=q?0:1;for(var nt=j.byteLength.toString(),K=0;K<nt.length;K++)x[O++]=parseInt(nt[K]);x[O++]=255;for(var G=new Uint8Array(j),K=0;K<G.length;K++)x[O++]=G[K]}),C(x.buffer)}):C(new ArrayBuffer(0))},r.encodePayloadAsBlob=function(m,C){function E(v,k){r.encodePacket(v,!0,!0,function(T){var x=new Uint8Array(1);if(x[0]=1,typeof T=="string"){for(var O=new Uint8Array(T.length),A=0;A<T.length;A++)O[A]=T.charCodeAt(A);T=O.buffer,x[0]=0}for(var q=T instanceof ArrayBuffer?T.byteLength:T.size,j=q.toString(),G=new Uint8Array(j.length+1),A=0;A<j.length;A++)G[A]=parseInt(j[A]);if(G[j.length]=255,S){var K=new S([x.buffer,G.buffer,T]);k(null,K)}})}d(m,E,function(v,k){return C(new S(k))})},r.decodePayloadAsBinary=function(m,C,E){typeof C=="function"&&(E=C,C=null);for(var v=m,k=[],T=!1;v.byteLength>0;){for(var x=new Uint8Array(v),O=x[0]===0,A="",q=1;x[q]!=255;q++){if(A.length>310){T=!0;break}A+=x[q]}if(T)return E(b,0,1);v=p(v,2+A.length),A=parseInt(A);var j=p(v,0,A);if(O)try{j=String.fromCharCode.apply(null,new Uint8Array(j))}catch{var G=new Uint8Array(j);j="";for(var q=0;q<G.length;q++)j+=String.fromCharCode(G[q])}k.push(j),v=p(v,A)}var K=k.length;k.forEach(function(nt,Ut){E(r.decodePacket(nt,C,!0),Ut,K)})}}).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 k,T,x=[],O=0,A=v.length;A>O;)k=v.charCodeAt(O++),k>=55296&&56319>=k&&A>O?(T=v.charCodeAt(O++),(64512&T)==56320?x.push(((1023&k)<<10)+(1023&T)+65536):(x.push(k),O--)):x.push(k);return x}function u(v){for(var k,T=v.length,x=-1,O="";++x<T;)k=v[x],k>65535&&(k-=65536,O+=b(k>>>10&1023|55296),k=56320|1023&k),O+=b(k);return O}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,k){return b(v>>k&63|128)}function c(v){if(!(4294967168&v))return b(v);var k="";return 4294965248&v?4294901760&v?!(4292870144&v)&&(k=b(v>>18&7|240),k+=d(v,12),k+=d(v,6)):(h(v),k=b(v>>12&15|224),k+=d(v,6)):k=b(v>>6&31|192),k+=b(63&v|128)}function l(v){for(var k,T=i(v),x=T.length,O=-1,A="";++O<x;)k=T[O],A+=c(k);return A}function p(){if(_>=I)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,k,T,x,O;if(_>I)throw Error("Invalid byte index");if(_==I)return!1;if(v=255&w[_],_++,(128&v)==0)return v;if((224&v)==192){var k=p();if(O=(31&v)<<6|k,O>=128)return O;throw Error("Invalid continuation byte")}if((240&v)==224){if(k=p(),T=p(),O=(15&v)<<12|k<<6|T,O>=2048)return h(O),O;throw Error("Invalid continuation byte")}if((248&v)==240&&(k=p(),T=p(),x=p(),O=(15&v)<<18|k<<12|T<<6|x,O>=65536&&1114111>=O))return O;throw Error("Invalid UTF-8 detected")}function s(v){w=i(v),I=w.length,_=0;for(var k,T=[];(k=a())!==!1;)T.push(k);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,I,_,b=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(I){var _=s.deconstructPacket(I),b=o(_.packet),S=_.buffers;S.unshift(b),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 I="";y.charAt(++w)!="-"&&(I+=y.charAt(w),w!=y.length););if(I!=Number(I)||y.charAt(w)!="-")throw new Error("Illegal attachments");g.attachments=Number(I)}if(y.charAt(w+1)=="/")for(g.nsp="";++w;){var _=y.charAt(w);if(_==","||(g.nsp+=_,w==y.length))break}else g.nsp="/";var b=y.charAt(w+1);if(b!==""&&Number(b)==b){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 B,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){(B=function(){return 1}).toJSON=B;try{D=N(0)==="0"&&N(new Number)==="0"&&N(new String)=='""'&&N(d)===h&&N(h)===h&&N()===h&&N(B)==="1"&&N([B])=="[1]"&&N([h])=="[null]"&&N(null)=="null"&&N([h,d,null])=="[null,null,null]"&&N({a:[B,!0,!1,null,`\0\b
9
+ \f\r `]})==F&&N(null,B)==="1"&&N([1,2],null,1)==`[
35
10
  1,
36
11
  2
37
- ]`&&P(new Date(-864e13))=='"-271821-04-20T00:00:00.000Z"'&&P(new Date(864e13))=='"+275760-09-13T00:00:00.000Z"'&&P(new Date(-621987552e5))=='"-000001-01-01T00:00:00.000Z"'&&P(new Date(-1))=='"1969-12-31T23:59:59.999Z"'}catch{Z=!1}}J=Z}if(q=="json-parse"){var tt=_.parse;if(typeof tt=="function")try{if(tt("0")===0&&!tt(!1)){F=tt(et);var z=F.a.length==5&&F.a[0]===1;if(z){try{z=!tt('" "')}catch{}if(z)try{z=tt("01")!==1}catch{}if(z)try{z=tt("1.")!==1}catch{}}}}catch{z=!1}J=z}}return u[q]=!!J}var f,m,g,S={}.toString,v=typeof JSON=="object"&&JSON,_=typeof n=="object"&&n&&!n.nodeType&&n;_&&v?(_.stringify=v.stringify,_.parse=v.parse):_=o.JSON=v||{};var y=new Date(-0xc782b5b800cec);try{y=y.getUTCFullYear()==-109252&&y.getUTCMonth()===0&&y.getUTCDate()===1&&y.getUTCHours()==10&&y.getUTCMinutes()==37&&y.getUTCSeconds()==6&&y.getUTCMilliseconds()==708}catch{}if(!u("json")){var l="[object Function]",h="[object Date]",b="[object Number]",A="[object String]",x="[object Array]",W="[object Boolean]",st=u("bug-string-char-index");if(!y)var V=Math.floor,ot=[0,31,59,90,120,151,181,212,243,273,304,334],H=function(q,J){return ot[J]+365*(q-1970)+V((q-1969+(J=+(J>1)))/4)-V((q-1901+J)/100)+V((q-1601+J)/400)};(f={}.hasOwnProperty)||(f=function(q){var J,F={};return(F.__proto__=null,F.__proto__={toString:1},F).toString!=S?f=function(et){var P=this.__proto__,Z=et in(this.__proto__=null,this);return this.__proto__=P,Z}:(J=F.constructor,f=function(et){var P=(this.constructor||J).prototype;return et in this&&!(et in P&&this[et]===P[et])}),F=null,f.call(this,q)});var D={boolean:1,number:1,string:1,undefined:1},M=function(q,J){var F=typeof q[J];return F=="object"?!!q[J]:!D[F]};if(m=function(q,J){var F,et,P,Z=0;(F=function(){this.valueOf=0}).prototype.valueOf=0,et=new F;for(P in et)f.call(et,P)&&Z++;return F=et=null,Z?m=Z==2?function(tt,z){var at,bt={},Jt=S.call(tt)==l;for(at in tt)Jt&&at=="prototype"||f.call(bt,at)||!(bt[at]=1)||!f.call(tt,at)||z(at)}:function(tt,z){var at,bt,Jt=S.call(tt)==l;for(at in tt)Jt&&at=="prototype"||!f.call(tt,at)||(bt=at==="constructor")||z(at);(bt||f.call(tt,at="constructor"))&&z(at)}:(et=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],m=function(tt,z){var at,bt,Jt=S.call(tt)==l,Ot=!Jt&&typeof tt.constructor!="function"&&M(tt,"hasOwnProperty")?tt.hasOwnProperty:f;for(at in tt)Jt&&at=="prototype"||!Ot.call(tt,at)||z(at);for(bt=et.length;at=et[--bt];Ot.call(tt,at)&&z(at));}),m(q,J)},!u("json-stringify")){var G={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},L="000000",U=function(q,J){return(L+(J||0)).slice(-q)},X="\\u00",Q=function(q){var J,F='"',et=0,P=q.length,Z=P>10&&st;for(Z&&(J=q.split(""));P>et;et++){var tt=q.charCodeAt(et);switch(tt){case 8:case 9:case 10:case 12:case 13:case 34:case 92:F+=G[tt];break;default:if(32>tt){F+=X+U(2,tt.toString(16));break}F+=Z?J[et]:st?q.charAt(et):q[et]}}return F+'"'},j=function(q,J,F,et,P,Z,tt){var z,at,bt,Jt,Ot,Ee,Fn,ue,mn,Mn,jt,Zt,Ne,Be,qn,Me;try{z=J[q]}catch{}if(typeof z=="object"&&z)if(at=S.call(z),at!=h||f.call(z,"toJSON"))typeof z.toJSON=="function"&&(at!=b&&at!=A&&at!=x||f.call(z,"toJSON"))&&(z=z.toJSON(q));else if(z>-1/0&&1/0>z){if(H){for(Ot=V(z/864e5),bt=V(Ot/365.2425)+1970-1;H(bt+1,0)<=Ot;bt++);for(Jt=V((Ot-H(bt,0))/30.42);H(bt,Jt+1)<=Ot;Jt++);Ot=1+Ot-H(bt,Jt),Ee=(z%864e5+864e5)%864e5,Fn=V(Ee/36e5)%24,ue=V(Ee/6e4)%60,mn=V(Ee/1e3)%60,Mn=Ee%1e3}else bt=z.getUTCFullYear(),Jt=z.getUTCMonth(),Ot=z.getUTCDate(),Fn=z.getUTCHours(),ue=z.getUTCMinutes(),mn=z.getUTCSeconds(),Mn=z.getUTCMilliseconds();z=(0>=bt||bt>=1e4?(0>bt?"-":"+")+U(6,0>bt?-bt:bt):U(4,bt))+"-"+U(2,Jt+1)+"-"+U(2,Ot)+"T"+U(2,Fn)+":"+U(2,ue)+":"+U(2,mn)+"."+U(3,Mn)+"Z"}else z=null;if(F&&(z=F.call(J,q,z)),z===null)return"null";if(at=S.call(z),at==W)return""+z;if(at==b)return z>-1/0&&1/0>z?""+z:"null";if(at==A)return Q(""+z);if(typeof z=="object"){for(Be=tt.length;Be--;)if(tt[Be]===z)throw TypeError();if(tt.push(z),jt=[],qn=Z,Z+=P,at==x){for(Ne=0,Be=z.length;Be>Ne;Ne++)Zt=j(Ne,z,F,et,P,Z,tt),jt.push(Zt===g?"null":Zt);Me=jt.length?P?`[
38
- `+Z+jt.join(`,
39
- `+Z)+`
40
- `+qn+"]":"["+jt.join(",")+"]":"[]"}else m(et||z,function(Wn){var Ve=j(Wn,z,F,et,P,Z,tt);Ve!==g&&jt.push(Q(Wn)+":"+(P?" ":"")+Ve)}),Me=jt.length?P?`{
41
- `+Z+jt.join(`,
42
- `+Z)+`
43
- `+qn+"}":"{"+jt.join(",")+"}":"{}";return tt.pop(),Me}};_.stringify=function(q,J,F){var et,P,Z,tt;if(typeof J=="function"||typeof J=="object"&&J){if((tt=S.call(J))==l)P=J;else if(tt==x){Z={};for(var z,at=0,bt=J.length;bt>at;z=J[at++],tt=S.call(z),(tt==A||tt==b)&&(Z[z]=1));}}if(F)if((tt=S.call(F))==b){if((F-=F%1)>0)for(et="",F>10&&(F=10);et.length<F;et+=" ");}else tt==A&&(et=F.length<=10?F:F.slice(0,10));return j("",(z={},z[""]=q,z),P,Z,et,"",[])}}if(!u("json-parse")){var B,kt,Et=String.fromCharCode,Rt={92:"\\",34:'"',47:"/",98:"\b",116:" ",110:`
44
- `,102:"\f",114:"\r"},ut=function(){throw B=kt=null,SyntaxError()},Xt=function(){for(var q,J,F,et,P,Z=kt,tt=Z.length;tt>B;)switch(P=Z.charCodeAt(B)){case 9:case 10:case 13:case 32:B++;break;case 123:case 125:case 91:case 93:case 58:case 44:return q=st?Z.charAt(B):Z[B],B++,q;case 34:for(q="@",B++;tt>B;)if(P=Z.charCodeAt(B),32>P)ut();else if(P==92)switch(P=Z.charCodeAt(++B)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:q+=Rt[P],B++;break;case 117:for(J=++B,F=B+4;F>B;B++)P=Z.charCodeAt(B),P>=48&&57>=P||P>=97&&102>=P||P>=65&&70>=P||ut();q+=Et("0x"+Z.slice(J,B));break;default:ut()}else{if(P==34)break;for(P=Z.charCodeAt(B),J=B;P>=32&&P!=92&&P!=34;)P=Z.charCodeAt(++B);q+=Z.slice(J,B)}if(Z.charCodeAt(B)==34)return B++,q;ut();default:if(J=B,P==45&&(et=!0,P=Z.charCodeAt(++B)),P>=48&&57>=P){for(P==48&&(P=Z.charCodeAt(B+1),P>=48&&57>=P)&&ut(),et=!1;tt>B&&(P=Z.charCodeAt(B),P>=48&&57>=P);B++);if(Z.charCodeAt(B)==46){for(F=++B;tt>F&&(P=Z.charCodeAt(F),P>=48&&57>=P);F++);F==B&&ut(),B=F}if(P=Z.charCodeAt(B),P==101||P==69){for(P=Z.charCodeAt(++B),(P==43||P==45)&&B++,F=B;tt>F&&(P=Z.charCodeAt(F),P>=48&&57>=P);F++);F==B&&ut(),B=F}return+Z.slice(J,B)}if(et&&ut(),Z.slice(B,B+4)=="true")return B+=4,!0;if(Z.slice(B,B+5)=="false")return B+=5,!1;if(Z.slice(B,B+4)=="null")return B+=4,null;ut()}return"$"},Le=function(q){var J,F;if(q=="$"&&ut(),typeof q=="string"){if((st?q.charAt(0):q[0])=="@")return q.slice(1);if(q=="["){for(J=[];q=Xt(),q!="]";F||(F=!0))F&&(q==","?(q=Xt(),q=="]"&&ut()):ut()),q==","&&ut(),J.push(Le(q));return J}if(q=="{"){for(J={};q=Xt(),q!="}";F||(F=!0))F&&(q==","?(q=Xt(),q=="}"&&ut()):ut()),(q==","||typeof q!="string"||(st?q.charAt(0):q[0])!="@"||Xt()!=":")&&ut(),J[q.slice(1)]=Le(Xt());return J}ut()}return q},ae=function(q,J,F){var et=pr(q,J,F);et===g?delete q[J]:q[J]=et},pr=function(q,J,F){var et,P=q[J];if(typeof P=="object"&&P)if(S.call(P)==x)for(et=P.length;et--;)ae(P,et,F);else m(P,function(Z){ae(P,Z,F)});return F.call(q,J,P)};_.parse=function(q,J){var F,et;return B=0,kt=""+q,F=Le(Xt()),Xt()!="$"&&ut(),B=kt=null,J&&S.call(J)==l?pr((et={},et[""]=F,et),"",J):F}}}})(this)},{}],48:[function(s,i){function n(o,u){var f=[];u=u||0;for(var m=u||0;m<o.length;m++)f[m-u]=o[m];return f}i.exports=n},{}]},{},[1])(1)}const lc=Object.assign({"./v1_3_7.js":Object.freeze(Object.defineProperty({__proto__:null,default:hc},Symbol.toStringTag,{value:"Module"}))}),pc=/v\d+_\d+_\d+/;function dc(s){return typeof s=="function"}const ri=Object.entries(lc).reduce((s,i)=>{var u;const n=i[1].default,o=(u=i[0].match(pc))==null?void 0:u[0];return dc(n)&&o&&(s[o]=n()),s},{}),zs=s=>{if(s in ri)return ri[s];throw new Error(`Socket version ${s} not found`)},gc={...ri,getSocketVersion:zs,makeSocketVersion:(s,...i)=>zs(s)(...i)};var Xs=(s=>(s.RINGING="Ringing",s.TALKING="Talking",s.DIALING="Dialing",s.HOLD="Hold",s))(Xs||{}),Js=(s=>(s.INCOMING="Incoming",s.OUTGOING="Outgoing",s))(Js||{}),Vs=(s=>(s.AUTOMATIC="Automatic",s.IVR="IVR",s))(Vs||{}),Ys=(s=>(s.INCOMINC="Incoming",s.OUTGOING="Outgoing",s.SPY="Spy",s.CLICK2CALL="Click2Call",s))(Ys||{}),js=(s=>(s.RESPONSE_FROM_API_VALID="RESPONSE_FROM_API_VALID",s.RESPONSE_FROM_API_INVALID="RESPONSE_FROM_API_INVALID",s))(js||{}),ht=(s=>(s.ALL_DIALER_STATUS="AllDialersStatus",s.ALL_EXTENSION_STATUS="AllExtensionsStatus",s.ALL_USERS_STATUS="AllUsersStatus",s.CONNECT="connect",s.DISCONNECT="disconnect",s.CONNECT_ERROR_EVENT="connect_error",s.EXTENSION_EVENT="ExtensionEvent",s.KEEP_ALIVE="keepalive",s.KEEP_ALIVE_RESPONSE="keepaliveResponse",s.LOGIN_STATUS="loginStatus",s.LOGIN_SUCCESS="loginSuccess",s.QUEUE_EVENT="QueueEvent",s.ONLINE_STATUS_EVENT="onlineStatusEvent",s.DIALER_EVENT="DialerEvent",s.EXTENSIONS_UPDATED="ExtensionsUpdated",s))(ht||{}),ii=(s=>(s.NEWCALL="NEWCALL",s.ANSWER="ANSWER",s.HOLD="HOLD",s.UNHOLD="UNHOLD",s.HANGUP="HANGUP",s.USER_STATUS_UPDATE="userStatusUpdate",s))(ii||{}),Zs=(s=>(s.NORMAL_HANGUP="Normal hangup",s.USER_BUSY="User busy",s.CALL_REJECTED="Call Rejected",s.UNALLOCATED_NUMBER="Unallocated (unassigned) number",s.UNKNOWN="Unknown",s.NO_USER_RESPONDING="No user responding",s.USER_ALERTING="User alerting, no answer",s.ANSWERED_ELSEWHERE="Answered elsewhere",s))(Zs||{}),Qs=(s=>(s.ANSWER="ANSWER",s.ABANDONED="ABANDONED",s.EXIT="EXIT",s.JOIN="JOIN",s))(Qs||{});class to{static mapExtensionEvent(i){var m,g;const n=i.reason;let o,u;i.data.currentCall&&(u=this.mapExtensionCall(i,i.data.currentCall));const f=this.mapExtensionData(i,i.data);return n===ii.HANGUP?o={...i,reason:n,data:{...f,currentCall:u?{...u,duration:Date.now()-((u==null?void 0:u.callAnswered_UTC_CLIENT)??0)}:void 0,calls:(m=i.data.calls)==null?void 0:m.map(S=>{const v=this.mapExtensionCall(i,S);return{...v,duration:Date.now()-(v.callAnswered_UTC_CLIENT??0)}})}}:o={...i,data:{...f,currentCall:u,calls:(g=i.data.calls)==null?void 0:g.map(S=>this.mapExtensionCall(i,S))},reason:n},o}static mapAllExtensionStatus(i){return{...i,extensions:i.extensions.map(n=>{var o;return{...this.mapExtensionData(i,n),currentCall:n.currentCall?this.mapExtensionCall(i,n.currentCall):void 0,calls:(o=n.calls)==null?void 0:o.map(u=>this.mapExtensionCall(i,u))}})}}static mapExtensionData(i,n){return this.configureUTCForObject(n,[{key:"lastAnsweredCallEventEpoch",format:"sec"},{key:"lastCallEventEpoch",format:"sec"},{key:"lastHangupCallEpoch",format:"sec"},{key:"representativeUpdated",format:"ms"}],i.servertime,i.servertimeoffset)}static mapExtensionCall(i,n){return this.configureUTCForObject(n,[{key:"callAnswered",format:"sec"},{key:"callStarted",format:"sec"}],i.servertime,i.servertimeoffset)}static assignProperty(i,n,o){i[n]=o}static configureUTCForObject(i,n,o,u){const f=(o-u*60)*1e3,m=Date.now()-f,g={};return n.forEach(S=>{const v=i[S.key],_=S.key;if(v!==0&&typeof v=="number"&&!isNaN(v)){let y=v;S.format==="ms"&&(y=Math.floor(y/1e3));const l=(y-u*60)*1e3;this.assignProperty(g,`${_}_UTC`,l),this.assignProperty(g,`${_}_UTC_CLIENT`,l+m)}else this.assignProperty(g,`${_}_UTC`,0),this.assignProperty(g,`${_}_UTC_CLIENT`,0)}),{...i,...g}}}var si=(s=>(s.UPDATE_MONITORED_EXTENSIONS="updateMonitoredExtensions",s.KEEP_ALIVE="keepAlive",s))(si||{});class vc{constructor(i){wt(this,"io");wt(this,"ioFunction");wt(this,"lastEventTimestamp",new Date().getTime());wt(this,"doReconnect",!0);wt(this,"keepAliveInterval");wt(this,"keepReconnectInterval");wt(this,"connected",!1);this.eventsSdkClass=i,this.eventsSdkClass=i}getSocketIoFunction(i){const n=i.split("v="),o="v".concat(n[n.length-1]).replaceAll(".","_");this.ioFunction=gc.getSocketVersion(o)}initSocketConnection(){const i=this.eventsSdkClass.authClass.token,n=this.eventsSdkClass.options.protocol,o=this.eventsSdkClass.server;try{const u=o?o.Domain:this.eventsSdkClass.URL,f=o?`${n}://${u}`:this.eventsSdkClass.URL;this.eventsSdkClass.loggerClass.log(zt.INFO,"Connecting to..",f),this.eventsSdkClass.eventEmitterClass.emit(ht.ONLINE_STATUS_EVENT,{isSocketConnected:!1,attemptToConnect:f,doReconnect:this.doReconnect});const m={reconnection:!1,upgrade:!1,transports:["websocket"],forceNew:!0,query:{token:i},timeout:this.eventsSdkClass.options.timeout};if(i&&(m.query={token:i}),this.ioFunction&&f)this.io=this.ioFunction(f,m);else throw new Error("Socket server url no defined")}catch(u){this.eventsSdkClass.loggerClass.log(zt.ERROR,"init socket connection error",u)}}clearKeepAliveInterval(){this.keepAliveInterval&&clearInterval(this.keepAliveInterval)}initKeepAlive(){this.clearKeepAliveInterval(),this.keepAliveInterval=setInterval(async()=>{if(new Date().getTime()>this.lastEventTimestamp+this.eventsSdkClass.options.keepAliveTimeout&&this.io&&this.eventsSdkClass.authClass.token){this.eventsSdkClass.emit(si.KEEP_ALIVE,this.eventsSdkClass.authClass.token),this.eventsSdkClass.loggerClass.log(zt.INFO,`EMIT -> ${ht.KEEP_ALIVE}`,this.eventsSdkClass.authClass.token);return}},this.eventsSdkClass.options.keepAliveTimeout)}closeAllConnections(){var i;this.io&&(this.io.close(),(i=this.io)==null||i.disconnect(),this.io=void 0),Un.clearSessionStorage()}initSocketEvents(){this.io&&this.io.on(ht.LOGIN_SUCCESS,i=>this.onLoginSuccessEvent(i)).on(ht.QUEUE_EVENT,i=>this.onQueueEvent(i)).on(ht.EXTENSION_EVENT,i=>this.onExtensionEvent(i)).on(ht.DIALER_EVENT,i=>this.onDialerEvent(i)).on(ht.LOGIN_STATUS,i=>this.onLoginStatusEvent(i)).on(ht.ALL_EXTENSION_STATUS,i=>this.onAllExtensionStatus(i)).on(ht.ALL_DIALER_STATUS,i=>this.onAllDialerStatus(i)).on(ht.KEEP_ALIVE_RESPONSE,i=>this.onKeepAliveResponse(i)).on(ht.EXTENSIONS_UPDATED,i=>this.onExtensionsUpdatedEvent(i)).on(ht.CONNECT,()=>this.onConnect()).on(ht.DISCONNECT,i=>this.onDisconnect(i)).on(ht.CONNECT_ERROR_EVENT,i=>this.onConnectError(i))}onLoginSuccessEvent(i){this.eventsSdkClass.eventEmitterClass.emit(ht.LOGIN_SUCCESS,i)}onQueueEvent(i){this.eventsSdkClass.eventEmitterClass.emit(ht.QUEUE_EVENT,i)}onExtensionEvent(i){const n=to.mapExtensionEvent(i);n&&this.eventsSdkClass.eventEmitterClass.emit(ht.EXTENSION_EVENT,n)}onDialerEvent(i){this.eventsSdkClass.eventEmitterClass.emit(ht.DIALER_EVENT,i)}onLoginStatusEvent(i){this.eventsSdkClass.eventEmitterClass.emit(ht.LOGIN_STATUS,i)}onAllExtensionStatus(i){const n=to.mapAllExtensionStatus(i);this.eventsSdkClass.eventEmitterClass.emit(ht.ALL_EXTENSION_STATUS,n)}onAllDialerStatus(i){this.eventsSdkClass.eventEmitterClass.emit(ht.ALL_DIALER_STATUS,i)}onKeepAliveResponse(i){if(this.eventsSdkClass.loggerClass.log(zt.INFO,ht.KEEP_ALIVE_RESPONSE),i.errorCode){this.initSocketConnection();return}this.connected?this.lastEventTimestamp=new Date().getTime():this.initSocketConnection()}onExtensionsUpdatedEvent(i){this.eventsSdkClass.eventEmitterClass.emit(ht.EXTENSIONS_UPDATED,i)}onConnect(){this.keepReconnectInterval&&clearInterval(this.keepReconnectInterval),this.connected=!0,this.eventsSdkClass.loggerClass.log(zt.INFO,ht.CONNECT,this.eventsSdkClass.reconnectOptions),this.eventsSdkClass.eventEmitterClass.emit(ht.ONLINE_STATUS_EVENT,{isSocketConnected:!0,doReconnect:this.doReconnect})}onDisconnect(i){this.connected=!1,this.eventsSdkClass.loggerClass.log(zt.INFO,ht.DISCONNECT,i),this.closeAllConnections(),this.eventsSdkClass.eventEmitterClass.emit(ht.ONLINE_STATUS_EVENT,{isSocketConnected:!1,doReconnect:this.doReconnect}),this.doReconnect&&(console.log("attempt to connect..."),this.eventsSdkClass.connect(an.NEXT))}onConnectError(i){this.eventsSdkClass.eventEmitterClass.emit(ht.ONLINE_STATUS_EVENT,{isSocketConnected:!1,doReconnect:this.doReconnect}),this.eventsSdkClass.loggerClass.log(zt.ERROR,ht.CONNECT_ERROR_EVENT,i),setTimeout(()=>{this.eventsSdkClass.connect(an.NEXT)},this.eventsSdkClass.options.reconnectionDelay)}}var yc=Object.defineProperty,mc=(s,i,n)=>i in s?yc(s,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[i]=n,qt=(s,i,n)=>(mc(s,typeof i!="symbol"?i+"":i,n),n);const Oe=Object.create(null);Oe.open="0",Oe.close="1",Oe.ping="2",Oe.pong="3",Oe.message="4",Oe.upgrade="5",Oe.noop="6";const ir=Object.create(null);Object.keys(Oe).forEach(s=>{ir[Oe[s]]=s});const oi={type:"error",data:"parser error"},eo=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",no=typeof ArrayBuffer=="function",ro=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer,ai=({type:s,data:i},n,o)=>eo&&i instanceof Blob?n?o(i):io(i,o):no&&(i instanceof ArrayBuffer||ro(i))?n?o(i):io(new Blob([i]),o):o(Oe[s]+(i||"")),io=(s,i)=>{const n=new FileReader;return n.onload=function(){const o=n.result.split(",")[1];i("b"+(o||""))},n.readAsDataURL(s)};function so(s){return s instanceof Uint8Array?s:s instanceof ArrayBuffer?new Uint8Array(s):new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}let ui;function _c(s,i){if(eo&&s.data instanceof Blob)return s.data.arrayBuffer().then(so).then(i);if(no&&(s.data instanceof ArrayBuffer||ro(s.data)))return i(so(s.data));ai(s,!1,n=>{ui||(ui=new TextEncoder),i(ui.encode(n))})}const oo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Dn=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let s=0;s<oo.length;s++)Dn[oo.charCodeAt(s)]=s;const wc=s=>{let i=s.length*.75,n=s.length,o,u=0,f,m,g,S;s[s.length-1]==="="&&(i--,s[s.length-2]==="="&&i--);const v=new ArrayBuffer(i),_=new Uint8Array(v);for(o=0;o<n;o+=4)f=Dn[s.charCodeAt(o)],m=Dn[s.charCodeAt(o+1)],g=Dn[s.charCodeAt(o+2)],S=Dn[s.charCodeAt(o+3)],_[u++]=f<<2|m>>4,_[u++]=(m&15)<<4|g>>2,_[u++]=(g&3)<<6|S&63;return v},bc=typeof ArrayBuffer=="function",ci=(s,i)=>{if(typeof s!="string")return{type:"message",data:ao(s,i)};const n=s.charAt(0);return n==="b"?{type:"message",data:Sc(s.substring(1),i)}:ir[n]?s.length>1?{type:ir[n],data:s.substring(1)}:{type:ir[n]}:oi},Sc=(s,i)=>{if(bc){const n=wc(s);return ao(n,i)}else return{base64:!0,data:s}},ao=(s,i)=>{switch(i){case"blob":return s instanceof Blob?s:new Blob([s]);case"arraybuffer":default:return s instanceof ArrayBuffer?s:s.buffer}},uo="",Cc=(s,i)=>{const n=s.length,o=new Array(n);let u=0;s.forEach((f,m)=>{ai(f,!1,g=>{o[m]=g,++u===n&&i(o.join(uo))})})},kc=(s,i)=>{const n=s.split(uo),o=[];for(let u=0;u<n.length;u++){const f=ci(n[u],i);if(o.push(f),f.type==="error")break}return o};function Ec(){return new TransformStream({transform(s,i){_c(s,n=>{const o=n.length;let u;if(o<126)u=new Uint8Array(1),new DataView(u.buffer).setUint8(0,o);else if(o<65536){u=new Uint8Array(3);const f=new DataView(u.buffer);f.setUint8(0,126),f.setUint16(1,o)}else{u=new Uint8Array(9);const f=new DataView(u.buffer);f.setUint8(0,127),f.setBigUint64(1,BigInt(o))}s.data&&typeof s.data!="string"&&(u[0]|=128),i.enqueue(u),i.enqueue(n)})}})}let fi;function sr(s){return s.reduce((i,n)=>i+n.length,0)}function or(s,i){if(s[0].length===i)return s.shift();const n=new Uint8Array(i);let o=0;for(let u=0;u<i;u++)n[u]=s[0][o++],o===s[0].length&&(s.shift(),o=0);return s.length&&o<s[0].length&&(s[0]=s[0].slice(o)),n}function Ac(s,i){fi||(fi=new TextDecoder);const n=[];let o=0,u=-1,f=!1;return new TransformStream({transform(m,g){for(n.push(m);;){if(o===0){if(sr(n)<1)break;const S=or(n,1);f=(S[0]&128)===128,u=S[0]&127,u<126?o=3:u===126?o=1:o=2}else if(o===1){if(sr(n)<2)break;const S=or(n,2);u=new DataView(S.buffer,S.byteOffset,S.length).getUint16(0),o=3}else if(o===2){if(sr(n)<8)break;const S=or(n,8),v=new DataView(S.buffer,S.byteOffset,S.length),_=v.getUint32(0);if(_>Math.pow(2,21)-1){g.enqueue(oi);break}u=_*Math.pow(2,32)+v.getUint32(4),o=3}else{if(sr(n)<u)break;const S=or(n,u);g.enqueue(ci(f?S:fi.decode(S),i)),o=0}if(u===0||u>s){g.enqueue(oi);break}}}})}const co=4;function Pt(s){if(s)return Tc(s)}function Tc(s){for(var i in Pt.prototype)s[i]=Pt.prototype[i];return s}Pt.prototype.on=Pt.prototype.addEventListener=function(s,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+s]=this._callbacks["$"+s]||[]).push(i),this},Pt.prototype.once=function(s,i){function n(){this.off(s,n),i.apply(this,arguments)}return n.fn=i,this.on(s,n),this},Pt.prototype.off=Pt.prototype.removeListener=Pt.prototype.removeAllListeners=Pt.prototype.removeEventListener=function(s,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+s];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+s],this;for(var o,u=0;u<n.length;u++)if(o=n[u],o===i||o.fn===i){n.splice(u,1);break}return n.length===0&&delete this._callbacks["$"+s],this},Pt.prototype.emit=function(s){this._callbacks=this._callbacks||{};for(var i=new Array(arguments.length-1),n=this._callbacks["$"+s],o=1;o<arguments.length;o++)i[o-1]=arguments[o];if(n){n=n.slice(0);for(var o=0,u=n.length;o<u;++o)n[o].apply(this,i)}return this},Pt.prototype.emitReserved=Pt.prototype.emit,Pt.prototype.listeners=function(s){return this._callbacks=this._callbacks||{},this._callbacks["$"+s]||[]},Pt.prototype.hasListeners=function(s){return!!this.listeners(s).length};const ge=typeof self<"u"?self:typeof window<"u"?window:Function("return this")();function fo(s,...i){return i.reduce((n,o)=>(s.hasOwnProperty(o)&&(n[o]=s[o]),n),{})}const xc=ge.setTimeout,Rc=ge.clearTimeout;function ar(s,i){i.useNativeTimers?(s.setTimeoutFn=xc.bind(ge),s.clearTimeoutFn=Rc.bind(ge)):(s.setTimeoutFn=ge.setTimeout.bind(ge),s.clearTimeoutFn=ge.clearTimeout.bind(ge))}const Oc=1.33;function Ic(s){return typeof s=="string"?Lc(s):Math.ceil((s.byteLength||s.size)*Oc)}function Lc(s){let i=0,n=0;for(let o=0,u=s.length;o<u;o++)i=s.charCodeAt(o),i<128?n+=1:i<2048?n+=2:i<55296||i>=57344?n+=3:(o++,n+=4);return n}function Nc(s){let i="";for(let n in s)s.hasOwnProperty(n)&&(i.length&&(i+="&"),i+=encodeURIComponent(n)+"="+encodeURIComponent(s[n]));return i}function Bc(s){let i={},n=s.split("&");for(let o=0,u=n.length;o<u;o++){let f=n[o].split("=");i[decodeURIComponent(f[0])]=decodeURIComponent(f[1])}return i}class Uc extends Error{constructor(i,n,o){super(i),this.description=n,this.context=o,this.type="TransportError"}}class hi extends Pt{constructor(i){super(),this.writable=!1,ar(this,i),this.opts=i,this.query=i.query,this.socket=i.socket}onError(i,n,o){return super.emitReserved("error",new Uc(i,n,o)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(i){this.readyState==="open"&&this.write(i)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(i){const n=ci(i,this.socket.binaryType);this.onPacket(n)}onPacket(i){super.emitReserved("packet",i)}onClose(i){this.readyState="closed",super.emitReserved("close",i)}pause(i){}createUri(i,n={}){return i+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const i=this.opts.hostname;return i.indexOf(":")===-1?i:"["+i+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(i){const n=Nc(i);return n.length?"?"+n:""}}const ho="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),li=64,Dc={};let lo=0,ur=0,po;function go(s){let i="";do i=ho[s%li]+i,s=Math.floor(s/li);while(s>0);return i}function vo(){const s=go(+new Date);return s!==po?(lo=0,po=s):s+"."+go(lo++)}for(;ur<li;ur++)Dc[ho[ur]]=ur;let yo=!1;try{yo=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Pc=yo;function mo(s){const i=s.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!i||Pc))return new XMLHttpRequest}catch{}if(!i)try{return new ge[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function Fc(){}const Mc=function(){return new mo({xdomain:!1}).responseType!=null}();class qc extends hi{constructor(i){if(super(i),this.polling=!1,typeof location<"u"){const o=location.protocol==="https:";let u=location.port;u||(u=o?"443":"80"),this.xd=typeof location<"u"&&i.hostname!==location.hostname||u!==i.port}const n=i&&i.forceBase64;this.supportsBinary=Mc&&!n,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(i){this.readyState="pausing";const n=()=>{this.readyState="paused",i()};if(this.polling||!this.writable){let o=0;this.polling&&(o++,this.once("pollComplete",function(){--o||n()})),this.writable||(o++,this.once("drain",function(){--o||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(i){const n=o=>{if(this.readyState==="opening"&&o.type==="open"&&this.onOpen(),o.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(o)};kc(i,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const i=()=>{this.write([{type:"close"}])};this.readyState==="open"?i():this.once("open",i)}write(i){this.writable=!1,Cc(i,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const i=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=vo()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(i,n)}request(i={}){return Object.assign(i,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Ie(this.uri(),i)}doWrite(i,n){const o=this.request({method:"POST",data:i});o.on("success",n),o.on("error",(u,f)=>{this.onError("xhr post error",u,f)})}doPoll(){const i=this.request();i.on("data",this.onData.bind(this)),i.on("error",(n,o)=>{this.onError("xhr poll error",n,o)}),this.pollXhr=i}}class Ie extends Pt{constructor(i,n){super(),ar(this,n),this.opts=n,this.method=n.method||"GET",this.uri=i,this.data=n.data!==void 0?n.data:null,this.create()}create(){var i;const n=fo(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const o=this.xhr=new mo(n);try{o.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){o.setDisableHeaderCheck&&o.setDisableHeaderCheck(!0);for(let u in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(u)&&o.setRequestHeader(u,this.opts.extraHeaders[u])}}catch{}if(this.method==="POST")try{o.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{o.setRequestHeader("Accept","*/*")}catch{}(i=this.opts.cookieJar)===null||i===void 0||i.addCookies(o),"withCredentials"in o&&(o.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(o.timeout=this.opts.requestTimeout),o.onreadystatechange=()=>{var u;o.readyState===3&&((u=this.opts.cookieJar)===null||u===void 0||u.parseCookies(o)),o.readyState===4&&(o.status===200||o.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof o.status=="number"?o.status:0)},0))},o.send(this.data)}catch(u){this.setTimeoutFn(()=>{this.onError(u)},0);return}typeof document<"u"&&(this.index=Ie.requestsCount++,Ie.requests[this.index]=this)}onError(i){this.emitReserved("error",i,this.xhr),this.cleanup(!0)}cleanup(i){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=Fc,i)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Ie.requests[this.index],this.xhr=null}}onLoad(){const i=this.xhr.responseText;i!==null&&(this.emitReserved("data",i),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(Ie.requestsCount=0,Ie.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",_o);else if(typeof addEventListener=="function"){const s="onpagehide"in ge?"pagehide":"unload";addEventListener(s,_o,!1)}}function _o(){for(let s in Ie.requests)Ie.requests.hasOwnProperty(s)&&Ie.requests[s].abort()}const pi=typeof Promise=="function"&&typeof Promise.resolve=="function"?s=>Promise.resolve().then(s):(s,i)=>i(s,0),cr=ge.WebSocket||ge.MozWebSocket,wo=!0,Wc="arraybuffer",bo=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Kc extends hi{constructor(i){super(i),this.supportsBinary=!i.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const i=this.uri(),n=this.opts.protocols,o=bo?{}:fo(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(o.headers=this.opts.extraHeaders);try{this.ws=wo&&!bo?n?new cr(i,n):new cr(i):new cr(i,n,o)}catch(u){return this.emitReserved("error",u)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=i=>this.onClose({description:"websocket connection closed",context:i}),this.ws.onmessage=i=>this.onData(i.data),this.ws.onerror=i=>this.onError("websocket error",i)}write(i){this.writable=!1;for(let n=0;n<i.length;n++){const o=i[n],u=n===i.length-1;ai(o,this.supportsBinary,f=>{try{wo&&this.ws.send(f)}catch{}u&&pi(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const i=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=vo()),this.supportsBinary||(n.b64=1),this.createUri(i,n)}check(){return!!cr}}class Gc extends hi{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(i=>{this.onError("webtransport error",i)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(i=>{const n=Ac(Number.MAX_SAFE_INTEGER,this.socket.binaryType),o=i.readable.pipeThrough(n).getReader(),u=Ec();u.readable.pipeTo(i.writable),this.writer=u.writable.getWriter();const f=()=>{o.read().then(({done:g,value:S})=>{g||(this.onPacket(S),f())}).catch(g=>{})};f();const m={type:"open"};this.query.sid&&(m.data=`{"sid":"${this.query.sid}"}`),this.writer.write(m).then(()=>this.onOpen())})}))}write(i){this.writable=!1;for(let n=0;n<i.length;n++){const o=i[n],u=n===i.length-1;this.writer.write(o).then(()=>{u&&pi(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var i;(i=this.transport)===null||i===void 0||i.close()}}const Hc={websocket:Kc,webtransport:Gc,polling:qc},$c=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,zc=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function di(s){if(s.length>2e3)throw"URI too long";const i=s,n=s.indexOf("["),o=s.indexOf("]");n!=-1&&o!=-1&&(s=s.substring(0,n)+s.substring(n,o).replace(/:/g,";")+s.substring(o,s.length));let u=$c.exec(s||""),f={},m=14;for(;m--;)f[zc[m]]=u[m]||"";return n!=-1&&o!=-1&&(f.source=i,f.host=f.host.substring(1,f.host.length-1).replace(/;/g,":"),f.authority=f.authority.replace("[","").replace("]","").replace(/;/g,":"),f.ipv6uri=!0),f.pathNames=Xc(f,f.path),f.queryKey=Jc(f,f.query),f}function Xc(s,i){const n=/\/{2,9}/g,o=i.replace(n,"/").split("/");return(i.slice(0,1)=="/"||i.length===0)&&o.splice(0,1),i.slice(-1)=="/"&&o.splice(o.length-1,1),o}function Jc(s,i){const n={};return i.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(o,u,f){u&&(n[u]=f)}),n}let So=class Bn extends Pt{constructor(i,n={}){super(),this.binaryType=Wc,this.writeBuffer=[],i&&typeof i=="object"&&(n=i,i=null),i?(i=di(i),n.hostname=i.host,n.secure=i.protocol==="https"||i.protocol==="wss",n.port=i.port,i.query&&(n.query=i.query)):n.host&&(n.hostname=di(n.host).host),ar(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Bc(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(i){const n=Object.assign({},this.opts.query);n.EIO=co,n.transport=i,this.id&&(n.sid=this.id);const o=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[i]);return new Hc[i](o)}open(){let i;if(this.opts.rememberUpgrade&&Bn.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)i="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else i=this.transports[0];this.readyState="opening";try{i=this.createTransport(i)}catch{this.transports.shift(),this.open();return}i.open(),this.setTransport(i)}setTransport(i){this.transport&&this.transport.removeAllListeners(),this.transport=i,i.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(i){let n=this.createTransport(i),o=!1;Bn.priorWebsocketSuccess=!1;const u=()=>{o||(n.send([{type:"ping",data:"probe"}]),n.once("packet",y=>{if(!o)if(y.type==="pong"&&y.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Bn.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{o||this.readyState!=="closed"&&(_(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const l=new Error("probe error");l.transport=n.name,this.emitReserved("upgradeError",l)}}))};function f(){o||(o=!0,_(),n.close(),n=null)}const m=y=>{const l=new Error("probe error: "+y);l.transport=n.name,f(),this.emitReserved("upgradeError",l)};function g(){m("transport closed")}function S(){m("socket closed")}function v(y){n&&y.name!==n.name&&f()}const _=()=>{n.removeListener("open",u),n.removeListener("error",m),n.removeListener("close",g),this.off("close",S),this.off("upgrading",v)};n.once("open",u),n.once("error",m),n.once("close",g),this.once("close",S),this.once("upgrading",v),this.upgrades.indexOf("webtransport")!==-1&&i!=="webtransport"?this.setTimeoutFn(()=>{o||n.open()},200):n.open()}onOpen(){if(this.readyState="open",Bn.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let i=0;const n=this.upgrades.length;for(;i<n;i++)this.probe(this.upgrades[i])}}onPacket(i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",i),this.emitReserved("heartbeat"),this.resetPingTimeout(),i.type){case"open":this.onHandshake(JSON.parse(i.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=i.data,this.onError(n);break;case"message":this.emitReserved("data",i.data),this.emitReserved("message",i.data);break}}onHandshake(i){this.emitReserved("handshake",i),this.id=i.sid,this.transport.query.sid=i.sid,this.upgrades=this.filterUpgrades(i.upgrades),this.pingInterval=i.pingInterval,this.pingTimeout=i.pingTimeout,this.maxPayload=i.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const i=this.getWritablePackets();this.transport.send(i),this.prevBufferLen=i.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let i=1;for(let n=0;n<this.writeBuffer.length;n++){const o=this.writeBuffer[n].data;if(o&&(i+=Ic(o)),n>0&&i>this.maxPayload)return this.writeBuffer.slice(0,n);i+=2}return this.writeBuffer}write(i,n,o){return this.sendPacket("message",i,n,o),this}send(i,n,o){return this.sendPacket("message",i,n,o),this}sendPacket(i,n,o,u){if(typeof n=="function"&&(u=n,n=void 0),typeof o=="function"&&(u=o,o=null),this.readyState==="closing"||this.readyState==="closed")return;o=o||{},o.compress=o.compress!==!1;const f={type:i,data:n,options:o};this.emitReserved("packetCreate",f),this.writeBuffer.push(f),u&&this.once("flush",u),this.flush()}close(){const i=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),i()},o=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?o():i()}):this.upgrading?o():i()),this}onError(i){Bn.priorWebsocketSuccess=!1,this.emitReserved("error",i),this.onClose("transport error",i)}onClose(i,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",i,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(i){const n=[];let o=0;const u=i.length;for(;o<u;o++)~this.transports.indexOf(i[o])&&n.push(i[o]);return n}};So.protocol=co;function Vc(s,i="",n){let o=s;n=n||typeof location<"u"&&location,s==null&&(s=n.protocol+"//"+n.host),typeof s=="string"&&(s.charAt(0)==="/"&&(s.charAt(1)==="/"?s=n.protocol+s:s=n.host+s),/^(https?|wss?):\/\//.test(s)||(typeof n<"u"?s=n.protocol+"//"+s:s="https://"+s),o=di(s)),o.port||(/^(http|ws)$/.test(o.protocol)?o.port="80":/^(http|ws)s$/.test(o.protocol)&&(o.port="443")),o.path=o.path||"/";const u=o.host.indexOf(":")!==-1?"["+o.host+"]":o.host;return o.id=o.protocol+"://"+u+":"+o.port+i,o.href=o.protocol+"://"+u+(n&&n.port===o.port?"":":"+o.port),o}const Yc=typeof ArrayBuffer=="function",jc=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s.buffer instanceof ArrayBuffer,Co=Object.prototype.toString,Zc=typeof Blob=="function"||typeof Blob<"u"&&Co.call(Blob)==="[object BlobConstructor]",Qc=typeof File=="function"||typeof File<"u"&&Co.call(File)==="[object FileConstructor]";function gi(s){return Yc&&(s instanceof ArrayBuffer||jc(s))||Zc&&s instanceof Blob||Qc&&s instanceof File}function fr(s,i){if(!s||typeof s!="object")return!1;if(Array.isArray(s)){for(let n=0,o=s.length;n<o;n++)if(fr(s[n]))return!0;return!1}if(gi(s))return!0;if(s.toJSON&&typeof s.toJSON=="function"&&arguments.length===1)return fr(s.toJSON(),!0);for(const n in s)if(Object.prototype.hasOwnProperty.call(s,n)&&fr(s[n]))return!0;return!1}function tf(s){const i=[],n=s.data,o=s;return o.data=vi(n,i),o.attachments=i.length,{packet:o,buffers:i}}function vi(s,i){if(!s)return s;if(gi(s)){const n={_placeholder:!0,num:i.length};return i.push(s),n}else if(Array.isArray(s)){const n=new Array(s.length);for(let o=0;o<s.length;o++)n[o]=vi(s[o],i);return n}else if(typeof s=="object"&&!(s instanceof Date)){const n={};for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&(n[o]=vi(s[o],i));return n}return s}function ef(s,i){return s.data=yi(s.data,i),delete s.attachments,s}function yi(s,i){if(!s)return s;if(s&&s._placeholder===!0){if(typeof s.num=="number"&&s.num>=0&&s.num<i.length)return i[s.num];throw new Error("illegal attachments")}else if(Array.isArray(s))for(let n=0;n<s.length;n++)s[n]=yi(s[n],i);else if(typeof s=="object")for(const n in s)Object.prototype.hasOwnProperty.call(s,n)&&(s[n]=yi(s[n],i));return s}const nf=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],rf=5;var yt;(function(s){s[s.CONNECT=0]="CONNECT",s[s.DISCONNECT=1]="DISCONNECT",s[s.EVENT=2]="EVENT",s[s.ACK=3]="ACK",s[s.CONNECT_ERROR=4]="CONNECT_ERROR",s[s.BINARY_EVENT=5]="BINARY_EVENT",s[s.BINARY_ACK=6]="BINARY_ACK"})(yt||(yt={}));class sf{constructor(i){this.replacer=i}encode(i){return(i.type===yt.EVENT||i.type===yt.ACK)&&fr(i)?this.encodeAsBinary({type:i.type===yt.EVENT?yt.BINARY_EVENT:yt.BINARY_ACK,nsp:i.nsp,data:i.data,id:i.id}):[this.encodeAsString(i)]}encodeAsString(i){let n=""+i.type;return(i.type===yt.BINARY_EVENT||i.type===yt.BINARY_ACK)&&(n+=i.attachments+"-"),i.nsp&&i.nsp!=="/"&&(n+=i.nsp+","),i.id!=null&&(n+=i.id),i.data!=null&&(n+=JSON.stringify(i.data,this.replacer)),n}encodeAsBinary(i){const n=tf(i),o=this.encodeAsString(n.packet),u=n.buffers;return u.unshift(o),u}}function ko(s){return Object.prototype.toString.call(s)==="[object Object]"}class mi extends Pt{constructor(i){super(),this.reviver=i}add(i){let n;if(typeof i=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(i);const o=n.type===yt.BINARY_EVENT;o||n.type===yt.BINARY_ACK?(n.type=o?yt.EVENT:yt.ACK,this.reconstructor=new of(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(gi(i)||i.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(i),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+i)}decodeString(i){let n=0;const o={type:Number(i.charAt(0))};if(yt[o.type]===void 0)throw new Error("unknown packet type "+o.type);if(o.type===yt.BINARY_EVENT||o.type===yt.BINARY_ACK){const f=n+1;for(;i.charAt(++n)!=="-"&&n!=i.length;);const m=i.substring(f,n);if(m!=Number(m)||i.charAt(n)!=="-")throw new Error("Illegal attachments");o.attachments=Number(m)}if(i.charAt(n+1)==="/"){const f=n+1;for(;++n&&!(i.charAt(n)===","||n===i.length););o.nsp=i.substring(f,n)}else o.nsp="/";const u=i.charAt(n+1);if(u!==""&&Number(u)==u){const f=n+1;for(;++n;){const m=i.charAt(n);if(m==null||Number(m)!=m){--n;break}if(n===i.length)break}o.id=Number(i.substring(f,n+1))}if(i.charAt(++n)){const f=this.tryParse(i.substr(n));if(mi.isPayloadValid(o.type,f))o.data=f;else throw new Error("invalid payload")}return o}tryParse(i){try{return JSON.parse(i,this.reviver)}catch{return!1}}static isPayloadValid(i,n){switch(i){case yt.CONNECT:return ko(n);case yt.DISCONNECT:return n===void 0;case yt.CONNECT_ERROR:return typeof n=="string"||ko(n);case yt.EVENT:case yt.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&nf.indexOf(n[0])===-1);case yt.ACK:case yt.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class of{constructor(i){this.packet=i,this.buffers=[],this.reconPack=i}takeBinaryData(i){if(this.buffers.push(i),this.buffers.length===this.reconPack.attachments){const n=ef(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const af=Object.freeze(Object.defineProperty({__proto__:null,Decoder:mi,Encoder:sf,get PacketType(){return yt},protocol:rf},Symbol.toStringTag,{value:"Module"}));function ke(s,i,n){return s.on(i,n),function(){s.off(i,n)}}const uf=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Eo extends Pt{constructor(i,n,o){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=i,this.nsp=n,o&&o.auth&&(this.auth=o.auth),this._opts=Object.assign({},o),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const i=this.io;this.subs=[ke(i,"open",this.onopen.bind(this)),ke(i,"packet",this.onpacket.bind(this)),ke(i,"error",this.onerror.bind(this)),ke(i,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...i){return i.unshift("message"),this.emit.apply(this,i),this}emit(i,...n){if(uf.hasOwnProperty(i))throw new Error('"'+i.toString()+'" is a reserved event name');if(n.unshift(i),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:yt.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const f=this.ids++,m=n.pop();this._registerAckCallback(f,m),o.id=f}const u=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!u||!this.connected)||(this.connected?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(i,n){var o;const u=(o=this.flags.timeout)!==null&&o!==void 0?o:this._opts.ackTimeout;if(u===void 0){this.acks[i]=n;return}const f=this.io.setTimeoutFn(()=>{delete this.acks[i];for(let m=0;m<this.sendBuffer.length;m++)this.sendBuffer[m].id===i&&this.sendBuffer.splice(m,1);n.call(this,new Error("operation has timed out"))},u);this.acks[i]=(...m)=>{this.io.clearTimeoutFn(f),n.apply(this,[null,...m])}}emitWithAck(i,...n){const o=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((u,f)=>{n.push((m,g)=>o?m?f(m):u(g):u(m)),this.emit(i,...n)})}_addToQueue(i){let n;typeof i[i.length-1]=="function"&&(n=i.pop());const o={id:this._queueSeq++,tryCount:0,pending:!1,args:i,flags:Object.assign({fromQueue:!0},this.flags)};i.push((u,...f)=>o!==this._queue[0]?void 0:(u!==null?o.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(u)):(this._queue.shift(),n&&n(null,...f)),o.pending=!1,this._drainQueue())),this._queue.push(o),this._drainQueue()}_drainQueue(i=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!i||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(i){i.nsp=this.nsp,this.io._packet(i)}onopen(){typeof this.auth=="function"?this.auth(i=>{this._sendConnectPacket(i)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(i){this.packet({type:yt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},i):i})}onerror(i){this.connected||this.emitReserved("connect_error",i)}onclose(i,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",i,n)}onpacket(i){if(i.nsp===this.nsp)switch(i.type){case yt.CONNECT:i.data&&i.data.sid?this.onconnect(i.data.sid,i.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case yt.EVENT:case yt.BINARY_EVENT:this.onevent(i);break;case yt.ACK:case yt.BINARY_ACK:this.onack(i);break;case yt.DISCONNECT:this.ondisconnect();break;case yt.CONNECT_ERROR:this.destroy();const n=new Error(i.data.message);n.data=i.data.data,this.emitReserved("connect_error",n);break}}onevent(i){const n=i.data||[];i.id!=null&&n.push(this.ack(i.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(i){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const o of n)o.apply(this,i)}super.emit.apply(this,i),this._pid&&i.length&&typeof i[i.length-1]=="string"&&(this._lastOffset=i[i.length-1])}ack(i){const n=this;let o=!1;return function(...u){o||(o=!0,n.packet({type:yt.ACK,id:i,data:u}))}}onack(i){const n=this.acks[i.id];typeof n=="function"&&(n.apply(this,i.data),delete this.acks[i.id])}onconnect(i,n){this.id=i,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(i=>this.emitEvent(i)),this.receiveBuffer=[],this.sendBuffer.forEach(i=>{this.notifyOutgoingListeners(i),this.packet(i)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(i=>i()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:yt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(i){return this.flags.compress=i,this}get volatile(){return this.flags.volatile=!0,this}timeout(i){return this.flags.timeout=i,this}onAny(i){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(i),this}prependAny(i){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(i),this}offAny(i){if(!this._anyListeners)return this;if(i){const n=this._anyListeners;for(let o=0;o<n.length;o++)if(i===n[o])return n.splice(o,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(i){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(i),this}prependAnyOutgoing(i){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(i),this}offAnyOutgoing(i){if(!this._anyOutgoingListeners)return this;if(i){const n=this._anyOutgoingListeners;for(let o=0;o<n.length;o++)if(i===n[o])return n.splice(o,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(i){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const o of n)o.apply(this,i.data)}}}function yn(s){s=s||{},this.ms=s.min||100,this.max=s.max||1e4,this.factor=s.factor||2,this.jitter=s.jitter>0&&s.jitter<=1?s.jitter:0,this.attempts=0}yn.prototype.duration=function(){var s=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var i=Math.random(),n=Math.floor(i*this.jitter*s);s=Math.floor(i*10)&1?s+n:s-n}return Math.min(s,this.max)|0},yn.prototype.reset=function(){this.attempts=0},yn.prototype.setMin=function(s){this.ms=s},yn.prototype.setMax=function(s){this.max=s},yn.prototype.setJitter=function(s){this.jitter=s};class _i extends Pt{constructor(i,n){var o;super(),this.nsps={},this.subs=[],i&&typeof i=="object"&&(n=i,i=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,ar(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((o=n.randomizationFactor)!==null&&o!==void 0?o:.5),this.backoff=new yn({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=i;const u=n.parser||af;this.encoder=new u.Encoder,this.decoder=new u.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(i){return arguments.length?(this._reconnection=!!i,this):this._reconnection}reconnectionAttempts(i){return i===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=i,this)}reconnectionDelay(i){var n;return i===void 0?this._reconnectionDelay:(this._reconnectionDelay=i,(n=this.backoff)===null||n===void 0||n.setMin(i),this)}randomizationFactor(i){var n;return i===void 0?this._randomizationFactor:(this._randomizationFactor=i,(n=this.backoff)===null||n===void 0||n.setJitter(i),this)}reconnectionDelayMax(i){var n;return i===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=i,(n=this.backoff)===null||n===void 0||n.setMax(i),this)}timeout(i){return arguments.length?(this._timeout=i,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(i){if(~this._readyState.indexOf("open"))return this;this.engine=new So(this.uri,this.opts);const n=this.engine,o=this;this._readyState="opening",this.skipReconnect=!1;const u=ke(n,"open",function(){o.onopen(),i&&i()}),f=g=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",g),i?i(g):this.maybeReconnectOnOpen()},m=ke(n,"error",f);if(this._timeout!==!1){const g=this._timeout,S=this.setTimeoutFn(()=>{u(),f(new Error("timeout")),n.close()},g);this.opts.autoUnref&&S.unref(),this.subs.push(()=>{this.clearTimeoutFn(S)})}return this.subs.push(u),this.subs.push(m),this}connect(i){return this.open(i)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const i=this.engine;this.subs.push(ke(i,"ping",this.onping.bind(this)),ke(i,"data",this.ondata.bind(this)),ke(i,"error",this.onerror.bind(this)),ke(i,"close",this.onclose.bind(this)),ke(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(i){try{this.decoder.add(i)}catch(n){this.onclose("parse error",n)}}ondecoded(i){pi(()=>{this.emitReserved("packet",i)},this.setTimeoutFn)}onerror(i){this.emitReserved("error",i)}socket(i,n){let o=this.nsps[i];return o?this._autoConnect&&!o.active&&o.connect():(o=new Eo(this,i,n),this.nsps[i]=o),o}_destroy(i){const n=Object.keys(this.nsps);for(const o of n)if(this.nsps[o].active)return;this._close()}_packet(i){const n=this.encoder.encode(i);for(let o=0;o<n.length;o++)this.engine.write(n[o],i.options)}cleanup(){this.subs.forEach(i=>i()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(i,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",i,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const i=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const o=this.setTimeoutFn(()=>{i.skipReconnect||(this.emitReserved("reconnect_attempt",i.backoff.attempts),!i.skipReconnect&&i.open(u=>{u?(i._reconnecting=!1,i.reconnect(),this.emitReserved("reconnect_error",u)):i.onreconnect()}))},n);this.opts.autoUnref&&o.unref(),this.subs.push(()=>{this.clearTimeoutFn(o)})}}onreconnect(){const i=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",i)}}const Pn={};function hr(s,i){typeof s=="object"&&(i=s,s=void 0),i=i||{};const n=Vc(s,i.path||"/socket.io"),o=n.source,u=n.id,f=n.path,m=Pn[u]&&f in Pn[u].nsps,g=i.forceNew||i["force new connection"]||i.multiplex===!1||m;let S;return g?S=new _i(o,i):(Pn[u]||(Pn[u]=new _i(o,i)),S=Pn[u]),n.query&&!i.query&&(i.query=n.queryKey),S.socket(n.path,i)}Object.assign(hr,{Manager:_i,Socket:Eo,io:hr,connect:hr});let lr;const cf=new Uint8Array(16);function ff(){if(!lr&&(lr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!lr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return lr(cf)}const Gt=[];for(let s=0;s<256;++s)Gt.push((s+256).toString(16).slice(1));function hf(s,i=0){return Gt[s[i+0]]+Gt[s[i+1]]+Gt[s[i+2]]+Gt[s[i+3]]+"-"+Gt[s[i+4]]+Gt[s[i+5]]+"-"+Gt[s[i+6]]+Gt[s[i+7]]+"-"+Gt[s[i+8]]+Gt[s[i+9]]+"-"+Gt[s[i+10]]+Gt[s[i+11]]+Gt[s[i+12]]+Gt[s[i+13]]+Gt[s[i+14]]+Gt[s[i+15]]}const lf=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ao={randomUUID:lf};function pf(s,i,n){if(Ao.randomUUID&&!i&&!s)return Ao.randomUUID();s=s||{};const o=s.random||(s.rng||ff)();if(o[6]=o[6]&15|64,o[8]=o[8]&63|128,i){n=n||0;for(let u=0;u<16;++u)i[n+u]=o[u];return i}return hf(o)}function df(s){return!!s&&(typeof s=="object"||typeof s=="function")&&typeof s.then=="function"}function gf(s,i){const n=i.map(u=>JSON.stringify(u)).join(" "),o=new Date().toISOString();return JSON.stringify({level:s,time:o,message:n})}function vf(s){const i=String(s[0]),n=s.slice(1);return{level:i,logs:n}}function yf(s,i){const n=JSON.parse(s);return i.forEach(o=>delete n[o]),n}const mf={reconnection:!0,reconnectionDelay:5e3,reconnectionAttempts:10,upgrade:!1,transports:["websocket"],debug:!1},wi={logToConsole:!0,overloadGlobalConsole:!1,socketEmitInterval:6e4};let ne=console;class To{constructor(i){qt(this,"logToConsole"),qt(this,"overloadGlobalConsole"),qt(this,"namespace"),qt(this,"socketEmitInterval"),qt(this,"storageId"),qt(this,"emitInProgress"),qt(this,"queue"),qt(this,"processing"),qt(this,"interval"),qt(this,"logIndex"),qt(this,"socket"),qt(this,"getItem"),qt(this,"setItem"),qt(this,"parseLog"),qt(this,"_logMethod"),qt(this,"_warnMethod"),qt(this,"_errorMethod"),qt(this,"_debugMethod");const{loggerOptions:n}=i;if(!n.namespace)throw new Error("Config property 'namespace' should be provided!");this.setupStorageFunctions(n.getItem,n.setItem,n.parseLog),this.namespace=n.namespace,this.socketEmitInterval=n.socketEmitInterval||wi.socketEmitInterval,this.logToConsole=n.logToConsole!==void 0?n.logToConsole:wi.logToConsole,this.overloadGlobalConsole=n.overloadGlobalConsole!==void 0?n.overloadGlobalConsole:wi.overloadGlobalConsole,this.storageId=this.getStorageName(),this.queue=[],this.processing=!1,this.emitInProgress=!1,this.logIndex=0,this.init(i)}setupStorageFunctions(i,n,o){this.getItem=i&&typeof i=="function"?this.promisifyStorageFunction(i):this.defaultGetItemFunction,this.setItem=n&&typeof n=="function"?this.promisifyStorageFunction(n):this.defaultSetItemFunction,this.parseLog=o&&typeof o=="function"?o:gf}promisifyStorageFunction(i){const n=i("");return df(n)?async(...o)=>new Promise((u,f)=>{try{const m=i(...o);u(m)}catch(m){f(m)}}):i}init(i){const{socket:n,url:o,socketOptions:u={}}=i;this._logMethod=ne.log.bind(ne),this._warnMethod=ne.warn.bind(ne),this._errorMethod=ne.error.bind(ne),this._debugMethod=ne.debug.bind(ne),this.initStorage().then(()=>{if(n)this.socket=n;else if(o)this.socket=this.createConnection(o,u);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(i,n={}){const o={...mf,...n};return hr(i,o)}async emitLogs(){if(!this.emitInProgress)try{const i=await this.getItem(this.storageId);if(!i)return;const n=[];this.emitInProgress=!0;const o=JSON.parse(i),u=Object.keys(o);if(!u.length)return;if(!this.socket||!this.socket.connected)throw new Error("Socket is disconnected");for(const g of u)this.socket.emit("Log",o[g]),n.push(g);const f=await this.getItem(this.storageId);if(!f)return;const m=yf(f,n);await this.setItem(this.storageId,JSON.stringify(m))}catch(i){this._errorMethod(i)}finally{this.emitInProgress=!1}}disconnectSocket(){!this.socket||!this.interval||(this.socket.disconnect(),clearInterval(this.interval))}_overloadConsole(){ne=Object.assign(ne,{log:(...i)=>{this.log(...i)},warn:(...i)=>{this.warn(...i)},error:(...i)=>{this.error(...i)},debug:(...i)=>{this.debug(...i)}})}async initStorage(){const i=await this.getItem(this.storageId);(!i||typeof i!="string")&&await this.setItem(this.storageId,JSON.stringify({}))}async resetStorage(){await this.setItem(this.storageId,JSON.stringify({}))}getStorageName(){const i=pf();return this.namespace.toString().toUpperCase()+i+Date.now()}async processLog(...i){try{if(i.length<2)return;const n=await this.getItem(this.storageId);if(!n)return;const{level:o,logs:u}=vf(i),f=JSON.parse(n),m=this.formItemKey(o);f[m]=this.parseLog(o,u),await this.setItem(this.storageId,JSON.stringify(f))}catch(n){this._errorMethod(n)}}async processQueue(){if(this.processing||this.queue.length===0)return;const i=this.queue.shift();i&&(this.processing=!0,await this.processLog(...i).finally(()=>{this.processing=!1,this.processQueue()}))}log(...i){const n=["INFO",...i];this.queue.push(n),this.logToConsole&&this._logMethod.apply(ne,i),this.processQueue()}warn(...i){const n=["WARN",...i];this.queue.push(n),this.logToConsole&&this._warnMethod.apply(ne,i),this.processQueue()}error(...i){const n=["ERROR",...i];this.queue.push(n),this.logToConsole&&this._errorMethod.apply(ne,i),this.processQueue()}debug(...i){const n=["DEBUG",...i];this.queue.push(n),this.logToConsole&&this._debugMethod.apply(ne,i),this.processQueue()}async defaultGetItemFunction(i){return localStorage.getItem(i)}async defaultSetItemFunction(i,n){try{localStorage.setItem(i,n)}catch(o){this._errorMethod(o)}}formItemKey(i){const n=new Date().toISOString();return this.logIndex++,`${i}-${this.namespace}-${n}-${this.logIndex}`}}class _f{constructor(i){wt(this,"io");wt(this,"storageLogger");this.eventsSdkClass=i,this.eventsSdkClass=i}init(){this.eventsSdkClass.options.useLogger&&(this.eventsSdkClass.options.loggerSocketConnection?this.io=this.eventsSdkClass.options.loggerSocketConnection:this.eventsSdkClass.socketIoClass.ioFunction&&(this.io=this.eventsSdkClass.socketIoClass.ioFunction(this.eventsSdkClass.options.loggerServer,this.eventsSdkClass.options.loggerConnectOptions)),this.io?this.storageLogger=new To({socket:this.io,loggerOptions:this.eventsSdkClass.options.loggerConfig}):this.storageLogger=new To({url:this.eventsSdkClass.options.loggerServer,socketOptions:this.eventsSdkClass.options.loggerConnectOptions,loggerOptions:this.eventsSdkClass.options.loggerConfig}))}log(i,n,...o){const u=[n,...o];this.storageLogger?i===zt.INFO?this.storageLogger.log(u):i===zt.ERROR&&this.storageLogger.error(u):i===zt.INFO?console.log(u):i===zt.ERROR&&console.error(u)}}class wf{constructor(i){wt(this,"listeners",{[ht.ALL_EXTENSION_STATUS]:[],[ht.ALL_DIALER_STATUS]:[],[ht.ALL_USERS_STATUS]:[],[ht.QUEUE_EVENT]:[],[ht.EXTENSION_EVENT]:[],[ht.DIALER_EVENT]:[],[ht.LOGIN_SUCCESS]:[],[ht.LOGIN_STATUS]:[],[ht.KEEP_ALIVE_RESPONSE]:[],[ht.ONLINE_STATUS_EVENT]:[],[ht.EXTENSIONS_UPDATED]:[]});wt(this,"allListeners",[]);this.eventsSdkClass=i,this.eventsSdkClass=i}on(i,n){i==="*"?this.allListeners.push(n):this.listeners[i].push(n)}off(i,n){if(i==="*")this.allListeners=this.allListeners.filter(o=>o!==n);else{const u=this.listeners[i].filter(f=>f!==n);this.listeners={...this.listeners,[i]:u}}}emit(i,n){this.eventsSdkClass.socketIoClass.lastEventTimestamp=new Date().getTime(),this.listeners[i].forEach(u=>u({name:i,data:n}));const o={name:i,data:n};this.allListeners.forEach(u=>u(o))}}class bf{constructor(i){wt(this,"argumentOptions");wt(this,"options");wt(this,"servers",[]);wt(this,"URLList",[]);wt(this,"server");wt(this,"URL");wt(this,"socket");wt(this,"mainServer");wt(this,"alreadyAttemptedOtherServers",[]);wt(this,"authClass",new uc(this));wt(this,"socketIoClass",new vc(this));wt(this,"loggerClass",new _f(this));wt(this,"eventEmitterClass",new wf(this));wt(this,"reconnectOptions");wt(this,"retryConnection");this.options={...fc,...i},this.reconnectOptions={retryCount:1,maxReconnectAttempts:this.options.maxReconnectAttempts,reconnectionDelay:this.options.reconnectionDelay,minReconnectionDelay:this.options.reconnectionDelay,maxReconnectionDelay:6e4*5},this.server=this.options.fallbackServer,this.retryConnection=cc.debounce(this.connect.bind(this),this.reconnectOptions.reconnectionDelay,{leading:!0,trailing:!1}),this.argumentOptions={...i}}on(i,n){this.eventEmitterClass.on(i,n)}emit(i,...n){this.socketIoClass.io&&this.socketIoClass.io.emit(i,...n)}connect(i){i===an.MAIN&&this.findMainServer(),i===an.NEXT&&this.findNextServer(),this.socketIoClass.doReconnect=!0,this.socketIoClass.initSocketConnection(),this.socketIoClass.initSocketEvents(),this.socketIoClass.initKeepAlive(),this.loggerClass.init()}disconnect(){this.socketIoClass.doReconnect=!1,this.socketIoClass.closeAllConnections()}clearKeepAliveInterval(){this.socketIoClass.clearKeepAliveInterval()}findMainServer(){this.servers.length?(this.mainServer=this.servers.reduce((i,n)=>n.Priority>i.Priority?n:i),this.server=this.mainServer):this.URLList.length&&(this.URL=this.URLList[0])}findNextServer(){if(this.servers.length)if(this.server.Priority===this.mainServer.Priority){let i=this.servers.filter(n=>n.Priority!==this.mainServer.Priority&&this.alreadyAttemptedOtherServers.indexOf(n.Priority)+1===0);i.length||(this.alreadyAttemptedOtherServers=[],i=this.servers.filter(n=>n.Priority!==this.mainServer.Priority&&this.alreadyAttemptedOtherServers.indexOf(n.Priority)+1===0)),i.length&&(this.server=i.reduce((n,o)=>o.Priority>n.Priority?o:n),this.alreadyAttemptedOtherServers.push(this.server.Priority))}else this.server=this.mainServer;else if(this.URLList.length)if(this.URL===this.URLList[0]){let i=this.URLList.filter(n=>n!==this.URLList[0]&&this.alreadyAttemptedOtherServers.indexOf(n)+1===0);i.length||(this.alreadyAttemptedOtherServers=[],i=this.URLList.filter(n=>n!==this.URLList[0]&&this.alreadyAttemptedOtherServers.indexOf(n)+1===0)),i.length&&(this.URL=i[0],this.alreadyAttemptedOtherServers.push(this.URL))}else this.URL=this.URLList[0]}async init(){return this.socket,await this.authClass.login(this.options),this.getServers(),!0}getServers(){this.options.serverFetchStrategy==="static"&&this.argumentOptions.servers&&Array.isArray(this.argumentOptions.servers)&&this.argumentOptions.servers.length>1&&(this.servers=this.argumentOptions.servers)}}Nt.CallStatusEnum=Xs,Nt.CallTypeEnum=Js,Nt.DialerTypeEnum=Vs,Nt.DirectionEnum=Ys,Nt.DoNotCallMeStatusCodeEnum=js,Nt.EventsEnum=ht,Nt.ExtensionEventReasonEnum=ii,Nt.ExtensionHangupCauseEnum=Zs,Nt.QueueEventReasonEnum=Qs,Nt.ServerListenerEventsEnum=si,Nt.default=bf,Object.defineProperties(Nt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
12
+ ]`&&N(new Date(-864e13))=='"-271821-04-20T00:00:00.000Z"'&&N(new Date(864e13))=='"+275760-09-13T00:00:00.000Z"'&&N(new Date(-621987552e5))=='"-000001-01-01T00:00:00.000Z"'&&N(new Date(-1))=='"1969-12-31T23:59:59.999Z"'}catch{D=!1}}U=D}if(R=="json-parse"){var P=l.parse;if(typeof P=="function")try{if(P("0")===0&&!P(!1)){B=P(F);var L=B.a.length==5&&B.a[0]===1;if(L){try{L=!P('" "')}catch{}if(L)try{L=P("01")!==1}catch{}if(L)try{L=P("1.")!==1}catch{}}}}catch{L=!1}U=L}}return o[R]=!!U}var i,u,h,d={}.toString,c=typeof JSON=="object"&&JSON,l=typeof r=="object"&&r&&!r.nodeType&&r;l&&c?(l.stringify=c.stringify,l.parse=c.parse):l=n.JSON=c||{};var p=new Date(-0xc782b5b800cec);try{p=p.getUTCFullYear()==-109252&&p.getUTCMonth()===0&&p.getUTCDate()===1&&p.getUTCHours()==10&&p.getUTCMinutes()==37&&p.getUTCSeconds()==6&&p.getUTCMilliseconds()==708}catch{}if(!o("json")){var a="[object Function]",s="[object Date]",f="[object Number]",y="[object String]",g="[object Array]",w="[object Boolean]",I=o("bug-string-char-index");if(!p)var _=Math.floor,b=[0,31,59,90,120,151,181,212,243,273,304,334],S=function(R,U){return b[U]+365*(R-1970)+_((R-1969+(U=+(U>1)))/4)-_((R-1901+U)/100)+_((R-1601+U)/400)};(i={}.hasOwnProperty)||(i=function(R){var U,B={};return(B.__proto__=null,B.__proto__={toString:1},B).toString!=d?i=function(F){var N=this.__proto__,D=F in(this.__proto__=null,this);return this.__proto__=N,D}:(U=B.constructor,i=function(F){var N=(this.constructor||U).prototype;return F in this&&!(F in N&&this[F]===N[F])}),B=null,i.call(this,R)});var m={boolean:1,number:1,string:1,undefined:1},C=function(R,U){var B=typeof R[U];return B=="object"?!!R[U]:!m[B]};if(u=function(R,U){var B,F,N,D=0;(B=function(){this.valueOf=0}).prototype.valueOf=0,F=new B;for(N in F)i.call(F,N)&&D++;return B=F=null,D?u=D==2?function(P,L){var M,J={},st=d.call(P)==a;for(M in P)st&&M=="prototype"||i.call(J,M)||!(J[M]=1)||!i.call(P,M)||L(M)}:function(P,L){var M,J,st=d.call(P)==a;for(M in P)st&&M=="prototype"||!i.call(P,M)||(J=M==="constructor")||L(M);(J||i.call(P,M="constructor"))&&L(M)}:(F=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],u=function(P,L){var M,J,st=d.call(P)==a,at=!st&&typeof P.constructor!="function"&&C(P,"hasOwnProperty")?P.hasOwnProperty:i;for(M in P)st&&M=="prototype"||!at.call(P,M)||L(M);for(J=F.length;M=F[--J];at.call(P,M)&&L(M));}),u(R,U)},!o("json-stringify")){var E={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},v="000000",k=function(R,U){return(v+(U||0)).slice(-R)},T="\\u00",x=function(R){var U,B='"',F=0,N=R.length,D=N>10&&I;for(D&&(U=R.split(""));N>F;F++){var P=R.charCodeAt(F);switch(P){case 8:case 9:case 10:case 12:case 13:case 34:case 92:B+=E[P];break;default:if(32>P){B+=T+k(2,P.toString(16));break}B+=D?U[F]:I?R.charAt(F):R[F]}}return B+'"'},O=function(R,U,B,F,N,D,P){var L,M,J,st,at,Dt,Te,Ne,xe,Oe,dt,Re,Gt,Pt,Be,Ie;try{L=U[R]}catch{}if(typeof L=="object"&&L)if(M=d.call(L),M!=s||i.call(L,"toJSON"))typeof L.toJSON=="function"&&(M!=f&&M!=y&&M!=g||i.call(L,"toJSON"))&&(L=L.toJSON(R));else if(L>-1/0&&1/0>L){if(S){for(at=_(L/864e5),J=_(at/365.2425)+1970-1;S(J+1,0)<=at;J++);for(st=_((at-S(J,0))/30.42);S(J,st+1)<=at;st++);at=1+at-S(J,st),Dt=(L%864e5+864e5)%864e5,Te=_(Dt/36e5)%24,Ne=_(Dt/6e4)%60,xe=_(Dt/1e3)%60,Oe=Dt%1e3}else J=L.getUTCFullYear(),st=L.getUTCMonth(),at=L.getUTCDate(),Te=L.getUTCHours(),Ne=L.getUTCMinutes(),xe=L.getUTCSeconds(),Oe=L.getUTCMilliseconds();L=(0>=J||J>=1e4?(0>J?"-":"+")+k(6,0>J?-J:J):k(4,J))+"-"+k(2,st+1)+"-"+k(2,at)+"T"+k(2,Te)+":"+k(2,Ne)+":"+k(2,xe)+"."+k(3,Oe)+"Z"}else L=null;if(B&&(L=B.call(U,R,L)),L===null)return"null";if(M=d.call(L),M==w)return""+L;if(M==f)return L>-1/0&&1/0>L?""+L:"null";if(M==y)return x(""+L);if(typeof L=="object"){for(Pt=P.length;Pt--;)if(P[Pt]===L)throw TypeError();if(P.push(L),dt=[],Be=D,D+=N,M==g){for(Gt=0,Pt=L.length;Pt>Gt;Gt++)Re=O(Gt,L,B,F,N,D,P),dt.push(Re===h?"null":Re);Ie=dt.length?N?`[
13
+ `+D+dt.join(`,
14
+ `+D)+`
15
+ `+Be+"]":"["+dt.join(",")+"]":"[]"}else u(F||L,function(_e){var Br=O(_e,L,B,F,N,D,P);Br!==h&&dt.push(x(_e)+":"+(N?" ":"")+Br)}),Ie=dt.length?N?`{
16
+ `+D+dt.join(`,
17
+ `+D)+`
18
+ `+Be+"}":"{"+dt.join(",")+"}":"{}";return P.pop(),Ie}};l.stringify=function(R,U,B){var F,N,D,P;if(typeof U=="function"||typeof U=="object"&&U){if((P=d.call(U))==a)N=U;else if(P==g){D={};for(var L,M=0,J=U.length;J>M;L=U[M++],P=d.call(L),(P==y||P==f)&&(D[L]=1));}}if(B)if((P=d.call(B))==f){if((B-=B%1)>0)for(F="",B>10&&(B=10);F.length<B;F+=" ");}else P==y&&(F=B.length<=10?B:B.slice(0,10));return O("",(L={},L[""]=R,L),N,D,F,"",[])}}if(!o("json-parse")){var A,q,j=String.fromCharCode,G={92:"\\",34:'"',47:"/",98:"\b",116:" ",110:`
19
+ `,102:"\f",114:"\r"},K=function(){throw A=q=null,SyntaxError()},nt=function(){for(var R,U,B,F,N,D=q,P=D.length;P>A;)switch(N=D.charCodeAt(A)){case 9:case 10:case 13:case 32:A++;break;case 123:case 125:case 91:case 93:case 58:case 44:return R=I?D.charAt(A):D[A],A++,R;case 34:for(R="@",A++;P>A;)if(N=D.charCodeAt(A),32>N)K();else if(N==92)switch(N=D.charCodeAt(++A)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:R+=G[N],A++;break;case 117:for(U=++A,B=A+4;B>A;A++)N=D.charCodeAt(A),N>=48&&57>=N||N>=97&&102>=N||N>=65&&70>=N||K();R+=j("0x"+D.slice(U,A));break;default:K()}else{if(N==34)break;for(N=D.charCodeAt(A),U=A;N>=32&&N!=92&&N!=34;)N=D.charCodeAt(++A);R+=D.slice(U,A)}if(D.charCodeAt(A)==34)return A++,R;K();default:if(U=A,N==45&&(F=!0,N=D.charCodeAt(++A)),N>=48&&57>=N){for(N==48&&(N=D.charCodeAt(A+1),N>=48&&57>=N)&&K(),F=!1;P>A&&(N=D.charCodeAt(A),N>=48&&57>=N);A++);if(D.charCodeAt(A)==46){for(B=++A;P>B&&(N=D.charCodeAt(B),N>=48&&57>=N);B++);B==A&&K(),A=B}if(N=D.charCodeAt(A),N==101||N==69){for(N=D.charCodeAt(++A),(N==43||N==45)&&A++,B=A;P>B&&(N=D.charCodeAt(B),N>=48&&57>=N);B++);B==A&&K(),A=B}return+D.slice(U,A)}if(F&&K(),D.slice(A,A+4)=="true")return A+=4,!0;if(D.slice(A,A+5)=="false")return A+=5,!1;if(D.slice(A,A+4)=="null")return A+=4,null;K()}return"$"},Ut=function(R){var U,B;if(R=="$"&&K(),typeof R=="string"){if((I?R.charAt(0):R[0])=="@")return R.slice(1);if(R=="["){for(U=[];R=nt(),R!="]";B||(B=!0))B&&(R==","?(R=nt(),R=="]"&&K()):K()),R==","&&K(),U.push(Ut(R));return U}if(R=="{"){for(U={};R=nt(),R!="}";B||(B=!0))B&&(R==","?(R=nt(),R=="}"&&K()):K()),(R==","||typeof R!="string"||(I?R.charAt(0):R[0])!="@"||nt()!=":")&&K(),U[R.slice(1)]=Ut(nt());return U}K()}return R},Or=function(R,U,B){var F=Rr(R,U,B);F===h?delete R[U]:R[U]=F},Rr=function(R,U,B){var F,N=R[U];if(typeof N=="object"&&N)if(d.call(N)==g)for(F=N.length;F--;)Or(N,F,B);else u(N,function(D){Or(N,D,B)});return B.call(R,U,N)};l.parse=function(R,U){var B,F;return A=0,q=""+R,B=Ut(nt()),nt()!="$"&&K(),A=q=null,U&&d.call(U)==a?Rr((F={},F[""]=B,F),"",U):B}}}})(this)},{}],48:[function(t,e){function r(n,o){var i=[];o=o||0;for(var u=o||0;u<n.length;u++)i[u-o]=n[u];return i}e.exports=r},{}]},{},[1])(1)}const Fo=Object.assign({"./v1_3_7.js":Object.freeze(Object.defineProperty({__proto__:null,default:Po},Symbol.toStringTag,{value:"Module"}))}),jo=/v\d+_\d+_\d+/;function Mo(t){return typeof t=="function"}const we=Object.entries(Fo).reduce((t,e)=>{var o;const r=e[1].default,n=(o=e[0].match(jo))==null?void 0:o[0];return Mo(r)&&n&&(t[n]=r()),t},{}),Cr=t=>{if(t in we)return we[t];throw new Error(`Socket version ${t} not found`)},qo={...we,getSocketVersion:Cr,makeSocketVersion:(t,...e)=>Cr(t)(...e)};var wr=(t=>(t.RINGING="Ringing",t.TALKING="Talking",t.DIALING="Dialing",t.HOLD="Hold",t))(wr||{}),Sr=(t=>(t.INCOMING="Incoming",t.OUTGOING="Outgoing",t))(Sr||{}),Er=(t=>(t.AUTOMATIC="Automatic",t.IVR="IVR",t))(Er||{}),Ar=(t=>(t.INCOMINC="Incoming",t.OUTGOING="Outgoing",t.SPY="Spy",t.CLICK2CALL="Click2Call",t))(Ar||{}),Tr=(t=>(t.RESPONSE_FROM_API_VALID="RESPONSE_FROM_API_VALID",t.RESPONSE_FROM_API_INVALID="RESPONSE_FROM_API_INVALID",t))(Tr||{}),z=(t=>(t.ALL_DIALER_STATUS="AllDialersStatus",t.ALL_EXTENSION_STATUS="AllExtensionsStatus",t.ALL_USERS_STATUS="AllUsersStatus",t.CONNECT="connect",t.DISCONNECT="disconnect",t.CONNECT_ERROR_EVENT="connect_error",t.EXTENSION_EVENT="ExtensionEvent",t.KEEP_ALIVE="keepalive",t.KEEP_ALIVE_RESPONSE="keepaliveResponse",t.LOGIN_STATUS="loginStatus",t.LOGIN_SUCCESS="loginSuccess",t.QUEUE_EVENT="QueueEvent",t.ONLINE_STATUS_EVENT="onlineStatusEvent",t.DIALER_EVENT="DialerEvent",t.EXTENSIONS_UPDATED="ExtensionsUpdated",t))(z||{}),Se=(t=>(t.NEWCALL="NEWCALL",t.ANSWER="ANSWER",t.HOLD="HOLD",t.UNHOLD="UNHOLD",t.HANGUP="HANGUP",t.USER_STATUS_UPDATE="userStatusUpdate",t))(Se||{}),Nr=(t=>(t.NORMAL_HANGUP="Normal hangup",t.USER_BUSY="User busy",t.CALL_REJECTED="Call Rejected",t.UNALLOCATED_NUMBER="Unallocated (unassigned) number",t.UNKNOWN="Unknown",t.NO_USER_RESPONDING="No user responding",t.USER_ALERTING="User alerting, no answer",t.ANSWERED_ELSEWHERE="Answered elsewhere",t))(Nr||{}),xr=(t=>(t.ANSWER="ANSWER",t.ABANDONED="ABANDONED",t.EXIT="EXIT",t.JOIN="JOIN",t))(xr||{});class Ee{static mapExtensionEvent(e){var u,h;const r=e.reason;let n,o;e.data.currentCall&&(o=this.mapExtensionCall(e,e.data.currentCall));const i=this.mapExtensionData(e,e.data);return r===Se.HANGUP?n={...e,reason:r,data:{...i,currentCall:o?{...o,duration:Date.now()-((o==null?void 0:o.callAnswered_UTC_CLIENT)??0)}:void 0,calls:(u=e.data.calls)==null?void 0:u.map(d=>{const c=this.mapExtensionCall(e,d);return{...c,duration:Date.now()-(c.callAnswered_UTC_CLIENT??0)}})}}:n={...e,data:{...i,currentCall:o,calls:(h=e.data.calls)==null?void 0:h.map(d=>this.mapExtensionCall(e,d))},reason:r},n}static mapAllExtensionStatus(e){return{...e,extensions:e.extensions.map(r=>{var n;return{...this.mapExtensionData(e,r),currentCall:r.currentCall?this.mapExtensionCall(e,r.currentCall):void 0,calls:(n=r.calls)==null?void 0:n.map(o=>this.mapExtensionCall(e,o))}})}}static mapExtensionData(e,r){return this.configureUTCForObject(r,[{key:"lastAnsweredCallEventEpoch",format:"sec"},{key:"lastCallEventEpoch",format:"sec"},{key:"lastHangupCallEpoch",format:"sec"},{key:"representativeUpdated",format:"ms"}],e.servertime,e.servertimeoffset)}static mapExtensionCall(e,r){return this.configureUTCForObject(r,[{key:"callAnswered",format:"sec"},{key:"callStarted",format:"sec"}],e.servertime,e.servertimeoffset)}static mapQueueEvent(e){var r;return{...e,data:{...e.data,Calls:(r=e.data.Calls)==null?void 0:r.map(n=>this.configureUTCForObject(n,[{key:"JoinTimeStamp",format:"sec"}],e.servertime,e.servertimeoffset))}}}static assignProperty(e,r,n){e[r]=n}static configureUTCForObject(e,r,n,o){const i=(n-o*60)*1e3,u=Date.now()-i,h={};return r.forEach(d=>{const c=e[d.key],l=d.key;if(c!==0&&typeof c=="number"&&!isNaN(c)){let p=c;d.format==="ms"&&(p=Math.floor(p/1e3));const a=(p-o*60)*1e3;this.assignProperty(h,`${l}_UTC`,a),this.assignProperty(h,`${l}_UTC_CLIENT`,a+u)}else this.assignProperty(h,`${l}_UTC`,0),this.assignProperty(h,`${l}_UTC_CLIENT`,0)}),{...e,...h}}}var Ae=(t=>(t.UPDATE_MONITORED_EXTENSIONS="updateMonitoredExtensions",t.KEEP_ALIVE="keepAlive",t))(Ae||{});class zo{constructor(e){H(this,"io");H(this,"ioFunction");H(this,"lastEventTimestamp",new Date().getTime());H(this,"doReconnect",!0);H(this,"keepAliveInterval");H(this,"keepReconnectInterval");H(this,"connected",!1);this.eventsSdkClass=e,this.eventsSdkClass=e}getSocketIoFunction(e){const r=e.split("v="),n="v".concat(r[r.length-1]).replaceAll(".","_");this.ioFunction=qo.getSocketVersion(n)}initSocketConnection(){const e=this.eventsSdkClass.authClass.token,r=this.eventsSdkClass.options.protocol,n=this.eventsSdkClass.server;try{const o=n?n.Domain:this.eventsSdkClass.URL,i=n?`${r}://${o}`:this.eventsSdkClass.URL;this.eventsSdkClass.eventEmitterClass.emit(z.ONLINE_STATUS_EVENT,{isSocketConnected:!1,attemptToConnect:i,doReconnect:this.doReconnect});const u={reconnection:!1,upgrade:!1,transports:["websocket"],forceNew:!0,query:{token:e},timeout:this.eventsSdkClass.options.timeout};if(e&&(u.query={token:e}),this.ioFunction&&i)this.io=this.ioFunction(i,u),this.eventsSdkClass.loggerClass.log({Message:`${this.eventsSdkClass.options.loggerConfig.system} tries to connect to WS server ${o}`,ActionName:pt.WSCONNECT,isShowClient:!1,Status:"Switching Protocols",StatusCode:101,Level:et.INFO,LogType:ut.INFO});else throw new Error("Socket server url no defined")}catch(o){this.eventsSdkClass.loggerClass.log({Message:`${o}`,ActionName:pt.WSCONNECT,isShowClient:!1,Status:"Connection error",StatusCode:500,Level:et.ERROR,LogType:ut.ERROR})}}clearKeepAliveInterval(){this.keepAliveInterval&&clearInterval(this.keepAliveInterval)}initKeepAlive(){this.clearKeepAliveInterval(),this.keepAliveInterval=setInterval(async()=>{if(new Date().getTime()>this.lastEventTimestamp+this.eventsSdkClass.options.keepAliveTimeout&&this.io&&this.eventsSdkClass.authClass.token){this.eventsSdkClass.emit(Ae.KEEP_ALIVE,this.eventsSdkClass.authClass.token),this.eventsSdkClass.loggerClass.log({Message:`Keep alive event emitted with this token: ${this.eventsSdkClass.authClass.token}`,ActionName:pt.WSCONNECT,isShowClient:!1,Level:et.INFO,LogType:ut.INFO});return}},this.eventsSdkClass.options.keepAliveTimeout)}closeAllConnections(){var e;this.io&&(this.io.close(),(e=this.io)==null||e.disconnect(),this.io=void 0),Rt.clearSessionStorage()}initSocketEvents(){this.io&&this.io.on(z.LOGIN_SUCCESS,e=>this.onLoginSuccessEvent(e)).on(z.QUEUE_EVENT,e=>this.onQueueEvent(e)).on(z.EXTENSION_EVENT,e=>this.onExtensionEvent(e)).on(z.DIALER_EVENT,e=>this.onDialerEvent(e)).on(z.LOGIN_STATUS,e=>this.onLoginStatusEvent(e)).on(z.ALL_EXTENSION_STATUS,e=>this.onAllExtensionStatus(e)).on(z.ALL_DIALER_STATUS,e=>this.onAllDialerStatus(e)).on(z.KEEP_ALIVE_RESPONSE,e=>this.onKeepAliveResponse(e)).on(z.EXTENSIONS_UPDATED,e=>this.onExtensionsUpdatedEvent(e)).on(z.CONNECT,()=>this.onConnect()).on(z.DISCONNECT,e=>this.onDisconnect(e)).on(z.CONNECT_ERROR_EVENT,e=>this.onConnectError(e))}onLoginSuccessEvent(e){this.eventsSdkClass.eventEmitterClass.emit(z.LOGIN_SUCCESS,e)}onQueueEvent(e){this.eventsSdkClass.eventEmitterClass.emit(z.QUEUE_EVENT,Ee.mapQueueEvent(e))}onExtensionEvent(e){const r=Ee.mapExtensionEvent(e);r&&this.eventsSdkClass.eventEmitterClass.emit(z.EXTENSION_EVENT,r)}onDialerEvent(e){this.eventsSdkClass.eventEmitterClass.emit(z.DIALER_EVENT,e)}onLoginStatusEvent(e){this.eventsSdkClass.eventEmitterClass.emit(z.LOGIN_STATUS,e)}onAllExtensionStatus(e){const r=Ee.mapAllExtensionStatus(e);this.eventsSdkClass.eventEmitterClass.emit(z.ALL_EXTENSION_STATUS,r)}onAllDialerStatus(e){this.eventsSdkClass.eventEmitterClass.emit(z.ALL_DIALER_STATUS,e)}onKeepAliveResponse(e){if(e.errorCode){this.initSocketConnection();return}this.eventsSdkClass.loggerClass.log({Message:`Keep alive response: ${e}`,ActionName:pt.WSCONNECT,isShowClient:!1,Status:"Successful",StatusCode:200,Level:et.INFO,LogType:ut.INFO}),this.connected?this.lastEventTimestamp=new Date().getTime():this.initSocketConnection()}onExtensionsUpdatedEvent(e){this.eventsSdkClass.eventEmitterClass.emit(z.EXTENSIONS_UPDATED,e)}onConnect(){this.keepReconnectInterval&&clearInterval(this.keepReconnectInterval),this.connected=!0,this.eventsSdkClass.eventEmitterClass.emit(z.ONLINE_STATUS_EVENT,{isSocketConnected:!0,doReconnect:this.doReconnect}),this.eventsSdkClass.loggerClass.log({Message:`Sdk connected to the socket server ${this.eventsSdkClass.server&&this.eventsSdkClass.server.Domain?this.eventsSdkClass.server.Domain:this.eventsSdkClass.URL}`,ActionName:pt.WSCONNECT,isShowClient:!1,Status:"Connection established",StatusCode:200,Level:et.INFO,LogType:ut.INFO})}onDisconnect(e){this.connected=!1,this.closeAllConnections(),this.eventsSdkClass.eventEmitterClass.emit(z.ONLINE_STATUS_EVENT,{isSocketConnected:!1,doReconnect:this.doReconnect}),this.eventsSdkClass.loggerClass.log({Message:`Sdk disconnected from the socket server ${this.eventsSdkClass.server&&this.eventsSdkClass.server.Domain?this.eventsSdkClass.server.Domain:this.eventsSdkClass.URL} (${e})`,ActionName:pt.WSCONNECT,isShowClient:!1,Status:"Connection closed",StatusCode:200,Level:et.INFO,LogType:ut.INFO}),this.doReconnect&&this.eventsSdkClass.connect(bt.NEXT)}onConnectError(e){this.eventsSdkClass.eventEmitterClass.emit(z.ONLINE_STATUS_EVENT,{isSocketConnected:!1,doReconnect:this.doReconnect}),this.eventsSdkClass.loggerClass.log({Message:`Sdk tries to connect to the socket server ${this.eventsSdkClass.URL} but error (${e})`,ActionName:pt.WSCONNECT,isShowClient:!1,Status:"Connection attempt error",StatusCode:500,Level:et.ERROR,LogType:ut.ERROR}),setTimeout(()=>{this.eventsSdkClass.connect(bt.NEXT)},this.eventsSdkClass.options.reconnectionDelay)}}class Xo{constructor(e){H(this,"storageLogger");this.eventsSdkClass=e,this.eventsSdkClass=e}init(){if(!this.eventsSdkClass.options.useLogger)return;if(this.eventsSdkClass.options.storageLoggerInstance){this.storageLogger=this.eventsSdkClass.options.storageLoggerInstance;return}let e;this.eventsSdkClass.options.loggerSocketConnection&&(e=this.eventsSdkClass.options.loggerSocketConnection),this.eventsSdkClass.socketIoClass.ioFunction&&!e&&(e=this.eventsSdkClass.socketIoClass.ioFunction(this.eventsSdkClass.options.loggerServer,this.eventsSdkClass.options.loggerConnectOptions)),e&&(this.storageLogger=new Lo({socket:e,loggerOptions:this.eventsSdkClass.options.loggerConfig}))}log(e){this.storageLogger?e.Level===et.INFO?this.storageLogger.log(e):e.Level===et.ERROR&&this.storageLogger.error(e):e.Level===et.INFO?console.log(e):e.Level===et.ERROR&&console.error(e)}sdkInitializedLog(e){const r={...e,token:"CENSORED",password:"CENSORED"};this.log({Message:"Sdk initialized with provided options",Body:JSON.stringify(r),ActionName:pt.WSCONNECT,isShowClient:!1,Status:"Sdk initialized",StatusCode:200,Level:et.INFO,LogType:ut.INFO})}}class Ko{constructor(e){H(this,"listeners",{[z.ALL_EXTENSION_STATUS]:[],[z.ALL_DIALER_STATUS]:[],[z.ALL_USERS_STATUS]:[],[z.QUEUE_EVENT]:[],[z.EXTENSION_EVENT]:[],[z.DIALER_EVENT]:[],[z.LOGIN_SUCCESS]:[],[z.LOGIN_STATUS]:[],[z.KEEP_ALIVE_RESPONSE]:[],[z.ONLINE_STATUS_EVENT]:[],[z.EXTENSIONS_UPDATED]:[]});H(this,"allListeners",[]);this.eventsSdkClass=e,this.eventsSdkClass=e}on(e,r){e==="*"?this.allListeners.push(r):this.listeners[e].push(r)}off(e,r){if(e==="*")this.allListeners=this.allListeners.filter(n=>n!==r);else{const o=this.listeners[e].filter(i=>i!==r);this.listeners={...this.listeners,[e]:o}}}emit(e,r){this.eventsSdkClass.socketIoClass.lastEventTimestamp=new Date().getTime(),this.listeners[e].forEach(o=>o({name:e,data:r}));const n={name:e,data:r};this.allListeners.forEach(o=>o(n))}}class Wo{constructor(e){H(this,"options");H(this,"servers",[]);H(this,"URLList",[]);H(this,"server");H(this,"URL");H(this,"socket");H(this,"mainServer");H(this,"alreadyAttemptedOtherServers",[]);H(this,"authClass",new Uo(this));H(this,"socketIoClass",new zo(this));H(this,"loggerClass",new Xo(this));H(this,"eventEmitterClass",new Ko(this));this.options={...Do,...e}}on(e,r){this.eventEmitterClass.on(e,r)}emit(e,...r){this.socketIoClass.io&&this.socketIoClass.io.emit(e,...r)}connect(e){e===bt.MAIN&&this.findMainServer(),e===bt.NEXT&&this.findNextServer(),this.socketIoClass.doReconnect=!0,this.loggerClass.init(),this.socketIoClass.initSocketConnection(),this.socketIoClass.initSocketEvents(),this.socketIoClass.initKeepAlive()}disconnect(){this.socketIoClass.doReconnect=!1,this.socketIoClass.closeAllConnections()}clearKeepAliveInterval(){this.socketIoClass.clearKeepAliveInterval()}findMainServer(){this.servers.length?(this.mainServer=this.servers.reduce((e,r)=>r.Priority>e.Priority?r:e),this.server=this.mainServer):this.URLList.length&&(this.URL=this.URLList[0])}findNextServer(){if(this.servers.length&&this.server)if(this.server.Priority===this.mainServer.Priority){let e=this.servers.filter(r=>r.Priority!==this.mainServer.Priority&&this.alreadyAttemptedOtherServers.indexOf(r.Priority)+1===0);e.length||(this.alreadyAttemptedOtherServers=[],e=this.servers.filter(r=>r.Priority!==this.mainServer.Priority&&this.alreadyAttemptedOtherServers.indexOf(r.Priority)+1===0)),e.length&&(this.server=e.reduce((r,n)=>n.Priority>r.Priority?n:r),this.alreadyAttemptedOtherServers.push(this.server.Priority))}else this.server=this.mainServer;else if(this.URLList.length)if(this.URL===this.URLList[0]){let e=this.URLList.filter(r=>r!==this.URLList[0]&&this.alreadyAttemptedOtherServers.indexOf(r)+1===0);e.length||(this.alreadyAttemptedOtherServers=[],e=this.URLList.filter(r=>r!==this.URLList[0]&&this.alreadyAttemptedOtherServers.indexOf(r)+1===0)),e.length&&(this.URL=e[0],this.alreadyAttemptedOtherServers.push(this.URL))}else this.URL=this.URLList[0]}async init(){return await this.authClass.login(this.options),this.loggerClass.sdkInitializedLog(this.options),!0}}$.CallStatusEnum=wr,$.CallTypeEnum=Sr,$.DialerTypeEnum=Er,$.DirectionEnum=Ar,$.DoNotCallMeStatusCodeEnum=Tr,$.EventsEnum=z,$.ExtensionEventReasonEnum=Se,$.ExtensionHangupCauseEnum=Nr,$.QueueEventReasonEnum=xr,$.ServerListenerEventsEnum=Ae,$.default=Wo,Object.defineProperties($,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
45
20
  //# sourceMappingURL=voicenter-events-sdk.umd.js.map