Comparing version 1.0.2 to 1.0.3
import io from 'socket.io-client' | ||
document.addEventListener('DOMContentLoaded', () => { | ||
const socket = io() | ||
const socket = io('http://' + window.location.hostname + ':3030/') | ||
const callback = ({ output, command }) => { | ||
@@ -6,0 +6,0 @@ socket.emit('callback', { |
@@ -1,1 +0,1 @@ | ||
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?_assertThisInitialized(e):t}function _createSuper(r){var n=_isNativeReflectConstruct();return function(){var e,t=_getPrototypeOf(r);return _possibleConstructorReturn(this,n?(e=_getPrototypeOf(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}function _get(e,t,r){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){e=_superPropBase(e,t);if(e){t=Object.getOwnPropertyDescriptor(e,t);return t.get?t.get.call(r):t.value}})(e,t,r||e)}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(r="Object"===r&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _createForOfIteratorHelper(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,t=function(){};return{s:t,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:t}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,i=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){i=!0,o=e},f:function(){try{s||null==r.return||r.return()}finally{if(i)throw o}}}}function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var build={exports:{}},url$1={},re=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,parts=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],parseuri$2=function(e){var t=e,r=e.indexOf("["),n=e.indexOf("]");-1!=r&&-1!=n&&(e=e.substring(0,r)+e.substring(r,n).replace(/:/g,";")+e.substring(n,e.length));for(var o=re.exec(e||""),s={},i=14;i--;)s[parts[i]]=o[i]||"";return-1!=r&&-1!=n&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=pathNames(s,s.path),s.queryKey=queryKey(s,s.query),s};function pathNames(e,t){var r=t.replace(/\/{2,9}/g,"/").split("/");return"/"!=t.substr(0,1)&&0!==t.length||r.splice(0,1),"/"==t.substr(t.length-1,1)&&r.splice(r.length-1,1),r}function queryKey(e,t){var n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,t,r){t&&(n[t]=r)}),n}var browser={exports:{}},s=1e3,m=60*s,h=60*m,d=24*h,w=7*d,y=365.25*d,ms=function(e,t){t=t||{};var r=_typeof(e);if("string"===r&&0<e.length)return parse(e);if("number"===r&&isFinite(e))return(t.long?fmtLong:fmtShort)(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function parse(e){if(!(100<(e=String(e)).length)){e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(e){var t=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return t*y;case"weeks":case"week":case"w":return t*w;case"days":case"day":case"d":return t*d;case"hours":case"hour":case"hrs":case"hr":case"h":return t*h;case"minutes":case"minute":case"mins":case"min":case"m":return t*m;case"seconds":case"second":case"secs":case"sec":case"s":return t*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function fmtShort(e){var t=Math.abs(e);return d<=t?Math.round(e/d)+"d":h<=t?Math.round(e/h)+"h":m<=t?Math.round(e/m)+"m":s<=t?Math.round(e/s)+"s":e+"ms"}function fmtLong(e){var t=Math.abs(e);return d<=t?plural(e,t,d,"day"):h<=t?plural(e,t,h,"hour"):m<=t?plural(e,t,m,"minute"):s<=t?plural(e,t,s,"second"):e+" ms"}function plural(e,t,r,n){t=1.5*r<=t;return Math.round(e/r)+" "+n+(t?"s":"")}function setup(t){function u(e){var a,t,r,n=null;function c(){for(var n,e,t,o,r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];c.enabled&&(n=c,t=(e=Number(new Date))-(a||e),n.diff=t,n.prev=a,n.curr=e,a=e,s[0]=u.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O"),s[o=0]=s[0].replace(/%([a-zA-Z%])/g,function(e,t){if("%%"===e)return"%";o++;var r=u.formatters[t];return"function"==typeof r&&(t=s[o],e=r.call(n,t),s.splice(o,1),o--),e}),u.formatArgs.call(n,s),(n.log||u.log).apply(n,s))}return c.namespace=e,c.useColors=u.useColors(),c.color=u.selectColor(e),c.extend=o,c.destroy=u.destroy,Object.defineProperty(c,"enabled",{enumerable:!0,configurable:!1,get:function(){return null!==n?n:(t!==u.namespaces&&(t=u.namespaces,r=u.enabled(e)),r)},set:function(e){n=e}}),"function"==typeof u.init&&u.init(c),c}function o(e,t){e=u(this.namespace+(void 0===t?":":t)+e);return e.log=this.log,e}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return((u.debug=u).default=u).coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},u.disable=function(){var e=[].concat(_toConsumableArray(u.names.map(r)),_toConsumableArray(u.skips.map(r).map(function(e){return"-"+e}))).join(",");return u.enable(""),e},u.enable=function(e){var t;u.save(e),u.namespaces=e,u.names=[],u.skips=[];var r=("string"==typeof e?e:"").split(/[\s,]+/),n=r.length;for(t=0;t<n;t++)r[t]&&("-"===(e=r[t].replace(/\*/g,".*?"))[0]?u.skips.push(new RegExp("^"+e.substr(1)+"$")):u.names.push(new RegExp("^"+e+"$")))},u.enabled=function(e){if("*"===e[e.length-1])return!0;var t,r;for(t=0,r=u.skips.length;t<r;t++)if(u.skips[t].test(e))return!1;for(t=0,r=u.names.length;t<r;t++)if(u.names[t].test(e))return!0;return!1},u.humanize=ms,u.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach(function(e){u[e]=t[e]}),u.names=[],u.skips=[],u.formatters={},u.selectColor=function(e){for(var t=0,r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return u.colors[Math.abs(t)%u.colors.length]},u.enable(u.load()),u}var common=setup;!function(o,t){var e;t.formatArgs=function(e){var t,r,n;e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+o.exports.humanize(this.diff),this.useColors&&(t="color: "+this.color,e.splice(1,0,t,"color: inherit"),e[n=r=0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(r++,"%c"===e&&(n=r))}),e.splice(n,0,t))},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){var e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&31<=parseInt(RegExp.$1,10)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(e=!1,function(){e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}),t.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"],t.log=console.debug||console.log||function(){},o.exports=common(t),o.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(browser,browser.exports),Object.defineProperty(url$1,"__esModule",{value:!0}),url$1.url=void 0;var parseuri$1=parseuri$2,debug$7=browser.exports("socket.io-client:url");function url(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",r=e,n=(n=2<arguments.length?arguments[2]:void 0)||"undefined"!=typeof location&&location;"string"==typeof(e=null==e?n.protocol+"//"+n.host:e)&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(debug$7("protocol-less url %s",e),e=void 0!==n?n.protocol+"//"+e:"https://"+e),debug$7("parse %s",e),r=parseuri$1(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";e=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+e+":"+r.port+t,r.href=r.protocol+"://"+e+(n&&n.port===r.port?"":":"+r.port),r}url$1.url=url;var manager={},lib$1={exports:{}},transports$1={},hasCors={exports:{}};try{hasCors.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(err){hasCors.exports=!1}var globalThis_browser="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")(),hasCORS=hasCors.exports,globalThis$3=globalThis_browser,xmlhttprequest=function(e){var t=e.xdomain,r=e.xscheme,e=e.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!t||hasCORS))return new XMLHttpRequest}catch(e){}try{if("undefined"!=typeof XDomainRequest&&!r&&e)return new XDomainRequest}catch(e){}if(!t)try{return new globalThis$3[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(e){}},pollingXhr={exports:{}},PACKET_TYPES$1=Object.create(null);PACKET_TYPES$1.open="0",PACKET_TYPES$1.close="1",PACKET_TYPES$1.ping="2",PACKET_TYPES$1.pong="3",PACKET_TYPES$1.message="4",PACKET_TYPES$1.upgrade="5",PACKET_TYPES$1.noop="6";var PACKET_TYPES_REVERSE$1=Object.create(null);Object.keys(PACKET_TYPES$1).forEach(function(e){PACKET_TYPES_REVERSE$1[PACKET_TYPES$1[e]]=e});var ERROR_PACKET$1={type:"error",data:"parser error"},commons={PACKET_TYPES:PACKET_TYPES$1,PACKET_TYPES_REVERSE:PACKET_TYPES_REVERSE$1,ERROR_PACKET:ERROR_PACKET$1},PACKET_TYPES=commons.PACKET_TYPES,withNativeBlob$1="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),withNativeArrayBuffer$2="function"==typeof ArrayBuffer,isView$1=function(e){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},encodePacket$1=function(e,t,r){var n=e.type,e=e.data;return withNativeBlob$1&&e instanceof Blob?t?r(e):encodeBlobAsBase64(e,r):withNativeArrayBuffer$2&&(e instanceof ArrayBuffer||isView$1(e))?t?r(e instanceof ArrayBuffer?e:e.buffer):encodeBlobAsBase64(new Blob([e]),r):r(PACKET_TYPES[n]+(e||""))},encodeBlobAsBase64=function(e,t){var r=new FileReader;return r.onload=function(){var e=r.result.split(",")[1];t("b"+e)},r.readAsDataURL(e)},encodePacket_browser=encodePacket$1,base64Arraybuffer={};!function(l){base64Arraybuffer.encode=function(e){for(var t=new Uint8Array(e),r=t.length,n="",o=0;o<r;o+=3)n+=l[t[o]>>2],n+=l[(3&t[o])<<4|t[o+1]>>4],n+=l[(15&t[o+1])<<2|t[o+2]>>6],n+=l[63&t[o+2]];return r%3==2?n=n.substring(0,n.length-1)+"=":r%3==1&&(n=n.substring(0,n.length-2)+"=="),n},base64Arraybuffer.decode=function(e){var t,r,n,o,s=.75*e.length,i=e.length,a=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);for(var s=new ArrayBuffer(s),c=new Uint8Array(s),u=0;u<i;u+=4)t=l.indexOf(e[u]),r=l.indexOf(e[u+1]),n=l.indexOf(e[u+2]),o=l.indexOf(e[u+3]),c[a++]=t<<2|r>>4,c[a++]=(15&r)<<4|n>>2,c[a++]=(3&n)<<6|63&o;return s}}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/");var PACKET_TYPES_REVERSE=commons.PACKET_TYPES_REVERSE,ERROR_PACKET=commons.ERROR_PACKET,withNativeArrayBuffer$1="function"==typeof ArrayBuffer,base64decoder;withNativeArrayBuffer$1&&(base64decoder=base64Arraybuffer);var decodePacket$1=function(e,t){if("string"!=typeof e)return{type:"message",data:mapBinary(e,t)};var r=e.charAt(0);return"b"===r?{type:"message",data:decodeBase64Packet(e.substring(1),t)}:PACKET_TYPES_REVERSE[r]?1<e.length?{type:PACKET_TYPES_REVERSE[r],data:e.substring(1)}:{type:PACKET_TYPES_REVERSE[r]}:ERROR_PACKET},decodeBase64Packet=function(e,t){if(base64decoder){var r=base64decoder.decode(e);return mapBinary(r,t)}return{base64:!0,data:e}},mapBinary=function(e,t){return"blob"===t&&e instanceof ArrayBuffer?new Blob([e]):e},decodePacket_browser=decodePacket$1,encodePacket=encodePacket_browser,decodePacket=decodePacket_browser,SEPARATOR=String.fromCharCode(30),encodePayload=function(e,r){var n=e.length,o=new Array(n),s=0;e.forEach(function(e,t){encodePacket(e,!1,function(e){o[t]=e,++s===n&&r(o.join(SEPARATOR))})})},decodePayload=function(e,t){for(var r=e.split(SEPARATOR),n=[],o=0;o<r.length;o++){var s=decodePacket(r[o],t);if(n.push(s),"error"===s.type)break}return n},lib={protocol:4,encodePacket:encodePacket,encodePayload:encodePayload,decodePacket:decodePacket,decodePayload:decodePayload},componentEmitter={exports:{}};!function(){function r(e){if(e)return function(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}(e)}(componentEmitter.exports=r).prototype.on=r.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},r.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<n.length;o++)if((r=n[o])===t||r.fn===t){n.splice(o,1);break}return 0===n.length&&delete this._callbacks["$"+e],this},r.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),r=this._callbacks["$"+e],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(r)for(var n=0,o=(r=r.slice(0)).length;n<o;++n)r[n].apply(this,t);return this},r.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},r.prototype.hasListeners=function(e){return!!this.listeners(e).length}}();var parser$4=lib,Emitter$3=componentEmitter.exports,debug$6=browser.exports("engine.io-client:transport"),Transport$2=function(){_inherits(n,Emitter$3);var r=_createSuper(n);function n(e){var t;return _classCallCheck(this,n),(t=r.call(this)).opts=e,t.query=e.query,t.readyState="",t.socket=e.socket,t}return _createClass(n,[{key:"onError",value:function(e,t){e=new Error(e);return e.type="TransportError",e.description=t,this.emit("error",e),this}},{key:"open",value:function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this}},{key:"close",value:function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}},{key:"send",value:function(e){"open"===this.readyState?this.write(e):debug$6("transport is not open, discarding packets")}},{key:"onOpen",value:function(){this.readyState="open",this.writable=!0,this.emit("open")}},{key:"onData",value:function(e){e=parser$4.decodePacket(e,this.socket.binaryType);this.onPacket(e)}},{key:"onPacket",value:function(e){this.emit("packet",e)}},{key:"onClose",value:function(){this.readyState="closed",this.emit("close")}}]),n}(),transport=Transport$2,parseqs$3={encode:function(e){var t,r="";for(t in e)e.hasOwnProperty(t)&&(r.length&&(r+="&"),r+=encodeURIComponent(t)+"="+encodeURIComponent(e[t]));return r},decode:function(e){for(var t={},r=e.split("&"),n=0,o=r.length;n<o;n++){var s=r[n].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}},alphabet="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),length=64,map={},seed=0,i=0,prev;function encode(e){for(var t="";t=alphabet[e%length]+t,0<(e=Math.floor(e/length)););return t}function decode(e){var t=0;for(i=0;i<e.length;i++)t=t*length+map[e.charAt(i)];return t}function yeast$2(){var e=encode(+new Date);return e!==prev?(seed=0,prev=e):e+"."+encode(seed++)}for(;i<length;i++)map[alphabet[i]]=i;yeast$2.encode=encode,yeast$2.decode=decode;var yeast_1=yeast$2,Transport$1=transport,parseqs$2=parseqs$3,parser$3=lib,yeast$1=yeast_1,debug$5=browser.exports("engine.io-client:polling"),Polling$2=function(){_inherits(t,Transport$1);var e=_createSuper(t);function t(){return _classCallCheck(this,t),e.apply(this,arguments)}return _createClass(t,[{key:"name",get:function(){return"polling"}},{key:"doOpen",value:function(){this.poll()}},{key:"pause",value:function(e){var t=this;this.readyState="pausing";function r(){debug$5("paused"),t.readyState="paused",e()}var n;this.polling||!this.writable?(n=0,this.polling&&(debug$5("we are currently polling - waiting to pause"),n++,this.once("pollComplete",function(){debug$5("pre-pause polling complete"),--n||r()})),this.writable||(debug$5("we are currently writing - waiting to pause"),n++,this.once("drain",function(){debug$5("pre-pause writing complete"),--n||r()}))):r()}},{key:"poll",value:function(){debug$5("polling"),this.polling=!0,this.doPoll(),this.emit("poll")}},{key:"onData",value:function(e){var t=this;debug$5("polling got data %s",e);parser$3.decodePayload(e,this.socket.binaryType).forEach(function(e){if("opening"===t.readyState&&"open"===e.type&&t.onOpen(),"close"===e.type)return t.onClose(),!1;t.onPacket(e)}),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():debug$5('ignoring poll - transport state "%s"',this.readyState))}},{key:"doClose",value:function(){function e(){debug$5("writing close packet"),t.write([{type:"close"}])}var t=this;"open"===this.readyState?(debug$5("transport open - closing"),e()):(debug$5("transport not open - deferring close"),this.once("open",e))}},{key:"write",value:function(e){var t=this;this.writable=!1,parser$3.encodePayload(e,function(e){t.doWrite(e,function(){t.writable=!0,t.emit("drain")})})}},{key:"uri",value:function(){var e=this.query||{},t=this.opts.secure?"https":"http",r="";return!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=yeast$1()),this.supportsBinary||e.sid||(e.b64=1),e=parseqs$2.encode(e),this.opts.port&&("https"==t&&443!==Number(this.opts.port)||"http"==t&&80!==Number(this.opts.port))&&(r=":"+this.opts.port),e.length&&(e="?"+e),t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+e}}]),t}(),polling$1=Polling$2,util={pick:function(r){for(var e=arguments.length,t=new Array(1<e?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return t.reduce(function(e,t){return r.hasOwnProperty(t)&&(e[t]=r[t]),e},{})}},XMLHttpRequest$2=xmlhttprequest,Polling$1=polling$1,Emitter$2=componentEmitter.exports,pick$1=util.pick,globalThis$2=globalThis_browser,debug$4=browser.exports("engine.io-client:polling-xhr");function empty(){}var hasXHR2=null!=new XMLHttpRequest$2({xdomain:!1}).responseType,XHR$1=function(){_inherits(s,Polling$1);var o=_createSuper(s);function s(e){var t,r,n;_classCallCheck(this,s),t=o.call(this,e),"undefined"!=typeof location&&(r="https:"===location.protocol,n=(n=location.port)||(r?443:80),t.xd="undefined"!=typeof location&&e.hostname!==location.hostname||n!==e.port,t.xs=e.secure!==r);e=e&&e.forceBase64;return t.supportsBinary=hasXHR2&&!e,t}return _createClass(s,[{key:"request",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new Request(this.uri(),e)}},{key:"doWrite",value:function(e,t){var r=this,e=this.request({method:"POST",data:e});e.on("success",t),e.on("error",function(e){r.onError("xhr post error",e)})}},{key:"doPoll",value:function(){var t=this;debug$4("xhr poll");var e=this.request();e.on("data",this.onData.bind(this)),e.on("error",function(e){t.onError("xhr poll error",e)}),this.pollXhr=e}}]),s}(),Request=function(){_inherits(o,Emitter$2);var n=_createSuper(o);function o(e,t){var r;return _classCallCheck(this,o),(r=n.call(this)).opts=t,r.method=t.method||"GET",r.uri=e,r.async=!1!==t.async,r.data=void 0!==t.data?t.data:null,r.create(),r}return _createClass(o,[{key:"create",value:function(){var t=this,e=pick$1(this.opts,"agent","enablesXDR","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;var r=this.xhr=new XMLHttpRequest$2(e);try{debug$4("xhr open %s: %s",this.method,this.uri),r.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders)for(var n in r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0),this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(n)&&r.setRequestHeader(n,this.opts.extraHeaders[n])}catch(e){}if("POST"===this.method)try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{r.setRequestHeader("Accept","*/*")}catch(e){}"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),this.hasXDR()?(r.onload=function(){t.onLoad()},r.onerror=function(){t.onError(r.responseText)}):r.onreadystatechange=function(){4===r.readyState&&(200===r.status||1223===r.status?t.onLoad():setTimeout(function(){t.onError("number"==typeof r.status?r.status:0)},0))},debug$4("xhr data %s",this.data),r.send(this.data)}catch(e){return void setTimeout(function(){t.onError(e)},0)}"undefined"!=typeof document&&(this.index=o.requestsCount++,o.requests[this.index]=this)}},{key:"onSuccess",value:function(){this.emit("success"),this.cleanup()}},{key:"onData",value:function(e){this.emit("data",e),this.onSuccess()}},{key:"onError",value:function(e){this.emit("error",e),this.cleanup(!0)}},{key:"cleanup",value:function(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=empty:this.xhr.onreadystatechange=empty,e)try{this.xhr.abort()}catch(e){}"undefined"!=typeof document&&delete o.requests[this.index],this.xhr=null}}},{key:"onLoad",value:function(){var e=this.xhr.responseText;null!==e&&this.onData(e)}},{key:"hasXDR",value:function(){return"undefined"!=typeof XDomainRequest&&!this.xs&&this.enablesXDR}},{key:"abort",value:function(){this.cleanup()}}]),o}(),terminationEvent;function unloadHandler(){for(var e in Request.requests)Request.requests.hasOwnProperty(e)&&Request.requests[e].abort()}Request.requestsCount=0,Request.requests={},"undefined"!=typeof document&&("function"==typeof attachEvent?attachEvent("onunload",unloadHandler):"function"==typeof addEventListener&&(terminationEvent="onpagehide"in globalThis$2?"pagehide":"unload",addEventListener(terminationEvent,unloadHandler,!1))),pollingXhr.exports=XHR$1,pollingXhr.exports.Request=Request;var Polling=polling$1,globalThis$1=globalThis_browser,rNewline=/\n/g,rEscapedNewline=/\\n/g,callbacks,JSONPPolling=function(){_inherits(r,Polling);var t=_createSuper(r);function r(e){return _classCallCheck(this,r),(e=t.call(this,e)).query=e.query||{},callbacks=callbacks||(globalThis$1.___eio=globalThis$1.___eio||[]),e.index=callbacks.length,callbacks.push(e.onData.bind(_assertThisInitialized(e))),e.query.j=e.index,e}return _createClass(r,[{key:"supportsBinary",get:function(){return!1}},{key:"doClose",value:function(){this.script&&(this.script.onerror=function(){},this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),_get(_getPrototypeOf(r.prototype),"doClose",this).call(this)}},{key:"doPoll",value: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(e){t.onError("jsonp poll error",e)};var r=document.getElementsByTagName("script")[0];r?r.parentNode.insertBefore(e,r):(document.head||document.body).appendChild(e),this.script=e,"undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent)&&setTimeout(function(){var e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)},100)}},{key:"doWrite",value:function(e,t){var r,n,o,s,i=this;function a(){c(),t()}this.form||(n=document.createElement("form"),o=document.createElement("textarea"),s=this.iframeId="eio_iframe_"+this.index,n.className="socketio",n.style.position="absolute",n.style.top="-1000px",n.style.left="-1000px",n.target=s,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();var c=function(){if(i.iframe)try{i.form.removeChild(i.iframe)}catch(e){i.onError("jsonp polling iframe removal error",e)}try{var e='<iframe src="javascript:0" name="'+i.iframeId+'">';r=document.createElement(e)}catch(e){(r=document.createElement("iframe")).name=i.iframeId,r.src="javascript:0"}r.id=i.iframeId,i.form.appendChild(r),i.iframe=r};c(),e=e.replace(rEscapedNewline,"\\\n"),this.area.value=e.replace(rNewline,"\\n");try{this.form.submit()}catch(e){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===i.iframe.readyState&&a()}:this.iframe.onload=a}}]),r}(),pollingJsonp=JSONPPolling,globalThis=globalThis_browser,nextTick$1="function"==typeof Promise&&"function"==typeof Promise.resolve?function(e){return Promise.resolve().then(e)}:function(e){return setTimeout(e,0)},websocketConstructor_browser={WebSocket:globalThis.WebSocket||globalThis.MozWebSocket,usingBrowserWebSocket:!0,defaultBinaryType:"arraybuffer",nextTick:nextTick$1},Transport=transport,parser$2=lib,parseqs$1=parseqs$3,yeast=yeast_1,pick=util.pick,WebSocket=websocketConstructor_browser.WebSocket,usingBrowserWebSocket=websocketConstructor_browser.usingBrowserWebSocket,defaultBinaryType=websocketConstructor_browser.defaultBinaryType,nextTick=websocketConstructor_browser.nextTick,debug$3=browser.exports("engine.io-client:websocket"),isReactNative="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),WS=function(){_inherits(n,Transport);var r=_createSuper(n);function n(e){var t;return _classCallCheck(this,n),(t=r.call(this,e)).supportsBinary=!e.forceBase64,t}return _createClass(n,[{key:"name",get:function(){return"websocket"}},{key:"doOpen",value:function(){if(this.check()){var e=this.uri(),t=this.opts.protocols,r=isReactNative?{}:pick(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=usingBrowserWebSocket&&!isReactNative?t?new WebSocket(e,t):new WebSocket(e):new WebSocket(e,t,r)}catch(e){return this.emit("error",e)}this.ws.binaryType=this.socket.binaryType||defaultBinaryType,this.addEventListeners()}}},{key:"addEventListeners",value:function(){var t=this;this.ws.onopen=function(){t.opts.autoUnref&&t.ws._socket.unref(),t.onOpen()},this.ws.onclose=this.onClose.bind(this),this.ws.onmessage=function(e){return t.onData(e.data)},this.ws.onerror=function(e){return t.onError("websocket error",e)}}},{key:"write",value:function(n){var o=this;this.writable=!1;for(var e=0;e<n.length;e++)!function(e){var t=n[e],r=e===n.length-1;parser$2.encodePacket(t,o.supportsBinary,function(e){try{usingBrowserWebSocket&&o.ws.send(e)}catch(e){debug$3("websocket closed before onclose event")}r&&nextTick(function(){o.writable=!0,o.emit("drain")})})}(e)}},{key:"onClose",value:function(){Transport.prototype.onClose.call(this)}},{key:"doClose",value:function(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}},{key:"uri",value:function(){var e=this.query||{},t=this.opts.secure?"wss":"ws",r="";return this.opts.port&&("wss"==t&&443!==Number(this.opts.port)||"ws"==t&&80!==Number(this.opts.port))&&(r=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=yeast()),this.supportsBinary||(e.b64=1),(e=parseqs$1.encode(e)).length&&(e="?"+e),t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+e}},{key:"check",value:function(){return!(!WebSocket||"__initialize"in WebSocket&&this.name===n.prototype.name)}}]),n}(),websocket$1=WS,XMLHttpRequest$1=xmlhttprequest,XHR=pollingXhr.exports,JSONP=pollingJsonp,websocket=websocket$1;function polling(e){var t,r,n=!1,o=!1,s=!1!==e.jsonp;if("undefined"!=typeof location&&(t="https:"===location.protocol,r=(r=location.port)||(t?443:80),n=e.hostname!==location.hostname||r!==e.port,o=e.secure!==t),e.xdomain=n,e.xscheme=o,"open"in new XMLHttpRequest$1(e)&&!e.forceJSONP)return new XHR(e);if(!s)throw new Error("JSONP disabled");return new JSONP(e)}transports$1.polling=polling,transports$1.websocket=websocket;var transports=transports$1,Emitter$1=componentEmitter.exports,debug$2=browser.exports("engine.io-client:socket"),parser$1=lib,parseuri=parseuri$2,parseqs=parseqs$3,Socket$2=function(){_inherits(p,Emitter$1);var n=_createSuper(p);function p(e){var t,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return _classCallCheck(this,p),t=n.call(this),e&&"object"===_typeof(e)&&(r=e,e=null),e?(e=parseuri(e),r.hostname=e.host,r.secure="https"===e.protocol||"wss"===e.protocol,r.port=e.port,e.query&&(r.query=e.query)):r.host&&(r.hostname=parseuri(r.host).host),t.secure=null!=r.secure?r.secure:"undefined"!=typeof location&&"https:"===location.protocol,r.hostname&&!r.port&&(r.port=t.secure?"443":"80"),t.hostname=r.hostname||("undefined"!=typeof location?location.hostname:"localhost"),t.port=r.port||("undefined"!=typeof location&&location.port?location.port:t.secure?443:80),t.transports=r.transports||["polling","websocket"],t.readyState="",t.writeBuffer=[],t.prevBufferLen=0,t.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,jsonp:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},r),t.opts.path=t.opts.path.replace(/\/$/,"")+"/","string"==typeof t.opts.query&&(t.opts.query=parseqs.decode(t.opts.query)),t.id=null,t.upgrades=null,t.pingInterval=null,t.pingTimeout=null,t.pingTimeoutTimer=null,"function"==typeof addEventListener&&(t.opts.closeOnBeforeunload&&addEventListener("beforeunload",function(){t.transport&&(t.transport.removeAllListeners(),t.transport.close())},!1),"localhost"!==t.hostname&&(t.offlineEventListener=function(){t.onClose("transport close")},addEventListener("offline",t.offlineEventListener,!1))),t.open(),t}return _createClass(p,[{key:"createTransport",value:function(e){debug$2('creating transport "%s"',e);var t=clone(this.opts.query);t.EIO=parser$1.protocol,t.transport=e,this.id&&(t.sid=this.id);t=Object.assign({},this.opts.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return debug$2("options: %j",t),new transports[e](t)}},{key:"open",value:function(){var e,t=this;if(this.opts.rememberUpgrade&&p.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void setTimeout(function(){t.emit("error","No transports available")},0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return debug$2("error while creating transport: %s",e),this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}},{key:"setTransport",value:function(e){var t=this;debug$2("setting transport %s",e.name),this.transport&&(debug$2("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),(this.transport=e).on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",function(){t.onClose("transport close")})}},{key:"probe",value:function(r){var n=this;debug$2('probing transport "%s"',r);var o=this.createTransport(r,{probe:1}),t=!1;p.priorWebsocketSuccess=!1;var e=function(){t||(debug$2('probe transport "%s" opened',r),o.send([{type:"ping",data:"probe"}]),o.once("packet",function(e){t||("pong"===e.type&&"probe"===e.data?(debug$2('probe transport "%s" pong',r),n.upgrading=!0,n.emit("upgrading",o),o&&(p.priorWebsocketSuccess="websocket"===o.name,debug$2('pausing current transport "%s"',n.transport.name),n.transport.pause(function(){t||"closed"!==n.readyState&&(debug$2("changing transport and sending upgrade packet"),l(),n.setTransport(o),o.send([{type:"upgrade"}]),n.emit("upgrade",o),o=null,n.upgrading=!1,n.flush())}))):(debug$2('probe transport "%s" failed',r),(e=new Error("probe error")).transport=o.name,n.emit("upgradeError",e)))}))};function s(){t||(t=!0,l(),o.close(),o=null)}var i=function(e){var t=new Error("probe error: "+e);t.transport=o.name,s(),debug$2('probe transport "%s" failed because of error: %s',r,e),n.emit("upgradeError",t)};function a(){i("transport closed")}function c(){i("socket closed")}function u(e){o&&e.name!==o.name&&(debug$2('"%s" works - aborting "%s"',e.name,o.name),s())}var l=function(){o.removeListener("open",e),o.removeListener("error",i),o.removeListener("close",a),n.removeListener("close",c),n.removeListener("upgrading",u)};o.once("open",e),o.once("error",i),o.once("close",a),this.once("close",c),this.once("upgrading",u),o.open()}},{key:"onOpen",value:function(){if(debug$2("socket open"),this.readyState="open",p.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade&&this.transport.pause){debug$2("starting upgrade probes");for(var e=0,t=this.upgrades.length;e<t;e++)this.probe(this.upgrades[e])}}},{key:"onPacket",value:function(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(debug$2('socket receive: type "%s", data "%s"',e.type,e.data),this.emit("packet",e),this.emit("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emit("ping"),this.emit("pong");break;case"error":var t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emit("data",e.data),this.emit("message",e.data)}else debug$2('packet received with socket readyState "%s"',this.readyState)}},{key:"onHandshake",value:function(e){this.emit("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}},{key:"resetPingTimeout",value:function(){var e=this;clearTimeout(this.pingTimeoutTimer),this.pingTimeoutTimer=setTimeout(function(){e.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}},{key:"onDrain",value:function(){this.writeBuffer.splice(0,this.prevBufferLen),(this.prevBufferLen=0)===this.writeBuffer.length?this.emit("drain"):this.flush()}},{key:"flush",value:function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(debug$2("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))}},{key:"write",value:function(e,t,r){return this.sendPacket("message",e,t,r),this}},{key:"send",value:function(e,t,r){return this.sendPacket("message",e,t,r),this}},{key:"sendPacket",value:function(e,t,r,n){"function"==typeof t&&(n=t,t=void 0),"function"==typeof r&&(n=r,r=null),"closing"!==this.readyState&&"closed"!==this.readyState&&((r=r||{}).compress=!1!==r.compress,this.emit("packetCreate",r={type:e,data:t,options:r}),this.writeBuffer.push(r),n&&this.once("flush",n),this.flush())}},{key:"close",value:function(){function e(){r.removeListener("upgrade",e),r.removeListener("upgradeError",e),n()}function t(){r.once("upgrade",e),r.once("upgradeError",e)}var r=this,n=function(){r.onClose("forced close"),debug$2("socket closing - telling transport to close"),r.transport.close()};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",function(){(r.upgrading?t:n)()}):(this.upgrading?t:n)()),this}},{key:"onError",value:function(e){debug$2("socket error %j",e),p.priorWebsocketSuccess=!1,this.emit("error",e),this.onClose("transport error",e)}},{key:"onClose",value:function(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(debug$2('socket close with reason: "%s"',e),clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&removeEventListener("offline",this.offlineEventListener,!1),this.readyState="closed",this.id=null,this.emit("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}},{key:"filterUpgrades",value:function(e){for(var t=[],r=0,n=e.length;r<n;r++)~this.transports.indexOf(e[r])&&t.push(e[r]);return t}}]),p}();function clone(e){var t,r={};for(t in e)e.hasOwnProperty(t)&&(r[t]=e[t]);return r}Socket$2.priorWebsocketSuccess=!1,Socket$2.protocol=parser$1.protocol;var socket$1=Socket$2,Socket$1=socket$1;lib$1.exports=function(e,t){return new Socket$1(e,t)},lib$1.exports.Socket=Socket$1,lib$1.exports.protocol=Socket$1.protocol,lib$1.exports.Transport=transport,lib$1.exports.transports=transports$1,lib$1.exports.parser=lib;var socket={},dist={},binary={},isBinary$1={};Object.defineProperty(isBinary$1,"__esModule",{value:!0}),isBinary$1.hasBinary=isBinary$1.isBinary=void 0;var withNativeArrayBuffer="function"==typeof ArrayBuffer,isView=function(e){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer},toString=Object.prototype.toString,withNativeBlob="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===toString.call(Blob),withNativeFile="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===toString.call(File);function isBinary(e){return withNativeArrayBuffer&&(e instanceof ArrayBuffer||isView(e))||withNativeBlob&&e instanceof Blob||withNativeFile&&e instanceof File}function hasBinary(e,t){if(!e||"object"!==_typeof(e))return!1;if(Array.isArray(e)){for(var r=0,n=e.length;r<n;r++)if(hasBinary(e[r]))return!0;return!1}if(isBinary(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return hasBinary(e.toJSON(),!0);for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&hasBinary(e[o]))return!0;return!1}isBinary$1.isBinary=isBinary,isBinary$1.hasBinary=hasBinary,Object.defineProperty(binary,"__esModule",{value:!0}),binary.reconstructPacket=binary.deconstructPacket=void 0;var is_binary_1=isBinary$1;function deconstructPacket(e){var t=[],r=e.data,e=e;return e.data=_deconstructPacket(r,t),e.attachments=t.length,{packet:e,buffers:t}}function _deconstructPacket(e,t){if(!e)return e;if(is_binary_1.isBinary(e)){var r={_placeholder:!0,num:t.length};return t.push(e),r}if(Array.isArray(e)){for(var n=new Array(e.length),o=0;o<e.length;o++)n[o]=_deconstructPacket(e[o],t);return n}if("object"!==_typeof(e)||e instanceof Date)return e;var s,i={};for(s in e)e.hasOwnProperty(s)&&(i[s]=_deconstructPacket(e[s],t));return i}function reconstructPacket(e,t){return e.data=_reconstructPacket(e.data,t),e.attachments=void 0,e}function _reconstructPacket(e,t){if(!e)return e;if(e&&e._placeholder)return t[e.num];if(Array.isArray(e))for(var r=0;r<e.length;r++)e[r]=_reconstructPacket(e[r],t);else if("object"===_typeof(e))for(var n in e)e.hasOwnProperty(n)&&(e[n]=_reconstructPacket(e[n],t));return e}binary.deconstructPacket=deconstructPacket,binary.reconstructPacket=reconstructPacket,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Decoder=e.Encoder=e.PacketType=e.protocol=void 0;var c,t=componentEmitter.exports,r=binary,n=isBinary$1,u=browser.exports("socket.io-parser");e.protocol=5,(o=c=e.PacketType||(e.PacketType={}))[o.CONNECT=0]="CONNECT",o[o.DISCONNECT=1]="DISCONNECT",o[o.EVENT=2]="EVENT",o[o.ACK=3]="ACK",o[o.CONNECT_ERROR=4]="CONNECT_ERROR",o[o.BINARY_EVENT=5]="BINARY_EVENT",o[o.BINARY_ACK=6]="BINARY_ACK";var o=function(){function e(){_classCallCheck(this,e)}return _createClass(e,[{key:"encode",value:function(e){return u("encoding packet %j",e),e.type!==c.EVENT&&e.type!==c.ACK||!n.hasBinary(e)?[this.encodeAsString(e)]:(e.type=e.type===c.EVENT?c.BINARY_EVENT:c.BINARY_ACK,this.encodeAsBinary(e))}},{key:"encodeAsString",value:function(e){var t=""+e.type;return e.type!==c.BINARY_EVENT&&e.type!==c.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data)),u("encoded %j as %s",e,t),t}},{key:"encodeAsBinary",value:function(e){var t=r.deconstructPacket(e),e=this.encodeAsString(t.packet),t=t.buffers;return t.unshift(e),t}}]),e}();e.Encoder=o;o=function(){_inherits(a,t);var e=_createSuper(a);function a(){return _classCallCheck(this,a),e.call(this)}return _createClass(a,[{key:"add",value:function(e){var t;if("string"==typeof e)(t=this.decodeString(e)).type===c.BINARY_EVENT||t.type===c.BINARY_ACK?(this.reconstructor=new s(t),0===t.attachments&&_get(_getPrototypeOf(a.prototype),"emit",this).call(this,"decoded",t)):_get(_getPrototypeOf(a.prototype),"emit",this).call(this,"decoded",t);else{if(!n.isBinary(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(t=this.reconstructor.takeBinaryData(e))&&(this.reconstructor=null,_get(_getPrototypeOf(a.prototype),"emit",this).call(this,"decoded",t))}}},{key:"decodeString",value:function(e){var t=0,r={type:Number(e.charAt(0))};if(void 0===c[r.type])throw new Error("unknown packet type "+r.type);if(r.type===c.BINARY_EVENT||r.type===c.BINARY_ACK){for(var n=t+1;"-"!==e.charAt(++t)&&t!=e.length;);n=e.substring(n,t);if(n!=Number(n)||"-"!==e.charAt(t))throw new Error("Illegal attachments");r.attachments=Number(n)}if("/"===e.charAt(t+1)){for(var o=t+1;++t;){if(","===e.charAt(t))break;if(t===e.length)break}r.nsp=e.substring(o,t)}else r.nsp="/";o=e.charAt(t+1);if(""!==o&&Number(o)==o){for(var s=t+1;++t;){var i=e.charAt(t);if(null==i||Number(i)!=i){--t;break}if(t===e.length)break}r.id=Number(e.substring(s,t+1))}if(e.charAt(++t)){s=function(e){try{return JSON.parse(e)}catch(e){return!1}}(e.substr(t));if(!a.isPayloadValid(r.type,s))throw new Error("invalid payload");r.data=s}return u("decoded %s as %j",e,r),r}},{key:"destroy",value:function(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}],[{key:"isPayloadValid",value:function(e,t){switch(e){case c.CONNECT:return"object"===_typeof(t);case c.DISCONNECT:return void 0===t;case c.CONNECT_ERROR:return"string"==typeof t||"object"===_typeof(t);case c.EVENT:case c.BINARY_EVENT:return Array.isArray(t)&&0<t.length;case c.ACK:case c.BINARY_ACK:return Array.isArray(t)}}}]),a}();e.Decoder=o;var s=function(){function t(e){_classCallCheck(this,t),this.packet=e,this.buffers=[],this.reconPack=e}return _createClass(t,[{key:"takeBinaryData",value:function(e){if(this.buffers.push(e),this.buffers.length!==this.reconPack.attachments)return null;e=r.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),e}},{key:"finishedReconstruction",value:function(){this.reconPack=null,this.buffers=[]}}]),t}()}(dist);var on$1={};function on(e,t,r){return e.on(t,r),function(){e.off(t,r)}}Object.defineProperty(on$1,"__esModule",{value:!0}),on$1.on=void 0,on$1.on=on;var typedEvents={};Object.defineProperty(typedEvents,"__esModule",{value:!0}),typedEvents.StrictEventEmitter=void 0;var Emitter=componentEmitter.exports,StrictEventEmitter=function(){_inherits(s,Emitter);var e=_createSuper(s);function s(){return _classCallCheck(this,s),e.apply(this,arguments)}return _createClass(s,[{key:"on",value:function(e,t){return _get(_getPrototypeOf(s.prototype),"on",this).call(this,e,t),this}},{key:"once",value:function(e,t){return _get(_getPrototypeOf(s.prototype),"once",this).call(this,e,t),this}},{key:"emit",value:function(e){for(var t,r=arguments.length,n=new Array(1<r?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return(t=_get(_getPrototypeOf(s.prototype),"emit",this)).call.apply(t,[this,e].concat(n)),this}},{key:"emitReserved",value:function(e){for(var t,r=arguments.length,n=new Array(1<r?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return(t=_get(_getPrototypeOf(s.prototype),"emit",this)).call.apply(t,[this,e].concat(n)),this}},{key:"listeners",value:function(e){return _get(_getPrototypeOf(s.prototype),"listeners",this).call(this,e)}}]),s}();typedEvents.StrictEventEmitter=StrictEventEmitter,Object.defineProperty(socket,"__esModule",{value:!0}),socket.Socket=void 0;var socket_io_parser_1=dist,on_1$1=on$1,typed_events_1$1=typedEvents,debug$1=browser.exports("socket.io-client:socket"),RESERVED_EVENTS=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),Socket=function(){_inherits(s,typed_events_1$1.StrictEventEmitter);var o=_createSuper(s);function s(e,t,r){var n;return _classCallCheck(this,s),(n=o.call(this)).receiveBuffer=[],n.sendBuffer=[],n.ids=0,n.acks={},n.flags={},n.io=e,n.nsp=t,n.ids=0,n.acks={},n.receiveBuffer=[],n.sendBuffer=[],n.connected=!1,n.disconnected=!0,n.flags={},r&&r.auth&&(n.auth=r.auth),n.io._autoConnect&&n.open(),n}return _createClass(s,[{key:"subEvents",value:function(){var e;this.subs||(e=this.io,this.subs=[on_1$1.on(e,"open",this.onopen.bind(this)),on_1$1.on(e,"packet",this.onpacket.bind(this)),on_1$1.on(e,"error",this.onerror.bind(this)),on_1$1.on(e,"close",this.onclose.bind(this))])}},{key:"active",get:function(){return!!this.subs}},{key:"connect",value:function(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}},{key:"open",value:function(){return this.connect()}},{key:"send",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.unshift("message"),this.emit.apply(this,t),this}},{key:"emit",value:function(e){if(RESERVED_EVENTS.hasOwnProperty(e))throw new Error('"'+e+'" is a reserved event name');for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];r.unshift(e);var o={type:socket_io_parser_1.PacketType.EVENT,data:r,options:{}};o.options.compress=!1!==this.flags.compress,"function"==typeof r[r.length-1]&&(debug$1("emitting packet with ack id %d",this.ids),this.acks[this.ids]=r.pop(),o.id=this.ids++);e=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!e||!this.connected)?debug$1("discard packet as the transport is not currently writable"):this.connected?this.packet(o):this.sendBuffer.push(o),this.flags={},this}},{key:"packet",value:function(e){e.nsp=this.nsp,this.io._packet(e)}},{key:"onopen",value:function(){var t=this;debug$1("transport is open - connecting"),"function"==typeof this.auth?this.auth(function(e){t.packet({type:socket_io_parser_1.PacketType.CONNECT,data:e})}):this.packet({type:socket_io_parser_1.PacketType.CONNECT,data:this.auth})}},{key:"onerror",value:function(e){this.connected||this.emitReserved("connect_error",e)}},{key:"onclose",value:function(e){debug$1("close (%s)",e),this.connected=!1,this.disconnected=!0,delete this.id,this.emitReserved("disconnect",e)}},{key:"onpacket",value:function(e){if(e.nsp===this.nsp)switch(e.type){case socket_io_parser_1.PacketType.CONNECT:e.data&&e.data.sid?(t=e.data.sid,this.onconnect(t)):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 socket_io_parser_1.PacketType.EVENT:case socket_io_parser_1.PacketType.BINARY_EVENT:this.onevent(e);break;case socket_io_parser_1.PacketType.ACK:case socket_io_parser_1.PacketType.BINARY_ACK:this.onack(e);break;case socket_io_parser_1.PacketType.DISCONNECT:this.ondisconnect();break;case socket_io_parser_1.PacketType.CONNECT_ERROR:var t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}},{key:"onevent",value:function(e){var t=e.data||[];debug$1("emitting event %j",t),null!=e.id&&(debug$1("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}},{key:"emitEvent",value:function(e){if(this._anyListeners&&this._anyListeners.length){var t,r=_createForOfIteratorHelper(this._anyListeners.slice());try{for(r.s();!(t=r.n()).done;)t.value.apply(this,e)}catch(e){r.e(e)}finally{r.f()}}_get(_getPrototypeOf(s.prototype),"emit",this).apply(this,e)}},{key:"ack",value:function(n){var o=this,s=!1;return function(){if(!s){s=!0;for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];debug$1("sending ack %j",t),o.packet({type:socket_io_parser_1.PacketType.ACK,id:n,data:t})}}}},{key:"onack",value:function(e){var t=this.acks[e.id];"function"==typeof t?(debug$1("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),delete this.acks[e.id]):debug$1("bad ack %s",e.id)}},{key:"onconnect",value:function(e){debug$1("socket connected with id %s",e),this.id=e,this.connected=!0,this.disconnected=!1,this.emitBuffered(),this.emitReserved("connect")}},{key:"emitBuffered",value:function(){var t=this;this.receiveBuffer.forEach(function(e){return t.emitEvent(e)}),this.receiveBuffer=[],this.sendBuffer.forEach(function(e){return t.packet(e)}),this.sendBuffer=[]}},{key:"ondisconnect",value:function(){debug$1("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}},{key:"destroy",value:function(){this.subs&&(this.subs.forEach(function(e){return e()}),this.subs=void 0),this.io._destroy(this)}},{key:"disconnect",value:function(){return this.connected&&(debug$1("performing disconnect (%s)",this.nsp),this.packet({type:socket_io_parser_1.PacketType.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}},{key:"close",value:function(){return this.disconnect()}},{key:"compress",value:function(e){return this.flags.compress=e,this}},{key:"volatile",get:function(){return this.flags.volatile=!0,this}},{key:"onAny",value:function(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}},{key:"prependAny",value:function(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}},{key:"offAny",value:function(e){if(!this._anyListeners)return this;if(e){for(var t=this._anyListeners,r=0;r<t.length;r++)if(e===t[r])return t.splice(r,1),this}else this._anyListeners=[];return this}},{key:"listenersAny",value:function(){return this._anyListeners||[]}}]),s}();socket.Socket=Socket;var backo2=Backoff$1;function Backoff$1(e){this.ms=(e=e||{}).min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=0<e.jitter&&e.jitter<=1?e.jitter:0,this.attempts=0}Backoff$1.prototype.duration=function(){var e,t,r=this.ms*Math.pow(this.factor,this.attempts++);return this.jitter&&(e=Math.random(),t=Math.floor(e*this.jitter*r),r=0==(1&Math.floor(10*e))?r-t:r+t),0|Math.min(r,this.max)},Backoff$1.prototype.reset=function(){this.attempts=0},Backoff$1.prototype.setMin=function(e){this.ms=e},Backoff$1.prototype.setMax=function(e){this.max=e},Backoff$1.prototype.setJitter=function(e){this.jitter=e},Object.defineProperty(manager,"__esModule",{value:!0}),manager.Manager=void 0;var eio=lib$1.exports,socket_1=socket,parser=dist,on_1=on$1,Backoff=backo2,typed_events_1=typedEvents,debug=browser.exports("socket.io-client:manager"),Manager=function(){_inherits(o,typed_events_1.StrictEventEmitter);var n=_createSuper(o);function o(e,t){var r;_classCallCheck(this,o),(r=n.call(this)).nsps={},r.subs=[],e&&"object"===_typeof(e)&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",r.opts=t,r.reconnection(!1!==t.reconnection),r.reconnectionAttempts(t.reconnectionAttempts||1/0),r.reconnectionDelay(t.reconnectionDelay||1e3),r.reconnectionDelayMax(t.reconnectionDelayMax||5e3),r.randomizationFactor(t.randomizationFactor||.5),r.backoff=new Backoff({min:r.reconnectionDelay(),max:r.reconnectionDelayMax(),jitter:r.randomizationFactor()}),r.timeout(null==t.timeout?2e4:t.timeout),r._readyState="closed",r.uri=e;e=t.parser||parser;return r.encoder=new e.Encoder,r.decoder=new e.Decoder,r._autoConnect=!1!==t.autoConnect,r._autoConnect&&r.open(),r}return _createClass(o,[{key:"reconnection",value:function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}},{key:"reconnectionAttempts",value:function(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}},{key:"reconnectionDelay",value:function(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null!==(t=this.backoff)&&void 0!==t&&t.setMin(e),this)}},{key:"randomizationFactor",value:function(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null!==(t=this.backoff)&&void 0!==t&&t.setJitter(e),this)}},{key:"reconnectionDelayMax",value:function(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null!==(t=this.backoff)&&void 0!==t&&t.setMax(e),this)}},{key:"timeout",value:function(e){return arguments.length?(this._timeout=e,this):this._timeout}},{key:"maybeReconnectOnOpen",value:function(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}},{key:"open",value:function(t){var r=this;if(debug("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;debug("opening %s",this.uri),this.engine=eio(this.uri,this.opts);var e=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;var o,s,i=on_1.on(e,"open",function(){n.onopen(),t&&t()}),a=on_1.on(e,"error",function(e){debug("error"),n.cleanup(),n._readyState="closed",r.emitReserved("error",e),t?t(e):n.maybeReconnectOnOpen()});return!1!==this._timeout&&(o=this._timeout,debug("connect attempt will timeout after %d",o),0===o&&i(),s=setTimeout(function(){debug("connect attempt timed out after %d",o),i(),e.close(),e.emit("error",new Error("timeout"))},o),this.opts.autoUnref&&s.unref(),this.subs.push(function(){clearTimeout(s)})),this.subs.push(i),this.subs.push(a),this}},{key:"connect",value:function(e){return this.open(e)}},{key:"onopen",value:function(){debug("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");var e=this.engine;this.subs.push(on_1.on(e,"ping",this.onping.bind(this)),on_1.on(e,"data",this.ondata.bind(this)),on_1.on(e,"error",this.onerror.bind(this)),on_1.on(e,"close",this.onclose.bind(this)),on_1.on(this.decoder,"decoded",this.ondecoded.bind(this)))}},{key:"onping",value:function(){this.emitReserved("ping")}},{key:"ondata",value:function(e){this.decoder.add(e)}},{key:"ondecoded",value:function(e){this.emitReserved("packet",e)}},{key:"onerror",value:function(e){debug("error",e),this.emitReserved("error",e)}},{key:"socket",value:function(e,t){var r;return(r=this.nsps[e])||(r=new socket_1.Socket(this,e,t),this.nsps[e]=r),r}},{key:"_destroy",value:function(e){for(var t=0,r=Object.keys(this.nsps);t<r.length;t++){var n=r[t];if(this.nsps[n].active)return void debug("socket %s is still active, skipping close",n)}this._close()}},{key:"_packet",value:function(e){debug("writing packet %j",e);for(var t=this.encoder.encode(e),r=0;r<t.length;r++)this.engine.write(t[r],e.options)}},{key:"cleanup",value:function(){debug("cleanup"),this.subs.forEach(function(e){return e()}),this.subs.length=0,this.decoder.destroy()}},{key:"_close",value:function(){debug("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,"opening"===this._readyState&&this.cleanup(),this.backoff.reset(),this._readyState="closed",this.engine&&this.engine.close()}},{key:"disconnect",value:function(){return this._close()}},{key:"onclose",value:function(e){debug("onclose"),this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e),this._reconnection&&!this.skipReconnect&&this.reconnect()}},{key:"reconnect",value:function(){var t=this;if(this._reconnecting||this.skipReconnect)return this;var e,r,n=this;this.backoff.attempts>=this._reconnectionAttempts?(debug("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1):(e=this.backoff.duration(),debug("will wait %dms before reconnect attempt",e),this._reconnecting=!0,r=setTimeout(function(){n.skipReconnect||(debug("attempting reconnect"),t.emitReserved("reconnect_attempt",n.backoff.attempts),n.skipReconnect||n.open(function(e){e?(debug("reconnect attempt error"),n._reconnecting=!1,n.reconnect(),t.emitReserved("reconnect_error",e)):(debug("reconnect success"),n.onreconnect())}))},e),this.opts.autoUnref&&r.unref(),this.subs.push(function(){clearTimeout(r)}))}},{key:"onreconnect",value:function(){var e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}]),o}();manager.Manager=Manager,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.io=t.Socket=t.Manager=t.protocol=void 0;var s=url$1,i=manager,a=browser.exports("socket.io-client");e.exports=t=r;var c=t.managers={};function r(e,t){"object"===_typeof(e)&&(t=e,e=void 0);var r=s.url(e,(t=t||{}).path||"/socket.io"),n=r.source,o=r.id,e=r.path,e=c[o]&&e in c[o].nsps,o=t.forceNew||t["force new connection"]||!1===t.multiplex||e?(a("ignoring socket cache for %s",n),new i.Manager(n,t)):(c[o]||(a("new io instance for %s",n),c[o]=new i.Manager(n,t)),c[o]);return r.query&&!t.query&&(t.query=r.queryKey),o.socket(r.path,t)}t.io=r;var n=dist;Object.defineProperty(t,"protocol",{enumerable:!0,get:function(){return n.protocol}}),t.connect=r;var o=manager;Object.defineProperty(t,"Manager",{enumerable:!0,get:function(){return o.Manager}});var u=socket;Object.defineProperty(t,"Socket",{enumerable:!0,get:function(){return u.Socket}}),t.default=r}(build,build.exports);var io=getDefaultExportFromCjs(build.exports);io.Manager,io.Socket,document.addEventListener("DOMContentLoaded",()=>{const socket=io(),callback=({output:e,command:t})=>{socket.emit("callback",{command:t,location:window.location.href,userAgent:navigator.userAgent,output:e})};socket.on("command",command=>{try{const output=eval(command);callback({output:output,command:command})}catch(e){callback({output:e.message,command:command})}})}); | ||
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?_assertThisInitialized(e):t}function _createSuper(r){var n=_isNativeReflectConstruct();return function(){var e,t=_getPrototypeOf(r);return _possibleConstructorReturn(this,n?(e=_getPrototypeOf(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}function _get(e,t,r){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){e=_superPropBase(e,t);if(e){t=Object.getOwnPropertyDescriptor(e,t);return t.get?t.get.call(r):t.value}})(e,t,r||e)}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(r="Object"===r&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _createForOfIteratorHelper(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,t=function(){};return{s:t,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:t}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,i=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){i=!0,o=e},f:function(){try{s||null==r.return||r.return()}finally{if(i)throw o}}}}function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var build={exports:{}},url$1={},re=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,parts=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],parseuri$2=function(e){var t=e,r=e.indexOf("["),n=e.indexOf("]");-1!=r&&-1!=n&&(e=e.substring(0,r)+e.substring(r,n).replace(/:/g,";")+e.substring(n,e.length));for(var o=re.exec(e||""),s={},i=14;i--;)s[parts[i]]=o[i]||"";return-1!=r&&-1!=n&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=pathNames(s,s.path),s.queryKey=queryKey(s,s.query),s};function pathNames(e,t){var r=t.replace(/\/{2,9}/g,"/").split("/");return"/"!=t.substr(0,1)&&0!==t.length||r.splice(0,1),"/"==t.substr(t.length-1,1)&&r.splice(r.length-1,1),r}function queryKey(e,t){var n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,t,r){t&&(n[t]=r)}),n}var browser={exports:{}},s=1e3,m=60*s,h=60*m,d=24*h,w=7*d,y=365.25*d,ms=function(e,t){t=t||{};var r=_typeof(e);if("string"===r&&0<e.length)return parse(e);if("number"===r&&isFinite(e))return(t.long?fmtLong:fmtShort)(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function parse(e){if(!(100<(e=String(e)).length)){e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(e){var t=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return t*y;case"weeks":case"week":case"w":return t*w;case"days":case"day":case"d":return t*d;case"hours":case"hour":case"hrs":case"hr":case"h":return t*h;case"minutes":case"minute":case"mins":case"min":case"m":return t*m;case"seconds":case"second":case"secs":case"sec":case"s":return t*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function fmtShort(e){var t=Math.abs(e);return d<=t?Math.round(e/d)+"d":h<=t?Math.round(e/h)+"h":m<=t?Math.round(e/m)+"m":s<=t?Math.round(e/s)+"s":e+"ms"}function fmtLong(e){var t=Math.abs(e);return d<=t?plural(e,t,d,"day"):h<=t?plural(e,t,h,"hour"):m<=t?plural(e,t,m,"minute"):s<=t?plural(e,t,s,"second"):e+" ms"}function plural(e,t,r,n){t=1.5*r<=t;return Math.round(e/r)+" "+n+(t?"s":"")}function setup(t){function u(e){var a,t,r,n=null;function c(){for(var n,e,t,o,r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];c.enabled&&(n=c,t=(e=Number(new Date))-(a||e),n.diff=t,n.prev=a,n.curr=e,a=e,s[0]=u.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O"),s[o=0]=s[0].replace(/%([a-zA-Z%])/g,function(e,t){if("%%"===e)return"%";o++;var r=u.formatters[t];return"function"==typeof r&&(t=s[o],e=r.call(n,t),s.splice(o,1),o--),e}),u.formatArgs.call(n,s),(n.log||u.log).apply(n,s))}return c.namespace=e,c.useColors=u.useColors(),c.color=u.selectColor(e),c.extend=o,c.destroy=u.destroy,Object.defineProperty(c,"enabled",{enumerable:!0,configurable:!1,get:function(){return null!==n?n:(t!==u.namespaces&&(t=u.namespaces,r=u.enabled(e)),r)},set:function(e){n=e}}),"function"==typeof u.init&&u.init(c),c}function o(e,t){e=u(this.namespace+(void 0===t?":":t)+e);return e.log=this.log,e}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return((u.debug=u).default=u).coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},u.disable=function(){var e=[].concat(_toConsumableArray(u.names.map(r)),_toConsumableArray(u.skips.map(r).map(function(e){return"-"+e}))).join(",");return u.enable(""),e},u.enable=function(e){var t;u.save(e),u.namespaces=e,u.names=[],u.skips=[];var r=("string"==typeof e?e:"").split(/[\s,]+/),n=r.length;for(t=0;t<n;t++)r[t]&&("-"===(e=r[t].replace(/\*/g,".*?"))[0]?u.skips.push(new RegExp("^"+e.substr(1)+"$")):u.names.push(new RegExp("^"+e+"$")))},u.enabled=function(e){if("*"===e[e.length-1])return!0;var t,r;for(t=0,r=u.skips.length;t<r;t++)if(u.skips[t].test(e))return!1;for(t=0,r=u.names.length;t<r;t++)if(u.names[t].test(e))return!0;return!1},u.humanize=ms,u.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach(function(e){u[e]=t[e]}),u.names=[],u.skips=[],u.formatters={},u.selectColor=function(e){for(var t=0,r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return u.colors[Math.abs(t)%u.colors.length]},u.enable(u.load()),u}var common=setup;!function(o,t){var e;t.formatArgs=function(e){var t,r,n;e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+o.exports.humanize(this.diff),this.useColors&&(t="color: "+this.color,e.splice(1,0,t,"color: inherit"),e[n=r=0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(r++,"%c"===e&&(n=r))}),e.splice(n,0,t))},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){var e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&31<=parseInt(RegExp.$1,10)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(e=!1,function(){e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}),t.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"],t.log=console.debug||console.log||function(){},o.exports=common(t),o.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(browser,browser.exports),Object.defineProperty(url$1,"__esModule",{value:!0}),url$1.url=void 0;var parseuri$1=parseuri$2,debug$7=browser.exports("socket.io-client:url");function url(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",r=e,n=(n=2<arguments.length?arguments[2]:void 0)||"undefined"!=typeof location&&location;"string"==typeof(e=null==e?n.protocol+"//"+n.host:e)&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(debug$7("protocol-less url %s",e),e=void 0!==n?n.protocol+"//"+e:"https://"+e),debug$7("parse %s",e),r=parseuri$1(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";e=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+e+":"+r.port+t,r.href=r.protocol+"://"+e+(n&&n.port===r.port?"":":"+r.port),r}url$1.url=url;var manager={},lib$1={exports:{}},transports$1={},hasCors={exports:{}};try{hasCors.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(err){hasCors.exports=!1}var globalThis_browser="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")(),hasCORS=hasCors.exports,globalThis$3=globalThis_browser,xmlhttprequest=function(e){var t=e.xdomain,r=e.xscheme,e=e.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!t||hasCORS))return new XMLHttpRequest}catch(e){}try{if("undefined"!=typeof XDomainRequest&&!r&&e)return new XDomainRequest}catch(e){}if(!t)try{return new globalThis$3[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch(e){}},pollingXhr={exports:{}},PACKET_TYPES$1=Object.create(null);PACKET_TYPES$1.open="0",PACKET_TYPES$1.close="1",PACKET_TYPES$1.ping="2",PACKET_TYPES$1.pong="3",PACKET_TYPES$1.message="4",PACKET_TYPES$1.upgrade="5",PACKET_TYPES$1.noop="6";var PACKET_TYPES_REVERSE$1=Object.create(null);Object.keys(PACKET_TYPES$1).forEach(function(e){PACKET_TYPES_REVERSE$1[PACKET_TYPES$1[e]]=e});var ERROR_PACKET$1={type:"error",data:"parser error"},commons={PACKET_TYPES:PACKET_TYPES$1,PACKET_TYPES_REVERSE:PACKET_TYPES_REVERSE$1,ERROR_PACKET:ERROR_PACKET$1},PACKET_TYPES=commons.PACKET_TYPES,withNativeBlob$1="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),withNativeArrayBuffer$2="function"==typeof ArrayBuffer,isView$1=function(e){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},encodePacket$1=function(e,t,r){var n=e.type,e=e.data;return withNativeBlob$1&&e instanceof Blob?t?r(e):encodeBlobAsBase64(e,r):withNativeArrayBuffer$2&&(e instanceof ArrayBuffer||isView$1(e))?t?r(e instanceof ArrayBuffer?e:e.buffer):encodeBlobAsBase64(new Blob([e]),r):r(PACKET_TYPES[n]+(e||""))},encodeBlobAsBase64=function(e,t){var r=new FileReader;return r.onload=function(){var e=r.result.split(",")[1];t("b"+e)},r.readAsDataURL(e)},encodePacket_browser=encodePacket$1,base64Arraybuffer={};!function(l){base64Arraybuffer.encode=function(e){for(var t=new Uint8Array(e),r=t.length,n="",o=0;o<r;o+=3)n+=l[t[o]>>2],n+=l[(3&t[o])<<4|t[o+1]>>4],n+=l[(15&t[o+1])<<2|t[o+2]>>6],n+=l[63&t[o+2]];return r%3==2?n=n.substring(0,n.length-1)+"=":r%3==1&&(n=n.substring(0,n.length-2)+"=="),n},base64Arraybuffer.decode=function(e){var t,r,n,o,s=.75*e.length,i=e.length,a=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);for(var s=new ArrayBuffer(s),c=new Uint8Array(s),u=0;u<i;u+=4)t=l.indexOf(e[u]),r=l.indexOf(e[u+1]),n=l.indexOf(e[u+2]),o=l.indexOf(e[u+3]),c[a++]=t<<2|r>>4,c[a++]=(15&r)<<4|n>>2,c[a++]=(3&n)<<6|63&o;return s}}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/");var PACKET_TYPES_REVERSE=commons.PACKET_TYPES_REVERSE,ERROR_PACKET=commons.ERROR_PACKET,withNativeArrayBuffer$1="function"==typeof ArrayBuffer,base64decoder;withNativeArrayBuffer$1&&(base64decoder=base64Arraybuffer);var decodePacket$1=function(e,t){if("string"!=typeof e)return{type:"message",data:mapBinary(e,t)};var r=e.charAt(0);return"b"===r?{type:"message",data:decodeBase64Packet(e.substring(1),t)}:PACKET_TYPES_REVERSE[r]?1<e.length?{type:PACKET_TYPES_REVERSE[r],data:e.substring(1)}:{type:PACKET_TYPES_REVERSE[r]}:ERROR_PACKET},decodeBase64Packet=function(e,t){if(base64decoder){var r=base64decoder.decode(e);return mapBinary(r,t)}return{base64:!0,data:e}},mapBinary=function(e,t){return"blob"===t&&e instanceof ArrayBuffer?new Blob([e]):e},decodePacket_browser=decodePacket$1,encodePacket=encodePacket_browser,decodePacket=decodePacket_browser,SEPARATOR=String.fromCharCode(30),encodePayload=function(e,r){var n=e.length,o=new Array(n),s=0;e.forEach(function(e,t){encodePacket(e,!1,function(e){o[t]=e,++s===n&&r(o.join(SEPARATOR))})})},decodePayload=function(e,t){for(var r=e.split(SEPARATOR),n=[],o=0;o<r.length;o++){var s=decodePacket(r[o],t);if(n.push(s),"error"===s.type)break}return n},lib={protocol:4,encodePacket:encodePacket,encodePayload:encodePayload,decodePacket:decodePacket,decodePayload:decodePayload},componentEmitter={exports:{}};!function(){function r(e){if(e)return function(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}(e)}(componentEmitter.exports=r).prototype.on=r.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},r.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<n.length;o++)if((r=n[o])===t||r.fn===t){n.splice(o,1);break}return 0===n.length&&delete this._callbacks["$"+e],this},r.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),r=this._callbacks["$"+e],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(r)for(var n=0,o=(r=r.slice(0)).length;n<o;++n)r[n].apply(this,t);return this},r.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},r.prototype.hasListeners=function(e){return!!this.listeners(e).length}}();var parser$4=lib,Emitter$3=componentEmitter.exports,debug$6=browser.exports("engine.io-client:transport"),Transport$2=function(){_inherits(n,Emitter$3);var r=_createSuper(n);function n(e){var t;return _classCallCheck(this,n),(t=r.call(this)).opts=e,t.query=e.query,t.readyState="",t.socket=e.socket,t}return _createClass(n,[{key:"onError",value:function(e,t){e=new Error(e);return e.type="TransportError",e.description=t,this.emit("error",e),this}},{key:"open",value:function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this}},{key:"close",value:function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}},{key:"send",value:function(e){"open"===this.readyState?this.write(e):debug$6("transport is not open, discarding packets")}},{key:"onOpen",value:function(){this.readyState="open",this.writable=!0,this.emit("open")}},{key:"onData",value:function(e){e=parser$4.decodePacket(e,this.socket.binaryType);this.onPacket(e)}},{key:"onPacket",value:function(e){this.emit("packet",e)}},{key:"onClose",value:function(){this.readyState="closed",this.emit("close")}}]),n}(),transport=Transport$2,parseqs$3={encode:function(e){var t,r="";for(t in e)e.hasOwnProperty(t)&&(r.length&&(r+="&"),r+=encodeURIComponent(t)+"="+encodeURIComponent(e[t]));return r},decode:function(e){for(var t={},r=e.split("&"),n=0,o=r.length;n<o;n++){var s=r[n].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}},alphabet="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),length=64,map={},seed=0,i=0,prev;function encode(e){for(var t="";t=alphabet[e%length]+t,0<(e=Math.floor(e/length)););return t}function decode(e){var t=0;for(i=0;i<e.length;i++)t=t*length+map[e.charAt(i)];return t}function yeast$2(){var e=encode(+new Date);return e!==prev?(seed=0,prev=e):e+"."+encode(seed++)}for(;i<length;i++)map[alphabet[i]]=i;yeast$2.encode=encode,yeast$2.decode=decode;var yeast_1=yeast$2,Transport$1=transport,parseqs$2=parseqs$3,parser$3=lib,yeast$1=yeast_1,debug$5=browser.exports("engine.io-client:polling"),Polling$2=function(){_inherits(t,Transport$1);var e=_createSuper(t);function t(){return _classCallCheck(this,t),e.apply(this,arguments)}return _createClass(t,[{key:"name",get:function(){return"polling"}},{key:"doOpen",value:function(){this.poll()}},{key:"pause",value:function(e){var t=this;this.readyState="pausing";function r(){debug$5("paused"),t.readyState="paused",e()}var n;this.polling||!this.writable?(n=0,this.polling&&(debug$5("we are currently polling - waiting to pause"),n++,this.once("pollComplete",function(){debug$5("pre-pause polling complete"),--n||r()})),this.writable||(debug$5("we are currently writing - waiting to pause"),n++,this.once("drain",function(){debug$5("pre-pause writing complete"),--n||r()}))):r()}},{key:"poll",value:function(){debug$5("polling"),this.polling=!0,this.doPoll(),this.emit("poll")}},{key:"onData",value:function(e){var t=this;debug$5("polling got data %s",e);parser$3.decodePayload(e,this.socket.binaryType).forEach(function(e){if("opening"===t.readyState&&"open"===e.type&&t.onOpen(),"close"===e.type)return t.onClose(),!1;t.onPacket(e)}),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():debug$5('ignoring poll - transport state "%s"',this.readyState))}},{key:"doClose",value:function(){function e(){debug$5("writing close packet"),t.write([{type:"close"}])}var t=this;"open"===this.readyState?(debug$5("transport open - closing"),e()):(debug$5("transport not open - deferring close"),this.once("open",e))}},{key:"write",value:function(e){var t=this;this.writable=!1,parser$3.encodePayload(e,function(e){t.doWrite(e,function(){t.writable=!0,t.emit("drain")})})}},{key:"uri",value:function(){var e=this.query||{},t=this.opts.secure?"https":"http",r="";return!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=yeast$1()),this.supportsBinary||e.sid||(e.b64=1),e=parseqs$2.encode(e),this.opts.port&&("https"==t&&443!==Number(this.opts.port)||"http"==t&&80!==Number(this.opts.port))&&(r=":"+this.opts.port),e.length&&(e="?"+e),t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+e}}]),t}(),polling$1=Polling$2,util={pick:function(r){for(var e=arguments.length,t=new Array(1<e?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return t.reduce(function(e,t){return r.hasOwnProperty(t)&&(e[t]=r[t]),e},{})}},XMLHttpRequest$2=xmlhttprequest,Polling$1=polling$1,Emitter$2=componentEmitter.exports,pick$1=util.pick,globalThis$2=globalThis_browser,debug$4=browser.exports("engine.io-client:polling-xhr");function empty(){}var hasXHR2=null!=new XMLHttpRequest$2({xdomain:!1}).responseType,XHR$1=function(){_inherits(s,Polling$1);var o=_createSuper(s);function s(e){var t,r,n;_classCallCheck(this,s),t=o.call(this,e),"undefined"!=typeof location&&(r="https:"===location.protocol,n=(n=location.port)||(r?443:80),t.xd="undefined"!=typeof location&&e.hostname!==location.hostname||n!==e.port,t.xs=e.secure!==r);e=e&&e.forceBase64;return t.supportsBinary=hasXHR2&&!e,t}return _createClass(s,[{key:"request",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new Request(this.uri(),e)}},{key:"doWrite",value:function(e,t){var r=this,e=this.request({method:"POST",data:e});e.on("success",t),e.on("error",function(e){r.onError("xhr post error",e)})}},{key:"doPoll",value:function(){var t=this;debug$4("xhr poll");var e=this.request();e.on("data",this.onData.bind(this)),e.on("error",function(e){t.onError("xhr poll error",e)}),this.pollXhr=e}}]),s}(),Request=function(){_inherits(o,Emitter$2);var n=_createSuper(o);function o(e,t){var r;return _classCallCheck(this,o),(r=n.call(this)).opts=t,r.method=t.method||"GET",r.uri=e,r.async=!1!==t.async,r.data=void 0!==t.data?t.data:null,r.create(),r}return _createClass(o,[{key:"create",value:function(){var t=this,e=pick$1(this.opts,"agent","enablesXDR","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;var r=this.xhr=new XMLHttpRequest$2(e);try{debug$4("xhr open %s: %s",this.method,this.uri),r.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders)for(var n in r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0),this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(n)&&r.setRequestHeader(n,this.opts.extraHeaders[n])}catch(e){}if("POST"===this.method)try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{r.setRequestHeader("Accept","*/*")}catch(e){}"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),this.hasXDR()?(r.onload=function(){t.onLoad()},r.onerror=function(){t.onError(r.responseText)}):r.onreadystatechange=function(){4===r.readyState&&(200===r.status||1223===r.status?t.onLoad():setTimeout(function(){t.onError("number"==typeof r.status?r.status:0)},0))},debug$4("xhr data %s",this.data),r.send(this.data)}catch(e){return void setTimeout(function(){t.onError(e)},0)}"undefined"!=typeof document&&(this.index=o.requestsCount++,o.requests[this.index]=this)}},{key:"onSuccess",value:function(){this.emit("success"),this.cleanup()}},{key:"onData",value:function(e){this.emit("data",e),this.onSuccess()}},{key:"onError",value:function(e){this.emit("error",e),this.cleanup(!0)}},{key:"cleanup",value:function(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=empty:this.xhr.onreadystatechange=empty,e)try{this.xhr.abort()}catch(e){}"undefined"!=typeof document&&delete o.requests[this.index],this.xhr=null}}},{key:"onLoad",value:function(){var e=this.xhr.responseText;null!==e&&this.onData(e)}},{key:"hasXDR",value:function(){return"undefined"!=typeof XDomainRequest&&!this.xs&&this.enablesXDR}},{key:"abort",value:function(){this.cleanup()}}]),o}(),terminationEvent;function unloadHandler(){for(var e in Request.requests)Request.requests.hasOwnProperty(e)&&Request.requests[e].abort()}Request.requestsCount=0,Request.requests={},"undefined"!=typeof document&&("function"==typeof attachEvent?attachEvent("onunload",unloadHandler):"function"==typeof addEventListener&&(terminationEvent="onpagehide"in globalThis$2?"pagehide":"unload",addEventListener(terminationEvent,unloadHandler,!1))),pollingXhr.exports=XHR$1,pollingXhr.exports.Request=Request;var Polling=polling$1,globalThis$1=globalThis_browser,rNewline=/\n/g,rEscapedNewline=/\\n/g,callbacks,JSONPPolling=function(){_inherits(r,Polling);var t=_createSuper(r);function r(e){return _classCallCheck(this,r),(e=t.call(this,e)).query=e.query||{},callbacks=callbacks||(globalThis$1.___eio=globalThis$1.___eio||[]),e.index=callbacks.length,callbacks.push(e.onData.bind(_assertThisInitialized(e))),e.query.j=e.index,e}return _createClass(r,[{key:"supportsBinary",get:function(){return!1}},{key:"doClose",value:function(){this.script&&(this.script.onerror=function(){},this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),_get(_getPrototypeOf(r.prototype),"doClose",this).call(this)}},{key:"doPoll",value: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(e){t.onError("jsonp poll error",e)};var r=document.getElementsByTagName("script")[0];r?r.parentNode.insertBefore(e,r):(document.head||document.body).appendChild(e),this.script=e,"undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent)&&setTimeout(function(){var e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)},100)}},{key:"doWrite",value:function(e,t){var r,n,o,s,i=this;function a(){c(),t()}this.form||(n=document.createElement("form"),o=document.createElement("textarea"),s=this.iframeId="eio_iframe_"+this.index,n.className="socketio",n.style.position="absolute",n.style.top="-1000px",n.style.left="-1000px",n.target=s,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();var c=function(){if(i.iframe)try{i.form.removeChild(i.iframe)}catch(e){i.onError("jsonp polling iframe removal error",e)}try{var e='<iframe src="javascript:0" name="'+i.iframeId+'">';r=document.createElement(e)}catch(e){(r=document.createElement("iframe")).name=i.iframeId,r.src="javascript:0"}r.id=i.iframeId,i.form.appendChild(r),i.iframe=r};c(),e=e.replace(rEscapedNewline,"\\\n"),this.area.value=e.replace(rNewline,"\\n");try{this.form.submit()}catch(e){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===i.iframe.readyState&&a()}:this.iframe.onload=a}}]),r}(),pollingJsonp=JSONPPolling,globalThis=globalThis_browser,nextTick$1="function"==typeof Promise&&"function"==typeof Promise.resolve?function(e){return Promise.resolve().then(e)}:function(e){return setTimeout(e,0)},websocketConstructor_browser={WebSocket:globalThis.WebSocket||globalThis.MozWebSocket,usingBrowserWebSocket:!0,defaultBinaryType:"arraybuffer",nextTick:nextTick$1},Transport=transport,parser$2=lib,parseqs$1=parseqs$3,yeast=yeast_1,pick=util.pick,WebSocket=websocketConstructor_browser.WebSocket,usingBrowserWebSocket=websocketConstructor_browser.usingBrowserWebSocket,defaultBinaryType=websocketConstructor_browser.defaultBinaryType,nextTick=websocketConstructor_browser.nextTick,debug$3=browser.exports("engine.io-client:websocket"),isReactNative="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),WS=function(){_inherits(n,Transport);var r=_createSuper(n);function n(e){var t;return _classCallCheck(this,n),(t=r.call(this,e)).supportsBinary=!e.forceBase64,t}return _createClass(n,[{key:"name",get:function(){return"websocket"}},{key:"doOpen",value:function(){if(this.check()){var e=this.uri(),t=this.opts.protocols,r=isReactNative?{}:pick(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=usingBrowserWebSocket&&!isReactNative?t?new WebSocket(e,t):new WebSocket(e):new WebSocket(e,t,r)}catch(e){return this.emit("error",e)}this.ws.binaryType=this.socket.binaryType||defaultBinaryType,this.addEventListeners()}}},{key:"addEventListeners",value:function(){var t=this;this.ws.onopen=function(){t.opts.autoUnref&&t.ws._socket.unref(),t.onOpen()},this.ws.onclose=this.onClose.bind(this),this.ws.onmessage=function(e){return t.onData(e.data)},this.ws.onerror=function(e){return t.onError("websocket error",e)}}},{key:"write",value:function(n){var o=this;this.writable=!1;for(var e=0;e<n.length;e++)!function(e){var t=n[e],r=e===n.length-1;parser$2.encodePacket(t,o.supportsBinary,function(e){try{usingBrowserWebSocket&&o.ws.send(e)}catch(e){debug$3("websocket closed before onclose event")}r&&nextTick(function(){o.writable=!0,o.emit("drain")})})}(e)}},{key:"onClose",value:function(){Transport.prototype.onClose.call(this)}},{key:"doClose",value:function(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}},{key:"uri",value:function(){var e=this.query||{},t=this.opts.secure?"wss":"ws",r="";return this.opts.port&&("wss"==t&&443!==Number(this.opts.port)||"ws"==t&&80!==Number(this.opts.port))&&(r=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=yeast()),this.supportsBinary||(e.b64=1),(e=parseqs$1.encode(e)).length&&(e="?"+e),t+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+e}},{key:"check",value:function(){return!(!WebSocket||"__initialize"in WebSocket&&this.name===n.prototype.name)}}]),n}(),websocket$1=WS,XMLHttpRequest$1=xmlhttprequest,XHR=pollingXhr.exports,JSONP=pollingJsonp,websocket=websocket$1;function polling(e){var t,r,n=!1,o=!1,s=!1!==e.jsonp;if("undefined"!=typeof location&&(t="https:"===location.protocol,r=(r=location.port)||(t?443:80),n=e.hostname!==location.hostname||r!==e.port,o=e.secure!==t),e.xdomain=n,e.xscheme=o,"open"in new XMLHttpRequest$1(e)&&!e.forceJSONP)return new XHR(e);if(!s)throw new Error("JSONP disabled");return new JSONP(e)}transports$1.polling=polling,transports$1.websocket=websocket;var transports=transports$1,Emitter$1=componentEmitter.exports,debug$2=browser.exports("engine.io-client:socket"),parser$1=lib,parseuri=parseuri$2,parseqs=parseqs$3,Socket$2=function(){_inherits(p,Emitter$1);var n=_createSuper(p);function p(e){var t,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return _classCallCheck(this,p),t=n.call(this),e&&"object"===_typeof(e)&&(r=e,e=null),e?(e=parseuri(e),r.hostname=e.host,r.secure="https"===e.protocol||"wss"===e.protocol,r.port=e.port,e.query&&(r.query=e.query)):r.host&&(r.hostname=parseuri(r.host).host),t.secure=null!=r.secure?r.secure:"undefined"!=typeof location&&"https:"===location.protocol,r.hostname&&!r.port&&(r.port=t.secure?"443":"80"),t.hostname=r.hostname||("undefined"!=typeof location?location.hostname:"localhost"),t.port=r.port||("undefined"!=typeof location&&location.port?location.port:t.secure?443:80),t.transports=r.transports||["polling","websocket"],t.readyState="",t.writeBuffer=[],t.prevBufferLen=0,t.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,jsonp:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},r),t.opts.path=t.opts.path.replace(/\/$/,"")+"/","string"==typeof t.opts.query&&(t.opts.query=parseqs.decode(t.opts.query)),t.id=null,t.upgrades=null,t.pingInterval=null,t.pingTimeout=null,t.pingTimeoutTimer=null,"function"==typeof addEventListener&&(t.opts.closeOnBeforeunload&&addEventListener("beforeunload",function(){t.transport&&(t.transport.removeAllListeners(),t.transport.close())},!1),"localhost"!==t.hostname&&(t.offlineEventListener=function(){t.onClose("transport close")},addEventListener("offline",t.offlineEventListener,!1))),t.open(),t}return _createClass(p,[{key:"createTransport",value:function(e){debug$2('creating transport "%s"',e);var t=clone(this.opts.query);t.EIO=parser$1.protocol,t.transport=e,this.id&&(t.sid=this.id);t=Object.assign({},this.opts.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return debug$2("options: %j",t),new transports[e](t)}},{key:"open",value:function(){var e,t=this;if(this.opts.rememberUpgrade&&p.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void setTimeout(function(){t.emit("error","No transports available")},0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return debug$2("error while creating transport: %s",e),this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}},{key:"setTransport",value:function(e){var t=this;debug$2("setting transport %s",e.name),this.transport&&(debug$2("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),(this.transport=e).on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",function(){t.onClose("transport close")})}},{key:"probe",value:function(r){var n=this;debug$2('probing transport "%s"',r);var o=this.createTransport(r,{probe:1}),t=!1;p.priorWebsocketSuccess=!1;var e=function(){t||(debug$2('probe transport "%s" opened',r),o.send([{type:"ping",data:"probe"}]),o.once("packet",function(e){t||("pong"===e.type&&"probe"===e.data?(debug$2('probe transport "%s" pong',r),n.upgrading=!0,n.emit("upgrading",o),o&&(p.priorWebsocketSuccess="websocket"===o.name,debug$2('pausing current transport "%s"',n.transport.name),n.transport.pause(function(){t||"closed"!==n.readyState&&(debug$2("changing transport and sending upgrade packet"),l(),n.setTransport(o),o.send([{type:"upgrade"}]),n.emit("upgrade",o),o=null,n.upgrading=!1,n.flush())}))):(debug$2('probe transport "%s" failed',r),(e=new Error("probe error")).transport=o.name,n.emit("upgradeError",e)))}))};function s(){t||(t=!0,l(),o.close(),o=null)}var i=function(e){var t=new Error("probe error: "+e);t.transport=o.name,s(),debug$2('probe transport "%s" failed because of error: %s',r,e),n.emit("upgradeError",t)};function a(){i("transport closed")}function c(){i("socket closed")}function u(e){o&&e.name!==o.name&&(debug$2('"%s" works - aborting "%s"',e.name,o.name),s())}var l=function(){o.removeListener("open",e),o.removeListener("error",i),o.removeListener("close",a),n.removeListener("close",c),n.removeListener("upgrading",u)};o.once("open",e),o.once("error",i),o.once("close",a),this.once("close",c),this.once("upgrading",u),o.open()}},{key:"onOpen",value:function(){if(debug$2("socket open"),this.readyState="open",p.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade&&this.transport.pause){debug$2("starting upgrade probes");for(var e=0,t=this.upgrades.length;e<t;e++)this.probe(this.upgrades[e])}}},{key:"onPacket",value:function(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(debug$2('socket receive: type "%s", data "%s"',e.type,e.data),this.emit("packet",e),this.emit("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emit("ping"),this.emit("pong");break;case"error":var t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emit("data",e.data),this.emit("message",e.data)}else debug$2('packet received with socket readyState "%s"',this.readyState)}},{key:"onHandshake",value:function(e){this.emit("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}},{key:"resetPingTimeout",value:function(){var e=this;clearTimeout(this.pingTimeoutTimer),this.pingTimeoutTimer=setTimeout(function(){e.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}},{key:"onDrain",value:function(){this.writeBuffer.splice(0,this.prevBufferLen),(this.prevBufferLen=0)===this.writeBuffer.length?this.emit("drain"):this.flush()}},{key:"flush",value:function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(debug$2("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))}},{key:"write",value:function(e,t,r){return this.sendPacket("message",e,t,r),this}},{key:"send",value:function(e,t,r){return this.sendPacket("message",e,t,r),this}},{key:"sendPacket",value:function(e,t,r,n){"function"==typeof t&&(n=t,t=void 0),"function"==typeof r&&(n=r,r=null),"closing"!==this.readyState&&"closed"!==this.readyState&&((r=r||{}).compress=!1!==r.compress,this.emit("packetCreate",r={type:e,data:t,options:r}),this.writeBuffer.push(r),n&&this.once("flush",n),this.flush())}},{key:"close",value:function(){function e(){r.removeListener("upgrade",e),r.removeListener("upgradeError",e),n()}function t(){r.once("upgrade",e),r.once("upgradeError",e)}var r=this,n=function(){r.onClose("forced close"),debug$2("socket closing - telling transport to close"),r.transport.close()};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",function(){(r.upgrading?t:n)()}):(this.upgrading?t:n)()),this}},{key:"onError",value:function(e){debug$2("socket error %j",e),p.priorWebsocketSuccess=!1,this.emit("error",e),this.onClose("transport error",e)}},{key:"onClose",value:function(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(debug$2('socket close with reason: "%s"',e),clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&removeEventListener("offline",this.offlineEventListener,!1),this.readyState="closed",this.id=null,this.emit("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}},{key:"filterUpgrades",value:function(e){for(var t=[],r=0,n=e.length;r<n;r++)~this.transports.indexOf(e[r])&&t.push(e[r]);return t}}]),p}();function clone(e){var t,r={};for(t in e)e.hasOwnProperty(t)&&(r[t]=e[t]);return r}Socket$2.priorWebsocketSuccess=!1,Socket$2.protocol=parser$1.protocol;var socket$1=Socket$2,Socket$1=socket$1;lib$1.exports=function(e,t){return new Socket$1(e,t)},lib$1.exports.Socket=Socket$1,lib$1.exports.protocol=Socket$1.protocol,lib$1.exports.Transport=transport,lib$1.exports.transports=transports$1,lib$1.exports.parser=lib;var socket={},dist={},binary={},isBinary$1={};Object.defineProperty(isBinary$1,"__esModule",{value:!0}),isBinary$1.hasBinary=isBinary$1.isBinary=void 0;var withNativeArrayBuffer="function"==typeof ArrayBuffer,isView=function(e){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer},toString=Object.prototype.toString,withNativeBlob="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===toString.call(Blob),withNativeFile="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===toString.call(File);function isBinary(e){return withNativeArrayBuffer&&(e instanceof ArrayBuffer||isView(e))||withNativeBlob&&e instanceof Blob||withNativeFile&&e instanceof File}function hasBinary(e,t){if(!e||"object"!==_typeof(e))return!1;if(Array.isArray(e)){for(var r=0,n=e.length;r<n;r++)if(hasBinary(e[r]))return!0;return!1}if(isBinary(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return hasBinary(e.toJSON(),!0);for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&hasBinary(e[o]))return!0;return!1}isBinary$1.isBinary=isBinary,isBinary$1.hasBinary=hasBinary,Object.defineProperty(binary,"__esModule",{value:!0}),binary.reconstructPacket=binary.deconstructPacket=void 0;var is_binary_1=isBinary$1;function deconstructPacket(e){var t=[],r=e.data,e=e;return e.data=_deconstructPacket(r,t),e.attachments=t.length,{packet:e,buffers:t}}function _deconstructPacket(e,t){if(!e)return e;if(is_binary_1.isBinary(e)){var r={_placeholder:!0,num:t.length};return t.push(e),r}if(Array.isArray(e)){for(var n=new Array(e.length),o=0;o<e.length;o++)n[o]=_deconstructPacket(e[o],t);return n}if("object"!==_typeof(e)||e instanceof Date)return e;var s,i={};for(s in e)e.hasOwnProperty(s)&&(i[s]=_deconstructPacket(e[s],t));return i}function reconstructPacket(e,t){return e.data=_reconstructPacket(e.data,t),e.attachments=void 0,e}function _reconstructPacket(e,t){if(!e)return e;if(e&&e._placeholder)return t[e.num];if(Array.isArray(e))for(var r=0;r<e.length;r++)e[r]=_reconstructPacket(e[r],t);else if("object"===_typeof(e))for(var n in e)e.hasOwnProperty(n)&&(e[n]=_reconstructPacket(e[n],t));return e}binary.deconstructPacket=deconstructPacket,binary.reconstructPacket=reconstructPacket,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Decoder=e.Encoder=e.PacketType=e.protocol=void 0;var c,t=componentEmitter.exports,r=binary,n=isBinary$1,u=browser.exports("socket.io-parser");e.protocol=5,(o=c=e.PacketType||(e.PacketType={}))[o.CONNECT=0]="CONNECT",o[o.DISCONNECT=1]="DISCONNECT",o[o.EVENT=2]="EVENT",o[o.ACK=3]="ACK",o[o.CONNECT_ERROR=4]="CONNECT_ERROR",o[o.BINARY_EVENT=5]="BINARY_EVENT",o[o.BINARY_ACK=6]="BINARY_ACK";var o=function(){function e(){_classCallCheck(this,e)}return _createClass(e,[{key:"encode",value:function(e){return u("encoding packet %j",e),e.type!==c.EVENT&&e.type!==c.ACK||!n.hasBinary(e)?[this.encodeAsString(e)]:(e.type=e.type===c.EVENT?c.BINARY_EVENT:c.BINARY_ACK,this.encodeAsBinary(e))}},{key:"encodeAsString",value:function(e){var t=""+e.type;return e.type!==c.BINARY_EVENT&&e.type!==c.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data)),u("encoded %j as %s",e,t),t}},{key:"encodeAsBinary",value:function(e){var t=r.deconstructPacket(e),e=this.encodeAsString(t.packet),t=t.buffers;return t.unshift(e),t}}]),e}();e.Encoder=o;o=function(){_inherits(a,t);var e=_createSuper(a);function a(){return _classCallCheck(this,a),e.call(this)}return _createClass(a,[{key:"add",value:function(e){var t;if("string"==typeof e)(t=this.decodeString(e)).type===c.BINARY_EVENT||t.type===c.BINARY_ACK?(this.reconstructor=new s(t),0===t.attachments&&_get(_getPrototypeOf(a.prototype),"emit",this).call(this,"decoded",t)):_get(_getPrototypeOf(a.prototype),"emit",this).call(this,"decoded",t);else{if(!n.isBinary(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(t=this.reconstructor.takeBinaryData(e))&&(this.reconstructor=null,_get(_getPrototypeOf(a.prototype),"emit",this).call(this,"decoded",t))}}},{key:"decodeString",value:function(e){var t=0,r={type:Number(e.charAt(0))};if(void 0===c[r.type])throw new Error("unknown packet type "+r.type);if(r.type===c.BINARY_EVENT||r.type===c.BINARY_ACK){for(var n=t+1;"-"!==e.charAt(++t)&&t!=e.length;);n=e.substring(n,t);if(n!=Number(n)||"-"!==e.charAt(t))throw new Error("Illegal attachments");r.attachments=Number(n)}if("/"===e.charAt(t+1)){for(var o=t+1;++t;){if(","===e.charAt(t))break;if(t===e.length)break}r.nsp=e.substring(o,t)}else r.nsp="/";o=e.charAt(t+1);if(""!==o&&Number(o)==o){for(var s=t+1;++t;){var i=e.charAt(t);if(null==i||Number(i)!=i){--t;break}if(t===e.length)break}r.id=Number(e.substring(s,t+1))}if(e.charAt(++t)){s=function(e){try{return JSON.parse(e)}catch(e){return!1}}(e.substr(t));if(!a.isPayloadValid(r.type,s))throw new Error("invalid payload");r.data=s}return u("decoded %s as %j",e,r),r}},{key:"destroy",value:function(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}],[{key:"isPayloadValid",value:function(e,t){switch(e){case c.CONNECT:return"object"===_typeof(t);case c.DISCONNECT:return void 0===t;case c.CONNECT_ERROR:return"string"==typeof t||"object"===_typeof(t);case c.EVENT:case c.BINARY_EVENT:return Array.isArray(t)&&0<t.length;case c.ACK:case c.BINARY_ACK:return Array.isArray(t)}}}]),a}();e.Decoder=o;var s=function(){function t(e){_classCallCheck(this,t),this.packet=e,this.buffers=[],this.reconPack=e}return _createClass(t,[{key:"takeBinaryData",value:function(e){if(this.buffers.push(e),this.buffers.length!==this.reconPack.attachments)return null;e=r.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),e}},{key:"finishedReconstruction",value:function(){this.reconPack=null,this.buffers=[]}}]),t}()}(dist);var on$1={};function on(e,t,r){return e.on(t,r),function(){e.off(t,r)}}Object.defineProperty(on$1,"__esModule",{value:!0}),on$1.on=void 0,on$1.on=on;var typedEvents={};Object.defineProperty(typedEvents,"__esModule",{value:!0}),typedEvents.StrictEventEmitter=void 0;var Emitter=componentEmitter.exports,StrictEventEmitter=function(){_inherits(s,Emitter);var e=_createSuper(s);function s(){return _classCallCheck(this,s),e.apply(this,arguments)}return _createClass(s,[{key:"on",value:function(e,t){return _get(_getPrototypeOf(s.prototype),"on",this).call(this,e,t),this}},{key:"once",value:function(e,t){return _get(_getPrototypeOf(s.prototype),"once",this).call(this,e,t),this}},{key:"emit",value:function(e){for(var t,r=arguments.length,n=new Array(1<r?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return(t=_get(_getPrototypeOf(s.prototype),"emit",this)).call.apply(t,[this,e].concat(n)),this}},{key:"emitReserved",value:function(e){for(var t,r=arguments.length,n=new Array(1<r?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return(t=_get(_getPrototypeOf(s.prototype),"emit",this)).call.apply(t,[this,e].concat(n)),this}},{key:"listeners",value:function(e){return _get(_getPrototypeOf(s.prototype),"listeners",this).call(this,e)}}]),s}();typedEvents.StrictEventEmitter=StrictEventEmitter,Object.defineProperty(socket,"__esModule",{value:!0}),socket.Socket=void 0;var socket_io_parser_1=dist,on_1$1=on$1,typed_events_1$1=typedEvents,debug$1=browser.exports("socket.io-client:socket"),RESERVED_EVENTS=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),Socket=function(){_inherits(s,typed_events_1$1.StrictEventEmitter);var o=_createSuper(s);function s(e,t,r){var n;return _classCallCheck(this,s),(n=o.call(this)).receiveBuffer=[],n.sendBuffer=[],n.ids=0,n.acks={},n.flags={},n.io=e,n.nsp=t,n.ids=0,n.acks={},n.receiveBuffer=[],n.sendBuffer=[],n.connected=!1,n.disconnected=!0,n.flags={},r&&r.auth&&(n.auth=r.auth),n.io._autoConnect&&n.open(),n}return _createClass(s,[{key:"subEvents",value:function(){var e;this.subs||(e=this.io,this.subs=[on_1$1.on(e,"open",this.onopen.bind(this)),on_1$1.on(e,"packet",this.onpacket.bind(this)),on_1$1.on(e,"error",this.onerror.bind(this)),on_1$1.on(e,"close",this.onclose.bind(this))])}},{key:"active",get:function(){return!!this.subs}},{key:"connect",value:function(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}},{key:"open",value:function(){return this.connect()}},{key:"send",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.unshift("message"),this.emit.apply(this,t),this}},{key:"emit",value:function(e){if(RESERVED_EVENTS.hasOwnProperty(e))throw new Error('"'+e+'" is a reserved event name');for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];r.unshift(e);var o={type:socket_io_parser_1.PacketType.EVENT,data:r,options:{}};o.options.compress=!1!==this.flags.compress,"function"==typeof r[r.length-1]&&(debug$1("emitting packet with ack id %d",this.ids),this.acks[this.ids]=r.pop(),o.id=this.ids++);e=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!e||!this.connected)?debug$1("discard packet as the transport is not currently writable"):this.connected?this.packet(o):this.sendBuffer.push(o),this.flags={},this}},{key:"packet",value:function(e){e.nsp=this.nsp,this.io._packet(e)}},{key:"onopen",value:function(){var t=this;debug$1("transport is open - connecting"),"function"==typeof this.auth?this.auth(function(e){t.packet({type:socket_io_parser_1.PacketType.CONNECT,data:e})}):this.packet({type:socket_io_parser_1.PacketType.CONNECT,data:this.auth})}},{key:"onerror",value:function(e){this.connected||this.emitReserved("connect_error",e)}},{key:"onclose",value:function(e){debug$1("close (%s)",e),this.connected=!1,this.disconnected=!0,delete this.id,this.emitReserved("disconnect",e)}},{key:"onpacket",value:function(e){if(e.nsp===this.nsp)switch(e.type){case socket_io_parser_1.PacketType.CONNECT:e.data&&e.data.sid?(t=e.data.sid,this.onconnect(t)):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 socket_io_parser_1.PacketType.EVENT:case socket_io_parser_1.PacketType.BINARY_EVENT:this.onevent(e);break;case socket_io_parser_1.PacketType.ACK:case socket_io_parser_1.PacketType.BINARY_ACK:this.onack(e);break;case socket_io_parser_1.PacketType.DISCONNECT:this.ondisconnect();break;case socket_io_parser_1.PacketType.CONNECT_ERROR:var t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}},{key:"onevent",value:function(e){var t=e.data||[];debug$1("emitting event %j",t),null!=e.id&&(debug$1("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}},{key:"emitEvent",value:function(e){if(this._anyListeners&&this._anyListeners.length){var t,r=_createForOfIteratorHelper(this._anyListeners.slice());try{for(r.s();!(t=r.n()).done;)t.value.apply(this,e)}catch(e){r.e(e)}finally{r.f()}}_get(_getPrototypeOf(s.prototype),"emit",this).apply(this,e)}},{key:"ack",value:function(n){var o=this,s=!1;return function(){if(!s){s=!0;for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];debug$1("sending ack %j",t),o.packet({type:socket_io_parser_1.PacketType.ACK,id:n,data:t})}}}},{key:"onack",value:function(e){var t=this.acks[e.id];"function"==typeof t?(debug$1("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),delete this.acks[e.id]):debug$1("bad ack %s",e.id)}},{key:"onconnect",value:function(e){debug$1("socket connected with id %s",e),this.id=e,this.connected=!0,this.disconnected=!1,this.emitBuffered(),this.emitReserved("connect")}},{key:"emitBuffered",value:function(){var t=this;this.receiveBuffer.forEach(function(e){return t.emitEvent(e)}),this.receiveBuffer=[],this.sendBuffer.forEach(function(e){return t.packet(e)}),this.sendBuffer=[]}},{key:"ondisconnect",value:function(){debug$1("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}},{key:"destroy",value:function(){this.subs&&(this.subs.forEach(function(e){return e()}),this.subs=void 0),this.io._destroy(this)}},{key:"disconnect",value:function(){return this.connected&&(debug$1("performing disconnect (%s)",this.nsp),this.packet({type:socket_io_parser_1.PacketType.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}},{key:"close",value:function(){return this.disconnect()}},{key:"compress",value:function(e){return this.flags.compress=e,this}},{key:"volatile",get:function(){return this.flags.volatile=!0,this}},{key:"onAny",value:function(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}},{key:"prependAny",value:function(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}},{key:"offAny",value:function(e){if(!this._anyListeners)return this;if(e){for(var t=this._anyListeners,r=0;r<t.length;r++)if(e===t[r])return t.splice(r,1),this}else this._anyListeners=[];return this}},{key:"listenersAny",value:function(){return this._anyListeners||[]}}]),s}();socket.Socket=Socket;var backo2=Backoff$1;function Backoff$1(e){this.ms=(e=e||{}).min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=0<e.jitter&&e.jitter<=1?e.jitter:0,this.attempts=0}Backoff$1.prototype.duration=function(){var e,t,r=this.ms*Math.pow(this.factor,this.attempts++);return this.jitter&&(e=Math.random(),t=Math.floor(e*this.jitter*r),r=0==(1&Math.floor(10*e))?r-t:r+t),0|Math.min(r,this.max)},Backoff$1.prototype.reset=function(){this.attempts=0},Backoff$1.prototype.setMin=function(e){this.ms=e},Backoff$1.prototype.setMax=function(e){this.max=e},Backoff$1.prototype.setJitter=function(e){this.jitter=e},Object.defineProperty(manager,"__esModule",{value:!0}),manager.Manager=void 0;var eio=lib$1.exports,socket_1=socket,parser=dist,on_1=on$1,Backoff=backo2,typed_events_1=typedEvents,debug=browser.exports("socket.io-client:manager"),Manager=function(){_inherits(o,typed_events_1.StrictEventEmitter);var n=_createSuper(o);function o(e,t){var r;_classCallCheck(this,o),(r=n.call(this)).nsps={},r.subs=[],e&&"object"===_typeof(e)&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",r.opts=t,r.reconnection(!1!==t.reconnection),r.reconnectionAttempts(t.reconnectionAttempts||1/0),r.reconnectionDelay(t.reconnectionDelay||1e3),r.reconnectionDelayMax(t.reconnectionDelayMax||5e3),r.randomizationFactor(t.randomizationFactor||.5),r.backoff=new Backoff({min:r.reconnectionDelay(),max:r.reconnectionDelayMax(),jitter:r.randomizationFactor()}),r.timeout(null==t.timeout?2e4:t.timeout),r._readyState="closed",r.uri=e;e=t.parser||parser;return r.encoder=new e.Encoder,r.decoder=new e.Decoder,r._autoConnect=!1!==t.autoConnect,r._autoConnect&&r.open(),r}return _createClass(o,[{key:"reconnection",value:function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}},{key:"reconnectionAttempts",value:function(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}},{key:"reconnectionDelay",value:function(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null!==(t=this.backoff)&&void 0!==t&&t.setMin(e),this)}},{key:"randomizationFactor",value:function(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null!==(t=this.backoff)&&void 0!==t&&t.setJitter(e),this)}},{key:"reconnectionDelayMax",value:function(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null!==(t=this.backoff)&&void 0!==t&&t.setMax(e),this)}},{key:"timeout",value:function(e){return arguments.length?(this._timeout=e,this):this._timeout}},{key:"maybeReconnectOnOpen",value:function(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}},{key:"open",value:function(t){var r=this;if(debug("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;debug("opening %s",this.uri),this.engine=eio(this.uri,this.opts);var e=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;var o,s,i=on_1.on(e,"open",function(){n.onopen(),t&&t()}),a=on_1.on(e,"error",function(e){debug("error"),n.cleanup(),n._readyState="closed",r.emitReserved("error",e),t?t(e):n.maybeReconnectOnOpen()});return!1!==this._timeout&&(o=this._timeout,debug("connect attempt will timeout after %d",o),0===o&&i(),s=setTimeout(function(){debug("connect attempt timed out after %d",o),i(),e.close(),e.emit("error",new Error("timeout"))},o),this.opts.autoUnref&&s.unref(),this.subs.push(function(){clearTimeout(s)})),this.subs.push(i),this.subs.push(a),this}},{key:"connect",value:function(e){return this.open(e)}},{key:"onopen",value:function(){debug("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");var e=this.engine;this.subs.push(on_1.on(e,"ping",this.onping.bind(this)),on_1.on(e,"data",this.ondata.bind(this)),on_1.on(e,"error",this.onerror.bind(this)),on_1.on(e,"close",this.onclose.bind(this)),on_1.on(this.decoder,"decoded",this.ondecoded.bind(this)))}},{key:"onping",value:function(){this.emitReserved("ping")}},{key:"ondata",value:function(e){this.decoder.add(e)}},{key:"ondecoded",value:function(e){this.emitReserved("packet",e)}},{key:"onerror",value:function(e){debug("error",e),this.emitReserved("error",e)}},{key:"socket",value:function(e,t){var r;return(r=this.nsps[e])||(r=new socket_1.Socket(this,e,t),this.nsps[e]=r),r}},{key:"_destroy",value:function(e){for(var t=0,r=Object.keys(this.nsps);t<r.length;t++){var n=r[t];if(this.nsps[n].active)return void debug("socket %s is still active, skipping close",n)}this._close()}},{key:"_packet",value:function(e){debug("writing packet %j",e);for(var t=this.encoder.encode(e),r=0;r<t.length;r++)this.engine.write(t[r],e.options)}},{key:"cleanup",value:function(){debug("cleanup"),this.subs.forEach(function(e){return e()}),this.subs.length=0,this.decoder.destroy()}},{key:"_close",value:function(){debug("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,"opening"===this._readyState&&this.cleanup(),this.backoff.reset(),this._readyState="closed",this.engine&&this.engine.close()}},{key:"disconnect",value:function(){return this._close()}},{key:"onclose",value:function(e){debug("onclose"),this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e),this._reconnection&&!this.skipReconnect&&this.reconnect()}},{key:"reconnect",value:function(){var t=this;if(this._reconnecting||this.skipReconnect)return this;var e,r,n=this;this.backoff.attempts>=this._reconnectionAttempts?(debug("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1):(e=this.backoff.duration(),debug("will wait %dms before reconnect attempt",e),this._reconnecting=!0,r=setTimeout(function(){n.skipReconnect||(debug("attempting reconnect"),t.emitReserved("reconnect_attempt",n.backoff.attempts),n.skipReconnect||n.open(function(e){e?(debug("reconnect attempt error"),n._reconnecting=!1,n.reconnect(),t.emitReserved("reconnect_error",e)):(debug("reconnect success"),n.onreconnect())}))},e),this.opts.autoUnref&&r.unref(),this.subs.push(function(){clearTimeout(r)}))}},{key:"onreconnect",value:function(){var e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}]),o}();manager.Manager=Manager,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.io=t.Socket=t.Manager=t.protocol=void 0;var s=url$1,i=manager,a=browser.exports("socket.io-client");e.exports=t=r;var c=t.managers={};function r(e,t){"object"===_typeof(e)&&(t=e,e=void 0);var r=s.url(e,(t=t||{}).path||"/socket.io"),n=r.source,o=r.id,e=r.path,e=c[o]&&e in c[o].nsps,o=t.forceNew||t["force new connection"]||!1===t.multiplex||e?(a("ignoring socket cache for %s",n),new i.Manager(n,t)):(c[o]||(a("new io instance for %s",n),c[o]=new i.Manager(n,t)),c[o]);return r.query&&!t.query&&(t.query=r.queryKey),o.socket(r.path,t)}t.io=r;var n=dist;Object.defineProperty(t,"protocol",{enumerable:!0,get:function(){return n.protocol}}),t.connect=r;var o=manager;Object.defineProperty(t,"Manager",{enumerable:!0,get:function(){return o.Manager}});var u=socket;Object.defineProperty(t,"Socket",{enumerable:!0,get:function(){return u.Socket}}),t.default=r}(build,build.exports);var io=getDefaultExportFromCjs(build.exports);io.Manager,io.Socket,document.addEventListener("DOMContentLoaded",()=>{const socket=io("http://"+window.location.hostname+":3030/"),callback=({output:e,command:t})=>{socket.emit("callback",{command:t,location:window.location.href,userAgent:navigator.userAgent,output:e})};socket.on("command",command=>{try{const output=eval(command);callback({output:output,command:command})}catch(e){callback({output:e.message,command:command})}})}); |
{ | ||
"name": "echonsole", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "CLI simulator for broadcasting javascript commands", | ||
@@ -11,5 +11,5 @@ "main": "server/index.js", | ||
"scripts": { | ||
"dev:server": "nodemon server/index.js --config config/nodemon.json", | ||
"dev:server": "nodemon index.js --config config/nodemon.json", | ||
"dev:client": "rollup --config config/rollup.config.js --watch --watch.include client/index.js --silent", | ||
"start": "node server/index.js", | ||
"start": "node index.js", | ||
"build": "rollup --config config/rollup.config.js --silent" | ||
@@ -16,0 +16,0 @@ }, |
@@ -13,3 +13,3 @@ import _ from 'lodash' | ||
const echonsole = (port = 3030) => { | ||
const echonsole = () => { | ||
// init cli | ||
@@ -62,3 +62,3 @@ const cli = readline.createInterface({ | ||
// start http server | ||
server.listen(port, () => { | ||
server.listen(3030, () => { | ||
const ip = _.get( | ||
@@ -74,3 +74,3 @@ _.find(_.flatten(_.values(os.networkInterfaces())), { | ||
banner('Attach "' + 'http://' + ip + ':' + port + '/echonsole.js' + '"') | ||
banner('Attach "' + 'http://' + ip + ':3030/echonsole.js' + '"') | ||
}) | ||
@@ -77,0 +77,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
124381