!function(e, t) {
    "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).Cloudplay = t()
}(this, function() {
    "use strict";
    function _iterableToArrayLimit(e, t) {
        var n = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
        if (null != n) {
            var i, o, r, s, a = [], c = !0, l = !1;
            try {
                if (r = (n = n.call(e)).next,
                0 === t) {
                    if (Object(n) !== n)
                        return;
                    c = !1
                } else
                    for (; !(c = (i = r.call(n)).done) && (a.push(i.value),
                    a.length !== t); c = !0)
                        ;
            } catch (e) {
                l = !0,
                o = e
            } finally {
                try {
                    if (!c && null != n.return && (s = n.return(),
                    Object(s) !== s))
                        return
                } finally {
                    if (l)
                        throw o
                }
            }
            return a
        }
    }
    function ownKeys(t, e) {
        var n, i = Object.keys(t);
        return Object.getOwnPropertySymbols && (n = Object.getOwnPropertySymbols(t),
        e && (n = n.filter(function(e) {
            return Object.getOwnPropertyDescriptor(t, e).enumerable
        })),
        i.push.apply(i, n)),
        i
    }
    function _objectSpread2(t) {
        for (var e = 1; e < arguments.length; e++) {
            var n = null != arguments[e] ? arguments[e] : {};
            e % 2 ? ownKeys(Object(n), !0).forEach(function(e) {
                _defineProperty(t, e, n[e])
            }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : ownKeys(Object(n)).forEach(function(e) {
                Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(n, e))
            })
        }
        return t
    }
    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 n = 0; n < t.length; n++) {
            var i = t[n];
            i.enumerable = i.enumerable || !1,
            i.configurable = !0,
            "value"in i && (i.writable = !0),
            Object.defineProperty(e, _toPropertyKey(i.key), i)
        }
    }
    function _createClass(e, t, n) {
        t && _defineProperties(e.prototype, t),
        n && _defineProperties(e, n),
        Object.defineProperty(e, "prototype", {
            writable: !1
        })
    }
    function _defineProperty(e, t, n) {
        return (t = _toPropertyKey(t))in e ? Object.defineProperty(e, t, {
            value: n,
            enumerable: !0,
            configurable: !0,
            writable: !0
        }) : e[t] = n,
        e
    }
    function _slicedToArray(e, t) {
        return _arrayWithHoles(e) || _iterableToArrayLimit(e, t) || _unsupportedIterableToArray(e, t) || _nonIterableRest()
    }
    function _toConsumableArray(e) {
        return _arrayWithoutHoles(e) || _iterableToArray(e) || _unsupportedIterableToArray(e) || _nonIterableSpread()
    }
    function _arrayWithoutHoles(e) {
        if (Array.isArray(e))
            return _arrayLikeToArray(e)
    }
    function _arrayWithHoles(e) {
        if (Array.isArray(e))
            return e
    }
    function _iterableToArray(e) {
        if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"])
            return Array.from(e)
    }
    function _unsupportedIterableToArray(e, t) {
        var n;
        if (e)
            return "string" == typeof e ? _arrayLikeToArray(e, t) : "Map" === (n = "Object" === (n = Object.prototype.toString.call(e).slice(8, -1)) && e.constructor ? e.constructor.name : n) || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? _arrayLikeToArray(e, t) : void 0
    }
    function _arrayLikeToArray(e, t) {
        (null == t || t > e.length) && (t = e.length);
        for (var n = 0, i = new Array(t); n < t; n++)
            i[n] = e[n];
        return i
    }
    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 _nonIterableRest() {
        throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
    }
    function _toPrimitive(e, t) {
        if ("object" != typeof e || null === e)
            return e;
        var n = e[Symbol.toPrimitive];
        if (void 0 === n)
            return ("string" === t ? String : Number)(e);
        n = n.call(e, t || "default");
        if ("object" != typeof n)
            return n;
        throw new TypeError("@@toPrimitive must return a primitive value.")
    }
    function _toPropertyKey(e) {
        e = _toPrimitive(e, "string");
        return "symbol" == typeof e ? e : String(e)
    }
    var commonjsGlobal = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {};
    function getDefaultExportFromCjs(e) {
        return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e
    }
    function createCommonjsModule(e, t, n) {
        return e(n = {
            path: t,
            exports: {},
            require: function(e, t) {
                return commonjsRequire(e, null == t ? n.path : t)
            }
        }, n.exports),
        n.exports
    }
    function getAugmentedNamespace(n) {
        var i;
        return n.__esModule ? n : (i = Object.defineProperty({}, "__esModule", {
            value: !0
        }),
        Object.keys(n).forEach(function(e) {
            var t = Object.getOwnPropertyDescriptor(n, e);
            Object.defineProperty(i, e, t.get ? t : {
                enumerable: !0,
                get: function() {
                    return n[e]
                }
            })
        }),
        i)
    }
    function commonjsRequire() {
        throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")
    }
    var core = createCommonjsModule(function(e, t) {
        e.exports = function(l) {
            var n = Object.create || function(e) {
                return t.prototype = e,
                e = new t,
                t.prototype = null,
                e
            }
            ;
            function t() {}
            var e = {}
              , i = e.lib = {}
              , o = i.Base = {
                extend: function(e) {
                    var t = n(this);
                    return e && t.mixIn(e),
                    t.hasOwnProperty("init") && this.init !== t.init || (t.init = function() {
                        t.$super.init.apply(this, arguments)
                    }
                    ),
                    (t.init.prototype = t).$super = this,
                    t
                },
                create: function() {
                    var e = this.extend();
                    return e.init.apply(e, arguments),
                    e
                },
                init: function() {},
                mixIn: function(e) {
                    for (var t in e)
                        e.hasOwnProperty(t) && (this[t] = e[t]);
                    e.hasOwnProperty("toString") && (this.toString = e.toString)
                },
                clone: function() {
                    return this.init.prototype.extend(this)
                }
            }
              , d = i.WordArray = o.extend({
                init: function(e, t) {
                    e = this.words = e || [],
                    this.sigBytes = null != t ? t : 4 * e.length
                },
                toString: function(e) {
                    return (e || s).stringify(this)
                },
                concat: function(e) {
                    var t = this.words
                      , n = e.words
                      , i = this.sigBytes
                      , o = e.sigBytes;
                    if (this.clamp(),
                    i % 4)
                        for (var r = 0; r < o; r++) {
                            var s = n[r >>> 2] >>> 24 - r % 4 * 8 & 255;
                            t[i + r >>> 2] |= s << 24 - (i + r) % 4 * 8
                        }
                    else
                        for (r = 0; r < o; r += 4)
                            t[i + r >>> 2] = n[r >>> 2];
                    return this.sigBytes += o,
                    this
                },
                clamp: function() {
                    var e = this.words
                      , t = this.sigBytes;
                    e[t >>> 2] &= 4294967295 << 32 - t % 4 * 8,
                    e.length = l.ceil(t / 4)
                },
                clone: function() {
                    var e;
                    return (e = o.clone.call(this)).words = this.words.slice(0),
                    e
                },
                random: function(e) {
                    for (var t = [], n = 0; n < e; n += 4) {
                        var i = function(t) {
                            var n = 987654321
                              , i = 4294967295;
                            return function() {
                                var e = ((n = 36969 * (65535 & n) + (n >> 16) & i) << 16) + (t = 18e3 * (65535 & t) + (t >> 16) & i) & i;
                                return (e / 4294967296 + .5) * (.5 < l.random() ? 1 : -1)
                            }
                        }(4294967296 * (o || l.random()))
                          , o = 987654071 * i();
                        t.push(4294967296 * i() | 0)
                    }
                    return new d.init(t,e)
                }
            })
              , r = e.enc = {}
              , s = r.Hex = {
                stringify: function(e) {
                    for (var t = e.words, n = e.sigBytes, i = [], o = 0; o < n; o++) {
                        var r = t[o >>> 2] >>> 24 - o % 4 * 8 & 255;
                        i.push((r >>> 4).toString(16)),
                        i.push((15 & r).toString(16))
                    }
                    return i.join("")
                },
                parse: function(e) {
                    for (var t = e.length, n = [], i = 0; i < t; i += 2)
                        n[i >>> 3] |= parseInt(e.substr(i, 2), 16) << 24 - i % 8 * 4;
                    return new d.init(n,t / 2)
                }
            }
              , a = r.Latin1 = {
                stringify: function(e) {
                    for (var t = e.words, n = e.sigBytes, i = [], o = 0; o < n; o++) {
                        var r = t[o >>> 2] >>> 24 - o % 4 * 8 & 255;
                        i.push(String.fromCharCode(r))
                    }
                    return i.join("")
                },
                parse: function(e) {
                    for (var t = e.length, n = [], i = 0; i < t; i++)
                        n[i >>> 2] |= (255 & e.charCodeAt(i)) << 24 - i % 4 * 8;
                    return new d.init(n,t)
                }
            }
              , c = r.Utf8 = {
                stringify: function(e) {
                    try {
                        return decodeURIComponent(escape(a.stringify(e)))
                    } catch (e) {
                        throw new Error("Malformed UTF-8 data")
                    }
                },
                parse: function(e) {
                    return a.parse(unescape(encodeURIComponent(e)))
                }
            }
              , p = i.BufferedBlockAlgorithm = o.extend({
                reset: function() {
                    this._data = new d.init,
                    this._nDataBytes = 0
                },
                _append: function(e) {
                    "string" == typeof e && (e = c.parse(e)),
                    this._data.concat(e),
                    this._nDataBytes += e.sigBytes
                },
                _process: function(e) {
                    var t = this._data
                      , n = t.words
                      , i = t.sigBytes
                      , o = this.blockSize
                      , r = i / (4 * o)
                      , s = (r = e ? l.ceil(r) : l.max((0 | r) - this._minBufferSize, 0)) * o
                      , e = l.min(4 * s, i);
                    if (s) {
                        for (var a = 0; a < s; a += o)
                            this._doProcessBlock(n, a);
                        var c = n.splice(0, s);
                        t.sigBytes -= e
                    }
                    return new d.init(c,e)
                },
                clone: function() {
                    var e;
                    return (e = o.clone.call(this))._data = this._data.clone(),
                    e
                },
                _minBufferSize: 0
            })
              , u = (i.Hasher = p.extend({
                cfg: o.extend(),
                init: function(e) {
                    this.cfg = this.cfg.extend(e),
                    this.reset()
                },
                reset: function() {
                    p.reset.call(this),
                    this._doReset()
                },
                update: function(e) {
                    return this._append(e),
                    this._process(),
                    this
                },
                finalize: function(e) {
                    return e && this._append(e),
                    this._doFinalize()
                },
                blockSize: 16,
                _createHelper: function(n) {
                    return function(e, t) {
                        return new n.init(t).finalize(e)
                    }
                },
                _createHmacHelper: function(n) {
                    return function(e, t) {
                        return new u.HMAC.init(n,t).finalize(e)
                    }
                }
            }),
            e.algo = {});
            return e
        }(Math)
    })
      , x64Core = createCommonjsModule(function(e, t) {
        var n, o, r, i;
        e.exports = (i = (n = e = core).lib,
        o = i.Base,
        r = i.WordArray,
        (i = n.x64 = {}).Word = o.extend({
            init: function(e, t) {
                this.high = e,
                this.low = t
            }
        }),
        i.WordArray = o.extend({
            init: function(e, t) {
                e = this.words = e || [],
                this.sigBytes = null != t ? t : 8 * e.length
            },
            toX32: function() {
                for (var e = this.words, t = e.length, n = [], i = 0; i < t; i++) {
                    var o = e[i];
                    n.push(o.high),
                    n.push(o.low)
                }
                return r.create(n, this.sigBytes)
            },
            clone: function() {
                for (var e, t = (e = o.clone.call(this)).words = this.words.slice(0), n = t.length, i = 0; i < n; i++)
                    t[i] = t[i].clone();
                return e
            }
        }),
        e)
    })
      , libTypedarrays = createCommonjsModule(function(e, t) {
        var n;
        e.exports = (n = core,
        function() {
            var e, o;
            "function" == typeof ArrayBuffer && (e = n.lib.WordArray,
            o = e.init,
            (e.init = function(e) {
                if ((e = (e = e instanceof ArrayBuffer ? new Uint8Array(e) : e)instanceof Int8Array || "undefined" != typeof Uint8ClampedArray && e instanceof Uint8ClampedArray || e instanceof Int16Array || e instanceof Uint16Array || e instanceof Int32Array || e instanceof Uint32Array || e instanceof Float32Array || e instanceof Float64Array ? new Uint8Array(e.buffer,e.byteOffset,e.byteLength) : e)instanceof Uint8Array) {
                    for (var t = e.byteLength, n = [], i = 0; i < t; i++)
                        n[i >>> 2] |= e[i] << 24 - i % 4 * 8;
                    o.call(this, n, t)
                } else
                    o.apply(this, arguments)
            }
            ).prototype = e)
        }(),
        n.lib.WordArray)
    })
      , encUtf16 = createCommonjsModule(function(e, t) {
        function s(e) {
            return e << 8 & 4278255360 | e >>> 8 & 16711935
        }
        var o, n;
        e.exports = (o = (e = core).lib.WordArray,
        (n = e.enc).Utf16 = n.Utf16BE = {
            stringify: function(e) {
                for (var t = e.words, n = e.sigBytes, i = [], o = 0; o < n; o += 2) {
                    var r = t[o >>> 2] >>> 16 - o % 4 * 8 & 65535;
                    i.push(String.fromCharCode(r))
                }
                return i.join("")
            },
            parse: function(e) {
                for (var t = e.length, n = [], i = 0; i < t; i++)
                    n[i >>> 1] |= e.charCodeAt(i) << 16 - i % 2 * 16;
                return o.create(n, 2 * t)
            }
        },
        n.Utf16LE = {
            stringify: function(e) {
                for (var t = e.words, n = e.sigBytes, i = [], o = 0; o < n; o += 2) {
                    var r = s(t[o >>> 2] >>> 16 - o % 4 * 8 & 65535);
                    i.push(String.fromCharCode(r))
                }
                return i.join("")
            },
            parse: function(e) {
                for (var t = e.length, n = [], i = 0; i < t; i++)
                    n[i >>> 1] |= s(e.charCodeAt(i) << 16 - i % 2 * 16);
                return o.create(n, 2 * t)
            }
        },
        e.enc.Utf16)
    })
      , encBase64 = createCommonjsModule(function(e, t) {
        function s(e, t, n) {
            for (var i, o, r = [], s = 0, a = 0; a < t; a++)
                a % 4 && (i = n[e.charCodeAt(a - 1)] << a % 4 * 2,
                o = n[e.charCodeAt(a)] >>> 6 - a % 4 * 2,
                r[s >>> 2] |= (i | o) << 24 - s % 4 * 8,
                s++);
            return c.create(r, s)
        }
        var c;
        e.exports = (c = (e = core).lib.WordArray,
        e.enc.Base64 = {
            stringify: function(e) {
                for (var t = e.words, n = e.sigBytes, i = this._map, o = (e.clamp(),
                []), r = 0; r < n; r += 3)
                    for (var s = (t[r >>> 2] >>> 24 - r % 4 * 8 & 255) << 16 | (t[r + 1 >>> 2] >>> 24 - (r + 1) % 4 * 8 & 255) << 8 | t[r + 2 >>> 2] >>> 24 - (r + 2) % 4 * 8 & 255, a = 0; a < 4 && r + .75 * a < n; a++)
                        o.push(i.charAt(s >>> 6 * (3 - a) & 63));
                var c = i.charAt(64);
                if (c)
                    for (; o.length % 4; )
                        o.push(c);
                return o.join("")
            },
            parse: function(e) {
                var t = e.length
                  , n = this._map;
                if (!(i = this._reverseMap))
                    for (var i = this._reverseMap = [], o = 0; o < n.length; o++)
                        i[n.charCodeAt(o)] = o;
                var r = n.charAt(64);
                return r && -1 !== (r = e.indexOf(r)) && (t = r),
                s(e, t, i)
            },
            _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
        },
        e.enc.Base64)
    })
      , md5 = createCommonjsModule(function(e, t) {
        e.exports = function(e) {
            for (var p = Math, t = e, n = t.lib, i = n.WordArray, o = n.Hasher, r = t.algo, I = [], s = 0; s < 64; s++)
                I[s] = p.abs(p.sin(s + 1)) * 4294967296 | 0;
            var a = r.MD5 = o.extend({
                _doReset: function e() {
                    this._hash = new i.init([1732584193, 4023233417, 2562383102, 271733878])
                },
                _doProcessBlock: function e(t, n) {
                    for (var i = 0; i < 16; i++) {
                        var o = n + i;
                        var r = t[o];
                        t[o] = (r << 8 | r >>> 24) & 16711935 | (r << 24 | r >>> 8) & 4278255360
                    }
                    var s = this._hash.words;
                    var a = t[n + 0];
                    var c = t[n + 1];
                    var l = t[n + 2];
                    var d = t[n + 3];
                    var p = t[n + 4];
                    var u = t[n + 5];
                    var h = t[n + 6];
                    var f = t[n + 7];
                    var m = t[n + 8];
                    var y = t[n + 9];
                    var g = t[n + 10];
                    var _ = t[n + 11];
                    var v = t[n + 12];
                    var S = t[n + 13];
                    var b = t[n + 14];
                    var k = t[n + 15];
                    var C = s[0];
                    var w = s[1];
                    var T = s[2];
                    var E = s[3];
                    C = R(C, w, T, E, a, 7, I[0]);
                    E = R(E, C, w, T, c, 12, I[1]);
                    T = R(T, E, C, w, l, 17, I[2]);
                    w = R(w, T, E, C, d, 22, I[3]);
                    C = R(C, w, T, E, p, 7, I[4]);
                    E = R(E, C, w, T, u, 12, I[5]);
                    T = R(T, E, C, w, h, 17, I[6]);
                    w = R(w, T, E, C, f, 22, I[7]);
                    C = R(C, w, T, E, m, 7, I[8]);
                    E = R(E, C, w, T, y, 12, I[9]);
                    T = R(T, E, C, w, g, 17, I[10]);
                    w = R(w, T, E, C, _, 22, I[11]);
                    C = R(C, w, T, E, v, 7, I[12]);
                    E = R(E, C, w, T, S, 12, I[13]);
                    T = R(T, E, C, w, b, 17, I[14]);
                    w = R(w, T, E, C, k, 22, I[15]);
                    C = x(C, w, T, E, c, 5, I[16]);
                    E = x(E, C, w, T, h, 9, I[17]);
                    T = x(T, E, C, w, _, 14, I[18]);
                    w = x(w, T, E, C, a, 20, I[19]);
                    C = x(C, w, T, E, u, 5, I[20]);
                    E = x(E, C, w, T, g, 9, I[21]);
                    T = x(T, E, C, w, k, 14, I[22]);
                    w = x(w, T, E, C, p, 20, I[23]);
                    C = x(C, w, T, E, y, 5, I[24]);
                    E = x(E, C, w, T, b, 9, I[25]);
                    T = x(T, E, C, w, d, 14, I[26]);
                    w = x(w, T, E, C, m, 20, I[27]);
                    C = x(C, w, T, E, S, 5, I[28]);
                    E = x(E, C, w, T, l, 9, I[29]);
                    T = x(T, E, C, w, f, 14, I[30]);
                    w = x(w, T, E, C, v, 20, I[31]);
                    C = P(C, w, T, E, u, 4, I[32]);
                    E = P(E, C, w, T, m, 11, I[33]);
                    T = P(T, E, C, w, _, 16, I[34]);
                    w = P(w, T, E, C, b, 23, I[35]);
                    C = P(C, w, T, E, c, 4, I[36]);
                    E = P(E, C, w, T, p, 11, I[37]);
                    T = P(T, E, C, w, f, 16, I[38]);
                    w = P(w, T, E, C, g, 23, I[39]);
                    C = P(C, w, T, E, S, 4, I[40]);
                    E = P(E, C, w, T, a, 11, I[41]);
                    T = P(T, E, C, w, d, 16, I[42]);
                    w = P(w, T, E, C, h, 23, I[43]);
                    C = P(C, w, T, E, y, 4, I[44]);
                    E = P(E, C, w, T, v, 11, I[45]);
                    T = P(T, E, C, w, k, 16, I[46]);
                    w = P(w, T, E, C, l, 23, I[47]);
                    C = O(C, w, T, E, a, 6, I[48]);
                    E = O(E, C, w, T, f, 10, I[49]);
                    T = O(T, E, C, w, b, 15, I[50]);
                    w = O(w, T, E, C, u, 21, I[51]);
                    C = O(C, w, T, E, v, 6, I[52]);
                    E = O(E, C, w, T, d, 10, I[53]);
                    T = O(T, E, C, w, g, 15, I[54]);
                    w = O(w, T, E, C, c, 21, I[55]);
                    C = O(C, w, T, E, m, 6, I[56]);
                    E = O(E, C, w, T, k, 10, I[57]);
                    T = O(T, E, C, w, h, 15, I[58]);
                    w = O(w, T, E, C, S, 21, I[59]);
                    C = O(C, w, T, E, p, 6, I[60]);
                    E = O(E, C, w, T, _, 10, I[61]);
                    T = O(T, E, C, w, l, 15, I[62]);
                    w = O(w, T, E, C, y, 21, I[63]);
                    s[0] = s[0] + C | 0;
                    s[1] = s[1] + w | 0;
                    s[2] = s[2] + T | 0;
                    s[3] = s[3] + E | 0
                },
                _doFinalize: function e() {
                    var t = this._data;
                    var n = t.words;
                    var i = this._nDataBytes * 8;
                    var o = t.sigBytes * 8;
                    n[o >>> 5] |= 128 << 24 - o % 32;
                    var r = p.floor(i / 4294967296);
                    var s = i;
                    n[(o + 64 >>> 9 << 4) + 15] = (r << 8 | r >>> 24) & 16711935 | (r << 24 | r >>> 8) & 4278255360;
                    n[(o + 64 >>> 9 << 4) + 14] = (s << 8 | s >>> 24) & 16711935 | (s << 24 | s >>> 8) & 4278255360;
                    t.sigBytes = (n.length + 1) * 4;
                    this._process();
                    var a = this._hash;
                    var c = a.words;
                    for (var l = 0; l < 4; l++) {
                        var d = c[l];
                        c[l] = (d << 8 | d >>> 24) & 16711935 | (d << 24 | d >>> 8) & 4278255360
                    }
                    return a
                },
                clone: function e() {
                    var e = o.clone.call(this);
                    e._hash = this._hash.clone();
                    return e
                }
            });
            function R(e, t, n, i, o, r, s) {
                var a = e + (t & n | ~t & i) + o + s;
                return (a << r | a >>> 32 - r) + t
            }
            function x(e, t, n, i, o, r, s) {
                var a = e + (t & i | n & ~i) + o + s;
                return (a << r | a >>> 32 - r) + t
            }
            function P(e, t, n, i, o, r, s) {
                var a = e + (t ^ n ^ i) + o + s;
                return (a << r | a >>> 32 - r) + t
            }
            function O(e, t, n, i, o, r, s) {
                var a = e + (n ^ (t | ~i)) + o + s;
                return (a << r | a >>> 32 - r) + t
            }
            return t.MD5 = o._createHelper(a),
            t.HmacMD5 = o._createHmacHelper(a),
            e.MD5
        }(core)
    })
      , sha1 = createCommonjsModule(function(e, t) {
        var n, i, o, d, r;
        e.exports = (r = (n = e = core).lib,
        i = r.WordArray,
        o = r.Hasher,
        r = n.algo,
        d = [],
        r = r.SHA1 = o.extend({
            _doReset: function() {
                this._hash = new i.init([1732584193, 4023233417, 2562383102, 271733878, 3285377520])
            },
            _doProcessBlock: function(e, t) {
                for (var n = this._hash.words, i = n[0], o = n[1], r = n[2], s = n[3], a = n[4], c = 0; c < 80; c++) {
                    c < 16 ? d[c] = 0 | e[t + c] : (l = d[c - 3] ^ d[c - 8] ^ d[c - 14] ^ d[c - 16],
                    d[c] = l << 1 | l >>> 31);
                    var l = (i << 5 | i >>> 27) + a + d[c];
                    l += c < 20 ? 1518500249 + (o & r | ~o & s) : c < 40 ? 1859775393 + (o ^ r ^ s) : c < 60 ? (o & r | o & s | r & s) - 1894007588 : (o ^ r ^ s) - 899497514,
                    a = s,
                    s = r,
                    r = o << 30 | o >>> 2,
                    o = i,
                    i = l
                }
                n[0] = n[0] + i | 0,
                n[1] = n[1] + o | 0,
                n[2] = n[2] + r | 0,
                n[3] = n[3] + s | 0,
                n[4] = n[4] + a | 0
            },
            _doFinalize: function() {
                var e = this._data
                  , t = e.words
                  , n = 8 * this._nDataBytes
                  , i = 8 * e.sigBytes;
                return t[i >>> 5] |= 128 << 24 - i % 32,
                t[14 + (64 + i >>> 9 << 4)] = Math.floor(n / 4294967296),
                t[15 + (64 + i >>> 9 << 4)] = n,
                e.sigBytes = 4 * t.length,
                this._process(),
                this._hash
            },
            clone: function() {
                var e;
                return (e = o.clone.call(this))._hash = this._hash.clone(),
                e
            }
        }),
        n.SHA1 = o._createHelper(r),
        n.HmacSHA1 = o._createHmacHelper(r),
        e.SHA1)
    })
      , sha256 = createCommonjsModule(function(e, t) {
        e.exports = function(e) {
            var r = Math
              , t = e
              , n = t.lib
              , i = n.WordArray
              , o = n.Hasher
              , s = t.algo
              , a = []
              , C = [];
            function c(e) {
                var t = r.sqrt(e);
                for (var n = 2; n <= t; n++)
                    if (!(e % n))
                        return false;
                return true
            }
            function l(e) {
                return (e - (e | 0)) * 4294967296 | 0
            }
            var d = 2
              , p = 0;
            while (p < 64) {
                if (c(d)) {
                    if (p < 8)
                        a[p] = l(r.pow(d, 1 / 2));
                    C[p] = l(r.pow(d, 1 / 3));
                    p++
                }
                d++
            }
            var w = []
              , u = s.SHA256 = o.extend({
                _doReset: function e() {
                    this._hash = new i.init(a.slice(0))
                },
                _doProcessBlock: function e(t, n) {
                    var i = this._hash.words;
                    var o = i[0];
                    var r = i[1];
                    var s = i[2];
                    var a = i[3];
                    var c = i[4];
                    var l = i[5];
                    var d = i[6];
                    var p = i[7];
                    for (var u = 0; u < 64; u++) {
                        if (u < 16)
                            w[u] = t[n + u] | 0;
                        else {
                            var h = w[u - 15];
                            var f = (h << 25 | h >>> 7) ^ (h << 14 | h >>> 18) ^ h >>> 3;
                            var m = w[u - 2];
                            var y = (m << 15 | m >>> 17) ^ (m << 13 | m >>> 19) ^ m >>> 10;
                            w[u] = f + w[u - 7] + y + w[u - 16]
                        }
                        var g = c & l ^ ~c & d;
                        var _ = o & r ^ o & s ^ r & s;
                        var v = (o << 30 | o >>> 2) ^ (o << 19 | o >>> 13) ^ (o << 10 | o >>> 22);
                        var S = (c << 26 | c >>> 6) ^ (c << 21 | c >>> 11) ^ (c << 7 | c >>> 25);
                        var b = p + S + g + C[u] + w[u];
                        var k = v + _;
                        p = d;
                        d = l;
                        l = c;
                        c = a + b | 0;
                        a = s;
                        s = r;
                        r = o;
                        o = b + k | 0
                    }
                    i[0] = i[0] + o | 0;
                    i[1] = i[1] + r | 0;
                    i[2] = i[2] + s | 0;
                    i[3] = i[3] + a | 0;
                    i[4] = i[4] + c | 0;
                    i[5] = i[5] + l | 0;
                    i[6] = i[6] + d | 0;
                    i[7] = i[7] + p | 0
                },
                _doFinalize: function e() {
                    var t = this._data;
                    var n = t.words;
                    var i = this._nDataBytes * 8;
                    var o = t.sigBytes * 8;
                    n[o >>> 5] |= 128 << 24 - o % 32;
                    n[(o + 64 >>> 9 << 4) + 14] = r.floor(i / 4294967296);
                    n[(o + 64 >>> 9 << 4) + 15] = i;
                    t.sigBytes = n.length * 4;
                    this._process();
                    return this._hash
                },
                clone: function e() {
                    var e = o.clone.call(this);
                    e._hash = this._hash.clone();
                    return e
                }
            });
            return t.SHA256 = o._createHelper(u),
            t.HmacSHA256 = o._createHmacHelper(u),
            e.SHA256
        }(core)
    })
      , sha224 = createCommonjsModule(function(e, t) {
        var n, i, o, r;
        e.exports = (i = (n = e = core).lib.WordArray,
        r = n.algo,
        o = r.SHA256,
        r = r.SHA224 = o.extend({
            _doReset: function() {
                this._hash = new i.init([3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428])
            },
            _doFinalize: function() {
                var e = o._doFinalize.call(this);
                return e.sigBytes -= 4,
                e
            }
        }),
        n.SHA224 = o._createHelper(r),
        n.HmacSHA224 = o._createHmacHelper(r),
        e.SHA224)
    })
      , sha512 = createCommonjsModule(function(e, t) {
        e.exports = function(e) {
            var t = e, n, i = t.lib.Hasher, o = t.x64, r = o.Word, s = o.WordArray, a = t.algo;
            function c() {
                return r.create.apply(r, arguments)
            }
            for (var Te = [c(1116352408, 3609767458), c(1899447441, 602891725), c(3049323471, 3964484399), c(3921009573, 2173295548), c(961987163, 4081628472), c(1508970993, 3053834265), c(2453635748, 2937671579), c(2870763221, 3664609560), c(3624381080, 2734883394), c(310598401, 1164996542), c(607225278, 1323610764), c(1426881987, 3590304994), c(1925078388, 4068182383), c(2162078206, 991336113), c(2614888103, 633803317), c(3248222580, 3479774868), c(3835390401, 2666613458), c(4022224774, 944711139), c(264347078, 2341262773), c(604807628, 2007800933), c(770255983, 1495990901), c(1249150122, 1856431235), c(1555081692, 3175218132), c(1996064986, 2198950837), c(2554220882, 3999719339), c(2821834349, 766784016), c(2952996808, 2566594879), c(3210313671, 3203337956), c(3336571891, 1034457026), c(3584528711, 2466948901), c(113926993, 3758326383), c(338241895, 168717936), c(666307205, 1188179964), c(773529912, 1546045734), c(1294757372, 1522805485), c(1396182291, 2643833823), c(1695183700, 2343527390), c(1986661051, 1014477480), c(2177026350, 1206759142), c(2456956037, 344077627), c(2730485921, 1290863460), c(2820302411, 3158454273), c(3259730800, 3505952657), c(3345764771, 106217008), c(3516065817, 3606008344), c(3600352804, 1432725776), c(4094571909, 1467031594), c(275423344, 851169720), c(430227734, 3100823752), c(506948616, 1363258195), c(659060556, 3750685593), c(883997877, 3785050280), c(958139571, 3318307427), c(1322822218, 3812723403), c(1537002063, 2003034995), c(1747873779, 3602036899), c(1955562222, 1575990012), c(2024104815, 1125592928), c(2227730452, 2716904306), c(2361852424, 442776044), c(2428436474, 593698344), c(2756734187, 3733110249), c(3204031479, 2999351573), c(3329325298, 3815920427), c(3391569614, 3928383900), c(3515267271, 566280711), c(3940187606, 3454069534), c(4118630271, 4000239992), c(116418474, 1914138554), c(174292421, 2731055270), c(289380356, 3203993006), c(460393269, 320620315), c(685471733, 587496836), c(852142971, 1086792851), c(1017036298, 365543100), c(1126000580, 2618297676), c(1288033470, 3409855158), c(1501505948, 4234509866), c(1607167915, 987167468), c(1816402316, 1246189591)], Ee = [], l = 0; l < 80; l++)
                Ee[l] = c();
            var d = a.SHA512 = i.extend({
                _doReset: function e() {
                    this._hash = new s.init([new r.init(1779033703,4089235720), new r.init(3144134277,2227873595), new r.init(1013904242,4271175723), new r.init(2773480762,1595750129), new r.init(1359893119,2917565137), new r.init(2600822924,725511199), new r.init(528734635,4215389547), new r.init(1541459225,327033209)])
                },
                _doProcessBlock: function K(N, L) {
                    var e = this._hash.words;
                    var t = e[0];
                    var n = e[1];
                    var i = e[2];
                    var o = e[3];
                    var r = e[4];
                    var s = e[5];
                    var a = e[6];
                    var c = e[7];
                    var F = t.high;
                    var l = t.low;
                    var $ = n.high;
                    var d = n.low;
                    var j = i.high;
                    var p = i.low;
                    var U = o.high;
                    var u = o.low;
                    var H = r.high;
                    var h = r.low;
                    var G = s.high;
                    var f = s.low;
                    var V = a.high;
                    var m = a.low;
                    var W = c.high;
                    var z = c.low;
                    var y = F;
                    var g = l;
                    var _ = $;
                    var v = d;
                    var S = j;
                    var b = p;
                    var q = U;
                    var k = u;
                    var C = H;
                    var w = h;
                    var J = G;
                    var T = f;
                    var Y = V;
                    var E = m;
                    var X = W;
                    var I = z;
                    for (var R = 0; R < 80; R++) {
                        var Q = Ee[R];
                        if (R < 16) {
                            var Z = Q.high = N[L + R * 2] | 0;
                            var x = Q.low = N[L + R * 2 + 1] | 0
                        } else {
                            var ee = Ee[R - 15];
                            var P = ee.high;
                            var O = ee.low;
                            var te = (P >>> 1 | O << 31) ^ (P >>> 8 | O << 24) ^ P >>> 7;
                            var ne = (O >>> 1 | P << 31) ^ (O >>> 8 | P << 24) ^ (O >>> 7 | P << 25);
                            var ie = Ee[R - 2];
                            var M = ie.high;
                            var D = ie.low;
                            var oe = (M >>> 19 | D << 13) ^ (M << 3 | D >>> 29) ^ M >>> 6;
                            var re = (D >>> 19 | M << 13) ^ (D << 3 | M >>> 29) ^ (D >>> 6 | M << 26);
                            var se = Ee[R - 7];
                            var ae = se.high;
                            var ce = se.low;
                            var le = Ee[R - 16];
                            var de = le.high;
                            var pe = le.low;
                            var x = ne + ce;
                            var Z = te + ae + (x >>> 0 < ne >>> 0 ? 1 : 0);
                            var x = x + re;
                            var Z = Z + oe + (x >>> 0 < re >>> 0 ? 1 : 0);
                            var x = x + pe;
                            var Z = Z + de + (x >>> 0 < pe >>> 0 ? 1 : 0);
                            Q.high = Z;
                            Q.low = x
                        }
                        var ue = C & J ^ ~C & Y;
                        var he = w & T ^ ~w & E;
                        var fe = y & _ ^ y & S ^ _ & S;
                        var me = g & v ^ g & b ^ v & b;
                        var ye = (y >>> 28 | g << 4) ^ (y << 30 | g >>> 2) ^ (y << 25 | g >>> 7);
                        var ge = (g >>> 28 | y << 4) ^ (g << 30 | y >>> 2) ^ (g << 25 | y >>> 7);
                        var _e = (C >>> 14 | w << 18) ^ (C >>> 18 | w << 14) ^ (C << 23 | w >>> 9);
                        var ve = (w >>> 14 | C << 18) ^ (w >>> 18 | C << 14) ^ (w << 23 | C >>> 9);
                        var Se = Te[R];
                        var be = Se.high;
                        var ke = Se.low;
                        var A = I + ve;
                        var B = X + _e + (A >>> 0 < I >>> 0 ? 1 : 0);
                        var A = A + he;
                        var B = B + ue + (A >>> 0 < he >>> 0 ? 1 : 0);
                        var A = A + ke;
                        var B = B + be + (A >>> 0 < ke >>> 0 ? 1 : 0);
                        var A = A + x;
                        var B = B + Z + (A >>> 0 < x >>> 0 ? 1 : 0);
                        var Ce = ge + me;
                        var we = ye + fe + (Ce >>> 0 < ge >>> 0 ? 1 : 0);
                        X = Y;
                        I = E;
                        Y = J;
                        E = T;
                        J = C;
                        T = w;
                        w = k + A | 0;
                        C = q + B + (w >>> 0 < k >>> 0 ? 1 : 0) | 0;
                        q = S;
                        k = b;
                        S = _;
                        b = v;
                        _ = y;
                        v = g;
                        g = A + Ce | 0;
                        y = B + we + (g >>> 0 < A >>> 0 ? 1 : 0) | 0
                    }
                    l = t.low = l + g;
                    t.high = F + y + (l >>> 0 < g >>> 0 ? 1 : 0);
                    d = n.low = d + v;
                    n.high = $ + _ + (d >>> 0 < v >>> 0 ? 1 : 0);
                    p = i.low = p + b;
                    i.high = j + S + (p >>> 0 < b >>> 0 ? 1 : 0);
                    u = o.low = u + k;
                    o.high = U + q + (u >>> 0 < k >>> 0 ? 1 : 0);
                    h = r.low = h + w;
                    r.high = H + C + (h >>> 0 < w >>> 0 ? 1 : 0);
                    f = s.low = f + T;
                    s.high = G + J + (f >>> 0 < T >>> 0 ? 1 : 0);
                    m = a.low = m + E;
                    a.high = V + Y + (m >>> 0 < E >>> 0 ? 1 : 0);
                    z = c.low = z + I;
                    c.high = W + X + (z >>> 0 < I >>> 0 ? 1 : 0)
                },
                _doFinalize: function e() {
                    var t = this._data;
                    var n = t.words;
                    var i = this._nDataBytes * 8;
                    var o = t.sigBytes * 8;
                    n[o >>> 5] |= 128 << 24 - o % 32;
                    n[(o + 128 >>> 10 << 5) + 30] = Math.floor(i / 4294967296);
                    n[(o + 128 >>> 10 << 5) + 31] = i;
                    t.sigBytes = n.length * 4;
                    this._process();
                    var r = this._hash.toX32();
                    return r
                },
                clone: function e() {
                    var e = i.clone.call(this);
                    e._hash = this._hash.clone();
                    return e
                },
                blockSize: 1024 / 32
            });
            return t.SHA512 = i._createHelper(d),
            t.HmacSHA512 = i._createHmacHelper(d),
            e.SHA512
        }(core)
    })
      , sha384 = createCommonjsModule(function(e, t) {
        var n, i, o, r, s;
        e.exports = (s = (n = e = core).x64,
        i = s.Word,
        o = s.WordArray,
        s = n.algo,
        r = s.SHA512,
        s = s.SHA384 = r.extend({
            _doReset: function() {
                this._hash = new o.init([new i.init(3418070365,3238371032), new i.init(1654270250,914150663), new i.init(2438529370,812702999), new i.init(355462360,4144912697), new i.init(1731405415,4290775857), new i.init(2394180231,1750603025), new i.init(3675008525,1694076839), new i.init(1203062813,3204075428)])
            },
            _doFinalize: function() {
                var e = r._doFinalize.call(this);
                return e.sigBytes -= 16,
                e
            }
        }),
        n.SHA384 = r._createHelper(s),
        n.HmacSHA384 = r._createHmacHelper(s),
        e.SHA384)
    })
      , sha3 = createCommonjsModule(function(e, t) {
        e.exports = function(e) {
            for (var h = Math, t = e, n = t.lib, f = n.WordArray, i = n.Hasher, o, r = t.x64.Word, s = t.algo, P = [], O = [], M = [], a = 1, c = 0, l = 0; l < 24; l++) {
                P[a + 5 * c] = (l + 1) * (l + 2) / 2 % 64;
                var d = c % 5;
                var p = (2 * a + 3 * c) % 5;
                a = d;
                c = p
            }
            for (var a = 0; a < 5; a++)
                for (var c = 0; c < 5; c++)
                    O[a + 5 * c] = c + (2 * a + 3 * c) % 5 * 5;
            for (var u = 1, m = 0; m < 24; m++) {
                var y = 0;
                var g = 0;
                for (var _ = 0; _ < 7; _++) {
                    if (u & 1) {
                        var v = (1 << _) - 1;
                        if (v < 32)
                            g ^= 1 << v;
                        else
                            y ^= 1 << v - 32
                    }
                    if (u & 128)
                        u = u << 1 ^ 113;
                    else
                        u <<= 1
                }
                M[m] = r.create(y, g)
            }
            for (var D = [], S = 0; S < 25; S++)
                D[S] = r.create();
            var b = s.SHA3 = i.extend({
                cfg: i.cfg.extend({
                    outputLength: 512
                }),
                _doReset: function e() {
                    var t = this._state = [];
                    for (var n = 0; n < 25; n++)
                        t[n] = new r.init;
                    this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32
                },
                _doProcessBlock: function e(t, n) {
                    var i = this._state;
                    var o = this.blockSize / 2;
                    for (var r = 0; r < o; r++) {
                        var s = t[n + 2 * r];
                        var a = t[n + 2 * r + 1];
                        s = (s << 8 | s >>> 24) & 16711935 | (s << 24 | s >>> 8) & 4278255360;
                        a = (a << 8 | a >>> 24) & 16711935 | (a << 24 | a >>> 8) & 4278255360;
                        var c = i[r];
                        c.high ^= a;
                        c.low ^= s
                    }
                    for (var l = 0; l < 24; l++) {
                        for (var d = 0; d < 5; d++) {
                            var p = 0
                              , u = 0;
                            for (var h = 0; h < 5; h++) {
                                var c = i[d + 5 * h];
                                p ^= c.high;
                                u ^= c.low
                            }
                            var f = D[d];
                            f.high = p;
                            f.low = u
                        }
                        for (var d = 0; d < 5; d++) {
                            var m = D[(d + 4) % 5];
                            var y = D[(d + 1) % 5];
                            var g = y.high;
                            var _ = y.low;
                            var p = m.high ^ (g << 1 | _ >>> 31);
                            var u = m.low ^ (_ << 1 | g >>> 31);
                            for (var h = 0; h < 5; h++) {
                                var c = i[d + 5 * h];
                                c.high ^= p;
                                c.low ^= u
                            }
                        }
                        for (var v = 1; v < 25; v++) {
                            var c = i[v];
                            var S = c.high;
                            var b = c.low;
                            var k = P[v];
                            if (k < 32) {
                                var p = S << k | b >>> 32 - k;
                                var u = b << k | S >>> 32 - k
                            } else {
                                var p = b << k - 32 | S >>> 64 - k;
                                var u = S << k - 32 | b >>> 64 - k
                            }
                            var C = D[O[v]];
                            C.high = p;
                            C.low = u
                        }
                        var w = D[0];
                        var T = i[0];
                        w.high = T.high;
                        w.low = T.low;
                        for (var d = 0; d < 5; d++)
                            for (var h = 0; h < 5; h++) {
                                var v = d + 5 * h;
                                var c = i[v];
                                var E = D[v];
                                var I = D[(d + 1) % 5 + 5 * h];
                                var R = D[(d + 2) % 5 + 5 * h];
                                c.high = E.high ^ ~I.high & R.high;
                                c.low = E.low ^ ~I.low & R.low
                            }
                        var c = i[0];
                        var x = M[l];
                        c.high ^= x.high;
                        c.low ^= x.low
                    }
                },
                _doFinalize: function e() {
                    var t = this._data;
                    var n = t.words;
                    this._nDataBytes * 8;
                    var i = t.sigBytes * 8;
                    var o = this.blockSize * 32;
                    n[i >>> 5] |= 1 << 24 - i % 32;
                    n[(h.ceil((i + 1) / o) * o >>> 5) - 1] |= 128;
                    t.sigBytes = n.length * 4;
                    this._process();
                    var r = this._state;
                    var s = this.cfg.outputLength / 8;
                    var a = s / 8;
                    var c = [];
                    for (var l = 0; l < a; l++) {
                        var d = r[l];
                        var p = d.high;
                        var u = d.low;
                        p = (p << 8 | p >>> 24) & 16711935 | (p << 24 | p >>> 8) & 4278255360;
                        u = (u << 8 | u >>> 24) & 16711935 | (u << 24 | u >>> 8) & 4278255360;
                        c.push(u);
                        c.push(p)
                    }
                    return new f.init(c,s)
                },
                clone: function e() {
                    var e = i.clone.call(this);
                    var t = e._state = this._state.slice(0);
                    for (var n = 0; n < 25; n++)
                        t[n] = t[n].clone();
                    return e
                }
            });
            return t.SHA3 = i._createHelper(b),
            t.HmacSHA3 = i._createHmacHelper(b),
            e.SHA3
        }(core)
    })
      , ripemd160 = createCommonjsModule(function(e, t) {
        function C(e, t, n) {
            return e & t | ~e & n
        }
        function w(e, t, n) {
            return e & n | t & ~n
        }
        function T(e, t) {
            return e << t | e >>> 32 - t
        }
        var n, i, o, E, I, R, x, P, O, r;
        e.exports = (r = (n = e = core).lib,
        i = r.WordArray,
        o = r.Hasher,
        r = n.algo,
        E = i.create([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]),
        I = i.create([5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]),
        R = i.create([11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6]),
        x = i.create([8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11]),
        P = i.create([0, 1518500249, 1859775393, 2400959708, 2840853838]),
        O = i.create([1352829926, 1548603684, 1836072691, 2053994217, 0]),
        r = r.RIPEMD160 = o.extend({
            _doReset: function() {
                this._hash = i.create([1732584193, 4023233417, 2562383102, 271733878, 3285377520])
            },
            _doProcessBlock: function(e, t) {
                for (var n = 0; n < 16; n++) {
                    var i = t + n
                      , o = e[i];
                    e[i] = 16711935 & (o << 8 | o >>> 24) | 4278255360 & (o << 24 | o >>> 8)
                }
                for (var r, s, a, c, l, d, p = this._hash.words, u = P.words, h = O.words, f = E.words, m = I.words, y = R.words, g = x.words, _ = r = p[0], v = s = p[1], S = a = p[2], b = c = p[3], k = l = p[4], n = 0; n < 80; n += 1)
                    d = (d = T(d = (d = r + e[t + f[n]] | 0) + (n < 16 ? (s ^ a ^ c) + u[0] : n < 32 ? C(s, a, c) + u[1] : n < 48 ? ((s | ~a) ^ c) + u[2] : n < 64 ? w(s, a, c) + u[3] : (s ^ (a | ~c)) + u[4]) | 0, y[n])) + l | 0,
                    r = l,
                    l = c,
                    c = T(a, 10),
                    a = s,
                    s = d,
                    d = (d = T(d = (d = _ + e[t + m[n]] | 0) + (n < 16 ? (v ^ (S | ~b)) + h[0] : n < 32 ? w(v, S, b) + h[1] : n < 48 ? ((v | ~S) ^ b) + h[2] : n < 64 ? C(v, S, b) + h[3] : (v ^ S ^ b) + h[4]) | 0, g[n])) + k | 0,
                    _ = k,
                    k = b,
                    b = T(S, 10),
                    S = v,
                    v = d;
                d = p[1] + a + b | 0,
                p[1] = p[2] + c + k | 0,
                p[2] = p[3] + l + _ | 0,
                p[3] = p[4] + r + v | 0,
                p[4] = p[0] + s + S | 0,
                p[0] = d
            },
            _doFinalize: function() {
                for (var e = this._data, t = e.words, n = 8 * this._nDataBytes, i = 8 * e.sigBytes, i = (t[i >>> 5] |= 128 << 24 - i % 32,
                t[14 + (64 + i >>> 9 << 4)] = 16711935 & (n << 8 | n >>> 24) | 4278255360 & (n << 24 | n >>> 8),
                e.sigBytes = 4 * (t.length + 1),
                this._process(),
                this._hash), o = i.words, r = 0; r < 5; r++) {
                    var s = o[r];
                    o[r] = 16711935 & (s << 8 | s >>> 24) | 4278255360 & (s << 24 | s >>> 8)
                }
                return i
            },
            clone: function() {
                var e;
                return (e = o.clone.call(this))._hash = this._hash.clone(),
                e
            }
        }),
        n.RIPEMD160 = o._createHelper(r),
        n.HmacRIPEMD160 = o._createHmacHelper(r),
        e.RIPEMD160)
    })
      , hmac = createCommonjsModule(function(e, t) {
        var n, a;
        e.exports = (n = (e = core).lib.Base,
        a = e.enc.Utf8,
        void (e.algo.HMAC = n.extend({
            init: function(e, t) {
                e = this._hasher = new e.init,
                "string" == typeof t && (t = a.parse(t));
                for (var n = e.blockSize, i = 4 * n, e = ((t = t.sigBytes > i ? e.finalize(t) : t).clamp(),
                this._oKey = t.clone()), t = this._iKey = t.clone(), o = e.words, r = t.words, s = 0; s < n; s++)
                    o[s] ^= 1549556828,
                    r[s] ^= 909522486;
                e.sigBytes = t.sigBytes = i,
                this.reset()
            },
            reset: function() {
                var e = this._hasher;
                e.reset(),
                e.update(this._iKey)
            },
            update: function(e) {
                return this._hasher.update(e),
                this
            },
            finalize: function(e) {
                var t = this._hasher
                  , e = t.finalize(e);
                return t.reset(),
                t.finalize(this._oKey.clone().concat(e))
            }
        })))
    })
      , pbkdf2 = createCommonjsModule(function(e, t) {
        var n, i, g, o, r, _, s;
        e.exports = (o = (n = e = core).lib,
        i = o.Base,
        g = o.WordArray,
        o = n.algo,
        r = o.SHA1,
        _ = o.HMAC,
        s = o.PBKDF2 = i.extend({
            cfg: i.extend({
                keySize: 4,
                hasher: r,
                iterations: 1
            }),
            init: function(e) {
                this.cfg = this.cfg.extend(e)
            },
            compute: function(e, t) {
                for (var n = this.cfg, i = _.create(n.hasher, e), o = g.create(), r = g.create([1]), s = o.words, a = r.words, c = n.keySize, l = n.iterations; s.length < c; ) {
                    for (var d = i.update(t).finalize(r), p = (i.reset(),
                    d.words), u = p.length, h = d, f = 1; f < l; f++) {
                        h = i.finalize(h),
                        i.reset();
                        for (var m = h.words, y = 0; y < u; y++)
                            p[y] ^= m[y]
                    }
                    o.concat(d),
                    a[0]++
                }
                return o.sigBytes = 4 * c,
                o
            }
        }),
        n.PBKDF2 = function(e, t, n) {
            return s.create(n).compute(e, t)
        }
        ,
        e.PBKDF2)
    })
      , evpkdf = createCommonjsModule(function(e, t) {
        var n, i, d, o, r, s;
        e.exports = (o = (n = e = core).lib,
        i = o.Base,
        d = o.WordArray,
        o = n.algo,
        r = o.MD5,
        s = o.EvpKDF = i.extend({
            cfg: i.extend({
                keySize: 4,
                hasher: r,
                iterations: 1
            }),
            init: function(e) {
                this.cfg = this.cfg.extend(e)
            },
            compute: function(e, t) {
                for (var n = this.cfg, i = n.hasher.create(), o = d.create(), r = o.words, s = n.keySize, a = n.iterations; r.length < s; ) {
                    c && i.update(c);
                    var c = i.update(e).finalize(t);
                    i.reset();
                    for (var l = 1; l < a; l++)
                        c = i.finalize(c),
                        i.reset();
                    o.concat(c)
                }
                return o.sigBytes = 4 * s,
                o
            }
        }),
        n.EvpKDF = function(e, t, n) {
            return s.create(n).compute(e, t)
        }
        ,
        e.EvpKDF)
    })
      , cipherCore = createCommonjsModule(function(e, t) {
        var n, i, s, o, r, a, c, l, d, p, u, h, f;
        e.exports = void ((e = core).lib.Cipher || (n = (e = e).lib,
        i = n.Base,
        s = n.WordArray,
        o = n.BufferedBlockAlgorithm,
        (p = e.enc).Utf8,
        r = p.Base64,
        a = e.algo.EvpKDF,
        c = n.Cipher = o.extend({
            cfg: i.extend(),
            createEncryptor: function(e, t) {
                return this.create(this._ENC_XFORM_MODE, e, t)
            },
            createDecryptor: function(e, t) {
                return this.create(this._DEC_XFORM_MODE, e, t)
            },
            init: function(e, t, n) {
                this.cfg = this.cfg.extend(n),
                this._xformMode = e,
                this._key = t,
                this.reset()
            },
            reset: function() {
                o.reset.call(this),
                this._doReset()
            },
            process: function(e) {
                return this._append(e),
                this._process()
            },
            finalize: function(e) {
                return e && this._append(e),
                this._doFinalize()
            },
            keySize: 4,
            ivSize: 4,
            _ENC_XFORM_MODE: 1,
            _DEC_XFORM_MODE: 2,
            _createHelper: function() {
                function o(e) {
                    return "string" == typeof e ? f : u
                }
                return function(i) {
                    return {
                        encrypt: function(e, t, n) {
                            return o(t).encrypt(i, e, t, n)
                        },
                        decrypt: function(e, t, n) {
                            return o(t).decrypt(i, e, t, n)
                        }
                    }
                }
            }()
        }),
        n.StreamCipher = c.extend({
            _doFinalize: function() {
                return this._process(!0)
            },
            blockSize: 1
        }),
        p = e.mode = {},
        l = n.BlockCipherMode = i.extend({
            createEncryptor: function(e, t) {
                return this.Encryptor.create(e, t)
            },
            createDecryptor: function(e, t) {
                return this.Decryptor.create(e, t)
            },
            init: function(e, t) {
                this._cipher = e,
                this._iv = t
            }
        }),
        p = p.CBC = function() {
            var e = l.extend();
            function r(e, t, n) {
                var i, o = this._iv;
                o ? (i = o,
                this._iv = void 0) : i = this._prevBlock;
                for (var r = 0; r < n; r++)
                    e[t + r] ^= i[r]
            }
            return e.Encryptor = e.extend({
                processBlock: function(e, t) {
                    var n = this._cipher
                      , i = n.blockSize;
                    r.call(this, e, t, i),
                    n.encryptBlock(e, t),
                    this._prevBlock = e.slice(t, t + i)
                }
            }),
            e.Decryptor = e.extend({
                processBlock: function(e, t) {
                    var n = this._cipher
                      , i = n.blockSize
                      , o = e.slice(t, t + i);
                    n.decryptBlock(e, t),
                    r.call(this, e, t, i),
                    this._prevBlock = o
                }
            }),
            e
        }(),
        h = (e.pad = {}).Pkcs7 = {
            pad: function(e, t) {
                for (var t = 4 * t, n = t - e.sigBytes % t, i = n << 24 | n << 16 | n << 8 | n, o = [], r = 0; r < n; r += 4)
                    o.push(i);
                t = s.create(o, n);
                e.concat(t)
            },
            unpad: function(e) {
                var t = 255 & e.words[e.sigBytes - 1 >>> 2];
                e.sigBytes -= t
            }
        },
        n.BlockCipher = c.extend({
            cfg: c.cfg.extend({
                mode: p,
                padding: h
            }),
            reset: function() {
                c.reset.call(this);
                var e, t = this.cfg, n = t.iv, t = t.mode;
                this._xformMode == this._ENC_XFORM_MODE ? e = t.createEncryptor : (e = t.createDecryptor,
                this._minBufferSize = 1),
                this._mode && this._mode.__creator == e ? this._mode.init(this, n && n.words) : (this._mode = e.call(t, this, n && n.words),
                this._mode.__creator = e)
            },
            _doProcessBlock: function(e, t) {
                this._mode.processBlock(e, t)
            },
            _doFinalize: function() {
                var e, t = this.cfg.padding;
                return this._xformMode == this._ENC_XFORM_MODE ? (t.pad(this._data, this.blockSize),
                e = this._process(!0)) : (e = this._process(!0),
                t.unpad(e)),
                e
            },
            blockSize: 4
        }),
        d = n.CipherParams = i.extend({
            init: function(e) {
                this.mixIn(e)
            },
            toString: function(e) {
                return (e || this.formatter).stringify(this)
            }
        }),
        p = (e.format = {}).OpenSSL = {
            stringify: function(e) {
                var t = e.ciphertext
                  , e = e.salt;
                return (e ? s.create([1398893684, 1701076831]).concat(e).concat(t) : t).toString(r)
            },
            parse: function(e) {
                var t, e = r.parse(e), n = e.words;
                return 1398893684 == n[0] && 1701076831 == n[1] && (t = s.create(n.slice(2, 4)),
                n.splice(0, 4),
                e.sigBytes -= 16),
                d.create({
                    ciphertext: e,
                    salt: t
                })
            }
        },
        u = n.SerializableCipher = i.extend({
            cfg: i.extend({
                format: p
            }),
            encrypt: function(e, t, n, i) {
                i = this.cfg.extend(i);
                var o = e.createEncryptor(n, i)
                  , t = o.finalize(t)
                  , o = o.cfg;
                return d.create({
                    ciphertext: t,
                    key: n,
                    iv: o.iv,
                    algorithm: e,
                    mode: o.mode,
                    padding: o.padding,
                    blockSize: e.blockSize,
                    formatter: i.format
                })
            },
            decrypt: function(e, t, n, i) {
                return i = this.cfg.extend(i),
                t = this._parse(t, i.format),
                e.createDecryptor(n, i).finalize(t.ciphertext)
            },
            _parse: function(e, t) {
                return "string" == typeof e ? t.parse(e, this) : e
            }
        }),
        h = (e.kdf = {}).OpenSSL = {
            execute: function(e, t, n, i) {
                i = i || s.random(8);
                e = a.create({
                    keySize: t + n
                }).compute(e, i),
                n = s.create(e.words.slice(t), 4 * n);
                return e.sigBytes = 4 * t,
                d.create({
                    key: e,
                    iv: n,
                    salt: i
                })
            }
        },
        f = n.PasswordBasedCipher = u.extend({
            cfg: u.cfg.extend({
                kdf: h
            }),
            encrypt: function(e, t, n, i) {
                n = (i = this.cfg.extend(i)).kdf.execute(n, e.keySize, e.ivSize),
                i.iv = n.iv,
                e = u.encrypt.call(this, e, t, n.key, i);
                return e.mixIn(n),
                e
            },
            decrypt: function(e, t, n, i) {
                i = this.cfg.extend(i),
                t = this._parse(t, i.format);
                n = i.kdf.execute(n, e.keySize, e.ivSize, t.salt);
                return i.iv = n.iv,
                u.decrypt.call(this, e, t, n.key, i)
            }
        })))
    })
      , modeCfb = createCommonjsModule(function(e, t) {
        var n;
        e.exports = ((n = core).mode.CFB = function() {
            var e = n.lib.BlockCipherMode.extend();
            function r(e, t, n, i) {
                var o, r = this._iv;
                r ? (o = r.slice(0),
                this._iv = void 0) : o = this._prevBlock,
                i.encryptBlock(o, 0);
                for (var s = 0; s < n; s++)
                    e[t + s] ^= o[s]
            }
            return e.Encryptor = e.extend({
                processBlock: function(e, t) {
                    var n = this._cipher
                      , i = n.blockSize;
                    r.call(this, e, t, i, n),
                    this._prevBlock = e.slice(t, t + i)
                }
            }),
            e.Decryptor = e.extend({
                processBlock: function(e, t) {
                    var n = this._cipher
                      , i = n.blockSize
                      , o = e.slice(t, t + i);
                    r.call(this, e, t, i, n),
                    this._prevBlock = o
                }
            }),
            e
        }(),
        n.mode.CFB)
    })
      , modeCtr = createCommonjsModule(function(e, t) {
        var n;
        e.exports = ((n = core).mode.CTR = function() {
            var e = n.lib.BlockCipherMode.extend()
              , t = e.Encryptor = e.extend({
                processBlock: function(e, t) {
                    var n = this._cipher
                      , i = n.blockSize
                      , o = this._iv
                      , r = this._counter
                      , s = (o && (r = this._counter = o.slice(0),
                    this._iv = void 0),
                    r.slice(0));
                    n.encryptBlock(s, 0),
                    r[i - 1] = r[i - 1] + 1 | 0;
                    for (var a = 0; a < i; a++)
                        e[t + a] ^= s[a]
                }
            });
            return e.Decryptor = t,
            e
        }(),
        n.mode.CTR)
    })
      , modeCtrGladman = createCommonjsModule(function(e, t) {
        var n;
        e.exports = ((n = core).mode.CTRGladman = function() {
            var e = n.lib.BlockCipherMode.extend();
            function c(e) {
                var t, n, i;
                return 255 == (e >> 24 & 255) ? (n = e >> 8 & 255,
                i = 255 & e,
                255 === (t = e >> 16 & 255) ? (t = 0,
                255 === n ? (n = 0,
                255 === i ? i = 0 : ++i) : ++n) : ++t,
                e = 0,
                e = (e += t << 16) + (n << 8) + i) : e += 1 << 24,
                e
            }
            var t = e.Encryptor = e.extend({
                processBlock: function(e, t) {
                    var n = this._cipher
                      , i = n.blockSize
                      , o = this._iv
                      , r = this._counter
                      , s = (o && (r = this._counter = o.slice(0),
                    this._iv = void 0),
                    0 === ((o = r)[0] = c(o[0])) && (o[1] = c(o[1])),
                    r.slice(0));
                    n.encryptBlock(s, 0);
                    for (var a = 0; a < i; a++)
                        e[t + a] ^= s[a]
                }
            });
            return e.Decryptor = t,
            e
        }(),
        n.mode.CTRGladman)
    })
      , modeOfb = createCommonjsModule(function(e, t) {
        var n;
        e.exports = ((n = core).mode.OFB = function() {
            var e = n.lib.BlockCipherMode.extend()
              , t = e.Encryptor = e.extend({
                processBlock: function(e, t) {
                    var n = this._cipher
                      , i = n.blockSize
                      , o = this._iv
                      , r = this._keystream;
                    o && (r = this._keystream = o.slice(0),
                    this._iv = void 0),
                    n.encryptBlock(r, 0);
                    for (var s = 0; s < i; s++)
                        e[t + s] ^= r[s]
                }
            });
            return e.Decryptor = t,
            e
        }(),
        n.mode.OFB)
    })
      , modeEcb = createCommonjsModule(function(e, t) {
        var n;
        e.exports = ((n = core).mode.ECB = function() {
            var e = n.lib.BlockCipherMode.extend();
            return e.Encryptor = e.extend({
                processBlock: function(e, t) {
                    this._cipher.encryptBlock(e, t)
                }
            }),
            e.Decryptor = e.extend({
                processBlock: function(e, t) {
                    this._cipher.decryptBlock(e, t)
                }
            }),
            e
        }(),
        n.mode.ECB)
    })
      , padAnsix923 = createCommonjsModule(function(e, t) {
        e.exports = ((e = core).pad.AnsiX923 = {
            pad: function(e, t) {
                var n = e.sigBytes
                  , t = 4 * t
                  , t = t - n % t
                  , n = n + t - 1;
                e.clamp(),
                e.words[n >>> 2] |= t << 24 - n % 4 * 8,
                e.sigBytes += t
            },
            unpad: function(e) {
                var t = 255 & e.words[e.sigBytes - 1 >>> 2];
                e.sigBytes -= t
            }
        },
        e.pad.Ansix923)
    })
      , padIso10126 = createCommonjsModule(function(e, t) {
        var n;
        e.exports = ((n = core).pad.Iso10126 = {
            pad: function(e, t) {
                t *= 4,
                t -= e.sigBytes % t;
                e.concat(n.lib.WordArray.random(t - 1)).concat(n.lib.WordArray.create([t << 24], 1))
            },
            unpad: function(e) {
                var t = 255 & e.words[e.sigBytes - 1 >>> 2];
                e.sigBytes -= t
            }
        },
        n.pad.Iso10126)
    })
      , padIso97971 = createCommonjsModule(function(e, t) {
        var n;
        e.exports = ((n = core).pad.Iso97971 = {
            pad: function(e, t) {
                e.concat(n.lib.WordArray.create([2147483648], 1)),
                n.pad.ZeroPadding.pad(e, t)
            },
            unpad: function(e) {
                n.pad.ZeroPadding.unpad(e),
                e.sigBytes--
            }
        },
        n.pad.Iso97971)
    })
      , padZeropadding = createCommonjsModule(function(e, t) {
        e.exports = ((e = core).pad.ZeroPadding = {
            pad: function(e, t) {
                t *= 4;
                e.clamp(),
                e.sigBytes += t - (e.sigBytes % t || t)
            },
            unpad: function(e) {
                for (var t = e.words, n = e.sigBytes - 1; !(t[n >>> 2] >>> 24 - n % 4 * 8 & 255); )
                    n--;
                e.sigBytes = n + 1
            }
        },
        e.pad.ZeroPadding)
    })
      , padNopadding = createCommonjsModule(function(e, t) {
        e.exports = ((e = core).pad.NoPadding = {
            pad: function() {},
            unpad: function() {}
        },
        e.pad.NoPadding)
    })
      , formatHex = createCommonjsModule(function(e, t) {
        var n, i;
        e.exports = (n = (e = core).lib.CipherParams,
        i = e.enc.Hex,
        e.format.Hex = {
            stringify: function(e) {
                return e.ciphertext.toString(i)
            },
            parse: function(e) {
                e = i.parse(e);
                return n.create({
                    ciphertext: e
                })
            }
        },
        e.format.Hex)
    })
      , aes = createCommonjsModule(function(e, t) {
        e.exports = function(e) {
            for (var t = e, n, i = t.lib.BlockCipher, o = t.algo, p = [], r = [], s = [], a = [], c = [], l = [], u = [], h = [], f = [], m = [], d = [], y = 0; y < 256; y++)
                if (y < 128)
                    d[y] = y << 1;
                else
                    d[y] = y << 1 ^ 283;
            for (var g = 0, _ = 0, y = 0; y < 256; y++) {
                var v = _ ^ _ << 1 ^ _ << 2 ^ _ << 3 ^ _ << 4;
                v = v >>> 8 ^ v & 255 ^ 99;
                p[g] = v;
                r[v] = g;
                var S = d[g];
                var b = d[S];
                var k = d[b];
                var C = d[v] * 257 ^ v * 16843008;
                s[g] = C << 24 | C >>> 8;
                a[g] = C << 16 | C >>> 16;
                c[g] = C << 8 | C >>> 24;
                l[g] = C;
                var C = k * 16843009 ^ b * 65537 ^ S * 257 ^ g * 16843008;
                u[v] = C << 24 | C >>> 8;
                h[v] = C << 16 | C >>> 16;
                f[v] = C << 8 | C >>> 24;
                m[v] = C;
                if (!g)
                    g = _ = 1;
                else {
                    g = S ^ d[d[d[k ^ S]]];
                    _ ^= d[d[_]]
                }
            }
            var w = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54]
              , T = o.AES = i.extend({
                _doReset: function e() {
                    if (this._nRounds && this._keyPriorReset === this._key)
                        return;
                    var t = this._keyPriorReset = this._key;
                    var n = t.words;
                    var i = t.sigBytes / 4;
                    var o = this._nRounds = i + 6;
                    var r = (o + 1) * 4;
                    var s = this._keySchedule = [];
                    for (var a = 0; a < r; a++)
                        if (a < i)
                            s[a] = n[a];
                        else {
                            var c = s[a - 1];
                            if (!(a % i)) {
                                c = c << 8 | c >>> 24;
                                c = p[c >>> 24] << 24 | p[c >>> 16 & 255] << 16 | p[c >>> 8 & 255] << 8 | p[c & 255];
                                c ^= w[a / i | 0] << 24
                            } else if (i > 6 && a % i == 4)
                                c = p[c >>> 24] << 24 | p[c >>> 16 & 255] << 16 | p[c >>> 8 & 255] << 8 | p[c & 255];
                            s[a] = s[a - i] ^ c
                        }
                    var l = this._invKeySchedule = [];
                    for (var d = 0; d < r; d++) {
                        var a = r - d;
                        if (d % 4)
                            var c = s[a];
                        else
                            var c = s[a - 4];
                        if (d < 4 || a <= 4)
                            l[d] = c;
                        else
                            l[d] = u[p[c >>> 24]] ^ h[p[c >>> 16 & 255]] ^ f[p[c >>> 8 & 255]] ^ m[p[c & 255]]
                    }
                },
                encryptBlock: function e(t, n) {
                    this._doCryptBlock(t, n, this._keySchedule, s, a, c, l, p)
                },
                decryptBlock: function e(t, n) {
                    var i = t[n + 1];
                    t[n + 1] = t[n + 3];
                    t[n + 3] = i;
                    this._doCryptBlock(t, n, this._invKeySchedule, u, h, f, m, r);
                    var i = t[n + 1];
                    t[n + 1] = t[n + 3];
                    t[n + 3] = i
                },
                _doCryptBlock: function e(t, n, i, o, r, s, a, c) {
                    var l = this._nRounds;
                    var d = t[n] ^ i[0];
                    var p = t[n + 1] ^ i[1];
                    var u = t[n + 2] ^ i[2];
                    var h = t[n + 3] ^ i[3];
                    var f = 4;
                    for (var m = 1; m < l; m++) {
                        var y = o[d >>> 24] ^ r[p >>> 16 & 255] ^ s[u >>> 8 & 255] ^ a[h & 255] ^ i[f++];
                        var g = o[p >>> 24] ^ r[u >>> 16 & 255] ^ s[h >>> 8 & 255] ^ a[d & 255] ^ i[f++];
                        var _ = o[u >>> 24] ^ r[h >>> 16 & 255] ^ s[d >>> 8 & 255] ^ a[p & 255] ^ i[f++];
                        var v = o[h >>> 24] ^ r[d >>> 16 & 255] ^ s[p >>> 8 & 255] ^ a[u & 255] ^ i[f++];
                        d = y;
                        p = g;
                        u = _;
                        h = v
                    }
                    var y = (c[d >>> 24] << 24 | c[p >>> 16 & 255] << 16 | c[u >>> 8 & 255] << 8 | c[h & 255]) ^ i[f++];
                    var g = (c[p >>> 24] << 24 | c[u >>> 16 & 255] << 16 | c[h >>> 8 & 255] << 8 | c[d & 255]) ^ i[f++];
                    var _ = (c[u >>> 24] << 24 | c[h >>> 16 & 255] << 16 | c[d >>> 8 & 255] << 8 | c[p & 255]) ^ i[f++];
                    var v = (c[h >>> 24] << 24 | c[d >>> 16 & 255] << 16 | c[p >>> 8 & 255] << 8 | c[u & 255]) ^ i[f++];
                    t[n] = y;
                    t[n + 1] = g;
                    t[n + 2] = _;
                    t[n + 3] = v
                },
                keySize: 256 / 32
            });
            return t.AES = i._createHelper(T),
            e.AES
        }(core)
    })
      , tripledes = createCommonjsModule(function(e, t) {
        function d(e, t) {
            t = (this._lBlock >>> e ^ this._rBlock) & t;
            this._rBlock ^= t,
            this._lBlock ^= t << e
        }
        function p(e, t) {
            t = (this._rBlock >>> e ^ this._lBlock) & t;
            this._lBlock ^= t,
            this._rBlock ^= t << e
        }
        var n, i, o, l, u, h, f, m, r, s;
        e.exports = (o = (n = e = core).lib,
        i = o.WordArray,
        o = o.BlockCipher,
        s = n.algo,
        l = [57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36, 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4],
        u = [14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2, 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48, 44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32],
        h = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28],
        f = [{
            0: 8421888,
            268435456: 32768,
            536870912: 8421378,
            805306368: 2,
            1073741824: 512,
            1342177280: 8421890,
            1610612736: 8389122,
            1879048192: 8388608,
            2147483648: 514,
            2415919104: 8389120,
            2684354560: 33280,
            2952790016: 8421376,
            3221225472: 32770,
            3489660928: 8388610,
            3758096384: 0,
            4026531840: 33282,
            134217728: 0,
            402653184: 8421890,
            671088640: 33282,
            939524096: 32768,
            1207959552: 8421888,
            1476395008: 512,
            1744830464: 8421378,
            2013265920: 2,
            2281701376: 8389120,
            2550136832: 33280,
            2818572288: 8421376,
            3087007744: 8389122,
            3355443200: 8388610,
            3623878656: 32770,
            3892314112: 514,
            4160749568: 8388608,
            1: 32768,
            268435457: 2,
            536870913: 8421888,
            805306369: 8388608,
            1073741825: 8421378,
            1342177281: 33280,
            1610612737: 512,
            1879048193: 8389122,
            2147483649: 8421890,
            2415919105: 8421376,
            2684354561: 8388610,
            2952790017: 33282,
            3221225473: 514,
            3489660929: 8389120,
            3758096385: 32770,
            4026531841: 0,
            134217729: 8421890,
            402653185: 8421376,
            671088641: 8388608,
            939524097: 512,
            1207959553: 32768,
            1476395009: 8388610,
            1744830465: 2,
            2013265921: 33282,
            2281701377: 32770,
            2550136833: 8389122,
            2818572289: 514,
            3087007745: 8421888,
            3355443201: 8389120,
            3623878657: 0,
            3892314113: 33280,
            4160749569: 8421378
        }, {
            0: 1074282512,
            16777216: 16384,
            33554432: 524288,
            50331648: 1074266128,
            67108864: 1073741840,
            83886080: 1074282496,
            100663296: 1073758208,
            117440512: 16,
            134217728: 540672,
            150994944: 1073758224,
            167772160: 1073741824,
            184549376: 540688,
            201326592: 524304,
            218103808: 0,
            234881024: 16400,
            251658240: 1074266112,
            8388608: 1073758208,
            25165824: 540688,
            41943040: 16,
            58720256: 1073758224,
            75497472: 1074282512,
            92274688: 1073741824,
            109051904: 524288,
            125829120: 1074266128,
            142606336: 524304,
            159383552: 0,
            176160768: 16384,
            192937984: 1074266112,
            209715200: 1073741840,
            226492416: 540672,
            243269632: 1074282496,
            260046848: 16400,
            268435456: 0,
            285212672: 1074266128,
            301989888: 1073758224,
            318767104: 1074282496,
            335544320: 1074266112,
            352321536: 16,
            369098752: 540688,
            385875968: 16384,
            402653184: 16400,
            419430400: 524288,
            436207616: 524304,
            452984832: 1073741840,
            469762048: 540672,
            486539264: 1073758208,
            503316480: 1073741824,
            520093696: 1074282512,
            276824064: 540688,
            293601280: 524288,
            310378496: 1074266112,
            327155712: 16384,
            343932928: 1073758208,
            360710144: 1074282512,
            377487360: 16,
            394264576: 1073741824,
            411041792: 1074282496,
            427819008: 1073741840,
            444596224: 1073758224,
            461373440: 524304,
            478150656: 0,
            494927872: 16400,
            511705088: 1074266128,
            528482304: 540672
        }, {
            0: 260,
            1048576: 0,
            2097152: 67109120,
            3145728: 65796,
            4194304: 65540,
            5242880: 67108868,
            6291456: 67174660,
            7340032: 67174400,
            8388608: 67108864,
            9437184: 67174656,
            10485760: 65792,
            11534336: 67174404,
            12582912: 67109124,
            13631488: 65536,
            14680064: 4,
            15728640: 256,
            524288: 67174656,
            1572864: 67174404,
            2621440: 0,
            3670016: 67109120,
            4718592: 67108868,
            5767168: 65536,
            6815744: 65540,
            7864320: 260,
            8912896: 4,
            9961472: 256,
            11010048: 67174400,
            12058624: 65796,
            13107200: 65792,
            14155776: 67109124,
            15204352: 67174660,
            16252928: 67108864,
            16777216: 67174656,
            17825792: 65540,
            18874368: 65536,
            19922944: 67109120,
            20971520: 256,
            22020096: 67174660,
            23068672: 67108868,
            24117248: 0,
            25165824: 67109124,
            26214400: 67108864,
            27262976: 4,
            28311552: 65792,
            29360128: 67174400,
            30408704: 260,
            31457280: 65796,
            32505856: 67174404,
            17301504: 67108864,
            18350080: 260,
            19398656: 67174656,
            20447232: 0,
            21495808: 65540,
            22544384: 67109120,
            23592960: 256,
            24641536: 67174404,
            25690112: 65536,
            26738688: 67174660,
            27787264: 65796,
            28835840: 67108868,
            29884416: 67109124,
            30932992: 67174400,
            31981568: 4,
            33030144: 65792
        }, {
            0: 2151682048,
            65536: 2147487808,
            131072: 4198464,
            196608: 2151677952,
            262144: 0,
            327680: 4198400,
            393216: 2147483712,
            458752: 4194368,
            524288: 2147483648,
            589824: 4194304,
            655360: 64,
            720896: 2147487744,
            786432: 2151678016,
            851968: 4160,
            917504: 4096,
            983040: 2151682112,
            32768: 2147487808,
            98304: 64,
            163840: 2151678016,
            229376: 2147487744,
            294912: 4198400,
            360448: 2151682112,
            425984: 0,
            491520: 2151677952,
            557056: 4096,
            622592: 2151682048,
            688128: 4194304,
            753664: 4160,
            819200: 2147483648,
            884736: 4194368,
            950272: 4198464,
            1015808: 2147483712,
            1048576: 4194368,
            1114112: 4198400,
            1179648: 2147483712,
            1245184: 0,
            1310720: 4160,
            1376256: 2151678016,
            1441792: 2151682048,
            1507328: 2147487808,
            1572864: 2151682112,
            1638400: 2147483648,
            1703936: 2151677952,
            1769472: 4198464,
            1835008: 2147487744,
            1900544: 4194304,
            1966080: 64,
            2031616: 4096,
            1081344: 2151677952,
            1146880: 2151682112,
            1212416: 0,
            1277952: 4198400,
            1343488: 4194368,
            1409024: 2147483648,
            1474560: 2147487808,
            1540096: 64,
            1605632: 2147483712,
            1671168: 4096,
            1736704: 2147487744,
            1802240: 2151678016,
            1867776: 4160,
            1933312: 2151682048,
            1998848: 4194304,
            2064384: 4198464
        }, {
            0: 128,
            4096: 17039360,
            8192: 262144,
            12288: 536870912,
            16384: 537133184,
            20480: 16777344,
            24576: 553648256,
            28672: 262272,
            32768: 16777216,
            36864: 537133056,
            40960: 536871040,
            45056: 553910400,
            49152: 553910272,
            53248: 0,
            57344: 17039488,
            61440: 553648128,
            2048: 17039488,
            6144: 553648256,
            10240: 128,
            14336: 17039360,
            18432: 262144,
            22528: 537133184,
            26624: 553910272,
            30720: 536870912,
            34816: 537133056,
            38912: 0,
            43008: 553910400,
            47104: 16777344,
            51200: 536871040,
            55296: 553648128,
            59392: 16777216,
            63488: 262272,
            65536: 262144,
            69632: 128,
            73728: 536870912,
            77824: 553648256,
            81920: 16777344,
            86016: 553910272,
            90112: 537133184,
            94208: 16777216,
            98304: 553910400,
            102400: 553648128,
            106496: 17039360,
            110592: 537133056,
            114688: 262272,
            118784: 536871040,
            122880: 0,
            126976: 17039488,
            67584: 553648256,
            71680: 16777216,
            75776: 17039360,
            79872: 537133184,
            83968: 536870912,
            88064: 17039488,
            92160: 128,
            96256: 553910272,
            100352: 262272,
            104448: 553910400,
            108544: 0,
            112640: 553648128,
            116736: 16777344,
            120832: 262144,
            124928: 537133056,
            129024: 536871040
        }, {
            0: 268435464,
            256: 8192,
            512: 270532608,
            768: 270540808,
            1024: 268443648,
            1280: 2097152,
            1536: 2097160,
            1792: 268435456,
            2048: 0,
            2304: 268443656,
            2560: 2105344,
            2816: 8,
            3072: 270532616,
            3328: 2105352,
            3584: 8200,
            3840: 270540800,
            128: 270532608,
            384: 270540808,
            640: 8,
            896: 2097152,
            1152: 2105352,
            1408: 268435464,
            1664: 268443648,
            1920: 8200,
            2176: 2097160,
            2432: 8192,
            2688: 268443656,
            2944: 270532616,
            3200: 0,
            3456: 270540800,
            3712: 2105344,
            3968: 268435456,
            4096: 268443648,
            4352: 270532616,
            4608: 270540808,
            4864: 8200,
            5120: 2097152,
            5376: 268435456,
            5632: 268435464,
            5888: 2105344,
            6144: 2105352,
            6400: 0,
            6656: 8,
            6912: 270532608,
            7168: 8192,
            7424: 268443656,
            7680: 270540800,
            7936: 2097160,
            4224: 8,
            4480: 2105344,
            4736: 2097152,
            4992: 268435464,
            5248: 268443648,
            5504: 8200,
            5760: 270540808,
            6016: 270532608,
            6272: 270540800,
            6528: 270532616,
            6784: 8192,
            7040: 2105352,
            7296: 2097160,
            7552: 0,
            7808: 268435456,
            8064: 268443656
        }, {
            0: 1048576,
            16: 33555457,
            32: 1024,
            48: 1049601,
            64: 34604033,
            80: 0,
            96: 1,
            112: 34603009,
            128: 33555456,
            144: 1048577,
            160: 33554433,
            176: 34604032,
            192: 34603008,
            208: 1025,
            224: 1049600,
            240: 33554432,
            8: 34603009,
            24: 0,
            40: 33555457,
            56: 34604032,
            72: 1048576,
            88: 33554433,
            104: 33554432,
            120: 1025,
            136: 1049601,
            152: 33555456,
            168: 34603008,
            184: 1048577,
            200: 1024,
            216: 34604033,
            232: 1,
            248: 1049600,
            256: 33554432,
            272: 1048576,
            288: 33555457,
            304: 34603009,
            320: 1048577,
            336: 33555456,
            352: 34604032,
            368: 1049601,
            384: 1025,
            400: 34604033,
            416: 1049600,
            432: 1,
            448: 0,
            464: 34603008,
            480: 33554433,
            496: 1024,
            264: 1049600,
            280: 33555457,
            296: 34603009,
            312: 1,
            328: 33554432,
            344: 1048576,
            360: 1025,
            376: 34604032,
            392: 33554433,
            408: 34603008,
            424: 0,
            440: 34604033,
            456: 1049601,
            472: 1024,
            488: 33555456,
            504: 1048577
        }, {
            0: 134219808,
            1: 131072,
            2: 134217728,
            3: 32,
            4: 131104,
            5: 134350880,
            6: 134350848,
            7: 2048,
            8: 134348800,
            9: 134219776,
            10: 133120,
            11: 134348832,
            12: 2080,
            13: 0,
            14: 134217760,
            15: 133152,
            2147483648: 2048,
            2147483649: 134350880,
            2147483650: 134219808,
            2147483651: 134217728,
            2147483652: 134348800,
            2147483653: 133120,
            2147483654: 133152,
            2147483655: 32,
            2147483656: 134217760,
            2147483657: 2080,
            2147483658: 131104,
            2147483659: 134350848,
            2147483660: 0,
            2147483661: 134348832,
            2147483662: 134219776,
            2147483663: 131072,
            16: 133152,
            17: 134350848,
            18: 32,
            19: 2048,
            20: 134219776,
            21: 134217760,
            22: 134348832,
            23: 131072,
            24: 0,
            25: 131104,
            26: 134348800,
            27: 134219808,
            28: 134350880,
            29: 133120,
            30: 2080,
            31: 134217728,
            2147483664: 131072,
            2147483665: 2048,
            2147483666: 134348832,
            2147483667: 133152,
            2147483668: 32,
            2147483669: 134348800,
            2147483670: 134217728,
            2147483671: 134219808,
            2147483672: 134350880,
            2147483673: 134217760,
            2147483674: 134219776,
            2147483675: 0,
            2147483676: 133120,
            2147483677: 2080,
            2147483678: 131104,
            2147483679: 134350848
        }],
        m = [4160749569, 528482304, 33030144, 2064384, 129024, 8064, 504, 2147483679],
        r = s.DES = o.extend({
            _doReset: function() {
                for (var e = this._key.words, t = [], n = 0; n < 56; n++) {
                    var i = l[n] - 1;
                    t[n] = e[i >>> 5] >>> 31 - i % 32 & 1
                }
                for (var o = this._subKeys = [], r = 0; r < 16; r++) {
                    for (var s = o[r] = [], a = h[r], n = 0; n < 24; n++)
                        s[n / 6 | 0] |= t[(u[n] - 1 + a) % 28] << 31 - n % 6,
                        s[4 + (n / 6 | 0)] |= t[28 + (u[n + 24] - 1 + a) % 28] << 31 - n % 6;
                    s[0] = s[0] << 1 | s[0] >>> 31;
                    for (n = 1; n < 7; n++)
                        s[n] = s[n] >>> 4 * (n - 1) + 3;
                    s[7] = s[7] << 5 | s[7] >>> 27
                }
                for (var c = this._invSubKeys = [], n = 0; n < 16; n++)
                    c[n] = o[15 - n]
            },
            encryptBlock: function(e, t) {
                this._doCryptBlock(e, t, this._subKeys)
            },
            decryptBlock: function(e, t) {
                this._doCryptBlock(e, t, this._invSubKeys)
            },
            _doCryptBlock: function(e, t, n) {
                this._lBlock = e[t],
                this._rBlock = e[t + 1],
                d.call(this, 4, 252645135),
                d.call(this, 16, 65535),
                p.call(this, 2, 858993459),
                p.call(this, 8, 16711935),
                d.call(this, 1, 1431655765);
                for (var i = 0; i < 16; i++) {
                    for (var o = n[i], r = this._lBlock, s = this._rBlock, a = 0, c = 0; c < 8; c++)
                        a |= f[c][((s ^ o[c]) & m[c]) >>> 0];
                    this._lBlock = s,
                    this._rBlock = r ^ a
                }
                var l = this._lBlock;
                this._lBlock = this._rBlock,
                this._rBlock = l,
                d.call(this, 1, 1431655765),
                p.call(this, 8, 16711935),
                p.call(this, 2, 858993459),
                d.call(this, 16, 65535),
                d.call(this, 4, 252645135),
                e[t] = this._lBlock,
                e[t + 1] = this._rBlock
            },
            keySize: 2,
            ivSize: 2,
            blockSize: 2
        }),
        n.DES = o._createHelper(r),
        s = s.TripleDES = o.extend({
            _doReset: function() {
                var e = this._key.words;
                this._des1 = r.createEncryptor(i.create(e.slice(0, 2))),
                this._des2 = r.createEncryptor(i.create(e.slice(2, 4))),
                this._des3 = r.createEncryptor(i.create(e.slice(4, 6)))
            },
            encryptBlock: function(e, t) {
                this._des1.encryptBlock(e, t),
                this._des2.decryptBlock(e, t),
                this._des3.encryptBlock(e, t)
            },
            decryptBlock: function(e, t) {
                this._des3.decryptBlock(e, t),
                this._des2.encryptBlock(e, t),
                this._des1.decryptBlock(e, t)
            },
            keySize: 6,
            ivSize: 2,
            blockSize: 2
        }),
        n.TripleDES = o._createHelper(s),
        e.TripleDES)
    })
      , rc4 = createCommonjsModule(function(e, t) {
        function n() {
            for (var e = this._S, t = this._i, n = this._j, i = 0, o = 0; o < 4; o++) {
                var n = (n + e[t = (t + 1) % 256]) % 256
                  , r = e[t];
                e[t] = e[n],
                e[n] = r,
                i |= e[(e[t] + e[n]) % 256] << 24 - 8 * o
            }
            return this._i = t,
            this._j = n,
            i
        }
        var i, o, r, s;
        e.exports = (o = (i = e = core).lib.StreamCipher,
        s = i.algo,
        r = s.RC4 = o.extend({
            _doReset: function() {
                for (var e = this._key, t = e.words, n = e.sigBytes, i = this._S = [], o = 0; o < 256; o++)
                    i[o] = o;
                for (var o = 0, r = 0; o < 256; o++) {
                    var s = o % n
                      , s = t[s >>> 2] >>> 24 - s % 4 * 8 & 255
                      , r = (r + i[o] + s) % 256
                      , s = i[o];
                    i[o] = i[r],
                    i[r] = s
                }
                this._i = this._j = 0
            },
            _doProcessBlock: function(e, t) {
                e[t] ^= n.call(this)
            },
            keySize: 8,
            ivSize: 0
        }),
        i.RC4 = o._createHelper(r),
        s = s.RC4Drop = r.extend({
            cfg: r.cfg.extend({
                drop: 192
            }),
            _doReset: function() {
                r._doReset.call(this);
                for (var e = this.cfg.drop; 0 < e; e--)
                    n.call(this)
            }
        }),
        i.RC4Drop = o._createHelper(s),
        e.RC4)
    })
      , rabbit = createCommonjsModule(function(e, t) {
        function c() {
            for (var e = this._X, t = this._C, n = 0; n < 8; n++)
                s[n] = t[n];
            t[0] = t[0] + 1295307597 + this._b | 0,
            t[1] = t[1] + 3545052371 + (t[0] >>> 0 < s[0] >>> 0 ? 1 : 0) | 0,
            t[2] = t[2] + 886263092 + (t[1] >>> 0 < s[1] >>> 0 ? 1 : 0) | 0,
            t[3] = t[3] + 1295307597 + (t[2] >>> 0 < s[2] >>> 0 ? 1 : 0) | 0,
            t[4] = t[4] + 3545052371 + (t[3] >>> 0 < s[3] >>> 0 ? 1 : 0) | 0,
            t[5] = t[5] + 886263092 + (t[4] >>> 0 < s[4] >>> 0 ? 1 : 0) | 0,
            t[6] = t[6] + 1295307597 + (t[5] >>> 0 < s[5] >>> 0 ? 1 : 0) | 0,
            t[7] = t[7] + 3545052371 + (t[6] >>> 0 < s[6] >>> 0 ? 1 : 0) | 0,
            this._b = t[7] >>> 0 < s[7] >>> 0 ? 1 : 0;
            for (n = 0; n < 8; n++) {
                var i = e[n] + t[n]
                  , o = 65535 & i
                  , r = i >>> 16;
                a[n] = ((o * o >>> 17) + o * r >>> 15) + r * r ^ ((4294901760 & i) * i | 0) + ((65535 & i) * i | 0)
            }
            e[0] = a[0] + (a[7] << 16 | a[7] >>> 16) + (a[6] << 16 | a[6] >>> 16) | 0,
            e[1] = a[1] + (a[0] << 8 | a[0] >>> 24) + a[7] | 0,
            e[2] = a[2] + (a[1] << 16 | a[1] >>> 16) + (a[0] << 16 | a[0] >>> 16) | 0,
            e[3] = a[3] + (a[2] << 8 | a[2] >>> 24) + a[1] | 0,
            e[4] = a[4] + (a[3] << 16 | a[3] >>> 16) + (a[2] << 16 | a[2] >>> 16) | 0,
            e[5] = a[5] + (a[4] << 8 | a[4] >>> 24) + a[3] | 0,
            e[6] = a[6] + (a[5] << 16 | a[5] >>> 16) + (a[4] << 16 | a[4] >>> 16) | 0,
            e[7] = a[7] + (a[6] << 8 | a[6] >>> 24) + a[5] | 0
        }
        var n, i, o, s, a, r;
        e.exports = (i = (n = e = core).lib.StreamCipher,
        r = n.algo,
        o = [],
        s = [],
        a = [],
        r = r.Rabbit = i.extend({
            _doReset: function() {
                for (var e = this._key.words, t = this.cfg.iv, n = 0; n < 4; n++)
                    e[n] = 16711935 & (e[n] << 8 | e[n] >>> 24) | 4278255360 & (e[n] << 24 | e[n] >>> 8);
                for (var i = this._X = [e[0], e[3] << 16 | e[2] >>> 16, e[1], e[0] << 16 | e[3] >>> 16, e[2], e[1] << 16 | e[0] >>> 16, e[3], e[2] << 16 | e[1] >>> 16], o = this._C = [e[2] << 16 | e[2] >>> 16, 4294901760 & e[0] | 65535 & e[1], e[3] << 16 | e[3] >>> 16, 4294901760 & e[1] | 65535 & e[2], e[0] << 16 | e[0] >>> 16, 4294901760 & e[2] | 65535 & e[3], e[1] << 16 | e[1] >>> 16, 4294901760 & e[3] | 65535 & e[0]], n = this._b = 0; n < 4; n++)
                    c.call(this);
                for (n = 0; n < 8; n++)
                    o[n] ^= i[n + 4 & 7];
                if (t) {
                    var t = t.words
                      , r = t[0]
                      , t = t[1]
                      , r = 16711935 & (r << 8 | r >>> 24) | 4278255360 & (r << 24 | r >>> 8)
                      , t = 16711935 & (t << 8 | t >>> 24) | 4278255360 & (t << 24 | t >>> 8)
                      , s = r >>> 16 | 4294901760 & t
                      , a = t << 16 | 65535 & r;
                    o[0] ^= r,
                    o[1] ^= s,
                    o[2] ^= t,
                    o[3] ^= a,
                    o[4] ^= r,
                    o[5] ^= s,
                    o[6] ^= t,
                    o[7] ^= a;
                    for (n = 0; n < 4; n++)
                        c.call(this)
                }
            },
            _doProcessBlock: function(e, t) {
                var n = this._X;
                c.call(this),
                o[0] = n[0] ^ n[5] >>> 16 ^ n[3] << 16,
                o[1] = n[2] ^ n[7] >>> 16 ^ n[5] << 16,
                o[2] = n[4] ^ n[1] >>> 16 ^ n[7] << 16,
                o[3] = n[6] ^ n[3] >>> 16 ^ n[1] << 16;
                for (var i = 0; i < 4; i++)
                    o[i] = 16711935 & (o[i] << 8 | o[i] >>> 24) | 4278255360 & (o[i] << 24 | o[i] >>> 8),
                    e[t + i] ^= o[i]
            },
            blockSize: 4,
            ivSize: 2
        }),
        n.Rabbit = i._createHelper(r),
        e.Rabbit)
    })
      , rabbitLegacy = createCommonjsModule(function(e, t) {
        function a() {
            for (var e = this._X, t = this._C, n = 0; n < 8; n++)
                s[n] = t[n];
            t[0] = t[0] + 1295307597 + this._b | 0,
            t[1] = t[1] + 3545052371 + (t[0] >>> 0 < s[0] >>> 0 ? 1 : 0) | 0,
            t[2] = t[2] + 886263092 + (t[1] >>> 0 < s[1] >>> 0 ? 1 : 0) | 0,
            t[3] = t[3] + 1295307597 + (t[2] >>> 0 < s[2] >>> 0 ? 1 : 0) | 0,
            t[4] = t[4] + 3545052371 + (t[3] >>> 0 < s[3] >>> 0 ? 1 : 0) | 0,
            t[5] = t[5] + 886263092 + (t[4] >>> 0 < s[4] >>> 0 ? 1 : 0) | 0,
            t[6] = t[6] + 1295307597 + (t[5] >>> 0 < s[5] >>> 0 ? 1 : 0) | 0,
            t[7] = t[7] + 3545052371 + (t[6] >>> 0 < s[6] >>> 0 ? 1 : 0) | 0,
            this._b = t[7] >>> 0 < s[7] >>> 0 ? 1 : 0;
            for (n = 0; n < 8; n++) {
                var i = e[n] + t[n]
                  , o = 65535 & i
                  , r = i >>> 16;
                c[n] = ((o * o >>> 17) + o * r >>> 15) + r * r ^ ((4294901760 & i) * i | 0) + ((65535 & i) * i | 0)
            }
            e[0] = c[0] + (c[7] << 16 | c[7] >>> 16) + (c[6] << 16 | c[6] >>> 16) | 0,
            e[1] = c[1] + (c[0] << 8 | c[0] >>> 24) + c[7] | 0,
            e[2] = c[2] + (c[1] << 16 | c[1] >>> 16) + (c[0] << 16 | c[0] >>> 16) | 0,
            e[3] = c[3] + (c[2] << 8 | c[2] >>> 24) + c[1] | 0,
            e[4] = c[4] + (c[3] << 16 | c[3] >>> 16) + (c[2] << 16 | c[2] >>> 16) | 0,
            e[5] = c[5] + (c[4] << 8 | c[4] >>> 24) + c[3] | 0,
            e[6] = c[6] + (c[5] << 16 | c[5] >>> 16) + (c[4] << 16 | c[4] >>> 16) | 0,
            e[7] = c[7] + (c[6] << 8 | c[6] >>> 24) + c[5] | 0
        }
        var n, i, o, s, c, r;
        e.exports = (i = (n = e = core).lib.StreamCipher,
        r = n.algo,
        o = [],
        s = [],
        c = [],
        r = r.RabbitLegacy = i.extend({
            _doReset: function() {
                for (var e = this._key.words, t = this.cfg.iv, n = this._X = [e[0], e[3] << 16 | e[2] >>> 16, e[1], e[0] << 16 | e[3] >>> 16, e[2], e[1] << 16 | e[0] >>> 16, e[3], e[2] << 16 | e[1] >>> 16], i = this._C = [e[2] << 16 | e[2] >>> 16, 4294901760 & e[0] | 65535 & e[1], e[3] << 16 | e[3] >>> 16, 4294901760 & e[1] | 65535 & e[2], e[0] << 16 | e[0] >>> 16, 4294901760 & e[2] | 65535 & e[3], e[1] << 16 | e[1] >>> 16, 4294901760 & e[3] | 65535 & e[0]], o = this._b = 0; o < 4; o++)
                    a.call(this);
                for (o = 0; o < 8; o++)
                    i[o] ^= n[o + 4 & 7];
                if (t) {
                    var e = t.words
                      , t = e[0]
                      , e = e[1]
                      , t = 16711935 & (t << 8 | t >>> 24) | 4278255360 & (t << 24 | t >>> 8)
                      , e = 16711935 & (e << 8 | e >>> 24) | 4278255360 & (e << 24 | e >>> 8)
                      , r = t >>> 16 | 4294901760 & e
                      , s = e << 16 | 65535 & t;
                    i[0] ^= t,
                    i[1] ^= r,
                    i[2] ^= e,
                    i[3] ^= s,
                    i[4] ^= t,
                    i[5] ^= r,
                    i[6] ^= e,
                    i[7] ^= s;
                    for (o = 0; o < 4; o++)
                        a.call(this)
                }
            },
            _doProcessBlock: function(e, t) {
                var n = this._X;
                a.call(this),
                o[0] = n[0] ^ n[5] >>> 16 ^ n[3] << 16,
                o[1] = n[2] ^ n[7] >>> 16 ^ n[5] << 16,
                o[2] = n[4] ^ n[1] >>> 16 ^ n[7] << 16,
                o[3] = n[6] ^ n[3] >>> 16 ^ n[1] << 16;
                for (var i = 0; i < 4; i++)
                    o[i] = 16711935 & (o[i] << 8 | o[i] >>> 24) | 4278255360 & (o[i] << 24 | o[i] >>> 8),
                    e[t + i] ^= o[i]
            },
            blockSize: 4,
            ivSize: 2
        }),
        n.RabbitLegacy = i._createHelper(r),
        e.RabbitLegacy)
    })
      , cryptoJs = createCommonjsModule(function(e, t) {
        e.exports = core
    });
    function encrypt(e, t) {
        t = cryptoJs.enc.Utf8.parse(t);
        return cryptoJs.AES.encrypt(e, t, {
            mode: cryptoJs.mode.ECB,
            padding: cryptoJs.pad.Pkcs7
        }).toString()
    }
    function decrypt(e, t) {
        t = cryptoJs.enc.Utf8.parse(t),
        e = cryptoJs.AES.decrypt(e, t, {
            mode: cryptoJs.mode.ECB,
            padding: cryptoJs.pad.Pkcs7
        });
        return cryptoJs.enc.Utf8.stringify(e)
    }
    function md5Encrypt(e) {
        return cryptoJs.MD5(e)
    }
    function base64(e) {
        e = cryptoJs.enc.Utf8.parse(window.encodeURIComponent(e));
        return cryptoJs.enc.Base64.stringify(e)
    }
    function base64ToStr(e) {
        e = cryptoJs.enc.Base64.parse(e);
        return cryptoJs.enc.Utf8.stringify(e)
    }
    function getDeviceInfo() {
        return ""
    }
    function getDeviceOS() {
        var e = navigator.userAgent;
        if (/iPhone/i.test(e))
            return "iPhone";
        if (/iPad/i.test(e))
            return "iPad";
        if (/Android/i.test(e))
            return "Android";
        var t = navigator.platform;
        if (/^(Mac68K|MacPPC|Macintosh|MacIntel)$/i.test(t))
            return "Mac";
        if (/Linux/i.test(t))
            return "Linux";
        if (/^(Win32|Windows)$/i.test(t)) {
            if (0 < e.search(/Windows NT 5\.0|Windows 2000/))
                return "Win2000";
            if (0 < e.search(/Windows NT 5\.1|Windows XP/))
                return "WinXP";
            if (0 < e.search(/Windows NT 5\.2|Windows 2003/))
                return "Win2003";
            if (0 < e.search(/Windows NT 6\.0|Windows Vista/))
                return "WinVista";
            if (0 < e.search(/Windows NT 6\.1|Windows 7/))
                return "Win7";
            if (0 < e.search(/Windows NT 6\.2|Windows 8/))
                return "Win8";
            if (0 < e.search(/Windows NT 10\.0|Windows NT 6\.4|Windows 10/))
                return "Win10"
        }
        return /^X11$/.test(t) ? "Unix" : "other"
    }
    function getBrowserInfo(e) {
        var t, n = navigator.userAgent.toLowerCase(), i = "", o = "";
        return /msie ([\d.]+)/.test(n) ? (i = "Trident",
        o = n.match(/msie ([\d.]+)/)[1]) : /micromessenger\/([\d.]+)/.test(n) ? (t = n.match(/micromessenger\/([\d.]+)/),
        i = "iphone" == getDeviceInfo().toLowerCase() ? "WeixinAppleWebKit" : "WeixinAndroidWebKit",
        o = t[1]) : /firefox\/([\d.]+)/.test(n) ? (i = "Gecko",
        o = n.match(/firefox\/([\d.]+)/)[1]) : /chrome\/([\d.]+)/.test(n) ? (i = "WebKit",
        o = n.match(/chrome\/([\d.]+)/)[1]) : /opera.([\d.]+)/.test(n) ? (i = "Presto",
        o = n.match(/opera.([\d.]+)/)[1]) : /version\/([\d.]+).*safari/.test(n) && (i = "WebKit",
        o = n.match(/version\/([\d.]+).*safari/)[1]),
        "kernel" == e || "name" == e ? i : "version" == e ? o : ""
    }
    function _webglInfo(e) {
        var t, n = document.createElement("canvas").getContext("experimental-webgl"), i = null, o = "", r = getDeviceOS().toLowerCase();
        return null != (i = "getExtension"in n ? n.getExtension("WEBGL_debug_renderer_info") : i) && (o = (o = "getParameter"in n ? n.getParameter(i[e]) : o) && o.toString().toUpperCase().trim()),
        "iphone" !== r && "ipad" !== r || (t = "getParameter"in n ? n.getParameter(n.VERSION) : t) && (t = t.toString().toUpperCase().trim(),
        o = o ? o + "__" + t : t),
        o
    }
    function getMobileDeviceGPU() {
        var e = getDeviceOS().toLowerCase()
          , t = "";
        try {
            t = _webglInfo("UNMASKED_RENDERER_WEBGL")
        } catch (e) {
            return "UNKNOWN"
        }
        return "iphone" === e || "ipad" === e ? 0 < t.indexOf("A6") ? "iPhone5" : 0 < t.indexOf("A7") ? "iPhone5s" : -1 < t.indexOf("POWERVR SGX 543") ? "iPhone5c" : 0 < t.indexOf("A8") ? "iPhone6" : 0 < t.indexOf("A9") ? "iPhone6s" : !(0 < t.indexOf("A10")) && 0 < t.search(/A11|A12|A13|A14|A15|A16/i) ? "iPhone8" : "iPhone7" : "android" === e ? {
            "ADRENO (TM) 505": "AndroidMedium"
        }[t] || "AndroidMedium" : "UNKNOWN"
    }
    function getClientType() {
        var e = getDeviceOS().toLowerCase();
        return "iphone" === e || "ipad" === e || iSNewIpad() ? 6 : "android" === e ? 7 : 3
    }
    function getMaxTouchPoints() {
        return navigator.maxTouchPoints || 0
    }
    function iSNewIpad() {
        return /(Mac68K|MacPPC|Macintosh|MacIntel)/i.test(navigator.userAgent) && 3 < getMaxTouchPoints()
    }
    var SDK_VERSION = "web-master-6.43.2-05be21c4"
      , CRYPT_KEY_PREFIX = "web0123456789012"
      , API_VERSION = "3.0.11"
      , saasConf = {
        saasUrl: "https://saas-rel-usa.haimacloud.com/s/rest/api",
        envType: ""
    }
      , loggerConf = {
        logUrl: "https://countly-rel-usa.haimacloud.com",
        appKey: "9c0edb3f80d8d9adc71bb544b6dc87743340e829",
        timeStamp: Date.now()
    }
      , mouseType = {
        down: 1,
        up: 2,
        move: 3
    }
      , stopByApp = {
        app: 1,
        server: 0
    }
      , keyTypes = {
        keydown: "keyDown",
        keyup: "keyUp"
    };
    function getSDKPath(e) {
        var t = ""
          , n = document.getElementsByTagName("script");
        if (n && 0 < n.length)
            for (var i in n) {
                var i = n[i].src
                  , o = i && i.indexOf(e);
                if (0 < o) {
                    t = i.slice(0, o);
                    break
                }
            }
        return t
    }
    function hasOwnProperty(e, t) {
        return Object.prototype.hasOwnProperty.call(e, t)
    }
    function mixTips(e, t) {
        if ("string" !== typeCheck(e))
            return "";
        for (var n = 0; n < t.length; ++n)
            e = e.replace("|", t[n]);
        return e.replace(/\n/g, "
") } function createUID(e) { for (var t = "", n = "0123456789abcdef", i = 0; i < 8; ++i) t += n.charAt(Math.round(15 * Math.random())); for (var o = 0; o < 3; ++o) { t += "-"; for (var r = 0; r < 4; r++) t += n.charAt(Math.round(15 * Math.random())) } for (var t = (t += "-") + ("0000000" + (new Date).getTime().toString(16).toUpperCase()).substr(-8), s = 0; s < 4; s++) t += n.charAt(Math.round(15 * Math.random())); return "".concat(t, "-").concat(e).concat(getDeviceOS()).concat(getBrowserInfo("name")) } function formatMS(e, t) { var n, i = "", e = e / 1e3; return 3600 < e && ((n = Math.floor(e / 3600)) && (i += "".concat(n).concat(t.hour)), e %= 3600), 60 < e && ((n = Math.floor(e / 60)) && (i += "".concat(n).concat(t.minute)), e %= 60), (e = Math.ceil(e)) && (i += "".concat(e).concat(t.seconds)), i } function getRandomString() { for (var e = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : 16, t = "abcdefghijklmnopqrstuvwxyz0123456789", n = t.charAt(Math.floor(26 * Math.random())), i = 0; i < e - 1; ++i) n += t.charAt(Math.floor(Math.random() * t.length)); return n } function indexBy(e, t, n) { if (!e || !t) return {}; var i, o = {}; for (i in e) { var r = e[i]; r && r[t] && (o[r[t]] = n ? r[n] || "" : r) } return o } function mixErrorCodeHtml(e, t, n, i) { t = t || e || i + (n ? "[" + n + "]" : ""); return t = n ? "".concat(t, "[").concat(n, "]") : t } function isSupportRTC() { var e = navigator.userAgent.toLowerCase(); return /chrome\//gi.test(e) ? 54 <= parseFloat(e.match(/chrome\/(\d+)/i)[1]) : /firefox\//gi.test(e) ? 46 <= parseFloat(e.match(/firefox\/(\d+)/i)[1]) : !!/safari\//gi.test(e) && 11 <= parseFloat(e.match(/version\/(\d+)/i)[1]) } function autoPlayVideo(e) { var t = document.getElementById(e); t && (window.WeixinJSBridge ? WeixinJSBridge.invoke("getNetworkType", {}, function() { t.play() }, !1) : document.addEventListener("WeixinJSBridgeReady", function() { WeixinJSBridge.invoke("getNetworkType", {}, function() { t.play() }) }, !1), t.play(), t.addEventListener("pause", t.play), t.addEventListener("loadeddata", t.play), t.parentNode.addEventListener("touchend", function() { t.paused && t.play() }), t.previousElementSibling.addEventListener("touchend", function() { t.paused && t.play() }, !0)) } function setCacheGameInfo(e, t) { var n = getCacheGameInfo(); n[e] = t, sessionStorage.setItem("hm_cloudPlay", JSON.stringify(n)) } function getCacheGameInfo() { var e = sessionStorage.getItem("hm_cloudPlay"); return e ? JSON.parse(e) : {} } function toRequestFullscreen(e) { e.requestFullscreen ? e.requestFullscreen() : e.webkitRequestFullScreen ? e.webkitRequestFullScreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.msRequestFullscreen() } function toExitFullscreen() { document.exitFullScreen ? document.exitFullScreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen ? document.webkitExitFullscreen() : document.msExitFullscreen && document.msExitFullscreen() } function isIE10() { return !(window.navigator.userAgent.toLowerCase().indexOf("msie") < 0) && /MSIE\s+10.0/i.test(navigator.userAgent) && function() { return void 0 === this }() } function isIE() { return !!(window.ActiveXObject || "ActiveXObject"in window) } function isObject$2(e) { return "[object Object]" === Object.prototype.toString.call(e) } function toLine(e) { return e && e.replace(/([A-Z])/g, "_$1").toLowerCase() } function emptyFunction() {} function isImage(e) { var t; return null == e || "undefined" == e || e.length < 8 ? null : (arraycopy(e, 0, [], 0, 6), arraycopy(e, 6, t = [], 0, 4), isJpeg(t) ? "image/jpeg" : (arraycopy(e, 0, t = [], 0, 8), isPng(t) ? "image/png" : null)) } function arraycopy(e, t, n, i, o) { for (var r = 0; r < o; r++) n[i + r] = e[t + r] } function arrayEquals(e, t) { if ("undefined" != e && "undefined" != t && e instanceof Array && t instanceof Array) { if (e.length != t.length) return !1; for (var n = 0; n < e.length; n++) if (e[n] != t[n]) return !1; return !0 } return !1 } var pngMagic = [137, 80, 78, 71, 13, 10, 26, 10] , jpeg_jfif = [74, 70, 73, 70] , jpeg_exif = [69, 120, 105, 102] , jpegMagic = [255, 216, 255, 224]; function isJpeg(e) { return arrayEquals(e, jpegMagic) || arrayEquals(e, jpeg_jfif) || arrayEquals(e, jpeg_exif) } function isPng(e) { return arrayEquals(e, pngMagic) } function getCompressionCss(e) { var t, n = window.innerHeight, i = window.innerWidth, e = n < i * e ? (t = Math.ceil(n / e), n) : (t = i, Math.ceil(i * e)); return { top: (n - e) / 2, left: (i - t) / 2, width: t, height: e } } function paramInObj(e, t, n) { var i = !1; return e.map(function(e) { e[t] == n && (i = !0) }), i } function getViewResolutionStr(e, t) { var n = ""; return n = "NaN" != parseFloat(e).toString() && "NaN" != parseFloat(t).toString() ? +t < +e ? e + "x" + t : t + "x" + e : n } function typeCheck(e) { e = Object.prototype.toString.call(e); return e.substring(8, e.length - 1).toLowerCase() } function resInfoCurBitrate(e, t) { for (var n = 0; n < t.length; n++) if (e == t[n].id) return parseInt(t[n].bitRate) } function numToString(e) { return void 0 === e || null == e || isNaN(e) ? "-1" : e.toString() } function divideBy2(e) { return parseInt(e, 2) } function assiginObj() { var e, t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}, n = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {}, i = t; if ("object" != _typeof(t) || "object" != _typeof(n)) return n; for (e in n) hasOwnProperty(t, e) ? i[e] = assiginObj(t[e], n[e]) : i[e] = n[e]; return i } function isArray$1(e) { e = Object.prototype.toString.call(e); return "array" === e.substring(8, e.length - 1).toLowerCase() } function ajax(e) { var t = e.url , n = e.data , i = e.done , o = e.timeout , r = void 0 === o ? 10 : o , o = e.contentType , o = void 0 === o ? "application/x-www-form-urlencoded" : o , s = e.retryRequestCount , a = new XMLHttpRequest , c = null; return "get" === e.method.toLowerCase() ? (a.open("GET", t, !0), a.send()) : "post" === e.method.toLowerCase() && (a.open("POST", t, !0), a.setRequestHeader("Content-type", o), a.send(n)), a.onreadystatechange = function() { 4 === a.readyState && (200 <= a.status && a.status < 300 || 304 === a.status ? i(!0, { statusCode: a.status, message: "", timeout: 1e3 * r, retryRequestCount: s }, a.responseText) : i(!1, { statusCode: a.status, message: "", timeout: 1e3 * r, retryRequestCount: s }, ""), clearTimeout(c), a = void 0) } , c = setTimeout(function() { a.abort() }, 1e3 * r), function() { a && (a.onreadystatechange = null, clearTimeout(c), a = c = void 0) } } function http(e) { var i, o = e.url, r = e.data, s = e.method, a = e.contentType, t = e.timeout, c = e.retryCount, l = e.done, e = e.retryInterval, d = void 0 === e ? 500 : e, p = 1; return isArray$1(c) && 0 < c.length ? (p = c.length, i = l, ajax({ url: o, data: r, method: s, contentType: a, done: l = function(e, t, n) { e ? i(!0, t, n) : --p <= 0 ? i(!1, t, n) : setTimeout(function() { ajax({ url: o, data: r, method: s, contentType: a, done: l, timeout: c[p - 1], retryRequestCount: c.length - p }) }, d) } , timeout: c[p - 1], retryRequestCount: 0 })) : ajax({ url: o, data: r, method: s, contentType: a, done: l, timeout: t, retryRequestCount: 0 }) } function json2url(e) { var t, n = []; for (t in e) n.push("".concat(t, "=").concat(e[t])); return n.join("&") } var SaasRequest = function() { function n(e, t) { _classCallCheck(this, n), this.accessKeyId = e, this.channelId = t, this.envType = saasConf.envType, this.clientType = getClientType(), this.device = this.deviceInfo(), this.retryCount = [10, 10, 10, 10, 10, 10] } return _createClass(n, [{ key: "deviceInfo", value: function() { return { hardDecoderSupported: "1", osName: getDeviceOS(), osVersion: getDeviceOS(), webInfo: { installLocSignYN: "", cookieId: "", userAgent: navigator.userAgent || "", browserType: navigator.vendor || "", platform: navigator.platform || "", browserVersion: getBrowserInfo("version"), browserKernel: getBrowserInfo("kernel"), browserKernelVersion: navigator.appVersion.substring(navigator.appVersion.lastIndexOf("/") + 1, navigator.appVersion.length), flashPlayerVersion: -1 }, screenInfo: { dpi: "", resolution: "".concat(screen.width, "*").concat(screen.height) } } } }, { key: "http", value: function(r, e, s) { var a = this , c = { url: saasConf.saasUrl, action: r, startTime: (new Date).getTime(), responseTime: 0, time: 0, result: "", msg: "" } , t = localStorage.getItem(md5Encrypt("did")) || "" , n = "" , l = "" , l = /^(104|108|211|217|218|113|112|219|220|221|223|304|305|306|308|309|310|235)$/.test(r) ? (n = getRandomString(), "".concat(CRYPT_KEY_PREFIX).concat(n)) : (n = e.cid, this.secretKey) , i = { accessKeyID: this.accessKeyId, channel: this.channelId, packageName: "haima", sdkVersion: SDK_VERSION } , n = { action: { actId: r, transId: "".concat((new Date).getTime()).concat(getRandomString(4)), protocol: API_VERSION, random: n, sdkType: this.clientType, did: t, clientTransId: this.clientTransId }, language: this.language || "zh_CN", data: encrypt(JSON.stringify(e), l), device: encrypt(JSON.stringify(this.device), l), client: encrypt(JSON.stringify(i), l) } , t = json2url({ t: n.action.clientTransId, a: n.action.actId, b: i.accessKeyID, d: n.action.did, u: this.userInfo.uId, p: e.packageName || "", g: e.appChannel || "", ct: n.action.sdkType, dt: (new Date).getTime() }) , i = "".concat(saasConf.saasUrl, "?").concat(t); this._ajaxRelease = http({ url: i, data: JSON.stringify(n), method: "post", contentType: "application/json", retryCount: this.retryCount, timeout: 10, retryInterval: 2e3, done: function(e, t, n) { if (c.responseTime = (new Date).getTime(), c.time = c.responseTime - c.startTime, c.result = e ? "success" : "failed", e) { e = null; try { e = JSON.parse(n) } catch (e) { throw new Error(a.sdkTips.responseDataError) } var i = e , o = i.code , i = i.errorCode; if (0 != o && (c.msg = "".concat(r, " ").concat(o, " ").concat(e.errorMsg, " ").concat(e.errorCode)), (0 === o || 20303 === o || e.data) && (!i || "0" === i)) try { e.data = JSON.parse(decrypt(e.data, l)) } catch (e) { throw new Error(a.sdkTips.responseDataError) } 0 === o && i && "0" !== i && (e.code = i), s(!0, t, e, c) } else c.msg = "".concat(r, " ").concat(t.status), s(!1, t, n, c) } }) } }, { key: "setClientTransId", value: function(e) { this.clientTransId = e } }, { key: "setRetryCount", value: function(e) { this.retryCount = e } }, { key: "setSecretKey", value: function(e) { this.secretKey = e } }, { key: "setUserInfo", value: function(e) { this.userInfo = e } }, { key: "setLanguage", value: function(e, t) { this.language = e, this.sdkTips = t } }, { key: "getDid", value: function(e, t) { e = { did: e, clientType: this.clientType, envType: this.envType }; this.http("104", e, t) } }, { key: "getConfig", value: function(e, t, n, i, o, r, s, a) { e = { clientType: this.clientType, packageName: e, type: t, accessKeyId: this.accessKeyId, envType: this.envType, appChannel: n, streamingTypes: r, sdkAbility: [s] }; i && o && (e.viewResolution = getViewResolutionStr(i, o)), this.http("108", e, a) } }, { key: "getSteamInfo", value: function(e, t) { var n, i = { envType: this.envType, channel: this.channelId, clientType: this.clientType, deviceType: getMobileDeviceGPU(), syncRefresh: !0, confirm: e.confirm || 0, userInfo: { userId: e.userInfo.uId, token: e.userInfo.uToken, userType: e.userInfo.uType, uLevel: e.userInfo.uLevel }, configInfo: e.configInfo, pkgName: e.pkgName, cToken: e.cToken, orientation: e.orientation || 1, playingtime: 1e3 * e.playingtime, opType: e.opType || 1, isArchive: !!hasOwnProperty(e, "isArchive") && e.isArchive, streamingTypes: e.streamingTypes, cid: e.cid || "", isHotUpdate: !!hasOwnProperty(e, "isHotUpdate") && e.isHotUpdate, protoData: e.protoData || "", appChannel: e.appChannel || "", bitRate: -1, payStr: e.payStr || "", priority: e.priority || 0, extraId: e.extraId || "", noInputTimeout: hasOwnProperty(e, "noInputTimeout") ? e.noInputTimeout : "", archiveFromBid: e.archiveFromBid || "", archiveFromUserId: e.archiveFromUserId || "", componentType: e.componentType || 0, action: e.action || "", componentName: e.componentName || "", extraData: e.extraData || "", sdkAbility: e.sdkAbility, richData: null, resolution: -1, keepAliveTimeSeconds: hasOwnProperty(e, "standbyDuration") ? e.standbyDuration : "" }; if (/^([1-9]+)(\d*)$/.test(e.bitRate) && (i.bitRate = 21474e5 < e.bitRate ? 21474e5 : parseInt(e.bitRate)), e.viewResolutionWidth && (n = "", e.viewResolutionWidth || e.viewResolutionHeight) && (n = getViewResolutionStr(e.viewResolutionWidth, e.viewResolutionHeight)) && (i.viewResolution = n), e.paramsExtension) for (var o in e.paramsExtension) i[o] = e.paramsExtension[o]; "object" === typeCheck(e.richData) && (i.richData = e.richData), /^([1-9]+)(\d*)$/.test(e.resolutionId) && (i.resolution = e.resolutionId), this.http("211", i, t) } }, { key: "releaseCid", value: function(e, t, n) { e = { cid: e, archiveMinSeconds: t || 0, envType: this.envType }; this.http("202", e, n) } }, { key: "cloudService", value: function(e, t, n, i, o, r, s) { t = { cid: t, sign: n, clientType: this.clientType, orientation: 1, playingtime: 1e3 * e.playingtime, opType: o, envType: this.envType, isArchive: !!e.isArchive, resolution: r, confirm: i, priority: e.priority || 0, payStr: e.payStr || "" }; 3 != this.clientType && (t.deviceType = getMobileDeviceGPU()), e.viewResolutionWidth && (n = "", e.viewResolutionWidth || e.viewResolutionHeight) && (n = getViewResolutionStr(e.viewResolutionWidth, e.viewResolutionHeight)) && (t.viewResolution = n), this.http("201", t, s) } }, { key: "getGameArchiveStatus", value: function(e, t, n, i) { e = { pkgName: e, userInfo: { userId: (this.userInfo = t).uId, token: t.uToken, userType: t.uType || 0, uLevel: t.uLevel || "" }, appChannel: n, envType: this.envType }; this.http("112", e, i) } }, { key: "hasGameArchived", value: function(e, t, n, i) { e = { pkgName: e, userInfo: { userId: (this.userInfo = t).uId, token: t.uToken, userType: t.uType || 0, uLevel: t.uLevel || "" }, appChannel: n, envType: this.envType }; this.http("113", e, i) } }, { key: "updateUID", value: function(e, t, n) { t = { envType: this.envType, cid: t.cid, playingTime: t.playingTime, userInfo: { userId: t.userInfo.uId, token: t.userInfo.uToken, userType: t.userInfo.uType || 0, uLevel: t.userInfo.uLevel || "" }, tip: t.tip, cToken: t.cToken, sdkAbility: t.sdkAbility, protoData: e.protoData || "" }; this.http("214", t, n) } }, { key: "checkPlayingGame", value: function(e, t) { this.userInfo = e; e = { envType: this.envType, userInfo: { userId: e.uId, token: e.uToken, userType: e.uType || 0, uLevel: e.uLevel || "" } }; this.http("217", e, t) } }, { key: "releasePlayingGame", value: function(e, t) { var n = e.userInfo , e = (this.userInfo = n, { envType: this.envType, cid: e.cid, cToken: e.cToken, pkgName: e.pkgName, playingtime: e.playingtime, appChannel: e.appChannel, userInfo: { userId: n.uId, token: n.uToken, userType: n.uType || 0, uLevel: n.uLevel || "" } }); this.http("218", e, t) } }, { key: "toStartLiving", value: function(e, t) { e = { envType: this.envType, cid: e.cid, livingId: e.roomId, pushStreamUrl: e.streamerUrl }; this.http("219", e, t) } }, { key: "toGetPinCode", value: function(e, t) { e = { envType: this.envType, cid: e.cid }; this.http("220", e, t) } }, { key: "toApplyControlPower", value: function(e, t) { 3 != this.clientType && (e.imeType = 0), this.http("221", e, t) } }, { key: "toEndLiving", value: function(e, t) { e = { envType: this.envType, cid: e.cid, livingId: e.roomId }; this.http("223", e, t) } }, { key: "controlPowerDistribute", value: function(e, t) { e = { cid: e.cid, controlInfos: e.controlInfos, envType: this.envType }; this.http("304", e, t) } }, { key: "controlPowerQuery", value: function(e, t) { e = { cid: e, envType: this.envType }; this.http("305", e, t) } }, { key: "captureGameImage", value: function(e, t) { e = { cid: e.cid, opType: e.opType, txId: e.txId, uploadUrl: e.uploadUrl, size: e.size, interval: e.interval || "", format: e.format || "", pixel: e.pixel || "", uploadType: e.uploadType || "" }; this.http("306", e, t) } }, { key: "startHuangUp", value: function(e, t) { this.http("308", e, t) } }, { key: "stopHuangUp", value: function(e, t) { this.http("309", e, t) } }, { key: "getHangUpTime", value: function(e, t) { this.http("310", e, t) } }, { key: "updateStandbyDuration", value: function(e, t, n) { t = { cid: t, keepAliveTimeSeconds: e.standbyDuration || "", noInputTimeSeconds: e.noInputTimeout || "", envType: this.envType }; this.http("235", t, n) } }, { key: "httpRequestRelease", value: function() { this._ajaxRelease && this._ajaxRelease() } }]), n }() , eventEmitter = function() { var o = {}; function n(e) { e ? delete o[e] : o = {} } return { on: function(e, t) { o[e] = t }, emit: function(e) { for (var t = arguments.length, n = new Array(1 < t ? t - 1 : 0), i = 1; i < t; i++) n[i - 1] = arguments[i]; o[e] && o[e].apply(o, n) }, off: n, once: function(e, t) { return o[e] = t, n(e), this } } }() , loggerEventId = { init_sdk_fun_call: 12058, init_sdk_fun_call_multi_error: 12106, start_sdk_fun_call_multi_error: 12107, init_sdk_fun_failed: 12066, apply_game_fun_call: 10012, apply_game_fun_failed: 12233, restart_game_failed: 12236, get_did_start: 12063, get_did_succeed: 12078, get_did_failed: 12079, get_config_start: 12084, get_config_succeed: 12080, get_config_failed: 12081, get_stream_info_start: 12120, get_stream_info_succeed: 12121, get_stream_info_failed: 12122, release_cid_start: 12091, release_cid_succeed: 12076, release_cid_failed: 12077, cloud_service_start: 12083, cloud_service_succeed: 12074, cloud_service_failed: 12075, saas_socket_connect: 12088, saas_socket_opened: 12089, saas_socket_closed: 12090, saas_socket_failed: 12050, saas_socket_message: 12054, saas_socket_message_parse_error: 12230, saas_socket_limit_stop: 12909, over_time_get_pong: 12311, over_limit_get_pong: 12313, saas_socket_ping_pong_delay_time: 12152, get_operation_5: 12242, get_operation_62: 12241, input_socket_connect: 12085, input_socket_opened: 10021, input_socket_closed: 10022, input_socket_ping_pong_delay_time: 10050, input_socket_ping_pong_delay_max: 10033, input_socket_start_im: 12094, input_socket_stop_im: 12095, input_socket_connect_failed: 12049, screen_socket_connect: 12401, screen_socket_opened: 12402, screen_socket_closed: 12403, screen_socket_reconnect: 12404, video_stream_connect: 12087, video_stream_connected: 12034, video_stream_connect_failed: 12036, device_un_support: 12300, video_get_data_success: 13210, video_decode_failed: 13211, audio_stream_connect: 12086, audio_stream_connected: 12033, audio_stream_connect_failed: 12035, video_first_frame_time: 12045, webrtc_decode_first_frame_end: 13249, page_closed: 12111, webrtc_begin_connect: 13215, webrtc_send_join: 13221, webrtc_receive_offer: 13222, webrtc_setRemoteDes_success: 13223, webrtc_setRemoteDes_error: 13233, webrtc_create_answer_error: 13235, webrtc_setLocalDes_success: 13236, webrtc_send_candidate: 13226, webrtc_send_answer: 13224, webrtc_setLocalDes_error: 13237, webrtc_receive_candidate: 13225, webrtc_addIceCandidate_success: 13238, webrtc_addIceCandidate_error: 13239, webrtc_ontrack: 13240, webrtc_connect_success: 13216, webrtc_self_connect_success: 13250, webrtc_no_self_connect_success: 13251, webrtc_connect_status: 13252, webrtc_connect_failed: 13217, webrtc_reconnect_failed: 13219, webrtc_datachannel_receive: 13281, webrtc_datachannel_send: 13282, webrtc_signal_server_success: 13241, webrtc_signal_server_disconnect: 13242, webrtc_signal_server_timeout: 13220, webrtc_socket_reconnect: 13245, webrtc_receive_audio: 13253, webrtc_x86_localIcecandidate: 13254, webrtc_x86_currentUseRemoteIcecandidate: 13255, webrtc_x86_track: 13256, webrtc_x86_iceConnectionState: 13257, webrtc_x86_icegatheringstatechange: 13258, webrtc_x86_signalingstatechange: 13259, webrtc_x86_connectionstatechange: 13260, webrtc_x86_createOfferError: 13261, webrtc_x86_getRemoteSdpBegin: 13262, webrtc_x86_getRemoteSdpSuccess: 13263, webrtc_x86_getRemoteSdpError: 13264, webrtc_x86_setRemoteDescriptionError: 13265, webrtc_x86_dataChannel: 13266, webrtc_x86_dataChannelNotify: 13267, webrtc_x86_sendLocalSdpBegin: 13268, webrtc_x86_sendLocalSdpSuccess: 13269, webrtc_x86_sendLocalSdpError: 13270, webrtc_x86_up_video_collection: 16005, x86_control_power_query_start: 12250, x86_control_power_query_succeed: 12251, x86_control_power_query_failed: 12252, x86_control_power_distribute_start: 12253, x86_control_power_distribute_succeed: 12254, x86_control_power_distribute_failed: 12255, x86_capture_game_image_start: 12260, x86_capture_game_image_succeed: 12261, x86_capture_game_image_failed: 12262, x86_game_extra_data_pay: 13272, x86_game_extra_data_play: 13273, x86_game_extra_data_help: 13274, x86_media_devices_request: 13275, x86_media_devices_response: 13276, x86_media_devices_camera_capabilities: 13277, x86_update_standby_duration_start: 12256, x86_update_standby_duration_succeed: 12257, x86_update_standby_duration_failed: 12258, app_report_finish_info: 15e3, video_url_got: 12044, stop_game_fun_Call: 12053, sdk_error_code: 13053, collect_delay_data: 16003, client_network_status: 13247, sdk_reconnect: 12104, start_revolution: 12039, enter_queue: 12019, out_queue: 10039, visibility_change_visible: 12040, visibility_change_hidden: 12041, low_bitrate_detected: 12046, auto_resolution_changed_start: 12011, frame_delay_info: 12042, fullscreen: 12001, exit_fullscreen: 12002, toolbar_keyboard_btn_clicked: 12006, keyboard_setting_set_game_pad: 12052, auto_resolution_changed_done: 12012, manual_resolution_changed_start: 12014, manual_resolution_changed_done: 12015, keyboard_setting_clear_all: 12051, set_stop_mouse_send_flag: 12110, only_apply: 12190, play_ready: 12191, app_start_palyer: 12192, keyboard_setting_reset: 12008, keyboard_setting_save: 12009, show_error_page: 12101, show_loading_view: 12099, hide_loading_view: 12100, sdk_scene_changed_call: 13505, rom_share_link: 12621, rom_open_camera: 12622, rom_open_gallery: 12623, rom_inform_cap: 12624, sdk_get_capList: 12625, rom_inform_capList: 12626, upload_image_start: 12601, upload_image_success: 12602, upload_image_error: 12605, upload_image_end: 12606, upload_image_state: 12607, downLoad_file_start: 12611, downLoad_file_success: 12612, downLoad_file_stop: 12613, downLoad_file_cancel: 12614, downLoad_file_error: 12615, downLoad_file_end: 12616, downLoad_file_state: 12617, big_file_inform: 12627, start_hang_up: 12634, end_hang_up: 12635, hang_up_time_end: 12636, hang_up_timeout: 12637, get_big_file_list: 12646, big_file_list: 12647, get_hang_up_time: 12652, player_connect_error: 13280, sensor_received: 13290, sensor_list_received: 13297, start_liveing: 13301, start_liveing_success: 13302, start_liveing_error: 13303, end_liveing: 13304, end_liveing_success: 13305, end_liveing_error: 13306, get_pin_code: 13307, get_pin_code_success: 13308, get_pin_code_error: 13309, apply_control_power: 13310, apply_control_power_success: 13311, apply_control_power_error: 13312, get_control_success: 13313, lost_control: 13315, wsmessage_send_started: 12901, wsmessage_send_successed: 12902, wsmessage_send_failed: 12903, wsmessage_send_recevied: 12904, video_camera_connect: 13455, video_camera_open: 13457, video_camera_first_buffer: 13458, video_camera_open_ack: 13459, video_camera_message: 14004, video_camera_close: 13460, video_camera_api_check: 14006, video_camera_code_check: 14007, video_camera_use_select: 14008, signalv2_opened: 13641, signalv2_closed: 13642, signalv2_setoffer: 13644, appSetScreenDirection: 12410, audio_connect_open: 13201, audio_connect_error: 13202, audio_start_msg: 13203, audio_start_msg_timeout: 13204, audio_user_allow_mike: 13205, audio_user_refuse_mike: 13206, audio_end_msg_timeout: 13207, audio_connect_close: 13208, audio_not_support: 13209, video_support_freamcallback: 13740, video_not_support_freamcallback: 13741 } , SCENE_EVENT_IDS = { 12058: !0, 12106: !0, 12059: !0, 12107: !0, 12063: !0, 12078: !0, 12079: !0, 12084: !0, 12080: !0, 12081: !0, 12056: !0, 12057: !0, 10012: !0, 12082: !0, 12072: !0, 12088: !0, 12089: !0, 12044: !0, 12112: !0, 12113: !0, 12114: !0 } , Logger = function() { function n(e, t) { _classCallCheck(this, n), this.accessKeyId = e, this.channelId = t, this.loggerUrl = "".concat(loggerConf.logUrl + "/i"), this.appKey = loggerConf.appKey, this.serverTimestamp = loggerConf.timeStamp, this.cache = [], this.clientType = getClientType() } return _createClass(n, [{ key: "setGameInfo", value: function(e, t, n, i) { this.extraId = e, this.uId = t, this.pkgName = n, this.appChannel = i } }, { key: "setLoggerInfo", value: function(e, t, n, i) { this.loggerUrl && this.appKey || (this.loggerUrl = "".concat(e, "/i"), this.appKey = t, this.serverTimestamp = n), this.deviceId = i || -1 } }, { key: "setCid", value: function(e) { this.cid = e } }, { key: "setClientTransId", value: function(e) { this.clientTransId = e } }, { key: "send", value: function(e, t) { var n = Date.now() , n = String(Math.floor(n)) , i = (new Date).getHours() , o = (new Date).getDay() , e = (t && "object" === _typeof(t) && (t.eventDataVer = "1.0"), SCENE_EVENT_IDS[e] && eventEmitter.emit("sceneChanged", "evnt", { eventId: e }), { key: "HMCPWebEvent", count: 1, timestamp: n, hour: i, dow: o, segmentation: { key: this.clientType, timeStamp: n, deviceID: this.deviceId, eventID: e, cloudID: this.cid || "", channel: this.channelId, extraId: this.extraId || "", eventData: t || "", uid: this.uId, accessKeyId: this.accessKeyId, networkType: "WIFI", netStatus: "WIFI", clientTransId: this.clientTransId, serverTimestamp: this.serverTimestamp || -1, extension: { sdkVersion: SDK_VERSION, pkgName: this.pkgName, appChannel: this.appChannel || "" } } }) , t = []; this.loggerUrl ? (this.cache.length ? (t = [].concat(_toConsumableArray(this.cache), [e]), this.cache = []) : t = [e], t = "events=" + JSON.stringify(t) + "&app_key=" + encodeURIComponent(this.appKey) + "&device_id=" + encodeURIComponent(this.deviceId) + "&sdk_name=" + encodeURIComponent("javascript_native_web") + "&sdk_version=" + encodeURIComponent("16.12") + "&hour=" + i + "&dow=" + o + "×tamp=" + n, i = json2url({ c: e.segmentation.cloudID || "", e: e.segmentation.eventID, t: e.segmentation.clientTransId, s: e.segmentation.key, u: e.segmentation.uid }), ajax({ url: "".concat(this.loggerUrl, "?").concat(i), data: t, method: "POST", contentType: "application/x-www-form-urlencoded", timeout: 10, done: function(e) {} })) : this.cache.push(e) } }]), n }() , SaasSocket = function() { function i(e, t, n) { _classCallCheck(this, i), this.socketUrl = e, this.maxRetryCount = t || 5, this.currentRetryCount = 1, this.pingpongretryCount = 0, this.setDataInfo = n, this.saasGetMessage = !1, this.disconnectStatus = !1 } return _createClass(i, [{ key: "connect", value: function() { this.currentRetryCount > this.maxRetryCount ? (this.closeReconnect(), eventEmitter.emit("saasSocket", "failed", this.currentRetryCount)) : (this.ws = new WebSocket(this.socketUrl), this.ws.onopen = this._open.bind(this), this.ws.onmessage = this._messages.bind(this), this.ws.onclose = this._close.bind(this)) } }, { key: "_open", value: function() { var e = this; eventEmitter.emit("saasSocket", "open", this.currentRetryCount), this.currentRetryCount = 1, this.pingpongretryCount = 0, "true" == this.setDataInfo.openPingPong ? (this.saasTimeOutFn(), this.saasGetMessage = !0) : this.heartTimer = setInterval(function() { e.ws.send("") }, 1e4) } }, { key: "_messages", value: function(e) { this.saasGetMessage = !0, this.pingpongretryCount = 0; e.data.toString().match(/^pong:\d+/gi) ? this.saasPingPongCountly(e.data.toString().match(/\d+/gi)[0]) : eventEmitter.emit("saasSocket", "messages", e.data) } }, { key: "_close", value: function(e) { var t = this; eventEmitter.emit("saasSocket", "close", e), this.closeReconnect(), this.disconnectStatus || (this.reconnectTimer = setTimeout(function() { t.currentRetryCount++, t.connect() }, 1e3 + 2e3 * this.currentRetryCount)) } }, { key: "send", value: function(e) { return !(!this.ws || this.ws.readyState != WebSocket.OPEN || (this.ws.send(e), 0)) } }, { key: "saasTimeOutFn", value: function(e) { var t = this; e = e || this.setDataInfo.retryPingPongPeriod[this.pingpongretryCount] || 10, clearTimeout(this.saasPingPongTimer), this.saasPingPongTimer = setTimeout(function() { if (t.saasGetMessage) t.saasSocketSendPing("ping"), t.saasTimeOutFn(); else { if (t.pingpongretryCount++, t.pingpongretryCount >= t.setDataInfo.retryPingPongPeriod.length) return eventEmitter.emit("saasSocket", "Countly", { eventId: loggerEventId.over_limit_get_pong, eventDate: t.pingpongretryCount }), void eventEmitter.emit("saasSocket", "PingPongTimeOut"); t.saasSocketSendPing("ping"), t.saasTimeOutFn(t.setDataInfo.retryPingPongPeriod[t.pingpongretryCount]), eventEmitter.emit("saasSocket", "Countly", { eventId: loggerEventId.over_time_get_pong, eventDate: t.pingpongretryCount }) } t.saasGetMessage = !1 }, e) } }, { key: "saasSocketSendPing", value: function(e) { var t = (new Date).getTime(); this.send(e + ":" + t) } }, { key: "saasPingPongCountly", value: function(e) { var t; "true" == this.setDataInfo.openCustomCountly && (t = Date.now(), eventEmitter.emit("saasSocket", "Countly", { eventId: loggerEventId.saas_socket_ping_pong_delay_time, eventDate: t - e })) } }, { key: "closeReconnect", value: function() { clearTimeout(this.reconnectTimer), clearInterval(this.heartTimer), clearTimeout(this.saasPingPongTimer), this.ws && (this.ws.onopen = null, this.ws.onmessage = null, this.ws.onclose = null, this.ws.close(), this.ws = null) } }, { key: "disconnect", value: function() { this.disconnectStatus = !0, this.closeReconnect() } }]), i }() , InputSocket = function() { function i(e, t, n) { _classCallCheck(this, i), this.socketUrl = e, this.pingPongInterval = t, this.maxPingPongDelay = n } return _createClass(i, [{ key: "connect", value: function() { this.ws = new WebSocket(this.socketUrl), this.ws.onopen = this._open.bind(this), this.ws.onmessage = this._messages.bind(this), this.ws.onclose = this._close.bind(this) } }, { key: "_open", value: function() { var e = this; eventEmitter.emit("inputSocket", "open"), this.pingPongTimer = setInterval(function() { e.ws.send("ping:".concat((new Date).getTime())) }, this.pingPongInterval || 6e4) } }, { key: "_messages", value: function(e) { eventEmitter.emit("inputSocket", "messages"); var t, e = e.data; /^pong:(\d+)/i.test(e) ? (t = Date.now() - RegExp.$1, eventEmitter.emit("inputSocket", "delay", t), t >= this.maxPingPongDelay && eventEmitter.emit("inputSocket", "delayMax", t)) : /^startim/i.test(e) ? eventEmitter.emit("inputSocket", "startIm", e) : /^stopim/i.test(e) && eventEmitter.emit("inputSocket", "stopIm", e) } }, { key: "_close", value: function(e) { eventEmitter.emit("inputSocket", "close", e), this.disconnect() } }, { key: "send", value: function(e) { this.ws && this.ws.readyState == WebSocket.OPEN && this.ws.send(e) } }, { key: "disconnect", value: function() { clearInterval(this.pingPongTimer), this.ws && (this.ws.onopen = null, this.ws.onmessage = null, this.ws.onclose = null, this.ws.close(), this.ws = null) } }]), i }() , ScreenSocket = function() { function n(e, t) { _classCallCheck(this, n), this.socketUrl = e, this.screenType = t || "screenSocket", this.maxRetryCount = 5, this.currentRetryCount = 0 } return _createClass(n, [{ key: "connect", value: function() { return this.ws = new WebSocket(this.socketUrl), this.ws.onopen = this._open.bind(this), this.ws.onmessage = this._messages.bind(this), this.ws.onclose = this._close.bind(this), this.ws } }, { key: "_open", value: function() { eventEmitter.emit(this.screenType, "open") } }, { key: "_messages", value: function(e) { eventEmitter.emit(this.screenType, "messages", e.data) } }, { key: "send", value: function(e) { return !(!this.ws || this.ws.readyState != WebSocket.OPEN || (this.ws.send(e), 0)) } }, { key: "_close", value: function(e) { var t = this; eventEmitter.emit(this.screenType, "close", e), this.currentRetryCount >= this.maxRetryCount ? eventEmitter.emit(this.screenType, "failed", e) : this.reconnectTimer = setTimeout(function() { eventEmitter.emit(t.screenType, "reconnect", e), t.currentRetryCount++, t.disconnect() }, 3e3) } }, { key: "disconnect", value: function() { this.ws && (clearTimeout(this.reconnectTimer), this.ws.onopen = null, this.ws.onmessage = null, this.ws.onclose = null, this.ws.close(), this.ws = null) } }]), n }() , applyFailCode = { INIT_PARAMS_VALIDATE_FAILED: 100000001, PARAMS_ERROR: 100000002, SAAS_WEBSOCKET_CONNECT: 100099001, SAAS_WEBSOCKET_DATA: 100099005, NETWORK_BROKEN: 100099006, VIDEO_STREAME_CONNECT_FAILED: 100099007, UNSUPPORTED_DEVICE: 100099101, wechat_unsupported: 100099102, game_interrupted: 100099012, invalid_resolution: 100099013, internal_error: 100099014, GET_DID_TIMEOUT: 100104002, GET_DID_DID_ERROR: 100104005, GET_DID_COUNTLY_ERROR: 100104006, GET_CONFIG_TIMEOUT: 100108002, GET_STREAM_INFO_TIMEOUT: 100211002, GET_STREAM_INFO_CID_ERROR: 100211005, GET_STREAM_INFO_SAAS_WEBSOCKET_ERROR: 100211006, GET_STREAM_INFO_INSTANCE_ERROR: 100211007, RELEASE_CID_TIMEOUT: 100202002, CHANGE_RESOLUTION_TIMEOUT: 100201002, streaming_sdk_candidate_error: 100300002, WEBRTC_CONNECT_TIMEOUT: 100300005, SAAS_WEBSOCKET_RTCDATE_ERROR: 100300006, x86_rtc_player_error: 100400001, x86_rtc_ice_connection_failed: 100400002, x86_rtc_connection_state_failed: 100400003, x86_rtc_create_offer_error: 100400004, x86_rtc_create_answer_error: 100400004, x86_rtc_get_remote_sdp_error: 100400005, x86_rtc_set_remote_desc_error: 100400006, x86_rtc_data_channel_error: 100400007, NO_CID: 100999001, CONNECT_WS_SAAS_FAILED: 100999002, WS_SAAS_PING_PONG_ERROR: 100999003, WS_SAAS_PING_PONG_SECCESS: 100999004, CONNECT_VIDEO_NOT_MSG: 100999005, CONNECT_ONLY_AUDIO_OK: 100999006, CONNECT_ONLY_INPUT_OK: 100999007, CONNECT_ALL_FAILED: 100999008 } , applyFailReason = { REQUEST_ERROR: "requestError", INTERNAL_ERROR: "internalError", IS_ERROR: "instanceError", TOKEN_EXPIRE: "tokenExpire", INSTANCE_LIMIT: "instanceLimit", IS_END: "timeLimit", LOG_OUT: "logOff", MULTI_INST: "multiInst", KICK_OFF: "noOperation", QUEUE_LIMIT: "queueLimit", MAINTAIN_SERVER: "maintainServer", TOKEN_FAILED: "tokenFailed", NORMAL: "normal", LOAD_GAME_FAILED: "loadGameFailed", NETWORK_OFF: "networkOff", LINK_LIMIT: "linkLimit", UNSUPPORTED_DEVICE: "unsupportDevice" } , logDisabled_ = (_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, applyFailReason.KICK_OFF, 36), applyFailReason.INTERNAL_ERROR, 60), applyFailReason.NORMAL, 62), applyFailReason.IS_END, 63), applyFailReason.LINK_LIMIT, 64), !0) , deprecationWarnings_ = !0; function extractVersion(e, t, n) { e = e.match(t); return e && e.length >= n && parseInt(e[n], 10) } function wrapPeerConnectionEvent(e, i, o) { var r, s; e.RTCPeerConnection && (e = e.RTCPeerConnection.prototype, r = e.addEventListener, e.addEventListener = function(e, t) { var n; return e !== i ? r.apply(this, arguments) : (n = function(e) { e = o(e); e && (t.handleEvent ? t.handleEvent(e) : t(e)) } , this._eventMap = this._eventMap || {}, this._eventMap[i] || (this._eventMap[i] = new Map), this._eventMap[i].set(t, n), r.apply(this, [e, n])) } , s = e.removeEventListener, e.removeEventListener = function(e, t) { var n; return e === i && this._eventMap && this._eventMap[i] && this._eventMap[i].has(t) ? (n = this._eventMap[i].get(t), this._eventMap[i].delete(t), 0 === this._eventMap[i].size && delete this._eventMap[i], 0 === Object.keys(this._eventMap).length && delete this._eventMap, s.apply(this, [e, n])) : s.apply(this, arguments) } , Object.defineProperty(e, "on" + i, { get: function() { return this["_on" + i] }, set: function(e) { this["_on" + i] && (this.removeEventListener(i, this["_on" + i]), delete this["_on" + i]), e && this.addEventListener(i, this["_on" + i] = e) }, enumerable: !0, configurable: !0 })) } function disableLog(e) { return "boolean" != typeof e ? new Error("Argument type: " + _typeof(e) + ". Please use a boolean.") : (logDisabled_ = e) ? "adapter.js logging disabled" : "adapter.js logging enabled" } function disableWarnings(e) { return "boolean" != typeof e ? new Error("Argument type: " + _typeof(e) + ". Please use a boolean.") : (deprecationWarnings_ = !e, "adapter.js deprecation warnings " + (e ? "disabled" : "enabled")) } function log() { "undefined" == typeof window || _typeof(window) } function deprecated(e, t) {} function detectBrowser(e) { var t = { browser: null, version: null }; if (void 0 !== e && e.navigator) { var n = e.navigator; if (n.mozGetUserMedia) t.browser = "firefox", t.version = extractVersion(n.userAgent, /Firefox\/(\d+)\./, 1); else if (n.webkitGetUserMedia || !1 === e.isSecureContext && e.webkitRTCPeerConnection && !e.RTCIceGatherer) t.browser = "chrome", t.version = extractVersion(n.userAgent, /Chrom(e|ium)\/(\d+)\./, 2); else if (n.mediaDevices && n.userAgent.match(/Edge\/(\d+).(\d+)$/)) t.browser = "edge", t.version = extractVersion(n.userAgent, /Edge\/(\d+).(\d+)$/, 2); else { if (!e.RTCPeerConnection || !n.userAgent.match(/AppleWebKit\/(\d+)\./)) return t.browser = "Not a supported browser.", t; t.browser = "safari", t.version = extractVersion(n.userAgent, /AppleWebKit\/(\d+)\./, 1), t.supportsUnifiedPlan = e.RTCRtpTransceiver && "currentDirection"in e.RTCRtpTransceiver.prototype } } else t.browser = "Not a browser."; return t } function isObject$1(e) { return "[object Object]" === Object.prototype.toString.call(e) } function compactObject(o) { return isObject$1(o) ? Object.keys(o).reduce(function(e, t) { var n = isObject$1(o[t]) , i = n ? compactObject(o[t]) : o[t] , n = n && !Object.keys(i).length; return void 0 === i || n ? e : Object.assign(e, _defineProperty({}, t, i)) }, {}) : o } function walkStats(t, n, i) { n && !i.has(n.id) && (i.set(n.id, n), Object.keys(n).forEach(function(e) { e.endsWith("Id") ? walkStats(t, t.get(n[e]), i) : e.endsWith("Ids") && n[e].forEach(function(e) { walkStats(t, t.get(e), i) }) })) } function filterStats(n, t, e) { var i, o = e ? "outbound-rtp" : "inbound-rtp", r = new Map; return null !== t && (i = [], n.forEach(function(e) { "track" === e.type && e.trackIdentifier === t.id && i.push(e) }), i.forEach(function(t) { n.forEach(function(e) { e.type === o && e.trackId === t.id && walkStats(n, e, r) }) })), r } var logging = log; function shimGetUserMedia$3(e, t) { var s, i, o, n, a = e && e.navigator; a.mediaDevices && (s = function(o) { var r; return "object" !== _typeof(o) || o.mandatory || o.optional ? o : (r = {}, Object.keys(o).forEach(function(t) { var n, i, e; "require" !== t && "advanced" !== t && "mediaSource" !== t && (void 0 !== (n = "object" === _typeof(o[t]) ? o[t] : { ideal: o[t] }).exact && "number" == typeof n.exact && (n.min = n.max = n.exact), i = function(e, t) { return e ? e + t.charAt(0).toUpperCase() + t.slice(1) : "deviceId" === t ? "sourceId" : t } , void 0 !== n.ideal && (r.optional = r.optional || [], e = {}, "number" == typeof n.ideal ? (e[i("min", t)] = n.ideal, r.optional.push(e), (e = {})[i("max", t)] = n.ideal) : e[i("", t)] = n.ideal, r.optional.push(e)), void 0 !== n.exact && "number" != typeof n.exact ? (r.mandatory = r.mandatory || {}, r.mandatory[i("", t)] = n.exact) : ["min", "max"].forEach(function(e) { void 0 !== n[e] && (r.mandatory = r.mandatory || {}, r.mandatory[i(e, t)] = n[e]) })) }), o.advanced && (r.optional = (r.optional || []).concat(o.advanced)), r) } , i = function(n, i) { if (!(61 <= t.version)) { if ((n = JSON.parse(JSON.stringify(n))) && "object" === _typeof(n.audio) && ((e = function(e, t, n) { t in e && !(n in e) && (e[n] = e[t], delete e[t]) } )((n = JSON.parse(JSON.stringify(n))).audio, "autoGainControl", "googAutoGainControl"), e(n.audio, "noiseSuppression", "googNoiseSuppression"), n.audio = s(n.audio)), n && "object" === _typeof(n.video)) { var o, r = (r = n.video.facingMode) && ("object" === _typeof(r) ? r : { ideal: r }), e = t.version < 66; if (r && ("user" === r.exact || "environment" === r.exact || "user" === r.ideal || "environment" === r.ideal) && (!a.mediaDevices.getSupportedConstraints || !a.mediaDevices.getSupportedConstraints().facingMode || e)) if (delete n.video.facingMode, "environment" === r.exact || "environment" === r.ideal ? o = ["back", "rear"] : "user" !== r.exact && "user" !== r.ideal || (o = ["front"]), o) return a.mediaDevices.enumerateDevices().then(function(e) { var t = (e = e.filter(function(e) { return "videoinput" === e.kind })).find(function(t) { return o.some(function(e) { return t.label.toLowerCase().includes(e) }) }); return (t = !t && e.length && o.includes("back") ? e[e.length - 1] : t) && (n.video.deviceId = r.exact ? { exact: t.deviceId } : { ideal: t.deviceId }), n.video = s(n.video), logging("chrome: " + JSON.stringify(n)), i(n) }); n.video = s(n.video) } logging("chrome: " + JSON.stringify(n)) } return i(n) } , o = function(e) { return 64 <= t.version ? e : { name: { PermissionDeniedError: "NotAllowedError", PermissionDismissedError: "NotAllowedError", InvalidStateError: "NotAllowedError", DevicesNotFoundError: "NotFoundError", ConstraintNotSatisfiedError: "OverconstrainedError", TrackStartError: "NotReadableError", MediaDeviceFailedDueToShutdown: "NotAllowedError", MediaDeviceKillSwitchOn: "NotAllowedError", TabCaptureError: "AbortError", ScreenCaptureError: "AbortError", DeviceCaptureError: "AbortError" }[e.name] || e.name, message: e.message, constraint: e.constraint || e.constraintName, toString: function() { return this.name + (this.message && ": ") + this.message } } } , a.getUserMedia = function(e, t, n) { i(e, function(e) { a.webkitGetUserMedia(e, t, function(e) { n && n(o(e)) }) }) } .bind(a), a.mediaDevices.getUserMedia) && (n = a.mediaDevices.getUserMedia.bind(a.mediaDevices), a.mediaDevices.getUserMedia = function(e) { return i(e, function(t) { return n(t).then(function(e) { if (t.audio && !e.getAudioTracks().length || t.video && !e.getVideoTracks().length) throw e.getTracks().forEach(function(e) { e.stop() }), new DOMException("","NotFoundError"); return e }, function(e) { return Promise.reject(o(e)) }) }) } ) } function shimGetDisplayMedia$2(r, e) { r.navigator.mediaDevices && "getDisplayMedia"in r.navigator.mediaDevices || r.navigator.mediaDevices && "function" == typeof e && (r.navigator.mediaDevices.getDisplayMedia = function(o) { return e(o).then(function(e) { var t = o.video && o.video.width , n = o.video && o.video.height , i = o.video && o.video.frameRate; return o.video = { mandatory: { chromeMediaSource: "desktop", chromeMediaSourceId: e, maxFrameRate: i || 3 } }, t && (o.video.mandatory.maxWidth = t), n && (o.video.mandatory.maxHeight = n), r.navigator.mediaDevices.getUserMedia(o) }) } ) } function shimMediaStream(e) { e.MediaStream = e.MediaStream || e.webkitMediaStream } function shimOnTrack$1(r) { var e; "object" !== _typeof(r) || !r.RTCPeerConnection || "ontrack"in r.RTCPeerConnection.prototype ? wrapPeerConnectionEvent(r, "track", function(e) { return e.transceiver || Object.defineProperty(e, "transceiver", { value: { receiver: e.receiver } }), e }) : (Object.defineProperty(r.RTCPeerConnection.prototype, "ontrack", { get: function() { return this._ontrack }, set: function(e) { this._ontrack && this.removeEventListener("track", this._ontrack), this.addEventListener("track", this._ontrack = e) }, enumerable: !0, configurable: !0 }), e = r.RTCPeerConnection.prototype.setRemoteDescription, r.RTCPeerConnection.prototype.setRemoteDescription = function() { var o = this; return this._ontrackpoly || (this._ontrackpoly = function(i) { i.stream.addEventListener("addtrack", function(t) { var e = r.RTCPeerConnection.prototype.getReceivers ? o.getReceivers().find(function(e) { return e.track && e.track.id === t.track.id }) : { track: t.track } , n = new Event("track"); n.track = t.track, n.receiver = e, n.transceiver = { receiver: e }, n.streams = [i.stream], o.dispatchEvent(n) }), i.stream.getTracks().forEach(function(t) { var e = r.RTCPeerConnection.prototype.getReceivers ? o.getReceivers().find(function(e) { return e.track && e.track.id === t.id }) : { track: t } , n = new Event("track"); n.track = t, n.receiver = e, n.transceiver = { receiver: e }, n.streams = [i.stream], o.dispatchEvent(n) }) } , this.addEventListener("addstream", this._ontrackpoly)), e.apply(this, arguments) } ) } function shimGetSendersWithDtmf(e) { var i, o, t, n, r, s; "object" === _typeof(e) && e.RTCPeerConnection && !("getSenders"in e.RTCPeerConnection.prototype) && "createDTMFSender"in e.RTCPeerConnection.prototype ? (i = function(e, t) { return { track: t, get dtmf() { return void 0 === this._dtmf && ("audio" === t.kind ? this._dtmf = e.createDTMFSender(t) : this._dtmf = null), this._dtmf }, _pc: e } } , e.RTCPeerConnection.prototype.getSenders || (e.RTCPeerConnection.prototype.getSenders = function() { return this._senders = this._senders || [], this._senders.slice() } , o = e.RTCPeerConnection.prototype.addTrack, e.RTCPeerConnection.prototype.addTrack = function(e, t) { var n = o.apply(this, arguments); return n || (n = i(this, e), this._senders.push(n)), n } , t = e.RTCPeerConnection.prototype.removeTrack, e.RTCPeerConnection.prototype.removeTrack = function(e) { t.apply(this, arguments); e = this._senders.indexOf(e); -1 !== e && this._senders.splice(e, 1) } ), n = e.RTCPeerConnection.prototype.addStream, e.RTCPeerConnection.prototype.addStream = function(e) { var t = this; this._senders = this._senders || [], n.apply(this, [e]), e.getTracks().forEach(function(e) { t._senders.push(i(t, e)) }) } , r = e.RTCPeerConnection.prototype.removeStream, e.RTCPeerConnection.prototype.removeStream = function(e) { var n = this; this._senders = this._senders || [], r.apply(this, [e]), e.getTracks().forEach(function(t) { var e = n._senders.find(function(e) { return e.track === t }); e && n._senders.splice(n._senders.indexOf(e), 1) }) } ) : "object" === _typeof(e) && e.RTCPeerConnection && "getSenders"in e.RTCPeerConnection.prototype && "createDTMFSender"in e.RTCPeerConnection.prototype && e.RTCRtpSender && !("dtmf"in e.RTCRtpSender.prototype) && (s = e.RTCPeerConnection.prototype.getSenders, e.RTCPeerConnection.prototype.getSenders = function() { var t = this , e = s.apply(this, []); return e.forEach(function(e) { return e._pc = t }), e } , Object.defineProperty(e.RTCRtpSender.prototype, "dtmf", { get: function() { return void 0 === this._dtmf && ("audio" === this.track.kind ? this._dtmf = this._pc.createDTMFSender(this.track) : this._dtmf = null), this._dtmf } })) } function shimGetStats(e) { var s; e.RTCPeerConnection && (s = e.RTCPeerConnection.prototype.getStats, e.RTCPeerConnection.prototype.getStats = function() { var n, i, o = this, e = Array.prototype.slice.call(arguments), t = e[0], r = e[1], e = e[2]; return 0 < arguments.length && "function" == typeof t ? s.apply(this, arguments) : 0 !== s.length || 0 !== arguments.length && "function" == typeof t ? (n = function(e) { var i = {}; return e.result().forEach(function(t) { var n = { id: t.id, timestamp: t.timestamp, type: { localcandidate: "local-candidate", remotecandidate: "remote-candidate" }[t.type] || t.type }; t.names().forEach(function(e) { n[e] = t.stat(e) }), i[n.id] = n }), i } , i = function(t) { return new Map(Object.keys(t).map(function(e) { return [e, t[e]] })) } , 2 <= arguments.length ? s.apply(this, [function(e) { r(i(n(e))) } , t]) : new Promise(function(t, e) { s.apply(o, [function(e) { t(i(n(e))) } , e]) } ).then(r, e)) : s.apply(this, []) } ) } function shimSenderReceiverGetStats(e) { var n, t, i, r; "object" === _typeof(e) && e.RTCPeerConnection && e.RTCRtpSender && e.RTCRtpReceiver && ("getStats"in e.RTCRtpSender.prototype || ((n = e.RTCPeerConnection.prototype.getSenders) && (e.RTCPeerConnection.prototype.getSenders = function() { var t = this , e = n.apply(this, []); return e.forEach(function(e) { return e._pc = t }), e } ), (t = e.RTCPeerConnection.prototype.addTrack) && (e.RTCPeerConnection.prototype.addTrack = function() { var e = t.apply(this, arguments); return e._pc = this, e } ), e.RTCRtpSender.prototype.getStats = function() { var t = this; return this._pc.getStats().then(function(e) { return filterStats(e, t.track, !0) }) } ), "getStats"in e.RTCRtpReceiver.prototype || ((i = e.RTCPeerConnection.prototype.getReceivers) && (e.RTCPeerConnection.prototype.getReceivers = function() { var t = this , e = i.apply(this, []); return e.forEach(function(e) { return e._pc = t }), e } ), wrapPeerConnectionEvent(e, "track", function(e) { return e.receiver._pc = e.srcElement, e }), e.RTCRtpReceiver.prototype.getStats = function() { var t = this; return this._pc.getStats().then(function(e) { return filterStats(e, t.track, !1) }) } ), "getStats"in e.RTCRtpSender.prototype) && "getStats"in e.RTCRtpReceiver.prototype && (r = e.RTCPeerConnection.prototype.getStats, e.RTCPeerConnection.prototype.getStats = function() { var t, n, i, o; return 0 < arguments.length && arguments[0]instanceof e.MediaStreamTrack ? (t = arguments[0], this.getSenders().forEach(function(e) { e.track === t && (n ? o = !0 : n = e) }), this.getReceivers().forEach(function(e) { return e.track === t && (i ? o = !0 : i = e), e.track === t }), o || n && i ? Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")) : n ? n.getStats() : i ? i.getStats() : Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))) : r.apply(this, arguments) } ) } function shimAddTrackRemoveTrackWithNative(e) { e.RTCPeerConnection.prototype.getLocalStreams = function() { var t = this; return this._shimmedLocalStreams = this._shimmedLocalStreams || {}, Object.keys(this._shimmedLocalStreams).map(function(e) { return t._shimmedLocalStreams[e][0] }) } ; var i = e.RTCPeerConnection.prototype.addTrack , o = (e.RTCPeerConnection.prototype.addTrack = function(e, t) { if (!t) return i.apply(this, arguments); this._shimmedLocalStreams = this._shimmedLocalStreams || {}; var n = i.apply(this, arguments); return this._shimmedLocalStreams[t.id] ? -1 === this._shimmedLocalStreams[t.id].indexOf(n) && this._shimmedLocalStreams[t.id].push(n) : this._shimmedLocalStreams[t.id] = [t, n], n } , e.RTCPeerConnection.prototype.addStream) , t = (e.RTCPeerConnection.prototype.addStream = function(e) { var n = this , t = (this._shimmedLocalStreams = this._shimmedLocalStreams || {}, e.getTracks().forEach(function(t) { if (n.getSenders().find(function(e) { return e.track === t })) throw new DOMException("Track already exists.","InvalidAccessError") }), this.getSenders()) , i = (o.apply(this, arguments), this.getSenders().filter(function(e) { return -1 === t.indexOf(e) })); this._shimmedLocalStreams[e.id] = [e].concat(i) } , e.RTCPeerConnection.prototype.removeStream) , r = (e.RTCPeerConnection.prototype.removeStream = function(e) { return this._shimmedLocalStreams = this._shimmedLocalStreams || {}, delete this._shimmedLocalStreams[e.id], t.apply(this, arguments) } , e.RTCPeerConnection.prototype.removeTrack); e.RTCPeerConnection.prototype.removeTrack = function(n) { var i = this; return this._shimmedLocalStreams = this._shimmedLocalStreams || {}, n && Object.keys(this._shimmedLocalStreams).forEach(function(e) { var t = i._shimmedLocalStreams[e].indexOf(n); -1 !== t && i._shimmedLocalStreams[e].splice(t, 1), 1 === i._shimmedLocalStreams[e].length && delete i._shimmedLocalStreams[e] }), r.apply(this, arguments) } } function shimAddTrackRemoveTrack(o, e) { if (o.RTCPeerConnection) { if (o.RTCPeerConnection.prototype.addTrack && 65 <= e.version) return shimAddTrackRemoveTrackWithNative(o); var n = o.RTCPeerConnection.prototype.getLocalStreams , i = (o.RTCPeerConnection.prototype.getLocalStreams = function() { var t = this , e = n.apply(this); return this._reverseStreams = this._reverseStreams || {}, e.map(function(e) { return t._reverseStreams[e.id] }) } , o.RTCPeerConnection.prototype.addStream) , t = (o.RTCPeerConnection.prototype.addStream = function(e) { var t, n = this; this._streams = this._streams || {}, this._reverseStreams = this._reverseStreams || {}, e.getTracks().forEach(function(t) { if (n.getSenders().find(function(e) { return e.track === t })) throw new DOMException("Track already exists.","InvalidAccessError") }), this._reverseStreams[e.id] || (t = new o.MediaStream(e.getTracks()), this._streams[e.id] = t, this._reverseStreams[t.id] = e, e = t), i.apply(this, [e]) } , o.RTCPeerConnection.prototype.removeStream) , r = (o.RTCPeerConnection.prototype.removeStream = function(e) { this._streams = this._streams || {}, this._reverseStreams = this._reverseStreams || {}, t.apply(this, [this._streams[e.id] || e]), delete this._reverseStreams[(this._streams[e.id] || e).id], delete this._streams[e.id] } , o.RTCPeerConnection.prototype.addTrack = function(t, e) { var n = this; if ("closed" === this.signalingState) throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError"); var i = [].slice.call(arguments, 1); if (1 !== i.length || !i[0].getTracks().find(function(e) { return e === t })) throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError"); if (this.getSenders().find(function(e) { return e.track === t })) throw new DOMException("Track already exists.","InvalidAccessError"); this._streams = this._streams || {}, this._reverseStreams = this._reverseStreams || {}; var i = this._streams[e.id]; return i ? (i.addTrack(t), Promise.resolve().then(function() { n.dispatchEvent(new Event("negotiationneeded")) })) : (i = new o.MediaStream([t]), this._streams[e.id] = i, this._reverseStreams[i.id] = e, this.addStream(i)), this.getSenders().find(function(e) { return e.track === t }) } , ["createOffer", "createAnswer"].forEach(function(e) { var i = o.RTCPeerConnection.prototype[e] , t = _defineProperty({}, e, function() { var t = this , n = arguments; return arguments.length && "function" == typeof arguments[0] ? i.apply(this, [function(e) { e = a(t, e); n[0].apply(null, [e]) } , function(e) { n[1] && n[1].apply(null, e) } , arguments[2]]) : i.apply(this, arguments).then(function(e) { return a(t, e) }) }); o.RTCPeerConnection.prototype[e] = t[e] }), o.RTCPeerConnection.prototype.setLocalDescription) , s = (o.RTCPeerConnection.prototype.setLocalDescription = function() { var n, e, i; return arguments.length && arguments[0].type && (arguments[0] = (n = this, i = (e = arguments[0]).sdp, Object.keys(n._reverseStreams || []).forEach(function(e) { var e = n._reverseStreams[e] , t = n._streams[e.id]; i = i.replace(new RegExp(e.id,"g"), t.id) }), new RTCSessionDescription({ type: e.type, sdp: i }))), r.apply(this, arguments) } , Object.getOwnPropertyDescriptor(o.RTCPeerConnection.prototype, "localDescription")); Object.defineProperty(o.RTCPeerConnection.prototype, "localDescription", { get: function() { var e = s.get.apply(this); return "" === e.type ? e : a(this, e) } }), o.RTCPeerConnection.prototype.removeTrack = function(t) { var n, i = this; if ("closed" === this.signalingState) throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError"); if (!t._pc) throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError"); if (!(t._pc === this)) throw new DOMException("Sender was not created by this connection.","InvalidAccessError"); this._streams = this._streams || {}, Object.keys(this._streams).forEach(function(e) { i._streams[e].getTracks().find(function(e) { return t.track === e }) && (n = i._streams[e]) }), n && (1 === n.getTracks().length ? this.removeStream(this._reverseStreams[n.id]) : n.removeTrack(t.track), this.dispatchEvent(new Event("negotiationneeded"))) } } function a(n, e) { var i = e.sdp; return Object.keys(n._reverseStreams || []).forEach(function(e) { var e = n._reverseStreams[e] , t = n._streams[e.id]; i = i.replace(new RegExp(t.id,"g"), e.id) }), new RTCSessionDescription({ type: e.type, sdp: i }) } } function shimPeerConnection$2(i, e) { !i.RTCPeerConnection && i.webkitRTCPeerConnection && (i.RTCPeerConnection = i.webkitRTCPeerConnection), i.RTCPeerConnection && e.version < 53 && ["setLocalDescription", "setRemoteDescription", "addIceCandidate"].forEach(function(e) { var t = i.RTCPeerConnection.prototype[e] , n = _defineProperty({}, e, function() { return arguments[0] = new ("addIceCandidate" === e ? i.RTCIceCandidate : i.RTCSessionDescription)(arguments[0]), t.apply(this, arguments) }); i.RTCPeerConnection.prototype[e] = n[e] }) } function fixNegotiationNeeded(e, n) { wrapPeerConnectionEvent(e, "negotiationneeded", function(e) { var t = e.target; if (!(n.version < 72 || t.getConfiguration && "plan-b" === t.getConfiguration().sdpSemantics) || "stable" === t.signalingState) return e }) } var chromeShim = Object.freeze({ __proto__: null, shimMediaStream: shimMediaStream, shimOnTrack: shimOnTrack$1, shimGetSendersWithDtmf: shimGetSendersWithDtmf, shimGetStats: shimGetStats, shimSenderReceiverGetStats: shimSenderReceiverGetStats, shimAddTrackRemoveTrackWithNative: shimAddTrackRemoveTrackWithNative, shimAddTrackRemoveTrack: shimAddTrackRemoveTrack, shimPeerConnection: shimPeerConnection$2, fixNegotiationNeeded: fixNegotiationNeeded, shimGetUserMedia: shimGetUserMedia$3, shimGetDisplayMedia: shimGetDisplayMedia$2 }); function filterIceServers$1(e, t) { var i = !1; return (e = JSON.parse(JSON.stringify(e))).filter(function(e) { var t, n; if (e && (e.urls || e.url)) return n = e.urls || e.url, e.url && !e.urls && deprecated("RTCIceServer.url", "RTCIceServer.urls"), n = (n = (t = "string" == typeof n) ? [n] : n).filter(function(e) { return 0 !== e.indexOf("stun:") && e.startsWith("turn") && !e.startsWith("turn:[") && e.includes("transport=udp") && !i && (i = !0) }), delete e.url, e.urls = t ? n[0] : n, !!n.length }) } var sdp = createCommonjsModule(function(e) { var l = { generateIdentifier: function() { return Math.random().toString(36).substr(2, 10) } }; l.localCName = l.generateIdentifier(), l.splitLines = function(e) { return e.trim().split("\n").map(function(e) { return e.trim() }) } , l.splitSections = function(e) { return e.split("\nm=").map(function(e, t) { return (0 < t ? "m=" + e : e).trim() + "\r\n" }) } , l.getDescription = function(e) { e = l.splitSections(e); return e && e[0] } , l.getMediaSections = function(e) { e = l.splitSections(e); return e.shift(), e } , l.matchPrefix = function(e, t) { return l.splitLines(e).filter(function(e) { return 0 === e.indexOf(t) }) } , l.parseCandidate = function(e) { for (var t = (0 === e.indexOf("a=candidate:") ? e.substring(12) : e.substring(10)).split(" "), n = { foundation: t[0], component: parseInt(t[1], 10), protocol: t[2].toLowerCase(), priority: parseInt(t[3], 10), ip: t[4], address: t[4], port: parseInt(t[5], 10), type: t[7] }, i = 8; i < t.length; i += 2) switch (t[i]) { case "raddr": n.relatedAddress = t[i + 1]; break; case "rport": n.relatedPort = parseInt(t[i + 1], 10); break; case "tcptype": n.tcpType = t[i + 1]; break; case "ufrag": n.ufrag = t[i + 1], n.usernameFragment = t[i + 1]; break; default: n[t[i]] = t[i + 1] } return n } , l.writeCandidate = function(e) { var t = [] , n = (t.push(e.foundation), t.push(e.component), t.push(e.protocol.toUpperCase()), t.push(e.priority), t.push(e.address || e.ip), t.push(e.port), e.type); return t.push("typ"), t.push(n), "host" !== n && e.relatedAddress && e.relatedPort && (t.push("raddr"), t.push(e.relatedAddress), t.push("rport"), t.push(e.relatedPort)), e.tcpType && "tcp" === e.protocol.toLowerCase() && (t.push("tcptype"), t.push(e.tcpType)), (e.usernameFragment || e.ufrag) && (t.push("ufrag"), t.push(e.usernameFragment || e.ufrag)), "candidate:" + t.join(" ") } , l.parseIceOptions = function(e) { return e.substr(14).split(" ") } , l.parseRtpMap = function(e) { var e = e.substr(9).split(" ") , t = { payloadType: parseInt(e.shift(), 10) } , e = e[0].split("/"); return t.name = e[0], t.clockRate = parseInt(e[1], 10), t.channels = 3 === e.length ? parseInt(e[2], 10) : 1, t.numChannels = t.channels, t } , l.writeRtpMap = function(e) { var t = e.payloadType , n = (void 0 !== e.preferredPayloadType && (t = e.preferredPayloadType), e.channels || e.numChannels || 1); return "a=rtpmap:" + t + " " + e.name + "/" + e.clockRate + (1 !== n ? "/" + n : "") + "\r\n" } , l.parseExtmap = function(e) { e = e.substr(9).split(" "); return { id: parseInt(e[0], 10), direction: 0 < e[0].indexOf("/") ? e[0].split("/")[1] : "sendrecv", uri: e[1] } } , l.writeExtmap = function(e) { return "a=extmap:" + (e.id || e.preferredId) + (e.direction && "sendrecv" !== e.direction ? "/" + e.direction : "") + " " + e.uri + "\r\n" } , l.parseFmtp = function(e) { for (var t, n = {}, i = e.substr(e.indexOf(" ") + 1).split(";"), o = 0; o < i.length; o++) n[(t = i[o].trim().split("="))[0].trim()] = t[1]; return n } , l.writeFmtp = function(t) { var n, e = "", i = t.payloadType; return void 0 !== t.preferredPayloadType && (i = t.preferredPayloadType), t.parameters && Object.keys(t.parameters).length && (n = [], Object.keys(t.parameters).forEach(function(e) { t.parameters[e] ? n.push(e + "=" + t.parameters[e]) : n.push(e) }), e += "a=fmtp:" + i + " " + n.join(";") + "\r\n"), e } , l.parseRtcpFb = function(e) { e = e.substr(e.indexOf(" ") + 1).split(" "); return { type: e.shift(), parameter: e.join(" ") } } , l.writeRtcpFb = function(e) { var t = "" , n = e.payloadType; return void 0 !== e.preferredPayloadType && (n = e.preferredPayloadType), e.rtcpFeedback && e.rtcpFeedback.length && e.rtcpFeedback.forEach(function(e) { t += "a=rtcp-fb:" + n + " " + e.type + (e.parameter && e.parameter.length ? " " + e.parameter : "") + "\r\n" }), t } , l.parseSsrcMedia = function(e) { var t = e.indexOf(" ") , n = { ssrc: parseInt(e.substr(7, t - 7), 10) } , i = e.indexOf(":", t); return -1 < i ? (n.attribute = e.substr(t + 1, i - t - 1), n.value = e.substr(i + 1)) : n.attribute = e.substr(t + 1), n } , l.parseSsrcGroup = function(e) { e = e.substr(13).split(" "); return { semantics: e.shift(), ssrcs: e.map(function(e) { return parseInt(e, 10) }) } } , l.getMid = function(e) { e = l.matchPrefix(e, "a=mid:")[0]; if (e) return e.substr(6) } , l.parseFingerprint = function(e) { e = e.substr(14).split(" "); return { algorithm: e[0].toLowerCase(), value: e[1] } } , l.getDtlsParameters = function(e, t) { return { role: "auto", fingerprints: l.matchPrefix(e + t, "a=fingerprint:").map(l.parseFingerprint) } } , l.writeDtlsParameters = function(e, t) { var n = "a=setup:" + t + "\r\n"; return e.fingerprints.forEach(function(e) { n += "a=fingerprint:" + e.algorithm + " " + e.value + "\r\n" }), n } , l.parseCryptoLine = function(e) { e = e.substr(9).split(" "); return { tag: parseInt(e[0], 10), cryptoSuite: e[1], keyParams: e[2], sessionParams: e.slice(3) } } , l.writeCryptoLine = function(e) { return "a=crypto:" + e.tag + " " + e.cryptoSuite + " " + ("object" === _typeof(e.keyParams) ? l.writeCryptoKeyParams(e.keyParams) : e.keyParams) + (e.sessionParams ? " " + e.sessionParams.join(" ") : "") + "\r\n" } , l.parseCryptoKeyParams = function(e) { return 0 !== e.indexOf("inline:") ? null : { keyMethod: "inline", keySalt: (e = e.substr(7).split("|"))[0], lifeTime: e[1], mkiValue: e[2] ? e[2].split(":")[0] : void 0, mkiLength: e[2] ? e[2].split(":")[1] : void 0 } } , l.writeCryptoKeyParams = function(e) { return e.keyMethod + ":" + e.keySalt + (e.lifeTime ? "|" + e.lifeTime : "") + (e.mkiValue && e.mkiLength ? "|" + e.mkiValue + ":" + e.mkiLength : "") } , l.getCryptoParameters = function(e, t) { return l.matchPrefix(e + t, "a=crypto:").map(l.parseCryptoLine) } , l.getIceParameters = function(e, t) { var n = l.matchPrefix(e + t, "a=ice-ufrag:")[0] , e = l.matchPrefix(e + t, "a=ice-pwd:")[0]; return n && e ? { usernameFragment: n.substr(12), password: e.substr(10) } : null } , l.writeIceParameters = function(e) { return "a=ice-ufrag:" + e.usernameFragment + "\r\na=ice-pwd:" + e.password + "\r\n" } , l.parseRtpParameters = function(e) { for (var t = { codecs: [], headerExtensions: [], fecMechanisms: [], rtcp: [] }, n = l.splitLines(e)[0].split(" "), i = 3; i < n.length; i++) { var o = n[i] , r = l.matchPrefix(e, "a=rtpmap:" + o + " ")[0]; if (r) { var s = l.parseRtpMap(r) , r = l.matchPrefix(e, "a=fmtp:" + o + " "); switch (s.parameters = r.length ? l.parseFmtp(r[0]) : {}, s.rtcpFeedback = l.matchPrefix(e, "a=rtcp-fb:" + o + " ").map(l.parseRtcpFb), t.codecs.push(s), s.name.toUpperCase()) { case "RED": case "ULPFEC": t.fecMechanisms.push(s.name.toUpperCase()) } } } return l.matchPrefix(e, "a=extmap:").forEach(function(e) { t.headerExtensions.push(l.parseExtmap(e)) }), t } , l.writeRtpDescription = function(e, t) { var n = "" , i = (n = (n = (n = (n += "m=" + e + " ") + (0 < t.codecs.length ? "9" : "0") + " UDP/TLS/RTP/SAVPF ") + (t.codecs.map(function(e) { return void 0 !== e.preferredPayloadType ? e.preferredPayloadType : e.payloadType }).join(" ") + "\r\n")) + "c=IN IP4 0.0.0.0\r\n" + "a=rtcp:9 IN IP4 0.0.0.0\r\n", t.codecs.forEach(function(e) { n = (n = (n += l.writeRtpMap(e)) + l.writeFmtp(e)) + l.writeRtcpFb(e) }), 0); return t.codecs.forEach(function(e) { e.maxptime > i && (i = e.maxptime) }), 0 < i && (n += "a=maxptime:" + i + "\r\n"), n += "a=rtcp-mux\r\n", t.headerExtensions && t.headerExtensions.forEach(function(e) { n += l.writeExtmap(e) }), n } , l.parseRtpEncodingParameters = function(e) { var t, n = [], i = l.parseRtpParameters(e), o = -1 !== i.fecMechanisms.indexOf("RED"), r = -1 !== i.fecMechanisms.indexOf("ULPFEC"), s = l.matchPrefix(e, "a=ssrc:").map(function(e) { return l.parseSsrcMedia(e) }).filter(function(e) { return "cname" === e.attribute }), a = 0 < s.length && s[0].ssrc, s = l.matchPrefix(e, "a=ssrc-group:FID").map(function(e) { return e.substr(17).split(" ").map(function(e) { return parseInt(e, 10) }) }), c = (0 < s.length && 1 < s[0].length && s[0][0] === a && (t = s[0][1]), i.codecs.forEach(function(e) { "RTX" === e.name.toUpperCase() && e.parameters.apt && (e = { ssrc: a, codecPayloadType: parseInt(e.parameters.apt, 10) }, a && t && (e.rtx = { ssrc: t }), n.push(e), o) && ((e = JSON.parse(JSON.stringify(e))).fec = { ssrc: a, mechanism: r ? "red+ulpfec" : "red" }, n.push(e)) }), 0 === n.length && a && n.push({ ssrc: a }), l.matchPrefix(e, "b=")); return c.length && (c = 0 === c[0].indexOf("b=TIAS:") ? parseInt(c[0].substr(7), 10) : 0 === c[0].indexOf("b=AS:") ? 1e3 * parseInt(c[0].substr(5), 10) * .95 - 16e3 : void 0, n.forEach(function(e) { e.maxBitrate = c })), n } , l.parseRtcpParameters = function(e) { var t = {} , n = l.matchPrefix(e, "a=ssrc:").map(function(e) { return l.parseSsrcMedia(e) }).filter(function(e) { return "cname" === e.attribute })[0] , n = (n && (t.cname = n.value, t.ssrc = n.ssrc), l.matchPrefix(e, "a=rtcp-rsize")) , n = (t.reducedSize = 0 < n.length, t.compound = 0 === n.length, l.matchPrefix(e, "a=rtcp-mux")); return t.mux = 0 < n.length, t } , l.parseMsid = function(e) { var t, n = l.matchPrefix(e, "a=msid:"); return 1 === n.length ? { stream: (t = n[0].substr(7).split(" "))[0], track: t[1] } : 0 < (n = l.matchPrefix(e, "a=ssrc:").map(function(e) { return l.parseSsrcMedia(e) }).filter(function(e) { return "msid" === e.attribute })).length ? { stream: (t = n[0].value.split(" "))[0], track: t[1] } : void 0 } , l.parseSctpDescription = function(e) { var t, n = l.parseMLine(e), i = l.matchPrefix(e, "a=max-message-size:"), i = (0 < i.length && (t = parseInt(i[0].substr(19), 10)), isNaN(t) && (t = 65536), l.matchPrefix(e, "a=sctp-port:")); return 0 < i.length ? { port: parseInt(i[0].substr(12), 10), protocol: n.fmt, maxMessageSize: t } : 0 < l.matchPrefix(e, "a=sctpmap:").length ? (i = l.matchPrefix(e, "a=sctpmap:")[0].substr(10).split(" "), { port: parseInt(i[0], 10), protocol: i[1], maxMessageSize: t }) : void 0 } , l.writeSctpDescription = function(e, t) { var n = [] , n = "DTLS/SCTP" !== e.protocol ? ["m=" + e.kind + " 9 " + e.protocol + " " + t.protocol + "\r\n", "c=IN IP4 0.0.0.0\r\n", "a=sctp-port:" + t.port + "\r\n"] : ["m=" + e.kind + " 9 " + e.protocol + " " + t.port + "\r\n", "c=IN IP4 0.0.0.0\r\n", "a=sctpmap:" + t.port + " " + t.protocol + " 65535\r\n"]; return void 0 !== t.maxMessageSize && n.push("a=max-message-size:" + t.maxMessageSize + "\r\n"), n.join("") } , l.generateSessionId = function() { return Math.random().toString().substr(2, 21) } , l.writeSessionBoilerplate = function(e, t, n) { t = void 0 !== t ? t : 2, e = e || l.generateSessionId(); return "v=0\r\no=" + (n || "thisisadapterortc") + " " + e + " " + t + " IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n" } , l.writeMediaSection = function(e, t, n, i) { t = l.writeRtpDescription(e.kind, t); return t = (t = (t += l.writeIceParameters(e.iceGatherer.getLocalParameters())) + l.writeDtlsParameters(e.dtlsTransport.getLocalParameters(), "offer" === n ? "actpass" : "active")) + ("a=mid:" + e.mid + "\r\n"), e.direction ? t += "a=" + e.direction + "\r\n" : e.rtpSender && e.rtpReceiver ? t += "a=sendrecv\r\n" : e.rtpSender ? t += "a=sendonly\r\n" : e.rtpReceiver ? t += "a=recvonly\r\n" : t += "a=inactive\r\n", e.rtpSender && (t = t + "a=" + (n = "msid:" + i.id + " " + e.rtpSender.track.id + "\r\n") + "a=ssrc:" + e.sendEncodingParameters[0].ssrc + " " + n, e.sendEncodingParameters[0].rtx) && (t = (t += "a=ssrc:" + e.sendEncodingParameters[0].rtx.ssrc + " " + n) + "a=ssrc-group:FID " + e.sendEncodingParameters[0].ssrc + " " + e.sendEncodingParameters[0].rtx.ssrc + "\r\n"), t += "a=ssrc:" + e.sendEncodingParameters[0].ssrc + " cname:" + l.localCName + "\r\n", e.rtpSender && e.sendEncodingParameters[0].rtx && (t += "a=ssrc:" + e.sendEncodingParameters[0].rtx.ssrc + " cname:" + l.localCName + "\r\n"), t } , l.getDirection = function(e, t) { for (var n = l.splitLines(e), i = 0; i < n.length; i++) switch (n[i]) { case "a=sendrecv": case "a=sendonly": case "a=recvonly": case "a=inactive": return n[i].substr(2) } return t ? l.getDirection(t) : "sendrecv" } , l.getKind = function(e) { return l.splitLines(e)[0].split(" ")[0].substr(2) } , l.isRejected = function(e) { return "0" === e.split(" ", 2)[1] } , l.parseMLine = function(e) { e = l.splitLines(e)[0].substr(2).split(" "); return { kind: e[0], port: parseInt(e[1], 10), protocol: e[2], fmt: e.slice(3).join(" ") } } , l.parseOLine = function(e) { e = l.matchPrefix(e, "o=")[0].substr(2).split(" "); return { username: e[0], sessionId: e[1], sessionVersion: parseInt(e[2], 10), netType: e[3], addressType: e[4], address: e[5] } } , l.isValidSDP = function(e) { if ("string" != typeof e || 0 === e.length) return !1; for (var t = l.splitLines(e), n = 0; n < t.length; n++) if (t[n].length < 2 || "=" !== t[n].charAt(1)) return !1; return !0 } , e.exports = l }); function fixStatsType(e) { return { inboundrtp: "inbound-rtp", outboundrtp: "outbound-rtp", candidatepair: "candidate-pair", localcandidate: "local-candidate", remotecandidate: "remote-candidate" }[e.type] || e.type } function writeMediaSection(e, t, n, i, o) { t = sdp.writeRtpDescription(e.kind, t); return t = (t = (t += sdp.writeIceParameters(e.iceGatherer.getLocalParameters())) + sdp.writeDtlsParameters(e.dtlsTransport.getLocalParameters(), "offer" === n ? "actpass" : o || "active")) + ("a=mid:" + e.mid + "\r\n"), e.rtpSender && e.rtpReceiver ? t += "a=sendrecv\r\n" : e.rtpSender ? t += "a=sendonly\r\n" : e.rtpReceiver ? t += "a=recvonly\r\n" : t += "a=inactive\r\n", e.rtpSender && (n = e.rtpSender._initialTrackId || e.rtpSender.track.id, e.rtpSender._initialTrackId = n, t = t + "a=" + (o = "msid:" + (i ? i.id : "-") + " " + n + "\r\n") + "a=ssrc:" + e.sendEncodingParameters[0].ssrc + " " + o, e.sendEncodingParameters[0].rtx) && (t = (t += "a=ssrc:" + e.sendEncodingParameters[0].rtx.ssrc + " " + o) + "a=ssrc-group:FID " + e.sendEncodingParameters[0].ssrc + " " + e.sendEncodingParameters[0].rtx.ssrc + "\r\n"), t += "a=ssrc:" + e.sendEncodingParameters[0].ssrc + " cname:" + sdp.localCName + "\r\n", e.rtpSender && e.sendEncodingParameters[0].rtx && (t += "a=ssrc:" + e.sendEncodingParameters[0].rtx.ssrc + " cname:" + sdp.localCName + "\r\n"), t } function filterIceServers(e, i) { var o = !1; return (e = JSON.parse(JSON.stringify(e))).filter(function(e) { var t, n; if (e && (e.urls || e.url)) return n = e.urls || e.url, e.url && e.urls, n = (n = (t = "string" == typeof n) ? [n] : n).filter(function(e) { return 0 !== e.indexOf("turn:") || -1 === e.indexOf("transport=udp") || -1 !== e.indexOf("turn:[") || o ? 0 === e.indexOf("stun:") && 14393 <= i && -1 === e.indexOf("?transport=udp") : o = !0 }), delete e.url, e.urls = t ? n[0] : n, !!n.length }) } function getCommonCapabilities(i, o) { function r(e, t) { e = parseInt(e, 10); for (var n = 0; n < t.length; n++) if (t[n].payloadType === e || t[n].preferredPayloadType === e) return t[n] } var s = { codecs: [], headerExtensions: [], fecMechanisms: [] }; return i.codecs.forEach(function(n) { for (var e = 0; e < o.codecs.length; e++) { var t = o.codecs[e]; if (n.name.toLowerCase() === t.name.toLowerCase() && n.clockRate === t.clockRate && ("rtx" !== n.name.toLowerCase() || !n.parameters || !t.parameters.apt || function(e, t, n, i) { e = r(e.parameters.apt, n), n = r(t.parameters.apt, i); return e && n && e.name.toLowerCase() === n.name.toLowerCase() }(n, t, i.codecs, o.codecs))) { (t = JSON.parse(JSON.stringify(t))).numChannels = Math.min(n.numChannels, t.numChannels), s.codecs.push(t), t.rtcpFeedback = t.rtcpFeedback.filter(function(e) { for (var t = 0; t < n.rtcpFeedback.length; t++) if (n.rtcpFeedback[t].type === e.type && n.rtcpFeedback[t].parameter === e.parameter) return !0; return !1 }); break } } }), i.headerExtensions.forEach(function(e) { for (var t = 0; t < o.headerExtensions.length; t++) { var n = o.headerExtensions[t]; if (e.uri === n.uri) { s.headerExtensions.push(n); break } } }), s } function isActionAllowedInSignalingState(e, t, n) { return -1 !== { offer: { setLocalDescription: ["stable", "have-local-offer"], setRemoteDescription: ["stable", "have-remote-offer"] }, answer: { setLocalDescription: ["have-remote-offer", "have-local-pranswer"], setRemoteDescription: ["have-local-offer", "have-remote-pranswer"] } }[t][e].indexOf(n) } function maybeAddCandidate(e, t) { var n = e.getRemoteCandidates().find(function(e) { return t.foundation === e.foundation && t.ip === e.ip && t.port === e.port && t.priority === e.priority && t.protocol === e.protocol && t.type === e.type }); return n || e.addRemoteCandidate(t), !n } function makeError(e, t) { t = new Error(t); return t.name = e, t.code = { NotSupportedError: 9, InvalidStateError: 11, InvalidAccessError: 15, TypeError: void 0, OperationError: void 0 }[e], t } var rtcpeerconnection = function(R, x) { function P(e, t) { t.addTrack(e), t.dispatchEvent(new R.MediaStreamTrackEvent("addtrack",{ track: e })) } function o(e, t, n, i) { var o = new Event("track"); o.track = t, o.receiver = n, o.transceiver = { receiver: n }, o.streams = i, R.setTimeout(function() { e._dispatchEvent("track", o) }) } function i(e) { var t = this , n = document.createDocumentFragment(); if (["addEventListener", "removeEventListener", "dispatchEvent"].forEach(function(e) { t[e] = n[e].bind(n) }), this.canTrickleIceCandidates = null, this.needNegotiation = !1, this.localStreams = [], this.remoteStreams = [], this._localDescription = null, this._remoteDescription = null, this.signalingState = "stable", this.iceConnectionState = "new", this.connectionState = "new", this.iceGatheringState = "new", e = JSON.parse(JSON.stringify(e || {})), this.usingBundle = "max-bundle" === e.bundlePolicy, "negotiate" === e.rtcpMuxPolicy) throw makeError("NotSupportedError", "rtcpMuxPolicy 'negotiate' is not supported"); switch (e.rtcpMuxPolicy || (e.rtcpMuxPolicy = "require"), e.iceTransportPolicy) { case "all": case "relay": break; default: e.iceTransportPolicy = "all" } switch (e.bundlePolicy) { case "balanced": case "max-compat": case "max-bundle": break; default: e.bundlePolicy = "balanced" } if (e.iceServers = filterIceServers(e.iceServers || [], x), this._iceGatherers = [], e.iceCandidatePoolSize) for (var i = e.iceCandidatePoolSize; 0 < i; i--) this._iceGatherers.push(new R.RTCIceGatherer({ iceServers: e.iceServers, gatherPolicy: e.iceTransportPolicy })); else e.iceCandidatePoolSize = 0; this._config = e, this.transceivers = [], this._sdpSessionId = sdp.generateSessionId(), this._sdpSessionVersion = 0, this._dtlsRole = void 0, this._isClosed = !1 } Object.defineProperty(i.prototype, "localDescription", { configurable: !0, get: function() { return this._localDescription } }), Object.defineProperty(i.prototype, "remoteDescription", { configurable: !0, get: function() { return this._remoteDescription } }), i.prototype.onicecandidate = null, i.prototype.onaddstream = null, i.prototype.ontrack = null, i.prototype.onremovestream = null, i.prototype.onsignalingstatechange = null, i.prototype.oniceconnectionstatechange = null, i.prototype.onconnectionstatechange = null, i.prototype.onicegatheringstatechange = null, i.prototype.onnegotiationneeded = null, i.prototype.ondatachannel = null, i.prototype._dispatchEvent = function(e, t) { this._isClosed || (this.dispatchEvent(t), "function" == typeof this["on" + e] && this["on" + e](t)) } , i.prototype._emitGatheringStateChange = function() { var e = new Event("icegatheringstatechange"); this._dispatchEvent("icegatheringstatechange", e) } , i.prototype.getConfiguration = function() { return this._config } , i.prototype.getLocalStreams = function() { return this.localStreams } , i.prototype.getRemoteStreams = function() { return this.remoteStreams } , i.prototype._createTransceiver = function(e, t) { var n = 0 < this.transceivers.length , e = { track: null, iceGatherer: null, iceTransport: null, dtlsTransport: null, localCapabilities: null, remoteCapabilities: null, rtpSender: null, rtpReceiver: null, kind: e, mid: null, sendEncodingParameters: null, recvEncodingParameters: null, stream: null, associatedRemoteMediaStreams: [], wantReceive: !0 }; return this.usingBundle && n ? (e.iceTransport = this.transceivers[0].iceTransport, e.dtlsTransport = this.transceivers[0].dtlsTransport) : (n = this._createIceAndDtlsTransports(), e.iceTransport = n.iceTransport, e.dtlsTransport = n.dtlsTransport), t || this.transceivers.push(e), e } , i.prototype.addTrack = function(t, e) { if (this._isClosed) throw makeError("InvalidStateError", "Attempted to call addTrack on a closed peerconnection."); var n; if (this.transceivers.find(function(e) { return e.track === t })) throw makeError("InvalidAccessError", "Track already exists."); for (var i = 0; i < this.transceivers.length; i++) this.transceivers[i].track || this.transceivers[i].kind !== t.kind || (n = this.transceivers[i]); return n = n || this._createTransceiver(t.kind), this._maybeFireNegotiationNeeded(), -1 === this.localStreams.indexOf(e) && this.localStreams.push(e), n.track = t, n.stream = e, n.rtpSender = new R.RTCRtpSender(t,n.dtlsTransport), n.rtpSender } , i.prototype.addStream = function(t) { var i, n = this; 15025 <= x ? t.getTracks().forEach(function(e) { n.addTrack(e, t) }) : (i = t.clone(), t.getTracks().forEach(function(e, t) { var n = i.getTracks()[t]; e.addEventListener("enabled", function(e) { n.enabled = e.enabled }) }), i.getTracks().forEach(function(e) { n.addTrack(e, i) })) } , i.prototype.removeTrack = function(t) { if (this._isClosed) throw makeError("InvalidStateError", "Attempted to call removeTrack on a closed peerconnection."); if (!(t instanceof R.RTCRtpSender)) throw new TypeError("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender."); var e = this.transceivers.find(function(e) { return e.rtpSender === t }); if (!e) throw makeError("InvalidAccessError", "Sender was not created by this connection."); var n = e.stream; e.rtpSender.stop(), e.rtpSender = null, e.track = null, e.stream = null, -1 === this.transceivers.map(function(e) { return e.stream }).indexOf(n) && -1 < this.localStreams.indexOf(n) && this.localStreams.splice(this.localStreams.indexOf(n), 1), this._maybeFireNegotiationNeeded() } , i.prototype.removeStream = function(e) { var n = this; e.getTracks().forEach(function(t) { var e = n.getSenders().find(function(e) { return e.track === t }); e && n.removeTrack(e) }) } , i.prototype.getSenders = function() { return this.transceivers.filter(function(e) { return !!e.rtpSender }).map(function(e) { return e.rtpSender }) } , i.prototype.getReceivers = function() { return this.transceivers.filter(function(e) { return !!e.rtpReceiver }).map(function(e) { return e.rtpReceiver }) } , i.prototype._createIceGatherer = function(n, e) { var i, o = this; return e && 0 < n ? this.transceivers[0].iceGatherer : this._iceGatherers.length ? this._iceGatherers.shift() : (i = new R.RTCIceGatherer({ iceServers: this._config.iceServers, gatherPolicy: this._config.iceTransportPolicy }), Object.defineProperty(i, "state", { value: "new", writable: !0 }), this.transceivers[n].bufferedCandidateEvents = [], this.transceivers[n].bufferCandidates = function(e) { var t = !e.candidate || 0 === Object.keys(e.candidate).length; i.state = t ? "completed" : "gathering", null !== o.transceivers[n].bufferedCandidateEvents && o.transceivers[n].bufferedCandidateEvents.push(e) } , i.addEventListener("localcandidate", this.transceivers[n].bufferCandidates), i) } , i.prototype._gather = function(i, o) { var e, r = this, s = this.transceivers[o].iceGatherer; s.onlocalcandidate || (e = this.transceivers[o].bufferedCandidateEvents, this.transceivers[o].bufferedCandidateEvents = null, s.removeEventListener("localcandidate", this.transceivers[o].bufferCandidates), s.onlocalcandidate = function(e) { var t, n; r.usingBundle && 0 < o || ((t = new Event("icecandidate")).candidate = { sdpMid: i, sdpMLineIndex: o }, (n = !(e = e.candidate) || 0 === Object.keys(e).length) ? "new" !== s.state && "gathering" !== s.state || (s.state = "completed") : ("new" === s.state && (s.state = "gathering"), e.component = 1, e.ufrag = s.getLocalParameters().usernameFragment, e = sdp.writeCandidate(e), t.candidate = Object.assign(t.candidate, sdp.parseCandidate(e)), t.candidate.candidate = e, t.candidate.toJSON = function() { return { candidate: t.candidate.candidate, sdpMid: t.candidate.sdpMid, sdpMLineIndex: t.candidate.sdpMLineIndex, usernameFragment: t.candidate.usernameFragment } } ), (e = sdp.getMediaSections(r._localDescription.sdp))[t.candidate.sdpMLineIndex] += n ? "a=end-of-candidates\r\n" : "a=" + t.candidate.candidate + "\r\n", r._localDescription.sdp = sdp.getDescription(r._localDescription.sdp) + e.join(""), e = r.transceivers.every(function(e) { return e.iceGatherer && "completed" === e.iceGatherer.state }), "gathering" !== r.iceGatheringState && (r.iceGatheringState = "gathering", r._emitGatheringStateChange()), n || r._dispatchEvent("icecandidate", t), e && (r._dispatchEvent("icecandidate", new Event("icecandidate")), r.iceGatheringState = "complete", r._emitGatheringStateChange())) } , R.setTimeout(function() { e.forEach(function(e) { s.onlocalcandidate(e) }) }, 0)) } , i.prototype._createIceAndDtlsTransports = function() { var e = this , t = new R.RTCIceTransport(null) , n = (t.onicestatechange = function() { e._updateIceConnectionState(), e._updateConnectionState() } , new R.RTCDtlsTransport(t)); return n.ondtlsstatechange = function() { e._updateConnectionState() } , n.onerror = function() { Object.defineProperty(n, "state", { value: "failed", writable: !0 }), e._updateConnectionState() } , { iceTransport: t, dtlsTransport: n } } , i.prototype._disposeIceAndDtlsTransports = function(e) { var t = this.transceivers[e].iceGatherer , t = (t && (delete t.onlocalcandidate, delete this.transceivers[e].iceGatherer), this.transceivers[e].iceTransport) , t = (t && (delete t.onicestatechange, delete this.transceivers[e].iceTransport), this.transceivers[e].dtlsTransport); t && (delete t.ondtlsstatechange, delete t.onerror, delete this.transceivers[e].dtlsTransport) } , i.prototype._transceive = function(e, t, n) { var i = getCommonCapabilities(e.localCapabilities, e.remoteCapabilities); t && e.rtpSender && (i.encodings = e.sendEncodingParameters, i.rtcp = { cname: sdp.localCName, compound: e.rtcpParameters.compound }, e.recvEncodingParameters.length && (i.rtcp.ssrc = e.recvEncodingParameters[0].ssrc), e.rtpSender.send(i)), n && e.rtpReceiver && 0 < i.codecs.length && ("video" === e.kind && e.recvEncodingParameters && x < 15019 && e.recvEncodingParameters.forEach(function(e) { delete e.rtx }), e.recvEncodingParameters.length ? i.encodings = e.recvEncodingParameters : i.encodings = [{}], i.rtcp = { compound: e.rtcpParameters.compound }, e.rtcpParameters.cname && (i.rtcp.cname = e.rtcpParameters.cname), e.sendEncodingParameters.length && (i.rtcp.ssrc = e.sendEncodingParameters[0].ssrc), e.rtpReceiver.receive(i)) } , i.prototype.setLocalDescription = function(e) { var t, l, d, p = this; return -1 === ["offer", "answer"].indexOf(e.type) ? Promise.reject(makeError("TypeError", 'Unsupported type "' + e.type + '"')) : !isActionAllowedInSignalingState("setLocalDescription", e.type, p.signalingState) || p._isClosed ? Promise.reject(makeError("InvalidStateError", "Can not set local " + e.type + " in state " + p.signalingState)) : ("offer" === e.type ? (t = sdp.splitSections(e.sdp), l = t.shift(), t.forEach(function(e, t) { e = sdp.parseRtpParameters(e); p.transceivers[t].localCapabilities = e }), p.transceivers.forEach(function(e, t) { p._gather(e.mid, t) })) : "answer" === e.type && (l = (t = sdp.splitSections(p._remoteDescription.sdp)).shift(), d = 0 < sdp.matchPrefix(l, "a=ice-lite").length, t.forEach(function(e, t) { var n, i = p.transceivers[t], o = i.iceGatherer, r = i.iceTransport, s = i.dtlsTransport, a = i.localCapabilities, c = i.remoteCapabilities; sdp.isRejected(e) && 0 === sdp.matchPrefix(e, "a=bundle-only").length || i.rejected || (n = sdp.getIceParameters(e, l), e = sdp.getDtlsParameters(e, l), d && (e.role = "server"), p.usingBundle && 0 !== t || (p._gather(i.mid, t), "new" === r.state && r.start(o, n, d ? "controlling" : "controlled"), "new" === s.state && s.start(e)), t = getCommonCapabilities(a, c), p._transceive(i, 0 < t.codecs.length, !1)) })), p._localDescription = { type: e.type, sdp: e.sdp }, "offer" === e.type ? p._updateSignalingState("have-local-offer") : p._updateSignalingState("stable"), Promise.resolve()) } , i.prototype.setRemoteDescription = function(b) { var k, C, e, w, T, E, t, I = this; return -1 === ["offer", "answer"].indexOf(b.type) ? Promise.reject(makeError("TypeError", 'Unsupported type "' + b.type + '"')) : !isActionAllowedInSignalingState("setRemoteDescription", b.type, I.signalingState) || I._isClosed ? Promise.reject(makeError("InvalidStateError", "Can not set remote " + b.type + " in state " + I.signalingState)) : (k = {}, I.remoteStreams.forEach(function(e) { k[e.id] = e }), C = [], e = sdp.splitSections(b.sdp), w = e.shift(), T = 0 < sdp.matchPrefix(w, "a=ice-lite").length, E = 0 < sdp.matchPrefix(w, "a=group:BUNDLE ").length, I.usingBundle = E, t = sdp.matchPrefix(w, "a=ice-options:")[0], I.canTrickleIceCandidates = !!t && 0 <= t.substr(14).split(" ").indexOf("trickle"), e.forEach(function(e, t) { var n, i, o, r, s, a, c, l, d, p, u, h, f, m = sdp.splitLines(e), y = sdp.getKind(e), g = sdp.isRejected(e) && 0 === sdp.matchPrefix(e, "a=bundle-only").length, m = m[0].substr(2).split(" ")[2], _ = sdp.getDirection(e, w), v = sdp.parseMsid(e), S = sdp.getMid(e) || sdp.generateIdentifier(); g || "application" === y && ("DTLS/SCTP" === m || "UDP/DTLS/SCTP" === m) ? I.transceivers[t] = { mid: S, kind: y, protocol: m, rejected: !0 } : (!g && I.transceivers[t] && I.transceivers[t].rejected && (I.transceivers[t] = I._createTransceiver(y, !0)), m = sdp.parseRtpParameters(e), g || (r = sdp.getIceParameters(e, w), (s = sdp.getDtlsParameters(e, w)).role = "client"), i = sdp.parseRtpEncodingParameters(e), a = sdp.parseRtcpParameters(e), c = 0 < sdp.matchPrefix(e, "a=end-of-candidates", w).length, e = sdp.matchPrefix(e, "a=candidate:").map(function(e) { return sdp.parseCandidate(e) }).filter(function(e) { return 1 === e.component }), ("offer" === b.type || "answer" === b.type) && !g && E && 0 < t && I.transceivers[t] && (I._disposeIceAndDtlsTransports(t), I.transceivers[t].iceGatherer = I.transceivers[0].iceGatherer, I.transceivers[t].iceTransport = I.transceivers[0].iceTransport, I.transceivers[t].dtlsTransport = I.transceivers[0].dtlsTransport, I.transceivers[t].rtpSender && I.transceivers[t].rtpSender.setTransport(I.transceivers[0].dtlsTransport), I.transceivers[t].rtpReceiver) && I.transceivers[t].rtpReceiver.setTransport(I.transceivers[0].dtlsTransport), "offer" !== b.type || g ? "answer" !== b.type || g || (g = (n = I.transceivers[t]).iceGatherer, h = n.iceTransport, l = n.dtlsTransport, f = n.rtpReceiver, d = n.sendEncodingParameters, o = n.localCapabilities, I.transceivers[t].recvEncodingParameters = i, I.transceivers[t].remoteCapabilities = m, I.transceivers[t].rtcpParameters = a, e.length && "new" === h.state && (!T && !c || E && 0 !== t ? e.forEach(function(e) { maybeAddCandidate(n.iceTransport, e) }) : h.setRemoteCandidates(e)), E && 0 !== t || ("new" === h.state && h.start(g, r, "controlling"), "new" === l.state && l.start(s)), !getCommonCapabilities(n.localCapabilities, n.remoteCapabilities).codecs.filter(function(e) { return "rtx" === e.name.toLowerCase() }).length && n.sendEncodingParameters[0].rtx && delete n.sendEncodingParameters[0].rtx, I._transceive(n, "sendrecv" === _ || "recvonly" === _, "sendrecv" === _ || "sendonly" === _), !f || "sendrecv" !== _ && "sendonly" !== _ ? delete n.rtpReceiver : (u = f.track, v ? (k[v.stream] || (k[v.stream] = new R.MediaStream), P(u, k[v.stream]), C.push([u, f, k[v.stream]])) : (k.default || (k.default = new R.MediaStream), P(u, k.default), C.push([u, f, k.default])))) : ((n = I.transceivers[t] || I._createTransceiver(y)).mid = S, n.iceGatherer || (n.iceGatherer = I._createIceGatherer(t, E)), e.length && "new" === n.iceTransport.state && (!c || E && 0 !== t ? e.forEach(function(e) { maybeAddCandidate(n.iceTransport, e) }) : n.iceTransport.setRemoteCandidates(e)), o = R.RTCRtpReceiver.getCapabilities(y), x < 15019 && (o.codecs = o.codecs.filter(function(e) { return "rtx" !== e.name })), d = n.sendEncodingParameters || [{ ssrc: 1001 * (2 * t + 2) }], h = !1, "sendrecv" === _ || "sendonly" === _ ? (h = !n.rtpReceiver, f = n.rtpReceiver || new R.RTCRtpReceiver(n.dtlsTransport,y), h && (u = f.track, (p = v && "-" === v.stream ? p : v ? (k[v.stream] || (k[v.stream] = new R.MediaStream, Object.defineProperty(k[v.stream], "id", { get: function() { return v.stream } })), Object.defineProperty(u, "id", { get: function() { return v.track } }), k[v.stream]) : (k.default || (k.default = new R.MediaStream), k.default)) && (P(u, p), n.associatedRemoteMediaStreams.push(p)), C.push([u, f, p]))) : n.rtpReceiver && n.rtpReceiver.track && (n.associatedRemoteMediaStreams.forEach(function(e) { var t = e.getTracks().find(function(e) { return e.id === n.rtpReceiver.track.id }); t && (t = t, (e = e).removeTrack(t), e.dispatchEvent(new R.MediaStreamTrackEvent("removetrack",{ track: t }))) }), n.associatedRemoteMediaStreams = []), n.localCapabilities = o, n.remoteCapabilities = m, n.rtpReceiver = f, n.rtcpParameters = a, n.sendEncodingParameters = d, n.recvEncodingParameters = i, I._transceive(I.transceivers[t], !1, h))) }), void 0 === I._dtlsRole && (I._dtlsRole = "offer" === b.type ? "active" : "passive"), I._remoteDescription = { type: b.type, sdp: b.sdp }, "offer" === b.type ? I._updateSignalingState("have-remote-offer") : I._updateSignalingState("stable"), Object.keys(k).forEach(function(e) { var t, i = k[e]; i.getTracks().length && (-1 === I.remoteStreams.indexOf(i) && (I.remoteStreams.push(i), (t = new Event("addstream")).stream = i, R.setTimeout(function() { I._dispatchEvent("addstream", t) })), C.forEach(function(e) { var t = e[0] , n = e[1]; i.id === e[2].id && o(I, t, n, [i]) })) }), C.forEach(function(e) { e[2] || o(I, e[0], e[1], []) }), R.setTimeout(function() { I && I.transceivers && I.transceivers.forEach(function(e) { e.iceTransport && "new" === e.iceTransport.state && 0 < e.iceTransport.getRemoteCandidates().length && e.iceTransport.addRemoteCandidate({}) }) }, 4e3), Promise.resolve()) } , i.prototype.close = function() { this.transceivers.forEach(function(e) { e.iceTransport && e.iceTransport.stop(), e.dtlsTransport && e.dtlsTransport.stop(), e.rtpSender && e.rtpSender.stop(), e.rtpReceiver && e.rtpReceiver.stop() }), this._isClosed = !0, this._updateSignalingState("closed") } , i.prototype._updateSignalingState = function(e) { this.signalingState = e; e = new Event("signalingstatechange"); this._dispatchEvent("signalingstatechange", e) } , i.prototype._maybeFireNegotiationNeeded = function() { var t = this; "stable" === this.signalingState && !0 !== this.needNegotiation && (this.needNegotiation = !0, R.setTimeout(function() { var e; t.needNegotiation && (t.needNegotiation = !1, e = new Event("negotiationneeded"), t._dispatchEvent("negotiationneeded", e)) }, 0)) } , i.prototype._updateIceConnectionState = function() { var e, t = { new: 0, closed: 0, checking: 0, connected: 0, completed: 0, disconnected: 0, failed: 0 }; this.transceivers.forEach(function(e) { e.iceTransport && !e.rejected && t[e.iceTransport.state]++ }), e = "new", 0 < t.failed ? e = "failed" : 0 < t.checking ? e = "checking" : 0 < t.disconnected ? e = "disconnected" : 0 < t.new ? e = "new" : 0 < t.connected ? e = "connected" : 0 < t.completed && (e = "completed"), e !== this.iceConnectionState && (this.iceConnectionState = e, e = new Event("iceconnectionstatechange"), this._dispatchEvent("iceconnectionstatechange", e)) } , i.prototype._updateConnectionState = function() { var e, t = { new: 0, closed: 0, connecting: 0, connected: 0, completed: 0, disconnected: 0, failed: 0 }; this.transceivers.forEach(function(e) { e.iceTransport && e.dtlsTransport && !e.rejected && (t[e.iceTransport.state]++, t[e.dtlsTransport.state]++) }), t.connected += t.completed, e = "new", 0 < t.failed ? e = "failed" : 0 < t.connecting ? e = "connecting" : 0 < t.disconnected ? e = "disconnected" : 0 < t.new ? e = "new" : 0 < t.connected && (e = "connected"), e !== this.connectionState && (this.connectionState = e, e = new Event("connectionstatechange"), this._dispatchEvent("connectionstatechange", e)) } , i.prototype.createOffer = function() { var r = this; if (r._isClosed) return Promise.reject(makeError("InvalidStateError", "Can not call createOffer after close")); var t = r.transceivers.filter(function(e) { return "audio" === e.kind }).length , n = r.transceivers.filter(function(e) { return "video" === e.kind }).length , e = arguments[0]; if (e) { if (e.mandatory || e.optional) throw new TypeError("Legacy mandatory/optional constraints not supported."); void 0 !== e.offerToReceiveAudio && (t = !0 === e.offerToReceiveAudio ? 1 : !1 === e.offerToReceiveAudio ? 0 : e.offerToReceiveAudio), void 0 !== e.offerToReceiveVideo && (n = !0 === e.offerToReceiveVideo ? 1 : !1 === e.offerToReceiveVideo ? 0 : e.offerToReceiveVideo) } for (r.transceivers.forEach(function(e) { "audio" === e.kind ? --t < 0 && (e.wantReceive = !1) : "video" === e.kind && --n < 0 && (e.wantReceive = !1) }); 0 < t || 0 < n; ) 0 < t && (r._createTransceiver("audio"), t--), 0 < n && (r._createTransceiver("video"), n--); var i = sdp.writeSessionBoilerplate(r._sdpSessionId, r._sdpSessionVersion++) , e = (r.transceivers.forEach(function(e, t) { var n = e.track , i = e.kind , o = e.mid || sdp.generateIdentifier() , o = (e.mid = o, e.iceGatherer || (e.iceGatherer = r._createIceGatherer(t, r.usingBundle)), R.RTCRtpSender.getCapabilities(i)) , t = (x < 15019 && (o.codecs = o.codecs.filter(function(e) { return "rtx" !== e.name })), o.codecs.forEach(function(t) { "H264" === t.name && void 0 === t.parameters["level-asymmetry-allowed"] && (t.parameters["level-asymmetry-allowed"] = "1"), e.remoteCapabilities && e.remoteCapabilities.codecs && e.remoteCapabilities.codecs.forEach(function(e) { t.name.toLowerCase() === e.name.toLowerCase() && t.clockRate === e.clockRate && (t.preferredPayloadType = e.payloadType) }) }), o.headerExtensions.forEach(function(t) { (e.remoteCapabilities && e.remoteCapabilities.headerExtensions || []).forEach(function(e) { t.uri === e.uri && (t.id = e.id) }) }), e.sendEncodingParameters || [{ ssrc: 1001 * (2 * t + 1) }]); n && 15019 <= x && "video" === i && !t[0].rtx && (t[0].rtx = { ssrc: t[0].ssrc + 1 }), e.wantReceive && (e.rtpReceiver = new R.RTCRtpReceiver(e.dtlsTransport,i)), e.localCapabilities = o, e.sendEncodingParameters = t }), "max-compat" !== r._config.bundlePolicy && (i += "a=group:BUNDLE " + r.transceivers.map(function(e) { return e.mid }).join(" ") + "\r\n"), i += "a=ice-options:trickle\r\n", r.transceivers.forEach(function(e, t) { i = i + writeMediaSection(e, e.localCapabilities, "offer", e.stream, r._dtlsRole) + "a=rtcp-rsize\r\n", !e.iceGatherer || "new" === r.iceGatheringState || 0 !== t && r.usingBundle || (e.iceGatherer.getLocalCandidates().forEach(function(e) { e.component = 1, i += "a=" + sdp.writeCandidate(e) + "\r\n" }), "completed" === e.iceGatherer.state && (i += "a=end-of-candidates\r\n")) }), new R.RTCSessionDescription({ type: "offer", sdp: i })); return Promise.resolve(e) } , i.prototype.createAnswer = function() { var i, o, e, r = this; return r._isClosed ? Promise.reject(makeError("InvalidStateError", "Can not call createAnswer after close")) : "have-remote-offer" !== r.signalingState && "have-local-pranswer" !== r.signalingState ? Promise.reject(makeError("InvalidStateError", "Can not call createAnswer in signalingState " + r.signalingState)) : (i = sdp.writeSessionBoilerplate(r._sdpSessionId, r._sdpSessionVersion++), r.usingBundle && (i += "a=group:BUNDLE " + r.transceivers.map(function(e) { return e.mid }).join(" ") + "\r\n"), i += "a=ice-options:trickle\r\n", o = sdp.getMediaSections(r._remoteDescription.sdp).length, r.transceivers.forEach(function(e, t) { var n; o < t + 1 || (e.rejected ? ("application" === e.kind ? "DTLS/SCTP" === e.protocol ? i += "m=application 0 DTLS/SCTP 5000\r\n" : i += "m=application 0 " + e.protocol + " webrtc-datachannel\r\n" : "audio" === e.kind ? i += "m=audio 0 UDP/TLS/RTP/SAVPF 0\r\na=rtpmap:0 PCMU/8000\r\n" : "video" === e.kind && (i += "m=video 0 UDP/TLS/RTP/SAVPF 120\r\na=rtpmap:120 VP8/90000\r\n"), i += "c=IN IP4 0.0.0.0\r\na=inactive\r\na=mid:" + e.mid + "\r\n") : (e.stream && ("audio" === e.kind ? n = e.stream.getAudioTracks()[0] : "video" === e.kind && (n = e.stream.getVideoTracks()[0]), n) && 15019 <= x && "video" === e.kind && !e.sendEncodingParameters[0].rtx && (e.sendEncodingParameters[0].rtx = { ssrc: e.sendEncodingParameters[0].ssrc + 1 }), !(t = getCommonCapabilities(e.localCapabilities, e.remoteCapabilities)).codecs.filter(function(e) { return "rtx" === e.name.toLowerCase() }).length && e.sendEncodingParameters[0].rtx && delete e.sendEncodingParameters[0].rtx, i += writeMediaSection(e, t, "answer", e.stream, r._dtlsRole), e.rtcpParameters && e.rtcpParameters.reducedSize && (i += "a=rtcp-rsize\r\n"))) }), e = new R.RTCSessionDescription({ type: "answer", sdp: i }), Promise.resolve(e)) } , i.prototype.addIceCandidate = function(a) { var c, l = this; return a && void 0 === a.sdpMLineIndex && !a.sdpMid ? Promise.reject(new TypeError("sdpMLineIndex or sdpMid required")) : new Promise(function(e, t) { if (!l._remoteDescription) return t(makeError("InvalidStateError", "Can not add ICE candidate without a remote description")); if (a && "" !== a.candidate) { var n = a.sdpMLineIndex; if (a.sdpMid) for (var i = 0; i < l.transceivers.length; i++) if (l.transceivers[i].mid === a.sdpMid) { n = i; break } var o = l.transceivers[n]; if (!o) return t(makeError("OperationError", "Can not add ICE candidate")); if (o.rejected) return e(); var r = 0 < Object.keys(a.candidate).length ? sdp.parseCandidate(a.candidate) : {}; if ("tcp" === r.protocol && (0 === r.port || 9 === r.port)) return e(); if (r.component && 1 !== r.component) return e(); if ((0 === n || 0 < n && o.iceTransport !== l.transceivers[0].iceTransport) && !maybeAddCandidate(o.iceTransport, r)) return t(makeError("OperationError", "Can not add ICE candidate")); o = a.candidate.trim(); 0 === o.indexOf("a=") && (o = o.substr(2)), (c = sdp.getMediaSections(l._remoteDescription.sdp))[n] += "a=" + (r.type ? o : "end-of-candidates") + "\r\n", l._remoteDescription.sdp = sdp.getDescription(l._remoteDescription.sdp) + c.join("") } else for (var s = 0; s < l.transceivers.length && (l.transceivers[s].rejected || (l.transceivers[s].iceTransport.addRemoteCandidate({}), (c = sdp.getMediaSections(l._remoteDescription.sdp))[s] += "a=end-of-candidates\r\n", l._remoteDescription.sdp = sdp.getDescription(l._remoteDescription.sdp) + c.join(""), !l.usingBundle)); s++) ; e() } ) } , i.prototype.getStats = function(t) { if (t && t instanceof R.MediaStreamTrack) { var n = null; if (this.transceivers.forEach(function(e) { e.rtpSender && e.rtpSender.track === t ? n = e.rtpSender : e.rtpReceiver && e.rtpReceiver.track === t && (n = e.rtpReceiver) }), n) return n.getStats(); throw makeError("InvalidAccessError", "Invalid selector.") } var i = []; return this.transceivers.forEach(function(t) { ["rtpSender", "rtpReceiver", "iceGatherer", "iceTransport", "dtlsTransport"].forEach(function(e) { t[e] && i.push(t[e].getStats()) }) }), Promise.all(i).then(function(e) { var t = new Map; return e.forEach(function(e) { e.forEach(function(e) { t.set(e.id, e) }) }), t }) } ; ["RTCRtpSender", "RTCRtpReceiver", "RTCIceGatherer", "RTCIceTransport", "RTCDtlsTransport"].forEach(function(e) { var t, e = R[e]; e && e.prototype && e.prototype.getStats && (t = e.prototype.getStats, e.prototype.getStats = function() { return t.apply(this).then(function(t) { var n = new Map; return Object.keys(t).forEach(function(e) { t[e].type = fixStatsType(t[e]), n.set(e, t[e]) }), n }) } ) }); var e = ["createOffer", "createAnswer"]; return e.forEach(function(e) { var n = i.prototype[e]; i.prototype[e] = function() { var t = arguments; return "function" == typeof t[0] || "function" == typeof t[1] ? n.apply(this, [arguments[2]]).then(function(e) { "function" == typeof t[0] && t[0].apply(null, [e]) }, function(e) { "function" == typeof t[1] && t[1].apply(null, [e]) }) : n.apply(this, arguments) } }), (e = ["setLocalDescription", "setRemoteDescription", "addIceCandidate"]).forEach(function(e) { var n = i.prototype[e]; i.prototype[e] = function() { var t = arguments; return "function" == typeof t[1] || "function" == typeof t[2] ? n.apply(this, arguments).then(function() { "function" == typeof t[1] && t[1].apply(null) }, function(e) { "function" == typeof t[2] && t[2].apply(null, [e]) }) : n.apply(this, arguments) } }), ["getStats"].forEach(function(e) { var t = i.prototype[e]; i.prototype[e] = function() { var e = arguments; return "function" == typeof e[1] ? t.apply(this, arguments).then(function() { "function" == typeof e[1] && e[1].apply(null) }) : t.apply(this, arguments) } }), i }; function shimGetUserMedia$2(e) { var e = e && e.navigator , t = e.mediaDevices.getUserMedia.bind(e.mediaDevices); e.mediaDevices.getUserMedia = function(e) { return t(e).catch(function(e) { return Promise.reject({ name: { PermissionDeniedError: "NotAllowedError" }[(e = e).name] || e.name, message: e.message, constraint: e.constraint, toString: function() { return this.name } }) }) } } function shimGetDisplayMedia$1(e) { "getDisplayMedia"in e.navigator && (!e.navigator.mediaDevices || e.navigator.mediaDevices && "getDisplayMedia"in e.navigator.mediaDevices || (e.navigator.mediaDevices.getDisplayMedia = e.navigator.getDisplayMedia.bind(e.navigator))) } function shimPeerConnection$1(e, t) { e.RTCIceGatherer && (e.RTCIceCandidate || (e.RTCIceCandidate = function(e) { return e } ), e.RTCSessionDescription || (e.RTCSessionDescription = function(e) { return e } ), t.version < 15025) && (n = Object.getOwnPropertyDescriptor(e.MediaStreamTrack.prototype, "enabled"), Object.defineProperty(e.MediaStreamTrack.prototype, "enabled", { set: function(e) { n.set.call(this, e); var t = new Event("enabled"); t.enabled = e, this.dispatchEvent(t) } })), !e.RTCRtpSender || "dtmf"in e.RTCRtpSender.prototype || Object.defineProperty(e.RTCRtpSender.prototype, "dtmf", { get: function() { return void 0 === this._dtmf && ("audio" === this.track.kind ? this._dtmf = new e.RTCDtmfSender(this) : "video" === this.track.kind && (this._dtmf = null)), this._dtmf } }), e.RTCDtmfSender && !e.RTCDTMFSender && (e.RTCDTMFSender = e.RTCDtmfSender); var n, i = rtcpeerconnection(e, t.version); e.RTCPeerConnection = function(e) { return e && e.iceServers && (e.iceServers = filterIceServers$1(e.iceServers, t.version), log("ICE servers after filtering:", e.iceServers)), new i(e) } , e.RTCPeerConnection.prototype = i.prototype } function shimReplaceTrack(e) { !e.RTCRtpSender || "replaceTrack"in e.RTCRtpSender.prototype || (e.RTCRtpSender.prototype.replaceTrack = e.RTCRtpSender.prototype.setTrack) } var edgeShim = Object.freeze({ __proto__: null, shimPeerConnection: shimPeerConnection$1, shimReplaceTrack: shimReplaceTrack, shimGetUserMedia: shimGetUserMedia$2, shimGetDisplayMedia: shimGetDisplayMedia$1 }); function shimGetUserMedia$1(e, t) { var n, i, o, r, s = e && e.navigator, e = e && e.MediaStreamTrack; s.getUserMedia = function(e, t, n) { deprecated("navigator.getUserMedia", "navigator.mediaDevices.getUserMedia"), s.mediaDevices.getUserMedia(e).then(t, n) } , 55 < t.version && "autoGainControl"in s.mediaDevices.getSupportedConstraints() || (n = function(e, t, n) { t in e && !(n in e) && (e[n] = e[t], delete e[t]) } , i = s.mediaDevices.getUserMedia.bind(s.mediaDevices), s.mediaDevices.getUserMedia = function(e) { return "object" === _typeof(e) && "object" === _typeof(e.audio) && (e = JSON.parse(JSON.stringify(e)), n(e.audio, "autoGainControl", "mozAutoGainControl"), n(e.audio, "noiseSuppression", "mozNoiseSuppression")), i(e) } , e && e.prototype.getSettings && (o = e.prototype.getSettings, e.prototype.getSettings = function() { var e = o.apply(this, arguments); return n(e, "mozAutoGainControl", "autoGainControl"), n(e, "mozNoiseSuppression", "noiseSuppression"), e } ), e && e.prototype.applyConstraints && (r = e.prototype.applyConstraints, e.prototype.applyConstraints = function(e) { return "audio" === this.kind && "object" === _typeof(e) && (e = JSON.parse(JSON.stringify(e)), n(e, "autoGainControl", "mozAutoGainControl"), n(e, "noiseSuppression", "mozNoiseSuppression")), r.apply(this, [e]) } )) } function shimGetDisplayMedia(t, n) { t.navigator.mediaDevices && "getDisplayMedia"in t.navigator.mediaDevices || t.navigator.mediaDevices && (t.navigator.mediaDevices.getDisplayMedia = function(e) { return e && e.video ? (!0 === e.video ? e.video = { mediaSource: n } : e.video.mediaSource = n, t.navigator.mediaDevices.getUserMedia(e)) : ((e = new DOMException("getDisplayMedia without video constraints is undefined")).name = "NotFoundError", e.code = 8, Promise.reject(e)) } ) } function shimOnTrack(e) { "object" === _typeof(e) && e.RTCTrackEvent && "receiver"in e.RTCTrackEvent.prototype && !("transceiver"in e.RTCTrackEvent.prototype) && Object.defineProperty(e.RTCTrackEvent.prototype, "transceiver", { get: function() { return { receiver: this.receiver } } }) } function shimPeerConnection(i, o) { var r, n; "object" === _typeof(i) && (i.RTCPeerConnection || i.mozRTCPeerConnection) && (!i.RTCPeerConnection && i.mozRTCPeerConnection && (i.RTCPeerConnection = i.mozRTCPeerConnection), o.version < 53 && ["setLocalDescription", "setRemoteDescription", "addIceCandidate"].forEach(function(e) { var t = i.RTCPeerConnection.prototype[e] , n = _defineProperty({}, e, function() { return arguments[0] = new ("addIceCandidate" === e ? i.RTCIceCandidate : i.RTCSessionDescription)(arguments[0]), t.apply(this, arguments) }); i.RTCPeerConnection.prototype[e] = n[e] }), r = { inboundrtp: "inbound-rtp", outboundrtp: "outbound-rtp", candidatepair: "candidate-pair", localcandidate: "local-candidate", remotecandidate: "remote-candidate" }, n = i.RTCPeerConnection.prototype.getStats, i.RTCPeerConnection.prototype.getStats = function() { var e = Array.prototype.slice.call(arguments) , t = e[0] , i = e[1] , e = e[2]; return n.apply(this, [t || null]).then(function(n) { if (o.version < 53 && !i) try { n.forEach(function(e) { e.type = r[e.type] || e.type }) } catch (e) { if ("TypeError" !== e.name) throw e; n.forEach(function(e, t) { n.set(t, Object.assign({}, e, { type: r[e.type] || e.type })) }) } return n }).then(i, e) } ) } function shimSenderGetStats(e) { var n, t; "object" === _typeof(e) && e.RTCPeerConnection && e.RTCRtpSender && (e.RTCRtpSender && "getStats"in e.RTCRtpSender.prototype || ((n = e.RTCPeerConnection.prototype.getSenders) && (e.RTCPeerConnection.prototype.getSenders = function() { var t = this , e = n.apply(this, []); return e.forEach(function(e) { return e._pc = t }), e } ), (t = e.RTCPeerConnection.prototype.addTrack) && (e.RTCPeerConnection.prototype.addTrack = function() { var e = t.apply(this, arguments); return e._pc = this, e } ), e.RTCRtpSender.prototype.getStats = function() { return this.track ? this._pc.getStats(this.track) : Promise.resolve(new Map) } )) } function shimReceiverGetStats(e) { var n; "object" === _typeof(e) && e.RTCPeerConnection && e.RTCRtpSender && (e.RTCRtpSender && "getStats"in e.RTCRtpReceiver.prototype || ((n = e.RTCPeerConnection.prototype.getReceivers) && (e.RTCPeerConnection.prototype.getReceivers = function() { var t = this , e = n.apply(this, []); return e.forEach(function(e) { return e._pc = t }), e } ), wrapPeerConnectionEvent(e, "track", function(e) { return e.receiver._pc = e.srcElement, e }), e.RTCRtpReceiver.prototype.getStats = function() { return this._pc.getStats(this.track) } )) } function shimRemoveStream(e) { !e.RTCPeerConnection || "removeStream"in e.RTCPeerConnection.prototype || (e.RTCPeerConnection.prototype.removeStream = function(t) { var n = this; deprecated("removeStream", "removeTrack"), this.getSenders().forEach(function(e) { e.track && t.getTracks().includes(e.track) && n.removeTrack(e) }) } ) } function shimRTCDataChannel(e) { e.DataChannel && !e.RTCDataChannel && (e.RTCDataChannel = e.DataChannel) } function shimAddTransceiver(e) { var o; "object" === _typeof(e) && e.RTCPeerConnection && (o = e.RTCPeerConnection.prototype.addTransceiver) && (e.RTCPeerConnection.prototype.addTransceiver = function() { this.setParametersPromises = []; var e, t = arguments[1], n = t && "sendEncodings"in t, i = (n && t.sendEncodings.forEach(function(e) { if ("rid"in e) if (!/^[a-z0-9]{0,16}$/i.test(e.rid)) throw new TypeError("Invalid RID value provided."); if ("scaleResolutionDownBy"in e && !(1 <= parseFloat(e.scaleResolutionDownBy))) throw new RangeError("scale_resolution_down_by must be >= 1.0"); if ("maxFramerate"in e && !(0 <= parseFloat(e.maxFramerate))) throw new RangeError("max_framerate must be >= 0.0") }), o.apply(this, arguments)); return !n || "encodings"in (n = (e = i.sender).getParameters()) && (1 !== n.encodings.length || 0 !== Object.keys(n.encodings[0]).length) || (n.encodings = t.sendEncodings, e.sendEncodings = t.sendEncodings, this.setParametersPromises.push(e.setParameters(n).then(function() { delete e.sendEncodings }).catch(function() { delete e.sendEncodings }))), i } ) } function shimGetParameters(e) { var t; "object" === _typeof(e) && e.RTCRtpSender && (t = e.RTCRtpSender.prototype.getParameters) && (e.RTCRtpSender.prototype.getParameters = function() { var e = t.apply(this, arguments); return "encodings"in e || (e.encodings = [].concat(this.sendEncodings || [{}])), e } ) } function shimCreateOffer(e) { var n; "object" === _typeof(e) && e.RTCPeerConnection && (n = e.RTCPeerConnection.prototype.createOffer, e.RTCPeerConnection.prototype.createOffer = function() { var e = arguments , t = this; return this.setParametersPromises && this.setParametersPromises.length ? Promise.all(this.setParametersPromises).then(function() { return n.apply(t, e) }).finally(function() { t.setParametersPromises = [] }) : n.apply(this, arguments) } ) } function shimCreateAnswer(e) { var n; "object" === _typeof(e) && e.RTCPeerConnection && (n = e.RTCPeerConnection.prototype.createAnswer, e.RTCPeerConnection.prototype.createAnswer = function() { var e = arguments , t = this; return this.setParametersPromises && this.setParametersPromises.length ? Promise.all(this.setParametersPromises).then(function() { return n.apply(t, e) }).finally(function() { t.setParametersPromises = [] }) : n.apply(this, arguments) } ) } var firefoxShim = Object.freeze({ __proto__: null, shimOnTrack: shimOnTrack, shimPeerConnection: shimPeerConnection, shimSenderGetStats: shimSenderGetStats, shimReceiverGetStats: shimReceiverGetStats, shimRemoveStream: shimRemoveStream, shimRTCDataChannel: shimRTCDataChannel, shimAddTransceiver: shimAddTransceiver, shimGetParameters: shimGetParameters, shimCreateOffer: shimCreateOffer, shimCreateAnswer: shimCreateAnswer, shimGetUserMedia: shimGetUserMedia$1, shimGetDisplayMedia: shimGetDisplayMedia }); function shimLocalStreamsAPI(e) { var r; "object" === _typeof(e) && e.RTCPeerConnection && ("getLocalStreams"in e.RTCPeerConnection.prototype || (e.RTCPeerConnection.prototype.getLocalStreams = function() { return this._localStreams || (this._localStreams = []), this._localStreams } ), "addStream"in e.RTCPeerConnection.prototype || (r = e.RTCPeerConnection.prototype.addTrack, e.RTCPeerConnection.prototype.addStream = function(t) { var n = this; this._localStreams || (this._localStreams = []), this._localStreams.includes(t) || this._localStreams.push(t), t.getAudioTracks().forEach(function(e) { return r.call(n, e, t) }), t.getVideoTracks().forEach(function(e) { return r.call(n, e, t) }) } , e.RTCPeerConnection.prototype.addTrack = function(e) { for (var t = this, n = arguments.length, i = new Array(1 < n ? n - 1 : 0), o = 1; o < n; o++) i[o - 1] = arguments[o]; return i && i.forEach(function(e) { t._localStreams ? t._localStreams.includes(e) || t._localStreams.push(e) : t._localStreams = [e] }), r.apply(this, arguments) } ), "removeStream"in e.RTCPeerConnection.prototype || (e.RTCPeerConnection.prototype.removeStream = function(e) { var t, n = this, i = (this._localStreams || (this._localStreams = []), this._localStreams.indexOf(e)); -1 !== i && (this._localStreams.splice(i, 1), t = e.getTracks(), this.getSenders().forEach(function(e) { t.includes(e.track) && n.removeTrack(e) })) } )) } function shimRemoteStreamsAPI(e) { var t; "object" === _typeof(e) && e.RTCPeerConnection && ("getRemoteStreams"in e.RTCPeerConnection.prototype || (e.RTCPeerConnection.prototype.getRemoteStreams = function() { return this._remoteStreams || [] } ), "onaddstream"in e.RTCPeerConnection.prototype || (Object.defineProperty(e.RTCPeerConnection.prototype, "onaddstream", { get: function() { return this._onaddstream }, set: function(e) { var n = this; this._onaddstream && (this.removeEventListener("addstream", this._onaddstream), this.removeEventListener("track", this._onaddstreampoly)), this.addEventListener("addstream", this._onaddstream = e), this.addEventListener("track", this._onaddstreampoly = function(e) { e.streams.forEach(function(e) { var t; n._remoteStreams || (n._remoteStreams = []), n._remoteStreams.includes(e) || (n._remoteStreams.push(e), (t = new Event("addstream")).stream = e, n.dispatchEvent(t)) }) } ) } }), t = e.RTCPeerConnection.prototype.setRemoteDescription, e.RTCPeerConnection.prototype.setRemoteDescription = function() { var n = this; return this._onaddstreampoly || this.addEventListener("track", this._onaddstreampoly = function(e) { e.streams.forEach(function(e) { var t; n._remoteStreams || (n._remoteStreams = []), 0 <= n._remoteStreams.indexOf(e) || (n._remoteStreams.push(e), (t = new Event("addstream")).stream = e, n.dispatchEvent(t)) }) } ), t.apply(n, arguments) } )) } function shimCallbacksAPI(e) { var i, o, r, s, a; "object" === _typeof(e) && e.RTCPeerConnection && (e = e.RTCPeerConnection.prototype, i = e.createOffer, o = e.createAnswer, r = e.setLocalDescription, s = e.setRemoteDescription, a = e.addIceCandidate, e.createOffer = function(e, t) { var n = i.apply(this, [2 <= arguments.length ? arguments[2] : e]); return t ? (n.then(e, t), Promise.resolve()) : n } , e.createAnswer = function(e, t) { var n = o.apply(this, [2 <= arguments.length ? arguments[2] : e]); return t ? (n.then(e, t), Promise.resolve()) : n } , e.setLocalDescription = function(e, t, n) { e = r.apply(this, [e]); return n ? (e.then(t, n), Promise.resolve()) : e } , e.setRemoteDescription = function(e, t, n) { e = s.apply(this, [e]); return n ? (e.then(t, n), Promise.resolve()) : e } , e.addIceCandidate = function(e, t, n) { e = a.apply(this, [e]); return n ? (e.then(t, n), Promise.resolve()) : e } ) } function shimGetUserMedia(e) { var t, i = e && e.navigator; i.mediaDevices && i.mediaDevices.getUserMedia && (e = i.mediaDevices, t = e.getUserMedia.bind(e), i.mediaDevices.getUserMedia = function(e) { return t(shimConstraints(e)) } ), !i.getUserMedia && i.mediaDevices && i.mediaDevices.getUserMedia && (i.getUserMedia = function(e, t, n) { i.mediaDevices.getUserMedia(e).then(t, n) } .bind(i)) } function shimConstraints(e) { return e && void 0 !== e.video ? Object.assign({}, e, { video: compactObject(e.video) }) : e } function shimRTCIceServerUrls(e) { var r; e.RTCPeerConnection && (r = e.RTCPeerConnection, e.RTCPeerConnection = function(e, t) { if (e && e.iceServers) { for (var n = [], i = 0; i < e.iceServers.length; i++) { var o = e.iceServers[i]; !o.hasOwnProperty("urls") && o.hasOwnProperty("url") ? (deprecated("RTCIceServer.url", "RTCIceServer.urls"), (o = JSON.parse(JSON.stringify(o))).urls = o.url, delete o.url, n.push(o)) : n.push(e.iceServers[i]) } e.iceServers = n } return new r(e,t) } , e.RTCPeerConnection.prototype = r.prototype, "generateCertificate"in r) && Object.defineProperty(e.RTCPeerConnection, "generateCertificate", { get: function() { return r.generateCertificate } }) } function shimTrackEventTransceiver(e) { "object" === _typeof(e) && e.RTCTrackEvent && "receiver"in e.RTCTrackEvent.prototype && !("transceiver"in e.RTCTrackEvent.prototype) && Object.defineProperty(e.RTCTrackEvent.prototype, "transceiver", { get: function() { return { receiver: this.receiver } } }) } function shimCreateOfferLegacy(e) { var n = e.RTCPeerConnection.prototype.createOffer; e.RTCPeerConnection.prototype.createOffer = function(e) { var t; return e && (void 0 !== e.offerToReceiveAudio && (e.offerToReceiveAudio = !!e.offerToReceiveAudio), t = this.getTransceivers().find(function(e) { return "audio" === e.receiver.track.kind }), !1 === e.offerToReceiveAudio && t ? "sendrecv" === t.direction ? t.setDirection ? t.setDirection("sendonly") : t.direction = "sendonly" : "recvonly" === t.direction && (t.setDirection ? t.setDirection("inactive") : t.direction = "inactive") : !0 !== e.offerToReceiveAudio || t || this.addTransceiver("audio"), void 0 !== e.offerToReceiveVideo && (e.offerToReceiveVideo = !!e.offerToReceiveVideo), t = this.getTransceivers().find(function(e) { return "video" === e.receiver.track.kind }), !1 === e.offerToReceiveVideo && t ? "sendrecv" === t.direction ? t.setDirection ? t.setDirection("sendonly") : t.direction = "sendonly" : "recvonly" === t.direction && (t.setDirection ? t.setDirection("inactive") : t.direction = "inactive") : !0 !== e.offerToReceiveVideo || t || this.addTransceiver("video")), n.apply(this, arguments) } } function shimAudioContext(e) { "object" !== _typeof(e) || e.AudioContext || (e.AudioContext = e.webkitAudioContext) } var safariShim = Object.freeze({ __proto__: null, shimLocalStreamsAPI: shimLocalStreamsAPI, shimRemoteStreamsAPI: shimRemoteStreamsAPI, shimCallbacksAPI: shimCallbacksAPI, shimGetUserMedia: shimGetUserMedia, shimConstraints: shimConstraints, shimRTCIceServerUrls: shimRTCIceServerUrls, shimTrackEventTransceiver: shimTrackEventTransceiver, shimCreateOfferLegacy: shimCreateOfferLegacy, shimAudioContext: shimAudioContext }); function shimRTCIceCandidate(t) { var o; !t.RTCIceCandidate || t.RTCIceCandidate && "foundation"in t.RTCIceCandidate.prototype || (o = t.RTCIceCandidate, t.RTCIceCandidate = function(e) { var t, n, i; return "object" === _typeof(e) && e.candidate && 0 === e.candidate.indexOf("a=") && ((e = JSON.parse(JSON.stringify(e))).candidate = e.candidate.substr(2)), e.candidate && e.candidate.length ? (t = new o(e), n = sdp.parseCandidate(e.candidate), (i = Object.assign(t, n)).toJSON = function() { return { candidate: i.candidate, sdpMid: i.sdpMid, sdpMLineIndex: i.sdpMLineIndex, usernameFragment: i.usernameFragment } } , i) : new o(e) } , t.RTCIceCandidate.prototype = o.prototype, wrapPeerConnectionEvent(t, "icecandidate", function(e) { return e.candidate && Object.defineProperty(e, "candidate", { value: new t.RTCIceCandidate(e.candidate), writable: "false" }), e })) } function shimMaxMessageSize(e, r) { var s; e.RTCPeerConnection && ("sctp"in e.RTCPeerConnection.prototype || Object.defineProperty(e.RTCPeerConnection.prototype, "sctp", { get: function() { return void 0 === this._sctp ? null : this._sctp } }), s = e.RTCPeerConnection.prototype.setRemoteDescription, e.RTCPeerConnection.prototype.setRemoteDescription = function() { var e, t, n, i, o; return this._sctp = null, "chrome" === r.browser && 76 <= r.version && "plan-b" === this.getConfiguration().sdpSemantics && Object.defineProperty(this, "sctp", { get: function() { return void 0 === this._sctp ? null : this._sctp }, enumerable: !0, configurable: !0 }), (o = arguments[0]) && o.sdp && ((o = sdp.splitSections(o.sdp)).shift(), o.some(function(e) { e = sdp.parseMLine(e); return e && "application" === e.kind && -1 !== e.protocol.indexOf("SCTP") })) && (o = null === (o = (o = arguments[0]).sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/)) || o.length < 2 || (o = parseInt(o[1], 10)) != o ? -1 : o, n = o, i = 65536, n = i = "firefox" === r.browser ? r.version < 57 ? -1 === n ? 16384 : 2147483637 : r.version < 60 ? 57 === r.version ? 65535 : 65536 : 2147483637 : i, i = arguments[0], o = o, t = 65536, "firefox" === r.browser && 57 === r.version && (t = 65535), 0 < (i = sdp.matchPrefix(i.sdp, "a=max-message-size:")).length ? t = parseInt(i[0].substr(19), 10) : "firefox" === r.browser && -1 !== o && (t = 2147483637), i = t, e = 0 === n && 0 === i ? Number.POSITIVE_INFINITY : 0 === n || 0 === i ? Math.max(n, i) : Math.min(n, i), o = {}, Object.defineProperty(o, "maxMessageSize", { get: function() { return e } }), this._sctp = o), s.apply(this, arguments) } ) } function shimSendThrowTypeError(e) { var t; function n(t, n) { var i = t.send; t.send = function() { var e = arguments[0] , e = e.length || e.size || e.byteLength; if ("open" === t.readyState && n.sctp && e > n.sctp.maxMessageSize) throw new TypeError("Message too large (can send a maximum of " + n.sctp.maxMessageSize + " bytes)"); return i.apply(t, arguments) } } e.RTCPeerConnection && "createDataChannel"in e.RTCPeerConnection.prototype && (t = e.RTCPeerConnection.prototype.createDataChannel, e.RTCPeerConnection.prototype.createDataChannel = function() { var e = t.apply(this, arguments); return n(e, this), e } , wrapPeerConnectionEvent(e, "datachannel", function(e) { return n(e.channel, e.target), e })) } function shimConnectionState(e) { var n; !e.RTCPeerConnection || "connectionState"in e.RTCPeerConnection.prototype || (n = e.RTCPeerConnection.prototype, Object.defineProperty(n, "connectionState", { get: function() { return { completed: "connected", checking: "connecting" }[this.iceConnectionState] || this.iceConnectionState }, enumerable: !0, configurable: !0 }), Object.defineProperty(n, "onconnectionstatechange", { get: function() { return this._onconnectionstatechange || null }, set: function(e) { this._onconnectionstatechange && (this.removeEventListener("connectionstatechange", this._onconnectionstatechange), delete this._onconnectionstatechange), e && this.addEventListener("connectionstatechange", this._onconnectionstatechange = e) }, enumerable: !0, configurable: !0 }), ["setLocalDescription", "setRemoteDescription"].forEach(function(e) { var t = n[e]; n[e] = function() { return this._connectionstatechangepoly || (this._connectionstatechangepoly = function(e) { var t, n = e.target; return n._lastConnectionState !== n.connectionState && (n._lastConnectionState = n.connectionState, t = new Event("connectionstatechange",e), n.dispatchEvent(t)), e } , this.addEventListener("iceconnectionstatechange", this._connectionstatechangepoly)), t.apply(this, arguments) } })) } function removeExtmapAllowMixed(n, e) { var i; !n.RTCPeerConnection || "chrome" === e.browser && 71 <= e.version || "safari" === e.browser && 605 <= e.version || (i = n.RTCPeerConnection.prototype.setRemoteDescription, n.RTCPeerConnection.prototype.setRemoteDescription = function(e) { var t; return e && e.sdp && -1 !== e.sdp.indexOf("\na=extmap-allow-mixed") && (t = e.sdp.split("\n").filter(function(e) { return "a=extmap-allow-mixed" !== e.trim() }).join("\n"), n.RTCSessionDescription && e instanceof n.RTCSessionDescription ? arguments[0] = new n.RTCSessionDescription({ type: e.type, sdp: t }) : e.sdp = t), i.apply(this, arguments) } ) } function shimAddIceCandidateNullOrEmpty(e, t) { var n; e.RTCPeerConnection && e.RTCPeerConnection.prototype && (n = e.RTCPeerConnection.prototype.addIceCandidate) && 0 !== n.length && (e.RTCPeerConnection.prototype.addIceCandidate = function() { return arguments[0] ? ("chrome" === t.browser && t.version < 78 || "firefox" === t.browser && t.version < 68 || "safari" === t.browser) && arguments[0] && "" === arguments[0].candidate ? Promise.resolve() : n.apply(this, arguments) : (arguments[1] && arguments[1].apply(null), Promise.resolve()) } ) } var commonShim = Object.freeze({ __proto__: null, shimRTCIceCandidate: shimRTCIceCandidate, shimMaxMessageSize: shimMaxMessageSize, shimSendThrowTypeError: shimSendThrowTypeError, shimConnectionState: shimConnectionState, removeExtmapAllowMixed: removeExtmapAllowMixed, shimAddIceCandidateNullOrEmpty: shimAddIceCandidateNullOrEmpty }); function adapterFactory() { var e = (0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}).window , t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : { shimChrome: !0, shimFirefox: !0, shimEdge: !0, shimSafari: !0 } , n = log , i = detectBrowser(e) , o = { browserDetails: i, commonShim: commonShim, extractVersion: extractVersion, disableLog: disableLog, disableWarnings: disableWarnings }; switch (i.browser) { case "chrome": if (!chromeShim || !shimPeerConnection$2 || !t.shimChrome) return n("Chrome shim is not included in this adapter release."), o; if (null === i.version) return n("Chrome shim can not determine version, not shimming."), o; n("adapter.js shimming chrome."), o.browserShim = chromeShim, shimAddIceCandidateNullOrEmpty(e, i), shimGetUserMedia$3(e, i), shimMediaStream(e), shimPeerConnection$2(e, i), shimOnTrack$1(e), shimAddTrackRemoveTrack(e, i), shimGetSendersWithDtmf(e), shimGetStats(e), shimSenderReceiverGetStats(e), fixNegotiationNeeded(e, i), shimRTCIceCandidate(e), shimConnectionState(e), shimMaxMessageSize(e, i), shimSendThrowTypeError(e), removeExtmapAllowMixed(e, i); break; case "firefox": if (!firefoxShim || !shimPeerConnection || !t.shimFirefox) return n("Firefox shim is not included in this adapter release."), o; n("adapter.js shimming firefox."), o.browserShim = firefoxShim, shimAddIceCandidateNullOrEmpty(e, i), shimGetUserMedia$1(e, i), shimPeerConnection(e, i), shimOnTrack(e), shimRemoveStream(e), shimSenderGetStats(e), shimReceiverGetStats(e), shimRTCDataChannel(e), shimAddTransceiver(e), shimGetParameters(e), shimCreateOffer(e), shimCreateAnswer(e), shimRTCIceCandidate(e), shimConnectionState(e), shimMaxMessageSize(e, i), shimSendThrowTypeError(e); break; case "edge": if (!edgeShim || !shimPeerConnection$1 || !t.shimEdge) return n("MS edge shim is not included in this adapter release."), o; n("adapter.js shimming edge."), o.browserShim = edgeShim, shimGetUserMedia$2(e), shimGetDisplayMedia$1(e), shimPeerConnection$1(e, i), shimReplaceTrack(e), shimMaxMessageSize(e, i), shimSendThrowTypeError(e); break; case "safari": if (!safariShim || !t.shimSafari) return n("Safari shim is not included in this adapter release."), o; n("adapter.js shimming safari."), o.browserShim = safariShim, shimAddIceCandidateNullOrEmpty(e, i), shimRTCIceServerUrls(e), shimCreateOfferLegacy(e), shimCallbacksAPI(e), shimLocalStreamsAPI(e), shimRemoteStreamsAPI(e), shimTrackEventTransceiver(e), shimGetUserMedia(e), shimAudioContext(e), shimRTCIceCandidate(e), shimMaxMessageSize(e, i), shimSendThrowTypeError(e), removeExtmapAllowMixed(e, i); break; default: n("Unsupported browser!") } return o } var adapter = adapterFactory({ window: "undefined" == typeof window ? void 0 : window }) , re$1 = /^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ , parts$1 = ["source", "protocol", "authority", "userInfo", "user", "password", "host", "port", "relative", "path", "directory", "file", "query", "anchor"] , parseuri$1 = function(e) { for (var t = e, n = e.indexOf("["), i = e.indexOf("]"), o = (-1 != n && -1 != i && (e = e.substring(0, n) + e.substring(n, i).replace(/:/g, ";") + e.substring(i, e.length)), re$1.exec(e || "")), r = {}, s = 14; s--; ) r[parts$1[s]] = o[s] || ""; return -1 != n && -1 != i && (r.source = t, r.host = r.host.substring(1, r.host.length - 1).replace(/;/g, ":"), r.authority = r.authority.replace("[", "").replace("]", "").replace(/;/g, ":"), r.ipv6uri = !0), r } , s$2 = 1e3 , m$2 = 60 * s$2 , h$2 = 60 * m$2 , d$2 = 24 * h$2 , w = 7 * d$2 , y$2 = 365.25 * d$2 , ms$2 = function(e, t) { t = t || {}; var n = _typeof(e); if ("string" === n && 0 < e.length) return parse$3(e); if ("number" === n && isFinite(e)) return (t.long ? fmtLong$2 : fmtShort$2)(e); throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(e)) }; function parse$3(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$2; case "weeks": case "week": case "w": return t * w; case "days": case "day": case "d": return t * d$2; case "hours": case "hour": case "hrs": case "hr": case "h": return t * h$2; case "minutes": case "minute": case "mins": case "min": case "m": return t * m$2; case "seconds": case "second": case "secs": case "sec": case "s": return t * s$2; case "milliseconds": case "millisecond": case "msecs": case "msec": case "ms": return t; default: return } } } } function fmtShort$2(e) { var t = Math.abs(e); return d$2 <= t ? Math.round(e / d$2) + "d" : h$2 <= t ? Math.round(e / h$2) + "h" : m$2 <= t ? Math.round(e / m$2) + "m" : s$2 <= t ? Math.round(e / s$2) + "s" : e + "ms" } function fmtLong$2(e) { var t = Math.abs(e); return d$2 <= t ? plural$2(e, t, d$2, "day") : h$2 <= t ? plural$2(e, t, h$2, "hour") : m$2 <= t ? plural$2(e, t, m$2, "minute") : s$2 <= t ? plural$2(e, t, s$2, "second") : e + " ms" } function plural$2(e, t, n, i) { t = 1.5 * n <= t; return Math.round(e / n) + " " + i + (t ? "s" : "") } function setup(t) { function n(e) { for (var t = 0, n = 0; n < e.length; n++) t = (t << 5) - t + e.charCodeAt(n), t |= 0; return l.colors[Math.abs(t) % l.colors.length] } function l(e) { var a; function c() { for (var i, e, t, o, n = arguments.length, r = new Array(n), s = 0; s < n; s++) r[s] = arguments[s]; c.enabled && (i = c, t = (e = Number(new Date)) - (a || e), i.diff = t, i.prev = a, i.curr = e, a = e, r[0] = l.coerce(r[0]), "string" != typeof r[0] && r.unshift("%O"), r[o = 0] = r[0].replace(/%([a-zA-Z%])/g, function(e, t) { var n; return "%%" !== e && (o++, "function" == typeof (t = l.formatters[t])) && (n = r[o], e = t.call(i, n), r.splice(o, 1), o--), e }), l.formatArgs.call(i, r), (i.log || l.log).apply(i, r)) } return c.namespace = e, c.enabled = l.enabled(e), c.useColors = l.useColors(), c.color = n(e), c.destroy = i, c.extend = o, "function" == typeof l.init && l.init(c), l.instances.push(c), c } function i() { var e = l.instances.indexOf(this); return -1 !== e && (l.instances.splice(e, 1), !0) } function o(e, t) { t = l(this.namespace + (void 0 === t ? ":" : t) + e); return t.log = this.log, t } function r(e) { return e.toString().substring(2, e.toString().length - 2).replace(/\.\*\?$/, "*") } return ((l.debug = l).default = l).coerce = function(e) { if (e instanceof Error) return e.stack || e.message; return e } , l.disable = function() { var e = [].concat(_toConsumableArray(l.names.map(r)), _toConsumableArray(l.skips.map(r).map(function(e) { return "-" + e }))).join(","); return l.enable(""), e } , l.enable = function(e) { l.save(e), l.names = [], l.skips = []; var t, n = ("string" == typeof e ? e : "").split(/[\s,]+/), i = n.length; for (t = 0; t < i; t++) n[t] && ("-" === (e = n[t].replace(/\*/g, ".*?"))[0] ? l.skips.push(new RegExp("^" + e.substr(1) + "$")) : l.names.push(new RegExp("^" + e + "$"))); for (t = 0; t < l.instances.length; t++) { var o = l.instances[t]; o.enabled = l.enabled(o.namespace) } } , l.enabled = function(e) { if ("*" === e[e.length - 1]) return !0; var t, n; for (t = 0, n = l.skips.length; t < n; t++) if (l.skips[t].test(e)) return !1; for (t = 0, n = l.names.length; t < n; t++) if (l.names[t].test(e)) return !0; return !1 } , l.humanize = ms$2, Object.keys(t).forEach(function(e) { l[e] = t[e] }), l.instances = [], l.names = [], l.skips = [], l.formatters = {}, l.selectColor = n, l.enable(l.load()), l } var common = setup , browser$3 = createCommonjsModule(function(o, t) { t.log = function() { var e; return "object" === ("undefined" == typeof console ? "undefined" : _typeof(console)) && console.log && (e = console).log.apply(e, arguments) } , t.formatArgs = function(e) { var t, n, i; 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[i = n = 0].replace(/%[a-zA-Z%]/g, function(e) { "%%" !== e && (n++, "%c" === e) && (i = n) }), e.splice(i, 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.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"], o.exports = common(t), o.exports.formatters.j = function(e) { try { return JSON.stringify(e) } catch (e) { return "[UnexpectedJSONParseError]: " + e.message } } }) , debug$7 = browser$3("socket.io-client:url") , url_1 = url; function url(e, t) { var n = e; t = t || "undefined" != typeof location && location, "string" == typeof (e = null == e ? t.protocol + "//" + t.host : e) && ("/" === e.charAt(0) && (e = "/" === e.charAt(1) ? t.protocol + e : t.host + e), /^(https?|wss?):\/\//.test(e) || (debug$7("protocol-less url %s", e), e = void 0 !== t ? t.protocol + "//" + e : "https://" + e), debug$7("parse %s", e), n = parseuri$1(e)), n.port || (/^(http|ws)$/.test(n.protocol) ? n.port = "80" : /^(http|ws)s$/.test(n.protocol) && (n.port = "443")), n.path = n.path || "/"; e = -1 !== n.host.indexOf(":") ? "[" + n.host + "]" : n.host; return n.id = n.protocol + "://" + e + ":" + n.port, n.href = n.protocol + "://" + e + (t && t.port === n.port ? "" : ":" + n.port), n } var s$1 = 1e3 , m$1 = 60 * s$1 , h$1 = 60 * m$1 , d$1 = 24 * h$1 , y$1 = 365.25 * d$1 , ms$1 = function(e, t) { t = t || {}; var n = _typeof(e); if ("string" === n && 0 < e.length) return parse$2(e); if ("number" === n && !1 === isNaN(e)) return (t.long ? fmtLong$1 : fmtShort$1)(e); throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(e)) }; function parse$2(e) { if (!(100 < (e = String(e)).length)) { e = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|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$1; case "days": case "day": case "d": return t * d$1; case "hours": case "hour": case "hrs": case "hr": case "h": return t * h$1; case "minutes": case "minute": case "mins": case "min": case "m": return t * m$1; case "seconds": case "second": case "secs": case "sec": case "s": return t * s$1; case "milliseconds": case "millisecond": case "msecs": case "msec": case "ms": return t; default: return } } } } function fmtShort$1(e) { return d$1 <= e ? Math.round(e / d$1) + "d" : h$1 <= e ? Math.round(e / h$1) + "h" : m$1 <= e ? Math.round(e / m$1) + "m" : s$1 <= e ? Math.round(e / s$1) + "s" : e + "ms" } function fmtLong$1(e) { return plural$1(e, d$1, "day") || plural$1(e, h$1, "hour") || plural$1(e, m$1, "minute") || plural$1(e, s$1, "second") || e + " ms" } function plural$1(e, t, n) { if (!(e < t)) return e < 1.5 * t ? Math.floor(e / t) + " " + n : Math.ceil(e / t) + " " + n + "s" } var debug$6 = createCommonjsModule(function(e, c) { function t(e) { var s; function a() { if (a.enabled) { for (var i = a, e = +new Date, t = e - (s || e), o = (i.diff = t, i.prev = s, i.curr = e, s = e, new Array(arguments.length)), n = 0; n < o.length; n++) o[n] = arguments[n]; o[0] = c.coerce(o[0]), "string" != typeof o[0] && o.unshift("%O"); var r = 0; o[0] = o[0].replace(/%([a-zA-Z%])/g, function(e, t) { var n; return "%%" !== e && (r++, "function" == typeof (t = c.formatters[t])) && (n = o[r], e = t.call(i, n), o.splice(r, 1), r--), e }), c.formatArgs.call(i, o), (a.log || c.log || void 0).apply(i, o) } } return a.namespace = e, a.enabled = c.enabled(e), a.useColors = c.useColors(), a.color = function(e) { var t, n = 0; for (t in e) n = (n << 5) - n + e.charCodeAt(t), n |= 0; return c.colors[Math.abs(n) % c.colors.length] }(e), a.destroy = n, "function" == typeof c.init && c.init(a), c.instances.push(a), a } function n() { var e = c.instances.indexOf(this); return -1 !== e && (c.instances.splice(e, 1), !0) } (c = e.exports = t.debug = t.default = t).coerce = function(e) { return e instanceof Error ? e.stack || e.message : e } , c.disable = function() { c.enable("") } , c.enable = function(e) { c.save(e), c.names = [], c.skips = []; var t, n = ("string" == typeof e ? e : "").split(/[\s,]+/), i = n.length; for (t = 0; t < i; t++) n[t] && ("-" === (e = n[t].replace(/\*/g, ".*?"))[0] ? c.skips.push(new RegExp("^" + e.substr(1) + "$")) : c.names.push(new RegExp("^" + e + "$"))); for (t = 0; t < c.instances.length; t++) { var o = c.instances[t]; o.enabled = c.enabled(o.namespace) } } , c.enabled = function(e) { if ("*" === e[e.length - 1]) return !0; var t, n; for (t = 0, n = c.skips.length; t < n; t++) if (c.skips[t].test(e)) return !1; for (t = 0, n = c.names.length; t < n; t++) if (c.names[t].test(e)) return !0; return !1 } , c.humanize = ms$1, c.instances = [], c.names = [], c.skips = [], c.formatters = {} }) , browser$2 = createCommonjsModule(function(e, o) { function t() { var e; try { e = o.storage.debug } catch (e) {} return e = !e && "undefined" != typeof process && "env"in process ? process.env.DEBUG : e } (o = e.exports = debug$6).log = function() { return "object" === ("undefined" == typeof console ? "undefined" : _typeof(console)) && console.log && Function.prototype.apply.call(console.log, console, arguments) } , o.formatArgs = function(e) { var t, n, i = this.useColors; e[0] = (i ? "%c" : "") + this.namespace + (i ? " %c" : " ") + e[0] + (i ? "%c " : " ") + "+" + o.humanize(this.diff), i && (i = "color: " + this.color, e.splice(1, 0, i, "color: inherit"), e[n = t = 0].replace(/%[a-zA-Z%]/g, function(e) { "%%" !== e && (t++, "%c" === e) && (n = t) }), e.splice(n, 0, i)) } , o.save = function(e) { try { null == e ? o.storage.removeItem("debug") : o.storage.debug = e } catch (e) {} } , o.load = t, o.useColors = function() { if ("undefined" != typeof window && window.process && "renderer" === window.process.type) 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+)/) } , o.storage = "undefined" != typeof chrome && void 0 !== chrome.storage ? chrome.storage.local : function() { try { return window.localStorage } catch (e) {} }(), o.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"], o.formatters.j = function(e) { try { return JSON.stringify(e) } catch (e) { return "[UnexpectedJSONParseError]: " + e.message } } , o.enable(t()) }) , componentEmitter$2 = createCommonjsModule(function(e) { function i(e) { if (e) { var t, n = e; for (t in i.prototype) n[t] = i.prototype[t]; return n } } (e.exports = i).prototype.on = i.prototype.addEventListener = function(e, t) { return this._callbacks = this._callbacks || {}, (this._callbacks["$" + e] = this._callbacks["$" + e] || []).push(t), this } , i.prototype.once = function(e, t) { function n() { this.off(e, n), t.apply(this, arguments) } return n.fn = t, this.on(e, n), this } , i.prototype.off = i.prototype.removeListener = i.prototype.removeAllListeners = i.prototype.removeEventListener = function(e, t) { if (this._callbacks = this._callbacks || {}, 0 == arguments.length) this._callbacks = {}; else { var n = this._callbacks["$" + e]; if (n) if (1 == arguments.length) delete this._callbacks["$" + e]; else { for (var i, o = 0; o < n.length; o++) if ((i = n[o]) === t || i.fn === t) { n.splice(o, 1); break } 0 === n.length && delete this._callbacks["$" + e] } } return this } , i.prototype.emit = function(e) { this._callbacks = this._callbacks || {}; for (var t = new Array(arguments.length - 1), n = this._callbacks["$" + e], i = 1; i < arguments.length; i++) t[i - 1] = arguments[i]; if (n) for (var i = 0, o = (n = n.slice(0)).length; i < o; ++i) n[i].apply(this, t); return this } , i.prototype.listeners = function(e) { return this._callbacks = this._callbacks || {}, this._callbacks["$" + e] || [] } , i.prototype.hasListeners = function(e) { return !!this.listeners(e).length } }) , toString$3 = {}.toString , isarray = Array.isArray || function(e) { return "[object Array]" == toString$3.call(e) } , isBuffer = isBuf , withNativeBuffer = "function" == typeof Buffer && "function" == typeof Buffer.isBuffer , withNativeArrayBuffer = "function" == typeof ArrayBuffer , isView = function(e) { return "function" == typeof ArrayBuffer.isView ? ArrayBuffer.isView(e) : e.buffer instanceof ArrayBuffer }; function isBuf(e) { return withNativeBuffer && Buffer.isBuffer(e) || withNativeArrayBuffer && (e instanceof ArrayBuffer || isView(e)) } var toString$2 = Object.prototype.toString , withNativeBlob$1 = "function" == typeof Blob || "undefined" != typeof Blob && "[object BlobConstructor]" === toString$2.call(Blob) , withNativeFile$1 = "function" == typeof File || "undefined" != typeof File && "[object FileConstructor]" === toString$2.call(File) , deconstructPacket = function(e) { var t = [] , n = e.data; return e.data = _deconstructPacket(n, t), e.attachments = t.length, { packet: e, buffers: t } }; function _deconstructPacket(e, t) { if (!e) return e; var n; if (isBuffer(e)) return n = { _placeholder: !0, num: t.length }, t.push(e), n; if (isarray(e)) for (var i = new Array(e.length), o = 0; o < e.length; o++) i[o] = _deconstructPacket(e[o], t); else { if ("object" !== _typeof(e) || e instanceof Date) return e; var r, i = {}; for (r in e) i[r] = _deconstructPacket(e[r], t) } return i } var reconstructPacket = function(e, t) { return e.data = _reconstructPacket(e.data, t), e.attachments = void 0, e }; function _reconstructPacket(e, t) { if (e) { if (e && !0 === e._placeholder) { if ("number" == typeof e.num && 0 <= e.num && e.num < t.length) return t[e.num]; throw new Error("illegal attachments") } if (isarray(e)) for (var n = 0; n < e.length; n++) e[n] = _reconstructPacket(e[n], t); else if ("object" === _typeof(e)) for (var i in e) e[i] = _reconstructPacket(e[i], t) } return e } var removeBlobs = function(e, a) { var c = 0 , l = e; !function e(t, n, i) { if (t) if (withNativeBlob$1 && t instanceof Blob || withNativeFile$1 && t instanceof File) { c++; var o = new FileReader; o.onload = function() { i ? i[n] = this.result : l = this.result, --c || a(l) } , o.readAsArrayBuffer(t) } else if (isarray(t)) for (var r = 0; r < t.length; r++) e(t[r], r, t); else if ("object" === _typeof(t) && !isBuffer(t)) for (var s in t) e(t[s], s, t) }(l), c || a(l) } , binary = { deconstructPacket: deconstructPacket, reconstructPacket: reconstructPacket, removeBlobs: removeBlobs } , socket_ioParser = createCommonjsModule(function(e, s) { var a = browser$2("socket.io-parser"); function t() {} s.protocol = 4, s.types = ["CONNECT", "DISCONNECT", "EVENT", "ACK", "ERROR", "BINARY_EVENT", "BINARY_ACK"], s.CONNECT = 0, s.DISCONNECT = 1, s.EVENT = 2, s.ACK = 3, s.ERROR = 4, s.BINARY_EVENT = 5, s.BINARY_ACK = 6, s.Encoder = t, s.Decoder = n; var i = s.ERROR + '"encode error"'; function o(e) { var t = "" + e.type; if (s.BINARY_EVENT !== e.type && s.BINARY_ACK !== e.type || (t += e.attachments + "-"), e.nsp && "/" !== e.nsp && (t += e.nsp + ","), null != e.id && (t += e.id), null != e.data) { var n = function(e) { try { return JSON.stringify(e) } catch (e) { return !1 } }(e.data); if (!1 === n) return i; t += n } return a("encoded %j as %s", e, t), t } function n() { this.reconstructor = null } function r(e) { this.reconPack = e, this.buffers = [] } function c(e) { return { type: s.ERROR, data: "parser error: " + e } } t.prototype.encode = function(e, t) { var n; a("encoding packet %j", e), s.BINARY_EVENT === e.type || s.BINARY_ACK === e.type ? (n = t, binary.removeBlobs(e, function(e) { var t = o((e = binary.deconstructPacket(e)).packet); (e = e.buffers).unshift(t), n(e) })) : t([o(e)]) } , componentEmitter$2(n.prototype), n.prototype.add = function(e) { var t; if ("string" == typeof e) { if (this.reconstructor) throw new Error("got plaintext data when reconstructing a packet"); t = function(e) { var t = 0 , n = { type: Number(e.charAt(0)) }; if (null == s.types[n.type]) return c("unknown packet type " + n.type); if (s.BINARY_EVENT === n.type || s.BINARY_ACK === n.type) { for (var i = t + 1; "-" !== e.charAt(++t) && t != e.length; ) ; var o = e.substring(i, t); if (o != Number(o) || "-" !== e.charAt(t)) throw new Error("Illegal attachments"); n.attachments = Number(o) } if ("/" === e.charAt(t + 1)) { for (i = t + 1; ++t; ) { if ("," === (r = e.charAt(t))) break; if (t === e.length) break } n.nsp = e.substring(i, t) } else n.nsp = "/"; o = e.charAt(t + 1); if ("" !== o && Number(o) == o) { for (var r, i = t + 1; ++t; ) { if (null == (r = e.charAt(t)) || Number(r) != r) { --t; break } if (t === e.length) break } n.id = Number(e.substring(i, t + 1)) } if (e.charAt(++t)) { o = function(e) { try { return JSON.parse(e) } catch (e) { return !1 } }(e.substr(t)); if (!(!1 !== o && (n.type === s.ERROR || isarray(o)))) return c("invalid payload"); n.data = o } return a("decoded %s as %j", e, n), n }(e), (s.BINARY_EVENT !== t.type && s.BINARY_ACK !== t.type || (this.reconstructor = new r(t), 0 === this.reconstructor.reconPack.attachments)) && this.emit("decoded", t) } else { if (!isBuffer(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, this.emit("decoded", t)) } } , n.prototype.destroy = function() { this.reconstructor && this.reconstructor.finishedReconstruction() } , r.prototype.takeBinaryData = function(e) { return this.buffers.push(e), this.buffers.length === this.reconPack.attachments ? (e = binary.reconstructPacket(this.reconPack, this.buffers), this.finishedReconstruction(), e) : null } , r.prototype.finishedReconstruction = function() { this.reconPack = null, this.buffers = [] } }) , hasCors = createCommonjsModule(function(t) { try { t.exports = "undefined" != typeof XMLHttpRequest && "withCredentials"in new XMLHttpRequest } catch (e) { t.exports = !1 } }) , globalThis_browser = "undefined" != typeof self ? self : "undefined" != typeof window ? window : Function("return this")() , xmlhttprequest = function(e) { var t = e.xdomain , n = e.xscheme , e = e.enablesXDR; try { if ("undefined" != typeof XMLHttpRequest && (!t || hasCors)) return new XMLHttpRequest } catch (e) {} try { if ("undefined" != typeof XDomainRequest && !n && e) return new XDomainRequest } catch (e) {} if (!t) try { return new globalThis_browser[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP") } catch (e) {} } , keys = Object.keys || function(e) { var t, n = [], i = Object.prototype.hasOwnProperty; for (t in e) i.call(e, t) && n.push(t); return n } , toString$1 = Object.prototype.toString , withNativeBlob = "function" == typeof Blob || "undefined" != typeof Blob && "[object BlobConstructor]" === toString$1.call(Blob) , withNativeFile = "function" == typeof File || "undefined" != typeof File && "[object FileConstructor]" === toString$1.call(File) , hasBinary2 = hasBinary; function hasBinary(e) { if (e && "object" === _typeof(e)) if (isarray(e)) { for (var t = 0, n = e.length; t < n; t++) if (hasBinary(e[t])) return !0 } else { if ("function" == typeof Buffer && Buffer.isBuffer && Buffer.isBuffer(e) || "function" == typeof ArrayBuffer && e instanceof ArrayBuffer || withNativeBlob && e instanceof Blob || withNativeFile && e instanceof File) return !0; if (e.toJSON && "function" == typeof e.toJSON && 1 === arguments.length) return hasBinary(e.toJSON(), !0); for (var i in e) if (Object.prototype.hasOwnProperty.call(e, i) && hasBinary(e[i])) return !0 } return !1 } var arraybuffer_slice = function(e, t, n) { var i = e.byteLength; if (t = t || 0, n = n || i, e.slice) return e.slice(t, n); if (t < 0 && (t += i), n < 0 && (n += i), i < n && (n = i), i <= t || n <= t || 0 === i) return new ArrayBuffer(0); for (var o = new Uint8Array(e), r = new Uint8Array(n - t), s = t, a = 0; s < n; s++, a++) r[a] = o[s]; return r.buffer } , after_1 = after$1; function after$1(e, n, i) { var o = !1; return i = i || noop, 0 === (r.count = e) ? n() : r; function r(e, t) { if (r.count <= 0) throw new Error("after called too many times"); --r.count, e ? (o = !0, n(e), n = i) : 0 !== r.count || o || n(null, t) } } function noop() {} var stringFromCharCode = String.fromCharCode, byteArray, byteCount, byteIndex; function ucs2decode(e) { for (var t, n, i = [], o = 0, r = e.length; o < r; ) 55296 <= (t = e.charCodeAt(o++)) && t <= 56319 && o < r ? 56320 == (64512 & (n = e.charCodeAt(o++))) ? i.push(((1023 & t) << 10) + (1023 & n) + 65536) : (i.push(t), o--) : i.push(t); return i } function ucs2encode(e) { for (var t, n = e.length, i = -1, o = ""; ++i < n; ) 65535 < (t = e[i]) && (o += stringFromCharCode((t -= 65536) >>> 10 & 1023 | 55296), t = 56320 | 1023 & t), o += stringFromCharCode(t); return o } function checkScalarValue(e, t) { if (!(55296 <= e && e <= 57343)) return 1; if (t) throw Error("Lone surrogate U+" + e.toString(16).toUpperCase() + " is not a scalar value") } function createByte(e, t) { return stringFromCharCode(e >> t & 63 | 128) } function encodeCodePoint(e, t) { var n; return 0 == (4294967168 & e) ? stringFromCharCode(e) : (n = "", 0 == (4294965248 & e) ? n = stringFromCharCode(e >> 6 & 31 | 192) : 0 == (4294901760 & e) ? (checkScalarValue(e, t) || (e = 65533), n = stringFromCharCode(e >> 12 & 15 | 224), n += createByte(e, 6)) : 0 == (4292870144 & e) && (n = stringFromCharCode(e >> 18 & 7 | 240), n = (n += createByte(e, 12)) + createByte(e, 6)), n + stringFromCharCode(63 & e | 128)) } function utf8encode(e, t) { for (var n = !1 !== (t = t || {}).strict, i = ucs2decode(e), o = i.length, r = -1, s = ""; ++r < o; ) s += encodeCodePoint(i[r], n); return s } function readContinuationByte() { if (byteCount <= byteIndex) throw Error("Invalid byte index"); var e = 255 & byteArray[byteIndex]; if (byteIndex++, 128 == (192 & e)) return 63 & e; throw Error("Invalid continuation byte") } function decodeSymbol(e) { var t, n; if (byteCount < byteIndex) throw Error("Invalid byte index"); if (byteIndex == byteCount) return !1; if (t = 255 & byteArray[byteIndex], byteIndex++, 0 == (128 & t)) return t; if (192 == (224 & t)) { if (128 <= (n = (31 & t) << 6 | readContinuationByte())) return n; throw Error("Invalid continuation byte") } if (224 == (240 & t)) { if (2048 <= (n = (15 & t) << 12 | readContinuationByte() << 6 | readContinuationByte())) return checkScalarValue(n, e) ? n : 65533; throw Error("Invalid continuation byte") } if (240 == (248 & t) && 65536 <= (n = (7 & t) << 18 | readContinuationByte() << 12 | readContinuationByte() << 6 | readContinuationByte()) && n <= 1114111) return n; throw Error("Invalid UTF-8 detected") } function utf8decode(e, t) { for (var n, i = !1 !== (t = t || {}).strict, o = (byteArray = ucs2decode(e), byteCount = byteArray.length, byteIndex = 0, []); !1 !== (n = decodeSymbol(i)); ) o.push(n); return ucs2encode(o) } var utf8 = { version: "2.1.2", encode: utf8encode, decode: utf8decode } , base64Arraybuffer = createCommonjsModule(function(e, t) { var d; d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", t.encode = function(e) { for (var t = new Uint8Array(e), n = t.length, i = "", o = 0; o < n; o += 3) i = (i = (i = (i += d[t[o] >> 2]) + d[(3 & t[o]) << 4 | t[o + 1] >> 4]) + d[(15 & t[o + 1]) << 2 | t[o + 2] >> 6]) + d[63 & t[o + 2]]; return n % 3 == 2 ? i = i.substring(0, i.length - 1) + "=" : n % 3 == 1 && (i = i.substring(0, i.length - 2) + "=="), i } , t.decode = function(e) { for (var t, n, i, o, r = .75 * e.length, s = e.length, a = 0, r = ("=" === e[e.length - 1] && (r--, "=" === e[e.length - 2]) && r--, new ArrayBuffer(r)), c = new Uint8Array(r), l = 0; l < s; l += 4) t = d.indexOf(e[l]), n = d.indexOf(e[l + 1]), i = d.indexOf(e[l + 2]), o = d.indexOf(e[l + 3]), c[a++] = t << 2 | n >> 4, c[a++] = (15 & n) << 4 | i >> 2, c[a++] = (3 & i) << 6 | 63 & o; return r } }) , BlobBuilder = void 0 !== BlobBuilder ? BlobBuilder : "undefined" != typeof WebKitBlobBuilder ? WebKitBlobBuilder : "undefined" != typeof MSBlobBuilder ? MSBlobBuilder : "undefined" != typeof MozBlobBuilder && MozBlobBuilder , blobSupported = function() { try { return 2 === new Blob(["hi"]).size } catch (e) { return !1 } }() , blobSupportsArrayBufferView = blobSupported && function() { try { return 2 === new Blob([new Uint8Array([1, 2])]).size } catch (e) { return !1 } }() , blobBuilderSupported = BlobBuilder && BlobBuilder.prototype.append && BlobBuilder.prototype.getBlob; function mapArrayBufferViews(e) { return e.map(function(e) { var t, n; return e.buffer instanceof ArrayBuffer ? (t = e.buffer, e.byteLength !== t.byteLength && ((n = new Uint8Array(e.byteLength)).set(new Uint8Array(t,e.byteOffset,e.byteLength)), t = n.buffer), t) : e }) } function BlobBuilderConstructor(e, t) { t = t || {}; var n = new BlobBuilder; return mapArrayBufferViews(e).forEach(function(e) { n.append(e) }), t.type ? n.getBlob(t.type) : n.getBlob() } function BlobConstructor(e, t) { return new Blob(mapArrayBufferViews(e),t || {}) } "undefined" != typeof Blob && (BlobBuilderConstructor.prototype = Blob.prototype, BlobConstructor.prototype = Blob.prototype); var blob = blobSupported ? blobSupportsArrayBufferView ? Blob : BlobConstructor : blobBuilderSupported ? BlobBuilderConstructor : void 0 , browser$1 = createCommonjsModule(function(e, m) { "undefined" != typeof ArrayBuffer && (o = base64Arraybuffer); var o, t = "undefined" != typeof navigator && /Android/i.test(navigator.userAgent), n = "undefined" != typeof navigator && /PhantomJS/i.test(navigator.userAgent), y = t || n, g = (m.protocol = 3, m.packets = { open: 0, close: 1, ping: 2, pong: 3, message: 4, upgrade: 5, noop: 6 }), r = keys(g), u = { type: "error", data: "parser error" }; function s(e, t, n) { for (var o = new Array(e.length), i = after_1(e.length, n), r = 0; r < e.length; r++) !function(n, e, i) { t(e, function(e, t) { o[n] = t, i(e, o) }) }(r, e[r], i) } m.encodePacket = function(e, t, n, i) { "function" == typeof t && (i = t, t = !1), "function" == typeof n && (i = n, n = null); var o = void 0 === e.data ? void 0 : e.data.buffer || e.data; if ("undefined" != typeof ArrayBuffer && o instanceof ArrayBuffer) { var r = e , s = i; if (!(a = t)) return m.encodeBase64Packet(r, s); var a = r.data , c = new Uint8Array(a) , l = new Uint8Array(1 + a.byteLength); l[0] = g[r.type]; for (var d = 0; d < c.length; d++) l[d + 1] = c[d]; return s(l.buffer) } if (void 0 !== blob && o instanceof blob) { var p, a = e, r = t, s = i; if (!r) return m.encodeBase64Packet(a, s); if (y) { var u = a; var h = r; var f = s; return h ? ((p = new FileReader).onload = function() { m.encodePacket({ type: u.type, data: p.result }, h, !0, f) } , p.readAsArrayBuffer(u.data)) : m.encodeBase64Packet(u, f); return } return (r = new Uint8Array(1))[0] = g[a.type], r = new blob([r.buffer, a.data]), s(r) } return o && o.base64 ? (t = e, o = i, t = "b" + m.packets[e.type] + e.data.data, o(t)) : (o = g[e.type], void 0 !== e.data && (o += n ? utf8.encode(String(e.data), { strict: !1 }) : String(e.data)), i("" + o)) } , m.encodeBase64Packet = function(t, n) { var i, o, r = "b" + m.packets[t.type]; if (void 0 !== blob && t.data instanceof blob) return (i = new FileReader).onload = function() { var e = i.result.split(",")[1]; n(r + e) } , i.readAsDataURL(t.data); try { o = String.fromCharCode.apply(null, new Uint8Array(t.data)) } catch (e) { for (var s = new Uint8Array(t.data), a = new Array(s.length), c = 0; c < s.length; c++) a[c] = s[c]; o = String.fromCharCode.apply(null, a) } return r += btoa(o), n(r) } , m.decodePacket = function(e, t, n) { var i; return void 0 === e ? u : "string" == typeof e ? "b" === e.charAt(0) ? m.decodeBase64Packet(e.substr(1), t) : (!n || !1 !== (e = function(e) { try { e = utf8.decode(e, { strict: !1 }) } catch (e) { return !1 } return e }(e))) && (i = e.charAt(0), Number(i) == i) && r[i] ? 1 < e.length ? { type: r[i], data: e.substring(1) } : { type: r[i] } : u : (i = new Uint8Array(e)[0], n = arraybuffer_slice(e, 1), blob && "blob" === t && (n = new blob([n])), { type: r[i], data: n }) } , m.decodeBase64Packet = function(e, t) { var n, i = r[e.charAt(0)]; return o ? (n = o.decode(e.substr(1)), { type: i, data: n = "blob" === t && blob ? new blob([n]) : n }) : { type: i, data: { base64: !0, data: e.substr(1) } } } , m.encodePayload = function(e, n, i) { "function" == typeof n && (i = n, n = null); var o = hasBinary2(e); return n && o ? blob && !y ? m.encodePayloadAsBlob(e, i) : m.encodePayloadAsArrayBuffer(e, i) : e.length ? void s(e, function(e, t) { m.encodePacket(e, !!o && n, !1, function(e) { t(null, e.length + ":" + e) }) }, function(e, t) { return i(t.join("")) }) : i("0:") } , m.decodePayload = function(e, t, n) { if ("string" != typeof e) return m.decodePayloadAsBinary(e, t, n); if ("function" == typeof t && (n = t, t = null), "" === e) return n(u, 0, 1); for (var i, o = "", r = 0, s = e.length; r < s; r++) { var a = e.charAt(r); if (":" !== a) o += a; else { if ("" === o || o != (i = Number(o))) return n(u, 0, 1); if (o != (a = e.substr(r + 1, i)).length) return n(u, 0, 1); if (a.length) { if (a = m.decodePacket(a, t, !1), u.type === a.type && u.data === a.data) return n(u, 0, 1); if (!1 === n(a, r + i, s)) return } r += i, o = "" } } return "" !== o ? n(u, 0, 1) : void 0 } , m.encodePayloadAsArrayBuffer = function(e, i) { if (!e.length) return i(new ArrayBuffer(0)); s(e, function(e, t) { m.encodePacket(e, !0, !0, function(e) { return t(null, e) }) }, function(e, t) { var n = t.reduce(function(e, t) { t = "string" == typeof t ? t.length : t.byteLength; return e + t.toString().length + t + 2 }, 0) , s = new Uint8Array(n) , a = 0; return t.forEach(function(e) { var t = "string" == typeof e , n = e; if (t) { for (var i = new Uint8Array(e.length), o = 0; o < e.length; o++) i[o] = e.charCodeAt(o); n = i.buffer } s[a++] = t ? 0 : 1; for (var r = n.byteLength.toString(), o = 0; o < r.length; o++) s[a++] = parseInt(r[o]); s[a++] = 255; for (i = new Uint8Array(n), o = 0; o < i.length; o++) s[a++] = i[o] }), i(s.buffer) }) } , m.encodePayloadAsBlob = function(e, n) { s(e, function(e, s) { m.encodePacket(e, !0, !0, function(e) { var t = new Uint8Array(1); if (t[0] = 1, "string" == typeof e) { for (var n = new Uint8Array(e.length), i = 0; i < e.length; i++) n[i] = e.charCodeAt(i); e = n.buffer, t[0] = 0 } for (var o = (e instanceof ArrayBuffer ? e.byteLength : e.size).toString(), r = new Uint8Array(o.length + 1), i = 0; i < o.length; i++) r[i] = parseInt(o[i]); r[o.length] = 255, blob && (t = new blob([t.buffer, r.buffer, e]), s(null, t)) }) }, function(e, t) { return n(new blob(t)) }) } , m.decodePayloadAsBinary = function(e, n, i) { "function" == typeof n && (i = n, n = null); for (var t = e, o = []; 0 < t.byteLength; ) { for (var r = new Uint8Array(t), s = 0 === r[0], a = "", c = 1; 255 !== r[c]; c++) { if (310 < a.length) return i(u, 0, 1); a += r[c] } var t = arraybuffer_slice(t, 2 + a.length) , a = parseInt(a) , l = arraybuffer_slice(t, 0, a); if (s) try { l = String.fromCharCode.apply(null, new Uint8Array(l)) } catch (e) { for (var d = new Uint8Array(l), l = "", c = 0; c < d.length; c++) l += String.fromCharCode(d[c]) } o.push(l), t = arraybuffer_slice(t, a) } var p = o.length; o.forEach(function(e, t) { i(m.decodePacket(e, n, !0), t, p) }) } }) , componentEmitter$1 = createCommonjsModule(function(e) { function i(e) { if (e) { var t, n = e; for (t in i.prototype) n[t] = i.prototype[t]; return n } } (e.exports = i).prototype.on = i.prototype.addEventListener = function(e, t) { return this._callbacks = this._callbacks || {}, (this._callbacks["$" + e] = this._callbacks["$" + e] || []).push(t), this } , i.prototype.once = function(e, t) { function n() { this.off(e, n), t.apply(this, arguments) } return n.fn = t, this.on(e, n), this } , i.prototype.off = i.prototype.removeListener = i.prototype.removeAllListeners = i.prototype.removeEventListener = function(e, t) { if (this._callbacks = this._callbacks || {}, 0 == arguments.length) this._callbacks = {}; else { var n = this._callbacks["$" + e]; if (n) if (1 == arguments.length) delete this._callbacks["$" + e]; else { for (var i, o = 0; o < n.length; o++) if ((i = n[o]) === t || i.fn === t) { n.splice(o, 1); break } 0 === n.length && delete this._callbacks["$" + e] } } return this } , i.prototype.emit = function(e) { this._callbacks = this._callbacks || {}; for (var t = new Array(arguments.length - 1), n = this._callbacks["$" + e], i = 1; i < arguments.length; i++) t[i - 1] = arguments[i]; if (n) for (var i = 0, o = (n = n.slice(0)).length; i < o; ++i) n[i].apply(this, t); return this } , i.prototype.listeners = function(e) { return this._callbacks = this._callbacks || {}, this._callbacks["$" + e] || [] } , i.prototype.hasListeners = function(e) { return !!this.listeners(e).length } }) , transport = Transport; function Transport(e) { this.path = e.path, this.hostname = e.hostname, this.port = e.port, this.secure = e.secure, this.query = e.query, this.timestampParam = e.timestampParam, this.timestampRequests = e.timestampRequests, this.readyState = "", this.agent = e.agent || !1, this.socket = e.socket, this.enablesXDR = e.enablesXDR, this.withCredentials = e.withCredentials, this.pfx = e.pfx, this.key = e.key, this.passphrase = e.passphrase, this.cert = e.cert, this.ca = e.ca, this.ciphers = e.ciphers, this.rejectUnauthorized = e.rejectUnauthorized, this.forceNode = e.forceNode, this.isReactNative = e.isReactNative, this.extraHeaders = e.extraHeaders, this.localAddress = e.localAddress } componentEmitter$1(Transport.prototype), Transport.prototype.onError = function(e, t) { e = new Error(e); return e.type = "TransportError", e.description = t, this.emit("error", e), this } , Transport.prototype.open = function() { return "closed" !== this.readyState && "" !== this.readyState || (this.readyState = "opening", this.doOpen()), this } , Transport.prototype.close = function() { return "opening" !== this.readyState && "open" !== this.readyState || (this.doClose(), this.onClose()), this } , Transport.prototype.send = function(e) { if ("open" !== this.readyState) throw new Error("Transport not open"); this.write(e) } , Transport.prototype.onOpen = function() { this.readyState = "open", this.writable = !0, this.emit("open") } , Transport.prototype.onData = function(e) { e = browser$1.decodePacket(e, this.socket.binaryType); this.onPacket(e) } , Transport.prototype.onPacket = function(e) { this.emit("packet", e) } , Transport.prototype.onClose = function() { this.readyState = "closed", this.emit("close") } ; var encode$2 = function(e) { var t, n = ""; for (t in e) e.hasOwnProperty(t) && (n.length && (n += "&"), n += encodeURIComponent(t) + "=" + encodeURIComponent(e[t])); return n }, decode$2 = function(e) { for (var t = {}, n = e.split("&"), i = 0, o = n.length; i < o; i++) { var r = n[i].split("="); t[decodeURIComponent(r[0])] = decodeURIComponent(r[1]) } return t }, parseqs$1 = { encode: encode$2, decode: decode$2 }, componentInherit = function(e, t) { function n() {} n.prototype = t.prototype, e.prototype = new n, e.prototype.constructor = e }, alphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""), length = 64, map = {}, seed = 0, i = 0, prev; function encode$1(e) { for (var t = ""; t = alphabet[e % length] + t, 0 < (e = Math.floor(e / length)); ) ; return t } function decode$1(e) { var t = 0; for (i = 0; i < e.length; i++) t = t * length + map[e.charAt(i)]; return t } function yeast() { var e = encode$1(+new Date); return e !== prev ? (seed = 0, prev = e) : e + "." + encode$1(seed++) } for (; i < length; i++) map[alphabet[i]] = i; yeast.encode = encode$1, yeast.decode = decode$1; var yeast_1 = yeast , s = 1e3 , m = 60 * s , h = 60 * m , d = 24 * h , y = 365.25 * d , ms = function(e, t) { t = t || {}; var n = _typeof(e); if ("string" === n && 0 < e.length) return parse$1(e); if ("number" === n && !1 === isNaN(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$1(e) { if (!(100 < (e = String(e)).length)) { e = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|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 "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) { return d <= e ? Math.round(e / d) + "d" : h <= e ? Math.round(e / h) + "h" : m <= e ? Math.round(e / m) + "m" : s <= e ? Math.round(e / s) + "s" : e + "ms" } function fmtLong(e) { return plural(e, d, "day") || plural(e, h, "hour") || plural(e, m, "minute") || plural(e, s, "second") || e + " ms" } function plural(e, t, n) { if (!(e < t)) return e < 1.5 * t ? Math.floor(e / t) + " " + n : Math.ceil(e / t) + " " + n + "s" } var debug$5 = createCommonjsModule(function(e, c) { function t(e) { var s; function a() { if (a.enabled) { for (var i = a, e = +new Date, t = e - (s || e), o = (i.diff = t, i.prev = s, i.curr = e, s = e, new Array(arguments.length)), n = 0; n < o.length; n++) o[n] = arguments[n]; o[0] = c.coerce(o[0]), "string" != typeof o[0] && o.unshift("%O"); var r = 0; o[0] = o[0].replace(/%([a-zA-Z%])/g, function(e, t) { var n; return "%%" !== e && (r++, "function" == typeof (t = c.formatters[t])) && (n = o[r], e = t.call(i, n), o.splice(r, 1), r--), e }), c.formatArgs.call(i, o), (a.log || c.log || void 0).apply(i, o) } } return a.namespace = e, a.enabled = c.enabled(e), a.useColors = c.useColors(), a.color = function(e) { var t, n = 0; for (t in e) n = (n << 5) - n + e.charCodeAt(t), n |= 0; return c.colors[Math.abs(n) % c.colors.length] }(e), a.destroy = n, "function" == typeof c.init && c.init(a), c.instances.push(a), a } function n() { var e = c.instances.indexOf(this); return -1 !== e && (c.instances.splice(e, 1), !0) } (c = e.exports = t.debug = t.default = t).coerce = function(e) { return e instanceof Error ? e.stack || e.message : e } , c.disable = function() { c.enable("") } , c.enable = function(e) { c.save(e), c.names = [], c.skips = []; var t, n = ("string" == typeof e ? e : "").split(/[\s,]+/), i = n.length; for (t = 0; t < i; t++) n[t] && ("-" === (e = n[t].replace(/\*/g, ".*?"))[0] ? c.skips.push(new RegExp("^" + e.substr(1) + "$")) : c.names.push(new RegExp("^" + e + "$"))); for (t = 0; t < c.instances.length; t++) { var o = c.instances[t]; o.enabled = c.enabled(o.namespace) } } , c.enabled = function(e) { if ("*" === e[e.length - 1]) return !0; var t, n; for (t = 0, n = c.skips.length; t < n; t++) if (c.skips[t].test(e)) return !1; for (t = 0, n = c.names.length; t < n; t++) if (c.names[t].test(e)) return !0; return !1 } , c.humanize = ms, c.instances = [], c.names = [], c.skips = [], c.formatters = {} }) , browser = createCommonjsModule(function(e, o) { function t() { var e; try { e = o.storage.debug } catch (e) {} return e = !e && "undefined" != typeof process && "env"in process ? process.env.DEBUG : e } (o = e.exports = debug$5).log = function() { return "object" === ("undefined" == typeof console ? "undefined" : _typeof(console)) && console.log && Function.prototype.apply.call(console.log, console, arguments) } , o.formatArgs = function(e) { var t, n, i = this.useColors; e[0] = (i ? "%c" : "") + this.namespace + (i ? " %c" : " ") + e[0] + (i ? "%c " : " ") + "+" + o.humanize(this.diff), i && (i = "color: " + this.color, e.splice(1, 0, i, "color: inherit"), e[n = t = 0].replace(/%[a-zA-Z%]/g, function(e) { "%%" !== e && (t++, "%c" === e) && (n = t) }), e.splice(n, 0, i)) } , o.save = function(e) { try { null == e ? o.storage.removeItem("debug") : o.storage.debug = e } catch (e) {} } , o.load = t, o.useColors = function() { if ("undefined" != typeof window && window.process && "renderer" === window.process.type) 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+)/) } , o.storage = "undefined" != typeof chrome && void 0 !== chrome.storage ? chrome.storage.local : function() { try { return window.localStorage } catch (e) {} }(), o.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"], o.formatters.j = function(e) { try { return JSON.stringify(e) } catch (e) { return "[UnexpectedJSONParseError]: " + e.message } } , o.enable(t()) }) , debug$4 = browser("engine.io-client:polling") , polling$1 = Polling , hasXHR2 = null != new xmlhttprequest({ xdomain: !1 }).responseType; function Polling(e) { var t = e && e.forceBase64; hasXHR2 && !t || (this.supportsBinary = !1), transport.call(this, e) } componentInherit(Polling, transport), Polling.prototype.name = "polling", Polling.prototype.doOpen = function() { this.poll() } , Polling.prototype.pause = function(e) { var t, n = this; function i() { debug$4("paused"), n.readyState = "paused", e() } this.readyState = "pausing", this.polling || !this.writable ? (t = 0, this.polling && (debug$4("we are currently polling - waiting to pause"), t++, this.once("pollComplete", function() { debug$4("pre-pause polling complete"), --t || i() })), this.writable || (debug$4("we are currently writing - waiting to pause"), t++, this.once("drain", function() { debug$4("pre-pause writing complete"), --t || i() }))) : i() } , Polling.prototype.poll = function() { debug$4("polling"), this.polling = !0, this.doPoll(), this.emit("poll") } , Polling.prototype.onData = function(e) { var i = this; debug$4("polling got data %s", e); browser$1.decodePayload(e, this.socket.binaryType, function(e, t, n) { if ("opening" === i.readyState && i.onOpen(), "close" === e.type) return i.onClose(), !1; i.onPacket(e) }), "closed" !== this.readyState && (this.polling = !1, this.emit("pollComplete"), "open" === this.readyState ? this.poll() : debug$4('ignoring poll - transport state "%s"', this.readyState)) } , Polling.prototype.doClose = function() { var e = this; function t() { debug$4("writing close packet"), e.write([{ type: "close" }]) } "open" === this.readyState ? (debug$4("transport open - closing"), t()) : (debug$4("transport not open - deferring close"), this.once("open", t)) } , Polling.prototype.write = function(e) { function t() { n.writable = !0, n.emit("drain") } var n = this; this.writable = !1; browser$1.encodePayload(e, this.supportsBinary, function(e) { n.doWrite(e, t) }) } , Polling.prototype.uri = function() { var e = this.query || {} , t = this.secure ? "https" : "http" , n = ""; return !1 !== this.timestampRequests && (e[this.timestampParam] = yeast_1()), this.supportsBinary || e.sid || (e.b64 = 1), e = parseqs$1.encode(e), this.port && ("https" == t && 443 !== Number(this.port) || "http" == t && 80 !== Number(this.port)) && (n = ":" + this.port), e.length && (e = "?" + e), t + "://" + (-1 !== this.hostname.indexOf(":") ? "[" + this.hostname + "]" : this.hostname) + n + this.path + e } ; var debug$3 = browser("engine.io-client:polling-xhr"), pollingXhr = XHR, Request_1 = Request, terminationEvent; function empty$2() {} function XHR(e) { var t, n; polling$1.call(this, e), this.requestTimeout = e.requestTimeout, this.extraHeaders = e.extraHeaders, "undefined" != typeof location && (t = "https:" === location.protocol, n = (n = location.port) || (t ? 443 : 80), this.xd = "undefined" != typeof location && e.hostname !== location.hostname || n !== e.port, this.xs = e.secure !== t) } function Request(e) { this.method = e.method || "GET", this.uri = e.uri, this.xd = !!e.xd, this.xs = !!e.xs, this.async = !1 !== e.async, this.data = void 0 !== e.data ? e.data : null, this.agent = e.agent, this.isBinary = e.isBinary, this.supportsBinary = e.supportsBinary, this.enablesXDR = e.enablesXDR, this.withCredentials = e.withCredentials, this.requestTimeout = e.requestTimeout, this.pfx = e.pfx, this.key = e.key, this.passphrase = e.passphrase, this.cert = e.cert, this.ca = e.ca, this.ciphers = e.ciphers, this.rejectUnauthorized = e.rejectUnauthorized, this.extraHeaders = e.extraHeaders, this.create() } function unloadHandler() { for (var e in Request.requests) Request.requests.hasOwnProperty(e) && Request.requests[e].abort() } componentInherit(XHR, polling$1), XHR.prototype.supportsBinary = !0, XHR.prototype.request = function(e) { return (e = e || {}).uri = this.uri(), e.xd = this.xd, e.xs = this.xs, e.agent = this.agent || !1, e.supportsBinary = this.supportsBinary, e.enablesXDR = this.enablesXDR, e.withCredentials = this.withCredentials, e.pfx = this.pfx, e.key = this.key, e.passphrase = this.passphrase, e.cert = this.cert, e.ca = this.ca, e.ciphers = this.ciphers, e.rejectUnauthorized = this.rejectUnauthorized, e.requestTimeout = this.requestTimeout, e.extraHeaders = this.extraHeaders, new Request(e) } , XHR.prototype.doWrite = function(e, t) { var e = this.request({ method: "POST", data: e, isBinary: "string" != typeof e && void 0 !== e }) , n = this; e.on("success", t), e.on("error", function(e) { n.onError("xhr post error", e) }), this.sendXhr = e } , XHR.prototype.doPoll = function() { debug$3("xhr poll"); var e = this.request() , t = this; e.on("data", function(e) { t.onData(e) }), e.on("error", function(e) { t.onError("xhr poll error", e) }), this.pollXhr = e } , componentEmitter$1(Request.prototype), Request.prototype.create = function() { var e = { agent: this.agent, xdomain: this.xd, xscheme: this.xs, enablesXDR: this.enablesXDR } , t = (e.pfx = this.pfx, e.key = this.key, e.passphrase = this.passphrase, e.cert = this.cert, e.ca = this.ca, e.ciphers = this.ciphers, e.rejectUnauthorized = this.rejectUnauthorized, this.xhr = new xmlhttprequest(e)) , n = this; try { debug$3("xhr open %s: %s", this.method, this.uri), t.open(this.method, this.uri, this.async); try { if (this.extraHeaders) for (var i in t.setDisableHeaderCheck && t.setDisableHeaderCheck(!0), this.extraHeaders) this.extraHeaders.hasOwnProperty(i) && t.setRequestHeader(i, this.extraHeaders[i]) } catch (e) {} if ("POST" === this.method) try { this.isBinary ? t.setRequestHeader("Content-type", "application/octet-stream") : t.setRequestHeader("Content-type", "text/plain;charset=UTF-8") } catch (e) {} try { t.setRequestHeader("Accept", "*/*") } catch (e) {} "withCredentials"in t && (t.withCredentials = this.withCredentials), this.requestTimeout && (t.timeout = this.requestTimeout), this.hasXDR() ? (t.onload = function() { n.onLoad() } , t.onerror = function() { n.onError(t.responseText) } ) : t.onreadystatechange = function() { if (2 === t.readyState) try { var e = t.getResponseHeader("Content-Type"); (n.supportsBinary && "application/octet-stream" === e || "application/octet-stream; charset=UTF-8" === e) && (t.responseType = "arraybuffer") } catch (e) {} 4 === t.readyState && (200 === t.status || 1223 === t.status ? n.onLoad() : setTimeout(function() { n.onError("number" == typeof t.status ? t.status : 0) }, 0)) } , debug$3("xhr data %s", this.data), t.send(this.data) } catch (e) { return void setTimeout(function() { n.onError(e) }, 0) } "undefined" != typeof document && (this.index = Request.requestsCount++, Request.requests[this.index] = this) } , Request.prototype.onSuccess = function() { this.emit("success"), this.cleanup() } , Request.prototype.onData = function(e) { this.emit("data", e), this.onSuccess() } , Request.prototype.onError = function(e) { this.emit("error", e), this.cleanup(!0) } , Request.prototype.cleanup = function(e) { if (void 0 !== this.xhr && null !== this.xhr) { if (this.hasXDR() ? this.xhr.onload = this.xhr.onerror = empty$2 : this.xhr.onreadystatechange = empty$2, e) try { this.xhr.abort() } catch (e) {} "undefined" != typeof document && delete Request.requests[this.index], this.xhr = null } } , Request.prototype.onLoad = function() { var e, t; try { try { t = this.xhr.getResponseHeader("Content-Type") } catch (e) {} e = ("application/octet-stream" === t || "application/octet-stream; charset=UTF-8" === t) && this.xhr.response || this.xhr.responseText } catch (e) { this.onError(e) } null != e && this.onData(e) } , Request.prototype.hasXDR = function() { return "undefined" != typeof XDomainRequest && !this.xs && this.enablesXDR } , Request.prototype.abort = function() { this.cleanup() } , Request.requestsCount = 0, Request.requests = {}, "undefined" != typeof document && ("function" == typeof attachEvent ? attachEvent("onunload", unloadHandler) : "function" == typeof addEventListener && (terminationEvent = "onpagehide"in globalThis_browser ? "pagehide" : "unload", addEventListener(terminationEvent, unloadHandler, !1))), pollingXhr.Request = Request_1; var pollingJsonp = JSONPPolling, rNewline = /\n/g, rEscapedNewline = /\\n/g, callbacks; function empty$1() {} function JSONPPolling(e) { polling$1.call(this, e), this.query = this.query || {}, callbacks = callbacks || (globalThis_browser.___eio = globalThis_browser.___eio || []), this.index = callbacks.length; var t = this; callbacks.push(function(e) { t.onData(e) }), this.query.j = this.index, "function" == typeof addEventListener && addEventListener("beforeunload", function() { t.script && (t.script.onerror = empty$1) }, !1) } componentInherit(JSONPPolling, polling$1), JSONPPolling.prototype.supportsBinary = !1, JSONPPolling.prototype.doClose = function() { this.script && (this.script.parentNode.removeChild(this.script), this.script = null), this.form && (this.form.parentNode.removeChild(this.form), this.form = null, this.iframe = null), polling$1.prototype.doClose.call(this) } , JSONPPolling.prototype.doPoll = function() { var t = this , e = document.createElement("script") , n = (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) } , document.getElementsByTagName("script")[0]); n ? n.parentNode.insertBefore(e, n) : (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) } , JSONPPolling.prototype.doWrite = function(e, t) { var n, i, o, r, s = this; function a() { c(), t() } function c() { if (s.iframe) try { s.form.removeChild(s.iframe) } catch (e) { s.onError("jsonp polling iframe removal error", e) } try { var e = '